Skip to main content
100%

Bowl of Fruit - General Update Pattern

✓ Published2🌍 Public
NNathan Cheever
Last edited Dec 31, 2019
Created on Dec 30, 2019

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
MIT Licensed

Similar vizzes