Bowl of Fruit - General Update Pattern Special Cases
This example demonstrates the general update pattern in D3, showing how enter, update, and exit selections handle dynamic data changes in a fruit bowl visualization. Five apples appear initially, then an apple is removed, another transforms into a lemon, and a second apple disappears, with each change animating smoothly over one second. The code uses d3.scaleOrdinal for color and radius scales based on fruit type, while d3-transition animates circle radius and fill attributes. SVG groups and shapes are bound to data with unique IDs, and the enter/merge/exit pattern manages the lifecycle.