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 stars0🌍 Public
Llanzosuarez
Last edited Jul 12, 2020
Created on Jul 11, 2020

A bowl of five apples appears as circles, then shrinks and disappears as one is eaten. A middle apple’s fill and radius transition from red to yellow as it becomes a lemon, demonstrating the general update pattern with enter, update, and exit selections. The example uses D3 v5’s `selection.merge`, `transition.attr`, and ordinal `scaleOrdinal` for colors and radii, with SVG circles redistributing horizontally via a computed `cx` position. Data updates are triggered by `setTimeout` after initial rendering from a `range(5)` array.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed