Bowl of Fruit - General Update Pattern
This example demonstrates the general update pattern in D3.js, animating a bowl of fruit rendered as SVG circles and text labels. The visualization shows how data joins handle entering, updating, and exiting elements: five apples initially appear, then one is eaten, another transforms into a lemon, and a third disappears. Using `selection.data()` with a key function, `.enter()`, `.merge()`, and `.exit()` transitions, circles smoothly shrink, change color via `scaleOrdinal`, and reposition over one-second durations. The React framework wraps the D3 v6 code, with `d3.select` and `range` driving the state changes.