🌍 Public
Viewing a saved revision (read-only)
bccd9fda8dad431e8fdc062ff9d45f53
Let's make a face with D3.js!
This example demonstrates fundamental DOM manipulation with D3.js by building a smiley face whose eyebrows animate upward and downward. It uses D3 selections and the `arc` generator to construct the face’s circular head, eyes, rectangular eyebrows, and mouth as SVG elements. The eyebrows move via chained `transition().duration()` calls, shifting their group’s transform attribute over two seconds in each direction. The code explicitly leverages `select`, `attr`, and `append` from d3.v5, with no external data source, relying entirely on hardcoded geometric values.
AI-generated descriptionDemonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.