Skip to main content
100%

Let's make a face with D3.js!

✓ Published2🌍 Public
Zzahrus
Last edited Apr 7, 2019
Created on Apr 7, 2019

An animated smiley face built with D3.js v5 demonstrates fundamental DOM manipulation through SVG rendering. The example uses `d3.select` to append shapes—circles for the eyes, rectangles for eyebrows, and an `arc()` path for the mouth—arranged with explicit X/Y coordinates and `attr` transforms. A two-stage `transition().duration(2000)` chain moves the entire eyebrow group up and then back down, creating a subtle raising-and-lowering animation. No external data is loaded; all geometry is hand-coded, and the interaction is purely visual.

AI-generated description

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

MIT Licensed

Similar vizzes