我有一个d3选择,我已经定义了事件回调。如何从外部触发d3事件
var obj = d3.select("#kk").on("mouseleave",function(){
console.log("mouse leave");
});
如何从外部触发事件?有什么样:
obj.mouseleave(); // actuall mouse leave function calling
如果有,如果我选择的对象,而指的是obj
,将触发还能用吗?
如:
var newObje=d3.select("#kk");
newObje.mouseleave(); //will this trigger the previously defined instructions
这很酷,很棒的除了d3 v4,不知道这个! –