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。
是的,我確認,我刪除它,現在它完美的作品。謝謝。 –