Nested Elements
This example demonstrates a dynamic fruit bowl visualization where apples and lemons appear, disappear, and change type over time. Using D3 v5’s `select`, `range`, `scaleOrdinal`, and custom component-style functions like `fruitBowl`, the SVG renders circles and text labels, with color and radius scales mapping fruit types to visual properties. The React-inspired component pattern merges enter, update, and exit selections to handle data changes smoothly, while timed `setTimeout` calls trigger data mutations that update the scene.