React Hooks Bowl of Fruit
✓ Published0🌍 Public
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.
MIT Licensed