Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

React Hooks Bowl of Fruit

Public visualization

Viewing a saved revision (read-only)

55cac5bcbdeb4888808093b42b438d7c

React Hooks Bowl of Fruit

0 stars0🌍 Public
Vvaporpin
Last edited Oct 28, 2020
Created on Oct 28, 2020

Five apples with D3 ordinal color and radius scales render as React circles in an SVG bowl. Clicking a fruit updates its selected state through React Hooks (`useState`) and a callback prop to draw a black stroke. React’s `useEffect` initializes a D3 brush on a separate `<g>` element, logging selection events to the console. The example demonstrates combining React’s declarative component model with D3’s imperative brush API.

AI-generated description

Trying out React Hooks.