Skip to main content
100%

Let's make a face with D3.js!

✓ Published2🌍 Public
Hhpies
Last edited Nov 21, 2019
Created on Nov 21, 2019

A face constructed from SVG shapes uses the D3.js `select` and `append` API to assemble a yellow circle, eyes, eyebrows, and an arc-based mouth. The code builds the figure by translating groups into position, then animates the eyebrows with a chained `transition().attr` call that moves them up and down over two seconds. The static geometry relies on D3's `arc()` generator for the mouth path, while the animation drives the two eyebrow rectangles through repeated attribute transitions.

AI-generated description

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

MIT Licensed

Similar vizzes