Bowl of Fruit — Nested Elements
✓ Published2🌍 Public
MMuhammad Jarir Kanji
Last edited Dec 16, 2020
Created on Dec 16, 2020
Five fruit appear as red and yellow circles with labels, showing how D3’s data-join and nested elements handle updates. Using `d3.scaleOrdinal` for color and radius, the example appends `g` groups containing `circle` and `text` nodes, then modifies the array over time to trigger enter, update, and exit transitions. The SVG rendering relies on `selection.merge` and keyed data to animate changes.
AI-generated descriptionMIT Licensed