🌍 Public
Viewing a saved revision (read-only)
9f5151a4e3b242ce84d6db7cfb81d6e4
Data join and Transition
This example demonstrates a data join and transition animation in D3 v5, where a set of circles representing fruits is dynamically updated. The visualization shows how the `selectAll` and `data` (with a custom key function) methods manage entering, updating, and exiting elements—new apples grow from a radius of zero, a lemon changes color and size, and a removed fruit shrinks away. The code uses D3's `scaleOrdinal` for color and radius mappings and leverages the `transition` API for smooth, 1000-millisecond animations.
AI-generated description