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)

1a03d21760104e67a3fbd953584c8be8

Let's make a face with D3.js!

0 stars0🌍 Public
Pprudhvirajmudunuri
Last edited Jul 2, 2019
Created on Jul 2, 2019

A static SVG smiley face is drawn with D3.js using primitive shapes: circles for the face and eyes, rectangles for the eyebrows, and an arc for the mouth. The example demonstrates DOM manipulation and chained transitions, as the code applies a two-second `transition().duration(2000)` to animate the eyebrows moving up and then back down. All elements are positioned relative to the SVG center via a `g` transform, showing fundamental D3 selection and attribute methods.

AI-generated description

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