Bowl of Fruit - Nested Elements
✓ Published1🌍 Public
JJordan Chiu
Last edited Jan 27, 2020
Created on Jan 27, 2020
This example demonstrates a nested SVG visualization where circular fruits inside a rounded bowl update dynamically over time. Using D3 v5 and the `fruitBowl` module, elements are bound to a `fruits` array, with apples (red, radius 50) and lemons (yellow, radius 30) encoded through ordinal color and size scales. The code shows incremental changes: removing an apple, altering one apple to a lemon, and filtering out another, showcasing how D3’s selection merging, `.merge()`, and `.exit()` handle transitions. The rendering uses raw SVG `rect`, `circle`, and `text` elements, driven by timer-based state mutations.
AI-generated descriptionTutorial!
MIT Licensed