Skip to main content
100%

Bowl of Fruit - Hoover to select events with D3.js!

✓ Published0🌍 Public
Fforcox43
Last edited Jul 15, 2020
Created on Jul 15, 2020

This example demonstrates interactive selection in a data visualization using D3.js within a React application. Animated SVG circles represent fruits in a bowl—apples and lemons—which appear, disappear, and change type over time. Users can hover over a circle to highlight it with a black stroke, triggering a selection event that updates the visualization's state. The implementation uses D3's `select`, `scaleOrdinal`, and transition APIs to manage animated enter, update, and exit states for the circles, driven by a `setSelectedFruit` callback.

AI-generated description

Click events.

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes