Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
SSH
Last edited Apr 18, 2019
Created on Apr 18, 2019

A smiley face is drawn entirely with D3.js SVG elements, including a yellow circle for the head, two eyes, and an arc-based mouth. The example demonstrates fundamental DOM manipulation by appending and styling shapes, then animates the eyebrows with a chained `transition().duration()` that moves them up and down. It uses `d3.select` to target the SVG, `d3.arc` to generate the mouth path, and attribute setters like `.attr()` to position each component relative to a centered group. The animation runs once on load, with no user interaction.

AI-generated description

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

MIT Licensed

Similar vizzes