Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a face with D3.js!

Public visualization

Viewing a saved revision (read-only)

b2cb52d8c0a64af18757e025c1ab6848

Let's make a face with D3.js!

0 stars1🌍 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.