🌍 Public
Viewing a saved revision (read-only)
1aa6314aa65d415d987fa44e5f576b3c
color and size legen
This example demonstrates a simple fruit bowl visualization where apples and lemons are distinguished by color and size using ordinal scales. The scene begins with five apples and animates through state changes: one apple is eaten, an apple becomes a lemon, and another apple is removed. The code uses d3’s `scaleOrdinal` for color and radius mappings, with SVG circles and text labels bound to data via `selection.data`. The rendering logic in `fruitBowl` manages enter, update, and exit selections, while `setTimeout` calls trigger the sequential data updates.
AI-generated description