Skip to main content
100%

Bowl of Fruit

✓ Published2🌍 Public
Ssakhabutdinov
Last edited Nov 26, 2019
Created on Nov 2, 2019

This example demonstrates a dynamic fruit bowl visualization where apples and lemons are drawn as circles with color and size mapped to fruit type. The scene animates through a sequence of state changes—removing fruits, replacing one type with another, and filtering—using D3.js v5 selections and merge operations. The SVG output is generated declaratively, with the `scaleOrdinal` function mapping fruit types to visual properties like fill color and radius. The bowl itself is a static rectangle with rounded corners, while the fruits are positioned and updated imperatively via a custom `fruitBowl` function that handles entering, exiting, and updating elements.

AI-generated description

An example showing the capabilities of VizHub.

MIT Licensed

Similar vizzes