Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of bowl of fruit

Public visualization

Viewing a saved revision (read-only)

5408b0a3fb3541d7a7c1b9a836c69c63

Fork of bowl of fruit

0 stars0🌍 Public
Jjlspangl
Last edited Aug 30, 2021
Created on Aug 30, 2021
Forked from bowl of fruit

This example demonstrates animated transitions of fruit shapes in an SVG bowl using D3 v5. Circles representing apples and lemons enter, update, and exit with sequential timing, showing how data joins and key functions track object identity. The code uses `d3.scaleOrdinal` for color and radius mappings, `d3.selectAll` and `selection.merge` for enter-update handling, and `transition.duration` to animate circle positions and radii over one second. Fruits are stored as an array with random IDs, and `setTimeout` triggers state changes like removing or replacing items.

AI-generated description

A demonstration of how to start using D3 version 6.