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 stars1🌍 Public
Ddarshue
Last edited Jan 30, 2020
Created on Jan 30, 2020

This example demonstrates fundamental DOM manipulation with D3.js by building a smiling face from scratch. The code constructs the face using basic SVG shapes—circles for the eyes, rectangles for the eyebrows, and a path generated with the `arc` generator for the mouth—all centered within an SVG canvas. A sequential `transition` on the eyebrows group animates the eyebrows upward and back over two seconds each way, creating a simple expressive motion. The script uses D3’s `select` and `append` to build the hierarchical structure, and the animation relies on D3’s built-in transition system.

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