Skip to main content
100%

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

✓ Published1🌍 Public
SSANEEM MOHAMMAD
Last edited Feb 24, 2023
Created on Feb 24, 2023

This example demonstrates fundamental D3.js DOM manipulation by animating a yellow smiley face whose eyebrows move up and down in a continuous loop. The face is drawn using SVG shapes—circles for the eyes and head, rectangles for the eyebrows, and a path generated with d3.arc() for the mouth. The animation is driven by chained transition() calls that alternately shift the eyebrow group’s transform attribute over two-second intervals. The code imports select and arc from D3 v5 and appends elements to a fixed 960×500 SVG canvas.

AI-generated description

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

MIT Licensed

Similar vizzes