Velo changes scale per node instead
This commit is contained in:
@@ -15,7 +15,7 @@ function startLinkSimulation() {
|
|||||||
.distance(function (n, m) {
|
.distance(function (n, m) {
|
||||||
return distanceFunction(n, m, props, norm);
|
return distanceFunction(n, m, props, norm);
|
||||||
})
|
})
|
||||||
.stableVelocity(0.000001) //TODO
|
.stableVelocity(0) //TODO
|
||||||
.onStableVelo(ended);
|
.onStableVelo(ended);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default function() {
|
|||||||
node = nodes[i];
|
node = nodes[i];
|
||||||
velocityDiff += Math.abs(Math.hypot(node.vx-node.oldvx, node.vy-node.oldvy));
|
velocityDiff += Math.abs(Math.hypot(node.vx-node.oldvx, node.vy-node.oldvy));
|
||||||
}
|
}
|
||||||
velocityDiff /= n*(n-1);
|
velocityDiff /= n;
|
||||||
latestVelocityDiff = velocityDiff;
|
latestVelocityDiff = velocityDiff;
|
||||||
|
|
||||||
if(velocityDiff<stableVelocity){
|
if(velocityDiff<stableVelocity){
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export default function () {
|
|||||||
node = nodes[i];
|
node = nodes[i];
|
||||||
velocityDiff += Math.abs(Math.hypot(node.vx-node.oldvx, node.vy-node.oldvy));
|
velocityDiff += Math.abs(Math.hypot(node.vx-node.oldvx, node.vy-node.oldvy));
|
||||||
}
|
}
|
||||||
velocityDiff /= n*(neighbourSize+sampleSize);
|
velocityDiff /= n;
|
||||||
latestVelocityDiff = velocityDiff;
|
latestVelocityDiff = velocityDiff;
|
||||||
|
|
||||||
if(velocityDiff<stableVelocity){
|
if(velocityDiff<stableVelocity){
|
||||||
|
|||||||
Reference in New Issue
Block a user