Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
PPiotrekW2
Last edited Feb 26, 2019
Created on Feb 26, 2019

A D3.js smiley face demonstrates basic DOM manipulation and chained transitions by animating raised eyebrows. Built from SVG primitives—circles for the face and eyes, rectangles for eyebrows, and an arc-generated path for the mouth—the code uses d3.select and d3.arc with explicit positional variables. The eyebrows move via transition().duration(2000) calls that shift the group’s transform attribute between two vertical offsets, creating a repeating motion. The example uses d3.v5 and renders entirely in SVG within a fixed 960x500 viewport.

AI-generated description

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

MIT Licensed

Similar vizzes