Skip to main content
100%

Bowl of Fruit - General Update Pattern

✓ Published2🌍 Public
MMatthew Rubino
Last edited Jun 11, 2021
Created on Jun 9, 2021
Forked from Face Time

This example demonstrates the D3 general update pattern, showing how fruit in a bowl transitions between states: apples disappear, an apple changes to a lemon, and another apple is removed. It renders SVG circles and text labels inside a rounded rectangle, using `scaleOrdinal` for color and radius mappings. The code uses `selection.data()`, `.enter()`, `.merge()`, and `.exit()` with `transition().duration(1000)` to animate entering, updating, and exiting elements, including shrinking exit circles to zero radius before removal.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes