Let's make a face with D3.js
✓ Published0🌍 Public
This example shows a simple cartoon face built from three circles—a yellow head and two black eyes—rendered as SVG. The face is centered within a 960x500 viewport, with eye positions fixed relative to the center. Using D3 v6’s `select` and `append` API, the code reads the SVG’s width and height attributes to compute coordinates dynamically. No data is loaded; instead, dimensions are derived from the SVG element itself, with eye spacing and vertical offset hardcoded. The styling comes from a minimal external stylesheet that removes page margins.
AI-generated descriptionReact Starter code.
MIT Licensed