Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - General Update Pattern

Public visualization

Bowl of Fruit - General Update Pattern

0 stars1🌍 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

Comments

Sign in to join the discussion.

MIT Licensed