Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
EEL MAHI Moncef
Last edited Mar 28, 2019
Created on Mar 28, 2019

D3.js constructs an animated smiley face by manipulating SVG shapes. A yellow circle forms the head, with two static eyes and a mouth drawn using the `arc` path generator. The eyebrows, rendered as rectangles, animate upward and downward over two seconds using chained `transition().duration()` calls on the SVG group, demonstrating fundamental DOM selection and attribute mutation. The code uses the `select` API to target the root SVG element.

AI-generated description

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

MIT Licensed

Similar vizzes