Let's make a face with D3.js!
✓ Published0🌍 Public
This example shows a smiley face built entirely with D3.js SVG elements, whose eyebrows animate upward and then return to their original position. The face is constructed using `select` and `append` to create a yellow circle for the head, two circles for the eyes, rectangles for the eyebrows, and a mouth path drawn with the `arc` helper. The animated eyebrow movement is driven by chained `transition` calls with a 2-second duration, using `attr` to update the transform translation. The code renders to a static SVG canvas and relies on D3 v5, with all geometry defined through explicit pixel offsets.
AI-generated descriptionDemonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.
MIT Licensed