Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

About fruits

Public visualization

Viewing a saved revision (read-only)

b28fe3c176b8492887377f8a56238bfa

About fruits

0 stars1🌍 Public
WWhitney Hung
Last edited Jun 3, 2020
Created on May 28, 2020

This example shows how a data join animates changes to a fruit bowl. Five apples are initially rendered as circles, then one is removed, another transforms into a lemon, and a third is eaten, all with smooth transitions. Using D3's `select`, `range`, and `scaleOrdinal`, the `fruitBowl` function manages circle enter, update, and exit states via `.transition().duration(1000)`, animating radius and position. The SVG output is updated dynamically as JavaScript timeouts trigger the re-rendering.

AI-generated description