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 stars2🌍 Public
Pprincit
Last edited Mar 27, 2020
Created on Mar 27, 2020

This example demonstrates D3’s general update pattern for entering, updating, and exiting data joins. Animated over time, a bowl of fruit changes as apples are removed, a lemon replaces one apple, and another apple disappears, with circles and labels updating accordingly. The code uses `d3.scaleOrdinal` for color and radius encoding, `selection.merge` to handle entering and updating elements, and `selection.exit().remove()` for removal. The fruit bowl shape is an SVG rectangle with rounded corners.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed