Bowl of Fruit - General Update Pattern
✓ Published2🌍 Public
The bowl of fruit demonstrates D3’s general update pattern, showing how circles enter, update, and exit smoothly with a 500ms transition. Apples and lemons are distinguished by ordinal color and radius scales, while each fruit’s identity is tracked via a random `id`. The `fruitBowl` function uses `selection.merge` and `transition.attr` to animate radius and x-position changes, and an exit transition shrinks removed fruits to zero before deletion. Data mutations—removing an apple, changing one to a lemon, and filtering—are triggered by `setTimeout` in `index.js`.
AI-generated descriptionBowl of Fruit demo
MIT Licensed