Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
WWesley Clark
Last edited Sep 13, 2019
Created on Sep 13, 2019

A yellow smiley face rendered with SVG takes center stage, its eyebrows raising and lowering in a looping two-second transition. The example introduces fundamental DOM manipulation with D3.js v5, using `d3.select`, `d3.append`, and `d3.arc` to construct the face from circles, rectangles, and a path. The code explicitly sets SVG attributes like `r`, `cx`, and `transform`, and animates the eyebrow group via chained `transition().duration(2000)` calls. No external data source is used; the face is purely generated from hardcoded dimensions.

AI-generated description

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

MIT Licensed

Similar vizzes