Skip to main content
100%

Let's make a face with D3.js!

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

The animation shows a yellow smiley face with eyes, eyebrows, and a mouth, where the eyebrows repeatedly move up and down in a looping motion. Built with D3.js v5, the code uses the `select` and `append` methods to construct SVG elements, and chains `transition().duration()` calls to animate the eyebrow group’s `transform` attribute between two vertical offsets. The mouth is drawn with the `arc` generator, and all coordinates are derived from the SVG’s width and height, with the face centered via a `translate` transformation.

AI-generated description

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

MIT Licensed

Similar vizzes