Completed cleanup run
This commit is contained in:
@@ -28,6 +28,7 @@ export default function (nodes, config) {
|
|||||||
var interpSubset = sampleFromNodes(sample, sample.length, Math.sqrt(sample.length)).sample;
|
var interpSubset = sampleFromNodes(sample, sample.length, Math.sqrt(sample.length)).sample;
|
||||||
|
|
||||||
var sampleSimulation = d3.forceSimulation(sample)
|
var sampleSimulation = d3.forceSimulation(sample)
|
||||||
|
.stop()
|
||||||
.alphaDecay(1 - Math.pow(0.001, 1 / SAMPLE_ITERATIONS));
|
.alphaDecay(1 - Math.pow(0.001, 1 / SAMPLE_ITERATIONS));
|
||||||
|
|
||||||
sampleSimulation
|
sampleSimulation
|
||||||
@@ -38,38 +39,44 @@ export default function (nodes, config) {
|
|||||||
.force("neighbourSampling", neighbourSamplingDistance()
|
.force("neighbourSampling", neighbourSamplingDistance()
|
||||||
.neighbourSize(neighbourSize)
|
.neighbourSize(neighbourSize)
|
||||||
.sampleSize(sampleSize)
|
.sampleSize(sampleSize)
|
||||||
|
.distanceRange(distanceRange)
|
||||||
.distance(distance)
|
.distance(distance)
|
||||||
.multiplier(MULTIPLIER)
|
.multiplier(MULTIPLIER)
|
||||||
)
|
)
|
||||||
.stop()
|
|
||||||
.alpha(1).restart();
|
.alpha(1).restart();
|
||||||
|
|
||||||
function ended() {
|
function ended() {
|
||||||
|
console.log("Ended sample simulation");
|
||||||
|
/*
|
||||||
if (PIVOTS) {
|
if (PIVOTS) {
|
||||||
interpolationPivots(sample, remainder, interpSubset, NUMPIVOTS, distance);
|
interpolationPivots(sample, remainder, interpSubset, NUMPIVOTS, distance);
|
||||||
} else {
|
} else {
|
||||||
interpolation(sample, remainder, interpSubset, distance);
|
interpolation(sample, remainder, interpSubset, distance);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
if (FULL_ITERATIONS==0) return;
|
||||||
fullSimulation = d3.forceSimulation()
|
fullSimulation = d3.forceSimulation()
|
||||||
|
.stop()
|
||||||
.alphaDecay(1 - Math.pow(0.001, 1 / FULL_ITERATIONS));
|
.alphaDecay(1 - Math.pow(0.001, 1 / FULL_ITERATIONS));
|
||||||
|
|
||||||
event.call("startFull", fullSimulation);
|
event.call("startFull", fullSimulation);
|
||||||
|
|
||||||
fullSimulation
|
fullSimulation
|
||||||
.force("neighbourSampling", d3.forceNeighbourSampling()
|
.force("neighbourSampling", neighbourSamplingDistance()
|
||||||
.distance(function (s, t) {
|
.neighbourSize(FullneighbourSize)
|
||||||
return distance(s, t, props, norm) * MULTIPLIER;
|
.sampleSize(FullsampleSize)
|
||||||
})
|
.distanceRange(FulldistanceRange)
|
||||||
.neighbourSize(neighbourSize)
|
.distance(distance)
|
||||||
.sampleSize(sampleSize))
|
.multiplier(MULTIPLIER)
|
||||||
.nodes(nodes)
|
)
|
||||||
.on("tick", function () {
|
.on("tick", function () {
|
||||||
event.call("fullTick", fullSimulation);
|
event.call("fullTick", fullSimulation);
|
||||||
})
|
})
|
||||||
.on("end", function () {
|
.on("end", function () {
|
||||||
event.call("end", fullSimulation);
|
event.call("end", fullSimulation);
|
||||||
});
|
})
|
||||||
|
.nodes(nodes)
|
||||||
|
.alpha(1).restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
return hybrid = {
|
return hybrid = {
|
||||||
|
|||||||
Reference in New Issue
Block a user