Skip to main content
100%

Bowl of fruit - general update pattern

✓ Published1🌍 Public
PPeter S
Last edited Aug 24, 2019
Created on Aug 15, 2019
Forked from Bowl of fruit

This example demonstrates the general update pattern in D3 by rendering a bowl of fruit as SVG shapes. Apples and lemons appear as colored circles with labels, positioned within a bowl drawn with rectangles and polylines. A React-less data flow using `d3.select`, `scaleOrdinal`, and a `data()` join shows how enter, update, and exit selections handle dynamic fruit arrays. Over time, setTimeouts modify the fruit list—removing items, changing a fruit type—and re-render to reflect those changes. The code relies on D3 v5 and SVG rendering, with data generated locally via random IDs.

AI-generated description

An example showing the capabilities of VizHub - Nesting

MIT Licensed

Similar vizzes