Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
VVincent Ko
Last edited Feb 17, 2019
Created on Feb 17, 2019

This example draws a yellow smiley face in SVG using D3.js, with circular eyes, rectangular eyebrows, and an arc-based mouth composed via the `d3.arc` helper. The face is centered by translating a group element to the middle of the viewport. The primary behavior is an animated eyebrow raise: the eyebrow group undergoes two sequential 2-second transitions using `transition.duration`, moving upward and then returning to its original vertical offset. The code demonstrates fundamental DOM selection, attribute setting, and chained transitions through D3's select and append methods.

AI-generated description

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

MIT Licensed

Similar vizzes