🌍 Public
Viewing a saved revision (read-only)
b5116d7ad5864d6680effeb2a2b97213
Let's make a face with D3.js!
This example demonstrates fundamental DOM manipulation with D3.js by constructing a cartoon smiley face from SVG primitives and animating one of its eyebrows. The code builds a yellow circular face, a mouth using the d3.arc() path generator, and two eyes with rectangular eyebrows. It uses D3's selection and transition APIs, including .transition().attr() to animate the left eyebrow's vertical position over two seconds, while the right eyebrow remains static. The underlying data is purely geometric, derived from hardcoded constants like eyeSpacing, eyeRadius, and svgHeight.
AI-generated descriptionDemonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.