Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
KKrister
Last edited Apr 20, 2020
Created on Apr 6, 2020

This example uses D3.js to build an animated smiley face with SVG elements, demonstrating fundamental DOM manipulation and transitions. Circles form the yellow head and eyes, while rectangles serve as eyebrows that move via chained `transition` calls. A black mouth is drawn using `d3.arc`, with its shape morphing between smile and frown through `attrTween` and an interpolator. The code relies on D3 v5’s selection methods, `arc`, and transition API to animate the facial features in sequence.

AI-generated description

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

MIT Licensed

Similar vizzes