Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Aaruba-haroon
Last edited Mar 24, 2020
Created on Mar 24, 2020

This example shows a D3.js smiley face with animated eyebrows, built using SVG primitives like circles, rectangles, and an arc-based mouth. The face is centered via a translated group, and the eyebrows transition vertically in a repeating 2000-millisecond cycle using `transition.attr` on the group. The code leverages D3 v5’s `select`, `arc`, and chained transitions to manipulate DOM elements directly, with a static orange face and dark eyes defined by hardcoded coordinates.

AI-generated description

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

MIT Licensed

Similar vizzes