Bowl of Fruit - Click to Select
✓ Published0🌍 Public
Five apples sit in a row across an SVG canvas, each rendered as a red circle with a radius of 50 pixels. Clicking any apple strokes it with a thick black border to mark it as selected, while the previously selected apple loses its outline. The example uses React state via the `useState` hook to track the selected fruit ID and d3's `scaleOrdinal` for both color and radius mapping. All fruits are generated with `range` and rendered as React components, with the selection interaction handled through the `onClick` event.
AI-generated descriptionMIT Licensed