Bowl of Fruit - Hoover to select events with D3.js!
✓ Published0🌍 Public
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 descriptionMIT Licensed