Skip to main content
100%

Bowl of Fruit: Click to Select

✓ Published1🌍 Public
Bbprokopowicz
Last edited Mar 30, 2020
Created on Mar 30, 2020

A bowl of fruit demonstrates click-to-select interactions with animated enter, update, and exit transitions. Five apples render as scaled SVG circles via a custom `fruitBowl` module, which uses `scaleOrdinal` for color and radius mappings. Clicking a fruit triggers an `onClick` handler that updates a `selectedFruit` identifier, applying a black stroke highlight. Timed updates replace an apple with a lemon, remove fruits, and re-render using `transition().duration(1000)` with `merge` and `remove` on circle selections.

AI-generated description

D3 course follow along.

MIT Licensed

Similar vizzes