Bowl of Fruit - General Update Pattern
This example demonstrates the general update pattern in D3, showing how data joins handle enter, update, and exit selections with animated transitions. Circles representing apples enter with a radius of zero, expand to full size, change color and stroke when clicked, and shrink away when removed from the data array. The code uses d3.scaleOrdinal for color and radius mappings, selection.data with a key function, and chained transition.duration calls to animate updates over one second. Data changes occur at timed intervals, modifying the fruit array through pop, filter, and property mutation.