cellepo
cellepo

Reputation: 4479

D3.js exit transition: delay has no effectD3

I have a D3 BubbleChart where I am trying to get the exit selection of the text in the bubbles to delay removal with the following code; but the delay seems to have no effect... The visualization form the below code behaves identical to it with the delay( 1 ) removed; changing the time parameter to delay anything else does not change the behavior either.

All other transitions in my Bubblechart work as expected.

Any ideas how I could get the delay working? Thanks!

// ... Exit data [from existing g elements], transitioning to 0-radius
  gDataJoin.exit().selectAll( "text" ).transition().delay( 1 ).remove();
  gDataJoin.exit().selectAll( "circle" ).transition().duration( transitionTime ).attr( "r", 0 );
  gDataJoin.exit().transition().delay( transitionTime ).remove();

Upvotes: 0

Views: 1010

Answers (1)

Union find
Union find

Reputation: 8150

delay(1) is the same as delay 1 millisecond. So it's working -- for a millisecond.

Change to:

gDataJoin.exit().selectAll( "text" ).transition().delay( 1000 ).remove();
  gDataJoin.exit().selectAll( "circle" ).transition().duration( transitionTime ).attr( "r", 0 );
  gDataJoin.exit().transition().delay( transitionTime ).remove();

Upvotes: 1

Related Questions