D3 过渡名称 - 它有什么用?

D3 Transition name - What is it for?

D3.js Transition wiki中,Transition的定义是:

d3.transition([selection], [name])

name 有什么用,如何发挥作用?

什么时候用?

AFAIK,这仅在与 transition.each():

结合使用时才有用

The interrupt event is invoked if an active transition is interrupted by another transition of the same name on the same element.

也就是说,如果您需要对同一元素进行多次转换,您可以使用 name 参数分别接收每个中断事件。