Skip to main content
100%

Bowl of Fruit - General Update Pattern

✓ Published1🌍 Public
Vvic126
Last edited Jun 25, 2020
Created on Jun 25, 2020

This example demonstrates the D3.js general update pattern by rendering a bowl of fruit that changes over time. It shows a row of apples and lemons as circles with matching labels, updating via enter, update, and exit selections. The code uses `d3.select`, `scaleOrdinal` for color and radius, and `selection.merge` to handle transitions. Initial fruits are apples, then one is removed, another becomes a lemon, and a second apple is removed through timed `setTimeout` calls. The visualization renders as SVG elements driven by React.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes