🌍 Public
Viewing a saved revision (read-only)
6dbea783feb041e89052ca4d97185361
Bowl of Fruit - General Update Pattern
This example demonstrates the D3 general update pattern by rendering a bowl of fruit as SVG circles that change over time. Using `d3.scaleOrdinal` for color and radius mapping, the `fruitBowl` function joins data to circle elements, handling enter, update, and exit selections with `.enter()`, `.merge()`, and `.exit().remove()`. Apples and lemons are distinguished by type, and timed interactions remove fruits or replace an apple with a lemon, showing how the visualization synchronizes DOM elements with changing data.
AI-generated description