Bowl of Fruit: Object Constancy
✓ Published0🌍 Public
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.
MIT Licensed