From 0d1fa385f8a35c472c36f7e360937827dc1801ac Mon Sep 17 00:00:00 2001 From: Pitchaya Boonsarngsuk <2285135b@student.gla.ac.uk> Date: Thu, 22 Mar 2018 16:35:48 +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=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/barnesHut.js | 10 +++++----- src/hybridSimulation.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/barnesHut.js b/src/barnesHut.js index 4290fe1..61a634e 100644 --- a/src/barnesHut.js +++ b/src/barnesHut.js @@ -78,11 +78,11 @@ export default function () { // Apply the Barnes-Hut approximation if possible. // Limit forces for very close nodes; randomize direction if coincident. if (w / l < theta) { - if (x === 0) {x = jiggle(); l += x * x;} - if (y === 0) {y = jiggle(); l += y * y;} + if (x === 0) { x = jiggle(); l += x * x; } + if (y === 0) { y = jiggle(); l += y * y; } if (quad.data) { l = (l - +distance(node, quad.data)) / l * alpha; - x *= l, y *= l; + x *= l; y *= l; quad.data.vx -= x; quad.data.vy -= y; node.vx += x; @@ -93,8 +93,8 @@ export default function () { // Limit forces for very close nodes; randomize direction if coincident. if (quad.data !== node || quad.next) { - if (x === 0) {x = jiggle(); l += x * x;} - if (y === 0) {y = jiggle(); l += y * y;} + if (x === 0) { x = jiggle(); l += x * x; } + if (y === 0) { y = jiggle(); l += y * y; } } do { diff --git a/src/hybridSimulation.js b/src/hybridSimulation.js index 59176b4..8722760 100644 --- a/src/hybridSimulation.js +++ b/src/hybridSimulation.js @@ -36,7 +36,7 @@ export default function (sim, forceS, forceF) { simulation = sim, forceSample = forceS, forceFull = forceF, - event = d3.dispatch('sampleTick', 'fullTick', 'startInterp', 'end'), + event = dispatch('sampleTick', 'fullTick', 'startInterp', 'end'), initAlready = false, nodes, alreadyRanIterations,