🌍 Public
Viewing a saved revision (read-only)
0a8f4310df3845fd91f2ad0a9b140a16
Bowl of Fruit - General Update Pattern II
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 descriptionAn example including some commonly used features of SVG.