From ff6abcd0f446e1011728b0c116bec01d45bba91d Mon Sep 17 00:00:00 2001 From: Pitchaya Boonsarngsuk <2285135b@student.gla.ac.uk> Date: Tue, 6 Feb 2018 13:32:31 +0000 Subject: [PATCH] Fix typo --- src/link.js | 4 ++-- src/stress.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/link.js b/src/link.js index cd979f2..af7f53f 100644 --- a/src/link.js +++ b/src/link.js @@ -15,7 +15,7 @@ export default function() { nodes, stableVelocity = 0, stableVeloHandler = null, - latestVelocityDiff = 0 + latestVelocityDiff = 0, iterations = 1; function force(alpha) { @@ -95,7 +95,7 @@ export default function() { force.latestAccel = function () { return latestVelocityDiff; }; - + force.onStableVelo = function (_) { return arguments.length ? (stableVeloHandler = _, force) : stableVeloHandler; }; diff --git a/src/stress.js b/src/stress.js index aa1a5bd..6d75880 100644 --- a/src/stress.js +++ b/src/stress.js @@ -7,7 +7,7 @@ export function getStress(nodes, distance) { let sumDiffSq = 0 let sumLowDDistSq = 0; - for (let j = nodes.length-1; j >= 1; j++) { + for (let j = nodes.length-1; j >= 1; j--) { for (let i = 0; i < j; i++) { let source = nodes[i], target = nodes[j]; let lowDDist = Math.hypot(target.x - source.x, target.y - source.y);