Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - General Update Pattern

Public visualization

Viewing a saved revision (read-only)

bf9e2409d48940a1995d07172e5e8a41

Bowl of Fruit - General Update Pattern

0 stars1🌍 Public
Ddaigokawabe
Last edited Aug 1, 2020
Created on Aug 1, 2020

This example demonstrates the general update pattern in D3, showing how graphical elements respond to changes in an array of fruit objects over time. A bowl of apples is gradually modified as fruits are removed, and one apple transitions into a lemon, with all shapes and colors updating accordingly. The code uses D3’s selection merging (`selection.enter().append()`, `.merge()`, and `.exit().remove()`) to handle the incremental changes, while `scaleOrdinal` maps fruit types to colors and radii. The visualization is rendered as SVG within a React framework, using D3 v5.

AI-generated description

A bare minimum HTML page.

See also React Starter.