hover to select d3
✓ Published0🌍 Public
This example demonstrates an interactive fruit bowl visualization where hovering over circles selects them, highlighting the chosen fruit with a black stroke. The code loads D3 v6 via UNPKG and uses local ES6 modules, with `fruitBowl.js` defining a reusable chart function that leverages `scaleOrdinal` for color and radius mapping. Data comes from `data.csv`, though the visualization primarily uses generated fruit objects. SVG circles transition smoothly between states using `transition().duration(1000)`, while mouse events trigger state changes and re-rendering. The example also shows enter, update, and exit selections as fruits are dynamically removed or modified over time.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed