Bowl of Fruit - General Update Pattern
✓ Published2🌍 Public
A bowl of fruit demonstrates D3's general update pattern, showing apples as dark red circles and lemons as yellow ones with distinct radii. New fruit enter at radius zero and grow, existing fruit move horizontally and change fill when types change, and removed fruit shrink away. The example uses D3 v5 selections with `.data()`, `.enter()`, `.merge()`, and `.exit()`, applying transitions over one second to animate SVG circle attributes. A simple timeline triggers updates by popping apples, replacing one with a lemon, and filtering out another.
AI-generated descriptionMIT Licensed