|
|
|
@ -71,6 +71,12 @@ BallRenderer.prototype = {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
addLinePoint: function(x, y){
|
|
|
|
|
if(!this.line){
|
|
|
|
|
this.line = [];
|
|
|
|
|
}
|
|
|
|
|
line.push({x,y});
|
|
|
|
|
},
|
|
|
|
|
horizontalLine: function(xi, xf, yi, x0, y0){
|
|
|
|
|
// Assumes xi is on the left and xf is on the right
|
|
|
|
|
if(typeof this.drawnTemp[yi] === "undefined"){
|
|
|
|
@ -94,6 +100,17 @@ BallRenderer.prototype = {
|
|
|
|
|
return Math.sqrt( xs + ys );
|
|
|
|
|
},
|
|
|
|
|
draw: function(dataArray){
|
|
|
|
|
if(this.line){
|
|
|
|
|
ctx.beginPath()
|
|
|
|
|
for (i in this.line){
|
|
|
|
|
if(i === 0) this.ctx.moveTo(this.line[i].x, this.line[i].x);
|
|
|
|
|
else{
|
|
|
|
|
this.ctx.lineTo(this.line[i].x, this.line[i].x);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ctx.endPath();
|
|
|
|
|
}
|
|
|
|
|
ctx.stroke();
|
|
|
|
|
if (!dataArray){
|
|
|
|
|
if (this.isoplethLayer) dataArray = this.isoplethLayer;
|
|
|
|
|
else if (this.contourLayer) dataArray = this.contourLayer;
|
|
|
|
|