Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Bbilibili
Last edited Jun 10, 2020
Created on Jun 10, 2020

This example shows a yellow smiley face with eyes, eyebrows, and a mouth, rendered as SVG shapes. The eyebrows animate by moving up and down through a sequence of d3.transition() calls, each lasting 2000 milliseconds. The code builds the face by appending circle, rect, and path elements to the SVG, using D3.js v5 selection and arc() to define the mouth’s curved shape. The animation demonstrates fundamental DOM manipulation with D3’s append and attr methods.

AI-generated description

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

MIT Licensed

Similar vizzes