🌍 Public
Viewing a saved revision (read-only)
4beb4af1db6548b78edaf5be77047b5f
Bowl of Fruit - General Update Pattern
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