Skip to main content
100%

Let's make a face with D3.js!

✓ Published2🌍 Public
Bblenderenderer
Last edited Jan 28, 2021
Created on Jan 26, 2021

A yellow smiley face is built entirely from SVG shapes, with D3.js selecting the root `<svg>` element and appending circles, rectangles, and a path for the mouth. The eyebrows are two rectangles that animate vertically using chained `transition().duration()` calls, moving up and then back down repeatedly. The face is centered via a translated `<g>` group, and the mouth is generated with the `arc()` helper from D3's `d3-shape` module. The code relies on D3 v6 and plain DOM manipulation without any external data source.

AI-generated description

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

MIT Licensed

Similar vizzes