Skip to main content
100%

Let's make a face with D3.js!

✓ Published2🌍 Public
Aakanksha maheshwari
Last edited Feb 25, 2020
Created on Feb 25, 2020

This example shows a yellow smiley face built with SVG shapes, whose eyebrows animate upward and downward in a repeating bounce. The code uses D3 v5’s `select` and `arc` to construct the head, eyes, and mouth, with `transition().duration(2000)` driving the eyebrow movement. A centered `<g>` group positions all facial features relative to the SVG’s midpoint, while hardcoded offsets define eye spacing and eyebrow placement. The rendering relies entirely on SVG elements—circles, rectangles, and a path—with no external data source.

AI-generated description

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

MIT Licensed

Similar vizzes