Skip to main content
100%

Bowl of fruit - General update pattern

✓ Published0🌍 Public
TTimvanAlphen
Last edited Nov 10, 2020
Created on Nov 10, 2020
Forked from Intro D3

Five apples appear as red circles in an SVG bowl, then one disappears and another turns yellow. The demo shows D3’s general update pattern, using `selection.data`, `.enter`, `.merge`, and `.exit` to bind an array of fruit objects to `circle` elements. `d3.scaleOrdinal` maps fruit types to fill colors and radii via `colorScale` and `radiusScale`, while `setTimeout` triggers the state changes.

AI-generated description
MIT Licensed

Similar vizzes