如何在第一个和最后一个元素之间运行连续循环
以下是示例代码
d3.selectAll('.radarArea').each(function (d, i) {
// add style to this element
// remove style to other than this element.
// if it is last then again start from first element
});
由于
答案 0 :(得分:1)
来自d3的API旨在:https://github.com/d3/d3-transition#active
但它需要v4,但尚未完成,所以:
var radarAreas = d3.selectAll('.radarArea')
setInterval(function() {
radarAreas.each(function (d, i) {
// add style to this element
// remove style to other than this element.
// if it is last then again start from first element
});
}, time)