INNER CODE UNIT · JavaScript
mx
hms-dbmi/scde · web/pathcl_canvas.js:233
var mx=evt.clientX-evtRect.left; var my=evt.clientY-evtRect.top;
evctx.clearRect(0,0,s.width,s.height);
var v=clusterPanel.s;
clusterPanel.evctx.clearRect(0,0,v.width,v.height);
if(my<=s.height-hc.margins.bottom && mx<=s.width-hc.margins.right && mx>=hc.hmleft() && my>=hc.hmtop(data)) {
//mx=hc.hmleft()+(rx+0.5)*hc.hmwidth(s.width)/data.matrix.dim[1];
evctx.beginPath();
evctx.moveTo(mx,hc.cctop(data)); evctx.lineTo(mx,s.height-hc.margins.bottom);
var ry=Math.floor((my-hc.hmtop(data))/hc.hmheight(data,s.height)*data.matrix.dim[0]);
//my=hc.hmtop(data)+(ry+0.5)*hc.hmheight(data,s.height)/data.matrix.dim[0];
evctx.moveTo(hc.margins.left,my); evctx.lineTo(s.width-hc.margins.right,my);
var rx=Math.floor((mx-hc.hmleft())/hc.hmwidth(s.width)*data.matrix.dim[1]);
// update the line in the cluster panel
clusterPanel.evctx.beginPath();
clusterPanel.evctx.moveTo(mx,hc.cctop(clusterPanel.pathcldata))
clusterPanel.evctx.lineTo(mx,v.height-hc.margins.bottom)