简体   繁体   中英

How do I interpret the __transition__ property that D3 attaches to DOM elements as part of a transition?

I implemented a chained transition using the transition.transition() pattern ( https://github.com/mbostock/d3/wiki/Transitions#transition ).

The __transition__ property after the first transition is scheduled:

{"4":{"tween":{},"time":1410878734661,"delay":0,"duration":1500},"active":0,"count":1}

The __transition__ property after the second transition is scheduled:

{"4":{"tween":{},"time":1410878734661,"delay":0,"duration":1500},"5":{"tween":{},"time":1410878734661,"delay":1500,"duration":500},"active":0,"count":2} 

Is "4" the id associated with both parts of this chained transition? Does active:0 indicate there are no actively running transitions? Does the count property indicate the number of transitions scheduled?

Thanks in advance!

var t0 = text.transition().delay(0).duration(1500) //first transition
var t1 = t0.transition().ease("bounce").duration(500) //second transition

The numbers in your object are indeed the ID of the transitions. active holds the ID of the active transition and count the total number of transitions.

More information in the source .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM