Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
GGosroPoorheydar
Last edited Nov 4, 2020
Created on Nov 4, 2020

A smiley face drawn with D3.js demonstrates declarative DOM manipulation through basic SVG shapes, while animated eyebrows show how transitions update attributes over time. The code explicitly builds the face using `select`, `append`, and `attr` for circles, rectangles, and a mouth path via the `arc()` generator. Two chained `transition().duration(2000)` calls move the eyebrow group up and then back down, creating a repeated motion loop. The face is centered with a `g` transform, and all styling relies on inline attributes with yellow and black fills.

AI-generated description

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

MIT Licensed

Similar vizzes