Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
MMukund Khandelwal
Last edited Sep 11, 2018
Created on Sep 11, 2018

A D3.js animation builds a yellow smiley face with a black outline, two eyes, and a mouth, then animates its eyebrows upward and downward using chained `transition` calls. The SVG is constructed by selecting the root element, setting a viewBox of 960 by 500, and translating a group to the center. The code uses D3’s `select`, `arc`, and `transition` APIs to draw circles, rectangles, and a path, with the mouth as an arc.

AI-generated description

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

MIT Licensed

Similar vizzes