我有一个d3.js图,它是由一系列对象组成的,例如:
svg.selectAll(".circ").data(dataArr) // dataArr is my array of objects
.enter().append("circle")
.attr("cy", function (d) {
return d.y
})
.attr("cx", function (d) {
return d.x
})
.attr("r", ele
当我从下面的例子学习代码时,我想我几乎得到了所有的东西。
除了我无法在我的生活中看到tick()是如何继续被调用的。(意思是,这个函数继续运行,因此继续更新图形。)
滴答不被调用,也没有设置间隔或类似的东西。我也不明白.each(“结束”、“滴答”)做什么。有人能告诉我吗?这是使用d3.js
tick();
function tick() {
// push a new data point onto the back
data.push(random());
// redraw the line, and slide it to the left
path
.a