Bowl of Fruit - General Update Pattern Special Cases
This example demonstrates the general update pattern’s special cases in D3 v5, animating a bowl of fruit with apples and lemons as data changes over time. It shows how to handle entering, updating, and exiting elements when items are added, removed, or modified, using SVG groups for each fruit. The code leverages `d3.scaleOrdinal` for color and radius mappings, and `selection.merge` with `transition.duration` to smoothly animate attribute changes. The scene updates three times via `setTimeout`, illustrating an apple removal, a type replacement, and a filter-based deletion.