แก้ coding style ภาค 10

This commit is contained in:
Pitchaya Boonsarngsuk
2018-03-22 16:40:27 +00:00
parent 400eab7e80
commit cd0f3687cb
14 changed files with 104 additions and 109 deletions

View File

@@ -1,28 +1,28 @@
/**
* Initialize the Chalmers' 1996 algorithm and start simulation.
*/
function startNeighbourSamplingSimulation() {
console.log("startNeighbourSamplingSimulation");
//springForce = true;
function startNeighbourSamplingSimulation () {
console.log('startNeighbourSamplingSimulation');
// springForce = true;
alreadyRanIterations = 0;
manualStop = true;
simulation.stop();
p1 = performance.now();
let force = d3.forceNeighbourSampling()
.neighbourSize(NEIGHBOUR_SIZE)
.sampleSize(SAMPLE_SIZE)
.distance(function (s, t) {
return distanceFunction(s, t, props, norm);
})
.stableVelocity(0) // Change here
.onStableVelo(ended);
.neighbourSize(NEIGHBOUR_SIZE)
.sampleSize(SAMPLE_SIZE)
.distance(function (s, t) {
return distanceFunction(s, t, props, norm);
})
.stableVelocity(0) // Change here
.onStableVelo(ended);
simulation
.alphaDecay(0)
.alpha(1)
.on("tick", ticked)
.on("end", ended)
.on('tick', ticked)
.on('end', ended)
.force(forceName, force);
// Restart the simulation.
simulation.restart();