Skip to main content
100%

Bowl of Fruit - Hover to Select

✓ Published0🌍 Public
RRubens
Last edited Sep 17, 2018
Created on Sep 17, 2018

Five pieces of fruit—apples and a lemon—appear in a row, and hovering over any fruit selects it with a dark blue outline while moving the mouse away deselects it. Using d3.v5, the fruitBowl function manages enter, update, and exit selections with circle elements, applying ordinal color and radius scales, and animating transitions via `.transition().duration(1000)`. The code includes a timed sequence that removes an apple, replaces one with a lemon, and filters out another, demonstrating dynamic data binding. SVG rendering and mouseover/mouseout event handlers drive the interaction.

AI-generated description
MIT Licensed

Similar vizzes