Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
MMichael Connors
Last edited Jul 1, 2019
Created on Jul 1, 2019

A yellow smiley face with black outlines is built from SVG shapes, including circles for eyes and a mouth drawn as an arc path. The animation shows the eyebrows, two rectangles, moving upward and back down via chained `transition().duration()` calls. D3.js v5 selects the SVG element and manipulates attributes like `cx`, `r`, and `transform` using `select` and `append`. The code uses D3's `arc` generator to construct the mouth, and all positioning is centered within a 960×500 viewport.

AI-generated description

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

MIT Licensed

Similar vizzes