Skip to main content
100%

Bowl of Fruit - General Update Pattern

✓ Published1🌍 Public
TThomas Seberechts
Last edited Jun 5, 2020
Created on Jun 5, 2020

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
MIT Licensed

Similar vizzes