Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of fruit - General update pattern

Public visualization

Viewing a saved revision (read-only)

890df232d01642f0af958b6e5082b2ba

Bowl of fruit - General update pattern

0 stars0🌍 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