Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Tthanhtrant219
Last edited Apr 15, 2020
Created on Apr 15, 2020

A smiling face is drawn using D3.js v5 with SVG shapes, including a yellow circle for the head, eyes, eyebrows, and a mouth created with the `arc` generator. The eyebrows animate upward and back down over four seconds using chained `transition` and `attr` methods. The code demonstrates fundamental DOM manipulation by selecting the SVG, appending groups, and positioning elements via translation transforms. All coordinates and dimensions are computed from the SVG's width and height attributes.

AI-generated description

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

MIT Licensed

Similar vizzes