color and size legen
✓ Published0🌍 Public
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 descriptionMIT Licensed