Skip to main content
100%

Bowl of Fruit - General Update Pattern

✓ Published2🌍 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
MIT Licensed

Similar vizzes