text: 'use strict';define(["jquery","modules/default/defaultcontroller","lodash"],function(a,b,c){"use strict";function d(){}function e(a,b){return function(c){var d=a.getMatrixElementFromEvent(c);if(d){var e=d[1],f=d[0];a.setVarFromEvent(b,"row","matrix",["xLabel",e]),a.setVarFromEvent(b,"col","matrix",["yLabel",f]);var g=[e,f],h=a.module.getDataFromRel("matrix").get();if(h.data&&(h=h.data,g.unshift("data")),a.setVarFromEvent(b,"intersect","matrix",g),"undefined"!=typeof h[e]){a.createDataFromEvent(b,"point",{row:e,column:f,value:h[e][f]}),a.createDataFromEvent(b,"fullRow",h[e].slice());for(var j=h.length,k=Array(j),l=0;l<j;l++)k[l]=h[l][f];a.createDataFromEvent(b,"fullCol",k)}}}}return a.extend(!0,d.prototype,b),d.prototype.moduleInformation={name:"Matrix display",description:"Display an array of array as a colored matrix",author:"Norman Pellet",date:"24.12.2013",license:"MIT",cssClass:"canvas_matrix"},d.prototype.getMatrixElementFromEvent=function(b){var c;if(!(c=this.module.getDataFromRel("matrix")))return!1;var d=this.module.view.getPxPerCell(),e=this.module.view.getXYShift();b.offsetX=b.offsetX||b.pageX-a(b.target).offset().left,b.offsetY=b.offsetY||b.pageY-a(b.target).offset().top;var f=Math.floor((b.offsetX-e.x)/d),g=Math.floor((b.offsetY-e.y)/d),h=c.get();return h=h.data?h.data:h,!(!h||!h[0]||0>f||0>g||g>h.length||f>h[0].length)&&[f,g]},d.prototype.initEvents=function(){var b=a(this.module.getDomContent());b.on("mousemove","canvas",c.debounce(e(this,"onPixelHover"),25)),b.on("click","canvas",e(this,"onPixelClick"))},d.prototype.references={row:{label:"Row index"},fullRow:{label:"Full row"},col:{label:"Column index"},fullCol:{label:"Full column"},intersect:{label:"Intersection value"},point:{label:"Coordinates and value"},matrix:{label:"Matrix",description:"A 2D array representing the matrix",type:["matrix","object","array"]}},d.prototype.variablesIn=["matrix"],d.prototype.events={onPixelHover:{label:"Hover on a pixel",description:"When the mouses moves over a new pixel of the data matrix",refVariable:["row","col","intersect","point","fullRow","fullCol"]},onPixelClick:{label:"Click on a pixel",description:"When the users click on any pixel",refVariable:["row","col","intersect","point","fullRow","fullCol"]}},d.prototype.configurationStructure=function(){return{groups:{group:{options:{type:"list"},fields:{highcontrast:{default:"true",type:"checkbox",title:"Contrast",options:{true:"Take data min/max as boundaries"}},color:{type:"color",title:"Color",multiple:!0}}}}}},d.prototype.configAliases={colors:["groups","group",0,"color"],highContrast:["groups","group",0,"highcontrast",0,0]},d});
  