From 8e34697d8994e61e5d97a9775d846a6cb2ffdcfa Mon Sep 17 00:00:00 2001 From: Pitchaya Boonsarngsuk <2285135b@student.gla.ac.uk> Date: Thu, 22 Mar 2018 16:22:43 +0000 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20coding=20style=20?= =?UTF-8?q?=E0=B8=A0=E0=B8=B2=E0=B8=84=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 10 +++++----- src/link.js | 2 +- src/stress.js | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index a383b74..2c35d8b 100644 --- a/index.js +++ b/index.js @@ -1,17 +1,17 @@ export {default as forceNeighbourSampling} from './src/neighbourSampling'; -export { default as forceBarnesHut} +export {default as forceBarnesHut} from './src/barnesHut'; -export { default as tSNE} +export {default as tSNE} from './src/t-sne'; -export { default as forceLinkCompleteGraph} +export {default as forceLinkCompleteGraph} from './src/link'; -export { default as hybridSimulation} +export {default as hybridSimulation} from './src/hybridSimulation'; -export { getStress as calculateStress } +export {getStress as calculateStress} from './src/stress'; diff --git a/src/link.js b/src/link.js index 80c7af8..e94d33a 100644 --- a/src/link.js +++ b/src/link.js @@ -41,7 +41,7 @@ export default function () { y = target.y + target.vy - source.y - source.vy || jiggle(); l = Math.sqrt(x * x + y * y); l = (l - distances[i * (i - 1) / 2 + j]) / l * dataSizeFactor * alpha; - x *= l, y *= l; + x *= l; y *= l; target.vx -= x; target.vy -= y; source.vx += x; diff --git a/src/stress.js b/src/stress.js index df54fec..785323b 100644 --- a/src/stress.js +++ b/src/stress.js @@ -9,7 +9,8 @@ export function getStress (nodes, distance) { let sumLowDDistSq = 0; for (let j = nodes.length - 1; j >= 1; j--) { for (let i = 0; i < j; i++) { - let source = nodes[i], target = nodes[j]; + let source = nodes[i]; + let target = nodes[j]; let lowDDist = Math.hypot(target.x - source.x, target.y - source.y); let highDDist = distance(source, target); sumDiffSq += Math.pow(highDDist - lowDDist, 2);