🌍 Public
Viewing a saved revision (read-only)
0508ebd7351541f4825662ae455490c7
Bowl of Fruit - General Update Pattern
A bowl of fruit demonstrates D3’s general update pattern for animated data joins. Circles represent apples and lemons, colored via a `scaleOrdinal` and sized by another. Each update transitions entering, updating, and exiting circles using `transition().duration(1000)`, shrinking exits to zero radius before removal. The example cycles through adding, removing, and mutating fruit types with `setTimeout`, showing how D3’s `selection.data` with a key function manages dynamic datasets. Rendering uses SVG in a static 960×500 viewport.
AI-generated description