Skip to main content
100%

Let's make a face with D3.js!

✓ Published2🌍 Public
Jjulieducasse
Last edited Sep 27, 2019
Created on Sep 19, 2019

A smiley face rendered in SVG with D3.js v5 demonstrates fundamental DOM manipulation through animated eyebrow movement. The face, eyes, and eyebrows are drawn as SVG circles using d3.select and d3.append, with the eyebrow positions controlled by coordinate offsets. The face circle triggers a recursive animation via addEvents and transition.attr, moving the entire face group vertically over two seconds before reversing direction. The example uses D3's selection.transition with .duration and .on("end") callbacks to create a continuous bobbing motion, showing how to build and animate SVG elements without external data.

AI-generated description

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

MIT Licensed

Similar vizzes