Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - Click to Select

Public visualization

Viewing a saved revision (read-only)

7cc5e10467854d8fb6cb0e4d0897a948

Bowl of Fruit - Click to Select

0 stars0🌍 Public
Jjesramyep1263
Last edited Mar 31, 2020
Created on Mar 31, 2020

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 description