Bowl of Fruit - General Update Pattern Special Cases
✓ Published1🌍 Public
Five apples in a bowl shrink and vanish when eaten, and a lemon substitutes for one apple, demonstrating D3's general update pattern with special cases. The example uses D3 v5’s `selectAll`, `enter`, `merge`, `exit`, and `transition` APIs to animate circle radii and text font sizes. A custom counter controls whether elements reappear after a removal, highlighting an atypical state where data updates do not fully reset visual properties. The SVG renders ordinal color and radius scales for fruit types.
AI-generated descriptionMIT Licensed