🌍 Public
Fade Out Fade In 2
Two groups of circles swap places on a D3.js SVG stage: two blue circles fade out and are removed, then four red circles fade in. The example demonstrates a common sequencing pitfall—the new data join executes before the old elements’ removal transition completes, causing selection conflicts. It uses d3.selectAll, data joins, .enter(), and transition().remove() in D3 v7, with fill-opacity transitions timed via .delay() to coordinate the fade-out and fade-in phases.
AI-generated descriptionFade Out Fade In 2
Trying to figure out how to remove elements and then make a new selection. There should be four red circles, not two. The new selection is being made before the first elements are removed.
(Connected with d3 Slack question)
MIT Licensed








Comments
Sign in to join the discussion.