Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
BBrittS6658
Last edited Oct 10, 2019
Created on Oct 10, 2019

A smiley face rendered in SVG with D3.js v5 demonstrates basic DOM manipulation and animation. The code uses D3's `select`, `append`, and `attr` methods to construct a face from circles, rectangles, and a path, with the mouth created using the `arc` function. Eyebrows animate by chaining `.transition().duration(2000)` calls to move their containing group vertically. The entire face is centered within a 960x500 SVG canvas using a translated group element.

AI-generated description

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

MIT Licensed

Similar vizzes