Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Color balls - transition

Public visualization

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

Comments

Sign in to join the discussion.

MIT Licensed