Skip to main content
100%

D3.selectAll(...).transition() Explained

✓ Published0🌍 Public
TThanaporn-sk
Last edited Apr 29, 2017
Created on Apr 29, 2017

This example demonstrates that D3’s `selectAll(...).transition()` creates one independent transition per selected element, each with its own scheduled lifecycle. Interactive radio buttons let viewers step through stages that visualize these transitions as animated lines, heads, and tails, highlighting how `.delay()` and `.duration()` vary per circle. The block uses d3.v3 with named transitions (`transition("playStage1")`) to manage overlapping animations, and explicitly illustrates the transition lifecycle from scheduling to stopping. Circles move vertically while timestamp labels show each transition’s start and end times.

AI-generated description

I hope this sequel will help you to understand how a d3-transition works, specifically when it is applied on multiple elements.

The main objective of this sequel is to illustrate that:

  • selectAll(...).transition() defines several transitions
  • each transition runs independantly

This sequel also illustrates:

  • the use of transition().delay(...), transition().duration()
  • the lifecycle of a transition (scheduled/starting/running/ending/stopped)

This sequel uses D3 v3.5.5.

If you look at the code, you will see that:
  • I use named transition in order to run several transition on the same element
  • I stop running transitions by overriding the adequate named transitions

forked from <a href='http://bl.ocks.org/Kcnarf/'>Kcnarf</a>'s block: <a href='http://bl.ocks.org/Kcnarf/9e4813ba03ef34beac6e'>D3.selectAll(...).transition() Explained</a>

lgpl-3.0 Licensed

Similar vizzes