Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Lliunaiming
Last edited Jul 19, 2019
Created on Jul 19, 2019

This example uses D3.js to build an animated smiley face in SVG, whose eyebrows lift and lower in a looping transition. It shows fundamental DOM manipulation by selecting an SVG element, appending grouped shapes, and binding attributes for the face’s circles, rectangles, and an arc-based mouth. The animation relies on chained `transition().duration()` calls to move the eyebrow group’s transform. Specific APIs include `select`, `append`, `attr`, and `arc` from D3 v5, with coordinates computed from hardcoded spacing and offset values.

AI-generated description

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

MIT Licensed

Similar vizzes