Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Kkb1ngram4
Last edited Aug 3, 2020
Created on Aug 3, 2020

This example builds a yellow smiley face entirely from SVG shapes created with D3.js, including a circular head, eyes, and an arc-based mouth. It demonstrates fundamental DOM manipulation with selections and attribute setting. The two rectangular eyebrows animate by moving up and down using chained `transition().duration()` calls, which shift the eyebrow group’s transform. The code uses d3’s `select`, `arc`, and transition methods to construct and animate the face, calculating positions relative to the SVG’s width and height.

AI-generated description

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

MIT Licensed

Similar vizzes