Link fix distanceFunction global var leak
This commit is contained in:
@@ -12,8 +12,8 @@ function startLinkSimulation() {
|
||||
|
||||
if (tweakedVerOfLink) {
|
||||
force = d3.forceLinkFullyConnected()
|
||||
.distance(function (n) {
|
||||
return distanceFunction(n.source, n.target, props, norm);
|
||||
.distance(function (n, m) {
|
||||
return distanceFunction(n, m, props, norm);
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -47,7 +47,7 @@ export default function() {
|
||||
if (!nodes) return;
|
||||
for (let i = 1, n = nodes.length; i < n; i++) {
|
||||
for (let j = 0; j < i; j++) {
|
||||
distances.push(distanceFunction(nodes[i], nodes[j], props, norm));
|
||||
distances.push(distance(nodes[i], nodes[j]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user