Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Vvaynexie
Last edited Dec 26, 2019
Created on Dec 26, 2019

A D3.js code example builds a yellow smiley face from SVG primitives, including a circular head, eyes, eyebrows, and a mouth created with the `d3.arc` path generator. The face is centered via a translated group, and the eyebrows are rectangles that move up and down using chained `transition()` calls with a two-second duration each. The demo relies on D3 v5's selection methods (`select`, `append`, `attr`) to construct the shape and animate its parts directly in the browser.

AI-generated description

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

MIT Licensed

Similar vizzes