Fix incomplete commits
This commit is contained in:
@@ -312,4 +312,4 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -354,23 +354,11 @@ function startHybridSimulation() {
|
|||||||
|
|
||||||
|
|
||||||
hybridSimulation
|
hybridSimulation
|
||||||
.on("sampleTick", tickedHybrid)
|
.on("sampleTick", ticked)
|
||||||
.on("fullTick", tickedHybrid)
|
.on("fullTick", ticked)
|
||||||
.on("startFull", startedFull)
|
.on("startFull", startedFull)
|
||||||
.on("end", endedHybrid);
|
.on("end", endedHybrid);
|
||||||
|
|
||||||
function tickedHybrid() {
|
|
||||||
if (rendering === true) {
|
|
||||||
node
|
|
||||||
.attr("cx", function (d) {
|
|
||||||
return d.x;
|
|
||||||
})
|
|
||||||
.attr("cy", function (d) {
|
|
||||||
return d.y;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function startedFull() {
|
function startedFull() {
|
||||||
d3.selectAll(".nodes").remove();
|
d3.selectAll(".nodes").remove();
|
||||||
// Add the nodes to DOM.
|
// Add the nodes to DOM.
|
||||||
|
|||||||
@@ -48,11 +48,13 @@ export default function (nodes, config) {
|
|||||||
function ended() {
|
function ended() {
|
||||||
event.call("startFull");
|
event.call("startFull");
|
||||||
console.log("Ended sample simulation");
|
console.log("Ended sample simulation");
|
||||||
|
alert('About to interpolate');
|
||||||
|
interpolation(sample, remainder, sampleSubset, distanceFn);
|
||||||
/*
|
/*
|
||||||
if (PIVOTS) {
|
if (PIVOTS) {
|
||||||
interpolationPivots(sample, remainder, interpSubset, NUMPIVOTS, distance);
|
interpolationPivots(sample, remainder, sampleSubSet, NUMPIVOTS, distance);
|
||||||
} else {
|
} else {
|
||||||
interpolation(sample, remainder, interpSubset, distance);
|
interpolation(sample, remainder, sampleSubSet, distance);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
event.call("fullTick");
|
event.call("fullTick");
|
||||||
@@ -72,6 +74,8 @@ export default function (nodes, config) {
|
|||||||
.sampleSize(FullsampleSize)
|
.sampleSize(FullsampleSize)
|
||||||
.distanceRange(FulldistanceRange)
|
.distanceRange(FulldistanceRange)
|
||||||
.distance(distanceFn)
|
.distance(distanceFn)
|
||||||
|
.stableVelocity(60)
|
||||||
|
.stableVeloHandler(function(){fullSimulation.stop(); event.call("end");})
|
||||||
)
|
)
|
||||||
.on("tick", function () {
|
.on("tick", function () {
|
||||||
event.call("fullTick", fullSimulation);
|
event.call("fullTick", fullSimulation);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ function placeNearToNearestNeighbour(node, minNode, radius, sampleSubset, realDi
|
|||||||
|
|
||||||
let angle = binarySearchMin(lowBound, highBound,
|
let angle = binarySearchMin(lowBound, highBound,
|
||||||
function(angle){
|
function(angle){
|
||||||
return sumDistError(pointOnCircle(minNode.x, minNode.y, angle, radius), samples, realDistances);
|
return sumDistError(pointOnCircle(minNode.x, minNode.y, angle, radius), sampleSubset, realDistances);
|
||||||
});
|
});
|
||||||
let newPoint = pointOnCircle(minNode.x, minNode.y, angle, radius);
|
let newPoint = pointOnCircle(minNode.x, minNode.y, angle, radius);
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export default function () {
|
|||||||
findNewNeighbours(i);
|
findNewNeighbours(i);
|
||||||
}
|
}
|
||||||
velocity /= nodes.length*alpha;
|
velocity /= nodes.length*alpha;
|
||||||
// Now total velocity change per node, alpha not considered
|
// Now total velocity changes per node, alpha not considered
|
||||||
if(Math.abs(velocity)<stableVelocity && stableVeloHandler!== null){
|
if(Math.abs(velocity)<stableVelocity && stableVeloHandler!== null){
|
||||||
console.log("Neighbour sampling is now", velocity, ", calling stableVeloHandler().")
|
console.log("Neighbour sampling is now", velocity, ", calling stableVeloHandler().")
|
||||||
stableVeloHandler();
|
stableVeloHandler();
|
||||||
|
|||||||
Reference in New Issue
Block a user