Bowl of fruit - General Update Pattern
This example demonstrates the general update pattern in D3, where a small dataset of fruit items is visualized as scaled and colored circles. The visualization shows how elements are added, removed, or modified over time through three timed transitions, first removing an apple, then changing another apple to a lemon, and finally deleting a third item. The code uses SVG circles and text elements, with D3's selection chaining methods such as `enter`, `merge`, and `exit` to handle the updates. Data is generated in memory using a `range` and random IDs, and the fruit types are mapped to colors and radii using ordinal scales.