Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - General Update Pattern

Public visualization

Viewing a saved revision (read-only)

7a680de55e1047eb92a07d3f2b4b1794

Bowl of Fruit - General Update Pattern

0 stars2🌍 Public
PPiotr Paszek
Last edited Apr 24, 2021
Created on Apr 24, 2021

Five fruit circles enter an SVG bowl and animate to their positions. This example demonstrates the D3 general update pattern by eating apples, replacing one with a lemon, and removing another, all with smooth transitions. The code uses d3.select, d3.range, scaleOrdinal for color and radius, and transition().duration() for animation. Each fruit has an id for keyed data joins, and exit selections shrink to zero radius before removal.

AI-generated description