|
@ -29990,6 +29990,12 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
dy = node2.y - node1.y; |
|
|
dy = node2.y - node1.y; |
|
|
distance = Math.sqrt(dx * dx + dy * dy); |
|
|
distance = Math.sqrt(dx * dx + dy * dy); |
|
|
|
|
|
|
|
|
|
|
|
// same condition as BarnesHut, making sure nodes are never 100% overlapping.
|
|
|
|
|
|
if (distance == 0) { |
|
|
|
|
|
distance = 0.1*Math.random(); |
|
|
|
|
|
dx = distance; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
minimumDistance = (combinedClusterSize == 0) ? nodeDistance : (nodeDistance * (1 + combinedClusterSize * this.constants.clustering.distanceAmplification)); |
|
|
minimumDistance = (combinedClusterSize == 0) ? nodeDistance : (nodeDistance * (1 + combinedClusterSize * this.constants.clustering.distanceAmplification)); |
|
|
var a = a_base / minimumDistance; |
|
|
var a = a_base / minimumDistance; |
|
|
if (distance < 2 * minimumDistance) { |
|
|
if (distance < 2 * minimumDistance) { |
|
@ -29999,13 +30005,13 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
else { |
|
|
else { |
|
|
repulsingForce = a * distance + b; // linear approx of 1 / (1 + Math.exp((distance / minimumDistance - 1) * steepness))
|
|
|
repulsingForce = a * distance + b; // linear approx of 1 / (1 + Math.exp((distance / minimumDistance - 1) * steepness))
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// amplify the repulsion for clusters.
|
|
|
// amplify the repulsion for clusters.
|
|
|
repulsingForce *= (combinedClusterSize == 0) ? 1 : 1 + combinedClusterSize * this.constants.clustering.forceAmplification; |
|
|
repulsingForce *= (combinedClusterSize == 0) ? 1 : 1 + combinedClusterSize * this.constants.clustering.forceAmplification; |
|
|
repulsingForce = repulsingForce / Math.max(distance,0.01*minimumDistance); |
|
|
repulsingForce = repulsingForce / Math.max(distance,0.01*minimumDistance); |
|
|
|
|
|
|
|
|
fx = dx * repulsingForce; |
|
|
fx = dx * repulsingForce; |
|
|
fy = dy * repulsingForce; |
|
|
fy = dy * repulsingForce; |
|
|
|
|
|
|
|
|
node1.fx -= fx; |
|
|
node1.fx -= fx; |
|
|
node1.fy -= fy; |
|
|
node1.fy -= fy; |
|
|
node2.fx += fx; |
|
|
node2.fx += fx; |
|
|