Skip to main content
100%

bowl of fruit-nested version update pattern

✓ Published0🌍 Public
Llinkshady
Last edited May 17, 2020
Created on May 17, 2020

This example demonstrates the enter-update-exit pattern with nested selections in D3. The code uses `selection.enter()` and `selection.merge()` to bind fruit data to SVG groups, each containing a circle and text, with `scaleOrdinal` mapping fruit types to colors and radii. Timed mutations—removing an apple, changing a fruit to a lemon, and removing another—show how the visualization updates smoothly, with exiting groups removed via `.exit().remove()`. The SVG rendering uses a simple bowl shape drawn with a rect.

AI-generated description
MIT Licensed

Similar vizzes