forked from MaayanLab/clustergrammer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclustergrammer.node.min.js
More file actions
9 lines (9 loc) · 193 KB
/
clustergrammer.node.min.js
File metadata and controls
9 lines (9 loc) · 193 KB
1
2
3
4
5
6
7
8
9
module.exports=function(t){function e(o){if(r[o])return r[o].exports;var a=r[o]={exports:{},id:o,loaded:!1};return t[o].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function o(t){function e(){d3.select(k.params.viz.viz_svg).style("opacity",.5);var t=500;this.params.viz.run_trans===!0&&(t=2500),setTimeout(o,t,this)}function o(t){s(t)}function y(t){_(this,t)}function b(t,e,r){f(this.params,t,e,r)}function x(){return w}var z=a(t),k={};if(k.params=n(z),k.config=z,k.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,k.params.viz.real_zoom*k.params.viz.zoom_switch]).on("zoom",function(){g(k)}),k.params.zoom_behavior.translate([k.params.viz.clust.margin.left,k.params.viz.clust.margin.top]),k.params.use_sidebar){var A=r(187);A(k)}return i(k),k.update_view=v,k.resize_viz=e,k.play_demo=l,k.ini_demo=c,k.filter_viz_using_nodes=d,k.filter_viz_using_names=u,k.update_cats=y,k.reset_cats=p,k.zoom=b,k.export_matrix=m,k.crop_matrix=h,k.d3_tip_custom=x,k}var a=r(1),n=r(9),i=r(37),s=r(79),l=r(123),c=r(162),d=r(165),u=r(166),_=r(167),p=r(168),f=r(91),v=r(170),m=r(173),h=r(175),g=r(80),w=r(49);d3.slider=r(177);r(179);r(181),r(185),t.exports=o},function(t,e,r){"use strict";var o=r(2),a=r(3),n=r(4),i=r(5),s=r(6),l=r(7),c=r(8);t.exports=function(t){var e=s(),r=o.extend(e,t);r.network_data=t.network_data;var d=": ";_.each(["row","col"],function(t){var e=r.network_data[t+"_nodes"],o=c(e);e.forEach(function(e){o&&(r.super_labels=!0,r["super"][t]=e.name.split(d)[0],e.name=e.name.split(d)[1]),e.name=e.name.replace(/_/g," ")})}),r.network_data.row_nodes_names=o.pluck(r.network_data.row_nodes,"name"),r.network_data.col_nodes_names=o.pluck(r.network_data.col_nodes,"name"),r.sim_mat=l(r);var u=n(r.network_data.views),p={};_.each(_.keys(u.possible_filters),function(t){var e=i(u.filter_data,t);p[t]=e}),_.has(r.network_data,"views")&&r.network_data.views.forEach(function(t){_.each(_.keys(u.possible_filters),function(e){_.has(t,e)||(t[e]=p[e])});var e=t.nodes;_.each(["row","col"],function(t){var r=c(e[t+"_nodes"]);e[t+"_nodes"].forEach(function(t){r&&(t.name=t.name.split(d)[1]),t.name=t.name.replace(/_/g," ")})})});var f=r.network_data.col_nodes,v=r.network_data.row_nodes;if(r.network_data.links.forEach(function(t){t.name=v[t.source].name+"_"+f[t.target].name,t.row_name=v[t.source].name,t.col_name=f[t.target].name}),r.transpose){r.network_data=a(r.network_data);var m=t.col_label,h=t.row_label;t.row_label=m,t.col_label=h}o.is_undefined(t.row_label)||o.is_undefined(t.col_label)||(r.super_labels=!0,r["super"]={},r["super"].row=t.row_label,r["super"].col=t.col_label),r.inst_order={},!o.is_undefined(t.order)&&o.is_supported_order(t.order)?(r.inst_order.row=t.order,r.inst_order.col=t.order):(r.inst_order.row="clust",r.inst_order.col="clust"),!o.is_undefined(t.row_order)&&o.is_supported_order(t.row_order)&&(r.inst_order.col=t.row_order),!o.is_undefined(t.col_order)&&o.is_supported_order(t.col_order)&&(r.inst_order.row=t.col_order);var g=o.has(r.network_data.row_nodes[0],"group"),w=o.has(r.network_data.col_nodes[0],"group");return r.show_dendrogram=g||w,o.has(r.network_data.links[0],"value_orig")?r.keep_orig=!0:r.keep_orig=!1,r}},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?"symbol":typeof t};t.exports={normal_name:function(t){var e=t.name.replace(/_/g," ").split("#")[0];return e},is_supported_order:function(t){return"ini"===t||"clust"===t||"rank_var"===t||"rank"===t||"class"===t||"alpha"==t},has:function(t,e){return null!=t&&hasOwnProperty.call(t,e)},property:function(t){return function(e){return null==e?void 0:e[t]}},pluck:function(t,e){var r=this;if(window._){if("function"==typeof _.pluck)return _.pluck(t,e);if("function"==typeof _.map)return _.map(t,r.property(e))}else if(t.map&&"function"==typeof t.map)return t.map(r.property(e))},is_undefined:function(t){return void 0===t},extend:function(t,e){t=t||{};for(var o in e)"object"===r(e[o])?t[o]=this.extend(t[o],e[o]):t[o]=e[o];return t}}},function(t,e,r){"use strict";var o=r(2);t.exports=function(t){var e,r,a={};for(a.row_nodes=t.col_nodes,a.col_nodes=t.row_nodes,a.links=[],r=0;r<t.links.length;r++)e={},e.source=t.links[r].target,e.target=t.links[r].source,e.value=t.links[r].value,o.has(t.links[r],"highlight")&&(e.highlight=t.links[r].highlight),o.has(t.links[r],"value_up")&&(e.value_up=t.links[r].value_up),o.has(t.links[r],"value_dn")&&(e.value_dn=t.links[r].value_dn),o.has(t.links[r],"info")&&(e.info=t.links[r].info),a.links.push(e);return a}},function(t,e){"use strict";t.exports=function(t){var e={},r={};_.each(t,function(t){var e=_.keys(t);_.each(e,function(e){"nodes"!=e&&(_.has(r,e)||(r[e]=[]),r[e].push(t[e]),r[e]=_.uniq(r[e]))})});var o=_.keys(r);_.each(o,function(t){var o=r[t],a=o.length,n="categorical";_.each(o,function(t){"number"==typeof t&&(n="numerical")}),a>1&&(e[t]=n)});var a={};return a.possible_filters=e,a.filter_data=r,a}},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,dendro_callback:null,new_cat_data:null};return t}},function(t,e){"use strict";t.exports=function(t){var e=!1,r=t.network_data.row_nodes_names.length,o=t.network_data.col_nodes_names.length;if(r==o){var a=t.network_data.row_nodes_names,n=t.network_data.col_nodes_names;e=!0,_.each(a,function(t){var r=a.indexOf(t);t!==n[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){t.name.indexOf(e)<0&&(r=!1)}),r}},function(t,e,r){"use strict";var o=r(10),a=r(13),n=r(14),i=r(4),s=r(15),l=r(36);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,d=i(r.network_data.views);r.viz={},r.viz.possible_filters=d.possible_filters,r.viz.filter_data=d.filter_data,c=n(r,c),r.network_data=o(e,r,c),r.requested_view=c}return r=s(r),r.use_sidebar&&(r.sidebar=a(r)),r.zoom_info=l(),r}},function(t,e,r){"use strict";var o=r(11),a=r(12);t.exports=function(t,e,r){var n=t.network_data.views,i=!1;_.has(n[0],"enr_score_type")&&(i=!0);var s=a(e,n,r);i&&0==s.length&&(r={N_row_sum:"all",N_col_sum:"10"},s=a(e,n,r));var l,c=s[0];if("undefined"!=typeof c){var d=c.nodes;l=o(t,d)}else l=t.network_data;return l}},function(t,e,r){"use strict";var o=r(2);t.exports=function(t,e){var r=t.network_data.links,a=o.pluck(e.row_nodes,"name"),n=o.pluck(e.col_nodes,"name"),i=_.filter(r,function(t){var e=t.name.split("_")[0],r=t.name.split("_")[1],o=_.indexOf(a,e),i=_.indexOf(n,r);if(o>-1&i>-1)return t.source=o,t.target=i,t}),s={};return s.row_nodes=e.row_nodes,s.row_nodes_names=a,s.col_nodes=e.col_nodes,s.col_nodes_names=n,s.links=i,s.all_links=r,s.views=t.network_data.views,s}},function(t,e,r){"use strict";var o=r(2),a=r(5);t.exports=function(t,e,r){var n,i,s=_.keys(r);_.each(s,function(t){n=r[t],/[^a-z_]/i.test(n)&&(n=parseInt(n,10)),i=!1,_.each(e,function(e){o.has(e,t)&&(i=!0)}),i&&(e=_.filter(e,function(e){return e[t]==n}))});var l,c,d=[],u=!1;return _.each(e,function(e){l=!0,_.each(_.keys(t.viz.possible_filters),function(r){c=a(t.viz.filter_data,r),e[r]!=c&&(l=!1)}),l?u===!1&&(u=!0,d.push(e)):d.push(e)}),d}},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(o){if(o!=r&&!d3.select(t.root+" .slider_"+o).empty()){var a=d3.select(t.root+" .slider_"+o).attr("current_state");e[o]=a}}),e}},function(t,e,r){"use strict";var o=r(16),a=r(17),n=r(23),i=r(25),s=r(26),l=r(27),c=r(28),d=r(29),u=r(30),_=r(33),p=r(35);t.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]||arguments[1];return t.labels=o(t),t.viz=a(t,e),n(t),t=i(t),t.viz=s(t.viz),t.viz=l(t.viz),t.viz=c(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=d(t),t=u(t),t=_(t),t=p(t)}},function(t,e){"use strict";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=_.max(t.network_data.row_nodes,function(t){return t.name.length}).name.length,e.col_max_char=_.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){"use strict";var o=r(2),a=r(4),n=r(18);t.exports=function(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.show_dendrogram&&(t.group_level={}),r.resize=t.resize,o.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=n(t,r,e),_.has(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 i=a(t.network_data.views);return r.possible_filters=i.possible_filters,r.filter_data=i.filter_data,r}},function(t,e,r){"use strict";var o=r(19),a=r(22);t.exports=function(t,e){var r=arguments.length<=2||void 0===arguments[2]||arguments[2];return e=o(t,e,r),e=a(t,e)}},function(t,e,r){"use strict";var o=r(2),a=r(20),n=r(21);t.exports=function(t,e){var r,i,s,l=arguments.length<=2||void 0===arguments[2]||arguments[2],c=": ";e.show_categories={},e.all_cats={},e.cat_names={},e.cat_info={};var d={};d.row=null,d.col=null;var u=!1;null===e.cat_colors?(e.cat_colors={},e.cat_colors.value_opacity=d,u=!1):u=!0,l===!1&&(u=!1);var p=0;return _.each(["row","col"],function(l){e.show_categories[l]=!1,e.all_cats[l]=[];var d=_.keys(t.network_data[l+"_nodes"][0]);_.each(d,function(t){t.indexOf("cat-")>=0&&(e.show_categories[l]=!0,e.all_cats[l].push(t))}),e.cat_info[l]=null,e.show_categories[l]&&(u===!1&&(e.cat_colors[l]={}),e.cat_info[l]={},e.cat_names[l]={},_.each(e.all_cats[l],function(d){_.each(t.network_data[l+"_nodes"],function(t){"string"==typeof t[d]&&t[d].indexOf(c)>0?(r=t[d].split(c)[0],e.cat_names[l][d]=r):e.cat_names[l][d]=d});var f=o.pluck(t.network_data[l+"_nodes"],d),v=_.uniq(f).sort();if(i=n(v),"cat_strings"===i.type){var m=_.countBy(f);i.cat_hist=m}else i.cat_hist=null;e.cat_info[l][d]=i,u===!1&&(e.cat_colors[l][d]={},_.each(v,function(t,r){s=a.get_random_color(r+p),e.cat_colors[l][d][t]=s,"string"==typeof t&&(t.indexOf("Not ")>=0||t.indexOf(": false")>0)&&(e.cat_colors[l][d][t]="#eee"),p+=1}))})),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}},function(t,e){"use strict";function r(){return"#EEE"}function o(t){return n[t%a()]}function a(){return n.length}var n;n=["#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:o,get_num_colors:a}},function(t,e){"use strict";t.exports=function(t){var e=t[0],r=!1,o=!1,a="cat_strings",n=NaN,i=[],s=null,l=": ";if("string"==typeof e&&e.indexOf(l)>-1&&(r=!0,e=e.split(l)[1]),0==isNaN(e)&&(o=!0),o&&(a="cat_values",_.each(t,function(t){r&&(t=t.split(l)[1]),1==isNaN(t)?a="cat_strings":(t=parseFloat(t),i.push(t))})),"cat_values"===a){var c=_.max(i,function(t){return Math.abs(t)});n=Math.abs(c),s=d3.scale.linear().domain([0,n]).range([0,1])}var d={};return d.type=a,d.max_abs_val=n,d.cat_scale=s,d}},function(t,e){"use strict";t.exports=function(t,e){var r,o=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(a){e.norm_labels.width[a]=o(t.labels[a+"_max_char"])*t[a+"_label_scale"],e["num_"+a+"_nodes"]=t.network_data[a+"_nodes"].length,"row"===a?e.dendro_room[a]=e.dendro_room.symbol_width:e.dendro_room[a]=e.dendro_room.symbol_width+3*e.uni_margin;var n=e.all_cats[a].length;if(e.show_categories[a]){r=(n-1)*e.cat_room.separation;var i;i="row"===a?n+1:n,e.cat_room[a]=i*e.cat_room.symbol_width+r}else"row"==a?e.cat_room[a]=e.cat_room.symbol_width:e.cat_room[a]=0}),e}},function(t,e,r){"use strict";var o=r(24);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=o(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={},o=t.buffer_width,a=d3.select(t.root).style("width").replace("px",""),n=d3.select(t.root).style("height").replace("px","");return t.viz.is_expand===!1?(e=t.viz.outer_margins,r.width=a-t.sidebar_width-o):(e=t.viz.outer_margins,r.width=a-o),r.top=e.top,r.left=e.left,t.viz.resize?r.height=n:(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)),o=r.rangeBand()/2;if(o>t.norm_labels.width.col){var a=t.norm_labels.width.col/o;e*=a}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){"use strict";t.exports=function(t){var e=Math.abs(_.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(_.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 o=r(31);t.exports=function(t){return t.matrix=o(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]),_.each(["row","col"],function(e){var r=t.viz.inst_order[e];"custom"===r&&(r="clust"),"row"===e?t.viz.x_scale.domain(t.matrix.orders[r+"_"+e]):t.viz.y_scale.domain(t.matrix.orders[r+"_"+e])}),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}},function(t,e,r){"use strict";var o=r(2),a=r(32);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.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(a){var n;n="row"===a?"col":"row";var i=r[n+"_nodes"],s=i.length,l=o.pluck(i,"name"),c=l.sort(),d=_.map(c,function(t){return r[n+"_nodes_names"].indexOf(t)});e.orders["alpha_"+a]=d;var u=["clust","rank"];_.has(i[0],"rankvar")&&u.push("rankvar"),t.viz.all_cats[n].length>0&&_.each(t.viz.all_cats[n],function(t){t=t.replace("-","_"),u.push(t+"_index")}),_.each(u,function(t){var r=d3.range(s).sort(function(e,r){return i[r][t]-i[e][t]});e.orders[t+"_"+a]=r})}),o.has(r,"all_links")?e.max_link=_.max(r.all_links,function(t){return Math.abs(t.value)}).value:e.max_link=_.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 n=o.has(r.links[0],"value_up"),i=o.has(r.links[0],"value_dn");return n||i?e.tile_type="updn":e.tile_type="simple",o.has(r.links[0],"highlight")?e.highlight=1:e.highlight=0,e.matrix=a(r),e.wait_tooltip=0,e}},function(t,e,r){"use strict";var o=r(2);t.exports=function(t){var e,r,a=[];return r=!!o.has(t.links[0],"value_orig"),t.row_nodes.forEach(function(n,i){a[i]={},a[i].name=t.row_nodes[i].name,a[i].row_data=d3.range(t.col_nodes.length).map(function(a){return e=o.has(t.links[0],"value_up")||o.has(t.links[0],"value_dn")?{pos_x:a,pos_y:i,value:0,value_up:0,value_dn:0,highlight:0}:{pos_x:a,pos_y:i,value:0,highlight:0},r&&(e.value_orig=0),e})}),t.links.forEach(function(t){a[t.source].row_data[t.target].value=t.value,a[t.source].row_data[t.target].row_name=t.row_name,a[t.source].row_data[t.target].col_name=t.col_name,(o.has(t,"value_up")||o.has(t,"value_dn"))&&(a[t.source].row_data[t.target].value_up=t.value_up,a[t.source].row_data[t.target].value_dn=t.value_dn),r&&(a[t.source].row_data[t.target].value_orig=t.value_orig),t.highlight&&(a[t.source].row_data[t.target].highlight=t.highlight),t.info&&(a[t.source].row_data[t.target].info=t.info)}),a}},function(t,e,r){"use strict";var o=r(34);t.exports=function(t){t.viz.zoom_scale_font={},t.viz.zoom_scale_font.row=1,t.viz.zoom_scale_font.col=1;var e=.75,r=t.viz.x_scale.rangeBand()/2;return t.viz.real_zoom=t.viz.norm_labels.width.col/r*e,t.viz=o(t.viz),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,t}},function(t,e){"use strict";t.exports=function(t){var e=t.clust.dim.width/t.num_col_nodes,r=t.clust.dim.height/t.num_row_nodes;return t.zoom_switch=e/r,t.zoom_switch_y=1,t.zoom_switch<1&&(t.zoom_switch_y=1/t.zoom_switch,t.zoom_switch=1),t}},function(t,e){"use strict";t.exports=function(t){return t.labels.default_fs_row=1.01*t.viz.y_scale.rangeBand(),t.labels.default_fs_col=.87*t.viz.x_scale.rangeBand(),t.labels.default_fs_row>t.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){"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 o=r(38),a=r(50),n=r(68),i=r(72),s=r(73),l=r(78),c=r(90),d=r(110),u=r(116),p=r(86),f=r(117),v=r(118),m=r(119),h=r(122);t.exports=function(t){function e(){var t=r.viz.super_border_color;return r.viz.is_expand&&(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"),o(r,g);var w=0;a(t,w),r.viz.show_dendrogram&&(f(t),v(t)),h(t),n(t,w),_.each(["row","col"],function(t){var e=Number(d3.select("."+t+"_label_group").select("text").style("font-size").replace("px","")),o=8;e>o&&d3.selectAll(r.root+" ."+t+"_label_group").each(function(){p(r,this,t)})}),u(t),r.viz.show_categories.col&&d(t),s(t),r.labels.super_labels&&i(r),m(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(r),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 o=r(2),a=r(39),n=r(42),i=r(43),s=r(49);t.exports=function(t,e){var r,l=t.network_data,c=[],d=l.row_nodes,u=o.pluck(d,"name");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);var p=s().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip tile_tip";return r}).style("display","none").direction("nw").offset([0,0]).html(function(e){var r,o=String(e.value.toFixed(3));if(t.keep_orig){var a=String(e.value_orig.toFixed(3));r="<p>"+e.row_name+" and "+e.col_name+"</p><p> normalized value: "+o+"</p><div> original value: "+a+"</div>"}else r="<p>"+e.row_name+" and "+e.col_name+"</p><div> value: "+o+"</div>";return r});d3.select(t.root+" .clust_group").call(p),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),r.selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).enter().append("g").attr("class","row").attr("transform",function(e){var r=_.indexOf(u,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}).each(function(e){i(t,e,p,this)}),"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,o.has(e,"value_up")&&(r.value_up=e.value_up),o.has(e,"value_dn")&&(r.value_dn=e.value_dn),o.has(e,"info")&&(r.info=e.info),t.click_tile(r),n(t,this)}):t.tile_click_hlight&&d3.selectAll(t.root+" .tile").on("click",function(){n(t,this)});var f={},v=0;return f.enter=0,a(t,f,v),{get_clust_group:function(){return r},get_matrix:function(){return c},get_nodes:function(t){return"row"===t?l.row_nodes:l.col_nodes}}}},function(t,e,r){"use strict";var o=r(40),a=r(41);t.exports=function(t,e,r){var n=t.network_data.row_nodes,i=t.network_data.col_nodes,s=d3.select(t.root+" .clust_group").selectAll(".horz_lines").data(n,function(t){return t.name}).enter().append("g").attr("class","horz_lines"),l=d3.select(t.root+" .clust_group").selectAll(".vert_lines").data(i).enter().append("g").attr("class","vert_lines");o(t,r),s.select("line").attr("opacity",0).attr("stroke","white").attr("opacity",1),l.select("line").style("stroke","white").attr("opacity",0).transition().delay(e.enter).duration(2*r).attr("opacity",1),a(t)}},function(t,e){"use strict";t.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?0:arguments[1],r=0;e>0&&(r=2e3);var o=d3.selectAll(t.root+" .horz_lines"),a=d3.selectAll(t.root+" .vert_lines"),n=t.network_data.row_nodes_names,i=t.network_data.col_nodes_names;o.style("opacity",0).attr("transform",function(e){var r=_.indexOf(n,e.name),o=t.viz.y_scale(r);return"translate( 0,"+o+") rotate(0)"}).transition().duration(e).delay(r).style("opacity",1),o.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"}),a.style("opacity",0).attr("transform",function(e){var r=_.indexOf(i,e.name),o=t.viz.x_scale(r);return"translate("+o+") rotate(-90)"}).transition().duration(e).delay(r).style("opacity",1),a.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){"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){"use strict";t.exports=function(t,e){d3.select(e).each(function(r){var o=r.pos_x,a=r.pos_y;if(d3.selectAll(t.root+" .click_hlight").remove(),o!=t.matrix.click_hlight_x||a!=t.matrix.click_hlight_y){t.matrix.click_hlight_x=o,t.matrix.click_hlight_y=a;var n=6,i=.85,s=n*t.viz.border_width.x,l=n*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(o)+",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(o)+","+.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(o)+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(o)+.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 o=r(44),a=r(45),n=r(46),i=r(47),s=r(48);t.exports=function(t,e,r,l){var c,d=e.row_data;c=!!_.has(t.network_data.links[0],"value_orig");var u;u=c===!1?_.filter(d,function(t){return 0!==t.value}):d;var p=d3.select(l).selectAll("rect").data(u,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){var r;return r="NaN"===e.value_orig?"#000000":e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]}).on("mouseover",function(){for(var e=arguments.length,o=Array(e),a=0;a<e;a++)o[a]=arguments[a];n(t,this,r,o)}).on("mouseout",function(){i(t,this,r)}).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("updn"==t.matrix.tile_type){var f=_.filter(d,function(t){return 0!=t.value_up||0!=t.value_dn});d3.select(l).selectAll(".tile_up").data(f,function(t){return t.col_name}).enter().append("path").attr("class","tile_up").attr("d",function(){return o(t)}).attr("transform",function(e){s(t,e)}).style("fill",function(){return t.matrix.tile_colors[0]}).style("fill-opacity",function(e){var r=0;return Math.abs(e.value_dn)>0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r}).on("mouseover",function(){for(var e=arguments.length,o=Array(e),a=0;a<e;a++)o[a]=arguments[a];n(t,this,r,o)}).on("mouseout",function(){i(t,this,r)}),d3.select(l).selectAll(".tile_dn").data(f,function(t){return t.col_name}).enter().append("path").attr("class","tile_dn").attr("d",function(){
return a(t)}).attr("transform",function(e){s(t,e)}).style("fill",function(){return t.matrix.tile_colors[1]}).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}).on("mouseover",function(){for(var e=arguments.length,o=Array(e),a=0;a<e;a++)o[a]=arguments[a];n(t,this,r,o)}).on("mouseout",function(){i(t,this,r)}),p.each(function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()})}t.matrix.tile_title&&p.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,o=0,a=t.viz.y_scale.rangeBand()-t.viz.border_width.y,n="M"+e+","+o+", L"+e+", "+a+", L"+r+",0 Z";return n}},function(t,e){"use strict";t.exports=function(t){var e=0,r=t.viz.x_scale.rangeBand()-t.viz.border_width.x,o=t.viz.y_scale.rangeBand()-t.viz.border_width.y,a=t.viz.y_scale.rangeBand()-t.viz.border_width.y,n="M"+e+", "+o+" , L"+r+", "+a+", L"+r+",0 Z";return n}},function(t,e){"use strict";t.exports=function(t,e,r,o){function a(){if(d3.select(e).classed("hovering")){var o=Number(d3.select(t.root+" .viz_svg").attr("is_zoom"));if(0===o&&t.matrix.show_tile_tooltips&&(d3.selectAll(".tile_tip").style("display","block"),r.show.apply(e,s),null!=t.tile_tip_callback)){var a=s[0];t.tile_tip_callback(a)}}}var n,i=o[0],s=[].slice.call(o),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,o=i[e+"_name"].replace(/_/g," ")===t.name;return r=o?"bold":"normal"})}),s.push(e),clearTimeout(n),n=setTimeout(a,l,e)}},function(t,e){"use strict";t.exports=function(t,e,r){d3.select(e).classed("hovering",!1),d3.selectAll(".tile_tip").style("display","none"),_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight","normal")}),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 o=r+.5*t.viz.border_width.x,a=.5*t.viz.border_width.y;return"translate("+o+","+a+")"}},function(t,e){"use strict";t.exports=function(){function t(t){x=f(t),z=x.createSVGPoint(),document.body.appendChild(b)}function e(){return"n"}function r(){return[0,0]}function o(){return" "}function a(){var t=v();return{top:t.s.y,left:t.s.x}}function n(){var t=v();return{top:t.n.y-b.offsetHeight,left:t.n.x-b.offsetWidth/2}}function i(){var t=v();return{top:t.s.y,left:t.s.x-b.offsetWidth/2}}function s(){var t=v();return{top:t.e.y-b.offsetHeight/2,left:t.e.x}}function l(){var t=v();return{top:t.w.y-b.offsetHeight/2,left:t.w.x-b.offsetWidth}}function c(){var t=v();return{top:t.nw.y-b.offsetHeight,left:t.nw.x-b.offsetWidth}}function d(){var t=v();return{top:t.ne.y-b.offsetHeight,left:t.ne.x}}function u(){var t=v();return{top:t.sw.y,left:t.sw.x-b.offsetWidth}}function _(){var t=v();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 f(t){return t=t.node(),"svg"==t.tagName.toLowerCase()?t:t.ownerSVGElement}function v(){var t=k||d3.event.target,e={},r=t.getScreenCTM(),o=t.getBBox(),a=o.width,n=o.height,i=o.x,s=o.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+a,e.ne=z.matrixTransform(r),z.y=z.y+n,e.se=z.matrixTransform(r),z.x=z.x-a,e.sw=z.matrixTransform(r),z.y=z.y-n/2,e.w=z.matrixTransform(r),z.x=z.x+a,e.e=z.matrixTransform(r),z.x=z.x-a/2,z.y=z.y-n/2,e.n=z.matrixTransform(r),z.y=z.y+n,e.s=z.matrixTransform(r),e}function m(t){var e=d3.select(t).classed("hovering");e&&d3.selectAll(".d3-tip").transition().duration(250).style("opacity",0).style("display","none")}function h(t){var e={};return t&&"[object Function]"===e.toString.call(t)}var g=e,w=r,y=o,b=p(),x=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,o=y.apply(this,e),a=w.apply(this,e),n=g.apply(this,e),i=d3.select(b),s=0;for(i.html(o).style({opacity:1,"pointer-events":"all"});s--;)i.classed(T[s],!1);if(r=A.get(n).apply(this),i.classed(n,!0).style({top:r.top+a[0]+"px",left:r.left+a[1]+"px"}),h(this)===!1){var l=d3.select(this).attr("class");l.indexOf("tile")>=0&&setTimeout(m,5e3,this)}return t},t.hide=function(){var e=d3.select(b);return e.style({opacity:0,"pointer-events":"none"}),t},t.attr=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(b).attr(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d3.select(b),r),t},t.style=function(e){if(arguments.length<2&&"string"==typeof e)return d3.select(b).style(e);var r=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d3.select(b),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?(w=null==e?e:d3.functor(e),t):w},t.html=function(e){return arguments.length?(y=null==e?e:d3.functor(e),t):y};var A=d3.map({n:n,s:i,e:s,w:l,nw:c,ne:d,sw:u,se:_,south_custom:a}),T=A.keys();return t}},function(t,e,r){"use strict";var o=r(2),a=r(51),n=r(52),i=r(66),s=r(67);t.exports=function(t,e){var r,l=t.params,c=l.network_data.row_nodes,d=l.network_data.row_nodes_names;r=d3.select(l.viz.viz_svg+" .row_container").empty()?d3.select(l.viz.viz_svg).append("g").attr("class","row_container").attr("transform","translate("+l.viz.norm_labels.margin.left+","+l.viz.clust.margin.top+")"):d3.select(l.viz.viz_svg).select(".row_container").attr("transform","translate("+l.viz.norm_labels.margin.left+","+l.viz.clust.margin.top+")"),d3.select(l.root+" .row_white_background").empty()&&r.append("rect").classed("row_white_background",!0).classed("white_bars",!0).attr("fill",l.viz.background_color).attr("width",l.viz.label_background.row).attr("height",30*l.viz.clust.dim.height+"px"),d3.select(l.root+" .row_label_container").empty()?r.append("g").attr("class","row_label_container").attr("transform","translate("+l.viz.norm_labels.width.row+",0)").append("g").attr("class","row_label_zoom_container"):r.select(l.root+" .row_label_container").attr("transform","translate("+l.viz.norm_labels.width.row+",0)");var u=d3.select(l.root+" .row_label_zoom_container").selectAll("g").data(c,function(t){return t.name}).enter().append("g").attr("class","row_label_group").attr("transform",function(t){var e=_.indexOf(d,t.name);return"translate(0,"+l.viz.y_scale(e)+")"});d3.select(l.root+" .row_label_zoom_container").selectAll(".row_label_group").on("dblclick",function(e){var r="__data__",o=this[r].name;if(l.sim_mat){n(t,this,o);var s=d3.selectAll(l.root+" .col_label_text").filter(function(t){return t.name==o})[0][0];i(t,s,o)}else n(t,this,o);l.tile_click_hlight&&a(this,e.ini)}),s(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 o.normal_name(t)}).attr("pointer-events","none").style("opacity",0).style("cursor","default").transition().delay(e).duration(e).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})}),o.has(l.network_data.row_nodes[0],"value")&&u.append("rect").attr("class","row_bars").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 o=6,a=.85,n=o*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",n).attr("fill",t.matrix.hlight_color).attr("opacity",a),d3.select(e).append("rect").classed("click_hlight",!0).classed("row_bottom_hlight",!0).attr("width",t.viz.svg_dim.width).attr("height",n).attr("fill",t.matrix.hlight_color).attr("opacity",a).attr("transform",function(){var e=t.viz.y_scale.rangeBand()-n;return"translate(0,"+e+")"})}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_row=-666}},function(t,e,r){"use strict";var o=r(2),a=r(53),n=r(54),i=r(64),s=r(36);t.exports=function(t,e,r){var l=t.params;l.viz.inst_order.row="custom",n(t,"col"),d3.selectAll(l.root+" .toggle_col_order .btn").classed("active",!1),l.viz.run_trans=!0;var c=l.matrix.matrix,d=l.network_data.row_nodes,u=l.network_data.col_nodes,p=o.pluck(u,"name"),f=[];d.forEach(function(t){f.push(t.name)}),r=_.indexOf(f,r),f=[],u.forEach(function(t,e){f.push(c[r].row_data[e].value)});var v=d3.range(f.length).sort(function(t,e){return f[e]-f[t]});l.viz.x_scale.domain(v),l.matrix.orders.custom_row=v;var m;l.network_data.links.length>l.matrix.def_large_matrix?(m=d3.select(l.root+" .clust_group"),d3.select(l.root+" .col_zoom_container").selectAll(".col_label_text").attr("transform",function(t){var e=_.indexOf(p,t.name);return"translate("+l.viz.x_scale(e)+")rotate(-90)"}),d3.selectAll(l.root+" .col_cat_group").attr("transform",function(t){var e=_.indexOf(p,t.name);return"translate("+l.viz.x_scale(e)+",0)"})):(m=d3.select(l.root+" .clust_group").transition().duration(2500),d3.select(l.root+" .col_zoom_container").selectAll(".col_label_text").transition().duration(2500).attr("transform",function(t){var e=_.indexOf(p,t.name);return"translate("+l.viz.x_scale(e)+")rotate(-90)"}),d3.selectAll(l.root+" .col_cat_group").transition().duration(2500).attr("transform",function(t){var e=_.indexOf(p,t.name);return"translate("+l.viz.x_scale(e)+",0)"})),m.selectAll(".tile").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),m.selectAll(".tile_up").attr("transform",function(t){return"translate("+l.viz.x_scale(t.pos_x)+",0)"}),m.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),a(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=s(),i(l),setTimeout(function(){l.viz.run_trans=!1},2500)}},function(t,e){"use strict";t.exports=function(t){var e=6,r=e*t.viz.border_width.x,o=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.x_scale.rangeBand()).attr("height",o).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*o).transition().duration(2500).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*o+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.y_scale.rangeBand()-.99*o).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*o+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.x_scale.rangeBand()-1.98*r}).attr("height",o).transition().duration(2500).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,a=t.viz.y_scale.rangeBand()-o;return"translate("+e+","+a+")"})}},function(t,e,r){"use strict";var o=r(55);t.exports=function(t,e){var r=arguments.length<=2||void 0===arguments[2]?1500:arguments[2],a=t.params;"row"===e&&"clust"===a.viz.inst_order.col&&setTimeout(o,r,t,"row",!0),"col"===e&&"clust"===a.viz.inst_order.row&&setTimeout(o,r,t,"col",!0),"clust"!=a.viz.inst_order.row&&a.viz.dendro_filter.col===!1&&(d3.selectAll(a.root+" .col_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null),d3.select(a.root+" .col_slider_group").style("opacity",0),d3.selectAll(a.root+" .col_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null)),"clust"!=a.viz.inst_order.col&&a.viz.dendro_filter.row===!1&&(d3.selectAll(a.root+" .row_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null).on("click",null),d3.select(a.root+" .row_slider_group").style("opacity",0),d3.selectAll(a.root+" .row_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null))}},function(t,e,r){"use strict";var o=r(56),a=r(57),n=r(58),i=r(49),s=r(60),l=r(62);t.exports=function(t,e){function r(t,r,o){if(d3.select(t).classed("hovering")){var a=d.viz.root_tips+"_"+e+"_dendro_tip";d3.select(a+" .cat_graph").empty()&&null!==d.viz.cat_info[e]&&l(d,e,r,_[o],a,!0),d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",1)}}var c=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],d=t.params;"both"===e&&(e="row");var u;u="row"===e?"col":"row","clust"===d.viz.inst_order[u]&&d3.select(d.root+" ."+e+"_slider_group").style("opacity",1);var _;_="row"===e?o(d):a(d),d3.select(t.params.root+" ."+e+"_dendro_crop_buttons").empty()===!1&&s(t,e);var p=d.viz.dendro_opacity,f=500;d3.selectAll(t.params.viz.root_tips+"_"+e+"_dendro_tip").remove();var v;d3.selectAll(d.root+" ."+e+"_dendro_group").empty()?v=!1:(v=!0,d3.selectAll(d.root+" ."+e+"_dendro_group").remove());var m=0,h=-5,g=i().attr("class",function(){var t=d.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_tip";return r}).direction("nw").offset([m,h]).style("display","block").style("opacity",0);g.html(function(){var t='<div class="cluster_info_container"></div>Click for cluster information <br>and additional options.';return t}),c&&(v=!1);var w,y,b,x,z,k,A=d3.select(d.root+" ."+e+"_dendro_container").selectAll("path").data(_,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?(w=0,y=t.pos_top,b=30,x=t.pos_mid,z=0,k=t.pos_bot):(w=t.pos_top,y=0,b=t.pos_mid,x=30,z=t.pos_bot,k=0);var r="M"+w+","+y+", L"+b+", "+x+", L"+z+","+k+" Z";return r}),A.on("mouseover",function(o,a){d3.select(this).classed("hovering",!0),null!=t.params.dendro_callback&&t.params.dendro_callback(this),d3.select(d.viz.root_tips+"_"+e+"_dendro_tip").style("display","block"),n(d,this,o,e),g.show(o),d3.select(d.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",0),setTimeout(r,f,this,o,a)}).on("mouseout",function(){"clust"===d.viz.inst_order[u]&&d3.select(this).style("opacity",p),d3.selectAll(d.root+" .dendro_shadow").remove(),d3.select(this).classed("hovering",!1),g.hide(this)}).on("click",function(t,r){$(d.root+" .dendro_info").modal("toggle");var o=t.all_names.join(", ");d3.select(d.root+" .dendro_info input").attr("value",o);var a=".dendro_info";d3.select(".dendro_info .cluster_info_container .cat_graph").remove(),null!==d.viz.cat_info[e]&&l(d,e,t,_[r],a)}).call(g);var T;T="clust"===d.viz.inst_order[u]?p:0,v?d3.select(d.root+" ."+e+"_dendro_container").selectAll("path").transition().delay(1e3).duration(1e3).style("opacity",T):d3.select(d.root+" ."+e+"_dendro_container").selectAll("path").style("opacity",T)}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.row,o=t.network_data.row_nodes,a=t.network_data.row_nodes_names;_.each(o,function(o){var n=o.group[r],i=_.indexOf(a,o.name),s=t.viz.y_scale(i),l=s+t.viz.y_scale.rangeBand();_.has(e,n)===!1&&(e[n]={},e[n].name_top=o.name,e[n].name_bot=o.name,e[n].pos_top=s,e[n].pos_bot=l,e[n].pos_mid=(s+l)/2,e[n].name=n,e[n].all_names=[],e[n].inst_rc="row"),e[n].all_names.push(o.name),s<e[n].pos_top&&(e[n].name_top=o.name,e[n].pos_top=s,e[n].pos_mid=(s+e[n].pos_bot)/2),l>e[n].pos_bot&&(e[n].name_bot=o.name,e[n].pos_bot=l,e[n].pos_mid=(e[n].pos_top+l)/2)});var n=[];return _.each(e,function(t){n.push(t)}),n}},function(t,e){"use strict";t.exports=function(t){var e={},r=t.group_level.col,o=t.network_data.col_nodes,a=t.network_data.col_nodes_names;_.each(o,function(o){var n=o.group[r],i=_.indexOf(a,o.name),s=t.viz.x_scale(i),l=s+t.viz.x_scale.rangeBand();_.has(e,n)===!1&&(e[n]={},e[n].name_top=o.name,e[n].name_bot=o.name,e[n].pos_top=s,e[n].pos_bot=l,e[n].pos_mid=(s+l)/2,e[n].name=n,e[n].all_names=[],e[n].inst_rc="col"),e[n].all_names.push(o.name),s<e[n].pos_top&&(e[n].name_top=o.name,e[n].pos_top=s,e[n].pos_mid=(s+e[n].pos_bot)/2),l>e[n].pos_bot&&(e[n].name_bot=o.name,e[n].pos_bot=l,e[n].pos_mid=(e[n].pos_top+l)/2)});var n=[];return _.each(e,function(t){n.push(t)}),n}},function(t,e,r){"use strict";var o=r(59);t.exports=function(t,e,r,a){function n(){d3.select(e).classed("hovering")&&t.is_slider_drag===!1&&(d3.select(e).style("opacity",.7),i())}function i(){"row"===a?"clust"===t.viz.inst_order.col&&o(t,e,a,r):"col"===a?"clust"===t.viz.inst_order.row&&o(t,e,a,r):"both"===a&&("clust"===t.viz.inst_order.col&&o(t,e,"row",r),"clust"===t.viz.inst_order.row&&o(t,e,"col",r))}var s=500;setTimeout(n,s)}},function(t,e){"use strict";t.exports=function(t,e,r,o){var a,n=.2;d3.selectAll(t.root+" .dendro_shadow").remove(),"row"==r?(d3.select(t.root+" .clust_group").append("rect").style("width",t.viz.clust.dim.width+"px").style("height",o.pos_top+"px").style("fill","black").classed("dendro_shadow",!0).style("opacity",n),a=t.viz.clust.dim.height-o.pos_bot,d3.select(t.root+" .clust_group").append("rect").style("width",t.viz.clust.dim.width+"px").style("height",a+"px").attr("transform","translate(0,"+o.pos_bot+")").style("fill","black").classed("dendro_shadow",!0).style("opacity",n)):"col"===r&&(d3.select(t.root+" .clust_group").append("rect").style("width",o.pos_top+"px").style("height",t.viz.clust.dim.height+"px").style("fill","black").classed("dendro_shadow",!0).style("opacity",n),a=t.viz.clust.dim.width-o.pos_bot,d3.select(t.root+" .clust_group").append("rect").style("width",a+"px").style("height",t.viz.clust.dim.height+"px").attr("transform","translate("+o.pos_bot+",0)").style("fill","black").classed("dendro_shadow",!0).style("opacity",n))}},function(t,e,r){"use strict";var o=r(56),a=r(57),n=r(49),i=r(58),s=r(61);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 l,c,d=t.params,u=.6*d.viz.dendro_opacity;"row"===e?(l=o(d),c="col"):(l=a(d),c="row");var _=0,p=-5,f=n().attr("class",function(){var t=d.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_"+e+"_dendro_crop_tip";return r}).direction("nw").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,h,g,w,y,b,x,z,k,A=45,T=.25,E=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(l,function(t){return t.name}).enter().append("path").classed(E,!0).attr("d",function(t){z=10,k=12;var r=t.pos_bot-t.pos_top;"row"===e?(r<A&&(z=r*T),h=k,g=-z,w=0,y=0,b=k,x=z):(r<A&&(k=r*T),h=-k,g=z,w=0,y=0,b=k,x=z);var o="M"+h+","+g+", L"+w+", "+y+", L"+b+","+x+" Z";return o}),f.html(function(){var t="Click to crop cluster";return t})):(m=d3.select(d.root+" ."+e+"_dendro_icons_group").selectAll("path").data(l,function(t){return t.name}).enter().append("path").classed(E,!0).attr("d",function(t){z=10,k=12;var r=t.pos_bot-t.pos_top;"row"===e?(r<A&&(z=r*T),h=0,g=-z,w=k,y=0,b=0,x=z):(r<A&&(k=r*T),h=-k,g=0,w=0,y=z,b=k,x=0);var o="M"+h+","+g+", L"+w+", "+y+", L"+b+","+x+" Z";return o}),f.html(function(){var t="Click to undo crop";return t})),m.style("cursor","pointer").style("opacity",u).attr("transform",function(t){var r,o,a;return"row"===e?(o=d.viz.uni_margin,a=t.pos_mid):(o=t.pos_mid,a=d.viz.uni_margin),r="translate("+o+","+a+")"}).on("mouseover",function(t){d3.select(this).classed("hovering",!0),f.show(t),i(d,this,t,e),d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_crop_tip").style("opacity",0).style("display","block"),setTimeout(r,v,this)}).on("mouseout",function(){d3.select(this).classed("hovering",!1),d3.selectAll(d.root+" .dendro_shadow").remove(),d3.select(this).style("opacity",u),f.hide(this)}).on("click",function(r){d3.select(this).style("opacity",.9).style("fill","blue").transition().duration(1e3).style("opacity",0),t.params.dendro_filter.row===!1&&t.params.dendro_filter.col===!1&&t.params.cat_filter.row===!1&&t.params.cat_filter.col===!1?(d3.select(t.params.root+" ."+e+"_dendro_icons_group").attr("transform","translate(0,0), scale(1,1)").classed("ran_filter",!0),d3.select(t.params.root+" ."+c+"_dendro_icons_group").attr("transform","translate(0,0), scale(1,1)"),d3.select(t.params.root+" ."+e+"_slider_group").style("display","none"),d3.select(t.params.root+" ."+c+"_dendro_icons_container").style("display","none"),d3.select(t.params.root+" .crop_button").style("opacity",.2)):(d3.select(t.params.root+" ."+e+"_dendro_icons_group").attr("transform","translate(0,0), scale(1,1)").classed("ran_filter",!1),d3.select(t.params.root+" ."+c+"_dendro_icons_group").attr("transform","translate(0,0), scale(1,1)"),"clust"===d.viz.inst_order[c]&&d3.select(t.params.root+" ."+e+"_slider_group").style("display","block"),d3.select(t.params.root+" ."+c+"_dendro_icons_container").style("display","block"),d3.select(t.params.root+" .crop_button").style("opacity",1)),s(t,r,e)}).call(f);var O;"clust"===d.viz.inst_order[c]?O=u:(O=0,d3.select(d.root+" ."+e+"_dendro_icons_group").selectAll("path").style("display","none")),d3.select(d.root+" ."+e+"_dendro_icons_group").selectAll("path").style("opacity",O)}},function(t,e){"use strict";t.exports=function(t,e,r){var o={};if(t.params.dendro_filter.row===!1&&t.params.dendro_filter.col===!1&&t.params.cat_filter.row===!1&&t.params.cat_filter.col===!1){d3.select(t.params.root+" ."+r+"_slider_group").style("opacity",.35).style("pointer-events","none"),o[r]=e.all_names;var a=t.params.network_data[r+"_nodes_names"],n=t.params.network_data.row_nodes,i=t.params.network_data.col_nodes;t.filter_viz_using_names(o),t.params.inst_nodes.row_nodes=n,t.params.inst_nodes.col_nodes=i,d3.selectAll(t.params.root+" .dendro_shadow").transition().duration(1e3).style("opacity",0).remove(),t.params.dendro_filter[r]=a}else o[r]=t.params.dendro_filter[r],t.filter_viz_using_names(o),t.params.dendro_filter[r]=!1}},function(t,e,r){"use strict";var o=r(63);t.exports=function(t,e,r,a,n){var i=!(arguments.length<=5||void 0===arguments[5])&&arguments[5];"both"===e&&(e="row");var s=o(t,r,e);if(s.length>0){var l=d3.select(n+" .cluster_info_container"),c=": ",d="<p>",u=225,p=23,f=20,v=15,m=135,h=27,g=3,w=5,y=20;_.each(s.slice(0,g),function(t){var e=t.bar_data.length;e>w&&(e=w),y+=h*(e+1)}),i&&l.append("text").text("Cluster Information");var b=l.append("div").style("margin-top","5px").classed("cat_graph",!0).append("svg").style("height",y+"px").style("width",u+"px");b.append("rect").classed("cat_background",!0).style("height",y+"px").style("width",u+"px").style("fill","white").style("opacity",1);var x=h;if(s=s.slice(0,g),_.each(s,function(e){e.bar_data=e.bar_data.slice(0,w),l.style("margin-bottom","5px");var r=b.append("g").classed("cat_graph_group",!0).attr("transform","translate(10, "+x+")");x+=h*(e.bar_data.length+1);var o=e.type_name;o.length>=v&&(o=o.slice(0,v)+".."),r.append("text").classed("cat_graph_title",!0).text(o).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",800);var a=15;r.append("text").text("Count").attr("transform",function(){var t=m+a,e="translate("+t+", 0)";return e});var n=4;r.append("line").attr("x1",0).attr("x2",m).attr("y1",n).attr("y2",n).style("stroke","blue").style("stroke-width",1).style("opacity",1);var i=r.append("g").classed("cat_bar_container",!0).attr("transform","translate(0, 10)"),s=i.selectAll("g").data(e.bar_data).enter().append("g").attr("transform",function(t,e){var r=e*p;return"translate(0,"+r+")"}),u=d3.scale.linear().domain([0,e.num_in_clust]).range([0,m]);s.append("rect").style("height",f+"px").style("width",function(t){var e=u(t[2]);return e+"px"}).style("fill",function(t){return t[3]}).style("opacity",t.viz.cat_colors.opacity).style("stroke","grey").style("stroke-width","0.5px"),s.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(d)>0&&(e=e.split(d)[0]),e.length>=v&&(e=e.slice(0,v)+".."),e}).attr("transform",function(){return"translate(5, "+.75*f+")"}).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",400);var _=25;s.append("text").classed("count_labels",!0).text(function(t){return String(t[4])}).attr("transform",function(){var t=m+a+_,e=.75*f;return"translate("+t+", "+e+")"}).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",400).style("text-anchor","end")}),i){var z=d3.select(n),k=z.style("top").split(".px")[0],A=z.style("left").split(".px")[0],T=0,E=0;"row"===e?(T=y+30,E=32,a.pos_top<y&&(T=-(y+(a.pos_mid-a.pos_top)/2))):(T=y+32,E=30),z.style("top",function(){var t=String(parseInt(k,10)-T)+"px";return t}).style("left",function(){var t=String(parseInt(A,10)-E)+"px";return t})}}}},function(t,e){"use strict";t.exports=function(t,e,r){"both"===r&&(r="row");var o,a=e.all_names,n=[],i=t.network_data[r+"_nodes"];_.each(i,function(t){o=t.name,a.indexOf(o)>=0&&n.push(t)});var s=[];if(null!==t.viz.cat_info[r]){for(var l,c,d,u=t.viz.cat_info[r],p=_.keys(u),f=[],v=[],m=0;m<p.length;m++)d="cat-"+String(m),"cat_strings"===t.viz.cat_info[r][d].type&&(l=t.viz.cat_names[r][d],v.push(l),f.push(d));var h,g,w={},y={},b=2,x=10;if(g=l===d,v.length>0){var z,k=a.length;_.each(f,function(e){if(c=e.split("-")[1],l=v[c],g)if(e.indexOf("-")>=0){var o=parseInt(e.split("-")[1],x)+1;l="Category "+String(o)}else l="Category";w[l]={},_.each(n,function(t){z=t[e],z.indexOf(": ")>=0&&(z=z.split(": ")[1]),z in w[l]?w[l][z]=w[l][z]+1:w[l][z]=1}),y={},y.type_name=l,y.num_in_clust=k,h=[];var a,i,d=w[l];for(var u in d){i=g?u:l+": "+u;var p=d[u];a=t.viz.cat_colors[r][e][i],h.push([e,i,d[u],a,p])}h.sort(function(t,e){return e[b]-t[b]}),y.bar_data=h,s.push(y)})}}return s}},function(t,e,r){"use strict";var o=r(65);t.exports=function(t){var e={},r=t.zoom_info;return e.min_x=Math.abs(r.trans_x)/r.zoom_x-5*t.viz.rect_width,e.min_y=Math.abs(r.trans_y)/r.zoom_y-5*t.viz.rect_height,e.max_x=Math.abs(r.trans_x)/r.zoom_x+t.viz.clust.dim.width/r.zoom_x,e.max_y=Math.abs(r.trans_y)/r.zoom_y+t.viz.clust.dim.height/r.zoom_y,d3.selectAll(t.root+" .row_label_group").each(function(){o(e,this,"row")}),d3.selectAll(t.root+" .row").each(function(){o(e,this,"row")}),d3.selectAll(t.root+" .col_label_text").each(function(){o(e,this,"col")}),e}},function(t,e){"use strict";t.exports=function(t,e,r){var o=d3.select(e).attr("transform");if("row"===r){var a=Number(o.split(",")[1].split(")")[0]);d3.select(e).style("display",function(){var e;return e=a<t.max_y&&a>t.min_y?"block":"none"})}else{var n=Number(o.split("(")[1].split(",")[0].split(")")[0]);d3.select(e).style("display",function(){var e;return e=n<t.max_x&&n>t.min_x?"block":"none"})}}},function(t,e,r){"use strict";var o=r(2),a=r(53),n=r(54),i=r(64),s=r(36);t.exports=function(t,e,r){var l=t.params;l.viz.inst_order.col="custom",n(t,"col"),d3.selectAll(l.root+" .toggle_row_order .btn").classed("active",!1),l.viz.run_trans=!0;var c=l.matrix.matrix,d=l.network_data.row_nodes,u=l.network_data.col_nodes,p=o.pluck(d,"name"),f=[];u.forEach(function(t){f.push(t.name)});var v=_.indexOf(f,r);f=[],d.forEach(function(t,e){f.push(c[e].row_data[v].value)});var m=d3.range(f.length).sort(function(t,e){return f[e]-f[t]});l.viz.y_scale.domain(m),l.matrix.orders.custom_col=m;var h;l.network_data.links.length>l.matrix.def_large_matrix?(h=d3.select(l.root+" .clust_group"),d3.selectAll(l.root+" .row_cat_group").attr("transform",function(t){var e=_.indexOf(p,t.name);return"translate(0,"+l.viz.y_scale(e)+")"}),d3.select(l.root+" .row_label_zoom_container").selectAll(".row_label_group").attr("transform",function(t){var e=_.indexOf(p,t.name);return"translate(0,"+l.viz.y_scale(e)+")"})):(h=d3.select(l.root+" .clust_group").transition().duration(2500),d3.selectAll(l.root+" .row_cat_group").transition().duration(2500).attr("transform",function(t){var e=_.indexOf(p,t.name);return"translate(0,"+l.viz.y_scale(e)+")"}),d3.select(l.root+" .row_label_zoom_container").selectAll(".row_label_group").transition().duration(2500).attr("transform",function(t){var e=_.indexOf(p,t.name);return"translate(0,"+l.viz.y_scale(e)+")"})),h.selectAll(".row").attr("transform",function(t){var e=_.indexOf(p,t.name);return"translate(0,"+l.viz.y_scale(e)+")"}),d3.selectAll(l.root+" .col_label_text").select(".highlight_rect").style("opacity",0),d3.select(e).select(".highlight_rect").style("opacity",1),l.network_data.links.forEach(function(t){t.x=l.viz.x_scale(t.target),t.y=l.viz.y_scale(t.source)}),a(l),l.zoom_info=s(),i(l),setTimeout(function(){l.viz.run_trans=!1},2500)}},function(t,e,r){"use strict";var o=r(49);t.exports=function(t){if(t.labels.show_label_tooltips){var e=o().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip row_tip";return r}).direction("e").offset([0,10]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return"<span>"+e+"</span>"});d3.select(t.viz.viz_wrapper).select(t.root+" .row_container").call(e),d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",function(r){d3.select(" .row_tip").classed(r.name,!0),d3.selectAll(".row_tip").style("display","block"),d3.select(this).select("text").classed("active",!0),e.show(r),null!=t.row_tip_callback&&t.row_tip_callback(r)}).on("mouseout",function(t){d3.selectAll(".row_tip").style("display","none").classed(t.name,!1),d3.select(this).select("text").classed("active",!1),e.hide(t)})}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 o=r(2),a=r(69),n=r(66),i=r(52),s=r(70),l=r(71);t.exports=function(t,e){var r,c=t.params,d=c.network_data.col_nodes,u=c.network_data.col_nodes_names,p=c.viz.x_scale.rangeBand()/2+c.viz.border_width.x;d3.select(c.root+" .col_container").empty()?(r=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+")"),r.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"),r.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")):(r=d3.select(c.root+" .col_container").attr("transform","translate("+c.viz.clust.margin.left+","+c.viz.norm_labels.margin.top+")"),r.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),r.select(c.root+" .col_label_outer_container"));var f=d3.select(c.root+" .col_zoom_container").selectAll(".col_label_text").data(d,function(t){return t.name}).enter().append("g").attr("class","col_label_text").attr("transform",function(t){var e=_.indexOf(u,t.name);return"translate("+c.viz.x_scale(e)+", 0) rotate(-90)"}),v=f.append("g").attr("class","col_label_group").attr("transform","translate("+c.viz.x_scale.rangeBand()/2+","+p+") rotate(45)").on("mouseover",function(){
d3.select(this).select("text").classed("active",!0)}).on("mouseout",function(){d3.select(this).select("text").classed("active",!1)});o.has(c.network_data.col_nodes[0],"value")&&v.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),v.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 o.normal_name(t)}).style("opacity",0).transition().delay(e).duration(e).style("opacity",1),s(c),v.append("path").style("stroke-width",0).attr("d",function(){return l(c)}).attr("fill","#eee").style("opacity",0).transition().delay(e).duration(e).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"),a(c,this,t.ini)):c.tile_click_hlight&&a(c,this,t.ini)}).on("dblclick",function(e){var r="__data__",o=this[r].name;if(c.sim_mat){n(t,this,o);var s=d3.selectAll(c.root+" .row_label_group").filter(function(t){return t.name==o})[0][0];i(t,s,o)}else n(t,this,o);c.tile_click_hlight&&a(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 o=6,a=.85,n=o*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",n).attr("fill",t.matrix.hlight_color).attr("opacity",a).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",n).attr("fill",t.matrix.hlight_color).attr("opacity",a).attr("transform",function(){var e=t.viz.x_scale.rangeBand()-n,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 o=r(49);t.exports=function(t){if(t.labels.show_label_tooltips){var e=o().attr("class",function(){var e=t.viz.root_tips.replace(".",""),r=e+" d3-tip col_tip";return r}).direction("w").offset([20,0]).style("display","none").html(function(t){var e=t.name.replace(/_/g," ").split("#")[0];return"<span>"+e+"</span>"});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(".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(".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,o=0,a=t.viz.x_scale.rangeBand()-e,n=-(t.viz.x_scale.rangeBand()-e+t.viz.border_width.x),i=-t.viz.border_width.x,s="M "+r+",0 L "+n+","+o+", L "+i+","+a+" 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(0,"+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,o=t.viz.super_labels.dim.width;return"translate("+r+","+o+")"}).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,o="translate(0,"+r+"), rotate(-90)";return o}).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 o=r(74),a=r(75),n=r(77),i=r(60);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,f=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin;var c=1.15*r.cat_room.symbol_width,d=.65,u=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",d).style("cursor","default").attr("transform",function(t){var e=parseInt(t.split("-")[1],10),o=f+u*r.cat_room.symbol_width*e;return"translate("+p+","+o+")"}).text(function(t){return o(r,t,"col")}),r.show_categories.row&&n(t),f=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 _=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,f=0,_.append("g").classed("col_dendro_icons_container",!0).attr("transform","translate("+p+","+f+")").append("g").classed("col_dendro_icons_group",!0),i(t,"col");var p=r.clust.margin.left+r.clust.dim.width,f=r.clust.margin.top+r.clust.dim.height,v=r.cat_room.col+r.clust.dim.width,m=r.cat_room.row+10*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",v).attr("height",m).attr("transform",function(){return"translate("+p+","+f+")"}).classed("white_bars",!0).classed("dendro_corner_spillover",!0),p=0,f=r.clust.margin.top+r.clust.dim.height,v=r.clust.margin.left,m=10*r.clust.dim.height,d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",v).attr("height",m).attr("transform",function(){return"translate("+p+","+f+")"}).classed("white_bars",!0).classed("dendro_col_spillover",!0),a(t)}},function(t,e){"use strict";t.exports=function(t,e,r){var o;if(t.cat_names[r][e]===e){var a=parseInt(e.split("-")[1],10)+1;o="Category "+a}else o=t.cat_names[r][e];return o}},function(t,e,r){"use strict";var o=r(76);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 a=this.__data__.replace("-","_")+"_index";e.viz.sim_mat?(o(t,a,"row"),o(t,a,"col")):o(t,a,r)})})}},function(t,e,r){"use strict";var o=r(2),a=r(54),n=r(64),i=r(36),s=r(48);t.exports=function(t,e,r){var l,c=t.params;"row"===r?l="col":"col"===r&&(l="row"),c.viz.run_trans=!0,"row"===l?c.viz.inst_order.row=e:"col"===l&&(c.viz.inst_order.col=e),c.viz.show_dendrogram&&a(t,r);var d=c.network_data.row_nodes,u=o.pluck(d,"name"),p=c.network_data.col_nodes,f=o.pluck(p,"name");"row"===l?c.viz.x_scale.domain(c.matrix.orders[c.viz.inst_order.row+"_row"]):"col"==l&&c.viz.y_scale.domain(c.matrix.orders[c.viz.inst_order.col+"_col"]);var v;d3.selectAll(c.root+" .tile")[0].length<c.matrix.def_large_matrix?(v=d3.select(c.root+" .clust_group").transition().duration(2500),v.selectAll(".row").attr("transform",function(t){var e=_.indexOf(u,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),v.selectAll(".row").selectAll(".tile").attr("transform",function(t){return"translate("+c.viz.x_scale(t.pos_x)+" , 0)"}),v.selectAll(".row").selectAll(".tile_circle").attr("transform",function(t){return s(c,t)}),v.selectAll(".tile_up").attr("transform",function(t){return"translate("+c.viz.x_scale(t.pos_x)+" , 0)"}),v.selectAll(".tile_dn").attr("transform",function(t){return"translate("+c.viz.x_scale(t.pos_x)+" , 0)"}),d3.select(c.root+" .row_label_zoom_container").selectAll(".row_label_group").transition().duration(2500).attr("transform",function(t){var e=_.indexOf(u,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),d3.select(c.root+" .col_zoom_container").selectAll(".col_label_text").transition().duration(2500).attr("transform",function(t){var e=_.indexOf(f,t.name);return"translate("+c.viz.x_scale(e)+") rotate(-90)"}),d3.selectAll(c.root+" .row_cat_group").transition().duration(2500).attr("transform",function(t){var e=_.indexOf(u,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),d3.selectAll(c.root+" .col_cat_group").transition().duration(2500).attr("transform",function(t){var e=_.indexOf(f,t.name);return"translate("+c.viz.x_scale(e)+",0)"})):(v=d3.select(c.root+" .clust_group"),v.selectAll(".row").attr("transform",function(t){var e=_.indexOf(u,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}).selectAll(".tile").attr("transform",function(t){return"translate("+c.viz.x_scale(t.pos_x)+" , 0)"}),v.selectAll(".tile_up").attr("transform",function(t){return"translate("+c.viz.x_scale(t.pos_x)+" , 0)"}),v.selectAll(".tile_dn").attr("transform",function(t){return"translate("+c.viz.x_scale(t.pos_x)+" , 0)"}),d3.select(c.root+" .row_label_zoom_container").selectAll(".row_label_group").attr("transform",function(t){var e=_.indexOf(u,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),d3.select(c.root+" .col_zoom_container").selectAll(".col_label_text").attr("transform",function(t){var e=_.indexOf(f,t.name);return"translate("+c.viz.x_scale(e)+") rotate(-90)"}),d3.selectAll(c.root+" .row_cat_group").attr("transform",function(t){var e=_.indexOf(u,t.name);return"translate(0,"+c.viz.y_scale(e)+")"}),d3.selectAll(c.root+" .col_cat_group").attr("transform",function(t){var e=_.indexOf(f,t.name);return"translate("+c.viz.x_scale(e)+",0)"})),c.network_data.links.forEach(function(t){t.x=c.viz.x_scale(t.target),t.y=c.viz.y_scale(t.source)}),c.zoom_info=i(),n(c),setTimeout(function(){c.viz.run_trans=!1},2500)}},function(t,e,r){"use strict";var o=r(74),a=r(49);t.exports=function(t){var e=t.params,r=e.viz,n=2.75;d3.select(".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,d=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+n*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 u=50,_=-75,p=a().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip "+t+"_row_cat_super";return r}).direction("south_custom").offset([u,_]).style("display","none").style("opacity",0).html(function(t){var a,n=e.network_data.row_nodes[0][t];if(n.indexOf("<p>")>-1){var i=n.split(": ")[0],s=n.split("<p>")[1];a=i+"<p>"+s}else a=o(r,t,"row");return a}),f=d*r.cat_room.symbol_width,v=.9*f;r.sim_mat===!1&&(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=d*r.cat_room.symbol_width*parseInt(t.split("-")[1],10);return"translate(0,"+e+")"}).text(function(t){return o(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=f*(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)}},function(t,e,r){"use strict";var o=r(79);t.exports=function(t){var e,r=t.params;d3.select(r.root+" .expand_button").on("click",null);var a=.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",a).on("mouseover",function(){d3.select(this).style("opacity",.75)}).on("mouseout",function(){d3.select(this).style("opacity",a)}).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(o,e,t)})}},function(t,e,r){"use strict";var o=r(2),a=r(80),n=r(90),i=r(93),s=r(94),l=r(95),c=r(96),d=r(97),u=r(98),p=r(99),f=r(100),v=r(101),m=r(102),h=r(103),g=r(104),w=r(105),y=r(106),b=r(107),x=r(92),z=r(55),k=r(54),A=r(64),T=r(24),E=r(108),O=r(77),B=r(75),S=r(109),M=r(36),N=r(40);t.exports=function(t){var e=t.params,r=T(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=w(e),e.zoom_info=M(),i(e);var C=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)}),C.on(".zoom",null),e.zoom_behavior.scaleExtent([1,e.viz.real_zoom*e.viz.zoom_switch]).on("zoom",function(){a(t)}),e.viz.do_zoom&&C.call(e.zoom_behavior),n(e),C.attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height),C.select(".super_background").style("width",e.viz.svg_dim.width).style("height",e.viz.svg_dim.height),C.select(".grey_background").attr("width",e.viz.clust.dim.width).attr("height",e.viz.clust.dim.height),setTimeout(E,100,e);var L=e.network_data.row_nodes,F=o.pluck(L,"name");y(e,C),C.selectAll(".highlighting_rect").attr("width",.8*e.viz.x_scale.rangeBand()).attr("height",.8*e.viz.y_scale.rangeBand()),p(e),u(e,C),f(e,C),C.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})}),C.selectAll(".row_label_group").select("text").attr("y",.5*e.viz.rect_height+.35*e.labels.default_fs_row),o.has(e.network_data.row_nodes[0],"value")&&b(t,C),C.selectAll(".row_cat_group").attr("transform",function(t){var r=_.indexOf(F,t.name);return"translate(0, "+e.viz.y_scale(r)+")"}),C.selectAll(".row_cat_group").select("path").attr("d",function(){var t=e.viz.cat_room.symbol_width-1,r=0,o=1,a=e.viz.rect_height/2,n=e.viz.cat_room.symbol_width-1,i=e.viz.rect_height,s="M "+t+","+r+" L "+o+","+a+", L "+n+","+i+" Z";return s});var R=!0;e.viz.show_dendrogram?(z(t,"row",R),z(t,"col",R),s(e,C),k(t,"row",0),k(t,"col",0)):s(e,C),v(e,C),m(e,C),h(e,C),g(e,C),l(e,C),c(e.viz,C),N(e),d(e,C),e.zoom_behavior.scale(1).translate([e.viz.clust.margin.left,e.viz.clust.margin.top]),x(e),d3.select(e.root+" .clust_container").attr("transform","translate("+e.viz.clust.margin.left+","+e.viz.clust.margin.top+")"),A(e),O(t),d3.select(e.viz.viz_svg).style("opacity",1),B(t),d3.select(t.params.root+" .row_slider_group").style("opacity",0),d3.select(t.params.root+" .col_slider_group").style("opacity",0),setTimeout(S,500,t,"row"),setTimeout(S,500,t,"col")}},function(t,e,r){"use strict";var o=r(81),a=r(88),n=r(89);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=a(e.viz,r),e.zoom_info=n(e.viz,r),e.is_slider_drag===!1&&e.is_cropping===!1){var i=r.trans_x+e.viz.clust.margin.left,s=r.trans_y+e.viz.clust.margin.top;e.zoom_behavior.translate([i,s]),o(e)}}},function(t,e,r){"use strict";var o=r(82),a=r(84),n=r(64),i=r(87),s=r(85);t.exports=function(t){var e=t.zoom_info;d3.select(t.root+" .clust_group").attr("transform","translate("+[e.trans_x,e.trans_y]+") scale("+e.zoom_x+","+e.zoom_y+")"),d3.select(t.root+" .row_label_zoom_container").attr("transform","translate("+[0,e.trans_y]+") scale("+e.zoom_y+")"),d3.select(t.root+" .col_zoom_container").attr("transform","translate("+[e.trans_x,0]+") scale("+e.zoom_x+")"),d3.select(t.root+" .row_cat_container").attr("transform","translate("+[0,e.trans_y]+") scale( 1,"+e.zoom_y+")"),d3.select(t.root+" .row_dendro_container").attr("transform","translate("+[t.viz.uni_margin/2,e.trans_y]+") scale( 1,"+e.zoom_y+")"),d3.select(t.root+" .row_dendro_icons_group").attr("transform",function(){var t=e.trans_y,r="translate("+[0,t]+") ",o="scale(1, "+e.zoom_y+")",a=r+o;return a}),d3.select(t.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(r){var o=t.viz.uni_margin,a=r.pos_mid;return"translate("+o+","+a+") scale(1, "+1/e.zoom_y+")"}),d3.select(t.root+" .col_dendro_icons_group").attr("transform",function(){var t=e.trans_x,r="translate("+[t,0]+")",o="scale("+e.zoom_x+", 1)",a=r+o;return a}),d3.select(t.root+" .col_dendro_icons_group").selectAll("path").attr("transform",function(r){var o=r.pos_mid,a=t.viz.uni_margin;return"translate("+o+","+a+") scale("+1/e.zoom_x+", 1)"}),d3.select(t.root+" .col_cat_container").attr("transform","translate("+[e.trans_x,0]+") scale("+e.zoom_x+",1)"),d3.select(t.root+" .col_dendro_container").attr("transform","translate("+[e.trans_x,t.viz.uni_margin/2]+") scale("+e.zoom_x+",1)"),o(t),i(t,e),d3.select(t.root+" .viz_svg").attr("is_zoom",function(){var e=Number(d3.select(t.root+" .viz_svg").attr("is_zoom"));return d3.select(t.root+" .viz_svg").attr("stopped_zoom",1),e+1});var r=function(){d3.select(t.root+" .viz_svg").attr("is_zoom",function(){var e=Number(d3.select(t.root+" .viz_svg").attr("is_zoom"));return e-1})};setTimeout(r,100),setTimeout(a,1e3,t),_.each(["row","col"],function(e){var r=s(t,e);d3.selectAll(".horz_lines").select("line").style("display","none"),d3.selectAll(".vert_lines").select("line").style("display","none"),r>75&&(d3.selectAll(t.root+" ."+e+"_label_group").select("text").style("display","none"),d3.selectAll(t.root+" ."+e+"_cat_group").select("path").style("display","none"))}),n(t,e)}},function(t,e,r){"use strict";var o=r(83);t.exports=function(t){var e,r=t.labels.default_fs_row,a=o(t);a.row>t.labels.max_allow_fs?(e=t.viz.zoom_switch_y?t.zoom_behavior.scale()/t.viz.zoom_switch_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>t.labels.max_allow_fs?(e=t.viz.zoom_switch>1?t.zoom_behavior.scale()/t.viz.zoom_switch: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_switch>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_switch_y,e.col=t.labels.default_fs_col*t.zoom_behavior.scale()),e}},function(t,e,r){"use strict";var o=r(85),a=r(86),n=r(82),i=r(41);t.exports=function(t){function e(){_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_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=Number(d3.select(t.root+" .viz_svg").attr("is_zoom"));if(_.each(["row","col"],function(e){d3.selectAll(t.root+" ."+e+"_label_group").select("text").style("opacity",1),d3.selectAll(t.root+" ."+e+"_cat_group").select("path").style("display","block")}),0===r){var s=Number(d3.select(t.root+" .viz_svg").attr("stopped_zoom"));0!=s&&(d3.selectAll(t.viz.root_tips).style("display","block"),d3.selectAll(t.root+" .row_label_group").select("text").style("display","none"),d3.selectAll(t.root+" .row_label_group").select("text").style("display","block"),d3.select(t.root+" .viz_svg").attr("stopped_zoom",0),d3.selectAll(t.root+" .row_label_group").select("text").style("display","block"),d3.selectAll(t.root+" .col_label_group").select("text").style("display","block"),i(t),_.each(["row","col"],function(e){var r=o(t,e);r<125&&d3.selectAll(t.root+" ."+e+"_label_group").each(function(){a(t,this,e)})}),e(),n(t)),setTimeout(e,25),setTimeout(e,100)}}},function(t,e){"use strict";t.exports=function(t,e){var r;"row"===e?r="group":"col"===e&&(r="text");var o=d3.selectAll(t.root+" ."+e+"_label_"+r).filter(function(){return"none"!=d3.select(this).style("display")})[0].length;return o}},function(t,e){"use strict";t.exports=function(t,e,r){function o(){return d=d3.select(this).text(),c=d.length,_=c-3,l=d.substring(0,_)+".."}function a(t){return d=d3.select(this).text(),c=".."===d.slice(-2)?d.length-2:d.length,u=t.name,_=c+2,l=u.substring(0,_)+"..",l.length>u.length&&(l=u),l}function n(t,e){return s=e<1?t:t*e}if("none"!=d3.select(e).style("display")){var i,s,l,c,d,u,_,p,f=t.viz.norm_labels.width[r];i="row"===r?t.viz.zoom_switch_y?t.zoom_behavior.scale()/t.viz.zoom_switch_y:t.zoom_behavior.scale():t.viz.zoom_switch>1?t.zoom_behavior.scale()/t.viz.zoom_switch:t.zoom_behavior.scale();var v;d3.select(e).select("text").each(function(t){v=t.name.length});var m=d3.select(e).select("text").node().getBBox().width;if(s=n(m,i),s>f)for(p=1;p<v;p++)s>f&&(d3.select(e).select("text").text(o),m=d3.select(e).select("text").node().getBBox().width,s=n(m,i));else if(s<.75*f)for(p=1;p<v;p++)s<.75*f&&(d3.select(e).select("text").text(a),m=d3.select(e).select("text").node().getBBox().width,s=n(m,i))}}},function(t,e,r){"use strict";var o=r(2);t.exports=function(t){var e=t.zoom_info;o.has(t.network_data.row_nodes[0],"value")&&d3.selectAll(t.root+" .row_bars").attr("width",function(r){var o=0;return o=t.labels.bar_scale_row(Math.abs(r.value))/e.zoom_y}).attr("x",function(r){var o=0;return o=-t.labels.bar_scale_row(Math.abs(r.value))/e.zoom_y}),o.has(t.network_data.col_nodes[0],"value")&&d3.selectAll(t.root+" .col_bars").attr("width",function(r){var o=0;return r.value>0&&(o=t.labels.bar_scale_col(r.value)/e.zoom_x),o})}},function(t,e){"use strict";t.exports=function(t,e){return t.zoom_switch_y>1&&(e.zoom_y<t.zoom_switch_y?(e.trans_y=0,e.zoom_y=1):e.zoom_y=e.zoom_y/t.zoom_switch_y),e.pan_room_y=(e.zoom_y-1)*t.clust.dim.height,e.trans_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){return t.zoom_switch>1&&(e.zoom_x<t.zoom_switch?(e.trans_x=0,e.zoom_x=1):e.zoom_x=e.zoom_x/t.zoom_switch),e.pan_room_x=(e.zoom_x-1)*t.clust.dim.width,e.trans_x>0?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 o=r(91);t.exports=function(t){d3.selectAll(t.viz.zoom_element).on("dblclick.zoom",null),d3.select(t.viz.zoom_element).on("dblclick",function(){o(t,0,0,1)})}},function(t,e,r){"use strict";var o=r(2),a=r(92),n=r(64),i=r(36),s=r(41);t.exports=function(t,e,r,l){function c(e,r){d3.selectAll(t.root+" ."+e+"_dendro_crop_buttons").transition().duration(h).style("opacity",r)}if(d3.selectAll(t.viz.root_tips).style("display","none"),t.zoom_info=i(),n(t),!t.viz.run_trans){var d=t.viz.clust.dim.height/2,u=d/t.viz.zoom_switch;if(r>=d-u){var p=d-r,f=-d/t.viz.zoom_switch+p;r+=f}r<-(d-u)&&(p=d+r,f=d/t.viz.zoom_switch-p,r+=f);var v,m=l;v=l<=t.viz.zoom_switch?1:l/t.viz.zoom_switch;var h=700,g=-(m-1)*d;d3.select(t.root+" .clust_group").transition().duration(h).attr("transform","translate("+[0,0+g]+") scale("+v+","+m+")translate("+[e,r]+")"),d3.select(t.root+" .row_label_zoom_container").transition().duration(h).attr("transform","translate("+[0,g]+") scale("+m+","+m+")translate("+[0,r]+")"),d3.select(t.root+" .row_cat_container").transition().duration(h).attr("transform","translate("+[0,g]+") scale(1,"+m+")translate("+[0,r]+")"),d3.select(t.root+" .row_dendro_container").transition().duration(h).attr("transform","translate("+[0,g]+") scale("+v+","+m+")translate("+[t.viz.uni_margin/2,r]+")");var w;_.each(["row","col"],function(e){w=d3.select(t.root+" ."+e+"_dendro_crop_buttons").style("opacity"),d3.selectAll(t.root+" ."+e+"_dendro_crop_buttons").style("opacity",0),setTimeout(c,700,e,w)}),d3.select(t.root+" .col_zoom_container").transition().duration(h).attr("transform"," scale("+v+","+v+")translate("+[e,0]+")"),d3.select(t.root+" .col_cat_container").transition().duration(h).attr("transform"," scale("+v+",1)translate("+[e,0]+")"),d3.select(t.root+" .col_dendro_container").transition().duration(h).attr("transform"," scale("+v+",1)translate("+[e,t.viz.uni_margin/2]+")");var y=t.viz.clust.margin.top+g+r*m,b=t.viz.clust.margin.left+e;t.zoom_behavior.scale(m).translate([b,y]),a(t),d3.select(t.root+" .row_label_zoom_container").each(function(){var e=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",.5*e.x).attr("y",0).attr("width",.5*e.width).attr("height",t.viz.y_scale.rangeBand()).style("fill","yellow")}),d3.select(t.root+" .row_dendro_icons_group").attr("transform","translate("+[0,0+g]+") scale("+v+","+m+")translate("+[e,r]+")"),d3.select(t.root+" .row_dendro_icons_group").selectAll("path").attr("transform",function(e){var r=t.viz.uni_margin,o=e.pos_mid;return"translate("+r+","+o+") scale(1, "+1/m+")"}),d3.select(t.root+" .col_dendro_icons_group").attr("transform","translate("+[0,0+g]+") scale("+v+","+m+")translate("+[e,r]+")"),d3.select(t.root+" .col_dendro_icons_group").selectAll("path").attr("transform",function(e){var r=e.pos_mid,o=t.viz.uni_margin;return"translate("+r+","+o+") scale("+1/v+",1)"}),o.has(t.network_data.col_nodes[0],"value")&&d3.selectAll(t.root+" .col_bars").attr("width",function(e){var r=0;return e.value>0&&(r=t.labels.bar_scale_col(e.value)/v),r}),o.has(t.network_data.row_nodes[0],"value")&&d3.selectAll(t.root+" .row_bars").transition().duration(h).attr("width",function(e){var r=0;return r=t.labels.bar_scale_row(Math.abs(e.value))/m}).attr("x",function(e){var r=0;return r=-t.labels.bar_scale_row(Math.abs(e.value))/m}),s(t)}}},function(t,e,r){"use strict";var o=r(2),a=r(86),n=r(82);t.exports=function(t){d3.selectAll(t.root+" .row_label_group").select("text").text(function(t){return o.normal_name(t)}),d3.selectAll(t.root+" .col_label_text").select("text").text(function(t){return o.normal_name(t)}),n(t),d3.selectAll(t.root+" .row_label_group").each(function(){a(t,this,"row")}),d3.selectAll(t.root+" .col_label_group").each(function(){a(t,this,"col")})}},function(t,e){"use strict";t.exports=function(t){var e=1,r=0,o=0,a=t.viz.clust.dim.height/2,n=-(e-1)*a;d3.select(t.root+" .clust_group").attr("transform","translate("+[0,0+n]+") scale(1,"+e+")translate("+[r,o]+")"),d3.select(t.root+" .row_label_zoom_container").attr("transform","translate("+[0,n]+") scale("+e+","+e+")translate("+[0,o]+")"),d3.select(t.root+" .row_cat_container").attr("transform","translate("+[0,n]+") scale(1,"+e+")translate("+[0,o]+")"),d3.select(t.root+" .row_dendro_container").attr("transform","translate("+[0,n]+") scale("+e+","+e+")translate("+[t.viz.uni_margin/2,o]+")"),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],o={};r===!1?o.run_transition=!1:o=r;var a,n=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;o.run_transition?(a=e.transition().delay(o.update).duration(n),e.selectAll(".col_cat_group").data(i,function(t){return t.name}).transition().delay(o.update).duration(n).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(o.update).duration(n).attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate("+t.viz.x_scale(r)+",0)"})):(a=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;l<r;l++)c="."+e+"_cat_rect_"+String(l),"row"===e?a.selectAll(c).attr("height",t.viz.y_scale.rangeBand()):a.selectAll(c).attr("width",t.viz.x_scale.rangeBand())});var d=t.viz.clust.margin.left+t.viz.clust.dim.width,u=t.viz.clust.margin.top,p=t.viz.dendro_room.row+t.viz.uni_margin;d3.select(t.root+" .viz_svg").select("row_dendro_outer_container").attr("transform","translate("+d+","+u+")"),d3.select(t.root+" .row_dendro_outer_container").select(".row_dendro_spillover").attr("width",p+"px").attr("height",t.viz.svg_dim.height),d=t.viz.clust.margin.left,u=t.viz.clust.margin.top+t.viz.clust.dim.height;var f=t.viz.dendro_room.col+t.viz.uni_margin;d3.select(t.root+" .col_dendro_outer_container").select(".col_dendro_spillover").attr("width",t.viz.svg_dim.width).attr("height",f+"px"),d3.select(t.root+" .col_dendro_outer_container").select(".col_dendro_spillover_top").attr("width",t.viz.svg_dim.width).attr("height",t.viz.svg_dim.height).attr("transform","translate(0,"+t.viz.dendro_room.col+")"),d=t.viz.clust.margin.left,u=0,d3.select(t.root+" .col_dendro_icons_container").attr("transform","translate("+d+","+u+")")}},function(t,e){"use strict";t.exports=function(t,e){var r,o=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],a={},n=t.viz.duration;o===!1?a.run_transition=!1:a=o,r=a.run_transition?e.transition().delay(a.update).duration(n):e,r.select(".super_col_bkg").attr("height",t.viz.super_labels.dim.width+"px").attr("transform","translate(0,"+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,o=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],a={},n=t.duration;o===!1?a.run_transition=!1:a=o,r=a.run_transition?e.transition().delay(a.update).duration(n):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,d=l,u=t.dendro_room.row+t.uni_margin,_=t.cat_room.col+t.uni_margin;d3.select(t.root+" .dendro_row_spillover").attr("width",u).attr("height",_).attr("transform",function(){return"translate("+c+","+d+")"}),c=0,d=t.clust.margin.top+t.clust.dim.height,u=t.clust.margin.left,_=10*t.clust.dim.height,r.select(".dendro_col_spillover").attr("width",u).attr("height",_).attr("transform",function(){return"translate("+c+","+d+")"}),c=t.clust.margin.left+t.clust.dim.width,d=t.clust.margin.top+t.clust.dim.height,u=t.cat_room.col+t.clust.dim.width,_=t.cat_room.row+t.uni_margin,r.select(".dendro_corner_spillover").attr("width",u).attr("height",_).attr("transform",function(){return"translate("+c+","+d+")"}),c=t.clust.margin.left+t.clust.dim.width+t.uni_margin,d=t.norm_labels.margin.top+t.norm_labels.width.col+2.5*t.uni_margin;var p=2.75,f=1.2;t.show_categories.col&&d3.selectAll(t.root+" .col_cat_super").attr("transform",function(e){var r=parseInt(e.split("-")[1],10),o=d+f*t.cat_room.symbol_width*r;return"translate("+c+","+o+")"}),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,d=t.clust.margin.top-t.uni_margin,"translate("+c+","+d+") rotate(-90)"}),d=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,"+d+")"}),r.select(t.root+" .bottom_spillover").attr("width",t.svg_dim.width).attr("height",2*t.svg_dim.height);var v=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",v).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,o=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],a={},n=t.viz.duration,i=t.network_data.row_nodes,s=t.network_data.row_nodes_names;o===!1?a.run_transition=!1:a=o,a.run_transition?(e.selectAll(".row_label_group").data(i,function(t){return t.name}).transition().delay(a.update).duration(n).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(a.update).duration(n)):(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,o=e*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.rect_width).attr("height",o).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*o).attr("transform",function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*o+")"}),d3.select(t.root+" .right_hlight").attr("width",r).attr("height",t.viz.rect_height-.99*o).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.rect_width-r;return"translate("+e+","+.99*o+")"}),d3.select(t.root+" .bottom_hlight").attr("width",function(){return t.viz.rect_width-1.98*r}).attr("height",o).attr("transform",function(){var e=t.viz.x_scale(t.matrix.click_hlight_x)+.99*r,a=t.viz.rect_height-o;return"translate("+e+","+a+")"}),d3.select(t.root+" .row_top_hlight").attr("width",t.viz.svg_dim.width).attr("height",o),d3.select(t.root+" .row_bottom_hlight").attr("width",t.viz.svg_dim.width).attr("height",o).attr("transform",function(){var e=t.viz.rect_height-o;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,o=-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin);return"translate("+o+","+e+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,o=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],a={},n=t.viz.duration;o===!1?a.run_transition=!1:a=o,r=a.run_transition?e.transition().delay(a.update).duration(n):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,o=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],a={},n=t.viz.duration,i=t.network_data.col_nodes,s=t.network_data.col_nodes_names;o===!1?a.run_transition=!1:a=o,a.run_transition?(r=e.transition().delay(a.update).duration(n),e.selectAll(".col_label_text").data(i,function(t){return t.name}).transition().delay(a.update).duration(n).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 o=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 o.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 o=r(71);t.exports=function(t,e){var r=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],a=e.selectAll(".col_label_group").select("path"),n={},i=t.viz.duration;r===!1?n.run_transition=!1:n=r;var s;s=n.run_transition?a.transition().delay(n.update).duration(i):a,s.attr("d",function(){return o(t)}).attr("fill","#eee")}},function(t,e,r){"use strict";var o=r(2);t.exports=function(t,e){var r=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],a={};r===!1?a.run_transition=!1:a=r,o.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 o=r(25),a=r(28),n=r(27),i=r(35),s=r(34);t.exports=function(t){return t=o(t),t.viz=n(t.viz),t.viz=a(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,t.viz.real_zoom=t.viz.norm_labels.width.col/(t.viz.rect_width/2),t=i(t)}},function(t,e,r){"use strict";var o=r(2),a=r(44),n=r(45),i=r(48);t.exports=function(t,e){var r=t.network_data.row_nodes,s=o.pluck(r,"name");e.selectAll(".row").attr("transform",function(e){var r=_.indexOf(s,e.name);return"translate(0,"+t.viz.y_scale(r)+")"}),e.selectAll(".row").selectAll(".tile").attr("transform",function(e){return i(t,e)}).attr("width",t.viz.rect_width).attr("height",t.viz.rect_height),e.selectAll(".row").selectAll(".tile_up").attr("d",function(){return a(t)}).attr("transform",function(e){return i(t,e)}),e.selectAll(".row").selectAll(".tile_dn").attr("d",function(){return n(t)}).attr("transform",function(e){return i(t,e)})}},function(t,e,r){"use strict";var o=r(29);t.exports=function(t,e){var r=t.params;r=o(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]),o=Number(e.split(",")[1].replace(")","")),a=r+t.viz.clust.dim.width/2,n=o+t.viz.clust.dim.height/2;d3.select(t.root+" .play_button").attr("transform",function(){return"translate("+a+","+n+")"})}},function(t,e){"use strict";t.exports=function(t,e){var r,o,a=t.params.viz;if("row"===e){var n=a.svg_dim.width-3*a.uni_margin;r=a.clust.margin.left+a.clust.dim.width+100,r>n&&(r=n),o=a.clust.margin.top+3*a.uni_margin}else r=2*a.uni_margin,o=a.svg_dim.height-2.5*a.uni_margin;d3.select(t.params.root+" ."+e+"_slider_group").attr("transform",function(){var t;return t="row"===e?"translate("+r+","+o+")":"translate("+r+","+o+"), rotate(-90)"}).style("opacity",1)}},function(t,e,r){"use strict";var o=r(111),a=r(49),n=r(112),i=r(113),s=r(114),l=r(115);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+")"});var r=a().attr("class",function(){var t=e.viz.root_tips.replace(".",""),r=t+" d3-tip col_cat_tip";return r}).direction("s").offset([5,0]).style("display","none").html(function(t){return o(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 o,a=this;_.each(e.viz.all_cats.col,function(s){var d=parseInt(s.split("-")[1],10),u="col_cat_rect_"+String(d);o=d3.select(a).select("."+u).empty()?d3.select(a).append("rect").attr("class",u).attr("cat",s).attr("transform",function(){var t=e.viz.cat_room.symbol_width+e.viz.cat_room.separation,r=d*t;return"translate(0,"+r+")"}).on("click",function(r){if(d3.select(this).classed("cat_strings"))if(d3.event.shiftKey===!0)c(t,r,this,"col");else{var o=l(e,r,this,"col");$(e.root+" .dendro_info").modal("toggle");var a=o.join(", ");d3.select(e.root+" .dendro_info input").attr("value",a)}}):d3.select(a).select("."+u),o.attr("width",e.viz.x_scale.rangeBand()).attr("height",e.viz.cat_room.symbol_width).style("fill",function(t){var r=t[s],o=e.viz.cat_colors.col[s][r];return o}).on("mouseover",r.show).on("mouseout",function(){r.hide(this),n(e),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(e.viz,"col",o,s)})});var c=_.debounce(s,1500)}},function(t,e,r){"use strict";var o=r(74);t.exports=function(t,e,r,a){function n(){var e=!1;if(d3.select(r).classed("hovering")){var o=[a];t.viz.sim_mat&&(o=["row","col"]),_.each(o,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 o,a=d3.select(this).attr("cat");o=e[a].indexOf(": ")>=0?e[a].split(": ")[1]:e[a],r=a===i&&o===l?t.viz.cat_colors.active_opacity:t.viz.cat_colors.opacity/4}return r})})}}d3.selectAll(".col_cat_tip").style("display","block"),d3.selectAll(".row_cat_tip").style("display","block");var i=d3.select(r).attr("cat"),s=o(t.viz,i,a),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(n,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,o){function a(t){"string"==typeof t&&t.indexOf(i)>-1&&(t=t.split(i)[1]);var e=parseFloat(t);return e}var n=!(arguments.length<=4||void 0===arguments[4])&&arguments[4],i=": ",s=t.cat_info[e][o].type;"cat_strings"===s?n?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 n=r[o],i=a(n);return t.cat_info[e][o].cat_scale(Math.abs(i))}).style("fill",function(e){var r,n=a(e[o]);return r=n>0?t.cat_value_colors[0]:t.cat_value_colors[1]})}},function(t,e,r){"use strict";var o=r(115);t.exports=function(t,e,r,a){function n(t,e,r){d3.selectAll(i.root+" ."+t+"_cat_group").selectAll("rect").style("opacity",function(t){var o=d3.select(this).style("opacity");if(d3.select(this).classed("cat_strings")){var a,n=d3.select(this).attr("cat");a=t[n],n===e&&a===r&&(o=1,d3.select(this).classed("filtered_cat",!0))}return o})}var i=t.params,s=d3.select(r).attr("cat"),l=e[s],c=o(i,e,r,a),d={row:"col",col:"row"},u=d[a],_={};if(_[a]=c,t.params.cat_filter[a]===!1){if(t.params.dendro_filter.row===!1&&t.params.dendro_filter.col===!1&&t.params.cat_filter[u]===!1){var p=t.params.network_data.col_nodes_names,f=t.params.network_data.row_nodes,v=t.params.network_data.col_nodes;t.filter_viz_using_names(_),t.params.inst_nodes.row_nodes=f,t.params.inst_nodes.col_nodes=v,t.params.cat_filter[a]=p,n(a,s,l)}}else _=t.params.cat_filter[a],t.filter_viz_using_names(_),t.params.cat_filter[a]=!1,d3.selectAll(i.root+" ."+a+"_cat_group").selectAll("rect").classed("filtered_cat",!1)}},function(t,e,r){"use strict";var o=r(2);t.exports=function(t,e,r,a){var n=d3.select(r).attr("cat"),i=e[n],s=t.network_data[a+"_nodes"],l=_.filter(s,function(t){return t[n]==i}),c=o.pluck(l,"name");return c}},function(t,e,r){"use strict";var o=r(111),a=r(49),n=r(112),i=r(113),s=r(114),l=r(115);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});var c=a().attr("class",function(){var t=r.viz.root_tips.replace(".",""),e=t+" d3-tip row_cat_tip";return e}).direction("e").offset([5,0]).style("display","none").html(function(t){return o(r,t,this,"row")}),d=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(c),d.append("path").attr("d",function(){var t=r.viz.cat_room.symbol_width-1,e=0,o=1,a=r.viz.y_scale.rangeBand()/2,n=r.viz.cat_room.symbol_width-1,i=r.viz.y_scale.rangeBand(),s="M "+t+","+e+" L "+o+","+a+", L "+n+","+i+" Z";return s}).attr("fill","#eee").style("opacity",r.viz.triangle_opacity);var u,p;d3.selectAll(r.root+" .row_cat_group rect").remove(),r.viz.show_categories.row&&d3.selectAll(r.root+" .row_cat_group").each(function(){p=this,_.each(r.viz.all_cats.row,function(o){var a=parseInt(o.split("-")[1],10),s="row_cat_rect_"+String(a);u=d3.select(p).select("."+s).empty()?d3.select(p).append("rect").attr("class",s).attr("cat",o):d3.select(p).select("."+s),u.attr("width",r.viz.cat_room.symbol_width).attr("height",r.viz.y_scale.rangeBand()).style("fill",function(t){var e=t[o],a=r.viz.cat_colors.row[o][e];return a}).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=a*t;return"translate("+e+",0)"}).on("click",function(e){if(d3.select(this).classed("cat_strings"))if(d3.event.shiftKey===!0)f(t,e,this,"row");else{var o=l(r,e,this,"row");$(r.root+" .dendro_info").modal("toggle");var a=o.join(", ");d3.select(r.root+" .dendro_info input").attr("value",a)}}).on("mouseover",c.show).on("mouseout",function(){c.hide(this),n(r),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")}),i(r.viz,"row",u,o,e)})});var f=_.debounce(s,1500)}},function(t,e,r){"use strict";var o=r(55);t.exports=function(t){var e=t.params,r=e.viz.dendro_room.row+e.viz.uni_margin,a=e.viz.clust.margin.left+e.viz.clust.dim.width,n=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("+a+","+n+")"),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("+a+","+n+")"),d3.select(e.root+" .row_dendro_outer_container").select(".row_dendro_spillover").attr("width",r+"px").attr("height",e.viz.svg_dim.height)),o(t,"row",!1),"clust"!=e.viz.inst_order.col&&d3.selectAll(e.root+" .row_dendro_group").remove()}},function(t,e,r){"use strict";var o=r(55);t.exports=function(t){var e=t.params,r=e.viz.clust.margin.left,a=e.viz.clust.margin.top+e.viz.clust.dim.height,n=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+","+a+")"),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",n+"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+","+a+")"),d3.select(e.root+" .col_dendro_outer_container").select(".col_dendro_spillover").attr("width",e.viz.svg_dim.width).attr("height",n+"px")),o(t,"col",!1),"clust"!=e.viz.inst_order.row&&d3.selectAll(e.root+" .col_dendro_group").remove()}},function(t,e,r){"use strict";var o=r(120);t.exports=function(t){o(t,"row"),o(t,"col")}},function(t,e,r){"use strict";var o=r(121),a=r(109);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 a=10-r/10;d3.select(this).attr("transform","translate(0, "+r+")"),o(t,e,a)}function n(){var r=d3.mouse(this),a=d3.round(r[1],-1);d3.select(t.params.root+" ."+e+"_group_circle").attr("transform","translate(0, "+a+")");var n=10-a/10;o(t,e,n)}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);a(t,e);var c=i+20,d=30;l.append("rect").classed(e+"_slider_background",!0).attr("height",c+"px").attr("width",d+"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",n);var u=-i/40;l.append("path").style("fill","black").attr("transform","translate("+u+", 0)").attr("d",function(){var t=0,e=0,r=0,o=i,a=i/10,n=0,s="M"+t+","+e+", L"+r+", "+o+", L"+a+","+n+" Z";return s}).style("opacity",.35).on("click",n);var _=.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",_).on("mouseover",function(){d3.select(this).style("opacity",p)}).on("mouseout",function(){d3.select(this).style("opacity",_)}).call(s)}},function(t,e,r){"use strict";var o=r(55);t.exports=function(t,e,r){var a=t.params;"row"===e?a.group_level.row=r:"col"===e&&(a.group_level.col=r);var n=!0;o(t,e,n)}},function(t,e,r){"use strict";var o=r(60);t.exports=function(t){var e=t.params.viz,r=e.clust.margin.left+e.clust.dim.width+e.uni_margin+e.dendro_room.row,a=d3.select(e.viz_svg).append("g").classed("right_spillover_container",!0).attr("transform",function(){return"translate("+r+", 0)"}),n=e.norm_labels.margin.top+e.norm_labels.width.col;a.append("rect").attr("fill",e.background_color).attr("width",10*e.clust.dim.width).attr("height",e.svg_dim.height+"px").attr("class","white_bars").attr("class","right_spillover").attr("transform",function(){return"translate( 0,"+n+")"});var i=0,s=e.clust.margin.top;a.append("g").classed("row_dendro_icons_container",!0).attr("transform","translate("+i+","+s+")").append("g").classed("row_dendro_icons_group",!0),o(t,"row"),i=e.clust.margin.left+e.clust.dim.width,s=n;var l=e.dendro_room.row+e.uni_margin,c=e.cat_room.col+e.uni_margin;d3.select(e.viz_svg).append("rect").attr("fill",e.background_color).attr("width",l).attr("height",c).attr("transform",function(){return"translate("+i+","+s+")"}).classed("white_bars",!0).classed("dendro_row_spillover",!0)}},function(t,e,r){"use strict";var o=r(124),a=r(125),n=r(127),i=r(128),s=r(130),l=r(131),c=r(133),d=r(134),u=r(156),_=r(157),p=r(158),f=r(159),v=r(160),m=r(161);t.exports=function(){var t=this,e=t.params;if(d3.select(e.root+" .running_demo").empty()){d3.select(e.root+" .play_button").classed("running_demo",!0),v(e,!1),$.blockUI({css:{border:"none",padding:"15px",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px",opacity:0,color:"#fff",cursor:"default"}}),d3.selectAll(".blockUI").style("opacity",0);var r=750;t.params.viz.is_expand===!1&&(r=o(e,r,u),r-=1500),r=o(e,r,a),r=o(e,r,n),r=o(e,r,i),r=o(e,r,p),r=o(e,r,s),r=o(e,r,m),r=o(e,r,_),r=o(e,r,l),r=o(e,r,c),r=o(t,r,d),r=o(e,r,u),r=o(e,r,f)}}},function(t,e){"use strict";t.exports=function(t,e,r){var o=(setTimeout(r().run,e,t),r().get_duration());return e+=o}},function(t,e,r){"use strict";var o=r(126);t.exports=function(){function t(t){var e="Clustergrammer allows users to generate\ninteractive and sharable visualizations\nby uploading a matrix",a="This demo will quickly overview some\nof Clustergrammer's interactive features";setTimeout(o,0,t,e,4500/r),setTimeout(o,4500/r,t,a,4500/r)}function e(){return 1e4/r}var r=1;return{run:t,get_duration:e}}},function(t,e){"use strict";t.exports=function(t,e,r){var o=e.split("\n");o.length<3&&o.push(""),d3.select(t.root+" .demo_group").style("opacity",0).transition().duration(250).style("opacity",1).transition().duration(250).delay(r).style("opacity",0);for(var a=0;a<o.length;a++){var n=a+1,i=d3.select(t.root+" .demo_group").select("#text_"+n).text(o[a]),s=i[0][0].getBBox(),l=.9,c=Number(d3.select(".demo_group").select("text").style("font-size").replace("px","")),d=1.3*c;d3.select(t.root+" .demo_group").select(".rect_"+n).style("fill","white").attr("width",s.width+20).attr("height",s.height).attr("x",-10).attr("y",s.y+a*d).style("opacity",l)}}},function(t,e,r){"use strict";var o=r(126),a=r(91);t.exports=function(){function t(t){var e="Zoom and pan by\nscrolling and dragging";o(t,e,4e3),setTimeout(a,1500,t,0,0,4)}function e(){return 4e3}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var o=r(126),a=r(91),n=r(129);t.exports=function(){function t(t){var e="Reset zoom by double-clicking\n";o(t,e,4e3),setTimeout(n,2e3,t,"double",300,300),setTimeout(a,2400,t,0,0,1)}function e(){return 4500}return{run:t,get_duration:e}}},function(t,e){"use strict";t.exports=function(t,e,r,o){var a=200,n=d3.select(t.root+" .viz_svg").append("circle").attr("cx",r).attr("cy",o).attr("r",25).style("stroke","black").style("stroke-width","3px").style("fill","#007f00").style("opacity",.5);"double"===e?n.transition().duration(a).style("opacity",0).transition().duration(50).style("opacity",.5).transition().duration(a).style("opacity",0).remove():n.transition().duration(a).style("opacity",0).transition().duration(250).remove()}},function(t,e,r){"use strict";var o=r(126),a=r(129);t.exports=function(){function t(t){var e="Reorder the matrix based on a single\nrow or column by double-clicking a\nlabel";o(t,e,7e3);var i=r(t,"EGFR"),s=d3.select(i).attr("transform"),l=d3.select(t.root+" .clust_container").attr("transform").split(",")[1].replace(")",""),c=.9*t.viz.norm_labels.width.row,d=s.split(",")[1].replace(")",""),u=String(Number(d)+Number(l)+t.viz.rect_height/2),_=4e3;
setTimeout(a,_,t,"double",c,u);var p=_+300;setTimeout(n,p,t,i)}function e(){return 8e3}function r(t,e){var r=d3.selectAll(t.root+" .row_label_group").filter(function(){var t=this.__data__;return t.name==e})[0][0];return r}function n(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 o=r(126),a=r(132);t.exports=function(){function t(t){var e="Reorder all rows and columns\nby clicking the reorder\n buttons";o(t,e,9e3),setTimeout(a,3e3,t,"toggle_col_order"),setTimeout(r,3500,t,"col","rank"),setTimeout(a,7e3,t,"toggle_row_order"),setTimeout(r,7500,t,"row","rank")}function e(){return 11e3}function r(t,e,r){var o=d3.selectAll(".toggle_"+e+"_order .btn").filter(function(){return this.__data__==r})[0];$(o).click()}return{run:t,get_duration:e}}},function(t,e){"use strict";t.exports=function(t,e){var r=arguments.length<=2||void 0===arguments[2]?4e3:arguments[2];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 o=r(126),a=r(132),n=r(91);t.exports=function(){function t(t){var e="Search for rows using\nthe search box";o(t,e,5e3);var s=2500;setTimeout(a,s,t,"gene_search_container"),setTimeout(r,s+1e3,t,"E"),setTimeout(r,s+1500,t,"EG"),setTimeout(r,s+2e3,t,"EGF"),setTimeout(r,s+2500,t,"EGFR"),setTimeout(i,5500,t),setTimeout(n,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 o=r(126),a=r(132),n=r(135);t.exports=function(){function t(t){var e=t.params,n="Filter rows based on sum or\nvariance using the sliders";o(e,n,4e3);var i="N_row_sum";setTimeout(a,5e3,e,"slider_"+i,13e3),n="Filter: Top 20 rows by sum",setTimeout(o,5e3,e,n,4e3),setTimeout(r,5300,t,i,20,1),n="Filter: Top 10 rows by sum",setTimeout(o,1e4,e,n,4e3),setTimeout(r,10300,t,i,10,2),n="Filter: All rows",setTimeout(o,15e3,e,n,4e3),setTimeout(r,15300,t,i,"all",0)}function e(){return 19500}function r(t,e,r,o){var a=t.params,i={};i[e]=r,n(t,i),$(a.root+" .slider_"+e).slider("value",o);var s;s="N_row_sum"===e?"sum":"variance",d3.select(a.root+" .title_"+e).text("Top rows "+s+": "+r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var o=r(10),a=r(136),n=r(137);t.exports=function(t,e){a(t.params);var r=o(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")}),n(t,r)}},function(t,e){"use strict";t.exports=function(t){console.log("improve sidebar disable"),d3.selectAll(t.root+" .btn").attr("disabled",!0),d3.select(t.viz.viz_svg).style("opacity",.7)}},function(t,e,r){"use strict";var o=r(9),a=r(138),n=r(139),i=r(78),s=r(110),l=r(116),c=r(117),d=r(118),u=r(150),_=r(152),p=r(90),f=r(153),v=r(77),m=r(154),h=r(80);t.exports=function(t,e){null!=t.params.matrix_update_callback&&t.params.matrix_update_callback();var r=t.params.group_level,g=t.params.crop_filter_nodes,w=jQuery.extend(!0,{},t.config),y=null;null!=t.params.new_cat_data&&(m(t.params.new_cat_data,e.row_nodes),y=t.params.new_cat_data),w.network_data=e,w.inst_order=t.params.viz.inst_order,w.input_domain=t.params.matrix.opacity_scale.domain()[1],f(w,t.params),w.ini_expand=!1,w.ini_view=null,w.current_col_cat=t.params.current_col_cat,w.cat_colors=t.params.viz.cat_colors;var b=o(w),x=a(t.params,b);t.params=b,t.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,t.params.viz.real_zoom*t.params.viz.zoom_switch]).on("zoom",function(){h(t)}),null!=y&&(t.params.new_cat_data=y),t.params.group_level=r,t.params.crop_filter_nodes=g,n(t,e,x),l(t),v(t),t.params.viz.show_categories.col&&s(t),t.params.viz.show_dendrogram&&(c(t),d(t)),i(t),d3.select(t.params.viz.viz_svg).call(t.params.zoom_behavior),p(t.params),u(t),t.params.viz.run_trans=!0,setTimeout(_,2500,t.params)}},function(t,e){"use strict";t.exports=function(t,e){function r(){d3.select(e.viz.viz_svg).transition().duration(250).style("opacity",1)}var o=t.network_data.row_nodes,a=t.network_data.col_nodes,n=_.map(o,function(t){return t.name}),i=_.map(a,function(t){return t.name}),s=n.concat(i),l=e.network_data.row_nodes,c=e.network_data.col_nodes,d=_.map(l,function(t){return t.name}),u=_.map(c,function(t){return t.name}),p=d.concat(u),f=_.difference(s,p).length,v=_.difference(p,s).length,m={};f>0?m.update=1e3:m.update=0,v>0?m.enter=1e3:m.enter=0,m.enter=m.enter+m.update,m.run_transition=!0;var h=t.network_data.links.length,g=e.network_data.links.length,w=.5*e.matrix.def_large_matrix;return(h>w||g>w)&&(m.run_transition=!1,m.update=0,m.enter=0),d3.select(e.viz.viz_svg).style("opacity",.7),setTimeout(r,m.enter),m}},function(t,e,r){"use strict";var o=r(140),a=r(50),n=r(68),i=r(141),s=r(145),l=r(39),c=r(146),d=r(149),u=r(92),p=r(49);t.exports=function(t,e,r){var f=t.params;d3.selectAll(f.viz.root_tips).remove();var v=p().attr("class",function(){var t=f.viz.root_tips.replace(".",""),e=t+" d3-tip tile_tip";return e}).direction("nw").offset([0,0]).style("display","none").html(function(t){var e,r=String(t.value.toFixed(3));if(f.keep_orig){var o=String(t.value_orig.toFixed(3));e="<p>"+t.row_name+" and "+t.col_name+"</p><p> normalized value: "+r+"</p><div> original value: "+o+"</div>"}else e="<p>"+t.row_name+" and "+t.col_name+"</p><div> value: "+r+"</div>";return e});d3.select(f.root+" .clust_group").call(v),d(f);for(var m=f.network_data.row_nodes_names,h=1e3,g=e.row_nodes,w=e.col_nodes,y=e.links,b=y,x=0;x<b.length;x++){var z=b[x];b[x].name=g[z.source].name+"_"+w[z.target].name}var k=d3.select(f.root+" .clust_group").selectAll(".row").data(f.matrix.matrix,function(t){return t.name});r.run_transition?k.transition().delay(r.update).duration(h).attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate(0,"+f.viz.y_scale(e)+")"}):k.attr("transform",function(t){var e=_.indexOf(m,t.name);return"translate(0,"+f.viz.y_scale(e)+")"}),d3.select(f.root+" .clust_group").selectAll(".row").each(function(t){var e=this;i(f,t,r,h,e,v)}),d3.selectAll(f.root+" .horz_lines").remove(),d3.selectAll(f.root+" .vert_lines").remove(),s(f,r,h),o(t,g,w,y,h,r),c(f,r,h,v),a(t,h),n(t,h),l(f,r,h),setTimeout(u,2e3,f)}},function(t,e,r){"use strict";var o=r(2),a=r(28),n=r(25),i=r(27),s=r(93),l=r(94),c=r(95),d=r(96),u=r(98),p=r(100),f=r(101),v=r(102),m=r(103),h=r(104),g=r(107),w=r(35),y=r(34),b=r(64),x=r(36);t.exports=function(t,e,r,z,k,A){var T=t.params;T.zoom_info=x(),b(T),setTimeout(b,2200,T,T.zoom_info);var E=T.network_data.row_nodes_names;s(T),T=n(T),T.viz=i(T.viz),T.viz=a(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=y(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.real_zoom=T.viz.norm_labels.width.col/(T.viz.x_scale.rangeBand()/2),T.zoom_behavior.scaleExtent([1,T.viz.real_zoom*T.viz.zoom_switch]),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=w(T);var O=d3.select(T.viz.viz_wrapper).select("svg");O.select(T.root+" .grey_background").transition().delay(A.update).duration(k).attr("width",T.viz.clust.dim.width).attr("height",T.viz.clust.dim.height),u(T,O,A),O.selectAll(".row_label_group").select("text").style("font-size",T.labels.default_fs_row+"px").text(function(t){return o.normal_name(t)}),O.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",T.viz.y_scale.rangeBand()).style("fill","yellow").style("opacity",function(t){var e=0;return 1===t.target&&(e=1),e})}),p(T,O,A),A.run_transition?(O.selectAll(".row_label_group").select("text").transition().delay(A.update).duration(k).attr("y",.5*T.viz.rect_height+.35*T.labels.default_fs_row),O.selectAll(".row_cat_group").data(e,function(t){return t.name}).transition().delay(A.update).duration(k).attr("transform",function(t){var e=_.indexOf(E,t.name);return"translate(0, "+T.viz.y_scale(e)+")"}),O.selectAll(".row_cat_group").select("path").transition().delay(A.update).duration(k).attr("d",function(){var t=T.viz.cat_room.symbol_width-1,e=0,r=1,o=T.viz.y_scale.rangeBand()/2,a=T.viz.cat_room.symbol_width-1,n=T.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+o+", L "+a+","+n+" Z";return i}),O.selectAll(".row_dendro_group").data(e,function(t){return t.name}).transition().delay(A.update).duration(k).attr("transform",function(t){var e=_.indexOf(E,t.name);return"translate(0, "+T.viz.y_scale(e)+")"})):(O.selectAll(".row_label_group").select("text").attr("y",.5*T.viz.rect_height+.35*T.labels.default_fs_row),O.selectAll(".row_cat_group").data(e,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(E,t.name);return"translate(0, "+T.viz.y_scale(e)+")"}),O.selectAll(".row_cat_group").select("path").attr("d",function(){var t=T.viz.cat_room.symbol_width-1,e=0,r=1,o=T.viz.y_scale.rangeBand()/2,a=T.viz.cat_room.symbol_width-1,n=T.viz.y_scale.rangeBand(),i="M "+t+","+e+" L "+r+","+o+", L "+a+","+n+" Z";return i}),O.selectAll(".row_dendro_group").data(e,function(t){return t.name}).attr("transform",function(t){var e=_.indexOf(E,t.name);return"translate(0, "+T.viz.y_scale(e)+")"})),o.has(T.network_data.row_nodes[0],"value")&&g(t,O),f(T,O,A),v(T,O),m(T,O,A),h(T,O,A),l(T,O,A),c(T,O,A),d(T.viz,O,A),T.zoom_behavior.scale(1).translate([T.viz.clust.margin.left,T.viz.clust.margin.top])}},function(t,e,r){"use strict";var o=r(142),a=r(143),n=r(144),i=r(46),s=r(47),l=r(48);t.exports=function(t,e,r,c,d,u){var p=e.row_data,f=_.filter(p,function(t){return 0!=t.value}),v=d3.select(d).selectAll(".tile").data(f,function(t){return t.col_name});o(t,r,v,p,d);var m=v.on("mouseover",function(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];i(t,this,u,r)}).on("mouseout",function(){s(t,this,u)}),h=t.network_data.col_nodes_names;r.run_transition?m.transition().delay(r.update).duration(c).attr("width",t.viz.rect_width).attr("height",t.viz.rect_height).attr("transform",function(e){return _.contains(h,e.col_name)?l(t,e):"translate(0,0)"}):m.attr("width",t.viz.rect_width).attr("height",t.viz.rect_height).attr("transform",function(e){return _.contains(h,e.col_name)?l(t,e):"translate(0,0)"}),"updn"==t.matrix.tile_type&&n(t,p,d,r,c,v,u),a(t,r,c,v,u)}},function(t,e){"use strict";t.exports=function(t,e,r,o,a){if(e.run_transition?r.exit().transition().duration(300).attr("fill-opacity",0).remove():r.exit().attr("fill-opacity",0).remove(),"updn"==t.matrix.tile_type){var n=_.filter(o,function(t){return 0!=t.value_up||0!=t.value_dn}),i=d3.select(a).selectAll(".tile_up").data(n,function(t){return t.col_name});e.run_transition?i.exit().transition().duration(300).attr("fill","0").remove():i.exit().attr("fill",0).remove();var s=d3.select(a).selectAll(".tile_dn").data(n,function(t){return t.col_name});e.run_transition?s.exit().transition().duration(300).attr("fill",0).remove():s.exit().attr("fill",0).remove()}}},function(t,e,r){"use strict";var o=r(46),a=r(47),n=r(48);t.exports=function(t,e,r,i,s){var l=i.enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",t.viz.rect_height).on("mouseover",function(){for(var e=arguments.length,r=Array(e),a=0;a<e;a++)r[a]=arguments[a];o(t,this,s,r)}).on("mouseout",function(){a(t,this,s)}).attr("fill-opacity",0).attr("transform",function(e){return n(t,e)});e.run_transition?l.transition().delay(e.enter).duration(r).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.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 o=r(44),a=r(45),n=r(46),i=r(47),s=r(48);t.exports=function(t,e,r,l,c,d,u){var p=_.filter(e,function(t){return 0!=t.value_up||0!=t.value_dn}),f=d3.select(r).selectAll(".tile_up").data(p,function(t){return t.col_name}),v=f.on("mouseover",function(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];n(t,this,u,r)}).on("mouseout",function(){i(t,this,u)});l.run_transition?v.transition().delay(l.update).duration(c).attr("d",function(){return o(t)}).attr("transform",function(e){return s(t,e)}):v.attr("d",function(){return o(t)}).attr("transform",function(e){return s(t,e)});var m=d3.select(r).selectAll(".tile_dn").data(p,function(t){return t.col_name}),h=m.on("mouseover",function(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];n(t,this,u,r)}).on("mouseout",function(){i(t,this,u)});l.run_transition?h.transition().delay(l.update).duration(c).attr("d",function(){return a(t)}).attr("transform",function(e){return s(t,e)}):h.attr("d",function(){return a(t)}).attr("transform",function(e){return s(t,e)}),d.selectAll(".tile").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,e,r){var o=t.network_data.row_nodes,a=t.network_data.col_nodes,n=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).exit();e.run_transition?n.transition().duration(r).style("opacity",0).remove():n.style("opacity",0).remove(),d3.selectAll(t.root+" .row_label_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_group").data(a,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_cat_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_dendro_group").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_text").data(a,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .horz_lines").data(o,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .vert_lines").data(a,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_cat_group").data(a,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_dendro_group").data(a,function(t){return t.name}).exit().transition().duration(r).style("opacity",0).remove()}},function(t,e,r){"use strict";var o=r(147);t.exports=function(t,e,r,a){var n=t.network_data.row_nodes_names,i=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,function(t){return t.name}).enter().append("g").attr("class","row").attr("transform",function(e){var r=_.indexOf(n,e.name);return"translate(0,"+t.viz.y_scale(r)+")"});i.each(function(n){o(t,n,e,r,a,this)})}},function(t,e,r){"use strict";var o=r(148),a=r(46),n=r(47),i=r(48);t.exports=function(t,e,r,s,l,c){var d=e.row_data,u=_.filter(d,function(t){return 0!==t.value}),p=d3.select(c).selectAll("rect").data(u,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),o=0;o<e;o++)r[o]=arguments[o];a(t,this,l,r)}).on("mouseout",function(){n(t,this,l)});p.style("fill-opacity",0).transition().delay(r.enter).duration(s).style("fill-opacity",function(e){var r=t.matrix.opacity_scale(Math.abs(e.value));return r}),p.attr("transform",function(e){return i(t,e)}),"updn"==t.matrix.tile_type&&o(t,d,c,l,r,s,p)}},function(t,e,r){"use strict";var o=r(44),a=r(45),n=r(48);t.exports=function(t,e,r,i,s,l,c){var d=_.filter(e,function(t){return 0!=t.value_up||0!=t.value_dn}),u=d3.select(r).selectAll(".tile_up").data(d,function(t){return t.col_name}).enter().append("path").attr("class","tile_up").attr("d",function(){return o(t)}).attr("transform",function(e){return n(t,e)}).style("fill",function(){return t.matrix.tile_colors[0]}).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()});u.style("fill-opacity",0).transition().delay(s.enter).duration(l).style("fill-opacity",function(e){var r=0;return Math.abs(e.value_dn)>0&&(r=t.matrix.opacity_scale(Math.abs(e.value_up))),r});var p=d3.select(r).selectAll(".tile_dn").data(d,function(t){return t.col_name}).enter().append("path").attr("class","tile_dn").attr("d",function(){return a(t)}).attr("transform",function(e){return n(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()});p.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 o=(r(121),r(76)),a=r(75),n=r(151);t.exports=function(t){function e(e,r){var o=2-r,a=t.params.matrix.abs_max_val*o;t.params.matrix.opacity_scale.domain([0,a]),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,$(r.root+" .gene_search_box").keyup(function(e){if(13===e.keyCode){var o=$(r.root+" .gene_search_box").val();n(t,o,l)}}),$(r.root+" .submit_gene_button").off().click(function(){var e=$(r.root+" .gene_search_box").val();n(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(a){var n=$(a.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?o(t,n,e):(o(t,n,"row"),o(t,n,"col"))})}),a(t),d3.select(t.params.root+" .opacity_slider").select("#handle-one").empty()){var d=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(d)}}},function(t,e,r){"use strict";var o=r(91);t.exports=function(t,e,r){var a="name";if(r.indexOf(e)!==-1){d3.selectAll(t.params.root+" .row_label_group").select("rect").style("opacity",0);var n=_.indexOf(r,e),i=t.params.viz.y_scale(n),s=t.params.viz.clust.dim.height/2-i;o(t.params,0,s,t.params.viz.zoom_switch),t.params.zoom_info.zoom_y=t.params.viz.zoom_switch,d3.selectAll(t.params.root+" .row_label_group").filter(function(t){return t[a]===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 o;o="row"===r?"col":"row",d3.selectAll(e.root+" .toggle_"+o+"_order .btn").filter(function(){return d3.select(this).attr("name")===t.inst_order[r]}).classed("active",!0)})}},function(t,e,r){"use strict";var o=r(155),a=r(2);t.exports=function(t,e){var r,n,i,s,l,c,d,u,p=0,f=0;_.each(e,function(e){s=e.name,s=s.toUpperCase(),p=0,o(e),_.each(t,function(t){if(r=t.cat_title,n=t.cats,l="false",f=-1,u=0,_.each(n,function(t){c=t.cat_name,i=t.members,_.contains(i,s)&&(l=c,f=u),u+=1}),a.has(t,"pval")){var o=t.pval.toExponential();d=r+": "+l+"<p> Pval "+String(o)+"</p>"}else d=r+": "+l;e["cat-"+String(p)]=d,e["cat_"+String(p)+"_index"]=f,p+=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 o=r(129);t.exports=function(){function t(t){var e=Number(d3.select(t.root+" .expand_button").attr("x").replace("px","")),n=Number(d3.select(t.root+" .expand_button").attr("y").replace("px","")),i=0,s=400;setTimeout(o,i,t,"single",e,n),setTimeout(r,s,t),setTimeout(a,1500,t)}function e(){return 3500}function r(t){$(t.root+" .expand_button").d3Click()}function a(t){n(t,"row","clust"),n(t,"col","clust")}function n(t,e,r){var o=d3.selectAll(".toggle_"+e+"_order .btn").filter(function(){return this.__data__==r})[0];$(o).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 o=r(126),a=r(132),n=r(121);t.exports=function(){function t(t){var e="Identify row and column groups\nof varying sizes using the\nsliders and dendrogram";o(t,e,1e4),setTimeout(a,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),n(cgm,e,r)}return{run:t,get_duration:e}}},function(t,e,r){"use strict";var o=r(126),a=r(129);t.exports=function(){function t(t){var e="Row and column categories\ncan be use to reorder\nby double-clicking";o(t,e,7e3);var n=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(a,c,t,"double",s,l);var d=c+300;setTimeout(r,d,t,n)}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 o=r(126),a=r(160);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",a="The example data being visualized is\ngene expression data obtained from the\nCancer Cell Line Encyclopedia",n="For more information please view\nthe help documentation";setTimeout(o,0,t,r,4500),setTimeout(o,4500,t,a,4500),setTimeout(o,9e3,t,n,4500),setTimeout(e,14e3,t)}function e(t){d3.select(t.root+" .play_button").classed("running_demo",!1),a(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 o=r(126),a=r(129);t.exports=function(){function t(t){var e="View additional controls\nby clicking the menu button";o(t,e,4e3);var n=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(a,s,t,"single",n,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 o=r(163),a=r(164);t.exports=function(){var t=this,e=t.params;o(t);var r=30;a(e,r)}},function(t,e,r){"use strict";var o=r(108);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);o(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"),o=Number(r.split("(")[1].split(",")[0]),a=Number(r.split(",")[1].replace(")","")),n=d3.select(t.root+" .viz_svg").append("g").classed("demo_group",!0).attr("transform",function(){var t=o+20,e=a+40;return"translate("+t+","+e+")"});n.append("rect").classed("rect_1",!0),n.append("rect").classed("rect_2",!0),n.append("rect").classed("rect_3",!0);var i=1.3*e;n.append("text").attr("id","text_1").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),n.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)+")"}),n.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 o=r(11),a=r(137);t.exports=function(t){var e=o(this.config,t);a(this,e)}},function(t,e,r){"use strict";var o=r(11),a=r(137);t.exports=function(t){var e,r=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];e=r===!1?this:r;var n,i=e.params,s={};_.each(["row","col"],function(e){var r=i.inst_nodes[e+"_nodes"];if(_.has(t,e)){var o=t[e];n=$.grep(r,function(t){return $.inArray(t.name,o)>-1})}else n=r;s[e+"_nodes"]=n});var l=o(e.config,s);a(e,l)}},function(t,e,r){"use strict";var o=r(116),a=r(15),n=r(79),i=r(154);t.exports=function(t,e){var r=t.params.viz.cat_colors.col;i(e,t.params.network_data.row_nodes),i(e,t.params.inst_nodes.row_nodes),t.params=a(t.params,!1),o(t,!0),n(t),t.params.new_cat_data=e,t.params.viz.cat_colors.col=r}},function(t,e,r){"use strict";var o=r(116),a=r(15),n=r(79),i=r(154),s=r(169);t.exports=function(){var t=this,e=s(t),r=t.params.viz.cat_colors.col;i(e,t.params.network_data.row_nodes),i(e,t.params.inst_nodes.row_nodes),t.params=a(t.params,!1),o(t,!0),n(t),t.params.new_cat_data=e,t.params.viz.cat_colors.col=r}},function(t,e){"use strict";t.exports=function(t){function e(t,e,a){r={},r.cat_title=t,r.cats=[],o={},o.cat_name=e,o.members=[],o.members.push(a),r.cats.push(o),c.push(r)}var r,o,a,n,i,s=t.config.network_data.row_nodes,l=": ",c=[];return _.each(s,function(t){var r=_.keys(t);_.each(r,function(r){if(r.indexOf("cat-")>-1){i=t[r];var s=r;i=t[r];var d=t[r],u=t.name;d.indexOf(l)>-1&&(s=d.split(l)[0],i=d.split(l)[1]),0===c.length?e(s,i,u):(a=!1,_.each(c,function(t){s===t.cat_title&&(a=!0,n=!1,_.each(t.cats,function(t){i===t.cat_name&&(n=!0,t.members.push(u))}),n===!1&&(o={},o.cat_name=i,o.members=[],o.members.push(u),t.cats.push(o)))}),a===!1&&e(s,i,u))}})}),c}},function(t,e,r){"use strict";var o=r(135),a=r(171);t.exports=function(t,e){var r=this,n={};n[t]=e,o(this,n),a(r,t,e)}},function(t,e,r){"use strict";var o=r(172);t.exports=function(t,e,r){var a,n,i=t.params;d3.select(i.root+" .slider_"+e).attr("current_state",r),_.each(_.keys(i.viz.possible_filters),function(r){if(a=e.indexOf("row")>-1?"row":e.indexOf("col")>-1?"col":"neither",n=r.indexOf("row")>-1?"row":r.indexOf("col")>-1?"col":"neither",e!=r&&"neither"!=a&&a==n){var s=o(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=o(i,e);d3.select(i.root+" .title_"+e).text(s.text+r+s.suffix)}},function(t,e,r){"use strict";var o=r(5);t.exports=function(t,e){var r={},a={},n={};return r.state=o(t.viz.filter_data,e),n.top=e.split("_")[0],n.node=e.split("_")[1],n.measure=e.split("_")[2],"row"===n.node?a.node="rows":a.node="columns","N"===n.top&&(r.suffix=""),"pct"===n.top&&(r.suffix="%"),"sum"==n.measure?a.measure="sum":"var"==n.measure&&(a.measure="variance"),"sum"===n.measure&&(r.text="Top "+a.node+" "+a.measure+": "),"var"===n.measure&&(r.text="Top "+a.node+" "+a.measure+": "),_.keys(t.viz.possible_filters).indexOf("enr_score_type")>-1&&"col"===n.node&&(r.text="Top Enriched Terms: ",r.suffix=""),r}},function(t,e,r){"use strict";var o=r(174);t.exports=function(){function t(t,e){var r=t.name,o=a.viz.all_cats[e].length;if(o>0){r="('"+r+"'";for(var n=0;n<o;n++)s="cat-"+String(n),r=r+", '"+t[s]+"'"}return r+=")"}var e,r=o(),a=this.params,n=a.matrix,i={};_.each(["row","col"],function(t){var r;r="row"===t?"col":"row",e=a.inst_order[t],i[r]=n.orders[e+"_"+t]});for(var s,l="\t",c=a.network_data.row_nodes,d=a.network_data.col_nodes,u=0;u<i.col.length;u++){var p=i.col[u],f=d[p],v=t(f,"col");u<i.col.length-1?l=l+v+"\t":l+=v}var m;l+="\n",_.each(i.row,function(e){m=n.matrix[e].row_data;var r=c[e],o=t(r,"row");l=l+o+"\t";for(var a=0;a<i.col.length;a++){
var s=i.col[a];a<i.col.length-1?l=l+String(m[s].value)+"\t":l+=String(m[s].value)}l+="\n"});var h=new Blob([l],{type:"text/plain;charset=utf-8"});r(h,"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},o=t.URL||t.webkitURL||t,a=e.createElementNS("http://www.w3.org/1999/xhtml","a"),n="download"in a,i=function(r){var o=e.createEvent("MouseEvents");o.initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(o)},s=t.webkitRequestFileSystem,l=t.requestFileSystem||s||t.mozRequestFileSystem,c=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},d="application/octet-stream",u=0,_=[],p=function(){for(var t=_.length;t--;){var e=_[t];"string"==typeof e?o.revokeObjectURL(e):e.remove()}_.length=0},f=function(t,e,r){e=[].concat(e);for(var o=e.length;o--;){var a=t["on"+e[o]];if("function"==typeof a)try{a.call(t,r||t)}catch(n){c(n)}}},v=function(e,o){var c,p,v,m=this,h=e.type,g=!1,w=function(){var t=r().createObjectURL(e);return _.push(t),t},y=function(){f(m,"writestart progress write writeend".split(" "))},b=function(){!g&&c||(c=w(e)),p&&(p.location.href=c),m.readyState=m.DONE,y()},x=function(t){return function(){if(m.readyState!==m.DONE)return t.apply(this,arguments)}},z={create:!0,exclusive:!1};return m.readyState=m.INIT,o||(o="download"),n?(c=w(e),a.href=c,a.download=o,i(a),m.readyState=m.DONE,void y()):(t.chrome&&h&&h!==d&&(v=e.slice||e.webkitSlice,e=v.call(e,0,e.size,d),g=!0),s&&"download"!==o&&(o+=".download"),p=h===d||s?t:t.open(),l?(u+=e.size,void l(t.TEMPORARY,u,x(function(t){t.root.getDirectory("saved",z,x(function(t){var r=function(){t.getFile(o,z,x(function(t){t.createWriter(x(function(r){r.onwriteend=function(e){p.location.href=t.toURL(),_.push(t),m.readyState=m.DONE,f(m,"writeend",e)},r.onerror=function(){var t=r.error;t.code!==t.ABORT_ERR&&b()},"writestart progress write abort".split(" ").forEach(function(t){r["on"+t]=m["on"+t]}),r.write(e),m.abort=function(){r.abort(),m.readyState=m.DONE},m.readyState=m.WRITING}),b)}),b)};t.getFile(o,{create:!1},x(function(t){t.remove(),r()}),x(function(t){t.code===t.NOT_FOUND_ERR?r():b()}))}),b)}),b)):void b())},m=v.prototype,h=function(t,e){return new v(t,e)};return m.abort=function(){var t=this;t.readyState=t.DONE,f(t,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,t.addEventListener("unload",p,!1),h}(self);return t}},function(t,e,r){"use strict";var o=r(176);t.exports=function(){function t(){d3.select(r.params.root+" .col_dendro_icons_container").style("display","none"),d3.select(r.params.root+" .row_dendro_icons_container").style("display","none");var t=c.extent(),n=t[0],i=t[1],s=n[0],l=i[0],d=n[1],u=i[1];if(s!=l&&d!=u){setTimeout(o,500,r);var _=e(s,l,d,u,n,i);r.filter_viz_using_names(_),d3.select(a.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!1).classed("fa-undo",!0)}}function e(t,e,r,o,n,i){t>e&&(t=i[0],e=n[0]),r>o&&(r=i[1],o=n[1]),r-=a.viz.rect_height,t-=a.viz.rect_width;var s={};return s.row=[],s.col=[],d3.selectAll(a.root+" .row_label_group").each(function(t){var e=d3.select(this).attr("transform"),a=Number(e.split(",")[1].split(")")[0]);a>r&&a<o&&s.row.push(t.name)}),d3.selectAll(a.root+" .col_label_text").each(function(r){var o=d3.select(this).attr("transform"),a=Number(o.split(",")[0].split("(")[1]);a>t&&a<e&&s.col.push(r.name)}),s}var r=this,a=r.params,n=a.viz.clust.dim.width,i=a.viz.clust.dim.height,s=d3.scale.linear().domain([0,n]).range([0,n]),l=d3.scale.linear().domain([0,i]).range([0,i]);d3.select(a.root+" .clust_container").append("g").classed("brush_group",!0),r.params.is_cropping=!0;var c=d3.svg.brush().x(s).y(l).on("brushend",t);d3.select(a.root+" .brush_group").call(c),d3.selectAll(a.root+" .extent").style("opacity",.2).style("fill","black")}},function(t,e){"use strict";t.exports=function(t){d3.select(t.params.root+" .brush_group").transition().style("opacity",0).remove(),t.params.is_cropping=!1}},function(t,e,r){var o,a,n;"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(i,s){a=[r(178)],o=s,n="function"==typeof o?o.apply(e,a):o,!(void 0!==n&&(t.exports=n))}(void 0,function(t){return function(){"use strict";function e(e){e.each(function(){function e(e){"boolean"==typeof h&&(h=t.svg.axis().ticks(Math.round(u/100)).tickFormat(z).orient("horizontal"===m?"bottom":"right")),l=s.ticks?s.copy().range([0,u]):s.copy().rangePoints([0,u],.5),h.scale(l);var r=e.append("svg").classed("d3-slider-axis d3-slider-axis-"+h.orient(),!0).on("click",T),o=r.append("g");"horizontal"===m?(r.style("margin-left",-g+"px"),r.attr({width:u+2*g,height:g}),"top"===h.orient()?(r.style("top",-g+"px"),o.attr("transform","translate("+g+","+g+")")):o.attr("transform","translate("+g+",0)")):(r.style("top",-g+"px"),r.attr({width:g,height:u+2*g}),"left"===h.orient()?(r.style("left",-g+"px"),o.attr("transform","translate("+g+","+g+")")):o.attr("transform","translate(0,"+g+")")),o.call(h)}function f(){if("array"!=n(i)){var e=Math.max(0,Math.min(u,t.event.offsetX||t.event.layerX));r(s.invert?o(s.invert(e/u)):a(e/u))}}function v(){if("array"!=n(i)){var e=u-Math.max(0,Math.min(u,t.event.offsetY||t.event.layerY));r(s.invert?o(s.invert(e/u)):a(e/u))}}function y(){"handle-one"===t.event.sourceEvent.target.id?w=1:"handle-two"==t.event.sourceEvent.target.id&&(w=2);var e=Math.max(0,Math.min(u,t.event.x));r(s.invert?o(s.invert(e/u)):a(e/u))}function A(){"handle-one"===t.event.sourceEvent.target.id?w=1:"handle-two"==t.event.sourceEvent.target.id&&(w=2);var e=u-Math.max(0,Math.min(u,t.event.y));r(s.invert?o(s.invert(e/u)):a(e/u))}function T(){t.event.stopPropagation()}s||(s=t.scale.linear().domain([_,p])),i=i||s.domain()[0];var E=t.select(this).classed("d3-slider d3-slider-"+m,!0),O=t.behavior.drag();if(O.on("dragend",function(){b.slideend(t.event,i)}),"array"==n(i)&&2==i.length?(c=E.append("a").classed("d3-slider-handle",!0).attr("xlink:href","#").attr("id","handle-one").on("click",T).call(O),k=E.append("a").classed("d3-slider-handle",!0).attr("id","handle-two").attr("xlink:href","#").on("click",T).call(O)):c=E.append("a").classed("d3-slider-handle",!0).attr("xlink:href","#").attr("id","handle-one").on("click",T).call(O),"horizontal"===m){if(E.on("click",f),"array"==n(i)&&2==i.length){d=t.select(this).append("div").classed("d3-slider-range",!0),c.style("left",x(s(i[0]))),d.style("left",x(s(i[0]))),O.on("drag",y);var B=100-parseFloat(x(s(i[1])));k.style("left",x(s(i[1]))),d.style("right",B+"%"),O.on("drag",y)}else c.style("left",x(s(i))),O.on("drag",y);u=parseInt(E.style("width"),10)}else{if(E.on("click",v),O.on("drag",A),"array"==n(i)&&2==i.length){d=t.select(this).append("div").classed("d3-slider-range-vertical",!0),c.style("bottom",x(s(i[0]))),d.style("bottom",x(s(i[0]))),O.on("drag",A);var S=100-parseFloat(x(s(i[1])));k.style("bottom",x(s(i[1]))),d.style("top",S+"%"),O.on("drag",A)}else c.style("bottom",x(s(i))),O.on("drag",A);u=parseInt(E.style("height"),10)}h&&e(E)})}function r(e){var r="array"==n(i)&&2==i.length?i[w-1]:i,a=x(s(o(r))),l=x(s(o(e))),u="horizontal"===m?"left":"bottom";if(a!==l){if("array"==n(i)&&2==i.length?(i[w-1]=e,t.event&&b.slide(t.event,i)):t.event&&b.slide(t.event.sourceEvent||t.event,i=e),i[0]>=i[1])return;if(1===w)"array"==n(i)&&2==i.length&&("left"===u?d.style("left",l):d.style("bottom",l)),v?c.transition().styleTween(u,function(){return t.interpolate(a,l)}).duration("number"==typeof v?v:250):c.style(u,l);else{var _=100-parseFloat(l),p=100-parseFloat(l);"left"===u?d.style("right",_+"%"):d.style("top",p+"%"),v?k.transition().styleTween(u,function(){return t.interpolate(a,l)}).duration("number"==typeof v?v:250):k.style(u,l)}}}function o(t){if(t===s.domain()[0]||t===s.domain()[1])return t;var e=t;if(y)e=a(s(t));else{var r=(t-s.domain()[0])%f;e=t-r,2*Math.abs(r)>=f&&(e+=r>0?f:-f)}return e}function a(t){var e=s.ticks?s.ticks():s.domain(),r=e.map(function(e){return t-s(e)}),o=-1,a=0,n=s.ticks?s.range()[1]:s.rangeExtent()[1];do o++,Math.abs(r[o])<n&&(n=Math.abs(r[o]),a=o);while(r[o]>0&&o<r.length-1);return e[a]}function n(t){return{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}var i,s,l,c,d,u,_=0,p=100,f=.01,v=!1,m="horizontal",h=!1,g=50,w=1,y=!1,b=t.dispatch("slide","slideend"),x=t.format(".2%"),z=t.format(".0"),k=null;return e.min=function(t){return arguments.length?(_=t,e):_},e.max=function(t){return arguments.length?(p=t,e):p},e.step=function(t){return arguments.length?(f=t,e):f},e.animate=function(t){return arguments.length?(v=t,e):v},e.orientation=function(t){return arguments.length?(m=t,e):m},e.axis=function(t){return arguments.length?(h=t,e):h},e.margin=function(t){return arguments.length?(g=t,e):g},e.value=function(t){return arguments.length?(i&&r(o(t)),i=t,e):i},e.snap=function(t){return arguments.length?(y=t,e):y},e.scale=function(t){return arguments.length?(s=t,e):s},t.rebind(e,b,"on"),e}})},function(t,e){t.exports=require("d3")},function(t,e,r){(function(t){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(){function r(t){var r=Array.isArray(t)?{label:t[0],value:t[1]}:"object"===("undefined"==typeof t?"undefined":e(t))&&"label"in t&&"value"in t?t:{label:t,value:t};this.label=r.label||r.value,this.value=r.value}function o(t,e,r){for(var o in e){var a=e[o],n=t.input.getAttribute("data-"+o.toLowerCase());"number"==typeof a?t[o]=parseInt(n):a===!1?t[o]=null!==n:a instanceof Function?t[o]=null:t[o]=n,t[o]||0===t[o]||(t[o]=o in r?r[o]:a)}}function a(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function n(t,e){return l.call((e||document).querySelectorAll(t))}function i(){n("input.awesomplete").forEach(function(t){new s(t)})}var s=function c(t,e){var r=this;this.input=a(t),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),e=e||{},o(this,{minChars:2,maxItems:10,autoFirst:!1,data:c.DATA,filter:c.FILTER_CONTAINS,sort:c.SORT_BYLENGTH,item:c.ITEM,replace:c.REPLACE},e),this.index=-1,this.container=a.create("div",{className:"awesomplete",around:t}),this.ul=a.create("ul",{hidden:"hidden",inside:this.container}),this.status=a.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-relevant":"additions",inside:this.container}),a.bind(this.input,{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(t){var e=t.keyCode;r.opened&&(13===e&&r.selected?(t.preventDefault(),r.select()):27===e?r.close({reason:"esc"}):38!==e&&40!==e||(t.preventDefault(),r[38===e?"previous":"next"]()))}}),a.bind(this.input.form,{submit:this.close.bind(this,{reason:"submit"})}),a.bind(this.ul,{mousedown:function(t){var e=t.target;if(e!==this){for(;e&&!/li/i.test(e.nodeName);)e=e.parentNode;e&&0===t.button&&(t.preventDefault(),r.select(e,t.target))}}}),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||e.list||[],c.all.push(this)};s.prototype={set list(t){if(Array.isArray(t))this._list=t;else if("string"==typeof t&&t.indexOf(",")>-1)this._list=t.split(/\s*,\s*/);else if(t=a(t),t&&t.children){var e=[];l.apply(t.children).forEach(function(t){if(!t.disabled){var r=t.textContent.trim(),o=t.value||r,a=t.label||r;""!==o&&e.push({label:a,value:o})}}),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,a.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.ul.removeAttribute("hidden"),this.autoFirst&&this.index===-1&&this["goto"](0),a.fire(this.input,"awesomplete-open")},next:function(){var t=this.ul.children.length;this["goto"](this.index<t-1?this.index+1:-1)},previous:function(){var t=this.ul.children.length;this["goto"](this.selected?this.index-1:t-1)},"goto":function(t){var e=this.ul.children;this.selected&&e[this.index].setAttribute("aria-selected","false"),this.index=t,t>-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.status.textContent=e[t].textContent,a.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e){if(t?this.index=a.siblingIndex(t):t=this.ul.children[this.index],t){var r=this.suggestions[this.index],o=a.fire(this.input,"awesomplete-select",{text:r,origin:e||t});o&&(this.replace(r),this.close({reason:"select"}),a.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(o){return new r(t.data(o,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(a.regExpEscape(e.trim()),"i").test(t)},s.FILTER_STARTSWITH=function(t,e){return RegExp("^"+a.regExpEscape(e.trim()),"i").test(t)},s.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t<e?-1:1},s.ITEM=function(t,e){var r=""===e?t:t.replace(RegExp(a.regExpEscape(e.trim()),"gi"),"<mark>$&</mark>");return a.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 a.create=function(t,e){var r=document.createElement(t);for(var o in e){var n=e[o];if("inside"===o)a(n).appendChild(r);else if("around"===o){var i=a(n);i.parentNode.insertBefore(r,i),r.appendChild(i)}else o in r?r[o]=n:r.setAttribute(o,n)}return r},a.bind=function(t,e){if(t)for(var r in e){var o=e[r];r.split(/\s+/).forEach(function(e){t.addEventListener(e,o)})}},a.fire=function(t,e,r){var o=document.createEvent("HTMLEvents");o.initEvent(e,!0,!0);for(var a in r)o[a]=r[a];return t.dispatchEvent(o)},a.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},a.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.$=a,s.$$=n,"undefined"!=typeof self&&(self.Awesomplete=s),"object"===e(t)&&t.exports&&(t.exports=s),s}()}).call(e,r(180)(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 o=r(182);"string"==typeof o&&(o=[[t.id,o,""]]);r(184)(o,{});o.locals&&(t.exports=o.locals)},function(t,e,r){e=t.exports=r(183)(),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<this.length;e++){var r=this[e];r[2]?t.push("@media "+r[2]+"{"+r[1]+"}"):t.push(r[1])}return t.join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},a=0;a<this.length;a++){var n=this[a][0];"number"==typeof n&&(o[n]=!0)}for(a=0;a<e.length;a++){var i=e[a];"number"==typeof i[0]&&o[i[0]]||(r&&!i[2]?i[2]=r:r&&(i[2]="("+i[2]+") and ("+r+")"),t.push(i))}},t}},function(t,e,r){function o(t,e){for(var r=0;r<t.length;r++){var o=t[r],a=p[o.id];if(a){a.refs++;for(var n=0;n<a.parts.length;n++)a.parts[n](o.parts[n]);for(;n<o.parts.length;n++)a.parts.push(c(o.parts[n],e))}else{for(var i=[],n=0;n<o.parts.length;n++)i.push(c(o.parts[n],e));p[o.id]={id:o.id,refs:1,parts:i}}}}function a(t){for(var e=[],r={},o=0;o<t.length;o++){var a=t[o],n=a[0],i=a[1],s=a[2],l=a[3],c={css:i,media:s,sourceMap:l};r[n]?r[n].parts.push(c):e.push(r[n]={id:n,parts:[c]})}return e}function n(t,e){var r=m(),o=w[w.length-1];if("top"===t.insertAt)o?o.nextSibling?r.insertBefore(e,o.nextSibling):r.appendChild(e):r.insertBefore(e,r.firstChild),w.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");r.appendChild(e)}}function i(t){t.parentNode.removeChild(t);var e=w.indexOf(t);e>=0&&w.splice(e,1)}function s(t){var e=document.createElement("style");return e.type="text/css",n(t,e),e}function l(t){var e=document.createElement("link");return e.rel="stylesheet",n(t,e),e}function c(t,e){var r,o,a;if(e.singleton){var n=g++;r=h||(h=s(e)),o=d.bind(null,r,n,!1),a=d.bind(null,r,n,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=l(e),o=_.bind(null,r),a=function(){i(r),r.href&&URL.revokeObjectURL(r.href)}):(r=s(e),o=u.bind(null,r),a=function(){i(r)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else a()}}function d(t,e,r,o){var a=r?"":o.css;if(t.styleSheet)t.styleSheet.cssText=y(e,a);else{var n=document.createTextNode(a),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(n,i[e]):t.appendChild(n)}}function u(t,e){var r=e.css,o=e.media;if(o&&t.setAttribute("media",o),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}function _(t,e){var r=e.css,o=e.sourceMap;o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),n=t.href;t.href=URL.createObjectURL(a),n&&URL.revokeObjectURL(n)}var p={},f=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},v=f(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),m=f(function(){return document.head||document.getElementsByTagName("head")[0]}),h=null,g=0,w=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=v()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var r=a(t);return o(r,e),function(t){for(var n=[],i=0;i<r.length;i++){var s=r[i],l=p[s.id];l.refs--,n.push(l)}if(t){var c=a(t);o(c,e)}for(var i=0;i<n.length;i++){var l=n[i];if(0===l.refs){for(var d=0;d<l.parts.length;d++)l.parts[d]();delete p[l.id]}}}};var y=function(){var t=[];return function(e,r){return t[e]=r,t.filter(Boolean).join("\n")}}()},function(t,e,r){var o=r(186);"string"==typeof o&&(o=[[t.id,o,""]]);r(184)(o,{});o.locals&&(t.exports=o.locals)},function(t,e,r){e=t.exports=r(183)(),e.push([t.id,'[hidden]{display:none}.visually-hidden{position:absolute;clip:rect(0,0,0,0)}div.awesomplete{display:inline-block;position:relative}div.awesomplete>input{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 o=r(150),a=r(188),n=r(193),i=r(194),s=r(195),l=r(196),c=r(198),d=r(200);t.exports=function u(t){var e=t.params,u=d3.select(e.root+" .sidebar_wrapper");e.viz.is_expand&&u.style("display","none"),u.append("div").classed("title_section",!0),null!=e.sidebar.title&&u.select(".title_section").append("h4").style("margin-left","20px").style("margin-top","5px").style("margin-bottom","0px").text(e.sidebar.title),u.append("div").style("padding-left","10px").style("padding-right","10px").classed("about_section",!0),null!=e.sidebar.about&&u.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(e.sidebar.about),u.append("div").classed("icons_section",!0).style("text-align","center"),c(e),e.sidebar.icons&&l(t,u),i(e,u),n(u,e),d(u);var r=_.keys(e.viz.possible_filters);r.indexOf("enr_score_type")>-1&&r.sort(function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())}),t.slider_functions={},_.each(r,function(e){a(t,e)}),o(t),null!==e.ini_view&&(s(e),e.ini_view=null)}},function(t,e,r){"use strict";var o=r(189),a=r(192);t.exports=function(t,e){var r=t.params,n=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]?o(t,e,n):"categorical"==r.viz.possible_filters[e]&&a(t,e,n)}},function(t,e,r){"use strict";var o=r(172),a=r(190),n=r(5),i=r(12);d3.slider=r(177),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=n(s.viz.filter_data,t);l[t]=r}});var d=o(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(d.text+d.state+d.suffix),r.append("div").classed("slider_"+e,!0).classed("slider",!0).attr("current_state",d.state);var u=s.network_data.views,p=i(s,u,l);p=p.sort(function(t,r){return r[e]-t[e]});var f=p.length-1,v=0;if(null!==s.requested_view&&e in s.requested_view){var m=s.requested_view[e];if("all"!=m){var h=p.map(function(t){return t[e]}).indexOf(m);h>0&&(v=h)}}var g=d3.slider().value(v).min(0).max(f).step(1).on("slide",function(r,o){w(t,e,p,o)}).on("slideend",function(r,o){w(t,e,p,o)});t.slider_functions[e]=g,d3.select(t.params.root+" .slider_"+e).call(g);var w=_.debounce(a,800)}},function(t,e,r){"use strict";var o=r(135),a=r(171),n=r(191),i=r(14);t.exports=function(t,e,r,s){var l=t.params,c=r[s][e];a(t,e,c),l=n(l);var d={};if(d[e]=c,d=i(l,d),_.has(r[0],"enr_score_type")){var u=d3.select(l.root+" .toggle_enr_score_type").attr("current_state");d.enr_score_type=u}o(t,d)}},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 o=r(14);t.exports=function(t,e,r,a){var n=a.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"};n.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};o(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"),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,o,a,n,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",o=Object.keys(t.matrix.orders);var c=[];_.each(o,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 d;d="both"!=e?" Order":"Reorder Matrix",l.append("div").classed("sidebar_button_text",!0).style("clear","both").style("margin-top","10px").html(s[e]+d),n=l.append("div").classed("btn-group-vertical",!0).style("width","100%").classed("toggle_"+e+"_order",!0).attr("role","group"),n.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 a=!1,e==t.viz.inst_order[i]&&(a=!0),a}).attr("name",function(t){return t}).html(function(t){return r[t]})})}},function(t,e,r){"use strict";var o=r(172);t.exports=function(t){_.each(_.keys(t.ini_view),function(e){var r=t.ini_view[e],a=t.viz.possible_filters[e];if("numerical"===a){"all"!=r&&(r=parseInt(r,10)),t.viz.filter_data[e].indexOf(r)<=-1&&(r="all");var n=o(t,e);d3.select(t.root+" .title_"+e).text(n.text+r+n.suffix),d3.select(t.root+" .slider_"+e).attr("current_state",r)}})}},function(t,e,r){"use strict";var o=r(197),a=r(174),n=r(91),i=r(176);t.exports=function(t,e){function r(){d3.select(s.root+" .expand_button").style("opacity",0);var t=d3.select(s.root+" 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"});c(e,"clustergrammer.svg"),d3.select(s.root+" .expand_button").style("opacity",.4)}var s=t.params,l=o(),c=a(),d=e.select(".icons_section").style("margin-top","7px").style("margin-left","5%"),u="22%",_="0px",p="0px";d.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",_).style("padding-right",p).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%"),d.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",_).style("padding-right",p).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%"),d.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",_).style("padding-right",p).append("i").classed("fa",!0).classed("fa fa-cloud-download",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",function(){t.export_matrix()}).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Download matrix").style("left","-200%"),d.append("div").classed("clust_icon",!0).style("float","left").style("width",u).style("padding-left",_).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.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"),i(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")),n(s,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 f="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),l(document.getElementById(f),"clustergrammer.png"),d3.select(s.root+" .expand_button").style("opacity",.4)})}},function(t,e){"use strict";t.exports=function(){function t(t){return t&&0==t.lastIndexOf("http",0)&&t.lastIndexOf(window.location.host)==-1}function r(e,r){var o=e.querySelectorAll("image"),a=o.length;0==a&&r();for(var n=0;n<o.length;n++)!function(e){var o=e.getAttributeNS("http://www.w3.org/1999/xlink","href");if(o&&t(o.value))return void console.warn("Cannot render embedded images linking to external hosts: "+o.value);var n=document.createElement("canvas"),i=n.getContext("2d"),s=new Image;o=o||e.getAttribute("href"),s.src=o,s.onload=function(){n.width=s.width,n.height=s.height,i.drawImage(s,0,0),e.setAttributeNS("http://www.w3.org/1999/xlink","href",n.toDataURL("image/png")),a--,0==a&&r()},s.onerror=function(){console.log("Could not load "+o),a--,0==a&&r()}}(o[n])}function o(t,e){for(var r="",o=document.styleSheets,a=0;a<o.length;a++){try{var n=o[a].cssRules}catch(i){
console.warn("Stylesheet could not be loaded: "+o[a].href);continue}if(null!=n)for(var s=0;s<n.length;s++){var l=n[s];if("undefined"!=typeof l.style){var c=null;try{c=t.querySelector(l.selectorText)}catch(d){console.warn('Invalid CSS selector "'+l.selectorText+'"',d)}if(c){var u=e?e(l.selectorText):l.selectorText;r+=u+" { "+l.style.cssText+" }\n"}else l.cssText.match(/^@font-face/)&&(r+=l.cssText+"\n")}}}return r}function a(t,e,r){var o=t.viewBox.baseVal&&t.viewBox.baseVal[r]||null!==e.getAttribute(r)&&!e.getAttribute(r).match(/%$/)&&parseInt(e.getAttribute(r))||t.getBoundingClientRect()[r]||parseInt(e.style[r])||parseInt(window.getComputedStyle(t).getPropertyValue(r));return"undefined"==typeof o||null===o||isNaN(parseFloat(o))?0:o}function n(t){return t=encodeURIComponent(t),t=t.replace(/%([0-9A-F]{2})/g,function(t,e){var r=String.fromCharCode("0x"+e);return"%"===r?"%25":r}),decodeURIComponent(t)}var i="undefined"!=typeof e&&e||this,s='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';return i.svgAsDataUri=function(t,e,i){e=e||{},e.scale=e.scale||1;var l="http://www.w3.org/2000/xmlns/";r(t,function(){var r,c,d=document.createElement("div"),u=t.cloneNode(!0);if("svg"==t.tagName)r=e.width||a(t,u,"width"),c=e.height||a(t,u,"height");else{if(!t.getBBox)return void console.error("Attempted to render non-SVG element",t);var _=t.getBBox();r=_.x+_.width,c=_.y+_.height,u.setAttribute("transform",u.getAttribute("transform").replace(/translate\(.*?\)/,""));var p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.appendChild(u),u=p}u.setAttribute("version","1.1"),u.setAttributeNS(l,"xmlns","http://www.w3.org/2000/svg"),u.setAttributeNS(l,"xmlns:xlink","http://www.w3.org/1999/xlink"),u.setAttribute("width",r*e.scale),u.setAttribute("height",c*e.scale),u.setAttribute("viewBox",[e.left||0,e.top||0,r,c].join(" ")),d.appendChild(u);var f=o(t,e.selectorRemap),v=document.createElement("style");v.setAttribute("type","text/css"),v.innerHTML="<![CDATA[\n"+f+"\n]]>";var m=document.createElement("defs");m.appendChild(v),u.insertBefore(m,u.firstChild);var p=s+d.innerHTML,h="data:image/svg+xml;base64,"+window.btoa(n(p));i&&i(h)})},i.svgAsPngUri=function(t,e,r){i.svgAsDataUri(t,e,function(t){var o=new Image;o.onload=function(){var t=document.createElement("canvas");t.width=o.width,t.height=o.height;var a=t.getContext("2d");e&&e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,t.width,t.height)),a.drawImage(o,0,0);var n;document.createElement("a");try{n=t.toDataURL("image/png")}catch(i){if(i instanceof SecurityError)return void console.error("Rendered SVG images cannot be downloaded in this browser.");throw i}r(n)},o.src=t})},i.saveSvgAsPng=function(t,e,r){r=r||{},i.svgAsPngUri(t,r,function(t){var r=document.createElement("a");r.download=e,r.href=t,document.body.appendChild(r),r.addEventListener("click",function(t){r.parentNode.removeChild(r)}),r.click()})},i.saveSvgAsPng}},function(t,e,r){"use strict";var o=r(199);t.exports=function(t){var e=o(t,"share_info");e.header.append("a").attr("target","_blank").attr("href","/clustergrammer/"),e.header.append("h4").classed("modal-title",!0).html("Share the visualization using the current URL:"),e.body.append("input").classed("bootstrap_highlight",!0).classed("share_url",!0);var r=o(t,"picture_info");r.header.append("h4").classed("modal-title",!0).html("Save a snapshot of the visualization"),r.body.append("div").classed("download_buttons",!0);var a=o(t,"dendro_info");a.header.append("h4").classed("modal-title",!0).html("Cluster Information"),a.body.append("g").classed("cluster_info_container",!0),a.body.append("div").classed("dendro_text",!0).append("input").classed("bootstrap_highlight",!0).classed("current_names",!0).style("width","100%")}},function(t,e){"use strict";t.exports=function(t,e){var r={},o=d3.select(t.root).append("div").classed("modal",!0).classed("fade",!0).classed(e,!0).attr("role","dialog"),a=o.append("div").classed("modal-dialog",!0),n=a.append("div").classed("modal-content",!0);return r.header=n.append("div").classed("modal-header",!0),r.header.append("button").attr("type","button").classed("close",!0).attr("data-dismiss","modal").html("×"),r.body=n.append("div").classed("modal-body",!0),r}},function(t,e){"use strict";t.exports=function(t){var e=t.append("div").classed("opacity_slider_container",!0).style("margin-top","5px").style("padding-left","10px").style("padding-right","10px");e.append("div").classed("sidebar_text",!0).classed("opacity_slider_text",!0).style("margin-bottom","3px").text("Opacity Slider"),e.append("div").classed("slider",!0).classed("opacity_slider",!0)}}]);
//# sourceMappingURL=clustergrammer.node.min.js.map