//assumed to be in the scope of stephen's graphing code
function drawIntegral(tuples){
	var c = document.getElementById("graph");
	var ctext = c.getContext("2d");
	//copy of tuples
	lastTuples = deepCopy(tuples);
	scaleXCoords(tuples, xScaling);
	scaleYCoords(tuples, yScaling);
	ctext.beginPath();
	ctext.strokeStyle="#000000";
	ctext.lineWidth=1;
	ctext.moveTo(0,256);
	//loops for each x
	for(var i=0;i<tuples.length;i++){
		//accounts for each y starting at tuple value down to y=1
		for(var j=0;j<tuples[i].y;j++){
			ctext.lineTo((256+tuples[i].x),(256-(tuples[i].y - j)));
			ctext.stroke();
			ctext.moveTo((256+tuples[i].x),(256-(tuples[i].y - j)));
		}
	}
	ctext.closePath();
	drawBorder();
}
@@ -494,16 +494,96 @@
 to y=1%0D%0A
+%09%09//conditional required for functions below the x-axis%0D%0A%09%09if(tuples%5Bi%5D.y%3E0)%7B%0D%0A%09
 %09%09for(va
@@ -608,24 +608,25 @@
 y;j++)%7B%0D%0A%09%09%09
+%09
 ctext.lineTo
@@ -667,24 +667,25 @@
 .y - j)));%0D%0A
+%09
 %09%09%09ctext.str
@@ -695,16 +695,17 @@
 ();%0D%0A%09%09%09
+%09
 ctext.mo
@@ -754,16 +754,464 @@
  j)));%0D%0A
+%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09else if(tuples%5Bi%5D.y%3C0)%7B%0D%0A%09%09%09for(var j=0;j%3Ctuples%5Bi%5D.y;j++)%7B%0D%0A%09%09%09%09ctext.lineTo((256+tuples%5Bi%5D.x),(256-(tuples%5Bi%5D.y + j)));%0D%0A%09%09%09%09ctext.stroke();%0D%0A%09%09%09%09ctext.moveTo((256+tuples%5Bi%5D.x),(256-(tuples%5Bi%5D.y + j)));%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09else if(tuples%5Bi%5D.y==0)%7B%0D%0A%09%09%09//integral is zero so%0D%0A%09%09%09ctext.lineTo((256+tuples%5Bi%5D.x),(256-tuples%5Bi%5D.y));%0D%0A%09%09%09ctext.stroke();%0D%0A%09%09%09ctext.moveTo((256+tuples%5Bi%5D.x),(256-tuples%5Bi%5D.y));%0D%0A%09%09%7D%0D%0A%09%09else%7B%0D%0A%09%09%09//out of bounds%0D%0A
 %09%09%7D%0D%0A%09%7D%0D
@@ -1249,8 +1249,10 @@
 er();%0D%0A%7D
+%0D%0A

Update drawintegral.js