Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 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.

MIT Licensed

Similar vizzes