🌍 Public
Viewing a saved revision (read-only)
983ac7648f0843e9867f2e48d1664040
React Hooks Bowl of Fruit
Five apples rendered as red SVG circles sit in a row, with one selectable via click. React Hooks manage the fruit state and selected fruit ID, while d3 ordinal scales map fruit type to color and radius. The code uses React's `useState` hook, ReactDOM rendering, and d3's `scaleOrdinal` and `range` functions. The data is generated using `Math.random()` for fruit IDs, and clicking a circle triggers a stroke highlight, though no animation is implemented.
AI-generated descriptionTrying out React Hooks.