Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
EElora-dev
Last edited Jul 19, 2020
Created on Jul 19, 2020

This example demonstrates how D3.js can build an animated smiley face using fundamental DOM manipulation. The face includes a yellow circle, eyes, eyebrows, and a mouth. Using `d3.select` and chained methods like `.append` and `.attr`, the code constructs SVG elements and groups them with translations. The eyebrows animate via `transition()` with a 2000-millisecond duration, moving up and down repeatedly. The mouth is drawn using the `d3.arc()` helper to generate a path. The visualization relies entirely on SVG rendering and D3 v5.

AI-generated description

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

MIT Licensed

Similar vizzes