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 stars7🌍 Public
CCurran Kelleher
Last edited Aug 21, 2019
Created on Feb 6, 2019

This example demonstrates a data visualization of a fruit bowl using React Hooks and D3.js. It shows a row of apple and lemon circles, where clicking a fruit selects it and highlights it with a black stroke. The code uses React's `useState` hook to manage the fruit data and selected fruit state, while D3's `scaleOrdinal` functions define the color and radius scales for each fruit type. The visualization renders as SVG circles within a React component, though the commented-out code suggests potential animation transitions that are not active.

AI-generated description

Trying out React Hooks.

Comments

Sign in to join the discussion.

MIT Licensed