Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - General Update Pattern2

Public visualization

Viewing a saved revision (read-only)

4dfcf68510b24db997b1953f02bf89da

Bowl of Fruit - General Update Pattern2

0 stars1🌍 Public
Rrainyrainyguo
Last edited Nov 14, 2020
Created on Nov 14, 2020

This example demonstrates the General Update Pattern, where a set of SVG circles representing fruit in a bowl is dynamically added, removed, and modified. Over a few seconds, apples disappear, and one apple transforms into a lemon, with each fruit’s color and radius encoded via `scaleOrdinal`. The visualization uses d3’s selection/merge API (`groupsEnter.merge(groups)`) to animate transitions smoothly. The code relies on d3.v6 and a custom `fruitBowl` function driven by `setTimeout` calls.

AI-generated description