Skip to main content
100%

Bowl of Fruit - General Update Pattern

✓ Published1🌍 Public
Ccathykan
Last edited May 16, 2020
Created on May 16, 2020

This example demonstrates the general update pattern in D3, showing how to handle data changes smoothly. A bowl of fruit is rendered as SVG circles with text labels, using a React-based structure with D3 v5. The code uses `selectAll` and data joins—through `enter()`, `merge()`, and `exit()`—to update the visualization as fruits are removed or their types change. Fruit types are mapped to colors and radii via `scaleOrdinal`, and the bowl shape is drawn as a rounded rectangle with `rx` attributes.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes