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
BbeauMarko
Last edited Jul 23, 2020
Created on Jul 23, 2020

This example demonstrates the D3 general update pattern with a bowl of fruit that changes over time. An SVG renders circles representing apples and lemons, with color and size determined by `d3.scaleOrdinal` scales. The `fruitBowl` function uses `selection.selectAll`, `enter()`, `merge()`, and `exit()` to handle data joins, while `setTimeout` triggers state changes—removing fruits and replacing an apple with a lemon—to show how the visualization updates dynamically.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed