Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bowl of Fruit - General Update Pattern II

Public visualization

Viewing a saved revision (read-only)

0a8f4310df3845fd91f2ad0a9b140a16

Bowl of Fruit - General Update Pattern II

0 stars2🌍 Public
Eegrebing
Last edited Sep 25, 2020
Created on Sep 23, 2020

Rendering an SVG bowl of fruit, this example demonstrates the general update pattern in D3 v6. Apples and lemons are drawn as colored circles with labels, using `d3.scaleOrdinal` to map fruit types to color and radius. The code shows nested enter-merge-exit selections for groups, circles, and text, animating through timed data changes that remove fruit, swap an apple for a lemon, and filter the array. A single `rect` represents the bowl, appended once via a `[null]` data join.

AI-generated description

An example including some commonly used features of SVG.