Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

color and size legen

Public visualization

color and size legen

0 stars0🌍 Public
Nntds12
Last edited Mar 24, 2020
Created on Mar 24, 2020

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

Comments

Sign in to join the discussion.

MIT Licensed