Bowl of Fruit - General Update Pattern
✓ Published2🌍 Public
This example demonstrates the D3 general update pattern using a bowl of fruit metaphor. Five apples are drawn as red circles with labels inside a rounded rectangle bowl. Over time, fruits are removed and one apple changes into a lemon, with the chart updating accordingly. The code uses D3 v7 APIs including `scaleOrdinal` for color and radius mappings, and the `selectAll`, `enter`, `merge`, and `exit` methods to handle data changes. The visualization renders as SVG with fruits positioned horizontally based on their array index.
AI-generated descriptionMIT Licensed