Skip to main content
100%

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

✓ Published0🌍 Public
TTejaswicmandava
Last edited Feb 21, 2023
Created on Feb 21, 2023

This example demonstrates how to create an animated smiley face using D3.js selections and SVG elements. The face consists of a green circle, two eyes, a mouth drawn with `d3.arc`, and rectangular eyebrows that translate vertically through chained `transition.duration` calls. The code uses D3 v5's `select`, `arc`, and `.attr` methods to manipulate the DOM. By appending SVG shapes to a centered group and applying coordinate transforms, the animation shows eyebrows moving independently while the rest of the face remains static.

AI-generated description

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

MIT Licensed

Similar vizzes