Skip to main content
100%

Bowl of Fruit - General Update Pattern

✓ Published0🌍 Public
BbeauMarko
Last edited Jul 19, 2020
Created on Jul 19, 2020

A bowl of fruit demonstrates the D3 general update pattern, showing how a visualization can add, remove, and modify data points. Five apples initially appear in a grey bowl; sequentially, an apple is removed, an apple changes into a lemon, and another apple is deleted. The code uses D3 v5 with a scaleOrdinal color and radius mapping, and employs selection merging via `.merge()` in the `fruitBowl` function to handle entering, updating, and exiting elements in the SVG.

AI-generated description
MIT Licensed

Similar vizzes