Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
DDavid Sjoberg
Last edited Nov 23, 2019
Created on Nov 23, 2019

This example uses D3.js v5 to construct an animated smiley face entirely with SVG elements. The face, eyes, and eyebrows are drawn using basic `circle` and `rect` shapes, while the mouth is created with the `arc` generator. Eyebrows move up and down through a recursive `transition` with `duration` and `on("end")` callbacks, and the mouth also transitions between arc shapes. The code demonstrates fundamental DOM manipulation and chained transitions with D3's selection API.

AI-generated description

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

MIT Licensed

Similar vizzes