Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
Mmirna981
Last edited Oct 10, 2019
Created on Oct 10, 2019

This example builds a smiling face in SVG using D3.js v5, showing fundamental DOM manipulation with selections and SVG shape elements. It draws a yellow circle for the head, two eyes, eyebrows as rectangles, and a mouth created with `d3.arc()`. The animation uses `transition().duration()` to move the eyebrow group up and down repeatedly, demonstrating chained transitions over a two-second interval. The page is set up with a simple HTML structure and imports D3 via a CDN, with all elements positioned relative to the SVG center.

AI-generated description

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

MIT Licensed

Similar vizzes