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