Bowl of Fruit - General Update Pattern Special Cases
A dynamic SVG bowl of fruit demonstrates the general update pattern in D3 v5. Apples and lemons are drawn as colored circles with labels, using ordinal scales for color and radius. The example shows three special cases: removing an element, updating an existing element's type, and filtering the data array. The `fruitBowl` function uses `selection.data()`, `.enter()`, `.merge()`, and `.exit()` to handle joins, with circles and text appended to grouped elements. Data changes are triggered by `setTimeout` calls that mutate or replace the fruit array.