$input = substr_replace($input ,"",-1);
}
}
-exec("java -jar Heatmap.jar " . $input, $output);
+$finalInput = "webpage " . $input;
+exec("java -Djava.awt.headless=true -jar Heatmap.jar " . $finalInput, $output);
//main heatmap data parsing
$tmp;
<br> <br> <br> <br> <br> <br>
-
-<body>
Click on a species name, cluster number, or cell for more information.
<br> Scroll down to see more clusters, right to see more species (if any exist).
<br>
<input type="submit" value="Jump to Cluster:" onClick="return jumpToCluster()"/>
<input type="text" name="cluster" />
</form>
-</body>
<div id="canvasDiv" style="overflow: auto; height: 515px; width: 1100px;" onscroll="drawMap();">
<canvas id="myCanvas" width="1500" height="1000" style="border:1px solid #c3c3c3;">
Your browser does not support the canvas element.
-</canvas>
+</canvas> </div>
+
+<form name="downloadImage" >
+<input type="button" value="Download as JPG" onClick="generateImage()"/>
+</form>
+
+</body>
<script type="text/javascript">
heatMap.fillStyle="#" + redcolor + "00" + bluecolor;
heatMap.fillRect(1030, 5+cellSize+(k-1)*(cellSize+5) + (topOffset-topScrollOffset),cellSize,cellSize);
heatMap.fillStyle="#000000";
- var key = Math.floor((k-2)*((maxCount-2)/2) + 2);
+ 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));
}
-alert(maxCount);
-
// drawing the clickable genes
// for(var i=0; i<clickableGenes.length; i++) {
if((x<leftOffset-leftScrollOffset) && (y>topOffset-topScrollOffset) && ((y+scrolledTop)<(topOffset + cellSize*clusterCount))) {
var index = Math.floor(((y+topScrollOffset)-topOffset)/cellSize) + Math.floor(scrolledTop/25);
var cluster = allClusterIDs[index];
- getClusterInfo(cluster);
- alert(index);
+ getClusterInfo(cluster, index);
}
if((y<topOffset-topScrollOffset) && (x>leftOffset-leftScrollOffset)) {
var index = Math.floor(((x+leftScrollOffset)-leftOffset)/cellSize) + Math.floor(scrolledLeft/25);
var cluster = allClusterIDs[clusterIndex];
var index = Math.floor(((x+leftScrollOffset)-leftOffset)/cellSize) + Math.floor(scrolledLeft/25);
var species = allSpecies[index];
- getBoxInfo(cluster, species, clusterIndex+1);
+ getBoxInfo(cluster, species, clusterIndex, index);
}
if(((y+scrolledTop)>(topOffset + cellSize*clusterCount))) {
var index = Math.floor((y+topScrollOffset-topOffset+cellSize*clusterCount)/cellSize)+Math.floor(scrolledTop/25);
}
-function getClusterInfo(cluster) {
+function getClusterInfo(cluster, index) {
document.infoForm.action = "ClusterInfo.php";
- document.infoForm.param.value = cluster;
+ var userIndex = index+1;
+ document.infoForm.param.value = cluster + "," + userIndex;
document.infoForm.submit();
}
function getSpeciesInfo(species) {
document.infoForm.action = "SpeciesInfo.php";
- var pass = [species]
+ var pass = [species];
pass = pass.concat(allClusterIDs);
- document.infoForm.param.value = (pass);
+ document.infoForm.param.value = pass;
document.infoForm.submit();
}
-function getBoxInfo(cluster, species, userIndex) {
+function getBoxInfo(cluster, species, clusterIndex, speciesIndex) {
+ var userIndex = clusterIndex+1;
+ var count = heatMapData[speciesIndex][clusterIndex];
document.infoForm.action = "ClusterSpeciesInfo.php";
- document.infoForm.param.value = cluster + "," + species + "," + userIndex;
+ document.infoForm.param.value = cluster + "," + species + "," + userIndex + "," + count;
document.infoForm.submit();
}
return false;
}
+function generateImage() {
+ document.infoForm.action="download.php";
+ document.infoForm.param.value = "unset DISPLAY && java -Djava.awt.headless=true -jar Heatmap.jar image " + "<?php echo $input; ?>";
+ document.infoForm.submit();
+}
+
drawMap(true);
canvas.addEventListener('mouseup', showInfo, false);
<!--
-10. Linkability from clickable genes?
-13. Update user instructions on use
-14. Jump-to-cluster Box
-
-CHECK 1. Scrolling up/left
-CHECK 2. Stop scrolling past the end
-CHECK 3. Fix so that you can see the key
-CHECK 4. Draw 7 ref points on key, not 5
-CHECK 5. Fix clickability
-CHECK 6. Resizable boxes
-CHECK 7. Make hardcoded numbers into variables
-CHECK 8. Fix heatmap initialization
-CHECK 9. Fix text size/positioning for resizable boxes
-CHECK 11. Fix weird row at the bottom of the heatmap that isn't rendering
-CHECK 12. Fix upwards scroll speed
-
--->
\ No newline at end of file
+
+-->