🌍 Public
Viewing a saved revision (read-only)
70196afc149f4d60a4a18faf43bec35e
Nested Example
A fruit bowl visualization demonstrates nested selections in D3.js, showing five fruit shapes in a brown bowl that updates over time. Apples appear as red circles, and one changes to a yellow lemon while another fruit is removed. The code uses `selection.selectAll`, `selection.enter`, and `selection.merge` to bind fruit data to SVG groups, with `d3.scaleOrdinal` mapping fruit types to colors and radii. Animated updates occur via `setTimeout` calls that modify the fruits array and re-render the scene.
AI-generated description