Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
MMartin Lord
Last edited Apr 15, 2020
Created on Apr 15, 2020

This example creates a smiling face from basic SVG shapes, with its eyebrows repeatedly moving up and down. It demonstrates fundamental D3.js DOM manipulation by appending and styling circles, rectangles, and a path for the mouth. The code uses `d3.select`, `d3.arc` for the mouth, and chained `transition().duration()` calls to animate the eyebrow group’s transform attribute. The face is centered via a translated `<g>` element, with eye spacing and offsets defined as numeric constants.

AI-generated description

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

MIT Licensed

Similar vizzes