Questions tagged «chord»

1
在D3力向图中突出显示选定的节点,其链接及其子级
我正在D3中制作力导向图。我想通过将所有其他节点和链接设置为较低的不透明度来突出显示mouseover'd节点,其链接及其子节点。 在本例中,http://jsfiddle.net/xReHA/,我能够淡出所有链接和节点,然后淡入连接的链接,但是到目前为止,我还不能优雅地淡入是当前鼠标悬停节点的子节点的已连接节点。 这是代码中的关键功能: function fade(opacity) { return function(d, i) { //fade all elements svg.selectAll("circle, line").style("opacity", opacity); var associated_links = svg.selectAll("line").filter(function(d) { return d.source.index == i || d.target.index == i; }).each(function(dLink, iLink) { //unfade links and nodes connected to the current node d3.select(this).style("opacity", 1); //THE FOLLOWING CAUSES: Uncaught TypeError: Cannot call …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.