Skip to main content
100%

Fork of Let's make a face with D3.js!

✓ Published0🌍 Public
Aakhil kata
Last edited Jun 18, 2022
Created on Jun 18, 2022

This example animates a smiley face built with SVG, showing its eyebrows moving up and down while the rest of the face remains static. It demonstrates fundamental D3.js DOM manipulation by constructing the face from basic shapes—circles for eyes, rectangles for eyebrows, and arcs for the nose and mouth—using a d3 selection and the `arc` helper. The eyebrow motion is driven by chained `transition.duration(0)` calls that instantly shift the group’s transform attribute. The code uses d3 v5 and orchestrates all elements within a centered SVG group.

AI-generated description

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

MIT Licensed

Similar vizzes