Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - Nested

Public visualization

Bowl of Fruit - Nested

0 stars1🌍 Public
CChristine Lanser
Last edited Oct 6, 2020
Created on Oct 3, 2020

A nested selection pattern updates a bowl of fruit rendered as SVG circles and text labels. The visualization starts with five apples, then sequentially removes one fruit, swaps an apple for a lemon, and filters out another apple. D3’s `scaleOrdinal` maps fruit types to colors and radii, while `selection.enter` and `selection.merge` manage entering and updating elements. The code uses `d3.select`, `d3.range`, and generic SVG `circle` and `text` elements.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed