Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowlfruit to select

Public visualization

Viewing a saved revision (read-only)

e2fce462294848b0b98964648496f97d

Bowlfruit to select

0 stars0🌍 Public
VVito
Last edited Nov 29, 2019
Created on Nov 29, 2019
Forked from Click to Select

Five fruits in a bowl transition between apples and lemons, with a black outline highlighting whichever fruit the pointer hovers over. The visualization demonstrates animated enter, update, and exit selections using D3 v5’s data join, transitioning circle radii from zero and updating positions via `transition().duration(1000)`. Mouseover and mouseout events trigger a state change through a `setSelectedFruit` callback, which re-renders the SVG with updated stroke styling. The code uses `d3.scaleOrdinal` for color and radius mappings, and `d3.range` to generate the initial dataset.

AI-generated description