Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Ssathesujit
Last edited Aug 7, 2020
Created on Aug 7, 2020

This example demonstrates fundamental DOM manipulation with D3.js by constructing a smiley face from SVG shapes, with animated eyebrows that move upward and downward. The face is drawn entirely through D3 selections and attribute assignments, using `d3.select` to target the SVG element and chain methods like `.append` and `.attr` to build the circles and lines. The eyebrows animate via a recurring `setInterval` that toggles their vertical position, showcasing how D3 can update existing elements. Rendering is purely SVG-based, with styling handled by an external stylesheet that hides overflow for a clean presentation.

AI-generated description

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

MIT Licensed

Similar vizzes