Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
Ssourcebox-bug
Last edited Apr 10, 2019
Created on Apr 10, 2019

This example shows a yellow smiley face with eyes, eyebrows, and a mouth built from SVG shapes using D3.js. The face is centered in an SVG canvas, with a circle for the head, two circles for eyes, rectangles for eyebrows, and an arc-generated path for the mouth. D3’s `selection.append`, `attr`, and `transition` APIs animate the eyebrows by shifting their group’s transform down and back over two two-second intervals. The code imports `select` and `arc` from the d3 module and uses chained transitions to create the movement.

AI-generated description

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

MIT Licensed

Similar vizzes