Skip to main content
100%

Bowl Fruit - Hover to select

✓ Published0🌍 Public
JJefferson Abreu
Last edited Jul 24, 2019
Created on Jul 24, 2019

Five pieces of fruit in a bowl animate between apples and lemons while responding to hover. D3 v5’s `scaleOrdinal` maps fruit types to colors and radii, and `selection.join` patterns with `transition` handle enter, update, and exit states. Circle elements grow from radius zero and shrink on removal, with an animated swap from apple to lemon. A black stroke highlights the selected fruit via mouseover events that update a `selectedFruit` variable, triggering a re-render. The example uses plain SVG circles and D3 transitions over one second.

AI-generated description
MIT Licensed

Similar vizzes