Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a face with D3.js!

Public visualization

Let's make a face with D3.js!

0 stars0🌍 Public
Mmic-bai
Last edited Jun 4, 2020
Created on Jun 4, 2020

This D3.js v5 example builds an animated smiley face from scratch using SVG shapes. The sketch programmatically constructs a yellow circle for the face, black eyes, rectangular eyebrows, and an arc path for the mouth on a 960-by-500 canvas. Using D3's selection and transition APIs, the code animates the eyebrow group's vertical position in a repeating two-second cycle, moving it up 50 pixels and back. The example demonstrates fundamental DOM manipulation, including `select`, `append`, `attr`, and chained `transition().duration()` calls, to create a simple, lively character.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed