Bowl of Fruit - General Update Pattern
This example demonstrates the general update pattern for data visualizations using D3 v5, where a bowl of fruit is rendered as SVG shapes and updated dynamically. The code uses D3’s selection, `range`, and data-join methods to bind an array of fruit objects—each with a `type` property—to visual elements. It draws apples as circles within an SVG canvas of 960 by 500 pixels, showing how enter, update, and exit selections manage changes to the dataset. The implementation relies on explicit SVG attributes and D3’s declarative data-binding approach rather than simulation or animation.