Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Oosaka004
Last edited Mar 29, 2020
Created on Mar 29, 2020

This example builds a cartoon smiley face with animated eyebrows using D3.js. The SVG canvas is populated by selecting the root element and appending a group, then adding circles for the face, eyes, and a path for the mouth using the `arc()` generator. The code explicitly sets attributes like `r`, `cx`, `cy`, and `d` to position the shapes. The face appears centered, with the mouth drawn as a half-circle arc. The code relies on `d3.select` and `d3.arc` from the D3 v5 library, but no actual animation logic is present.

AI-generated description

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

MIT Licensed

Similar vizzes