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)

25b2953f3f34438da46f8adc05013d67

Let's make a face with D3.js!

0 stars0🌍 Public
TThiago Ramos
Last edited May 12, 2020
Created on May 12, 2020

A smiley face with animated eyebrows demonstrates basic DOM manipulation with D3.js. The visualization renders SVG shapes—a yellow circle, eyes, rectangular eyebrows, and an arc-based mouth—centered on a 960×500 canvas. Using `d3.select` and `d3.arc`, the code constructs each facial feature programmatically. A chained `transition` with 2000-millisecond durations moves the eyebrow group upward and back, creating a blinking-like motion. The example showcases fundamental D3 v5 selections, attribute setting, and animation without external data, relying purely on geometric constants for positioning.

AI-generated description

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