Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Object constancy

Public visualization

Viewing a saved revision (read-only)

dbe9a41add7f4ab192373bcf354ec021

Object constancy

0 stars0🌍 Public
Aalobry
Last edited Dec 17, 2020
Created on Dec 17, 2020
Forked from Bowl of fruits

Five fruits sit in a row as colored circles with labels, shifting position when an apple is removed or changed into a lemon. The d3 selection with a key function preserves each fruit’s identity across updates, while `transition().duration()` animates the circle’s radius to zero on exit and slides the remaining fruits to their new slots. `scaleOrdinal` maps fruit type to color and radius, and all rendering uses SVG.

AI-generated description

SVG HTML

Exercice : Add transition!