Bowl of Fruit - Click to Select
✓ Published1🌍 Public
A set of fruit shapes animate into a bowl using SVG circles. Each fruit is rendered with a color and radius determined by its type via `d3.scaleOrdinal`, with apples appearing red and larger, lemons yellow and smaller. Clicking a fruit selects it, applying a black stroke, and triggers a callback that re-renders the visualization. The example demonstrates the D3 general update pattern: new fruits enter with a 2-second radius animation, exiting fruits shrink away over 1 second, and changes to existing fruit types update smoothly through the merged enter/update selection.
AI-generated descriptionMIT Licensed