Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fruitbowl V2 nesting

Public visualization

Fruitbowl V2 nesting

1 star0🌍 Public
Iisaachowen
Last edited Aug 11, 2019
Created on Aug 6, 2019

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 description

Comments

Sign in to join the discussion.

MIT Licensed