diff --git a/inst/htmlwidgets/lib/canvasXpress/canvasXpress.min.js b/inst/htmlwidgets/lib/canvasXpress/canvasXpress.min.js
index 844d2f69..bb2f207b 100644
--- a/inst/htmlwidgets/lib/canvasXpress/canvasXpress.min.js
+++ b/inst/htmlwidgets/lib/canvasXpress/canvasXpress.min.js
@@ -1,6 +1,6 @@
/**
*
- * CanvasXpress 47.0 - JavaScript Canvas Library
+ * CanvasXpress 47.1 - JavaScript Canvas Library
*
* Copyright (c) 2009-2023 - license@canvasxpress.org
*
@@ -296,8 +296,8 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-(function(b,a){if(typeof exports==="object"&&typeof module!=="undefined"){a(exports)}else{(a((b.CanvasXpress=b.CanvasXpress||{})))}}(this,(function(b){var c,a;if(this){c=this.window;a=this.document}CanvasXpress=typeof CanvasXpress!="undefined"&&CanvasXpress.ready?CanvasXpress:function(k,h,g,o,f,l,n,j){var i=this;var m=function(){i.init(k,h,g,o,f,l,n,j)};var e=function(p){if(p){i.init(p)}else{i.init(k,h,g,o,f,l,n,j)}};if((g&&g.fonts)||(k&&k.config&&k.config.fonts)){if(g&&g.fonts){CanvasXpress.loadFonts(g.fonts,m)}else{CanvasXpress.loadFonts(k.config.fonts,m)}}else{if((g&&g.fontsExternal)||(k&&k.config&&k.config.fontsExternal)){if(g&&g.fontsExternal){CanvasXpress.loadFontsExternal(g.fontsExternal,m)}else{CanvasXpress.loadFontsExternal(k.config.fontsExternal,m)}}else{if((g&&g.topoJSON&&typeof g.topoJSON=="string")||(k&&k.config&&k.config.topoJSON&&typeof k.config.topoJSON=="string")||(g&&g.useLeaflet)||(k&&k.config&&k.config.useLeaflet)){if((g&&g.useLeaflet)||(k&&k.config&&k.config.useLeaflet)){var d=function(){if(g&&g.topoJSON){CanvasXpress.loadTopoJSON(g.topoJSON,g.mapId,m)}else{if(k&&k.config&&k.config.topoJSON){CanvasXpress.loadTopoJSON(k.config.topoJSON,k.config.mapId,m)}else{m()}}};CanvasXpress.loadLeaflet(d,i)}else{if(g&&g.topoJSON){CanvasXpress.loadTopoJSON(g.topoJSON,g.mapId,m)}else{CanvasXpress.loadTopoJSON(k.config.topoJSON,k.config.mapId,m)}}}else{if((h&&typeof h=="string")||(k&&k.data&&typeof k.data=="string")){if(h){CanvasXpress.loadRemoteData(k,h,g,o,e)}else{CanvasXpress.loadRemoteData(k.renderTo,k.data,k.config,k.events,e)}}else{this.init(k,h,g,o,f,l,n,j)}}}}}})));(function(b,a){if(typeof exports==="object"&&typeof module!=="undefined"){a(exports)}else{(a((b.cxplot=b.cxplot||{})))}}(this,(function(){cxplot=function(u,v,j,a){if(typeof(u)=="object"&&u.isGGPlot){var l=function(f){if(Array.isArray(f)&&!f.length){return{}}else{return f}};var k=function(){if(u.order){u.aes.meta={};for(var f in u.order){u.aes.meta[f]=u.order[f]}}if(!u.aes.hasOwnProperty("x")){for(var f=0;f1){if(c==0){f.x=b[c][d]}else{if(c==1){f.y=b[c][d]}else{if(c==2){f.z=b[c][d]}}}}}else{if(e.includes(d)){if(b[c][d] instanceof Object&&b[c][d].factor){a();f.stringSampleFactors.push(b[c][d].factor);f.stringVariableFactors.push(b[c][d].factor);f.asSampleFactors.push(b[c][d].factor);f.asVariableFactors.push(b[c][d].factor);f[d]=b[c][d].factor}else{if(b[c][d].toString().match(/^factor\(.+\)/)){f[d]=b[c][d].replace(/^factor\(/,"").replace(/\)$/,"");a();f.stringSampleFactors.push(f[d]);f.stringVariableFactors.push(f[d]);f.asSampleFactors.push(f[d]);f.asVariableFactors.push(f[d])}}}else{if(d=="sample"){f.x=b[c][d]}}}}}else{if(c==0){f.x=b[c]}else{if(c==1){f.y=b[c]}else{if(c==2){f.z=b[c]}}}f[b[c]]=b[c]}}}return f}})));CanvasXpress.instances=CanvasXpress.instances||[];CanvasXpress.config=CanvasXpress.config||[];CanvasXpress.transitions=CanvasXpress.transitions||{};CanvasXpress.remoteUpdating=CanvasXpress.remoteUpdating||false;CanvasXpress.cacheImages=CanvasXpress.cacheImages||{};CanvasXpress.cacheImagesReady=CanvasXpress.cacheImagesReady||false;CanvasXpress.cachePatterns=CanvasXpress.cachePatterns||{};CanvasXpress.cacheText=CanvasXpress.cacheText||{};CanvasXpress.tabPanels=CanvasXpress.tabPanels||{};CanvasXpress.fonts=CanvasXpress.fonts||{"American Typewriter":true,"Andale Mono":true,Arial:true,Baskerville:true,"Bradley Hand":true,"Brush Script MT":true,"Comic Sans MS":true,Courier:true,Didot:true,Georgia:true,"Gill Sans":true,Helvetica:true,Impact:true,"Lucida Console":true,Luminari:true,Monaco:true,Optima:true,Palatino:true,Roboto:true,Tahoma:true,"Times New Roman":true,"Trebuchet MS":true,Verdana:true};CanvasXpress.selector=CanvasXpress.selector||{vars:{},smps:{},meta:{},comp:{},nodes:{},edges:{},mixed:{},selections:0,groups:{},graphType:false};CanvasXpress.hidden=CanvasXpress.hidden||{hiddenVars:{},hiddenSmps:{},hiddenGrps:{},hiddenMapFeatures:{},hiddenNodes:{},hiddenEdges:{}};CanvasXpress.stack=CanvasXpress.stack||{};CanvasXpress.current=CanvasXpress.current||false;CanvasXpress.chain=CanvasXpress.chain||{};CanvasXpress.resizing=CanvasXpress.resizing||false;CanvasXpress.registered="7A64D88307896170036C253EA";CanvasXpress.system=CanvasXpress.system||{};CanvasXpress.ready=CanvasXpress.ready||false;CanvasXpress.readyFonts=CanvasXpress.readyFonts||false;CanvasXpress.factory=CanvasXpress.factory||{version:47,buildDate:"10-31-2023",client:"",siteSrc:false,valid:typeof window.cX=="string"?window.cX:undefined,href:window.location.href};CanvasXpress.factory.services="https://www.canvasxpress.org/cgi-bin/services.pl";CanvasXpress.onReady=function(){var f=[];var a=false;var d=false;var c=function(){if(!a){var g=CanvasXpress.instances[0];if(g){g.T4("canvasXpress JS ready");a=true;for(var h=0;h0){CanvasXpress.instances[0].destroy(b,a)}};CanvasXpress.create=function(c,b,a){CanvasXpress.inject(c);return new CanvasXpress(id,b,a)};CanvasXpress.createObject=function(f,d,b,c,e,h,g,a){if(!f){throw new Error("No target provided")}else{if(typeof(f)=="object"&&f.renderTo){d=f.tracks?{tracks:f.tracks}:f.nodes?{nodes:f.nodes}:f.venn?{venn:f.venn}:f.data?f.data:false;b=f.config||false;if(f.version){b.createVersion=f.version}if(f.factory){b.createFactory=f.factory}c=f.events||false;e=f.info?f.info.replace(/'/g,"'").replace(/"/g,"'"):false;h=f.afterRender||false;g=f.callback||false;a=f.noValidate?f.noValidate:b&&b.noValidate?b.noValidate:false;f=f.renderTo;CanvasXpress.inject(f)}else{if(typeof f==="string"||f instanceof String){CanvasXpress.inject(f)}}}return{target:f,data:d,config:b,events:c,info:e,afterRender:h,callback:g,noValidate:a}};CanvasXpress.inject=function(c){if(typeof c==="string"||c instanceof String){var b=document.getElementById(c);if(b!==null){if(b.tagName.toLowerCase()=="canvas"){if(!b.width){b.width=500}if(!b.height){b.height=500}}else{if(b.tagName.toLowerCase()=="div"){b.id=c+"-div";var a=document.createElement("canvas");a.id=c;a.width=500;a.height=500;b.appendChild(a)}}}else{var a=document.createElement("canvas");a.id=c;a.width=500;a.height=500;document.body.appendChild(a)}}};CanvasXpress.prototype.init=function(f,d,b,c,e,h,g,a){this.N5=function(i){this.target=i.target;this.events=i.events;this.info=i.info;this.userId=1;this.url={};this.meta={ids:{},time:{start:parseInt(performance.timeOrigin),current:0,end:null,elapsed:[]},data:false,canvas:{},config:{user:i.config,orig:{},vals:{},remote:false},ggplot:{aes:{},config:[],coords:[],data:[],facet:[],geoms:[],labels:{},layers:{},order:{},scales:[],theme:[],map:{}},vals:{},render:{objects:[],groups:{},types:{},order:[],map:{},origin:[],transition:false},console:[],events:{},state:{save:0,clip:false,translate:[0,0],rotate:[0],scale:[1,1],last:{translate:[0,0],rotate:[0],scale:[1,1]}},stack:[],def:{},dom:{},layout:{}};this.config={};this.legend={color:{},shape:{},size:{},sample:{},variable:{},line:{},pattern:{},outline:{},connect:{},contour:{},bin2d:{},decoration:{},oncoprint:{},overlays:{},colorNode:{},shapeNode:{},sizeNode:{},patternNode:{},colorEdge:{},sizeEdge:{},colorLabel:{},sizeLabel:{}};this.scales={};this.panel={};this.plot={}};this.wu=function(i){var k=this.meta.time.current||performance.now();if(!i){i=""}var j=performance.now();this.meta.time.elapsed.push([i,parseInt(j-k),parseInt(j)]);this.meta.time.current=j};this.GW=function(i){this.gh(i);this.qS(i);this.eg(i);this.jk(i);this.sK(i)};this.gh=function(j){if(typeof(j.data)=="function"){try{j.data=d.call(this)}catch(i){alert("Not a valid Data object:\n"+i)}}else{if(!j.noValidate){try{JSON.stringify(j.data)}catch(i){alert("Data object malformed:\n"+i)}}}};this.qS=function(j){if(j.config){if(typeof(j.config)=="function"){try{j.config=j.config.call(this)}catch(i){alert("Not a valid Data object:\n"+i)}}else{if(!j.noValidate){try{JSON.stringify(j.config)}catch(i){alert("Config object malformed:\n"+i)}}}}};this.eg=function(i){};this.jk=function(i){if(!i.info){i.info=""}};this.sK=function(j){if(j.afterRender){try{JSON.stringify(j.afterRender)}catch(i){alert("AfterRender object malformed:\n"+i)}}};this.hu=function(i){if(!i){i=this}if(i.transposeData){return true}if(i.transformData){}if(i.asSampleFactors&&i.asSampleFactors.length){return true}if(i.asVariableFactors&&i.asVariableFactors.length){return true}if(i.stringSampleFactors&&i.stringSampleFactors.length){return true}if(i.stringVariableFactors&&i.stringVariableFactors.length){return true}if(i.stringNodeAttributes&&i.stringNodeAttributes.length){return true}if(i.stringEdgeAttributes&&i.stringEdgeAttributes.length){return true}if(i.histogramData){return true}if(i.ridgeBy){return true}if(i.sortData&&i.sortData.length){return true}if(i.asDOE){}return false};this.Vs=function(l){var k=[];if(l.histogramData||l.ridgeBy){if(l.histogramData===true&&l.colorBy){k.unshift(["createHistogram",[],{}])}else{k.unshift(["createHistogram",[l.ridgeBy||l.histogramData||l.colorBy],{}])}}if(l.stringVariableFactors&&l.stringVariableFactors.length){for(var j=0;j=0){this.ZZ([n,this.xAxisIndices[0],this.yAxisIndices[0]]);x=true}}if(x){q.unshift(["broadcastDraw",[{func:"afterRender"}],{},B,true])}}var r=q.length-1;var k=false;for(var o=0;o0?m.shift():[];var w=m.length>0?m.shift():{};var A=m.length>0?m.shift():B;var p=m.length>0?m.shift():false;if(this.showFunctionNamesAfterRender){this.oC(20,20,u)}var l=q[o+1]&&q[o+1][0]&&q[o+1][0].match(/drag/i)?true:false;this.skipRender=u=="createDOE"||u=="createHistogram"||u=="modifyColorScheme"||u.match(/segregate/)||l?false:!this.showTransition&&o0&&!CanvasXpress.readyFonts){CanvasXpress.readyFonts=true;return}m.T4("canvasXpress data ready - "+l);m.h3();CanvasXpress.ready=true};if(CanvasXpress.cacheImagesReady){if(l=="afterRender"){if(!this.isAnimation&&!this.isTransitionOn&&!this.isUpdateRemoteData){i()}}else{if(this.graphType=="Network"){if(!this.isAnimation&&!this.isUpdateRemoteData){i()}}else{if(!this.isTransitionOn){i()}}}}};this.iS=function(){CanvasXpress.stack[this.target].stateCX.push(this.tD())};this.fo=function(){var j=CanvasXpress.stack[this.target];var i=this.hu();this.Yh(false,false,false,false,false,false,i);this.AH(j.afterRenderInit);this.iS();CanvasXpress.current=this.target;this.meta.time.end=parseInt(performance.now());this.Jb()};this.dU=function(){if(!this.lazyLoad||(!this.loaded&&this.hW(this.meta.canvas.ctx.canvas))){this.fo()}};this.A2=function(j){var i=this;i.N5(j);i.wu("init");i.yh();i.GW(j);i.nb();i.Hz();i.PW();i.Cb();i.cQ(j.config);i.Qp();i.CZ();i.cA();i.LH(j.data);i.wu("initData");i.mW();i.nt();i.Bk();i.Al();i.fO(j.data,j.config,j.events,j.info,j.afterRender);i.Ec();i.Hz();i.dU()};this.VL=function(j){try{CanvasXpress}catch(i){return false}CanvasXpress.instances.push(this);this.initIO();this.initDOM();this.initSVG();this.initInterface();this.initSave();this.initConfig();this.initDate();this.initViewport();this.initPrimitives();this.initUtils();this.initNumeric();this.initjLouvain();this.initCola();this.initCrypt();this.initMathUtils();this.initLegendUtils();this.initMarkerUtils();this.initFilterUtils();this.initClusterUtils();this.initSortUtils();this.initExample();this.initDataUtils();this.initRandom();this.initData();this.initFunctionData();this.initLayout();this.initEvents();this.initTooltip();this.initTooltipMouse();this.initTooltipDiv();this.initToolbar();this.initTabpanel();this.initMenus();this.initLinks();this.initDataFilter();this.initDataTable();this.initCodeInfo();this.initBin();this.initCustomizer();this.initAnimation();this.initRemote();this.initAxes();this.initGraph();this.initCxplot();this.A2(j)};if(!f){throw new Error("No target provided")}else{if(typeof(f)=="object"&&f.isGGPlot){return new cxplot(f)}else{this.VL(CanvasXpress.createObject(f,d,b,c,e,h,g,a))}}};CanvasXpress.prototype.initIO=function(){this.c9=function(s,r){try{return JSON.parse(s,r)}catch(e){if(s.toString().match(/=len){throw RangeError("Out of bound")}if(primary<0){throw RangeError("Out of bound")}var A=src;src=src.join("");A.sort();var start={};for(var i=len-1;i>=0;i--){start[A[i]]=i}var links=[];for(i=0;i0;a[i]=a[--i]){}buff.push(a[0]=v)}var RBitfield=function(){this.initbit=function(x){this.masks=[];for(var i=0;i<31;i++){this.masks[i]=(1<>1;return this.readbits(n2)*(1<>(this.bits-n))&m;this.bits-=n;this.bitfield&=~(m<this.max_bits){this.max_bits=x.bits}},this)}};var decode=function(input){var b=new RBitfield();b.initbit(input);b.readbits(16);var method=b.readbits(8);if(method!=104){throw"Unknown (not type 'h'uffman Bzip2) compression method"}var blocksize=b.readbits(8);if(49<=blocksize&&blocksize<=57){blocksize-=48}else{throw"Unknown (not size '1'-'9') Bzip2 blocksize"}function getUsedCharTable(b){var a=[];var used_groups=b.readbits(16);for(var m1=1<<15;m1>0;m1>>=1){if(!(used_groups&m1)){for(var i=0;i<16;i++){a.push(false)}continue}var used_chars=b.readbits(16);for(var m2=1<<15;m2>0;m2>>=1){a.push(Boolean(used_chars&m2))}}return a}var out=[];function main_loop(){while(true){var blocktype=b.readbits2(48);var crc=b.readbits2(32);if(blocktype==54156738319193){if(b.readbits(1)){throw"Bzip2 randomised support not implemented"}var pointer=b.readbits(24);var used=getUsedCharTable(b);var huffman_groups=b.readbits(3);if(2>huffman_groups||huffman_groups>6){throw RangeError("Bzip2: Number of Huffman groups not in range 2..6")}var mtf=[0,1,2,3,4,5,6].slice(0,huffman_groups);var selectors_list=[];for(var i=0,selectors_used=b.readbits(15);i=huffman_groups){throw RangeError("More than max ("+huffman_groups+") groups")}}move_to_front_and_store(mtf,c,selectors_list)}var groups_lengths=[];var symbols_in_use=used.reduce(function(a,b){return a+b},0)+2;for(var j=0;j20){throw RangeError("Bzip2 Huffman length code outside range 0..20")}while(b.readbits(1)){length-=(b.readbits(1)*2)-1}lengths.push(length)}groups_lengths.push(lengths)}var tables=[];for(var g=0;g=0;c--){if(used[c]){favourites.push(String.fromCharCode(c))}}favourites.reverse();var selector_pointer=0;var decoded=0;var t;var repeat=0;var repeat_power=0;var buffer=[],r;while(true){if(--decoded<=0){decoded=50;if(selector_pointer<=selectors_list.length){t=tables[selectors_list[selector_pointer++]]}}for(var bb in t.faht){if(b.bits>(b.bits-bb)]){b.bitfield&=b.masks[b.bits-=bb];r=r.code;break}}if(0<=r&&r<=1){if(repeat==0){repeat_power=1}repeat+=repeat_power<0;repeat--){buffer.push(v)}}if(r==symbols_in_use-1){break}else{move_to_front_and_store(favourites,r-1,buffer)}}var nt=bwt_reverse(buffer,pointer);var done=[];var i=0;var len=nt.length;while(i0;rep--){done.push(c)}i+=5}else{done.push(nt[i++])}}out.push(done.join(""))}else{if(blocktype==25779555029136){b.readbits(b.bits&7);break}else{throw"Illegal Bzip2 blocktype = 0x"+blocktype.toString(16)}}}}main_loop();return out.join("")};return decode(str)};this.af=function(str){isNumber=function(n){return n===null||n===undefined?true:!isNaN(parseFloat(n))&&isFinite(n)};if(str.match(/^<\?xml/)){return false}var tc=str.split(",").length-1;var tt=str.split("\t").length-1;var ts=str.split(";").length-1;if(tc<2&&tt<2&&ts<2){return false}var delim=tc>tt&&tc>ts?",":ts>tc&&ts>tt?";":"\t";var pat=new RegExp(("(\\"+delim+'|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+delim+"\\r\\n]*))"),"gi");var arr=[[]];var arrM=null;while(arrM=pat.exec(str)){var strM=arrM[1];if(strM.length&&strM!==delim){arr.push([])}var strV;if(arrM[2]){strV=arrM[2].replace(new RegExp('""',"g"),'"')}else{strV=arrM[3]}arr[arr.length-1].push(isNumber(strV)?Number(strV):strV!="NA"?strV:null)}for(var i=0;i0){for(var i=0;iarr[0].length){cols.shift();if(!cols.length==arr[0].length){return false}}if(arr[0].length!=arr[arr.length-1].length){arr.pop();rows.pop();if(arr[0].length!=arr[arr.length-1].length){return false}}var isrd=isDate(rows);if(isrd){cols.unshift("Date");for(var i=0;i1){var n=Math.ceil(total*0.6);var q=0;for(var i=types.length-1;i>=0;i--){if(!types[i]){q++}else{if(qnodes){nodes=0;edges=0;fail=0;type="edge";for(var i=1;i8){nodes=0;edges=0;fail=0;type="node";for(var i=1;i5||edges>=arr.length-1))||(type=="node"&&(nodes>5||nodes>=arr.length-1))){return{data:obj,rows:Math.max(nodes,edges),fail:fail,type:type}}else{return arr}}else{if(!type||type=="edge"){var done={};for(var i=1;i");var data={data:{nodes:nodes,edges:edges},config:{graphType:"Network",calculateLayout:cl,showAnimation:false,networkNodesOnTop:true,showNodeNameThreshold:20000,networkFreeze:false,preScaleNetwork:false,moveParentsWithChildren:true,ignoreEventlessOrder:true,networkVendor:"Gephi"},renderTo:target,events:events,afterRender:[["flashInfoSpan",[100,100,res,5000]],["appendNetworkDataFromURL",[]]]};if(config){for(var p in config){data.config[p]=config[p]}}return data};this.l1=function(xml,target,config,events){var that=this;var loc={3:"microsome",13:"epr",21:"lysosome",43:"nucleus",67:"golgi",1287:"mitochondria",1312:"peroxisome"};var ctx=window.document.createElement("canvas").getContext("2d",{willReadFrequently:true});var wrapText=function(str,width){var re=new RegExp("(?![^\\n]{1,"+width+"}$)([^\\n]{1,"+width+"})([\\s|-])","g");return str.toString().replace(re,"$1$2\n").replace(" \n","\n")};var measureTextMultiple=function(t,f){var l=t.split(/\n/);var m=0;ctx.font=f;for(var i=0;i0){intersectionX=nodeLeft}else{intersectionX=nodeRight}if(leftIntersect>=0&&leftIntersect<=1){intersectionY=y0+leftIntersect*dy}else{if(rightIntersect>=0&&rightIntersect<=1){intersectionY=y0+rightIntersect*dy}}}if(dy!==0){const topIntersect=(nodeTop-y0)/dy;const bottomIntersect=(nodeBottom-y0)/dy;if(dy>0){intersectionY=nodeTop}else{intersectionY=nodeBottom}if(topIntersect>=0&&topIntersect<=1){intersectionX=x0+topIntersect*dx}else{if(bottomIntersect>=0&&bottomIntersect<=1){intersectionX=x0+bottomIntersect*dx}}}const distance=Math.sqrt(Math.pow(intersectionX-x0,2)+Math.pow(intersectionY-y0,2));return distance+2};var nodes=[];var edges=[];var pw=xml.childNodes[0];if(pw.tagName.toLowerCase()=="map"){var seen={};var sord=[];var n=0;var ob=this.MR(pw,false,false,true);nodes.push({id:"__background__",type:"background",shape:"rectangle",color:"rgb(220,231,232)",outline:"rgb(29,154,195)",outlineWidth:3,width:Number(ob.width),height:Number(ob.height),x:Number(ob.width)*0.5,y:Number(ob.height)*0.5,hideLabel:true,immutable:true,eventless:true,zorder:1});sord.push(n++);for(var i=0;i40?"roundrecto":"roundrect";break;case"21":case"61":case"63":case"91":case"-11":case"-12":node.width-=4;node.height-=4;node.x+=2;node.y+=2;node.shape="roundrect";break;default:break}node.immutable=true}else{node.shape="roundrect";node.immutable=true}}if(node.name==""){node.hideLabel=true}else{node.name=node.name.toString().replace(/\[/g,"[").replace(/\]/g,"]").replace(/\"/g,""")}if(node.textarea){var lines=1;if(node.font){lines=Math.floor(node.textarea[3]/(Number(node.font[2])+(Number(node.font[2])>12?1:0)));node.labelSize=node.font[2]==14?1.1:1;if(node.font[0].match(/Bold Italic/i)){node.labelStyle="Bold Italic"}else{if(node.font[0].match(/Bold/i)){node.labelStyle="Bold"}else{if(node.font[0].match(/Italic/i)){node.labelStyle="Italic"}}}}if(lines>1&&!node.name.toString().match(/\n/)){var fnt=Math.floor(10*node.labelSize)+"px Arial";var tst=Math.floor(node.textarea[2]/5.5);var wrp=tst>0?wrapText(node.name.toString(),tst):node.name.toString();var lns=wrp.split(/\n/);var max=measureTextMultiple(wrp,fnt);if(lns.length>lines){while(lns.length>lines&&tstnode.textarea[2]){wrp=wrp.replace("(","\n(");lns=wrp.split(/\n/);max=measureTextMultiple(wrp,fnt);while((max>node.textarea[2]||lns.length*fnt>node.textarea[3]||lns.length3){wrp=wrapText(node.name,tst--);lns=wrp.split(/\n/);max=measureTextMultiple(wrp,fnt)}}node.name=wrp}else{if(lines==0){node.hideLabel=true}}node.labelX=node.textarea[0]+(node.textarea[2]*0.5);node.labelY=node.textarea[1]+(node.textarea[3]*0.5)}if(node.textalignment!=null){if(node.textalignment==0){node.labelAlign="left";node.labelX-=(node.textarea[2]*0.45)}else{if(node.textalignment==1){node.labelAlign="center"}else{if(node.textalignment==2){node.labelAlign="right";node.labelX+=(node.textarea[2]*0.45)}}}}delete node.textarea;if(node.fontcolor){node.labelColor=node.fontcolor;delete node.fontcolor}if(node.backgroundcolor){node.color=node.backgroundcolor;delete node.backgroundcolor}if(node.bordercolor){node.outline=node.bordercolor;delete node.bordercolor}if(node.rotateangle){node.rotate=node.shape=="image"?-node.rotateangle:270-node.rotateangle;if(node.shape!="image"){node.labelRotate=-node.rotateangle}delete node.rotateangle}if(node.borderwidth){node.outlineWidth=Number(node.borderwidth)-1;delete node.borderwidth}seen[node.id]=n;delete node.appearance;delete node.icontype;nodes.push(node);sord.push(n++);if(node.complex){nodes.push({id:node.id+"-complex",x:node.x,y:node.y,width:14,height:14,shape:"star",color:"rgb(255,255,255)",hideLabel:true,zorder:node.zorder+1,parentNode:node.id});seen[node.id+"-complex"]=n;sord.push(n++);delete node.complex}if(node.pathstart){var rot=0;var ptx=0;var pty=0;switch(node.sideofpathstarteditor){case 0:rot=90;pty=-(40+node.pathstartarrowmargin);break;case 1:rot=180;ptx=(40+node.pathstartarrowmargin);break;case 2:rot=270;pty=(40+node.pathstartarrowmargin);break;case 3:rot=0;ptx=-(40+node.pathstartarrowmargin);break}nodes.push({id:node.id+"-pathstart",x:node.x+ptx,y:node.y+pty,width:40,height:40,shape:"image",imagePath:CanvasXpress.images["99"],hideLabel:true,immutable:true,rotate:rot,zorder:node.zorder+1,parentNode:node.id});seen[node.id+"-pathstart"]=n;sord.push(n++);delete node.sideofpathstarteditor;delete node.pathstartarrowmargin;delete node.pathstart}if(node.organismspecificobject){nodes.push({id:node.id+"-organism",x:node.x,y:node.y,width:60,height:60,shape:"circle",color:"rgba(0,0,0,0.1)",outline:"rgb(255,255,0)",outlineWidth:3,hideLabel:true,zorder:node.zorder-1,parentNode:node.id});seen[node.id+"-organism"]=n;sord.push(n++);delete node.organismspecificobject}}}break;case"edges":for(var j=0;j=0){switch(edge.effect){case 0:edge.color="rgb(152,156,158)";break;case 1:edge.color="rgb(0,128,0)";break;case 2:edge.color="rgb(170,0,0)";break}}if(edge.mech!=null){var dec={};if(edge.showhexagon){var col=edge.hexagoncustomcolor||edge.color;var idx=edge.hexagonindex||0;var pos=edge.hexagoncoordinate||0.5;var cll=edge.effect==0?"black":"rgb(242,216,0)";var getDec=function(lbl){return{label:lbl,labelColor:cll,shape:"hexagon",color:col,index:idx,pos:pos}};switch(edge.mech){case -1:dec=getDec("");break;case 0:dec=getDec("?");break;case 2:dec=getDec("CM");break;case 3:dec=getDec("+P");break;case 4:dec=getDec("-P");break;case 5:dec=getDec("B");break;case 6:dec=getDec("Cn");break;case 7:dec=getDec("T");break;case 8:dec=getDec("C");break;case 9:dec=getDec("TR");break;case 10:dec=getDec("GR");dec.labelColor="white";dec.color="rgb(0,0,170)";break;case 11:dec=getDec("CR");break;case 12:dec=getDec("IE");break;case 14:dec=getDec("CS");dec.labelColor="white";dec.color="rgb(0,0,170)";break;case 15:dec=getDec("Z");break;case 16:dec=getDec("Tn");break;case 20:dec=getDec("cRT");break;case 21:dec=getDec("PE");break;case 22:dec=getDec("TE");break;case 24:dec=getDec("M");break;case 31:dec=getDec("SR");break;case 44:dec=getDec("RG");break;default:dec=getDec("");break}if(dec.label!=""){edge.decoration=[dec]}}delete edge.effect;delete edge.mech;delete edge.hexagonindex;delete edge.hexagoncoordinate;delete edge.showhexagon;delete edge.hexagoncustomcolor}}if(edge.broken){if(!edge.decoration){edge.decoration=[]}edge.decoration.push({label:"X",labelColor:"purple",fontSize:20,shape:"square",color:"rgba(0,0,0,0)",index:(edge.brokenindex||0),pos:(edge.brokencoordinate||0.5)});delete edge.broken;delete edge.brokenindex;delete edge.brokencoordinate}if(edge.weakens){if(!edge.decoration){edge.decoration=[]}edge.decoration.push({label:"-x-",labelColor:"purple",fontSize:12,shape:"square",color:"rgba(0,0,0,0)",index:(edge.weakensindex||0),pos:(edge.weakenscoordinate||0.5)});delete edge.weakens;delete edge.weakensindex;delete edge.weakenscoordinate}if(edge.disease){edge.color="purple";edge.thickness=2;delete edge.disease}if(edge.enhances){edge.color="purple";edge.thickness=2;delete edge.enhances}delete edge.appearance;delete edge.src;delete edge.dst;if(seen.hasOwnProperty(edge.id1)&&seen.hasOwnProperty(edge.id2)){var src=nodes[seen[edge.id1]];var dst=nodes[seen[edge.id2]];var sx=src.x;var sy=src.y;var sw=src.width*0.5;var sh=src.height*0.5;var ex=0;var ey=0;var dx=dst.x;var dy=dst.y;var dw=dst.width*0.5;var dh=dst.height*0.5;var ss,sd,sq,ds,dd,dq,xy,cx,cy,rd,frs,lst,n1;if(edge.visualization&&edge.visualization=="Right angle polyline"){ss=edge.linksourcepointindex?Math.floor((edge.linksourcepointindex-1)/src.linkpointcount):-1;sd=edge.linksourcepointindex?(edge.linksourcepointindex-(src.linkpointcount*ss))/(src.linkpointcount+1):0;if(edge.firstleg&&edge.firstleg=="Vertical"){frs=edge.controlpoints?edge.controlpoints[0][1]:false;sy=frs&&frs[1]>0?sy+sh:src.y>dst.y?sy-sh:frs&&frs<0?sy-sh:sy+sh;if(ss==0||ss==2){sx=(sx-sw)+(src.width*sd)}else{if(ss==1){sx=sx+sw}else{if(ss==3){sx=sx-sw}}}sq="tb"}else{frs=edge.controlpoints?edge.controlpoints[0][0]:false;sx=frs&&frs>0?sx+sw:src.x>dst.x?sx-sw:frs&&frs<0?sx-sw:sx+sw;if(ss==1||ss==3){sy=(sy-sh)+(src.height*sd)}else{if(ss==0){sy=sy-sh}else{if(ss==2){sy=sy+sh}}}sq="lr"}ds=edge.linktargetpointindex?Math.floor((edge.linktargetpointindex-1)/dst.linkpointcount):-1;dd=edge.linktargetpointindex?(edge.linktargetpointindex-(dst.linkpointcount*ds))/(dst.linkpointcount+1):0;if(!edge.controlpoints){if(edge.firstleg&&edge.firstleg=="Vertical"){dx=src.x>dst.x?dx+dw:dx-dw;if(ds==1||ds==3){dy=(dy-dh)+(dst.height*dd)}}else{dy=src.y>dst.y?dy+dh:dy-dh;if(ds==0||ds==2){dx=(dx-dw)+(dst.width*dd)}}}else{dq=edge.controlpoints.length%2?sq:sq=="tb"?"lr":"tb";n1=edge.controlpoints.length-1;lst=edge.controlpoints[n1];if(edge.linktargetpointindex){if(ds==1||ds==3){if(src.x+lst[0]>dst.x){dx+=dw}else{dx-=dw}dy=(dy-dh)+(dst.height*dd)}else{if(ds==0||ds==2){dx=(dx-dw)+(dst.width*dd);if(src.y+lst[1]>dst.y){dy+=dh}else{dy-=dh}}}}else{if(edge.controlpoints.length%2){if(sq==dq&&sq=="lr"){if(src.x+lst[0]>dst.x){dx+=dw}else{dx-=dw}}}else{dx=src.x+lst[0]>dst.x?dx+dw:dx-dw}if(edge.controlpoints.length%2){if(sq!=dq||sq!="lr"){dy=src.y+lst[1]>dst.y?dy+dh:dy-dh}}else{if(src.y+lst[1]>dst.y){dy=dy+dh}}}}if(edge.controlpoints){edge.elbows=[[sx,sy]];cx=sx;cy=sy;if(edge.firstleg&&edge.firstleg=="Vertical"){for(var k=0;k0,pos:(ss==0?"top":ss==1?"right":ss=2?"bottom":"left"),size:20,end:"arrow"}}else{if(ss>ds||(ss==0&&ds==3)){edge.self={dir:edge.angle>0,pos:(ss==0?"topLeft":ss=1?"topRight":ss==2?"bottomRight":"bottomLeft"),size:20,end:"arrow"}}else{if(ds>ss||(ds==0&&ss==3)){edge.self={dir:edge.angle>0,pos:(ss==0?"topRight":ss==1?"bottomRight":ss==2?"bottomLeft":"topLeft"),size:20,end:"arrow"}}}}}else{if(edge.linksourcepointindex){ss=edge.linksourcepointindex?Math.floor((edge.linksourcepointindex-1)/src.linkpointcount):-1;sd=edge.linksourcepointindex?(edge.linksourcepointindex-(src.linkpointcount*ss))/(src.linkpointcount+1):0;if(ss==0||ss==2){sx=(sx-sw)+(src.width*sd)}else{sy=(sy-sh)+(src.height*sd)}}if(edge.linktargetpointindex){ds=edge.linktargetpointindex?Math.floor((edge.linktargetpointindex-1)/dst.linkpointcount):-1;dd=edge.linktargetpointindex?(edge.linktargetpointindex-(dst.linkpointcount*ds))/(dst.linkpointcount+1):0;if(ds==0||ds==2){dx=(dx-dw)+(dst.width*dd)}else{dy=(dy-dh)+(dst.height*dd)}}if(edge.linksourcepointindex||edge.linktargetpointindex){if(edge.linksourcepointindex){switch(ss){case 0:sy-=sh;break;case 1:sx+=sw;break;case 2:sy+=sh;break;case 3:sx-=sw;break}if(!edge.linktargetpointindex){ds=getLengthToNodeBoundary(dx,dy,sx,sy,dst);xy=getCoordinateAtDistance(dx,dy,sx,sy,ds);dx=xy[0];dy=xy[1]}else{switch(ds){case 0:dy-=dh;break;case 1:dx+=dw;break;case 2:dy+=dh;break;case 3:dx-=dw;break}}}else{switch(ds){case 0:dy-=dh;break;case 1:dx+=dw;break;case 2:dy+=dh;break;case 3:dx-=dw;break}ds=getLengthToNodeBoundary(sx,sy,dx,dy,src);xy=getCoordinateAtDistance(sx,sy,dx,dy,ds);sx=xy[0];sy=xy[1]}edge.elbows=[[sx,sy],[dx,dy]]}}}}delete edge.linksourcepointindex;delete edge.linktargetpointindex;delete edge.controlpoints;delete edge.visualization;delete edge.firstleg;edges.push(edge)}}}break}}}sord.sort(function(a,b){if(nodes[a].zorder-nodes[b].zorder==0){return a-b}else{return nodes[a].zorder-nodes[b].zorder}});var tmp=[];for(var i=0;i");var data={data:{nodes:nodes,edges:edges},config:{adjustBezier:false,graphType:"Network",calculateLayout:false,showAnimation:false,networkNodesOnTop:false,showNodeNameThreshold:20000,networkFreeze:true,preScaleNetwork:false,moveParentsWithChildren:true,ignoreEventlessOrder:true,networkVendor:"Metabase"},renderTo:target,events:events,afterRender:[["flashInfoSpan",[100,100,res,5000]],["appendNetworkDataFromURL",[]]]};if(config){for(var p in config){data.config[p]=config[p]}}return data};this.ba=function(xml,target,config,events){var sp={ELLIPSE:"oval",arc:"circle",bitmap:"circle",line:"minus",text:"circle",ver_ellipsis:"oval",hor_ellipsis:"oval"};var nodes=[];var edges=[];var title="";var pw=xml.childNodes[0];if(pw.tagName.toLowerCase()=="graph"){for(var i=0;i");var data={data:{nodes:nodes,edges:edges},config:{adjustBezier:false,graphType:"Network",calculateLayout:false,showAnimation:false,networkNodesOnTop:true,showNodeNameThreshold:20000,networkFreeze:false,preScaleNetwork:false,title:title,moveParentsWithChildren:true,ignoreEventlessOrder:true,networkVendor:"Cytoscape"},renderTo:target,events:events,afterRender:[["flashInfoSpan",[100,100,res,5000]],["appendNetworkDataFromURL",[]]]};if(config){for(var p in config){data.config[p]=config[p]}}return data};this.Tw=function(xml,target,config,events){var pw=xml.childNodes[0];var nodes={};var edges=[];var state={};var groups={};var anchors={};var order={};var cntp=1;var cntn=0;var sord=[];var groupRef={};var groupGref={};var groupId={};var wrn="\nWarnings:\n";var htt=false;var title,subtitle;var arrowTypes={Line:false,Arrow:"arrow",TBar:"square","mim-necessary-stimulation":false,"mim-binding":false,"mim-conversion":"arrow","mim-stimulation":"arrow","mim-catalysis":"round","mim-modification":false,"mim-inhibition":"square","mim-covalent-bond":false,"mim-transcription-translation":false};var createNodeFromGroup=function(grp,id){var mnx=Number.MAX_VALUE;var mny=Number.MAX_VALUE;var mxx=-Number.MAX_VALUE;var mxy=-Number.MAX_VALUE;var ids=[];var ord=[];var shw=false;for(var i=0;i1&&w>10?5:0),height:h+(grp.length>1&&h>10?5:0),group:ids,hideLabel:true,hideTooltip:htt,type:"Group",color:(shw?"rgba(245,245,245,0.5)":"rgba(0,0,0,0)"),outline:(shw?"rgb(0,0,0)":"rgba(0,0,0,0)"),shape:"rectangle",zorder:ord[0]};order[id]=cntn--;nodes[id]=ob;sord.push(id)};var createNodeFromPoint=function(p,id){var ob={id:id,x:Math.round(p.x*10)/10,y:Math.round(p.y*10)/10,width:p.width?Math.round(p.width):1,height:p.height?Math.round(p.height):1,hideLabel:p.show?false:true,hideTooltip:!htt?false:p.show?false:true,eventless:p.show?false:true,type:p.type||"Anchor",color:p.color||"rgba(0,0,0,0)",outline:p.outline||"rgba(0,0,0,0)",shape:p.shape||"circle",label:p.label||"",zorder:p.zorder||0};order[id]=cntp++;nodes[id]=ob;sord.push(id)};var getDirection=function(s){switch(s){case"r":case"l":return"rl";case"b":case"t":case"c":return"tb"}};var getSide=function(p){if(parseInt(p.relx)==1){return"r"}else{if(parseInt(p.relx)==-1){return"l"}else{if(parseInt(p.rely)==1){return"b"}else{if(parseInt(p.rely)==-1){return"t"}else{if(Math.abs(p.relx)>Math.abs(p.rely)){if(parseFloat(p.relx)>0){return"r"}else{return"l"}}else{if(parseFloat(p.rely)>0){return"b"}else{if(parseFloat(p.rely)<0){return"t"}else{return"c"}}}}}}}};var getNumberOfLines=function(s,t){var findExtra=function(sd,p1,p2){switch(sd){case"r":if(parseFloat(p1.x)>=parseFloat(p2.x)){return 2}break;case"l":if(parseFloat(p1.x)<=parseFloat(p2.x)){return 2}break;case"t":case"c":if(parseFloat(p1.y)<=parseFloat(p2.y)){return 2}break;case"b":if(parseFloat(p1.y)>=parseFloat(p2.y)){return 2}break}return 0};var ss=getSide(s);var ts=getSide(t);var ls=2;if(getDirection(ss)==getDirection(ts)){ls++}if(ss!=ts){ls+=findExtra(ss,s,t);ls+=findExtra(ts,t,s)}return ls};var getPoint=function(s,a,f){if(f){switch(s){case"r":return[a[0]+20,a[1]];case"l":return[a[0]-20,a[1]];case"t":case"c":return[a[0],a[1]-20];case"b":return[a[0],a[1]+20]}}else{switch(s){case"r":case"l":return[a[0][0],a[1][1]];case"t":case"b":case"c":return[a[1][0],a[0][1]]}}};var getCoords=function(d,a){var r=[a[0]];var l=a[0];for(var i=1;i3){if(ls>3){a.splice(2,0,getPoint(t,a[2],true))}if(ls>4){if(ls>4){a.splice(3,0,[(a[1][0]+a[2][0])/2,(a[1][1]+a[2][1])/2])}if(ls>5){a=to2DArray(edg);a=getCoords(d,a)}}else{a.splice(2,0,getPoint(s,[a[1],a[2]]))}}else{if((a[0][0]==a[1][0]&&a[1][0]==a[2][0])||(a[0][1]==a[1][1]&&a[1][1]==a[2][1])){a.splice(1,1)}else{a.splice(2,0,getPoint(s,[a[1],a[2]]))}}}else{if(ps.length>ls){a=getCoords(d,a)}else{for(var i=0;itn.y-tn.height){my-=tn.height}}else{if(t=="b"){if(mytn.x-tn.width){mx-=tn.width*0.5}}else{if(t=="r"){if(mxtn.x-tn.width)||(t=="r"&&p0[0]tn.y-tn.height)||(t=="b"&&p0[1]0){for(var i=0;i0){res+="Number of Failed Edges: "+fail.length+"\n";for(var i=0;i");var data={data:{nodes:nods,edges:edgs},config:{adjustBezier:false,graphType:"Network",calculateLayout:false,showAnimation:false,networkNodesOnTop:false,showNodeNameThreshold:20000,networkFreeze:false,preScaleNetwork:false,title:title,networkVendor:"Wikipathways"},renderTo:target,events:events,afterRender:[["flashInfoSpan",[100,100,res,5000]],["appendNetworkDataFromURL",[]]]};if(config){for(var p in config){data.config[p]=config[p]}}return data};this.yc=function(xml,target,config,events,callback){var pw=xml.childNodes[2]||xml.childNodes[1];var nodes=[];var edges=[];var title,image,link,width,height;var addAnchors=function(){nodes.push({id:"__zero__",type:"anchor",shape:"circle",color:"rgba(0,0,0,0)",outline:"rgb(0,0,0)",width:1,height:1,x:0,y:0,hideLabel:true},{id:"__max__",type:"anchor",shape:"circle",color:"rgba(0,0,0,0)",outline:"rgb(0,0,0)",width:1,height:1,x:width,y:height,hideLabel:true})};var getAngle=function(x0,y0,x1,y1){var a=(Math.atan2(y1-y0,x1-x0)*180/Math.PI)%360;var min=0;while(a=(min+360)){a-=360}return a};var mean=function(arr){var mean=0;var n=0;for(var i=0;i0){mean/=n}return mean};if(pw.tagName.toLowerCase()=="pathway"){var ob=this.MR(pw,false,false,true);title=ob.title;image=ob.image;link=ob.link;var img=new Image();img.onload=function(){width=this.width;height=this.height;var res="Number of Nodes: "+nodes.length+"\n";res+="Number of Edges: "+edges.length+"\n";addAnchors();var data={data:{nodes:nodes,edges:edges},config:{adjustBezier:false,graphType:"Network",calculateLayout:false,showAnimation:false,networkNodesOnTop:false,networkFreeze:false,showNodeNameThreshold:20000,preScaleNetwork:false,title:title,backgroundType:"image",backgroundImage:image,networkVendor:"Kegg"},renderTo:target,events:events,afterRender:[["flashInfoSpan",[100,100,res,5000]],["appendNetworkDataFromURL",[]]]};if(config){for(var p in config){data.config[p]=config[p]}}return callback(data)};if((CanvasXpress.system.isR&&!CanvasXpress.system.isInIframe)||!CanvasXpress.system.isR){img.crossOrigin="anonymous"}img.src=ob.image;for(var i=0;i1){x.push(parseInt(coords.shift()));y.push(parseInt(coords.shift()))}var mx=parseInt(mean(x));var my=parseInt(mean(y));if(x[0]==x[1]){mx+=1;w=2;h=y[1]-y[0];r=0}else{if(y[0]==y[1]){my+=1;w=x[1]-x[0];h=2;r=0}else{h=Math.sqrt(Math.pow(x[1]-x[0],2)+Math.pow(y[1]-0[0],2));w=2;r=getAngle(x[0],y[0],x[1],y[1])}}var node={id:ob.id,type:ob.type,link:ob.link,name:ob.graphics[0].name,shape:"rect",color:"rgba(0,0,0,0)",outline:"rgba(0,0,0,0)",x:mx,y:my,width:w,height:h,rotate:r,hideLabel:true,fixed:true};nodes.push(node)}}}break;case"relation":case"reaction":var ob=this.MR(el);ob.id1=this.c9(this.uY(ob.entry1));ob.id2=this.c9(this.uY(ob.entry2));delete (ob.entry1);delete (ob.entry2);ob.color="rgba(0,0,0,0)";edges.push(ob);break}}}}else{alert("Ooops! Not a kgml file!")}};this.b8=function(table,config){var ar=[];for(var i=0;i";return t};if(CanvasXpress.icons.use.hasOwnProperty(f)){var h='';if(CanvasXpress.icons.gradients.hasOwnProperty(f)){h+=CanvasXpress.icons.gradients[f].replace(/"/g,'"')}for(var g=0;g";return s};if(b&&CanvasXpress.icons.use.hasOwnProperty(e)){var g='';if(CanvasXpress.icons.gradients.hasOwnProperty(e)){g+=CanvasXpress.icons.gradients[e].replace(/"/g,'"')}for(var f=0;f"+a[f]+""}}}}if(l){for(var f in l){b.style[f]=l[f]}}b.innerHTML=j+h+g}};this.$p=function(s){var t=this;var w=window;var q=t.$w;var p=t[q(0)];var u=t[q(0,true)];var r=s?p:!p?false:!u;if(w[q(8)][q(15)]&&!w[q(8)][q(15)].length){if(t.$v()){r=true}}if(!s&&r){w[q(40)]=function(){return false}}return r};this.$pX=function(c){var t=this;var q=t.$w;var p=t.$(t.target+q(2));if(c&&p){var x=t[q(0)];if(x){var e=t[q(10)](x);if(e==p.value){t[q(0,true)]=true;return true}else{return false}}else{return false}}else{if(p&&p.value!=""){var e=t[q(9)](p.value);t[q(0)]=e;t[q(0,true)]=true;return e}else{return false}}};this.xQ=function(s){var h="";for(var i=0;i50?CanvasXpress.colorWords[i]:n?q(CanvasXpress.colorWords[i].split("").reverse().join("")).split("").reverse().join(""):q(CanvasXpress.colorWords[i].split("").reverse().join(""))};this.Ux=function(){try{CanvasXpress}catch(f){return false}if(CanvasXpress.instances.length==1){this.beaconImage=this.$cX("img",{id:this.target+"-cX-Beacon-Image",src:(window.navigator.onLine?"https://www.canvasxpress.org/assets/images/beacon.gif?"+CanvasXpress.factory.client:CanvasXpress.png),title:"",alt:""})}else{this.beaconImage=CanvasXpress.instances[0].beaconImage}};this.$$=function(){try{CanvasXpress}catch(f){return false}var o=this;var j=CanvasXpress;var g=function(i){if(!i){i=j[h[4]]}else{if(i.length>36){return 0}}var c=i.length;var f=Number(i.substring(2,3));var d=Number(i.substring(c-3,c-2));var q=i.substring(3+f,3+f+5)[h[7]]("")[h[8]]()[h[9]]("");var m=i.substring(c-(3+d+5),c-(3+d));return Number(q+""+m+"000")};var l=["686578546f537472696e67","6472617754657874","666163746f7279","73797374656d","72656769737465726564","76616c6964","737562737472696e67","73706c6974","72657665727365","6a6f696e","43616e766173587072657373","4e6f7420612076616c696420636f7079206f6620","556e737570706f727465642056657273696f6e206f6620","20522056657273696f6e","204e6f64652056657273696f6e","697352566965776572","697352436f6e736f6c65","68726566","2f7777772e63616e7661737870726573732e6f72672f646973742f","72616e646f6d496e744265747765656e","666f6e7453697a65","666f6e744e616d65","69734378706c6f74","6378706c6f742042792043616e766173587072657373","736574506978656c496d616765","64697361626c65426561636f6e"];var h=[];for(var e=0;e1200?24:s>800?20:s>500?16:s>300?12:8;var n=Number(t.meta.time.start);var h=t[d[1]]=="rgba(0,0,0,0)";for(var i=0;i=0&&b.top>=0&&c<=w[0]&&m<=w[1]};this.qO=function(e,n){return e?e.classList.contains(n):false};this.Qs=function(e,n){if(e){e.classList.add(n)}};this.uz=function(e,n){if(e){e.classList.remove(n)}};this.jK=function(e){var s="";var o=getComputedStyle(e);for(var i=0;i0?1:-1)*Math.floor(Math.abs(number))};var maxSafeInteger=Math.pow(2,53)-1;var toLength=function(value){var len=toInteger(value);return Math.min(Math.max(len,0),maxSafeInteger)};return function from(arrayLike){var C=this;var items=Object(arrayLike);if(arrayLike==null){throw new TypeError("Array.from requires an array-like object - not null or undefined")}var mapFn=arguments.length>1?arguments[1]:void undefined;var T;if(typeof mapFn!=="undefined"){if(!isCallable(mapFn)){throw new TypeError("Array.from: when provided, the second argument must be a function")}if(arguments.length>2){T=arguments[2]}}var len=toLength(items.length);var A=isCallable(C)?Object(new C(len)):new Array(len);var k=0;var kValue;while(k>>0;var start=arguments[1];var relativeStart=start>>0;var k=relativeStart<0?Math.max(len+relativeStart,0):Math.min(relativeStart,len);var end=arguments[2];var relativeEnd=end===undefined?len:end>>0;var finl=relativeEnd<0?Math.max(len+relativeEnd,0):Math.min(relativeEnd,len);while(k>>0;if(typeof callback!=="function"){throw new TypeError(callback+" is not a function")}if(arguments.length>1){T=arguments[1]}A=new Array(len);k=0;while(k>>0;if(typeof predicate!=="function"){throw new TypeError("predicate must be a function")}var thisArg=arguments[1];var k=0;while(k>>0;if(len===0){return false}var n=fromIndex|0;var k=Math.max(n>=0?n:len-Math.abs(n),0);function sameValueZero(x,y){return x===y||(typeof x==="number"&&typeof y==="number"&&isNaN(x)&&isNaN(y))}while(kA){var G=A;A=u;u=G}}var o=this.ct(u,A,4);u=o[0];A=o[o.length-1];var y=A-u;var a=(((y*1000000)-(parseInt(y)*1000000))/1000000).toString().replace(/\./,"").length-1;var e=Math.pow(1/10,(a+1));var C=u>0?Math.log10(u):u==0?0:null;var E=A>0?Math.log10(A):A==0?0:null;var c=[];var Q="CanvasXpressRangeSlider";if(C!=null&&E!=null){var I=this.ct(C,E,4);for(var B=0;B1){m=l;m.width=arguments[0];m.height=arguments[1]}else{if(!n){m=l}else{m=n}}if(!(this instanceof k)){return new k(m)}this.width=m.width||l.width;this.height=m.height||l.height;this.desc=m.desc||l.desc;this.enableMirroring=m.enableMirroring!==undefined?m.enableMirroring:l.enableMirroring;this.canvas=this;this.__document=m.document||document;if(m.ctx){this.__ctx=m.ctx}else{this.__canvas=this.__document.createElement("canvas");this.__ctx=this.__canvas.getContext("2d")}this.__setDefaultStyles();this.__stack=[this.__getStyleState()];this.__groupStack=[];this.__root=this.__document.createElementNS("http://www.w3.org/2000/svg","svg");this.__root.setAttribute("version",1.1);this.__root.setAttribute("xmlns","http://www.w3.org/2000/svg");this.__root.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");this.__root.setAttribute("width",this.width);this.__root.setAttribute("height",this.height);this.__root.setAttribute("desc",this.desc);this.__ids={};this.__defs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs");this.__root.appendChild(this.__defs);this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g");this.__root.appendChild(this.__currentElement)};k.prototype.__createElement=function(l,p,r){if(typeof p==="undefined"){p={}}var o=this.__document.createElementNS("http://www.w3.org/2000/svg",l),q=Object.keys(p),n,m;if(r){o.setAttribute("fill","none");o.setAttribute("stroke","none")}for(n=0;n0){if(this.__currentElement.nodeName==="path"){if(!this.__currentElementsToStyle){this.__currentElementsToStyle={element:n,children:[]}}this.__currentElementsToStyle.children.push(this.__currentElement);this.__applyCurrentDefaultPath()}var o=this.__createElement("g");n.appendChild(o);this.__currentElement=o}var l=this.__currentElement.getAttribute("transform");if(l){l+=" "}else{l=""}l+=m;this.__currentElement.setAttribute("transform",l)};k.prototype.scale=function(l,m){if(m===undefined){m=l}this.__addTransform(g("scale({x},{y})",{x:l,y:m}))};k.prototype.rotate=function(m){var l=(m*180/Math.PI);this.__addTransform(g("rotate({angle},{cx},{cy})",{angle:l,cx:0,cy:0}))};k.prototype.translate=function(l,m){this.__addTransform(g("translate({x},{y})",{x:l,y:m}))};k.prototype.transform=function(m,l,q,p,o,n){this.__addTransform(g("matrix({a},{b},{c},{d},{e},{f})",{a:m,b:l,c:q,d:p,e:o,f:n}))};k.prototype.beginPath=function(){var m,l;this.__currentDefaultPath="";this.__currentPosition={};m=this.__createElement("path",{},true);l=this.__closestGroupOrSvg();l.appendChild(m);this.__currentElement=m};k.prototype.__applyCurrentDefaultPath=function(){var l=this.__currentElement;if(l.nodeName==="path"){l.setAttribute("d",this.__currentDefaultPath)}else{console.error("Attempted to apply path command to node",l.nodeName)}};k.prototype.__addPathCommand=function(l){this.__currentDefaultPath+=" ";this.__currentDefaultPath+=l};k.prototype.moveTo=function(l,m){if(this.__currentElement.nodeName!=="path"){this.beginPath()}this.__currentPosition={x:l,y:m};this.__addPathCommand(g("M {x} {y}",{x:l,y:m}))};k.prototype.closePath=function(){if(this.__currentDefaultPath){this.__addPathCommand("Z")}};k.prototype.lineTo=function(l,m){this.__currentPosition={x:l,y:m};if(this.__currentDefaultPath.indexOf("M")>-1){this.__addPathCommand(g("L {x} {y}",{x:l,y:m}))}else{this.__addPathCommand(g("M {x} {y}",{x:l,y:m}))}};k.prototype.bezierCurveTo=function(n,m,p,o,l,q){this.__currentPosition={x:l,y:q};this.__addPathCommand(g("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:n,cp1y:m,cp2x:p,cp2y:o,x:l,y:q}))};k.prototype.quadraticCurveTo=function(n,m,l,o){this.__currentPosition={x:l,y:o};this.__addPathCommand(g("Q {cpx} {cpy} {x} {y}",{cpx:n,cpy:m,x:l,y:o}))};var b=function(m){var l=Math.sqrt(m[0]*m[0]+m[1]*m[1]);return[m[0]/l,m[1]/l]};k.prototype.arcTo=function(F,o,E,n,q){var G=this.__currentPosition&&this.__currentPosition.x;var p=this.__currentPosition&&this.__currentPosition.y;if(typeof G=="undefined"||typeof p=="undefined"){return}if(q<0){throw new Error("IndexSizeError: The radius provided ("+q+") is negative.")}if(((G===F)&&(p===o))||((F===E)&&(o===n))||(q===0)){this.lineTo(F,o);return}var u=b([G-F,p-o]);var t=b([E-F,n-o]);if(u[0]*t[1]===u[1]*t[0]){this.lineTo(F,o);return}var m=(u[0]*t[0]+u[1]*t[1]);var v=Math.acos(Math.abs(m));var B=b([u[0]+t[0],u[1]+t[1]]);var r=q/Math.sin(v/2);var A=F+r*B[0];var z=o+r*B[1];var l=[-u[1],u[0]];var w=[t[1],-t[0]];var s=function(I){var H=I[0];var J=I[1];if(J>=0){return Math.acos(H)}else{return -Math.acos(H)}};var D=s(l);var C=s(w);this.lineTo(A+l[0]*q,z+l[1]*q);this.arc(A,z,q,D,C)};k.prototype.stroke=function(){if(this.__currentElement.nodeName==="path"){this.__currentElement.setAttribute("paint-order","fill stroke markers")}this.__applyCurrentDefaultPath();this.__applyStyleToCurrentElement("stroke")};k.prototype.fill=function(){if(this.__currentElement.nodeName==="path"){this.__currentElement.setAttribute("paint-order","stroke fill markers")}this.__applyCurrentDefaultPath();this.__applyStyleToCurrentElement("fill")};k.prototype.rect=function(m,o,n,l){if(this.__currentElement.nodeName!=="path"){this.beginPath()}this.moveTo(m,o);this.lineTo(m+n,o);this.lineTo(m+n,o+l);this.lineTo(m,o+l);this.lineTo(m,o);this.closePath()};k.prototype.fillRect=function(m,q,o,l){var p,n;p=this.__createElement("rect",{x:m,y:q,width:o,height:l},true);n=this.__closestGroupOrSvg();n.appendChild(p);this.__currentElement=p;this.__applyStyleToCurrentElement("fill")};k.prototype.strokeRect=function(m,q,o,l){var p,n;p=this.__createElement("rect",{x:m,y:q,width:o,height:l},true);n=this.__closestGroupOrSvg();n.appendChild(p);this.__currentElement=p;this.__applyStyleToCurrentElement("stroke")};k.prototype.__clearCanvas=function(){var o=this.__closestGroupOrSvg(),l=o.getAttribute("transform");var n=this.__root.childNodes[1];var p=n.childNodes;for(var m=p.length-1;m>=0;m--){if(p[m]){n.removeChild(p[m])}}this.__currentElement=n;this.__groupStack=[];if(l){this.__addTransform(l)}};k.prototype.clearRect=function(m,q,o,l){if(m===0&&q===0&&o===this.width&&l===this.height){this.__clearCanvas();return}var p,n=this.__closestGroupOrSvg();p=this.__createElement("rect",{x:m,y:q,width:o,height:l,fill:"#FFFFFF"},true);n.appendChild(p)};k.prototype.createLinearGradient=function(m,o,l,n){var p=this.__createElement("linearGradient",{id:h(this.__ids),x1:m+"px",x2:l+"px",y1:o+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},false);this.__defs.appendChild(p);return new i(p,this)};k.prototype.createRadialGradient=function(o,q,n,m,p,l){var r=this.__createElement("radialGradient",{id:h(this.__ids),cx:m+"px",cy:p+"px",r:l+"px",fx:o+"px",fy:q+"px",gradientUnits:"userSpaceOnUse"},false);this.__defs.appendChild(r);return new i(r,this)};k.prototype.__parseFont=function(){var m=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z0-9]+?)\s*$/i;var l=m.exec(this.font);var n={style:l[1]||"normal",size:l[4]||"10px",family:l[6]||"sans-serif",weight:l[3]||"normal",decoration:l[2]||"normal",href:null};if(this.__fontUnderline==="underline"){n.decoration="underline"}if(this.__fontHref){n.href=this.__fontHref}return n};k.prototype.__wrapTextLink=function(m,n){if(m.href){var l=this.__createElement("a");l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m.href);l.appendChild(n);return l}return n};k.prototype.__applyText=function(q,l,r,p){var n=this.__parseFont(),o=this.__closestGroupOrSvg(),m=this.__createElement("text",{"font-family":n.family,"font-size":n.size,"font-style":n.style,"font-weight":n.weight,"text-decoration":n.decoration,x:l,y:r,"text-anchor":f(this.textAlign),"dominant-baseline":c(this.textBaseline)},true);m.appendChild(this.__document.createTextNode(q));this.__currentElement=m;this.__applyStyleToCurrentElement(p);o.appendChild(this.__wrapTextLink(n,m))};k.prototype.fillText=function(m,l,n){this.__applyText(m,l,n,"fill")};k.prototype.strokeText=function(m,l,n){this.__applyText(m,l,n,"stroke")};k.prototype.measureText=function(l){this.__ctx.font=this.font;return this.__ctx.measureText(l)};k.prototype.arc=function(t,s,q,r,m,v){if(r===m){return}r=r%(2*Math.PI);m=m%(2*Math.PI);if(r===m){m=((m+(2*Math.PI))-0.001*(v?-1:1))%(2*Math.PI)}var z=t+q*Math.cos(m),w=s+q*Math.sin(m),p=t+q*Math.cos(r),o=s+q*Math.sin(r),n=v?0:1,l=0,u=m-r;if(u<0){u+=2*Math.PI}if(v){l=u>Math.PI?0:1}else{l=u>Math.PI?1:0}this.lineTo(p,o);this.__addPathCommand(g("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:q,ry:q,xAxisRotation:0,largeArcFlag:l,sweepFlag:n,endX:z,endY:w}));this.__currentPosition={x:z,y:w}};k.prototype.clip=function(){var m=this.__closestGroupOrSvg(),l=this.__createElement("clipPath"),o=h(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath();m.removeChild(this.__currentElement);l.setAttribute("id",o);l.appendChild(this.__currentElement);this.__defs.appendChild(l);m.setAttribute("clip-path",g("url(#{id})",{id:o}));m.appendChild(n);this.__currentElement=n};k.prototype.drawImage=function(){var n=Array.prototype.slice.call(arguments),z=n[0],u,t,v,F,x=0,w=0,C,G,s,y,l,q,o,D,p,m,B;if(n.length===3){u=n[1];t=n[2];C=z.width;G=z.height;v=C;F=G}else{if(n.length===5){u=n[1];t=n[2];v=n[3];F=n[4];C=z.width;G=z.height}else{if(n.length===9){x=n[1];w=n[2];C=n[3];G=n[4];u=n[5];t=n[6];v=n[7];F=n[8]}else{throw new Error("Inavlid number of arguments passed to drawImage: "+arguments.length)}}}s=this.__closestGroupOrSvg();o=this.__currentElement;var r="translate("+u+", "+t+")";if(z instanceof k){y=z.getSvg().cloneNode(true);if(y.childNodes&&y.childNodes.length>1){l=y.childNodes[0];while(l.childNodes.length){B=l.childNodes[0].getAttribute("id");this.__ids[B]=B;this.__defs.appendChild(l.childNodes[0])}q=y.childNodes[1];if(q){var E=q.getAttribute("transform");var A;if(E){A=E+" "+r}else{A=r}q.setAttribute("transform",A);s.appendChild(q)}}}else{if(z.nodeName==="CANVAS"||z.nodeName==="IMG"){D=this.__createElement("image");D.setAttribute("width",v);D.setAttribute("height",F);D.setAttribute("preserveAspectRatio","none");if(x||w||C!==z.width||G!==z.height){p=this.__document.createElement("canvas");p.width=v;p.height=F;m=p.getContext("2d");m.drawImage(z,x,w,C,G,0,0,v,F);z=p}D.setAttribute("transform",r);D.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",z.nodeName==="CANVAS"?z.toDataURL():z.getAttribute("src"));s.appendChild(D)}}};k.prototype.createPattern=function(o,m){var n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),p=h(this.__ids),l;n.setAttribute("id",p);n.setAttribute("width",o.width);n.setAttribute("height",o.height);if(o.nodeName==="CANVAS"||o.nodeName==="IMG"){l=this.__document.createElementNS("http://www.w3.org/2000/svg","image");l.setAttribute("width",o.width);l.setAttribute("height",o.height);l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o.nodeName==="CANVAS"?o.toDataURL():o.getAttribute("src"));n.appendChild(l);this.__defs.appendChild(n)}else{if(o instanceof k){n.appendChild(o.__root.childNodes[1]);this.__defs.appendChild(n)}}return new e(n,this)};k.prototype.setLineDash=function(l){if(l&&l.length>0){this.lineDash=l.join(",")}else{this.lineDash=null}};k.prototype.drawFocusRing=function(){};k.prototype.createImageData=function(){};k.prototype.getImageData=function(){};k.prototype.putImageData=function(){};k.prototype.globalCompositeOperation=function(){};k.prototype.setTransform=function(){};this.BO=k};CanvasXpress.prototype.initInterface=function(){this.wT=function(b){return function(e){b.It();var k=e.target.files[0];var i=k.type;var l=k.name.split(".");var a=new FileReader();var j=l.pop();if(j=="json"){a.onload=function(){try{var c=b.c9(a.result);b.PI();b.layoutValid=false;for(var p in c.config){b[p]=c.config[p]}if(c.afterRender){for(var f=0;f1){m.name+=e[m.name]}var p=b.ZD(m);p.level=l||1;p.parent=i||null;return p}),f.map(function(m){w=Math.max(w,(l||1)+1);if(!m.children){g.push(m.name);q.push(m.value||1)}return C(j(m)||[],j,(l||1)+1,m.name)}))};var d=function d(f){return f.children||null};var h=C(d(k),d).map(function(f){f.n=f.children?f.children.length:0;return delete f.children&&f});var B={y:{vars:["Dummy"],smps:g,data:[q]},x:{}};for(var x=0;x1?u:"")][o]=h[t].name;while(y){t=A[y];u=h[t].level;B.x[z+(u>1?u:"")][o]=h[t].name;y=h[t].parent}}}return{renderTo:"newTree",data:B,config:{graphType:"Tree",hierarchy:n}}};return c(a)};this.sO=function(b){return function(q,y,a,r){b.It();b.HV();var t=function(c){if(c.config&&c.config.backgroundImage&&!Array.isArray(c.config.backgroundImage)&&c.config.backgroundImage.match(/^javascript:\/\//)&&c.config.backgroundImageSrc){var d=new Image();d.id=c.config.backgroundImage.split("//")[1];d.style.display="none";d.src="data:image/png;base64,"+atob(c.config.backgroundImageSrc);document.body.appendChild(d);CanvasXpress.cacheImages[b.SZ(d.src)]=d}else{if(c.config&&c.config.backgroundImage&&Array.isArray(c.config.backgroundImage)){c.config.backgroundImageMD5=b.s8(c.config.backgroundImage);var d=new Image();d.onload=function(){CanvasXpress.cacheImages[c.config.backgroundImageMD5]=this};d.crossOrigin="anonymous";d.src=b.Bg(c.config.backgroundImage)}}};var v=r?r:q.target?q.target.files[0]:q.files[0];var f=v.type;var x=v.name.split(".");var s=new FileReader();var e=window;if(f=="image/png"){var u=function(g,h){var c="";for(var d=0;d<4;d++){c+=String.fromCharCode(g.getUint8(h+d))}return c=="tEXt"};var w=function(d,h,i){var c="";for(var g=0;g0){h=g.fail+" records couldn't be mapped to network data"}alert(g.rows+" "+g.type+" records added to network data\n"+h);if(g.type=="node"){b.CR(g.data)}else{b.Gr(g.data)}b.Jb();return}else{g=b.wD(g)}}else{g=b.JA(b.af(c),b.graphType=="Map");if(g&&!b.pe(g)){if(g.addt){alert(g.recs+" records added as an additional data set\n")}else{alert(g.recs+" records added to meta data\n")}b.Yd(g.data,g.addt);b.Jb();return}else{g=b.wD(g)}}g.renderTo=x[0].replace(/\s/g,"").replace(/\(/g,"").replace(/\)/g,"");b.Dz(g,a);b.Jb()}catch(d){b.Jb();alert("Oooops! Not a valid CanvasXpress delimited file")}}}else{if(z=="esv"){s.onload=function(){try{var c=s.result;var g=b.dL(b.af(c),false,false,false,b.data,"edge");g.renderTo=x[0];b.Dz(g,a);b.Jb()}catch(d){b.Jb();alert("Oooops! Not a valid CanvasXpress delimited file")}}}else{if(z=="gml"){s.onload=function(){try{var d=b.FV(s.result);d.renderTo=x[0];b.Dz(d,a);b.Jb()}catch(c){b.Jb();alert("Oooops! Not a valid gml file for CanvasXpress")}}}else{if(z.match(/ml$/)||z=="gexf"){s.onload=function(){try{CanvasXpress.loadRemoteData(x[0],s.result,false,false,b.updateRemoteData)}catch(c){b.Jb();alert("Oooops! Not a valid "+z+" file for CanvasXpress")}}}}}}}}}}s.readAsText(v)}}}}(this);this.R0=function(a){return function(k,i){if(a.editable||i){var m=window;var b=a.$w;if(a.$p()){m[b(29)](b(1));return}a.removeM;var c=a.VF();var l="\n";l+="