🌍 Public
Viewing a saved revision (read-only)
e8e8b748cbc3497a8a8ffc95a287b216
Bowl of Fruit — Nested Elements
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 description