🌍 Public
Viewing a saved revision (read-only)
a5dcfaa4fdfa46168a0316b9c26bc10f
Let's make a face with D3.js!
This example uses D3.js (v5) to construct an animated smiley face entirely through SVG primitives and DOM manipulation. It shows how a face composed of a circle, eyes, eyebrows, and a mouth can be built and animated on an empty 960x500 SVG canvas. The code demonstrates chained `transition().duration()` calls to move the left eyebrow up and down over two seconds, while the right eyebrow is a rectangle and the mouth is an arc path generated with the `d3.arc` API. All elements are positioned through SVG attributes and groups, with no external data—the face is purely synthetic.
AI-generated descriptionDemonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.