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)

4beb4af1db6548b78edaf5be77047b5f

Bowl of Fruit - General Update Pattern

0 stars2🌍 Public
ZZ-Richard
Last edited Jun 16, 2020
Created on Jun 15, 2020

This example demonstrates the D3 general update pattern with a bowl of fruit rendered as SVG circles. Apples and lemons are distinguished by color and radius using `scaleOrdinal`, while animated transitions adjust circle positions and sizes over one second. The code explicitly manages enter, update, and exit selections, shrinking removed fruit to zero radius via `transition.attr('r', 0)` and `.remove()`. Data mutations—deleting an apple, changing one to a lemon, and filtering another—occur at timed intervals, showing how the visualization responds to changing data through D3 v5's data join.

AI-generated description