0
我试图复制Hierarchical edge bundling case,但添加了鼠标悬停并单击创建的链接(svg中的路径)。当我添加.on("click")
或.on("mouseover")
到link
除了在事件监听器上,他们不工作。d3:使用鼠标点击链接的分层边缘绑定
我已经所述示例的变化是:
link = link
.data(bundle(links))
.enter().append("path")
.each(function(d) {
d.source = d[0], d.target = d[d.length - 1];
})
.attr("class", "link")
.attr("d", line)
.on('click', function(d) {
alert('mouseover');
});
我的代码here。
是的,我确认,我删除它,现在它完美的作品。谢谢。 –