1
我正在做強制佈局,在事件點擊我添加新節點並按行連接。但是 行重疊節點。爲什麼?我的代碼被示http://jsfiddle.net/WRGtL/D3 js線重疊節點
function click(d) {
if (d3.event.defaultPrevented) return; // ignore drag
//alert("clicked");
var d = {id:"d"};
nodes.push(nodeId[index]);
if(index==0)
links.push({source: a, target: nodeId[index]});
else
links.push({source: nodes[1], target: nodeId[index]});
index++;
start();
}
很好。我接受了你的答案。謝謝! –