Viewing a saved revision (read-only)
9e6c0ab3fd754dbca52a0b6bf8d1f511
Fork of Let's make a face with D3.js!
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 descriptionDemonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.