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)

219445fe409742e6a81bfd4744f0d4d5

Bowl of Fruit - General update pattern

0 stars0🌍 Public
AAaron Goebel
Last edited Apr 12, 2020
Created on Apr 12, 2020

This example demonstrates the general update pattern in D3.js, showing how a bowl of fruit changes as apples are eaten or transformed into lemons over time. A sequence of timed events triggers data updates, and the visualization transitions between three scenarios: removing an apple, changing one apple to a lemon, and filtering out another apple. The code uses D3 v5 with `selectAll` and `data` joins to handle enter, update, and exit selections, plus `scaleOrdinal` for color and radius mappings. SVG circles and text elements render each fruit based on its type.

AI-generated description