Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
Mmarissaverdonck
Last edited Nov 12, 2019
Created on Nov 12, 2019

A D3.js example draws a yellow smiley face with animated eyebrows that raise and lower in a continuous loop. The face is constructed using SVG primitives: circles for the head, eyes, and an arc-shaped mouth, while rectangles form the eyebrows. The animation relies on D3's `transition().duration()` method to interpolate the eyebrow group's transform attribute between two vertical positions. The code demonstrates straightforward DOM manipulation via `d3.select` and `d3.append`, with all elements positioned absolutely within a 960 by 500 pixel SVG canvas.

AI-generated description

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

MIT Licensed

Similar vizzes