Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

React Hooks Bowl of Fruit

Public visualization

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.

Comments

Sign in to join the discussion.

MIT Licensed