Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
VVinh H. Le
Last edited Apr 30, 2020
Created on Apr 27, 2020

A yellow smiley face with animated eyebrows is drawn in an SVG canvas using D3.js. The code demonstrates fundamental DOM manipulation by appending circles, rectangles, and an arc-based mouth path through method chaining. It uses D3’s `select`, `attr`, and `append` APIs, with a `transition` and duration to move the eyebrow group up and down repeatedly. The face is centered via a translated `<g>` element, and dimensions are parsed from the SVG attributes. Static shapes initialize the face, then the eyebrow transition adds motion.

AI-generated description

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

MIT Licensed

Similar vizzes