🌍 Public
Viewing a saved revision (read-only)
8eec89c6d8e14d719f60e4e480a33288
Bowl of fruit - Nested Elements
A dynamic fruit bowl demonstrates data joins and nested elements with D3 v5. Five circles represent apples, rendered as red groups with uppercase text labels. As the simulation runs, fruits disappear, and one apple transforms into a yellow lemon, changing both color and radius. The code uses `d3.scaleOrdinal` for color and radius scales, `selection.data` with object constancy, and group elements containing circle and text children, with enter, update, and exit selections managing transitions.
AI-generated description