From 27a289cdf33bb9340a8ed84944edd3c4471c692f Mon Sep 17 00:00:00 2001 From: miles Date: Mon, 19 Nov 2012 19:29:42 +0000 Subject: [PATCH] species inclusion check boxes now in a table. Revised instructions slightly. Renamed important functions. Select and Deselect All buttons implimented. svn path=/; revision=414 --- Personnel/miles/Web Page/heatMap.php | 33 +++++++++++++--------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Personnel/miles/Web Page/heatMap.php b/Personnel/miles/Web Page/heatMap.php index 333eb9b..60fd39e 100644 --- a/Personnel/miles/Web Page/heatMap.php +++ b/Personnel/miles/Web Page/heatMap.php @@ -330,20 +330,21 @@ function drawMap(init) { } function drawKey() { + var keyStart = leftOffset + (speciesCount * cellSize); //drawing the key //0 heatMap.fillStyle="#5C5C5C"; - heatMap.fillRect(1030,(topOffset-topScrollOffset),cellSize,cellSize); + heatMap.fillRect(keyStart + 30,(topOffset-topScrollOffset),cellSize,cellSize); heatMap.fillStyle="#000000"; - heatMap.fillText("= 0",1060,13 + (topOffset-topScrollOffset)); - heatMap.strokeRect(1030-borderWidth/2,(topOffset-topScrollOffset)-borderWidth/2,cellSize,cellSize); + heatMap.fillText("= 0",keyStart + 60,13 + (topOffset-topScrollOffset)); + heatMap.strokeRect(keyStart + 30 - borderWidth/2,(topOffset-topScrollOffset)-borderWidth/2,cellSize,cellSize); //1 heatMap.fillStyle="#CFB52B"; - heatMap.fillRect(1030,cellSize+5+(topOffset-topScrollOffset),cellSize,cellSize); + heatMap.fillRect(keyStart + 30,cellSize+5+(topOffset-topScrollOffset),cellSize,cellSize); heatMap.fillStyle="#000000"; - heatMap.fillText("= 1",1060,5+(3/2)*cellSize + (topOffset-topScrollOffset)); - heatMap.strokeRect(1030-borderWidth/2,(topOffset-topScrollOffset) + 5+cellSize - borderWidth/2,cellSize,cellSize); + heatMap.fillText("= 1",keyStart + 60,5+(3/2)*cellSize + (topOffset-topScrollOffset)); + heatMap.strokeRect(keyStart + 30-borderWidth/2,(topOffset-topScrollOffset) + 5+cellSize - borderWidth/2,cellSize,cellSize); //2 if(maxCount == 2) { @@ -352,10 +353,10 @@ function drawKey() { else { heatMap.fillStyle="#0000FF"; } - heatMap.fillRect(1030,2*(cellSize+5)+(topOffset-topScrollOffset),cellSize,cellSize); + heatMap.fillRect(keyStart + 30,2*(cellSize+5)+(topOffset-topScrollOffset),cellSize,cellSize); heatMap.fillStyle="#000000"; - heatMap.fillText("= 2",1060,10+(5/2)*cellSize+(topOffset-topScrollOffset)); - heatMap.strokeRect(1030-borderWidth/2,(topOffset-topScrollOffset)+2*(cellSize+5)-borderWidth/2,cellSize,cellSize); + heatMap.fillText("= 2",keyStart + 60,10+(5/2)*cellSize+(topOffset-topScrollOffset)); + heatMap.strokeRect(keyStart + 30-borderWidth/2,(topOffset-topScrollOffset)+2*(cellSize+5)-borderWidth/2,cellSize,cellSize); //3+ var i=7; @@ -375,13 +376,13 @@ function drawKey() { bluecolor = "0" + bluecolor; } heatMap.fillStyle="#" + redcolor + "00" + bluecolor; - heatMap.fillRect(1030, 5+cellSize+(k-1)*(cellSize+5) + (topOffset-topScrollOffset),cellSize,cellSize); + heatMap.fillRect(keyStart + 30, 5+cellSize+(k-1)*(cellSize+5) + (topOffset-topScrollOffset),cellSize,cellSize); heatMap.fillStyle="#000000"; var key = Math.floor((k-2)*((maxCount-2)/(i-3)) + 2); // var key = Math.floor((k+1)*(maxCount-2)/i); var txt = "= " + key; - heatMap.fillText(txt,1060,5+(3/2*cellSize)+(k-1)*(cellSize+5) + (topOffset-topScrollOffset)); - heatMap.strokeRect(1030-borderWidth/2, 5+cellSize+(k-1)*(cellSize+5) + (topOffset-topScrollOffset) - borderWidth/2,cellSize,cellSize); + heatMap.fillText(txt,keyStart + 60,5+(3/2*cellSize)+(k-1)*(cellSize+5) + (topOffset-topScrollOffset)); + heatMap.strokeRect(keyStart+30-borderWidth/2, 5+cellSize+(k-1)*(cellSize+5) + (topOffset-topScrollOffset) - borderWidth/2,cellSize,cellSize); } } @@ -458,10 +459,6 @@ canvas.addEventListener('mouseup', showInfo, false); \ No newline at end of file -- 2.34.1