🌍 Public
Viewing a saved revision (read-only)
48fbfa893ff94d7e9581a25069bca58f
Bowl of Fruit - General Update Pattern
This example demonstrates D3’s general update pattern for entering, updating, and exiting data joins. Animated over time, a bowl of fruit changes as apples are removed, a lemon replaces one apple, and another apple disappears, with circles and labels updating accordingly. The code uses `d3.scaleOrdinal` for color and radius encoding, `selection.merge` to handle entering and updating elements, and `selection.exit().remove()` for removal. The fruit bowl shape is an SVG rectangle with rounded corners.
AI-generated description