Skip to main content
100%

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

✓ Published0🌍 Public
AAlainRo
Last edited Jun 11, 2018
Created on Jun 11, 2018

This visualization explains D3 transitions by animating seven circles, each representing an independently scheduled transition. Using D3 v3, it demonstrates how `selectAll(...).transition()` creates multiple, independent transitions, and how `delay()`, `duration()`, and named transitions manage their lifecycle. The example visualizes each transition’s schedule with graphical “head,” “body,” and “tail” markers, along with labeled start and end times, and includes controls to play or rewind stages, showing how transitions can be interrupted and overridden.

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