我自己在D3工作,我跟着这个问题:Highlight selected node, its links, and its children in a D3 force directed graph
对我来说这一切似乎都很简单。但是我仍然没有突出显示链接的节点。链接工作正常。
function neighboring(a, b) {
return data.links.some(function(d) {
return (d.source === a && d.target === b) || (d.source === b && d.target === a);
});
}
完整的jsfiddle在这里:http://jsfiddle.net/D82TK/1/
有人能指出我的错误吗?