Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fade Out Fade In 2

Public visualization

Viewing a saved revision (read-only)

959dc2219f4246d6a8f50c0ba5bd7f0c

Fade Out Fade In 2

0 stars3🌍 Public
Rrnyc1
Last edited Nov 27, 2021
Created on Nov 27, 2021
Forked from Fade Out Fade In

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 description

Fade 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)