เปลี่ยนชื่อไฟล์2
This commit is contained in:
29
examples/js/src/example-papaparsing/neighbourSampling.js
Normal file
29
examples/js/src/example-papaparsing/neighbourSampling.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Initialize the Chalmers' 1996 algorithm and start simulation.
|
||||
*/
|
||||
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.000001) //TODO
|
||||
.stableVeloHandler(ended);
|
||||
|
||||
simulation
|
||||
.alphaDecay(0)
|
||||
.alpha(1)
|
||||
.on("tick", ticked)
|
||||
.on("end", ended)
|
||||
.force(forceName, force);
|
||||
// Restart the simulation.
|
||||
simulation.restart();
|
||||
}
|
||||
Reference in New Issue
Block a user