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)

b8dfa8215fdd46e5b2fab47a8c1a7063

Let's make a face with D3.js!

0 stars2🌍 Public
AAndrew Yan
Last edited Jun 4, 2020
Created on Jun 4, 2020

This gallery example builds a yellow smiley face in an SVG canvas using D3.js v5. The face is assembled from primitive shapes—circles for the head and eyes, rectangles for eyebrows, and a path for the mouth—all positioned via D3’s `select` and `append` methods. The animation uses D3’s `transition` API to move the eyebrows up and down over two seconds, demonstrating basic DOM manipulation and chained transitions. The code defines all geometry explicitly without external data, relying on D3’s `arc` generator for the mouth’s curved path.

AI-generated description

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