Skip to main content
100%

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

✓ Published0🌍 Public
PPoojaThandra
Last edited Feb 20, 2023
Created on Feb 17, 2023

This example builds a smiley face with D3.js v5, demonstrating fundamental DOM manipulation through SVG shapes and animated transitions. A red circle forms the head, with eyes, eyebrows, and a mouth added as separate SVG elements. The eyebrows are rectangles that move up and down via chained `transition().duration(2000)` calls, creating a simple animation loop. The code uses D3’s `select`, `arc`, and transition methods to append and animate elements, with positioning handled through explicit `attr` coordinates.

AI-generated description

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

MIT Licensed

Similar vizzes