Skip to main content
100%

Fork of Bowl of Fruit - Hover to Select

✓ Published0🌍 Public
TToooooooT
Last edited Sep 18, 2022
Created on Sep 18, 2022

A fork of the Bowl of Fruit example demonstrates an interactive data join with D3 v7. The visualization renders apples and lemons as SVG circles, which animate their radius and x-position using `transition().duration(1000)` as fruits are added, removed, or replaced. Hovering over a circle triggers a `mouseover` event, invoking `setSelectedFruit` to highlight it with a black stroke; moving the mouse away clears the selection. The code uses D3’s `scaleOrdinal` for color and radius mappings, with a keyed `data` join on fruit IDs to track elements across updates.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes