Skip to main content
100%

Fork of Fork of Let's make a face with D3.js!

✓ Published0🌍 Public
Pprachow
Last edited Feb 22, 2023
Created on Feb 22, 2023

This example demonstrates fundamental DOM manipulation with D3.js by animating a smiley face whose eyebrows move up and down. It shows how to build the SVG face from basic shapes—circles for the eyes, rectangles for the eyebrows, and an arc for the mouth—before applying a two-stage transition to the eyebrow group. The code uses d3-selection and d3-shape’s `arc()` to construct the path, with `transition().duration()` chaining to create the animated eyebrow movement. The face is centered using an SVG group with a translated transform.

AI-generated description

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

MIT Licensed

Similar vizzes