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)

8ab59cb552c848eb99a66e38862075f0

Bowl of Fruit, General Update Pattern

1 star0🌍 Public
Ccledevoute
Last edited Jun 24, 2020
Created on Jun 24, 2020

This example demonstrates the D3 general update pattern with a bowl of fruit that changes over time through a series of timed events. Apples and lemons are rendered as SVG circles with ordinal scales mapping fruit type to color and radius. The code uses `selection.data()`, `enter()`, `merge()`, and `exit()` to handle updates, while `setTimeout` triggers actions like eating an apple or replacing one with a lemon. The visualization shows how D3's data joins manage dynamic datasets.

AI-generated description

Stuff and Things