2013-08-05 59 views
1

類似this example隱藏文本元素

enter image description here

我有一個功能,突出鏈接到所選組的和絃和隱藏所有不相關的和絃:

function fade() { 
    return function(d, i) { 
     svg.selectAll("path.chord") 
     .filter(function(d) { 
      return d.source.index != i && d.target.index != i; 
     }) 
     .style("visibility", "hidden"); 
    }; 
} 

我試圖擴大這個範圍,以便它不僅隱藏了和絃,還顯示了未連接到當前選定組的組的文本標籤。

是否可以將這兩個操作合併爲一個函數,然後傳遞給.on("mouseover",[function])

回答