Skip to main content
100%

Fork of Let's make a face with D3.js!

✓ Published0🌍 Public
AAlmatrom
Last edited Mar 10, 2022
Created on Mar 10, 2022

This example uses D3.js to build an animated smiley face in SVG, with eyebrows that rise and fall in a repeating cycle. The code constructs the face by appending SVG circles, a path for the mouth, and rectangles for the eyebrows, then applies chained transitions to move the eyebrow group. D3’s `select` and `arc` APIs handle DOM selection and mouth shape generation, while the animation relies on `transition` with a two-second duration for each movement phase. The face is centered within a 960-by-500 SVG canvas.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

MIT Licensed

Similar vizzes