bowl of fruit - general update with text and layers
✓ Published0🌍 Public
A bowl of fruit demonstrates D3's general update pattern, animating a row of apples and lemons within a blue bowl shape. Circles shrink and disappear, a lemon replaces an apple in place, and remaining fruits shift positions across three timed updates. The code uses `selection.data()`, `merge()`, and `exit()` with `transition().duration()` to coordinate enter, update, and exit layers for both circle radii and text labels. An ordinal color scale maps fruit types to red and yellow fills.
AI-generated descriptionMIT Licensed