Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit

Public visualization

Viewing a saved revision (read-only)

c94a40aef091457f908bb040c379178a

Bowl of Fruit

0 stars2🌍 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.