Skip to main content
100%

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

✓ Published1🌍 Public
Ssmchaaritha@gmail.com
Last edited Feb 24, 2025
Created on Feb 12, 2025

This example demonstrates fundamental DOM manipulation with D3.js by building a smiley face from SVG shapes, including a red circle head, two eyes, and a mouth drawn with the `d3.arc` helper. The eyebrows, rendered as rectangles, animate upward and back down using D3’s `transition` method with a duration of 1000 and 2000 milliseconds. The code structures the scene by appending elements to a central `<g>` group, using constants for spacing and offsets to position facial features symmetrically. Built with d3.v5, it renders in an SVG container and relies on simple attribute chaining for styling and movement.

AI-generated description

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

MIT Licensed

Similar vizzes