Skip to main content
100%

Bowl of Fruit, Interaction click

✓ Published1🌍 Public
AAli Ahmed
Last edited Dec 2, 2018
Created on Dec 2, 2018

Five apples appear in a row, and clicking one outlines it in black. As time passes, apples are removed and one changes into a lemon, with new and exiting circles animating their radius. The example demonstrates the D3 general update pattern using `selection.data`, `enter`, `merge`, and `exit` transitions. Fruit types map to colors and sizes via `scaleOrdinal`, and click events trigger a re-render with a selected fruit ID. SVG circles animate over one second using `transition().duration(1000)`.

AI-generated description

General Update Pattern

MIT Licensed

Similar vizzes