Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
MMMoronto
Last edited Oct 4, 2019
Created on Oct 4, 2019

A smiley face built with D3.js demonstrates core DOM manipulation through SVG elements, including circles for the eyes, rectangles for eyebrows, and an arc-generated mouth. Animated transitions move the eyebrows upward and back down over two-second intervals, showing how `transition().duration()` sequences chained animations. The face is centered using SVG group transforms, while D3 v5’s `select` and `arc` APIs handle element selection and path generation. The example highlights fundamental D3 concepts like attribute setting, coordinate positioning, and timed state changes within a static SVG canvas.

AI-generated description

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

MIT Licensed

Similar vizzes