Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Zztawil
Last edited Sep 8, 2020
Created on Sep 7, 2020

An animated smiley face is built from basic SVG shapes, with eyes that blink and eyebrows that raise and lower in a looping transition. The example demonstrates fundamental D3.js DOM manipulation by selecting the SVG canvas, appending a group, and positioning circles, rectangles, and a path for the mouth. Using chained `transition()` calls, the code animates the eyebrow’s transform attribute and the eye’s radius over two-second durations. The mouth is drawn with D3’s `arc` generator, and all elements are centered via SVG group transforms.

AI-generated description

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

MIT Licensed

Similar vizzes