🌍 Public
Viewing a saved revision (read-only)
ce8db15906b84c7385d4bebec95cb2cf
Bowl of Fruit - Click to Select
Five apples are rendered as red circles in a row, with a black stroke highlighting the currently selected fruit. Clicking any apple moves the selection to that fruit. The example uses React state with `useState` to track the selected fruit’s ID, and `d3.scaleOrdinal` maps fruit types to colors and radii. Each circle’s `onClick` handler updates the selection, while an SVG renders the circles as React components. The code also comments on transitioning circles with D3 transitions, but active animation is not implemented.
AI-generated description