Bowl of Fruit - General Update Pattern Special Cases
This example demonstrates the general update pattern in D3.js with special cases for entering, updating, and exiting data. It shows a bowl of fruit where apples are added, eaten, replaced by lemons, and filtered out over time, using animated transitions. The code uses D3 v5’s `selection.enter`, `selection.merge`, `selection.exit`, and `transition.duration` to handle these updates, with ordinal scales for color, radius, and font size. Rendering occurs in an SVG via `circle` and `text` elements.