Skip to main content
100%

Bowl of Fruit - General Update Pattern II

✓ Published2🌍 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.

MIT Licensed

Similar vizzes