简体   繁体   English

我如何解释D3在过渡过程中附加到DOM元素的__transition__属性?

[英]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 ). 我使用transition.transition()模式( https://github.com/mbostock/d3/wiki/Transitions#transition )实现了一个链式过渡。

The __transition__ property after the first transition is scheduled: 安排了第一次转换后的__transition__属性:

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

The __transition__ property after the second transition is scheduled: 计划第二次转换后的__transition__属性:

{"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? 这个链接转换的两个部分的ID是否为“ 4”? Does active:0 indicate there are no actively running transitions? active:0是否指示没有正在运行的过渡? Does the count property indicate the number of transitions scheduled? count属性是否指示计划的转换数?

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. 对象中的数字确实是转换的ID。 active holds the ID of the active transition and count the total number of transitions. active保留活动过渡的ID,并count过渡总数。

More information in the source . 来源中有更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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