Skip to main content
100%

Bowl of Fruit - General Update Pattern

✓ Published2🌍 Public
Ccathykan
Last edited May 11, 2020
Created on May 11, 2020

This example demonstrates the general update pattern for data joins, showing how fruits enter, update, and exit as the dataset changes over time. A bowl of apples and lemons is rendered as color-coded circles with differing radii, and users see animations as apples are eaten or replaced. The code uses D3 v5’s `selectAll` with key functions, `.enter()`, `.merge()`, and `.exit()` to manage transitions, along with `scaleOrdinal` for color and size. The SVG is drawn in React and animated via `.transition().duration(1000)`, updating circle positions and radii.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes