最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - D3 listening to "end" event of a transition - Stack Overflow

programmeradmin1浏览0评论

I'm learning D3 and following this lesson: ;index=8&list=PL6il2r9i3BqH9PmbOf5wA5E1wOG3FT22p

Why is .each("end", function() {...} producing this error? Uncaught TypeError: callback.call is not a function

var canvas3 = d3.select("#doooo")
                .append("svg")
                .attr("width", 500)
                .attr("height", 500)
var circle3 = canvas3.append("circle")
                .attr("cx", 50)
                .attr("cy", 50)
                .attr("r", 25)

circle3.transition()
    .duration(1500)
    .attr("cx", 150)
    .each("end", function() { console.log("This is producing an error"); })

I'm learning D3 and following this lesson: https://www.youtube.com/watch?v=EpeOzq8eDYk&index=8&list=PL6il2r9i3BqH9PmbOf5wA5E1wOG3FT22p

Why is .each("end", function() {...} producing this error? Uncaught TypeError: callback.call is not a function

var canvas3 = d3.select("#doooo")
                .append("svg")
                .attr("width", 500)
                .attr("height", 500)
var circle3 = canvas3.append("circle")
                .attr("cx", 50)
                .attr("cy", 50)
                .attr("r", 25)

circle3.transition()
    .duration(1500)
    .attr("cx", 150)
    .each("end", function() { console.log("This is producing an error"); })
Share Improve this question asked Aug 17, 2016 at 2:26 bevanbbevanb 8,52110 gold badges54 silver badges94 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 23

Ah, .each("end", function() {...}) (version 3) seems to have been replaced by .on("end", ...) in version 4.

发布评论

评论列表(0)

  1. 暂无评论