INNER CODE UNIT · JavaScript
colIndex
hms-dbmi/scde · web/pathcl.js:244
var colIndex=Math.floor(coord[0]/bbox.width*data.matrix.dim[1])
var rowIndex=Math.floor(coord[1]/bbox.height*data.matrix.dim[0])
d3.select(rowlab[rowIndex]).classed('active', true);
var newy=cmap.y(rowIndex); var newx=cmap.x(colIndex);
focushl.attr("transform","translate(0,"+newy+")");
focusvl.attr("transform","translate("+newx+",0)");
focustx.text("cell: "+data.matrix.cols[colIndex]);
//focustx.attr("transform","translate("+coord[0]+","+(heatmapPos[1]+heatmapHeight-10)+")");
if(newy>bbox.height/2) { newy=newy-5; } else { newy=newy+15; }
if(newx>bbox.width/2) {
focustx.attr("transform","translate("+(newx-5)+","+newy+")");
focustx.attr("text-anchor","end")
} else {
focustx.attr("transform","translate("+(newx+5)+","+newy+")");
focustx.attr("text-anchor","start")
}
d3.select('#pathclfocusvl').attr("transform","translate("+newx+",0)");
}).on("mouseenter",function() {