🌍 Public
Viewing a saved revision (read-only)
cfb6203ec5994988adf07bb29dd864ab
React Hooks Bowl of Fruit
A static bowl of five apples demonstrates React Hooks for state management in a D3-based SVG visualization. The `FruitBowl` component maps fruit data to circles positioned along a row, using `scaleOrdinal` color and radius scales to differentiate apple from lemon. Clicking a fruit updates the `selectedFruit` state, highlighting the chosen circle with a black stroke. The example uses React's `useState` hook, D3's `range` for data generation, and renders purely via SVG, with no animation or transitions active in the final code.
AI-generated descriptionTrying out React Hooks.