Fruitbowl V2 nesting
✓ Published0🌍 Public
This example demonstrates a nested data visualization using D3 v5, where a row of fruit circles—apples and lemons—is rendered and animated within an SVG. The fruitBowl component uses `selection.enter()` and `.merge()` to handle groups, circles, and text elements, with `scaleOrdinal` mapping fruit types to colors and radii. A scripted sequence changes the fruit array over time, triggering re-renders that show the exit, update, and enter transitions, such as removing a fruit or changing an apple to a lemon. The animation is driven by setTimeout calls that manipulate the `fruits` state and invoke the render function.
AI-generated descriptionMIT Licensed