Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
Jjustprophet
Last edited Dec 4, 2018
Created on Dec 4, 2018

This example demonstrates fundamental DOM manipulation with D3.js by constructing a smiley face from SVG primitives: a yellow circle, two eyes, a mouth drawn with `d3.arc`, and rectangular eyebrows. The face is centered in an SVG canvas via a `g` element and coordinate transforms. The eyebrows animate using chained `transition().duration()` calls, moving up and down over two-second intervals. The code relies on D3 v5 selection, attribute setting, and transition APIs to mutate SVG elements directly.

AI-generated description

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

MIT Licensed

Similar vizzes