Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Color balls - transition

Public visualization

Viewing a saved revision (read-only)

624cf6153906460b9f9d17a6aa965d21

Color balls - transition

0 stars0🌍 Public
GGanesh Avalur
Last edited Jul 1, 2021
Created on Jul 1, 2021

Five colored circles transition between states—an apple is removed, a lemon replaces an apple, and another apple disappears—while hover highlights a circle with a black outline. Using D3 v5’s `select` and `scaleOrdinal`, the `fruitBowl` function applies `transition().duration(1000)` to animate `attr('r')` and `attr('cx')` as circles enter, merge, or exit. The SVG’s fill and stroke update per data type (`apple` or `lemon`) through ordinal scales, with mouseover events triggering selection.

AI-generated description