🌍 Public
Viewing a saved revision (read-only)
0941cdc3f3d240b7a11ad515d51d0004
Bowl of Fruit: Object Constancy
Five apples appear in a row, then fade and slide in response to timed data updates that remove fruits or change an apple into a lemon, preserving each circle’s identity via a stable `id` key. The example demonstrates D3’s object constancy pattern by using `selection.data` with a key function, `enter`, `merge`, and `exit` selections, plus chained `transition` calls to animate radius and x-position over one second. Rendering uses SVG circles with d3-color scales for fill and size.
AI-generated descriptionD3 course follow along.