diff --git a/clustergrammer.js b/clustergrammer.js index b24f1cc5..1442da75 100644 --- a/clustergrammer.js +++ b/clustergrammer.js @@ -11523,10 +11523,20 @@ var Clustergrammer = viz = make_cat_params(params, viz, predefined_cat_colors); + // // always make group level dict + // params.group_level = {}; + if (_.has(params, 'group_level') == false) { if (viz.show_dendrogram) { params.group_level = {}; } + + // preventing error when un-clustered, above statement + // preserves dendro state while updating + if (_.has(params, 'group_level') == false) { + params.group_level = {}; + } + params.group_level.row = 5; params.group_level.col = 5; } @@ -14221,10 +14231,9 @@ var Clustergrammer = if (params.viz.show_dendrogram) { make_row_dendro(cgm); make_col_dendro(cgm); + make_row_dendro_spillover(cgm); } - make_row_dendro_spillover(cgm); - make_col_label_container(cgm); // initial trim text @@ -14254,8 +14263,10 @@ var Clustergrammer = generate_super_labels(params); } - // sliders should go above super labels - make_svg_dendro_sliders(cgm); + if (params.viz.show_dendrogram) { + // sliders should go above super labels + make_svg_dendro_sliders(cgm); + } function border_colors() { var inst_color = params.viz.super_border_color; @@ -15677,14 +15688,16 @@ var Clustergrammer = var dendro_info; - if (inst_rc === 'row') { - dendro_info = calc_row_dendro_triangles(params); - } else { - dendro_info = calc_col_dendro_triangles(params); - } + if (params.viz.show_dendrogram) { + if (inst_rc === 'row') { + dendro_info = calc_row_dendro_triangles(params); + } else { + dendro_info = calc_col_dendro_triangles(params); + } - if (d3.select(cgm.params.root + ' .' + inst_rc + '_dendro_crop_buttons').empty() === false) { - make_dendro_crop_buttons(cgm, inst_rc); + if (d3.select(cgm.params.root + ' .' + inst_rc + '_dendro_crop_buttons').empty() === false) { + make_dendro_crop_buttons(cgm, inst_rc); + } } // constant dendrogram opacity @@ -19805,7 +19818,9 @@ var Clustergrammer = y_offset = 0; b_spill_container.append('g').classed('col_dendro_icons_container', true).attr('transform', 'translate(' + x_offset + ',' + y_offset + ')').append('g').classed('col_dendro_icons_group', true); - make_dendro_crop_buttons(cgm, 'col'); + if (params.viz.show_dendrogram) { + make_dendro_crop_buttons(cgm, 'col'); + } var x_offset = viz.clust.margin.left + viz.clust.dim.width; var y_offset = viz.clust.margin.top + viz.clust.dim.height; diff --git a/clustergrammer.min.js b/clustergrammer.min.js index 8fa5f992..0bf32e21 100644 --- a/clustergrammer.min.js +++ b/clustergrammer.min.js @@ -1,13 +1,13 @@ var Clustergrammer=function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){function e(){d3.select(S.params.viz.viz_svg).style("opacity",.5);var t=500;this.params.viz.run_trans===!0&&(t=2500),setTimeout(n,t,this)}function n(t){s(t)}function b(t){f(this,t)}function z(t,e,r){_(this,t,e,r)}function k(){return y}function A(t,e){"sum"===e&&(e="rank"),"var"===e&&(e="rankvar"),w(this,e,t)}function E(){return x(this.params)}function N(t,e){h(this,t,e)}var M=o(t),S={};if(S.params=a(M),S.config=M,S.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,S.params.viz.square_zoom*S.params.viz.zoom_ratio.x]).on("zoom",function(){g(S)}),S.params.zoom_behavior.translate([S.params.viz.clust.margin.left,S.params.viz.clust.margin.top]),S.params.use_sidebar){var O=r(271);O(S)}return i(S),S.update_view=h,S.resize_viz=e,S.play_demo=l,S.ini_demo=c,S.filter_viz_using_nodes=u,S.filter_viz_using_names=d,S.update_cats=b,S.reset_cats=p,S.zoom=z,S.save_matrix=v,S.brush_crop_matrix=m,S.d3_tip_custom=k,S.reorder=A,S.export_matrix_string=E,S.update_view=N,S}var o=r(1),a=r(9),i=r(89),s=r(152),l=r(229),c=r(247),u=r(250),d=r(251),f=r(252),p=r(253),_=r(144),h=r(202),v=r(255),m=r(259),g=r(153),y=r(100),w=r(143),x=r(257);d3.slider=r(261);r(263);r(265),r(269),t.exports=n},function(t,e,r){"use strict";var n=r(2),o=r(3),a=r(4),i=r(5),s=r(6),l=r(7),c=r(8);t.exports=function(t){var e=s(),r=n.extend(e,t);r.network_data=t.network_data;var u=": ";_.each(["row","col"],function(t){var e=r.network_data[t+"_nodes"],n=c(e);e.forEach(function(e,o){e[t+"_index"]=o,n&&(r.super_labels=!0,r.super[t]=e.name.split(u)[0],e.name=e.name.split(u)[1]),e.name=String(e.name),e.name=e.name.replace(/_/g," ")})}),r.network_data.row_nodes_names=n.pluck(r.network_data.row_nodes,"name"),r.network_data.col_nodes_names=n.pluck(r.network_data.col_nodes,"name"),r.sim_mat=l(r);var d=a(r.network_data.views),f={};_.each(_.keys(d.possible_filters),function(t){var e=i(d.filter_data,t);f[t]=e}),_.has(r.network_data,"views")&&r.network_data.views.forEach(function(t){_.each(_.keys(d.possible_filters),function(e){_.has(t,e)||(t[e]=f[e])});var e=t.nodes;_.each(["row","col"],function(t){var r=c(e[t+"_nodes"]);e[t+"_nodes"].forEach(function(e,n){e[t+"_index"]=n,r&&(e.name=e.name.split(u)[1]),e.name=String(e.name),e.name=e.name.replace(/_/g," ")})})});var p=r.network_data.col_nodes,h=r.network_data.row_nodes;if(_.has(r.network_data,"mat")){for(var v=[],m=r.network_data.mat,g={},y=0;y1&&(e[t]=a)});var o={};return o.possible_filters=e,o.filter_data=r,o}},function(t,e){"use strict";t.exports=function(t,e){var r=t[e].sort(function(t,e){return e-t})[0];return r=String(r)}},function(t,e){"use strict";t.exports=function(){var t={row_label_scale:1,col_label_scale:1,super_labels:!1,super:{},show_label_tooltips:!0,show_tile_tooltips:!0,transpose:!1,tile_colors:["#FF0000","#1C86EE"],bar_colors:["#FF0000","#1C86EE"],cat_value_colors:["#2F4F4F","#9370DB"],outline_colors:["orange","black"],highlight_color:"#FFFF00",tile_title:!1,input_domain:0,opacity_scale:"linear",do_zoom:!0,is_zoom:0,is_slider_drag:!1,is_cropping:!1,background_color:"#FFFFFF",super_border_color:"#F5F5F5",outer_margins:{top:0,bottom:0,left:0,right:0},ini_expand:!1,grey_border_width:2,tile_click_hlight:!1,super_label_scale:1,make_tile_tooltip:function(t){return t.info},ini_view:null,requested_view:null,use_sidebar:!0,title:null,about:null,sidebar_width:160,sidebar_icons:!0,row_search_placeholder:"Row",buffer_width:10,show_sim_mat:!1,cat_colors:null,resize:!0,clamp_opacity:.85,expand_button:!0,max_allow_fs:20,dendro_filter:{row:!1,col:!1},cat_filter:{row:!1,col:!1},crop_filter_nodes:{row:!1,col:!1},row_tip_callback:null,col_tip_callback:null,tile_tip_callback:null,matrix_update_callback:null,cat_update_callback:null,dendro_callback:null,dendro_click_callback:null,new_row_cats:null,make_modals:!0,show_viz_border:!1};return t}},function(t,e){"use strict";t.exports=function(t){var e=!1,r=t.network_data.row_nodes_names.length,n=t.network_data.col_nodes_names.length;if(r==n){var o=t.network_data.row_nodes_names,a=t.network_data.col_nodes_names;e=!0,_.each(o,function(t){var r=o.indexOf(t);t!==a[r]&&(e=!1)})}return e&&(t.expand_button=!1),e}},function(t,e){"use strict";t.exports=function(t){var e=": ",r=!0;return _.each(t,function(t){var n=String(t.name);n.indexOf(e)<0&&(r=!1)}),r}},function(t,e,r){"use strict";var n=r(10),o=r(64),a=r(65),i=r(4),s=r(66),l=r(88);t.exports=function(t){var e=$.extend(!0,{},t),r=e;if(r.inst_nodes={},r.inst_nodes.row_nodes=r.network_data.row_nodes,r.inst_nodes.col_nodes=r.network_data.col_nodes,null!==r.ini_view){var c=r.ini_view,u=i(r.network_data.views);r.viz={},r.viz.possible_filters=u.possible_filters,r.viz.filter_data=u.filter_data,c=a(r,c),r.network_data=n(e,r,c),r.requested_view=c}return r=s(r),r.use_sidebar&&(r.sidebar=o(r)),r.zoom_info=l(),r}},function(t,e,r){"use strict";var n=r(11),o=r(63);t.exports=function(t,e,r){var a=t.network_data.views,i=!1;_.has(a[0],"enr_score_type")&&(i=!0);var s=o(e,a,r);i&&0==s.length&&(r={N_row_sum:"all",N_col_sum:"10"},s=o(e,a,r));var l,c=s[0];if("undefined"!=typeof c){var u=c.nodes;l=n(t,u)}else l=t.network_data;return l}},function(t,e,r){"use strict";var n=r(2),o=r(12),a=o.create();a.import(r(25)),a.import(r(62)),t.exports=function(t,e){var r=t.network_data.links,o=n.pluck(e.row_nodes,"name"),i=n.pluck(e.col_nodes,"name"),s=a.matrix(a.zeros([e.row_nodes.length,e.col_nodes.length]));s=s.toArray();var l=_.filter(r,function(t){var e=t.name.split("_")[0],r=t.name.split("_")[1],n=_.indexOf(o,e),a=_.indexOf(i,r);if(n>-1&a>-1)return t.source=n,t.target=a,s[n][a]=t.value,t}),c={};return c.row_nodes=e.row_nodes,c.row_nodes_names=o,c.col_nodes=e.col_nodes,c.col_nodes_names=i,c.links=l,c.all_links=r,c.mat=s,c.views=t.network_data.views,_.has(t.network_data,"cat_colors")&&(c.cat_colors=t.network_data.cat_colors),c}},function(t,e,r){"use strict";t.exports=r(13)},function(t,e,r){"use strict";var n=r(14).isFactory,o=r(16),a=r(20),i=r(22),s=r(24);e.create=function(t){function e(t){if(!n(t))throw new Error("Factory object with properties `type`, `name`, and `factory` expected");var o,a=r.indexOf(t);return a===-1?(o=t.math===!0?t.factory(c.type,u,e,c.typed,c):t.factory(c.type,u,e,c.typed),r.push(t),l.push(o)):o=l[a],o}if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var r=[],l=[],c=a.mixin({});c.type={},c.expression={transform:{},mathWithTransform:{}},c.typed=o.create(c.type);var u={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};return c.import=e(i),c.config=e(s),c.expression.mathWithTransform.config=c.config,t&&c.config(t),c}},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=r(15);e.clone=function t(r){var a="undefined"==typeof r?"undefined":n(r);if("number"===a||"string"===a||"boolean"===a||null===r||void 0===r)return r;if("function"==typeof r.clone)return r.clone();if(Array.isArray(r))return r.map(function(e){return t(e)});if(r instanceof Number)return new Number(r.valueOf());if(r instanceof String)return new String(r.valueOf());if(r instanceof Boolean)return new Boolean(r.valueOf());if(r instanceof Date)return new Date(r.valueOf());if(o(r))return r;if(r instanceof RegExp)throw new TypeError("Cannot clone "+r);return e.map(r,t)},e.map=function(t,r){var n={};for(var o in t)e.hasOwnProperty(t,o)&&(n[o]=r(t[o]));return n},e.extend=function(t,r){for(var n in r)e.hasOwnProperty(r,n)&&(t[n]=r[n]);return t},e.deepExtend=function t(r,n){if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var o in n)if(e.hasOwnProperty(n,o))if(n[o]&&n[o].constructor===Object)void 0===r[o]&&(r[o]={}),r[o].constructor===Object?t(r[o],n[o]):r[o]=n[o];else{if(Array.isArray(n[o]))throw new TypeError("Arrays are not supported by deepExtend");r[o]=n[o]}return r},e.deepEqual=function(t,r){var o,a,i;if(Array.isArray(t)){if(!Array.isArray(r))return!1;if(t.length!=r.length)return!1;for(a=0,i=t.length;a15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t.BigNumber(e)}},{from:"number",to:"Complex",convert:function(e){return new t.Complex(e,0)}},{from:"number",to:"string",convert:function(t){return t+""}},{from:"BigNumber",to:"Complex",convert:function(e){return new t.Complex(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return new t.Complex(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){var r=new t.Fraction(e);if(r.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return new t.Fraction(e)}},{from:"string",to:"number",convert:function(t){var e=Number(t);if(isNaN(e))throw new Error('Cannot convert "'+t+'" to a number');return e}},{from:"string",to:"BigNumber",convert:function(e){try{return new t.BigNumber(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){try{return new t.Fraction(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){try{return new t.Complex(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(e){return new t.BigNumber(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return new t.Fraction(+e)}},{from:"boolean",to:"string",convert:function(t){return+t}},{from:"null",to:"number",convert:function(){return 0}},{from:"null",to:"string",convert:function(){return"null"}},{from:"null",to:"BigNumber",convert:function(){return new t.BigNumber(0)}},{from:"null",to:"Fraction",convert:function(){return new t.Fraction(0)}},{from:"Array",to:"Matrix",convert:function(e){return new t.DenseMatrix(e)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}],e}},function(t,e,r){var n,o,a,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(r,i){o=[],n=i,a="function"==typeof n?n.apply(e,o):n,!(void 0!==a&&(t.exports=a))}(void 0,function(){function t(){function e(t){for(var e,r=0;rr&&!c?"Unexpected type of argument in function "+l+" (expected: "+s.join(" or ")+", actual: "+i+", index: "+r+")":"Too few arguments in function "+l+" (expected: "+s.join(" or ")+", index: "+r+")":"Too many arguments in function "+l+" (expected: "+r+", actual: "+e+")";var d=new TypeError(a);return d.data=u,d}function o(t){this.name=t||"refs",this.categories={}}function a(t,e){if("string"==typeof t){var r=t.trim(),n="..."===r.substr(0,3);if(n&&(r=r.substr(3)),""===r)this.types=["any"];else{this.types=r.split("|");for(var o=0;oe&&(e=n)}return e}function v(t){for(var e,r=0;r0},a.prototype.contains=function(t){for(var e=0;ee.params.length)return 1;if(t.params.lengthi)return 1;if(o "+o+") {"),n.push(r+" var varArgs = [];"),n.push(r+" for (var i = "+o+"; i < arguments.length; i++) {"),n.push(r+" varArgs.push(arguments[i]);"),n.push(r+" }"),n.push(this.signature.toCode(t,r+" ")),n.push(r+"}");else{for(var s=function(r,n){for(var o=[],a=0;a "+r+") {",e+" throw createError(name, arguments.length, "+r+", arguments["+r+"]);",e+"}"].join("\n");for(var n={},o=[],a=0;a0?1:t<0?-1:0},e.format=function(t,r){if("function"==typeof r)return r(t);if(t===1/0)return"Infinity";if(t===-(1/0))return"-Infinity";if(isNaN(t))return"NaN";var n="auto",o=void 0;switch(r&&(r.notation&&(n=r.notation),e.isNumber(r)?o=r:r.precision&&(o=r.precision)),n){case"fixed":return e.toFixed(t,o);case"exponential":return e.toExponential(t,o);case"engineering":return e.toEngineering(t,o);case"auto":return e.toPrecision(t,o,r&&r.exponential).replace(/((\.\d*?)(0+))($|e)/,function(){var t=arguments[2],e=arguments[4];return"."!==t?t+e:e});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", or "fixed".')}},e.splitNumber=function(t){var e=String(t).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var r=e[1],n=e[2],o=parseFloat(e[4]||"0"),a=n.indexOf(".");o+=a!==-1?a-1:n.length-1;var i=n.replace(".","").replace(/^0*/,function(t){return o-=t.length,""}).replace(/0*$/,"").split("").map(function(t){return parseInt(t)});return 0===i.length&&(i.push(0),o++),{sign:r,coefficients:i,exponent:o}},e.toEngineering=function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var o=e.roundDigits(e.splitNumber(t),n),a=o.exponent,i=o.coefficients,s=a%3===0?a:a<0?a-3-a%3:a-a%3,l=a>=0?a:Math.abs(s);i.length-1=0;)u++;var d=i.slice(u).join(""),f=d.match(/[1-9]/)?"."+d:"",p=i.slice(0,u).join("")+f+"e"+(a>=0?"+":"")+s.toString();return o.sign+p},e.toFixed=function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var o=e.splitNumber(t),a=e.roundDigits(o,o.exponent+1+(n||0)),i=a.coefficients,s=a.exponent+1,l=s+(n||0);return i.length0?"."+i.join(""):"")+"e"+(s>=0?"+":"")+s},e.toPrecision=function(t,n,o){if(isNaN(t)||!isFinite(t))return String(t);var a=o&&void 0!==o.lower?o.lower:.001,i=o&&void 0!==o.upper?o.upper:1e5,s=e.splitNumber(t),l=Math.abs(Math.pow(10,s.exponent));if(l=i)return e.toExponential(t,n);var c=n?e.roundDigits(s,n):s,u=c.coefficients,d=c.exponent;u.length0?d:0;return fe){var o=n.splice(e,n.length-e);if(o[0]>=5){var a=e-1;for(n[a]++;10===n[a];)n.pop(),0===a&&(n.unshift(0),r.exponent++,a++),a--,n[a]++}}return r},e.digits=function(t){return t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length},e.DBL_EPSILON=Number.EPSILON||2.220446049250313e-16,e.nearlyEqual=function(t,r,n){if(null==n)return t==r;if(t==r)return!0;if(isNaN(t)||isNaN(r))return!1;if(isFinite(t)&&isFinite(r)){var o=Math.abs(t-r);return o")}function o(t,r,n,a){var i,s,l=t.length,c=r[n],u=Math.min(l,c);if(t.length=c,n=e)throw new d(t,e)},e.UNINITIALIZED={},e.resize=function(t,e,r){if(!Array.isArray(t)||!Array.isArray(e))throw new TypeError("Array expected");if(0===e.length)throw new Error("Resizing to scalar is not supported");e.forEach(function(t){if(!l.isNumber(t)||!l.isInteger(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+c.format(e)+")")});var n=void 0!==r?r:0;return o(t,e,0,n),t},e.reshape=function(t,r){var n,o=e.flatten(t),i=function(t){return t.reduce(function(t,e){return t*e})};if(!Array.isArray(t)||!Array.isArray(r))throw new TypeError("Array expected");if(0===r.length)throw new u(0,i(e.size(t)),"!=");try{n=a(o,r)}catch(n){if(n instanceof u)throw new u(i(r),i(e.size(t)),"!=");throw n}if(o.length>0)throw new u(i(r),i(e.size(t)),"!=");return n},e.squeeze=function(t,r){for(var n=r||e.size(t);Array.isArray(t)&&1===t.length;)t=t[0],n.shift();for(var o=n.length;1===n[o-1];)o--;return o/g,">")}},function(t,e){"use strict";e.format=function(t,r){if("function"==typeof r)return r(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var n="auto",o=void 0;switch(void 0!==r&&(r.notation&&(n=r.notation),"number"==typeof r?o=r:r.precision&&(o=r.precision)),n){case"fixed":return e.toFixed(t,o);case"exponential":return e.toExponential(t,o);case"auto":var a=.001,i=1e5;r&&r.exponential&&(void 0!==r.exponential.lower&&(a=r.exponential.lower),void 0!==r.exponential.upper&&(i=r.exponential.upper));({toExpNeg:t.constructor.toExpNeg,toExpPos:t.constructor.toExpPos});if(t.constructor.config({toExpNeg:Math.round(Math.log(a)/Math.LN10),toExpPos:Math.round(Math.log(i)/Math.LN10)}),t.isZero())return"0";var s,l=t.abs();return s=l.gte(a)&&l.lt(i)?t.toSignificantDigits(o).toFixed():e.toExponential(t,o),s.replace(/((\.\d*?)(0+))($|e)/,function(){var t=arguments[2],e=arguments[4];return"."!==t?t+e:e});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", or "fixed".')}},e.toExponential=function(t,e){return void 0!==e?t.toExponential(e-1):t.toExponential()},e.toFixed=function(t,e){return t.toFixed(e||0)}},function(t,e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.type=function(t){var e="undefined"==typeof t?"undefined":r(t);return"object"===e?null===t?"null":Array.isArray(t)?"Array":t instanceof Date?"Date":t instanceof RegExp?"RegExp":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":"Object":"function"===e?"Function":e}},function(t,e){"use strict";function r(t,e,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=e,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=(new Error).stack}r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="DimensionError",r.prototype.isDimensionError=!0,t.exports=r},function(t,e){"use strict";function r(t,e,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=n),void 0!==this.min&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="IndexError",r.prototype.isIndexError=!0,t.exports=r},function(t,e){"use strict";e.isBoolean=function(t){return"boolean"==typeof t}},function(t,e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.memoize=function(t,e){return function n(){"object"!==r(n.cache)&&(n.cache={});for(var o=[],a=0;a");var p=r.max().map(function(t){return t+1});w(e,p,o);var _=c.length,h=0;y(e._data,r,n,_,h)}return e}function y(t,e,r,n,o){var a=o===n-1,i=e.dimension(o);a?i.forEach(function(e,n){_(e),t[e]=r[n[0]]}):i.forEach(function(a,i){_(a),y(t[a],e,r[i[0]],n,o+1)})}function w(t,e,r){for(var n=t._size.slice(0),o=!1;n.lengthn[a]&&(n[a]=e[a],o=!0);o&&z(t,n,r)}function x(t){for(var e=0,r=t.length;e0?e:0,n=e<0?-e:0,o=this._size[0],a=this._size[1],i=Math.min(o-n,a-r),s=[],l=0;l0?n:0,_=n<0?-n:0,v=e[0],m=e[1],g=Math.min(v-_,m-l);if(u(r)){if(r.length!==g)throw new Error("Invalid value array length");i=function(t){return r[t]}}else if(t.isMatrix(r)){var y=r.size();if(1!==y.length||y[0]!==g)throw new Error("Invalid matrix length");i=function(t){return r.get([t])}}else i=function(){return r};o||(o=t.isBigNumber(i(0))?new t.BigNumber(0):0);var w=[];if(e.length>0){w=s.resize(w,e,o);for(var x=0;x0){var s=0;do{t._ptr.push(t._index.length);for(var l=0;l");for(var p=r.min()[0],_=r.min()[1],h=l[0],v=l[1],m=0;mi-1||o>s-1)&&(E(this,Math.max(n+1,i),Math.max(o+1,s),r),i=this._size[0],s=this._size[1]),_(n,i),_(o,s); var d=z(n,this._ptr[o],this._ptr[o+1],this._index);return df){for(l=f;ld){if(u){var _=0;for(l=0;le-1&&(t._values.splice(c,1),t._index.splice(c,1),m++)}t._ptr[l]=t._values.length}return t._size[0]=e,t._size[1]=r,t};v.prototype.reshape=function(t,e){if(!u(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");if(t.forEach(function(e){if(!c.isNumber(e)||!c.isInteger(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+l.format(t)+")")}),this._size[0]*this._size[1]!==t[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=e?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var n=[],o=0;o=e&&b<=r){if(!i)for(var z=w;z "+(this._values?l.format(this._values[c],t):"X")}return o},v.prototype.toString=function(){return l.format(this.toArray())},v.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},v.prototype.diagonal=function(e){if(e){if(t.isBigNumber(e)&&(e=e.toNumber()),!d(e)||!f(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var r=e>0?e:0,n=e<0?-e:0,o=this._size[0],a=this._size[1],i=Math.min(o-n,a-r),s=[],l=[],c=[];c[0]=0;for(var u=r;u0?n:0,_=n<0?-n:0,m=e[0],y=e[1],w=Math.min(m-_,y-c);if(u(r)){if(r.length!==w)throw new Error("Invalid value array length");l=function(t){return r[t]}}else if(t.isMatrix(r)){var x=r.size();if(1!==x.length||x[0]!==w)throw new Error("Invalid matrix length");l=function(t){return r.get([t])}}else l=function(){return r};for(var b=[],z=[],k=[],A=0;A=0&&E=l||o[u]!==e)){var f=n?n[c]:void 0;o.splice(u,0,e),n&&n.splice(u,0,f),o.splice(u<=c?c+1:c,1),n&&n.splice(u<=c?c+1:c,1)}else if(u=l||o[c]!==t)){var p=n?n[u]:void 0;o.splice(c,0,t),n&&n.splice(c,0,p),o.splice(c<=u?u+1:u,1),n&&n.splice(c<=u?u+1:u,1)}}},t.Matrix._storage.sparse=v,v}var o=r(27),a=r(32),i=o.array,s=o.object,l=o.string,c=o.number,u=Array.isArray,d=c.isNumber,f=c.isInteger,p=l.isString,_=i.validateIndex;e.name="SparseMatrix",e.path="type",e.factory=n,e.lazy=!1},function(t,e,r){"use strict";function n(t,e,r,n){var i=n("equalScalar",{"boolean, boolean":function(t,e){return t===e},"number, number":function(t,r){return t===r||o(t,r,e.epsilon)},"BigNumber, BigNumber":function(t,r){return t.eq(r)||a(t,r,e.epsilon)},"Fraction, Fraction":function(t,e){return t.equals(e)},"Complex, Complex":function(t,e){return t.equals(e)},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return i(t.value,e.value)},"string, string":function(t,e){return t===e}});return i}var o=r(18).nearlyEqual,a=r(40);e.factory=n},function(t,e){"use strict";t.exports=function(t,e,r){if(null==r)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var n=t.minus(e).abs();if(n.isZero())return!0;var o=t.constructor.max(t.abs(),e.abs());return n.lte(o.times(r))}return!1}},function(t,e,r){"use strict";function n(t,e,n){function o(){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new t.FibonacciHeap}var a=n(r(42)),i=n(r(39));return o.prototype.type="Spa",o.prototype.isSpa=!0,o.prototype.set=function(t,e){if(this._values[t])this._values[t].value=e;else{var r=this._heap.insert(t,e);this._values[t]=r}},o.prototype.get=function(t){var e=this._values[t];return e?e.value:0},o.prototype.accumulate=function(t,e){var r=this._values[t];r?r.value=a(r.value,e):(r=this._heap.insert(t,e),this._values[t]=r)},o.prototype.forEach=function(t,e,r){var n=this._heap,o=this._values,a=[],s=n.extractMinimum();for(s&&a.push(s);s&&s.key<=e;)s.key>=t&&(i(s.value,0)||r(s.key,s.value,this)),s=n.extractMinimum(),s&&a.push(s);for(var l=0;l>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},e.defaultTemplate="\\mathrm{${name}}\\left(${args}\\right)";var r={deg:"^\\circ"};e.toSymbol=function(t,n){if(n="undefined"!=typeof n&&n)return r.hasOwnProperty(t)?r[t]:"\\mathrm{"+t+"}";if(e.symbols.hasOwnProperty(t))return e.symbols[t];if(t.indexOf("_")!==-1){var o=t.indexOf("_");return e.toSymbol(t.substring(0,o))+"_{"+e.toSymbol(t.substring(o+1))+"}"}return t}},function(t,e,r){"use strict";function n(t,e,r,n){var a=t.DenseMatrix,i=function(t,e,r,i){var s=t._data,l=t._size,c=t._datatype,u=e._values,d=e._index,f=e._ptr,p=e._size,_=e._datatype;if(l.length!==p.length)throw new o(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,v,m=l[0],g=l[1],y="string"==typeof c&&c===_?c:void 0,w=y?n.find(r,[y,y]):r,x=[];for(h=0;h0?s(v,0,p,p[0],i,u):[];return new o({data:m,size:p,datatype:h})},s=function t(e,r,n,o,a,i){var s=[];if(r===n.length-1)for(var l=0;l0?s(f,0,u,u[0],c,e,i):[];return new a({data:p,size:o(u),datatype:l})},s=function t(e,r,n,o,a,i,s){var l=[];if(r===n.length-1)for(var c=0;c0;){var o=n.right;n.left.right=n.right,n.right.left=n.left,n.left=e,n.right=e.right,e.right=n,n.right.left=n,n.parent=null,n=o,r--}return t.left.right=t.right,t.right.left=t.left,t==t.right?e=null:(e=t.right,e=p(e,this._size)),this._size--,this._minimum=e,t},a.prototype.remove=function(t){this._minimum=c(this._minimum,t,-1),this.extractMinimum()};var c=function(t,e,r){e.key=r;var n=e.parent;return n&&i(e.key,n.key)&&(u(t,e,n),d(t,n)),i(e.key,t.key)&&(t=e),t},u=function(t,e,r){e.left.right=e.right,e.right.left=e.left,r.degree--,r.child==e&&(r.child=e.right),0===r.degree&&(r.child=null),e.left=t,e.right=t.right,t.right=e,e.right.left=e,e.parent=null,e.mark=!1},d=function t(e,r){var n=r.parent;n&&(r.mark?(u(e,r,n),t(n)):r.mark=!0)},f=function(t,e){t.left.right=t.right,t.right.left=t.left,t.parent=e,e.child?(t.left=e.child,t.right=e.child.right,e.child.right=t,t.right.left=t):(e.child=t,t.right=t,t.left=t),e.degree++,t.mark=!1},p=function(t,e){var r=Math.floor(Math.log(e)*l)+1,n=new Array(r),o=0,a=t;if(a)for(o++,a=a.right;a!==t;)o++,a=a.right;for(var c;o>0;){for(var u=a.degree,d=a.right;;){if(c=n[u],!c)break;if(s(a.key,c.key)){var p=c;c=a,a=p}f(c,a),n[u]=null,u++}n[u]=a,a=d,o--}t=null;for(var _=0;_e},"number, number":function(t,r){return t>r&&!o(t,r,e.epsilon)},"BigNumber, BigNumber":function(t,r){return t.gt(r)&&!a(t,r,e.epsilon)},"Fraction, Fraction":function(t,e){return 1===t.compare(e)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return _(t.value,e.value)},"string, string":function(t,e){return t>e},"Matrix, Matrix":function(t,e){var r;switch(t.storage()){case"sparse":switch(e.storage()){case"sparse":r=c(t,e,_);break;default:r=l(e,t,_,!0)}break;default:switch(e.storage()){case"sparse":r=l(t,e,_,!1);break;default:r=d(t,e,_)}}return r},"Array, Array":function(t,e){return _(s(t),s(e)).valueOf()},"Array, Matrix":function(t,e){return _(s(t),e)},"Matrix, Array":function(t,e){return _(t,s(e))},"Matrix, any":function(t,e){var r;switch(t.storage()){case"sparse":r=u(t,e,_,!1);break;default:r=f(t,e,_,!1)}return r},"any, Matrix":function(t,e){var r;switch(e.storage()){case"sparse":r=u(e,t,_,!0);break;default:r=f(e,t,_,!0)}return r},"Array, any":function(t,e){return f(s(t),e,_,!1).valueOf()},"any, Array":function(t,e){return f(s(e),t,_,!0).valueOf()}});return _.toTex={2:"\\left(${args[0]}"+p.operators.larger+"${args[1]}\\right)"},_}var o=r(18).nearlyEqual,a=r(40);e.name="larger",e.factory=n},function(t,e,r){"use strict";function n(t,e,n){function a(e,r){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!l(r))throw new Error("Invalid datatype: "+r);if(t.isMatrix(e)||s(e)){var n=new c(e,r);this._data=n._data,this._size=n._size,this._datatype=n._datatype,this._min=null,this._max=null}else if(e&&s(e.data)&&s(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min="undefined"!=typeof e.min?e.min:null,this._max="undefined"!=typeof e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+o.types.type(e)+")");this._data=[],this._size=[0],this._datatype=r,this._min=null,this._max=null}}var c=n(r(36)),u=n(r(52));return a.prototype=new c,a.prototype.type="ImmutableDenseMatrix",a.prototype.isImmutableDenseMatrix=!0,a.prototype.subset=function(e){switch(arguments.length){case 1:var r=c.prototype.subset.call(this,e);return t.isMatrix(r)?new a({data:r._data,size:r._size,datatype:r._datatype}):r;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},a.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},a.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},a.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},a.prototype.clone=function(){var t=new a({data:i.clone(this._data),size:i.clone(this._size),datatype:this._datatype});return t},a.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},a.fromJSON=function(t){return new a(t)},a.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},a.prototype.min=function(){if(null===this._min){var t=null;this.forEach(function(e){(null===t||u(e,t))&&(t=e)}),this._min=null!==t?t:void 0}return this._min},a.prototype.max=function(){if(null===this._max){var t=null;this.forEach(function(e){(null===t||u(t,e))&&(t=e)}),this._max=null!==t?t:void 0}return this._max},a}var o=r(27),a=o.string,i=o.object,s=Array.isArray,l=a.isString;e.name="ImmutableDenseMatrix",e.path="type",e.factory=n},function(t,e,r){"use strict";function n(t){function e(n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var o=0,a=arguments.length;o0?this.step>0?this.start:this.start+(t-1)*this.step:void 0},a.prototype.max=function(){var t=this.size()[0];return t>0?this.step>0?this.start+(t-1)*this.step:this.start:void 0},a.prototype.forEach=function(t){var e=this.start,r=this.step,n=this.end,o=0;if(r>0)for(;en;)t(e,[o],this),e+=r,o++},a.prototype.map=function(t){var e=[];return this.forEach(function(r,n,o){e[n[0]]=t(r,n,o)}),e},a.prototype.toArray=function(){var t=[];return this.forEach(function(e,r){t[r[0]]=e}),t},a.prototype.valueOf=function(){return this.toArray()},a.prototype.format=function(t){var e=o.format(this.start,t);return 1!=this.step&&(e+=":"+o.format(this.step,t)),e+=":"+o.format(this.end,t)},a.prototype.toString=function(){return this.format()},a.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},a.fromJSON=function(t){return new a(t.start,t.end,t.step)},a}var o=r(18);e.name="Range",e.path="type",e.factory=n},function(t,e){"use strict";function r(t,e,r,n){return n("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e){var r=e.map(function(e){return t.isBigNumber(e)?e.toNumber():Array.isArray(e)||t.isMatrix(e)?e.map(function(e){return t.isBigNumber(e)?e.toNumber():e}):e}),n=new t.Index;return t.Index.apply(n,r),n}})}e.name="index",e.factory=r},function(t,e){"use strict";function r(t,e,r,n){var o=t.SparseMatrix,a=n("sparse",{"":function(){return new o([])},string:function(t){return new o([],t)},"Array | Matrix":function(t){return new o(t)},"Array | Matrix, string":function(t,e){return new o(t,e)}});return a.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},a}e.name="sparse",e.factory=r},function(t,e,r){"use strict";function n(t,e,n,i){function s(e,r){var n=l(e),o=n?new t.BigNumber(0):0;if(c(e),r){var i=u(r);return e.length>0?i.resize(e,o):i}var s=[];return e.length>0?a(s,e,o):s}function l(e){var r=!1;return e.forEach(function(e,n,o){t.isBigNumber(e)&&(r=!0,o[n]=e.toNumber())}),r}function c(t){t.forEach(function(t){if("number"!=typeof t||!o(t)||t<0)throw new Error("Parameters in function zeros must be positive integers")})}var u=n(r(43)),d=i("zeros",{"":function(){return"Array"===e.matrix?s([]):s([],"default")},"...number | BigNumber | string":function(t){var r=t[t.length-1];if("string"==typeof r){var n=t.pop();return s(t,n)}return"Array"===e.matrix?s(t):s(t,"default")},Array:s,Matrix:function(t){var e=t.storage();return s(t.valueOf(),e)},"Array | Matrix, string":function(t,e){return s(t.valueOf(),e)}});return d.toTex=void 0,d}var o=r(18).isInteger,a=r(28).resize;e.name="zeros",e.factory=n},function(t,e,r){"use strict";var n=r(2),o=r(5);t.exports=function(t,e,r){var a,i,s=_.keys(r);_.each(s,function(t){a=r[t],/[^a-z_]/i.test(a)&&(a=parseInt(a,10)),i=!1,_.each(e,function(e){n.has(e,t)&&(i=!0)}),i&&(e=_.filter(e,function(e){return e[t]==a}))});var l,c,u=[],d=!1;return _.each(e,function(e){l=!0,_.each(_.keys(t.viz.possible_filters),function(r){c=o(t.viz.filter_data,r),e[r]!=c&&(l=!1)}),l?d===!1&&(d=!0,u.push(e)):u.push(e)}),u}},function(t,e){"use strict";t.exports=function(t){var e={};return e.wrapper={},e.row_search={},e.row_search.box={},e.row_search.box.height=34,e.row_search.box.width=95,e.row_search.placeholder=t.row_search_placeholder,e.row_search.margin_left=7,e.slider={},e.slider.width=t.sidebar_width-30,e.slider.margin_left=15,e.key_cat={},e.key_cat.width=t.sidebar_width-15,e.key_cat.margin_left=5,e.key_cat.max_height=100,e.title=t.title,e.title_margin_left=7,e.about=t.about,e.width=t.sidebar_width,e.buttons={},e.buttons.width=t.sidebar_width-15,e.text={},e.icons=t.sidebar_icons,e.icon_margin_left=-5,e}},function(t,e){"use strict";t.exports=function(t,e){var r=_.keys(e)[0];return _.each(_.keys(t.viz.possible_filters),function(n){if(n!=r&&!d3.select(t.root+" .slider_"+n).empty()){var o=d3.select(t.root+" .slider_"+n).attr("current_state");e[n]=o}}),e}},function(t,e,r){"use strict";var n=r(67),o=r(69),a=r(71),i=r(72),s=r(73),l=r(74),c=r(75),u=r(76),d=r(81),f=r(83),p=r(2),h=r(4),v=r(84);t.exports=function(t){function e(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={};r.root=t.root,r.root_tips=t.root.replace("#",".")+"_d3-tip",r.viz_wrapper=t.root+" .viz_wrapper",r.do_zoom=t.do_zoom,r.background_color=t.background_color,r.super_border_color=t.super_border_color,r.outer_margins=t.outer_margins,r.is_expand=t.ini_expand,r.grey_border_width=t.grey_border_width,r.show_dendrogram=t.show_dendrogram,r.tile_click_hlight=t.tile_click_hlight,r.inst_order=t.inst_order,r.expand_button=t.expand_button,r.sim_mat=t.sim_mat,r.dendro_filter=t.dendro_filter,r.cat_filter=t.cat_filter,r.cat_value_colors=t.cat_value_colors,r.viz_svg=r.viz_wrapper+" .viz_svg",r.zoom_element=r.viz_wrapper+" .viz_svg",r.uni_duration=1e3,r.bottom_space=10,r.run_trans=!1,r.duration=1e3,r.resize=t.resize,p.has(t,"size")?r.fixed_size=t.size:r.fixed_size=!1,r.border_fraction=65,r.uni_margin=5,r.super_labels={},r.super_labels.margin={},r.super_labels.dim={},r.super_labels.margin.left=r.grey_border_width,r.super_labels.margin.top=r.grey_border_width,r.super_labels.dim.width=0,t.labels.super_labels&&(r.super_labels.dim.width=15*t.labels.super_label_scale),r.triangle_opacity=.6,r.norm_labels={},r.norm_labels.width={},r.dendro_room={},r.show_dendrogram?r.dendro_room.symbol_width=10:r.dendro_room.symbol_width=0,r.cat_colors=t.cat_colors,r=v(t,r,e),0==_.has(t,"group_level")&&(r.show_dendrogram&&(t.group_level={}),t.group_level.row=5,t.group_level.col=5),r.dendro_opacity=.35,r.spillover_col_slant=r.norm_labels.width.col;var n=h(t.network_data.views);return r.possible_filters=n.possible_filters,r.filter_data=n.filter_data,r.viz_nodes={},r.viz_nodes.row=t.network_data.row_nodes_names,r.viz_nodes.col=t.network_data.col_nodes_names,r.viz_nodes.curr_row=t.network_data.row_nodes_names,r.viz_nodes.curr_col=t.network_data.col_nodes_names,r.x_offset=0,r}var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.labels=n(t),t.viz=e(t,r),o(t),t=a(t),t.viz=i(t.viz),t.viz=s(t.viz),t.viz=l(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t=c(t),t=u(t),t=d(t),t=f(t)}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e={};return e.super_label_scale=t.super_label_scale,e.super_labels=t.super_labels,e.super_label_fs=13.8,e.super_labels&&(e.super={},e.super.row=t.super.row,e.super.col=t.super.col),e.show_label_tooltips=t.show_label_tooltips,e.row_max_char=n.max(t.network_data.row_nodes,function(t){return t.name.length}).name.length,e.col_max_char=n.max(t.network_data.col_nodes,function(t){return t.name.length}).name.length,e.max_allow_fs=t.max_allow_fs,e}},function(t,e,r){var n,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};(function(){function r(t){function e(e,r,n,o,a,i){for(;a>=0&&a0?0:s-1;return arguments.length<3&&(o=r[i?i[l]:l],l+=t),e(r,n,o,i,l,s)}}function i(t){return function(e,r,n){r=A(r,n);for(var o=O(e),a=t>0?0:o-1;a>=0&&a0?i=a>=0?a:Math.max(a+s,i):s=a>=0?Math.min(a+1,s):a+s+1;else if(r&&a&&s)return a=r(n,o),n[a]===o?a:-1;if(o!==o)return a=e(h.call(n,i,s),z.isNaN),a>=0?a+i:-1;for(a=t>0?i:s-1;a>=0&&a=0&&e<=S};z.each=z.forEach=function(t,e,r){e=k(e,r);var n,o;if(T(t))for(n=0,o=t.length;n=0},z.invoke=function(t,e){var r=h.call(arguments,2),n=z.isFunction(e);return z.map(t,function(t){var o=n?e:t[e];return null==o?o:o.apply(t,r)})},z.pluck=function(t,e){return z.map(t,z.property(e))},z.where=function(t,e){return z.filter(t,z.matcher(e))},z.findWhere=function(t,e){return z.find(t,z.matcher(e))},z.max=function(t,e,r){var n,o,a=-(1/0),i=-(1/0);if(null==e&&null!=t){t=T(t)?t:z.values(t);for(var s=0,l=t.length;sa&&(a=n)}else e=A(e,r),z.each(t,function(t,r,n){o=e(t,r,n),(o>i||o===-(1/0)&&a===-(1/0))&&(a=t,i=o)});return a},z.min=function(t,e,r){var n,o,a=1/0,i=1/0;if(null==e&&null!=t){t=T(t)?t:z.values(t);for(var s=0,l=t.length;sn||void 0===r)return 1;if(re?(i&&(clearTimeout(i),i=null),s=c,a=t.apply(n,o),i||(n=o=null)):i||r.trailing===!1||(i=setTimeout(l,u)),a}},z.debounce=function(t,e,r){var n,o,a,i,s,l=function l(){var c=z.now()-i;c=0?n=setTimeout(l,e-c):(n=null,r||(s=t.apply(a,o),n||(a=o=null)))};return function(){a=this,o=arguments,i=z.now();var c=r&&!n;return n||(n=setTimeout(l,e)),c&&(s=t.apply(a,o),a=o=null),s}},z.wrap=function(t,e){return z.partial(e,t)},z.negate=function(t){return function(){return!t.apply(this,arguments)}},z.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},z.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},z.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},z.once=z.partial(z.before,2);var I=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];z.keys=function(t){if(!z.isObject(t))return[];if(y)return y(t);var e=[];for(var r in t)z.has(t,r)&&e.push(r);return I&&l(t,e),e},z.allKeys=function(t){if(!z.isObject(t))return[];var e=[];for(var r in t)e.push(r);return I&&l(t,e),e},z.values=function(t){for(var e=z.keys(t),r=e.length,n=Array(r),o=0;o":">",'"':""","'":"'","`":"`"},D=z.invert(L),P=function(t){var e=function(e){return t[e]},r="(?:"+z.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(o,e):t}};z.escape=P(L),z.unescape=P(D),z.result=function(t,e,r){var n=null==t?void 0:t[e];return void 0===n&&(n=r),z.isFunction(n)?n.call(t):n};var U=0;z.uniqueId=function(t){var e=++U+"";return t?t+e:e},z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,$={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+$[t]};z.template=function(t,e,r){!e&&r&&(e=r),e=z.defaults({},e,z.templateSettings);var n=RegExp([(e.escape||q).source,(e.interpolate||q).source,(e.evaluate||q).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(n,function(e,r,n,i,s){return a+=t.slice(o,s).replace(H,W),o=s+e.length,r?a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),e}),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var i=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var s=function(t){return i.call(this,t,z)},l=e.variable||"obj";return s.source="function("+l+"){\n"+a+"}",s},z.chain=function(t){var e=z(t);return e._chain=!0,e};var Z=function(t,e){return t._chain?z(e).chain():e};z.mixin=function(t){z.each(z.functions(t),function(e){var r=z[e]=t[e];z.prototype[e]=function(){var t=[this._wrapped];return _.apply(t,arguments),Z(this,r.apply(z,t))}})},z.mixin(z),z.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=d[t];z.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],Z(this,r)}}),z.each(["concat","join","slice"],function(t){var e=d[t];z.prototype[t]=function(){return Z(this,e.apply(this._wrapped,arguments))}}),z.prototype.value=function(){return this._wrapped},z.prototype.valueOf=z.prototype.toJSON=z.prototype.value,z.prototype.toString=function(){return""+this._wrapped},n=[],o=function(){return z}.apply(e,n),!(void 0!==o&&(t.exports=o))}).call(void 0)},function(t,e,r){"use strict";var n=r(70);t.exports=function(t){d3.select(t.root+" .viz_wrapper").empty()&&(d3.select(t.root).append("div").classed("sidebar_wrapper",!0),d3.select(t.root).append("div").classed("viz_wrapper",!0));var e=n(t);d3.select(t.root+" .sidebar_wrapper").style("float","left").style("width",t.sidebar_width+"px").style("height",e.height+"px").style("overflow","hidden"),d3.select(t.viz.viz_wrapper).style("float","left").style("width",e.width+"px").style("height",e.height+"px")}},function(t,e){"use strict";t.exports=function(t){var e,r={},n=t.buffer_width,o=d3.select(t.root).style("width").replace("px",""),a=d3.select(t.root).style("height").replace("px","");return t.viz.is_expand===!1?(e=t.viz.outer_margins,r.width=o-t.sidebar_width-n):(e=t.viz.outer_margins,r.width=o-n),r.top=e.top,r.left=e.left,t.viz.resize?r.height=a:(t.viz.is_expand?r.width=t.viz.fixed_size.width:r.width=t.viz.fixed_size.width-t.sidebar_width,r.height=t.viz.fixed_size.height),r}},function(t,e){"use strict";t.exports=function(t){return t.viz.svg_dim={},t.viz.svg_dim.width=Number(d3.select(t.viz.viz_wrapper).style("width").replace("px","")),t.viz.svg_dim.height=Number(d3.select(t.viz.viz_wrapper).style("height").replace("px","")),t}},function(t,e){"use strict";t.exports=function(t){return t.norm_labels.margin={},t.norm_labels.margin.left=t.super_labels.margin.left+t.super_labels.dim.width,t.norm_labels.margin.top=t.super_labels.margin.top+t.super_labels.dim.width,t.label_background={},t.label_background.row=t.norm_labels.width.row+t.cat_room.row+t.uni_margin,t.label_background.col=t.norm_labels.width.col+t.cat_room.col+t.uni_margin,t}},function(t,e){"use strict";t.exports=function(t){t.clust={},t.clust.margin={},t.clust.margin.left=t.norm_labels.margin.left+t.norm_labels.width.row+t.cat_room.row+t.uni_margin,t.clust.margin.top=t.norm_labels.margin.top+t.norm_labels.width.col+t.cat_room.col+t.uni_margin;var e=t.svg_dim.width-t.clust.margin.left-t.spillover_col_slant,r=d3.scale.ordinal().rangeBands([0,e]).domain(_.range(t.num_col_nodes)),n=r.rangeBand()/2;if(n>t.norm_labels.width.col){var o=t.norm_labels.width.col/n;e*=o}return t.clust.dim={},t.clust.dim.width=e,t}},function(t,e){"use strict";t.exports=function(t){var e=t.svg_dim.height-t.clust.margin.top-t.dendro_room.col-t.bottom_space;return t.clust.dim.height=e,t}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e=Math.abs(n.max(t.network_data.col_nodes,function(t){return Math.abs(t.value)}).value);return t.labels.bar_scale_col=d3.scale.linear().domain([0,e]).range([0,.75*t.viz.norm_labels.width.col]),e=Math.abs(n.max(t.network_data.row_nodes,function(t){return Math.abs(t.value)}).value),t.labels.bar_scale_row=d3.scale.linear().domain([0,e]).range([0,t.viz.norm_labels.width.row]),t}},function(t,e,r){"use strict";var n=r(77),o=r(79);t.exports=function(t){t.matrix=n(t),t.viz.x_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]);var e;return _.each(["row","col"],function(r){e=t.viz.inst_order[r],"custom"===e&&(e="clust"),"row"===r?t.viz.x_scale.domain(t.matrix.orders[e+"_"+r]):t.viz.y_scale.domain(t.matrix.orders[e+"_"+r])}),t.viz.border_width={},t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,o(t),t}},function(t,e,r){"use strict";var n=r(2),o=r(78),a=r(68);t.exports=function(t){var e={},r=t.network_data;e.tile_colors=t.tile_colors,e.bar_colors=t.bar_colors,e.outline_colors=t.outline_colors,e.hlight_color=t.highlight_color,e.tile_title=t.tile_title,e.show_tile_tooltips=t.show_tile_tooltips,e.make_tile_tooltip=t.make_tile_tooltip,e.distance_metric="cosine",e.linkage_type="average",e.click_hlight_x=-666,e.click_hlight_y=-666,e.click_hlight_row=-666,e.click_hlight_col=-666,e.def_large_matrix=1e4,e.opacity_function=t.opacity_scale,e.orders={},_.each(["row","col"],function(o){var a;a="row"===o?"col":"row";var i=r[a+"_nodes"],s=i.length,l=n.pluck(i,"name"),c=l.sort(),u=_.map(c,function(t){return r[a+"_nodes_names"].indexOf(t)});e.orders["alpha_"+o]=u;var d=["clust","rank"];_.has(i[0],"rankvar")&&d.push("rankvar"),t.viz.all_cats[a].length>0&&_.each(t.viz.all_cats[a],function(t){t=t.replace("-","_"),d.push(t+"_index")}),_.each(d,function(t){var r=d3.range(s).sort(function(e,r){return i[r][t]-i[e][t]});e.orders[t+"_"+o]=r})}),n.has(r,"all_links")?e.max_link=a.max(r.all_links,function(t){return Math.abs(t.value)}).value:e.max_link=a.max(r.links,function(t){return Math.abs(t.value)}).value,e.abs_max_val=Math.abs(e.max_link)*t.clamp_opacity,0===t.input_domain?"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,e.abs_max_val]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,e.abs_max_val]).clamp(!0).range([0,1])):"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,t.input_domain]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,t.input_domain]).clamp(!0).range([0,1]));var i=n.has(r.links[0],"value_up"),s=n.has(r.links[0],"value_dn");return i||s?e.tile_type="updn":e.tile_type="simple",n.has(r.links[0],"highlight")?e.highlight=1:e.highlight=0,e.matrix=o(r),e.wait_tooltip=0,e}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t){var e,r,o=[];return r=!!n.has(t.links[0],"value_orig"),t.row_nodes.forEach(function(a,i){o[i]={},o[i].name=t.row_nodes[i].name,o[i].row_index=i,o[i].row_data=d3.range(t.col_nodes.length).map(function(o){return e=n.has(t.links[0],"value_up")||n.has(t.links[0],"value_dn")?{pos_x:o,pos_y:i,value:0,value_up:0,value_dn:0,highlight:0}:{pos_x:o,pos_y:i,value:0,highlight:0},r&&(e.value_orig=0),e})}),t.links.forEach(function(t){o[t.source].row_data[t.target].value=t.value,o[t.source].row_data[t.target].row_name=t.row_name,o[t.source].row_data[t.target].col_name=t.col_name,(n.has(t,"value_up")||n.has(t,"value_dn"))&&(o[t.source].row_data[t.target].value_up=t.value_up,o[t.source].row_data[t.target].value_dn=t.value_dn),r&&(o[t.source].row_data[t.target].value_orig=t.value_orig),t.highlight&&(o[t.source].row_data[t.target].highlight=t.highlight),t.info&&(o[t.source].row_data[t.target].info=t.info)}),o}},function(t,e,r){"use strict";var n=r(80);t.exports=function(t){var e=3,r=2,o=e/t.viz.rect_height,a=2;t.viz.ds_zt=a;var i=Math.floor(Math.log(o)/Math.log(a));if(t.viz.rect_height0){var s=2;t.viz.ds_opacity_scale=d3.scale.linear().domain([1,100]).range([1,s]).clamp(!0);var l;t.viz.ds_num_levels=i,t.viz.ds=[],t.matrix.ds_matrix=[];for(var c=t.viz.inst_order.row,u=$.extend(!0,{},t.matrix.matrix),d=0;dt.labels.max_allow_fs&&(t.labels.default_fs_row=t.labels.max_allow_fs),t.labels.default_fs_col>t.labels.max_allow_fs&&(t.labels.default_fs_col=t.labels.max_allow_fs), -t}},function(t,e,r){"use strict";var n=r(85),o=r(2),a=r(86),i=r(87);t.exports=function(t,e){var r,s,l,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=": ";e.show_categories={},e.all_cats={},e.cat_names={},e.cat_info={};var d={};d.row=null,d.col=null,e.cat_colors={},e.cat_colors.value_opacity=d;var f=0;return _.each(["row","col"],function(n){e.show_categories[n]=!1,e.all_cats[n]=[];var d=_.keys(t.network_data[n+"_nodes"][0]);d=d.sort(),_.each(d,function(t){t.indexOf("cat-")>=0&&(e.show_categories[n]=!0,e.all_cats[n].push(t))}),e.cat_info[n]=null,e.show_categories[n]&&(e.cat_colors[n]={},e.cat_info[n]={},e.cat_names[n]={},_.each(e.all_cats[n],function(c){var d=t.network_data[n+"_nodes"][0];"string"==typeof d[c]&&d[c].indexOf(u)>0?(r=d[c].split(u)[0],e.cat_names[n][c]=r):e.cat_names[n][c]=c;var p=o.pluck(t.network_data[n+"_nodes"],c),h=[];_.each(p,function(t){var e;e=t.indexOf(": ")>0?t.split(": ")[1]:t,h.push(e)});var v=_.uniq(p).sort();if(s=i(v),"cat_strings"===s.type){var m=_.countBy(h);s.cat_hist=m}else s.cat_hist=null;e.cat_info[n][c]=s,e.cat_colors[n][c]={},_.each(v,function(t,r){l=a.get_random_color(r+f),e.cat_colors[n][c][t]=l,"string"==typeof t&&(t.indexOf("Not ")>=0||t.indexOf(": false")>0)&&(e.cat_colors[n][c][t]="#eee"),f+=1})})),_.has(t.network_data,"cat_colors")&&c===!0&&(e.cat_colors[n]=t.network_data.cat_colors[n]),t.sim_mat&&(e.cat_colors.col=e.cat_colors.row)}),e.cat_colors=e.cat_colors,e.cat_colors.opacity=.6,e.cat_colors.active_opacity=.9,e=n(t,e)}},function(t,e){"use strict";t.exports=function(t,e){var r,n=d3.scale.linear().domain([5,15]).range([85,120]).clamp("true");return e.cat_room={},e.cat_room.symbol_width=12,e.cat_room.separation=3,_.each(["row","col"],function(o){e.norm_labels.width[o]=n(t.labels[o+"_max_char"])*t[o+"_label_scale"],e["num_"+o+"_nodes"]=t.network_data[o+"_nodes"].length,"row"===o?e.dendro_room[o]=e.dendro_room.symbol_width:e.dendro_room[o]=e.dendro_room.symbol_width+3*e.uni_margin;var a=e.all_cats[o].length;if(e.show_categories[o]){r=(a-1)*e.cat_room.separation;var i;i="row"===o?a+1:a,e.cat_room[o]=i*e.cat_room.symbol_width+r}else"row"==o?e.cat_room[o]=e.cat_room.symbol_width:e.cat_room[o]=0}),e}},function(t,e){"use strict";function r(){return"#EEE"}function n(t){return a[t%o()]}function o(){return a.length}var a;a=["#393b79","#aec7e8","#ff7f0e","#ffbb78","#98df8a","#bcbd22","#404040","#ff9896","#c5b0d5","#8c564b","#1f77b4","#5254a3","#FFDB58","#c49c94","#e377c2","#7f7f7f","#2ca02c","#9467bd","#dbdb8d","#17becf","#637939","#6b6ecf","#9c9ede","#d62728","#8ca252","#8c6d31","#bd9e39","#e7cb94","#843c39","#ad494a","#d6616b","#7b4173","#a55194","#ce6dbd","#de9ed6"],t.exports={get_default_color:r,get_random_color:n,get_num_colors:o}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e=t[0],r=!1,o=!1,a="cat_strings",i=NaN,s=[],l=null,c=": ";if("string"==typeof e&&e.indexOf(c)>-1&&(r=!0,e=e.split(c)[1]),0==isNaN(e)&&(o=!0),o&&(a="cat_values",_.each(t,function(t){r&&(t=t.split(c)[1]),isNaN(t)===!0?a="cat_strings":(t=parseFloat(t),s.push(t))})),"cat_values"===a){var u=n.max(s,function(t){return Math.abs(t)});i=Math.abs(u),l=d3.scale.linear().domain([0,i]).range([0,1])}var d={};return d.type=a,d.max_abs_val=i,d.cat_scale=l,d}},function(t,e){"use strict";t.exports=function(){var t={};return t.zoom_x=1,t.zoom_y=1,t.trans_x=0,t.trans_y=0,t}},function(t,e,r){"use strict";var n=r(90),o=r(101),a=r(131),i=r(139),s=r(140),l=r(151),c=r(161),u=r(180),d=r(185),f=r(146),p=r(186),h=r(187),v=r(188),m=r(228);t.exports=function(t){function e(){var t=r.viz.super_border_color;return(r.viz.is_expand||0==r.show_viz_border)&&(t="white"),t}var r=t.params;d3.select(r.viz.viz_wrapper+" svg").remove();var g=d3.select(r.viz.viz_wrapper).append("svg").attr("class","viz_svg").attr("id","svg_"+r.root.replace("#","")).attr("width",r.viz.svg_dim.width).attr("height",r.viz.svg_dim.height).attr("is_zoom",0).attr("stopped_zoom",1);g.append("rect").attr("class","super_background").style("width",r.viz.svg_dim.width).style("height",r.viz.svg_dim.height).style("fill","white"),n(r,g),o(t),r.viz.show_dendrogram&&(p(t),h(t)),m(t),a(t),r.viz.ds_level===-1&&_.each(["row","col"],function(t){var e=Number(d3.select("."+t+"_label_group").select("text").style("font-size").replace("px","")),n=8;e>n&&d3.selectAll(r.root+" ."+t+"_label_group").each(function(){f(r,this,t)})}),d(t),r.viz.show_categories.col&&u(t),s(t),r.labels.super_labels&&i(r),v(t),d3.select(r.viz.viz_svg).append("rect").classed("left_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.grey_border_width).attr("height",r.viz.svg_dim.height).attr("transform","translate(0,0)"),d3.select(r.viz.viz_svg).append("rect").classed("right_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.grey_border_width).attr("height",r.viz.svg_dim.height).attr("transform",function(){var t=r.viz.svg_dim.width-r.viz.grey_border_width;return"translate("+t+",0)"}),d3.select(r.viz.viz_svg).append("rect").classed("top_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.svg_dim.width).attr("height",r.viz.grey_border_width).attr("transform",function(){var t=0;return"translate("+t+",0)"}),d3.select(r.viz.viz_svg).append("rect").classed("bottom_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.svg_dim.width).attr("height",r.viz.grey_border_width).attr("transform",function(){var t=r.viz.svg_dim.height-r.viz.grey_border_width;return"translate(0,"+t+")"}),l(t),c(t),r.viz.do_zoom&&d3.select(r.viz.zoom_element).call(r.zoom_behavior),d3.select(r.viz.zoom_element).on("dblclick.zoom",null)}},function(t,e,r){"use strict";var n=r(2),o=r(91),a=r(92),i=r(93);t.exports=function(t,e){var r,s=t.network_data,l=[];r=e.append("g").attr("class","clust_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.clust.margin.top+")").append("g").attr("class","clust_group").classed("clust_group",!0),r.append("rect").classed("background",!0).classed("grey_background",!0).style("fill","#eee").style("opacity",.25).attr("width",t.viz.clust.dim.width).attr("height",t.viz.clust.dim.height),null===t.viz.ds?i(t,t.matrix.matrix,"all",t.viz.ds_level):i(t,t.matrix.ds_matrix[0],"all",t.viz.ds_level),"function"==typeof t.click_tile?d3.selectAll(t.root+" .tile").on("click",function(e){var r={};r.row=t.network_data.row_nodes[e.pos_y].name,r.col=t.network_data.col_nodes[e.pos_x].name,r.value=e.value,n.has(e,"value_up")&&(r.value_up=e.value_up),n.has(e,"value_dn")&&(r.value_dn=e.value_dn),n.has(e,"info")&&(r.info=e.info),t.click_tile(r),a(t,this)}):t.tile_click_hlight&&d3.selectAll(t.root+" .tile").on("click",function(){a(t,this)});var c={},u=0;return c.enter=0,o(t,c,u),{get_clust_group:function(){return r},get_matrix:function(){return l},get_nodes:function(t){return"row"===t?s.row_nodes:s.col_nodes}}}},function(t,e){"use strict";t.exports=function(t,e,r){}},function(t,e){"use strict";t.exports=function(t,e){d3.select(e).each(function(r){var n=r.pos_x,o=r.pos_y;if(d3.selectAll(t.root+" .click_hlight").remove(),n!=t.matrix.click_hlight_x||o!=t.matrix.click_hlight_y){t.matrix.click_hlight_x=n,t.matrix.click_hlight_y=o;var a=6,i=.85,s=a*t.viz.border_width.x,l=a*t.viz.border_width.y;d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("top_hlight",!0).attr("width",t.viz.x_scale.rangeBand()).attr("height",l).attr("fill",t.matrix.hlight_color).attr("transform",function(){return"translate("+t.viz.x_scale(n)+",0)"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("left_hlight",!0).attr("width",s).attr("height",t.viz.y_scale.rangeBand()-.99*l).attr("fill",t.matrix.hlight_color).attr("transform",function(){return"translate("+t.viz.x_scale(n)+","+.99*l+")"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("right_hlight",!0).attr("width",s).attr("height",t.viz.y_scale.rangeBand()-.99*l).attr("fill",t.matrix.hlight_color).attr("transform",function(){var e=t.viz.x_scale(n)+t.viz.x_scale.rangeBand()-s;return"translate("+e+","+.99*l+")"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("bottom_hlight",!0).attr("width",function(){return t.viz.x_scale.rangeBand()-1.98*s}).attr("height",l).attr("fill",t.matrix.hlight_color).attr("transform",function(){var e=t.viz.x_scale(n)+.99*s,r=t.viz.y_scale.rangeBand()-l;return"translate("+e+","+r+")"}).attr("opacity",i)}else t.matrix.click_hlight_x=-666,t.matrix.click_hlight_y=-666})}},function(t,e,r){"use strict";var n=r(94),o=r(100),a=r(68);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=t.viz.y_scale,l=!0,c="row";if(i>=0&&(s=t.viz.ds[i].y_scale,l=!1,c="ds"+String(i)+"_row"),l)var u=o().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip "+e+"_tile_tip";return r}).style("display","none").direction("nw").offset([0,0]).html(function(e){var r,n=String(e.value.toFixed(3));if(t.keep_orig){var o=String(e.value_orig.toFixed(3));r="

"+e.row_name+" and "+e.col_name+"

normalized value: "+n+"

original value: "+o+"
"}else r="

"+e.row_name+" and "+e.col_name+"

value: "+n+"
";return r});else u=null;var d=[];"all"===r?d=e:_.each(e,function(t){a.contains(r,t.name)&&d.push(t)}),d3.select(t.root+" .clust_group").selectAll(".row").data(d,function(t){return t.name}).enter().append("g").classed(c,!0).attr("transform",function(t){return"translate(0,"+s(t.row_index)+")"}).each(function(e){n(t,e,u,this,i)}),t.viz.ds_level===-1&&null!=u&&d3.selectAll(t.root+" .row").call(u)}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99);t.exports=function(t,e,r,l){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,u=e.row_data,d=!0,f=t.viz.rect_height;c>=0&&(f=t.viz.ds[c].rect_height);var p;p=!!_.has(t.network_data.links[0],"value_orig");var h;h=p===!1?_.filter(u,function(t){return 0!==t.value}):u;var v=d3.select(l).selectAll("rect").data(h,function(t){return t.col_name}).enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",f).style("fill",function(e){var r;return r="NaN"===e.value_orig?"#000000":e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).style("fill-opacity",function(e){var r;return r="NaN"===e.value_orig?.175:t.matrix.opacity_scale(Math.abs(e.value))}).attr("transform",function(e){return s(t,e)});if(d&&v.on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r}).on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&(r=t.matrix.opacity_scale(Math.abs(e.value_dn))),r}).on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}t.matrix.tile_title&&v.append("title").text(function(t){var e="value: "+t.value;return e})}},function(t,e){"use strict";t.exports=function(t){var e=0,r=t.viz.x_scale.rangeBand()-t.viz.border_width.x,n=0,o=t.viz.y_scale.rangeBand()-t.viz.border_width.y,a="M"+e+","+n+", L"+e+", "+o+", L"+r+",0 Z";return a}},function(t,e){"use strict";t.exports=function(t){var e=0,r=t.viz.x_scale.rangeBand()-t.viz.border_width.x,n=t.viz.y_scale.rangeBand()-t.viz.border_width.y,o=t.viz.y_scale.rangeBand()-t.viz.border_width.y,a="M"+e+", "+n+" , L"+r+", "+o+", L"+r+",0 Z";return a}},function(t,e){"use strict";t.exports=function(t,e,r,n){function o(){if(d3.select(e).classed("hovering")){var n=Number(d3.select(t.root+" .viz_svg").attr("is_zoom"));if(0===n&&t.matrix.show_tile_tooltips&&null!==r&&(d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","block"),r.show.apply(e,s),null!=t.tile_tip_callback)){var o=s[0];t.tile_tip_callback(o)}}}var a,i=n[0],s=[].slice.call(n),l=1e3;d3.select(e).classed("hovering",!0),_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight",function(t){var r,n=i[e+"_name"].replace(/_/g," ")===t.name;return r=n?"bold":"normal"})}),s.push(e),clearTimeout(a),a=setTimeout(o,l,e)}},function(t,e){"use strict";t.exports=function(t,e,r){d3.select(e).classed("hovering",!1),d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","none"),_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight","normal")}),null!=r&&r.hide()}},function(t,e){"use strict";t.exports=function(t,e){var r;r=e.pos_x in t.viz.x_scale.domain()?t.viz.x_scale(e.pos_x):0;var n=r+.5*t.viz.border_width.x,o=.5*t.viz.border_width.y;return"translate("+n+","+o+")"}},function(t,e){"use strict";t.exports=function(){function t(t){b=_(t),z=b.createSVGPoint(),document.body.appendChild(x)}function e(){return"n"}function r(){return[0,0]}function n(){return" "}function o(){var t=h();return{top:t.s.y,left:t.s.x}}function a(){var t=h();return{top:t.n.y-x.offsetHeight,left:t.n.x-x.offsetWidth/2}}function i(){var t=h();return{top:t.s.y,left:t.s.x-x.offsetWidth/2}}function s(){var t=h();return{top:t.e.y-x.offsetHeight/2,left:t.e.x}}function l(){var t=h();return{top:t.w.y-x.offsetHeight/2,left:t.w.x-x.offsetWidth}}function c(){var t=h();return{top:t.nw.y-x.offsetHeight,left:t.nw.x-x.offsetWidth}}function u(){var t=h();return{top:t.ne.y-x.offsetHeight,left:t.ne.x}}function d(){var t=h();return{top:t.sw.y,left:t.sw.x-x.offsetWidth}}function f(){var t=h();return{top:t.se.y,left:t.e.x}}function p(){var t=d3.select(document.createElement("div"));return t.style({position:"absolute",opacity:0,pointerEvents:"none",boxSizing:"border-box"}),t.node()}function _(t){return t=t.node(),"svg"==t.tagName.toLowerCase()?t:t.ownerSVGElement}function h(){var t=k||d3.event.target,e={},r=t.getScreenCTM(),n=t.getBBox(),o=n.width,a=n.height,i=n.x,s=n.y,l=document.documentElement.scrollTop||document.body.scrollTop,c=document.documentElement.scrollLeft||document.body.scrollLeft;return r.a=1,r.d=1,r.e=r.e+c,r.f=r.f+l,z.x=i,z.y=s,e.nw=z.matrixTransform(r),z.x=z.x+o,e.ne=z.matrixTransform(r),z.y=z.y+a,e.se=z.matrixTransform(r),z.x=z.x-o,e.sw=z.matrixTransform(r),z.y=z.y-a/2,e.w=z.matrixTransform(r),z.x=z.x+o,e.e=z.matrixTransform(r),z.x=z.x-o/2,z.y=z.y-a/2,e.n=z.matrixTransform(r),z.y=z.y+a,e.s=z.matrixTransform(r),e}function v(t){var e=d3.select(t).classed("hovering");e&&d3.selectAll(".d3-tip").transition().duration(250).style("opacity",0).style("display","none")}function m(t){var e={};return t&&"[object Function]"===e.toString.call(t)}var g=e,y=r,w=n,x=p(),b=null,z=null,k=null;t.show=function(){var e=Array.prototype.slice.call(arguments);e[e.length-1]instanceof SVGElement&&(k=e.pop());var r,n=w.apply(this,e),o=y.apply(this,e),a=g.apply(this,e),i=d3.select(x),s=0;for(i.html(n).style({opacity:1,"pointer-events":"all"}).style("z-index",99);s--;)i.classed(E[s],!1);if(r=A.get(a).apply(this),i.classed(a,!0).style({top:r.top+o[0]+"px",left:r.left+o[1]+"px"}),m(this)===!1){var l=d3.select(this).attr("class");l.indexOf("tile")>=0&&setTimeout(v,5e3,this)}return t},t.hide=function(){var e=d3.select(x);return e.style({opacity:0,"pointer-events":"none"}),t},t.attr=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(x).attr(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d3.select(x),r),t},t.style=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(x).style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d3.select(x),r),t},t.direction=function(e){return arguments.length?(g=null==e?e:d3.functor(e),t):g},t.offset=function(e){return arguments.length?(y=null==e?e:d3.functor(e),t):y},t.html=function(e){return arguments.length?(w=null==e?e:d3.functor(e),t):w};var A=d3.map({n:a,s:i,e:s,w:l,nw:c,ne:u,sw:d,se:f,south_custom:o}),E=A.keys();return t}},function(t,e,r){"use strict";var n=r(102);t.exports=function(t,e){var r,o=t.params;r=d3.select(o.viz.viz_svg+" .row_container").empty()?d3.select(o.viz.viz_svg).append("g").classed("row_container",!0).attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"):d3.select(o.viz.viz_svg).select(".row_container").attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"),d3.select(o.root+" .row_white_background").empty()&&r.append("rect").classed("row_white_background",!0).classed("white_bars",!0).attr("fill",o.viz.background_color).attr("width",o.viz.label_background.row).attr("height",30*o.viz.clust.dim.height+"px"),d3.select(o.root+" .row_label_container").empty()?r.append("g").classed("row_label_container",!0).attr("transform","translate("+o.viz.norm_labels.width.row+",0)").append("g").classed("row_label_zoom_container",!0):r.select(o.root+" .row_label_container").attr("transform","translate("+o.viz.norm_labels.width.row+",0)"),o.viz.ds_level===-1&&n(t,"all",e)}},function(t,e,r){"use strict";var n=r(2),o=r(103),a=r(104),i=r(130),s=r(68);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=t.params,c=[];"all"===e?c=l.network_data.row_nodes:_.each(l.network_data.row_nodes,function(t){s.contains(e,t.name)&&c.push(t)});var u=d3.select(l.root+" .row_label_zoom_container").selectAll("g").data(c,function(t){return t.name}).enter().append("g").classed("row_label_group",!0),d=l.network_data.row_nodes_names;u.attr("transform",function(t){var e=_.indexOf(d,t.name);return"translate(0,"+l.viz.y_scale(e)+")"}),u.on("dblclick",function(e){var r="__data__",n=this[r].name;a(t,this,n),l.tile_click_hlight&&o(this,e.ini)}),i(l),u.insert("rect").style("opacity",0),u.append("text").attr("y",.5*l.viz.rect_height+.35*l.labels.default_fs_row).attr("text-anchor","end").style("font-size",l.labels.default_fs_row+"px").text(function(t){return n.normal_name(t)}).attr("pointer-events","none").style("opacity",0).style("cursor","default").transition().delay(r).duration(r).style("opacity",1),u.each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",l.viz.y_scale.rangeBand()).style("fill",function(){var t="yellow";return t}).style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),n.has(l.network_data.row_nodes[0],"value")&&u.append("rect").classed("row_bars",!0).attr("width",function(t){var e=0;return e=l.labels.bar_scale_row(Math.abs(t.value))}).attr("x",function(t){var e=0;return e=-l.labels.bar_scale_row(Math.abs(t.value))}).attr("height",l.viz.y_scale.rangeBand()).attr("fill",function(t){return t.value>0?l.matrix.bar_colors[0]:l.matrix.bar_colors[1]}).attr("opacity",.4)}},function(t,e){"use strict";t.exports=function(t,e,r){if(r!=t.click_hlight_row){var n=6,o=.85,a=n*t.viz.border_width.x;d3.selectAll(t.root+" .click_hlight").remove(),d3.select(e).append("rect").classed("click_hlight",!0).classed("row_top_hlight",!0).attr("width",t.viz.svg_dim.width).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o),d3.select(e).append("rect").classed("click_hlight",!0).classed("row_bottom_hlight",!0).attr("width",t.viz.svg_dim.width).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=t.viz.y_scale.rangeBand()-a;return"translate(0,"+e+")"})}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_row=-666}},function(t,e,r){"use strict";var n=r(105),o=r(106),a=r(88),i=r(129),s=r(79);t.exports=function(t,e,r){var l=t.params,c=i(l);if(1===c.zoom_y&&1===c.zoom_x){l.viz.inst_order.row="custom",o(t,"col"),d3.selectAll(l.root+" .toggle_col_order .btn").classed("active",!1),l.viz.run_trans=!0;var u=$.extend(!0,{},l.matrix.matrix),d=l.network_data.row_nodes,f=l.network_data.col_nodes,p=[];d.forEach(function(t){p.push(t.name)}),r=_.indexOf(p,r),p=[],f.forEach(function(t,e){p.push(u[r].row_data[e].value)});var h=d3.range(p.length).sort(function(t,e){return p[e]-p[t]});l.viz.x_scale.domain(h),l.matrix.orders.custom_row=h;var v;v=l.network_data.links.length>l.matrix.def_large_matrix?d3.select(l.root+" .viz_svg"):d3.select(l.root+" .viz_svg").transition().duration(2500);var m=l.network_data.col_nodes_names;v.select(".col_zoom_container").selectAll(".col_label_text").attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate("+l.viz.x_scale(e)+")rotate(-90)"}),v.selectAll(".col_cat_group").attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate("+l.viz.x_scale(e)+",0)"}),l.viz.ds_level===-1&&(v.selectAll(".tile").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),v.selectAll(".tile_up").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),v.selectAll(".tile_dn").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"})),d3.selectAll(l.root+" .row_label_group").select("rect").style("opacity",0),d3.select(e).select("rect").style("opacity",1),n(l),l.network_data.links.forEach(function(t){t.x=l.viz.x_scale(t.target),t.y=l.viz.y_scale(t.source)}),l.zoom_info=a(),setTimeout(function(){l.viz.run_trans=!1},2500),l.viz.ds_num_levels>0&&l.viz.ds_level>=0&&s(l)}}},function(t,e){"use strict";t.exports=function(t){var e=6,r=e*t.viz.border_width.x,n=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.x_scale.rangeBand()).attr("height",n).transition().duration(2500).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+",0)"}),d3.select(t.root+" .left_hlight").attr("width",r).attr("height",t.viz.y_scale.rangeBand()-.99*n).transition().duration(2500).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*n+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.y_scale.rangeBand()-.99*n).transition().duration(2500).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.x_scale.rangeBand()-r;return"translate("+e+","+.99*n+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.x_scale.rangeBand()-1.98*r}).attr("height",n).transition().duration(2500).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,o=t.viz.y_scale.rangeBand()-n;return"translate("+e+","+o+")"})}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500,o=t.params;"row"===e&&"clust"===o.viz.inst_order.col&&setTimeout(n,r,t,"row",!0),"col"===e&&"clust"===o.viz.inst_order.row&&setTimeout(n,r,t,"col",!0),"clust"!=o.viz.inst_order.row&&o.viz.dendro_filter.col===!1&&(d3.selectAll(o.root+" .col_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null),d3.select(o.root+" .col_slider_group").style("opacity",0),d3.selectAll(o.root+" .col_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null)),"clust"!=o.viz.inst_order.col&&o.viz.dendro_filter.row===!1&&(d3.selectAll(o.root+" .row_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null).on("click",null),d3.select(o.root+" .row_slider_group").style("opacity",0),d3.selectAll(o.root+" .row_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null))}},function(t,e,r){"use strict";var n=r(108),o=r(109),a=r(110),i=r(100),s=r(112),l=r(115);t.exports=function(t,e){function r(t,r,n){if(d3.select(t).classed("hovering")){var o=u.viz.root_tips+"_"+e+"_dendro_tip";d3.select(o+" .cat_graph").empty()&&null!==u.viz.cat_info[e]&&l(u,e,r,f[n],o,!0),d3.selectAll(u.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",1)}}var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=t.params;"both"===e&&(e="row");var d;d="row"===e?"col":"row","clust"===u.viz.inst_order[d]&&d3.select(u.root+" ."+e+"_slider_group").style("opacity",1);var f;f="row"===e?n(u):o(u),d3.select(t.params.root+" ."+e+"_dendro_crop_buttons").empty()===!1&&s(t,e);var p=u.viz.dendro_opacity,_=500;d3.selectAll(t.params.viz.root_tips+"_"+e+"_dendro_tip").remove();var h;d3.selectAll(u.root+" ."+e+"_dendro_group").empty()?h=!1:(h=!0,d3.selectAll(u.root+" ."+e+"_dendro_group").remove());var v=0,m=-5,g=i().attr("class",function(){var t=u.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_tip";return r}).direction("nw").offset([v,m]).style("display","none").style("opacity",0);g.html(function(){var t='
Click for cluster information
and additional options.';return t}),c&&(h=!1);var y,w,x,b,z,k,A=d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").data(f,function(t){return t.name}).enter().append("path").style("opacity",0).attr("class",e+"_dendro_group").style("fill","black");A.attr("d",function(t){"row"===e?(y=0,w=t.pos_top,x=30,b=t.pos_mid,z=0,k=t.pos_bot):(y=t.pos_top,w=0,x=t.pos_mid,b=30,z=t.pos_bot,k=0);var r="M"+y+","+w+", L"+x+", "+b+", L"+z+","+k+" Z";return r}),A.on("mouseover",function(n,o){d3.select(this).classed("hovering",!0),null!=t.params.dendro_callback&&t.params.dendro_callback(this),d3.select(u.viz.root_tips+"_"+e+"_dendro_tip").style("display","block"),a(u,this,n,e),g.show(n),d3.select(u.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",0),setTimeout(r,_,this,n,o)}).on("mouseout",function(){"clust"===u.viz.inst_order[d]&&d3.select(this).style("opacity",p),d3.selectAll(u.root+" .dendro_shadow").remove(),d3.select(this).classed("hovering",!1),g.hide(this)}).on("click",function(r,n){$(u.root+" .dendro_info").modal("toggle");var o=r.all_names.join(", ");d3.select(u.root+" .dendro_info input").attr("value",o);var a=u.root+" .dendro_info";d3.selectAll(".dendro_info .cluster_info_container .cat_graph").remove(),null!==u.viz.cat_info[e]&&l(u,e,r,f[n],a),null!=t.params.dendro_click_callback&&t.params.dendro_click_callback(this)}).call(g);var E;E="clust"===u.viz.inst_order[d]?p:0,h?d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").transition().delay(1e3).duration(1e3).style("opacity",E):d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").style("opacity",E)}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.row,n=t.network_data.row_nodes,o=t.network_data.row_nodes_names;_.each(n,function(n){var a=n.group[r],i=_.indexOf(o,n.name),s=t.viz.y_scale(i),l=s+t.viz.y_scale.rangeBand();_.has(e,a)===!1&&(e[a]={},e[a].name_top=n.name,e[a].name_bot=n.name,e[a].pos_top=s,e[a].pos_bot=l,e[a].pos_mid=(s+l)/2,e[a].name=a,e[a].all_names=[],e[a].inst_rc="row"),e[a].all_names.push(n.name),se[a].pos_bot&&(e[a].name_bot=n.name,e[a].pos_bot=l,e[a].pos_mid=(e[a].pos_top+l)/2)});var a=[];return _.each(e,function(t){a.push(t)}),a}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.col,n=t.network_data.col_nodes,o=t.network_data.col_nodes_names;_.each(n,function(n){var a=n.group[r],i=_.indexOf(o,n.name),s=t.viz.x_scale(i),l=s+t.viz.x_scale.rangeBand();_.has(e,a)===!1&&(e[a]={},e[a].name_top=n.name,e[a].name_bot=n.name,e[a].pos_top=s,e[a].pos_bot=l,e[a].pos_mid=(s+l)/2,e[a].name=a,e[a].all_names=[],e[a].inst_rc="col"),e[a].all_names.push(n.name),se[a].pos_bot&&(e[a].name_bot=n.name,e[a].pos_bot=l,e[a].pos_mid=(e[a].pos_top+l)/2)});var a=[];return _.each(e,function(t){a.push(t)}),a}},function(t,e,r){"use strict";var n=r(111);t.exports=function(t,e,r,o){function a(){d3.select(e).classed("hovering")&&t.is_slider_drag===!1&&(d3.select(e).style("opacity",.7),d3.select(t.viz.viz_svg).classed("running_update")===!1&&i())}function i(){"row"===o?"clust"===t.viz.inst_order.col&&n(t,e,o,r):"col"===o?"clust"===t.viz.inst_order.row&&n(t,e,o,r):"both"===o&&("clust"===t.viz.inst_order.col&&n(t,e,"row",r),"clust"===t.viz.inst_order.row&&n(t,e,"col",r))}d3.selectAll(t.root+" ."+o+"_dendro_crop_buttons")[0].length>1?setTimeout(a,500):d3.selectAll(t.root+" .dendro_shadow").remove()}},function(t,e){"use strict";t.exports=function(t,e,r,n){var o,a=.2;d3.selectAll(t.root+" .dendro_shadow").remove(),"row"==r?(d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",n.pos_top+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.height-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",o+"px").attr("transform","translate(0,"+n.pos_bot+")").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a)):"col"===r&&(d3.select(t.root+" .clust_group").append("rect").attr("width",n.pos_top+"px").attr("height",t.viz.clust.dim.height+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.width-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",o+"px").attr("height",t.viz.clust.dim.height+"px").attr("transform","translate("+n.pos_bot+",0)").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a))}},function(t,e,r){"use strict";var n=r(108),o=r(109),a=r(100),i=r(110),s=r(113),l=r(114);t.exports=function(t,e){function r(t){d3.select(t).classed("hovering")&&d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_crop_tip").style("opacity",1).style("display","block")}var c,u,d=t.params,f=.6*d.viz.dendro_opacity;"row"===e?(c=n(d),u="col"):(c=o(d),u="row");var p=5,_=-5,h=a().attr("class",function(){var t=d.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_crop_tip";return r}).direction("nw").style("display","none").offset([p,_]),v=500;d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_crop_tip").remove(),d3.selectAll(d.root+" ."+e+"_dendro_crop_buttons").remove();var m,g,y,w,x,b,z,k,A,E,N=45,M=.25,S=e+"_dendro_crop_buttons";d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter")===!1?(m=d3.select(d.root+" ."+e+"_dendro_icons_group").selectAll("path").data(c,function(t){return t.name}).enter().append("path").classed(S,!0).attr("d",function(t){k=10,A=10;var r=t.pos_bot-t.pos_top;"row"===e?(r5&&void 0!==arguments[5]&&arguments[5];"both"===e&&(e="row");var s=n(t,r,e);if(s.length>0){var l=d3.select(a+" .cluster_info_container"),c=": ",u="

",d=370,f=23,p=20,h=25,v=180,m=27,g=177,y=4,w=5,x=150,b=6,z=!1;null!=s[0].bar_data[0][w]&&(d+=100,g=g+x-47,z=!0);var k=o.all_names.length,A=y;if(z){A=w;var E=s[0].bar_data;k=0,_.each(E,function(t){k+=t[w]})}var N=3,M=25,S=20;_.each(s.slice(0,N),function(t){var e=t.bar_data.length;e>M&&(e=M),S+=m*(e+1)}),i&&l.append("text").text("Cluster Information");var O=l.append("div").style("margin-top","5px").classed("cat_graph",!0).append("svg").style("height",S+"px").style("width",d+"px");O.append("rect").classed("cat_background",!0).attr("height",S+"px").attr("width",d+"px").attr("fill","white").attr("opacity",1);var T=m;if(s=s.slice(0,N),_.each(s,function(e){var r=e.bar_data[0][A],n=d3.scale.linear().domain([0,1e5]).range([20,30]);e.bar_data=e.bar_data.slice(0,M),l.style("margin-bottom","5px");var o=O.append("g").classed("cat_graph_group",!0).attr("transform","translate(10, "+T+")");T+=m*(e.bar_data.length+1);var a=e.type_name;a.length>=h&&(a=a.slice(0,h)+".."),o.append("text").classed("cat_graph_title",!0).text(a).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",800);var i=n(r);o.append("text").text("Count").attr("transform",function(){var t=v+i,e="translate("+t+", 0)";return e}),o.append("text").text("Pct").attr("transform",function(){var t=v+i+60,e="translate("+t+", 0)";return e}),o.append("text").text("P-val").attr("transform",function(){var t=v+i+115,e="translate("+t+", 0)";return e}),z&&o.append("text").text("Clusters").attr("transform",function(){var t=v+x,e="translate("+t+", 0)";return e});var s=4;o.append("line").attr("x1",0).attr("x2",v).attr("y1",s).attr("y2",s).attr("stroke","blue").attr("stroke-width",1).attr("opacity",1);var d=o.append("g").classed("cat_bar_container",!0).attr("transform","translate(0, 10)"),_=d.selectAll("g").data(e.bar_data).enter().append("g").attr("transform",function(t,e){var r=e*f;return"translate(0,"+r+")"}),g=d3.scale.linear().domain([0,r]).range([0,v]);_.append("rect").attr("height",p+"px").attr("width",function(t){var e=g(t[A]);return e+"px"}).attr("fill",function(t){return t[3]}).attr("opacity",t.viz.cat_colors.opacity).attr("stroke","grey").attr("stroke-width","0.5px"),_.append("text").classed("bar_labels",!0).text(function(t){var e=t[1];return e.indexOf(c)>0&&(e=e.split(c)[1]),e.indexOf(u)>0&&(e=e.split(u)[0]),e.length>=h&&(e=e.slice(0,h)+".."),e}).attr("transform",function(){return"translate(5, "+.75*p+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","right");var w=35;_.append("text").classed("count_labels",!0).text(function(t){var e=t[A];return e=e.toLocaleString(),String(e)}).attr("transform",function(){var t=v+i+w,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),_.append("text").classed("count_labels",!0).text(function(t){var e=t[A]/k*100;return e=Math.round(10*e)/10,e=e.toLocaleString(),String(e)}).attr("transform",function(){var t=v+i+w+47,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),_.append("text").classed("count_labels",!0).text(function(t){var e=t[b];return e<.001?(e=parseFloat(e.toPrecision(3)),e=e.toExponential()):e=parseFloat(e.toPrecision(2)),e}).attr("transform",function(){var t=v+i+w+112,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),z&&_.append("text").classed("count_labels",!0).text(function(t){return String(t[y].toLocaleString())}).attr("transform",function(){var t=v+w+x+20,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end")}),i){var C=d3.select(a),B=C.style("top").split(".px")[0],F=C.style("left").split(".px")[0],I=0,j=0;"row"===e?(I=0,j=g):(I=S+32,j=30),C.style("top",function(){var t=String(parseInt(B,10)-I)+"px";return t}).style("left",function(){var t=String(parseInt(F,10)-j)+"px";return t})}}}},function(t,e,r){"use strict";var n=r(117);t.exports=function(t,e,r){"both"===r&&(r="row");var o,a=e.all_names,i=[],s=t.network_data[r+"_nodes"],l=null,c=!1;_.each(s,function(t){o=t.name,a.indexOf(o)>=0&&i.push(t)});var u=[];if(null!==t.viz.cat_info[r]){for(var d,f,p,h=t.viz.cat_info[r],v=_.keys(h),m=[],g=[],y=0;y0){var E,N=a.length;_.each(m,function(e){if(f=e.split("-")[1],d=g[f],A)if(e.indexOf("-")>=0){var o=parseInt(e.split("-")[1],z)+1;d="Category "+String(o)}else d="Category";x[d]={},_.each(i,function(t){E=t[e],E.indexOf(": ")>=0&&(E=E.split(": ")[1]),E in x[d]?(x[d][E].num_nodes=x[d][E].num_nodes+1,null!=l&&(x[d][E].num_nodes_ds=x[d][E].num_nodes_ds+parseInt(t[l].split(": ")[1],z))):(x[d][E]={},x[d][E].num_nodes=1,null!=l&&(x[d][E].num_nodes_ds=parseInt(t[l].split(": ")[1],z)))}),b={},b.type_name=d,b.num_in_clust=N,w=[];var a,s,c=x[d];for(var p in c){var h=t.viz.cat_info[r][e].cat_hist[p],v=t.network_data[r+"_nodes"].length,m=h/v;s=A?p:d+": "+p;var y=c[p].num_nodes,M=y,S=n(M,N,m);if(_.has(c[p],"num_nodes_ds"))var O=c[p].num_nodes_ds;else O=null;a=t.viz.cat_colors[r][e][s],w.push([e,s,c[p],a,y,O,S])}w.sort(function(t,e){return e[k]-t[k]}),b.bar_data=w,u.push(b)})}}return u}},function(t,e,r){"use strict";var n=r(118),o=r(12),a=o.create();a.import(r(119)),t.exports=function(t,e,r){function o(t,e,r){var n=c(e)/(c(t)*c(e-t));return r=n*(Math.pow(r,t)*Math.pow(1-r,e-t))}function i(t,e,r){for(var n,a,i=0,s=t;s1;)a=a.times(i),i--;return new t.BigNumber(a.toPrecision(t.BigNumber.precision))}var u=n(r(122)),d=n(r(125)),f=l("gamma",{number:function(t){var e,r;if(a(t)){if(t<=0)return isFinite(t)?1/0:NaN;if(t>171)return 1/0;for(var n=t-2,o=t-1;n>1;)o*=n,n--;return 0==o&&(o=1),o}if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*f(1-t));if(t>=171.35)return 1/0;if(t>85){var l=t*t,c=l*t,u=c*t,d=u*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*l)-139/(51840*c)-571/(2488320*u)+163879/(209018880*d)+5246819/(75246796800*d*t))}--t,r=s[0];for(var p=1;pN)for(var S=0,O=0;O1&&n===-(1/0)?0:e.predictable&&(r<-1&&n===1/0||r>-1&&r<0&&n===-(1/0))?NaN:o(n)||r>=0||e.predictable?Math.pow(r,n):new t.Complex(r,0).pow(n,0)}function l(t,e){if(!o(e)||e<0)throw new TypeError("For A^b, b must be a positive integer (value is "+e+")");var r=a(t);if(2!=r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!=r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");for(var n=d(r[0]).valueOf(),i=t;e>=1;)1==(1&e)&&(n=f(i,n)),e>>=1,i=f(i,i);return n}function c(t,e){return p(l(t.valueOf(),e))}var u=r(45),d=n(r(126)),f=n(r(122)),p=n(r(43)),_=n(r(127)),h=n(r(128)),v=i("pow",{"number, number":s,"Complex, Complex":function(t,e){return t.pow(e)},"BigNumber, BigNumber":function(r,n){return n.isInteger()||r>=0||e.predictable?r.pow(n):new t.Complex(r.toNumber(),0).pow(n.toNumber(),0)},"Fraction, Fraction":function(t,r){if(1!==r.d){if(e.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return s(t.valueOf(),r.valueOf())}return t.pow(r)},"Array, number":l,"Array, BigNumber":function(t,e){return l(t,e.toNumber())},"Matrix, number":c,"Matrix, BigNumber":function(t,e){return c(t,e.toNumber())},"Unit, number":function(t,e){return t.pow(e)}});return v.toTex={2:"\\left(${args[0]}\\right)"+u.operators.pow+"{${args[1]}}"},v}var o=r(18).isInteger,a=r(28).size;e.name="pow",e.factory=n},function(t,e,r){"use strict";function n(t,e,n,i){function s(t,e){switch(t.length){case 0:return e?c(e):[];case 1:return l(t[0],t[0],e);case 2:return l(t[0],t[1],e);default:throw new Error("Vector containing two values expected")}}function l(e,r,n){var i=t.isBigNumber(e)||t.isBigNumber(r)?t.BigNumber:null;if(t.isBigNumber(e)&&(e=e.toNumber()),t.isBigNumber(r)&&(r=r.toNumber()),!a(e)||e<1)throw new Error("Parameters in function eye must be positive integers");if(!a(r)||r<1)throw new Error("Parameters in function eye must be positive integers");var s=i?new t.BigNumber(1):1,l=i?new i(0):0,c=[e,r];if(n){var u=t.Matrix.storage(n);return u.diagonal(c,s,0,l)}for(var d=o.resize([],c,l),f=e0?(e.zoom_x=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[0]),e.zoom_y=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[1])):(e.zoom_x=1,e.zoom_y=1),e}},function(t,e,r){"use strict";var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_row_tip").remove();var e=t.viz.root_tips.replace(".",""),r=n().attr("class",function(){var t=e+" d3-tip "+e+"_row_tip";return t}).direction("e").offset([0,10]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return""+e+""});d3.select(t.viz.viz_wrapper).select(t.root+" .row_container").call(r),d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",function(e){d3.select(t.viz.root_tips+"_row_tip").classed(e.name,!0),d3.selectAll(t.viz.root_tips+"_row_tip").style("display","block"),d3.select(this).select("text").classed("active",!0),r.show(e),null!=t.row_tip_callback&&t.row_tip_callback(t.viz.root_tips,e)}).on("mouseout",function(e){d3.selectAll(t.viz.root_tips+"_row_tip").style("display","none").classed(e.name,!1),d3.select(this).select("text").classed("active",!1),r.hide(e)})}else d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",function(){d3.select(this).select("text").classed("active",!0)}).on("mouseout",function(){d3.select(this).select("text").classed("active",!1)})}},function(t,e,r){"use strict";var n=r(2),o=r(132),a=r(133),i=r(104),s=r(137),l=r(138);t.exports=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=t.params,u=c.network_data.col_nodes,d=c.viz.x_scale.rangeBand()/2+c.viz.border_width.x; -d3.select(c.root+" .col_container").empty()?(e=d3.select(c.viz.viz_svg).append("g").attr("class","col_container").attr("transform","translate("+c.viz.clust.margin.left+","+c.viz.norm_labels.margin.top+")"),e.append("rect").attr("fill",c.viz.background_color).attr("width",30*c.viz.clust.dim.width+"px").attr("height",c.viz.label_background.col).attr("class","white_bars"),e.append("g").attr("class","col_label_outer_container").attr("transform","translate(0,"+c.viz.norm_labels.width.col+")").append("g").attr("class","col_zoom_container")):(e=d3.select(c.root+" .col_container").attr("transform","translate("+c.viz.clust.margin.left+","+c.viz.norm_labels.margin.top+")"),e.select(".white_bars").attr("fill",c.viz.background_color).attr("width",30*c.viz.clust.dim.width+"px").attr("height",c.viz.label_background.col),e.select(c.root+" .col_label_outer_container"));var f=d3.select(c.root+" .col_zoom_container").selectAll(".col_label_text").data(u,function(t){return t.name}).enter().append("g").attr("class","col_label_text").attr("transform",function(t){var e=t.col_index;return"translate("+c.viz.x_scale(e)+", 0) rotate(-90)"}),p=f.append("g").attr("class","col_label_group").attr("transform","translate("+c.viz.x_scale.rangeBand()/2+","+d+") rotate(45)").on("mouseover",function(){d3.select(this).select("text").classed("active",!0)}).on("mouseout",function(){d3.select(this).select("text").classed("active",!1)});n.has(c.network_data.col_nodes[0],"value")&&p.append("rect").attr("class","col_bars").attr("width",function(t){var e=0;return t.value>0&&(e=c.labels.bar_scale_col(t.value)),e}).attr("height",.66*c.viz.x_scale.rangeBand()).style("fill",function(t){return t.value>0?c.matrix.bar_colors[0]:c.matrix.bar_colors[1]}).attr("opacity",.6),p.append("text").attr("x",0).attr("y",.64*c.viz.x_scale.rangeBand()).attr("dx",c.viz.border_width.x).attr("text-anchor","start").attr("full_name",function(t){return t.name}).style("font-size",c.labels.default_fs_col+"px").style("cursor","default").text(function(t){return n.normal_name(t)}).style("opacity",0).transition().delay(r).duration(r).style("opacity",1),s(c),p.append("path").style("stroke-width",0).attr("d",function(){return l(c)}).attr("fill","#eee").style("opacity",0).transition().delay(r).duration(r).style("opacity",c.viz.triangle_opacity),d3.selectAll(c.root+" .col_label_text").on("click",function(t){"function"==typeof c.click_label?(c.click_label(t.name,"col"),o(c,this,t.ini)):c.tile_click_hlight&&o(c,this,t.ini)}).on("dblclick",function(e){var r="__data__",n=this[r].name;if(c.sim_mat){a(t,this,n);var s=d3.selectAll(c.root+" .row_label_group").filter(function(t){return t.name==n})[0][0];i(t,s,n)}else a(t,this,n);c.tile_click_hlight&&o(c,this,e.ini)})}},function(t,e){"use strict";t.exports=function(t,e,r){if(r!=t.click_hlight_col){t.click_hlight_col=r;var n=6,o=.85,a=n*t.viz.border_width.x;d3.selectAll(t.root+" .click_hlight").remove(),d3.select(e).append("rect").classed("click_hlight",!0).classed("col_top_hlight",!0).attr("width",t.viz.clust.dim.height).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=0,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"}),d3.select(e).append("rect").classed("click_hlight",!0).classed("col_bottom_hlight",!0).attr("width",t.viz.clust.dim.height).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=t.viz.x_scale.rangeBand()-a,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"})}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_col=-666}},function(t,e,r){"use strict";var n=r(105),o=r(106),a=r(134),i=r(88),s=r(129),l=r(79);t.exports=function(t,e,r){var c=t.params,u=s(c);if(1===u.zoom_y&&1===u.zoom_x){c.viz.inst_order.col="custom",o(t,"col"),d3.selectAll(c.root+" .toggle_row_order .btn").classed("active",!1),c.viz.run_trans=!0;var d=$.extend(!0,{},c.matrix.matrix),f=c.network_data.row_nodes,p=c.network_data.col_nodes,h=[];p.forEach(function(t){h.push(t.name)});var v=_.indexOf(h,r);h=[],f.forEach(function(t,e){h.push(d[e].row_data[v].value)});var m=d3.range(h.length).sort(function(t,e){return h[e]-h[t]});c.viz.y_scale.domain(m),c.matrix.orders.custom_col=m;var g,y=c.network_data.row_nodes_names;if(g=c.network_data.links.length>c.matrix.def_large_matrix?d3.select(c.root+" .viz_svg"):d3.select(c.root+" .viz_svg").transition().duration(2500),g.selectAll(".row_cat_group").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),g.select(".row_label_zoom_container").selectAll(".row_label_group").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),c.viz.ds_level===-1&&g.selectAll(".row").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),d3.selectAll(c.root+" .col_label_text").select(".highlight_rect").style("opacity",0),d3.select(e).select(".highlight_rect").style("opacity",1),c.network_data.links.forEach(function(t){t.x=c.viz.x_scale(t.target),t.y=c.viz.y_scale(t.source)}),n(c),c.zoom_info=i(),setTimeout(function(){c.viz.run_trans=!1},2500),c.viz.ds_num_levels>0&&c.viz.ds_level>=0){l(c);var w=!0,x=!0,b=!0;a(t,w,x,b)}}}},function(t,e,r){"use strict";var n=r(135),o=r(93),a=r(102),i=r(136),s=r(68);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=t.params,u=c.zoom_info,d=c.viz.ds_level,f=c.viz.ds_level;null===c.viz.ds?d=-1:(d=Math.floor(Math.log(u.zoom_y)/Math.log(c.viz.ds_zt)),d>c.viz.ds_num_levels-1&&(d=-1));var p=!1;f==-1?d>=0&&(p=!0):d=0&&(d3.selectAll(c.root+" .row").remove(),d3.selectAll(c.viz.root_tips+"_tile_tip").remove(),d3.selectAll(c.viz.root_tips+"_row_tip").remove());var w;if(h<0?(w=c.matrix.matrix,i(c)):(w=c.matrix.ds_matrix[h],d3.selectAll(c.root+" .row_cat_group path").remove()),r===!0&&d3.selectAll(c.root+" .row_cat_group path").remove(),e===!0&&(h>=0?d3.selectAll(c.root+" .ds"+String(h)+"_row").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}):d3.selectAll(c.root+" .row").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}),d3.selectAll(c.root+" .row_label_group").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}),h!=f&&(g=c.viz.viz_nodes.row,d3.selectAll(c.root+" .ds"+String(f)+"_row").remove())),(g.length>=1||"all"===g)&&o(c,w,g,h),h===-1&&(r===!1||e)){var x=[];d3.selectAll(c.root+" .row_label_group").each(function(t){x.push(t.name)});var b=_.difference(c.viz.viz_nodes.row,x),z=1;b.length>z&&a(t,b)}}},function(t,e){"use strict";t.exports=function(t,e){var r,n=[],o=[],a=t.viz.y_scale,i=t.viz.ds_level,s=t.network_data.row_nodes_names,l=".row";i>=0&&(a=t.viz.ds[i].y_scale,s=d3.range(t.matrix.ds_matrix[i].length).map(String),l=".ds"+String(i)+"_row");for(var c=0;ce.min_y&&n.push(s[c]);d3.selectAll(t.root+" "+l).each(function(t){o.push(t.name)}),t.viz.viz_nodes.row=n,t.viz.viz_nodes.curr_row=o}},function(t,e){"use strict";t.exports=function(t){d3.select(t.root+" .row_cat_group path").empty()===!0&&d3.selectAll(t.root+" .row_cat_group").append("path").attr("d",function(){var e=t.viz.cat_room.symbol_width-1,r=0,n=1,o=t.viz.y_scale.rangeBand()/2,a=t.viz.cat_room.symbol_width-1,i=t.viz.y_scale.rangeBand(),s="M "+e+","+r+" L "+n+","+o+", L "+a+","+i+" Z";return s}).attr("fill","#eee").style("opacity",t.viz.triangle_opacity)}},function(t,e,r){"use strict";var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_col_tip").remove();var e=n().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip "+e+"_col_tip";return r}).direction("w").offset([20,0]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return""+e+""});d3.select(t.viz.viz_wrapper).select("svg").select(t.root+" .col_zoom_container").selectAll(".col_label_group").select("text").call(e),d3.select(t.root+" .col_zoom_container").selectAll(".col_label_group").on("mouseover",function(r){d3.selectAll(t.viz.root_tips+"_col_tip").style("display","block"),e.show(r),null!=t.col_tip_callback&&t.col_tip_callback(r)}).on("mouseout",function(){e.hide(this),d3.selectAll(t.viz.root_tips+"_col_tip").style("display","none")})}}},function(t,e){"use strict";t.exports=function(t){var e=.36*t.viz.x_scale.rangeBand(),r=-t.viz.border_width.x,n=0,o=t.viz.x_scale.rangeBand()-e,a=-(t.viz.x_scale.rangeBand()-e+t.viz.border_width.x),i=-t.viz.border_width.x,s="M "+r+",0 L "+a+","+n+", L "+i+","+o+" Z";return s}},function(t,e){"use strict";t.exports=function(t){d3.select(t.viz.viz_svg).append("rect").attr("fill",t.viz.background_color).attr("height",t.viz.super_labels.dim.width+"px").attr("width","3000px").classed("super_col_bkg",!0).classed("white_bars",!0).attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.super_labels.margin.top+")"),d3.select(t.viz.viz_svg).append("text").attr("class","super_col").text(t.labels.super.col).attr("text-anchor","center").attr("transform",function(){var e=d3.select(this)[0][0].getBBox().width,r=t.viz.clust.dim.width/2+t.viz.norm_labels.width.row-e/2,n=t.viz.super_labels.dim.width;return"translate("+r+","+n+")"}).style("font-size",function(){var e=t.labels.super_label_fs*t.labels.super_label_scale;return e+"px"}).style("font-weight",300),d3.select(t.viz.viz_svg).append("rect").attr("fill",t.viz.background_color).attr("width",t.viz.super_labels.dim.width+"px").attr("height","3000px").classed("super_row_bkg",!0).classed("white_bars",!0).attr("transform","translate("+t.viz.super_labels.margin.left+",0)"),d3.select(t.viz.viz_svg).append("g").classed("super_row",!0).attr("transform",function(){var e=t.viz.super_labels.dim.width,r=t.viz.clust.dim.height/2+t.viz.norm_labels.width.col;return"translate("+e+","+r+")"}),d3.select(t.root+" .super_row").append("text").text(t.labels.super.row).attr("text-anchor","center").attr("transform",function(){var e=d3.select(this)[0][0].getBBox().width,r=e/2+t.viz.norm_labels.width.col,n="translate(0,"+r+"), rotate(-90)";return n}).style("font-size",function(){var e=t.labels.super_label_fs*t.labels.super_label_scale;return e+"px"}).style("font-weight",300)}},function(t,e,r){"use strict";var n=r(141),o=r(142),a=r(150),i=r(112);t.exports=function(t){var e=t.params,r=e.viz;d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 1000,-1000, L 1000,0 Z").attr("fill",r.background_color).attr("class","right_slant_triangle").attr("transform","translate("+r.clust.dim.width+","+r.norm_labels.width.col+")"),d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 500,-500, L 0,-500 Z").attr("fill",r.background_color).attr("class","left_slant_triangle").attr("transform","translate(-1,"+r.norm_labels.width.col+")");var s=r.clust.margin.top+r.uni_margin/5;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",r.clust.margin.left).attr("height",s).attr("class","top_left_white");var l=r.cat_room.col+1.5*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",2*r.clust.dim.width).attr("height",l).attr("class","top_right_white").attr("transform",function(){var t=r.clust.margin.left+r.clust.dim.width,e=r.norm_labels.width.col+r.norm_labels.margin.top-r.uni_margin;return"translate("+t+", "+e+")"}),p=r.clust.margin.left+r.clust.dim.width+r.uni_margin,_=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin;var c=1.15*r.cat_room.symbol_width,u=.65,d=1.25;r.show_categories.col&&d3.select(r.viz_svg).selectAll().data(r.all_cats.col).enter().append("text").classed("col_cat_super",!0).style("font-size",c+"px").style("opacity",u).style("cursor","default").attr("transform",function(t){var e=parseInt(t.split("-")[1],10),n=_+d*r.cat_room.symbol_width*e;return"translate("+p+","+n+")"}).text(function(t){return n(r,t,"col")}),a(t),_=r.show_dendrogram?r.clust.margin.top+r.clust.dim.height+r.dendro_room.col-2*r.uni_margin:r.clust.margin.top+r.clust.dim.height;var f=d3.select(r.viz_svg).append("g").classed("bottom_spillover_container",!0).attr("transform",function(){return"translate(0,"+_+")"});f.append("rect").attr("class","bottom_spillover").attr("fill",r.background_color).attr("width",r.svg_dim.width).attr("height",2*r.svg_dim.height),p=r.clust.margin.left,_=0,f.append("g").classed("col_dendro_icons_container",!0).attr("transform","translate("+p+","+_+")").append("g").classed("col_dendro_icons_group",!0),i(t,"col");var p=r.clust.margin.left+r.clust.dim.width,_=r.clust.margin.top+r.clust.dim.height,h=r.cat_room.col+r.clust.dim.width,v=r.cat_room.row+10*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",h).attr("height",v).attr("transform",function(){return"translate("+p+","+_+")"}).classed("white_bars",!0).classed("dendro_corner_spillover",!0),p=0,_=r.clust.margin.top+r.clust.dim.height,h=r.clust.margin.left,v=10*r.clust.dim.height,d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",h).attr("height",v).attr("transform",function(){return"translate("+p+","+_+")"}).classed("white_bars",!0).classed("dendro_col_spillover",!0),o(t)}},function(t,e){"use strict";t.exports=function(t,e,r){var n;if(t.cat_names[r][e]===e){var o=parseInt(e.split("-")[1],10)+1;n="Category "+o}else n=t.cat_names[r][e];return n}},function(t,e,r){"use strict";var n=r(143);t.exports=function(t){var e=t.params;_.each(["row","col"],function(r){e.viz.show_categories[r]&&d3.selectAll(e.root+" ."+r+"_cat_super").on("dblclick",function(){e.sim_mat&&(r="both"),d3.selectAll(e.root+" .toggle_"+r+"_order .btn").classed("active",!1);var o=this.__data__.replace("-","_")+"_index";e.viz.sim_mat?(n(t,o,"row"),n(t,o,"col")):n(t,o,r)})})}},function(t,e,r){"use strict";var n=r(106),o=r(134),a=r(88),i=r(79),s=r(144),l=r(129);t.exports=function(t,e,r){var c=t.params,u=l(c),d=0;1==u.zoom_y&&1==u.zoom_x||(s(t,0,0,1),d=1200);var f;"row"===r?f="col":"col"===r&&(f="row"),c.viz.run_trans=!0,"row"===f?c.viz.inst_order.row=e:"col"===f&&(c.viz.inst_order.col=e),c.viz.show_dendrogram&&n(t,r),"row"===f?c.viz.x_scale.domain(c.matrix.orders[c.viz.inst_order.row+"_row"]):"col"==f&&c.viz.y_scale.domain(c.matrix.orders[c.viz.inst_order.col+"_col"]);var p;p=d3.selectAll(c.root+" .tile")[0].length0&&c.viz.ds_level>=0){i(c);var m=!0,g=!0,y=!0;o(t,m,g,y)}setTimeout(function(){c.viz.run_trans=!1},2500)}},function(t,e,r){"use strict";var n=r(2),o=r(145),a=r(134),i=r(88),s=r(149);t.exports=function(t,e,r,l){function c(t,e){d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").transition().duration(g).style("opacity",e)}var u=t.params;if(d3.selectAll(u.viz.root_tips).style("display","none"),u.zoom_info=i(),a(t),!u.viz.run_trans){var d=u.viz.clust.dim.height/2,f=d/l;if(r>=d-f){var p=d-r,h=-d/l+p;r+=h}r<-(d-f)&&(p=d+r,h=d/l-p,r+=h);var v=l,m=1,g=700,y=-(v-1)*d;d3.select(u.root+" .clust_group").transition().duration(g).attr("transform","translate("+[0,0+y]+") scale("+m+","+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_label_zoom_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale("+v+","+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_cat_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale(1,"+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_dendro_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale("+m+","+v+")translate("+[u.viz.uni_margin/2,r]+")");var w;_.each(["row","col"],function(t){w=d3.select(u.root+" ."+t+"_dendro_crop_buttons").style("opacity"),d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").style("opacity",0),setTimeout(c,700,t,w)}),d3.select(u.root+" .col_zoom_container").transition().duration(g).attr("transform"," scale("+m+","+m+")translate("+[e,0]+")"),d3.select(u.root+" .col_cat_container").transition().duration(g).attr("transform"," scale("+m+",1)translate("+[e,0]+")"),d3.select(u.root+" .col_dendro_container").transition().duration(g).attr("transform"," scale("+m+",1)translate("+[e,u.viz.uni_margin/2]+")");var x=u.viz.clust.margin.top+y+r*v,b=u.viz.clust.margin.left+e;u.zoom_behavior.scale(v).translate([b,x]),o(u),d3.select(u.root+" .row_label_zoom_container text").empty()===!1&&d3.select(u.root+" .row_label_zoom_container").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",.5*t.x).attr("y",0).attr("width",.5*t.width).attr("height",u.viz.y_scale.rangeBand()).style("fill","yellow")}),d3.select(u.root+" .row_dendro_icons_group").attr("transform","translate("+[0,0+y]+") scale("+m+","+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=u.viz.uni_margin,r=t.pos_mid;return"translate("+e+","+r+") scale(1, "+1/v+")"}),d3.select(u.root+" .col_dendro_icons_group").attr("transform",function(){var t=" scale("+m+","+v+")";return t}),d3.select(u.root+" .col_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=t.pos_mid,r=u.viz.uni_margin;return"translate("+e+","+r+") scale(1,1)"}),n.has(u.network_data.col_nodes[0],"value")&&d3.selectAll(u.root+" .col_bars").attr("width",function(t){var e=0;return t.value>0&&(e=u.labels.bar_scale_col(t.value)/m),e}),n.has(u.network_data.row_nodes[0],"value")&&d3.selectAll(u.root+" .row_bars").transition().duration(g).attr("width",function(t){var e=0;return e=u.labels.bar_scale_row(Math.abs(t.value))/v}).attr("x",function(t){var e=0;return e=-u.labels.bar_scale_row(Math.abs(t.value))/v}),s(u)}}},function(t,e,r){"use strict";var n=r(2),o=r(146),a=r(147);t.exports=function(t){d3.selectAll(t.root+" .row_label_group").select("text").text(function(t){return n.normal_name(t)}),d3.selectAll(t.root+" .col_label_text").select("text").text(function(t){return n.normal_name(t)}),a(t),d3.selectAll(t.root+" .row_label_group").each(function(){o(t,this,"row")}),d3.selectAll(t.root+" .col_label_group").each(function(){o(t,this,"col")})}},function(t,e){"use strict";t.exports=function(t,e,r){function n(){return u=d3.select(this).text(),c=u.length,f=c-3,l=u.substring(0,f)+".."}function o(t){return u=d3.select(this).text(),c=".."===u.slice(-2)?u.length-2:u.length,d=t.name,f=c+2,l=d.substring(0,f)+"..",l.length>d.length&&(l=d),l}function a(t,e){return s=e<1?t:t*e}if("none"!=d3.select(e).style("display")){var i,s,l,c,u,d,f,p,_=t.viz.norm_labels.width[r];i="row"===r?t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale():t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale();var h;d3.select(e).select("text").each(function(t){h=t.name.length});var v=d3.select(e).select("text").node().getBBox().width;if(s=a(v,i),s>_)for(p=1;p_&&(d3.select(e).select("text").text(n),v=d3.select(e).select("text").node().getBBox().width,s=a(v,i));else if(s<.75*_)for(p=1;po&&(a.row>t.labels.max_allow_fs?(e=t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale(),e<1&&(e=1),r=t.labels.max_allow_fs/e,d3.selectAll(t.root+" .row_label_group").select("text").style("font-size",r+"px").attr("y",.5*t.viz.rect_height+.35*r)):d3.selectAll(t.root+" .row_label_group").select("text").style("font-size",t.labels.default_fs_row+"px").attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row)),a.col>o&&(a.col>t.labels.max_allow_fs?(e=t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale(),e<1&&(e=1),r=t.labels.max_allow_fs/e,r>.7*t.viz.rect_width&&(r=.7*t.viz.rect_width),d3.selectAll(t.root+" .col_label_text").select("text").style("font-size",r+"px")):d3.selectAll(t.root+" .col_label_text").select("text").style("font-size",t.labels.default_fs_col+"px"))}},function(t,e){"use strict";t.exports=function(t){var e={};return t.viz.zoom_ratio.x>1?(e.row=t.labels.default_fs_row*t.zoom_behavior.scale(),e.col=t.labels.default_fs_col*t.zoom_behavior.scale()):(e.row=t.labels.default_fs_row*t.zoom_behavior.scale()/t.viz.zoom_ratio.y,e.col=t.labels.default_fs_col*t.zoom_behavior.scale()),e}},function(t,e){"use strict";t.exports=function(t){t.zoom_info.zoom_x*t.viz.border_width.x>1?d3.selectAll(t.root+" .vert_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .vert_lines").select("line").style("display","none"),t.zoom_info.zoom_y*t.viz.border_width.y>1?d3.selectAll(t.root+" .horz_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .horz_lines").select("line").style("display","none")}},function(t,e,r){"use strict";var n=r(141),o=r(100);t.exports=function(t){var e=t.params,r=e.viz,a=2.75;d3.select(e.root+" .row_cat_label_container").empty()&&(d3.select(t.params.viz.viz_svg).append("g").classed("row_cat_label_container",!0),d3.select(t.params.viz.viz_svg+" .row_cat_label_container").append("g").classed("row_cat_label_bar_container",!0));var i=r.clust.margin.left+r.clust.dim.width+r.uni_margin,s=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin,l=1.15*r.cat_room.symbol_width,c=.65,u=1.25;d3.select(e.root+" .row_cat_label_container").attr("transform",function(){return i=r.norm_labels.margin.left+r.norm_labels.width.row+r.cat_room.symbol_width+a*r.uni_margin,s=r.clust.margin.top-r.uni_margin,"translate("+i+","+s+") rotate(-90)"}),d3.selectAll(e.root+" .row_cat_label_container text").remove(),d3.selectAll(e.root+" .row_cat_selection_bar").remove(),d3.selectAll(t.params.viz.root_tips+"_row_cat_super").remove();var d=50,f=-75,p=o().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_row_cat_super";return r}).direction("south_custom").offset([d,f]).style("display","none").style("opacity",0).html(function(t){var o,a=e.network_data.row_nodes[0][t];if(a.indexOf("

")>-1){var i=a.split(": ")[0],s=a.split("

")[1];o=i+"

"+s}else o=n(r,t,"row");return o}),h=u*r.cat_room.symbol_width,v=.9*h;if(d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("text").style("width","100px").style("height",v+"px").classed("row_cat_super",!0).style("font-size",l+"px").style("opacity",c).style("cursor","default").attr("transform",function(t){var e=u*r.cat_room.symbol_width*parseInt(t.split("-")[1],10);return"translate(0,"+e+")"}).text(function(t){return n(r,t,"row")}),d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("rect").classed("row_cat_super",!0).classed("row_cat_selection_bar",!0).style("height",v+"px").style("fill","green").style("width","120px").style("opacity",0).attr("transform",function(t){var e=h*(parseInt(t.split("-")[1],10)-.75);return"translate(0,"+e+")"}).on("mouseover",function(t){d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","block").style("opacity",1),p.show(t)}).on("mouseout",function(){p.hide(this),d3.selectAll(".d3-tip").style("display","none"),d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","none").style("opacity",0)}),d3.select(e.root+" .row_cat_selection_bar").empty()===!1&&d3.selectAll(e.root+" .row_cat_selection_bar").call(p),_.has(e.network_data,"row_cat_bars")){d3.select(e.root+" .enr_title").remove();var m=d3.select(e.root+" .viz_svg").append("g").classed("enr_title",!0).attr("transform",function(){var t=d3.select(e.root+" .row_cat_label_container").attr("transform").split("(")[1].split(")")[0],r=Number(t.split(",")[0])-10;return"translate("+String(r)+", 0)"});m.append("rect").attr("width",e.viz.cat_room.row).attr("height",25).attr("fill","white");var g=e.network_data.enrichrgram_lib.substring(0,40);m.append("text").attr("transform","translate(0, 17)").text(g.replace(/_/g," ")).style("font-size","15px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),d3.selectAll(e.root+" .enrichr_bars").remove();var y=e.viz.clust.margin.top-35,w=e.network_data.row_cat_bars[0],x=d3.scale.linear().domain([0,w]).range([0,y]);d3.select(e.root+" .row_cat_label_bar_container").selectAll().data(e.network_data.row_cat_bars).enter().append("rect").classed("enrichr_bars",!0).attr("height",v+"px").attr("fill","red").attr("width",function(t){var e=x(t);return e+"px"}).attr("opacity",.4).attr("transform",function(t,e){var r=h*(e-.75);return"translate(0, "+r+")"})}}},function(t,e,r){"use strict";var n=r(152);t.exports=function(t){var e,r=t.params;d3.select(r.root+" .expand_button").on("click",null);var o=.4;e=d3.select(r.root+" .expand_button").empty()?d3.select(r.viz.viz_svg).append("text").attr("class","expand_button"):d3.select(r.root+" .expand_button"),e.attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family","FontAwesome").attr("font-size","30px").text(function(){return r.viz.is_expand===!1?"":""}).attr("y","25px").attr("x","25px").style("cursor","pointer").style("opacity",o).on("mouseover",function(){d3.select(this).style("opacity",.75)}).on("mouseout",function(){d3.select(this).style("opacity",o)}).on("click",function(){r.viz.is_expand===!1?(d3.select(this).text(function(){return""}),r.viz.is_expand=!0,d3.selectAll(r.root+" .borders").style("fill","white"),d3.select(r.root+" .sidebar_wrapper").style("display","none")):(d3.select(this).text(function(){return""}),r.viz.is_expand=!1,d3.selectAll(r.root+" .borders").style("fill","#eee"),d3.select(r.root+" .viz_wrapper").style("width","100px"),d3.select(r.root+" .sidebar_wrapper").style("display","block")),d3.select(r.viz.viz_svg).style("opacity",.5);var e=500;1==r.viz.run_trans&&(e=2500),setTimeout(n,e,t)})}},function(t,e,r){"use strict";var n=r(2),o=r(153),a=r(161),i=r(162),s=r(163),l=r(164),c=r(165),u=r(166),d=r(167),f=r(168),p=r(169),h=r(170),v=r(171),m=r(172),g=r(173),y=r(174),w=r(175),x=r(176),b=r(145),z=r(107),k=r(106),A=r(134),E=r(70),N=r(177),M=r(150),S=r(142),O=r(178),T=r(88),C=r(179);t.exports=function(t){var e=t.params,r=E(e);d3.select(e.root+" .play_button"),d3.select(e.root+" .sidebar_wrapper").style("height",r.height+"px"),d3.select(e.viz.viz_wrapper).style("margin-top",r.top+"px").style("width",r.width+"px").style("height",r.height+"px"),e=y(e),e.zoom_info=T(),i(e);var B=d3.select(e.viz.viz_svg);_.each(e.network_data.links,function(t){t.x=e.viz.x_scale(t.target),t.y=e.viz.y_scale(t.source)}),B.on(".zoom",null),e.zoom_behavior.scaleExtent([1,e.viz.square_zoom*e.viz.zoom_ratio.x]).on("zoom",function(){o(t)}),e.viz.do_zoom&&B.call(e.zoom_behavior),a(t),B.attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height),B.select(".super_background").style("width",e.viz.svg_dim.width).style("height",e.viz.svg_dim.height),B.select(".grey_background").attr("width",e.viz.clust.dim.width).attr("height",e.viz.clust.dim.height),setTimeout(N,100,e);var F=e.network_data.row_nodes,I=n.pluck(F,"name");w(e,B),B.selectAll(".highlighting_rect").attr("width",.8*e.viz.x_scale.rangeBand()).attr("height",.8*e.viz.y_scale.rangeBand()),f(e),d(e,B),p(e,B),B.selectAll(".row_label_group").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",e.viz.rect_height).style("fill","yellow").style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),B.selectAll(".row_label_group").select("text").attr("y",.5*e.viz.rect_height+.35*e.labels.default_fs_row),n.has(e.network_data.row_nodes[0],"value")&&x(t,B),B.selectAll(".row_cat_group").attr("transform",function(t){var r=_.indexOf(I,t.name);return"translate(0, "+e.viz.y_scale(r)+")"}),B.selectAll(".row_cat_group").select("path").attr("d",function(){var t=e.viz.cat_room.symbol_width-1,r=0,n=1,o=e.viz.rect_height/2,a=e.viz.cat_room.symbol_width-1,i=e.viz.rect_height,s="M "+t+","+r+" L "+n+","+o+", L "+a+","+i+" Z";return s});var j=!0;e.viz.show_dendrogram?(z(t,"row",j),z(t,"col",j),s(e,B),k(t,"row",0),k(t,"col",0)):s(e,B),h(e,B),v(e,B),m(e,B),g(e,B),l(e,B),c(e.viz,B),C(e),u(e,B),e.zoom_behavior.scale(1).translate([e.viz.clust.margin.left,e.viz.clust.margin.top]),b(e),d3.select(e.root+" .clust_container").attr("transform","translate("+e.viz.clust.margin.left+","+e.viz.clust.margin.top+")"),t.params.viz.ds_level===-1&&A(t),M(t),d3.select(e.viz.viz_svg).style("opacity",1),S(t),d3.select(t.params.root+" .row_slider_group").style("opacity",0),d3.select(t.params.root+" .col_slider_group").style("opacity",0),setTimeout(O,500,t,"row"),setTimeout(O,500,t,"col")}},function(t,e,r){"use strict";var n=r(154),o=r(159),a=r(160);t.exports=function(t){var e=t.params,r={};if(r.zoom_x=d3.event.scale,r.zoom_y=d3.event.scale,r.trans_x=e.zoom_behavior.translate()[0]-e.viz.clust.margin.left,r.trans_y=e.zoom_behavior.translate()[1]-e.viz.clust.margin.top,d3.selectAll(e.viz.root_tips).style("display","none"),e.zoom_info=o(e,r),e.zoom_info=a(e,r),e.is_slider_drag===!1&&e.is_cropping===!1){var i=e.zoom_info.trans_x+e.viz.clust.margin.left,s=e.zoom_info.trans_y+e.viz.clust.margin.top;e.zoom_behavior.translate([i,s]),t.params=e,n(t)}}},function(t,e,r){"use strict";var n=r(147),o=r(134),a=r(155),i=r(114),s=r(129),l=r(156),c=r(158);t.exports=function(t){function e(t){var e=t.params,r=c(e);r===!0&&setTimeout(l,50,t)}var r=t.params,u=r.zoom_info,d=s(r);d3.select(r.root+" .clust_group").attr("transform","translate("+[u.trans_x,u.trans_y]+") scale("+u.zoom_x+","+u.zoom_y+")"),d3.select(r.root+" .row_label_zoom_container").attr("transform","translate("+[0,u.trans_y]+") scale("+u.zoom_y+")"),d3.select(r.root+" .col_zoom_container").attr("transform","translate("+[u.trans_x,0]+") scale("+u.zoom_x+")"), -d3.select(r.root+" .row_cat_container").attr("transform","translate("+[0,u.trans_y]+") scale( 1,"+u.zoom_y+")"),d3.select(r.root+" .row_dendro_container").attr("transform","translate("+[r.viz.uni_margin/2,u.trans_y]+") scale( 1,"+u.zoom_y+")"),d3.select(r.root+" .row_dendro_icons_group").attr("transform",function(){var t=u.trans_y,e="translate("+[0,t]+") ",r="scale(1, "+u.zoom_y+")",n=e+r;return n}),d3.select(r.root+" .col_dendro_icons_group").attr("transform",function(){var t=u.trans_x,e="translate("+[t,0]+")",r="scale("+u.zoom_x+", 1)",n=e+r;return n}),i(r,u,"row"),i(r,u,"col"),d3.select(r.root+" .col_cat_container").attr("transform","translate("+[u.trans_x,0]+") scale("+u.zoom_x+",1)"),d3.select(r.root+" .col_dendro_container").attr("transform","translate("+[u.trans_x,r.viz.uni_margin/2]+") scale("+u.zoom_x+",1)"),a(r,u),d3.select(r.root+" .viz_svg").attr("is_zoom",function(){var t=Number(d3.select(r.root+" .viz_svg").attr("is_zoom"));return d3.select(r.root+" .viz_svg").attr("stopped_zoom",1),t+1});var f=function(){d3.select(r.root+" .viz_svg").attr("is_zoom",function(){var t=Number(d3.select(r.root+" .viz_svg").attr("is_zoom"));return t-1})};if(n(r),u.zoom_y<=d.zoom_y){var p=!1;u.zoom_y0&&(n=t.labels.bar_scale_col(r.value)/e.zoom_x),n})}},function(t,e,r){"use strict";var n=r(147),o=r(146),a=r(157),i=r(149),s=r(134),l=r(158);t.exports=function(t){function e(){_.each(["row","col"],function(t){d3.selectAll(r.root+" ."+t+"_label_group").filter(function(){return"none"!=d3.select(this).style("display")}).select("text").style("font-size",function(){var t=Number(d3.select(this).style("font-size").replace("px",""));return t})})}var r=t.params,c=l(r);if(c===!0){_.each(["row","col"],function(t){d3.selectAll(r.root+" ."+t+"_label_group").select("text").style("opacity",1),d3.selectAll(r.root+" ."+t+"_cat_group").select("path").style("display","block")}),s(t,!0),d3.selectAll(r.viz.root_tips).style("display","block"),d3.selectAll(r.root+" .row_label_group").select("text").style("display","none"),d3.selectAll(r.root+" .row_label_group").select("text").style("display","block"),d3.select(r.root+" .viz_svg").attr("stopped_zoom",0),d3.selectAll(r.root+" .row_label_group").select("text").style("display","block"),d3.selectAll(r.root+" .col_label_group").select("text").style("display","block"),i(r),t.params.viz.x_offset=0;var u=150;_.each(["row","col"],function(t){var e=a(r,t);e1&&(e.zoom_y=0?e.trans_y=0:e.trans_y<=-e.pan_room_y&&(e.trans_y=-e.pan_room_y),e}},function(t,e){"use strict";t.exports=function(t,e){var r=t.viz;return r.zoom_ratio.x>1&&(e.zoom_x0?e.trans_x=0:e.trans_x<=-e.pan_room_x&&(e.trans_x=-e.pan_room_x),e}},function(t,e,r){"use strict";var n=r(144);t.exports=function(t){var e=t.params;d3.selectAll(e.viz.zoom_element).on("dblclick.zoom",null),d3.select(e.viz.zoom_element).on("dblclick",function(){n(t,0,0,1)})}},function(t,e){"use strict";t.exports=function(t){var e=1,r=0,n=0,o=t.viz.clust.dim.height/2,a=-(e-1)*o;d3.select(t.root+" .clust_group").attr("transform","translate("+[0,0+a]+") scale(1,"+e+")translate("+[r,n]+")"),d3.select(t.root+" .row_label_zoom_container").attr("transform","translate("+[0,a]+") scale("+e+","+e+")translate("+[0,n]+")"),d3.select(t.root+" .row_cat_container").attr("transform","translate("+[0,a]+") scale(1,"+e+")translate("+[0,n]+")"),d3.select(t.root+" .row_dendro_container").attr("transform","translate("+[0,a]+") scale("+e+","+e+")translate("+[t.viz.uni_margin/2,n]+")"),d3.select(t.root+" .col_zoom_container").attr("transform"," scale(1,1)translate("+[r,0]+")"),d3.select(t.root+" .col_cat_container").attr("transform"," scale(1,1)translate("+[r,0]+")"),d3.select(t.root+" .col_dendro_container").attr("transform"," scale(1,1)translate("+[r,t.viz.uni_margin/2]+")"),d3.select(t.root+" .row_dendro_icons_group").attr("transform",function(){return"translate(0,0) scale(1)"}),d3.select(t.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=7,r=t.pos_mid;return"translate("+e+","+r+") scale(1, 1)"})}},function(t,e){"use strict";t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n={};r===!1?n.run_transition=!1:n=r;var o,a=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;n.run_transition?(o=e.transition().delay(n.update).duration(a),e.selectAll(".col_cat_group").data(i,function(t){return t.name}).transition().delay(n.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}),e.selectAll(".col_dendro_group").data(i,function(t){return t.name}).transition().delay(n.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"})):(o=e,e.selectAll(".col_cat_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}),d3.select(t.root).selectAll(".col_dendro_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}));var l,c;_.each(["row","col"],function(e){var r=t.viz.all_cats[e].length;for(l=0;l2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(".super_col_bkg").attr("height",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.grey_border_width+")"),r.select(".super_col").attr("transform",function(){var e=t.viz.clust.dim.width/2+t.viz.norm_labels.width.row,r=t.viz.super_labels.dim.width;return"translate("+e+","+r+")"}),r.select(".super_row_bkg").attr("width",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.grey_border_width+",0)"),r.select(".super_row").attr("transform",function(){var e=t.viz.super_labels.dim.width,r=t.viz.clust.dim.height/2+t.viz.norm_labels.width.col;return"translate("+e+","+r+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(t.root+" .right_slant_triangle").attr("transform","translate("+t.clust.dim.width+","+t.norm_labels.width.col+")"),r.select(t.root+" .left_slant_triangle").attr("transform","translate(-1,"+t.norm_labels.width.col+")");var i=t.clust.margin.top+t.uni_margin/5;r.select(t.root+" .top_left_white").attr("width",t.clust.margin.left).attr("height",i);var s=t.clust.margin.left+t.clust.dim.width+t.uni_margin+t.dendro_room.row,l=t.norm_labels.margin.top+t.norm_labels.width.col;r.select(t.root+" .right_spillover_container").attr("transform",function(){return"translate("+s+", 0)"}),l=t.norm_labels.margin.top+t.norm_labels.width.col,r.select(t.root+" .right_spillover_container rect").attr("transform",function(){return"translate( 0,"+l+")"}),r.select(t.root+" .right_spillover").attr("height",t.svg_dim.height+"px");var c=t.clust.margin.left+t.clust.dim.width,u=l,d=t.dendro_room.row+t.uni_margin,f=t.cat_room.col+t.uni_margin;d3.select(t.root+" .dendro_row_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=0,u=t.clust.margin.top+t.clust.dim.height,d=t.clust.margin.left,f=10*t.clust.dim.height,r.select(".dendro_col_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=t.clust.margin.left+t.clust.dim.width,u=t.clust.margin.top+t.clust.dim.height,d=t.cat_room.col+t.clust.dim.width,f=t.cat_room.row+t.uni_margin,r.select(".dendro_corner_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=t.clust.margin.left+t.clust.dim.width+t.uni_margin,u=t.norm_labels.margin.top+t.norm_labels.width.col+2.5*t.uni_margin;var p=2.75,_=1.2;t.show_categories.col&&d3.selectAll(t.root+" .col_cat_super").attr("transform",function(e){var r=parseInt(e.split("-")[1],10),n=u+_*t.cat_room.symbol_width*r;return"translate("+c+","+n+")"}),t.show_categories.row&&d3.select(t.root+" .row_cat_label_container").attr("transform",function(){return c=t.norm_labels.margin.left+t.norm_labels.width.row+t.cat_room.symbol_width+p*t.uni_margin,u=t.clust.margin.top-t.uni_margin,"translate("+c+","+u+") rotate(-90)"}),u=t.show_dendrogram?t.clust.margin.top+t.clust.dim.height+t.dendro_room.col-2*t.uni_margin:t.clust.margin.top+t.clust.dim.height,d3.select(t.root+" .bottom_spillover_container").attr("transform",function(){return"translate(0,"+u+")"}),r.select(t.root+" .bottom_spillover").attr("width",t.svg_dim.width).attr("height",2*t.svg_dim.height);var h=t.cat_room.col+1.5*t.uni_margin;d3.select(t.viz_svg+" .top_right_white").attr("fill",t.background_color).attr("width",2*t.clust.dim.width).attr("height",h).attr("transform",function(){var e=t.clust.margin.left+t.clust.dim.width,r=t.norm_labels.width.col+t.norm_labels.margin.top-t.uni_margin;return"translate("+e+", "+r+")"})}},function(t,e){"use strict";t.exports=function(t,e){e.select(".left_border").attr("width",t.viz.grey_border_width).attr("height",t.viz.svg_dim.height).attr("transform","translate(0,0)"),e.select(".right_border").attr("width",t.viz.grey_border_width).attr("height",t.viz.svg_dim.height).attr("transform",function(){var e=t.viz.svg_dim.width-t.viz.grey_border_width;return"translate("+e+",0)"}),e.select(".top_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",function(){var t=0;return"translate("+t+",0)"}),e.select(".bottom_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",function(){var e=t.viz.svg_dim.height-t.viz.grey_border_width;return"translate(0,"+e+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration,i=t.network_data.row_nodes,s=t.network_data.row_nodes_names;n===!1?o.run_transition=!1:o=n,o.run_transition?(e.selectAll(".row_label_group").data(i,function(t){return t.name}).transition().delay(o.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),r=e.transition().delay(o.update).duration(a)):(e.selectAll(".row_label_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),r=e),r.select(t.root+" .row_container").attr("transform","translate("+t.viz.norm_labels.margin.left+","+t.viz.clust.margin.top+")"),r.select(t.root+" .row_container").select(".white_bars").attr("width",t.viz.label_background.row).attr("height",30*t.viz.clust.dim.height+"px"),r.select(t.root+" .row_container").select(".row_label_container").attr("transform","translate("+t.viz.norm_labels.width.row+",0)")}},function(t,e){"use strict";t.exports=function(t){var e=6,r=e*t.viz.border_width.x,n=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.rect_width).attr("height",n).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+",0)"}),d3.select(t.root+" .left_hlight").attr("width",r).attr("height",t.viz.rect_width-.99*n).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*n+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.rect_height-.99*n).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.rect_width-r;return"translate("+e+","+.99*n+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.rect_width-1.98*r}).attr("height",n).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,o=t.viz.rect_height-n;return"translate("+e+","+o+")"}),d3.select(t.root+" .row_top_hlight").attr("width",t.viz.svg_dim.width).attr("height",n),d3.select(t.root+" .row_bottom_hlight").attr("width",t.viz.svg_dim.width).attr("height",n).attr("transform",function(){var e=t.viz.rect_height-n;return"translate(0,"+e+")"}),d3.select(t.root+" .col_top_hlight").attr("width",t.viz.clust.dim.height).attr("height",r).attr("transform",function(){var e=0,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"}),d3.select(t.root+" .col_bottom_hlight").attr("width",t.viz.clust.dim.height).attr("height",r).attr("transform",function(){var e=t.viz.rect_width-r,n=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+n+","+e+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(".row_cat_outer_container").attr("transform","translate("+t.viz.norm_labels.width.row+",0)").select("white_bars").attr("width",t.viz.cat_room.row+"px").attr("height",function(){var e=t.viz.clust.dim.height;return e});var i=t.viz.clust.margin.left+t.viz.clust.dim.width,s=t.viz.clust.margin.top;r.select(".row_dendro_outer_container").attr("transform","translate("+i+","+s+")"),i=t.viz.clust.margin.left,s=t.viz.clust.margin.top+t.viz.clust.dim.height,r.select(" .col_dendro_outer_container").attr("transform",function(){return"translate("+i+","+s+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;n===!1?o.run_transition=!1:o=n,o.run_transition?(r=e.transition().delay(o.update).duration(a),e.selectAll(".col_label_text").data(i,function(t){return t.name}).transition().delay(o.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"})):(r=e,e.selectAll(".col_label_text").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"}));var l=t.viz.x_scale.rangeBand()/2+t.viz.border_width.x;r.select(t.root+" .col_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.norm_labels.margin.top+")"),r.select(t.root+" .col_container").select(".white_bars").attr("width",30*t.viz.clust.dim.width+"px").attr("height",t.viz.label_background.col),r.select(t.root+" .col_container").select(".col_label_outer_container").attr("transform","translate(0,"+t.viz.norm_labels.width.col+")"),r.selectAll(".col_label_group").attr("transform","translate("+t.viz.x_scale.rangeBand()/2+","+l+") rotate(45)"),r.selectAll(".col_label_group").select("text").attr("y",.6*t.viz.x_scale.rangeBand()).attr("dx",2*t.viz.border_width.x)}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){e.selectAll(".col_label_group").select("text").style("font-size",t.labels.default_fs_col+"px").text(function(t){return n.normal_name(t)}),e.selectAll(".col_label_group").each(function(){d3.select(this).select("text")[0][0].getBBox()})}},function(t,e,r){"use strict";var n=r(138);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.selectAll(".col_label_group").select("path"),a={},i=t.viz.duration;r===!1?a.run_transition=!1:a=r;var s;s=a.run_transition?o.transition().delay(a.update).duration(i):o,s.attr("d",function(){return n(t)}).attr("fill","#eee")}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={};r===!1?o.run_transition=!1:o=r,n.has(t.network_data.col_nodes[0],"value")&&e.selectAll(".col_bars").data(t.network_data.col_nodes,function(t){return t.name}).attr("width",function(e){var r=0;return e.value>0&&(r=t.labels.bar_scale_col(e.value)),r}).attr("height",.66*t.viz.rect_width)}},function(t,e,r){"use strict";var n=r(71),o=r(74),a=r(73),i=r(83),s=r(82);t.exports=function(t){if(t=n(t),t.viz=a(t.viz),t.viz=o(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t.viz=s(t.viz),t.viz.x_scale.rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale.rangeBands([0,t.viz.clust.dim.height]),t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,null!=t.viz.ds)for(var e;e0&&_.each(t.viz.ds,function(e){e.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]),e.y_scale.domain(d3.range(e.num_rows+1)),e.rect_height=e.y_scale.rangeBand()-t.viz.border_width.y}),t.viz.square_zoom=t.viz.norm_labels.width.col/(t.viz.rect_width/2),t=i(t)}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(99);t.exports=function(t,e){var r=t.network_data.row_nodes_names;if(t.viz.ds_level===-1)e.selectAll(".row").attr("transform",function(e){var n=_.indexOf(r,e.name),o=t.viz.y_scale(n);return"translate(0,"+o+")"}),e.selectAll(".row").selectAll(".tile").attr("transform",function(e){return a(t,e)}).attr("width",t.viz.rect_width).attr("height",t.viz.rect_height),e.selectAll(".row").selectAll(".tile_up").attr("d",function(){return n(t)}).attr("transform",function(e){return a(t,e)}),e.selectAll(".row").selectAll(".tile_dn").attr("d",function(){return o(t)}).attr("transform",function(e){return a(t,e)});else{var i=t.viz.ds_level,s=".ds"+String(i)+"_row",l=t.viz.ds[i].rect_height;e.selectAll(s).attr("transform",function(e){var r=t.viz.ds[i].y_scale(e.row_index);return"translate(0,"+r+")"}),e.selectAll(s).selectAll(".tile").attr("transform",function(e){return a(t,e)}).attr("width",t.viz.rect_width).attr("height",l)}}},function(t,e,r){"use strict";var n=r(75);t.exports=function(t,e){var r=t.params;r=n(r),e.selectAll(".row_bars").attr("width",function(t){var e=0;return e=r.labels.bar_scale_row(Math.abs(t.value))}).attr("x",function(t){var e=0;return e=-r.labels.bar_scale_row(Math.abs(t.value))}).attr("height",r.viz.y_scale.rangeBand())}},function(t,e){"use strict";t.exports=function(t){var e=d3.select(t.root+" .clust_container").attr("transform"),r=Number(e.split("(")[1].split(",")[0]),n=Number(e.split(",")[1].replace(")","")),o=r+t.viz.clust.dim.width/2,a=n+t.viz.clust.dim.height/2;d3.select(t.root+" .play_button").attr("transform",function(){return"translate("+o+","+a+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o=t.params.viz;if("row"===e){var a=o.svg_dim.width-3*o.uni_margin;r=o.clust.margin.left+o.clust.dim.width+5.25*o.dendro_room.row,r>a&&(r=a),n=o.clust.margin.top+3*o.uni_margin-50}else r=2*o.uni_margin,n=o.clust.margin.top+o.clust.dim.height+o.dendro_room.col-2*o.uni_margin;d3.select(t.params.root+" ."+e+"_tree_group").attr("transform",function(){var t;return n-=75,t="translate("+r+","+n+")"}).style("opacity",1),d3.select(t.params.root+" ."+e+"_slider_group").attr("transform",function(){var t;return"row"===e?(r+=.8*o.dendro_room.row,n+=65,t="translate("+r+","+n+")"):t="translate("+r+","+n+"), rotate(-90)",t}).style("opacity",1)}},function(t,e){"use strict";t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;e>0&&(r=2e3);var n=d3.selectAll(t.root+" .horz_lines"),o=d3.selectAll(t.root+" .vert_lines");n.style("opacity",0).attr("transform",function(e){var r=e.row_index,n=t.viz.y_scale(r);return"translate( 0,"+n+") rotate(0)"}).transition().duration(e).delay(r).style("opacity",1),n.append("line").attr("x1",0).attr("x2",t.viz.clust.dim.width).style("stroke-width",function(){var e=t.viz.border_width.y;return e+"px"}),o.style("opacity",0).attr("transform",function(e){var r=e.col_index,n=t.viz.x_scale(r);return"translate("+n+") rotate(-90)"}).transition().duration(e).delay(r).style("opacity",1),o.append("line").attr("x1",0).attr("x2",-t.viz.clust.dim.height).style("stroke-width",function(){var e=t.viz.border_width.x;return e+"px"})}},function(t,e,r){"use strict";var n=r(181),o=r(100),a=r(182),i=r(183),s=r(184);t.exports=function(t){var e=t.params;d3.select(e.root+" .col_cat_outer_container").empty()?d3.select(e.root+" .col_container").append("g").attr("class","col_cat_outer_container").attr("transform",function(){var t=e.viz.norm_labels.width.col+2;return"translate(0,"+t+")"}).append("g").attr("class","col_cat_container"):d3.select(e.root+" .col_container").select("col_cat_outer_container").attr("transform",function(){var t=e.viz.norm_labels.width.col+2;return"translate(0,"+t+")"}),d3.selectAll(e.viz.root_tips+"_col_cat_tip").remove();var r=o().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_col_cat_tip";return r}).direction("s").offset([5,0]).style("display","none").html(function(t){return n(e,t,this,"col")});d3.select(e.root+" .col_cat_container").selectAll("g").data(e.network_data.col_nodes,function(t){return t.name}).enter().append("g").attr("class","col_cat_group").attr("transform",function(t){var r=_.indexOf(e.network_data.col_nodes_names,t.name);return"translate("+e.viz.x_scale(r)+",0)"}),d3.select(e.root+" .col_cat_container").selectAll(".col_cat_group").call(r),d3.selectAll(e.root+" .col_cat_group").each(function(){var t,n=this;_.each(e.viz.all_cats.col,function(o){var l=parseInt(o.split("-")[1],10),c="col_cat_rect_"+String(l);t=d3.select(n).select("."+c).empty()?d3.select(n).append("rect").attr("class",c).attr("cat",o).attr("transform",function(){var t=e.viz.cat_room.symbol_width+e.viz.cat_room.separation,r=l*t;return"translate(0,"+r+")"}).on("click",function(t){if(d3.select(this).classed("cat_strings")){var r=s(e,t,this,"col");$(e.root+" .dendro_info").modal("toggle");var n=r.join(", ");d3.select(e.root+" .dendro_info input").attr("value",n)}}):d3.select(n).select("."+c),t.attr("width",e.viz.x_scale.rangeBand()).attr("height",e.viz.cat_room.symbol_width).style("fill",function(t){var r=t[o],n=e.viz.cat_colors.col[o][r];return n}).on("mouseover",r.show).on("mouseout",function(){r.hide(this),a(e),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(e.viz,"col",t,o)})})}},function(t,e,r){"use strict";var n=r(141);t.exports=function(t,e,r,o){function a(){var e=!1;if(d3.select(r).classed("hovering")){var n=[o];t.viz.sim_mat&&(n=["row","col"]),_.each(n,function(r){"string"==typeof l&&l.indexOf("Not ")<0&&"false"!=l&&(e=!0),e&&d3.selectAll(t.root+" ."+r+"_cat_group").selectAll("rect").style("opacity",function(e){var r=d3.select(this).style("opacity");if(d3.select(this).classed("cat_strings")&&d3.select(this).classed("filtered_cat")===!1){var n,o=d3.select(this).attr("cat");n=e[o].indexOf(": ")>=0?e[o].split(": ")[1]:e[o],r=o===i&&n===l?t.viz.cat_colors.active_opacity:t.viz.cat_colors.opacity/4}return r})})}}d3.selectAll(t.viz.root_tips+"_col_cat_tip").style("display","block"),d3.selectAll(t.viz.root_tips+"_row_cat_tip").style("display","block");var i=d3.select(r).attr("cat"),s=n(t.viz,i,o),l=e[i];"string"==typeof l&&l.indexOf(": ")>=0&&(l=l.split(": ")[1]);var c=s+": "+l;return d3.select(r).classed("hovering",!0),setTimeout(a,500),c}},function(t,e){"use strict";t.exports=function(t){_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_cat_group").selectAll("rect").style("opacity",function(){var e=d3.select(this).style("opacity");return d3.select(this).classed("cat_strings")&&d3.select(this).classed("filtered_cat")===!1&&(e=t.viz.cat_colors.opacity),e})})}},function(t,e){"use strict";t.exports=function(t,e,r,n){function o(t){"string"==typeof t&&t.indexOf(i)>-1&&(t=t.split(i)[1]);var e=parseFloat(t);return e}var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=": ",s=t.cat_info[e][n].type;"cat_strings"===s?a?r.classed("cat_strings",!0).style("opacity",0).transition().duration(1e3).style("opacity",t.cat_colors.opacity):r.classed("cat_strings",!0).style("opacity",t.cat_colors.opacity):r.classed("cat_values",!0).style("opacity",function(r){var a=r[n],i=o(a);return t.cat_info[e][n].cat_scale(Math.abs(i))}).style("fill",function(e){var r,a=o(e[n]);return r=a>0?t.cat_value_colors[0]:t.cat_value_colors[1]})}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e,r,o){var a=d3.select(r).attr("cat"),i=e[a],s=t.network_data[o+"_nodes"],l=_.filter(s,function(t){return t[a]==i}),c=n.pluck(l,"name");return c}},function(t,e,r){"use strict";var n=r(181),o=r(100),a=r(182),i=r(183),s=r(184);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.params;d3.select(r.root+" .row_cat_outer_container").empty()?d3.select(r.root+" .row_container").append("g").attr("class","row_cat_outer_container").attr("transform","translate("+r.viz.norm_labels.width.row+",0)").append("g").attr("class","row_cat_container"):d3.select(r.root+" .row_container").select("row_cat_outer_container").attr("transform","translate("+r.viz.norm_labels.width.row+",0)"),d3.select(r.root+" .row_cat_container").select(".white_bars").empty()?d3.select(r.root+" .row_cat_container").append("rect").attr("class","white_bars").attr("fill",r.viz.background_color).attr("width",r.viz.cat_room.row+"px").attr("height",function(){var t=r.viz.clust.dim.height;return t}):d3.select(r.root+" .row_cat_container").select(".white_bars").attr("fill",r.viz.background_color).attr("width",r.viz.cat_room.row+"px").attr("height",function(){var t=r.viz.clust.dim.height;return t}),d3.selectAll(r.viz.root_tips+"_row_cat_tip").remove();var l=o().attr("class",function(){var t=r.viz.root_tips.replace(".",""),e=t+" d3-tip "+t+"_row_cat_tip";return e}).direction("e").offset([5,0]).style("display","none").html(function(t){return n(r,t,this,"row")});d3.select(r.root+" .row_cat_container").selectAll("g").data(r.network_data.row_nodes,function(t){return t.name}).enter().append("g").attr("class","row_cat_group").attr("transform",function(t){var e=_.indexOf(r.network_data.row_nodes_names,t.name);return"translate(0, "+r.viz.y_scale(e)+")"}),d3.select(r.root+" .row_cat_container").selectAll(".row_cat_group").call(l);var c,u;d3.selectAll(r.root+" .row_cat_group rect").remove(),r.viz.show_categories.row&&d3.selectAll(r.root+" .row_cat_group").each(function(){u=this,_.each(r.viz.all_cats.row,function(t){var n=parseInt(t.split("-")[1],10),o="row_cat_rect_"+String(n);c=d3.select(u).select("."+o).empty()?d3.select(u).append("rect").attr("class",o).attr("cat",t):d3.select(u).select("."+o),c.attr("width",r.viz.cat_room.symbol_width).attr("height",r.viz.y_scale.rangeBand()).style("fill",function(e){var n=e[t],o=r.viz.cat_colors.row[t][n];return o}).attr("x",function(){var t=r.viz.cat_room.symbol_width+r.viz.uni_margin/2;return t+"px"}).attr("transform",function(){var t=r.viz.cat_room.symbol_width+r.viz.cat_room.separation,e=n*t;return"translate("+e+",0)"}).on("click",function(t){if(d3.select(this).classed("cat_strings")){var e=s(r,t,this,"row");$(r.root+" .dendro_info").modal("toggle");var n=e.join(", ");d3.select(r.root+" .dendro_info input").attr("value",n)}}).on("mouseover",l.show).on("mouseout",function(){l.hide(this),a(r),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(r.viz,"row",c,t,e)})})}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.dendro_room.row+e.viz.uni_margin,o=e.viz.clust.margin.left+e.viz.clust.dim.width,a=e.viz.clust.margin.top;d3.select(e.root+" .row_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").append("rect").classed("row_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",r+"px").attr("height",e.viz.svg_dim.height),d3.select(e.root+" .row_dendro_outer_container").append("g").attr("class","row_dendro_container").attr("transform","translate("+e.viz.uni_margin/2+",0)")):(d3.select(e.root+" .viz_svg").select("row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").select(".row_dendro_spillover").attr("width",r+"px").attr("height",e.viz.svg_dim.height)),n(t,"row",!1),"clust"!=e.viz.inst_order.col&&d3.selectAll(e.root+" .row_dendro_group").remove()}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.clust.margin.left,o=e.viz.clust.margin.top+e.viz.clust.dim.height,a=e.viz.dendro_room.col+e.viz.uni_margin;d3.select(e.root+" .col_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","col_dendro_outer_container").attr("transform","translate("+r+","+o+")"),d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",a+"px"),d3.select(e.root+" .col_dendro_outer_container").append("g").attr("class","col_dendro_container").attr("transform","translate(0,"+e.viz.uni_margin/2+")"),d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover_top",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height).attr("transform","translate(0,"+e.viz.dendro_room.col+")")):(d3.select(e.root+" .viz_svg").select("col_dendro_outer_container").attr("transform","translate("+r+","+o+")"), -d3.select(e.root+" .col_dendro_outer_container").select(".col_dendro_spillover").attr("width",e.viz.svg_dim.width).attr("height",a+"px")),n(t,"col",!1),"clust"!=e.viz.inst_order.row&&d3.selectAll(e.root+" .col_dendro_group").remove()}},function(t,e,r){"use strict";var n=r(189);r(191);t.exports=function(t){n(t,"row"),n(t,"col")}},function(t,e,r){"use strict";var n=r(190),o=r(178);t.exports=function(t,e){function r(){t.params.is_slider_drag=!0;var r=d3.event.y;r<0&&(r=0),r>i&&(r=i),this.nextSibling&&this.parentNode.appendChild(this),r=d3.round(r,-1);var o=10-r/10;d3.select(this).attr("transform","translate(0, "+r+")"),n(t,e,o)}function a(){var r=d3.mouse(this),o=d3.round(r[1],-1);d3.select(t.params.root+" ."+e+"_group_circle").attr("transform","translate(0, "+o+")");var a=10-o/10;n(t,e,a)}var i=100,s=d3.behavior.drag().on("drag",r).on("dragend",function(){t.params.is_slider_drag=!1}),l=d3.select(t.params.root+" .viz_svg").append("g").classed(e+"_slider_group",!0);o(t,e);var c=i+20,u=30;l.append("rect").classed(e+"_slider_background",!0).attr("height",c+"px").attr("width",u+"px").attr("fill",t.params.viz.background_color).attr("transform",function(){var t="translate(-10, -5)";return t}).style("opacity",0),l.append("line").style("stroke-width",i/7+"px").style("stroke","black").style("stroke-linecap","round").style("opacity",0).attr("y1",0).attr("y2",function(){return i-2}).on("click",a);var d=-i/40;l.append("path").style("fill","black").attr("transform","translate("+d+", 0)").attr("d",function(){var t=0,e=0,r=0,n=i,o=i/10,a=0,s="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return s}).style("opacity",.35).on("click",a);var f=.35,p=.6;l.append("circle").classed(e+"_group_circle",!0).attr("r",.08*i).attr("transform",function(){return"translate(0, "+i/2+")"}).style("fill","blue").style("opacity",f).on("mouseover",function(){d3.select(this).style("opacity",p)}).on("mouseout",function(){d3.select(this).style("opacity",f)}).call(s)}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t,e,r){var o=t.params;"row"===e?o.group_level.row=r:"col"===e&&(o.group_level.col=r);var a=!0;n(t,e,a)}},function(t,e,r){"use strict";var n=r(178),o=r(100),a=r(192);t.exports=function(t,e){e="row";var r=40,i=t.params,s=.35,l=.6,c=o().attr("class",function(){var t=i.viz.root_tips.replace(".",""),e=t+"_tree_menu_tip d3-tip";return e}).direction("sw").style("display","none").offset([-10,-5]).html(function(){return"Clustering Menu"}),u=d3.select(i.root+" .viz_svg").append("g").classed(e+"_tree_group",!0).on("mouseover",function(){d3.select(i.root+" .tree_menu").empty()&&(d3.selectAll(i.viz.root_tips+"_tree_menu_tip").style("opacity",1).style("display","block"),c.show()),d3.selectAll(i.root+" .tree_leaf_circle").style("opacity",l)}).on("mouseout",function(){c.hide(),d3.selectAll(i.root+" .tree_leaf_circle").style("opacity",s)}).call(c),d=u.append("g").classed("dendro_tree_container",!0).on("click",function(){d3.select(i.root+" .tree_menu").empty()?(a(t,"open"),c.hide()):a(t,"close")});d3.select(i.root+" .dendro_tree_container").attr("transform","scale(0.9)"),n(t,e);var f=0,p=20;d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=0,e=r,n=p/2,o=0,a=p,i=r,s="M"+t+","+e+", L"+n+", "+o+", L"+a+","+i+" Z";return s}).style("opacity",.35);var _=30;d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=4.3,e=23,r=-5,n=_/2.5,o=5.8,a=_/1.8,i="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return i}).style("opacity",.35),d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=15.7,e=23,r=25,n=_/2.5,o=14.2,a=_/1.8,i="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return i}).style("opacity",.35);var h=13,v=9.5;d.selectAll().data([[-3,h,v],[p/2,0,17],[23,h,v]]).enter().append("circle").classed("tree_leaf_circle",!0).attr("r",function(t){return t[2]}).attr("transform",function(t){return"translate("+t[0]+", "+t[1]+")"}).attr("fill","blue").attr("opacity",s).attr(""),d.append("rect").attr("width",50).attr("height",62).attr("transform",function(){return"translate(-15, -19)"}).attr("opacity",0)}},function(t,e,r){"use strict";var n=r(193);t.exports=function(t,e){var r=t.params;"open"===e?n(t):"close"===e&&(d3.select(r.root+" .tree_menu").transition(700).attr("opacity",0),setTimeout(function(){d3.select(r.root+" .tree_menu").remove()},700))}},function(t,e,r){"use strict";var n=r(194);t.exports=function(t){function e(t){return t.charAt(0).toUpperCase()+t.slice(1)}var r=t.params,o=475,a=d3.select(r.root+" .viz_svg").append("g").attr("transform",function(){var t={};return t.x=r.viz.clust.dim.width+r.viz.clust.margin.left-o+25,t.y=r.viz.clust.margin.top,"translate("+t.x+", "+t.y+")"}).classed("tree_menu",!0);a.attr("opacity",0).transition().attr("opacity",1),a.append("rect").classed("tree_menu_background",!0).attr("width",function(){var t=o;return t}).attr("height",function(){var t=500;return t}).attr("fill","white").attr("stroke","#A3A3A3").attr("stroke-width","3px").attr("opacity",.95),a.append("text").classed("tree_menu_title",!0).attr("transform","translate(20,30)").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-size","18px").attr("font-weight",800).attr("cursor","default").text("Clustering Menu");var i=["cosine","euclidean","correlation","jaccard"],s=30,l=110,c=80;a.append("text").attr("transform","translate(25, 70)").attr("font-size","18px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("cursor","default").text("Distance Metric"),a.append("rect").classed("tree_menu_line",!0).attr("height","2px").attr("width","435px").attr("stroke-width","3px").attr("opacity",.3).attr("fill","black").attr("transform","translate(20,"+c+")");var u=a.append("g").attr("transform","translate(20,"+l+")").classed("distance_section",!0),d=u.selectAll("g").data(i).enter().append("g").attr("transform",function(t,e){var r=e*s,n="translate(0,"+r+")";return n}).on("click",function(e){d3.select(r.root+" .tree_menu").transition(700).attr("opacity",0),setTimeout(function(){d3.select(r.root+" .tree_menu").remove()},700),t.params.matrix.distance_metric=e,n(t,e)});d.append("circle").attr("cx",10).attr("cy",-6).attr("r",7).style("stroke","#A3A3A3").style("stroke-width","2px").style("fill",function(e){var r="white";return e===t.params.matrix.distance_metric&&(r="red"),r}),d.append("text").attr("transform","translate(25,0)").style("font-size","16px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("cursor","default").text(function(t){return e(t)})}},function(t,e,r){"use strict";var n=r(195),o=r(12),a=o.create(),i=r(199),s=r(200),l=r(202);a.import(r(227)),a.import(r(25)),t.exports=function(t,e){var r={};r.N_row_sum="null",r.N_row_var="null",r.dist=e,r.nodes={},r.nodes.row_nodes=$.extend(!0,[],t.params.network_data.row_nodes),r.nodes.col_nodes=$.extend(!0,[],t.params.network_data.col_nodes),_.each(["row","col"],function(o){var l,c,u,d=a.transpose;"row"===o?(l=$.extend(!0,[],t.params.network_data.mat),c=t.params.network_data.row_nodes_names,u="row_nodes"):"col"===o&&(l=$.extend(!0,[],t.params.network_data.mat),l=d(l),c=t.params.network_data.col_nodes_names,u="col_nodes");for(var f,p,_=n.hcluster(l,i[e]),h=s(_,c),v=r.nodes[u],m=0;m=this.threshold)return!1;var a=this.index[t],i=this.index[this.mins[t]],s={dist:e,left:a,right:i,key:a.key,size:a.size+i.size};this.tree[a.index]=s,this.tree.splice(i.index,1),this.index[a.key]=s;for(var r=0;rthis.dists[i.key][l.key]&&(o=this.dists[i.key][l.key])):"complete"==this.linkage?(o=this.dists[a.key][l.key],this.dists[a.key][l.key]r&&(r=t.dist,e=t)}),e}function r(t){return 1===t.size?[t.value]:r(t.left).concat(r(t.right))}(t>this.tree.size||t<1)&&(t=this.tree.size);for(var n=[],o=[this.tree];t>1;){var a=e(o);o.splice(o.indexOf(a),1),o.push(a.left,a.right),t--}return o.forEach(function(t){n.push(r(t))}),n}};var a=function(t,e,r,n,a,i){var s=new o(e,r,n),l=s.tree(t,a,i);return{hc:s,tree:void 0===n?l[0]:l,clusters:s.clusters}};t.exports=a},function(t,e){"use strict";t.exports={euclidean:function(t,e){for(var r=0,n=0;ne&&(e=t)})}),e}},function(t,e,r){"use strict";var n=r(203),o=r(225);t.exports=function(t,e,r){var a={};a[e]=r,n(t,a),o(t,e,r)}},function(t,e,r){"use strict";var n=r(10),o=r(204),a=r(205);t.exports=function(t,e){o(t.params);var r=n(t.config,t.params,e);d3.select(t.params.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!0).classed("fa-undo",!1).classed("active_cropping",!1),_.each(["row","col"],function(e){d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter",!1),d3.select(t.params.root+" ."+e+"_dendro_icons_container").style("display","block")}),a(t,r)}},function(t,e){"use strict";t.exports=function(t){d3.selectAll(t.root+" .btn").attr("disabled",!0),d3.select(t.viz.viz_svg).style("opacity",.7)}},function(t,e,r){"use strict";var n=r(9),o=r(206),a=r(207),i=r(151),s=r(180),l=r(185),c=r(186),u=r(187),d=r(218),f=r(220),p=r(161),_=r(221),h=r(150),v=r(222),m=r(153),g=r(224),y=r(84);t.exports=function(t,e){function r(){d3.selectAll(".dendro_shadow").remove()}function w(){d3.select(t.params.viz.viz_svg).transition().duration(250).style("opacity",1),setTimeout(x,1e3)}function x(){d3.select(t.params.viz.viz_svg).classed("running_update",!1)}d3.select(t.params.viz.viz_svg).classed("running_update",!0),d3.selectAll(t.params.root+" .ds"+String(t.params.viz.ds_level)+"_row").remove(),null!=t.params.matrix_update_callback&&t.params.matrix_update_callback();var b=t.params.matrix.distance_metric,z=t.params.group_level,k=t.params.crop_filter_nodes,A=jQuery.extend(!0,{},t.config),E=null;if(null!=t.params.new_row_cats){v(t.params.new_row_cats,e.row_nodes),E=t.params.new_row_cats,t.params.new_row_cats=E;var N=!0;t.params.viz=y(t.params,t.params.viz,N)}A.network_data=e,A.inst_order=t.params.viz.inst_order,A.input_domain=t.params.matrix.opacity_scale.domain()[1],_(A,t.params),A.ini_view=null,A.current_col_cat=t.params.current_col_cat,A.cat_colors=t.params.viz.cat_colors;var M=n(A),S=o(t.params,M);t.params=M,t.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,t.params.viz.square_zoom*t.params.viz.zoom_ratio.x]).on("zoom",function(){m(t)}),t.params.matrix.distance_metric=b,t.params.group_level=z,t.params.crop_filter_nodes=k,0===t.params.viz.ds_num_levels?a(t,e,S):g(t),d3.select(t.params.viz.viz_svg).style("opacity",.7),l(t),h(t),t.params.viz.show_categories.col&&s(t),t.params.viz.show_dendrogram&&(c(t),u(t)),i(t),d3.select(t.params.viz.viz_svg).call(t.params.zoom_behavior),p(t),d(t),t.params.viz.run_trans=!0,setTimeout(f,2500,t.params),setTimeout(r,50),setTimeout(r,100),setTimeout(r,500),setTimeout(r,1e3),setTimeout(r,1500),setTimeout(w,S.enter)}},function(t,e){"use strict";t.exports=function(t,e){var r=t.network_data.row_nodes,n=t.network_data.col_nodes,o=_.map(r,function(t){return t.name}),a=_.map(n,function(t){return t.name}),i=o.concat(a),s=e.network_data.row_nodes,l=e.network_data.col_nodes,c=_.map(s,function(t){return t.name}),u=_.map(l,function(t){return t.name}),d=c.concat(u),f=_.difference(i,d).length,p=_.difference(d,i).length,h={};f>0?h.update=1e3:h.update=0,p>0?h.enter=1e3:h.enter=0,h.enter=h.enter+h.update,h.run_transition=!0;var v=t.network_data.links.length,m=e.network_data.links.length,g=.5*e.matrix.def_large_matrix;return(v>g||m>g)&&(h.run_transition=!1,h.update=0,h.enter=0),h}},function(t,e,r){"use strict";var n=r(208),o=r(101),a=r(131),i=r(209),s=r(213),l=r(91),c=r(214),u=r(217),d=r(145),f=r(100);t.exports=function(t,e,r){var p=t.params;d3.selectAll(p.viz.root_tips).remove();var _=f().attr("class",function(){var t=p.viz.root_tips.replace(".",""),e=t+" d3-tip "+t+"_tile_tip";return e}).direction("nw").offset([0,0]).style("display","none").html(function(t){var e,r=String(t.value.toFixed(3));if(p.keep_orig){var n=String(t.value_orig.toFixed(3));e="

"+t.row_name+" and "+t.col_name+"

normalized value: "+r+"

original value: "+n+"
"}else e="

"+t.row_name+" and "+t.col_name+"

value: "+r+"
";return e});d3.select(p.root+" .clust_group").call(_),u(p);for(var h=1e3,v=e.row_nodes,m=e.col_nodes,g=e.links,y=g,w=0;w1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null===r&&(r={},r.enter=0,r.update=0,r.run_transition=!1);var b=t.params,z=t.params.network_data.row_nodes;b.zoom_info=x();var k=b.network_data.row_nodes_names;s(b),b=a(b),b.viz=i(b.viz),b.viz=o(b.viz),b.sim_mat&&(b.viz.clust.dim.width<=b.viz.clust.dim.height?b.viz.clust.dim.height=b.viz.clust.dim.width:b.viz.clust.dim.width=b.viz.clust.dim.height),b.viz=w(b.viz),b.viz.x_scale.rangeBands([0,b.viz.clust.dim.width]),b.viz.y_scale.rangeBands([0,b.viz.clust.dim.height]),b.viz.square_zoom=b.viz.norm_labels.width.col/(b.viz.x_scale.rangeBand()/2),b.zoom_behavior.scaleExtent([1,b.viz.square_zoom*b.viz.zoom_ratio.x]),b.viz.border_width.x=b.viz.x_scale.rangeBand()/b.viz.border_fraction,b.viz.border_width.y=b.viz.y_scale.rangeBand()/b.viz.border_fraction,b=y(b);var A=d3.select(b.viz.viz_wrapper).select("svg");A.select(b.root+" .grey_background").transition().delay(r.update).duration(e).attr("width",b.viz.clust.dim.width).attr("height",b.viz.clust.dim.height),d(b,A,r),A.selectAll(".row_label_group").select("text").style("font-size",b.labels.default_fs_row+"px").text(function(t){return n.normal_name(t)}),A.selectAll(".row_label_group").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",b.viz.y_scale.rangeBand()).style("fill","yellow").style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),f(b,A,r),r.run_transition?(A.selectAll(".row_label_group").select("text").transition().delay(r.update).duration(e).attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,function(t){return t.name}).transition().delay(r.update).duration(e).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}),A.selectAll(".row_cat_group").select("path").transition().delay(r.update).duration(e).attr("d",function(){var t=b.viz.cat_room.symbol_width-1,e=0,r=1,n=b.viz.y_scale.rangeBand()/2,o=b.viz.cat_room.symbol_width-1,a=b.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+n+", L "+o+","+a+" Z";return i}),A.selectAll(".row_dendro_group").data(z,function(t){return t.name}).transition().delay(r.update).duration(e).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})):(A.selectAll(".row_label_group").select("text").attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}),A.selectAll(".row_cat_group").select("path").attr("d",function(){var t=b.viz.cat_room.symbol_width-1,e=0,r=1,n=b.viz.y_scale.rangeBand()/2,o=b.viz.cat_room.symbol_width-1,a=b.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+n+", L "+o+","+a+" Z";return i}),A.selectAll(".row_dendro_group").data(z,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})),n.has(b.network_data.row_nodes[0],"value")&&g(t,A),p(b,A,r),h(b,A),v(b,A,r),m(b,A,r),l(b,A,r),c(b,A,r),u(b.viz,A,r),b.zoom_behavior.scale(1).translate([b.viz.clust.margin.left,b.viz.clust.margin.top])}},function(t,e,r){"use strict";var n=r(210),o=r(211),a=r(212),i=r(97),s=r(98),l=r(99),c=r(68);t.exports=function(t,e,r,u,d,f){var p=e.row_data,h=_.filter(p,function(t){return 0!=t.value}),v=d3.select(d).selectAll(".tile").data(h,function(t){return t.col_name});n(t,r,v,p,d);var m=v.on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).attr("fill-opacity",function(e){var r=t.matrix.opacity_scale(Math.abs(e.value));return r}):l.style("fill",function(e){return e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).attr("fill-opacity",function(e){var r=t.matrix.opacity_scale(Math.abs(e.value));return r}),l.each(function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99);t.exports=function(t,e,r,l,c,u,d){var f=_.filter(e,function(t){return 0!=t.value_up||0!=t.value_dn}),p=d3.select(r).selectAll(".tile_up").data(f,function(t){return t.col_name}),h=p.on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e){"use strict";t.exports=function(t,e,r){var n=t.network_data.row_nodes,o=t.network_data.col_nodes,a=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).exit();e.run_transition?a.transition().duration(r).style("opacity",0).remove():a.style("opacity",0).remove(),d3.selectAll(t.root+" .row_label_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_cat_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_dendro_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_text").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .horz_lines").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .vert_lines").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_cat_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_dendro_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove()}},function(t,e,r){"use strict";var n=r(215);t.exports=function(t,e,r,o){var a=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).enter().append("g").classed("row",!0).attr("transform",function(e){return"translate(0,"+t.viz.y_scale(e.row_index)+")"});a.each(function(a){n(t,a,e,r,o,this)})}},function(t,e,r){"use strict";var n=r(216),o=r(97),a=r(98),i=r(99);t.exports=function(t,e,r,s,l,c){var u=e.row_data,d=_.filter(u,function(t){return 0!==t.value}),f=d3.select(c).selectAll("rect").data(d,function(t){return t.col_name}).enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",t.viz.rect_height).style("fill",function(e){return e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r});var f=d3.select(r).selectAll(".tile_dn").data(u,function(t){return t.col_name}).enter().append("path").attr("class","tile_dn").attr("d",function(){return o(t)}).attr("transform",function(e){return a(t,e)}).style("fill",function(){return t.matrix.tile_colors[1]}).on("mouseover",function(e){d3.selectAll(t.root+" .row_label_group text").classed("active",function(t){return e.row_name===t.name}),d3.selectAll(t.root+" .col_label_text text").classed("active",function(t){return e.col_name===t.name}),t.matrix.show_tile_tooltips&&i.show(e)}).on("mouseout",function(){d3.selectAll(t.root+" text").classed("active",!1),t.matrix.show_tile_tooltips&&i.hide()});f.style("fill-opacity",0).transition().delay(s.enter).duration(l).style("fill-opacity",function(e){var r=0;return Math.abs(e.value_up)>0&&(r=t.matrix.opacity_scale(Math.abs(e.value_dn))),r}),c.each(function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e){"use strict";t.exports=function(t){d3.select(t.root+" .clust_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.clust.margin.top+")"),d3.select(t.root+" .col_label_outer_container").attr("transform","translate(0,"+t.viz.norm_labels.width.col+")"),d3.select(t.root+" .col_cat_outer_container").attr("transform",function(){var e=t.viz.norm_labels.width.col+2;return"translate(0,"+e+")"})}},function(t,e,r){"use strict";var n=(r(190),r(143)),o=r(142),a=r(219);t.exports=function(t){function e(e,r){var n=2-r,o=t.params.matrix.abs_max_val*n;t.params.matrix.opacity_scale.domain([0,o]),d3.selectAll(t.params.root+" .tile").style("fill-opacity",function(e){var r=t.params.matrix.opacity_scale(Math.abs(e.value));return r})}var r=t.params,i=d3.select(r.root+" .gene_search_box")[0][0],s=new Awesomplete(i,{minChars:1,maxItems:15}),l=t.params.network_data.row_nodes_names;s.list=l,d3.selectAll(".awesomplete ul").style("z-index",99),$(r.root+" .gene_search_box").keyup(function(e){if(13===e.keyCode){var n=$(r.root+" .gene_search_box").val();a(t,n,l)}}),$(r.root+" .submit_gene_button").off().click(function(){var e=$(r.root+" .gene_search_box").val();a(t,e,l)});var c;if(c=r.sim_mat?["both"]:["row","col"],_.each(c,function(e){$(r.root+" .toggle_"+e+"_order .btn").off().click(function(o){var a=$(o.target).attr("name").replace("_row","").replace("_col","");d3.selectAll(r.root+" .toggle_"+e+"_order .btn").classed("active",!1),d3.select(this).classed("active",!0),"both"!=e?n(t,a,e):(n(t,a,"row"),n(t,a,"col"))})}),o(t),d3.select(t.params.root+" .opacity_slider").select("#handle-one").empty()){var u=d3.slider().snap(!0).value(1).min(.1).max(1.9).step(.1).on("slide",function(t,r){e(t,r)});d3.select(t.params.root+" .opacity_slider").call(u)}}},function(t,e,r){"use strict";var n=r(144);t.exports=function(t,e,r){var o="name";if(r.indexOf(e)!==-1){d3.selectAll(t.params.root+" .row_label_group").select("rect").style("opacity",0);var a=_.indexOf(r,e),i=t.params.viz.y_scale(a),s=t.params.viz.clust.dim.height/2-i,l=t.params.viz.zoom_ratio.x;n(t,0,s,l),t.params.zoom_info.zoom_y=l,d3.selectAll(t.params.root+" .row_label_group").filter(function(t){return t[o]===e}).select("rect").style("opacity",1)}}},function(t,e){"use strict";t.exports=function(t){t.dendro_filter.row===!1&&"clust"===t.viz.inst_order.col&&d3.select(t.root+" .row_slider_group").style("opacity",1).style("pointer-events","all"), -d3.selectAll(t.root+" .toggle_row_order .btn").attr("disabled",null),t.dendro_filter.col===!1&&"clust"===t.viz.inst_order.row&&d3.select(t.root+" .col_slider_group").style("opacity",1).style("pointer-events","all"),d3.selectAll(t.root+" .toggle_col_order .btn").attr("disabled",null),d3.selectAll(t.root+" .gene_search_button .btn").attr("disabled",null),t.viz.run_trans=!1}},function(t,e){"use strict";t.exports=function(t,e){_.each(["row","col"],function(r){var n;n="row"===r?"col":"row",d3.selectAll(e.root+" .toggle_"+n+"_order .btn").filter(function(){return d3.select(this).attr("name")===t.inst_order[r]}).classed("active",!0)})}},function(t,e,r){"use strict";var n=r(223),o=r(2),a=r(68);t.exports=function(t,e){var r,i,s,l,c,u,d,f,p=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=0,v=0;_.each(e,function(e){l=e.name,p===!0&&(l.indexOf(" ")?l=l.split(" ")[0]:l.indexOf("_")&&(l=l.split("_")[0])),h=0,n(e),_.each(t,function(t){if(r=t.cat_title,i=t.cats,c="false",v=-1,f=0,_.each(i,function(t){u=t.cat_name,s=t.members,a.contains(s,l)&&(c=u,v=f),f+=1}),o.has(t,"pval")){var n=t.pval.toExponential();d=r+": "+c+"

Pval "+String(n)+"

"}else d=r.indexOf("cat-")===-1?r+": "+c:c;e["cat-"+String(h)]=d,e["cat_"+String(h)+"_index"]=v,h+=1})})}},function(t,e){"use strict";t.exports=function(t){var e=_.keys(t);_.each(e,function(e){e.indexOf("cat-")>-1&&delete t[e],e.indexOf("cat_")>-1&&delete t[e]})}},function(t,e,r){"use strict";var n=r(208),o=r(131),a=r(134),i=r(217);t.exports=function(t){d3.selectAll(t.params.root+" .row_cat_group").remove(),d3.selectAll(t.params.root+" .row_label_group").remove(),d3.selectAll(t.params.root+" .row").remove();var e=!0,r=!0,s=!0;a(t,e,r,s),o(t);var l=t.params.network_data.col_nodes;d3.selectAll(t.params.root+" .col_label_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_label_text").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_cat_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_dendro_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),i(t.params);var c={};c.enter=0,c.update=0,c.run_transition=!1;var u=0;n(t,u,c)}},function(t,e,r){"use strict";var n=r(226);t.exports=function(t,e,r){var o,a,i=t.params;d3.select(i.root+" .slider_"+e).attr("current_state",r),_.each(_.keys(i.viz.possible_filters),function(r){if(o=e.indexOf("row")>-1?"row":e.indexOf("col")>-1?"col":"neither",a=r.indexOf("row")>-1?"row":r.indexOf("col")>-1?"col":"neither",e!=r&&"neither"!=o&&o==a){var s=n(i,r);t.slider_functions[r].value(0),d3.select(i.root+" .title_"+r).text(s.text+s.state),d3.select(i.root+" .slider_"+r).attr("current_state",s.state)}});var s=n(i,e);d3.select(i.root+" .title_"+e).text(s.text+r+s.suffix)}},function(t,e,r){"use strict";var n=r(5);t.exports=function(t,e){var r={},o={},a={};return r.state=n(t.viz.filter_data,e),a.top=e.split("_")[0],a.node=e.split("_")[1],a.measure=e.split("_")[2],"row"===a.node?o.node="rows":o.node="columns","N"===a.top&&(r.suffix=""),"pct"===a.top&&(r.suffix="%"),"sum"==a.measure?o.measure="sum":"var"==a.measure&&(o.measure="variance"),"sum"===a.measure&&(r.text="Top "+o.node+" "+o.measure+": "),"var"===a.measure&&(r.text="Top "+o.node+" "+o.measure+": "),_.keys(t.viz.possible_filters).indexOf("enr_score_type")>-1&&"col"===a.node&&(r.text="Top Enriched Terms: ",r.suffix=""),r}},function(t,e,r){"use strict";function n(t,e,n,i){var s=r(45),l=n(r(43)),c=t.DenseMatrix,u=t.SparseMatrix,d=i("transpose",{Array:function(t){return d(l(t)).valueOf()},Matrix:function(t){var e,r=t.size();switch(r.length){case 1:e=t.clone();break;case 2:var n=r[0],o=r[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+a(r)+")");switch(t.storage()){case"dense":e=f(t,n,o);break;case"sparse":e=p(t,n,o)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+a(this._size)+")")}return e},any:function(t){return o(t)}}),f=function(t,e,r){for(var n,a=t._data,i=[],s=0;s2&&void 0!==arguments[2]?arguments[2]:4e3;e.indexOf("slider")<0?d3.select(t.root+" ."+e).style("background","#007f00").style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("background","#FFFFFF").style("box-shadow","none"):d3.select(t.root+" ."+e).style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("box-shadow","none")}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(144);t.exports=function(){function t(t){var e=t.params,s="Search for rows using\nthe search box";n(e,s,5e3);var l=2500;setTimeout(o,l,e,"gene_search_container"),setTimeout(r,l+1e3,e,"E"),setTimeout(r,l+1500,e,"EG"),setTimeout(r,l+2e3,e,"EGF"),setTimeout(r,l+2500,e,"EGFR"),setTimeout(i,5500,e),setTimeout(a,7500,t,0,0,1)}function e(){return 1e4}function r(t,e){$(t.root+" .gene_search_box").val(e),$(t.root+" .gene_search_box").autocomplete("search",e)}function i(t){$(t.root+" .submit_gene_button").click(),$(t.root+" .gene_search_box").autocomplete("search","")}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(203);t.exports=function(){function t(t){var e=t.params,a="Filter rows based on sum or\nvariance using the sliders";n(e,a,4e3);var i="N_row_sum";setTimeout(o,5e3,e,"slider_"+i,13e3),a="Filter: Top 20 rows by sum",setTimeout(n,5e3,e,a,4e3),setTimeout(r,5300,t,i,20,1),a="Filter: Top 10 rows by sum",setTimeout(n,1e4,e,a,4e3),setTimeout(r,10300,t,i,10,2),a="Filter: All rows",setTimeout(n,15e3,e,a,4e3),setTimeout(r,15300,t,i,"all",0)}function e(){return 19500}function r(t,e,r,n){var o=t.params,i={};i[e]=r,a(t,i),$(o.root+" .slider_"+e).slider("value",n);var s;s="N_row_sum"===e?"sum":"variance",d3.select(o.root+" .title_"+e).text("Top rows "+s+": "+r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(235);t.exports=function(){function t(t){var e=Number(d3.select(t.root+" .expand_button").attr("x").replace("px","")),a=Number(d3.select(t.root+" .expand_button").attr("y").replace("px","")),i=0,s=400;setTimeout(n,i,t,"single",e,a),setTimeout(r,s,t),setTimeout(o,1500,t)}function e(){return 3500}function r(t){$(t.root+" .expand_button").d3Click()}function o(t){a(t,"row","clust"),a(t,"col","clust")}function a(t,e,r){var n=d3.selectAll(".toggle_"+e+"_order .btn").filter(function(){return this.__data__==r})[0];$(n).click()}return jQuery.fn.d3Click=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(190);t.exports=function(){function t(t){var e="Identify row and column groups\nof varying sizes using the\nsliders and dendrogram";n(t,e,1e4),setTimeout(o,3e3,t,"slider_col",7e3),setTimeout(r,4e3,t,"row",3),setTimeout(r,5e3,t,"row",4),setTimeout(r,6e3,t,"row",5),setTimeout(r,7e3,t,"row",6),setTimeout(r,8e3,t,"row",7),setTimeout(r,9e3,t,"row",5)}function e(){return 11e3}function r(t,e,r){$(cgm.params.root+" .slider_col").slider("value",r/10),a(cgm,e,r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(235);t.exports=function(){function t(t){var e="Row and column categories\ncan be use to reorder\nby double-clicking";n(t,e,7e3);var a=d3.selectAll(t.root+" .col_cat_super").filter(function(){return"cat-1"===this.__data__})[0],i=d3.select(".col_cat_super").attr("transform"),s=Number(i.split("(")[1].split(",")[0].replace(")",""))+20,l=Number(i.split(",")[1].replace(")","")),c=4e3;setTimeout(o,c,t,"double",s,l);var u=c+300;setTimeout(r,u,t,a)}function e(){return 8e3}function r(t,e){$(e).d3DblClick()}return jQuery.fn.d3DblClick=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("dblclick",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(245);t.exports=function(){function t(t){var r="Clustergrammer is built with gene\nexpression data in mind and interfaces\nwith several Ma'ayan lab web tools",o="The example data being visualized is\ngene expression data obtained from the\nCancer Cell Line Encyclopedia",a="For more information please view\nthe help documentation";setTimeout(n,0,t,r,4500),setTimeout(n,4500,t,o,4500),setTimeout(n,9e3,t,a,4500),setTimeout(e,14e3,t)}function e(t){d3.select(t.root+" .play_button").classed("running_demo",!1),o(t,!0)}function r(){return 12e3}return{run:t,get_duration:r}}},function(t,e){"use strict";t.exports=function(t,e){e===!1?d3.select(t.root+" .play_button").transition().duration(500).style("opacity",0):(d3.select(t.root+" .play_button").transition().duration(500).style("opacity",1),$.unblockUI())}},function(t,e,r){"use strict";var n=r(232),o=r(235);t.exports=function(){function t(t){var e="View additional controls\nby clicking the menu button";n(t,e,4e3);var a=Number(d3.select(t.root+" .expand_button").attr("x").replace("px","")),i=Number(d3.select(t.root+" .expand_button").attr("y").replace("px","")),s=3e3,l=3400;setTimeout(o,s,t,"single",a,i),setTimeout(r,l,t)}function e(){return 5e3}function r(t){$(t.root+" .expand_button").d3Click()}return jQuery.fn.d3Click=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},jQuery.fn.d3DblClick=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("dblclick",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(248),o=r(249);t.exports=function(){var t=this,e=t.params;n(t);var r=30;o(e,r)}},function(t,e,r){"use strict";var n=r(177);t.exports=function(t){var e=t.params;if(d3.select(e.root+" .play_button").empty()){var r=d3.select(e.root+" .viz_svg").append("g").classed("play_button",!0).classed("running_demo",!1);n(e),r.append("circle").style("r",45).style("fill","white").style("stroke","black").style("stroke-width","3px").style("opacity",.5),r.append("path").attr("d",function(){var t=40,e=22,r=15;return"M-"+r+",-"+e+" l "+t+","+e+" l -"+t+","+e+" z "}).style("fill","black").style("opacity",.5),r.on("mouseover",function(){d3.select(this).select("path").style("fill","red").style("opacity",1),d3.select(this).select("circle").style("opacity",1)}).on("mouseout",function(){d3.select(this).select("path").style("fill","black").style("opacity",.5),d3.select(this).select("circle").style("opacity",.5)}).on("click",function(){t.play_demo()})}}},function(t,e){"use strict";t.exports=function(t,e){if(d3.select(t.root+" .demo_group").empty()){var r=d3.select(t.root+" .clust_container").attr("transform"),n=Number(r.split("(")[1].split(",")[0]),o=Number(r.split(",")[1].replace(")","")),a=d3.select(t.root+" .viz_svg").append("g").classed("demo_group",!0).attr("transform",function(){var t=n+20,e=o+40;return"translate("+t+","+e+")"});a.append("rect").classed("rect_1",!0),a.append("rect").classed("rect_2",!0),a.append("rect").classed("rect_3",!0);var i=1.3*e;a.append("text").attr("id","text_1").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),a.append("text").attr("id","text_2").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",function(){return"translate(0,"+String(i)+")"}),a.append("text").attr("id","text_3").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",function(){return"translate(0,"+String(2*i)+")"})}}},function(t,e,r){"use strict";var n=r(11),o=r(205);t.exports=function(t){var e=n(this.config,t);o(this,e)}},function(t,e,r){"use strict";var n=r(11),o=r(205);t.exports=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=r===!1?this:r;var a,i=e.params,s={};_.each(["row","col"],function(e){var r=i.inst_nodes[e+"_nodes"];if(_.has(t,e))if(t[e].length>0){var n=t[e];a=$.grep(r,function(t){return $.inArray(t.name,n)>-1})}else a=r;else a=r;s[e+"_nodes"]=a});var l=e.params.network_data.row_nodes,c=e.params.network_data.col_nodes,u=n(e.config,s);o(e,u),l.length>e.params.inst_nodes.row_nodes.length&&(e.params.inst_nodes.row_nodes=l),c.length>e.params.inst_nodes.col_nodes.length&&(e.params.inst_nodes.col_nodes=c)}},function(t,e,r){"use strict";var n=r(185),o=r(66),a=r(152),i=r(222);t.exports=function(t,e){null!=t.params.cat_update_callback&&t.params.cat_update_callback(this);var r=t.params.viz.cat_colors.col;i(e,t.params.network_data.row_nodes,!0),i(e,t.params.inst_nodes.row_nodes,!0),t.params=o(t.params,!1),n(t,!0),a(t),t.params.new_row_cats=e,t.params.viz.cat_colors.col=r}},function(t,e,r){"use strict";var n=r(185),o=r(66),a=r(152),i=r(222),s=r(254);t.exports=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this,r=s(e),l=e.params.viz.cat_colors.col;if(i(r,e.params.network_data.row_nodes),i(r,e.params.inst_nodes.row_nodes),e.params.new_row_cats=r,e.params.viz.cat_colors.col=l,t){var c=!0;e.params=o(e.params,c),n(e,!0),a(e)}}},function(t,e){"use strict";t.exports=function(t){function e(t,e,o){r={},r.cat_title=t,r.cats=[],n={},n.cat_name=e,n.members=[],n.members.push(o),r.cats.push(n),f.push(r)}var r,n,o,a,i,s,l,c,u=t.config.network_data.row_nodes,d=": ",f=[],p=u[0],h=_.keys(p),v={};_.each(h,function(t){t.indexOf("cat-")>=0&&(s=p[t],c=parseInt(t.split("cat-")[1],10),l=s.indexOf(d)>=0?s.split(d)[0]:t,v[c]=l)});var m,g=_.keys(v).sort();return _.each(g,function(t){m={},m.cat_title=v[t],m.cats=[],f.push(m)}),_.each(u,function(t){var r=_.keys(t);_.each(r,function(r){if(r.indexOf("cat-")>-1){i=t[r],c=parseInt(r.split("cat-")[1],10);var s=r;i=t[r];var l=t[r],u=t.name;l.indexOf(d)>-1?(s=l.split(d)[0],i=l.split(d)[1]):(s=r,i=l),0===f.length?e(s,i,u):(o=!1,_.each(f,function(t){s===t.cat_title&&(o=!0,a=!1,_.each(t.cats,function(t){i===t.cat_name&&(a=!0,t.members.push(u))}),a===!1&&(n={},n.cat_name=i,n.members=[],n.members.push(u),t.cats.push(n)))}))}})}),f}},function(t,e,r){"use strict";var n=r(256),o=r(257);t.exports=function(){var t=n(),e=this.params,r=o(e),a=new Blob([r],{type:"text/plain;charset=utf-8"});t(a,"clustergrammer.txt")}},function(t,e){"use strict";t.exports=function(){/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ +o++;else if(r<0)for(;e>n;)t(e,[o],this),e+=r,o++},a.prototype.map=function(t){var e=[];return this.forEach(function(r,n,o){e[n[0]]=t(r,n,o)}),e},a.prototype.toArray=function(){var t=[];return this.forEach(function(e,r){t[r[0]]=e}),t},a.prototype.valueOf=function(){return this.toArray()},a.prototype.format=function(t){var e=o.format(this.start,t);return 1!=this.step&&(e+=":"+o.format(this.step,t)),e+=":"+o.format(this.end,t)},a.prototype.toString=function(){return this.format()},a.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},a.fromJSON=function(t){return new a(t.start,t.end,t.step)},a}var o=r(18);e.name="Range",e.path="type",e.factory=n},function(t,e){"use strict";function r(t,e,r,n){return n("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e){var r=e.map(function(e){return t.isBigNumber(e)?e.toNumber():Array.isArray(e)||t.isMatrix(e)?e.map(function(e){return t.isBigNumber(e)?e.toNumber():e}):e}),n=new t.Index;return t.Index.apply(n,r),n}})}e.name="index",e.factory=r},function(t,e){"use strict";function r(t,e,r,n){var o=t.SparseMatrix,a=n("sparse",{"":function(){return new o([])},string:function(t){return new o([],t)},"Array | Matrix":function(t){return new o(t)},"Array | Matrix, string":function(t,e){return new o(t,e)}});return a.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},a}e.name="sparse",e.factory=r},function(t,e,r){"use strict";function n(t,e,n,i){function s(e,r){var n=l(e),o=n?new t.BigNumber(0):0;if(c(e),r){var i=u(r);return e.length>0?i.resize(e,o):i}var s=[];return e.length>0?a(s,e,o):s}function l(e){var r=!1;return e.forEach(function(e,n,o){t.isBigNumber(e)&&(r=!0,o[n]=e.toNumber())}),r}function c(t){t.forEach(function(t){if("number"!=typeof t||!o(t)||t<0)throw new Error("Parameters in function zeros must be positive integers")})}var u=n(r(43)),d=i("zeros",{"":function(){return"Array"===e.matrix?s([]):s([],"default")},"...number | BigNumber | string":function(t){var r=t[t.length-1];if("string"==typeof r){var n=t.pop();return s(t,n)}return"Array"===e.matrix?s(t):s(t,"default")},Array:s,Matrix:function(t){var e=t.storage();return s(t.valueOf(),e)},"Array | Matrix, string":function(t,e){return s(t.valueOf(),e)}});return d.toTex=void 0,d}var o=r(18).isInteger,a=r(28).resize;e.name="zeros",e.factory=n},function(t,e,r){"use strict";var n=r(2),o=r(5);t.exports=function(t,e,r){var a,i,s=_.keys(r);_.each(s,function(t){a=r[t],/[^a-z_]/i.test(a)&&(a=parseInt(a,10)),i=!1,_.each(e,function(e){n.has(e,t)&&(i=!0)}),i&&(e=_.filter(e,function(e){return e[t]==a}))});var l,c,u=[],d=!1;return _.each(e,function(e){l=!0,_.each(_.keys(t.viz.possible_filters),function(r){c=o(t.viz.filter_data,r),e[r]!=c&&(l=!1)}),l?d===!1&&(d=!0,u.push(e)):u.push(e)}),u}},function(t,e){"use strict";t.exports=function(t){var e={};return e.wrapper={},e.row_search={},e.row_search.box={},e.row_search.box.height=34,e.row_search.box.width=95,e.row_search.placeholder=t.row_search_placeholder,e.row_search.margin_left=7,e.slider={},e.slider.width=t.sidebar_width-30,e.slider.margin_left=15,e.key_cat={},e.key_cat.width=t.sidebar_width-15,e.key_cat.margin_left=5,e.key_cat.max_height=100,e.title=t.title,e.title_margin_left=7,e.about=t.about,e.width=t.sidebar_width,e.buttons={},e.buttons.width=t.sidebar_width-15,e.text={},e.icons=t.sidebar_icons,e.icon_margin_left=-5,e}},function(t,e){"use strict";t.exports=function(t,e){var r=_.keys(e)[0];return _.each(_.keys(t.viz.possible_filters),function(n){if(n!=r&&!d3.select(t.root+" .slider_"+n).empty()){var o=d3.select(t.root+" .slider_"+n).attr("current_state");e[n]=o}}),e}},function(t,e,r){"use strict";var n=r(67),o=r(69),a=r(71),i=r(72),s=r(73),l=r(74),c=r(75),u=r(76),d=r(81),f=r(83),p=r(2),h=r(4),v=r(84);t.exports=function(t){function e(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={};r.root=t.root,r.root_tips=t.root.replace("#",".")+"_d3-tip",r.viz_wrapper=t.root+" .viz_wrapper",r.do_zoom=t.do_zoom,r.background_color=t.background_color,r.super_border_color=t.super_border_color,r.outer_margins=t.outer_margins,r.is_expand=t.ini_expand,r.grey_border_width=t.grey_border_width,r.show_dendrogram=t.show_dendrogram,r.tile_click_hlight=t.tile_click_hlight,r.inst_order=t.inst_order,r.expand_button=t.expand_button,r.sim_mat=t.sim_mat,r.dendro_filter=t.dendro_filter,r.cat_filter=t.cat_filter,r.cat_value_colors=t.cat_value_colors,r.viz_svg=r.viz_wrapper+" .viz_svg",r.zoom_element=r.viz_wrapper+" .viz_svg",r.uni_duration=1e3,r.bottom_space=10,r.run_trans=!1,r.duration=1e3,r.resize=t.resize,p.has(t,"size")?r.fixed_size=t.size:r.fixed_size=!1,r.border_fraction=65,r.uni_margin=5,r.super_labels={},r.super_labels.margin={},r.super_labels.dim={},r.super_labels.margin.left=r.grey_border_width,r.super_labels.margin.top=r.grey_border_width,r.super_labels.dim.width=0,t.labels.super_labels&&(r.super_labels.dim.width=15*t.labels.super_label_scale),r.triangle_opacity=.6,r.norm_labels={},r.norm_labels.width={},r.dendro_room={},r.show_dendrogram?r.dendro_room.symbol_width=10:r.dendro_room.symbol_width=0,r.cat_colors=t.cat_colors,r=v(t,r,e),0==_.has(t,"group_level")&&(r.show_dendrogram&&(t.group_level={}),0==_.has(t,"group_level")&&(t.group_level={}),t.group_level.row=5,t.group_level.col=5),r.dendro_opacity=.35,r.spillover_col_slant=r.norm_labels.width.col;var n=h(t.network_data.views);return r.possible_filters=n.possible_filters,r.filter_data=n.filter_data,r.viz_nodes={},r.viz_nodes.row=t.network_data.row_nodes_names,r.viz_nodes.col=t.network_data.col_nodes_names,r.viz_nodes.curr_row=t.network_data.row_nodes_names,r.viz_nodes.curr_col=t.network_data.col_nodes_names,r.x_offset=0,r}var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.labels=n(t),t.viz=e(t,r),o(t),t=a(t),t.viz=i(t.viz),t.viz=s(t.viz),t.viz=l(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t=c(t),t=u(t),t=d(t),t=f(t)}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e={};return e.super_label_scale=t.super_label_scale,e.super_labels=t.super_labels,e.super_label_fs=13.8,e.super_labels&&(e.super={},e.super.row=t.super.row,e.super.col=t.super.col),e.show_label_tooltips=t.show_label_tooltips,e.row_max_char=n.max(t.network_data.row_nodes,function(t){return t.name.length}).name.length,e.col_max_char=n.max(t.network_data.col_nodes,function(t){return t.name.length}).name.length,e.max_allow_fs=t.max_allow_fs,e}},function(t,e,r){var n,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};(function(){function r(t){function e(e,r,n,o,a,i){for(;a>=0&&a0?0:s-1;return arguments.length<3&&(o=r[i?i[l]:l],l+=t),e(r,n,o,i,l,s)}}function i(t){return function(e,r,n){r=A(r,n);for(var o=O(e),a=t>0?0:o-1;a>=0&&a0?i=a>=0?a:Math.max(a+s,i):s=a>=0?Math.min(a+1,s):a+s+1;else if(r&&a&&s)return a=r(n,o),n[a]===o?a:-1;if(o!==o)return a=e(h.call(n,i,s),z.isNaN),a>=0?a+i:-1;for(a=t>0?i:s-1;a>=0&&a=0&&e<=S};z.each=z.forEach=function(t,e,r){e=k(e,r);var n,o;if(T(t))for(n=0,o=t.length;n=0},z.invoke=function(t,e){var r=h.call(arguments,2),n=z.isFunction(e);return z.map(t,function(t){var o=n?e:t[e];return null==o?o:o.apply(t,r)})},z.pluck=function(t,e){return z.map(t,z.property(e))},z.where=function(t,e){return z.filter(t,z.matcher(e))},z.findWhere=function(t,e){return z.find(t,z.matcher(e))},z.max=function(t,e,r){var n,o,a=-(1/0),i=-(1/0);if(null==e&&null!=t){t=T(t)?t:z.values(t);for(var s=0,l=t.length;sa&&(a=n)}else e=A(e,r),z.each(t,function(t,r,n){o=e(t,r,n),(o>i||o===-(1/0)&&a===-(1/0))&&(a=t,i=o)});return a},z.min=function(t,e,r){var n,o,a=1/0,i=1/0;if(null==e&&null!=t){t=T(t)?t:z.values(t);for(var s=0,l=t.length;sn||void 0===r)return 1;if(re?(i&&(clearTimeout(i),i=null),s=c,a=t.apply(n,o),i||(n=o=null)):i||r.trailing===!1||(i=setTimeout(l,u)),a}},z.debounce=function(t,e,r){var n,o,a,i,s,l=function l(){var c=z.now()-i;c=0?n=setTimeout(l,e-c):(n=null,r||(s=t.apply(a,o),n||(a=o=null)))};return function(){a=this,o=arguments,i=z.now();var c=r&&!n;return n||(n=setTimeout(l,e)),c&&(s=t.apply(a,o),a=o=null),s}},z.wrap=function(t,e){return z.partial(e,t)},z.negate=function(t){return function(){return!t.apply(this,arguments)}},z.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},z.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},z.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},z.once=z.partial(z.before,2);var I=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];z.keys=function(t){if(!z.isObject(t))return[];if(y)return y(t);var e=[];for(var r in t)z.has(t,r)&&e.push(r);return I&&l(t,e),e},z.allKeys=function(t){if(!z.isObject(t))return[];var e=[];for(var r in t)e.push(r);return I&&l(t,e),e},z.values=function(t){for(var e=z.keys(t),r=e.length,n=Array(r),o=0;o":">",'"':""","'":"'","`":"`"},D=z.invert(L),P=function(t){var e=function(e){return t[e]},r="(?:"+z.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(o,e):t}};z.escape=P(L),z.unescape=P(D),z.result=function(t,e,r){var n=null==t?void 0:t[e];return void 0===n&&(n=r),z.isFunction(n)?n.call(t):n};var U=0;z.uniqueId=function(t){var e=++U+"";return t?t+e:e},z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,$={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+$[t]};z.template=function(t,e,r){!e&&r&&(e=r),e=z.defaults({},e,z.templateSettings);var n=RegExp([(e.escape||q).source,(e.interpolate||q).source,(e.evaluate||q).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(n,function(e,r,n,i,s){return a+=t.slice(o,s).replace(H,W),o=s+e.length,r?a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),e}),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var i=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var s=function(t){return i.call(this,t,z)},l=e.variable||"obj";return s.source="function("+l+"){\n"+a+"}",s},z.chain=function(t){var e=z(t);return e._chain=!0,e};var Z=function(t,e){return t._chain?z(e).chain():e};z.mixin=function(t){z.each(z.functions(t),function(e){var r=z[e]=t[e];z.prototype[e]=function(){var t=[this._wrapped];return _.apply(t,arguments),Z(this,r.apply(z,t))}})},z.mixin(z),z.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=d[t];z.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],Z(this,r)}}),z.each(["concat","join","slice"],function(t){var e=d[t];z.prototype[t]=function(){return Z(this,e.apply(this._wrapped,arguments))}}),z.prototype.value=function(){return this._wrapped},z.prototype.valueOf=z.prototype.toJSON=z.prototype.value,z.prototype.toString=function(){return""+this._wrapped},n=[],o=function(){return z}.apply(e,n),!(void 0!==o&&(t.exports=o))}).call(void 0)},function(t,e,r){"use strict";var n=r(70);t.exports=function(t){d3.select(t.root+" .viz_wrapper").empty()&&(d3.select(t.root).append("div").classed("sidebar_wrapper",!0),d3.select(t.root).append("div").classed("viz_wrapper",!0));var e=n(t);d3.select(t.root+" .sidebar_wrapper").style("float","left").style("width",t.sidebar_width+"px").style("height",e.height+"px").style("overflow","hidden"),d3.select(t.viz.viz_wrapper).style("float","left").style("width",e.width+"px").style("height",e.height+"px")}},function(t,e){"use strict";t.exports=function(t){var e,r={},n=t.buffer_width,o=d3.select(t.root).style("width").replace("px",""),a=d3.select(t.root).style("height").replace("px","");return t.viz.is_expand===!1?(e=t.viz.outer_margins,r.width=o-t.sidebar_width-n):(e=t.viz.outer_margins,r.width=o-n),r.top=e.top,r.left=e.left,t.viz.resize?r.height=a:(t.viz.is_expand?r.width=t.viz.fixed_size.width:r.width=t.viz.fixed_size.width-t.sidebar_width,r.height=t.viz.fixed_size.height),r}},function(t,e){"use strict";t.exports=function(t){return t.viz.svg_dim={},t.viz.svg_dim.width=Number(d3.select(t.viz.viz_wrapper).style("width").replace("px","")),t.viz.svg_dim.height=Number(d3.select(t.viz.viz_wrapper).style("height").replace("px","")),t}},function(t,e){"use strict";t.exports=function(t){return t.norm_labels.margin={},t.norm_labels.margin.left=t.super_labels.margin.left+t.super_labels.dim.width,t.norm_labels.margin.top=t.super_labels.margin.top+t.super_labels.dim.width,t.label_background={},t.label_background.row=t.norm_labels.width.row+t.cat_room.row+t.uni_margin,t.label_background.col=t.norm_labels.width.col+t.cat_room.col+t.uni_margin,t}},function(t,e){"use strict";t.exports=function(t){t.clust={},t.clust.margin={},t.clust.margin.left=t.norm_labels.margin.left+t.norm_labels.width.row+t.cat_room.row+t.uni_margin,t.clust.margin.top=t.norm_labels.margin.top+t.norm_labels.width.col+t.cat_room.col+t.uni_margin;var e=t.svg_dim.width-t.clust.margin.left-t.spillover_col_slant,r=d3.scale.ordinal().rangeBands([0,e]).domain(_.range(t.num_col_nodes)),n=r.rangeBand()/2;if(n>t.norm_labels.width.col){var o=t.norm_labels.width.col/n;e*=o}return t.clust.dim={},t.clust.dim.width=e,t}},function(t,e){"use strict";t.exports=function(t){var e=t.svg_dim.height-t.clust.margin.top-t.dendro_room.col-t.bottom_space;return t.clust.dim.height=e,t}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e=Math.abs(n.max(t.network_data.col_nodes,function(t){return Math.abs(t.value)}).value);return t.labels.bar_scale_col=d3.scale.linear().domain([0,e]).range([0,.75*t.viz.norm_labels.width.col]),e=Math.abs(n.max(t.network_data.row_nodes,function(t){return Math.abs(t.value)}).value),t.labels.bar_scale_row=d3.scale.linear().domain([0,e]).range([0,t.viz.norm_labels.width.row]),t}},function(t,e,r){"use strict";var n=r(77),o=r(79);t.exports=function(t){t.matrix=n(t),t.viz.x_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]);var e;return _.each(["row","col"],function(r){e=t.viz.inst_order[r],"custom"===e&&(e="clust"),"row"===r?t.viz.x_scale.domain(t.matrix.orders[e+"_"+r]):t.viz.y_scale.domain(t.matrix.orders[e+"_"+r])}),t.viz.border_width={},t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,o(t),t}},function(t,e,r){"use strict";var n=r(2),o=r(78),a=r(68);t.exports=function(t){var e={},r=t.network_data;e.tile_colors=t.tile_colors,e.bar_colors=t.bar_colors,e.outline_colors=t.outline_colors,e.hlight_color=t.highlight_color,e.tile_title=t.tile_title,e.show_tile_tooltips=t.show_tile_tooltips,e.make_tile_tooltip=t.make_tile_tooltip,e.distance_metric="cosine",e.linkage_type="average",e.click_hlight_x=-666,e.click_hlight_y=-666,e.click_hlight_row=-666,e.click_hlight_col=-666,e.def_large_matrix=1e4,e.opacity_function=t.opacity_scale,e.orders={},_.each(["row","col"],function(o){var a;a="row"===o?"col":"row";var i=r[a+"_nodes"],s=i.length,l=n.pluck(i,"name"),c=l.sort(),u=_.map(c,function(t){return r[a+"_nodes_names"].indexOf(t)});e.orders["alpha_"+o]=u;var d=["clust","rank"];_.has(i[0],"rankvar")&&d.push("rankvar"),t.viz.all_cats[a].length>0&&_.each(t.viz.all_cats[a],function(t){t=t.replace("-","_"),d.push(t+"_index")}),_.each(d,function(t){var r=d3.range(s).sort(function(e,r){return i[r][t]-i[e][t]});e.orders[t+"_"+o]=r})}),n.has(r,"all_links")?e.max_link=a.max(r.all_links,function(t){return Math.abs(t.value)}).value:e.max_link=a.max(r.links,function(t){return Math.abs(t.value)}).value,e.abs_max_val=Math.abs(e.max_link)*t.clamp_opacity,0===t.input_domain?"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,e.abs_max_val]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,e.abs_max_val]).clamp(!0).range([0,1])):"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,t.input_domain]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,t.input_domain]).clamp(!0).range([0,1]));var i=n.has(r.links[0],"value_up"),s=n.has(r.links[0],"value_dn");return i||s?e.tile_type="updn":e.tile_type="simple",n.has(r.links[0],"highlight")?e.highlight=1:e.highlight=0,e.matrix=o(r),e.wait_tooltip=0,e}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t){var e,r,o=[];return r=!!n.has(t.links[0],"value_orig"),t.row_nodes.forEach(function(a,i){o[i]={},o[i].name=t.row_nodes[i].name,o[i].row_index=i,o[i].row_data=d3.range(t.col_nodes.length).map(function(o){return e=n.has(t.links[0],"value_up")||n.has(t.links[0],"value_dn")?{pos_x:o,pos_y:i,value:0,value_up:0,value_dn:0,highlight:0}:{pos_x:o,pos_y:i,value:0,highlight:0},r&&(e.value_orig=0),e})}),t.links.forEach(function(t){o[t.source].row_data[t.target].value=t.value,o[t.source].row_data[t.target].row_name=t.row_name,o[t.source].row_data[t.target].col_name=t.col_name,(n.has(t,"value_up")||n.has(t,"value_dn"))&&(o[t.source].row_data[t.target].value_up=t.value_up,o[t.source].row_data[t.target].value_dn=t.value_dn),r&&(o[t.source].row_data[t.target].value_orig=t.value_orig),t.highlight&&(o[t.source].row_data[t.target].highlight=t.highlight),t.info&&(o[t.source].row_data[t.target].info=t.info)}),o}},function(t,e,r){"use strict";var n=r(80);t.exports=function(t){var e=3,r=2,o=e/t.viz.rect_height,a=2;t.viz.ds_zt=a;var i=Math.floor(Math.log(o)/Math.log(a));if(t.viz.rect_height0){var s=2;t.viz.ds_opacity_scale=d3.scale.linear().domain([1,100]).range([1,s]).clamp(!0);var l;t.viz.ds_num_levels=i,t.viz.ds=[],t.matrix.ds_matrix=[];for(var c=t.viz.inst_order.row,u=$.extend(!0,{},t.matrix.matrix),d=0;dt.labels.max_allow_fs&&(t.labels.default_fs_row=t.labels.max_allow_fs),t.labels.default_fs_col>t.labels.max_allow_fs&&(t.labels.default_fs_col=t.labels.max_allow_fs), +t}},function(t,e,r){"use strict";var n=r(85),o=r(2),a=r(86),i=r(87);t.exports=function(t,e){var r,s,l,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=": ";e.show_categories={},e.all_cats={},e.cat_names={},e.cat_info={};var d={};d.row=null,d.col=null,e.cat_colors={},e.cat_colors.value_opacity=d;var f=0;return _.each(["row","col"],function(n){e.show_categories[n]=!1,e.all_cats[n]=[];var d=_.keys(t.network_data[n+"_nodes"][0]);d=d.sort(),_.each(d,function(t){t.indexOf("cat-")>=0&&(e.show_categories[n]=!0,e.all_cats[n].push(t))}),e.cat_info[n]=null,e.show_categories[n]&&(e.cat_colors[n]={},e.cat_info[n]={},e.cat_names[n]={},_.each(e.all_cats[n],function(c){var d=t.network_data[n+"_nodes"][0];"string"==typeof d[c]&&d[c].indexOf(u)>0?(r=d[c].split(u)[0],e.cat_names[n][c]=r):e.cat_names[n][c]=c;var p=o.pluck(t.network_data[n+"_nodes"],c),h=[];_.each(p,function(t){var e;e=t.indexOf(": ")>0?t.split(": ")[1]:t,h.push(e)});var v=_.uniq(p).sort();if(s=i(v),"cat_strings"===s.type){var m=_.countBy(h);s.cat_hist=m}else s.cat_hist=null;e.cat_info[n][c]=s,e.cat_colors[n][c]={},_.each(v,function(t,r){l=a.get_random_color(r+f),e.cat_colors[n][c][t]=l,"string"==typeof t&&(t.indexOf("Not ")>=0||t.indexOf(": false")>0)&&(e.cat_colors[n][c][t]="#eee"),f+=1})})),_.has(t.network_data,"cat_colors")&&c===!0&&(e.cat_colors[n]=t.network_data.cat_colors[n]),t.sim_mat&&(e.cat_colors.col=e.cat_colors.row)}),e.cat_colors=e.cat_colors,e.cat_colors.opacity=.6,e.cat_colors.active_opacity=.9,e=n(t,e)}},function(t,e){"use strict";t.exports=function(t,e){var r,n=d3.scale.linear().domain([5,15]).range([85,120]).clamp("true");return e.cat_room={},e.cat_room.symbol_width=12,e.cat_room.separation=3,_.each(["row","col"],function(o){e.norm_labels.width[o]=n(t.labels[o+"_max_char"])*t[o+"_label_scale"],e["num_"+o+"_nodes"]=t.network_data[o+"_nodes"].length,"row"===o?e.dendro_room[o]=e.dendro_room.symbol_width:e.dendro_room[o]=e.dendro_room.symbol_width+3*e.uni_margin;var a=e.all_cats[o].length;if(e.show_categories[o]){r=(a-1)*e.cat_room.separation;var i;i="row"===o?a+1:a,e.cat_room[o]=i*e.cat_room.symbol_width+r}else"row"==o?e.cat_room[o]=e.cat_room.symbol_width:e.cat_room[o]=0}),e}},function(t,e){"use strict";function r(){return"#EEE"}function n(t){return a[t%o()]}function o(){return a.length}var a;a=["#393b79","#aec7e8","#ff7f0e","#ffbb78","#98df8a","#bcbd22","#404040","#ff9896","#c5b0d5","#8c564b","#1f77b4","#5254a3","#FFDB58","#c49c94","#e377c2","#7f7f7f","#2ca02c","#9467bd","#dbdb8d","#17becf","#637939","#6b6ecf","#9c9ede","#d62728","#8ca252","#8c6d31","#bd9e39","#e7cb94","#843c39","#ad494a","#d6616b","#7b4173","#a55194","#ce6dbd","#de9ed6"],t.exports={get_default_color:r,get_random_color:n,get_num_colors:o}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e=t[0],r=!1,o=!1,a="cat_strings",i=NaN,s=[],l=null,c=": ";if("string"==typeof e&&e.indexOf(c)>-1&&(r=!0,e=e.split(c)[1]),0==isNaN(e)&&(o=!0),o&&(a="cat_values",_.each(t,function(t){r&&(t=t.split(c)[1]),isNaN(t)===!0?a="cat_strings":(t=parseFloat(t),s.push(t))})),"cat_values"===a){var u=n.max(s,function(t){return Math.abs(t)});i=Math.abs(u),l=d3.scale.linear().domain([0,i]).range([0,1])}var d={};return d.type=a,d.max_abs_val=i,d.cat_scale=l,d}},function(t,e){"use strict";t.exports=function(){var t={};return t.zoom_x=1,t.zoom_y=1,t.trans_x=0,t.trans_y=0,t}},function(t,e,r){"use strict";var n=r(90),o=r(101),a=r(131),i=r(139),s=r(140),l=r(151),c=r(161),u=r(180),d=r(185),f=r(146),p=r(186),h=r(187),v=r(188),m=r(228);t.exports=function(t){function e(){var t=r.viz.super_border_color;return(r.viz.is_expand||0==r.show_viz_border)&&(t="white"),t}var r=t.params;d3.select(r.viz.viz_wrapper+" svg").remove();var g=d3.select(r.viz.viz_wrapper).append("svg").attr("class","viz_svg").attr("id","svg_"+r.root.replace("#","")).attr("width",r.viz.svg_dim.width).attr("height",r.viz.svg_dim.height).attr("is_zoom",0).attr("stopped_zoom",1);g.append("rect").attr("class","super_background").style("width",r.viz.svg_dim.width).style("height",r.viz.svg_dim.height).style("fill","white"),n(r,g),o(t),r.viz.show_dendrogram&&(p(t),h(t),m(t)),a(t),r.viz.ds_level===-1&&_.each(["row","col"],function(t){var e=Number(d3.select("."+t+"_label_group").select("text").style("font-size").replace("px","")),n=8;e>n&&d3.selectAll(r.root+" ."+t+"_label_group").each(function(){f(r,this,t)})}),d(t),r.viz.show_categories.col&&u(t),s(t),r.labels.super_labels&&i(r),r.viz.show_dendrogram&&v(t),d3.select(r.viz.viz_svg).append("rect").classed("left_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.grey_border_width).attr("height",r.viz.svg_dim.height).attr("transform","translate(0,0)"),d3.select(r.viz.viz_svg).append("rect").classed("right_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.grey_border_width).attr("height",r.viz.svg_dim.height).attr("transform",function(){var t=r.viz.svg_dim.width-r.viz.grey_border_width;return"translate("+t+",0)"}),d3.select(r.viz.viz_svg).append("rect").classed("top_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.svg_dim.width).attr("height",r.viz.grey_border_width).attr("transform",function(){var t=0;return"translate("+t+",0)"}),d3.select(r.viz.viz_svg).append("rect").classed("bottom_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.svg_dim.width).attr("height",r.viz.grey_border_width).attr("transform",function(){var t=r.viz.svg_dim.height-r.viz.grey_border_width;return"translate(0,"+t+")"}),l(t),c(t),r.viz.do_zoom&&d3.select(r.viz.zoom_element).call(r.zoom_behavior),d3.select(r.viz.zoom_element).on("dblclick.zoom",null)}},function(t,e,r){"use strict";var n=r(2),o=r(91),a=r(92),i=r(93);t.exports=function(t,e){var r,s=t.network_data,l=[];r=e.append("g").attr("class","clust_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.clust.margin.top+")").append("g").attr("class","clust_group").classed("clust_group",!0),r.append("rect").classed("background",!0).classed("grey_background",!0).style("fill","#eee").style("opacity",.25).attr("width",t.viz.clust.dim.width).attr("height",t.viz.clust.dim.height),null===t.viz.ds?i(t,t.matrix.matrix,"all",t.viz.ds_level):i(t,t.matrix.ds_matrix[0],"all",t.viz.ds_level),"function"==typeof t.click_tile?d3.selectAll(t.root+" .tile").on("click",function(e){var r={};r.row=t.network_data.row_nodes[e.pos_y].name,r.col=t.network_data.col_nodes[e.pos_x].name,r.value=e.value,n.has(e,"value_up")&&(r.value_up=e.value_up),n.has(e,"value_dn")&&(r.value_dn=e.value_dn),n.has(e,"info")&&(r.info=e.info),t.click_tile(r),a(t,this)}):t.tile_click_hlight&&d3.selectAll(t.root+" .tile").on("click",function(){a(t,this)});var c={},u=0;return c.enter=0,o(t,c,u),{get_clust_group:function(){return r},get_matrix:function(){return l},get_nodes:function(t){return"row"===t?s.row_nodes:s.col_nodes}}}},function(t,e){"use strict";t.exports=function(t,e,r){}},function(t,e){"use strict";t.exports=function(t,e){d3.select(e).each(function(r){var n=r.pos_x,o=r.pos_y;if(d3.selectAll(t.root+" .click_hlight").remove(),n!=t.matrix.click_hlight_x||o!=t.matrix.click_hlight_y){t.matrix.click_hlight_x=n,t.matrix.click_hlight_y=o;var a=6,i=.85,s=a*t.viz.border_width.x,l=a*t.viz.border_width.y;d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("top_hlight",!0).attr("width",t.viz.x_scale.rangeBand()).attr("height",l).attr("fill",t.matrix.hlight_color).attr("transform",function(){return"translate("+t.viz.x_scale(n)+",0)"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("left_hlight",!0).attr("width",s).attr("height",t.viz.y_scale.rangeBand()-.99*l).attr("fill",t.matrix.hlight_color).attr("transform",function(){return"translate("+t.viz.x_scale(n)+","+.99*l+")"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("right_hlight",!0).attr("width",s).attr("height",t.viz.y_scale.rangeBand()-.99*l).attr("fill",t.matrix.hlight_color).attr("transform",function(){var e=t.viz.x_scale(n)+t.viz.x_scale.rangeBand()-s;return"translate("+e+","+.99*l+")"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("bottom_hlight",!0).attr("width",function(){return t.viz.x_scale.rangeBand()-1.98*s}).attr("height",l).attr("fill",t.matrix.hlight_color).attr("transform",function(){var e=t.viz.x_scale(n)+.99*s,r=t.viz.y_scale.rangeBand()-l;return"translate("+e+","+r+")"}).attr("opacity",i)}else t.matrix.click_hlight_x=-666,t.matrix.click_hlight_y=-666})}},function(t,e,r){"use strict";var n=r(94),o=r(100),a=r(68);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=t.viz.y_scale,l=!0,c="row";if(i>=0&&(s=t.viz.ds[i].y_scale,l=!1,c="ds"+String(i)+"_row"),l)var u=o().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip "+e+"_tile_tip";return r}).style("display","none").direction("nw").offset([0,0]).html(function(e){var r,n=String(e.value.toFixed(3));if(t.keep_orig){var o=String(e.value_orig.toFixed(3));r="

"+e.row_name+" and "+e.col_name+"

normalized value: "+n+"

original value: "+o+"
"}else r="

"+e.row_name+" and "+e.col_name+"

value: "+n+"
";return r});else u=null;var d=[];"all"===r?d=e:_.each(e,function(t){a.contains(r,t.name)&&d.push(t)}),d3.select(t.root+" .clust_group").selectAll(".row").data(d,function(t){return t.name}).enter().append("g").classed(c,!0).attr("transform",function(t){return"translate(0,"+s(t.row_index)+")"}).each(function(e){n(t,e,u,this,i)}),t.viz.ds_level===-1&&null!=u&&d3.selectAll(t.root+" .row").call(u)}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99);t.exports=function(t,e,r,l){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,u=e.row_data,d=!0,f=t.viz.rect_height;c>=0&&(f=t.viz.ds[c].rect_height);var p;p=!!_.has(t.network_data.links[0],"value_orig");var h;h=p===!1?_.filter(u,function(t){return 0!==t.value}):u;var v=d3.select(l).selectAll("rect").data(h,function(t){return t.col_name}).enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",f).style("fill",function(e){var r;return r="NaN"===e.value_orig?"#000000":e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).style("fill-opacity",function(e){var r;return r="NaN"===e.value_orig?.175:t.matrix.opacity_scale(Math.abs(e.value))}).attr("transform",function(e){return s(t,e)});if(d&&v.on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r}).on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&(r=t.matrix.opacity_scale(Math.abs(e.value_dn))),r}).on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}t.matrix.tile_title&&v.append("title").text(function(t){var e="value: "+t.value;return e})}},function(t,e){"use strict";t.exports=function(t){var e=0,r=t.viz.x_scale.rangeBand()-t.viz.border_width.x,n=0,o=t.viz.y_scale.rangeBand()-t.viz.border_width.y,a="M"+e+","+n+", L"+e+", "+o+", L"+r+",0 Z";return a}},function(t,e){"use strict";t.exports=function(t){var e=0,r=t.viz.x_scale.rangeBand()-t.viz.border_width.x,n=t.viz.y_scale.rangeBand()-t.viz.border_width.y,o=t.viz.y_scale.rangeBand()-t.viz.border_width.y,a="M"+e+", "+n+" , L"+r+", "+o+", L"+r+",0 Z";return a}},function(t,e){"use strict";t.exports=function(t,e,r,n){function o(){if(d3.select(e).classed("hovering")){var n=Number(d3.select(t.root+" .viz_svg").attr("is_zoom"));if(0===n&&t.matrix.show_tile_tooltips&&null!==r&&(d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","block"),r.show.apply(e,s),null!=t.tile_tip_callback)){var o=s[0];t.tile_tip_callback(o)}}}var a,i=n[0],s=[].slice.call(n),l=1e3;d3.select(e).classed("hovering",!0),_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight",function(t){var r,n=i[e+"_name"].replace(/_/g," ")===t.name;return r=n?"bold":"normal"})}),s.push(e),clearTimeout(a),a=setTimeout(o,l,e)}},function(t,e){"use strict";t.exports=function(t,e,r){d3.select(e).classed("hovering",!1),d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","none"),_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight","normal")}),null!=r&&r.hide()}},function(t,e){"use strict";t.exports=function(t,e){var r;r=e.pos_x in t.viz.x_scale.domain()?t.viz.x_scale(e.pos_x):0;var n=r+.5*t.viz.border_width.x,o=.5*t.viz.border_width.y;return"translate("+n+","+o+")"}},function(t,e){"use strict";t.exports=function(){function t(t){b=_(t),z=b.createSVGPoint(),document.body.appendChild(x)}function e(){return"n"}function r(){return[0,0]}function n(){return" "}function o(){var t=h();return{top:t.s.y,left:t.s.x}}function a(){var t=h();return{top:t.n.y-x.offsetHeight,left:t.n.x-x.offsetWidth/2}}function i(){var t=h();return{top:t.s.y,left:t.s.x-x.offsetWidth/2}}function s(){var t=h();return{top:t.e.y-x.offsetHeight/2,left:t.e.x}}function l(){var t=h();return{top:t.w.y-x.offsetHeight/2,left:t.w.x-x.offsetWidth}}function c(){var t=h();return{top:t.nw.y-x.offsetHeight,left:t.nw.x-x.offsetWidth}}function u(){var t=h();return{top:t.ne.y-x.offsetHeight,left:t.ne.x}}function d(){var t=h();return{top:t.sw.y,left:t.sw.x-x.offsetWidth}}function f(){var t=h();return{top:t.se.y,left:t.e.x}}function p(){var t=d3.select(document.createElement("div"));return t.style({position:"absolute",opacity:0,pointerEvents:"none",boxSizing:"border-box"}),t.node()}function _(t){return t=t.node(),"svg"==t.tagName.toLowerCase()?t:t.ownerSVGElement}function h(){var t=k||d3.event.target,e={},r=t.getScreenCTM(),n=t.getBBox(),o=n.width,a=n.height,i=n.x,s=n.y,l=document.documentElement.scrollTop||document.body.scrollTop,c=document.documentElement.scrollLeft||document.body.scrollLeft;return r.a=1,r.d=1,r.e=r.e+c,r.f=r.f+l,z.x=i,z.y=s,e.nw=z.matrixTransform(r),z.x=z.x+o,e.ne=z.matrixTransform(r),z.y=z.y+a,e.se=z.matrixTransform(r),z.x=z.x-o,e.sw=z.matrixTransform(r),z.y=z.y-a/2,e.w=z.matrixTransform(r),z.x=z.x+o,e.e=z.matrixTransform(r),z.x=z.x-o/2,z.y=z.y-a/2,e.n=z.matrixTransform(r),z.y=z.y+a,e.s=z.matrixTransform(r),e}function v(t){var e=d3.select(t).classed("hovering");e&&d3.selectAll(".d3-tip").transition().duration(250).style("opacity",0).style("display","none")}function m(t){var e={};return t&&"[object Function]"===e.toString.call(t)}var g=e,y=r,w=n,x=p(),b=null,z=null,k=null;t.show=function(){var e=Array.prototype.slice.call(arguments);e[e.length-1]instanceof SVGElement&&(k=e.pop());var r,n=w.apply(this,e),o=y.apply(this,e),a=g.apply(this,e),i=d3.select(x),s=0;for(i.html(n).style({opacity:1,"pointer-events":"all"}).style("z-index",99);s--;)i.classed(E[s],!1);if(r=A.get(a).apply(this),i.classed(a,!0).style({top:r.top+o[0]+"px",left:r.left+o[1]+"px"}),m(this)===!1){var l=d3.select(this).attr("class");l.indexOf("tile")>=0&&setTimeout(v,5e3,this)}return t},t.hide=function(){var e=d3.select(x);return e.style({opacity:0,"pointer-events":"none"}),t},t.attr=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(x).attr(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d3.select(x),r),t},t.style=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(x).style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d3.select(x),r),t},t.direction=function(e){return arguments.length?(g=null==e?e:d3.functor(e),t):g},t.offset=function(e){return arguments.length?(y=null==e?e:d3.functor(e),t):y},t.html=function(e){return arguments.length?(w=null==e?e:d3.functor(e),t):w};var A=d3.map({n:a,s:i,e:s,w:l,nw:c,ne:u,sw:d,se:f,south_custom:o}),E=A.keys();return t}},function(t,e,r){"use strict";var n=r(102);t.exports=function(t,e){var r,o=t.params;r=d3.select(o.viz.viz_svg+" .row_container").empty()?d3.select(o.viz.viz_svg).append("g").classed("row_container",!0).attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"):d3.select(o.viz.viz_svg).select(".row_container").attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"),d3.select(o.root+" .row_white_background").empty()&&r.append("rect").classed("row_white_background",!0).classed("white_bars",!0).attr("fill",o.viz.background_color).attr("width",o.viz.label_background.row).attr("height",30*o.viz.clust.dim.height+"px"),d3.select(o.root+" .row_label_container").empty()?r.append("g").classed("row_label_container",!0).attr("transform","translate("+o.viz.norm_labels.width.row+",0)").append("g").classed("row_label_zoom_container",!0):r.select(o.root+" .row_label_container").attr("transform","translate("+o.viz.norm_labels.width.row+",0)"),o.viz.ds_level===-1&&n(t,"all",e)}},function(t,e,r){"use strict";var n=r(2),o=r(103),a=r(104),i=r(130),s=r(68);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=t.params,c=[];"all"===e?c=l.network_data.row_nodes:_.each(l.network_data.row_nodes,function(t){s.contains(e,t.name)&&c.push(t)});var u=d3.select(l.root+" .row_label_zoom_container").selectAll("g").data(c,function(t){return t.name}).enter().append("g").classed("row_label_group",!0),d=l.network_data.row_nodes_names;u.attr("transform",function(t){var e=_.indexOf(d,t.name);return"translate(0,"+l.viz.y_scale(e)+")"}),u.on("dblclick",function(e){var r="__data__",n=this[r].name;a(t,this,n),l.tile_click_hlight&&o(this,e.ini)}),i(l),u.insert("rect").style("opacity",0),u.append("text").attr("y",.5*l.viz.rect_height+.35*l.labels.default_fs_row).attr("text-anchor","end").style("font-size",l.labels.default_fs_row+"px").text(function(t){return n.normal_name(t)}).attr("pointer-events","none").style("opacity",0).style("cursor","default").transition().delay(r).duration(r).style("opacity",1),u.each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",l.viz.y_scale.rangeBand()).style("fill",function(){var t="yellow";return t}).style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),n.has(l.network_data.row_nodes[0],"value")&&u.append("rect").classed("row_bars",!0).attr("width",function(t){var e=0;return e=l.labels.bar_scale_row(Math.abs(t.value))}).attr("x",function(t){var e=0;return e=-l.labels.bar_scale_row(Math.abs(t.value))}).attr("height",l.viz.y_scale.rangeBand()).attr("fill",function(t){return t.value>0?l.matrix.bar_colors[0]:l.matrix.bar_colors[1]}).attr("opacity",.4)}},function(t,e){"use strict";t.exports=function(t,e,r){if(r!=t.click_hlight_row){var n=6,o=.85,a=n*t.viz.border_width.x;d3.selectAll(t.root+" .click_hlight").remove(),d3.select(e).append("rect").classed("click_hlight",!0).classed("row_top_hlight",!0).attr("width",t.viz.svg_dim.width).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o),d3.select(e).append("rect").classed("click_hlight",!0).classed("row_bottom_hlight",!0).attr("width",t.viz.svg_dim.width).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=t.viz.y_scale.rangeBand()-a;return"translate(0,"+e+")"})}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_row=-666}},function(t,e,r){"use strict";var n=r(105),o=r(106),a=r(88),i=r(129),s=r(79);t.exports=function(t,e,r){var l=t.params,c=i(l);if(1===c.zoom_y&&1===c.zoom_x){l.viz.inst_order.row="custom",o(t,"col"),d3.selectAll(l.root+" .toggle_col_order .btn").classed("active",!1),l.viz.run_trans=!0;var u=$.extend(!0,{},l.matrix.matrix),d=l.network_data.row_nodes,f=l.network_data.col_nodes,p=[];d.forEach(function(t){p.push(t.name)}),r=_.indexOf(p,r),p=[],f.forEach(function(t,e){p.push(u[r].row_data[e].value)});var h=d3.range(p.length).sort(function(t,e){return p[e]-p[t]});l.viz.x_scale.domain(h),l.matrix.orders.custom_row=h;var v;v=l.network_data.links.length>l.matrix.def_large_matrix?d3.select(l.root+" .viz_svg"):d3.select(l.root+" .viz_svg").transition().duration(2500);var m=l.network_data.col_nodes_names;v.select(".col_zoom_container").selectAll(".col_label_text").attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate("+l.viz.x_scale(e)+")rotate(-90)"}),v.selectAll(".col_cat_group").attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate("+l.viz.x_scale(e)+",0)"}),l.viz.ds_level===-1&&(v.selectAll(".tile").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),v.selectAll(".tile_up").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),v.selectAll(".tile_dn").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"})),d3.selectAll(l.root+" .row_label_group").select("rect").style("opacity",0),d3.select(e).select("rect").style("opacity",1),n(l),l.network_data.links.forEach(function(t){t.x=l.viz.x_scale(t.target),t.y=l.viz.y_scale(t.source)}),l.zoom_info=a(),setTimeout(function(){l.viz.run_trans=!1},2500),l.viz.ds_num_levels>0&&l.viz.ds_level>=0&&s(l)}}},function(t,e){"use strict";t.exports=function(t){var e=6,r=e*t.viz.border_width.x,n=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.x_scale.rangeBand()).attr("height",n).transition().duration(2500).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+",0)"}),d3.select(t.root+" .left_hlight").attr("width",r).attr("height",t.viz.y_scale.rangeBand()-.99*n).transition().duration(2500).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*n+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.y_scale.rangeBand()-.99*n).transition().duration(2500).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.x_scale.rangeBand()-r;return"translate("+e+","+.99*n+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.x_scale.rangeBand()-1.98*r}).attr("height",n).transition().duration(2500).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,o=t.viz.y_scale.rangeBand()-n;return"translate("+e+","+o+")"})}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500,o=t.params;"row"===e&&"clust"===o.viz.inst_order.col&&setTimeout(n,r,t,"row",!0),"col"===e&&"clust"===o.viz.inst_order.row&&setTimeout(n,r,t,"col",!0),"clust"!=o.viz.inst_order.row&&o.viz.dendro_filter.col===!1&&(d3.selectAll(o.root+" .col_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null),d3.select(o.root+" .col_slider_group").style("opacity",0),d3.selectAll(o.root+" .col_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null)),"clust"!=o.viz.inst_order.col&&o.viz.dendro_filter.row===!1&&(d3.selectAll(o.root+" .row_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null).on("click",null),d3.select(o.root+" .row_slider_group").style("opacity",0),d3.selectAll(o.root+" .row_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null))}},function(t,e,r){"use strict";var n=r(108),o=r(109),a=r(110),i=r(100),s=r(112),l=r(115);t.exports=function(t,e){function r(t,r,n){if(d3.select(t).classed("hovering")){var o=u.viz.root_tips+"_"+e+"_dendro_tip";d3.select(o+" .cat_graph").empty()&&null!==u.viz.cat_info[e]&&l(u,e,r,f[n],o,!0),d3.selectAll(u.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",1)}}var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=t.params;"both"===e&&(e="row");var d;d="row"===e?"col":"row","clust"===u.viz.inst_order[d]&&d3.select(u.root+" ."+e+"_slider_group").style("opacity",1);var f;u.viz.show_dendrogram&&(f="row"===e?n(u):o(u),d3.select(t.params.root+" ."+e+"_dendro_crop_buttons").empty()===!1&&s(t,e));var p=u.viz.dendro_opacity,_=500;d3.selectAll(t.params.viz.root_tips+"_"+e+"_dendro_tip").remove();var h;d3.selectAll(u.root+" ."+e+"_dendro_group").empty()?h=!1:(h=!0,d3.selectAll(u.root+" ."+e+"_dendro_group").remove());var v=0,m=-5,g=i().attr("class",function(){var t=u.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_tip";return r}).direction("nw").offset([v,m]).style("display","none").style("opacity",0);g.html(function(){var t='
Click for cluster information
and additional options.';return t}),c&&(h=!1);var y,w,x,b,z,k,A=d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").data(f,function(t){return t.name}).enter().append("path").style("opacity",0).attr("class",e+"_dendro_group").style("fill","black");A.attr("d",function(t){"row"===e?(y=0,w=t.pos_top,x=30,b=t.pos_mid,z=0,k=t.pos_bot):(y=t.pos_top,w=0,x=t.pos_mid,b=30,z=t.pos_bot,k=0);var r="M"+y+","+w+", L"+x+", "+b+", L"+z+","+k+" Z";return r}),A.on("mouseover",function(n,o){d3.select(this).classed("hovering",!0),null!=t.params.dendro_callback&&t.params.dendro_callback(this),d3.select(u.viz.root_tips+"_"+e+"_dendro_tip").style("display","block"),a(u,this,n,e),g.show(n),d3.select(u.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",0),setTimeout(r,_,this,n,o)}).on("mouseout",function(){"clust"===u.viz.inst_order[d]&&d3.select(this).style("opacity",p),d3.selectAll(u.root+" .dendro_shadow").remove(),d3.select(this).classed("hovering",!1),g.hide(this)}).on("click",function(r,n){$(u.root+" .dendro_info").modal("toggle");var o=r.all_names.join(", ");d3.select(u.root+" .dendro_info input").attr("value",o);var a=u.root+" .dendro_info";d3.selectAll(".dendro_info .cluster_info_container .cat_graph").remove(),null!==u.viz.cat_info[e]&&l(u,e,r,f[n],a),null!=t.params.dendro_click_callback&&t.params.dendro_click_callback(this)}).call(g);var E;E="clust"===u.viz.inst_order[d]?p:0,h?d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").transition().delay(1e3).duration(1e3).style("opacity",E):d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").style("opacity",E)}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.row,n=t.network_data.row_nodes,o=t.network_data.row_nodes_names;_.each(n,function(n){var a=n.group[r],i=_.indexOf(o,n.name),s=t.viz.y_scale(i),l=s+t.viz.y_scale.rangeBand();_.has(e,a)===!1&&(e[a]={},e[a].name_top=n.name,e[a].name_bot=n.name,e[a].pos_top=s,e[a].pos_bot=l,e[a].pos_mid=(s+l)/2,e[a].name=a,e[a].all_names=[],e[a].inst_rc="row"),e[a].all_names.push(n.name),se[a].pos_bot&&(e[a].name_bot=n.name,e[a].pos_bot=l,e[a].pos_mid=(e[a].pos_top+l)/2)});var a=[];return _.each(e,function(t){a.push(t)}),a}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.col,n=t.network_data.col_nodes,o=t.network_data.col_nodes_names;_.each(n,function(n){var a=n.group[r],i=_.indexOf(o,n.name),s=t.viz.x_scale(i),l=s+t.viz.x_scale.rangeBand();_.has(e,a)===!1&&(e[a]={},e[a].name_top=n.name,e[a].name_bot=n.name,e[a].pos_top=s,e[a].pos_bot=l,e[a].pos_mid=(s+l)/2,e[a].name=a,e[a].all_names=[],e[a].inst_rc="col"),e[a].all_names.push(n.name),se[a].pos_bot&&(e[a].name_bot=n.name,e[a].pos_bot=l,e[a].pos_mid=(e[a].pos_top+l)/2)});var a=[];return _.each(e,function(t){a.push(t)}),a}},function(t,e,r){"use strict";var n=r(111);t.exports=function(t,e,r,o){function a(){d3.select(e).classed("hovering")&&t.is_slider_drag===!1&&(d3.select(e).style("opacity",.7),d3.select(t.viz.viz_svg).classed("running_update")===!1&&i())}function i(){"row"===o?"clust"===t.viz.inst_order.col&&n(t,e,o,r):"col"===o?"clust"===t.viz.inst_order.row&&n(t,e,o,r):"both"===o&&("clust"===t.viz.inst_order.col&&n(t,e,"row",r),"clust"===t.viz.inst_order.row&&n(t,e,"col",r))}d3.selectAll(t.root+" ."+o+"_dendro_crop_buttons")[0].length>1?setTimeout(a,500):d3.selectAll(t.root+" .dendro_shadow").remove()}},function(t,e){"use strict";t.exports=function(t,e,r,n){var o,a=.2;d3.selectAll(t.root+" .dendro_shadow").remove(),"row"==r?(d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",n.pos_top+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.height-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",o+"px").attr("transform","translate(0,"+n.pos_bot+")").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a)):"col"===r&&(d3.select(t.root+" .clust_group").append("rect").attr("width",n.pos_top+"px").attr("height",t.viz.clust.dim.height+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.width-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",o+"px").attr("height",t.viz.clust.dim.height+"px").attr("transform","translate("+n.pos_bot+",0)").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a))}},function(t,e,r){"use strict";var n=r(108),o=r(109),a=r(100),i=r(110),s=r(113),l=r(114);t.exports=function(t,e){function r(t){d3.select(t).classed("hovering")&&d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_crop_tip").style("opacity",1).style("display","block")}var c,u,d=t.params,f=.6*d.viz.dendro_opacity;"row"===e?(c=n(d),u="col"):(c=o(d),u="row");var p=5,_=-5,h=a().attr("class",function(){var t=d.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_crop_tip";return r}).direction("nw").style("display","none").offset([p,_]),v=500;d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_crop_tip").remove(),d3.selectAll(d.root+" ."+e+"_dendro_crop_buttons").remove();var m,g,y,w,x,b,z,k,A,E,N=45,M=.25,S=e+"_dendro_crop_buttons";d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter")===!1?(m=d3.select(d.root+" ."+e+"_dendro_icons_group").selectAll("path").data(c,function(t){return t.name}).enter().append("path").classed(S,!0).attr("d",function(t){k=10,A=10;var r=t.pos_bot-t.pos_top;"row"===e?(r5&&void 0!==arguments[5]&&arguments[5];"both"===e&&(e="row");var s=n(t,r,e);if(s.length>0){var l=d3.select(a+" .cluster_info_container"),c=": ",u="

",d=370,f=23,p=20,h=25,v=180,m=27,g=177,y=4,w=5,x=150,b=6,z=!1;null!=s[0].bar_data[0][w]&&(d+=100,g=g+x-47,z=!0);var k=o.all_names.length,A=y;if(z){A=w;var E=s[0].bar_data;k=0,_.each(E,function(t){k+=t[w]})}var N=3,M=25,S=20;_.each(s.slice(0,N),function(t){var e=t.bar_data.length;e>M&&(e=M),S+=m*(e+1)}),i&&l.append("text").text("Cluster Information");var O=l.append("div").style("margin-top","5px").classed("cat_graph",!0).append("svg").style("height",S+"px").style("width",d+"px");O.append("rect").classed("cat_background",!0).attr("height",S+"px").attr("width",d+"px").attr("fill","white").attr("opacity",1);var T=m;if(s=s.slice(0,N),_.each(s,function(e){var r=e.bar_data[0][A],n=d3.scale.linear().domain([0,1e5]).range([20,30]);e.bar_data=e.bar_data.slice(0,M),l.style("margin-bottom","5px");var o=O.append("g").classed("cat_graph_group",!0).attr("transform","translate(10, "+T+")");T+=m*(e.bar_data.length+1);var a=e.type_name;a.length>=h&&(a=a.slice(0,h)+".."),o.append("text").classed("cat_graph_title",!0).text(a).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",800);var i=n(r);o.append("text").text("Count").attr("transform",function(){var t=v+i,e="translate("+t+", 0)";return e}),o.append("text").text("Pct").attr("transform",function(){var t=v+i+60,e="translate("+t+", 0)";return e}),o.append("text").text("P-val").attr("transform",function(){var t=v+i+115,e="translate("+t+", 0)";return e}),z&&o.append("text").text("Clusters").attr("transform",function(){var t=v+x,e="translate("+t+", 0)";return e});var s=4;o.append("line").attr("x1",0).attr("x2",v).attr("y1",s).attr("y2",s).attr("stroke","blue").attr("stroke-width",1).attr("opacity",1);var d=o.append("g").classed("cat_bar_container",!0).attr("transform","translate(0, 10)"),_=d.selectAll("g").data(e.bar_data).enter().append("g").attr("transform",function(t,e){var r=e*f;return"translate(0,"+r+")"}),g=d3.scale.linear().domain([0,r]).range([0,v]);_.append("rect").attr("height",p+"px").attr("width",function(t){var e=g(t[A]);return e+"px"}).attr("fill",function(t){return t[3]}).attr("opacity",t.viz.cat_colors.opacity).attr("stroke","grey").attr("stroke-width","0.5px"),_.append("text").classed("bar_labels",!0).text(function(t){var e=t[1];return e.indexOf(c)>0&&(e=e.split(c)[1]),e.indexOf(u)>0&&(e=e.split(u)[0]),e.length>=h&&(e=e.slice(0,h)+".."),e}).attr("transform",function(){return"translate(5, "+.75*p+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","right");var w=35;_.append("text").classed("count_labels",!0).text(function(t){var e=t[A];return e=e.toLocaleString(),String(e)}).attr("transform",function(){var t=v+i+w,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),_.append("text").classed("count_labels",!0).text(function(t){var e=t[A]/k*100;return e=Math.round(10*e)/10,e=e.toLocaleString(),String(e)}).attr("transform",function(){var t=v+i+w+47,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),_.append("text").classed("count_labels",!0).text(function(t){var e=t[b];return e<.001?(e=parseFloat(e.toPrecision(3)),e=e.toExponential()):e=parseFloat(e.toPrecision(2)),e}).attr("transform",function(){var t=v+i+w+112,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),z&&_.append("text").classed("count_labels",!0).text(function(t){return String(t[y].toLocaleString())}).attr("transform",function(){var t=v+w+x+20,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end")}),i){var C=d3.select(a),B=C.style("top").split(".px")[0],F=C.style("left").split(".px")[0],I=0,j=0;"row"===e?(I=0,j=g):(I=S+32,j=30),C.style("top",function(){var t=String(parseInt(B,10)-I)+"px";return t}).style("left",function(){var t=String(parseInt(F,10)-j)+"px";return t})}}}},function(t,e,r){"use strict";var n=r(117);t.exports=function(t,e,r){"both"===r&&(r="row");var o,a=e.all_names,i=[],s=t.network_data[r+"_nodes"],l=null,c=!1;_.each(s,function(t){o=t.name,a.indexOf(o)>=0&&i.push(t)});var u=[];if(null!==t.viz.cat_info[r]){for(var d,f,p,h=t.viz.cat_info[r],v=_.keys(h),m=[],g=[],y=0;y0){var E,N=a.length;_.each(m,function(e){if(f=e.split("-")[1],d=g[f],A)if(e.indexOf("-")>=0){var o=parseInt(e.split("-")[1],z)+1;d="Category "+String(o)}else d="Category";x[d]={},_.each(i,function(t){E=t[e],E.indexOf(": ")>=0&&(E=E.split(": ")[1]),E in x[d]?(x[d][E].num_nodes=x[d][E].num_nodes+1,null!=l&&(x[d][E].num_nodes_ds=x[d][E].num_nodes_ds+parseInt(t[l].split(": ")[1],z))):(x[d][E]={},x[d][E].num_nodes=1,null!=l&&(x[d][E].num_nodes_ds=parseInt(t[l].split(": ")[1],z)))}),b={},b.type_name=d,b.num_in_clust=N,w=[];var a,s,c=x[d];for(var p in c){var h=t.viz.cat_info[r][e].cat_hist[p],v=t.network_data[r+"_nodes"].length,m=h/v;s=A?p:d+": "+p;var y=c[p].num_nodes,M=y,S=n(M,N,m);if(_.has(c[p],"num_nodes_ds"))var O=c[p].num_nodes_ds;else O=null;a=t.viz.cat_colors[r][e][s],w.push([e,s,c[p],a,y,O,S])}w.sort(function(t,e){return e[k]-t[k]}),b.bar_data=w,u.push(b)})}}return u}},function(t,e,r){"use strict";var n=r(118),o=r(12),a=o.create();a.import(r(119)),t.exports=function(t,e,r){function o(t,e,r){var n=c(e)/(c(t)*c(e-t));return r=n*(Math.pow(r,t)*Math.pow(1-r,e-t))}function i(t,e,r){for(var n,a,i=0,s=t;s1;)a=a.times(i),i--;return new t.BigNumber(a.toPrecision(t.BigNumber.precision))}var u=n(r(122)),d=n(r(125)),f=l("gamma",{number:function(t){var e,r;if(a(t)){if(t<=0)return isFinite(t)?1/0:NaN;if(t>171)return 1/0;for(var n=t-2,o=t-1;n>1;)o*=n,n--;return 0==o&&(o=1),o}if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*f(1-t));if(t>=171.35)return 1/0;if(t>85){var l=t*t,c=l*t,u=c*t,d=u*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*l)-139/(51840*c)-571/(2488320*u)+163879/(209018880*d)+5246819/(75246796800*d*t))}--t,r=s[0];for(var p=1;pN)for(var S=0,O=0;O1&&n===-(1/0)?0:e.predictable&&(r<-1&&n===1/0||r>-1&&r<0&&n===-(1/0))?NaN:o(n)||r>=0||e.predictable?Math.pow(r,n):new t.Complex(r,0).pow(n,0)}function l(t,e){if(!o(e)||e<0)throw new TypeError("For A^b, b must be a positive integer (value is "+e+")");var r=a(t);if(2!=r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!=r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");for(var n=d(r[0]).valueOf(),i=t;e>=1;)1==(1&e)&&(n=f(i,n)),e>>=1,i=f(i,i);return n}function c(t,e){return p(l(t.valueOf(),e))}var u=r(45),d=n(r(126)),f=n(r(122)),p=n(r(43)),_=n(r(127)),h=n(r(128)),v=i("pow",{"number, number":s,"Complex, Complex":function(t,e){return t.pow(e)},"BigNumber, BigNumber":function(r,n){return n.isInteger()||r>=0||e.predictable?r.pow(n):new t.Complex(r.toNumber(),0).pow(n.toNumber(),0)},"Fraction, Fraction":function(t,r){if(1!==r.d){if(e.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return s(t.valueOf(),r.valueOf())}return t.pow(r)},"Array, number":l,"Array, BigNumber":function(t,e){return l(t,e.toNumber())},"Matrix, number":c,"Matrix, BigNumber":function(t,e){return c(t,e.toNumber())},"Unit, number":function(t,e){return t.pow(e)}});return v.toTex={2:"\\left(${args[0]}\\right)"+u.operators.pow+"{${args[1]}}"},v}var o=r(18).isInteger,a=r(28).size;e.name="pow",e.factory=n},function(t,e,r){"use strict";function n(t,e,n,i){function s(t,e){switch(t.length){case 0:return e?c(e):[];case 1:return l(t[0],t[0],e);case 2:return l(t[0],t[1],e);default:throw new Error("Vector containing two values expected")}}function l(e,r,n){var i=t.isBigNumber(e)||t.isBigNumber(r)?t.BigNumber:null;if(t.isBigNumber(e)&&(e=e.toNumber()),t.isBigNumber(r)&&(r=r.toNumber()),!a(e)||e<1)throw new Error("Parameters in function eye must be positive integers");if(!a(r)||r<1)throw new Error("Parameters in function eye must be positive integers");var s=i?new t.BigNumber(1):1,l=i?new i(0):0,c=[e,r];if(n){var u=t.Matrix.storage(n);return u.diagonal(c,s,0,l)}for(var d=o.resize([],c,l),f=e0?(e.zoom_x=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[0]),e.zoom_y=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[1])):(e.zoom_x=1,e.zoom_y=1),e}},function(t,e,r){"use strict";var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_row_tip").remove();var e=t.viz.root_tips.replace(".",""),r=n().attr("class",function(){var t=e+" d3-tip "+e+"_row_tip";return t}).direction("e").offset([0,10]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return""+e+""});d3.select(t.viz.viz_wrapper).select(t.root+" .row_container").call(r),d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",function(e){d3.select(t.viz.root_tips+"_row_tip").classed(e.name,!0),d3.selectAll(t.viz.root_tips+"_row_tip").style("display","block"),d3.select(this).select("text").classed("active",!0),r.show(e),null!=t.row_tip_callback&&t.row_tip_callback(t.viz.root_tips,e)}).on("mouseout",function(e){d3.selectAll(t.viz.root_tips+"_row_tip").style("display","none").classed(e.name,!1),d3.select(this).select("text").classed("active",!1),r.hide(e)})}else d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",function(){d3.select(this).select("text").classed("active",!0)}).on("mouseout",function(){d3.select(this).select("text").classed("active",!1)})}},function(t,e,r){"use strict";var n=r(2),o=r(132),a=r(133),i=r(104),s=r(137),l=r(138); +t.exports=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=t.params,u=c.network_data.col_nodes,d=c.viz.x_scale.rangeBand()/2+c.viz.border_width.x;d3.select(c.root+" .col_container").empty()?(e=d3.select(c.viz.viz_svg).append("g").attr("class","col_container").attr("transform","translate("+c.viz.clust.margin.left+","+c.viz.norm_labels.margin.top+")"),e.append("rect").attr("fill",c.viz.background_color).attr("width",30*c.viz.clust.dim.width+"px").attr("height",c.viz.label_background.col).attr("class","white_bars"),e.append("g").attr("class","col_label_outer_container").attr("transform","translate(0,"+c.viz.norm_labels.width.col+")").append("g").attr("class","col_zoom_container")):(e=d3.select(c.root+" .col_container").attr("transform","translate("+c.viz.clust.margin.left+","+c.viz.norm_labels.margin.top+")"),e.select(".white_bars").attr("fill",c.viz.background_color).attr("width",30*c.viz.clust.dim.width+"px").attr("height",c.viz.label_background.col),e.select(c.root+" .col_label_outer_container"));var f=d3.select(c.root+" .col_zoom_container").selectAll(".col_label_text").data(u,function(t){return t.name}).enter().append("g").attr("class","col_label_text").attr("transform",function(t){var e=t.col_index;return"translate("+c.viz.x_scale(e)+", 0) rotate(-90)"}),p=f.append("g").attr("class","col_label_group").attr("transform","translate("+c.viz.x_scale.rangeBand()/2+","+d+") rotate(45)").on("mouseover",function(){d3.select(this).select("text").classed("active",!0)}).on("mouseout",function(){d3.select(this).select("text").classed("active",!1)});n.has(c.network_data.col_nodes[0],"value")&&p.append("rect").attr("class","col_bars").attr("width",function(t){var e=0;return t.value>0&&(e=c.labels.bar_scale_col(t.value)),e}).attr("height",.66*c.viz.x_scale.rangeBand()).style("fill",function(t){return t.value>0?c.matrix.bar_colors[0]:c.matrix.bar_colors[1]}).attr("opacity",.6),p.append("text").attr("x",0).attr("y",.64*c.viz.x_scale.rangeBand()).attr("dx",c.viz.border_width.x).attr("text-anchor","start").attr("full_name",function(t){return t.name}).style("font-size",c.labels.default_fs_col+"px").style("cursor","default").text(function(t){return n.normal_name(t)}).style("opacity",0).transition().delay(r).duration(r).style("opacity",1),s(c),p.append("path").style("stroke-width",0).attr("d",function(){return l(c)}).attr("fill","#eee").style("opacity",0).transition().delay(r).duration(r).style("opacity",c.viz.triangle_opacity),d3.selectAll(c.root+" .col_label_text").on("click",function(t){"function"==typeof c.click_label?(c.click_label(t.name,"col"),o(c,this,t.ini)):c.tile_click_hlight&&o(c,this,t.ini)}).on("dblclick",function(e){var r="__data__",n=this[r].name;if(c.sim_mat){a(t,this,n);var s=d3.selectAll(c.root+" .row_label_group").filter(function(t){return t.name==n})[0][0];i(t,s,n)}else a(t,this,n);c.tile_click_hlight&&o(c,this,e.ini)})}},function(t,e){"use strict";t.exports=function(t,e,r){if(r!=t.click_hlight_col){t.click_hlight_col=r;var n=6,o=.85,a=n*t.viz.border_width.x;d3.selectAll(t.root+" .click_hlight").remove(),d3.select(e).append("rect").classed("click_hlight",!0).classed("col_top_hlight",!0).attr("width",t.viz.clust.dim.height).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=0,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"}),d3.select(e).append("rect").classed("click_hlight",!0).classed("col_bottom_hlight",!0).attr("width",t.viz.clust.dim.height).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=t.viz.x_scale.rangeBand()-a,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"})}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_col=-666}},function(t,e,r){"use strict";var n=r(105),o=r(106),a=r(134),i=r(88),s=r(129),l=r(79);t.exports=function(t,e,r){var c=t.params,u=s(c);if(1===u.zoom_y&&1===u.zoom_x){c.viz.inst_order.col="custom",o(t,"col"),d3.selectAll(c.root+" .toggle_row_order .btn").classed("active",!1),c.viz.run_trans=!0;var d=$.extend(!0,{},c.matrix.matrix),f=c.network_data.row_nodes,p=c.network_data.col_nodes,h=[];p.forEach(function(t){h.push(t.name)});var v=_.indexOf(h,r);h=[],f.forEach(function(t,e){h.push(d[e].row_data[v].value)});var m=d3.range(h.length).sort(function(t,e){return h[e]-h[t]});c.viz.y_scale.domain(m),c.matrix.orders.custom_col=m;var g,y=c.network_data.row_nodes_names;if(g=c.network_data.links.length>c.matrix.def_large_matrix?d3.select(c.root+" .viz_svg"):d3.select(c.root+" .viz_svg").transition().duration(2500),g.selectAll(".row_cat_group").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),g.select(".row_label_zoom_container").selectAll(".row_label_group").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),c.viz.ds_level===-1&&g.selectAll(".row").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),d3.selectAll(c.root+" .col_label_text").select(".highlight_rect").style("opacity",0),d3.select(e).select(".highlight_rect").style("opacity",1),c.network_data.links.forEach(function(t){t.x=c.viz.x_scale(t.target),t.y=c.viz.y_scale(t.source)}),n(c),c.zoom_info=i(),setTimeout(function(){c.viz.run_trans=!1},2500),c.viz.ds_num_levels>0&&c.viz.ds_level>=0){l(c);var w=!0,x=!0,b=!0;a(t,w,x,b)}}}},function(t,e,r){"use strict";var n=r(135),o=r(93),a=r(102),i=r(136),s=r(68);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=t.params,u=c.zoom_info,d=c.viz.ds_level,f=c.viz.ds_level;null===c.viz.ds?d=-1:(d=Math.floor(Math.log(u.zoom_y)/Math.log(c.viz.ds_zt)),d>c.viz.ds_num_levels-1&&(d=-1));var p=!1;f==-1?d>=0&&(p=!0):d=0&&(d3.selectAll(c.root+" .row").remove(),d3.selectAll(c.viz.root_tips+"_tile_tip").remove(),d3.selectAll(c.viz.root_tips+"_row_tip").remove());var w;if(h<0?(w=c.matrix.matrix,i(c)):(w=c.matrix.ds_matrix[h],d3.selectAll(c.root+" .row_cat_group path").remove()),r===!0&&d3.selectAll(c.root+" .row_cat_group path").remove(),e===!0&&(h>=0?d3.selectAll(c.root+" .ds"+String(h)+"_row").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}):d3.selectAll(c.root+" .row").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}),d3.selectAll(c.root+" .row_label_group").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}),h!=f&&(g=c.viz.viz_nodes.row,d3.selectAll(c.root+" .ds"+String(f)+"_row").remove())),(g.length>=1||"all"===g)&&o(c,w,g,h),h===-1&&(r===!1||e)){var x=[];d3.selectAll(c.root+" .row_label_group").each(function(t){x.push(t.name)});var b=_.difference(c.viz.viz_nodes.row,x),z=1;b.length>z&&a(t,b)}}},function(t,e){"use strict";t.exports=function(t,e){var r,n=[],o=[],a=t.viz.y_scale,i=t.viz.ds_level,s=t.network_data.row_nodes_names,l=".row";i>=0&&(a=t.viz.ds[i].y_scale,s=d3.range(t.matrix.ds_matrix[i].length).map(String),l=".ds"+String(i)+"_row");for(var c=0;ce.min_y&&n.push(s[c]);d3.selectAll(t.root+" "+l).each(function(t){o.push(t.name)}),t.viz.viz_nodes.row=n,t.viz.viz_nodes.curr_row=o}},function(t,e){"use strict";t.exports=function(t){d3.select(t.root+" .row_cat_group path").empty()===!0&&d3.selectAll(t.root+" .row_cat_group").append("path").attr("d",function(){var e=t.viz.cat_room.symbol_width-1,r=0,n=1,o=t.viz.y_scale.rangeBand()/2,a=t.viz.cat_room.symbol_width-1,i=t.viz.y_scale.rangeBand(),s="M "+e+","+r+" L "+n+","+o+", L "+a+","+i+" Z";return s}).attr("fill","#eee").style("opacity",t.viz.triangle_opacity)}},function(t,e,r){"use strict";var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_col_tip").remove();var e=n().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip "+e+"_col_tip";return r}).direction("w").offset([20,0]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return""+e+""});d3.select(t.viz.viz_wrapper).select("svg").select(t.root+" .col_zoom_container").selectAll(".col_label_group").select("text").call(e),d3.select(t.root+" .col_zoom_container").selectAll(".col_label_group").on("mouseover",function(r){d3.selectAll(t.viz.root_tips+"_col_tip").style("display","block"),e.show(r),null!=t.col_tip_callback&&t.col_tip_callback(r)}).on("mouseout",function(){e.hide(this),d3.selectAll(t.viz.root_tips+"_col_tip").style("display","none")})}}},function(t,e){"use strict";t.exports=function(t){var e=.36*t.viz.x_scale.rangeBand(),r=-t.viz.border_width.x,n=0,o=t.viz.x_scale.rangeBand()-e,a=-(t.viz.x_scale.rangeBand()-e+t.viz.border_width.x),i=-t.viz.border_width.x,s="M "+r+",0 L "+a+","+n+", L "+i+","+o+" Z";return s}},function(t,e){"use strict";t.exports=function(t){d3.select(t.viz.viz_svg).append("rect").attr("fill",t.viz.background_color).attr("height",t.viz.super_labels.dim.width+"px").attr("width","3000px").classed("super_col_bkg",!0).classed("white_bars",!0).attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.super_labels.margin.top+")"),d3.select(t.viz.viz_svg).append("text").attr("class","super_col").text(t.labels.super.col).attr("text-anchor","center").attr("transform",function(){var e=d3.select(this)[0][0].getBBox().width,r=t.viz.clust.dim.width/2+t.viz.norm_labels.width.row-e/2,n=t.viz.super_labels.dim.width;return"translate("+r+","+n+")"}).style("font-size",function(){var e=t.labels.super_label_fs*t.labels.super_label_scale;return e+"px"}).style("font-weight",300),d3.select(t.viz.viz_svg).append("rect").attr("fill",t.viz.background_color).attr("width",t.viz.super_labels.dim.width+"px").attr("height","3000px").classed("super_row_bkg",!0).classed("white_bars",!0).attr("transform","translate("+t.viz.super_labels.margin.left+",0)"),d3.select(t.viz.viz_svg).append("g").classed("super_row",!0).attr("transform",function(){var e=t.viz.super_labels.dim.width,r=t.viz.clust.dim.height/2+t.viz.norm_labels.width.col;return"translate("+e+","+r+")"}),d3.select(t.root+" .super_row").append("text").text(t.labels.super.row).attr("text-anchor","center").attr("transform",function(){var e=d3.select(this)[0][0].getBBox().width,r=e/2+t.viz.norm_labels.width.col,n="translate(0,"+r+"), rotate(-90)";return n}).style("font-size",function(){var e=t.labels.super_label_fs*t.labels.super_label_scale;return e+"px"}).style("font-weight",300)}},function(t,e,r){"use strict";var n=r(141),o=r(142),a=r(150),i=r(112);t.exports=function(t){var e=t.params,r=e.viz;d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 1000,-1000, L 1000,0 Z").attr("fill",r.background_color).attr("class","right_slant_triangle").attr("transform","translate("+r.clust.dim.width+","+r.norm_labels.width.col+")"),d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 500,-500, L 0,-500 Z").attr("fill",r.background_color).attr("class","left_slant_triangle").attr("transform","translate(-1,"+r.norm_labels.width.col+")");var s=r.clust.margin.top+r.uni_margin/5;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",r.clust.margin.left).attr("height",s).attr("class","top_left_white");var l=r.cat_room.col+1.5*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",2*r.clust.dim.width).attr("height",l).attr("class","top_right_white").attr("transform",function(){var t=r.clust.margin.left+r.clust.dim.width,e=r.norm_labels.width.col+r.norm_labels.margin.top-r.uni_margin;return"translate("+t+", "+e+")"}),p=r.clust.margin.left+r.clust.dim.width+r.uni_margin,_=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin;var c=1.15*r.cat_room.symbol_width,u=.65,d=1.25;r.show_categories.col&&d3.select(r.viz_svg).selectAll().data(r.all_cats.col).enter().append("text").classed("col_cat_super",!0).style("font-size",c+"px").style("opacity",u).style("cursor","default").attr("transform",function(t){var e=parseInt(t.split("-")[1],10),n=_+d*r.cat_room.symbol_width*e;return"translate("+p+","+n+")"}).text(function(t){return n(r,t,"col")}),a(t),_=r.show_dendrogram?r.clust.margin.top+r.clust.dim.height+r.dendro_room.col-2*r.uni_margin:r.clust.margin.top+r.clust.dim.height;var f=d3.select(r.viz_svg).append("g").classed("bottom_spillover_container",!0).attr("transform",function(){return"translate(0,"+_+")"});f.append("rect").attr("class","bottom_spillover").attr("fill",r.background_color).attr("width",r.svg_dim.width).attr("height",2*r.svg_dim.height),p=r.clust.margin.left,_=0,f.append("g").classed("col_dendro_icons_container",!0).attr("transform","translate("+p+","+_+")").append("g").classed("col_dendro_icons_group",!0),e.viz.show_dendrogram&&i(t,"col");var p=r.clust.margin.left+r.clust.dim.width,_=r.clust.margin.top+r.clust.dim.height,h=r.cat_room.col+r.clust.dim.width,v=r.cat_room.row+10*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",h).attr("height",v).attr("transform",function(){return"translate("+p+","+_+")"}).classed("white_bars",!0).classed("dendro_corner_spillover",!0),p=0,_=r.clust.margin.top+r.clust.dim.height,h=r.clust.margin.left,v=10*r.clust.dim.height,d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",h).attr("height",v).attr("transform",function(){return"translate("+p+","+_+")"}).classed("white_bars",!0).classed("dendro_col_spillover",!0),o(t)}},function(t,e){"use strict";t.exports=function(t,e,r){var n;if(t.cat_names[r][e]===e){var o=parseInt(e.split("-")[1],10)+1;n="Category "+o}else n=t.cat_names[r][e];return n}},function(t,e,r){"use strict";var n=r(143);t.exports=function(t){var e=t.params;_.each(["row","col"],function(r){e.viz.show_categories[r]&&d3.selectAll(e.root+" ."+r+"_cat_super").on("dblclick",function(){e.sim_mat&&(r="both"),d3.selectAll(e.root+" .toggle_"+r+"_order .btn").classed("active",!1);var o=this.__data__.replace("-","_")+"_index";e.viz.sim_mat?(n(t,o,"row"),n(t,o,"col")):n(t,o,r)})})}},function(t,e,r){"use strict";var n=r(106),o=r(134),a=r(88),i=r(79),s=r(144),l=r(129);t.exports=function(t,e,r){var c=t.params,u=l(c),d=0;1==u.zoom_y&&1==u.zoom_x||(s(t,0,0,1),d=1200);var f;"row"===r?f="col":"col"===r&&(f="row"),c.viz.run_trans=!0,"row"===f?c.viz.inst_order.row=e:"col"===f&&(c.viz.inst_order.col=e),c.viz.show_dendrogram&&n(t,r),"row"===f?c.viz.x_scale.domain(c.matrix.orders[c.viz.inst_order.row+"_row"]):"col"==f&&c.viz.y_scale.domain(c.matrix.orders[c.viz.inst_order.col+"_col"]);var p;p=d3.selectAll(c.root+" .tile")[0].length0&&c.viz.ds_level>=0){i(c);var m=!0,g=!0,y=!0;o(t,m,g,y)}setTimeout(function(){c.viz.run_trans=!1},2500)}},function(t,e,r){"use strict";var n=r(2),o=r(145),a=r(134),i=r(88),s=r(149);t.exports=function(t,e,r,l){function c(t,e){d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").transition().duration(g).style("opacity",e)}var u=t.params;if(d3.selectAll(u.viz.root_tips).style("display","none"),u.zoom_info=i(),a(t),!u.viz.run_trans){var d=u.viz.clust.dim.height/2,f=d/l;if(r>=d-f){var p=d-r,h=-d/l+p;r+=h}r<-(d-f)&&(p=d+r,h=d/l-p,r+=h);var v=l,m=1,g=700,y=-(v-1)*d;d3.select(u.root+" .clust_group").transition().duration(g).attr("transform","translate("+[0,0+y]+") scale("+m+","+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_label_zoom_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale("+v+","+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_cat_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale(1,"+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_dendro_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale("+m+","+v+")translate("+[u.viz.uni_margin/2,r]+")");var w;_.each(["row","col"],function(t){w=d3.select(u.root+" ."+t+"_dendro_crop_buttons").style("opacity"),d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").style("opacity",0),setTimeout(c,700,t,w)}),d3.select(u.root+" .col_zoom_container").transition().duration(g).attr("transform"," scale("+m+","+m+")translate("+[e,0]+")"),d3.select(u.root+" .col_cat_container").transition().duration(g).attr("transform"," scale("+m+",1)translate("+[e,0]+")"),d3.select(u.root+" .col_dendro_container").transition().duration(g).attr("transform"," scale("+m+",1)translate("+[e,u.viz.uni_margin/2]+")");var x=u.viz.clust.margin.top+y+r*v,b=u.viz.clust.margin.left+e;u.zoom_behavior.scale(v).translate([b,x]),o(u),d3.select(u.root+" .row_label_zoom_container text").empty()===!1&&d3.select(u.root+" .row_label_zoom_container").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",.5*t.x).attr("y",0).attr("width",.5*t.width).attr("height",u.viz.y_scale.rangeBand()).style("fill","yellow")}),d3.select(u.root+" .row_dendro_icons_group").attr("transform","translate("+[0,0+y]+") scale("+m+","+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=u.viz.uni_margin,r=t.pos_mid;return"translate("+e+","+r+") scale(1, "+1/v+")"}),d3.select(u.root+" .col_dendro_icons_group").attr("transform",function(){var t=" scale("+m+","+v+")";return t}),d3.select(u.root+" .col_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=t.pos_mid,r=u.viz.uni_margin;return"translate("+e+","+r+") scale(1,1)"}),n.has(u.network_data.col_nodes[0],"value")&&d3.selectAll(u.root+" .col_bars").attr("width",function(t){var e=0;return t.value>0&&(e=u.labels.bar_scale_col(t.value)/m),e}),n.has(u.network_data.row_nodes[0],"value")&&d3.selectAll(u.root+" .row_bars").transition().duration(g).attr("width",function(t){var e=0;return e=u.labels.bar_scale_row(Math.abs(t.value))/v}).attr("x",function(t){var e=0;return e=-u.labels.bar_scale_row(Math.abs(t.value))/v}),s(u)}}},function(t,e,r){"use strict";var n=r(2),o=r(146),a=r(147);t.exports=function(t){d3.selectAll(t.root+" .row_label_group").select("text").text(function(t){return n.normal_name(t)}),d3.selectAll(t.root+" .col_label_text").select("text").text(function(t){return n.normal_name(t)}),a(t),d3.selectAll(t.root+" .row_label_group").each(function(){o(t,this,"row")}),d3.selectAll(t.root+" .col_label_group").each(function(){o(t,this,"col")})}},function(t,e){"use strict";t.exports=function(t,e,r){function n(){return u=d3.select(this).text(),c=u.length,f=c-3,l=u.substring(0,f)+".."}function o(t){return u=d3.select(this).text(),c=".."===u.slice(-2)?u.length-2:u.length,d=t.name,f=c+2,l=d.substring(0,f)+"..",l.length>d.length&&(l=d),l}function a(t,e){return s=e<1?t:t*e}if("none"!=d3.select(e).style("display")){var i,s,l,c,u,d,f,p,_=t.viz.norm_labels.width[r];i="row"===r?t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale():t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale();var h;d3.select(e).select("text").each(function(t){h=t.name.length});var v=d3.select(e).select("text").node().getBBox().width;if(s=a(v,i),s>_)for(p=1;p_&&(d3.select(e).select("text").text(n),v=d3.select(e).select("text").node().getBBox().width,s=a(v,i));else if(s<.75*_)for(p=1;po&&(a.row>t.labels.max_allow_fs?(e=t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale(),e<1&&(e=1),r=t.labels.max_allow_fs/e,d3.selectAll(t.root+" .row_label_group").select("text").style("font-size",r+"px").attr("y",.5*t.viz.rect_height+.35*r)):d3.selectAll(t.root+" .row_label_group").select("text").style("font-size",t.labels.default_fs_row+"px").attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row)),a.col>o&&(a.col>t.labels.max_allow_fs?(e=t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale(),e<1&&(e=1),r=t.labels.max_allow_fs/e,r>.7*t.viz.rect_width&&(r=.7*t.viz.rect_width),d3.selectAll(t.root+" .col_label_text").select("text").style("font-size",r+"px")):d3.selectAll(t.root+" .col_label_text").select("text").style("font-size",t.labels.default_fs_col+"px"))}},function(t,e){"use strict";t.exports=function(t){var e={};return t.viz.zoom_ratio.x>1?(e.row=t.labels.default_fs_row*t.zoom_behavior.scale(),e.col=t.labels.default_fs_col*t.zoom_behavior.scale()):(e.row=t.labels.default_fs_row*t.zoom_behavior.scale()/t.viz.zoom_ratio.y,e.col=t.labels.default_fs_col*t.zoom_behavior.scale()),e}},function(t,e){"use strict";t.exports=function(t){t.zoom_info.zoom_x*t.viz.border_width.x>1?d3.selectAll(t.root+" .vert_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .vert_lines").select("line").style("display","none"),t.zoom_info.zoom_y*t.viz.border_width.y>1?d3.selectAll(t.root+" .horz_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .horz_lines").select("line").style("display","none")}},function(t,e,r){"use strict";var n=r(141),o=r(100);t.exports=function(t){var e=t.params,r=e.viz,a=2.75;d3.select(e.root+" .row_cat_label_container").empty()&&(d3.select(t.params.viz.viz_svg).append("g").classed("row_cat_label_container",!0),d3.select(t.params.viz.viz_svg+" .row_cat_label_container").append("g").classed("row_cat_label_bar_container",!0));var i=r.clust.margin.left+r.clust.dim.width+r.uni_margin,s=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin,l=1.15*r.cat_room.symbol_width,c=.65,u=1.25;d3.select(e.root+" .row_cat_label_container").attr("transform",function(){return i=r.norm_labels.margin.left+r.norm_labels.width.row+r.cat_room.symbol_width+a*r.uni_margin,s=r.clust.margin.top-r.uni_margin,"translate("+i+","+s+") rotate(-90)"}),d3.selectAll(e.root+" .row_cat_label_container text").remove(),d3.selectAll(e.root+" .row_cat_selection_bar").remove(),d3.selectAll(t.params.viz.root_tips+"_row_cat_super").remove();var d=50,f=-75,p=o().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_row_cat_super";return r}).direction("south_custom").offset([d,f]).style("display","none").style("opacity",0).html(function(t){var o,a=e.network_data.row_nodes[0][t];if(a.indexOf("

")>-1){var i=a.split(": ")[0],s=a.split("

")[1];o=i+"

"+s}else o=n(r,t,"row");return o}),h=u*r.cat_room.symbol_width,v=.9*h;if(d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("text").style("width","100px").style("height",v+"px").classed("row_cat_super",!0).style("font-size",l+"px").style("opacity",c).style("cursor","default").attr("transform",function(t){var e=u*r.cat_room.symbol_width*parseInt(t.split("-")[1],10);return"translate(0,"+e+")"}).text(function(t){return n(r,t,"row")}),d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("rect").classed("row_cat_super",!0).classed("row_cat_selection_bar",!0).style("height",v+"px").style("fill","green").style("width","120px").style("opacity",0).attr("transform",function(t){var e=h*(parseInt(t.split("-")[1],10)-.75);return"translate(0,"+e+")"}).on("mouseover",function(t){d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","block").style("opacity",1),p.show(t)}).on("mouseout",function(){p.hide(this),d3.selectAll(".d3-tip").style("display","none"),d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","none").style("opacity",0)}),d3.select(e.root+" .row_cat_selection_bar").empty()===!1&&d3.selectAll(e.root+" .row_cat_selection_bar").call(p),_.has(e.network_data,"row_cat_bars")){d3.select(e.root+" .enr_title").remove();var m=d3.select(e.root+" .viz_svg").append("g").classed("enr_title",!0).attr("transform",function(){var t=d3.select(e.root+" .row_cat_label_container").attr("transform").split("(")[1].split(")")[0],r=Number(t.split(",")[0])-10;return"translate("+String(r)+", 0)"});m.append("rect").attr("width",e.viz.cat_room.row).attr("height",25).attr("fill","white");var g=e.network_data.enrichrgram_lib.substring(0,40);m.append("text").attr("transform","translate(0, 17)").text(g.replace(/_/g," ")).style("font-size","15px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),d3.selectAll(e.root+" .enrichr_bars").remove();var y=e.viz.clust.margin.top-35,w=e.network_data.row_cat_bars[0],x=d3.scale.linear().domain([0,w]).range([0,y]);d3.select(e.root+" .row_cat_label_bar_container").selectAll().data(e.network_data.row_cat_bars).enter().append("rect").classed("enrichr_bars",!0).attr("height",v+"px").attr("fill","red").attr("width",function(t){var e=x(t);return e+"px"}).attr("opacity",.4).attr("transform",function(t,e){var r=h*(e-.75);return"translate(0, "+r+")"})}}},function(t,e,r){"use strict";var n=r(152);t.exports=function(t){var e,r=t.params;d3.select(r.root+" .expand_button").on("click",null);var o=.4;e=d3.select(r.root+" .expand_button").empty()?d3.select(r.viz.viz_svg).append("text").attr("class","expand_button"):d3.select(r.root+" .expand_button"),e.attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family","FontAwesome").attr("font-size","30px").text(function(){return r.viz.is_expand===!1?"":""}).attr("y","25px").attr("x","25px").style("cursor","pointer").style("opacity",o).on("mouseover",function(){d3.select(this).style("opacity",.75)}).on("mouseout",function(){d3.select(this).style("opacity",o)}).on("click",function(){r.viz.is_expand===!1?(d3.select(this).text(function(){return""}),r.viz.is_expand=!0,d3.selectAll(r.root+" .borders").style("fill","white"),d3.select(r.root+" .sidebar_wrapper").style("display","none")):(d3.select(this).text(function(){return""}),r.viz.is_expand=!1,d3.selectAll(r.root+" .borders").style("fill","#eee"),d3.select(r.root+" .viz_wrapper").style("width","100px"),d3.select(r.root+" .sidebar_wrapper").style("display","block")),d3.select(r.viz.viz_svg).style("opacity",.5);var e=500;1==r.viz.run_trans&&(e=2500),setTimeout(n,e,t)})}},function(t,e,r){"use strict";var n=r(2),o=r(153),a=r(161),i=r(162),s=r(163),l=r(164),c=r(165),u=r(166),d=r(167),f=r(168),p=r(169),h=r(170),v=r(171),m=r(172),g=r(173),y=r(174),w=r(175),x=r(176),b=r(145),z=r(107),k=r(106),A=r(134),E=r(70),N=r(177),M=r(150),S=r(142),O=r(178),T=r(88),C=r(179);t.exports=function(t){var e=t.params,r=E(e);d3.select(e.root+" .play_button"),d3.select(e.root+" .sidebar_wrapper").style("height",r.height+"px"),d3.select(e.viz.viz_wrapper).style("margin-top",r.top+"px").style("width",r.width+"px").style("height",r.height+"px"),e=y(e),e.zoom_info=T(),i(e);var B=d3.select(e.viz.viz_svg);_.each(e.network_data.links,function(t){t.x=e.viz.x_scale(t.target),t.y=e.viz.y_scale(t.source)}),B.on(".zoom",null),e.zoom_behavior.scaleExtent([1,e.viz.square_zoom*e.viz.zoom_ratio.x]).on("zoom",function(){o(t)}),e.viz.do_zoom&&B.call(e.zoom_behavior),a(t),B.attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height),B.select(".super_background").style("width",e.viz.svg_dim.width).style("height",e.viz.svg_dim.height),B.select(".grey_background").attr("width",e.viz.clust.dim.width).attr("height",e.viz.clust.dim.height),setTimeout(N,100,e);var F=e.network_data.row_nodes,I=n.pluck(F,"name");w(e,B),B.selectAll(".highlighting_rect").attr("width",.8*e.viz.x_scale.rangeBand()).attr("height",.8*e.viz.y_scale.rangeBand()),f(e),d(e,B),p(e,B),B.selectAll(".row_label_group").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",e.viz.rect_height).style("fill","yellow").style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),B.selectAll(".row_label_group").select("text").attr("y",.5*e.viz.rect_height+.35*e.labels.default_fs_row),n.has(e.network_data.row_nodes[0],"value")&&x(t,B),B.selectAll(".row_cat_group").attr("transform",function(t){var r=_.indexOf(I,t.name);return"translate(0, "+e.viz.y_scale(r)+")"}),B.selectAll(".row_cat_group").select("path").attr("d",function(){var t=e.viz.cat_room.symbol_width-1,r=0,n=1,o=e.viz.rect_height/2,a=e.viz.cat_room.symbol_width-1,i=e.viz.rect_height,s="M "+t+","+r+" L "+n+","+o+", L "+a+","+i+" Z";return s});var j=!0;e.viz.show_dendrogram?(z(t,"row",j),z(t,"col",j),s(e,B),k(t,"row",0),k(t,"col",0)):s(e,B),h(e,B),v(e,B),m(e,B),g(e,B),l(e,B),c(e.viz,B),C(e),u(e,B),e.zoom_behavior.scale(1).translate([e.viz.clust.margin.left,e.viz.clust.margin.top]),b(e),d3.select(e.root+" .clust_container").attr("transform","translate("+e.viz.clust.margin.left+","+e.viz.clust.margin.top+")"),t.params.viz.ds_level===-1&&A(t),M(t),d3.select(e.viz.viz_svg).style("opacity",1),S(t),d3.select(t.params.root+" .row_slider_group").style("opacity",0),d3.select(t.params.root+" .col_slider_group").style("opacity",0),setTimeout(O,500,t,"row"),setTimeout(O,500,t,"col")}},function(t,e,r){"use strict";var n=r(154),o=r(159),a=r(160);t.exports=function(t){var e=t.params,r={};if(r.zoom_x=d3.event.scale,r.zoom_y=d3.event.scale,r.trans_x=e.zoom_behavior.translate()[0]-e.viz.clust.margin.left,r.trans_y=e.zoom_behavior.translate()[1]-e.viz.clust.margin.top,d3.selectAll(e.viz.root_tips).style("display","none"),e.zoom_info=o(e,r),e.zoom_info=a(e,r),e.is_slider_drag===!1&&e.is_cropping===!1){var i=e.zoom_info.trans_x+e.viz.clust.margin.left,s=e.zoom_info.trans_y+e.viz.clust.margin.top;e.zoom_behavior.translate([i,s]),t.params=e,n(t)}}},function(t,e,r){"use strict";var n=r(147),o=r(134),a=r(155),i=r(114),s=r(129),l=r(156),c=r(158);t.exports=function(t){function e(t){var e=t.params,r=c(e);r===!0&&setTimeout(l,50,t)}var r=t.params,u=r.zoom_info,d=s(r);d3.select(r.root+" .clust_group").attr("transform","translate("+[u.trans_x,u.trans_y]+") scale("+u.zoom_x+","+u.zoom_y+")"), +d3.select(r.root+" .row_label_zoom_container").attr("transform","translate("+[0,u.trans_y]+") scale("+u.zoom_y+")"),d3.select(r.root+" .col_zoom_container").attr("transform","translate("+[u.trans_x,0]+") scale("+u.zoom_x+")"),d3.select(r.root+" .row_cat_container").attr("transform","translate("+[0,u.trans_y]+") scale( 1,"+u.zoom_y+")"),d3.select(r.root+" .row_dendro_container").attr("transform","translate("+[r.viz.uni_margin/2,u.trans_y]+") scale( 1,"+u.zoom_y+")"),d3.select(r.root+" .row_dendro_icons_group").attr("transform",function(){var t=u.trans_y,e="translate("+[0,t]+") ",r="scale(1, "+u.zoom_y+")",n=e+r;return n}),d3.select(r.root+" .col_dendro_icons_group").attr("transform",function(){var t=u.trans_x,e="translate("+[t,0]+")",r="scale("+u.zoom_x+", 1)",n=e+r;return n}),i(r,u,"row"),i(r,u,"col"),d3.select(r.root+" .col_cat_container").attr("transform","translate("+[u.trans_x,0]+") scale("+u.zoom_x+",1)"),d3.select(r.root+" .col_dendro_container").attr("transform","translate("+[u.trans_x,r.viz.uni_margin/2]+") scale("+u.zoom_x+",1)"),a(r,u),d3.select(r.root+" .viz_svg").attr("is_zoom",function(){var t=Number(d3.select(r.root+" .viz_svg").attr("is_zoom"));return d3.select(r.root+" .viz_svg").attr("stopped_zoom",1),t+1});var f=function(){d3.select(r.root+" .viz_svg").attr("is_zoom",function(){var t=Number(d3.select(r.root+" .viz_svg").attr("is_zoom"));return t-1})};if(n(r),u.zoom_y<=d.zoom_y){var p=!1;u.zoom_y0&&(n=t.labels.bar_scale_col(r.value)/e.zoom_x),n})}},function(t,e,r){"use strict";var n=r(147),o=r(146),a=r(157),i=r(149),s=r(134),l=r(158);t.exports=function(t){function e(){_.each(["row","col"],function(t){d3.selectAll(r.root+" ."+t+"_label_group").filter(function(){return"none"!=d3.select(this).style("display")}).select("text").style("font-size",function(){var t=Number(d3.select(this).style("font-size").replace("px",""));return t})})}var r=t.params,c=l(r);if(c===!0){_.each(["row","col"],function(t){d3.selectAll(r.root+" ."+t+"_label_group").select("text").style("opacity",1),d3.selectAll(r.root+" ."+t+"_cat_group").select("path").style("display","block")}),s(t,!0),d3.selectAll(r.viz.root_tips).style("display","block"),d3.selectAll(r.root+" .row_label_group").select("text").style("display","none"),d3.selectAll(r.root+" .row_label_group").select("text").style("display","block"),d3.select(r.root+" .viz_svg").attr("stopped_zoom",0),d3.selectAll(r.root+" .row_label_group").select("text").style("display","block"),d3.selectAll(r.root+" .col_label_group").select("text").style("display","block"),i(r),t.params.viz.x_offset=0;var u=150;_.each(["row","col"],function(t){var e=a(r,t);e1&&(e.zoom_y=0?e.trans_y=0:e.trans_y<=-e.pan_room_y&&(e.trans_y=-e.pan_room_y),e}},function(t,e){"use strict";t.exports=function(t,e){var r=t.viz;return r.zoom_ratio.x>1&&(e.zoom_x0?e.trans_x=0:e.trans_x<=-e.pan_room_x&&(e.trans_x=-e.pan_room_x),e}},function(t,e,r){"use strict";var n=r(144);t.exports=function(t){var e=t.params;d3.selectAll(e.viz.zoom_element).on("dblclick.zoom",null),d3.select(e.viz.zoom_element).on("dblclick",function(){n(t,0,0,1)})}},function(t,e){"use strict";t.exports=function(t){var e=1,r=0,n=0,o=t.viz.clust.dim.height/2,a=-(e-1)*o;d3.select(t.root+" .clust_group").attr("transform","translate("+[0,0+a]+") scale(1,"+e+")translate("+[r,n]+")"),d3.select(t.root+" .row_label_zoom_container").attr("transform","translate("+[0,a]+") scale("+e+","+e+")translate("+[0,n]+")"),d3.select(t.root+" .row_cat_container").attr("transform","translate("+[0,a]+") scale(1,"+e+")translate("+[0,n]+")"),d3.select(t.root+" .row_dendro_container").attr("transform","translate("+[0,a]+") scale("+e+","+e+")translate("+[t.viz.uni_margin/2,n]+")"),d3.select(t.root+" .col_zoom_container").attr("transform"," scale(1,1)translate("+[r,0]+")"),d3.select(t.root+" .col_cat_container").attr("transform"," scale(1,1)translate("+[r,0]+")"),d3.select(t.root+" .col_dendro_container").attr("transform"," scale(1,1)translate("+[r,t.viz.uni_margin/2]+")"),d3.select(t.root+" .row_dendro_icons_group").attr("transform",function(){return"translate(0,0) scale(1)"}),d3.select(t.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=7,r=t.pos_mid;return"translate("+e+","+r+") scale(1, 1)"})}},function(t,e){"use strict";t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n={};r===!1?n.run_transition=!1:n=r;var o,a=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;n.run_transition?(o=e.transition().delay(n.update).duration(a),e.selectAll(".col_cat_group").data(i,function(t){return t.name}).transition().delay(n.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}),e.selectAll(".col_dendro_group").data(i,function(t){return t.name}).transition().delay(n.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"})):(o=e,e.selectAll(".col_cat_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}),d3.select(t.root).selectAll(".col_dendro_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}));var l,c;_.each(["row","col"],function(e){var r=t.viz.all_cats[e].length;for(l=0;l2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(".super_col_bkg").attr("height",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.grey_border_width+")"),r.select(".super_col").attr("transform",function(){var e=t.viz.clust.dim.width/2+t.viz.norm_labels.width.row,r=t.viz.super_labels.dim.width;return"translate("+e+","+r+")"}),r.select(".super_row_bkg").attr("width",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.grey_border_width+",0)"),r.select(".super_row").attr("transform",function(){var e=t.viz.super_labels.dim.width,r=t.viz.clust.dim.height/2+t.viz.norm_labels.width.col;return"translate("+e+","+r+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(t.root+" .right_slant_triangle").attr("transform","translate("+t.clust.dim.width+","+t.norm_labels.width.col+")"),r.select(t.root+" .left_slant_triangle").attr("transform","translate(-1,"+t.norm_labels.width.col+")");var i=t.clust.margin.top+t.uni_margin/5;r.select(t.root+" .top_left_white").attr("width",t.clust.margin.left).attr("height",i);var s=t.clust.margin.left+t.clust.dim.width+t.uni_margin+t.dendro_room.row,l=t.norm_labels.margin.top+t.norm_labels.width.col;r.select(t.root+" .right_spillover_container").attr("transform",function(){return"translate("+s+", 0)"}),l=t.norm_labels.margin.top+t.norm_labels.width.col,r.select(t.root+" .right_spillover_container rect").attr("transform",function(){return"translate( 0,"+l+")"}),r.select(t.root+" .right_spillover").attr("height",t.svg_dim.height+"px");var c=t.clust.margin.left+t.clust.dim.width,u=l,d=t.dendro_room.row+t.uni_margin,f=t.cat_room.col+t.uni_margin;d3.select(t.root+" .dendro_row_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=0,u=t.clust.margin.top+t.clust.dim.height,d=t.clust.margin.left,f=10*t.clust.dim.height,r.select(".dendro_col_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=t.clust.margin.left+t.clust.dim.width,u=t.clust.margin.top+t.clust.dim.height,d=t.cat_room.col+t.clust.dim.width,f=t.cat_room.row+t.uni_margin,r.select(".dendro_corner_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=t.clust.margin.left+t.clust.dim.width+t.uni_margin,u=t.norm_labels.margin.top+t.norm_labels.width.col+2.5*t.uni_margin;var p=2.75,_=1.2;t.show_categories.col&&d3.selectAll(t.root+" .col_cat_super").attr("transform",function(e){var r=parseInt(e.split("-")[1],10),n=u+_*t.cat_room.symbol_width*r;return"translate("+c+","+n+")"}),t.show_categories.row&&d3.select(t.root+" .row_cat_label_container").attr("transform",function(){return c=t.norm_labels.margin.left+t.norm_labels.width.row+t.cat_room.symbol_width+p*t.uni_margin,u=t.clust.margin.top-t.uni_margin,"translate("+c+","+u+") rotate(-90)"}),u=t.show_dendrogram?t.clust.margin.top+t.clust.dim.height+t.dendro_room.col-2*t.uni_margin:t.clust.margin.top+t.clust.dim.height,d3.select(t.root+" .bottom_spillover_container").attr("transform",function(){return"translate(0,"+u+")"}),r.select(t.root+" .bottom_spillover").attr("width",t.svg_dim.width).attr("height",2*t.svg_dim.height);var h=t.cat_room.col+1.5*t.uni_margin;d3.select(t.viz_svg+" .top_right_white").attr("fill",t.background_color).attr("width",2*t.clust.dim.width).attr("height",h).attr("transform",function(){var e=t.clust.margin.left+t.clust.dim.width,r=t.norm_labels.width.col+t.norm_labels.margin.top-t.uni_margin;return"translate("+e+", "+r+")"})}},function(t,e){"use strict";t.exports=function(t,e){e.select(".left_border").attr("width",t.viz.grey_border_width).attr("height",t.viz.svg_dim.height).attr("transform","translate(0,0)"),e.select(".right_border").attr("width",t.viz.grey_border_width).attr("height",t.viz.svg_dim.height).attr("transform",function(){var e=t.viz.svg_dim.width-t.viz.grey_border_width;return"translate("+e+",0)"}),e.select(".top_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",function(){var t=0;return"translate("+t+",0)"}),e.select(".bottom_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",function(){var e=t.viz.svg_dim.height-t.viz.grey_border_width;return"translate(0,"+e+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration,i=t.network_data.row_nodes,s=t.network_data.row_nodes_names;n===!1?o.run_transition=!1:o=n,o.run_transition?(e.selectAll(".row_label_group").data(i,function(t){return t.name}).transition().delay(o.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),r=e.transition().delay(o.update).duration(a)):(e.selectAll(".row_label_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),r=e),r.select(t.root+" .row_container").attr("transform","translate("+t.viz.norm_labels.margin.left+","+t.viz.clust.margin.top+")"),r.select(t.root+" .row_container").select(".white_bars").attr("width",t.viz.label_background.row).attr("height",30*t.viz.clust.dim.height+"px"),r.select(t.root+" .row_container").select(".row_label_container").attr("transform","translate("+t.viz.norm_labels.width.row+",0)")}},function(t,e){"use strict";t.exports=function(t){var e=6,r=e*t.viz.border_width.x,n=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.rect_width).attr("height",n).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+",0)"}),d3.select(t.root+" .left_hlight").attr("width",r).attr("height",t.viz.rect_width-.99*n).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*n+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.rect_height-.99*n).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.rect_width-r;return"translate("+e+","+.99*n+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.rect_width-1.98*r}).attr("height",n).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,o=t.viz.rect_height-n;return"translate("+e+","+o+")"}),d3.select(t.root+" .row_top_hlight").attr("width",t.viz.svg_dim.width).attr("height",n),d3.select(t.root+" .row_bottom_hlight").attr("width",t.viz.svg_dim.width).attr("height",n).attr("transform",function(){var e=t.viz.rect_height-n;return"translate(0,"+e+")"}),d3.select(t.root+" .col_top_hlight").attr("width",t.viz.clust.dim.height).attr("height",r).attr("transform",function(){var e=0,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"}),d3.select(t.root+" .col_bottom_hlight").attr("width",t.viz.clust.dim.height).attr("height",r).attr("transform",function(){var e=t.viz.rect_width-r,n=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+n+","+e+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(".row_cat_outer_container").attr("transform","translate("+t.viz.norm_labels.width.row+",0)").select("white_bars").attr("width",t.viz.cat_room.row+"px").attr("height",function(){var e=t.viz.clust.dim.height;return e});var i=t.viz.clust.margin.left+t.viz.clust.dim.width,s=t.viz.clust.margin.top;r.select(".row_dendro_outer_container").attr("transform","translate("+i+","+s+")"),i=t.viz.clust.margin.left,s=t.viz.clust.margin.top+t.viz.clust.dim.height,r.select(" .col_dendro_outer_container").attr("transform",function(){return"translate("+i+","+s+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;n===!1?o.run_transition=!1:o=n,o.run_transition?(r=e.transition().delay(o.update).duration(a),e.selectAll(".col_label_text").data(i,function(t){return t.name}).transition().delay(o.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"})):(r=e,e.selectAll(".col_label_text").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"}));var l=t.viz.x_scale.rangeBand()/2+t.viz.border_width.x;r.select(t.root+" .col_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.norm_labels.margin.top+")"),r.select(t.root+" .col_container").select(".white_bars").attr("width",30*t.viz.clust.dim.width+"px").attr("height",t.viz.label_background.col),r.select(t.root+" .col_container").select(".col_label_outer_container").attr("transform","translate(0,"+t.viz.norm_labels.width.col+")"),r.selectAll(".col_label_group").attr("transform","translate("+t.viz.x_scale.rangeBand()/2+","+l+") rotate(45)"),r.selectAll(".col_label_group").select("text").attr("y",.6*t.viz.x_scale.rangeBand()).attr("dx",2*t.viz.border_width.x)}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){e.selectAll(".col_label_group").select("text").style("font-size",t.labels.default_fs_col+"px").text(function(t){return n.normal_name(t)}),e.selectAll(".col_label_group").each(function(){d3.select(this).select("text")[0][0].getBBox()})}},function(t,e,r){"use strict";var n=r(138);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.selectAll(".col_label_group").select("path"),a={},i=t.viz.duration;r===!1?a.run_transition=!1:a=r;var s;s=a.run_transition?o.transition().delay(a.update).duration(i):o,s.attr("d",function(){return n(t)}).attr("fill","#eee")}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={};r===!1?o.run_transition=!1:o=r,n.has(t.network_data.col_nodes[0],"value")&&e.selectAll(".col_bars").data(t.network_data.col_nodes,function(t){return t.name}).attr("width",function(e){var r=0;return e.value>0&&(r=t.labels.bar_scale_col(e.value)),r}).attr("height",.66*t.viz.rect_width)}},function(t,e,r){"use strict";var n=r(71),o=r(74),a=r(73),i=r(83),s=r(82);t.exports=function(t){if(t=n(t),t.viz=a(t.viz),t.viz=o(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t.viz=s(t.viz),t.viz.x_scale.rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale.rangeBands([0,t.viz.clust.dim.height]),t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,null!=t.viz.ds)for(var e;e0&&_.each(t.viz.ds,function(e){e.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]),e.y_scale.domain(d3.range(e.num_rows+1)),e.rect_height=e.y_scale.rangeBand()-t.viz.border_width.y}),t.viz.square_zoom=t.viz.norm_labels.width.col/(t.viz.rect_width/2),t=i(t)}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(99);t.exports=function(t,e){var r=t.network_data.row_nodes_names;if(t.viz.ds_level===-1)e.selectAll(".row").attr("transform",function(e){var n=_.indexOf(r,e.name),o=t.viz.y_scale(n);return"translate(0,"+o+")"}),e.selectAll(".row").selectAll(".tile").attr("transform",function(e){return a(t,e)}).attr("width",t.viz.rect_width).attr("height",t.viz.rect_height),e.selectAll(".row").selectAll(".tile_up").attr("d",function(){return n(t)}).attr("transform",function(e){return a(t,e)}),e.selectAll(".row").selectAll(".tile_dn").attr("d",function(){return o(t)}).attr("transform",function(e){return a(t,e)});else{var i=t.viz.ds_level,s=".ds"+String(i)+"_row",l=t.viz.ds[i].rect_height;e.selectAll(s).attr("transform",function(e){var r=t.viz.ds[i].y_scale(e.row_index);return"translate(0,"+r+")"}),e.selectAll(s).selectAll(".tile").attr("transform",function(e){return a(t,e)}).attr("width",t.viz.rect_width).attr("height",l)}}},function(t,e,r){"use strict";var n=r(75);t.exports=function(t,e){var r=t.params;r=n(r),e.selectAll(".row_bars").attr("width",function(t){var e=0;return e=r.labels.bar_scale_row(Math.abs(t.value))}).attr("x",function(t){var e=0;return e=-r.labels.bar_scale_row(Math.abs(t.value))}).attr("height",r.viz.y_scale.rangeBand())}},function(t,e){"use strict";t.exports=function(t){var e=d3.select(t.root+" .clust_container").attr("transform"),r=Number(e.split("(")[1].split(",")[0]),n=Number(e.split(",")[1].replace(")","")),o=r+t.viz.clust.dim.width/2,a=n+t.viz.clust.dim.height/2;d3.select(t.root+" .play_button").attr("transform",function(){return"translate("+o+","+a+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o=t.params.viz;if("row"===e){var a=o.svg_dim.width-3*o.uni_margin;r=o.clust.margin.left+o.clust.dim.width+5.25*o.dendro_room.row,r>a&&(r=a),n=o.clust.margin.top+3*o.uni_margin-50}else r=2*o.uni_margin,n=o.clust.margin.top+o.clust.dim.height+o.dendro_room.col-2*o.uni_margin;d3.select(t.params.root+" ."+e+"_tree_group").attr("transform",function(){var t;return n-=75,t="translate("+r+","+n+")"}).style("opacity",1),d3.select(t.params.root+" ."+e+"_slider_group").attr("transform",function(){var t;return"row"===e?(r+=.8*o.dendro_room.row,n+=65,t="translate("+r+","+n+")"):t="translate("+r+","+n+"), rotate(-90)",t}).style("opacity",1)}},function(t,e){"use strict";t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;e>0&&(r=2e3);var n=d3.selectAll(t.root+" .horz_lines"),o=d3.selectAll(t.root+" .vert_lines");n.style("opacity",0).attr("transform",function(e){var r=e.row_index,n=t.viz.y_scale(r);return"translate( 0,"+n+") rotate(0)"}).transition().duration(e).delay(r).style("opacity",1),n.append("line").attr("x1",0).attr("x2",t.viz.clust.dim.width).style("stroke-width",function(){var e=t.viz.border_width.y;return e+"px"}),o.style("opacity",0).attr("transform",function(e){var r=e.col_index,n=t.viz.x_scale(r);return"translate("+n+") rotate(-90)"}).transition().duration(e).delay(r).style("opacity",1),o.append("line").attr("x1",0).attr("x2",-t.viz.clust.dim.height).style("stroke-width",function(){var e=t.viz.border_width.x;return e+"px"})}},function(t,e,r){"use strict";var n=r(181),o=r(100),a=r(182),i=r(183),s=r(184);t.exports=function(t){var e=t.params;d3.select(e.root+" .col_cat_outer_container").empty()?d3.select(e.root+" .col_container").append("g").attr("class","col_cat_outer_container").attr("transform",function(){var t=e.viz.norm_labels.width.col+2;return"translate(0,"+t+")"}).append("g").attr("class","col_cat_container"):d3.select(e.root+" .col_container").select("col_cat_outer_container").attr("transform",function(){var t=e.viz.norm_labels.width.col+2;return"translate(0,"+t+")"}),d3.selectAll(e.viz.root_tips+"_col_cat_tip").remove();var r=o().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_col_cat_tip";return r}).direction("s").offset([5,0]).style("display","none").html(function(t){return n(e,t,this,"col")});d3.select(e.root+" .col_cat_container").selectAll("g").data(e.network_data.col_nodes,function(t){return t.name}).enter().append("g").attr("class","col_cat_group").attr("transform",function(t){var r=_.indexOf(e.network_data.col_nodes_names,t.name);return"translate("+e.viz.x_scale(r)+",0)"}),d3.select(e.root+" .col_cat_container").selectAll(".col_cat_group").call(r),d3.selectAll(e.root+" .col_cat_group").each(function(){var t,n=this;_.each(e.viz.all_cats.col,function(o){var l=parseInt(o.split("-")[1],10),c="col_cat_rect_"+String(l);t=d3.select(n).select("."+c).empty()?d3.select(n).append("rect").attr("class",c).attr("cat",o).attr("transform",function(){var t=e.viz.cat_room.symbol_width+e.viz.cat_room.separation,r=l*t;return"translate(0,"+r+")"}).on("click",function(t){if(d3.select(this).classed("cat_strings")){var r=s(e,t,this,"col");$(e.root+" .dendro_info").modal("toggle");var n=r.join(", ");d3.select(e.root+" .dendro_info input").attr("value",n)}}):d3.select(n).select("."+c),t.attr("width",e.viz.x_scale.rangeBand()).attr("height",e.viz.cat_room.symbol_width).style("fill",function(t){var r=t[o],n=e.viz.cat_colors.col[o][r];return n}).on("mouseover",r.show).on("mouseout",function(){r.hide(this),a(e),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(e.viz,"col",t,o)})})}},function(t,e,r){"use strict";var n=r(141);t.exports=function(t,e,r,o){function a(){var e=!1;if(d3.select(r).classed("hovering")){var n=[o];t.viz.sim_mat&&(n=["row","col"]),_.each(n,function(r){"string"==typeof l&&l.indexOf("Not ")<0&&"false"!=l&&(e=!0),e&&d3.selectAll(t.root+" ."+r+"_cat_group").selectAll("rect").style("opacity",function(e){var r=d3.select(this).style("opacity");if(d3.select(this).classed("cat_strings")&&d3.select(this).classed("filtered_cat")===!1){var n,o=d3.select(this).attr("cat");n=e[o].indexOf(": ")>=0?e[o].split(": ")[1]:e[o],r=o===i&&n===l?t.viz.cat_colors.active_opacity:t.viz.cat_colors.opacity/4}return r})})}}d3.selectAll(t.viz.root_tips+"_col_cat_tip").style("display","block"),d3.selectAll(t.viz.root_tips+"_row_cat_tip").style("display","block");var i=d3.select(r).attr("cat"),s=n(t.viz,i,o),l=e[i];"string"==typeof l&&l.indexOf(": ")>=0&&(l=l.split(": ")[1]);var c=s+": "+l;return d3.select(r).classed("hovering",!0),setTimeout(a,500),c}},function(t,e){"use strict";t.exports=function(t){_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_cat_group").selectAll("rect").style("opacity",function(){var e=d3.select(this).style("opacity");return d3.select(this).classed("cat_strings")&&d3.select(this).classed("filtered_cat")===!1&&(e=t.viz.cat_colors.opacity),e})})}},function(t,e){"use strict";t.exports=function(t,e,r,n){function o(t){"string"==typeof t&&t.indexOf(i)>-1&&(t=t.split(i)[1]);var e=parseFloat(t);return e}var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=": ",s=t.cat_info[e][n].type;"cat_strings"===s?a?r.classed("cat_strings",!0).style("opacity",0).transition().duration(1e3).style("opacity",t.cat_colors.opacity):r.classed("cat_strings",!0).style("opacity",t.cat_colors.opacity):r.classed("cat_values",!0).style("opacity",function(r){var a=r[n],i=o(a);return t.cat_info[e][n].cat_scale(Math.abs(i))}).style("fill",function(e){var r,a=o(e[n]);return r=a>0?t.cat_value_colors[0]:t.cat_value_colors[1]})}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e,r,o){var a=d3.select(r).attr("cat"),i=e[a],s=t.network_data[o+"_nodes"],l=_.filter(s,function(t){return t[a]==i}),c=n.pluck(l,"name");return c}},function(t,e,r){"use strict";var n=r(181),o=r(100),a=r(182),i=r(183),s=r(184);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.params;d3.select(r.root+" .row_cat_outer_container").empty()?d3.select(r.root+" .row_container").append("g").attr("class","row_cat_outer_container").attr("transform","translate("+r.viz.norm_labels.width.row+",0)").append("g").attr("class","row_cat_container"):d3.select(r.root+" .row_container").select("row_cat_outer_container").attr("transform","translate("+r.viz.norm_labels.width.row+",0)"),d3.select(r.root+" .row_cat_container").select(".white_bars").empty()?d3.select(r.root+" .row_cat_container").append("rect").attr("class","white_bars").attr("fill",r.viz.background_color).attr("width",r.viz.cat_room.row+"px").attr("height",function(){var t=r.viz.clust.dim.height;return t}):d3.select(r.root+" .row_cat_container").select(".white_bars").attr("fill",r.viz.background_color).attr("width",r.viz.cat_room.row+"px").attr("height",function(){var t=r.viz.clust.dim.height;return t}),d3.selectAll(r.viz.root_tips+"_row_cat_tip").remove();var l=o().attr("class",function(){var t=r.viz.root_tips.replace(".",""),e=t+" d3-tip "+t+"_row_cat_tip";return e}).direction("e").offset([5,0]).style("display","none").html(function(t){return n(r,t,this,"row")});d3.select(r.root+" .row_cat_container").selectAll("g").data(r.network_data.row_nodes,function(t){return t.name}).enter().append("g").attr("class","row_cat_group").attr("transform",function(t){var e=_.indexOf(r.network_data.row_nodes_names,t.name);return"translate(0, "+r.viz.y_scale(e)+")"}),d3.select(r.root+" .row_cat_container").selectAll(".row_cat_group").call(l);var c,u;d3.selectAll(r.root+" .row_cat_group rect").remove(),r.viz.show_categories.row&&d3.selectAll(r.root+" .row_cat_group").each(function(){u=this,_.each(r.viz.all_cats.row,function(t){var n=parseInt(t.split("-")[1],10),o="row_cat_rect_"+String(n);c=d3.select(u).select("."+o).empty()?d3.select(u).append("rect").attr("class",o).attr("cat",t):d3.select(u).select("."+o),c.attr("width",r.viz.cat_room.symbol_width).attr("height",r.viz.y_scale.rangeBand()).style("fill",function(e){var n=e[t],o=r.viz.cat_colors.row[t][n];return o}).attr("x",function(){var t=r.viz.cat_room.symbol_width+r.viz.uni_margin/2;return t+"px"}).attr("transform",function(){var t=r.viz.cat_room.symbol_width+r.viz.cat_room.separation,e=n*t;return"translate("+e+",0)"}).on("click",function(t){if(d3.select(this).classed("cat_strings")){var e=s(r,t,this,"row");$(r.root+" .dendro_info").modal("toggle");var n=e.join(", ");d3.select(r.root+" .dendro_info input").attr("value",n)}}).on("mouseover",l.show).on("mouseout",function(){l.hide(this),a(r),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(r.viz,"row",c,t,e)})})}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.dendro_room.row+e.viz.uni_margin,o=e.viz.clust.margin.left+e.viz.clust.dim.width,a=e.viz.clust.margin.top;d3.select(e.root+" .row_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").append("rect").classed("row_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",r+"px").attr("height",e.viz.svg_dim.height),d3.select(e.root+" .row_dendro_outer_container").append("g").attr("class","row_dendro_container").attr("transform","translate("+e.viz.uni_margin/2+",0)")):(d3.select(e.root+" .viz_svg").select("row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").select(".row_dendro_spillover").attr("width",r+"px").attr("height",e.viz.svg_dim.height)),n(t,"row",!1),"clust"!=e.viz.inst_order.col&&d3.selectAll(e.root+" .row_dendro_group").remove()}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.clust.margin.left,o=e.viz.clust.margin.top+e.viz.clust.dim.height,a=e.viz.dendro_room.col+e.viz.uni_margin;d3.select(e.root+" .col_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","col_dendro_outer_container").attr("transform","translate("+r+","+o+")"),d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",a+"px"),d3.select(e.root+" .col_dendro_outer_container").append("g").attr("class","col_dendro_container").attr("transform","translate(0,"+e.viz.uni_margin/2+")"), +d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover_top",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height).attr("transform","translate(0,"+e.viz.dendro_room.col+")")):(d3.select(e.root+" .viz_svg").select("col_dendro_outer_container").attr("transform","translate("+r+","+o+")"),d3.select(e.root+" .col_dendro_outer_container").select(".col_dendro_spillover").attr("width",e.viz.svg_dim.width).attr("height",a+"px")),n(t,"col",!1),"clust"!=e.viz.inst_order.row&&d3.selectAll(e.root+" .col_dendro_group").remove()}},function(t,e,r){"use strict";var n=r(189);r(191);t.exports=function(t){n(t,"row"),n(t,"col")}},function(t,e,r){"use strict";var n=r(190),o=r(178);t.exports=function(t,e){function r(){t.params.is_slider_drag=!0;var r=d3.event.y;r<0&&(r=0),r>i&&(r=i),this.nextSibling&&this.parentNode.appendChild(this),r=d3.round(r,-1);var o=10-r/10;d3.select(this).attr("transform","translate(0, "+r+")"),n(t,e,o)}function a(){var r=d3.mouse(this),o=d3.round(r[1],-1);d3.select(t.params.root+" ."+e+"_group_circle").attr("transform","translate(0, "+o+")");var a=10-o/10;n(t,e,a)}var i=100,s=d3.behavior.drag().on("drag",r).on("dragend",function(){t.params.is_slider_drag=!1}),l=d3.select(t.params.root+" .viz_svg").append("g").classed(e+"_slider_group",!0);o(t,e);var c=i+20,u=30;l.append("rect").classed(e+"_slider_background",!0).attr("height",c+"px").attr("width",u+"px").attr("fill",t.params.viz.background_color).attr("transform",function(){var t="translate(-10, -5)";return t}).style("opacity",0),l.append("line").style("stroke-width",i/7+"px").style("stroke","black").style("stroke-linecap","round").style("opacity",0).attr("y1",0).attr("y2",function(){return i-2}).on("click",a);var d=-i/40;l.append("path").style("fill","black").attr("transform","translate("+d+", 0)").attr("d",function(){var t=0,e=0,r=0,n=i,o=i/10,a=0,s="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return s}).style("opacity",.35).on("click",a);var f=.35,p=.6;l.append("circle").classed(e+"_group_circle",!0).attr("r",.08*i).attr("transform",function(){return"translate(0, "+i/2+")"}).style("fill","blue").style("opacity",f).on("mouseover",function(){d3.select(this).style("opacity",p)}).on("mouseout",function(){d3.select(this).style("opacity",f)}).call(s)}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t,e,r){var o=t.params;"row"===e?o.group_level.row=r:"col"===e&&(o.group_level.col=r);var a=!0;n(t,e,a)}},function(t,e,r){"use strict";var n=r(178),o=r(100),a=r(192);t.exports=function(t,e){e="row";var r=40,i=t.params,s=.35,l=.6,c=o().attr("class",function(){var t=i.viz.root_tips.replace(".",""),e=t+"_tree_menu_tip d3-tip";return e}).direction("sw").style("display","none").offset([-10,-5]).html(function(){return"Clustering Menu"}),u=d3.select(i.root+" .viz_svg").append("g").classed(e+"_tree_group",!0).on("mouseover",function(){d3.select(i.root+" .tree_menu").empty()&&(d3.selectAll(i.viz.root_tips+"_tree_menu_tip").style("opacity",1).style("display","block"),c.show()),d3.selectAll(i.root+" .tree_leaf_circle").style("opacity",l)}).on("mouseout",function(){c.hide(),d3.selectAll(i.root+" .tree_leaf_circle").style("opacity",s)}).call(c),d=u.append("g").classed("dendro_tree_container",!0).on("click",function(){d3.select(i.root+" .tree_menu").empty()?(a(t,"open"),c.hide()):a(t,"close")});d3.select(i.root+" .dendro_tree_container").attr("transform","scale(0.9)"),n(t,e);var f=0,p=20;d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=0,e=r,n=p/2,o=0,a=p,i=r,s="M"+t+","+e+", L"+n+", "+o+", L"+a+","+i+" Z";return s}).style("opacity",.35);var _=30;d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=4.3,e=23,r=-5,n=_/2.5,o=5.8,a=_/1.8,i="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return i}).style("opacity",.35),d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=15.7,e=23,r=25,n=_/2.5,o=14.2,a=_/1.8,i="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return i}).style("opacity",.35);var h=13,v=9.5;d.selectAll().data([[-3,h,v],[p/2,0,17],[23,h,v]]).enter().append("circle").classed("tree_leaf_circle",!0).attr("r",function(t){return t[2]}).attr("transform",function(t){return"translate("+t[0]+", "+t[1]+")"}).attr("fill","blue").attr("opacity",s).attr(""),d.append("rect").attr("width",50).attr("height",62).attr("transform",function(){return"translate(-15, -19)"}).attr("opacity",0)}},function(t,e,r){"use strict";var n=r(193);t.exports=function(t,e){var r=t.params;"open"===e?n(t):"close"===e&&(d3.select(r.root+" .tree_menu").transition(700).attr("opacity",0),setTimeout(function(){d3.select(r.root+" .tree_menu").remove()},700))}},function(t,e,r){"use strict";var n=r(194);t.exports=function(t){function e(t){return t.charAt(0).toUpperCase()+t.slice(1)}var r=t.params,o=475,a=d3.select(r.root+" .viz_svg").append("g").attr("transform",function(){var t={};return t.x=r.viz.clust.dim.width+r.viz.clust.margin.left-o+25,t.y=r.viz.clust.margin.top,"translate("+t.x+", "+t.y+")"}).classed("tree_menu",!0);a.attr("opacity",0).transition().attr("opacity",1),a.append("rect").classed("tree_menu_background",!0).attr("width",function(){var t=o;return t}).attr("height",function(){var t=500;return t}).attr("fill","white").attr("stroke","#A3A3A3").attr("stroke-width","3px").attr("opacity",.95),a.append("text").classed("tree_menu_title",!0).attr("transform","translate(20,30)").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-size","18px").attr("font-weight",800).attr("cursor","default").text("Clustering Menu");var i=["cosine","euclidean","correlation","jaccard"],s=30,l=110,c=80;a.append("text").attr("transform","translate(25, 70)").attr("font-size","18px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("cursor","default").text("Distance Metric"),a.append("rect").classed("tree_menu_line",!0).attr("height","2px").attr("width","435px").attr("stroke-width","3px").attr("opacity",.3).attr("fill","black").attr("transform","translate(20,"+c+")");var u=a.append("g").attr("transform","translate(20,"+l+")").classed("distance_section",!0),d=u.selectAll("g").data(i).enter().append("g").attr("transform",function(t,e){var r=e*s,n="translate(0,"+r+")";return n}).on("click",function(e){d3.select(r.root+" .tree_menu").transition(700).attr("opacity",0),setTimeout(function(){d3.select(r.root+" .tree_menu").remove()},700),t.params.matrix.distance_metric=e,n(t,e)});d.append("circle").attr("cx",10).attr("cy",-6).attr("r",7).style("stroke","#A3A3A3").style("stroke-width","2px").style("fill",function(e){var r="white";return e===t.params.matrix.distance_metric&&(r="red"),r}),d.append("text").attr("transform","translate(25,0)").style("font-size","16px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("cursor","default").text(function(t){return e(t)})}},function(t,e,r){"use strict";var n=r(195),o=r(12),a=o.create(),i=r(199),s=r(200),l=r(202);a.import(r(227)),a.import(r(25)),t.exports=function(t,e){var r={};r.N_row_sum="null",r.N_row_var="null",r.dist=e,r.nodes={},r.nodes.row_nodes=$.extend(!0,[],t.params.network_data.row_nodes),r.nodes.col_nodes=$.extend(!0,[],t.params.network_data.col_nodes),_.each(["row","col"],function(o){var l,c,u,d=a.transpose;"row"===o?(l=$.extend(!0,[],t.params.network_data.mat),c=t.params.network_data.row_nodes_names,u="row_nodes"):"col"===o&&(l=$.extend(!0,[],t.params.network_data.mat),l=d(l),c=t.params.network_data.col_nodes_names,u="col_nodes");for(var f,p,_=n.hcluster(l,i[e]),h=s(_,c),v=r.nodes[u],m=0;m=this.threshold)return!1;var a=this.index[t],i=this.index[this.mins[t]],s={dist:e,left:a,right:i,key:a.key,size:a.size+i.size};this.tree[a.index]=s,this.tree.splice(i.index,1),this.index[a.key]=s;for(var r=0;rthis.dists[i.key][l.key]&&(o=this.dists[i.key][l.key])):"complete"==this.linkage?(o=this.dists[a.key][l.key],this.dists[a.key][l.key]r&&(r=t.dist,e=t)}),e}function r(t){return 1===t.size?[t.value]:r(t.left).concat(r(t.right))}(t>this.tree.size||t<1)&&(t=this.tree.size);for(var n=[],o=[this.tree];t>1;){var a=e(o);o.splice(o.indexOf(a),1),o.push(a.left,a.right),t--}return o.forEach(function(t){n.push(r(t))}),n}};var a=function(t,e,r,n,a,i){var s=new o(e,r,n),l=s.tree(t,a,i);return{hc:s,tree:void 0===n?l[0]:l,clusters:s.clusters}};t.exports=a},function(t,e){"use strict";t.exports={euclidean:function(t,e){for(var r=0,n=0;ne&&(e=t)})}),e}},function(t,e,r){"use strict";var n=r(203),o=r(225);t.exports=function(t,e,r){var a={};a[e]=r,n(t,a),o(t,e,r)}},function(t,e,r){"use strict";var n=r(10),o=r(204),a=r(205);t.exports=function(t,e){o(t.params);var r=n(t.config,t.params,e);d3.select(t.params.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!0).classed("fa-undo",!1).classed("active_cropping",!1),_.each(["row","col"],function(e){d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter",!1),d3.select(t.params.root+" ."+e+"_dendro_icons_container").style("display","block")}),a(t,r)}},function(t,e){"use strict";t.exports=function(t){d3.selectAll(t.root+" .btn").attr("disabled",!0),d3.select(t.viz.viz_svg).style("opacity",.7)}},function(t,e,r){"use strict";var n=r(9),o=r(206),a=r(207),i=r(151),s=r(180),l=r(185),c=r(186),u=r(187),d=r(218),f=r(220),p=r(161),_=r(221),h=r(150),v=r(222),m=r(153),g=r(224),y=r(84);t.exports=function(t,e){function r(){d3.selectAll(".dendro_shadow").remove()}function w(){d3.select(t.params.viz.viz_svg).transition().duration(250).style("opacity",1),setTimeout(x,1e3)}function x(){d3.select(t.params.viz.viz_svg).classed("running_update",!1)}d3.select(t.params.viz.viz_svg).classed("running_update",!0),d3.selectAll(t.params.root+" .ds"+String(t.params.viz.ds_level)+"_row").remove(),null!=t.params.matrix_update_callback&&t.params.matrix_update_callback();var b=t.params.matrix.distance_metric,z=t.params.group_level,k=t.params.crop_filter_nodes,A=jQuery.extend(!0,{},t.config),E=null;if(null!=t.params.new_row_cats){v(t.params.new_row_cats,e.row_nodes),E=t.params.new_row_cats,t.params.new_row_cats=E;var N=!0;t.params.viz=y(t.params,t.params.viz,N)}A.network_data=e,A.inst_order=t.params.viz.inst_order,A.input_domain=t.params.matrix.opacity_scale.domain()[1],_(A,t.params),A.ini_view=null,A.current_col_cat=t.params.current_col_cat,A.cat_colors=t.params.viz.cat_colors;var M=n(A),S=o(t.params,M);t.params=M,t.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,t.params.viz.square_zoom*t.params.viz.zoom_ratio.x]).on("zoom",function(){m(t)}),t.params.matrix.distance_metric=b,t.params.group_level=z,t.params.crop_filter_nodes=k,0===t.params.viz.ds_num_levels?a(t,e,S):g(t),d3.select(t.params.viz.viz_svg).style("opacity",.7),l(t),h(t),t.params.viz.show_categories.col&&s(t),t.params.viz.show_dendrogram&&(c(t),u(t)),i(t),d3.select(t.params.viz.viz_svg).call(t.params.zoom_behavior),p(t),d(t),t.params.viz.run_trans=!0,setTimeout(f,2500,t.params),setTimeout(r,50),setTimeout(r,100),setTimeout(r,500),setTimeout(r,1e3),setTimeout(r,1500),setTimeout(w,S.enter)}},function(t,e){"use strict";t.exports=function(t,e){var r=t.network_data.row_nodes,n=t.network_data.col_nodes,o=_.map(r,function(t){return t.name}),a=_.map(n,function(t){return t.name}),i=o.concat(a),s=e.network_data.row_nodes,l=e.network_data.col_nodes,c=_.map(s,function(t){return t.name}),u=_.map(l,function(t){return t.name}),d=c.concat(u),f=_.difference(i,d).length,p=_.difference(d,i).length,h={};f>0?h.update=1e3:h.update=0,p>0?h.enter=1e3:h.enter=0,h.enter=h.enter+h.update,h.run_transition=!0;var v=t.network_data.links.length,m=e.network_data.links.length,g=.5*e.matrix.def_large_matrix;return(v>g||m>g)&&(h.run_transition=!1,h.update=0,h.enter=0),h}},function(t,e,r){"use strict";var n=r(208),o=r(101),a=r(131),i=r(209),s=r(213),l=r(91),c=r(214),u=r(217),d=r(145),f=r(100);t.exports=function(t,e,r){var p=t.params;d3.selectAll(p.viz.root_tips).remove();var _=f().attr("class",function(){var t=p.viz.root_tips.replace(".",""),e=t+" d3-tip "+t+"_tile_tip";return e}).direction("nw").offset([0,0]).style("display","none").html(function(t){var e,r=String(t.value.toFixed(3));if(p.keep_orig){var n=String(t.value_orig.toFixed(3));e="

"+t.row_name+" and "+t.col_name+"

normalized value: "+r+"

original value: "+n+"
"}else e="

"+t.row_name+" and "+t.col_name+"

value: "+r+"
";return e});d3.select(p.root+" .clust_group").call(_),u(p);for(var h=1e3,v=e.row_nodes,m=e.col_nodes,g=e.links,y=g,w=0;w1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null===r&&(r={},r.enter=0,r.update=0,r.run_transition=!1);var b=t.params,z=t.params.network_data.row_nodes;b.zoom_info=x();var k=b.network_data.row_nodes_names;s(b),b=a(b),b.viz=i(b.viz),b.viz=o(b.viz),b.sim_mat&&(b.viz.clust.dim.width<=b.viz.clust.dim.height?b.viz.clust.dim.height=b.viz.clust.dim.width:b.viz.clust.dim.width=b.viz.clust.dim.height),b.viz=w(b.viz),b.viz.x_scale.rangeBands([0,b.viz.clust.dim.width]),b.viz.y_scale.rangeBands([0,b.viz.clust.dim.height]),b.viz.square_zoom=b.viz.norm_labels.width.col/(b.viz.x_scale.rangeBand()/2),b.zoom_behavior.scaleExtent([1,b.viz.square_zoom*b.viz.zoom_ratio.x]),b.viz.border_width.x=b.viz.x_scale.rangeBand()/b.viz.border_fraction,b.viz.border_width.y=b.viz.y_scale.rangeBand()/b.viz.border_fraction,b=y(b);var A=d3.select(b.viz.viz_wrapper).select("svg");A.select(b.root+" .grey_background").transition().delay(r.update).duration(e).attr("width",b.viz.clust.dim.width).attr("height",b.viz.clust.dim.height),d(b,A,r),A.selectAll(".row_label_group").select("text").style("font-size",b.labels.default_fs_row+"px").text(function(t){return n.normal_name(t)}),A.selectAll(".row_label_group").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",b.viz.y_scale.rangeBand()).style("fill","yellow").style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),f(b,A,r),r.run_transition?(A.selectAll(".row_label_group").select("text").transition().delay(r.update).duration(e).attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,function(t){return t.name}).transition().delay(r.update).duration(e).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}),A.selectAll(".row_cat_group").select("path").transition().delay(r.update).duration(e).attr("d",function(){var t=b.viz.cat_room.symbol_width-1,e=0,r=1,n=b.viz.y_scale.rangeBand()/2,o=b.viz.cat_room.symbol_width-1,a=b.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+n+", L "+o+","+a+" Z";return i}),A.selectAll(".row_dendro_group").data(z,function(t){return t.name}).transition().delay(r.update).duration(e).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})):(A.selectAll(".row_label_group").select("text").attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}),A.selectAll(".row_cat_group").select("path").attr("d",function(){var t=b.viz.cat_room.symbol_width-1,e=0,r=1,n=b.viz.y_scale.rangeBand()/2,o=b.viz.cat_room.symbol_width-1,a=b.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+n+", L "+o+","+a+" Z";return i}),A.selectAll(".row_dendro_group").data(z,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})),n.has(b.network_data.row_nodes[0],"value")&&g(t,A),p(b,A,r),h(b,A),v(b,A,r),m(b,A,r),l(b,A,r),c(b,A,r),u(b.viz,A,r),b.zoom_behavior.scale(1).translate([b.viz.clust.margin.left,b.viz.clust.margin.top])}},function(t,e,r){"use strict";var n=r(210),o=r(211),a=r(212),i=r(97),s=r(98),l=r(99),c=r(68);t.exports=function(t,e,r,u,d,f){var p=e.row_data,h=_.filter(p,function(t){return 0!=t.value}),v=d3.select(d).selectAll(".tile").data(h,function(t){return t.col_name});n(t,r,v,p,d);var m=v.on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).attr("fill-opacity",function(e){var r=t.matrix.opacity_scale(Math.abs(e.value));return r}):l.style("fill",function(e){return e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).attr("fill-opacity",function(e){var r=t.matrix.opacity_scale(Math.abs(e.value));return r}),l.each(function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99);t.exports=function(t,e,r,l,c,u,d){var f=_.filter(e,function(t){return 0!=t.value_up||0!=t.value_dn}),p=d3.select(r).selectAll(".tile_up").data(f,function(t){return t.col_name}),h=p.on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e){"use strict";t.exports=function(t,e,r){var n=t.network_data.row_nodes,o=t.network_data.col_nodes,a=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).exit();e.run_transition?a.transition().duration(r).style("opacity",0).remove():a.style("opacity",0).remove(),d3.selectAll(t.root+" .row_label_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_cat_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_dendro_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_text").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .horz_lines").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .vert_lines").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_cat_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_dendro_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove()}},function(t,e,r){"use strict";var n=r(215);t.exports=function(t,e,r,o){var a=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).enter().append("g").classed("row",!0).attr("transform",function(e){return"translate(0,"+t.viz.y_scale(e.row_index)+")"});a.each(function(a){n(t,a,e,r,o,this)})}},function(t,e,r){"use strict";var n=r(216),o=r(97),a=r(98),i=r(99);t.exports=function(t,e,r,s,l,c){var u=e.row_data,d=_.filter(u,function(t){return 0!==t.value}),f=d3.select(c).selectAll("rect").data(d,function(t){return t.col_name}).enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",t.viz.rect_height).style("fill",function(e){return e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r});var f=d3.select(r).selectAll(".tile_dn").data(u,function(t){return t.col_name}).enter().append("path").attr("class","tile_dn").attr("d",function(){return o(t)}).attr("transform",function(e){return a(t,e)}).style("fill",function(){return t.matrix.tile_colors[1]}).on("mouseover",function(e){d3.selectAll(t.root+" .row_label_group text").classed("active",function(t){return e.row_name===t.name}),d3.selectAll(t.root+" .col_label_text text").classed("active",function(t){return e.col_name===t.name}),t.matrix.show_tile_tooltips&&i.show(e)}).on("mouseout",function(){d3.selectAll(t.root+" text").classed("active",!1),t.matrix.show_tile_tooltips&&i.hide()});f.style("fill-opacity",0).transition().delay(s.enter).duration(l).style("fill-opacity",function(e){var r=0;return Math.abs(e.value_up)>0&&(r=t.matrix.opacity_scale(Math.abs(e.value_dn))),r}),c.each(function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e){"use strict";t.exports=function(t){d3.select(t.root+" .clust_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.clust.margin.top+")"),d3.select(t.root+" .col_label_outer_container").attr("transform","translate(0,"+t.viz.norm_labels.width.col+")"),d3.select(t.root+" .col_cat_outer_container").attr("transform",function(){var e=t.viz.norm_labels.width.col+2;return"translate(0,"+e+")"})}},function(t,e,r){"use strict";var n=(r(190),r(143)),o=r(142),a=r(219);t.exports=function(t){function e(e,r){var n=2-r,o=t.params.matrix.abs_max_val*n;t.params.matrix.opacity_scale.domain([0,o]),d3.selectAll(t.params.root+" .tile").style("fill-opacity",function(e){var r=t.params.matrix.opacity_scale(Math.abs(e.value));return r})}var r=t.params,i=d3.select(r.root+" .gene_search_box")[0][0],s=new Awesomplete(i,{minChars:1,maxItems:15}),l=t.params.network_data.row_nodes_names;s.list=l,d3.selectAll(".awesomplete ul").style("z-index",99),$(r.root+" .gene_search_box").keyup(function(e){if(13===e.keyCode){var n=$(r.root+" .gene_search_box").val();a(t,n,l)}}),$(r.root+" .submit_gene_button").off().click(function(){var e=$(r.root+" .gene_search_box").val();a(t,e,l)});var c;if(c=r.sim_mat?["both"]:["row","col"],_.each(c,function(e){$(r.root+" .toggle_"+e+"_order .btn").off().click(function(o){var a=$(o.target).attr("name").replace("_row","").replace("_col","");d3.selectAll(r.root+" .toggle_"+e+"_order .btn").classed("active",!1),d3.select(this).classed("active",!0),"both"!=e?n(t,a,e):(n(t,a,"row"),n(t,a,"col"))})}),o(t),d3.select(t.params.root+" .opacity_slider").select("#handle-one").empty()){var u=d3.slider().snap(!0).value(1).min(.1).max(1.9).step(.1).on("slide",function(t,r){e(t,r)});d3.select(t.params.root+" .opacity_slider").call(u)}}},function(t,e,r){"use strict";var n=r(144);t.exports=function(t,e,r){var o="name";if(r.indexOf(e)!==-1){d3.selectAll(t.params.root+" .row_label_group").select("rect").style("opacity",0);var a=_.indexOf(r,e),i=t.params.viz.y_scale(a),s=t.params.viz.clust.dim.height/2-i,l=t.params.viz.zoom_ratio.x; +n(t,0,s,l),t.params.zoom_info.zoom_y=l,d3.selectAll(t.params.root+" .row_label_group").filter(function(t){return t[o]===e}).select("rect").style("opacity",1)}}},function(t,e){"use strict";t.exports=function(t){t.dendro_filter.row===!1&&"clust"===t.viz.inst_order.col&&d3.select(t.root+" .row_slider_group").style("opacity",1).style("pointer-events","all"),d3.selectAll(t.root+" .toggle_row_order .btn").attr("disabled",null),t.dendro_filter.col===!1&&"clust"===t.viz.inst_order.row&&d3.select(t.root+" .col_slider_group").style("opacity",1).style("pointer-events","all"),d3.selectAll(t.root+" .toggle_col_order .btn").attr("disabled",null),d3.selectAll(t.root+" .gene_search_button .btn").attr("disabled",null),t.viz.run_trans=!1}},function(t,e){"use strict";t.exports=function(t,e){_.each(["row","col"],function(r){var n;n="row"===r?"col":"row",d3.selectAll(e.root+" .toggle_"+n+"_order .btn").filter(function(){return d3.select(this).attr("name")===t.inst_order[r]}).classed("active",!0)})}},function(t,e,r){"use strict";var n=r(223),o=r(2),a=r(68);t.exports=function(t,e){var r,i,s,l,c,u,d,f,p=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=0,v=0;_.each(e,function(e){l=e.name,p===!0&&(l.indexOf(" ")?l=l.split(" ")[0]:l.indexOf("_")&&(l=l.split("_")[0])),h=0,n(e),_.each(t,function(t){if(r=t.cat_title,i=t.cats,c="false",v=-1,f=0,_.each(i,function(t){u=t.cat_name,s=t.members,a.contains(s,l)&&(c=u,v=f),f+=1}),o.has(t,"pval")){var n=t.pval.toExponential();d=r+": "+c+"

Pval "+String(n)+"

"}else d=r.indexOf("cat-")===-1?r+": "+c:c;e["cat-"+String(h)]=d,e["cat_"+String(h)+"_index"]=v,h+=1})})}},function(t,e){"use strict";t.exports=function(t){var e=_.keys(t);_.each(e,function(e){e.indexOf("cat-")>-1&&delete t[e],e.indexOf("cat_")>-1&&delete t[e]})}},function(t,e,r){"use strict";var n=r(208),o=r(131),a=r(134),i=r(217);t.exports=function(t){d3.selectAll(t.params.root+" .row_cat_group").remove(),d3.selectAll(t.params.root+" .row_label_group").remove(),d3.selectAll(t.params.root+" .row").remove();var e=!0,r=!0,s=!0;a(t,e,r,s),o(t);var l=t.params.network_data.col_nodes;d3.selectAll(t.params.root+" .col_label_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_label_text").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_cat_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_dendro_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),i(t.params);var c={};c.enter=0,c.update=0,c.run_transition=!1;var u=0;n(t,u,c)}},function(t,e,r){"use strict";var n=r(226);t.exports=function(t,e,r){var o,a,i=t.params;d3.select(i.root+" .slider_"+e).attr("current_state",r),_.each(_.keys(i.viz.possible_filters),function(r){if(o=e.indexOf("row")>-1?"row":e.indexOf("col")>-1?"col":"neither",a=r.indexOf("row")>-1?"row":r.indexOf("col")>-1?"col":"neither",e!=r&&"neither"!=o&&o==a){var s=n(i,r);t.slider_functions[r].value(0),d3.select(i.root+" .title_"+r).text(s.text+s.state),d3.select(i.root+" .slider_"+r).attr("current_state",s.state)}});var s=n(i,e);d3.select(i.root+" .title_"+e).text(s.text+r+s.suffix)}},function(t,e,r){"use strict";var n=r(5);t.exports=function(t,e){var r={},o={},a={};return r.state=n(t.viz.filter_data,e),a.top=e.split("_")[0],a.node=e.split("_")[1],a.measure=e.split("_")[2],"row"===a.node?o.node="rows":o.node="columns","N"===a.top&&(r.suffix=""),"pct"===a.top&&(r.suffix="%"),"sum"==a.measure?o.measure="sum":"var"==a.measure&&(o.measure="variance"),"sum"===a.measure&&(r.text="Top "+o.node+" "+o.measure+": "),"var"===a.measure&&(r.text="Top "+o.node+" "+o.measure+": "),_.keys(t.viz.possible_filters).indexOf("enr_score_type")>-1&&"col"===a.node&&(r.text="Top Enriched Terms: ",r.suffix=""),r}},function(t,e,r){"use strict";function n(t,e,n,i){var s=r(45),l=n(r(43)),c=t.DenseMatrix,u=t.SparseMatrix,d=i("transpose",{Array:function(t){return d(l(t)).valueOf()},Matrix:function(t){var e,r=t.size();switch(r.length){case 1:e=t.clone();break;case 2:var n=r[0],o=r[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+a(r)+")");switch(t.storage()){case"dense":e=f(t,n,o);break;case"sparse":e=p(t,n,o)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+a(this._size)+")")}return e},any:function(t){return o(t)}}),f=function(t,e,r){for(var n,a=t._data,i=[],s=0;s2&&void 0!==arguments[2]?arguments[2]:4e3;e.indexOf("slider")<0?d3.select(t.root+" ."+e).style("background","#007f00").style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("background","#FFFFFF").style("box-shadow","none"):d3.select(t.root+" ."+e).style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("box-shadow","none")}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(144);t.exports=function(){function t(t){var e=t.params,s="Search for rows using\nthe search box";n(e,s,5e3);var l=2500;setTimeout(o,l,e,"gene_search_container"),setTimeout(r,l+1e3,e,"E"),setTimeout(r,l+1500,e,"EG"),setTimeout(r,l+2e3,e,"EGF"),setTimeout(r,l+2500,e,"EGFR"),setTimeout(i,5500,e),setTimeout(a,7500,t,0,0,1)}function e(){return 1e4}function r(t,e){$(t.root+" .gene_search_box").val(e),$(t.root+" .gene_search_box").autocomplete("search",e)}function i(t){$(t.root+" .submit_gene_button").click(),$(t.root+" .gene_search_box").autocomplete("search","")}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(203);t.exports=function(){function t(t){var e=t.params,a="Filter rows based on sum or\nvariance using the sliders";n(e,a,4e3);var i="N_row_sum";setTimeout(o,5e3,e,"slider_"+i,13e3),a="Filter: Top 20 rows by sum",setTimeout(n,5e3,e,a,4e3),setTimeout(r,5300,t,i,20,1),a="Filter: Top 10 rows by sum",setTimeout(n,1e4,e,a,4e3),setTimeout(r,10300,t,i,10,2),a="Filter: All rows",setTimeout(n,15e3,e,a,4e3),setTimeout(r,15300,t,i,"all",0)}function e(){return 19500}function r(t,e,r,n){var o=t.params,i={};i[e]=r,a(t,i),$(o.root+" .slider_"+e).slider("value",n);var s;s="N_row_sum"===e?"sum":"variance",d3.select(o.root+" .title_"+e).text("Top rows "+s+": "+r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(235);t.exports=function(){function t(t){var e=Number(d3.select(t.root+" .expand_button").attr("x").replace("px","")),a=Number(d3.select(t.root+" .expand_button").attr("y").replace("px","")),i=0,s=400;setTimeout(n,i,t,"single",e,a),setTimeout(r,s,t),setTimeout(o,1500,t)}function e(){return 3500}function r(t){$(t.root+" .expand_button").d3Click()}function o(t){a(t,"row","clust"),a(t,"col","clust")}function a(t,e,r){var n=d3.selectAll(".toggle_"+e+"_order .btn").filter(function(){return this.__data__==r})[0];$(n).click()}return jQuery.fn.d3Click=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(190);t.exports=function(){function t(t){var e="Identify row and column groups\nof varying sizes using the\nsliders and dendrogram";n(t,e,1e4),setTimeout(o,3e3,t,"slider_col",7e3),setTimeout(r,4e3,t,"row",3),setTimeout(r,5e3,t,"row",4),setTimeout(r,6e3,t,"row",5),setTimeout(r,7e3,t,"row",6),setTimeout(r,8e3,t,"row",7),setTimeout(r,9e3,t,"row",5)}function e(){return 11e3}function r(t,e,r){$(cgm.params.root+" .slider_col").slider("value",r/10),a(cgm,e,r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(235);t.exports=function(){function t(t){var e="Row and column categories\ncan be use to reorder\nby double-clicking";n(t,e,7e3);var a=d3.selectAll(t.root+" .col_cat_super").filter(function(){return"cat-1"===this.__data__})[0],i=d3.select(".col_cat_super").attr("transform"),s=Number(i.split("(")[1].split(",")[0].replace(")",""))+20,l=Number(i.split(",")[1].replace(")","")),c=4e3;setTimeout(o,c,t,"double",s,l);var u=c+300;setTimeout(r,u,t,a)}function e(){return 8e3}function r(t,e){$(e).d3DblClick()}return jQuery.fn.d3DblClick=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("dblclick",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(245);t.exports=function(){function t(t){var r="Clustergrammer is built with gene\nexpression data in mind and interfaces\nwith several Ma'ayan lab web tools",o="The example data being visualized is\ngene expression data obtained from the\nCancer Cell Line Encyclopedia",a="For more information please view\nthe help documentation";setTimeout(n,0,t,r,4500),setTimeout(n,4500,t,o,4500),setTimeout(n,9e3,t,a,4500),setTimeout(e,14e3,t)}function e(t){d3.select(t.root+" .play_button").classed("running_demo",!1),o(t,!0)}function r(){return 12e3}return{run:t,get_duration:r}}},function(t,e){"use strict";t.exports=function(t,e){e===!1?d3.select(t.root+" .play_button").transition().duration(500).style("opacity",0):(d3.select(t.root+" .play_button").transition().duration(500).style("opacity",1),$.unblockUI())}},function(t,e,r){"use strict";var n=r(232),o=r(235);t.exports=function(){function t(t){var e="View additional controls\nby clicking the menu button";n(t,e,4e3);var a=Number(d3.select(t.root+" .expand_button").attr("x").replace("px","")),i=Number(d3.select(t.root+" .expand_button").attr("y").replace("px","")),s=3e3,l=3400;setTimeout(o,s,t,"single",a,i),setTimeout(r,l,t)}function e(){return 5e3}function r(t){$(t.root+" .expand_button").d3Click()}return jQuery.fn.d3Click=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},jQuery.fn.d3DblClick=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("dblclick",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(248),o=r(249);t.exports=function(){var t=this,e=t.params;n(t);var r=30;o(e,r)}},function(t,e,r){"use strict";var n=r(177);t.exports=function(t){var e=t.params;if(d3.select(e.root+" .play_button").empty()){var r=d3.select(e.root+" .viz_svg").append("g").classed("play_button",!0).classed("running_demo",!1);n(e),r.append("circle").style("r",45).style("fill","white").style("stroke","black").style("stroke-width","3px").style("opacity",.5),r.append("path").attr("d",function(){var t=40,e=22,r=15;return"M-"+r+",-"+e+" l "+t+","+e+" l -"+t+","+e+" z "}).style("fill","black").style("opacity",.5),r.on("mouseover",function(){d3.select(this).select("path").style("fill","red").style("opacity",1),d3.select(this).select("circle").style("opacity",1)}).on("mouseout",function(){d3.select(this).select("path").style("fill","black").style("opacity",.5),d3.select(this).select("circle").style("opacity",.5)}).on("click",function(){t.play_demo()})}}},function(t,e){"use strict";t.exports=function(t,e){if(d3.select(t.root+" .demo_group").empty()){var r=d3.select(t.root+" .clust_container").attr("transform"),n=Number(r.split("(")[1].split(",")[0]),o=Number(r.split(",")[1].replace(")","")),a=d3.select(t.root+" .viz_svg").append("g").classed("demo_group",!0).attr("transform",function(){var t=n+20,e=o+40;return"translate("+t+","+e+")"});a.append("rect").classed("rect_1",!0),a.append("rect").classed("rect_2",!0),a.append("rect").classed("rect_3",!0);var i=1.3*e;a.append("text").attr("id","text_1").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),a.append("text").attr("id","text_2").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",function(){return"translate(0,"+String(i)+")"}),a.append("text").attr("id","text_3").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",function(){return"translate(0,"+String(2*i)+")"})}}},function(t,e,r){"use strict";var n=r(11),o=r(205);t.exports=function(t){var e=n(this.config,t);o(this,e)}},function(t,e,r){"use strict";var n=r(11),o=r(205);t.exports=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=r===!1?this:r;var a,i=e.params,s={};_.each(["row","col"],function(e){var r=i.inst_nodes[e+"_nodes"];if(_.has(t,e))if(t[e].length>0){var n=t[e];a=$.grep(r,function(t){return $.inArray(t.name,n)>-1})}else a=r;else a=r;s[e+"_nodes"]=a});var l=e.params.network_data.row_nodes,c=e.params.network_data.col_nodes,u=n(e.config,s);o(e,u),l.length>e.params.inst_nodes.row_nodes.length&&(e.params.inst_nodes.row_nodes=l),c.length>e.params.inst_nodes.col_nodes.length&&(e.params.inst_nodes.col_nodes=c)}},function(t,e,r){"use strict";var n=r(185),o=r(66),a=r(152),i=r(222);t.exports=function(t,e){null!=t.params.cat_update_callback&&t.params.cat_update_callback(this);var r=t.params.viz.cat_colors.col;i(e,t.params.network_data.row_nodes,!0),i(e,t.params.inst_nodes.row_nodes,!0),t.params=o(t.params,!1),n(t,!0),a(t),t.params.new_row_cats=e,t.params.viz.cat_colors.col=r}},function(t,e,r){"use strict";var n=r(185),o=r(66),a=r(152),i=r(222),s=r(254);t.exports=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this,r=s(e),l=e.params.viz.cat_colors.col;if(i(r,e.params.network_data.row_nodes),i(r,e.params.inst_nodes.row_nodes),e.params.new_row_cats=r,e.params.viz.cat_colors.col=l,t){var c=!0;e.params=o(e.params,c),n(e,!0),a(e)}}},function(t,e){"use strict";t.exports=function(t){function e(t,e,o){r={},r.cat_title=t,r.cats=[],n={},n.cat_name=e,n.members=[],n.members.push(o),r.cats.push(n),f.push(r)}var r,n,o,a,i,s,l,c,u=t.config.network_data.row_nodes,d=": ",f=[],p=u[0],h=_.keys(p),v={};_.each(h,function(t){t.indexOf("cat-")>=0&&(s=p[t],c=parseInt(t.split("cat-")[1],10),l=s.indexOf(d)>=0?s.split(d)[0]:t,v[c]=l)});var m,g=_.keys(v).sort();return _.each(g,function(t){m={},m.cat_title=v[t],m.cats=[],f.push(m)}),_.each(u,function(t){var r=_.keys(t);_.each(r,function(r){if(r.indexOf("cat-")>-1){i=t[r],c=parseInt(r.split("cat-")[1],10);var s=r;i=t[r];var l=t[r],u=t.name;l.indexOf(d)>-1?(s=l.split(d)[0],i=l.split(d)[1]):(s=r,i=l),0===f.length?e(s,i,u):(o=!1,_.each(f,function(t){s===t.cat_title&&(o=!0,a=!1,_.each(t.cats,function(t){i===t.cat_name&&(a=!0,t.members.push(u))}),a===!1&&(n={},n.cat_name=i,n.members=[],n.members.push(u),t.cats.push(n)))}))}})}),f}},function(t,e,r){"use strict";var n=r(256),o=r(257);t.exports=function(){var t=n(),e=this.params,r=o(e),a=new Blob([r],{type:"text/plain;charset=utf-8"});t(a,"clustergrammer.txt")}},function(t,e){"use strict";t.exports=function(){/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ var t=t||navigator.msSaveBlob&&navigator.msSaveBlob.bind(navigator)||function(t){var e=t.document,r=function(){return t.URL||t.webkitURL||t},n=t.URL||t.webkitURL||t,o=e.createElementNS("http://www.w3.org/1999/xhtml","a"),a="download"in o,i=function(r){var n=e.createEvent("MouseEvents");n.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(n)},s=t.webkitRequestFileSystem,l=t.requestFileSystem||s||t.mozRequestFileSystem,c=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},u="application/octet-stream",d=0,f=[],p=function(){for(var t=f.length;t--;){var e=f[t];"string"==typeof e?n.revokeObjectURL(e):e.remove()}f.length=0},_=function(t,e,r){e=[].concat(e);for(var n=e.length;n--;){var o=t["on"+e[n]];if("function"==typeof o)try{o.call(t,r||t)}catch(t){c(t)}}},h=function(e,n){var c,p,h,v=this,m=e.type,g=!1,y=function(){var t=r().createObjectURL(e);return f.push(t),t},w=function(){_(v,"writestart progress write writeend".split(" "))},x=function(){!g&&c||(c=y(e)),p&&(p.location.href=c),v.readyState=v.DONE,w()},b=function(t){return function(){if(v.readyState!==v.DONE)return t.apply(this,arguments)}},z={create:!0,exclusive:!1};return v.readyState=v.INIT,n||(n="download"),a?(c=y(e),o.href=c,o.download=n,i(o),v.readyState=v.DONE,void w()):(t.chrome&&m&&m!==u&&(h=e.slice||e.webkitSlice,e=h.call(e,0,e.size,u),g=!0),s&&"download"!==n&&(n+=".download"),p=m===u||s?t:t.open(),l?(d+=e.size,void l(t.TEMPORARY,d,b(function(t){t.root.getDirectory("saved",z,b(function(t){var r=function(){t.getFile(n,z,b(function(t){t.createWriter(b(function(r){r.onwriteend=function(e){p.location.href=t.toURL(),f.push(t),v.readyState=v.DONE,_(v,"writeend",e)},r.onerror=function(){var t=r.error;t.code!==t.ABORT_ERR&&x()},"writestart progress write abort".split(" ").forEach(function(t){r["on"+t]=v["on"+t]}),r.write(e),v.abort=function(){r.abort(),v.readyState=v.DONE},v.readyState=v.WRITING}),x)}),x)};t.getFile(n,{create:!1},b(function(t){t.remove(),r()}),b(function(t){t.code===t.NOT_FOUND_ERR?r():x()}))}),x)}),x)):void x())},v=h.prototype,m=function(t,e){return new h(t,e)};return v.abort=function(){var t=this;t.readyState=t.DONE,_(t,"abort")},v.readyState=v.INIT=0,v.WRITING=1,v.DONE=2,v.error=v.onwritestart=v.onprogress=v.onwrite=v.onabort=v.onerror=v.onwriteend=null,t.addEventListener("unload",p,!1),m}(self);return t}},function(t,e,r){"use strict";var n=r(258);t.exports=function(t){var e,r=t.matrix,o={};_.each(["row","col"],function(n){var a;a="row"===n?"col":"row",e=t.inst_order[n],o[a]=r.orders[e+"_"+n]});for(var a="\t",i=t.network_data.row_nodes,s=t.network_data.col_nodes,l=0;l0){o="('"+o+"'";for(var i=0;ie&&(t=i[0],e=a[0]),r>n&&(r=i[1],n=a[1]),r-=o.viz.rect_height,t-=o.viz.rect_width;var s={};return s.row=[],s.col=[],_.each(o.matrix.matrix,function(t){var e=o.viz.y_scale(t.row_index);e>r&&et&&o=i[1])return;if(1===y)"array"==a(i)&&2==i.length&&("left"===d?u.style("left",l):u.style("bottom",l)),h?c.transition().styleTween(d,function(){return t.interpolate(o,l)}).duration("number"==typeof h?h:250):c.style(d,l);else{var f=100-parseFloat(l),p=100-parseFloat(l);"left"===d?u.style("right",f+"%"):u.style("top",p+"%"),h?k.transition().styleTween(d,function(){return t.interpolate(o,l)}).duration("number"==typeof h?h:250):k.style(d,l)}}}function n(t){if(t===s.domain()[0]||t===s.domain()[1])return t;var e=t;if(w)e=o(s(t));else{var r=(t-s.domain()[0])%_;e=t-r,2*Math.abs(r)>=_&&(e+=r>0?_:-_)}return e}function o(t){var e=s.ticks?s.ticks():s.domain(),r=e.map(function(e){return t-s(e)}),n=-1,o=0,a=s.ticks?s.range()[1]:s.rangeExtent()[1];do n++,Math.abs(r[n])0&&n-1)this._list=t.split(/\s*,\s*/);else if(t=o(t),t&&t.children){var e=[];l.apply(t.children).forEach(function(t){if(!t.disabled){var r=t.textContent.trim(),n=t.value||r,o=t.label||r;""!==n&&e.push({label:o,value:n})}}),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return!this.ul.hasAttribute("hidden")},close:function(t){this.opened&&(this.ul.setAttribute("hidden",""),this.index=-1,o.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.ul.removeAttribute("hidden"),this.autoFirst&&this.index===-1&&this.goto(0),o.fire(this.input,"awesomplete-open")},next:function(){var t=this.ul.children.length;this.goto(this.index-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.status.textContent=e[t].textContent,o.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e){if(t?this.index=o.siblingIndex(t):t=this.ul.children[this.index],t){var r=this.suggestions[this.index],n=o.fire(this.input,"awesomplete-select",{text:r,origin:e||t});n&&(this.replace(r),this.close({reason:"select"}),o.fire(this.input,"awesomplete-selectcomplete",{text:r}))}},evaluate:function(){var t=this,e=this.input.value;e.length>=this.minChars&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(n){return new r(t.data(n,e))}).filter(function(r){return t.filter(r,e)}).sort(this.sort).slice(0,this.maxItems),this.suggestions.forEach(function(r){t.ul.appendChild(t.item(r,e))}),0===this.ul.children.length?this.close({reason:"nomatches"}):this.open()):this.close({reason:"nomatches"})}},s.all=[],s.FILTER_CONTAINS=function(t,e){return RegExp(o.regExpEscape(e.trim()),"i").test(t)},s.FILTER_STARTSWITH=function(t,e){return RegExp("^"+o.regExpEscape(e.trim()),"i").test(t)},s.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t$&");return o.create("li",{innerHTML:r,"aria-selected":"false"})},s.REPLACE=function(t){this.input.value=t.value},s.DATA=function(t){return t},Object.defineProperty(r.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),r.prototype.toString=r.prototype.valueOf=function(){return""+this.label};var l=Array.prototype.slice;return o.create=function(t,e){var r=document.createElement(t);for(var n in e){var a=e[n];if("inside"===n)o(a).appendChild(r);else if("around"===n){var i=o(a);i.parentNode.insertBefore(r,i),r.appendChild(i)}else n in r?r[n]=a:r.setAttribute(n,a)}return r},o.bind=function(t,e){if(t)for(var r in e){var n=e[r];r.split(/\s+/).forEach(function(e){t.addEventListener(e,n)})}},o.fire=function(t,e,r){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0);for(var o in r)n[o]=r[o];return t.dispatchEvent(n)},o.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},o.siblingIndex=function(t){for(var e=0;t=t.previousElementSibling;e++);return e},"undefined"!=typeof Document&&("loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i)),s.$=o,s.$$=a,"undefined"!=typeof self&&(self.Awesomplete=s),"object"===e(t)&&t.exports&&(t.exports=s),s}()}).call(e,r(264)(t))},function(t,e){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,r){var n=r(266);"string"==typeof n&&(n=[[t.id,n,""]]);r(268)(n,{});n.locals&&(t.exports=n.locals)},function(t,e,r){e=t.exports=r(267)(),e.push([t.id,".d3-slider{position:relative;font-family:Verdana,Arial,sans-serif;font-size:1.1em;border:1px solid #aaa;z-index:2}.d3-slider-horizontal{height:.8em}.d3-slider-range{height:.8em}.d3-slider-range,.d3-slider-range-vertical{background:#2980b9;left:0;right:0;position:absolute}.d3-slider-range-vertical{top:0}.d3-slider-vertical{width:.8em;height:100px}.d3-slider-handle{position:absolute;width:1.2em;height:1.2em;border:1px solid #d3d3d3;border-radius:4px;background:#eee;background:linear-gradient(180deg,#eee 0,#ddd);z-index:3}.d3-slider-handle:hover{border:1px solid #999}.d3-slider-horizontal .d3-slider-handle{top:-.3em;margin-left:-.6em}.d3-slider-axis{position:relative;z-index:1}.d3-slider-axis-bottom{top:.8em}.d3-slider-axis-right{left:.8em}.d3-slider-axis path{stroke-width:0;fill:none}.d3-slider-axis line{fill:none;stroke:#aaa;shape-rendering:crispEdges}.d3-slider-axis text{font-size:11px}.d3-slider-vertical .d3-slider-handle{left:-.25em;margin-left:0;margin-bottom:-.6em}",""])},function(t,e){"use strict";t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e=0&&y.splice(e,1)}function s(t){var e=document.createElement("style");return e.type="text/css",a(t,e),e}function l(t){var e=document.createElement("link");return e.rel="stylesheet",a(t,e),e}function c(t,e){var r,n,o;if(e.singleton){var a=g++;r=m||(m=s(e)),n=u.bind(null,r,a,!1),o=u.bind(null,r,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=l(e),n=f.bind(null,r),o=function(){i(r),r.href&&URL.revokeObjectURL(r.href)}):(r=s(e),n=d.bind(null,r),o=function(){i(r)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}function u(t,e,r,n){var o=r?"":n.css;if(t.styleSheet)t.styleSheet.cssText=w(e,o);else{var a=document.createTextNode(o),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(a,i[e]):t.appendChild(a)}}function d(t,e){var r=e.css,n=e.media;if(n&&t.setAttribute("media",n),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}function f(t,e){var r=e.css,n=e.sourceMap;n&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var o=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(o),a&&URL.revokeObjectURL(a)}var p={},_=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},h=_(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),v=_(function(){return document.head||document.getElementsByTagName("head")[0]}),m=null,g=0,y=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=h()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var r=o(t);return n(r,e),function(t){for(var a=[],i=0;iinput{display:block}div.awesomplete>ul{position:absolute;left:0;z-index:1;min-width:100%;box-sizing:border-box;list-style:none;padding:0;border-radius:.3em;margin:.2em 0 0;background:hsla(0,0%,100%,.9);background:linear-gradient(to bottom right,#fff,hsla(0,0%,100%,.8));border:1px solid rgba(0,0,0,.3);box-shadow:.05em .2em .6em rgba(0,0,0,.2);text-shadow:none}div.awesomplete>ul:empty,div.awesomplete>ul[hidden]{display:none}@supports (transform:scale(0)){div.awesomplete>ul{transition:.3s cubic-bezier(.4,.2,.5,1.4);transform-origin:1.43em -.43em}div.awesomplete>ul:empty,div.awesomplete>ul[hidden]{opacity:0;transform:scale(0);display:block;transition-timing-function:ease}}div.awesomplete>ul:before{content:"";position:absolute;top:-.43em;left:1em;width:0;height:0;padding:.4em;background:#fff;border:inherit;border-right:0;border-bottom:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}div.awesomplete>ul>li{position:relative;padding:.2em .5em;cursor:pointer}div.awesomplete>ul>li:hover{background:#b8d3e0;color:#000}div.awesomplete>ul>li[aria-selected=true]{background:#3d6d8f;color:#fff}div.awesomplete mark{background:#eaff00}div.awesomplete li:hover mark{background:#b5d100}div.awesomplete li[aria-selected=true] mark{background:#3d6b00;color:inherit}',""])},function(t,e,r){"use strict";var n=r(218),o=r(272),a=r(277),i=r(278),s=r(279),l=r(280),c=r(282),u=r(284),d=r(285);t.exports=function t(e){var r=e.params,t=d3.select(r.root+" .sidebar_wrapper");r.viz.is_expand&&t.style("display","none"),t.append("div").classed("title_section",!0),null!=r.sidebar.title&&t.select(".title_section").append("h4").style("margin-left","20px").style("margin-top","5px").style("margin-bottom","0px").text(r.sidebar.title),t.append("div").style("padding-right","2px").classed("about_section",!0),null!=r.sidebar.about&&t.select(".about_section").append("h5").classed("sidebar_text",!0).style("margin-left","7px").style("margin-top","5px").style("margin-bottom","2px").style("text-align","justify").html(r.sidebar.about),t.append("div").classed("icons_section",!0).style("text-align","center"),e.params.make_modals&&c(r),r.sidebar.icons&&l(e,t),i(r,t),a(t,r),u(t);var f=_.keys(r.viz.possible_filters);f.indexOf("enr_score_type")>-1&&f.sort(function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())}),e.slider_functions={},_.each(f,function(t){o(e,t)}),n(e),null!==r.ini_view&&(s(r),r.ini_view=null),d(e)}},function(t,e,r){"use strict";var n=r(273),o=r(276);t.exports=function(t,e){var r=t.params,a=d3.select(r.root+" .sidebar_wrapper").append("div").classed("div_filters",!0).style("padding-left","10px").style("padding-right","10px");"numerical"==r.viz.possible_filters[e]?n(t,e,a):"categorical"==r.viz.possible_filters[e]&&o(t,e,a)}},function(t,e,r){"use strict";var n=r(226),o=r(274),a=r(5),i=r(63);d3.slider=r(261),t.exports=function(t,e,r){var s=t.params,l={},c=_.keys(s.viz.possible_filters);_.each(c,function(t){if(t!=e){var r=a(s.viz.filter_data,t);l[t]=r}});var u=n(s,e);r.append("div").classed("title_"+e,!0).classed("sidebar_text",!0).classed("slider_description",!0).style("margin-top","5px").style("margin-bottom","3px").text(u.text+u.state+u.suffix),r.append("div").classed("slider_"+e,!0).classed("slider",!0).attr("current_state",u.state);var d=s.network_data.views,f=i(s,d,l);f=f.sort(function(t,r){return r[e]-t[e]});var p=f.length-1,h=0;if(null!==s.requested_view&&e in s.requested_view){var v=s.requested_view[e];if("all"!=v){var m=f.map(function(t){return t[e]}).indexOf(v);m>0&&(h=m)}}var g=d3.slider().value(h).min(0).max(p).step(1).on("slide",function(r,n){y(t,e,f,n)}).on("slideend",function(r,n){y(t,e,f,n)});t.slider_functions[e]=g,d3.select(t.params.root+" .slider_"+e).call(g);var y=_.debounce(o,800)}},function(t,e,r){"use strict";var n=r(203),o=r(225),a=r(275),i=r(65);t.exports=function(t,e,r,s){if(d3.select(t.params.viz.viz_svg).classed("running_update")===!1){var l=t.params,c=r[s][e];o(t,e,c),l=a(l);var u={};if(u[e]=c,u=i(l,u),_.has(r[0],"enr_score_type")){var d=d3.select(l.root+" .toggle_enr_score_type").attr("current_state");u.enr_score_type=d}n(t,u)}}},function(t,e){"use strict";t.exports=function(t){var e;return _.each(["row","col"],function(r){e="row"===r?"col":"row",d3.select(t.root+" .toggle_"+e+"_order .active").empty()===!1?t.viz.inst_order[r]=d3.select(t.root+" .toggle_"+e+"_order").select(".active").attr("name"):t.viz.inst_order[r]="clust"}),t}},function(t,e,r){"use strict";var n=r(65);t.exports=function(t,e,r,o){var a=o.append("div").classed("categorical_filter",!0).classed("toggle_"+r,!0).classed("btn-group-vertical",!0).style("width","100%").style("margin-top","10px").attr("current_state","combined_score"),i=e.viz.filter_data[r],s={combined_score:"Combined Score",pval:"P-Value",zscore:"Z-score"};a.selectAll("button").data(i).enter().append("button").attr("type","button").classed("btn",!0).classed("btn-primary",!0).classed(".filter_button",!0).classed("active",function(t){var e=!1;return"combined_score"==t&&(e=!0),e}).attr("name",function(t){return t}).html(function(t){return s[t]}),$(e.root+" .categorical_filter .btn").off().click(function(){d3.selectAll(e.root+" .categorical_filter .btn").classed("active",!1),d3.select(this).classed("active",!0);var t=d3.select(this).attr("name"),r={enr_score_type:t};n(e,r),d3.select(e.root+" .toggle_enr_score_type").attr("current_state",t)})}},function(t,e){"use strict";t.exports=function(t,e){var r=t.append("div").classed("gene_search_container",!0).style("padding-left","10px").style("padding-right","10px").style("margin-top","10px");r.append("input").classed("form-control",!0).classed("gene_search_box",!0).classed("sidebar_text",!0).attr("type","text").attr("placeholder",e.sidebar.row_search.placeholder).style("height",e.sidebar.row_search.box.height+"px").style("margin-top","10px"),r.append("div").classed("gene_search_button",!0).style("margin-top","5px").attr("data-toggle","buttons").append("button").classed("sidebar_text",!0).html("Search").attr("type","button").classed("btn",!0).classed("btn-primary",!0).classed("submit_gene_button",!0).style("width","100%").style("font-size","14px")}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o,a,i,s={row:"Row",col:"Column",both:""},l=e.append("div").style("padding-left","10px").style("padding-right","10px").classed("reorder_section",!0);i=t.sim_mat?["both"]:["row","col"],_.each(i,function(e){r={clust:"Cluster",rank:"Rank by Sum",rankvar:"Rank by Variance",ini:"Initial Order",alpha:"Alphabetically"};var i;i="row"===e?"col":"row",n=Object.keys(t.matrix.orders);var c=[];_.each(n,function(t){t.indexOf(i)>-1&&(t=t.replace("_row","").replace("_col",""),t.indexOf("cat_")<0&&c.push(t))}),_.keys(t.viz.filter_data).indexOf("enr_score_type")>-1&&(c=["clust","rank"]),c=_.uniq(c),c=c.sort();var u;u="both"!=e?" Order":"Reorder Matrix",l.append("div").classed("sidebar_button_text",!0).style("clear","both").style("margin-top","10px").html(s[e]+u),a=l.append("div").classed("btn-group-vertical",!0).style("width","100%").classed("toggle_"+e+"_order",!0).attr("role","group"),a.selectAll(".button").data(c).enter().append("button").attr("type","button").classed("btn",!0).classed("btn-primary",!0).classed("sidebar_button_text",!0).classed("active",function(e){return o=!1,e==t.viz.inst_order[i]&&(o=!0),o}).attr("name",function(t){return t}).html(function(t){return r[t]})})}},function(t,e,r){"use strict";var n=r(226);t.exports=function(t){_.each(_.keys(t.ini_view),function(e){var r=t.ini_view[e],o=t.viz.possible_filters[e];if("numerical"===o){"all"!=r&&(r=parseInt(r,10)),t.viz.filter_data[e].indexOf(r)<=-1&&(r="all");var a=n(t,e);d3.select(t.root+" .title_"+e).text(a.text+r+a.suffix),d3.select(t.root+" .slider_"+e).attr("current_state",r)}})}},function(t,e,r){"use strict";var n=r(256),o=r(144),a=r(260),i=r(281);t.exports=function(t,e){function r(){d3.select(s.root+" .expand_button").style("opacity",0);var t=d3.select(s.root+" .viz_svg").attr("title","test2").attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML,e=new Blob([t],{type:"image/svg+xml"});l(e,"clustergrammer.svg"),d3.select(s.root+" .expand_button").style("opacity",.4)}var s=t.params,l=n(),c=e.select(".icons_section").style("margin-top","7px").style("margin-left","5%"),u="22%",d="0px",f="0px";c.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",d).style("padding-right",f).append("i").classed("fa",!0).classed("fa-share-alt",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",function(){$(s.root+" .share_info").modal("toggle"),$(".share_url").val(window.location.href)}).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Share").style("left","0%"),c.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",d).style("padding-right",f).append("i").classed("fa",!0).classed("fa-camera",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",function(){$(s.root+" .picture_info").modal("toggle")}).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Take snapshot").style("left","-100%"),c.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",d).style("padding-right",f).append("i").classed("fa",!0).classed("fa fa-cloud-download",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",function(){t.save_matrix()}).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Download matrix").style("left","-200%"),c.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",d).style("padding-right","-5px").append("i").classed("fa",!0).classed("fa-crop",!0).classed("crop_button",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",function(){if(t.params.dendro_filter.row===!1&&t.params.dendro_filter.col===!1){var e=d3.select(this).classed("fa-crop"),r=d3.select(this).classed("fa-undo");e&&(t.params.crop_filter_nodes={},t.params.crop_filter_nodes.row_nodes=t.params.network_data.row_nodes,t.params.crop_filter_nodes.col_nodes=t.params.network_data.col_nodes,t.brush_crop_matrix(),d3.select(this).classed("active_cropping")===!1?d3.select(this).classed("active_cropping",!0).style("color","red"):(d3.select(this).classed("active_cropping",!1).style("color","#337ab7"),a(t))),r&&(d3.select(s.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!0).classed("fa-undo",!1),t.filter_viz_using_nodes(t.params.crop_filter_nodes),d3.select(t.params.root+" .col_dendro_icons_container").style("display","block"),d3.select(t.params.root+" .row_dendro_icons_container").style("display","block")),o(t,0,0,1)}}).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Crop matrix").style("left","-400%"),d3.select(s.root+" .download_buttons").append("p").append("a").html("Download SVG").on("click",function(){r()});var p="svg_"+s.root.replace("#","");d3.select(s.root+" .download_buttons").append("p").append("a").html("Download PNG").on("click",function(){d3.select(s.root+" .expand_button").style("opacity",0),i.saveSvgAsPng(document.getElementById(p),"clustergrammer.png"),d3.select(s.root+" .expand_button").style("opacity",.4)})}},function(t,e,r){ var n;!function(){function o(t){return t instanceof HTMLElement||t instanceof SVGElement}function a(t){if(!o(t))throw new Error("an HTMLElement or SVGElement is required; got "+t)}function i(t){return t&&0==t.lastIndexOf("http",0)&&t.lastIndexOf(window.location.host)==-1}function s(t,e){a(t);var r=t.querySelectorAll("image"),n=r.length,o=function(){0===n&&e()};o();for(var s=0;s0)return e[o]}return console.error("Unknown font format for "+t+"; Fonts may not be working correctly"),"application/octet-stream"}function o(t){function e(e){function r(){var t=s.response,r=a(t);i(e,r)}function n(t){console.warn("Failed to load font from: "+e.url),console.warn(t),l+=e.text+"\n",o()}function i(e,r){var n='url("data:'+e.format+";base64,"+r+'")';l+=e.text.replace(e.fontUrlRegexp,n)+"\n",setTimeout(function(){o(t)},0)}var s=new XMLHttpRequest;s.addEventListener("load",r),s.addEventListener("error",n),s.addEventListener("abort",n),s.open("GET",e.url),s.responseType="arraybuffer",s.send()}if(t.length>0){var n=t.pop();e(n)}else r(l)}function a(t){for(var e="",r=new Uint8Array(t),n=r.byteLength,o=0;o";var n=document.createElement("defs");if(n.appendChild(e),u.insertBefore(n,u.firstChild),r){var o=s.innerHTML;o=o.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href'),r(o,a,i)}}var a,i,s=document.createElement("div"),u=t.cloneNode(!0);if("svg"==t.tagName)a=e.width||c(t,u,"width"),i=e.height||c(t,u,"height");else{if(!t.getBBox)return void console.error("Attempted to render non-SVG element",t);var d=t.getBBox();a=d.x+d.width,i=d.y+d.height,u.setAttribute("transform",u.getAttribute("transform").replace(/translate\(.*?\)/,""));var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.appendChild(u),u=f}u.setAttribute("version","1.1"),u.getAttribute("xmlns")||u.setAttributeNS(n,"xmlns","http://www.w3.org/2000/svg"),u.getAttribute("xmlns:xlink")||u.setAttributeNS(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),e.responsive?(u.removeAttribute("width"),u.removeAttribute("height"),u.setAttribute("preserveAspectRatio","xMinYMin meet")):(u.setAttribute("width",a*e.scale),u.setAttribute("height",i*e.scale)),u.setAttribute("viewBox",[e.left||0,e.top||0,a,i].join(" "));for(var p=u.querySelectorAll("foreignObject > *"),_=0;_=0?(g.append("stop").attr("offset","0%").attr("stop-color","white"),g.append("stop").attr("offset","100%").attr("stop-color","red"),y="all_postiive"):p<=0?(g.append("stop").attr("offset","0%").attr("stop-color","blue"),g.append("stop").attr("offset","100%").attr("stop-color","white"),y="all_negative"):(g.append("stop").attr("offset","0%").attr("stop-color","blue"),g.append("stop").attr("offset","50%").attr("stop-color","white"),g.append("stop").attr("offset","100%").attr("stop-color","red")),v.append("rect").classed("background",!0).attr("height",o+"px").attr("width",r+"px").attr("fill","url(#linear-gradient)").attr("transform","translate("+u+", "+d+")").attr("stroke","grey").attr("stroke-width","0.25px");var w=Math.abs(Math.round(10*e.matrix.max_link)/10),x=13;v.append("text").text(function(){var t;return t="all_postiive"===y?0:"-"+w.toLocaleString()}).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",300).style("font-size",x).attr("transform","translate("+s+","+l+")").attr("text-anchor","start"),v.append("text").text(w.toLocaleString()).text(function(){var t;return t="all_negative"===y?0:w.toLocaleString()}).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",300).style("font-size",x).attr("transform","translate("+c+","+l+")").attr("text-anchor","end")}}]); //# sourceMappingURL=clustergrammer.min.js.map \ No newline at end of file diff --git a/clustergrammer.node.js b/clustergrammer.node.js index c724fa98..60b628b4 100644 --- a/clustergrammer.node.js +++ b/clustergrammer.node.js @@ -11608,10 +11608,20 @@ module.exports = viz = make_cat_params(params, viz, predefined_cat_colors); + // // always make group level dict + // params.group_level = {}; + if (_.has(params, 'group_level') == false) { if (viz.show_dendrogram) { params.group_level = {}; } + + // preventing error when un-clustered, above statement + // preserves dendro state while updating + if (_.has(params, 'group_level') == false) { + params.group_level = {}; + } + params.group_level.row = 5; params.group_level.col = 5; } @@ -14361,10 +14371,9 @@ module.exports = if (params.viz.show_dendrogram) { make_row_dendro(cgm); make_col_dendro(cgm); + make_row_dendro_spillover(cgm); } - make_row_dendro_spillover(cgm); - make_col_label_container(cgm); // initial trim text @@ -14394,8 +14403,10 @@ module.exports = generate_super_labels(params); } - // sliders should go above super labels - make_svg_dendro_sliders(cgm); + if (params.viz.show_dendrogram) { + // sliders should go above super labels + make_svg_dendro_sliders(cgm); + } function border_colors() { var inst_color = params.viz.super_border_color; @@ -15873,14 +15884,16 @@ module.exports = var dendro_info; - if (inst_rc === 'row') { - dendro_info = calc_row_dendro_triangles(params); - } else { - dendro_info = calc_col_dendro_triangles(params); - } + if (params.viz.show_dendrogram) { + if (inst_rc === 'row') { + dendro_info = calc_row_dendro_triangles(params); + } else { + dendro_info = calc_col_dendro_triangles(params); + } - if (d3.select(cgm.params.root + ' .' + inst_rc + '_dendro_crop_buttons').empty() === false) { - make_dendro_crop_buttons(cgm, inst_rc); + if (d3.select(cgm.params.root + ' .' + inst_rc + '_dendro_crop_buttons').empty() === false) { + make_dendro_crop_buttons(cgm, inst_rc); + } } // constant dendrogram opacity @@ -20054,7 +20067,9 @@ module.exports = y_offset = 0; b_spill_container.append('g').classed('col_dendro_icons_container', true).attr('transform', 'translate(' + x_offset + ',' + y_offset + ')').append('g').classed('col_dendro_icons_group', true); - make_dendro_crop_buttons(cgm, 'col'); + if (params.viz.show_dendrogram) { + make_dendro_crop_buttons(cgm, 'col'); + } var x_offset = viz.clust.margin.left + viz.clust.dim.width; var y_offset = viz.clust.margin.top + viz.clust.dim.height; diff --git a/clustergrammer.node.min.js b/clustergrammer.node.min.js index 8fee93a1..3c0cb8a9 100644 --- a/clustergrammer.node.min.js +++ b/clustergrammer.node.min.js @@ -1,13 +1,13 @@ module.exports=function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){function e(){d3.select(S.params.viz.viz_svg).style("opacity",.5);var t=500;this.params.viz.run_trans===!0&&(t=2500),setTimeout(n,t,this)}function n(t){s(t)}function b(t){f(this,t)}function z(t,e,r){_(this,t,e,r)}function k(){return y}function A(t,e){"sum"===e&&(e="rank"),"var"===e&&(e="rankvar"),w(this,e,t)}function E(){return x(this.params)}function N(t,e){h(this,t,e)}var M=o(t),S={};if(S.params=a(M),S.config=M,S.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,S.params.viz.square_zoom*S.params.viz.zoom_ratio.x]).on("zoom",function(){g(S)}),S.params.zoom_behavior.translate([S.params.viz.clust.margin.left,S.params.viz.clust.margin.top]),S.params.use_sidebar){var O=r(271);O(S)}return i(S),S.update_view=h,S.resize_viz=e,S.play_demo=l,S.ini_demo=c,S.filter_viz_using_nodes=u,S.filter_viz_using_names=d,S.update_cats=b,S.reset_cats=p,S.zoom=z,S.save_matrix=v,S.brush_crop_matrix=m,S.d3_tip_custom=k,S.reorder=A,S.export_matrix_string=E,S.update_view=N,S}var o=r(1),a=r(9),i=r(89),s=r(152),l=r(229),c=r(247),u=r(250),d=r(251),f=r(252),p=r(253),_=r(144),h=r(202),v=r(255),m=r(259),g=r(153),y=r(100),w=r(143),x=r(257);d3.slider=r(261);r(263);r(265),r(269),t.exports=n},function(t,e,r){"use strict";var n=r(2),o=r(3),a=r(4),i=r(5),s=r(6),l=r(7),c=r(8);t.exports=function(t){var e=s(),r=n.extend(e,t);r.network_data=t.network_data;var u=": ";_.each(["row","col"],function(t){var e=r.network_data[t+"_nodes"],n=c(e);e.forEach(function(e,o){e[t+"_index"]=o,n&&(r.super_labels=!0,r.super[t]=e.name.split(u)[0],e.name=e.name.split(u)[1]),e.name=String(e.name),e.name=e.name.replace(/_/g," ")})}),r.network_data.row_nodes_names=n.pluck(r.network_data.row_nodes,"name"),r.network_data.col_nodes_names=n.pluck(r.network_data.col_nodes,"name"),r.sim_mat=l(r);var d=a(r.network_data.views),f={};_.each(_.keys(d.possible_filters),function(t){var e=i(d.filter_data,t);f[t]=e}),_.has(r.network_data,"views")&&r.network_data.views.forEach(function(t){_.each(_.keys(d.possible_filters),function(e){_.has(t,e)||(t[e]=f[e])});var e=t.nodes;_.each(["row","col"],function(t){var r=c(e[t+"_nodes"]);e[t+"_nodes"].forEach(function(e,n){e[t+"_index"]=n,r&&(e.name=e.name.split(u)[1]),e.name=String(e.name),e.name=e.name.replace(/_/g," ")})})});var p=r.network_data.col_nodes,h=r.network_data.row_nodes;if(_.has(r.network_data,"mat")){for(var v=[],m=r.network_data.mat,g={},y=0;y1&&(e[t]=a)});var o={};return o.possible_filters=e,o.filter_data=r,o}},function(t,e){"use strict";t.exports=function(t,e){var r=t[e].sort(function(t,e){return e-t})[0];return r=String(r)}},function(t,e){"use strict";t.exports=function(){var t={row_label_scale:1,col_label_scale:1,super_labels:!1,super:{},show_label_tooltips:!0,show_tile_tooltips:!0,transpose:!1,tile_colors:["#FF0000","#1C86EE"],bar_colors:["#FF0000","#1C86EE"],cat_value_colors:["#2F4F4F","#9370DB"],outline_colors:["orange","black"],highlight_color:"#FFFF00",tile_title:!1,input_domain:0,opacity_scale:"linear",do_zoom:!0,is_zoom:0,is_slider_drag:!1,is_cropping:!1,background_color:"#FFFFFF",super_border_color:"#F5F5F5",outer_margins:{top:0,bottom:0,left:0,right:0},ini_expand:!1,grey_border_width:2,tile_click_hlight:!1,super_label_scale:1,make_tile_tooltip:function(t){return t.info},ini_view:null,requested_view:null,use_sidebar:!0,title:null,about:null,sidebar_width:160,sidebar_icons:!0,row_search_placeholder:"Row",buffer_width:10,show_sim_mat:!1,cat_colors:null,resize:!0,clamp_opacity:.85,expand_button:!0,max_allow_fs:20,dendro_filter:{row:!1,col:!1},cat_filter:{row:!1,col:!1},crop_filter_nodes:{row:!1,col:!1},row_tip_callback:null,col_tip_callback:null,tile_tip_callback:null,matrix_update_callback:null,cat_update_callback:null,dendro_callback:null,dendro_click_callback:null,new_row_cats:null,make_modals:!0,show_viz_border:!1};return t}},function(t,e){"use strict";t.exports=function(t){var e=!1,r=t.network_data.row_nodes_names.length,n=t.network_data.col_nodes_names.length;if(r==n){var o=t.network_data.row_nodes_names,a=t.network_data.col_nodes_names;e=!0,_.each(o,function(t){var r=o.indexOf(t);t!==a[r]&&(e=!1)})}return e&&(t.expand_button=!1),e}},function(t,e){"use strict";t.exports=function(t){var e=": ",r=!0;return _.each(t,function(t){var n=String(t.name);n.indexOf(e)<0&&(r=!1)}),r}},function(t,e,r){"use strict";var n=r(10),o=r(64),a=r(65),i=r(4),s=r(66),l=r(88);t.exports=function(t){var e=$.extend(!0,{},t),r=e;if(r.inst_nodes={},r.inst_nodes.row_nodes=r.network_data.row_nodes,r.inst_nodes.col_nodes=r.network_data.col_nodes,null!==r.ini_view){var c=r.ini_view,u=i(r.network_data.views);r.viz={},r.viz.possible_filters=u.possible_filters,r.viz.filter_data=u.filter_data,c=a(r,c),r.network_data=n(e,r,c),r.requested_view=c}return r=s(r),r.use_sidebar&&(r.sidebar=o(r)),r.zoom_info=l(),r}},function(t,e,r){"use strict";var n=r(11),o=r(63);t.exports=function(t,e,r){var a=t.network_data.views,i=!1;_.has(a[0],"enr_score_type")&&(i=!0);var s=o(e,a,r);i&&0==s.length&&(r={N_row_sum:"all",N_col_sum:"10"},s=o(e,a,r));var l,c=s[0];if("undefined"!=typeof c){var u=c.nodes;l=n(t,u)}else l=t.network_data;return l}},function(t,e,r){"use strict";var n=r(2),o=r(12),a=o.create();a.import(r(25)),a.import(r(62)),t.exports=function(t,e){var r=t.network_data.links,o=n.pluck(e.row_nodes,"name"),i=n.pluck(e.col_nodes,"name"),s=a.matrix(a.zeros([e.row_nodes.length,e.col_nodes.length]));s=s.toArray();var l=_.filter(r,function(t){var e=t.name.split("_")[0],r=t.name.split("_")[1],n=_.indexOf(o,e),a=_.indexOf(i,r);if(n>-1&a>-1)return t.source=n,t.target=a,s[n][a]=t.value,t}),c={};return c.row_nodes=e.row_nodes,c.row_nodes_names=o,c.col_nodes=e.col_nodes,c.col_nodes_names=i,c.links=l,c.all_links=r,c.mat=s,c.views=t.network_data.views,_.has(t.network_data,"cat_colors")&&(c.cat_colors=t.network_data.cat_colors),c}},function(t,e,r){"use strict";t.exports=r(13)},function(t,e,r){"use strict";var n=r(14).isFactory,o=r(16),a=r(20),i=r(22),s=r(24);e.create=function(t){function e(t){if(!n(t))throw new Error("Factory object with properties `type`, `name`, and `factory` expected");var o,a=r.indexOf(t);return a===-1?(o=t.math===!0?t.factory(c.type,u,e,c.typed,c):t.factory(c.type,u,e,c.typed),r.push(t),l.push(o)):o=l[a],o}if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var r=[],l=[],c=a.mixin({});c.type={},c.expression={transform:{},mathWithTransform:{}},c.typed=o.create(c.type);var u={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};return c.import=e(i),c.config=e(s),c.expression.mathWithTransform.config=c.config,t&&c.config(t),c}},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=r(15);e.clone=function t(r){var a="undefined"==typeof r?"undefined":n(r);if("number"===a||"string"===a||"boolean"===a||null===r||void 0===r)return r;if("function"==typeof r.clone)return r.clone();if(Array.isArray(r))return r.map(function(e){return t(e)});if(r instanceof Number)return new Number(r.valueOf());if(r instanceof String)return new String(r.valueOf());if(r instanceof Boolean)return new Boolean(r.valueOf());if(r instanceof Date)return new Date(r.valueOf());if(o(r))return r;if(r instanceof RegExp)throw new TypeError("Cannot clone "+r);return e.map(r,t)},e.map=function(t,r){var n={};for(var o in t)e.hasOwnProperty(t,o)&&(n[o]=r(t[o]));return n},e.extend=function(t,r){for(var n in r)e.hasOwnProperty(r,n)&&(t[n]=r[n]);return t},e.deepExtend=function t(r,n){if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var o in n)if(e.hasOwnProperty(n,o))if(n[o]&&n[o].constructor===Object)void 0===r[o]&&(r[o]={}),r[o].constructor===Object?t(r[o],n[o]):r[o]=n[o];else{if(Array.isArray(n[o]))throw new TypeError("Arrays are not supported by deepExtend");r[o]=n[o]}return r},e.deepEqual=function(t,r){var o,a,i;if(Array.isArray(t)){if(!Array.isArray(r))return!1;if(t.length!=r.length)return!1;for(a=0,i=t.length;a15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t.BigNumber(e)}},{from:"number",to:"Complex",convert:function(e){return new t.Complex(e,0)}},{from:"number",to:"string",convert:function(t){return t+""}},{from:"BigNumber",to:"Complex",convert:function(e){return new t.Complex(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return new t.Complex(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){var r=new t.Fraction(e);if(r.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return new t.Fraction(e)}},{from:"string",to:"number",convert:function(t){var e=Number(t);if(isNaN(e))throw new Error('Cannot convert "'+t+'" to a number');return e}},{from:"string",to:"BigNumber",convert:function(e){try{return new t.BigNumber(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){try{return new t.Fraction(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){try{return new t.Complex(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(e){return new t.BigNumber(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return new t.Fraction(+e)}},{from:"boolean",to:"string",convert:function(t){return+t}},{from:"null",to:"number",convert:function(){return 0}},{from:"null",to:"string",convert:function(){return"null"}},{from:"null",to:"BigNumber",convert:function(){return new t.BigNumber(0)}},{from:"null",to:"Fraction",convert:function(){return new t.Fraction(0)}},{from:"Array",to:"Matrix",convert:function(e){return new t.DenseMatrix(e)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}],e}},function(t,e,r){var n,o,a,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(r,i){o=[],n=i,a="function"==typeof n?n.apply(e,o):n,!(void 0!==a&&(t.exports=a))}(void 0,function(){function t(){function e(t){for(var e,r=0;rr&&!c?"Unexpected type of argument in function "+l+" (expected: "+s.join(" or ")+", actual: "+i+", index: "+r+")":"Too few arguments in function "+l+" (expected: "+s.join(" or ")+", index: "+r+")":"Too many arguments in function "+l+" (expected: "+r+", actual: "+e+")";var d=new TypeError(a);return d.data=u,d}function o(t){this.name=t||"refs",this.categories={}}function a(t,e){if("string"==typeof t){var r=t.trim(),n="..."===r.substr(0,3);if(n&&(r=r.substr(3)),""===r)this.types=["any"];else{this.types=r.split("|");for(var o=0;oe&&(e=n)}return e}function v(t){for(var e,r=0;r0},a.prototype.contains=function(t){for(var e=0;ee.params.length)return 1;if(t.params.lengthi)return 1;if(o "+o+") {"),n.push(r+" var varArgs = [];"),n.push(r+" for (var i = "+o+"; i < arguments.length; i++) {"),n.push(r+" varArgs.push(arguments[i]);"),n.push(r+" }"),n.push(this.signature.toCode(t,r+" ")),n.push(r+"}");else{for(var s=function(r,n){for(var o=[],a=0;a "+r+") {",e+" throw createError(name, arguments.length, "+r+", arguments["+r+"]);",e+"}"].join("\n");for(var n={},o=[],a=0;a0?1:t<0?-1:0},e.format=function(t,r){if("function"==typeof r)return r(t);if(t===1/0)return"Infinity";if(t===-(1/0))return"-Infinity";if(isNaN(t))return"NaN";var n="auto",o=void 0;switch(r&&(r.notation&&(n=r.notation),e.isNumber(r)?o=r:r.precision&&(o=r.precision)),n){case"fixed":return e.toFixed(t,o);case"exponential":return e.toExponential(t,o);case"engineering":return e.toEngineering(t,o);case"auto":return e.toPrecision(t,o,r&&r.exponential).replace(/((\.\d*?)(0+))($|e)/,function(){var t=arguments[2],e=arguments[4];return"."!==t?t+e:e});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", or "fixed".')}},e.splitNumber=function(t){var e=String(t).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var r=e[1],n=e[2],o=parseFloat(e[4]||"0"),a=n.indexOf(".");o+=a!==-1?a-1:n.length-1;var i=n.replace(".","").replace(/^0*/,function(t){return o-=t.length,""}).replace(/0*$/,"").split("").map(function(t){return parseInt(t)});return 0===i.length&&(i.push(0),o++),{sign:r,coefficients:i,exponent:o}},e.toEngineering=function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var o=e.roundDigits(e.splitNumber(t),n),a=o.exponent,i=o.coefficients,s=a%3===0?a:a<0?a-3-a%3:a-a%3,l=a>=0?a:Math.abs(s);i.length-1=0;)u++;var d=i.slice(u).join(""),f=d.match(/[1-9]/)?"."+d:"",p=i.slice(0,u).join("")+f+"e"+(a>=0?"+":"")+s.toString();return o.sign+p},e.toFixed=function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var o=e.splitNumber(t),a=e.roundDigits(o,o.exponent+1+(n||0)),i=a.coefficients,s=a.exponent+1,l=s+(n||0);return i.length0?"."+i.join(""):"")+"e"+(s>=0?"+":"")+s},e.toPrecision=function(t,n,o){if(isNaN(t)||!isFinite(t))return String(t);var a=o&&void 0!==o.lower?o.lower:.001,i=o&&void 0!==o.upper?o.upper:1e5,s=e.splitNumber(t),l=Math.abs(Math.pow(10,s.exponent));if(l=i)return e.toExponential(t,n);var c=n?e.roundDigits(s,n):s,u=c.coefficients,d=c.exponent;u.length0?d:0;return fe){var o=n.splice(e,n.length-e);if(o[0]>=5){var a=e-1;for(n[a]++;10===n[a];)n.pop(),0===a&&(n.unshift(0),r.exponent++,a++),a--,n[a]++}}return r},e.digits=function(t){return t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length},e.DBL_EPSILON=Number.EPSILON||2.220446049250313e-16,e.nearlyEqual=function(t,r,n){if(null==n)return t==r;if(t==r)return!0;if(isNaN(t)||isNaN(r))return!1;if(isFinite(t)&&isFinite(r)){var o=Math.abs(t-r);return o")}function o(t,r,n,a){var i,s,l=t.length,c=r[n],u=Math.min(l,c);if(t.length=c,n=e)throw new d(t,e)},e.UNINITIALIZED={},e.resize=function(t,e,r){if(!Array.isArray(t)||!Array.isArray(e))throw new TypeError("Array expected");if(0===e.length)throw new Error("Resizing to scalar is not supported");e.forEach(function(t){if(!l.isNumber(t)||!l.isInteger(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+c.format(e)+")")});var n=void 0!==r?r:0;return o(t,e,0,n),t},e.reshape=function(t,r){var n,o=e.flatten(t),i=function(t){return t.reduce(function(t,e){return t*e})};if(!Array.isArray(t)||!Array.isArray(r))throw new TypeError("Array expected");if(0===r.length)throw new u(0,i(e.size(t)),"!=");try{n=a(o,r)}catch(n){if(n instanceof u)throw new u(i(r),i(e.size(t)),"!=");throw n}if(o.length>0)throw new u(i(r),i(e.size(t)),"!=");return n},e.squeeze=function(t,r){for(var n=r||e.size(t);Array.isArray(t)&&1===t.length;)t=t[0],n.shift();for(var o=n.length;1===n[o-1];)o--;return o/g,">")}},function(t,e){"use strict";e.format=function(t,r){if("function"==typeof r)return r(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var n="auto",o=void 0;switch(void 0!==r&&(r.notation&&(n=r.notation),"number"==typeof r?o=r:r.precision&&(o=r.precision)),n){case"fixed":return e.toFixed(t,o);case"exponential":return e.toExponential(t,o);case"auto":var a=.001,i=1e5;r&&r.exponential&&(void 0!==r.exponential.lower&&(a=r.exponential.lower),void 0!==r.exponential.upper&&(i=r.exponential.upper));({toExpNeg:t.constructor.toExpNeg,toExpPos:t.constructor.toExpPos});if(t.constructor.config({toExpNeg:Math.round(Math.log(a)/Math.LN10),toExpPos:Math.round(Math.log(i)/Math.LN10)}),t.isZero())return"0";var s,l=t.abs();return s=l.gte(a)&&l.lt(i)?t.toSignificantDigits(o).toFixed():e.toExponential(t,o),s.replace(/((\.\d*?)(0+))($|e)/,function(){var t=arguments[2],e=arguments[4];return"."!==t?t+e:e});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", or "fixed".')}},e.toExponential=function(t,e){return void 0!==e?t.toExponential(e-1):t.toExponential()},e.toFixed=function(t,e){return t.toFixed(e||0)}},function(t,e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.type=function(t){var e="undefined"==typeof t?"undefined":r(t);return"object"===e?null===t?"null":Array.isArray(t)?"Array":t instanceof Date?"Date":t instanceof RegExp?"RegExp":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":"Object":"function"===e?"Function":e}},function(t,e){"use strict";function r(t,e,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=e,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=(new Error).stack}r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="DimensionError",r.prototype.isDimensionError=!0,t.exports=r},function(t,e){"use strict";function r(t,e,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=n),void 0!==this.min&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="IndexError",r.prototype.isIndexError=!0,t.exports=r},function(t,e){"use strict";e.isBoolean=function(t){return"boolean"==typeof t}},function(t,e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.memoize=function(t,e){return function n(){"object"!==r(n.cache)&&(n.cache={});for(var o=[],a=0;a");var p=r.max().map(function(t){return t+1});w(e,p,o);var _=c.length,h=0;y(e._data,r,n,_,h)}return e}function y(t,e,r,n,o){var a=o===n-1,i=e.dimension(o);a?i.forEach(function(e,n){_(e),t[e]=r[n[0]]}):i.forEach(function(a,i){_(a),y(t[a],e,r[i[0]],n,o+1)})}function w(t,e,r){for(var n=t._size.slice(0),o=!1;n.lengthn[a]&&(n[a]=e[a],o=!0);o&&z(t,n,r)}function x(t){for(var e=0,r=t.length;e0?e:0,n=e<0?-e:0,o=this._size[0],a=this._size[1],i=Math.min(o-n,a-r),s=[],l=0;l0?n:0,_=n<0?-n:0,v=e[0],m=e[1],g=Math.min(v-_,m-l);if(u(r)){if(r.length!==g)throw new Error("Invalid value array length");i=function(t){return r[t]}}else if(t.isMatrix(r)){var y=r.size();if(1!==y.length||y[0]!==g)throw new Error("Invalid matrix length");i=function(t){return r.get([t])}}else i=function(){return r};o||(o=t.isBigNumber(i(0))?new t.BigNumber(0):0);var w=[];if(e.length>0){w=s.resize(w,e,o);for(var x=0;x0){var s=0;do{t._ptr.push(t._index.length);for(var l=0;l");for(var p=r.min()[0],_=r.min()[1],h=l[0],v=l[1],m=0;mi-1||o>s-1)&&(E(this,Math.max(n+1,i),Math.max(o+1,s),r),i=this._size[0],s=this._size[1]),_(n,i),_(o,s);var d=z(n,this._ptr[o],this._ptr[o+1],this._index); return df){for(l=f;ld){if(u){var _=0;for(l=0;le-1&&(t._values.splice(c,1),t._index.splice(c,1),m++)}t._ptr[l]=t._values.length}return t._size[0]=e,t._size[1]=r,t};v.prototype.reshape=function(t,e){if(!u(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");if(t.forEach(function(e){if(!c.isNumber(e)||!c.isInteger(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+l.format(t)+")")}),this._size[0]*this._size[1]!==t[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=e?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var n=[],o=0;o=e&&b<=r){if(!i)for(var z=w;z "+(this._values?l.format(this._values[c],t):"X")}return o},v.prototype.toString=function(){return l.format(this.toArray())},v.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},v.prototype.diagonal=function(e){if(e){if(t.isBigNumber(e)&&(e=e.toNumber()),!d(e)||!f(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var r=e>0?e:0,n=e<0?-e:0,o=this._size[0],a=this._size[1],i=Math.min(o-n,a-r),s=[],l=[],c=[];c[0]=0;for(var u=r;u0?n:0,_=n<0?-n:0,m=e[0],y=e[1],w=Math.min(m-_,y-c);if(u(r)){if(r.length!==w)throw new Error("Invalid value array length");l=function(t){return r[t]}}else if(t.isMatrix(r)){var x=r.size();if(1!==x.length||x[0]!==w)throw new Error("Invalid matrix length");l=function(t){return r.get([t])}}else l=function(){return r};for(var b=[],z=[],k=[],A=0;A=0&&E=l||o[u]!==e)){var f=n?n[c]:void 0;o.splice(u,0,e),n&&n.splice(u,0,f),o.splice(u<=c?c+1:c,1),n&&n.splice(u<=c?c+1:c,1)}else if(u=l||o[c]!==t)){var p=n?n[u]:void 0;o.splice(c,0,t),n&&n.splice(c,0,p),o.splice(c<=u?u+1:u,1),n&&n.splice(c<=u?u+1:u,1)}}},t.Matrix._storage.sparse=v,v}var o=r(27),a=r(32),i=o.array,s=o.object,l=o.string,c=o.number,u=Array.isArray,d=c.isNumber,f=c.isInteger,p=l.isString,_=i.validateIndex;e.name="SparseMatrix",e.path="type",e.factory=n,e.lazy=!1},function(t,e,r){"use strict";function n(t,e,r,n){var i=n("equalScalar",{"boolean, boolean":function(t,e){return t===e},"number, number":function(t,r){return t===r||o(t,r,e.epsilon)},"BigNumber, BigNumber":function(t,r){return t.eq(r)||a(t,r,e.epsilon)},"Fraction, Fraction":function(t,e){return t.equals(e)},"Complex, Complex":function(t,e){return t.equals(e)},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return i(t.value,e.value)},"string, string":function(t,e){return t===e}});return i}var o=r(18).nearlyEqual,a=r(40);e.factory=n},function(t,e){"use strict";t.exports=function(t,e,r){if(null==r)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var n=t.minus(e).abs();if(n.isZero())return!0;var o=t.constructor.max(t.abs(),e.abs());return n.lte(o.times(r))}return!1}},function(t,e,r){"use strict";function n(t,e,n){function o(){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new t.FibonacciHeap}var a=n(r(42)),i=n(r(39));return o.prototype.type="Spa",o.prototype.isSpa=!0,o.prototype.set=function(t,e){if(this._values[t])this._values[t].value=e;else{var r=this._heap.insert(t,e);this._values[t]=r}},o.prototype.get=function(t){var e=this._values[t];return e?e.value:0},o.prototype.accumulate=function(t,e){var r=this._values[t];r?r.value=a(r.value,e):(r=this._heap.insert(t,e),this._values[t]=r)},o.prototype.forEach=function(t,e,r){var n=this._heap,o=this._values,a=[],s=n.extractMinimum();for(s&&a.push(s);s&&s.key<=e;)s.key>=t&&(i(s.value,0)||r(s.key,s.value,this)),s=n.extractMinimum(),s&&a.push(s);for(var l=0;l>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},e.defaultTemplate="\\mathrm{${name}}\\left(${args}\\right)";var r={deg:"^\\circ"};e.toSymbol=function(t,n){if(n="undefined"!=typeof n&&n)return r.hasOwnProperty(t)?r[t]:"\\mathrm{"+t+"}";if(e.symbols.hasOwnProperty(t))return e.symbols[t];if(t.indexOf("_")!==-1){var o=t.indexOf("_");return e.toSymbol(t.substring(0,o))+"_{"+e.toSymbol(t.substring(o+1))+"}"}return t}},function(t,e,r){"use strict";function n(t,e,r,n){var a=t.DenseMatrix,i=function(t,e,r,i){var s=t._data,l=t._size,c=t._datatype,u=e._values,d=e._index,f=e._ptr,p=e._size,_=e._datatype;if(l.length!==p.length)throw new o(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,v,m=l[0],g=l[1],y="string"==typeof c&&c===_?c:void 0,w=y?n.find(r,[y,y]):r,x=[];for(h=0;h0?s(v,0,p,p[0],i,u):[];return new o({data:m,size:p,datatype:h})},s=function t(e,r,n,o,a,i){var s=[];if(r===n.length-1)for(var l=0;l0?s(f,0,u,u[0],c,e,i):[];return new a({data:p,size:o(u),datatype:l})},s=function t(e,r,n,o,a,i,s){var l=[];if(r===n.length-1)for(var c=0;c0;){var o=n.right;n.left.right=n.right,n.right.left=n.left,n.left=e,n.right=e.right,e.right=n,n.right.left=n,n.parent=null,n=o,r--}return t.left.right=t.right,t.right.left=t.left,t==t.right?e=null:(e=t.right,e=p(e,this._size)),this._size--,this._minimum=e,t},a.prototype.remove=function(t){this._minimum=c(this._minimum,t,-1),this.extractMinimum()};var c=function(t,e,r){e.key=r;var n=e.parent;return n&&i(e.key,n.key)&&(u(t,e,n),d(t,n)),i(e.key,t.key)&&(t=e),t},u=function(t,e,r){e.left.right=e.right,e.right.left=e.left,r.degree--,r.child==e&&(r.child=e.right),0===r.degree&&(r.child=null),e.left=t,e.right=t.right,t.right=e,e.right.left=e,e.parent=null,e.mark=!1},d=function t(e,r){var n=r.parent;n&&(r.mark?(u(e,r,n),t(n)):r.mark=!0)},f=function(t,e){t.left.right=t.right,t.right.left=t.left,t.parent=e,e.child?(t.left=e.child,t.right=e.child.right,e.child.right=t,t.right.left=t):(e.child=t,t.right=t,t.left=t),e.degree++,t.mark=!1},p=function(t,e){var r=Math.floor(Math.log(e)*l)+1,n=new Array(r),o=0,a=t;if(a)for(o++,a=a.right;a!==t;)o++,a=a.right;for(var c;o>0;){for(var u=a.degree,d=a.right;;){if(c=n[u],!c)break;if(s(a.key,c.key)){var p=c;c=a,a=p}f(c,a),n[u]=null,u++}n[u]=a,a=d,o--}t=null;for(var _=0;_e},"number, number":function(t,r){return t>r&&!o(t,r,e.epsilon)},"BigNumber, BigNumber":function(t,r){return t.gt(r)&&!a(t,r,e.epsilon)},"Fraction, Fraction":function(t,e){return 1===t.compare(e)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return _(t.value,e.value)},"string, string":function(t,e){return t>e},"Matrix, Matrix":function(t,e){var r;switch(t.storage()){case"sparse":switch(e.storage()){case"sparse":r=c(t,e,_);break;default:r=l(e,t,_,!0)}break;default:switch(e.storage()){case"sparse":r=l(t,e,_,!1);break;default:r=d(t,e,_)}}return r},"Array, Array":function(t,e){return _(s(t),s(e)).valueOf()},"Array, Matrix":function(t,e){return _(s(t),e)},"Matrix, Array":function(t,e){return _(t,s(e))},"Matrix, any":function(t,e){var r;switch(t.storage()){case"sparse":r=u(t,e,_,!1);break;default:r=f(t,e,_,!1)}return r},"any, Matrix":function(t,e){var r;switch(e.storage()){case"sparse":r=u(e,t,_,!0);break;default:r=f(e,t,_,!0)}return r},"Array, any":function(t,e){return f(s(t),e,_,!1).valueOf()},"any, Array":function(t,e){return f(s(e),t,_,!0).valueOf()}});return _.toTex={2:"\\left(${args[0]}"+p.operators.larger+"${args[1]}\\right)"},_}var o=r(18).nearlyEqual,a=r(40);e.name="larger",e.factory=n},function(t,e,r){"use strict";function n(t,e,n){function a(e,r){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!l(r))throw new Error("Invalid datatype: "+r);if(t.isMatrix(e)||s(e)){var n=new c(e,r);this._data=n._data,this._size=n._size,this._datatype=n._datatype,this._min=null,this._max=null}else if(e&&s(e.data)&&s(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min="undefined"!=typeof e.min?e.min:null,this._max="undefined"!=typeof e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+o.types.type(e)+")");this._data=[],this._size=[0],this._datatype=r,this._min=null,this._max=null}}var c=n(r(36)),u=n(r(52));return a.prototype=new c,a.prototype.type="ImmutableDenseMatrix",a.prototype.isImmutableDenseMatrix=!0,a.prototype.subset=function(e){switch(arguments.length){case 1:var r=c.prototype.subset.call(this,e);return t.isMatrix(r)?new a({data:r._data,size:r._size,datatype:r._datatype}):r;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},a.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},a.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},a.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},a.prototype.clone=function(){var t=new a({data:i.clone(this._data),size:i.clone(this._size),datatype:this._datatype});return t},a.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},a.fromJSON=function(t){return new a(t)},a.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},a.prototype.min=function(){if(null===this._min){var t=null;this.forEach(function(e){(null===t||u(e,t))&&(t=e)}),this._min=null!==t?t:void 0}return this._min},a.prototype.max=function(){if(null===this._max){var t=null;this.forEach(function(e){(null===t||u(t,e))&&(t=e)}),this._max=null!==t?t:void 0}return this._max},a}var o=r(27),a=o.string,i=o.object,s=Array.isArray,l=a.isString;e.name="ImmutableDenseMatrix",e.path="type",e.factory=n},function(t,e,r){"use strict";function n(t){function e(n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var o=0,a=arguments.length;o0?this.step>0?this.start:this.start+(t-1)*this.step:void 0},a.prototype.max=function(){var t=this.size()[0];return t>0?this.step>0?this.start+(t-1)*this.step:this.start:void 0},a.prototype.forEach=function(t){var e=this.start,r=this.step,n=this.end,o=0;if(r>0)for(;en;)t(e,[o],this),e+=r,o++; -},a.prototype.map=function(t){var e=[];return this.forEach(function(r,n,o){e[n[0]]=t(r,n,o)}),e},a.prototype.toArray=function(){var t=[];return this.forEach(function(e,r){t[r[0]]=e}),t},a.prototype.valueOf=function(){return this.toArray()},a.prototype.format=function(t){var e=o.format(this.start,t);return 1!=this.step&&(e+=":"+o.format(this.step,t)),e+=":"+o.format(this.end,t)},a.prototype.toString=function(){return this.format()},a.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},a.fromJSON=function(t){return new a(t.start,t.end,t.step)},a}var o=r(18);e.name="Range",e.path="type",e.factory=n},function(t,e){"use strict";function r(t,e,r,n){return n("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e){var r=e.map(function(e){return t.isBigNumber(e)?e.toNumber():Array.isArray(e)||t.isMatrix(e)?e.map(function(e){return t.isBigNumber(e)?e.toNumber():e}):e}),n=new t.Index;return t.Index.apply(n,r),n}})}e.name="index",e.factory=r},function(t,e){"use strict";function r(t,e,r,n){var o=t.SparseMatrix,a=n("sparse",{"":function(){return new o([])},string:function(t){return new o([],t)},"Array | Matrix":function(t){return new o(t)},"Array | Matrix, string":function(t,e){return new o(t,e)}});return a.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},a}e.name="sparse",e.factory=r},function(t,e,r){"use strict";function n(t,e,n,i){function s(e,r){var n=l(e),o=n?new t.BigNumber(0):0;if(c(e),r){var i=u(r);return e.length>0?i.resize(e,o):i}var s=[];return e.length>0?a(s,e,o):s}function l(e){var r=!1;return e.forEach(function(e,n,o){t.isBigNumber(e)&&(r=!0,o[n]=e.toNumber())}),r}function c(t){t.forEach(function(t){if("number"!=typeof t||!o(t)||t<0)throw new Error("Parameters in function zeros must be positive integers")})}var u=n(r(43)),d=i("zeros",{"":function(){return"Array"===e.matrix?s([]):s([],"default")},"...number | BigNumber | string":function(t){var r=t[t.length-1];if("string"==typeof r){var n=t.pop();return s(t,n)}return"Array"===e.matrix?s(t):s(t,"default")},Array:s,Matrix:function(t){var e=t.storage();return s(t.valueOf(),e)},"Array | Matrix, string":function(t,e){return s(t.valueOf(),e)}});return d.toTex=void 0,d}var o=r(18).isInteger,a=r(28).resize;e.name="zeros",e.factory=n},function(t,e,r){"use strict";var n=r(2),o=r(5);t.exports=function(t,e,r){var a,i,s=_.keys(r);_.each(s,function(t){a=r[t],/[^a-z_]/i.test(a)&&(a=parseInt(a,10)),i=!1,_.each(e,function(e){n.has(e,t)&&(i=!0)}),i&&(e=_.filter(e,function(e){return e[t]==a}))});var l,c,u=[],d=!1;return _.each(e,function(e){l=!0,_.each(_.keys(t.viz.possible_filters),function(r){c=o(t.viz.filter_data,r),e[r]!=c&&(l=!1)}),l?d===!1&&(d=!0,u.push(e)):u.push(e)}),u}},function(t,e){"use strict";t.exports=function(t){var e={};return e.wrapper={},e.row_search={},e.row_search.box={},e.row_search.box.height=34,e.row_search.box.width=95,e.row_search.placeholder=t.row_search_placeholder,e.row_search.margin_left=7,e.slider={},e.slider.width=t.sidebar_width-30,e.slider.margin_left=15,e.key_cat={},e.key_cat.width=t.sidebar_width-15,e.key_cat.margin_left=5,e.key_cat.max_height=100,e.title=t.title,e.title_margin_left=7,e.about=t.about,e.width=t.sidebar_width,e.buttons={},e.buttons.width=t.sidebar_width-15,e.text={},e.icons=t.sidebar_icons,e.icon_margin_left=-5,e}},function(t,e){"use strict";t.exports=function(t,e){var r=_.keys(e)[0];return _.each(_.keys(t.viz.possible_filters),function(n){if(n!=r&&!d3.select(t.root+" .slider_"+n).empty()){var o=d3.select(t.root+" .slider_"+n).attr("current_state");e[n]=o}}),e}},function(t,e,r){"use strict";var n=r(67),o=r(69),a=r(71),i=r(72),s=r(73),l=r(74),c=r(75),u=r(76),d=r(81),f=r(83),p=r(2),h=r(4),v=r(84);t.exports=function(t){function e(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={};r.root=t.root,r.root_tips=t.root.replace("#",".")+"_d3-tip",r.viz_wrapper=t.root+" .viz_wrapper",r.do_zoom=t.do_zoom,r.background_color=t.background_color,r.super_border_color=t.super_border_color,r.outer_margins=t.outer_margins,r.is_expand=t.ini_expand,r.grey_border_width=t.grey_border_width,r.show_dendrogram=t.show_dendrogram,r.tile_click_hlight=t.tile_click_hlight,r.inst_order=t.inst_order,r.expand_button=t.expand_button,r.sim_mat=t.sim_mat,r.dendro_filter=t.dendro_filter,r.cat_filter=t.cat_filter,r.cat_value_colors=t.cat_value_colors,r.viz_svg=r.viz_wrapper+" .viz_svg",r.zoom_element=r.viz_wrapper+" .viz_svg",r.uni_duration=1e3,r.bottom_space=10,r.run_trans=!1,r.duration=1e3,r.resize=t.resize,p.has(t,"size")?r.fixed_size=t.size:r.fixed_size=!1,r.border_fraction=65,r.uni_margin=5,r.super_labels={},r.super_labels.margin={},r.super_labels.dim={},r.super_labels.margin.left=r.grey_border_width,r.super_labels.margin.top=r.grey_border_width,r.super_labels.dim.width=0,t.labels.super_labels&&(r.super_labels.dim.width=15*t.labels.super_label_scale),r.triangle_opacity=.6,r.norm_labels={},r.norm_labels.width={},r.dendro_room={},r.show_dendrogram?r.dendro_room.symbol_width=10:r.dendro_room.symbol_width=0,r.cat_colors=t.cat_colors,r=v(t,r,e),0==_.has(t,"group_level")&&(r.show_dendrogram&&(t.group_level={}),t.group_level.row=5,t.group_level.col=5),r.dendro_opacity=.35,r.spillover_col_slant=r.norm_labels.width.col;var n=h(t.network_data.views);return r.possible_filters=n.possible_filters,r.filter_data=n.filter_data,r.viz_nodes={},r.viz_nodes.row=t.network_data.row_nodes_names,r.viz_nodes.col=t.network_data.col_nodes_names,r.viz_nodes.curr_row=t.network_data.row_nodes_names,r.viz_nodes.curr_col=t.network_data.col_nodes_names,r.x_offset=0,r}var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.labels=n(t),t.viz=e(t,r),o(t),t=a(t),t.viz=i(t.viz),t.viz=s(t.viz),t.viz=l(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t=c(t),t=u(t),t=d(t),t=f(t)}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e={};return e.super_label_scale=t.super_label_scale,e.super_labels=t.super_labels,e.super_label_fs=13.8,e.super_labels&&(e.super={},e.super.row=t.super.row,e.super.col=t.super.col),e.show_label_tooltips=t.show_label_tooltips,e.row_max_char=n.max(t.network_data.row_nodes,function(t){return t.name.length}).name.length,e.col_max_char=n.max(t.network_data.col_nodes,function(t){return t.name.length}).name.length,e.max_allow_fs=t.max_allow_fs,e}},function(t,e,r){var n,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};(function(){function r(t){function e(e,r,n,o,a,i){for(;a>=0&&a0?0:s-1;return arguments.length<3&&(o=r[i?i[l]:l],l+=t),e(r,n,o,i,l,s)}}function i(t){return function(e,r,n){r=A(r,n);for(var o=O(e),a=t>0?0:o-1;a>=0&&a0?i=a>=0?a:Math.max(a+s,i):s=a>=0?Math.min(a+1,s):a+s+1;else if(r&&a&&s)return a=r(n,o),n[a]===o?a:-1;if(o!==o)return a=e(h.call(n,i,s),z.isNaN),a>=0?a+i:-1;for(a=t>0?i:s-1;a>=0&&a=0&&e<=S};z.each=z.forEach=function(t,e,r){e=k(e,r);var n,o;if(T(t))for(n=0,o=t.length;n=0},z.invoke=function(t,e){var r=h.call(arguments,2),n=z.isFunction(e);return z.map(t,function(t){var o=n?e:t[e];return null==o?o:o.apply(t,r)})},z.pluck=function(t,e){return z.map(t,z.property(e))},z.where=function(t,e){return z.filter(t,z.matcher(e))},z.findWhere=function(t,e){return z.find(t,z.matcher(e))},z.max=function(t,e,r){var n,o,a=-(1/0),i=-(1/0);if(null==e&&null!=t){t=T(t)?t:z.values(t);for(var s=0,l=t.length;sa&&(a=n)}else e=A(e,r),z.each(t,function(t,r,n){o=e(t,r,n),(o>i||o===-(1/0)&&a===-(1/0))&&(a=t,i=o)});return a},z.min=function(t,e,r){var n,o,a=1/0,i=1/0;if(null==e&&null!=t){t=T(t)?t:z.values(t);for(var s=0,l=t.length;sn||void 0===r)return 1;if(re?(i&&(clearTimeout(i),i=null),s=c,a=t.apply(n,o),i||(n=o=null)):i||r.trailing===!1||(i=setTimeout(l,u)),a}},z.debounce=function(t,e,r){var n,o,a,i,s,l=function l(){var c=z.now()-i;c=0?n=setTimeout(l,e-c):(n=null,r||(s=t.apply(a,o),n||(a=o=null)))};return function(){a=this,o=arguments,i=z.now();var c=r&&!n;return n||(n=setTimeout(l,e)),c&&(s=t.apply(a,o),a=o=null),s}},z.wrap=function(t,e){return z.partial(e,t)},z.negate=function(t){return function(){return!t.apply(this,arguments)}},z.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},z.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},z.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},z.once=z.partial(z.before,2);var I=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];z.keys=function(t){if(!z.isObject(t))return[];if(y)return y(t);var e=[];for(var r in t)z.has(t,r)&&e.push(r);return I&&l(t,e),e},z.allKeys=function(t){if(!z.isObject(t))return[];var e=[];for(var r in t)e.push(r);return I&&l(t,e),e},z.values=function(t){for(var e=z.keys(t),r=e.length,n=Array(r),o=0;o":">",'"':""","'":"'","`":"`"},D=z.invert(L),P=function(t){var e=function(e){return t[e]},r="(?:"+z.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(o,e):t}};z.escape=P(L),z.unescape=P(D),z.result=function(t,e,r){var n=null==t?void 0:t[e];return void 0===n&&(n=r),z.isFunction(n)?n.call(t):n};var U=0;z.uniqueId=function(t){var e=++U+"";return t?t+e:e},z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,$={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+$[t]};z.template=function(t,e,r){!e&&r&&(e=r),e=z.defaults({},e,z.templateSettings);var n=RegExp([(e.escape||q).source,(e.interpolate||q).source,(e.evaluate||q).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(n,function(e,r,n,i,s){return a+=t.slice(o,s).replace(H,W),o=s+e.length,r?a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),e}),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var i=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var s=function(t){return i.call(this,t,z)},l=e.variable||"obj";return s.source="function("+l+"){\n"+a+"}",s},z.chain=function(t){var e=z(t);return e._chain=!0,e};var Z=function(t,e){return t._chain?z(e).chain():e};z.mixin=function(t){z.each(z.functions(t),function(e){var r=z[e]=t[e];z.prototype[e]=function(){var t=[this._wrapped];return _.apply(t,arguments),Z(this,r.apply(z,t))}})},z.mixin(z),z.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=d[t];z.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],Z(this,r)}}),z.each(["concat","join","slice"],function(t){var e=d[t];z.prototype[t]=function(){return Z(this,e.apply(this._wrapped,arguments))}}),z.prototype.value=function(){return this._wrapped},z.prototype.valueOf=z.prototype.toJSON=z.prototype.value,z.prototype.toString=function(){return""+this._wrapped},n=[],o=function(){return z}.apply(e,n),!(void 0!==o&&(t.exports=o))}).call(void 0)},function(t,e,r){"use strict";var n=r(70);t.exports=function(t){d3.select(t.root+" .viz_wrapper").empty()&&(d3.select(t.root).append("div").classed("sidebar_wrapper",!0),d3.select(t.root).append("div").classed("viz_wrapper",!0));var e=n(t);d3.select(t.root+" .sidebar_wrapper").style("float","left").style("width",t.sidebar_width+"px").style("height",e.height+"px").style("overflow","hidden"),d3.select(t.viz.viz_wrapper).style("float","left").style("width",e.width+"px").style("height",e.height+"px")}},function(t,e){"use strict";t.exports=function(t){var e,r={},n=t.buffer_width,o=d3.select(t.root).style("width").replace("px",""),a=d3.select(t.root).style("height").replace("px","");return t.viz.is_expand===!1?(e=t.viz.outer_margins,r.width=o-t.sidebar_width-n):(e=t.viz.outer_margins,r.width=o-n),r.top=e.top,r.left=e.left,t.viz.resize?r.height=a:(t.viz.is_expand?r.width=t.viz.fixed_size.width:r.width=t.viz.fixed_size.width-t.sidebar_width,r.height=t.viz.fixed_size.height),r}},function(t,e){"use strict";t.exports=function(t){return t.viz.svg_dim={},t.viz.svg_dim.width=Number(d3.select(t.viz.viz_wrapper).style("width").replace("px","")),t.viz.svg_dim.height=Number(d3.select(t.viz.viz_wrapper).style("height").replace("px","")),t}},function(t,e){"use strict";t.exports=function(t){return t.norm_labels.margin={},t.norm_labels.margin.left=t.super_labels.margin.left+t.super_labels.dim.width,t.norm_labels.margin.top=t.super_labels.margin.top+t.super_labels.dim.width,t.label_background={},t.label_background.row=t.norm_labels.width.row+t.cat_room.row+t.uni_margin,t.label_background.col=t.norm_labels.width.col+t.cat_room.col+t.uni_margin,t}},function(t,e){"use strict";t.exports=function(t){t.clust={},t.clust.margin={},t.clust.margin.left=t.norm_labels.margin.left+t.norm_labels.width.row+t.cat_room.row+t.uni_margin,t.clust.margin.top=t.norm_labels.margin.top+t.norm_labels.width.col+t.cat_room.col+t.uni_margin;var e=t.svg_dim.width-t.clust.margin.left-t.spillover_col_slant,r=d3.scale.ordinal().rangeBands([0,e]).domain(_.range(t.num_col_nodes)),n=r.rangeBand()/2;if(n>t.norm_labels.width.col){var o=t.norm_labels.width.col/n;e*=o}return t.clust.dim={},t.clust.dim.width=e,t}},function(t,e){"use strict";t.exports=function(t){var e=t.svg_dim.height-t.clust.margin.top-t.dendro_room.col-t.bottom_space;return t.clust.dim.height=e,t}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e=Math.abs(n.max(t.network_data.col_nodes,function(t){return Math.abs(t.value)}).value);return t.labels.bar_scale_col=d3.scale.linear().domain([0,e]).range([0,.75*t.viz.norm_labels.width.col]),e=Math.abs(n.max(t.network_data.row_nodes,function(t){return Math.abs(t.value)}).value),t.labels.bar_scale_row=d3.scale.linear().domain([0,e]).range([0,t.viz.norm_labels.width.row]),t}},function(t,e,r){"use strict";var n=r(77),o=r(79);t.exports=function(t){t.matrix=n(t),t.viz.x_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]);var e;return _.each(["row","col"],function(r){e=t.viz.inst_order[r],"custom"===e&&(e="clust"),"row"===r?t.viz.x_scale.domain(t.matrix.orders[e+"_"+r]):t.viz.y_scale.domain(t.matrix.orders[e+"_"+r])}),t.viz.border_width={},t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,o(t),t}},function(t,e,r){"use strict";var n=r(2),o=r(78),a=r(68);t.exports=function(t){var e={},r=t.network_data;e.tile_colors=t.tile_colors,e.bar_colors=t.bar_colors,e.outline_colors=t.outline_colors,e.hlight_color=t.highlight_color,e.tile_title=t.tile_title,e.show_tile_tooltips=t.show_tile_tooltips,e.make_tile_tooltip=t.make_tile_tooltip,e.distance_metric="cosine",e.linkage_type="average",e.click_hlight_x=-666,e.click_hlight_y=-666,e.click_hlight_row=-666,e.click_hlight_col=-666,e.def_large_matrix=1e4,e.opacity_function=t.opacity_scale,e.orders={},_.each(["row","col"],function(o){var a;a="row"===o?"col":"row";var i=r[a+"_nodes"],s=i.length,l=n.pluck(i,"name"),c=l.sort(),u=_.map(c,function(t){return r[a+"_nodes_names"].indexOf(t)});e.orders["alpha_"+o]=u;var d=["clust","rank"];_.has(i[0],"rankvar")&&d.push("rankvar"),t.viz.all_cats[a].length>0&&_.each(t.viz.all_cats[a],function(t){t=t.replace("-","_"),d.push(t+"_index")}),_.each(d,function(t){var r=d3.range(s).sort(function(e,r){return i[r][t]-i[e][t]});e.orders[t+"_"+o]=r})}),n.has(r,"all_links")?e.max_link=a.max(r.all_links,function(t){return Math.abs(t.value)}).value:e.max_link=a.max(r.links,function(t){return Math.abs(t.value)}).value,e.abs_max_val=Math.abs(e.max_link)*t.clamp_opacity,0===t.input_domain?"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,e.abs_max_val]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,e.abs_max_val]).clamp(!0).range([0,1])):"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,t.input_domain]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,t.input_domain]).clamp(!0).range([0,1]));var i=n.has(r.links[0],"value_up"),s=n.has(r.links[0],"value_dn");return i||s?e.tile_type="updn":e.tile_type="simple",n.has(r.links[0],"highlight")?e.highlight=1:e.highlight=0,e.matrix=o(r),e.wait_tooltip=0,e}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t){var e,r,o=[];return r=!!n.has(t.links[0],"value_orig"),t.row_nodes.forEach(function(a,i){o[i]={},o[i].name=t.row_nodes[i].name,o[i].row_index=i,o[i].row_data=d3.range(t.col_nodes.length).map(function(o){return e=n.has(t.links[0],"value_up")||n.has(t.links[0],"value_dn")?{pos_x:o,pos_y:i,value:0,value_up:0,value_dn:0,highlight:0}:{pos_x:o,pos_y:i,value:0,highlight:0},r&&(e.value_orig=0),e})}),t.links.forEach(function(t){o[t.source].row_data[t.target].value=t.value,o[t.source].row_data[t.target].row_name=t.row_name,o[t.source].row_data[t.target].col_name=t.col_name,(n.has(t,"value_up")||n.has(t,"value_dn"))&&(o[t.source].row_data[t.target].value_up=t.value_up,o[t.source].row_data[t.target].value_dn=t.value_dn),r&&(o[t.source].row_data[t.target].value_orig=t.value_orig),t.highlight&&(o[t.source].row_data[t.target].highlight=t.highlight),t.info&&(o[t.source].row_data[t.target].info=t.info)}),o}},function(t,e,r){"use strict";var n=r(80);t.exports=function(t){var e=3,r=2,o=e/t.viz.rect_height,a=2;t.viz.ds_zt=a;var i=Math.floor(Math.log(o)/Math.log(a));if(t.viz.rect_height0){var s=2;t.viz.ds_opacity_scale=d3.scale.linear().domain([1,100]).range([1,s]).clamp(!0);var l;t.viz.ds_num_levels=i,t.viz.ds=[],t.matrix.ds_matrix=[];for(var c=t.viz.inst_order.row,u=$.extend(!0,{},t.matrix.matrix),d=0;dt.labels.max_allow_fs&&(t.labels.default_fs_row=t.labels.max_allow_fs),t.labels.default_fs_col>t.labels.max_allow_fs&&(t.labels.default_fs_col=t.labels.max_allow_fs),t}},function(t,e,r){"use strict";var n=r(85),o=r(2),a=r(86),i=r(87); -t.exports=function(t,e){var r,s,l,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=": ";e.show_categories={},e.all_cats={},e.cat_names={},e.cat_info={};var d={};d.row=null,d.col=null,e.cat_colors={},e.cat_colors.value_opacity=d;var f=0;return _.each(["row","col"],function(n){e.show_categories[n]=!1,e.all_cats[n]=[];var d=_.keys(t.network_data[n+"_nodes"][0]);d=d.sort(),_.each(d,function(t){t.indexOf("cat-")>=0&&(e.show_categories[n]=!0,e.all_cats[n].push(t))}),e.cat_info[n]=null,e.show_categories[n]&&(e.cat_colors[n]={},e.cat_info[n]={},e.cat_names[n]={},_.each(e.all_cats[n],function(c){var d=t.network_data[n+"_nodes"][0];"string"==typeof d[c]&&d[c].indexOf(u)>0?(r=d[c].split(u)[0],e.cat_names[n][c]=r):e.cat_names[n][c]=c;var p=o.pluck(t.network_data[n+"_nodes"],c),h=[];_.each(p,function(t){var e;e=t.indexOf(": ")>0?t.split(": ")[1]:t,h.push(e)});var v=_.uniq(p).sort();if(s=i(v),"cat_strings"===s.type){var m=_.countBy(h);s.cat_hist=m}else s.cat_hist=null;e.cat_info[n][c]=s,e.cat_colors[n][c]={},_.each(v,function(t,r){l=a.get_random_color(r+f),e.cat_colors[n][c][t]=l,"string"==typeof t&&(t.indexOf("Not ")>=0||t.indexOf(": false")>0)&&(e.cat_colors[n][c][t]="#eee"),f+=1})})),_.has(t.network_data,"cat_colors")&&c===!0&&(e.cat_colors[n]=t.network_data.cat_colors[n]),t.sim_mat&&(e.cat_colors.col=e.cat_colors.row)}),e.cat_colors=e.cat_colors,e.cat_colors.opacity=.6,e.cat_colors.active_opacity=.9,e=n(t,e)}},function(t,e){"use strict";t.exports=function(t,e){var r,n=d3.scale.linear().domain([5,15]).range([85,120]).clamp("true");return e.cat_room={},e.cat_room.symbol_width=12,e.cat_room.separation=3,_.each(["row","col"],function(o){e.norm_labels.width[o]=n(t.labels[o+"_max_char"])*t[o+"_label_scale"],e["num_"+o+"_nodes"]=t.network_data[o+"_nodes"].length,"row"===o?e.dendro_room[o]=e.dendro_room.symbol_width:e.dendro_room[o]=e.dendro_room.symbol_width+3*e.uni_margin;var a=e.all_cats[o].length;if(e.show_categories[o]){r=(a-1)*e.cat_room.separation;var i;i="row"===o?a+1:a,e.cat_room[o]=i*e.cat_room.symbol_width+r}else"row"==o?e.cat_room[o]=e.cat_room.symbol_width:e.cat_room[o]=0}),e}},function(t,e){"use strict";function r(){return"#EEE"}function n(t){return a[t%o()]}function o(){return a.length}var a;a=["#393b79","#aec7e8","#ff7f0e","#ffbb78","#98df8a","#bcbd22","#404040","#ff9896","#c5b0d5","#8c564b","#1f77b4","#5254a3","#FFDB58","#c49c94","#e377c2","#7f7f7f","#2ca02c","#9467bd","#dbdb8d","#17becf","#637939","#6b6ecf","#9c9ede","#d62728","#8ca252","#8c6d31","#bd9e39","#e7cb94","#843c39","#ad494a","#d6616b","#7b4173","#a55194","#ce6dbd","#de9ed6"],t.exports={get_default_color:r,get_random_color:n,get_num_colors:o}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e=t[0],r=!1,o=!1,a="cat_strings",i=NaN,s=[],l=null,c=": ";if("string"==typeof e&&e.indexOf(c)>-1&&(r=!0,e=e.split(c)[1]),0==isNaN(e)&&(o=!0),o&&(a="cat_values",_.each(t,function(t){r&&(t=t.split(c)[1]),isNaN(t)===!0?a="cat_strings":(t=parseFloat(t),s.push(t))})),"cat_values"===a){var u=n.max(s,function(t){return Math.abs(t)});i=Math.abs(u),l=d3.scale.linear().domain([0,i]).range([0,1])}var d={};return d.type=a,d.max_abs_val=i,d.cat_scale=l,d}},function(t,e){"use strict";t.exports=function(){var t={};return t.zoom_x=1,t.zoom_y=1,t.trans_x=0,t.trans_y=0,t}},function(t,e,r){"use strict";var n=r(90),o=r(101),a=r(131),i=r(139),s=r(140),l=r(151),c=r(161),u=r(180),d=r(185),f=r(146),p=r(186),h=r(187),v=r(188),m=r(228);t.exports=function(t){function e(){var t=r.viz.super_border_color;return(r.viz.is_expand||0==r.show_viz_border)&&(t="white"),t}var r=t.params;d3.select(r.viz.viz_wrapper+" svg").remove();var g=d3.select(r.viz.viz_wrapper).append("svg").attr("class","viz_svg").attr("id","svg_"+r.root.replace("#","")).attr("width",r.viz.svg_dim.width).attr("height",r.viz.svg_dim.height).attr("is_zoom",0).attr("stopped_zoom",1);g.append("rect").attr("class","super_background").style("width",r.viz.svg_dim.width).style("height",r.viz.svg_dim.height).style("fill","white"),n(r,g),o(t),r.viz.show_dendrogram&&(p(t),h(t)),m(t),a(t),r.viz.ds_level===-1&&_.each(["row","col"],function(t){var e=Number(d3.select("."+t+"_label_group").select("text").style("font-size").replace("px","")),n=8;e>n&&d3.selectAll(r.root+" ."+t+"_label_group").each(function(){f(r,this,t)})}),d(t),r.viz.show_categories.col&&u(t),s(t),r.labels.super_labels&&i(r),v(t),d3.select(r.viz.viz_svg).append("rect").classed("left_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.grey_border_width).attr("height",r.viz.svg_dim.height).attr("transform","translate(0,0)"),d3.select(r.viz.viz_svg).append("rect").classed("right_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.grey_border_width).attr("height",r.viz.svg_dim.height).attr("transform",function(){var t=r.viz.svg_dim.width-r.viz.grey_border_width;return"translate("+t+",0)"}),d3.select(r.viz.viz_svg).append("rect").classed("top_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.svg_dim.width).attr("height",r.viz.grey_border_width).attr("transform",function(){var t=0;return"translate("+t+",0)"}),d3.select(r.viz.viz_svg).append("rect").classed("bottom_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.svg_dim.width).attr("height",r.viz.grey_border_width).attr("transform",function(){var t=r.viz.svg_dim.height-r.viz.grey_border_width;return"translate(0,"+t+")"}),l(t),c(t),r.viz.do_zoom&&d3.select(r.viz.zoom_element).call(r.zoom_behavior),d3.select(r.viz.zoom_element).on("dblclick.zoom",null)}},function(t,e,r){"use strict";var n=r(2),o=r(91),a=r(92),i=r(93);t.exports=function(t,e){var r,s=t.network_data,l=[];r=e.append("g").attr("class","clust_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.clust.margin.top+")").append("g").attr("class","clust_group").classed("clust_group",!0),r.append("rect").classed("background",!0).classed("grey_background",!0).style("fill","#eee").style("opacity",.25).attr("width",t.viz.clust.dim.width).attr("height",t.viz.clust.dim.height),null===t.viz.ds?i(t,t.matrix.matrix,"all",t.viz.ds_level):i(t,t.matrix.ds_matrix[0],"all",t.viz.ds_level),"function"==typeof t.click_tile?d3.selectAll(t.root+" .tile").on("click",function(e){var r={};r.row=t.network_data.row_nodes[e.pos_y].name,r.col=t.network_data.col_nodes[e.pos_x].name,r.value=e.value,n.has(e,"value_up")&&(r.value_up=e.value_up),n.has(e,"value_dn")&&(r.value_dn=e.value_dn),n.has(e,"info")&&(r.info=e.info),t.click_tile(r),a(t,this)}):t.tile_click_hlight&&d3.selectAll(t.root+" .tile").on("click",function(){a(t,this)});var c={},u=0;return c.enter=0,o(t,c,u),{get_clust_group:function(){return r},get_matrix:function(){return l},get_nodes:function(t){return"row"===t?s.row_nodes:s.col_nodes}}}},function(t,e){"use strict";t.exports=function(t,e,r){}},function(t,e){"use strict";t.exports=function(t,e){d3.select(e).each(function(r){var n=r.pos_x,o=r.pos_y;if(d3.selectAll(t.root+" .click_hlight").remove(),n!=t.matrix.click_hlight_x||o!=t.matrix.click_hlight_y){t.matrix.click_hlight_x=n,t.matrix.click_hlight_y=o;var a=6,i=.85,s=a*t.viz.border_width.x,l=a*t.viz.border_width.y;d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("top_hlight",!0).attr("width",t.viz.x_scale.rangeBand()).attr("height",l).attr("fill",t.matrix.hlight_color).attr("transform",function(){return"translate("+t.viz.x_scale(n)+",0)"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("left_hlight",!0).attr("width",s).attr("height",t.viz.y_scale.rangeBand()-.99*l).attr("fill",t.matrix.hlight_color).attr("transform",function(){return"translate("+t.viz.x_scale(n)+","+.99*l+")"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("right_hlight",!0).attr("width",s).attr("height",t.viz.y_scale.rangeBand()-.99*l).attr("fill",t.matrix.hlight_color).attr("transform",function(){var e=t.viz.x_scale(n)+t.viz.x_scale.rangeBand()-s;return"translate("+e+","+.99*l+")"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("bottom_hlight",!0).attr("width",function(){return t.viz.x_scale.rangeBand()-1.98*s}).attr("height",l).attr("fill",t.matrix.hlight_color).attr("transform",function(){var e=t.viz.x_scale(n)+.99*s,r=t.viz.y_scale.rangeBand()-l;return"translate("+e+","+r+")"}).attr("opacity",i)}else t.matrix.click_hlight_x=-666,t.matrix.click_hlight_y=-666})}},function(t,e,r){"use strict";var n=r(94),o=r(100),a=r(68);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=t.viz.y_scale,l=!0,c="row";if(i>=0&&(s=t.viz.ds[i].y_scale,l=!1,c="ds"+String(i)+"_row"),l)var u=o().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip "+e+"_tile_tip";return r}).style("display","none").direction("nw").offset([0,0]).html(function(e){var r,n=String(e.value.toFixed(3));if(t.keep_orig){var o=String(e.value_orig.toFixed(3));r="

"+e.row_name+" and "+e.col_name+"

normalized value: "+n+"

original value: "+o+"
"}else r="

"+e.row_name+" and "+e.col_name+"

value: "+n+"
";return r});else u=null;var d=[];"all"===r?d=e:_.each(e,function(t){a.contains(r,t.name)&&d.push(t)}),d3.select(t.root+" .clust_group").selectAll(".row").data(d,function(t){return t.name}).enter().append("g").classed(c,!0).attr("transform",function(t){return"translate(0,"+s(t.row_index)+")"}).each(function(e){n(t,e,u,this,i)}),t.viz.ds_level===-1&&null!=u&&d3.selectAll(t.root+" .row").call(u)}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99);t.exports=function(t,e,r,l){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,u=e.row_data,d=!0,f=t.viz.rect_height;c>=0&&(f=t.viz.ds[c].rect_height);var p;p=!!_.has(t.network_data.links[0],"value_orig");var h;h=p===!1?_.filter(u,function(t){return 0!==t.value}):u;var v=d3.select(l).selectAll("rect").data(h,function(t){return t.col_name}).enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",f).style("fill",function(e){var r;return r="NaN"===e.value_orig?"#000000":e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).style("fill-opacity",function(e){var r;return r="NaN"===e.value_orig?.175:t.matrix.opacity_scale(Math.abs(e.value))}).attr("transform",function(e){return s(t,e)});if(d&&v.on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r}).on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&(r=t.matrix.opacity_scale(Math.abs(e.value_dn))),r}).on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}t.matrix.tile_title&&v.append("title").text(function(t){var e="value: "+t.value;return e})}},function(t,e){"use strict";t.exports=function(t){var e=0,r=t.viz.x_scale.rangeBand()-t.viz.border_width.x,n=0,o=t.viz.y_scale.rangeBand()-t.viz.border_width.y,a="M"+e+","+n+", L"+e+", "+o+", L"+r+",0 Z";return a}},function(t,e){"use strict";t.exports=function(t){var e=0,r=t.viz.x_scale.rangeBand()-t.viz.border_width.x,n=t.viz.y_scale.rangeBand()-t.viz.border_width.y,o=t.viz.y_scale.rangeBand()-t.viz.border_width.y,a="M"+e+", "+n+" , L"+r+", "+o+", L"+r+",0 Z";return a}},function(t,e){"use strict";t.exports=function(t,e,r,n){function o(){if(d3.select(e).classed("hovering")){var n=Number(d3.select(t.root+" .viz_svg").attr("is_zoom"));if(0===n&&t.matrix.show_tile_tooltips&&null!==r&&(d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","block"),r.show.apply(e,s),null!=t.tile_tip_callback)){var o=s[0];t.tile_tip_callback(o)}}}var a,i=n[0],s=[].slice.call(n),l=1e3;d3.select(e).classed("hovering",!0),_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight",function(t){var r,n=i[e+"_name"].replace(/_/g," ")===t.name;return r=n?"bold":"normal"})}),s.push(e),clearTimeout(a),a=setTimeout(o,l,e)}},function(t,e){"use strict";t.exports=function(t,e,r){d3.select(e).classed("hovering",!1),d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","none"),_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight","normal")}),null!=r&&r.hide()}},function(t,e){"use strict";t.exports=function(t,e){var r;r=e.pos_x in t.viz.x_scale.domain()?t.viz.x_scale(e.pos_x):0;var n=r+.5*t.viz.border_width.x,o=.5*t.viz.border_width.y;return"translate("+n+","+o+")"}},function(t,e){"use strict";t.exports=function(){function t(t){b=_(t),z=b.createSVGPoint(),document.body.appendChild(x)}function e(){return"n"}function r(){return[0,0]}function n(){return" "}function o(){var t=h();return{top:t.s.y,left:t.s.x}}function a(){var t=h();return{top:t.n.y-x.offsetHeight,left:t.n.x-x.offsetWidth/2}}function i(){var t=h();return{top:t.s.y,left:t.s.x-x.offsetWidth/2}}function s(){var t=h();return{top:t.e.y-x.offsetHeight/2,left:t.e.x}}function l(){var t=h();return{top:t.w.y-x.offsetHeight/2,left:t.w.x-x.offsetWidth}}function c(){var t=h();return{top:t.nw.y-x.offsetHeight,left:t.nw.x-x.offsetWidth}}function u(){var t=h();return{top:t.ne.y-x.offsetHeight,left:t.ne.x}}function d(){var t=h();return{top:t.sw.y,left:t.sw.x-x.offsetWidth}}function f(){var t=h();return{top:t.se.y,left:t.e.x}}function p(){var t=d3.select(document.createElement("div"));return t.style({position:"absolute",opacity:0,pointerEvents:"none",boxSizing:"border-box"}),t.node()}function _(t){return t=t.node(),"svg"==t.tagName.toLowerCase()?t:t.ownerSVGElement}function h(){var t=k||d3.event.target,e={},r=t.getScreenCTM(),n=t.getBBox(),o=n.width,a=n.height,i=n.x,s=n.y,l=document.documentElement.scrollTop||document.body.scrollTop,c=document.documentElement.scrollLeft||document.body.scrollLeft;return r.a=1,r.d=1,r.e=r.e+c,r.f=r.f+l,z.x=i,z.y=s,e.nw=z.matrixTransform(r),z.x=z.x+o,e.ne=z.matrixTransform(r),z.y=z.y+a,e.se=z.matrixTransform(r),z.x=z.x-o,e.sw=z.matrixTransform(r),z.y=z.y-a/2,e.w=z.matrixTransform(r),z.x=z.x+o,e.e=z.matrixTransform(r),z.x=z.x-o/2,z.y=z.y-a/2,e.n=z.matrixTransform(r),z.y=z.y+a,e.s=z.matrixTransform(r),e}function v(t){var e=d3.select(t).classed("hovering");e&&d3.selectAll(".d3-tip").transition().duration(250).style("opacity",0).style("display","none")}function m(t){var e={};return t&&"[object Function]"===e.toString.call(t)}var g=e,y=r,w=n,x=p(),b=null,z=null,k=null;t.show=function(){var e=Array.prototype.slice.call(arguments);e[e.length-1]instanceof SVGElement&&(k=e.pop());var r,n=w.apply(this,e),o=y.apply(this,e),a=g.apply(this,e),i=d3.select(x),s=0;for(i.html(n).style({opacity:1,"pointer-events":"all"}).style("z-index",99);s--;)i.classed(E[s],!1);if(r=A.get(a).apply(this),i.classed(a,!0).style({top:r.top+o[0]+"px",left:r.left+o[1]+"px"}),m(this)===!1){var l=d3.select(this).attr("class");l.indexOf("tile")>=0&&setTimeout(v,5e3,this)}return t},t.hide=function(){var e=d3.select(x);return e.style({opacity:0,"pointer-events":"none"}),t},t.attr=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(x).attr(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d3.select(x),r),t},t.style=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(x).style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d3.select(x),r),t},t.direction=function(e){return arguments.length?(g=null==e?e:d3.functor(e),t):g},t.offset=function(e){return arguments.length?(y=null==e?e:d3.functor(e),t):y},t.html=function(e){return arguments.length?(w=null==e?e:d3.functor(e),t):w};var A=d3.map({n:a,s:i,e:s,w:l,nw:c,ne:u,sw:d,se:f,south_custom:o}),E=A.keys();return t}},function(t,e,r){"use strict";var n=r(102);t.exports=function(t,e){var r,o=t.params;r=d3.select(o.viz.viz_svg+" .row_container").empty()?d3.select(o.viz.viz_svg).append("g").classed("row_container",!0).attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"):d3.select(o.viz.viz_svg).select(".row_container").attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"),d3.select(o.root+" .row_white_background").empty()&&r.append("rect").classed("row_white_background",!0).classed("white_bars",!0).attr("fill",o.viz.background_color).attr("width",o.viz.label_background.row).attr("height",30*o.viz.clust.dim.height+"px"),d3.select(o.root+" .row_label_container").empty()?r.append("g").classed("row_label_container",!0).attr("transform","translate("+o.viz.norm_labels.width.row+",0)").append("g").classed("row_label_zoom_container",!0):r.select(o.root+" .row_label_container").attr("transform","translate("+o.viz.norm_labels.width.row+",0)"),o.viz.ds_level===-1&&n(t,"all",e)}},function(t,e,r){"use strict";var n=r(2),o=r(103),a=r(104),i=r(130),s=r(68);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=t.params,c=[];"all"===e?c=l.network_data.row_nodes:_.each(l.network_data.row_nodes,function(t){s.contains(e,t.name)&&c.push(t)});var u=d3.select(l.root+" .row_label_zoom_container").selectAll("g").data(c,function(t){return t.name}).enter().append("g").classed("row_label_group",!0),d=l.network_data.row_nodes_names;u.attr("transform",function(t){var e=_.indexOf(d,t.name);return"translate(0,"+l.viz.y_scale(e)+")"}),u.on("dblclick",function(e){var r="__data__",n=this[r].name;a(t,this,n),l.tile_click_hlight&&o(this,e.ini)}),i(l),u.insert("rect").style("opacity",0),u.append("text").attr("y",.5*l.viz.rect_height+.35*l.labels.default_fs_row).attr("text-anchor","end").style("font-size",l.labels.default_fs_row+"px").text(function(t){return n.normal_name(t)}).attr("pointer-events","none").style("opacity",0).style("cursor","default").transition().delay(r).duration(r).style("opacity",1),u.each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",l.viz.y_scale.rangeBand()).style("fill",function(){var t="yellow";return t}).style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),n.has(l.network_data.row_nodes[0],"value")&&u.append("rect").classed("row_bars",!0).attr("width",function(t){var e=0;return e=l.labels.bar_scale_row(Math.abs(t.value))}).attr("x",function(t){var e=0;return e=-l.labels.bar_scale_row(Math.abs(t.value))}).attr("height",l.viz.y_scale.rangeBand()).attr("fill",function(t){return t.value>0?l.matrix.bar_colors[0]:l.matrix.bar_colors[1]}).attr("opacity",.4)}},function(t,e){"use strict";t.exports=function(t,e,r){if(r!=t.click_hlight_row){var n=6,o=.85,a=n*t.viz.border_width.x;d3.selectAll(t.root+" .click_hlight").remove(),d3.select(e).append("rect").classed("click_hlight",!0).classed("row_top_hlight",!0).attr("width",t.viz.svg_dim.width).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o),d3.select(e).append("rect").classed("click_hlight",!0).classed("row_bottom_hlight",!0).attr("width",t.viz.svg_dim.width).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=t.viz.y_scale.rangeBand()-a;return"translate(0,"+e+")"})}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_row=-666}},function(t,e,r){"use strict";var n=r(105),o=r(106),a=r(88),i=r(129),s=r(79);t.exports=function(t,e,r){var l=t.params,c=i(l);if(1===c.zoom_y&&1===c.zoom_x){l.viz.inst_order.row="custom",o(t,"col"),d3.selectAll(l.root+" .toggle_col_order .btn").classed("active",!1),l.viz.run_trans=!0;var u=$.extend(!0,{},l.matrix.matrix),d=l.network_data.row_nodes,f=l.network_data.col_nodes,p=[];d.forEach(function(t){p.push(t.name)}),r=_.indexOf(p,r),p=[],f.forEach(function(t,e){p.push(u[r].row_data[e].value)});var h=d3.range(p.length).sort(function(t,e){return p[e]-p[t]});l.viz.x_scale.domain(h),l.matrix.orders.custom_row=h;var v;v=l.network_data.links.length>l.matrix.def_large_matrix?d3.select(l.root+" .viz_svg"):d3.select(l.root+" .viz_svg").transition().duration(2500);var m=l.network_data.col_nodes_names;v.select(".col_zoom_container").selectAll(".col_label_text").attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate("+l.viz.x_scale(e)+")rotate(-90)"}),v.selectAll(".col_cat_group").attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate("+l.viz.x_scale(e)+",0)"}),l.viz.ds_level===-1&&(v.selectAll(".tile").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),v.selectAll(".tile_up").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),v.selectAll(".tile_dn").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"})),d3.selectAll(l.root+" .row_label_group").select("rect").style("opacity",0),d3.select(e).select("rect").style("opacity",1),n(l),l.network_data.links.forEach(function(t){t.x=l.viz.x_scale(t.target),t.y=l.viz.y_scale(t.source)}),l.zoom_info=a(),setTimeout(function(){l.viz.run_trans=!1},2500),l.viz.ds_num_levels>0&&l.viz.ds_level>=0&&s(l)}}},function(t,e){"use strict";t.exports=function(t){var e=6,r=e*t.viz.border_width.x,n=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.x_scale.rangeBand()).attr("height",n).transition().duration(2500).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+",0)"}),d3.select(t.root+" .left_hlight").attr("width",r).attr("height",t.viz.y_scale.rangeBand()-.99*n).transition().duration(2500).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*n+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.y_scale.rangeBand()-.99*n).transition().duration(2500).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.x_scale.rangeBand()-r;return"translate("+e+","+.99*n+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.x_scale.rangeBand()-1.98*r}).attr("height",n).transition().duration(2500).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,o=t.viz.y_scale.rangeBand()-n;return"translate("+e+","+o+")"})}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500,o=t.params;"row"===e&&"clust"===o.viz.inst_order.col&&setTimeout(n,r,t,"row",!0),"col"===e&&"clust"===o.viz.inst_order.row&&setTimeout(n,r,t,"col",!0),"clust"!=o.viz.inst_order.row&&o.viz.dendro_filter.col===!1&&(d3.selectAll(o.root+" .col_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null),d3.select(o.root+" .col_slider_group").style("opacity",0),d3.selectAll(o.root+" .col_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null)),"clust"!=o.viz.inst_order.col&&o.viz.dendro_filter.row===!1&&(d3.selectAll(o.root+" .row_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null).on("click",null),d3.select(o.root+" .row_slider_group").style("opacity",0),d3.selectAll(o.root+" .row_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null))}},function(t,e,r){"use strict";var n=r(108),o=r(109),a=r(110),i=r(100),s=r(112),l=r(115);t.exports=function(t,e){function r(t,r,n){if(d3.select(t).classed("hovering")){var o=u.viz.root_tips+"_"+e+"_dendro_tip";d3.select(o+" .cat_graph").empty()&&null!==u.viz.cat_info[e]&&l(u,e,r,f[n],o,!0),d3.selectAll(u.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",1)}}var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=t.params;"both"===e&&(e="row");var d;d="row"===e?"col":"row","clust"===u.viz.inst_order[d]&&d3.select(u.root+" ."+e+"_slider_group").style("opacity",1);var f;f="row"===e?n(u):o(u),d3.select(t.params.root+" ."+e+"_dendro_crop_buttons").empty()===!1&&s(t,e);var p=u.viz.dendro_opacity,_=500;d3.selectAll(t.params.viz.root_tips+"_"+e+"_dendro_tip").remove();var h;d3.selectAll(u.root+" ."+e+"_dendro_group").empty()?h=!1:(h=!0,d3.selectAll(u.root+" ."+e+"_dendro_group").remove());var v=0,m=-5,g=i().attr("class",function(){var t=u.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_tip";return r}).direction("nw").offset([v,m]).style("display","none").style("opacity",0);g.html(function(){var t='
Click for cluster information
and additional options.';return t}),c&&(h=!1);var y,w,x,b,z,k,A=d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").data(f,function(t){return t.name}).enter().append("path").style("opacity",0).attr("class",e+"_dendro_group").style("fill","black");A.attr("d",function(t){"row"===e?(y=0,w=t.pos_top,x=30,b=t.pos_mid,z=0,k=t.pos_bot):(y=t.pos_top,w=0,x=t.pos_mid,b=30,z=t.pos_bot,k=0);var r="M"+y+","+w+", L"+x+", "+b+", L"+z+","+k+" Z";return r}),A.on("mouseover",function(n,o){d3.select(this).classed("hovering",!0),null!=t.params.dendro_callback&&t.params.dendro_callback(this),d3.select(u.viz.root_tips+"_"+e+"_dendro_tip").style("display","block"),a(u,this,n,e),g.show(n),d3.select(u.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",0),setTimeout(r,_,this,n,o)}).on("mouseout",function(){"clust"===u.viz.inst_order[d]&&d3.select(this).style("opacity",p),d3.selectAll(u.root+" .dendro_shadow").remove(),d3.select(this).classed("hovering",!1),g.hide(this)}).on("click",function(r,n){$(u.root+" .dendro_info").modal("toggle");var o=r.all_names.join(", ");d3.select(u.root+" .dendro_info input").attr("value",o);var a=u.root+" .dendro_info";d3.selectAll(".dendro_info .cluster_info_container .cat_graph").remove(),null!==u.viz.cat_info[e]&&l(u,e,r,f[n],a),null!=t.params.dendro_click_callback&&t.params.dendro_click_callback(this)}).call(g);var E;E="clust"===u.viz.inst_order[d]?p:0,h?d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").transition().delay(1e3).duration(1e3).style("opacity",E):d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").style("opacity",E)}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.row,n=t.network_data.row_nodes,o=t.network_data.row_nodes_names;_.each(n,function(n){var a=n.group[r],i=_.indexOf(o,n.name),s=t.viz.y_scale(i),l=s+t.viz.y_scale.rangeBand();_.has(e,a)===!1&&(e[a]={},e[a].name_top=n.name,e[a].name_bot=n.name,e[a].pos_top=s,e[a].pos_bot=l,e[a].pos_mid=(s+l)/2,e[a].name=a,e[a].all_names=[],e[a].inst_rc="row"),e[a].all_names.push(n.name),se[a].pos_bot&&(e[a].name_bot=n.name,e[a].pos_bot=l,e[a].pos_mid=(e[a].pos_top+l)/2)});var a=[];return _.each(e,function(t){a.push(t)}),a}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.col,n=t.network_data.col_nodes,o=t.network_data.col_nodes_names;_.each(n,function(n){var a=n.group[r],i=_.indexOf(o,n.name),s=t.viz.x_scale(i),l=s+t.viz.x_scale.rangeBand();_.has(e,a)===!1&&(e[a]={},e[a].name_top=n.name,e[a].name_bot=n.name,e[a].pos_top=s,e[a].pos_bot=l,e[a].pos_mid=(s+l)/2,e[a].name=a,e[a].all_names=[],e[a].inst_rc="col"),e[a].all_names.push(n.name),se[a].pos_bot&&(e[a].name_bot=n.name,e[a].pos_bot=l,e[a].pos_mid=(e[a].pos_top+l)/2)});var a=[];return _.each(e,function(t){a.push(t)}),a}},function(t,e,r){"use strict";var n=r(111);t.exports=function(t,e,r,o){function a(){d3.select(e).classed("hovering")&&t.is_slider_drag===!1&&(d3.select(e).style("opacity",.7),d3.select(t.viz.viz_svg).classed("running_update")===!1&&i())}function i(){"row"===o?"clust"===t.viz.inst_order.col&&n(t,e,o,r):"col"===o?"clust"===t.viz.inst_order.row&&n(t,e,o,r):"both"===o&&("clust"===t.viz.inst_order.col&&n(t,e,"row",r),"clust"===t.viz.inst_order.row&&n(t,e,"col",r))}d3.selectAll(t.root+" ."+o+"_dendro_crop_buttons")[0].length>1?setTimeout(a,500):d3.selectAll(t.root+" .dendro_shadow").remove()}},function(t,e){"use strict";t.exports=function(t,e,r,n){var o,a=.2;d3.selectAll(t.root+" .dendro_shadow").remove(),"row"==r?(d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",n.pos_top+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.height-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",o+"px").attr("transform","translate(0,"+n.pos_bot+")").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a)):"col"===r&&(d3.select(t.root+" .clust_group").append("rect").attr("width",n.pos_top+"px").attr("height",t.viz.clust.dim.height+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.width-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",o+"px").attr("height",t.viz.clust.dim.height+"px").attr("transform","translate("+n.pos_bot+",0)").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a))}},function(t,e,r){"use strict";var n=r(108),o=r(109),a=r(100),i=r(110),s=r(113),l=r(114);t.exports=function(t,e){function r(t){d3.select(t).classed("hovering")&&d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_crop_tip").style("opacity",1).style("display","block")}var c,u,d=t.params,f=.6*d.viz.dendro_opacity;"row"===e?(c=n(d),u="col"):(c=o(d),u="row");var p=5,_=-5,h=a().attr("class",function(){var t=d.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_crop_tip";return r}).direction("nw").style("display","none").offset([p,_]),v=500;d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_crop_tip").remove(),d3.selectAll(d.root+" ."+e+"_dendro_crop_buttons").remove();var m,g,y,w,x,b,z,k,A,E,N=45,M=.25,S=e+"_dendro_crop_buttons";d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter")===!1?(m=d3.select(d.root+" ."+e+"_dendro_icons_group").selectAll("path").data(c,function(t){return t.name}).enter().append("path").classed(S,!0).attr("d",function(t){k=10,A=10;var r=t.pos_bot-t.pos_top;"row"===e?(r5&&void 0!==arguments[5]&&arguments[5];"both"===e&&(e="row");var s=n(t,r,e);if(s.length>0){var l=d3.select(a+" .cluster_info_container"),c=": ",u="

",d=370,f=23,p=20,h=25,v=180,m=27,g=177,y=4,w=5,x=150,b=6,z=!1;null!=s[0].bar_data[0][w]&&(d+=100,g=g+x-47,z=!0);var k=o.all_names.length,A=y;if(z){A=w;var E=s[0].bar_data;k=0,_.each(E,function(t){k+=t[w]})}var N=3,M=25,S=20;_.each(s.slice(0,N),function(t){var e=t.bar_data.length;e>M&&(e=M),S+=m*(e+1)}),i&&l.append("text").text("Cluster Information");var O=l.append("div").style("margin-top","5px").classed("cat_graph",!0).append("svg").style("height",S+"px").style("width",d+"px");O.append("rect").classed("cat_background",!0).attr("height",S+"px").attr("width",d+"px").attr("fill","white").attr("opacity",1);var T=m;if(s=s.slice(0,N),_.each(s,function(e){var r=e.bar_data[0][A],n=d3.scale.linear().domain([0,1e5]).range([20,30]);e.bar_data=e.bar_data.slice(0,M),l.style("margin-bottom","5px");var o=O.append("g").classed("cat_graph_group",!0).attr("transform","translate(10, "+T+")");T+=m*(e.bar_data.length+1);var a=e.type_name;a.length>=h&&(a=a.slice(0,h)+".."),o.append("text").classed("cat_graph_title",!0).text(a).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",800);var i=n(r);o.append("text").text("Count").attr("transform",function(){var t=v+i,e="translate("+t+", 0)";return e}),o.append("text").text("Pct").attr("transform",function(){var t=v+i+60,e="translate("+t+", 0)";return e}),o.append("text").text("P-val").attr("transform",function(){var t=v+i+115,e="translate("+t+", 0)";return e}),z&&o.append("text").text("Clusters").attr("transform",function(){var t=v+x,e="translate("+t+", 0)";return e});var s=4;o.append("line").attr("x1",0).attr("x2",v).attr("y1",s).attr("y2",s).attr("stroke","blue").attr("stroke-width",1).attr("opacity",1);var d=o.append("g").classed("cat_bar_container",!0).attr("transform","translate(0, 10)"),_=d.selectAll("g").data(e.bar_data).enter().append("g").attr("transform",function(t,e){var r=e*f;return"translate(0,"+r+")"}),g=d3.scale.linear().domain([0,r]).range([0,v]);_.append("rect").attr("height",p+"px").attr("width",function(t){var e=g(t[A]);return e+"px"}).attr("fill",function(t){return t[3]}).attr("opacity",t.viz.cat_colors.opacity).attr("stroke","grey").attr("stroke-width","0.5px"),_.append("text").classed("bar_labels",!0).text(function(t){var e=t[1];return e.indexOf(c)>0&&(e=e.split(c)[1]),e.indexOf(u)>0&&(e=e.split(u)[0]),e.length>=h&&(e=e.slice(0,h)+".."),e}).attr("transform",function(){return"translate(5, "+.75*p+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","right");var w=35;_.append("text").classed("count_labels",!0).text(function(t){var e=t[A];return e=e.toLocaleString(),String(e)}).attr("transform",function(){var t=v+i+w,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),_.append("text").classed("count_labels",!0).text(function(t){var e=t[A]/k*100;return e=Math.round(10*e)/10,e=e.toLocaleString(),String(e)}).attr("transform",function(){var t=v+i+w+47,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),_.append("text").classed("count_labels",!0).text(function(t){var e=t[b];return e<.001?(e=parseFloat(e.toPrecision(3)),e=e.toExponential()):e=parseFloat(e.toPrecision(2)),e}).attr("transform",function(){var t=v+i+w+112,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),z&&_.append("text").classed("count_labels",!0).text(function(t){return String(t[y].toLocaleString())}).attr("transform",function(){var t=v+w+x+20,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end")}),i){var C=d3.select(a),B=C.style("top").split(".px")[0],F=C.style("left").split(".px")[0],I=0,j=0;"row"===e?(I=0,j=g):(I=S+32,j=30),C.style("top",function(){var t=String(parseInt(B,10)-I)+"px";return t}).style("left",function(){var t=String(parseInt(F,10)-j)+"px";return t})}}}},function(t,e,r){"use strict";var n=r(117);t.exports=function(t,e,r){"both"===r&&(r="row");var o,a=e.all_names,i=[],s=t.network_data[r+"_nodes"],l=null,c=!1;_.each(s,function(t){o=t.name,a.indexOf(o)>=0&&i.push(t)});var u=[];if(null!==t.viz.cat_info[r]){for(var d,f,p,h=t.viz.cat_info[r],v=_.keys(h),m=[],g=[],y=0;y0){var E,N=a.length;_.each(m,function(e){if(f=e.split("-")[1],d=g[f],A)if(e.indexOf("-")>=0){var o=parseInt(e.split("-")[1],z)+1;d="Category "+String(o)}else d="Category";x[d]={},_.each(i,function(t){E=t[e],E.indexOf(": ")>=0&&(E=E.split(": ")[1]),E in x[d]?(x[d][E].num_nodes=x[d][E].num_nodes+1,null!=l&&(x[d][E].num_nodes_ds=x[d][E].num_nodes_ds+parseInt(t[l].split(": ")[1],z))):(x[d][E]={},x[d][E].num_nodes=1,null!=l&&(x[d][E].num_nodes_ds=parseInt(t[l].split(": ")[1],z)))}),b={},b.type_name=d,b.num_in_clust=N,w=[];var a,s,c=x[d];for(var p in c){var h=t.viz.cat_info[r][e].cat_hist[p],v=t.network_data[r+"_nodes"].length,m=h/v;s=A?p:d+": "+p;var y=c[p].num_nodes,M=y,S=n(M,N,m);if(_.has(c[p],"num_nodes_ds"))var O=c[p].num_nodes_ds;else O=null;a=t.viz.cat_colors[r][e][s],w.push([e,s,c[p],a,y,O,S])}w.sort(function(t,e){return e[k]-t[k]}),b.bar_data=w,u.push(b)})}}return u}},function(t,e,r){"use strict";var n=r(118),o=r(12),a=o.create();a.import(r(119)),t.exports=function(t,e,r){function o(t,e,r){var n=c(e)/(c(t)*c(e-t));return r=n*(Math.pow(r,t)*Math.pow(1-r,e-t))}function i(t,e,r){for(var n,a,i=0,s=t;s1;)a=a.times(i),i--;return new t.BigNumber(a.toPrecision(t.BigNumber.precision))}var u=n(r(122)),d=n(r(125)),f=l("gamma",{number:function(t){var e,r;if(a(t)){if(t<=0)return isFinite(t)?1/0:NaN;if(t>171)return 1/0;for(var n=t-2,o=t-1;n>1;)o*=n,n--;return 0==o&&(o=1),o}if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*f(1-t));if(t>=171.35)return 1/0;if(t>85){var l=t*t,c=l*t,u=c*t,d=u*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*l)-139/(51840*c)-571/(2488320*u)+163879/(209018880*d)+5246819/(75246796800*d*t))}--t,r=s[0];for(var p=1;pN)for(var S=0,O=0;O1&&n===-(1/0)?0:e.predictable&&(r<-1&&n===1/0||r>-1&&r<0&&n===-(1/0))?NaN:o(n)||r>=0||e.predictable?Math.pow(r,n):new t.Complex(r,0).pow(n,0)}function l(t,e){if(!o(e)||e<0)throw new TypeError("For A^b, b must be a positive integer (value is "+e+")");var r=a(t);if(2!=r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!=r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");for(var n=d(r[0]).valueOf(),i=t;e>=1;)1==(1&e)&&(n=f(i,n)),e>>=1,i=f(i,i);return n}function c(t,e){return p(l(t.valueOf(),e))}var u=r(45),d=n(r(126)),f=n(r(122)),p=n(r(43)),_=n(r(127)),h=n(r(128)),v=i("pow",{"number, number":s,"Complex, Complex":function(t,e){return t.pow(e)},"BigNumber, BigNumber":function(r,n){return n.isInteger()||r>=0||e.predictable?r.pow(n):new t.Complex(r.toNumber(),0).pow(n.toNumber(),0)},"Fraction, Fraction":function(t,r){if(1!==r.d){if(e.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return s(t.valueOf(),r.valueOf())}return t.pow(r)},"Array, number":l,"Array, BigNumber":function(t,e){return l(t,e.toNumber())},"Matrix, number":c,"Matrix, BigNumber":function(t,e){return c(t,e.toNumber())},"Unit, number":function(t,e){return t.pow(e)}});return v.toTex={2:"\\left(${args[0]}\\right)"+u.operators.pow+"{${args[1]}}"},v}var o=r(18).isInteger,a=r(28).size;e.name="pow",e.factory=n},function(t,e,r){"use strict";function n(t,e,n,i){function s(t,e){switch(t.length){case 0:return e?c(e):[];case 1:return l(t[0],t[0],e);case 2:return l(t[0],t[1],e);default:throw new Error("Vector containing two values expected")}}function l(e,r,n){var i=t.isBigNumber(e)||t.isBigNumber(r)?t.BigNumber:null;if(t.isBigNumber(e)&&(e=e.toNumber()),t.isBigNumber(r)&&(r=r.toNumber()),!a(e)||e<1)throw new Error("Parameters in function eye must be positive integers");if(!a(r)||r<1)throw new Error("Parameters in function eye must be positive integers");var s=i?new t.BigNumber(1):1,l=i?new i(0):0,c=[e,r];if(n){var u=t.Matrix.storage(n);return u.diagonal(c,s,0,l)}for(var d=o.resize([],c,l),f=e0?(e.zoom_x=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[0]),e.zoom_y=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[1])):(e.zoom_x=1,e.zoom_y=1),e}},function(t,e,r){"use strict";var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_row_tip").remove();var e=t.viz.root_tips.replace(".",""),r=n().attr("class",function(){var t=e+" d3-tip "+e+"_row_tip";return t}).direction("e").offset([0,10]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return""+e+""});d3.select(t.viz.viz_wrapper).select(t.root+" .row_container").call(r),d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",function(e){d3.select(t.viz.root_tips+"_row_tip").classed(e.name,!0),d3.selectAll(t.viz.root_tips+"_row_tip").style("display","block"),d3.select(this).select("text").classed("active",!0),r.show(e),null!=t.row_tip_callback&&t.row_tip_callback(t.viz.root_tips,e)}).on("mouseout",function(e){d3.selectAll(t.viz.root_tips+"_row_tip").style("display","none").classed(e.name,!1),d3.select(this).select("text").classed("active",!1),r.hide(e)})}else d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",function(){d3.select(this).select("text").classed("active",!0)}).on("mouseout",function(){d3.select(this).select("text").classed("active",!1)})}},function(t,e,r){"use strict";var n=r(2),o=r(132),a=r(133),i=r(104),s=r(137),l=r(138);t.exports=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=t.params,u=c.network_data.col_nodes,d=c.viz.x_scale.rangeBand()/2+c.viz.border_width.x; -d3.select(c.root+" .col_container").empty()?(e=d3.select(c.viz.viz_svg).append("g").attr("class","col_container").attr("transform","translate("+c.viz.clust.margin.left+","+c.viz.norm_labels.margin.top+")"),e.append("rect").attr("fill",c.viz.background_color).attr("width",30*c.viz.clust.dim.width+"px").attr("height",c.viz.label_background.col).attr("class","white_bars"),e.append("g").attr("class","col_label_outer_container").attr("transform","translate(0,"+c.viz.norm_labels.width.col+")").append("g").attr("class","col_zoom_container")):(e=d3.select(c.root+" .col_container").attr("transform","translate("+c.viz.clust.margin.left+","+c.viz.norm_labels.margin.top+")"),e.select(".white_bars").attr("fill",c.viz.background_color).attr("width",30*c.viz.clust.dim.width+"px").attr("height",c.viz.label_background.col),e.select(c.root+" .col_label_outer_container"));var f=d3.select(c.root+" .col_zoom_container").selectAll(".col_label_text").data(u,function(t){return t.name}).enter().append("g").attr("class","col_label_text").attr("transform",function(t){var e=t.col_index;return"translate("+c.viz.x_scale(e)+", 0) rotate(-90)"}),p=f.append("g").attr("class","col_label_group").attr("transform","translate("+c.viz.x_scale.rangeBand()/2+","+d+") rotate(45)").on("mouseover",function(){d3.select(this).select("text").classed("active",!0)}).on("mouseout",function(){d3.select(this).select("text").classed("active",!1)});n.has(c.network_data.col_nodes[0],"value")&&p.append("rect").attr("class","col_bars").attr("width",function(t){var e=0;return t.value>0&&(e=c.labels.bar_scale_col(t.value)),e}).attr("height",.66*c.viz.x_scale.rangeBand()).style("fill",function(t){return t.value>0?c.matrix.bar_colors[0]:c.matrix.bar_colors[1]}).attr("opacity",.6),p.append("text").attr("x",0).attr("y",.64*c.viz.x_scale.rangeBand()).attr("dx",c.viz.border_width.x).attr("text-anchor","start").attr("full_name",function(t){return t.name}).style("font-size",c.labels.default_fs_col+"px").style("cursor","default").text(function(t){return n.normal_name(t)}).style("opacity",0).transition().delay(r).duration(r).style("opacity",1),s(c),p.append("path").style("stroke-width",0).attr("d",function(){return l(c)}).attr("fill","#eee").style("opacity",0).transition().delay(r).duration(r).style("opacity",c.viz.triangle_opacity),d3.selectAll(c.root+" .col_label_text").on("click",function(t){"function"==typeof c.click_label?(c.click_label(t.name,"col"),o(c,this,t.ini)):c.tile_click_hlight&&o(c,this,t.ini)}).on("dblclick",function(e){var r="__data__",n=this[r].name;if(c.sim_mat){a(t,this,n);var s=d3.selectAll(c.root+" .row_label_group").filter(function(t){return t.name==n})[0][0];i(t,s,n)}else a(t,this,n);c.tile_click_hlight&&o(c,this,e.ini)})}},function(t,e){"use strict";t.exports=function(t,e,r){if(r!=t.click_hlight_col){t.click_hlight_col=r;var n=6,o=.85,a=n*t.viz.border_width.x;d3.selectAll(t.root+" .click_hlight").remove(),d3.select(e).append("rect").classed("click_hlight",!0).classed("col_top_hlight",!0).attr("width",t.viz.clust.dim.height).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=0,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"}),d3.select(e).append("rect").classed("click_hlight",!0).classed("col_bottom_hlight",!0).attr("width",t.viz.clust.dim.height).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=t.viz.x_scale.rangeBand()-a,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"})}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_col=-666}},function(t,e,r){"use strict";var n=r(105),o=r(106),a=r(134),i=r(88),s=r(129),l=r(79);t.exports=function(t,e,r){var c=t.params,u=s(c);if(1===u.zoom_y&&1===u.zoom_x){c.viz.inst_order.col="custom",o(t,"col"),d3.selectAll(c.root+" .toggle_row_order .btn").classed("active",!1),c.viz.run_trans=!0;var d=$.extend(!0,{},c.matrix.matrix),f=c.network_data.row_nodes,p=c.network_data.col_nodes,h=[];p.forEach(function(t){h.push(t.name)});var v=_.indexOf(h,r);h=[],f.forEach(function(t,e){h.push(d[e].row_data[v].value)});var m=d3.range(h.length).sort(function(t,e){return h[e]-h[t]});c.viz.y_scale.domain(m),c.matrix.orders.custom_col=m;var g,y=c.network_data.row_nodes_names;if(g=c.network_data.links.length>c.matrix.def_large_matrix?d3.select(c.root+" .viz_svg"):d3.select(c.root+" .viz_svg").transition().duration(2500),g.selectAll(".row_cat_group").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),g.select(".row_label_zoom_container").selectAll(".row_label_group").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),c.viz.ds_level===-1&&g.selectAll(".row").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),d3.selectAll(c.root+" .col_label_text").select(".highlight_rect").style("opacity",0),d3.select(e).select(".highlight_rect").style("opacity",1),c.network_data.links.forEach(function(t){t.x=c.viz.x_scale(t.target),t.y=c.viz.y_scale(t.source)}),n(c),c.zoom_info=i(),setTimeout(function(){c.viz.run_trans=!1},2500),c.viz.ds_num_levels>0&&c.viz.ds_level>=0){l(c);var w=!0,x=!0,b=!0;a(t,w,x,b)}}}},function(t,e,r){"use strict";var n=r(135),o=r(93),a=r(102),i=r(136),s=r(68);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=t.params,u=c.zoom_info,d=c.viz.ds_level,f=c.viz.ds_level;null===c.viz.ds?d=-1:(d=Math.floor(Math.log(u.zoom_y)/Math.log(c.viz.ds_zt)),d>c.viz.ds_num_levels-1&&(d=-1));var p=!1;f==-1?d>=0&&(p=!0):d=0&&(d3.selectAll(c.root+" .row").remove(),d3.selectAll(c.viz.root_tips+"_tile_tip").remove(),d3.selectAll(c.viz.root_tips+"_row_tip").remove());var w;if(h<0?(w=c.matrix.matrix,i(c)):(w=c.matrix.ds_matrix[h],d3.selectAll(c.root+" .row_cat_group path").remove()),r===!0&&d3.selectAll(c.root+" .row_cat_group path").remove(),e===!0&&(h>=0?d3.selectAll(c.root+" .ds"+String(h)+"_row").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}):d3.selectAll(c.root+" .row").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}),d3.selectAll(c.root+" .row_label_group").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}),h!=f&&(g=c.viz.viz_nodes.row,d3.selectAll(c.root+" .ds"+String(f)+"_row").remove())),(g.length>=1||"all"===g)&&o(c,w,g,h),h===-1&&(r===!1||e)){var x=[];d3.selectAll(c.root+" .row_label_group").each(function(t){x.push(t.name)});var b=_.difference(c.viz.viz_nodes.row,x),z=1;b.length>z&&a(t,b)}}},function(t,e){"use strict";t.exports=function(t,e){var r,n=[],o=[],a=t.viz.y_scale,i=t.viz.ds_level,s=t.network_data.row_nodes_names,l=".row";i>=0&&(a=t.viz.ds[i].y_scale,s=d3.range(t.matrix.ds_matrix[i].length).map(String),l=".ds"+String(i)+"_row");for(var c=0;ce.min_y&&n.push(s[c]);d3.selectAll(t.root+" "+l).each(function(t){o.push(t.name)}),t.viz.viz_nodes.row=n,t.viz.viz_nodes.curr_row=o}},function(t,e){"use strict";t.exports=function(t){d3.select(t.root+" .row_cat_group path").empty()===!0&&d3.selectAll(t.root+" .row_cat_group").append("path").attr("d",function(){var e=t.viz.cat_room.symbol_width-1,r=0,n=1,o=t.viz.y_scale.rangeBand()/2,a=t.viz.cat_room.symbol_width-1,i=t.viz.y_scale.rangeBand(),s="M "+e+","+r+" L "+n+","+o+", L "+a+","+i+" Z";return s}).attr("fill","#eee").style("opacity",t.viz.triangle_opacity)}},function(t,e,r){"use strict";var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_col_tip").remove();var e=n().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip "+e+"_col_tip";return r}).direction("w").offset([20,0]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return""+e+""});d3.select(t.viz.viz_wrapper).select("svg").select(t.root+" .col_zoom_container").selectAll(".col_label_group").select("text").call(e),d3.select(t.root+" .col_zoom_container").selectAll(".col_label_group").on("mouseover",function(r){d3.selectAll(t.viz.root_tips+"_col_tip").style("display","block"),e.show(r),null!=t.col_tip_callback&&t.col_tip_callback(r)}).on("mouseout",function(){e.hide(this),d3.selectAll(t.viz.root_tips+"_col_tip").style("display","none")})}}},function(t,e){"use strict";t.exports=function(t){var e=.36*t.viz.x_scale.rangeBand(),r=-t.viz.border_width.x,n=0,o=t.viz.x_scale.rangeBand()-e,a=-(t.viz.x_scale.rangeBand()-e+t.viz.border_width.x),i=-t.viz.border_width.x,s="M "+r+",0 L "+a+","+n+", L "+i+","+o+" Z";return s}},function(t,e){"use strict";t.exports=function(t){d3.select(t.viz.viz_svg).append("rect").attr("fill",t.viz.background_color).attr("height",t.viz.super_labels.dim.width+"px").attr("width","3000px").classed("super_col_bkg",!0).classed("white_bars",!0).attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.super_labels.margin.top+")"),d3.select(t.viz.viz_svg).append("text").attr("class","super_col").text(t.labels.super.col).attr("text-anchor","center").attr("transform",function(){var e=d3.select(this)[0][0].getBBox().width,r=t.viz.clust.dim.width/2+t.viz.norm_labels.width.row-e/2,n=t.viz.super_labels.dim.width;return"translate("+r+","+n+")"}).style("font-size",function(){var e=t.labels.super_label_fs*t.labels.super_label_scale;return e+"px"}).style("font-weight",300),d3.select(t.viz.viz_svg).append("rect").attr("fill",t.viz.background_color).attr("width",t.viz.super_labels.dim.width+"px").attr("height","3000px").classed("super_row_bkg",!0).classed("white_bars",!0).attr("transform","translate("+t.viz.super_labels.margin.left+",0)"),d3.select(t.viz.viz_svg).append("g").classed("super_row",!0).attr("transform",function(){var e=t.viz.super_labels.dim.width,r=t.viz.clust.dim.height/2+t.viz.norm_labels.width.col;return"translate("+e+","+r+")"}),d3.select(t.root+" .super_row").append("text").text(t.labels.super.row).attr("text-anchor","center").attr("transform",function(){var e=d3.select(this)[0][0].getBBox().width,r=e/2+t.viz.norm_labels.width.col,n="translate(0,"+r+"), rotate(-90)";return n}).style("font-size",function(){var e=t.labels.super_label_fs*t.labels.super_label_scale;return e+"px"}).style("font-weight",300)}},function(t,e,r){"use strict";var n=r(141),o=r(142),a=r(150),i=r(112);t.exports=function(t){var e=t.params,r=e.viz;d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 1000,-1000, L 1000,0 Z").attr("fill",r.background_color).attr("class","right_slant_triangle").attr("transform","translate("+r.clust.dim.width+","+r.norm_labels.width.col+")"),d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 500,-500, L 0,-500 Z").attr("fill",r.background_color).attr("class","left_slant_triangle").attr("transform","translate(-1,"+r.norm_labels.width.col+")");var s=r.clust.margin.top+r.uni_margin/5;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",r.clust.margin.left).attr("height",s).attr("class","top_left_white");var l=r.cat_room.col+1.5*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",2*r.clust.dim.width).attr("height",l).attr("class","top_right_white").attr("transform",function(){var t=r.clust.margin.left+r.clust.dim.width,e=r.norm_labels.width.col+r.norm_labels.margin.top-r.uni_margin;return"translate("+t+", "+e+")"}),p=r.clust.margin.left+r.clust.dim.width+r.uni_margin,_=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin;var c=1.15*r.cat_room.symbol_width,u=.65,d=1.25;r.show_categories.col&&d3.select(r.viz_svg).selectAll().data(r.all_cats.col).enter().append("text").classed("col_cat_super",!0).style("font-size",c+"px").style("opacity",u).style("cursor","default").attr("transform",function(t){var e=parseInt(t.split("-")[1],10),n=_+d*r.cat_room.symbol_width*e;return"translate("+p+","+n+")"}).text(function(t){return n(r,t,"col")}),a(t),_=r.show_dendrogram?r.clust.margin.top+r.clust.dim.height+r.dendro_room.col-2*r.uni_margin:r.clust.margin.top+r.clust.dim.height;var f=d3.select(r.viz_svg).append("g").classed("bottom_spillover_container",!0).attr("transform",function(){return"translate(0,"+_+")"});f.append("rect").attr("class","bottom_spillover").attr("fill",r.background_color).attr("width",r.svg_dim.width).attr("height",2*r.svg_dim.height),p=r.clust.margin.left,_=0,f.append("g").classed("col_dendro_icons_container",!0).attr("transform","translate("+p+","+_+")").append("g").classed("col_dendro_icons_group",!0),i(t,"col");var p=r.clust.margin.left+r.clust.dim.width,_=r.clust.margin.top+r.clust.dim.height,h=r.cat_room.col+r.clust.dim.width,v=r.cat_room.row+10*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",h).attr("height",v).attr("transform",function(){return"translate("+p+","+_+")"}).classed("white_bars",!0).classed("dendro_corner_spillover",!0),p=0,_=r.clust.margin.top+r.clust.dim.height,h=r.clust.margin.left,v=10*r.clust.dim.height,d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",h).attr("height",v).attr("transform",function(){return"translate("+p+","+_+")"}).classed("white_bars",!0).classed("dendro_col_spillover",!0),o(t)}},function(t,e){"use strict";t.exports=function(t,e,r){var n;if(t.cat_names[r][e]===e){var o=parseInt(e.split("-")[1],10)+1;n="Category "+o}else n=t.cat_names[r][e];return n}},function(t,e,r){"use strict";var n=r(143);t.exports=function(t){var e=t.params;_.each(["row","col"],function(r){e.viz.show_categories[r]&&d3.selectAll(e.root+" ."+r+"_cat_super").on("dblclick",function(){e.sim_mat&&(r="both"),d3.selectAll(e.root+" .toggle_"+r+"_order .btn").classed("active",!1);var o=this.__data__.replace("-","_")+"_index";e.viz.sim_mat?(n(t,o,"row"),n(t,o,"col")):n(t,o,r)})})}},function(t,e,r){"use strict";var n=r(106),o=r(134),a=r(88),i=r(79),s=r(144),l=r(129);t.exports=function(t,e,r){var c=t.params,u=l(c),d=0;1==u.zoom_y&&1==u.zoom_x||(s(t,0,0,1),d=1200);var f;"row"===r?f="col":"col"===r&&(f="row"),c.viz.run_trans=!0,"row"===f?c.viz.inst_order.row=e:"col"===f&&(c.viz.inst_order.col=e),c.viz.show_dendrogram&&n(t,r),"row"===f?c.viz.x_scale.domain(c.matrix.orders[c.viz.inst_order.row+"_row"]):"col"==f&&c.viz.y_scale.domain(c.matrix.orders[c.viz.inst_order.col+"_col"]);var p;p=d3.selectAll(c.root+" .tile")[0].length0&&c.viz.ds_level>=0){i(c);var m=!0,g=!0,y=!0;o(t,m,g,y)}setTimeout(function(){c.viz.run_trans=!1},2500)}},function(t,e,r){"use strict";var n=r(2),o=r(145),a=r(134),i=r(88),s=r(149);t.exports=function(t,e,r,l){function c(t,e){d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").transition().duration(g).style("opacity",e)}var u=t.params;if(d3.selectAll(u.viz.root_tips).style("display","none"),u.zoom_info=i(),a(t),!u.viz.run_trans){var d=u.viz.clust.dim.height/2,f=d/l;if(r>=d-f){var p=d-r,h=-d/l+p;r+=h}r<-(d-f)&&(p=d+r,h=d/l-p,r+=h);var v=l,m=1,g=700,y=-(v-1)*d;d3.select(u.root+" .clust_group").transition().duration(g).attr("transform","translate("+[0,0+y]+") scale("+m+","+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_label_zoom_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale("+v+","+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_cat_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale(1,"+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_dendro_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale("+m+","+v+")translate("+[u.viz.uni_margin/2,r]+")");var w;_.each(["row","col"],function(t){w=d3.select(u.root+" ."+t+"_dendro_crop_buttons").style("opacity"),d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").style("opacity",0),setTimeout(c,700,t,w)}),d3.select(u.root+" .col_zoom_container").transition().duration(g).attr("transform"," scale("+m+","+m+")translate("+[e,0]+")"),d3.select(u.root+" .col_cat_container").transition().duration(g).attr("transform"," scale("+m+",1)translate("+[e,0]+")"),d3.select(u.root+" .col_dendro_container").transition().duration(g).attr("transform"," scale("+m+",1)translate("+[e,u.viz.uni_margin/2]+")");var x=u.viz.clust.margin.top+y+r*v,b=u.viz.clust.margin.left+e;u.zoom_behavior.scale(v).translate([b,x]),o(u),d3.select(u.root+" .row_label_zoom_container text").empty()===!1&&d3.select(u.root+" .row_label_zoom_container").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",.5*t.x).attr("y",0).attr("width",.5*t.width).attr("height",u.viz.y_scale.rangeBand()).style("fill","yellow")}),d3.select(u.root+" .row_dendro_icons_group").attr("transform","translate("+[0,0+y]+") scale("+m+","+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=u.viz.uni_margin,r=t.pos_mid;return"translate("+e+","+r+") scale(1, "+1/v+")"}),d3.select(u.root+" .col_dendro_icons_group").attr("transform",function(){var t=" scale("+m+","+v+")";return t}),d3.select(u.root+" .col_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=t.pos_mid,r=u.viz.uni_margin;return"translate("+e+","+r+") scale(1,1)"}),n.has(u.network_data.col_nodes[0],"value")&&d3.selectAll(u.root+" .col_bars").attr("width",function(t){var e=0;return t.value>0&&(e=u.labels.bar_scale_col(t.value)/m),e}),n.has(u.network_data.row_nodes[0],"value")&&d3.selectAll(u.root+" .row_bars").transition().duration(g).attr("width",function(t){var e=0;return e=u.labels.bar_scale_row(Math.abs(t.value))/v}).attr("x",function(t){var e=0;return e=-u.labels.bar_scale_row(Math.abs(t.value))/v}),s(u)}}},function(t,e,r){"use strict";var n=r(2),o=r(146),a=r(147);t.exports=function(t){d3.selectAll(t.root+" .row_label_group").select("text").text(function(t){return n.normal_name(t)}),d3.selectAll(t.root+" .col_label_text").select("text").text(function(t){return n.normal_name(t)}),a(t),d3.selectAll(t.root+" .row_label_group").each(function(){o(t,this,"row")}),d3.selectAll(t.root+" .col_label_group").each(function(){o(t,this,"col")})}},function(t,e){"use strict";t.exports=function(t,e,r){function n(){return u=d3.select(this).text(),c=u.length,f=c-3,l=u.substring(0,f)+".."}function o(t){return u=d3.select(this).text(),c=".."===u.slice(-2)?u.length-2:u.length,d=t.name,f=c+2,l=d.substring(0,f)+"..",l.length>d.length&&(l=d),l}function a(t,e){return s=e<1?t:t*e}if("none"!=d3.select(e).style("display")){var i,s,l,c,u,d,f,p,_=t.viz.norm_labels.width[r];i="row"===r?t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale():t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale();var h;d3.select(e).select("text").each(function(t){h=t.name.length});var v=d3.select(e).select("text").node().getBBox().width;if(s=a(v,i),s>_)for(p=1;p_&&(d3.select(e).select("text").text(n),v=d3.select(e).select("text").node().getBBox().width,s=a(v,i));else if(s<.75*_)for(p=1;po&&(a.row>t.labels.max_allow_fs?(e=t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale(),e<1&&(e=1),r=t.labels.max_allow_fs/e,d3.selectAll(t.root+" .row_label_group").select("text").style("font-size",r+"px").attr("y",.5*t.viz.rect_height+.35*r)):d3.selectAll(t.root+" .row_label_group").select("text").style("font-size",t.labels.default_fs_row+"px").attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row)),a.col>o&&(a.col>t.labels.max_allow_fs?(e=t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale(),e<1&&(e=1),r=t.labels.max_allow_fs/e,r>.7*t.viz.rect_width&&(r=.7*t.viz.rect_width),d3.selectAll(t.root+" .col_label_text").select("text").style("font-size",r+"px")):d3.selectAll(t.root+" .col_label_text").select("text").style("font-size",t.labels.default_fs_col+"px"))}},function(t,e){"use strict";t.exports=function(t){var e={};return t.viz.zoom_ratio.x>1?(e.row=t.labels.default_fs_row*t.zoom_behavior.scale(),e.col=t.labels.default_fs_col*t.zoom_behavior.scale()):(e.row=t.labels.default_fs_row*t.zoom_behavior.scale()/t.viz.zoom_ratio.y,e.col=t.labels.default_fs_col*t.zoom_behavior.scale()),e}},function(t,e){"use strict";t.exports=function(t){t.zoom_info.zoom_x*t.viz.border_width.x>1?d3.selectAll(t.root+" .vert_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .vert_lines").select("line").style("display","none"),t.zoom_info.zoom_y*t.viz.border_width.y>1?d3.selectAll(t.root+" .horz_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .horz_lines").select("line").style("display","none")}},function(t,e,r){"use strict";var n=r(141),o=r(100);t.exports=function(t){var e=t.params,r=e.viz,a=2.75;d3.select(e.root+" .row_cat_label_container").empty()&&(d3.select(t.params.viz.viz_svg).append("g").classed("row_cat_label_container",!0),d3.select(t.params.viz.viz_svg+" .row_cat_label_container").append("g").classed("row_cat_label_bar_container",!0));var i=r.clust.margin.left+r.clust.dim.width+r.uni_margin,s=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin,l=1.15*r.cat_room.symbol_width,c=.65,u=1.25;d3.select(e.root+" .row_cat_label_container").attr("transform",function(){return i=r.norm_labels.margin.left+r.norm_labels.width.row+r.cat_room.symbol_width+a*r.uni_margin,s=r.clust.margin.top-r.uni_margin,"translate("+i+","+s+") rotate(-90)"}),d3.selectAll(e.root+" .row_cat_label_container text").remove(),d3.selectAll(e.root+" .row_cat_selection_bar").remove(),d3.selectAll(t.params.viz.root_tips+"_row_cat_super").remove();var d=50,f=-75,p=o().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_row_cat_super";return r}).direction("south_custom").offset([d,f]).style("display","none").style("opacity",0).html(function(t){var o,a=e.network_data.row_nodes[0][t];if(a.indexOf("

")>-1){var i=a.split(": ")[0],s=a.split("

")[1];o=i+"

"+s}else o=n(r,t,"row");return o}),h=u*r.cat_room.symbol_width,v=.9*h;if(d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("text").style("width","100px").style("height",v+"px").classed("row_cat_super",!0).style("font-size",l+"px").style("opacity",c).style("cursor","default").attr("transform",function(t){var e=u*r.cat_room.symbol_width*parseInt(t.split("-")[1],10);return"translate(0,"+e+")"}).text(function(t){return n(r,t,"row")}),d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("rect").classed("row_cat_super",!0).classed("row_cat_selection_bar",!0).style("height",v+"px").style("fill","green").style("width","120px").style("opacity",0).attr("transform",function(t){var e=h*(parseInt(t.split("-")[1],10)-.75);return"translate(0,"+e+")"}).on("mouseover",function(t){d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","block").style("opacity",1),p.show(t)}).on("mouseout",function(){p.hide(this),d3.selectAll(".d3-tip").style("display","none"),d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","none").style("opacity",0)}),d3.select(e.root+" .row_cat_selection_bar").empty()===!1&&d3.selectAll(e.root+" .row_cat_selection_bar").call(p),_.has(e.network_data,"row_cat_bars")){d3.select(e.root+" .enr_title").remove();var m=d3.select(e.root+" .viz_svg").append("g").classed("enr_title",!0).attr("transform",function(){var t=d3.select(e.root+" .row_cat_label_container").attr("transform").split("(")[1].split(")")[0],r=Number(t.split(",")[0])-10;return"translate("+String(r)+", 0)"});m.append("rect").attr("width",e.viz.cat_room.row).attr("height",25).attr("fill","white");var g=e.network_data.enrichrgram_lib.substring(0,40);m.append("text").attr("transform","translate(0, 17)").text(g.replace(/_/g," ")).style("font-size","15px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),d3.selectAll(e.root+" .enrichr_bars").remove();var y=e.viz.clust.margin.top-35,w=e.network_data.row_cat_bars[0],x=d3.scale.linear().domain([0,w]).range([0,y]);d3.select(e.root+" .row_cat_label_bar_container").selectAll().data(e.network_data.row_cat_bars).enter().append("rect").classed("enrichr_bars",!0).attr("height",v+"px").attr("fill","red").attr("width",function(t){var e=x(t);return e+"px"}).attr("opacity",.4).attr("transform",function(t,e){var r=h*(e-.75);return"translate(0, "+r+")"})}}},function(t,e,r){"use strict";var n=r(152);t.exports=function(t){var e,r=t.params;d3.select(r.root+" .expand_button").on("click",null);var o=.4;e=d3.select(r.root+" .expand_button").empty()?d3.select(r.viz.viz_svg).append("text").attr("class","expand_button"):d3.select(r.root+" .expand_button"),e.attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family","FontAwesome").attr("font-size","30px").text(function(){return r.viz.is_expand===!1?"":""}).attr("y","25px").attr("x","25px").style("cursor","pointer").style("opacity",o).on("mouseover",function(){d3.select(this).style("opacity",.75)}).on("mouseout",function(){d3.select(this).style("opacity",o)}).on("click",function(){r.viz.is_expand===!1?(d3.select(this).text(function(){return""}),r.viz.is_expand=!0,d3.selectAll(r.root+" .borders").style("fill","white"),d3.select(r.root+" .sidebar_wrapper").style("display","none")):(d3.select(this).text(function(){return""}),r.viz.is_expand=!1,d3.selectAll(r.root+" .borders").style("fill","#eee"),d3.select(r.root+" .viz_wrapper").style("width","100px"),d3.select(r.root+" .sidebar_wrapper").style("display","block")),d3.select(r.viz.viz_svg).style("opacity",.5);var e=500;1==r.viz.run_trans&&(e=2500),setTimeout(n,e,t)})}},function(t,e,r){"use strict";var n=r(2),o=r(153),a=r(161),i=r(162),s=r(163),l=r(164),c=r(165),u=r(166),d=r(167),f=r(168),p=r(169),h=r(170),v=r(171),m=r(172),g=r(173),y=r(174),w=r(175),x=r(176),b=r(145),z=r(107),k=r(106),A=r(134),E=r(70),N=r(177),M=r(150),S=r(142),O=r(178),T=r(88),C=r(179);t.exports=function(t){var e=t.params,r=E(e);d3.select(e.root+" .play_button"),d3.select(e.root+" .sidebar_wrapper").style("height",r.height+"px"),d3.select(e.viz.viz_wrapper).style("margin-top",r.top+"px").style("width",r.width+"px").style("height",r.height+"px"),e=y(e),e.zoom_info=T(),i(e);var B=d3.select(e.viz.viz_svg);_.each(e.network_data.links,function(t){t.x=e.viz.x_scale(t.target),t.y=e.viz.y_scale(t.source)}),B.on(".zoom",null),e.zoom_behavior.scaleExtent([1,e.viz.square_zoom*e.viz.zoom_ratio.x]).on("zoom",function(){o(t)}),e.viz.do_zoom&&B.call(e.zoom_behavior),a(t),B.attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height),B.select(".super_background").style("width",e.viz.svg_dim.width).style("height",e.viz.svg_dim.height),B.select(".grey_background").attr("width",e.viz.clust.dim.width).attr("height",e.viz.clust.dim.height),setTimeout(N,100,e);var F=e.network_data.row_nodes,I=n.pluck(F,"name");w(e,B),B.selectAll(".highlighting_rect").attr("width",.8*e.viz.x_scale.rangeBand()).attr("height",.8*e.viz.y_scale.rangeBand()),f(e),d(e,B),p(e,B),B.selectAll(".row_label_group").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",e.viz.rect_height).style("fill","yellow").style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),B.selectAll(".row_label_group").select("text").attr("y",.5*e.viz.rect_height+.35*e.labels.default_fs_row),n.has(e.network_data.row_nodes[0],"value")&&x(t,B),B.selectAll(".row_cat_group").attr("transform",function(t){var r=_.indexOf(I,t.name);return"translate(0, "+e.viz.y_scale(r)+")"}),B.selectAll(".row_cat_group").select("path").attr("d",function(){var t=e.viz.cat_room.symbol_width-1,r=0,n=1,o=e.viz.rect_height/2,a=e.viz.cat_room.symbol_width-1,i=e.viz.rect_height,s="M "+t+","+r+" L "+n+","+o+", L "+a+","+i+" Z";return s});var j=!0;e.viz.show_dendrogram?(z(t,"row",j),z(t,"col",j),s(e,B),k(t,"row",0),k(t,"col",0)):s(e,B),h(e,B),v(e,B),m(e,B),g(e,B),l(e,B),c(e.viz,B),C(e),u(e,B),e.zoom_behavior.scale(1).translate([e.viz.clust.margin.left,e.viz.clust.margin.top]),b(e),d3.select(e.root+" .clust_container").attr("transform","translate("+e.viz.clust.margin.left+","+e.viz.clust.margin.top+")"),t.params.viz.ds_level===-1&&A(t),M(t),d3.select(e.viz.viz_svg).style("opacity",1),S(t),d3.select(t.params.root+" .row_slider_group").style("opacity",0),d3.select(t.params.root+" .col_slider_group").style("opacity",0),setTimeout(O,500,t,"row"),setTimeout(O,500,t,"col")}},function(t,e,r){"use strict";var n=r(154),o=r(159),a=r(160);t.exports=function(t){var e=t.params,r={};if(r.zoom_x=d3.event.scale,r.zoom_y=d3.event.scale,r.trans_x=e.zoom_behavior.translate()[0]-e.viz.clust.margin.left,r.trans_y=e.zoom_behavior.translate()[1]-e.viz.clust.margin.top,d3.selectAll(e.viz.root_tips).style("display","none"),e.zoom_info=o(e,r),e.zoom_info=a(e,r),e.is_slider_drag===!1&&e.is_cropping===!1){var i=e.zoom_info.trans_x+e.viz.clust.margin.left,s=e.zoom_info.trans_y+e.viz.clust.margin.top;e.zoom_behavior.translate([i,s]),t.params=e,n(t)}}},function(t,e,r){"use strict";var n=r(147),o=r(134),a=r(155),i=r(114),s=r(129),l=r(156),c=r(158);t.exports=function(t){function e(t){var e=t.params,r=c(e);r===!0&&setTimeout(l,50,t)}var r=t.params,u=r.zoom_info,d=s(r);d3.select(r.root+" .clust_group").attr("transform","translate("+[u.trans_x,u.trans_y]+") scale("+u.zoom_x+","+u.zoom_y+")"),d3.select(r.root+" .row_label_zoom_container").attr("transform","translate("+[0,u.trans_y]+") scale("+u.zoom_y+")"),d3.select(r.root+" .col_zoom_container").attr("transform","translate("+[u.trans_x,0]+") scale("+u.zoom_x+")"), -d3.select(r.root+" .row_cat_container").attr("transform","translate("+[0,u.trans_y]+") scale( 1,"+u.zoom_y+")"),d3.select(r.root+" .row_dendro_container").attr("transform","translate("+[r.viz.uni_margin/2,u.trans_y]+") scale( 1,"+u.zoom_y+")"),d3.select(r.root+" .row_dendro_icons_group").attr("transform",function(){var t=u.trans_y,e="translate("+[0,t]+") ",r="scale(1, "+u.zoom_y+")",n=e+r;return n}),d3.select(r.root+" .col_dendro_icons_group").attr("transform",function(){var t=u.trans_x,e="translate("+[t,0]+")",r="scale("+u.zoom_x+", 1)",n=e+r;return n}),i(r,u,"row"),i(r,u,"col"),d3.select(r.root+" .col_cat_container").attr("transform","translate("+[u.trans_x,0]+") scale("+u.zoom_x+",1)"),d3.select(r.root+" .col_dendro_container").attr("transform","translate("+[u.trans_x,r.viz.uni_margin/2]+") scale("+u.zoom_x+",1)"),a(r,u),d3.select(r.root+" .viz_svg").attr("is_zoom",function(){var t=Number(d3.select(r.root+" .viz_svg").attr("is_zoom"));return d3.select(r.root+" .viz_svg").attr("stopped_zoom",1),t+1});var f=function(){d3.select(r.root+" .viz_svg").attr("is_zoom",function(){var t=Number(d3.select(r.root+" .viz_svg").attr("is_zoom"));return t-1})};if(n(r),u.zoom_y<=d.zoom_y){var p=!1;u.zoom_y0&&(n=t.labels.bar_scale_col(r.value)/e.zoom_x),n})}},function(t,e,r){"use strict";var n=r(147),o=r(146),a=r(157),i=r(149),s=r(134),l=r(158);t.exports=function(t){function e(){_.each(["row","col"],function(t){d3.selectAll(r.root+" ."+t+"_label_group").filter(function(){return"none"!=d3.select(this).style("display")}).select("text").style("font-size",function(){var t=Number(d3.select(this).style("font-size").replace("px",""));return t})})}var r=t.params,c=l(r);if(c===!0){_.each(["row","col"],function(t){d3.selectAll(r.root+" ."+t+"_label_group").select("text").style("opacity",1),d3.selectAll(r.root+" ."+t+"_cat_group").select("path").style("display","block")}),s(t,!0),d3.selectAll(r.viz.root_tips).style("display","block"),d3.selectAll(r.root+" .row_label_group").select("text").style("display","none"),d3.selectAll(r.root+" .row_label_group").select("text").style("display","block"),d3.select(r.root+" .viz_svg").attr("stopped_zoom",0),d3.selectAll(r.root+" .row_label_group").select("text").style("display","block"),d3.selectAll(r.root+" .col_label_group").select("text").style("display","block"),i(r),t.params.viz.x_offset=0;var u=150;_.each(["row","col"],function(t){var e=a(r,t);e1&&(e.zoom_y=0?e.trans_y=0:e.trans_y<=-e.pan_room_y&&(e.trans_y=-e.pan_room_y),e}},function(t,e){"use strict";t.exports=function(t,e){var r=t.viz;return r.zoom_ratio.x>1&&(e.zoom_x0?e.trans_x=0:e.trans_x<=-e.pan_room_x&&(e.trans_x=-e.pan_room_x),e}},function(t,e,r){"use strict";var n=r(144);t.exports=function(t){var e=t.params;d3.selectAll(e.viz.zoom_element).on("dblclick.zoom",null),d3.select(e.viz.zoom_element).on("dblclick",function(){n(t,0,0,1)})}},function(t,e){"use strict";t.exports=function(t){var e=1,r=0,n=0,o=t.viz.clust.dim.height/2,a=-(e-1)*o;d3.select(t.root+" .clust_group").attr("transform","translate("+[0,0+a]+") scale(1,"+e+")translate("+[r,n]+")"),d3.select(t.root+" .row_label_zoom_container").attr("transform","translate("+[0,a]+") scale("+e+","+e+")translate("+[0,n]+")"),d3.select(t.root+" .row_cat_container").attr("transform","translate("+[0,a]+") scale(1,"+e+")translate("+[0,n]+")"),d3.select(t.root+" .row_dendro_container").attr("transform","translate("+[0,a]+") scale("+e+","+e+")translate("+[t.viz.uni_margin/2,n]+")"),d3.select(t.root+" .col_zoom_container").attr("transform"," scale(1,1)translate("+[r,0]+")"),d3.select(t.root+" .col_cat_container").attr("transform"," scale(1,1)translate("+[r,0]+")"),d3.select(t.root+" .col_dendro_container").attr("transform"," scale(1,1)translate("+[r,t.viz.uni_margin/2]+")"),d3.select(t.root+" .row_dendro_icons_group").attr("transform",function(){return"translate(0,0) scale(1)"}),d3.select(t.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=7,r=t.pos_mid;return"translate("+e+","+r+") scale(1, 1)"})}},function(t,e){"use strict";t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n={};r===!1?n.run_transition=!1:n=r;var o,a=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;n.run_transition?(o=e.transition().delay(n.update).duration(a),e.selectAll(".col_cat_group").data(i,function(t){return t.name}).transition().delay(n.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}),e.selectAll(".col_dendro_group").data(i,function(t){return t.name}).transition().delay(n.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"})):(o=e,e.selectAll(".col_cat_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}),d3.select(t.root).selectAll(".col_dendro_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}));var l,c;_.each(["row","col"],function(e){var r=t.viz.all_cats[e].length;for(l=0;l2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(".super_col_bkg").attr("height",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.grey_border_width+")"),r.select(".super_col").attr("transform",function(){var e=t.viz.clust.dim.width/2+t.viz.norm_labels.width.row,r=t.viz.super_labels.dim.width;return"translate("+e+","+r+")"}),r.select(".super_row_bkg").attr("width",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.grey_border_width+",0)"),r.select(".super_row").attr("transform",function(){var e=t.viz.super_labels.dim.width,r=t.viz.clust.dim.height/2+t.viz.norm_labels.width.col;return"translate("+e+","+r+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(t.root+" .right_slant_triangle").attr("transform","translate("+t.clust.dim.width+","+t.norm_labels.width.col+")"),r.select(t.root+" .left_slant_triangle").attr("transform","translate(-1,"+t.norm_labels.width.col+")");var i=t.clust.margin.top+t.uni_margin/5;r.select(t.root+" .top_left_white").attr("width",t.clust.margin.left).attr("height",i);var s=t.clust.margin.left+t.clust.dim.width+t.uni_margin+t.dendro_room.row,l=t.norm_labels.margin.top+t.norm_labels.width.col;r.select(t.root+" .right_spillover_container").attr("transform",function(){return"translate("+s+", 0)"}),l=t.norm_labels.margin.top+t.norm_labels.width.col,r.select(t.root+" .right_spillover_container rect").attr("transform",function(){return"translate( 0,"+l+")"}),r.select(t.root+" .right_spillover").attr("height",t.svg_dim.height+"px");var c=t.clust.margin.left+t.clust.dim.width,u=l,d=t.dendro_room.row+t.uni_margin,f=t.cat_room.col+t.uni_margin;d3.select(t.root+" .dendro_row_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=0,u=t.clust.margin.top+t.clust.dim.height,d=t.clust.margin.left,f=10*t.clust.dim.height,r.select(".dendro_col_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=t.clust.margin.left+t.clust.dim.width,u=t.clust.margin.top+t.clust.dim.height,d=t.cat_room.col+t.clust.dim.width,f=t.cat_room.row+t.uni_margin,r.select(".dendro_corner_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=t.clust.margin.left+t.clust.dim.width+t.uni_margin,u=t.norm_labels.margin.top+t.norm_labels.width.col+2.5*t.uni_margin;var p=2.75,_=1.2;t.show_categories.col&&d3.selectAll(t.root+" .col_cat_super").attr("transform",function(e){var r=parseInt(e.split("-")[1],10),n=u+_*t.cat_room.symbol_width*r;return"translate("+c+","+n+")"}),t.show_categories.row&&d3.select(t.root+" .row_cat_label_container").attr("transform",function(){return c=t.norm_labels.margin.left+t.norm_labels.width.row+t.cat_room.symbol_width+p*t.uni_margin,u=t.clust.margin.top-t.uni_margin,"translate("+c+","+u+") rotate(-90)"}),u=t.show_dendrogram?t.clust.margin.top+t.clust.dim.height+t.dendro_room.col-2*t.uni_margin:t.clust.margin.top+t.clust.dim.height,d3.select(t.root+" .bottom_spillover_container").attr("transform",function(){return"translate(0,"+u+")"}),r.select(t.root+" .bottom_spillover").attr("width",t.svg_dim.width).attr("height",2*t.svg_dim.height);var h=t.cat_room.col+1.5*t.uni_margin;d3.select(t.viz_svg+" .top_right_white").attr("fill",t.background_color).attr("width",2*t.clust.dim.width).attr("height",h).attr("transform",function(){var e=t.clust.margin.left+t.clust.dim.width,r=t.norm_labels.width.col+t.norm_labels.margin.top-t.uni_margin;return"translate("+e+", "+r+")"})}},function(t,e){"use strict";t.exports=function(t,e){e.select(".left_border").attr("width",t.viz.grey_border_width).attr("height",t.viz.svg_dim.height).attr("transform","translate(0,0)"),e.select(".right_border").attr("width",t.viz.grey_border_width).attr("height",t.viz.svg_dim.height).attr("transform",function(){var e=t.viz.svg_dim.width-t.viz.grey_border_width;return"translate("+e+",0)"}),e.select(".top_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",function(){var t=0;return"translate("+t+",0)"}),e.select(".bottom_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",function(){var e=t.viz.svg_dim.height-t.viz.grey_border_width;return"translate(0,"+e+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration,i=t.network_data.row_nodes,s=t.network_data.row_nodes_names;n===!1?o.run_transition=!1:o=n,o.run_transition?(e.selectAll(".row_label_group").data(i,function(t){return t.name}).transition().delay(o.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),r=e.transition().delay(o.update).duration(a)):(e.selectAll(".row_label_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),r=e),r.select(t.root+" .row_container").attr("transform","translate("+t.viz.norm_labels.margin.left+","+t.viz.clust.margin.top+")"),r.select(t.root+" .row_container").select(".white_bars").attr("width",t.viz.label_background.row).attr("height",30*t.viz.clust.dim.height+"px"),r.select(t.root+" .row_container").select(".row_label_container").attr("transform","translate("+t.viz.norm_labels.width.row+",0)")}},function(t,e){"use strict";t.exports=function(t){var e=6,r=e*t.viz.border_width.x,n=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.rect_width).attr("height",n).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+",0)"}),d3.select(t.root+" .left_hlight").attr("width",r).attr("height",t.viz.rect_width-.99*n).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*n+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.rect_height-.99*n).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.rect_width-r;return"translate("+e+","+.99*n+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.rect_width-1.98*r}).attr("height",n).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,o=t.viz.rect_height-n;return"translate("+e+","+o+")"}),d3.select(t.root+" .row_top_hlight").attr("width",t.viz.svg_dim.width).attr("height",n),d3.select(t.root+" .row_bottom_hlight").attr("width",t.viz.svg_dim.width).attr("height",n).attr("transform",function(){var e=t.viz.rect_height-n;return"translate(0,"+e+")"}),d3.select(t.root+" .col_top_hlight").attr("width",t.viz.clust.dim.height).attr("height",r).attr("transform",function(){var e=0,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"}),d3.select(t.root+" .col_bottom_hlight").attr("width",t.viz.clust.dim.height).attr("height",r).attr("transform",function(){var e=t.viz.rect_width-r,n=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+n+","+e+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(".row_cat_outer_container").attr("transform","translate("+t.viz.norm_labels.width.row+",0)").select("white_bars").attr("width",t.viz.cat_room.row+"px").attr("height",function(){var e=t.viz.clust.dim.height;return e});var i=t.viz.clust.margin.left+t.viz.clust.dim.width,s=t.viz.clust.margin.top;r.select(".row_dendro_outer_container").attr("transform","translate("+i+","+s+")"),i=t.viz.clust.margin.left,s=t.viz.clust.margin.top+t.viz.clust.dim.height,r.select(" .col_dendro_outer_container").attr("transform",function(){return"translate("+i+","+s+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;n===!1?o.run_transition=!1:o=n,o.run_transition?(r=e.transition().delay(o.update).duration(a),e.selectAll(".col_label_text").data(i,function(t){return t.name}).transition().delay(o.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"})):(r=e,e.selectAll(".col_label_text").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"}));var l=t.viz.x_scale.rangeBand()/2+t.viz.border_width.x;r.select(t.root+" .col_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.norm_labels.margin.top+")"),r.select(t.root+" .col_container").select(".white_bars").attr("width",30*t.viz.clust.dim.width+"px").attr("height",t.viz.label_background.col),r.select(t.root+" .col_container").select(".col_label_outer_container").attr("transform","translate(0,"+t.viz.norm_labels.width.col+")"),r.selectAll(".col_label_group").attr("transform","translate("+t.viz.x_scale.rangeBand()/2+","+l+") rotate(45)"),r.selectAll(".col_label_group").select("text").attr("y",.6*t.viz.x_scale.rangeBand()).attr("dx",2*t.viz.border_width.x)}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){e.selectAll(".col_label_group").select("text").style("font-size",t.labels.default_fs_col+"px").text(function(t){return n.normal_name(t)}),e.selectAll(".col_label_group").each(function(){d3.select(this).select("text")[0][0].getBBox()})}},function(t,e,r){"use strict";var n=r(138);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.selectAll(".col_label_group").select("path"),a={},i=t.viz.duration;r===!1?a.run_transition=!1:a=r;var s;s=a.run_transition?o.transition().delay(a.update).duration(i):o,s.attr("d",function(){return n(t)}).attr("fill","#eee")}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={};r===!1?o.run_transition=!1:o=r,n.has(t.network_data.col_nodes[0],"value")&&e.selectAll(".col_bars").data(t.network_data.col_nodes,function(t){return t.name}).attr("width",function(e){var r=0;return e.value>0&&(r=t.labels.bar_scale_col(e.value)),r}).attr("height",.66*t.viz.rect_width)}},function(t,e,r){"use strict";var n=r(71),o=r(74),a=r(73),i=r(83),s=r(82);t.exports=function(t){if(t=n(t),t.viz=a(t.viz),t.viz=o(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t.viz=s(t.viz),t.viz.x_scale.rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale.rangeBands([0,t.viz.clust.dim.height]),t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,null!=t.viz.ds)for(var e;e0&&_.each(t.viz.ds,function(e){e.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]),e.y_scale.domain(d3.range(e.num_rows+1)),e.rect_height=e.y_scale.rangeBand()-t.viz.border_width.y}),t.viz.square_zoom=t.viz.norm_labels.width.col/(t.viz.rect_width/2),t=i(t)}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(99);t.exports=function(t,e){var r=t.network_data.row_nodes_names;if(t.viz.ds_level===-1)e.selectAll(".row").attr("transform",function(e){var n=_.indexOf(r,e.name),o=t.viz.y_scale(n);return"translate(0,"+o+")"}),e.selectAll(".row").selectAll(".tile").attr("transform",function(e){return a(t,e)}).attr("width",t.viz.rect_width).attr("height",t.viz.rect_height),e.selectAll(".row").selectAll(".tile_up").attr("d",function(){return n(t)}).attr("transform",function(e){return a(t,e)}),e.selectAll(".row").selectAll(".tile_dn").attr("d",function(){return o(t)}).attr("transform",function(e){return a(t,e)});else{var i=t.viz.ds_level,s=".ds"+String(i)+"_row",l=t.viz.ds[i].rect_height;e.selectAll(s).attr("transform",function(e){var r=t.viz.ds[i].y_scale(e.row_index);return"translate(0,"+r+")"}),e.selectAll(s).selectAll(".tile").attr("transform",function(e){return a(t,e)}).attr("width",t.viz.rect_width).attr("height",l)}}},function(t,e,r){"use strict";var n=r(75);t.exports=function(t,e){var r=t.params;r=n(r),e.selectAll(".row_bars").attr("width",function(t){var e=0;return e=r.labels.bar_scale_row(Math.abs(t.value))}).attr("x",function(t){var e=0;return e=-r.labels.bar_scale_row(Math.abs(t.value))}).attr("height",r.viz.y_scale.rangeBand())}},function(t,e){"use strict";t.exports=function(t){var e=d3.select(t.root+" .clust_container").attr("transform"),r=Number(e.split("(")[1].split(",")[0]),n=Number(e.split(",")[1].replace(")","")),o=r+t.viz.clust.dim.width/2,a=n+t.viz.clust.dim.height/2;d3.select(t.root+" .play_button").attr("transform",function(){return"translate("+o+","+a+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o=t.params.viz;if("row"===e){var a=o.svg_dim.width-3*o.uni_margin;r=o.clust.margin.left+o.clust.dim.width+5.25*o.dendro_room.row,r>a&&(r=a),n=o.clust.margin.top+3*o.uni_margin-50}else r=2*o.uni_margin,n=o.clust.margin.top+o.clust.dim.height+o.dendro_room.col-2*o.uni_margin;d3.select(t.params.root+" ."+e+"_tree_group").attr("transform",function(){var t;return n-=75,t="translate("+r+","+n+")"}).style("opacity",1),d3.select(t.params.root+" ."+e+"_slider_group").attr("transform",function(){var t;return"row"===e?(r+=.8*o.dendro_room.row,n+=65,t="translate("+r+","+n+")"):t="translate("+r+","+n+"), rotate(-90)",t}).style("opacity",1)}},function(t,e){"use strict";t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;e>0&&(r=2e3);var n=d3.selectAll(t.root+" .horz_lines"),o=d3.selectAll(t.root+" .vert_lines");n.style("opacity",0).attr("transform",function(e){var r=e.row_index,n=t.viz.y_scale(r);return"translate( 0,"+n+") rotate(0)"}).transition().duration(e).delay(r).style("opacity",1),n.append("line").attr("x1",0).attr("x2",t.viz.clust.dim.width).style("stroke-width",function(){var e=t.viz.border_width.y;return e+"px"}),o.style("opacity",0).attr("transform",function(e){var r=e.col_index,n=t.viz.x_scale(r);return"translate("+n+") rotate(-90)"}).transition().duration(e).delay(r).style("opacity",1),o.append("line").attr("x1",0).attr("x2",-t.viz.clust.dim.height).style("stroke-width",function(){var e=t.viz.border_width.x;return e+"px"})}},function(t,e,r){"use strict";var n=r(181),o=r(100),a=r(182),i=r(183),s=r(184);t.exports=function(t){var e=t.params;d3.select(e.root+" .col_cat_outer_container").empty()?d3.select(e.root+" .col_container").append("g").attr("class","col_cat_outer_container").attr("transform",function(){var t=e.viz.norm_labels.width.col+2;return"translate(0,"+t+")"}).append("g").attr("class","col_cat_container"):d3.select(e.root+" .col_container").select("col_cat_outer_container").attr("transform",function(){var t=e.viz.norm_labels.width.col+2;return"translate(0,"+t+")"}),d3.selectAll(e.viz.root_tips+"_col_cat_tip").remove();var r=o().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_col_cat_tip";return r}).direction("s").offset([5,0]).style("display","none").html(function(t){return n(e,t,this,"col")});d3.select(e.root+" .col_cat_container").selectAll("g").data(e.network_data.col_nodes,function(t){return t.name}).enter().append("g").attr("class","col_cat_group").attr("transform",function(t){var r=_.indexOf(e.network_data.col_nodes_names,t.name);return"translate("+e.viz.x_scale(r)+",0)"}),d3.select(e.root+" .col_cat_container").selectAll(".col_cat_group").call(r),d3.selectAll(e.root+" .col_cat_group").each(function(){var t,n=this;_.each(e.viz.all_cats.col,function(o){var l=parseInt(o.split("-")[1],10),c="col_cat_rect_"+String(l);t=d3.select(n).select("."+c).empty()?d3.select(n).append("rect").attr("class",c).attr("cat",o).attr("transform",function(){var t=e.viz.cat_room.symbol_width+e.viz.cat_room.separation,r=l*t;return"translate(0,"+r+")"}).on("click",function(t){if(d3.select(this).classed("cat_strings")){var r=s(e,t,this,"col");$(e.root+" .dendro_info").modal("toggle");var n=r.join(", ");d3.select(e.root+" .dendro_info input").attr("value",n)}}):d3.select(n).select("."+c),t.attr("width",e.viz.x_scale.rangeBand()).attr("height",e.viz.cat_room.symbol_width).style("fill",function(t){var r=t[o],n=e.viz.cat_colors.col[o][r];return n}).on("mouseover",r.show).on("mouseout",function(){r.hide(this),a(e),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(e.viz,"col",t,o)})})}},function(t,e,r){"use strict";var n=r(141);t.exports=function(t,e,r,o){function a(){var e=!1;if(d3.select(r).classed("hovering")){var n=[o];t.viz.sim_mat&&(n=["row","col"]),_.each(n,function(r){"string"==typeof l&&l.indexOf("Not ")<0&&"false"!=l&&(e=!0),e&&d3.selectAll(t.root+" ."+r+"_cat_group").selectAll("rect").style("opacity",function(e){var r=d3.select(this).style("opacity");if(d3.select(this).classed("cat_strings")&&d3.select(this).classed("filtered_cat")===!1){var n,o=d3.select(this).attr("cat");n=e[o].indexOf(": ")>=0?e[o].split(": ")[1]:e[o],r=o===i&&n===l?t.viz.cat_colors.active_opacity:t.viz.cat_colors.opacity/4}return r})})}}d3.selectAll(t.viz.root_tips+"_col_cat_tip").style("display","block"),d3.selectAll(t.viz.root_tips+"_row_cat_tip").style("display","block");var i=d3.select(r).attr("cat"),s=n(t.viz,i,o),l=e[i];"string"==typeof l&&l.indexOf(": ")>=0&&(l=l.split(": ")[1]);var c=s+": "+l;return d3.select(r).classed("hovering",!0),setTimeout(a,500),c}},function(t,e){"use strict";t.exports=function(t){_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_cat_group").selectAll("rect").style("opacity",function(){var e=d3.select(this).style("opacity");return d3.select(this).classed("cat_strings")&&d3.select(this).classed("filtered_cat")===!1&&(e=t.viz.cat_colors.opacity),e})})}},function(t,e){"use strict";t.exports=function(t,e,r,n){function o(t){"string"==typeof t&&t.indexOf(i)>-1&&(t=t.split(i)[1]);var e=parseFloat(t);return e}var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=": ",s=t.cat_info[e][n].type;"cat_strings"===s?a?r.classed("cat_strings",!0).style("opacity",0).transition().duration(1e3).style("opacity",t.cat_colors.opacity):r.classed("cat_strings",!0).style("opacity",t.cat_colors.opacity):r.classed("cat_values",!0).style("opacity",function(r){var a=r[n],i=o(a);return t.cat_info[e][n].cat_scale(Math.abs(i))}).style("fill",function(e){var r,a=o(e[n]);return r=a>0?t.cat_value_colors[0]:t.cat_value_colors[1]})}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e,r,o){var a=d3.select(r).attr("cat"),i=e[a],s=t.network_data[o+"_nodes"],l=_.filter(s,function(t){return t[a]==i}),c=n.pluck(l,"name");return c}},function(t,e,r){"use strict";var n=r(181),o=r(100),a=r(182),i=r(183),s=r(184);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.params;d3.select(r.root+" .row_cat_outer_container").empty()?d3.select(r.root+" .row_container").append("g").attr("class","row_cat_outer_container").attr("transform","translate("+r.viz.norm_labels.width.row+",0)").append("g").attr("class","row_cat_container"):d3.select(r.root+" .row_container").select("row_cat_outer_container").attr("transform","translate("+r.viz.norm_labels.width.row+",0)"),d3.select(r.root+" .row_cat_container").select(".white_bars").empty()?d3.select(r.root+" .row_cat_container").append("rect").attr("class","white_bars").attr("fill",r.viz.background_color).attr("width",r.viz.cat_room.row+"px").attr("height",function(){var t=r.viz.clust.dim.height;return t}):d3.select(r.root+" .row_cat_container").select(".white_bars").attr("fill",r.viz.background_color).attr("width",r.viz.cat_room.row+"px").attr("height",function(){var t=r.viz.clust.dim.height;return t}),d3.selectAll(r.viz.root_tips+"_row_cat_tip").remove();var l=o().attr("class",function(){var t=r.viz.root_tips.replace(".",""),e=t+" d3-tip "+t+"_row_cat_tip";return e}).direction("e").offset([5,0]).style("display","none").html(function(t){return n(r,t,this,"row")});d3.select(r.root+" .row_cat_container").selectAll("g").data(r.network_data.row_nodes,function(t){return t.name}).enter().append("g").attr("class","row_cat_group").attr("transform",function(t){var e=_.indexOf(r.network_data.row_nodes_names,t.name);return"translate(0, "+r.viz.y_scale(e)+")"}),d3.select(r.root+" .row_cat_container").selectAll(".row_cat_group").call(l);var c,u;d3.selectAll(r.root+" .row_cat_group rect").remove(),r.viz.show_categories.row&&d3.selectAll(r.root+" .row_cat_group").each(function(){u=this,_.each(r.viz.all_cats.row,function(t){var n=parseInt(t.split("-")[1],10),o="row_cat_rect_"+String(n);c=d3.select(u).select("."+o).empty()?d3.select(u).append("rect").attr("class",o).attr("cat",t):d3.select(u).select("."+o),c.attr("width",r.viz.cat_room.symbol_width).attr("height",r.viz.y_scale.rangeBand()).style("fill",function(e){var n=e[t],o=r.viz.cat_colors.row[t][n];return o}).attr("x",function(){var t=r.viz.cat_room.symbol_width+r.viz.uni_margin/2;return t+"px"}).attr("transform",function(){var t=r.viz.cat_room.symbol_width+r.viz.cat_room.separation,e=n*t;return"translate("+e+",0)"}).on("click",function(t){if(d3.select(this).classed("cat_strings")){var e=s(r,t,this,"row");$(r.root+" .dendro_info").modal("toggle");var n=e.join(", ");d3.select(r.root+" .dendro_info input").attr("value",n)}}).on("mouseover",l.show).on("mouseout",function(){l.hide(this),a(r),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(r.viz,"row",c,t,e)})})}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.dendro_room.row+e.viz.uni_margin,o=e.viz.clust.margin.left+e.viz.clust.dim.width,a=e.viz.clust.margin.top;d3.select(e.root+" .row_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").append("rect").classed("row_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",r+"px").attr("height",e.viz.svg_dim.height),d3.select(e.root+" .row_dendro_outer_container").append("g").attr("class","row_dendro_container").attr("transform","translate("+e.viz.uni_margin/2+",0)")):(d3.select(e.root+" .viz_svg").select("row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").select(".row_dendro_spillover").attr("width",r+"px").attr("height",e.viz.svg_dim.height)),n(t,"row",!1),"clust"!=e.viz.inst_order.col&&d3.selectAll(e.root+" .row_dendro_group").remove()}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.clust.margin.left,o=e.viz.clust.margin.top+e.viz.clust.dim.height,a=e.viz.dendro_room.col+e.viz.uni_margin;d3.select(e.root+" .col_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","col_dendro_outer_container").attr("transform","translate("+r+","+o+")"),d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",a+"px"),d3.select(e.root+" .col_dendro_outer_container").append("g").attr("class","col_dendro_container").attr("transform","translate(0,"+e.viz.uni_margin/2+")"),d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover_top",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height).attr("transform","translate(0,"+e.viz.dendro_room.col+")")):(d3.select(e.root+" .viz_svg").select("col_dendro_outer_container").attr("transform","translate("+r+","+o+")"), -d3.select(e.root+" .col_dendro_outer_container").select(".col_dendro_spillover").attr("width",e.viz.svg_dim.width).attr("height",a+"px")),n(t,"col",!1),"clust"!=e.viz.inst_order.row&&d3.selectAll(e.root+" .col_dendro_group").remove()}},function(t,e,r){"use strict";var n=r(189);r(191);t.exports=function(t){n(t,"row"),n(t,"col")}},function(t,e,r){"use strict";var n=r(190),o=r(178);t.exports=function(t,e){function r(){t.params.is_slider_drag=!0;var r=d3.event.y;r<0&&(r=0),r>i&&(r=i),this.nextSibling&&this.parentNode.appendChild(this),r=d3.round(r,-1);var o=10-r/10;d3.select(this).attr("transform","translate(0, "+r+")"),n(t,e,o)}function a(){var r=d3.mouse(this),o=d3.round(r[1],-1);d3.select(t.params.root+" ."+e+"_group_circle").attr("transform","translate(0, "+o+")");var a=10-o/10;n(t,e,a)}var i=100,s=d3.behavior.drag().on("drag",r).on("dragend",function(){t.params.is_slider_drag=!1}),l=d3.select(t.params.root+" .viz_svg").append("g").classed(e+"_slider_group",!0);o(t,e);var c=i+20,u=30;l.append("rect").classed(e+"_slider_background",!0).attr("height",c+"px").attr("width",u+"px").attr("fill",t.params.viz.background_color).attr("transform",function(){var t="translate(-10, -5)";return t}).style("opacity",0),l.append("line").style("stroke-width",i/7+"px").style("stroke","black").style("stroke-linecap","round").style("opacity",0).attr("y1",0).attr("y2",function(){return i-2}).on("click",a);var d=-i/40;l.append("path").style("fill","black").attr("transform","translate("+d+", 0)").attr("d",function(){var t=0,e=0,r=0,n=i,o=i/10,a=0,s="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return s}).style("opacity",.35).on("click",a);var f=.35,p=.6;l.append("circle").classed(e+"_group_circle",!0).attr("r",.08*i).attr("transform",function(){return"translate(0, "+i/2+")"}).style("fill","blue").style("opacity",f).on("mouseover",function(){d3.select(this).style("opacity",p)}).on("mouseout",function(){d3.select(this).style("opacity",f)}).call(s)}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t,e,r){var o=t.params;"row"===e?o.group_level.row=r:"col"===e&&(o.group_level.col=r);var a=!0;n(t,e,a)}},function(t,e,r){"use strict";var n=r(178),o=r(100),a=r(192);t.exports=function(t,e){e="row";var r=40,i=t.params,s=.35,l=.6,c=o().attr("class",function(){var t=i.viz.root_tips.replace(".",""),e=t+"_tree_menu_tip d3-tip";return e}).direction("sw").style("display","none").offset([-10,-5]).html(function(){return"Clustering Menu"}),u=d3.select(i.root+" .viz_svg").append("g").classed(e+"_tree_group",!0).on("mouseover",function(){d3.select(i.root+" .tree_menu").empty()&&(d3.selectAll(i.viz.root_tips+"_tree_menu_tip").style("opacity",1).style("display","block"),c.show()),d3.selectAll(i.root+" .tree_leaf_circle").style("opacity",l)}).on("mouseout",function(){c.hide(),d3.selectAll(i.root+" .tree_leaf_circle").style("opacity",s)}).call(c),d=u.append("g").classed("dendro_tree_container",!0).on("click",function(){d3.select(i.root+" .tree_menu").empty()?(a(t,"open"),c.hide()):a(t,"close")});d3.select(i.root+" .dendro_tree_container").attr("transform","scale(0.9)"),n(t,e);var f=0,p=20;d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=0,e=r,n=p/2,o=0,a=p,i=r,s="M"+t+","+e+", L"+n+", "+o+", L"+a+","+i+" Z";return s}).style("opacity",.35);var _=30;d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=4.3,e=23,r=-5,n=_/2.5,o=5.8,a=_/1.8,i="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return i}).style("opacity",.35),d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=15.7,e=23,r=25,n=_/2.5,o=14.2,a=_/1.8,i="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return i}).style("opacity",.35);var h=13,v=9.5;d.selectAll().data([[-3,h,v],[p/2,0,17],[23,h,v]]).enter().append("circle").classed("tree_leaf_circle",!0).attr("r",function(t){return t[2]}).attr("transform",function(t){return"translate("+t[0]+", "+t[1]+")"}).attr("fill","blue").attr("opacity",s).attr(""),d.append("rect").attr("width",50).attr("height",62).attr("transform",function(){return"translate(-15, -19)"}).attr("opacity",0)}},function(t,e,r){"use strict";var n=r(193);t.exports=function(t,e){var r=t.params;"open"===e?n(t):"close"===e&&(d3.select(r.root+" .tree_menu").transition(700).attr("opacity",0),setTimeout(function(){d3.select(r.root+" .tree_menu").remove()},700))}},function(t,e,r){"use strict";var n=r(194);t.exports=function(t){function e(t){return t.charAt(0).toUpperCase()+t.slice(1)}var r=t.params,o=475,a=d3.select(r.root+" .viz_svg").append("g").attr("transform",function(){var t={};return t.x=r.viz.clust.dim.width+r.viz.clust.margin.left-o+25,t.y=r.viz.clust.margin.top,"translate("+t.x+", "+t.y+")"}).classed("tree_menu",!0);a.attr("opacity",0).transition().attr("opacity",1),a.append("rect").classed("tree_menu_background",!0).attr("width",function(){var t=o;return t}).attr("height",function(){var t=500;return t}).attr("fill","white").attr("stroke","#A3A3A3").attr("stroke-width","3px").attr("opacity",.95),a.append("text").classed("tree_menu_title",!0).attr("transform","translate(20,30)").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-size","18px").attr("font-weight",800).attr("cursor","default").text("Clustering Menu");var i=["cosine","euclidean","correlation","jaccard"],s=30,l=110,c=80;a.append("text").attr("transform","translate(25, 70)").attr("font-size","18px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("cursor","default").text("Distance Metric"),a.append("rect").classed("tree_menu_line",!0).attr("height","2px").attr("width","435px").attr("stroke-width","3px").attr("opacity",.3).attr("fill","black").attr("transform","translate(20,"+c+")");var u=a.append("g").attr("transform","translate(20,"+l+")").classed("distance_section",!0),d=u.selectAll("g").data(i).enter().append("g").attr("transform",function(t,e){var r=e*s,n="translate(0,"+r+")";return n}).on("click",function(e){d3.select(r.root+" .tree_menu").transition(700).attr("opacity",0),setTimeout(function(){d3.select(r.root+" .tree_menu").remove()},700),t.params.matrix.distance_metric=e,n(t,e)});d.append("circle").attr("cx",10).attr("cy",-6).attr("r",7).style("stroke","#A3A3A3").style("stroke-width","2px").style("fill",function(e){var r="white";return e===t.params.matrix.distance_metric&&(r="red"),r}),d.append("text").attr("transform","translate(25,0)").style("font-size","16px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("cursor","default").text(function(t){return e(t)})}},function(t,e,r){"use strict";var n=r(195),o=r(12),a=o.create(),i=r(199),s=r(200),l=r(202);a.import(r(227)),a.import(r(25)),t.exports=function(t,e){var r={};r.N_row_sum="null",r.N_row_var="null",r.dist=e,r.nodes={},r.nodes.row_nodes=$.extend(!0,[],t.params.network_data.row_nodes),r.nodes.col_nodes=$.extend(!0,[],t.params.network_data.col_nodes),_.each(["row","col"],function(o){var l,c,u,d=a.transpose;"row"===o?(l=$.extend(!0,[],t.params.network_data.mat),c=t.params.network_data.row_nodes_names,u="row_nodes"):"col"===o&&(l=$.extend(!0,[],t.params.network_data.mat),l=d(l),c=t.params.network_data.col_nodes_names,u="col_nodes");for(var f,p,_=n.hcluster(l,i[e]),h=s(_,c),v=r.nodes[u],m=0;m=this.threshold)return!1;var a=this.index[t],i=this.index[this.mins[t]],s={dist:e,left:a,right:i,key:a.key,size:a.size+i.size};this.tree[a.index]=s,this.tree.splice(i.index,1),this.index[a.key]=s;for(var r=0;rthis.dists[i.key][l.key]&&(o=this.dists[i.key][l.key])):"complete"==this.linkage?(o=this.dists[a.key][l.key],this.dists[a.key][l.key]r&&(r=t.dist,e=t)}),e}function r(t){return 1===t.size?[t.value]:r(t.left).concat(r(t.right))}(t>this.tree.size||t<1)&&(t=this.tree.size);for(var n=[],o=[this.tree];t>1;){var a=e(o);o.splice(o.indexOf(a),1),o.push(a.left,a.right),t--}return o.forEach(function(t){n.push(r(t))}),n}};var a=function(t,e,r,n,a,i){var s=new o(e,r,n),l=s.tree(t,a,i);return{hc:s,tree:void 0===n?l[0]:l,clusters:s.clusters}};t.exports=a},function(t,e){"use strict";t.exports={euclidean:function(t,e){for(var r=0,n=0;ne&&(e=t)})}),e}},function(t,e,r){"use strict";var n=r(203),o=r(225);t.exports=function(t,e,r){var a={};a[e]=r,n(t,a),o(t,e,r)}},function(t,e,r){"use strict";var n=r(10),o=r(204),a=r(205);t.exports=function(t,e){o(t.params);var r=n(t.config,t.params,e);d3.select(t.params.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!0).classed("fa-undo",!1).classed("active_cropping",!1),_.each(["row","col"],function(e){d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter",!1),d3.select(t.params.root+" ."+e+"_dendro_icons_container").style("display","block")}),a(t,r)}},function(t,e){"use strict";t.exports=function(t){d3.selectAll(t.root+" .btn").attr("disabled",!0),d3.select(t.viz.viz_svg).style("opacity",.7)}},function(t,e,r){"use strict";var n=r(9),o=r(206),a=r(207),i=r(151),s=r(180),l=r(185),c=r(186),u=r(187),d=r(218),f=r(220),p=r(161),_=r(221),h=r(150),v=r(222),m=r(153),g=r(224),y=r(84);t.exports=function(t,e){function r(){d3.selectAll(".dendro_shadow").remove()}function w(){d3.select(t.params.viz.viz_svg).transition().duration(250).style("opacity",1),setTimeout(x,1e3)}function x(){d3.select(t.params.viz.viz_svg).classed("running_update",!1)}d3.select(t.params.viz.viz_svg).classed("running_update",!0),d3.selectAll(t.params.root+" .ds"+String(t.params.viz.ds_level)+"_row").remove(),null!=t.params.matrix_update_callback&&t.params.matrix_update_callback();var b=t.params.matrix.distance_metric,z=t.params.group_level,k=t.params.crop_filter_nodes,A=jQuery.extend(!0,{},t.config),E=null;if(null!=t.params.new_row_cats){v(t.params.new_row_cats,e.row_nodes),E=t.params.new_row_cats,t.params.new_row_cats=E;var N=!0;t.params.viz=y(t.params,t.params.viz,N)}A.network_data=e,A.inst_order=t.params.viz.inst_order,A.input_domain=t.params.matrix.opacity_scale.domain()[1],_(A,t.params),A.ini_view=null,A.current_col_cat=t.params.current_col_cat,A.cat_colors=t.params.viz.cat_colors;var M=n(A),S=o(t.params,M);t.params=M,t.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,t.params.viz.square_zoom*t.params.viz.zoom_ratio.x]).on("zoom",function(){m(t)}),t.params.matrix.distance_metric=b,t.params.group_level=z,t.params.crop_filter_nodes=k,0===t.params.viz.ds_num_levels?a(t,e,S):g(t),d3.select(t.params.viz.viz_svg).style("opacity",.7),l(t),h(t),t.params.viz.show_categories.col&&s(t),t.params.viz.show_dendrogram&&(c(t),u(t)),i(t),d3.select(t.params.viz.viz_svg).call(t.params.zoom_behavior),p(t),d(t),t.params.viz.run_trans=!0,setTimeout(f,2500,t.params),setTimeout(r,50),setTimeout(r,100),setTimeout(r,500),setTimeout(r,1e3),setTimeout(r,1500),setTimeout(w,S.enter)}},function(t,e){"use strict";t.exports=function(t,e){var r=t.network_data.row_nodes,n=t.network_data.col_nodes,o=_.map(r,function(t){return t.name}),a=_.map(n,function(t){return t.name}),i=o.concat(a),s=e.network_data.row_nodes,l=e.network_data.col_nodes,c=_.map(s,function(t){return t.name}),u=_.map(l,function(t){return t.name}),d=c.concat(u),f=_.difference(i,d).length,p=_.difference(d,i).length,h={};f>0?h.update=1e3:h.update=0,p>0?h.enter=1e3:h.enter=0,h.enter=h.enter+h.update,h.run_transition=!0;var v=t.network_data.links.length,m=e.network_data.links.length,g=.5*e.matrix.def_large_matrix;return(v>g||m>g)&&(h.run_transition=!1,h.update=0,h.enter=0),h}},function(t,e,r){"use strict";var n=r(208),o=r(101),a=r(131),i=r(209),s=r(213),l=r(91),c=r(214),u=r(217),d=r(145),f=r(100);t.exports=function(t,e,r){var p=t.params;d3.selectAll(p.viz.root_tips).remove();var _=f().attr("class",function(){var t=p.viz.root_tips.replace(".",""),e=t+" d3-tip "+t+"_tile_tip";return e}).direction("nw").offset([0,0]).style("display","none").html(function(t){var e,r=String(t.value.toFixed(3));if(p.keep_orig){var n=String(t.value_orig.toFixed(3));e="

"+t.row_name+" and "+t.col_name+"

normalized value: "+r+"

original value: "+n+"
"}else e="

"+t.row_name+" and "+t.col_name+"

value: "+r+"
";return e});d3.select(p.root+" .clust_group").call(_),u(p);for(var h=1e3,v=e.row_nodes,m=e.col_nodes,g=e.links,y=g,w=0;w1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null===r&&(r={},r.enter=0,r.update=0,r.run_transition=!1);var b=t.params,z=t.params.network_data.row_nodes;b.zoom_info=x();var k=b.network_data.row_nodes_names;s(b),b=a(b),b.viz=i(b.viz),b.viz=o(b.viz),b.sim_mat&&(b.viz.clust.dim.width<=b.viz.clust.dim.height?b.viz.clust.dim.height=b.viz.clust.dim.width:b.viz.clust.dim.width=b.viz.clust.dim.height),b.viz=w(b.viz),b.viz.x_scale.rangeBands([0,b.viz.clust.dim.width]),b.viz.y_scale.rangeBands([0,b.viz.clust.dim.height]),b.viz.square_zoom=b.viz.norm_labels.width.col/(b.viz.x_scale.rangeBand()/2),b.zoom_behavior.scaleExtent([1,b.viz.square_zoom*b.viz.zoom_ratio.x]),b.viz.border_width.x=b.viz.x_scale.rangeBand()/b.viz.border_fraction,b.viz.border_width.y=b.viz.y_scale.rangeBand()/b.viz.border_fraction,b=y(b);var A=d3.select(b.viz.viz_wrapper).select("svg");A.select(b.root+" .grey_background").transition().delay(r.update).duration(e).attr("width",b.viz.clust.dim.width).attr("height",b.viz.clust.dim.height),d(b,A,r),A.selectAll(".row_label_group").select("text").style("font-size",b.labels.default_fs_row+"px").text(function(t){return n.normal_name(t)}),A.selectAll(".row_label_group").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",b.viz.y_scale.rangeBand()).style("fill","yellow").style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),f(b,A,r),r.run_transition?(A.selectAll(".row_label_group").select("text").transition().delay(r.update).duration(e).attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,function(t){return t.name}).transition().delay(r.update).duration(e).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}),A.selectAll(".row_cat_group").select("path").transition().delay(r.update).duration(e).attr("d",function(){var t=b.viz.cat_room.symbol_width-1,e=0,r=1,n=b.viz.y_scale.rangeBand()/2,o=b.viz.cat_room.symbol_width-1,a=b.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+n+", L "+o+","+a+" Z";return i}),A.selectAll(".row_dendro_group").data(z,function(t){return t.name}).transition().delay(r.update).duration(e).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})):(A.selectAll(".row_label_group").select("text").attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}),A.selectAll(".row_cat_group").select("path").attr("d",function(){var t=b.viz.cat_room.symbol_width-1,e=0,r=1,n=b.viz.y_scale.rangeBand()/2,o=b.viz.cat_room.symbol_width-1,a=b.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+n+", L "+o+","+a+" Z";return i}),A.selectAll(".row_dendro_group").data(z,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})),n.has(b.network_data.row_nodes[0],"value")&&g(t,A),p(b,A,r),h(b,A),v(b,A,r),m(b,A,r),l(b,A,r),c(b,A,r),u(b.viz,A,r),b.zoom_behavior.scale(1).translate([b.viz.clust.margin.left,b.viz.clust.margin.top])}},function(t,e,r){"use strict";var n=r(210),o=r(211),a=r(212),i=r(97),s=r(98),l=r(99),c=r(68);t.exports=function(t,e,r,u,d,f){var p=e.row_data,h=_.filter(p,function(t){return 0!=t.value}),v=d3.select(d).selectAll(".tile").data(h,function(t){return t.col_name});n(t,r,v,p,d);var m=v.on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).attr("fill-opacity",function(e){var r=t.matrix.opacity_scale(Math.abs(e.value));return r}):l.style("fill",function(e){return e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).attr("fill-opacity",function(e){var r=t.matrix.opacity_scale(Math.abs(e.value));return r}),l.each(function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99);t.exports=function(t,e,r,l,c,u,d){var f=_.filter(e,function(t){return 0!=t.value_up||0!=t.value_dn}),p=d3.select(r).selectAll(".tile_up").data(f,function(t){return t.col_name}),h=p.on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e){"use strict";t.exports=function(t,e,r){var n=t.network_data.row_nodes,o=t.network_data.col_nodes,a=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).exit();e.run_transition?a.transition().duration(r).style("opacity",0).remove():a.style("opacity",0).remove(),d3.selectAll(t.root+" .row_label_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_cat_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_dendro_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_text").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .horz_lines").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .vert_lines").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_cat_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_dendro_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove()}},function(t,e,r){"use strict";var n=r(215);t.exports=function(t,e,r,o){var a=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).enter().append("g").classed("row",!0).attr("transform",function(e){return"translate(0,"+t.viz.y_scale(e.row_index)+")"});a.each(function(a){n(t,a,e,r,o,this)})}},function(t,e,r){"use strict";var n=r(216),o=r(97),a=r(98),i=r(99);t.exports=function(t,e,r,s,l,c){var u=e.row_data,d=_.filter(u,function(t){return 0!==t.value}),f=d3.select(c).selectAll("rect").data(d,function(t){return t.col_name}).enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",t.viz.rect_height).style("fill",function(e){return e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r});var f=d3.select(r).selectAll(".tile_dn").data(u,function(t){return t.col_name}).enter().append("path").attr("class","tile_dn").attr("d",function(){return o(t)}).attr("transform",function(e){return a(t,e)}).style("fill",function(){return t.matrix.tile_colors[1]}).on("mouseover",function(e){d3.selectAll(t.root+" .row_label_group text").classed("active",function(t){return e.row_name===t.name}),d3.selectAll(t.root+" .col_label_text text").classed("active",function(t){return e.col_name===t.name}),t.matrix.show_tile_tooltips&&i.show(e)}).on("mouseout",function(){d3.selectAll(t.root+" text").classed("active",!1),t.matrix.show_tile_tooltips&&i.hide()});f.style("fill-opacity",0).transition().delay(s.enter).duration(l).style("fill-opacity",function(e){var r=0;return Math.abs(e.value_up)>0&&(r=t.matrix.opacity_scale(Math.abs(e.value_dn))),r}),c.each(function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e){"use strict";t.exports=function(t){d3.select(t.root+" .clust_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.clust.margin.top+")"),d3.select(t.root+" .col_label_outer_container").attr("transform","translate(0,"+t.viz.norm_labels.width.col+")"),d3.select(t.root+" .col_cat_outer_container").attr("transform",function(){var e=t.viz.norm_labels.width.col+2;return"translate(0,"+e+")"})}},function(t,e,r){"use strict";var n=(r(190),r(143)),o=r(142),a=r(219);t.exports=function(t){function e(e,r){var n=2-r,o=t.params.matrix.abs_max_val*n;t.params.matrix.opacity_scale.domain([0,o]),d3.selectAll(t.params.root+" .tile").style("fill-opacity",function(e){var r=t.params.matrix.opacity_scale(Math.abs(e.value));return r})}var r=t.params,i=d3.select(r.root+" .gene_search_box")[0][0],s=new Awesomplete(i,{minChars:1,maxItems:15}),l=t.params.network_data.row_nodes_names;s.list=l,d3.selectAll(".awesomplete ul").style("z-index",99),$(r.root+" .gene_search_box").keyup(function(e){if(13===e.keyCode){var n=$(r.root+" .gene_search_box").val();a(t,n,l)}}),$(r.root+" .submit_gene_button").off().click(function(){var e=$(r.root+" .gene_search_box").val();a(t,e,l)});var c;if(c=r.sim_mat?["both"]:["row","col"],_.each(c,function(e){$(r.root+" .toggle_"+e+"_order .btn").off().click(function(o){var a=$(o.target).attr("name").replace("_row","").replace("_col","");d3.selectAll(r.root+" .toggle_"+e+"_order .btn").classed("active",!1),d3.select(this).classed("active",!0),"both"!=e?n(t,a,e):(n(t,a,"row"),n(t,a,"col"))})}),o(t),d3.select(t.params.root+" .opacity_slider").select("#handle-one").empty()){var u=d3.slider().snap(!0).value(1).min(.1).max(1.9).step(.1).on("slide",function(t,r){e(t,r)});d3.select(t.params.root+" .opacity_slider").call(u)}}},function(t,e,r){"use strict";var n=r(144);t.exports=function(t,e,r){var o="name";if(r.indexOf(e)!==-1){d3.selectAll(t.params.root+" .row_label_group").select("rect").style("opacity",0);var a=_.indexOf(r,e),i=t.params.viz.y_scale(a),s=t.params.viz.clust.dim.height/2-i,l=t.params.viz.zoom_ratio.x;n(t,0,s,l),t.params.zoom_info.zoom_y=l,d3.selectAll(t.params.root+" .row_label_group").filter(function(t){return t[o]===e}).select("rect").style("opacity",1)}}},function(t,e){"use strict";t.exports=function(t){t.dendro_filter.row===!1&&"clust"===t.viz.inst_order.col&&d3.select(t.root+" .row_slider_group").style("opacity",1).style("pointer-events","all"), -d3.selectAll(t.root+" .toggle_row_order .btn").attr("disabled",null),t.dendro_filter.col===!1&&"clust"===t.viz.inst_order.row&&d3.select(t.root+" .col_slider_group").style("opacity",1).style("pointer-events","all"),d3.selectAll(t.root+" .toggle_col_order .btn").attr("disabled",null),d3.selectAll(t.root+" .gene_search_button .btn").attr("disabled",null),t.viz.run_trans=!1}},function(t,e){"use strict";t.exports=function(t,e){_.each(["row","col"],function(r){var n;n="row"===r?"col":"row",d3.selectAll(e.root+" .toggle_"+n+"_order .btn").filter(function(){return d3.select(this).attr("name")===t.inst_order[r]}).classed("active",!0)})}},function(t,e,r){"use strict";var n=r(223),o=r(2),a=r(68);t.exports=function(t,e){var r,i,s,l,c,u,d,f,p=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=0,v=0;_.each(e,function(e){l=e.name,p===!0&&(l.indexOf(" ")?l=l.split(" ")[0]:l.indexOf("_")&&(l=l.split("_")[0])),h=0,n(e),_.each(t,function(t){if(r=t.cat_title,i=t.cats,c="false",v=-1,f=0,_.each(i,function(t){u=t.cat_name,s=t.members,a.contains(s,l)&&(c=u,v=f),f+=1}),o.has(t,"pval")){var n=t.pval.toExponential();d=r+": "+c+"

Pval "+String(n)+"

"}else d=r.indexOf("cat-")===-1?r+": "+c:c;e["cat-"+String(h)]=d,e["cat_"+String(h)+"_index"]=v,h+=1})})}},function(t,e){"use strict";t.exports=function(t){var e=_.keys(t);_.each(e,function(e){e.indexOf("cat-")>-1&&delete t[e],e.indexOf("cat_")>-1&&delete t[e]})}},function(t,e,r){"use strict";var n=r(208),o=r(131),a=r(134),i=r(217);t.exports=function(t){d3.selectAll(t.params.root+" .row_cat_group").remove(),d3.selectAll(t.params.root+" .row_label_group").remove(),d3.selectAll(t.params.root+" .row").remove();var e=!0,r=!0,s=!0;a(t,e,r,s),o(t);var l=t.params.network_data.col_nodes;d3.selectAll(t.params.root+" .col_label_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_label_text").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_cat_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_dendro_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),i(t.params);var c={};c.enter=0,c.update=0,c.run_transition=!1;var u=0;n(t,u,c)}},function(t,e,r){"use strict";var n=r(226);t.exports=function(t,e,r){var o,a,i=t.params;d3.select(i.root+" .slider_"+e).attr("current_state",r),_.each(_.keys(i.viz.possible_filters),function(r){if(o=e.indexOf("row")>-1?"row":e.indexOf("col")>-1?"col":"neither",a=r.indexOf("row")>-1?"row":r.indexOf("col")>-1?"col":"neither",e!=r&&"neither"!=o&&o==a){var s=n(i,r);t.slider_functions[r].value(0),d3.select(i.root+" .title_"+r).text(s.text+s.state),d3.select(i.root+" .slider_"+r).attr("current_state",s.state)}});var s=n(i,e);d3.select(i.root+" .title_"+e).text(s.text+r+s.suffix)}},function(t,e,r){"use strict";var n=r(5);t.exports=function(t,e){var r={},o={},a={};return r.state=n(t.viz.filter_data,e),a.top=e.split("_")[0],a.node=e.split("_")[1],a.measure=e.split("_")[2],"row"===a.node?o.node="rows":o.node="columns","N"===a.top&&(r.suffix=""),"pct"===a.top&&(r.suffix="%"),"sum"==a.measure?o.measure="sum":"var"==a.measure&&(o.measure="variance"),"sum"===a.measure&&(r.text="Top "+o.node+" "+o.measure+": "),"var"===a.measure&&(r.text="Top "+o.node+" "+o.measure+": "),_.keys(t.viz.possible_filters).indexOf("enr_score_type")>-1&&"col"===a.node&&(r.text="Top Enriched Terms: ",r.suffix=""),r}},function(t,e,r){"use strict";function n(t,e,n,i){var s=r(45),l=n(r(43)),c=t.DenseMatrix,u=t.SparseMatrix,d=i("transpose",{Array:function(t){return d(l(t)).valueOf()},Matrix:function(t){var e,r=t.size();switch(r.length){case 1:e=t.clone();break;case 2:var n=r[0],o=r[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+a(r)+")");switch(t.storage()){case"dense":e=f(t,n,o);break;case"sparse":e=p(t,n,o)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+a(this._size)+")")}return e},any:function(t){return o(t)}}),f=function(t,e,r){for(var n,a=t._data,i=[],s=0;s2&&void 0!==arguments[2]?arguments[2]:4e3;e.indexOf("slider")<0?d3.select(t.root+" ."+e).style("background","#007f00").style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("background","#FFFFFF").style("box-shadow","none"):d3.select(t.root+" ."+e).style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("box-shadow","none")}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(144);t.exports=function(){function t(t){var e=t.params,s="Search for rows using\nthe search box";n(e,s,5e3);var l=2500;setTimeout(o,l,e,"gene_search_container"),setTimeout(r,l+1e3,e,"E"),setTimeout(r,l+1500,e,"EG"),setTimeout(r,l+2e3,e,"EGF"),setTimeout(r,l+2500,e,"EGFR"),setTimeout(i,5500,e),setTimeout(a,7500,t,0,0,1)}function e(){return 1e4}function r(t,e){$(t.root+" .gene_search_box").val(e),$(t.root+" .gene_search_box").autocomplete("search",e)}function i(t){$(t.root+" .submit_gene_button").click(),$(t.root+" .gene_search_box").autocomplete("search","")}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(203);t.exports=function(){function t(t){var e=t.params,a="Filter rows based on sum or\nvariance using the sliders";n(e,a,4e3);var i="N_row_sum";setTimeout(o,5e3,e,"slider_"+i,13e3),a="Filter: Top 20 rows by sum",setTimeout(n,5e3,e,a,4e3),setTimeout(r,5300,t,i,20,1),a="Filter: Top 10 rows by sum",setTimeout(n,1e4,e,a,4e3),setTimeout(r,10300,t,i,10,2),a="Filter: All rows",setTimeout(n,15e3,e,a,4e3),setTimeout(r,15300,t,i,"all",0)}function e(){return 19500}function r(t,e,r,n){var o=t.params,i={};i[e]=r,a(t,i),$(o.root+" .slider_"+e).slider("value",n);var s;s="N_row_sum"===e?"sum":"variance",d3.select(o.root+" .title_"+e).text("Top rows "+s+": "+r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(235);t.exports=function(){function t(t){var e=Number(d3.select(t.root+" .expand_button").attr("x").replace("px","")),a=Number(d3.select(t.root+" .expand_button").attr("y").replace("px","")),i=0,s=400;setTimeout(n,i,t,"single",e,a),setTimeout(r,s,t),setTimeout(o,1500,t)}function e(){return 3500}function r(t){$(t.root+" .expand_button").d3Click()}function o(t){a(t,"row","clust"),a(t,"col","clust")}function a(t,e,r){var n=d3.selectAll(".toggle_"+e+"_order .btn").filter(function(){return this.__data__==r})[0];$(n).click()}return jQuery.fn.d3Click=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(190);t.exports=function(){function t(t){var e="Identify row and column groups\nof varying sizes using the\nsliders and dendrogram";n(t,e,1e4),setTimeout(o,3e3,t,"slider_col",7e3),setTimeout(r,4e3,t,"row",3),setTimeout(r,5e3,t,"row",4),setTimeout(r,6e3,t,"row",5),setTimeout(r,7e3,t,"row",6),setTimeout(r,8e3,t,"row",7),setTimeout(r,9e3,t,"row",5)}function e(){return 11e3}function r(t,e,r){$(cgm.params.root+" .slider_col").slider("value",r/10),a(cgm,e,r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(235);t.exports=function(){function t(t){var e="Row and column categories\ncan be use to reorder\nby double-clicking";n(t,e,7e3);var a=d3.selectAll(t.root+" .col_cat_super").filter(function(){return"cat-1"===this.__data__})[0],i=d3.select(".col_cat_super").attr("transform"),s=Number(i.split("(")[1].split(",")[0].replace(")",""))+20,l=Number(i.split(",")[1].replace(")","")),c=4e3;setTimeout(o,c,t,"double",s,l);var u=c+300;setTimeout(r,u,t,a)}function e(){return 8e3}function r(t,e){$(e).d3DblClick()}return jQuery.fn.d3DblClick=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("dblclick",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(245);t.exports=function(){function t(t){var r="Clustergrammer is built with gene\nexpression data in mind and interfaces\nwith several Ma'ayan lab web tools",o="The example data being visualized is\ngene expression data obtained from the\nCancer Cell Line Encyclopedia",a="For more information please view\nthe help documentation";setTimeout(n,0,t,r,4500),setTimeout(n,4500,t,o,4500),setTimeout(n,9e3,t,a,4500),setTimeout(e,14e3,t)}function e(t){d3.select(t.root+" .play_button").classed("running_demo",!1),o(t,!0)}function r(){return 12e3}return{run:t,get_duration:r}}},function(t,e){"use strict";t.exports=function(t,e){e===!1?d3.select(t.root+" .play_button").transition().duration(500).style("opacity",0):(d3.select(t.root+" .play_button").transition().duration(500).style("opacity",1),$.unblockUI())}},function(t,e,r){"use strict";var n=r(232),o=r(235);t.exports=function(){function t(t){var e="View additional controls\nby clicking the menu button";n(t,e,4e3);var a=Number(d3.select(t.root+" .expand_button").attr("x").replace("px","")),i=Number(d3.select(t.root+" .expand_button").attr("y").replace("px","")),s=3e3,l=3400;setTimeout(o,s,t,"single",a,i),setTimeout(r,l,t)}function e(){return 5e3}function r(t){$(t.root+" .expand_button").d3Click()}return jQuery.fn.d3Click=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},jQuery.fn.d3DblClick=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("dblclick",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(248),o=r(249);t.exports=function(){var t=this,e=t.params;n(t);var r=30;o(e,r)}},function(t,e,r){"use strict";var n=r(177);t.exports=function(t){var e=t.params;if(d3.select(e.root+" .play_button").empty()){var r=d3.select(e.root+" .viz_svg").append("g").classed("play_button",!0).classed("running_demo",!1);n(e),r.append("circle").style("r",45).style("fill","white").style("stroke","black").style("stroke-width","3px").style("opacity",.5),r.append("path").attr("d",function(){var t=40,e=22,r=15;return"M-"+r+",-"+e+" l "+t+","+e+" l -"+t+","+e+" z "}).style("fill","black").style("opacity",.5),r.on("mouseover",function(){d3.select(this).select("path").style("fill","red").style("opacity",1),d3.select(this).select("circle").style("opacity",1)}).on("mouseout",function(){d3.select(this).select("path").style("fill","black").style("opacity",.5),d3.select(this).select("circle").style("opacity",.5)}).on("click",function(){t.play_demo()})}}},function(t,e){"use strict";t.exports=function(t,e){if(d3.select(t.root+" .demo_group").empty()){var r=d3.select(t.root+" .clust_container").attr("transform"),n=Number(r.split("(")[1].split(",")[0]),o=Number(r.split(",")[1].replace(")","")),a=d3.select(t.root+" .viz_svg").append("g").classed("demo_group",!0).attr("transform",function(){var t=n+20,e=o+40;return"translate("+t+","+e+")"});a.append("rect").classed("rect_1",!0),a.append("rect").classed("rect_2",!0),a.append("rect").classed("rect_3",!0);var i=1.3*e;a.append("text").attr("id","text_1").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),a.append("text").attr("id","text_2").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",function(){return"translate(0,"+String(i)+")"}),a.append("text").attr("id","text_3").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",function(){return"translate(0,"+String(2*i)+")"})}}},function(t,e,r){"use strict";var n=r(11),o=r(205);t.exports=function(t){var e=n(this.config,t);o(this,e)}},function(t,e,r){"use strict";var n=r(11),o=r(205);t.exports=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=r===!1?this:r;var a,i=e.params,s={};_.each(["row","col"],function(e){var r=i.inst_nodes[e+"_nodes"];if(_.has(t,e))if(t[e].length>0){var n=t[e];a=$.grep(r,function(t){return $.inArray(t.name,n)>-1})}else a=r;else a=r;s[e+"_nodes"]=a});var l=e.params.network_data.row_nodes,c=e.params.network_data.col_nodes,u=n(e.config,s);o(e,u),l.length>e.params.inst_nodes.row_nodes.length&&(e.params.inst_nodes.row_nodes=l),c.length>e.params.inst_nodes.col_nodes.length&&(e.params.inst_nodes.col_nodes=c)}},function(t,e,r){"use strict";var n=r(185),o=r(66),a=r(152),i=r(222);t.exports=function(t,e){null!=t.params.cat_update_callback&&t.params.cat_update_callback(this);var r=t.params.viz.cat_colors.col;i(e,t.params.network_data.row_nodes,!0),i(e,t.params.inst_nodes.row_nodes,!0),t.params=o(t.params,!1),n(t,!0),a(t),t.params.new_row_cats=e,t.params.viz.cat_colors.col=r}},function(t,e,r){"use strict";var n=r(185),o=r(66),a=r(152),i=r(222),s=r(254);t.exports=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this,r=s(e),l=e.params.viz.cat_colors.col;if(i(r,e.params.network_data.row_nodes),i(r,e.params.inst_nodes.row_nodes),e.params.new_row_cats=r,e.params.viz.cat_colors.col=l,t){var c=!0;e.params=o(e.params,c),n(e,!0),a(e)}}},function(t,e){"use strict";t.exports=function(t){function e(t,e,o){r={},r.cat_title=t,r.cats=[],n={},n.cat_name=e,n.members=[],n.members.push(o),r.cats.push(n),f.push(r)}var r,n,o,a,i,s,l,c,u=t.config.network_data.row_nodes,d=": ",f=[],p=u[0],h=_.keys(p),v={};_.each(h,function(t){t.indexOf("cat-")>=0&&(s=p[t],c=parseInt(t.split("cat-")[1],10),l=s.indexOf(d)>=0?s.split(d)[0]:t,v[c]=l)});var m,g=_.keys(v).sort();return _.each(g,function(t){m={},m.cat_title=v[t],m.cats=[],f.push(m)}),_.each(u,function(t){var r=_.keys(t);_.each(r,function(r){if(r.indexOf("cat-")>-1){i=t[r],c=parseInt(r.split("cat-")[1],10);var s=r;i=t[r];var l=t[r],u=t.name;l.indexOf(d)>-1?(s=l.split(d)[0],i=l.split(d)[1]):(s=r,i=l),0===f.length?e(s,i,u):(o=!1,_.each(f,function(t){s===t.cat_title&&(o=!0,a=!1,_.each(t.cats,function(t){i===t.cat_name&&(a=!0,t.members.push(u))}),a===!1&&(n={},n.cat_name=i,n.members=[],n.members.push(u),t.cats.push(n)))}))}})}),f}},function(t,e,r){"use strict";var n=r(256),o=r(257);t.exports=function(){var t=n(),e=this.params,r=o(e),a=new Blob([r],{type:"text/plain;charset=utf-8"});t(a,"clustergrammer.txt")}},function(t,e){"use strict";t.exports=function(){/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ +},a.prototype.map=function(t){var e=[];return this.forEach(function(r,n,o){e[n[0]]=t(r,n,o)}),e},a.prototype.toArray=function(){var t=[];return this.forEach(function(e,r){t[r[0]]=e}),t},a.prototype.valueOf=function(){return this.toArray()},a.prototype.format=function(t){var e=o.format(this.start,t);return 1!=this.step&&(e+=":"+o.format(this.step,t)),e+=":"+o.format(this.end,t)},a.prototype.toString=function(){return this.format()},a.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},a.fromJSON=function(t){return new a(t.start,t.end,t.step)},a}var o=r(18);e.name="Range",e.path="type",e.factory=n},function(t,e){"use strict";function r(t,e,r,n){return n("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e){var r=e.map(function(e){return t.isBigNumber(e)?e.toNumber():Array.isArray(e)||t.isMatrix(e)?e.map(function(e){return t.isBigNumber(e)?e.toNumber():e}):e}),n=new t.Index;return t.Index.apply(n,r),n}})}e.name="index",e.factory=r},function(t,e){"use strict";function r(t,e,r,n){var o=t.SparseMatrix,a=n("sparse",{"":function(){return new o([])},string:function(t){return new o([],t)},"Array | Matrix":function(t){return new o(t)},"Array | Matrix, string":function(t,e){return new o(t,e)}});return a.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},a}e.name="sparse",e.factory=r},function(t,e,r){"use strict";function n(t,e,n,i){function s(e,r){var n=l(e),o=n?new t.BigNumber(0):0;if(c(e),r){var i=u(r);return e.length>0?i.resize(e,o):i}var s=[];return e.length>0?a(s,e,o):s}function l(e){var r=!1;return e.forEach(function(e,n,o){t.isBigNumber(e)&&(r=!0,o[n]=e.toNumber())}),r}function c(t){t.forEach(function(t){if("number"!=typeof t||!o(t)||t<0)throw new Error("Parameters in function zeros must be positive integers")})}var u=n(r(43)),d=i("zeros",{"":function(){return"Array"===e.matrix?s([]):s([],"default")},"...number | BigNumber | string":function(t){var r=t[t.length-1];if("string"==typeof r){var n=t.pop();return s(t,n)}return"Array"===e.matrix?s(t):s(t,"default")},Array:s,Matrix:function(t){var e=t.storage();return s(t.valueOf(),e)},"Array | Matrix, string":function(t,e){return s(t.valueOf(),e)}});return d.toTex=void 0,d}var o=r(18).isInteger,a=r(28).resize;e.name="zeros",e.factory=n},function(t,e,r){"use strict";var n=r(2),o=r(5);t.exports=function(t,e,r){var a,i,s=_.keys(r);_.each(s,function(t){a=r[t],/[^a-z_]/i.test(a)&&(a=parseInt(a,10)),i=!1,_.each(e,function(e){n.has(e,t)&&(i=!0)}),i&&(e=_.filter(e,function(e){return e[t]==a}))});var l,c,u=[],d=!1;return _.each(e,function(e){l=!0,_.each(_.keys(t.viz.possible_filters),function(r){c=o(t.viz.filter_data,r),e[r]!=c&&(l=!1)}),l?d===!1&&(d=!0,u.push(e)):u.push(e)}),u}},function(t,e){"use strict";t.exports=function(t){var e={};return e.wrapper={},e.row_search={},e.row_search.box={},e.row_search.box.height=34,e.row_search.box.width=95,e.row_search.placeholder=t.row_search_placeholder,e.row_search.margin_left=7,e.slider={},e.slider.width=t.sidebar_width-30,e.slider.margin_left=15,e.key_cat={},e.key_cat.width=t.sidebar_width-15,e.key_cat.margin_left=5,e.key_cat.max_height=100,e.title=t.title,e.title_margin_left=7,e.about=t.about,e.width=t.sidebar_width,e.buttons={},e.buttons.width=t.sidebar_width-15,e.text={},e.icons=t.sidebar_icons,e.icon_margin_left=-5,e}},function(t,e){"use strict";t.exports=function(t,e){var r=_.keys(e)[0];return _.each(_.keys(t.viz.possible_filters),function(n){if(n!=r&&!d3.select(t.root+" .slider_"+n).empty()){var o=d3.select(t.root+" .slider_"+n).attr("current_state");e[n]=o}}),e}},function(t,e,r){"use strict";var n=r(67),o=r(69),a=r(71),i=r(72),s=r(73),l=r(74),c=r(75),u=r(76),d=r(81),f=r(83),p=r(2),h=r(4),v=r(84);t.exports=function(t){function e(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={};r.root=t.root,r.root_tips=t.root.replace("#",".")+"_d3-tip",r.viz_wrapper=t.root+" .viz_wrapper",r.do_zoom=t.do_zoom,r.background_color=t.background_color,r.super_border_color=t.super_border_color,r.outer_margins=t.outer_margins,r.is_expand=t.ini_expand,r.grey_border_width=t.grey_border_width,r.show_dendrogram=t.show_dendrogram,r.tile_click_hlight=t.tile_click_hlight,r.inst_order=t.inst_order,r.expand_button=t.expand_button,r.sim_mat=t.sim_mat,r.dendro_filter=t.dendro_filter,r.cat_filter=t.cat_filter,r.cat_value_colors=t.cat_value_colors,r.viz_svg=r.viz_wrapper+" .viz_svg",r.zoom_element=r.viz_wrapper+" .viz_svg",r.uni_duration=1e3,r.bottom_space=10,r.run_trans=!1,r.duration=1e3,r.resize=t.resize,p.has(t,"size")?r.fixed_size=t.size:r.fixed_size=!1,r.border_fraction=65,r.uni_margin=5,r.super_labels={},r.super_labels.margin={},r.super_labels.dim={},r.super_labels.margin.left=r.grey_border_width,r.super_labels.margin.top=r.grey_border_width,r.super_labels.dim.width=0,t.labels.super_labels&&(r.super_labels.dim.width=15*t.labels.super_label_scale),r.triangle_opacity=.6,r.norm_labels={},r.norm_labels.width={},r.dendro_room={},r.show_dendrogram?r.dendro_room.symbol_width=10:r.dendro_room.symbol_width=0,r.cat_colors=t.cat_colors,r=v(t,r,e),0==_.has(t,"group_level")&&(r.show_dendrogram&&(t.group_level={}),0==_.has(t,"group_level")&&(t.group_level={}),t.group_level.row=5,t.group_level.col=5),r.dendro_opacity=.35,r.spillover_col_slant=r.norm_labels.width.col;var n=h(t.network_data.views);return r.possible_filters=n.possible_filters,r.filter_data=n.filter_data,r.viz_nodes={},r.viz_nodes.row=t.network_data.row_nodes_names,r.viz_nodes.col=t.network_data.col_nodes_names,r.viz_nodes.curr_row=t.network_data.row_nodes_names,r.viz_nodes.curr_col=t.network_data.col_nodes_names,r.x_offset=0,r}var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.labels=n(t),t.viz=e(t,r),o(t),t=a(t),t.viz=i(t.viz),t.viz=s(t.viz),t.viz=l(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t=c(t),t=u(t),t=d(t),t=f(t)}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e={};return e.super_label_scale=t.super_label_scale,e.super_labels=t.super_labels,e.super_label_fs=13.8,e.super_labels&&(e.super={},e.super.row=t.super.row,e.super.col=t.super.col),e.show_label_tooltips=t.show_label_tooltips,e.row_max_char=n.max(t.network_data.row_nodes,function(t){return t.name.length}).name.length,e.col_max_char=n.max(t.network_data.col_nodes,function(t){return t.name.length}).name.length,e.max_allow_fs=t.max_allow_fs,e}},function(t,e,r){var n,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};(function(){function r(t){function e(e,r,n,o,a,i){for(;a>=0&&a0?0:s-1;return arguments.length<3&&(o=r[i?i[l]:l],l+=t),e(r,n,o,i,l,s)}}function i(t){return function(e,r,n){r=A(r,n);for(var o=O(e),a=t>0?0:o-1;a>=0&&a0?i=a>=0?a:Math.max(a+s,i):s=a>=0?Math.min(a+1,s):a+s+1;else if(r&&a&&s)return a=r(n,o),n[a]===o?a:-1;if(o!==o)return a=e(h.call(n,i,s),z.isNaN),a>=0?a+i:-1;for(a=t>0?i:s-1;a>=0&&a=0&&e<=S};z.each=z.forEach=function(t,e,r){e=k(e,r);var n,o;if(T(t))for(n=0,o=t.length;n=0},z.invoke=function(t,e){var r=h.call(arguments,2),n=z.isFunction(e);return z.map(t,function(t){var o=n?e:t[e];return null==o?o:o.apply(t,r)})},z.pluck=function(t,e){return z.map(t,z.property(e))},z.where=function(t,e){return z.filter(t,z.matcher(e))},z.findWhere=function(t,e){return z.find(t,z.matcher(e))},z.max=function(t,e,r){var n,o,a=-(1/0),i=-(1/0);if(null==e&&null!=t){t=T(t)?t:z.values(t);for(var s=0,l=t.length;sa&&(a=n)}else e=A(e,r),z.each(t,function(t,r,n){o=e(t,r,n),(o>i||o===-(1/0)&&a===-(1/0))&&(a=t,i=o)});return a},z.min=function(t,e,r){var n,o,a=1/0,i=1/0;if(null==e&&null!=t){t=T(t)?t:z.values(t);for(var s=0,l=t.length;sn||void 0===r)return 1;if(re?(i&&(clearTimeout(i),i=null),s=c,a=t.apply(n,o),i||(n=o=null)):i||r.trailing===!1||(i=setTimeout(l,u)),a}},z.debounce=function(t,e,r){var n,o,a,i,s,l=function l(){var c=z.now()-i;c=0?n=setTimeout(l,e-c):(n=null,r||(s=t.apply(a,o),n||(a=o=null)))};return function(){a=this,o=arguments,i=z.now();var c=r&&!n;return n||(n=setTimeout(l,e)),c&&(s=t.apply(a,o),a=o=null),s}},z.wrap=function(t,e){return z.partial(e,t)},z.negate=function(t){return function(){return!t.apply(this,arguments)}},z.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},z.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},z.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},z.once=z.partial(z.before,2);var I=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];z.keys=function(t){if(!z.isObject(t))return[];if(y)return y(t);var e=[];for(var r in t)z.has(t,r)&&e.push(r);return I&&l(t,e),e},z.allKeys=function(t){if(!z.isObject(t))return[];var e=[];for(var r in t)e.push(r);return I&&l(t,e),e},z.values=function(t){for(var e=z.keys(t),r=e.length,n=Array(r),o=0;o":">",'"':""","'":"'","`":"`"},D=z.invert(L),P=function(t){var e=function(e){return t[e]},r="(?:"+z.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(o,e):t}};z.escape=P(L),z.unescape=P(D),z.result=function(t,e,r){var n=null==t?void 0:t[e];return void 0===n&&(n=r),z.isFunction(n)?n.call(t):n};var U=0;z.uniqueId=function(t){var e=++U+"";return t?t+e:e},z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,$={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+$[t]};z.template=function(t,e,r){!e&&r&&(e=r),e=z.defaults({},e,z.templateSettings);var n=RegExp([(e.escape||q).source,(e.interpolate||q).source,(e.evaluate||q).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(n,function(e,r,n,i,s){return a+=t.slice(o,s).replace(H,W),o=s+e.length,r?a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),e}),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var i=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var s=function(t){return i.call(this,t,z)},l=e.variable||"obj";return s.source="function("+l+"){\n"+a+"}",s},z.chain=function(t){var e=z(t);return e._chain=!0,e};var Z=function(t,e){return t._chain?z(e).chain():e};z.mixin=function(t){z.each(z.functions(t),function(e){var r=z[e]=t[e];z.prototype[e]=function(){var t=[this._wrapped];return _.apply(t,arguments),Z(this,r.apply(z,t))}})},z.mixin(z),z.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=d[t];z.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],Z(this,r)}}),z.each(["concat","join","slice"],function(t){var e=d[t];z.prototype[t]=function(){return Z(this,e.apply(this._wrapped,arguments))}}),z.prototype.value=function(){return this._wrapped},z.prototype.valueOf=z.prototype.toJSON=z.prototype.value,z.prototype.toString=function(){return""+this._wrapped},n=[],o=function(){return z}.apply(e,n),!(void 0!==o&&(t.exports=o))}).call(void 0)},function(t,e,r){"use strict";var n=r(70);t.exports=function(t){d3.select(t.root+" .viz_wrapper").empty()&&(d3.select(t.root).append("div").classed("sidebar_wrapper",!0),d3.select(t.root).append("div").classed("viz_wrapper",!0));var e=n(t);d3.select(t.root+" .sidebar_wrapper").style("float","left").style("width",t.sidebar_width+"px").style("height",e.height+"px").style("overflow","hidden"),d3.select(t.viz.viz_wrapper).style("float","left").style("width",e.width+"px").style("height",e.height+"px")}},function(t,e){"use strict";t.exports=function(t){var e,r={},n=t.buffer_width,o=d3.select(t.root).style("width").replace("px",""),a=d3.select(t.root).style("height").replace("px","");return t.viz.is_expand===!1?(e=t.viz.outer_margins,r.width=o-t.sidebar_width-n):(e=t.viz.outer_margins,r.width=o-n),r.top=e.top,r.left=e.left,t.viz.resize?r.height=a:(t.viz.is_expand?r.width=t.viz.fixed_size.width:r.width=t.viz.fixed_size.width-t.sidebar_width,r.height=t.viz.fixed_size.height),r}},function(t,e){"use strict";t.exports=function(t){return t.viz.svg_dim={},t.viz.svg_dim.width=Number(d3.select(t.viz.viz_wrapper).style("width").replace("px","")),t.viz.svg_dim.height=Number(d3.select(t.viz.viz_wrapper).style("height").replace("px","")),t}},function(t,e){"use strict";t.exports=function(t){return t.norm_labels.margin={},t.norm_labels.margin.left=t.super_labels.margin.left+t.super_labels.dim.width,t.norm_labels.margin.top=t.super_labels.margin.top+t.super_labels.dim.width,t.label_background={},t.label_background.row=t.norm_labels.width.row+t.cat_room.row+t.uni_margin,t.label_background.col=t.norm_labels.width.col+t.cat_room.col+t.uni_margin,t}},function(t,e){"use strict";t.exports=function(t){t.clust={},t.clust.margin={},t.clust.margin.left=t.norm_labels.margin.left+t.norm_labels.width.row+t.cat_room.row+t.uni_margin,t.clust.margin.top=t.norm_labels.margin.top+t.norm_labels.width.col+t.cat_room.col+t.uni_margin;var e=t.svg_dim.width-t.clust.margin.left-t.spillover_col_slant,r=d3.scale.ordinal().rangeBands([0,e]).domain(_.range(t.num_col_nodes)),n=r.rangeBand()/2;if(n>t.norm_labels.width.col){var o=t.norm_labels.width.col/n;e*=o}return t.clust.dim={},t.clust.dim.width=e,t}},function(t,e){"use strict";t.exports=function(t){var e=t.svg_dim.height-t.clust.margin.top-t.dendro_room.col-t.bottom_space;return t.clust.dim.height=e,t}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e=Math.abs(n.max(t.network_data.col_nodes,function(t){return Math.abs(t.value)}).value);return t.labels.bar_scale_col=d3.scale.linear().domain([0,e]).range([0,.75*t.viz.norm_labels.width.col]),e=Math.abs(n.max(t.network_data.row_nodes,function(t){return Math.abs(t.value)}).value),t.labels.bar_scale_row=d3.scale.linear().domain([0,e]).range([0,t.viz.norm_labels.width.row]),t}},function(t,e,r){"use strict";var n=r(77),o=r(79);t.exports=function(t){t.matrix=n(t),t.viz.x_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]);var e;return _.each(["row","col"],function(r){e=t.viz.inst_order[r],"custom"===e&&(e="clust"),"row"===r?t.viz.x_scale.domain(t.matrix.orders[e+"_"+r]):t.viz.y_scale.domain(t.matrix.orders[e+"_"+r])}),t.viz.border_width={},t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,o(t),t}},function(t,e,r){"use strict";var n=r(2),o=r(78),a=r(68);t.exports=function(t){var e={},r=t.network_data;e.tile_colors=t.tile_colors,e.bar_colors=t.bar_colors,e.outline_colors=t.outline_colors,e.hlight_color=t.highlight_color,e.tile_title=t.tile_title,e.show_tile_tooltips=t.show_tile_tooltips,e.make_tile_tooltip=t.make_tile_tooltip,e.distance_metric="cosine",e.linkage_type="average",e.click_hlight_x=-666,e.click_hlight_y=-666,e.click_hlight_row=-666,e.click_hlight_col=-666,e.def_large_matrix=1e4,e.opacity_function=t.opacity_scale,e.orders={},_.each(["row","col"],function(o){var a;a="row"===o?"col":"row";var i=r[a+"_nodes"],s=i.length,l=n.pluck(i,"name"),c=l.sort(),u=_.map(c,function(t){return r[a+"_nodes_names"].indexOf(t)});e.orders["alpha_"+o]=u;var d=["clust","rank"];_.has(i[0],"rankvar")&&d.push("rankvar"),t.viz.all_cats[a].length>0&&_.each(t.viz.all_cats[a],function(t){t=t.replace("-","_"),d.push(t+"_index")}),_.each(d,function(t){var r=d3.range(s).sort(function(e,r){return i[r][t]-i[e][t]});e.orders[t+"_"+o]=r})}),n.has(r,"all_links")?e.max_link=a.max(r.all_links,function(t){return Math.abs(t.value)}).value:e.max_link=a.max(r.links,function(t){return Math.abs(t.value)}).value,e.abs_max_val=Math.abs(e.max_link)*t.clamp_opacity,0===t.input_domain?"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,e.abs_max_val]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,e.abs_max_val]).clamp(!0).range([0,1])):"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,t.input_domain]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,t.input_domain]).clamp(!0).range([0,1]));var i=n.has(r.links[0],"value_up"),s=n.has(r.links[0],"value_dn");return i||s?e.tile_type="updn":e.tile_type="simple",n.has(r.links[0],"highlight")?e.highlight=1:e.highlight=0,e.matrix=o(r),e.wait_tooltip=0,e}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t){var e,r,o=[];return r=!!n.has(t.links[0],"value_orig"),t.row_nodes.forEach(function(a,i){o[i]={},o[i].name=t.row_nodes[i].name,o[i].row_index=i,o[i].row_data=d3.range(t.col_nodes.length).map(function(o){return e=n.has(t.links[0],"value_up")||n.has(t.links[0],"value_dn")?{pos_x:o,pos_y:i,value:0,value_up:0,value_dn:0,highlight:0}:{pos_x:o,pos_y:i,value:0,highlight:0},r&&(e.value_orig=0),e})}),t.links.forEach(function(t){o[t.source].row_data[t.target].value=t.value,o[t.source].row_data[t.target].row_name=t.row_name,o[t.source].row_data[t.target].col_name=t.col_name,(n.has(t,"value_up")||n.has(t,"value_dn"))&&(o[t.source].row_data[t.target].value_up=t.value_up,o[t.source].row_data[t.target].value_dn=t.value_dn),r&&(o[t.source].row_data[t.target].value_orig=t.value_orig),t.highlight&&(o[t.source].row_data[t.target].highlight=t.highlight),t.info&&(o[t.source].row_data[t.target].info=t.info)}),o}},function(t,e,r){"use strict";var n=r(80);t.exports=function(t){var e=3,r=2,o=e/t.viz.rect_height,a=2;t.viz.ds_zt=a;var i=Math.floor(Math.log(o)/Math.log(a));if(t.viz.rect_height0){var s=2;t.viz.ds_opacity_scale=d3.scale.linear().domain([1,100]).range([1,s]).clamp(!0);var l;t.viz.ds_num_levels=i,t.viz.ds=[],t.matrix.ds_matrix=[];for(var c=t.viz.inst_order.row,u=$.extend(!0,{},t.matrix.matrix),d=0;dt.labels.max_allow_fs&&(t.labels.default_fs_row=t.labels.max_allow_fs),t.labels.default_fs_col>t.labels.max_allow_fs&&(t.labels.default_fs_col=t.labels.max_allow_fs), +t}},function(t,e,r){"use strict";var n=r(85),o=r(2),a=r(86),i=r(87);t.exports=function(t,e){var r,s,l,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=": ";e.show_categories={},e.all_cats={},e.cat_names={},e.cat_info={};var d={};d.row=null,d.col=null,e.cat_colors={},e.cat_colors.value_opacity=d;var f=0;return _.each(["row","col"],function(n){e.show_categories[n]=!1,e.all_cats[n]=[];var d=_.keys(t.network_data[n+"_nodes"][0]);d=d.sort(),_.each(d,function(t){t.indexOf("cat-")>=0&&(e.show_categories[n]=!0,e.all_cats[n].push(t))}),e.cat_info[n]=null,e.show_categories[n]&&(e.cat_colors[n]={},e.cat_info[n]={},e.cat_names[n]={},_.each(e.all_cats[n],function(c){var d=t.network_data[n+"_nodes"][0];"string"==typeof d[c]&&d[c].indexOf(u)>0?(r=d[c].split(u)[0],e.cat_names[n][c]=r):e.cat_names[n][c]=c;var p=o.pluck(t.network_data[n+"_nodes"],c),h=[];_.each(p,function(t){var e;e=t.indexOf(": ")>0?t.split(": ")[1]:t,h.push(e)});var v=_.uniq(p).sort();if(s=i(v),"cat_strings"===s.type){var m=_.countBy(h);s.cat_hist=m}else s.cat_hist=null;e.cat_info[n][c]=s,e.cat_colors[n][c]={},_.each(v,function(t,r){l=a.get_random_color(r+f),e.cat_colors[n][c][t]=l,"string"==typeof t&&(t.indexOf("Not ")>=0||t.indexOf(": false")>0)&&(e.cat_colors[n][c][t]="#eee"),f+=1})})),_.has(t.network_data,"cat_colors")&&c===!0&&(e.cat_colors[n]=t.network_data.cat_colors[n]),t.sim_mat&&(e.cat_colors.col=e.cat_colors.row)}),e.cat_colors=e.cat_colors,e.cat_colors.opacity=.6,e.cat_colors.active_opacity=.9,e=n(t,e)}},function(t,e){"use strict";t.exports=function(t,e){var r,n=d3.scale.linear().domain([5,15]).range([85,120]).clamp("true");return e.cat_room={},e.cat_room.symbol_width=12,e.cat_room.separation=3,_.each(["row","col"],function(o){e.norm_labels.width[o]=n(t.labels[o+"_max_char"])*t[o+"_label_scale"],e["num_"+o+"_nodes"]=t.network_data[o+"_nodes"].length,"row"===o?e.dendro_room[o]=e.dendro_room.symbol_width:e.dendro_room[o]=e.dendro_room.symbol_width+3*e.uni_margin;var a=e.all_cats[o].length;if(e.show_categories[o]){r=(a-1)*e.cat_room.separation;var i;i="row"===o?a+1:a,e.cat_room[o]=i*e.cat_room.symbol_width+r}else"row"==o?e.cat_room[o]=e.cat_room.symbol_width:e.cat_room[o]=0}),e}},function(t,e){"use strict";function r(){return"#EEE"}function n(t){return a[t%o()]}function o(){return a.length}var a;a=["#393b79","#aec7e8","#ff7f0e","#ffbb78","#98df8a","#bcbd22","#404040","#ff9896","#c5b0d5","#8c564b","#1f77b4","#5254a3","#FFDB58","#c49c94","#e377c2","#7f7f7f","#2ca02c","#9467bd","#dbdb8d","#17becf","#637939","#6b6ecf","#9c9ede","#d62728","#8ca252","#8c6d31","#bd9e39","#e7cb94","#843c39","#ad494a","#d6616b","#7b4173","#a55194","#ce6dbd","#de9ed6"],t.exports={get_default_color:r,get_random_color:n,get_num_colors:o}},function(t,e,r){"use strict";var n=r(68);t.exports=function(t){var e=t[0],r=!1,o=!1,a="cat_strings",i=NaN,s=[],l=null,c=": ";if("string"==typeof e&&e.indexOf(c)>-1&&(r=!0,e=e.split(c)[1]),0==isNaN(e)&&(o=!0),o&&(a="cat_values",_.each(t,function(t){r&&(t=t.split(c)[1]),isNaN(t)===!0?a="cat_strings":(t=parseFloat(t),s.push(t))})),"cat_values"===a){var u=n.max(s,function(t){return Math.abs(t)});i=Math.abs(u),l=d3.scale.linear().domain([0,i]).range([0,1])}var d={};return d.type=a,d.max_abs_val=i,d.cat_scale=l,d}},function(t,e){"use strict";t.exports=function(){var t={};return t.zoom_x=1,t.zoom_y=1,t.trans_x=0,t.trans_y=0,t}},function(t,e,r){"use strict";var n=r(90),o=r(101),a=r(131),i=r(139),s=r(140),l=r(151),c=r(161),u=r(180),d=r(185),f=r(146),p=r(186),h=r(187),v=r(188),m=r(228);t.exports=function(t){function e(){var t=r.viz.super_border_color;return(r.viz.is_expand||0==r.show_viz_border)&&(t="white"),t}var r=t.params;d3.select(r.viz.viz_wrapper+" svg").remove();var g=d3.select(r.viz.viz_wrapper).append("svg").attr("class","viz_svg").attr("id","svg_"+r.root.replace("#","")).attr("width",r.viz.svg_dim.width).attr("height",r.viz.svg_dim.height).attr("is_zoom",0).attr("stopped_zoom",1);g.append("rect").attr("class","super_background").style("width",r.viz.svg_dim.width).style("height",r.viz.svg_dim.height).style("fill","white"),n(r,g),o(t),r.viz.show_dendrogram&&(p(t),h(t),m(t)),a(t),r.viz.ds_level===-1&&_.each(["row","col"],function(t){var e=Number(d3.select("."+t+"_label_group").select("text").style("font-size").replace("px","")),n=8;e>n&&d3.selectAll(r.root+" ."+t+"_label_group").each(function(){f(r,this,t)})}),d(t),r.viz.show_categories.col&&u(t),s(t),r.labels.super_labels&&i(r),r.viz.show_dendrogram&&v(t),d3.select(r.viz.viz_svg).append("rect").classed("left_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.grey_border_width).attr("height",r.viz.svg_dim.height).attr("transform","translate(0,0)"),d3.select(r.viz.viz_svg).append("rect").classed("right_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.grey_border_width).attr("height",r.viz.svg_dim.height).attr("transform",function(){var t=r.viz.svg_dim.width-r.viz.grey_border_width;return"translate("+t+",0)"}),d3.select(r.viz.viz_svg).append("rect").classed("top_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.svg_dim.width).attr("height",r.viz.grey_border_width).attr("transform",function(){var t=0;return"translate("+t+",0)"}),d3.select(r.viz.viz_svg).append("rect").classed("bottom_border",!0).classed("borders",!0).attr("fill",e).attr("width",r.viz.svg_dim.width).attr("height",r.viz.grey_border_width).attr("transform",function(){var t=r.viz.svg_dim.height-r.viz.grey_border_width;return"translate(0,"+t+")"}),l(t),c(t),r.viz.do_zoom&&d3.select(r.viz.zoom_element).call(r.zoom_behavior),d3.select(r.viz.zoom_element).on("dblclick.zoom",null)}},function(t,e,r){"use strict";var n=r(2),o=r(91),a=r(92),i=r(93);t.exports=function(t,e){var r,s=t.network_data,l=[];r=e.append("g").attr("class","clust_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.clust.margin.top+")").append("g").attr("class","clust_group").classed("clust_group",!0),r.append("rect").classed("background",!0).classed("grey_background",!0).style("fill","#eee").style("opacity",.25).attr("width",t.viz.clust.dim.width).attr("height",t.viz.clust.dim.height),null===t.viz.ds?i(t,t.matrix.matrix,"all",t.viz.ds_level):i(t,t.matrix.ds_matrix[0],"all",t.viz.ds_level),"function"==typeof t.click_tile?d3.selectAll(t.root+" .tile").on("click",function(e){var r={};r.row=t.network_data.row_nodes[e.pos_y].name,r.col=t.network_data.col_nodes[e.pos_x].name,r.value=e.value,n.has(e,"value_up")&&(r.value_up=e.value_up),n.has(e,"value_dn")&&(r.value_dn=e.value_dn),n.has(e,"info")&&(r.info=e.info),t.click_tile(r),a(t,this)}):t.tile_click_hlight&&d3.selectAll(t.root+" .tile").on("click",function(){a(t,this)});var c={},u=0;return c.enter=0,o(t,c,u),{get_clust_group:function(){return r},get_matrix:function(){return l},get_nodes:function(t){return"row"===t?s.row_nodes:s.col_nodes}}}},function(t,e){"use strict";t.exports=function(t,e,r){}},function(t,e){"use strict";t.exports=function(t,e){d3.select(e).each(function(r){var n=r.pos_x,o=r.pos_y;if(d3.selectAll(t.root+" .click_hlight").remove(),n!=t.matrix.click_hlight_x||o!=t.matrix.click_hlight_y){t.matrix.click_hlight_x=n,t.matrix.click_hlight_y=o;var a=6,i=.85,s=a*t.viz.border_width.x,l=a*t.viz.border_width.y;d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("top_hlight",!0).attr("width",t.viz.x_scale.rangeBand()).attr("height",l).attr("fill",t.matrix.hlight_color).attr("transform",function(){return"translate("+t.viz.x_scale(n)+",0)"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("left_hlight",!0).attr("width",s).attr("height",t.viz.y_scale.rangeBand()-.99*l).attr("fill",t.matrix.hlight_color).attr("transform",function(){return"translate("+t.viz.x_scale(n)+","+.99*l+")"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("right_hlight",!0).attr("width",s).attr("height",t.viz.y_scale.rangeBand()-.99*l).attr("fill",t.matrix.hlight_color).attr("transform",function(){var e=t.viz.x_scale(n)+t.viz.x_scale.rangeBand()-s;return"translate("+e+","+.99*l+")"}).attr("opacity",i),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("bottom_hlight",!0).attr("width",function(){return t.viz.x_scale.rangeBand()-1.98*s}).attr("height",l).attr("fill",t.matrix.hlight_color).attr("transform",function(){var e=t.viz.x_scale(n)+.99*s,r=t.viz.y_scale.rangeBand()-l;return"translate("+e+","+r+")"}).attr("opacity",i)}else t.matrix.click_hlight_x=-666,t.matrix.click_hlight_y=-666})}},function(t,e,r){"use strict";var n=r(94),o=r(100),a=r(68);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=t.viz.y_scale,l=!0,c="row";if(i>=0&&(s=t.viz.ds[i].y_scale,l=!1,c="ds"+String(i)+"_row"),l)var u=o().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip "+e+"_tile_tip";return r}).style("display","none").direction("nw").offset([0,0]).html(function(e){var r,n=String(e.value.toFixed(3));if(t.keep_orig){var o=String(e.value_orig.toFixed(3));r="

"+e.row_name+" and "+e.col_name+"

normalized value: "+n+"

original value: "+o+"
"}else r="

"+e.row_name+" and "+e.col_name+"

value: "+n+"
";return r});else u=null;var d=[];"all"===r?d=e:_.each(e,function(t){a.contains(r,t.name)&&d.push(t)}),d3.select(t.root+" .clust_group").selectAll(".row").data(d,function(t){return t.name}).enter().append("g").classed(c,!0).attr("transform",function(t){return"translate(0,"+s(t.row_index)+")"}).each(function(e){n(t,e,u,this,i)}),t.viz.ds_level===-1&&null!=u&&d3.selectAll(t.root+" .row").call(u)}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99);t.exports=function(t,e,r,l){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,u=e.row_data,d=!0,f=t.viz.rect_height;c>=0&&(f=t.viz.ds[c].rect_height);var p;p=!!_.has(t.network_data.links[0],"value_orig");var h;h=p===!1?_.filter(u,function(t){return 0!==t.value}):u;var v=d3.select(l).selectAll("rect").data(h,function(t){return t.col_name}).enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",f).style("fill",function(e){var r;return r="NaN"===e.value_orig?"#000000":e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).style("fill-opacity",function(e){var r;return r="NaN"===e.value_orig?.175:t.matrix.opacity_scale(Math.abs(e.value))}).attr("transform",function(e){return s(t,e)});if(d&&v.on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r}).on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&(r=t.matrix.opacity_scale(Math.abs(e.value_dn))),r}).on("mouseover",function(){for(var e=arguments.length,n=Array(e),o=0;o0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}t.matrix.tile_title&&v.append("title").text(function(t){var e="value: "+t.value;return e})}},function(t,e){"use strict";t.exports=function(t){var e=0,r=t.viz.x_scale.rangeBand()-t.viz.border_width.x,n=0,o=t.viz.y_scale.rangeBand()-t.viz.border_width.y,a="M"+e+","+n+", L"+e+", "+o+", L"+r+",0 Z";return a}},function(t,e){"use strict";t.exports=function(t){var e=0,r=t.viz.x_scale.rangeBand()-t.viz.border_width.x,n=t.viz.y_scale.rangeBand()-t.viz.border_width.y,o=t.viz.y_scale.rangeBand()-t.viz.border_width.y,a="M"+e+", "+n+" , L"+r+", "+o+", L"+r+",0 Z";return a}},function(t,e){"use strict";t.exports=function(t,e,r,n){function o(){if(d3.select(e).classed("hovering")){var n=Number(d3.select(t.root+" .viz_svg").attr("is_zoom"));if(0===n&&t.matrix.show_tile_tooltips&&null!==r&&(d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","block"),r.show.apply(e,s),null!=t.tile_tip_callback)){var o=s[0];t.tile_tip_callback(o)}}}var a,i=n[0],s=[].slice.call(n),l=1e3;d3.select(e).classed("hovering",!0),_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight",function(t){var r,n=i[e+"_name"].replace(/_/g," ")===t.name;return r=n?"bold":"normal"})}),s.push(e),clearTimeout(a),a=setTimeout(o,l,e)}},function(t,e){"use strict";t.exports=function(t,e,r){d3.select(e).classed("hovering",!1),d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","none"),_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight","normal")}),null!=r&&r.hide()}},function(t,e){"use strict";t.exports=function(t,e){var r;r=e.pos_x in t.viz.x_scale.domain()?t.viz.x_scale(e.pos_x):0;var n=r+.5*t.viz.border_width.x,o=.5*t.viz.border_width.y;return"translate("+n+","+o+")"}},function(t,e){"use strict";t.exports=function(){function t(t){b=_(t),z=b.createSVGPoint(),document.body.appendChild(x)}function e(){return"n"}function r(){return[0,0]}function n(){return" "}function o(){var t=h();return{top:t.s.y,left:t.s.x}}function a(){var t=h();return{top:t.n.y-x.offsetHeight,left:t.n.x-x.offsetWidth/2}}function i(){var t=h();return{top:t.s.y,left:t.s.x-x.offsetWidth/2}}function s(){var t=h();return{top:t.e.y-x.offsetHeight/2,left:t.e.x}}function l(){var t=h();return{top:t.w.y-x.offsetHeight/2,left:t.w.x-x.offsetWidth}}function c(){var t=h();return{top:t.nw.y-x.offsetHeight,left:t.nw.x-x.offsetWidth}}function u(){var t=h();return{top:t.ne.y-x.offsetHeight,left:t.ne.x}}function d(){var t=h();return{top:t.sw.y,left:t.sw.x-x.offsetWidth}}function f(){var t=h();return{top:t.se.y,left:t.e.x}}function p(){var t=d3.select(document.createElement("div"));return t.style({position:"absolute",opacity:0,pointerEvents:"none",boxSizing:"border-box"}),t.node()}function _(t){return t=t.node(),"svg"==t.tagName.toLowerCase()?t:t.ownerSVGElement}function h(){var t=k||d3.event.target,e={},r=t.getScreenCTM(),n=t.getBBox(),o=n.width,a=n.height,i=n.x,s=n.y,l=document.documentElement.scrollTop||document.body.scrollTop,c=document.documentElement.scrollLeft||document.body.scrollLeft;return r.a=1,r.d=1,r.e=r.e+c,r.f=r.f+l,z.x=i,z.y=s,e.nw=z.matrixTransform(r),z.x=z.x+o,e.ne=z.matrixTransform(r),z.y=z.y+a,e.se=z.matrixTransform(r),z.x=z.x-o,e.sw=z.matrixTransform(r),z.y=z.y-a/2,e.w=z.matrixTransform(r),z.x=z.x+o,e.e=z.matrixTransform(r),z.x=z.x-o/2,z.y=z.y-a/2,e.n=z.matrixTransform(r),z.y=z.y+a,e.s=z.matrixTransform(r),e}function v(t){var e=d3.select(t).classed("hovering");e&&d3.selectAll(".d3-tip").transition().duration(250).style("opacity",0).style("display","none")}function m(t){var e={};return t&&"[object Function]"===e.toString.call(t)}var g=e,y=r,w=n,x=p(),b=null,z=null,k=null;t.show=function(){var e=Array.prototype.slice.call(arguments);e[e.length-1]instanceof SVGElement&&(k=e.pop());var r,n=w.apply(this,e),o=y.apply(this,e),a=g.apply(this,e),i=d3.select(x),s=0;for(i.html(n).style({opacity:1,"pointer-events":"all"}).style("z-index",99);s--;)i.classed(E[s],!1);if(r=A.get(a).apply(this),i.classed(a,!0).style({top:r.top+o[0]+"px",left:r.left+o[1]+"px"}),m(this)===!1){var l=d3.select(this).attr("class");l.indexOf("tile")>=0&&setTimeout(v,5e3,this)}return t},t.hide=function(){var e=d3.select(x);return e.style({opacity:0,"pointer-events":"none"}),t},t.attr=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(x).attr(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d3.select(x),r),t},t.style=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(x).style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d3.select(x),r),t},t.direction=function(e){return arguments.length?(g=null==e?e:d3.functor(e),t):g},t.offset=function(e){return arguments.length?(y=null==e?e:d3.functor(e),t):y},t.html=function(e){return arguments.length?(w=null==e?e:d3.functor(e),t):w};var A=d3.map({n:a,s:i,e:s,w:l,nw:c,ne:u,sw:d,se:f,south_custom:o}),E=A.keys();return t}},function(t,e,r){"use strict";var n=r(102);t.exports=function(t,e){var r,o=t.params;r=d3.select(o.viz.viz_svg+" .row_container").empty()?d3.select(o.viz.viz_svg).append("g").classed("row_container",!0).attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"):d3.select(o.viz.viz_svg).select(".row_container").attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"),d3.select(o.root+" .row_white_background").empty()&&r.append("rect").classed("row_white_background",!0).classed("white_bars",!0).attr("fill",o.viz.background_color).attr("width",o.viz.label_background.row).attr("height",30*o.viz.clust.dim.height+"px"),d3.select(o.root+" .row_label_container").empty()?r.append("g").classed("row_label_container",!0).attr("transform","translate("+o.viz.norm_labels.width.row+",0)").append("g").classed("row_label_zoom_container",!0):r.select(o.root+" .row_label_container").attr("transform","translate("+o.viz.norm_labels.width.row+",0)"),o.viz.ds_level===-1&&n(t,"all",e)}},function(t,e,r){"use strict";var n=r(2),o=r(103),a=r(104),i=r(130),s=r(68);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=t.params,c=[];"all"===e?c=l.network_data.row_nodes:_.each(l.network_data.row_nodes,function(t){s.contains(e,t.name)&&c.push(t)});var u=d3.select(l.root+" .row_label_zoom_container").selectAll("g").data(c,function(t){return t.name}).enter().append("g").classed("row_label_group",!0),d=l.network_data.row_nodes_names;u.attr("transform",function(t){var e=_.indexOf(d,t.name);return"translate(0,"+l.viz.y_scale(e)+")"}),u.on("dblclick",function(e){var r="__data__",n=this[r].name;a(t,this,n),l.tile_click_hlight&&o(this,e.ini)}),i(l),u.insert("rect").style("opacity",0),u.append("text").attr("y",.5*l.viz.rect_height+.35*l.labels.default_fs_row).attr("text-anchor","end").style("font-size",l.labels.default_fs_row+"px").text(function(t){return n.normal_name(t)}).attr("pointer-events","none").style("opacity",0).style("cursor","default").transition().delay(r).duration(r).style("opacity",1),u.each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",l.viz.y_scale.rangeBand()).style("fill",function(){var t="yellow";return t}).style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),n.has(l.network_data.row_nodes[0],"value")&&u.append("rect").classed("row_bars",!0).attr("width",function(t){var e=0;return e=l.labels.bar_scale_row(Math.abs(t.value))}).attr("x",function(t){var e=0;return e=-l.labels.bar_scale_row(Math.abs(t.value))}).attr("height",l.viz.y_scale.rangeBand()).attr("fill",function(t){return t.value>0?l.matrix.bar_colors[0]:l.matrix.bar_colors[1]}).attr("opacity",.4)}},function(t,e){"use strict";t.exports=function(t,e,r){if(r!=t.click_hlight_row){var n=6,o=.85,a=n*t.viz.border_width.x;d3.selectAll(t.root+" .click_hlight").remove(),d3.select(e).append("rect").classed("click_hlight",!0).classed("row_top_hlight",!0).attr("width",t.viz.svg_dim.width).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o),d3.select(e).append("rect").classed("click_hlight",!0).classed("row_bottom_hlight",!0).attr("width",t.viz.svg_dim.width).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=t.viz.y_scale.rangeBand()-a;return"translate(0,"+e+")"})}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_row=-666}},function(t,e,r){"use strict";var n=r(105),o=r(106),a=r(88),i=r(129),s=r(79);t.exports=function(t,e,r){var l=t.params,c=i(l);if(1===c.zoom_y&&1===c.zoom_x){l.viz.inst_order.row="custom",o(t,"col"),d3.selectAll(l.root+" .toggle_col_order .btn").classed("active",!1),l.viz.run_trans=!0;var u=$.extend(!0,{},l.matrix.matrix),d=l.network_data.row_nodes,f=l.network_data.col_nodes,p=[];d.forEach(function(t){p.push(t.name)}),r=_.indexOf(p,r),p=[],f.forEach(function(t,e){p.push(u[r].row_data[e].value)});var h=d3.range(p.length).sort(function(t,e){return p[e]-p[t]});l.viz.x_scale.domain(h),l.matrix.orders.custom_row=h;var v;v=l.network_data.links.length>l.matrix.def_large_matrix?d3.select(l.root+" .viz_svg"):d3.select(l.root+" .viz_svg").transition().duration(2500);var m=l.network_data.col_nodes_names;v.select(".col_zoom_container").selectAll(".col_label_text").attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate("+l.viz.x_scale(e)+")rotate(-90)"}),v.selectAll(".col_cat_group").attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate("+l.viz.x_scale(e)+",0)"}),l.viz.ds_level===-1&&(v.selectAll(".tile").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),v.selectAll(".tile_up").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),v.selectAll(".tile_dn").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"})),d3.selectAll(l.root+" .row_label_group").select("rect").style("opacity",0),d3.select(e).select("rect").style("opacity",1),n(l),l.network_data.links.forEach(function(t){t.x=l.viz.x_scale(t.target),t.y=l.viz.y_scale(t.source)}),l.zoom_info=a(),setTimeout(function(){l.viz.run_trans=!1},2500),l.viz.ds_num_levels>0&&l.viz.ds_level>=0&&s(l)}}},function(t,e){"use strict";t.exports=function(t){var e=6,r=e*t.viz.border_width.x,n=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.x_scale.rangeBand()).attr("height",n).transition().duration(2500).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+",0)"}),d3.select(t.root+" .left_hlight").attr("width",r).attr("height",t.viz.y_scale.rangeBand()-.99*n).transition().duration(2500).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*n+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.y_scale.rangeBand()-.99*n).transition().duration(2500).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.x_scale.rangeBand()-r;return"translate("+e+","+.99*n+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.x_scale.rangeBand()-1.98*r}).attr("height",n).transition().duration(2500).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,o=t.viz.y_scale.rangeBand()-n;return"translate("+e+","+o+")"})}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500,o=t.params;"row"===e&&"clust"===o.viz.inst_order.col&&setTimeout(n,r,t,"row",!0),"col"===e&&"clust"===o.viz.inst_order.row&&setTimeout(n,r,t,"col",!0),"clust"!=o.viz.inst_order.row&&o.viz.dendro_filter.col===!1&&(d3.selectAll(o.root+" .col_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null),d3.select(o.root+" .col_slider_group").style("opacity",0),d3.selectAll(o.root+" .col_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null)),"clust"!=o.viz.inst_order.col&&o.viz.dendro_filter.row===!1&&(d3.selectAll(o.root+" .row_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null).on("click",null),d3.select(o.root+" .row_slider_group").style("opacity",0),d3.selectAll(o.root+" .row_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null))}},function(t,e,r){"use strict";var n=r(108),o=r(109),a=r(110),i=r(100),s=r(112),l=r(115);t.exports=function(t,e){function r(t,r,n){if(d3.select(t).classed("hovering")){var o=u.viz.root_tips+"_"+e+"_dendro_tip";d3.select(o+" .cat_graph").empty()&&null!==u.viz.cat_info[e]&&l(u,e,r,f[n],o,!0),d3.selectAll(u.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",1)}}var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=t.params;"both"===e&&(e="row");var d;d="row"===e?"col":"row","clust"===u.viz.inst_order[d]&&d3.select(u.root+" ."+e+"_slider_group").style("opacity",1);var f;u.viz.show_dendrogram&&(f="row"===e?n(u):o(u),d3.select(t.params.root+" ."+e+"_dendro_crop_buttons").empty()===!1&&s(t,e));var p=u.viz.dendro_opacity,_=500;d3.selectAll(t.params.viz.root_tips+"_"+e+"_dendro_tip").remove();var h;d3.selectAll(u.root+" ."+e+"_dendro_group").empty()?h=!1:(h=!0,d3.selectAll(u.root+" ."+e+"_dendro_group").remove());var v=0,m=-5,g=i().attr("class",function(){var t=u.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_tip";return r}).direction("nw").offset([v,m]).style("display","none").style("opacity",0);g.html(function(){var t='
Click for cluster information
and additional options.';return t}),c&&(h=!1);var y,w,x,b,z,k,A=d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").data(f,function(t){return t.name}).enter().append("path").style("opacity",0).attr("class",e+"_dendro_group").style("fill","black");A.attr("d",function(t){"row"===e?(y=0,w=t.pos_top,x=30,b=t.pos_mid,z=0,k=t.pos_bot):(y=t.pos_top,w=0,x=t.pos_mid,b=30,z=t.pos_bot,k=0);var r="M"+y+","+w+", L"+x+", "+b+", L"+z+","+k+" Z";return r}),A.on("mouseover",function(n,o){d3.select(this).classed("hovering",!0),null!=t.params.dendro_callback&&t.params.dendro_callback(this),d3.select(u.viz.root_tips+"_"+e+"_dendro_tip").style("display","block"),a(u,this,n,e),g.show(n),d3.select(u.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",0),setTimeout(r,_,this,n,o)}).on("mouseout",function(){"clust"===u.viz.inst_order[d]&&d3.select(this).style("opacity",p),d3.selectAll(u.root+" .dendro_shadow").remove(),d3.select(this).classed("hovering",!1),g.hide(this)}).on("click",function(r,n){$(u.root+" .dendro_info").modal("toggle");var o=r.all_names.join(", ");d3.select(u.root+" .dendro_info input").attr("value",o);var a=u.root+" .dendro_info";d3.selectAll(".dendro_info .cluster_info_container .cat_graph").remove(),null!==u.viz.cat_info[e]&&l(u,e,r,f[n],a),null!=t.params.dendro_click_callback&&t.params.dendro_click_callback(this)}).call(g);var E;E="clust"===u.viz.inst_order[d]?p:0,h?d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").transition().delay(1e3).duration(1e3).style("opacity",E):d3.select(u.root+" ."+e+"_dendro_container").selectAll("path").style("opacity",E)}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.row,n=t.network_data.row_nodes,o=t.network_data.row_nodes_names;_.each(n,function(n){var a=n.group[r],i=_.indexOf(o,n.name),s=t.viz.y_scale(i),l=s+t.viz.y_scale.rangeBand();_.has(e,a)===!1&&(e[a]={},e[a].name_top=n.name,e[a].name_bot=n.name,e[a].pos_top=s,e[a].pos_bot=l,e[a].pos_mid=(s+l)/2,e[a].name=a,e[a].all_names=[],e[a].inst_rc="row"),e[a].all_names.push(n.name),se[a].pos_bot&&(e[a].name_bot=n.name,e[a].pos_bot=l,e[a].pos_mid=(e[a].pos_top+l)/2)});var a=[];return _.each(e,function(t){a.push(t)}),a}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.col,n=t.network_data.col_nodes,o=t.network_data.col_nodes_names;_.each(n,function(n){var a=n.group[r],i=_.indexOf(o,n.name),s=t.viz.x_scale(i),l=s+t.viz.x_scale.rangeBand();_.has(e,a)===!1&&(e[a]={},e[a].name_top=n.name,e[a].name_bot=n.name,e[a].pos_top=s,e[a].pos_bot=l,e[a].pos_mid=(s+l)/2,e[a].name=a,e[a].all_names=[],e[a].inst_rc="col"),e[a].all_names.push(n.name),se[a].pos_bot&&(e[a].name_bot=n.name,e[a].pos_bot=l,e[a].pos_mid=(e[a].pos_top+l)/2)});var a=[];return _.each(e,function(t){a.push(t)}),a}},function(t,e,r){"use strict";var n=r(111);t.exports=function(t,e,r,o){function a(){d3.select(e).classed("hovering")&&t.is_slider_drag===!1&&(d3.select(e).style("opacity",.7),d3.select(t.viz.viz_svg).classed("running_update")===!1&&i())}function i(){"row"===o?"clust"===t.viz.inst_order.col&&n(t,e,o,r):"col"===o?"clust"===t.viz.inst_order.row&&n(t,e,o,r):"both"===o&&("clust"===t.viz.inst_order.col&&n(t,e,"row",r),"clust"===t.viz.inst_order.row&&n(t,e,"col",r))}d3.selectAll(t.root+" ."+o+"_dendro_crop_buttons")[0].length>1?setTimeout(a,500):d3.selectAll(t.root+" .dendro_shadow").remove()}},function(t,e){"use strict";t.exports=function(t,e,r,n){var o,a=.2;d3.selectAll(t.root+" .dendro_shadow").remove(),"row"==r?(d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",n.pos_top+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.height-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",o+"px").attr("transform","translate(0,"+n.pos_bot+")").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a)):"col"===r&&(d3.select(t.root+" .clust_group").append("rect").attr("width",n.pos_top+"px").attr("height",t.viz.clust.dim.height+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.width-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",o+"px").attr("height",t.viz.clust.dim.height+"px").attr("transform","translate("+n.pos_bot+",0)").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a))}},function(t,e,r){"use strict";var n=r(108),o=r(109),a=r(100),i=r(110),s=r(113),l=r(114);t.exports=function(t,e){function r(t){d3.select(t).classed("hovering")&&d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_crop_tip").style("opacity",1).style("display","block")}var c,u,d=t.params,f=.6*d.viz.dendro_opacity;"row"===e?(c=n(d),u="col"):(c=o(d),u="row");var p=5,_=-5,h=a().attr("class",function(){var t=d.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_crop_tip";return r}).direction("nw").style("display","none").offset([p,_]),v=500;d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_crop_tip").remove(),d3.selectAll(d.root+" ."+e+"_dendro_crop_buttons").remove();var m,g,y,w,x,b,z,k,A,E,N=45,M=.25,S=e+"_dendro_crop_buttons";d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter")===!1?(m=d3.select(d.root+" ."+e+"_dendro_icons_group").selectAll("path").data(c,function(t){return t.name}).enter().append("path").classed(S,!0).attr("d",function(t){k=10,A=10;var r=t.pos_bot-t.pos_top;"row"===e?(r5&&void 0!==arguments[5]&&arguments[5];"both"===e&&(e="row");var s=n(t,r,e);if(s.length>0){var l=d3.select(a+" .cluster_info_container"),c=": ",u="

",d=370,f=23,p=20,h=25,v=180,m=27,g=177,y=4,w=5,x=150,b=6,z=!1;null!=s[0].bar_data[0][w]&&(d+=100,g=g+x-47,z=!0);var k=o.all_names.length,A=y;if(z){A=w;var E=s[0].bar_data;k=0,_.each(E,function(t){k+=t[w]})}var N=3,M=25,S=20;_.each(s.slice(0,N),function(t){var e=t.bar_data.length;e>M&&(e=M),S+=m*(e+1)}),i&&l.append("text").text("Cluster Information");var O=l.append("div").style("margin-top","5px").classed("cat_graph",!0).append("svg").style("height",S+"px").style("width",d+"px");O.append("rect").classed("cat_background",!0).attr("height",S+"px").attr("width",d+"px").attr("fill","white").attr("opacity",1);var T=m;if(s=s.slice(0,N),_.each(s,function(e){var r=e.bar_data[0][A],n=d3.scale.linear().domain([0,1e5]).range([20,30]);e.bar_data=e.bar_data.slice(0,M),l.style("margin-bottom","5px");var o=O.append("g").classed("cat_graph_group",!0).attr("transform","translate(10, "+T+")");T+=m*(e.bar_data.length+1);var a=e.type_name;a.length>=h&&(a=a.slice(0,h)+".."),o.append("text").classed("cat_graph_title",!0).text(a).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",800);var i=n(r);o.append("text").text("Count").attr("transform",function(){var t=v+i,e="translate("+t+", 0)";return e}),o.append("text").text("Pct").attr("transform",function(){var t=v+i+60,e="translate("+t+", 0)";return e}),o.append("text").text("P-val").attr("transform",function(){var t=v+i+115,e="translate("+t+", 0)";return e}),z&&o.append("text").text("Clusters").attr("transform",function(){var t=v+x,e="translate("+t+", 0)";return e});var s=4;o.append("line").attr("x1",0).attr("x2",v).attr("y1",s).attr("y2",s).attr("stroke","blue").attr("stroke-width",1).attr("opacity",1);var d=o.append("g").classed("cat_bar_container",!0).attr("transform","translate(0, 10)"),_=d.selectAll("g").data(e.bar_data).enter().append("g").attr("transform",function(t,e){var r=e*f;return"translate(0,"+r+")"}),g=d3.scale.linear().domain([0,r]).range([0,v]);_.append("rect").attr("height",p+"px").attr("width",function(t){var e=g(t[A]);return e+"px"}).attr("fill",function(t){return t[3]}).attr("opacity",t.viz.cat_colors.opacity).attr("stroke","grey").attr("stroke-width","0.5px"),_.append("text").classed("bar_labels",!0).text(function(t){var e=t[1];return e.indexOf(c)>0&&(e=e.split(c)[1]),e.indexOf(u)>0&&(e=e.split(u)[0]),e.length>=h&&(e=e.slice(0,h)+".."),e}).attr("transform",function(){return"translate(5, "+.75*p+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","right");var w=35;_.append("text").classed("count_labels",!0).text(function(t){var e=t[A];return e=e.toLocaleString(),String(e)}).attr("transform",function(){var t=v+i+w,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),_.append("text").classed("count_labels",!0).text(function(t){var e=t[A]/k*100;return e=Math.round(10*e)/10,e=e.toLocaleString(),String(e)}).attr("transform",function(){var t=v+i+w+47,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),_.append("text").classed("count_labels",!0).text(function(t){var e=t[b];return e<.001?(e=parseFloat(e.toPrecision(3)),e=e.toExponential()):e=parseFloat(e.toPrecision(2)),e}).attr("transform",function(){var t=v+i+w+112,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),z&&_.append("text").classed("count_labels",!0).text(function(t){return String(t[y].toLocaleString())}).attr("transform",function(){var t=v+w+x+20,e=.75*p;return"translate("+t+", "+e+")"}).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end")}),i){var C=d3.select(a),B=C.style("top").split(".px")[0],F=C.style("left").split(".px")[0],I=0,j=0;"row"===e?(I=0,j=g):(I=S+32,j=30),C.style("top",function(){var t=String(parseInt(B,10)-I)+"px";return t}).style("left",function(){var t=String(parseInt(F,10)-j)+"px";return t})}}}},function(t,e,r){"use strict";var n=r(117);t.exports=function(t,e,r){"both"===r&&(r="row");var o,a=e.all_names,i=[],s=t.network_data[r+"_nodes"],l=null,c=!1;_.each(s,function(t){o=t.name,a.indexOf(o)>=0&&i.push(t)});var u=[];if(null!==t.viz.cat_info[r]){for(var d,f,p,h=t.viz.cat_info[r],v=_.keys(h),m=[],g=[],y=0;y0){var E,N=a.length;_.each(m,function(e){if(f=e.split("-")[1],d=g[f],A)if(e.indexOf("-")>=0){var o=parseInt(e.split("-")[1],z)+1;d="Category "+String(o)}else d="Category";x[d]={},_.each(i,function(t){E=t[e],E.indexOf(": ")>=0&&(E=E.split(": ")[1]),E in x[d]?(x[d][E].num_nodes=x[d][E].num_nodes+1,null!=l&&(x[d][E].num_nodes_ds=x[d][E].num_nodes_ds+parseInt(t[l].split(": ")[1],z))):(x[d][E]={},x[d][E].num_nodes=1,null!=l&&(x[d][E].num_nodes_ds=parseInt(t[l].split(": ")[1],z)))}),b={},b.type_name=d,b.num_in_clust=N,w=[];var a,s,c=x[d];for(var p in c){var h=t.viz.cat_info[r][e].cat_hist[p],v=t.network_data[r+"_nodes"].length,m=h/v;s=A?p:d+": "+p;var y=c[p].num_nodes,M=y,S=n(M,N,m);if(_.has(c[p],"num_nodes_ds"))var O=c[p].num_nodes_ds;else O=null;a=t.viz.cat_colors[r][e][s],w.push([e,s,c[p],a,y,O,S])}w.sort(function(t,e){return e[k]-t[k]}),b.bar_data=w,u.push(b)})}}return u}},function(t,e,r){"use strict";var n=r(118),o=r(12),a=o.create();a.import(r(119)),t.exports=function(t,e,r){function o(t,e,r){var n=c(e)/(c(t)*c(e-t));return r=n*(Math.pow(r,t)*Math.pow(1-r,e-t))}function i(t,e,r){for(var n,a,i=0,s=t;s1;)a=a.times(i),i--;return new t.BigNumber(a.toPrecision(t.BigNumber.precision))}var u=n(r(122)),d=n(r(125)),f=l("gamma",{number:function(t){var e,r;if(a(t)){if(t<=0)return isFinite(t)?1/0:NaN;if(t>171)return 1/0;for(var n=t-2,o=t-1;n>1;)o*=n,n--;return 0==o&&(o=1),o}if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*f(1-t));if(t>=171.35)return 1/0;if(t>85){var l=t*t,c=l*t,u=c*t,d=u*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*l)-139/(51840*c)-571/(2488320*u)+163879/(209018880*d)+5246819/(75246796800*d*t))}--t,r=s[0];for(var p=1;pN)for(var S=0,O=0;O1&&n===-(1/0)?0:e.predictable&&(r<-1&&n===1/0||r>-1&&r<0&&n===-(1/0))?NaN:o(n)||r>=0||e.predictable?Math.pow(r,n):new t.Complex(r,0).pow(n,0)}function l(t,e){if(!o(e)||e<0)throw new TypeError("For A^b, b must be a positive integer (value is "+e+")");var r=a(t);if(2!=r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!=r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");for(var n=d(r[0]).valueOf(),i=t;e>=1;)1==(1&e)&&(n=f(i,n)),e>>=1,i=f(i,i);return n}function c(t,e){return p(l(t.valueOf(),e))}var u=r(45),d=n(r(126)),f=n(r(122)),p=n(r(43)),_=n(r(127)),h=n(r(128)),v=i("pow",{"number, number":s,"Complex, Complex":function(t,e){return t.pow(e)},"BigNumber, BigNumber":function(r,n){return n.isInteger()||r>=0||e.predictable?r.pow(n):new t.Complex(r.toNumber(),0).pow(n.toNumber(),0)},"Fraction, Fraction":function(t,r){if(1!==r.d){if(e.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return s(t.valueOf(),r.valueOf())}return t.pow(r)},"Array, number":l,"Array, BigNumber":function(t,e){return l(t,e.toNumber())},"Matrix, number":c,"Matrix, BigNumber":function(t,e){return c(t,e.toNumber())},"Unit, number":function(t,e){return t.pow(e)}});return v.toTex={2:"\\left(${args[0]}\\right)"+u.operators.pow+"{${args[1]}}"},v}var o=r(18).isInteger,a=r(28).size;e.name="pow",e.factory=n},function(t,e,r){"use strict";function n(t,e,n,i){function s(t,e){switch(t.length){case 0:return e?c(e):[];case 1:return l(t[0],t[0],e);case 2:return l(t[0],t[1],e);default:throw new Error("Vector containing two values expected")}}function l(e,r,n){var i=t.isBigNumber(e)||t.isBigNumber(r)?t.BigNumber:null;if(t.isBigNumber(e)&&(e=e.toNumber()),t.isBigNumber(r)&&(r=r.toNumber()),!a(e)||e<1)throw new Error("Parameters in function eye must be positive integers");if(!a(r)||r<1)throw new Error("Parameters in function eye must be positive integers");var s=i?new t.BigNumber(1):1,l=i?new i(0):0,c=[e,r];if(n){var u=t.Matrix.storage(n);return u.diagonal(c,s,0,l)}for(var d=o.resize([],c,l),f=e0?(e.zoom_x=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[0]),e.zoom_y=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[1])):(e.zoom_x=1,e.zoom_y=1),e}},function(t,e,r){"use strict";var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_row_tip").remove();var e=t.viz.root_tips.replace(".",""),r=n().attr("class",function(){var t=e+" d3-tip "+e+"_row_tip";return t}).direction("e").offset([0,10]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return""+e+""});d3.select(t.viz.viz_wrapper).select(t.root+" .row_container").call(r),d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",function(e){d3.select(t.viz.root_tips+"_row_tip").classed(e.name,!0),d3.selectAll(t.viz.root_tips+"_row_tip").style("display","block"),d3.select(this).select("text").classed("active",!0),r.show(e),null!=t.row_tip_callback&&t.row_tip_callback(t.viz.root_tips,e)}).on("mouseout",function(e){d3.selectAll(t.viz.root_tips+"_row_tip").style("display","none").classed(e.name,!1),d3.select(this).select("text").classed("active",!1),r.hide(e)})}else d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",function(){d3.select(this).select("text").classed("active",!0)}).on("mouseout",function(){d3.select(this).select("text").classed("active",!1)})}},function(t,e,r){"use strict";var n=r(2),o=r(132),a=r(133),i=r(104),s=r(137),l=r(138); +t.exports=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=t.params,u=c.network_data.col_nodes,d=c.viz.x_scale.rangeBand()/2+c.viz.border_width.x;d3.select(c.root+" .col_container").empty()?(e=d3.select(c.viz.viz_svg).append("g").attr("class","col_container").attr("transform","translate("+c.viz.clust.margin.left+","+c.viz.norm_labels.margin.top+")"),e.append("rect").attr("fill",c.viz.background_color).attr("width",30*c.viz.clust.dim.width+"px").attr("height",c.viz.label_background.col).attr("class","white_bars"),e.append("g").attr("class","col_label_outer_container").attr("transform","translate(0,"+c.viz.norm_labels.width.col+")").append("g").attr("class","col_zoom_container")):(e=d3.select(c.root+" .col_container").attr("transform","translate("+c.viz.clust.margin.left+","+c.viz.norm_labels.margin.top+")"),e.select(".white_bars").attr("fill",c.viz.background_color).attr("width",30*c.viz.clust.dim.width+"px").attr("height",c.viz.label_background.col),e.select(c.root+" .col_label_outer_container"));var f=d3.select(c.root+" .col_zoom_container").selectAll(".col_label_text").data(u,function(t){return t.name}).enter().append("g").attr("class","col_label_text").attr("transform",function(t){var e=t.col_index;return"translate("+c.viz.x_scale(e)+", 0) rotate(-90)"}),p=f.append("g").attr("class","col_label_group").attr("transform","translate("+c.viz.x_scale.rangeBand()/2+","+d+") rotate(45)").on("mouseover",function(){d3.select(this).select("text").classed("active",!0)}).on("mouseout",function(){d3.select(this).select("text").classed("active",!1)});n.has(c.network_data.col_nodes[0],"value")&&p.append("rect").attr("class","col_bars").attr("width",function(t){var e=0;return t.value>0&&(e=c.labels.bar_scale_col(t.value)),e}).attr("height",.66*c.viz.x_scale.rangeBand()).style("fill",function(t){return t.value>0?c.matrix.bar_colors[0]:c.matrix.bar_colors[1]}).attr("opacity",.6),p.append("text").attr("x",0).attr("y",.64*c.viz.x_scale.rangeBand()).attr("dx",c.viz.border_width.x).attr("text-anchor","start").attr("full_name",function(t){return t.name}).style("font-size",c.labels.default_fs_col+"px").style("cursor","default").text(function(t){return n.normal_name(t)}).style("opacity",0).transition().delay(r).duration(r).style("opacity",1),s(c),p.append("path").style("stroke-width",0).attr("d",function(){return l(c)}).attr("fill","#eee").style("opacity",0).transition().delay(r).duration(r).style("opacity",c.viz.triangle_opacity),d3.selectAll(c.root+" .col_label_text").on("click",function(t){"function"==typeof c.click_label?(c.click_label(t.name,"col"),o(c,this,t.ini)):c.tile_click_hlight&&o(c,this,t.ini)}).on("dblclick",function(e){var r="__data__",n=this[r].name;if(c.sim_mat){a(t,this,n);var s=d3.selectAll(c.root+" .row_label_group").filter(function(t){return t.name==n})[0][0];i(t,s,n)}else a(t,this,n);c.tile_click_hlight&&o(c,this,e.ini)})}},function(t,e){"use strict";t.exports=function(t,e,r){if(r!=t.click_hlight_col){t.click_hlight_col=r;var n=6,o=.85,a=n*t.viz.border_width.x;d3.selectAll(t.root+" .click_hlight").remove(),d3.select(e).append("rect").classed("click_hlight",!0).classed("col_top_hlight",!0).attr("width",t.viz.clust.dim.height).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=0,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"}),d3.select(e).append("rect").classed("click_hlight",!0).classed("col_bottom_hlight",!0).attr("width",t.viz.clust.dim.height).attr("height",a).attr("fill",t.matrix.hlight_color).attr("opacity",o).attr("transform",function(){var e=t.viz.x_scale.rangeBand()-a,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"})}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_col=-666}},function(t,e,r){"use strict";var n=r(105),o=r(106),a=r(134),i=r(88),s=r(129),l=r(79);t.exports=function(t,e,r){var c=t.params,u=s(c);if(1===u.zoom_y&&1===u.zoom_x){c.viz.inst_order.col="custom",o(t,"col"),d3.selectAll(c.root+" .toggle_row_order .btn").classed("active",!1),c.viz.run_trans=!0;var d=$.extend(!0,{},c.matrix.matrix),f=c.network_data.row_nodes,p=c.network_data.col_nodes,h=[];p.forEach(function(t){h.push(t.name)});var v=_.indexOf(h,r);h=[],f.forEach(function(t,e){h.push(d[e].row_data[v].value)});var m=d3.range(h.length).sort(function(t,e){return h[e]-h[t]});c.viz.y_scale.domain(m),c.matrix.orders.custom_col=m;var g,y=c.network_data.row_nodes_names;if(g=c.network_data.links.length>c.matrix.def_large_matrix?d3.select(c.root+" .viz_svg"):d3.select(c.root+" .viz_svg").transition().duration(2500),g.selectAll(".row_cat_group").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),g.select(".row_label_zoom_container").selectAll(".row_label_group").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),c.viz.ds_level===-1&&g.selectAll(".row").attr("transform",function(t){var e=_.indexOf(y,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),d3.selectAll(c.root+" .col_label_text").select(".highlight_rect").style("opacity",0),d3.select(e).select(".highlight_rect").style("opacity",1),c.network_data.links.forEach(function(t){t.x=c.viz.x_scale(t.target),t.y=c.viz.y_scale(t.source)}),n(c),c.zoom_info=i(),setTimeout(function(){c.viz.run_trans=!1},2500),c.viz.ds_num_levels>0&&c.viz.ds_level>=0){l(c);var w=!0,x=!0,b=!0;a(t,w,x,b)}}}},function(t,e,r){"use strict";var n=r(135),o=r(93),a=r(102),i=r(136),s=r(68);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=t.params,u=c.zoom_info,d=c.viz.ds_level,f=c.viz.ds_level;null===c.viz.ds?d=-1:(d=Math.floor(Math.log(u.zoom_y)/Math.log(c.viz.ds_zt)),d>c.viz.ds_num_levels-1&&(d=-1));var p=!1;f==-1?d>=0&&(p=!0):d=0&&(d3.selectAll(c.root+" .row").remove(),d3.selectAll(c.viz.root_tips+"_tile_tip").remove(),d3.selectAll(c.viz.root_tips+"_row_tip").remove());var w;if(h<0?(w=c.matrix.matrix,i(c)):(w=c.matrix.ds_matrix[h],d3.selectAll(c.root+" .row_cat_group path").remove()),r===!0&&d3.selectAll(c.root+" .row_cat_group path").remove(),e===!0&&(h>=0?d3.selectAll(c.root+" .ds"+String(h)+"_row").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}):d3.selectAll(c.root+" .row").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}),d3.selectAll(c.root+" .row_label_group").each(function(t){s.contains(c.viz.viz_nodes.row,t.name)===!1&&d3.select(this).remove()}),h!=f&&(g=c.viz.viz_nodes.row,d3.selectAll(c.root+" .ds"+String(f)+"_row").remove())),(g.length>=1||"all"===g)&&o(c,w,g,h),h===-1&&(r===!1||e)){var x=[];d3.selectAll(c.root+" .row_label_group").each(function(t){x.push(t.name)});var b=_.difference(c.viz.viz_nodes.row,x),z=1;b.length>z&&a(t,b)}}},function(t,e){"use strict";t.exports=function(t,e){var r,n=[],o=[],a=t.viz.y_scale,i=t.viz.ds_level,s=t.network_data.row_nodes_names,l=".row";i>=0&&(a=t.viz.ds[i].y_scale,s=d3.range(t.matrix.ds_matrix[i].length).map(String),l=".ds"+String(i)+"_row");for(var c=0;ce.min_y&&n.push(s[c]);d3.selectAll(t.root+" "+l).each(function(t){o.push(t.name)}),t.viz.viz_nodes.row=n,t.viz.viz_nodes.curr_row=o}},function(t,e){"use strict";t.exports=function(t){d3.select(t.root+" .row_cat_group path").empty()===!0&&d3.selectAll(t.root+" .row_cat_group").append("path").attr("d",function(){var e=t.viz.cat_room.symbol_width-1,r=0,n=1,o=t.viz.y_scale.rangeBand()/2,a=t.viz.cat_room.symbol_width-1,i=t.viz.y_scale.rangeBand(),s="M "+e+","+r+" L "+n+","+o+", L "+a+","+i+" Z";return s}).attr("fill","#eee").style("opacity",t.viz.triangle_opacity)}},function(t,e,r){"use strict";var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_col_tip").remove();var e=n().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip "+e+"_col_tip";return r}).direction("w").offset([20,0]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return""+e+""});d3.select(t.viz.viz_wrapper).select("svg").select(t.root+" .col_zoom_container").selectAll(".col_label_group").select("text").call(e),d3.select(t.root+" .col_zoom_container").selectAll(".col_label_group").on("mouseover",function(r){d3.selectAll(t.viz.root_tips+"_col_tip").style("display","block"),e.show(r),null!=t.col_tip_callback&&t.col_tip_callback(r)}).on("mouseout",function(){e.hide(this),d3.selectAll(t.viz.root_tips+"_col_tip").style("display","none")})}}},function(t,e){"use strict";t.exports=function(t){var e=.36*t.viz.x_scale.rangeBand(),r=-t.viz.border_width.x,n=0,o=t.viz.x_scale.rangeBand()-e,a=-(t.viz.x_scale.rangeBand()-e+t.viz.border_width.x),i=-t.viz.border_width.x,s="M "+r+",0 L "+a+","+n+", L "+i+","+o+" Z";return s}},function(t,e){"use strict";t.exports=function(t){d3.select(t.viz.viz_svg).append("rect").attr("fill",t.viz.background_color).attr("height",t.viz.super_labels.dim.width+"px").attr("width","3000px").classed("super_col_bkg",!0).classed("white_bars",!0).attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.super_labels.margin.top+")"),d3.select(t.viz.viz_svg).append("text").attr("class","super_col").text(t.labels.super.col).attr("text-anchor","center").attr("transform",function(){var e=d3.select(this)[0][0].getBBox().width,r=t.viz.clust.dim.width/2+t.viz.norm_labels.width.row-e/2,n=t.viz.super_labels.dim.width;return"translate("+r+","+n+")"}).style("font-size",function(){var e=t.labels.super_label_fs*t.labels.super_label_scale;return e+"px"}).style("font-weight",300),d3.select(t.viz.viz_svg).append("rect").attr("fill",t.viz.background_color).attr("width",t.viz.super_labels.dim.width+"px").attr("height","3000px").classed("super_row_bkg",!0).classed("white_bars",!0).attr("transform","translate("+t.viz.super_labels.margin.left+",0)"),d3.select(t.viz.viz_svg).append("g").classed("super_row",!0).attr("transform",function(){var e=t.viz.super_labels.dim.width,r=t.viz.clust.dim.height/2+t.viz.norm_labels.width.col;return"translate("+e+","+r+")"}),d3.select(t.root+" .super_row").append("text").text(t.labels.super.row).attr("text-anchor","center").attr("transform",function(){var e=d3.select(this)[0][0].getBBox().width,r=e/2+t.viz.norm_labels.width.col,n="translate(0,"+r+"), rotate(-90)";return n}).style("font-size",function(){var e=t.labels.super_label_fs*t.labels.super_label_scale;return e+"px"}).style("font-weight",300)}},function(t,e,r){"use strict";var n=r(141),o=r(142),a=r(150),i=r(112);t.exports=function(t){var e=t.params,r=e.viz;d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 1000,-1000, L 1000,0 Z").attr("fill",r.background_color).attr("class","right_slant_triangle").attr("transform","translate("+r.clust.dim.width+","+r.norm_labels.width.col+")"),d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 500,-500, L 0,-500 Z").attr("fill",r.background_color).attr("class","left_slant_triangle").attr("transform","translate(-1,"+r.norm_labels.width.col+")");var s=r.clust.margin.top+r.uni_margin/5;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",r.clust.margin.left).attr("height",s).attr("class","top_left_white");var l=r.cat_room.col+1.5*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",2*r.clust.dim.width).attr("height",l).attr("class","top_right_white").attr("transform",function(){var t=r.clust.margin.left+r.clust.dim.width,e=r.norm_labels.width.col+r.norm_labels.margin.top-r.uni_margin;return"translate("+t+", "+e+")"}),p=r.clust.margin.left+r.clust.dim.width+r.uni_margin,_=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin;var c=1.15*r.cat_room.symbol_width,u=.65,d=1.25;r.show_categories.col&&d3.select(r.viz_svg).selectAll().data(r.all_cats.col).enter().append("text").classed("col_cat_super",!0).style("font-size",c+"px").style("opacity",u).style("cursor","default").attr("transform",function(t){var e=parseInt(t.split("-")[1],10),n=_+d*r.cat_room.symbol_width*e;return"translate("+p+","+n+")"}).text(function(t){return n(r,t,"col")}),a(t),_=r.show_dendrogram?r.clust.margin.top+r.clust.dim.height+r.dendro_room.col-2*r.uni_margin:r.clust.margin.top+r.clust.dim.height;var f=d3.select(r.viz_svg).append("g").classed("bottom_spillover_container",!0).attr("transform",function(){return"translate(0,"+_+")"});f.append("rect").attr("class","bottom_spillover").attr("fill",r.background_color).attr("width",r.svg_dim.width).attr("height",2*r.svg_dim.height),p=r.clust.margin.left,_=0,f.append("g").classed("col_dendro_icons_container",!0).attr("transform","translate("+p+","+_+")").append("g").classed("col_dendro_icons_group",!0),e.viz.show_dendrogram&&i(t,"col");var p=r.clust.margin.left+r.clust.dim.width,_=r.clust.margin.top+r.clust.dim.height,h=r.cat_room.col+r.clust.dim.width,v=r.cat_room.row+10*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",h).attr("height",v).attr("transform",function(){return"translate("+p+","+_+")"}).classed("white_bars",!0).classed("dendro_corner_spillover",!0),p=0,_=r.clust.margin.top+r.clust.dim.height,h=r.clust.margin.left,v=10*r.clust.dim.height,d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",h).attr("height",v).attr("transform",function(){return"translate("+p+","+_+")"}).classed("white_bars",!0).classed("dendro_col_spillover",!0),o(t)}},function(t,e){"use strict";t.exports=function(t,e,r){var n;if(t.cat_names[r][e]===e){var o=parseInt(e.split("-")[1],10)+1;n="Category "+o}else n=t.cat_names[r][e];return n}},function(t,e,r){"use strict";var n=r(143);t.exports=function(t){var e=t.params;_.each(["row","col"],function(r){e.viz.show_categories[r]&&d3.selectAll(e.root+" ."+r+"_cat_super").on("dblclick",function(){e.sim_mat&&(r="both"),d3.selectAll(e.root+" .toggle_"+r+"_order .btn").classed("active",!1);var o=this.__data__.replace("-","_")+"_index";e.viz.sim_mat?(n(t,o,"row"),n(t,o,"col")):n(t,o,r)})})}},function(t,e,r){"use strict";var n=r(106),o=r(134),a=r(88),i=r(79),s=r(144),l=r(129);t.exports=function(t,e,r){var c=t.params,u=l(c),d=0;1==u.zoom_y&&1==u.zoom_x||(s(t,0,0,1),d=1200);var f;"row"===r?f="col":"col"===r&&(f="row"),c.viz.run_trans=!0,"row"===f?c.viz.inst_order.row=e:"col"===f&&(c.viz.inst_order.col=e),c.viz.show_dendrogram&&n(t,r),"row"===f?c.viz.x_scale.domain(c.matrix.orders[c.viz.inst_order.row+"_row"]):"col"==f&&c.viz.y_scale.domain(c.matrix.orders[c.viz.inst_order.col+"_col"]);var p;p=d3.selectAll(c.root+" .tile")[0].length0&&c.viz.ds_level>=0){i(c);var m=!0,g=!0,y=!0;o(t,m,g,y)}setTimeout(function(){c.viz.run_trans=!1},2500)}},function(t,e,r){"use strict";var n=r(2),o=r(145),a=r(134),i=r(88),s=r(149);t.exports=function(t,e,r,l){function c(t,e){d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").transition().duration(g).style("opacity",e)}var u=t.params;if(d3.selectAll(u.viz.root_tips).style("display","none"),u.zoom_info=i(),a(t),!u.viz.run_trans){var d=u.viz.clust.dim.height/2,f=d/l;if(r>=d-f){var p=d-r,h=-d/l+p;r+=h}r<-(d-f)&&(p=d+r,h=d/l-p,r+=h);var v=l,m=1,g=700,y=-(v-1)*d;d3.select(u.root+" .clust_group").transition().duration(g).attr("transform","translate("+[0,0+y]+") scale("+m+","+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_label_zoom_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale("+v+","+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_cat_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale(1,"+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_dendro_container").transition().duration(g).attr("transform","translate("+[0,y]+") scale("+m+","+v+")translate("+[u.viz.uni_margin/2,r]+")");var w;_.each(["row","col"],function(t){w=d3.select(u.root+" ."+t+"_dendro_crop_buttons").style("opacity"),d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").style("opacity",0),setTimeout(c,700,t,w)}),d3.select(u.root+" .col_zoom_container").transition().duration(g).attr("transform"," scale("+m+","+m+")translate("+[e,0]+")"),d3.select(u.root+" .col_cat_container").transition().duration(g).attr("transform"," scale("+m+",1)translate("+[e,0]+")"),d3.select(u.root+" .col_dendro_container").transition().duration(g).attr("transform"," scale("+m+",1)translate("+[e,u.viz.uni_margin/2]+")");var x=u.viz.clust.margin.top+y+r*v,b=u.viz.clust.margin.left+e;u.zoom_behavior.scale(v).translate([b,x]),o(u),d3.select(u.root+" .row_label_zoom_container text").empty()===!1&&d3.select(u.root+" .row_label_zoom_container").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",.5*t.x).attr("y",0).attr("width",.5*t.width).attr("height",u.viz.y_scale.rangeBand()).style("fill","yellow")}),d3.select(u.root+" .row_dendro_icons_group").attr("transform","translate("+[0,0+y]+") scale("+m+","+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=u.viz.uni_margin,r=t.pos_mid;return"translate("+e+","+r+") scale(1, "+1/v+")"}),d3.select(u.root+" .col_dendro_icons_group").attr("transform",function(){var t=" scale("+m+","+v+")";return t}),d3.select(u.root+" .col_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=t.pos_mid,r=u.viz.uni_margin;return"translate("+e+","+r+") scale(1,1)"}),n.has(u.network_data.col_nodes[0],"value")&&d3.selectAll(u.root+" .col_bars").attr("width",function(t){var e=0;return t.value>0&&(e=u.labels.bar_scale_col(t.value)/m),e}),n.has(u.network_data.row_nodes[0],"value")&&d3.selectAll(u.root+" .row_bars").transition().duration(g).attr("width",function(t){var e=0;return e=u.labels.bar_scale_row(Math.abs(t.value))/v}).attr("x",function(t){var e=0;return e=-u.labels.bar_scale_row(Math.abs(t.value))/v}),s(u)}}},function(t,e,r){"use strict";var n=r(2),o=r(146),a=r(147);t.exports=function(t){d3.selectAll(t.root+" .row_label_group").select("text").text(function(t){return n.normal_name(t)}),d3.selectAll(t.root+" .col_label_text").select("text").text(function(t){return n.normal_name(t)}),a(t),d3.selectAll(t.root+" .row_label_group").each(function(){o(t,this,"row")}),d3.selectAll(t.root+" .col_label_group").each(function(){o(t,this,"col")})}},function(t,e){"use strict";t.exports=function(t,e,r){function n(){return u=d3.select(this).text(),c=u.length,f=c-3,l=u.substring(0,f)+".."}function o(t){return u=d3.select(this).text(),c=".."===u.slice(-2)?u.length-2:u.length,d=t.name,f=c+2,l=d.substring(0,f)+"..",l.length>d.length&&(l=d),l}function a(t,e){return s=e<1?t:t*e}if("none"!=d3.select(e).style("display")){var i,s,l,c,u,d,f,p,_=t.viz.norm_labels.width[r];i="row"===r?t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale():t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale();var h;d3.select(e).select("text").each(function(t){h=t.name.length});var v=d3.select(e).select("text").node().getBBox().width;if(s=a(v,i),s>_)for(p=1;p_&&(d3.select(e).select("text").text(n),v=d3.select(e).select("text").node().getBBox().width,s=a(v,i));else if(s<.75*_)for(p=1;po&&(a.row>t.labels.max_allow_fs?(e=t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale(),e<1&&(e=1),r=t.labels.max_allow_fs/e,d3.selectAll(t.root+" .row_label_group").select("text").style("font-size",r+"px").attr("y",.5*t.viz.rect_height+.35*r)):d3.selectAll(t.root+" .row_label_group").select("text").style("font-size",t.labels.default_fs_row+"px").attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row)),a.col>o&&(a.col>t.labels.max_allow_fs?(e=t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale(),e<1&&(e=1),r=t.labels.max_allow_fs/e,r>.7*t.viz.rect_width&&(r=.7*t.viz.rect_width),d3.selectAll(t.root+" .col_label_text").select("text").style("font-size",r+"px")):d3.selectAll(t.root+" .col_label_text").select("text").style("font-size",t.labels.default_fs_col+"px"))}},function(t,e){"use strict";t.exports=function(t){var e={};return t.viz.zoom_ratio.x>1?(e.row=t.labels.default_fs_row*t.zoom_behavior.scale(),e.col=t.labels.default_fs_col*t.zoom_behavior.scale()):(e.row=t.labels.default_fs_row*t.zoom_behavior.scale()/t.viz.zoom_ratio.y,e.col=t.labels.default_fs_col*t.zoom_behavior.scale()),e}},function(t,e){"use strict";t.exports=function(t){t.zoom_info.zoom_x*t.viz.border_width.x>1?d3.selectAll(t.root+" .vert_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .vert_lines").select("line").style("display","none"),t.zoom_info.zoom_y*t.viz.border_width.y>1?d3.selectAll(t.root+" .horz_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .horz_lines").select("line").style("display","none")}},function(t,e,r){"use strict";var n=r(141),o=r(100);t.exports=function(t){var e=t.params,r=e.viz,a=2.75;d3.select(e.root+" .row_cat_label_container").empty()&&(d3.select(t.params.viz.viz_svg).append("g").classed("row_cat_label_container",!0),d3.select(t.params.viz.viz_svg+" .row_cat_label_container").append("g").classed("row_cat_label_bar_container",!0));var i=r.clust.margin.left+r.clust.dim.width+r.uni_margin,s=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin,l=1.15*r.cat_room.symbol_width,c=.65,u=1.25;d3.select(e.root+" .row_cat_label_container").attr("transform",function(){return i=r.norm_labels.margin.left+r.norm_labels.width.row+r.cat_room.symbol_width+a*r.uni_margin,s=r.clust.margin.top-r.uni_margin,"translate("+i+","+s+") rotate(-90)"}),d3.selectAll(e.root+" .row_cat_label_container text").remove(),d3.selectAll(e.root+" .row_cat_selection_bar").remove(),d3.selectAll(t.params.viz.root_tips+"_row_cat_super").remove();var d=50,f=-75,p=o().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_row_cat_super";return r}).direction("south_custom").offset([d,f]).style("display","none").style("opacity",0).html(function(t){var o,a=e.network_data.row_nodes[0][t];if(a.indexOf("

")>-1){var i=a.split(": ")[0],s=a.split("

")[1];o=i+"

"+s}else o=n(r,t,"row");return o}),h=u*r.cat_room.symbol_width,v=.9*h;if(d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("text").style("width","100px").style("height",v+"px").classed("row_cat_super",!0).style("font-size",l+"px").style("opacity",c).style("cursor","default").attr("transform",function(t){var e=u*r.cat_room.symbol_width*parseInt(t.split("-")[1],10);return"translate(0,"+e+")"}).text(function(t){return n(r,t,"row")}),d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("rect").classed("row_cat_super",!0).classed("row_cat_selection_bar",!0).style("height",v+"px").style("fill","green").style("width","120px").style("opacity",0).attr("transform",function(t){var e=h*(parseInt(t.split("-")[1],10)-.75);return"translate(0,"+e+")"}).on("mouseover",function(t){d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","block").style("opacity",1),p.show(t)}).on("mouseout",function(){p.hide(this),d3.selectAll(".d3-tip").style("display","none"),d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","none").style("opacity",0)}),d3.select(e.root+" .row_cat_selection_bar").empty()===!1&&d3.selectAll(e.root+" .row_cat_selection_bar").call(p),_.has(e.network_data,"row_cat_bars")){d3.select(e.root+" .enr_title").remove();var m=d3.select(e.root+" .viz_svg").append("g").classed("enr_title",!0).attr("transform",function(){var t=d3.select(e.root+" .row_cat_label_container").attr("transform").split("(")[1].split(")")[0],r=Number(t.split(",")[0])-10;return"translate("+String(r)+", 0)"});m.append("rect").attr("width",e.viz.cat_room.row).attr("height",25).attr("fill","white");var g=e.network_data.enrichrgram_lib.substring(0,40);m.append("text").attr("transform","translate(0, 17)").text(g.replace(/_/g," ")).style("font-size","15px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),d3.selectAll(e.root+" .enrichr_bars").remove();var y=e.viz.clust.margin.top-35,w=e.network_data.row_cat_bars[0],x=d3.scale.linear().domain([0,w]).range([0,y]);d3.select(e.root+" .row_cat_label_bar_container").selectAll().data(e.network_data.row_cat_bars).enter().append("rect").classed("enrichr_bars",!0).attr("height",v+"px").attr("fill","red").attr("width",function(t){var e=x(t);return e+"px"}).attr("opacity",.4).attr("transform",function(t,e){var r=h*(e-.75);return"translate(0, "+r+")"})}}},function(t,e,r){"use strict";var n=r(152);t.exports=function(t){var e,r=t.params;d3.select(r.root+" .expand_button").on("click",null);var o=.4;e=d3.select(r.root+" .expand_button").empty()?d3.select(r.viz.viz_svg).append("text").attr("class","expand_button"):d3.select(r.root+" .expand_button"),e.attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family","FontAwesome").attr("font-size","30px").text(function(){return r.viz.is_expand===!1?"":""}).attr("y","25px").attr("x","25px").style("cursor","pointer").style("opacity",o).on("mouseover",function(){d3.select(this).style("opacity",.75)}).on("mouseout",function(){d3.select(this).style("opacity",o)}).on("click",function(){r.viz.is_expand===!1?(d3.select(this).text(function(){return""}),r.viz.is_expand=!0,d3.selectAll(r.root+" .borders").style("fill","white"),d3.select(r.root+" .sidebar_wrapper").style("display","none")):(d3.select(this).text(function(){return""}),r.viz.is_expand=!1,d3.selectAll(r.root+" .borders").style("fill","#eee"),d3.select(r.root+" .viz_wrapper").style("width","100px"),d3.select(r.root+" .sidebar_wrapper").style("display","block")),d3.select(r.viz.viz_svg).style("opacity",.5);var e=500;1==r.viz.run_trans&&(e=2500),setTimeout(n,e,t)})}},function(t,e,r){"use strict";var n=r(2),o=r(153),a=r(161),i=r(162),s=r(163),l=r(164),c=r(165),u=r(166),d=r(167),f=r(168),p=r(169),h=r(170),v=r(171),m=r(172),g=r(173),y=r(174),w=r(175),x=r(176),b=r(145),z=r(107),k=r(106),A=r(134),E=r(70),N=r(177),M=r(150),S=r(142),O=r(178),T=r(88),C=r(179);t.exports=function(t){var e=t.params,r=E(e);d3.select(e.root+" .play_button"),d3.select(e.root+" .sidebar_wrapper").style("height",r.height+"px"),d3.select(e.viz.viz_wrapper).style("margin-top",r.top+"px").style("width",r.width+"px").style("height",r.height+"px"),e=y(e),e.zoom_info=T(),i(e);var B=d3.select(e.viz.viz_svg);_.each(e.network_data.links,function(t){t.x=e.viz.x_scale(t.target),t.y=e.viz.y_scale(t.source)}),B.on(".zoom",null),e.zoom_behavior.scaleExtent([1,e.viz.square_zoom*e.viz.zoom_ratio.x]).on("zoom",function(){o(t)}),e.viz.do_zoom&&B.call(e.zoom_behavior),a(t),B.attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height),B.select(".super_background").style("width",e.viz.svg_dim.width).style("height",e.viz.svg_dim.height),B.select(".grey_background").attr("width",e.viz.clust.dim.width).attr("height",e.viz.clust.dim.height),setTimeout(N,100,e);var F=e.network_data.row_nodes,I=n.pluck(F,"name");w(e,B),B.selectAll(".highlighting_rect").attr("width",.8*e.viz.x_scale.rangeBand()).attr("height",.8*e.viz.y_scale.rangeBand()),f(e),d(e,B),p(e,B),B.selectAll(".row_label_group").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",e.viz.rect_height).style("fill","yellow").style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),B.selectAll(".row_label_group").select("text").attr("y",.5*e.viz.rect_height+.35*e.labels.default_fs_row),n.has(e.network_data.row_nodes[0],"value")&&x(t,B),B.selectAll(".row_cat_group").attr("transform",function(t){var r=_.indexOf(I,t.name);return"translate(0, "+e.viz.y_scale(r)+")"}),B.selectAll(".row_cat_group").select("path").attr("d",function(){var t=e.viz.cat_room.symbol_width-1,r=0,n=1,o=e.viz.rect_height/2,a=e.viz.cat_room.symbol_width-1,i=e.viz.rect_height,s="M "+t+","+r+" L "+n+","+o+", L "+a+","+i+" Z";return s});var j=!0;e.viz.show_dendrogram?(z(t,"row",j),z(t,"col",j),s(e,B),k(t,"row",0),k(t,"col",0)):s(e,B),h(e,B),v(e,B),m(e,B),g(e,B),l(e,B),c(e.viz,B),C(e),u(e,B),e.zoom_behavior.scale(1).translate([e.viz.clust.margin.left,e.viz.clust.margin.top]),b(e),d3.select(e.root+" .clust_container").attr("transform","translate("+e.viz.clust.margin.left+","+e.viz.clust.margin.top+")"),t.params.viz.ds_level===-1&&A(t),M(t),d3.select(e.viz.viz_svg).style("opacity",1),S(t),d3.select(t.params.root+" .row_slider_group").style("opacity",0),d3.select(t.params.root+" .col_slider_group").style("opacity",0),setTimeout(O,500,t,"row"),setTimeout(O,500,t,"col")}},function(t,e,r){"use strict";var n=r(154),o=r(159),a=r(160);t.exports=function(t){var e=t.params,r={};if(r.zoom_x=d3.event.scale,r.zoom_y=d3.event.scale,r.trans_x=e.zoom_behavior.translate()[0]-e.viz.clust.margin.left,r.trans_y=e.zoom_behavior.translate()[1]-e.viz.clust.margin.top,d3.selectAll(e.viz.root_tips).style("display","none"),e.zoom_info=o(e,r),e.zoom_info=a(e,r),e.is_slider_drag===!1&&e.is_cropping===!1){var i=e.zoom_info.trans_x+e.viz.clust.margin.left,s=e.zoom_info.trans_y+e.viz.clust.margin.top;e.zoom_behavior.translate([i,s]),t.params=e,n(t)}}},function(t,e,r){"use strict";var n=r(147),o=r(134),a=r(155),i=r(114),s=r(129),l=r(156),c=r(158);t.exports=function(t){function e(t){var e=t.params,r=c(e);r===!0&&setTimeout(l,50,t)}var r=t.params,u=r.zoom_info,d=s(r);d3.select(r.root+" .clust_group").attr("transform","translate("+[u.trans_x,u.trans_y]+") scale("+u.zoom_x+","+u.zoom_y+")"), +d3.select(r.root+" .row_label_zoom_container").attr("transform","translate("+[0,u.trans_y]+") scale("+u.zoom_y+")"),d3.select(r.root+" .col_zoom_container").attr("transform","translate("+[u.trans_x,0]+") scale("+u.zoom_x+")"),d3.select(r.root+" .row_cat_container").attr("transform","translate("+[0,u.trans_y]+") scale( 1,"+u.zoom_y+")"),d3.select(r.root+" .row_dendro_container").attr("transform","translate("+[r.viz.uni_margin/2,u.trans_y]+") scale( 1,"+u.zoom_y+")"),d3.select(r.root+" .row_dendro_icons_group").attr("transform",function(){var t=u.trans_y,e="translate("+[0,t]+") ",r="scale(1, "+u.zoom_y+")",n=e+r;return n}),d3.select(r.root+" .col_dendro_icons_group").attr("transform",function(){var t=u.trans_x,e="translate("+[t,0]+")",r="scale("+u.zoom_x+", 1)",n=e+r;return n}),i(r,u,"row"),i(r,u,"col"),d3.select(r.root+" .col_cat_container").attr("transform","translate("+[u.trans_x,0]+") scale("+u.zoom_x+",1)"),d3.select(r.root+" .col_dendro_container").attr("transform","translate("+[u.trans_x,r.viz.uni_margin/2]+") scale("+u.zoom_x+",1)"),a(r,u),d3.select(r.root+" .viz_svg").attr("is_zoom",function(){var t=Number(d3.select(r.root+" .viz_svg").attr("is_zoom"));return d3.select(r.root+" .viz_svg").attr("stopped_zoom",1),t+1});var f=function(){d3.select(r.root+" .viz_svg").attr("is_zoom",function(){var t=Number(d3.select(r.root+" .viz_svg").attr("is_zoom"));return t-1})};if(n(r),u.zoom_y<=d.zoom_y){var p=!1;u.zoom_y0&&(n=t.labels.bar_scale_col(r.value)/e.zoom_x),n})}},function(t,e,r){"use strict";var n=r(147),o=r(146),a=r(157),i=r(149),s=r(134),l=r(158);t.exports=function(t){function e(){_.each(["row","col"],function(t){d3.selectAll(r.root+" ."+t+"_label_group").filter(function(){return"none"!=d3.select(this).style("display")}).select("text").style("font-size",function(){var t=Number(d3.select(this).style("font-size").replace("px",""));return t})})}var r=t.params,c=l(r);if(c===!0){_.each(["row","col"],function(t){d3.selectAll(r.root+" ."+t+"_label_group").select("text").style("opacity",1),d3.selectAll(r.root+" ."+t+"_cat_group").select("path").style("display","block")}),s(t,!0),d3.selectAll(r.viz.root_tips).style("display","block"),d3.selectAll(r.root+" .row_label_group").select("text").style("display","none"),d3.selectAll(r.root+" .row_label_group").select("text").style("display","block"),d3.select(r.root+" .viz_svg").attr("stopped_zoom",0),d3.selectAll(r.root+" .row_label_group").select("text").style("display","block"),d3.selectAll(r.root+" .col_label_group").select("text").style("display","block"),i(r),t.params.viz.x_offset=0;var u=150;_.each(["row","col"],function(t){var e=a(r,t);e1&&(e.zoom_y=0?e.trans_y=0:e.trans_y<=-e.pan_room_y&&(e.trans_y=-e.pan_room_y),e}},function(t,e){"use strict";t.exports=function(t,e){var r=t.viz;return r.zoom_ratio.x>1&&(e.zoom_x0?e.trans_x=0:e.trans_x<=-e.pan_room_x&&(e.trans_x=-e.pan_room_x),e}},function(t,e,r){"use strict";var n=r(144);t.exports=function(t){var e=t.params;d3.selectAll(e.viz.zoom_element).on("dblclick.zoom",null),d3.select(e.viz.zoom_element).on("dblclick",function(){n(t,0,0,1)})}},function(t,e){"use strict";t.exports=function(t){var e=1,r=0,n=0,o=t.viz.clust.dim.height/2,a=-(e-1)*o;d3.select(t.root+" .clust_group").attr("transform","translate("+[0,0+a]+") scale(1,"+e+")translate("+[r,n]+")"),d3.select(t.root+" .row_label_zoom_container").attr("transform","translate("+[0,a]+") scale("+e+","+e+")translate("+[0,n]+")"),d3.select(t.root+" .row_cat_container").attr("transform","translate("+[0,a]+") scale(1,"+e+")translate("+[0,n]+")"),d3.select(t.root+" .row_dendro_container").attr("transform","translate("+[0,a]+") scale("+e+","+e+")translate("+[t.viz.uni_margin/2,n]+")"),d3.select(t.root+" .col_zoom_container").attr("transform"," scale(1,1)translate("+[r,0]+")"),d3.select(t.root+" .col_cat_container").attr("transform"," scale(1,1)translate("+[r,0]+")"),d3.select(t.root+" .col_dendro_container").attr("transform"," scale(1,1)translate("+[r,t.viz.uni_margin/2]+")"),d3.select(t.root+" .row_dendro_icons_group").attr("transform",function(){return"translate(0,0) scale(1)"}),d3.select(t.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(t){var e=7,r=t.pos_mid;return"translate("+e+","+r+") scale(1, 1)"})}},function(t,e){"use strict";t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n={};r===!1?n.run_transition=!1:n=r;var o,a=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;n.run_transition?(o=e.transition().delay(n.update).duration(a),e.selectAll(".col_cat_group").data(i,function(t){return t.name}).transition().delay(n.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}),e.selectAll(".col_dendro_group").data(i,function(t){return t.name}).transition().delay(n.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"})):(o=e,e.selectAll(".col_cat_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}),d3.select(t.root).selectAll(".col_dendro_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"}));var l,c;_.each(["row","col"],function(e){var r=t.viz.all_cats[e].length;for(l=0;l2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(".super_col_bkg").attr("height",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.grey_border_width+")"),r.select(".super_col").attr("transform",function(){var e=t.viz.clust.dim.width/2+t.viz.norm_labels.width.row,r=t.viz.super_labels.dim.width;return"translate("+e+","+r+")"}),r.select(".super_row_bkg").attr("width",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.grey_border_width+",0)"),r.select(".super_row").attr("transform",function(){var e=t.viz.super_labels.dim.width,r=t.viz.clust.dim.height/2+t.viz.norm_labels.width.col;return"translate("+e+","+r+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(t.root+" .right_slant_triangle").attr("transform","translate("+t.clust.dim.width+","+t.norm_labels.width.col+")"),r.select(t.root+" .left_slant_triangle").attr("transform","translate(-1,"+t.norm_labels.width.col+")");var i=t.clust.margin.top+t.uni_margin/5;r.select(t.root+" .top_left_white").attr("width",t.clust.margin.left).attr("height",i);var s=t.clust.margin.left+t.clust.dim.width+t.uni_margin+t.dendro_room.row,l=t.norm_labels.margin.top+t.norm_labels.width.col;r.select(t.root+" .right_spillover_container").attr("transform",function(){return"translate("+s+", 0)"}),l=t.norm_labels.margin.top+t.norm_labels.width.col,r.select(t.root+" .right_spillover_container rect").attr("transform",function(){return"translate( 0,"+l+")"}),r.select(t.root+" .right_spillover").attr("height",t.svg_dim.height+"px");var c=t.clust.margin.left+t.clust.dim.width,u=l,d=t.dendro_room.row+t.uni_margin,f=t.cat_room.col+t.uni_margin;d3.select(t.root+" .dendro_row_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=0,u=t.clust.margin.top+t.clust.dim.height,d=t.clust.margin.left,f=10*t.clust.dim.height,r.select(".dendro_col_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=t.clust.margin.left+t.clust.dim.width,u=t.clust.margin.top+t.clust.dim.height,d=t.cat_room.col+t.clust.dim.width,f=t.cat_room.row+t.uni_margin,r.select(".dendro_corner_spillover").attr("width",d).attr("height",f).attr("transform",function(){return"translate("+c+","+u+")"}),c=t.clust.margin.left+t.clust.dim.width+t.uni_margin,u=t.norm_labels.margin.top+t.norm_labels.width.col+2.5*t.uni_margin;var p=2.75,_=1.2;t.show_categories.col&&d3.selectAll(t.root+" .col_cat_super").attr("transform",function(e){var r=parseInt(e.split("-")[1],10),n=u+_*t.cat_room.symbol_width*r;return"translate("+c+","+n+")"}),t.show_categories.row&&d3.select(t.root+" .row_cat_label_container").attr("transform",function(){return c=t.norm_labels.margin.left+t.norm_labels.width.row+t.cat_room.symbol_width+p*t.uni_margin,u=t.clust.margin.top-t.uni_margin,"translate("+c+","+u+") rotate(-90)"}),u=t.show_dendrogram?t.clust.margin.top+t.clust.dim.height+t.dendro_room.col-2*t.uni_margin:t.clust.margin.top+t.clust.dim.height,d3.select(t.root+" .bottom_spillover_container").attr("transform",function(){return"translate(0,"+u+")"}),r.select(t.root+" .bottom_spillover").attr("width",t.svg_dim.width).attr("height",2*t.svg_dim.height);var h=t.cat_room.col+1.5*t.uni_margin;d3.select(t.viz_svg+" .top_right_white").attr("fill",t.background_color).attr("width",2*t.clust.dim.width).attr("height",h).attr("transform",function(){var e=t.clust.margin.left+t.clust.dim.width,r=t.norm_labels.width.col+t.norm_labels.margin.top-t.uni_margin;return"translate("+e+", "+r+")"})}},function(t,e){"use strict";t.exports=function(t,e){e.select(".left_border").attr("width",t.viz.grey_border_width).attr("height",t.viz.svg_dim.height).attr("transform","translate(0,0)"),e.select(".right_border").attr("width",t.viz.grey_border_width).attr("height",t.viz.svg_dim.height).attr("transform",function(){var e=t.viz.svg_dim.width-t.viz.grey_border_width;return"translate("+e+",0)"}),e.select(".top_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",function(){var t=0;return"translate("+t+",0)"}),e.select(".bottom_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",function(){var e=t.viz.svg_dim.height-t.viz.grey_border_width;return"translate(0,"+e+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration,i=t.network_data.row_nodes,s=t.network_data.row_nodes_names;n===!1?o.run_transition=!1:o=n,o.run_transition?(e.selectAll(".row_label_group").data(i,function(t){return t.name}).transition().delay(o.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),r=e.transition().delay(o.update).duration(a)):(e.selectAll(".row_label_group").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),r=e),r.select(t.root+" .row_container").attr("transform","translate("+t.viz.norm_labels.margin.left+","+t.viz.clust.margin.top+")"),r.select(t.root+" .row_container").select(".white_bars").attr("width",t.viz.label_background.row).attr("height",30*t.viz.clust.dim.height+"px"),r.select(t.root+" .row_container").select(".row_label_container").attr("transform","translate("+t.viz.norm_labels.width.row+",0)")}},function(t,e){"use strict";t.exports=function(t){var e=6,r=e*t.viz.border_width.x,n=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.rect_width).attr("height",n).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+",0)"}),d3.select(t.root+" .left_hlight").attr("width",r).attr("height",t.viz.rect_width-.99*n).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*n+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.rect_height-.99*n).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.rect_width-r;return"translate("+e+","+.99*n+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.rect_width-1.98*r}).attr("height",n).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,o=t.viz.rect_height-n;return"translate("+e+","+o+")"}),d3.select(t.root+" .row_top_hlight").attr("width",t.viz.svg_dim.width).attr("height",n),d3.select(t.root+" .row_bottom_hlight").attr("width",t.viz.svg_dim.width).attr("height",n).attr("transform",function(){var e=t.viz.rect_height-n;return"translate(0,"+e+")"}),d3.select(t.root+" .col_top_hlight").attr("width",t.viz.clust.dim.height).attr("height",r).attr("transform",function(){var e=0,r=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+r+","+e+")"}),d3.select(t.root+" .col_bottom_hlight").attr("width",t.viz.clust.dim.height).attr("height",r).attr("transform",function(){var e=t.viz.rect_width-r,n=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+n+","+e+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration;n===!1?o.run_transition=!1:o=n,r=o.run_transition?e.transition().delay(o.update).duration(a):e,r.select(".row_cat_outer_container").attr("transform","translate("+t.viz.norm_labels.width.row+",0)").select("white_bars").attr("width",t.viz.cat_room.row+"px").attr("height",function(){var e=t.viz.clust.dim.height;return e});var i=t.viz.clust.margin.left+t.viz.clust.dim.width,s=t.viz.clust.margin.top;r.select(".row_dendro_outer_container").attr("transform","translate("+i+","+s+")"),i=t.viz.clust.margin.left,s=t.viz.clust.margin.top+t.viz.clust.dim.height,r.select(" .col_dendro_outer_container").attr("transform",function(){return"translate("+i+","+s+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={},a=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;n===!1?o.run_transition=!1:o=n,o.run_transition?(r=e.transition().delay(o.update).duration(a),e.selectAll(".col_label_text").data(i,function(t){return t.name}).transition().delay(o.update).duration(a).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"})):(r=e,e.selectAll(".col_label_text").data(i,function(t){return t.name}).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"}));var l=t.viz.x_scale.rangeBand()/2+t.viz.border_width.x;r.select(t.root+" .col_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.norm_labels.margin.top+")"),r.select(t.root+" .col_container").select(".white_bars").attr("width",30*t.viz.clust.dim.width+"px").attr("height",t.viz.label_background.col),r.select(t.root+" .col_container").select(".col_label_outer_container").attr("transform","translate(0,"+t.viz.norm_labels.width.col+")"),r.selectAll(".col_label_group").attr("transform","translate("+t.viz.x_scale.rangeBand()/2+","+l+") rotate(45)"),r.selectAll(".col_label_group").select("text").attr("y",.6*t.viz.x_scale.rangeBand()).attr("dx",2*t.viz.border_width.x)}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){e.selectAll(".col_label_group").select("text").style("font-size",t.labels.default_fs_col+"px").text(function(t){return n.normal_name(t)}),e.selectAll(".col_label_group").each(function(){d3.select(this).select("text")[0][0].getBBox()})}},function(t,e,r){"use strict";var n=r(138);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.selectAll(".col_label_group").select("path"),a={},i=t.viz.duration;r===!1?a.run_transition=!1:a=r;var s;s=a.run_transition?o.transition().delay(a.update).duration(i):o,s.attr("d",function(){return n(t)}).attr("fill","#eee")}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o={};r===!1?o.run_transition=!1:o=r,n.has(t.network_data.col_nodes[0],"value")&&e.selectAll(".col_bars").data(t.network_data.col_nodes,function(t){return t.name}).attr("width",function(e){var r=0;return e.value>0&&(r=t.labels.bar_scale_col(e.value)),r}).attr("height",.66*t.viz.rect_width)}},function(t,e,r){"use strict";var n=r(71),o=r(74),a=r(73),i=r(83),s=r(82);t.exports=function(t){if(t=n(t),t.viz=a(t.viz),t.viz=o(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t.viz=s(t.viz),t.viz.x_scale.rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale.rangeBands([0,t.viz.clust.dim.height]),t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,null!=t.viz.ds)for(var e;e0&&_.each(t.viz.ds,function(e){e.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]),e.y_scale.domain(d3.range(e.num_rows+1)),e.rect_height=e.y_scale.rangeBand()-t.viz.border_width.y}),t.viz.square_zoom=t.viz.norm_labels.width.col/(t.viz.rect_width/2),t=i(t)}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(99);t.exports=function(t,e){var r=t.network_data.row_nodes_names;if(t.viz.ds_level===-1)e.selectAll(".row").attr("transform",function(e){var n=_.indexOf(r,e.name),o=t.viz.y_scale(n);return"translate(0,"+o+")"}),e.selectAll(".row").selectAll(".tile").attr("transform",function(e){return a(t,e)}).attr("width",t.viz.rect_width).attr("height",t.viz.rect_height),e.selectAll(".row").selectAll(".tile_up").attr("d",function(){return n(t)}).attr("transform",function(e){return a(t,e)}),e.selectAll(".row").selectAll(".tile_dn").attr("d",function(){return o(t)}).attr("transform",function(e){return a(t,e)});else{var i=t.viz.ds_level,s=".ds"+String(i)+"_row",l=t.viz.ds[i].rect_height;e.selectAll(s).attr("transform",function(e){var r=t.viz.ds[i].y_scale(e.row_index);return"translate(0,"+r+")"}),e.selectAll(s).selectAll(".tile").attr("transform",function(e){return a(t,e)}).attr("width",t.viz.rect_width).attr("height",l)}}},function(t,e,r){"use strict";var n=r(75);t.exports=function(t,e){var r=t.params;r=n(r),e.selectAll(".row_bars").attr("width",function(t){var e=0;return e=r.labels.bar_scale_row(Math.abs(t.value))}).attr("x",function(t){var e=0;return e=-r.labels.bar_scale_row(Math.abs(t.value))}).attr("height",r.viz.y_scale.rangeBand())}},function(t,e){"use strict";t.exports=function(t){var e=d3.select(t.root+" .clust_container").attr("transform"),r=Number(e.split("(")[1].split(",")[0]),n=Number(e.split(",")[1].replace(")","")),o=r+t.viz.clust.dim.width/2,a=n+t.viz.clust.dim.height/2;d3.select(t.root+" .play_button").attr("transform",function(){return"translate("+o+","+a+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o=t.params.viz;if("row"===e){var a=o.svg_dim.width-3*o.uni_margin;r=o.clust.margin.left+o.clust.dim.width+5.25*o.dendro_room.row,r>a&&(r=a),n=o.clust.margin.top+3*o.uni_margin-50}else r=2*o.uni_margin,n=o.clust.margin.top+o.clust.dim.height+o.dendro_room.col-2*o.uni_margin;d3.select(t.params.root+" ."+e+"_tree_group").attr("transform",function(){var t;return n-=75,t="translate("+r+","+n+")"}).style("opacity",1),d3.select(t.params.root+" ."+e+"_slider_group").attr("transform",function(){var t;return"row"===e?(r+=.8*o.dendro_room.row,n+=65,t="translate("+r+","+n+")"):t="translate("+r+","+n+"), rotate(-90)",t}).style("opacity",1)}},function(t,e){"use strict";t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=0;e>0&&(r=2e3);var n=d3.selectAll(t.root+" .horz_lines"),o=d3.selectAll(t.root+" .vert_lines");n.style("opacity",0).attr("transform",function(e){var r=e.row_index,n=t.viz.y_scale(r);return"translate( 0,"+n+") rotate(0)"}).transition().duration(e).delay(r).style("opacity",1),n.append("line").attr("x1",0).attr("x2",t.viz.clust.dim.width).style("stroke-width",function(){var e=t.viz.border_width.y;return e+"px"}),o.style("opacity",0).attr("transform",function(e){var r=e.col_index,n=t.viz.x_scale(r);return"translate("+n+") rotate(-90)"}).transition().duration(e).delay(r).style("opacity",1),o.append("line").attr("x1",0).attr("x2",-t.viz.clust.dim.height).style("stroke-width",function(){var e=t.viz.border_width.x;return e+"px"})}},function(t,e,r){"use strict";var n=r(181),o=r(100),a=r(182),i=r(183),s=r(184);t.exports=function(t){var e=t.params;d3.select(e.root+" .col_cat_outer_container").empty()?d3.select(e.root+" .col_container").append("g").attr("class","col_cat_outer_container").attr("transform",function(){var t=e.viz.norm_labels.width.col+2;return"translate(0,"+t+")"}).append("g").attr("class","col_cat_container"):d3.select(e.root+" .col_container").select("col_cat_outer_container").attr("transform",function(){var t=e.viz.norm_labels.width.col+2;return"translate(0,"+t+")"}),d3.selectAll(e.viz.root_tips+"_col_cat_tip").remove();var r=o().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_col_cat_tip";return r}).direction("s").offset([5,0]).style("display","none").html(function(t){return n(e,t,this,"col")});d3.select(e.root+" .col_cat_container").selectAll("g").data(e.network_data.col_nodes,function(t){return t.name}).enter().append("g").attr("class","col_cat_group").attr("transform",function(t){var r=_.indexOf(e.network_data.col_nodes_names,t.name);return"translate("+e.viz.x_scale(r)+",0)"}),d3.select(e.root+" .col_cat_container").selectAll(".col_cat_group").call(r),d3.selectAll(e.root+" .col_cat_group").each(function(){var t,n=this;_.each(e.viz.all_cats.col,function(o){var l=parseInt(o.split("-")[1],10),c="col_cat_rect_"+String(l);t=d3.select(n).select("."+c).empty()?d3.select(n).append("rect").attr("class",c).attr("cat",o).attr("transform",function(){var t=e.viz.cat_room.symbol_width+e.viz.cat_room.separation,r=l*t;return"translate(0,"+r+")"}).on("click",function(t){if(d3.select(this).classed("cat_strings")){var r=s(e,t,this,"col");$(e.root+" .dendro_info").modal("toggle");var n=r.join(", ");d3.select(e.root+" .dendro_info input").attr("value",n)}}):d3.select(n).select("."+c),t.attr("width",e.viz.x_scale.rangeBand()).attr("height",e.viz.cat_room.symbol_width).style("fill",function(t){var r=t[o],n=e.viz.cat_colors.col[o][r];return n}).on("mouseover",r.show).on("mouseout",function(){r.hide(this),a(e),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(e.viz,"col",t,o)})})}},function(t,e,r){"use strict";var n=r(141);t.exports=function(t,e,r,o){function a(){var e=!1;if(d3.select(r).classed("hovering")){var n=[o];t.viz.sim_mat&&(n=["row","col"]),_.each(n,function(r){"string"==typeof l&&l.indexOf("Not ")<0&&"false"!=l&&(e=!0),e&&d3.selectAll(t.root+" ."+r+"_cat_group").selectAll("rect").style("opacity",function(e){var r=d3.select(this).style("opacity");if(d3.select(this).classed("cat_strings")&&d3.select(this).classed("filtered_cat")===!1){var n,o=d3.select(this).attr("cat");n=e[o].indexOf(": ")>=0?e[o].split(": ")[1]:e[o],r=o===i&&n===l?t.viz.cat_colors.active_opacity:t.viz.cat_colors.opacity/4}return r})})}}d3.selectAll(t.viz.root_tips+"_col_cat_tip").style("display","block"),d3.selectAll(t.viz.root_tips+"_row_cat_tip").style("display","block");var i=d3.select(r).attr("cat"),s=n(t.viz,i,o),l=e[i];"string"==typeof l&&l.indexOf(": ")>=0&&(l=l.split(": ")[1]);var c=s+": "+l;return d3.select(r).classed("hovering",!0),setTimeout(a,500),c}},function(t,e){"use strict";t.exports=function(t){_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_cat_group").selectAll("rect").style("opacity",function(){var e=d3.select(this).style("opacity");return d3.select(this).classed("cat_strings")&&d3.select(this).classed("filtered_cat")===!1&&(e=t.viz.cat_colors.opacity),e})})}},function(t,e){"use strict";t.exports=function(t,e,r,n){function o(t){"string"==typeof t&&t.indexOf(i)>-1&&(t=t.split(i)[1]);var e=parseFloat(t);return e}var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=": ",s=t.cat_info[e][n].type;"cat_strings"===s?a?r.classed("cat_strings",!0).style("opacity",0).transition().duration(1e3).style("opacity",t.cat_colors.opacity):r.classed("cat_strings",!0).style("opacity",t.cat_colors.opacity):r.classed("cat_values",!0).style("opacity",function(r){var a=r[n],i=o(a);return t.cat_info[e][n].cat_scale(Math.abs(i))}).style("fill",function(e){var r,a=o(e[n]);return r=a>0?t.cat_value_colors[0]:t.cat_value_colors[1]})}},function(t,e,r){"use strict";var n=r(2);t.exports=function(t,e,r,o){var a=d3.select(r).attr("cat"),i=e[a],s=t.network_data[o+"_nodes"],l=_.filter(s,function(t){return t[a]==i}),c=n.pluck(l,"name");return c}},function(t,e,r){"use strict";var n=r(181),o=r(100),a=r(182),i=r(183),s=r(184);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.params;d3.select(r.root+" .row_cat_outer_container").empty()?d3.select(r.root+" .row_container").append("g").attr("class","row_cat_outer_container").attr("transform","translate("+r.viz.norm_labels.width.row+",0)").append("g").attr("class","row_cat_container"):d3.select(r.root+" .row_container").select("row_cat_outer_container").attr("transform","translate("+r.viz.norm_labels.width.row+",0)"),d3.select(r.root+" .row_cat_container").select(".white_bars").empty()?d3.select(r.root+" .row_cat_container").append("rect").attr("class","white_bars").attr("fill",r.viz.background_color).attr("width",r.viz.cat_room.row+"px").attr("height",function(){var t=r.viz.clust.dim.height;return t}):d3.select(r.root+" .row_cat_container").select(".white_bars").attr("fill",r.viz.background_color).attr("width",r.viz.cat_room.row+"px").attr("height",function(){var t=r.viz.clust.dim.height;return t}),d3.selectAll(r.viz.root_tips+"_row_cat_tip").remove();var l=o().attr("class",function(){var t=r.viz.root_tips.replace(".",""),e=t+" d3-tip "+t+"_row_cat_tip";return e}).direction("e").offset([5,0]).style("display","none").html(function(t){return n(r,t,this,"row")});d3.select(r.root+" .row_cat_container").selectAll("g").data(r.network_data.row_nodes,function(t){return t.name}).enter().append("g").attr("class","row_cat_group").attr("transform",function(t){var e=_.indexOf(r.network_data.row_nodes_names,t.name);return"translate(0, "+r.viz.y_scale(e)+")"}),d3.select(r.root+" .row_cat_container").selectAll(".row_cat_group").call(l);var c,u;d3.selectAll(r.root+" .row_cat_group rect").remove(),r.viz.show_categories.row&&d3.selectAll(r.root+" .row_cat_group").each(function(){u=this,_.each(r.viz.all_cats.row,function(t){var n=parseInt(t.split("-")[1],10),o="row_cat_rect_"+String(n);c=d3.select(u).select("."+o).empty()?d3.select(u).append("rect").attr("class",o).attr("cat",t):d3.select(u).select("."+o),c.attr("width",r.viz.cat_room.symbol_width).attr("height",r.viz.y_scale.rangeBand()).style("fill",function(e){var n=e[t],o=r.viz.cat_colors.row[t][n];return o}).attr("x",function(){var t=r.viz.cat_room.symbol_width+r.viz.uni_margin/2;return t+"px"}).attr("transform",function(){var t=r.viz.cat_room.symbol_width+r.viz.cat_room.separation,e=n*t;return"translate("+e+",0)"}).on("click",function(t){if(d3.select(this).classed("cat_strings")){var e=s(r,t,this,"row");$(r.root+" .dendro_info").modal("toggle");var n=e.join(", ");d3.select(r.root+" .dendro_info input").attr("value",n)}}).on("mouseover",l.show).on("mouseout",function(){l.hide(this),a(r),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(r.viz,"row",c,t,e)})})}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.dendro_room.row+e.viz.uni_margin,o=e.viz.clust.margin.left+e.viz.clust.dim.width,a=e.viz.clust.margin.top;d3.select(e.root+" .row_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").append("rect").classed("row_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",r+"px").attr("height",e.viz.svg_dim.height),d3.select(e.root+" .row_dendro_outer_container").append("g").attr("class","row_dendro_container").attr("transform","translate("+e.viz.uni_margin/2+",0)")):(d3.select(e.root+" .viz_svg").select("row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").select(".row_dendro_spillover").attr("width",r+"px").attr("height",e.viz.svg_dim.height)),n(t,"row",!1),"clust"!=e.viz.inst_order.col&&d3.selectAll(e.root+" .row_dendro_group").remove()}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.clust.margin.left,o=e.viz.clust.margin.top+e.viz.clust.dim.height,a=e.viz.dendro_room.col+e.viz.uni_margin;d3.select(e.root+" .col_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","col_dendro_outer_container").attr("transform","translate("+r+","+o+")"),d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",a+"px"),d3.select(e.root+" .col_dendro_outer_container").append("g").attr("class","col_dendro_container").attr("transform","translate(0,"+e.viz.uni_margin/2+")"), +d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover_top",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height).attr("transform","translate(0,"+e.viz.dendro_room.col+")")):(d3.select(e.root+" .viz_svg").select("col_dendro_outer_container").attr("transform","translate("+r+","+o+")"),d3.select(e.root+" .col_dendro_outer_container").select(".col_dendro_spillover").attr("width",e.viz.svg_dim.width).attr("height",a+"px")),n(t,"col",!1),"clust"!=e.viz.inst_order.row&&d3.selectAll(e.root+" .col_dendro_group").remove()}},function(t,e,r){"use strict";var n=r(189);r(191);t.exports=function(t){n(t,"row"),n(t,"col")}},function(t,e,r){"use strict";var n=r(190),o=r(178);t.exports=function(t,e){function r(){t.params.is_slider_drag=!0;var r=d3.event.y;r<0&&(r=0),r>i&&(r=i),this.nextSibling&&this.parentNode.appendChild(this),r=d3.round(r,-1);var o=10-r/10;d3.select(this).attr("transform","translate(0, "+r+")"),n(t,e,o)}function a(){var r=d3.mouse(this),o=d3.round(r[1],-1);d3.select(t.params.root+" ."+e+"_group_circle").attr("transform","translate(0, "+o+")");var a=10-o/10;n(t,e,a)}var i=100,s=d3.behavior.drag().on("drag",r).on("dragend",function(){t.params.is_slider_drag=!1}),l=d3.select(t.params.root+" .viz_svg").append("g").classed(e+"_slider_group",!0);o(t,e);var c=i+20,u=30;l.append("rect").classed(e+"_slider_background",!0).attr("height",c+"px").attr("width",u+"px").attr("fill",t.params.viz.background_color).attr("transform",function(){var t="translate(-10, -5)";return t}).style("opacity",0),l.append("line").style("stroke-width",i/7+"px").style("stroke","black").style("stroke-linecap","round").style("opacity",0).attr("y1",0).attr("y2",function(){return i-2}).on("click",a);var d=-i/40;l.append("path").style("fill","black").attr("transform","translate("+d+", 0)").attr("d",function(){var t=0,e=0,r=0,n=i,o=i/10,a=0,s="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return s}).style("opacity",.35).on("click",a);var f=.35,p=.6;l.append("circle").classed(e+"_group_circle",!0).attr("r",.08*i).attr("transform",function(){return"translate(0, "+i/2+")"}).style("fill","blue").style("opacity",f).on("mouseover",function(){d3.select(this).style("opacity",p)}).on("mouseout",function(){d3.select(this).style("opacity",f)}).call(s)}},function(t,e,r){"use strict";var n=r(107);t.exports=function(t,e,r){var o=t.params;"row"===e?o.group_level.row=r:"col"===e&&(o.group_level.col=r);var a=!0;n(t,e,a)}},function(t,e,r){"use strict";var n=r(178),o=r(100),a=r(192);t.exports=function(t,e){e="row";var r=40,i=t.params,s=.35,l=.6,c=o().attr("class",function(){var t=i.viz.root_tips.replace(".",""),e=t+"_tree_menu_tip d3-tip";return e}).direction("sw").style("display","none").offset([-10,-5]).html(function(){return"Clustering Menu"}),u=d3.select(i.root+" .viz_svg").append("g").classed(e+"_tree_group",!0).on("mouseover",function(){d3.select(i.root+" .tree_menu").empty()&&(d3.selectAll(i.viz.root_tips+"_tree_menu_tip").style("opacity",1).style("display","block"),c.show()),d3.selectAll(i.root+" .tree_leaf_circle").style("opacity",l)}).on("mouseout",function(){c.hide(),d3.selectAll(i.root+" .tree_leaf_circle").style("opacity",s)}).call(c),d=u.append("g").classed("dendro_tree_container",!0).on("click",function(){d3.select(i.root+" .tree_menu").empty()?(a(t,"open"),c.hide()):a(t,"close")});d3.select(i.root+" .dendro_tree_container").attr("transform","scale(0.9)"),n(t,e);var f=0,p=20;d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=0,e=r,n=p/2,o=0,a=p,i=r,s="M"+t+","+e+", L"+n+", "+o+", L"+a+","+i+" Z";return s}).style("opacity",.35);var _=30;d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=4.3,e=23,r=-5,n=_/2.5,o=5.8,a=_/1.8,i="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return i}).style("opacity",.35),d.append("path").style("fill","black").attr("transform","translate("+f+", 0)").attr("d",function(){var t=15.7,e=23,r=25,n=_/2.5,o=14.2,a=_/1.8,i="M"+t+","+e+", L"+r+", "+n+", L"+o+","+a+" Z";return i}).style("opacity",.35);var h=13,v=9.5;d.selectAll().data([[-3,h,v],[p/2,0,17],[23,h,v]]).enter().append("circle").classed("tree_leaf_circle",!0).attr("r",function(t){return t[2]}).attr("transform",function(t){return"translate("+t[0]+", "+t[1]+")"}).attr("fill","blue").attr("opacity",s).attr(""),d.append("rect").attr("width",50).attr("height",62).attr("transform",function(){return"translate(-15, -19)"}).attr("opacity",0)}},function(t,e,r){"use strict";var n=r(193);t.exports=function(t,e){var r=t.params;"open"===e?n(t):"close"===e&&(d3.select(r.root+" .tree_menu").transition(700).attr("opacity",0),setTimeout(function(){d3.select(r.root+" .tree_menu").remove()},700))}},function(t,e,r){"use strict";var n=r(194);t.exports=function(t){function e(t){return t.charAt(0).toUpperCase()+t.slice(1)}var r=t.params,o=475,a=d3.select(r.root+" .viz_svg").append("g").attr("transform",function(){var t={};return t.x=r.viz.clust.dim.width+r.viz.clust.margin.left-o+25,t.y=r.viz.clust.margin.top,"translate("+t.x+", "+t.y+")"}).classed("tree_menu",!0);a.attr("opacity",0).transition().attr("opacity",1),a.append("rect").classed("tree_menu_background",!0).attr("width",function(){var t=o;return t}).attr("height",function(){var t=500;return t}).attr("fill","white").attr("stroke","#A3A3A3").attr("stroke-width","3px").attr("opacity",.95),a.append("text").classed("tree_menu_title",!0).attr("transform","translate(20,30)").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-size","18px").attr("font-weight",800).attr("cursor","default").text("Clustering Menu");var i=["cosine","euclidean","correlation","jaccard"],s=30,l=110,c=80;a.append("text").attr("transform","translate(25, 70)").attr("font-size","18px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("cursor","default").text("Distance Metric"),a.append("rect").classed("tree_menu_line",!0).attr("height","2px").attr("width","435px").attr("stroke-width","3px").attr("opacity",.3).attr("fill","black").attr("transform","translate(20,"+c+")");var u=a.append("g").attr("transform","translate(20,"+l+")").classed("distance_section",!0),d=u.selectAll("g").data(i).enter().append("g").attr("transform",function(t,e){var r=e*s,n="translate(0,"+r+")";return n}).on("click",function(e){d3.select(r.root+" .tree_menu").transition(700).attr("opacity",0),setTimeout(function(){d3.select(r.root+" .tree_menu").remove()},700),t.params.matrix.distance_metric=e,n(t,e)});d.append("circle").attr("cx",10).attr("cy",-6).attr("r",7).style("stroke","#A3A3A3").style("stroke-width","2px").style("fill",function(e){var r="white";return e===t.params.matrix.distance_metric&&(r="red"),r}),d.append("text").attr("transform","translate(25,0)").style("font-size","16px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("cursor","default").text(function(t){return e(t)})}},function(t,e,r){"use strict";var n=r(195),o=r(12),a=o.create(),i=r(199),s=r(200),l=r(202);a.import(r(227)),a.import(r(25)),t.exports=function(t,e){var r={};r.N_row_sum="null",r.N_row_var="null",r.dist=e,r.nodes={},r.nodes.row_nodes=$.extend(!0,[],t.params.network_data.row_nodes),r.nodes.col_nodes=$.extend(!0,[],t.params.network_data.col_nodes),_.each(["row","col"],function(o){var l,c,u,d=a.transpose;"row"===o?(l=$.extend(!0,[],t.params.network_data.mat),c=t.params.network_data.row_nodes_names,u="row_nodes"):"col"===o&&(l=$.extend(!0,[],t.params.network_data.mat),l=d(l),c=t.params.network_data.col_nodes_names,u="col_nodes");for(var f,p,_=n.hcluster(l,i[e]),h=s(_,c),v=r.nodes[u],m=0;m=this.threshold)return!1;var a=this.index[t],i=this.index[this.mins[t]],s={dist:e,left:a,right:i,key:a.key,size:a.size+i.size};this.tree[a.index]=s,this.tree.splice(i.index,1),this.index[a.key]=s;for(var r=0;rthis.dists[i.key][l.key]&&(o=this.dists[i.key][l.key])):"complete"==this.linkage?(o=this.dists[a.key][l.key],this.dists[a.key][l.key]r&&(r=t.dist,e=t)}),e}function r(t){return 1===t.size?[t.value]:r(t.left).concat(r(t.right))}(t>this.tree.size||t<1)&&(t=this.tree.size);for(var n=[],o=[this.tree];t>1;){var a=e(o);o.splice(o.indexOf(a),1),o.push(a.left,a.right),t--}return o.forEach(function(t){n.push(r(t))}),n}};var a=function(t,e,r,n,a,i){var s=new o(e,r,n),l=s.tree(t,a,i);return{hc:s,tree:void 0===n?l[0]:l,clusters:s.clusters}};t.exports=a},function(t,e){"use strict";t.exports={euclidean:function(t,e){for(var r=0,n=0;ne&&(e=t)})}),e}},function(t,e,r){"use strict";var n=r(203),o=r(225);t.exports=function(t,e,r){var a={};a[e]=r,n(t,a),o(t,e,r)}},function(t,e,r){"use strict";var n=r(10),o=r(204),a=r(205);t.exports=function(t,e){o(t.params);var r=n(t.config,t.params,e);d3.select(t.params.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!0).classed("fa-undo",!1).classed("active_cropping",!1),_.each(["row","col"],function(e){d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter",!1),d3.select(t.params.root+" ."+e+"_dendro_icons_container").style("display","block")}),a(t,r)}},function(t,e){"use strict";t.exports=function(t){d3.selectAll(t.root+" .btn").attr("disabled",!0),d3.select(t.viz.viz_svg).style("opacity",.7)}},function(t,e,r){"use strict";var n=r(9),o=r(206),a=r(207),i=r(151),s=r(180),l=r(185),c=r(186),u=r(187),d=r(218),f=r(220),p=r(161),_=r(221),h=r(150),v=r(222),m=r(153),g=r(224),y=r(84);t.exports=function(t,e){function r(){d3.selectAll(".dendro_shadow").remove()}function w(){d3.select(t.params.viz.viz_svg).transition().duration(250).style("opacity",1),setTimeout(x,1e3)}function x(){d3.select(t.params.viz.viz_svg).classed("running_update",!1)}d3.select(t.params.viz.viz_svg).classed("running_update",!0),d3.selectAll(t.params.root+" .ds"+String(t.params.viz.ds_level)+"_row").remove(),null!=t.params.matrix_update_callback&&t.params.matrix_update_callback();var b=t.params.matrix.distance_metric,z=t.params.group_level,k=t.params.crop_filter_nodes,A=jQuery.extend(!0,{},t.config),E=null;if(null!=t.params.new_row_cats){v(t.params.new_row_cats,e.row_nodes),E=t.params.new_row_cats,t.params.new_row_cats=E;var N=!0;t.params.viz=y(t.params,t.params.viz,N)}A.network_data=e,A.inst_order=t.params.viz.inst_order,A.input_domain=t.params.matrix.opacity_scale.domain()[1],_(A,t.params),A.ini_view=null,A.current_col_cat=t.params.current_col_cat,A.cat_colors=t.params.viz.cat_colors;var M=n(A),S=o(t.params,M);t.params=M,t.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,t.params.viz.square_zoom*t.params.viz.zoom_ratio.x]).on("zoom",function(){m(t)}),t.params.matrix.distance_metric=b,t.params.group_level=z,t.params.crop_filter_nodes=k,0===t.params.viz.ds_num_levels?a(t,e,S):g(t),d3.select(t.params.viz.viz_svg).style("opacity",.7),l(t),h(t),t.params.viz.show_categories.col&&s(t),t.params.viz.show_dendrogram&&(c(t),u(t)),i(t),d3.select(t.params.viz.viz_svg).call(t.params.zoom_behavior),p(t),d(t),t.params.viz.run_trans=!0,setTimeout(f,2500,t.params),setTimeout(r,50),setTimeout(r,100),setTimeout(r,500),setTimeout(r,1e3),setTimeout(r,1500),setTimeout(w,S.enter)}},function(t,e){"use strict";t.exports=function(t,e){var r=t.network_data.row_nodes,n=t.network_data.col_nodes,o=_.map(r,function(t){return t.name}),a=_.map(n,function(t){return t.name}),i=o.concat(a),s=e.network_data.row_nodes,l=e.network_data.col_nodes,c=_.map(s,function(t){return t.name}),u=_.map(l,function(t){return t.name}),d=c.concat(u),f=_.difference(i,d).length,p=_.difference(d,i).length,h={};f>0?h.update=1e3:h.update=0,p>0?h.enter=1e3:h.enter=0,h.enter=h.enter+h.update,h.run_transition=!0;var v=t.network_data.links.length,m=e.network_data.links.length,g=.5*e.matrix.def_large_matrix;return(v>g||m>g)&&(h.run_transition=!1,h.update=0,h.enter=0),h}},function(t,e,r){"use strict";var n=r(208),o=r(101),a=r(131),i=r(209),s=r(213),l=r(91),c=r(214),u=r(217),d=r(145),f=r(100);t.exports=function(t,e,r){var p=t.params;d3.selectAll(p.viz.root_tips).remove();var _=f().attr("class",function(){var t=p.viz.root_tips.replace(".",""),e=t+" d3-tip "+t+"_tile_tip";return e}).direction("nw").offset([0,0]).style("display","none").html(function(t){var e,r=String(t.value.toFixed(3));if(p.keep_orig){var n=String(t.value_orig.toFixed(3));e="

"+t.row_name+" and "+t.col_name+"

normalized value: "+r+"

original value: "+n+"
"}else e="

"+t.row_name+" and "+t.col_name+"

value: "+r+"
";return e});d3.select(p.root+" .clust_group").call(_),u(p);for(var h=1e3,v=e.row_nodes,m=e.col_nodes,g=e.links,y=g,w=0;w1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null===r&&(r={},r.enter=0,r.update=0,r.run_transition=!1);var b=t.params,z=t.params.network_data.row_nodes;b.zoom_info=x();var k=b.network_data.row_nodes_names;s(b),b=a(b),b.viz=i(b.viz),b.viz=o(b.viz),b.sim_mat&&(b.viz.clust.dim.width<=b.viz.clust.dim.height?b.viz.clust.dim.height=b.viz.clust.dim.width:b.viz.clust.dim.width=b.viz.clust.dim.height),b.viz=w(b.viz),b.viz.x_scale.rangeBands([0,b.viz.clust.dim.width]),b.viz.y_scale.rangeBands([0,b.viz.clust.dim.height]),b.viz.square_zoom=b.viz.norm_labels.width.col/(b.viz.x_scale.rangeBand()/2),b.zoom_behavior.scaleExtent([1,b.viz.square_zoom*b.viz.zoom_ratio.x]),b.viz.border_width.x=b.viz.x_scale.rangeBand()/b.viz.border_fraction,b.viz.border_width.y=b.viz.y_scale.rangeBand()/b.viz.border_fraction,b=y(b);var A=d3.select(b.viz.viz_wrapper).select("svg");A.select(b.root+" .grey_background").transition().delay(r.update).duration(e).attr("width",b.viz.clust.dim.width).attr("height",b.viz.clust.dim.height),d(b,A,r),A.selectAll(".row_label_group").select("text").style("font-size",b.labels.default_fs_row+"px").text(function(t){return n.normal_name(t)}),A.selectAll(".row_label_group").each(function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",b.viz.y_scale.rangeBand()).style("fill","yellow").style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),f(b,A,r),r.run_transition?(A.selectAll(".row_label_group").select("text").transition().delay(r.update).duration(e).attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,function(t){return t.name}).transition().delay(r.update).duration(e).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}),A.selectAll(".row_cat_group").select("path").transition().delay(r.update).duration(e).attr("d",function(){var t=b.viz.cat_room.symbol_width-1,e=0,r=1,n=b.viz.y_scale.rangeBand()/2,o=b.viz.cat_room.symbol_width-1,a=b.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+n+", L "+o+","+a+" Z";return i}),A.selectAll(".row_dendro_group").data(z,function(t){return t.name}).transition().delay(r.update).duration(e).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})):(A.selectAll(".row_label_group").select("text").attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}),A.selectAll(".row_cat_group").select("path").attr("d",function(){var t=b.viz.cat_room.symbol_width-1,e=0,r=1,n=b.viz.y_scale.rangeBand()/2,o=b.viz.cat_room.symbol_width-1,a=b.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+n+", L "+o+","+a+" Z";return i}),A.selectAll(".row_dendro_group").data(z,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})),n.has(b.network_data.row_nodes[0],"value")&&g(t,A),p(b,A,r),h(b,A),v(b,A,r),m(b,A,r),l(b,A,r),c(b,A,r),u(b.viz,A,r),b.zoom_behavior.scale(1).translate([b.viz.clust.margin.left,b.viz.clust.margin.top])}},function(t,e,r){"use strict";var n=r(210),o=r(211),a=r(212),i=r(97),s=r(98),l=r(99),c=r(68);t.exports=function(t,e,r,u,d,f){var p=e.row_data,h=_.filter(p,function(t){return 0!=t.value}),v=d3.select(d).selectAll(".tile").data(h,function(t){return t.col_name});n(t,r,v,p,d);var m=v.on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).attr("fill-opacity",function(e){var r=t.matrix.opacity_scale(Math.abs(e.value));return r}):l.style("fill",function(e){return e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).attr("fill-opacity",function(e){var r=t.matrix.opacity_scale(Math.abs(e.value));return r}),l.each(function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e,r){"use strict";var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99);t.exports=function(t,e,r,l,c,u,d){var f=_.filter(e,function(t){return 0!=t.value_up||0!=t.value_dn}),p=d3.select(r).selectAll(".tile_up").data(f,function(t){return t.col_name}),h=p.on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e){"use strict";t.exports=function(t,e,r){var n=t.network_data.row_nodes,o=t.network_data.col_nodes,a=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).exit();e.run_transition?a.transition().duration(r).style("opacity",0).remove():a.style("opacity",0).remove(),d3.selectAll(t.root+" .row_label_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_cat_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_dendro_group").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_text").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .horz_lines").data(n,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .vert_lines").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_cat_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_dendro_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove()}},function(t,e,r){"use strict";var n=r(215);t.exports=function(t,e,r,o){var a=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).enter().append("g").classed("row",!0).attr("transform",function(e){return"translate(0,"+t.viz.y_scale(e.row_index)+")"});a.each(function(a){n(t,a,e,r,o,this)})}},function(t,e,r){"use strict";var n=r(216),o=r(97),a=r(98),i=r(99);t.exports=function(t,e,r,s,l,c){var u=e.row_data,d=_.filter(u,function(t){return 0!==t.value}),f=d3.select(c).selectAll("rect").data(d,function(t){return t.col_name}).enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",t.viz.rect_height).style("fill",function(e){return e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).on("mouseover",function(){for(var e=arguments.length,r=Array(e),n=0;n0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r});var f=d3.select(r).selectAll(".tile_dn").data(u,function(t){return t.col_name}).enter().append("path").attr("class","tile_dn").attr("d",function(){return o(t)}).attr("transform",function(e){return a(t,e)}).style("fill",function(){return t.matrix.tile_colors[1]}).on("mouseover",function(e){d3.selectAll(t.root+" .row_label_group text").classed("active",function(t){return e.row_name===t.name}),d3.selectAll(t.root+" .col_label_text text").classed("active",function(t){return e.col_name===t.name}),t.matrix.show_tile_tooltips&&i.show(e)}).on("mouseout",function(){d3.selectAll(t.root+" text").classed("active",!1),t.matrix.show_tile_tooltips&&i.hide()});f.style("fill-opacity",0).transition().delay(s.enter).duration(l).style("fill-opacity",function(e){var r=0;return Math.abs(e.value_up)>0&&(r=t.matrix.opacity_scale(Math.abs(e.value_dn))),r}),c.each(function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}},function(t,e){"use strict";t.exports=function(t){d3.select(t.root+" .clust_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.clust.margin.top+")"),d3.select(t.root+" .col_label_outer_container").attr("transform","translate(0,"+t.viz.norm_labels.width.col+")"),d3.select(t.root+" .col_cat_outer_container").attr("transform",function(){var e=t.viz.norm_labels.width.col+2;return"translate(0,"+e+")"})}},function(t,e,r){"use strict";var n=(r(190),r(143)),o=r(142),a=r(219);t.exports=function(t){function e(e,r){var n=2-r,o=t.params.matrix.abs_max_val*n;t.params.matrix.opacity_scale.domain([0,o]),d3.selectAll(t.params.root+" .tile").style("fill-opacity",function(e){var r=t.params.matrix.opacity_scale(Math.abs(e.value));return r})}var r=t.params,i=d3.select(r.root+" .gene_search_box")[0][0],s=new Awesomplete(i,{minChars:1,maxItems:15}),l=t.params.network_data.row_nodes_names;s.list=l,d3.selectAll(".awesomplete ul").style("z-index",99),$(r.root+" .gene_search_box").keyup(function(e){if(13===e.keyCode){var n=$(r.root+" .gene_search_box").val();a(t,n,l)}}),$(r.root+" .submit_gene_button").off().click(function(){var e=$(r.root+" .gene_search_box").val();a(t,e,l)});var c;if(c=r.sim_mat?["both"]:["row","col"],_.each(c,function(e){$(r.root+" .toggle_"+e+"_order .btn").off().click(function(o){var a=$(o.target).attr("name").replace("_row","").replace("_col","");d3.selectAll(r.root+" .toggle_"+e+"_order .btn").classed("active",!1),d3.select(this).classed("active",!0),"both"!=e?n(t,a,e):(n(t,a,"row"),n(t,a,"col"))})}),o(t),d3.select(t.params.root+" .opacity_slider").select("#handle-one").empty()){var u=d3.slider().snap(!0).value(1).min(.1).max(1.9).step(.1).on("slide",function(t,r){e(t,r)});d3.select(t.params.root+" .opacity_slider").call(u)}}},function(t,e,r){"use strict";var n=r(144);t.exports=function(t,e,r){var o="name";if(r.indexOf(e)!==-1){d3.selectAll(t.params.root+" .row_label_group").select("rect").style("opacity",0);var a=_.indexOf(r,e),i=t.params.viz.y_scale(a),s=t.params.viz.clust.dim.height/2-i,l=t.params.viz.zoom_ratio.x; +n(t,0,s,l),t.params.zoom_info.zoom_y=l,d3.selectAll(t.params.root+" .row_label_group").filter(function(t){return t[o]===e}).select("rect").style("opacity",1)}}},function(t,e){"use strict";t.exports=function(t){t.dendro_filter.row===!1&&"clust"===t.viz.inst_order.col&&d3.select(t.root+" .row_slider_group").style("opacity",1).style("pointer-events","all"),d3.selectAll(t.root+" .toggle_row_order .btn").attr("disabled",null),t.dendro_filter.col===!1&&"clust"===t.viz.inst_order.row&&d3.select(t.root+" .col_slider_group").style("opacity",1).style("pointer-events","all"),d3.selectAll(t.root+" .toggle_col_order .btn").attr("disabled",null),d3.selectAll(t.root+" .gene_search_button .btn").attr("disabled",null),t.viz.run_trans=!1}},function(t,e){"use strict";t.exports=function(t,e){_.each(["row","col"],function(r){var n;n="row"===r?"col":"row",d3.selectAll(e.root+" .toggle_"+n+"_order .btn").filter(function(){return d3.select(this).attr("name")===t.inst_order[r]}).classed("active",!0)})}},function(t,e,r){"use strict";var n=r(223),o=r(2),a=r(68);t.exports=function(t,e){var r,i,s,l,c,u,d,f,p=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=0,v=0;_.each(e,function(e){l=e.name,p===!0&&(l.indexOf(" ")?l=l.split(" ")[0]:l.indexOf("_")&&(l=l.split("_")[0])),h=0,n(e),_.each(t,function(t){if(r=t.cat_title,i=t.cats,c="false",v=-1,f=0,_.each(i,function(t){u=t.cat_name,s=t.members,a.contains(s,l)&&(c=u,v=f),f+=1}),o.has(t,"pval")){var n=t.pval.toExponential();d=r+": "+c+"

Pval "+String(n)+"

"}else d=r.indexOf("cat-")===-1?r+": "+c:c;e["cat-"+String(h)]=d,e["cat_"+String(h)+"_index"]=v,h+=1})})}},function(t,e){"use strict";t.exports=function(t){var e=_.keys(t);_.each(e,function(e){e.indexOf("cat-")>-1&&delete t[e],e.indexOf("cat_")>-1&&delete t[e]})}},function(t,e,r){"use strict";var n=r(208),o=r(131),a=r(134),i=r(217);t.exports=function(t){d3.selectAll(t.params.root+" .row_cat_group").remove(),d3.selectAll(t.params.root+" .row_label_group").remove(),d3.selectAll(t.params.root+" .row").remove();var e=!0,r=!0,s=!0;a(t,e,r,s),o(t);var l=t.params.network_data.col_nodes;d3.selectAll(t.params.root+" .col_label_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_label_text").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_cat_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_dendro_group").data(l,function(t){return t.name}).exit().style("opacity",0).remove(),i(t.params);var c={};c.enter=0,c.update=0,c.run_transition=!1;var u=0;n(t,u,c)}},function(t,e,r){"use strict";var n=r(226);t.exports=function(t,e,r){var o,a,i=t.params;d3.select(i.root+" .slider_"+e).attr("current_state",r),_.each(_.keys(i.viz.possible_filters),function(r){if(o=e.indexOf("row")>-1?"row":e.indexOf("col")>-1?"col":"neither",a=r.indexOf("row")>-1?"row":r.indexOf("col")>-1?"col":"neither",e!=r&&"neither"!=o&&o==a){var s=n(i,r);t.slider_functions[r].value(0),d3.select(i.root+" .title_"+r).text(s.text+s.state),d3.select(i.root+" .slider_"+r).attr("current_state",s.state)}});var s=n(i,e);d3.select(i.root+" .title_"+e).text(s.text+r+s.suffix)}},function(t,e,r){"use strict";var n=r(5);t.exports=function(t,e){var r={},o={},a={};return r.state=n(t.viz.filter_data,e),a.top=e.split("_")[0],a.node=e.split("_")[1],a.measure=e.split("_")[2],"row"===a.node?o.node="rows":o.node="columns","N"===a.top&&(r.suffix=""),"pct"===a.top&&(r.suffix="%"),"sum"==a.measure?o.measure="sum":"var"==a.measure&&(o.measure="variance"),"sum"===a.measure&&(r.text="Top "+o.node+" "+o.measure+": "),"var"===a.measure&&(r.text="Top "+o.node+" "+o.measure+": "),_.keys(t.viz.possible_filters).indexOf("enr_score_type")>-1&&"col"===a.node&&(r.text="Top Enriched Terms: ",r.suffix=""),r}},function(t,e,r){"use strict";function n(t,e,n,i){var s=r(45),l=n(r(43)),c=t.DenseMatrix,u=t.SparseMatrix,d=i("transpose",{Array:function(t){return d(l(t)).valueOf()},Matrix:function(t){var e,r=t.size();switch(r.length){case 1:e=t.clone();break;case 2:var n=r[0],o=r[1];if(0===o)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+a(r)+")");switch(t.storage()){case"dense":e=f(t,n,o);break;case"sparse":e=p(t,n,o)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+a(this._size)+")")}return e},any:function(t){return o(t)}}),f=function(t,e,r){for(var n,a=t._data,i=[],s=0;s2&&void 0!==arguments[2]?arguments[2]:4e3;e.indexOf("slider")<0?d3.select(t.root+" ."+e).style("background","#007f00").style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("background","#FFFFFF").style("box-shadow","none"):d3.select(t.root+" ."+e).style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("box-shadow","none")}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(144);t.exports=function(){function t(t){var e=t.params,s="Search for rows using\nthe search box";n(e,s,5e3);var l=2500;setTimeout(o,l,e,"gene_search_container"),setTimeout(r,l+1e3,e,"E"),setTimeout(r,l+1500,e,"EG"),setTimeout(r,l+2e3,e,"EGF"),setTimeout(r,l+2500,e,"EGFR"),setTimeout(i,5500,e),setTimeout(a,7500,t,0,0,1)}function e(){return 1e4}function r(t,e){$(t.root+" .gene_search_box").val(e),$(t.root+" .gene_search_box").autocomplete("search",e)}function i(t){$(t.root+" .submit_gene_button").click(),$(t.root+" .gene_search_box").autocomplete("search","")}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(203);t.exports=function(){function t(t){var e=t.params,a="Filter rows based on sum or\nvariance using the sliders";n(e,a,4e3);var i="N_row_sum";setTimeout(o,5e3,e,"slider_"+i,13e3),a="Filter: Top 20 rows by sum",setTimeout(n,5e3,e,a,4e3),setTimeout(r,5300,t,i,20,1),a="Filter: Top 10 rows by sum",setTimeout(n,1e4,e,a,4e3),setTimeout(r,10300,t,i,10,2),a="Filter: All rows",setTimeout(n,15e3,e,a,4e3),setTimeout(r,15300,t,i,"all",0)}function e(){return 19500}function r(t,e,r,n){var o=t.params,i={};i[e]=r,a(t,i),$(o.root+" .slider_"+e).slider("value",n);var s;s="N_row_sum"===e?"sum":"variance",d3.select(o.root+" .title_"+e).text("Top rows "+s+": "+r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(235);t.exports=function(){function t(t){var e=Number(d3.select(t.root+" .expand_button").attr("x").replace("px","")),a=Number(d3.select(t.root+" .expand_button").attr("y").replace("px","")),i=0,s=400;setTimeout(n,i,t,"single",e,a),setTimeout(r,s,t),setTimeout(o,1500,t)}function e(){return 3500}function r(t){$(t.root+" .expand_button").d3Click()}function o(t){a(t,"row","clust"),a(t,"col","clust")}function a(t,e,r){var n=d3.selectAll(".toggle_"+e+"_order .btn").filter(function(){return this.__data__==r})[0];$(n).click()}return jQuery.fn.d3Click=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(238),a=r(190);t.exports=function(){function t(t){var e="Identify row and column groups\nof varying sizes using the\nsliders and dendrogram";n(t,e,1e4),setTimeout(o,3e3,t,"slider_col",7e3),setTimeout(r,4e3,t,"row",3),setTimeout(r,5e3,t,"row",4),setTimeout(r,6e3,t,"row",5),setTimeout(r,7e3,t,"row",6),setTimeout(r,8e3,t,"row",7),setTimeout(r,9e3,t,"row",5)}function e(){return 11e3}function r(t,e,r){$(cgm.params.root+" .slider_col").slider("value",r/10),a(cgm,e,r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(235);t.exports=function(){function t(t){var e="Row and column categories\ncan be use to reorder\nby double-clicking";n(t,e,7e3);var a=d3.selectAll(t.root+" .col_cat_super").filter(function(){return"cat-1"===this.__data__})[0],i=d3.select(".col_cat_super").attr("transform"),s=Number(i.split("(")[1].split(",")[0].replace(")",""))+20,l=Number(i.split(",")[1].replace(")","")),c=4e3;setTimeout(o,c,t,"double",s,l);var u=c+300;setTimeout(r,u,t,a)}function e(){return 8e3}function r(t,e){$(e).d3DblClick()}return jQuery.fn.d3DblClick=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("dblclick",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(232),o=r(245);t.exports=function(){function t(t){var r="Clustergrammer is built with gene\nexpression data in mind and interfaces\nwith several Ma'ayan lab web tools",o="The example data being visualized is\ngene expression data obtained from the\nCancer Cell Line Encyclopedia",a="For more information please view\nthe help documentation";setTimeout(n,0,t,r,4500),setTimeout(n,4500,t,o,4500),setTimeout(n,9e3,t,a,4500),setTimeout(e,14e3,t)}function e(t){d3.select(t.root+" .play_button").classed("running_demo",!1),o(t,!0)}function r(){return 12e3}return{run:t,get_duration:r}}},function(t,e){"use strict";t.exports=function(t,e){e===!1?d3.select(t.root+" .play_button").transition().duration(500).style("opacity",0):(d3.select(t.root+" .play_button").transition().duration(500).style("opacity",1),$.unblockUI())}},function(t,e,r){"use strict";var n=r(232),o=r(235);t.exports=function(){function t(t){var e="View additional controls\nby clicking the menu button";n(t,e,4e3);var a=Number(d3.select(t.root+" .expand_button").attr("x").replace("px","")),i=Number(d3.select(t.root+" .expand_button").attr("y").replace("px","")),s=3e3,l=3400;setTimeout(o,s,t,"single",a,i),setTimeout(r,l,t)}function e(){return 5e3}function r(t){$(t.root+" .expand_button").d3Click()}return jQuery.fn.d3Click=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},jQuery.fn.d3DblClick=function(){this.each(function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("dblclick",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)})},{run:t,get_duration:e}}},function(t,e,r){"use strict";var n=r(248),o=r(249);t.exports=function(){var t=this,e=t.params;n(t);var r=30;o(e,r)}},function(t,e,r){"use strict";var n=r(177);t.exports=function(t){var e=t.params;if(d3.select(e.root+" .play_button").empty()){var r=d3.select(e.root+" .viz_svg").append("g").classed("play_button",!0).classed("running_demo",!1);n(e),r.append("circle").style("r",45).style("fill","white").style("stroke","black").style("stroke-width","3px").style("opacity",.5),r.append("path").attr("d",function(){var t=40,e=22,r=15;return"M-"+r+",-"+e+" l "+t+","+e+" l -"+t+","+e+" z "}).style("fill","black").style("opacity",.5),r.on("mouseover",function(){d3.select(this).select("path").style("fill","red").style("opacity",1),d3.select(this).select("circle").style("opacity",1)}).on("mouseout",function(){d3.select(this).select("path").style("fill","black").style("opacity",.5),d3.select(this).select("circle").style("opacity",.5)}).on("click",function(){t.play_demo()})}}},function(t,e){"use strict";t.exports=function(t,e){if(d3.select(t.root+" .demo_group").empty()){var r=d3.select(t.root+" .clust_container").attr("transform"),n=Number(r.split("(")[1].split(",")[0]),o=Number(r.split(",")[1].replace(")","")),a=d3.select(t.root+" .viz_svg").append("g").classed("demo_group",!0).attr("transform",function(){var t=n+20,e=o+40;return"translate("+t+","+e+")"});a.append("rect").classed("rect_1",!0),a.append("rect").classed("rect_2",!0),a.append("rect").classed("rect_3",!0);var i=1.3*e;a.append("text").attr("id","text_1").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),a.append("text").attr("id","text_2").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",function(){return"translate(0,"+String(i)+")"}),a.append("text").attr("id","text_3").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",function(){return"translate(0,"+String(2*i)+")"})}}},function(t,e,r){"use strict";var n=r(11),o=r(205);t.exports=function(t){var e=n(this.config,t);o(this,e)}},function(t,e,r){"use strict";var n=r(11),o=r(205);t.exports=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=r===!1?this:r;var a,i=e.params,s={};_.each(["row","col"],function(e){var r=i.inst_nodes[e+"_nodes"];if(_.has(t,e))if(t[e].length>0){var n=t[e];a=$.grep(r,function(t){return $.inArray(t.name,n)>-1})}else a=r;else a=r;s[e+"_nodes"]=a});var l=e.params.network_data.row_nodes,c=e.params.network_data.col_nodes,u=n(e.config,s);o(e,u),l.length>e.params.inst_nodes.row_nodes.length&&(e.params.inst_nodes.row_nodes=l),c.length>e.params.inst_nodes.col_nodes.length&&(e.params.inst_nodes.col_nodes=c)}},function(t,e,r){"use strict";var n=r(185),o=r(66),a=r(152),i=r(222);t.exports=function(t,e){null!=t.params.cat_update_callback&&t.params.cat_update_callback(this);var r=t.params.viz.cat_colors.col;i(e,t.params.network_data.row_nodes,!0),i(e,t.params.inst_nodes.row_nodes,!0),t.params=o(t.params,!1),n(t,!0),a(t),t.params.new_row_cats=e,t.params.viz.cat_colors.col=r}},function(t,e,r){"use strict";var n=r(185),o=r(66),a=r(152),i=r(222),s=r(254);t.exports=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this,r=s(e),l=e.params.viz.cat_colors.col;if(i(r,e.params.network_data.row_nodes),i(r,e.params.inst_nodes.row_nodes),e.params.new_row_cats=r,e.params.viz.cat_colors.col=l,t){var c=!0;e.params=o(e.params,c),n(e,!0),a(e)}}},function(t,e){"use strict";t.exports=function(t){function e(t,e,o){r={},r.cat_title=t,r.cats=[],n={},n.cat_name=e,n.members=[],n.members.push(o),r.cats.push(n),f.push(r)}var r,n,o,a,i,s,l,c,u=t.config.network_data.row_nodes,d=": ",f=[],p=u[0],h=_.keys(p),v={};_.each(h,function(t){t.indexOf("cat-")>=0&&(s=p[t],c=parseInt(t.split("cat-")[1],10),l=s.indexOf(d)>=0?s.split(d)[0]:t,v[c]=l)});var m,g=_.keys(v).sort();return _.each(g,function(t){m={},m.cat_title=v[t],m.cats=[],f.push(m)}),_.each(u,function(t){var r=_.keys(t);_.each(r,function(r){if(r.indexOf("cat-")>-1){i=t[r],c=parseInt(r.split("cat-")[1],10);var s=r;i=t[r];var l=t[r],u=t.name;l.indexOf(d)>-1?(s=l.split(d)[0],i=l.split(d)[1]):(s=r,i=l),0===f.length?e(s,i,u):(o=!1,_.each(f,function(t){s===t.cat_title&&(o=!0,a=!1,_.each(t.cats,function(t){i===t.cat_name&&(a=!0,t.members.push(u))}),a===!1&&(n={},n.cat_name=i,n.members=[],n.members.push(u),t.cats.push(n)))}))}})}),f}},function(t,e,r){"use strict";var n=r(256),o=r(257);t.exports=function(){var t=n(),e=this.params,r=o(e),a=new Blob([r],{type:"text/plain;charset=utf-8"});t(a,"clustergrammer.txt")}},function(t,e){"use strict";t.exports=function(){/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ var t=t||navigator.msSaveBlob&&navigator.msSaveBlob.bind(navigator)||function(t){var e=t.document,r=function(){return t.URL||t.webkitURL||t},n=t.URL||t.webkitURL||t,o=e.createElementNS("http://www.w3.org/1999/xhtml","a"),a="download"in o,i=function(r){var n=e.createEvent("MouseEvents");n.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(n)},s=t.webkitRequestFileSystem,l=t.requestFileSystem||s||t.mozRequestFileSystem,c=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},u="application/octet-stream",d=0,f=[],p=function(){for(var t=f.length;t--;){var e=f[t];"string"==typeof e?n.revokeObjectURL(e):e.remove()}f.length=0},_=function(t,e,r){e=[].concat(e);for(var n=e.length;n--;){var o=t["on"+e[n]];if("function"==typeof o)try{o.call(t,r||t)}catch(t){c(t)}}},h=function(e,n){var c,p,h,v=this,m=e.type,g=!1,y=function(){var t=r().createObjectURL(e);return f.push(t),t},w=function(){_(v,"writestart progress write writeend".split(" "))},x=function(){!g&&c||(c=y(e)),p&&(p.location.href=c),v.readyState=v.DONE,w()},b=function(t){return function(){if(v.readyState!==v.DONE)return t.apply(this,arguments)}},z={create:!0,exclusive:!1};return v.readyState=v.INIT,n||(n="download"),a?(c=y(e),o.href=c,o.download=n,i(o),v.readyState=v.DONE,void w()):(t.chrome&&m&&m!==u&&(h=e.slice||e.webkitSlice,e=h.call(e,0,e.size,u),g=!0),s&&"download"!==n&&(n+=".download"),p=m===u||s?t:t.open(),l?(d+=e.size,void l(t.TEMPORARY,d,b(function(t){t.root.getDirectory("saved",z,b(function(t){var r=function(){t.getFile(n,z,b(function(t){t.createWriter(b(function(r){r.onwriteend=function(e){p.location.href=t.toURL(),f.push(t),v.readyState=v.DONE,_(v,"writeend",e)},r.onerror=function(){var t=r.error;t.code!==t.ABORT_ERR&&x()},"writestart progress write abort".split(" ").forEach(function(t){r["on"+t]=v["on"+t]}),r.write(e),v.abort=function(){r.abort(),v.readyState=v.DONE},v.readyState=v.WRITING}),x)}),x)};t.getFile(n,{create:!1},b(function(t){t.remove(),r()}),b(function(t){t.code===t.NOT_FOUND_ERR?r():x()}))}),x)}),x)):void x())},v=h.prototype,m=function(t,e){return new h(t,e)};return v.abort=function(){var t=this;t.readyState=t.DONE,_(t,"abort")},v.readyState=v.INIT=0,v.WRITING=1,v.DONE=2,v.error=v.onwritestart=v.onprogress=v.onwrite=v.onabort=v.onerror=v.onwriteend=null,t.addEventListener("unload",p,!1),m}(self);return t}},function(t,e,r){"use strict";var n=r(258);t.exports=function(t){var e,r=t.matrix,o={};_.each(["row","col"],function(n){var a;a="row"===n?"col":"row",e=t.inst_order[n],o[a]=r.orders[e+"_"+n]});for(var a="\t",i=t.network_data.row_nodes,s=t.network_data.col_nodes,l=0;l0){o="('"+o+"'";for(var i=0;ie&&(t=i[0],e=a[0]),r>n&&(r=i[1],n=a[1]),r-=o.viz.rect_height,t-=o.viz.rect_width;var s={};return s.row=[],s.col=[],_.each(o.matrix.matrix,function(t){var e=o.viz.y_scale(t.row_index);e>r&&et&&o=i[1])return;if(1===y)"array"==a(i)&&2==i.length&&("left"===d?u.style("left",l):u.style("bottom",l)),h?c.transition().styleTween(d,function(){return t.interpolate(o,l)}).duration("number"==typeof h?h:250):c.style(d,l);else{var f=100-parseFloat(l),p=100-parseFloat(l);"left"===d?u.style("right",f+"%"):u.style("top",p+"%"),h?k.transition().styleTween(d,function(){return t.interpolate(o,l)}).duration("number"==typeof h?h:250):k.style(d,l)}}}function n(t){if(t===s.domain()[0]||t===s.domain()[1])return t;var e=t;if(w)e=o(s(t));else{var r=(t-s.domain()[0])%_;e=t-r,2*Math.abs(r)>=_&&(e+=r>0?_:-_)}return e}function o(t){var e=s.ticks?s.ticks():s.domain(),r=e.map(function(e){return t-s(e)}),n=-1,o=0,a=s.ticks?s.range()[1]:s.rangeExtent()[1];do n++,Math.abs(r[n])0&&n-1)this._list=t.split(/\s*,\s*/);else if(t=o(t),t&&t.children){var e=[];l.apply(t.children).forEach(function(t){if(!t.disabled){var r=t.textContent.trim(),n=t.value||r,o=t.label||r;""!==n&&e.push({label:o,value:n})}}),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return!this.ul.hasAttribute("hidden")},close:function(t){this.opened&&(this.ul.setAttribute("hidden",""),this.index=-1,o.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.ul.removeAttribute("hidden"),this.autoFirst&&this.index===-1&&this.goto(0),o.fire(this.input,"awesomplete-open")},next:function(){var t=this.ul.children.length;this.goto(this.index-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.status.textContent=e[t].textContent,o.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e){if(t?this.index=o.siblingIndex(t):t=this.ul.children[this.index],t){var r=this.suggestions[this.index],n=o.fire(this.input,"awesomplete-select",{text:r,origin:e||t});n&&(this.replace(r),this.close({reason:"select"}),o.fire(this.input,"awesomplete-selectcomplete",{text:r}))}},evaluate:function(){var t=this,e=this.input.value;e.length>=this.minChars&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(n){return new r(t.data(n,e))}).filter(function(r){return t.filter(r,e)}).sort(this.sort).slice(0,this.maxItems),this.suggestions.forEach(function(r){t.ul.appendChild(t.item(r,e))}),0===this.ul.children.length?this.close({reason:"nomatches"}):this.open()):this.close({reason:"nomatches"})}},s.all=[],s.FILTER_CONTAINS=function(t,e){return RegExp(o.regExpEscape(e.trim()),"i").test(t)},s.FILTER_STARTSWITH=function(t,e){return RegExp("^"+o.regExpEscape(e.trim()),"i").test(t)},s.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t$&");return o.create("li",{innerHTML:r,"aria-selected":"false"})},s.REPLACE=function(t){this.input.value=t.value},s.DATA=function(t){return t},Object.defineProperty(r.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),r.prototype.toString=r.prototype.valueOf=function(){return""+this.label};var l=Array.prototype.slice;return o.create=function(t,e){var r=document.createElement(t);for(var n in e){var a=e[n];if("inside"===n)o(a).appendChild(r);else if("around"===n){var i=o(a);i.parentNode.insertBefore(r,i),r.appendChild(i)}else n in r?r[n]=a:r.setAttribute(n,a)}return r},o.bind=function(t,e){if(t)for(var r in e){var n=e[r];r.split(/\s+/).forEach(function(e){t.addEventListener(e,n)})}},o.fire=function(t,e,r){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0);for(var o in r)n[o]=r[o];return t.dispatchEvent(n)},o.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},o.siblingIndex=function(t){for(var e=0;t=t.previousElementSibling;e++);return e},"undefined"!=typeof Document&&("loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i)),s.$=o,s.$$=a,"undefined"!=typeof self&&(self.Awesomplete=s),"object"===e(t)&&t.exports&&(t.exports=s),s}()}).call(e,r(264)(t))},function(t,e){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,r){var n=r(266);"string"==typeof n&&(n=[[t.id,n,""]]);r(268)(n,{});n.locals&&(t.exports=n.locals)},function(t,e,r){e=t.exports=r(267)(),e.push([t.id,".d3-slider{position:relative;font-family:Verdana,Arial,sans-serif;font-size:1.1em;border:1px solid #aaa;z-index:2}.d3-slider-horizontal{height:.8em}.d3-slider-range{height:.8em}.d3-slider-range,.d3-slider-range-vertical{background:#2980b9;left:0;right:0;position:absolute}.d3-slider-range-vertical{top:0}.d3-slider-vertical{width:.8em;height:100px}.d3-slider-handle{position:absolute;width:1.2em;height:1.2em;border:1px solid #d3d3d3;border-radius:4px;background:#eee;background:linear-gradient(180deg,#eee 0,#ddd);z-index:3}.d3-slider-handle:hover{border:1px solid #999}.d3-slider-horizontal .d3-slider-handle{top:-.3em;margin-left:-.6em}.d3-slider-axis{position:relative;z-index:1}.d3-slider-axis-bottom{top:.8em}.d3-slider-axis-right{left:.8em}.d3-slider-axis path{stroke-width:0;fill:none}.d3-slider-axis line{fill:none;stroke:#aaa;shape-rendering:crispEdges}.d3-slider-axis text{font-size:11px}.d3-slider-vertical .d3-slider-handle{left:-.25em;margin-left:0;margin-bottom:-.6em}",""])},function(t,e){"use strict";t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e=0&&y.splice(e,1)}function s(t){var e=document.createElement("style");return e.type="text/css",a(t,e),e}function l(t){var e=document.createElement("link");return e.rel="stylesheet",a(t,e),e}function c(t,e){var r,n,o;if(e.singleton){var a=g++;r=m||(m=s(e)),n=u.bind(null,r,a,!1),o=u.bind(null,r,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=l(e),n=f.bind(null,r),o=function(){i(r),r.href&&URL.revokeObjectURL(r.href)}):(r=s(e),n=d.bind(null,r),o=function(){i(r)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}function u(t,e,r,n){var o=r?"":n.css;if(t.styleSheet)t.styleSheet.cssText=w(e,o);else{var a=document.createTextNode(o),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(a,i[e]):t.appendChild(a)}}function d(t,e){var r=e.css,n=e.media;if(n&&t.setAttribute("media",n),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}function f(t,e){var r=e.css,n=e.sourceMap;n&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var o=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(o),a&&URL.revokeObjectURL(a)}var p={},_=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},h=_(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),v=_(function(){return document.head||document.getElementsByTagName("head")[0]}),m=null,g=0,y=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=h()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var r=o(t);return n(r,e),function(t){for(var a=[],i=0;iinput{display:block}div.awesomplete>ul{position:absolute;left:0;z-index:1;min-width:100%;box-sizing:border-box;list-style:none;padding:0;border-radius:.3em;margin:.2em 0 0;background:hsla(0,0%,100%,.9);background:linear-gradient(to bottom right,#fff,hsla(0,0%,100%,.8));border:1px solid rgba(0,0,0,.3);box-shadow:.05em .2em .6em rgba(0,0,0,.2);text-shadow:none}div.awesomplete>ul:empty,div.awesomplete>ul[hidden]{display:none}@supports (transform:scale(0)){div.awesomplete>ul{transition:.3s cubic-bezier(.4,.2,.5,1.4);transform-origin:1.43em -.43em}div.awesomplete>ul:empty,div.awesomplete>ul[hidden]{opacity:0;transform:scale(0);display:block;transition-timing-function:ease}}div.awesomplete>ul:before{content:"";position:absolute;top:-.43em;left:1em;width:0;height:0;padding:.4em;background:#fff;border:inherit;border-right:0;border-bottom:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}div.awesomplete>ul>li{position:relative;padding:.2em .5em;cursor:pointer}div.awesomplete>ul>li:hover{background:#b8d3e0;color:#000}div.awesomplete>ul>li[aria-selected=true]{background:#3d6d8f;color:#fff}div.awesomplete mark{background:#eaff00}div.awesomplete li:hover mark{background:#b5d100}div.awesomplete li[aria-selected=true] mark{background:#3d6b00;color:inherit}',""])},function(t,e,r){"use strict";var n=r(218),o=r(272),a=r(277),i=r(278),s=r(279),l=r(280),c=r(282),u=r(284),d=r(285);t.exports=function t(e){var r=e.params,t=d3.select(r.root+" .sidebar_wrapper");r.viz.is_expand&&t.style("display","none"),t.append("div").classed("title_section",!0),null!=r.sidebar.title&&t.select(".title_section").append("h4").style("margin-left","20px").style("margin-top","5px").style("margin-bottom","0px").text(r.sidebar.title),t.append("div").style("padding-right","2px").classed("about_section",!0),null!=r.sidebar.about&&t.select(".about_section").append("h5").classed("sidebar_text",!0).style("margin-left","7px").style("margin-top","5px").style("margin-bottom","2px").style("text-align","justify").html(r.sidebar.about),t.append("div").classed("icons_section",!0).style("text-align","center"),e.params.make_modals&&c(r),r.sidebar.icons&&l(e,t),i(r,t),a(t,r),u(t);var f=_.keys(r.viz.possible_filters);f.indexOf("enr_score_type")>-1&&f.sort(function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())}),e.slider_functions={},_.each(f,function(t){o(e,t)}),n(e),null!==r.ini_view&&(s(r),r.ini_view=null),d(e)}},function(t,e,r){"use strict";var n=r(273),o=r(276);t.exports=function(t,e){var r=t.params,a=d3.select(r.root+" .sidebar_wrapper").append("div").classed("div_filters",!0).style("padding-left","10px").style("padding-right","10px");"numerical"==r.viz.possible_filters[e]?n(t,e,a):"categorical"==r.viz.possible_filters[e]&&o(t,e,a)}},function(t,e,r){"use strict";var n=r(226),o=r(274),a=r(5),i=r(63);d3.slider=r(261),t.exports=function(t,e,r){var s=t.params,l={},c=_.keys(s.viz.possible_filters);_.each(c,function(t){if(t!=e){var r=a(s.viz.filter_data,t);l[t]=r}});var u=n(s,e);r.append("div").classed("title_"+e,!0).classed("sidebar_text",!0).classed("slider_description",!0).style("margin-top","5px").style("margin-bottom","3px").text(u.text+u.state+u.suffix),r.append("div").classed("slider_"+e,!0).classed("slider",!0).attr("current_state",u.state);var d=s.network_data.views,f=i(s,d,l);f=f.sort(function(t,r){return r[e]-t[e]});var p=f.length-1,h=0;if(null!==s.requested_view&&e in s.requested_view){var v=s.requested_view[e];if("all"!=v){var m=f.map(function(t){return t[e]}).indexOf(v);m>0&&(h=m)}}var g=d3.slider().value(h).min(0).max(p).step(1).on("slide",function(r,n){y(t,e,f,n)}).on("slideend",function(r,n){y(t,e,f,n)});t.slider_functions[e]=g,d3.select(t.params.root+" .slider_"+e).call(g);var y=_.debounce(o,800)}},function(t,e,r){"use strict";var n=r(203),o=r(225),a=r(275),i=r(65);t.exports=function(t,e,r,s){if(d3.select(t.params.viz.viz_svg).classed("running_update")===!1){var l=t.params,c=r[s][e];o(t,e,c),l=a(l);var u={};if(u[e]=c,u=i(l,u),_.has(r[0],"enr_score_type")){var d=d3.select(l.root+" .toggle_enr_score_type").attr("current_state");u.enr_score_type=d}n(t,u)}}},function(t,e){"use strict";t.exports=function(t){var e;return _.each(["row","col"],function(r){e="row"===r?"col":"row",d3.select(t.root+" .toggle_"+e+"_order .active").empty()===!1?t.viz.inst_order[r]=d3.select(t.root+" .toggle_"+e+"_order").select(".active").attr("name"):t.viz.inst_order[r]="clust"}),t}},function(t,e,r){"use strict";var n=r(65);t.exports=function(t,e,r,o){var a=o.append("div").classed("categorical_filter",!0).classed("toggle_"+r,!0).classed("btn-group-vertical",!0).style("width","100%").style("margin-top","10px").attr("current_state","combined_score"),i=e.viz.filter_data[r],s={combined_score:"Combined Score",pval:"P-Value",zscore:"Z-score"};a.selectAll("button").data(i).enter().append("button").attr("type","button").classed("btn",!0).classed("btn-primary",!0).classed(".filter_button",!0).classed("active",function(t){var e=!1;return"combined_score"==t&&(e=!0),e}).attr("name",function(t){return t}).html(function(t){return s[t]}),$(e.root+" .categorical_filter .btn").off().click(function(){d3.selectAll(e.root+" .categorical_filter .btn").classed("active",!1),d3.select(this).classed("active",!0);var t=d3.select(this).attr("name"),r={enr_score_type:t};n(e,r),d3.select(e.root+" .toggle_enr_score_type").attr("current_state",t)})}},function(t,e){"use strict";t.exports=function(t,e){var r=t.append("div").classed("gene_search_container",!0).style("padding-left","10px").style("padding-right","10px").style("margin-top","10px");r.append("input").classed("form-control",!0).classed("gene_search_box",!0).classed("sidebar_text",!0).attr("type","text").attr("placeholder",e.sidebar.row_search.placeholder).style("height",e.sidebar.row_search.box.height+"px").style("margin-top","10px"),r.append("div").classed("gene_search_button",!0).style("margin-top","5px").attr("data-toggle","buttons").append("button").classed("sidebar_text",!0).html("Search").attr("type","button").classed("btn",!0).classed("btn-primary",!0).classed("submit_gene_button",!0).style("width","100%").style("font-size","14px")}},function(t,e){"use strict";t.exports=function(t,e){var r,n,o,a,i,s={row:"Row",col:"Column",both:""},l=e.append("div").style("padding-left","10px").style("padding-right","10px").classed("reorder_section",!0);i=t.sim_mat?["both"]:["row","col"],_.each(i,function(e){r={clust:"Cluster",rank:"Rank by Sum",rankvar:"Rank by Variance",ini:"Initial Order",alpha:"Alphabetically"};var i;i="row"===e?"col":"row",n=Object.keys(t.matrix.orders);var c=[];_.each(n,function(t){t.indexOf(i)>-1&&(t=t.replace("_row","").replace("_col",""),t.indexOf("cat_")<0&&c.push(t))}),_.keys(t.viz.filter_data).indexOf("enr_score_type")>-1&&(c=["clust","rank"]),c=_.uniq(c),c=c.sort();var u;u="both"!=e?" Order":"Reorder Matrix",l.append("div").classed("sidebar_button_text",!0).style("clear","both").style("margin-top","10px").html(s[e]+u),a=l.append("div").classed("btn-group-vertical",!0).style("width","100%").classed("toggle_"+e+"_order",!0).attr("role","group"),a.selectAll(".button").data(c).enter().append("button").attr("type","button").classed("btn",!0).classed("btn-primary",!0).classed("sidebar_button_text",!0).classed("active",function(e){return o=!1,e==t.viz.inst_order[i]&&(o=!0),o}).attr("name",function(t){return t}).html(function(t){return r[t]})})}},function(t,e,r){"use strict";var n=r(226);t.exports=function(t){_.each(_.keys(t.ini_view),function(e){var r=t.ini_view[e],o=t.viz.possible_filters[e];if("numerical"===o){"all"!=r&&(r=parseInt(r,10)),t.viz.filter_data[e].indexOf(r)<=-1&&(r="all");var a=n(t,e);d3.select(t.root+" .title_"+e).text(a.text+r+a.suffix),d3.select(t.root+" .slider_"+e).attr("current_state",r)}})}},function(t,e,r){"use strict";var n=r(256),o=r(144),a=r(260),i=r(281);t.exports=function(t,e){function r(){d3.select(s.root+" .expand_button").style("opacity",0);var t=d3.select(s.root+" .viz_svg").attr("title","test2").attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML,e=new Blob([t],{type:"image/svg+xml"});l(e,"clustergrammer.svg"),d3.select(s.root+" .expand_button").style("opacity",.4)}var s=t.params,l=n(),c=e.select(".icons_section").style("margin-top","7px").style("margin-left","5%"),u="22%",d="0px",f="0px";c.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",d).style("padding-right",f).append("i").classed("fa",!0).classed("fa-share-alt",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",function(){$(s.root+" .share_info").modal("toggle"),$(".share_url").val(window.location.href)}).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Share").style("left","0%"),c.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",d).style("padding-right",f).append("i").classed("fa",!0).classed("fa-camera",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",function(){$(s.root+" .picture_info").modal("toggle")}).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Take snapshot").style("left","-100%"),c.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",d).style("padding-right",f).append("i").classed("fa",!0).classed("fa fa-cloud-download",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",function(){t.save_matrix()}).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Download matrix").style("left","-200%"),c.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",d).style("padding-right","-5px").append("i").classed("fa",!0).classed("fa-crop",!0).classed("crop_button",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",function(){if(t.params.dendro_filter.row===!1&&t.params.dendro_filter.col===!1){var e=d3.select(this).classed("fa-crop"),r=d3.select(this).classed("fa-undo");e&&(t.params.crop_filter_nodes={},t.params.crop_filter_nodes.row_nodes=t.params.network_data.row_nodes,t.params.crop_filter_nodes.col_nodes=t.params.network_data.col_nodes,t.brush_crop_matrix(),d3.select(this).classed("active_cropping")===!1?d3.select(this).classed("active_cropping",!0).style("color","red"):(d3.select(this).classed("active_cropping",!1).style("color","#337ab7"),a(t))),r&&(d3.select(s.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!0).classed("fa-undo",!1),t.filter_viz_using_nodes(t.params.crop_filter_nodes),d3.select(t.params.root+" .col_dendro_icons_container").style("display","block"),d3.select(t.params.root+" .row_dendro_icons_container").style("display","block")),o(t,0,0,1)}}).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Crop matrix").style("left","-400%"),d3.select(s.root+" .download_buttons").append("p").append("a").html("Download SVG").on("click",function(){r()});var p="svg_"+s.root.replace("#","");d3.select(s.root+" .download_buttons").append("p").append("a").html("Download PNG").on("click",function(){d3.select(s.root+" .expand_button").style("opacity",0),i.saveSvgAsPng(document.getElementById(p),"clustergrammer.png"),d3.select(s.root+" .expand_button").style("opacity",.4); })}},function(t,e,r){var n;!function(){function o(t){return t instanceof HTMLElement||t instanceof SVGElement}function a(t){if(!o(t))throw new Error("an HTMLElement or SVGElement is required; got "+t)}function i(t){return t&&0==t.lastIndexOf("http",0)&&t.lastIndexOf(window.location.host)==-1}function s(t,e){a(t);var r=t.querySelectorAll("image"),n=r.length,o=function(){0===n&&e()};o();for(var s=0;s0)return e[o]}return console.error("Unknown font format for "+t+"; Fonts may not be working correctly"),"application/octet-stream"}function o(t){function e(e){function r(){var t=s.response,r=a(t);i(e,r)}function n(t){console.warn("Failed to load font from: "+e.url),console.warn(t),l+=e.text+"\n",o()}function i(e,r){var n='url("data:'+e.format+";base64,"+r+'")';l+=e.text.replace(e.fontUrlRegexp,n)+"\n",setTimeout(function(){o(t)},0)}var s=new XMLHttpRequest;s.addEventListener("load",r),s.addEventListener("error",n),s.addEventListener("abort",n),s.open("GET",e.url),s.responseType="arraybuffer",s.send()}if(t.length>0){var n=t.pop();e(n)}else r(l)}function a(t){for(var e="",r=new Uint8Array(t),n=r.byteLength,o=0;o";var n=document.createElement("defs");if(n.appendChild(e),u.insertBefore(n,u.firstChild),r){var o=s.innerHTML;o=o.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href'),r(o,a,i)}}var a,i,s=document.createElement("div"),u=t.cloneNode(!0);if("svg"==t.tagName)a=e.width||c(t,u,"width"),i=e.height||c(t,u,"height");else{if(!t.getBBox)return void console.error("Attempted to render non-SVG element",t);var d=t.getBBox();a=d.x+d.width,i=d.y+d.height,u.setAttribute("transform",u.getAttribute("transform").replace(/translate\(.*?\)/,""));var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.appendChild(u),u=f}u.setAttribute("version","1.1"),u.getAttribute("xmlns")||u.setAttributeNS(n,"xmlns","http://www.w3.org/2000/svg"),u.getAttribute("xmlns:xlink")||u.setAttributeNS(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),e.responsive?(u.removeAttribute("width"),u.removeAttribute("height"),u.setAttribute("preserveAspectRatio","xMinYMin meet")):(u.setAttribute("width",a*e.scale),u.setAttribute("height",i*e.scale)),u.setAttribute("viewBox",[e.left||0,e.top||0,a,i].join(" "));for(var p=u.querySelectorAll("foreignObject > *"),_=0;_=0?(g.append("stop").attr("offset","0%").attr("stop-color","white"),g.append("stop").attr("offset","100%").attr("stop-color","red"),y="all_postiive"):p<=0?(g.append("stop").attr("offset","0%").attr("stop-color","blue"),g.append("stop").attr("offset","100%").attr("stop-color","white"),y="all_negative"):(g.append("stop").attr("offset","0%").attr("stop-color","blue"),g.append("stop").attr("offset","50%").attr("stop-color","white"),g.append("stop").attr("offset","100%").attr("stop-color","red")),v.append("rect").classed("background",!0).attr("height",o+"px").attr("width",r+"px").attr("fill","url(#linear-gradient)").attr("transform","translate("+u+", "+d+")").attr("stroke","grey").attr("stroke-width","0.25px");var w=Math.abs(Math.round(10*e.matrix.max_link)/10),x=13;v.append("text").text(function(){var t;return t="all_postiive"===y?0:"-"+w.toLocaleString()}).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",300).style("font-size",x).attr("transform","translate("+s+","+l+")").attr("text-anchor","start"),v.append("text").text(w.toLocaleString()).text(function(){var t;return t="all_negative"===y?0:w.toLocaleString()}).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",300).style("font-size",x).attr("transform","translate("+c+","+l+")").attr("text-anchor","end")}}]); //# sourceMappingURL=clustergrammer.node.min.js.map \ No newline at end of file diff --git a/json/mult_view.json b/json/mult_view.json index f109f344..abeab59d 100644 --- a/json/mult_view.json +++ b/json/mult_view.json @@ -9967,5 +9967,5 @@ "rankvar": 13 } ], - "enrichrgram": true + "enrichrgram": false } \ No newline at end of file diff --git a/make_clustergrammer.py b/make_clustergrammer.py index 895058e0..57dff446 100644 --- a/make_clustergrammer.py +++ b/make_clustergrammer.py @@ -34,7 +34,8 @@ # net.dendro_cats('row', 5) net.cluster(dist_type='cos',views=['N_row_sum', 'N_row_var'] , dendro=True, - sim_mat=True, filter_sim=0.1, calc_cat_pval=False, enrichrgram=True) + sim_mat=True, filter_sim=0.1, calc_cat_pval=False, enrichrgram= + False, run_clustering=True) # write jsons for front-end visualizations net.write_json_to_file('viz', 'json/mult_view.json', 'indent') diff --git a/src/dendrogram/make_dendro_triangles.js b/src/dendrogram/make_dendro_triangles.js index cdac0cdd..1869308d 100755 --- a/src/dendrogram/make_dendro_triangles.js +++ b/src/dendrogram/make_dendro_triangles.js @@ -31,16 +31,20 @@ module.exports = function make_dendro_triangles(cgm, inst_rc, is_change_group = var dendro_info; - if (inst_rc === 'row'){ - dendro_info = calc_row_dendro_triangles(params); - } else { - dendro_info = calc_col_dendro_triangles(params); - } + if (params.viz.show_dendrogram){ + if (inst_rc === 'row'){ + dendro_info = calc_row_dendro_triangles(params); + } else { + dendro_info = calc_col_dendro_triangles(params); + } + + if (d3.select(cgm.params.root+' .'+ inst_rc +'_dendro_crop_buttons').empty() === false){ + make_dendro_crop_buttons(cgm, inst_rc); + } - if (d3.select(cgm.params.root+' .'+ inst_rc +'_dendro_crop_buttons').empty() === false){ - make_dendro_crop_buttons(cgm, inst_rc); } + // constant dendrogram opacity var inst_dendro_opacity = params.viz.dendro_opacity; diff --git a/src/make_viz.js b/src/make_viz.js index 03254494..19e0c01b 100755 --- a/src/make_viz.js +++ b/src/make_viz.js @@ -43,10 +43,9 @@ module.exports = function make_viz(cgm) { if (params.viz.show_dendrogram){ make_row_dendro(cgm); make_col_dendro(cgm); + make_row_dendro_spillover(cgm); } - make_row_dendro_spillover(cgm); - make_col_label_container(cgm); // initial trim text @@ -64,7 +63,6 @@ module.exports = function make_viz(cgm) { trim_text(params, this, inst_rc); }); } - }); } @@ -81,8 +79,11 @@ module.exports = function make_viz(cgm) { generate_super_labels(params); } - // sliders should go above super labels - make_svg_dendro_sliders(cgm); + + if (params.viz.show_dendrogram){ + // sliders should go above super labels + make_svg_dendro_sliders(cgm); + } function border_colors() { var inst_color = params.viz.super_border_color; diff --git a/src/params/calc_viz_params.js b/src/params/calc_viz_params.js index 9f5d6314..6c5e457c 100644 --- a/src/params/calc_viz_params.js +++ b/src/params/calc_viz_params.js @@ -113,10 +113,20 @@ module.exports = function calc_viz_params(params, predefined_cat_colors=true){ viz = make_cat_params(params, viz, predefined_cat_colors); + // // always make group level dict + // params.group_level = {}; + if (_.has(params, 'group_level') == false){ if (viz.show_dendrogram){ params.group_level = {}; } + + // preventing error when un-clustered, above statement + // preserves dendro state while updating + if (_.has(params, 'group_level') == false){ + params.group_level = {}; + } + params.group_level.row = 5; params.group_level.col = 5; } diff --git a/src/spillover/main_spillover.js b/src/spillover/main_spillover.js index 794b5803..a7da31a3 100755 --- a/src/spillover/main_spillover.js +++ b/src/spillover/main_spillover.js @@ -119,7 +119,9 @@ module.exports = function Spillover(cgm) { .append('g') .classed('col_dendro_icons_group', true); - make_dendro_crop_buttons(cgm, 'col'); + if (params.viz.show_dendrogram){ + make_dendro_crop_buttons(cgm, 'col'); + } var x_offset = viz.clust.margin.left + viz.clust.dim.width; var y_offset = viz.clust.margin.top + viz.clust.dim.height;