Fix Link Force adding 2 links per pair of node
This commit is contained in:
@@ -12,7 +12,7 @@ function startLinkSimulation() {
|
|||||||
// Initialize link array.
|
// Initialize link array.
|
||||||
nodes = simulation.nodes();
|
nodes = simulation.nodes();
|
||||||
for (i = 0; i < nodes.length; i++) {
|
for (i = 0; i < nodes.length; i++) {
|
||||||
for (j = 0; j < nodes.length; j++) {
|
for (j = 0; j < i; j++) {
|
||||||
if (i !== j) {
|
if (i !== j) {
|
||||||
links.push({
|
links.push({
|
||||||
source: nodes[i],
|
source: nodes[i],
|
||||||
|
|||||||
Reference in New Issue
Block a user