-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathclustergrammer.min.js
3 lines (3 loc) · 325 KB
/
clustergrammer.min.js
1
2
3
var Clustergrammer=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=t,r.c=e,r.p="",r(0)}([function(t,e,r){var n=r(1),o=r(10),a=r(89),i=r(154),s=r(197),l=r(237),c=r(240),u=r(241),d=r(242),f=r(243),p=r(146),_=r(245),h=r(248),v=r(252),m=r(155),g=r(100),y=r(145),w=r(250);d3.slider=r(254);r(256);r(257),r(261),t.exports=function(t){var e=n(t),x={};function b(t){i(t)}return x.params=o(e),x.config=e,x.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,x.params.viz.square_zoom*x.params.viz.zoom_ratio.x]).on("zoom",(function(){m(x)})),x.params.zoom_behavior.translate([x.params.viz.clust.margin.left,x.params.viz.clust.margin.top]),x.params.use_sidebar&&r(263)(x),a(x),x.update_view=_,x.resize_viz=function(){d3.select(x.params.viz.viz_svg).style("opacity",.5);var t=500;!0===this.params.viz.run_trans&&(t=2500),setTimeout(b,t,this)},x.play_demo=s,x.ini_demo=l,x.filter_viz_using_nodes=c,x.filter_viz_using_names=u,x.update_cats=function(t){d(this,t)},x.reset_cats=f,x.zoom=function(t,e,r){p(this,t,e,r)},x.save_matrix=h,x.brush_crop_matrix=v,x.d3_tip_custom=function(){return g},x.reorder=function(t,e){"sum"===e&&(e="rank"),"var"===e&&(e="rankvar"),y(this,e,t)},x.export_matrix_string=function(){return w(this.params)},x.update_view=function(t,e){_(this,t,e)},x}},function(t,e,r){var n=r(2),o=r(4),a=r(5),i=r(6),s=r(7),l=r(8),c=r(9),u=r(3);t.exports=function(t){var e=s(),r=n.extend(e,t);r.network_data=t.network_data;var d=": ";u.each(["row","col"],(function(t){var e=r.network_data[t+"_nodes"],n=c(e);e.forEach((function(e,o){e[t+"_index"]=o,n&&(r.super_labels=!0,r.super[t]=e.name.split(d)[0],e.name=e.name.split(d)[1]),e.name=String(e.name),e.name=e.name.replace(/_/g," ")}))})),r.network_data.row_nodes_names=n.pluck(r.network_data.row_nodes,"name"),r.network_data.col_nodes_names=n.pluck(r.network_data.col_nodes,"name"),r.sim_mat=l(r);var f=a(r.network_data.views),p={};u.each(u.keys(f.possible_filters),(function(t){var e=i(f.filter_data,t);p[t]=e})),_.has(r.network_data,"views")&&r.network_data.views.forEach((function(t){u.each(u.keys(f.possible_filters),(function(e){_.has(t,e)||(t[e]=p[e])}));var e=t.nodes;u.each(["row","col"],(function(t){var r=c(e[t+"_nodes"]);e[t+"_nodes"].forEach((function(e,n){e[t+"_index"]=n,r&&(e.name=e.name.split(d)[1]),e.name=String(e.name),e.name=e.name.replace(/_/g," ")}))}))}));var h=r.network_data.col_nodes,v=r.network_data.row_nodes;if(_.has(r.network_data,"mat")){for(var m=[],g=r.network_data.mat,y={},w=0;w<g.length;w++)for(var x=0;x<g[0].length;x++)(y={}).source=w,y.target=x,y.value=g[w][x],m.push(y);r.network_data.links=m}if(r.network_data.links.forEach((function(t){t.name=v[t.source].name+"_"+h[t.target].name,t.row_name=v[t.source].name,t.col_name=h[t.target].name})),r.transpose){r.network_data=o(r.network_data);var b=t.col_label,z=t.row_label;t.row_label=b,t.col_label=z}n.is_undefined(t.row_label)||n.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={},!n.is_undefined(t.order)&&n.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"),!n.is_undefined(t.row_order)&&n.is_supported_order(t.row_order)&&(r.inst_order.col=t.row_order),!n.is_undefined(t.col_order)&&n.is_supported_order(t.col_order)&&(r.inst_order.row=t.col_order);var k=n.has(r.network_data.row_nodes[0],"group"),A=n.has(r.network_data.col_nodes[0],"group");return r.show_dendrogram=k||A,n.has(r.network_data.links[0],"value_orig")?r.keep_orig=!0:r.keep_orig=!1,r}},function(t,e,r){var n=r(3);t.exports={normal_name:function(t){return t.name.replace(/_/g," ").split("#")[0]},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){if(window._){if("function"==typeof n.pluck)return n.pluck(t,e);if("function"==typeof n.map)return n.map(t,this.property(e))}else if(t.map&&"function"==typeof t.map)return t.map(this.property(e))},is_undefined:function(t){return void 0===t},extend:function(t,e){for(var r in t=t||{},e)"object"==typeof e[r]?t[r]=this.extend(t[r],e[r]):t[r]=e[r];return t}}},function(t,e,r){var n;(function(){var r=this,o=r._,a=Array.prototype,i=Object.prototype,s=Function.prototype,l=a.push,c=a.slice,u=i.toString,d=i.hasOwnProperty,f=Array.isArray,p=Object.keys,_=s.bind,h=Object.create,v=function(){},m=function(t){return t instanceof m?t:this instanceof m?void(this._wrapped=t):new m(t)};void 0!==t&&t.exports&&(e=t.exports=m),e._=m,m.VERSION="1.8.3";var g=function(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)};case 4:return function(r,n,o,a){return t.call(e,r,n,o,a)}}return function(){return t.apply(e,arguments)}},y=function(t,e,r){return null==t?m.identity:m.isFunction(t)?g(t,e,r):m.isObject(t)?m.matcher(t):m.property(t)};m.iteratee=function(t,e){return y(t,e,1/0)};var w=function(t,e){return function(r){var n=arguments.length;if(n<2||null==r)return r;for(var o=1;o<n;o++)for(var a=arguments[o],i=t(a),s=i.length,l=0;l<s;l++){var c=i[l];e&&void 0!==r[c]||(r[c]=a[c])}return r}},x=function(t){if(!m.isObject(t))return{};if(h)return h(t);v.prototype=t;var e=new v;return v.prototype=null,e},b=function(t){return function(e){return null==e?void 0:e[t]}},z=Math.pow(2,53)-1,k=b("length"),A=function(t){var e=k(t);return"number"==typeof e&&e>=0&&e<=z};function E(t){function e(e,r,n,o,a,i){for(;a>=0&&a<i;a+=t){var s=o?o[a]:a;n=r(n,e[s],s,e)}return n}return function(r,n,o,a){n=g(n,a,4);var i=!A(r)&&m.keys(r),s=(i||r).length,l=t>0?0:s-1;return arguments.length<3&&(o=r[i?i[l]:l],l+=t),e(r,n,o,i,l,s)}}m.each=m.forEach=function(t,e,r){var n,o;if(e=g(e,r),A(t))for(n=0,o=t.length;n<o;n++)e(t[n],n,t);else{var a=m.keys(t);for(n=0,o=a.length;n<o;n++)e(t[a[n]],a[n],t)}return t},m.map=m.collect=function(t,e,r){e=y(e,r);for(var n=!A(t)&&m.keys(t),o=(n||t).length,a=Array(o),i=0;i<o;i++){var s=n?n[i]:i;a[i]=e(t[s],s,t)}return a},m.reduce=m.foldl=m.inject=E(1),m.reduceRight=m.foldr=E(-1),m.find=m.detect=function(t,e,r){var n;if(void 0!==(n=A(t)?m.findIndex(t,e,r):m.findKey(t,e,r))&&-1!==n)return t[n]},m.filter=m.select=function(t,e,r){var n=[];return e=y(e,r),m.each(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n},m.reject=function(t,e,r){return m.filter(t,m.negate(y(e)),r)},m.every=m.all=function(t,e,r){e=y(e,r);for(var n=!A(t)&&m.keys(t),o=(n||t).length,a=0;a<o;a++){var i=n?n[a]:a;if(!e(t[i],i,t))return!1}return!0},m.some=m.any=function(t,e,r){e=y(e,r);for(var n=!A(t)&&m.keys(t),o=(n||t).length,a=0;a<o;a++){var i=n?n[a]:a;if(e(t[i],i,t))return!0}return!1},m.contains=m.includes=m.include=function(t,e,r,n){return A(t)||(t=m.values(t)),("number"!=typeof r||n)&&(r=0),m.indexOf(t,e,r)>=0},m.invoke=function(t,e){var r=c.call(arguments,2),n=m.isFunction(e);return m.map(t,(function(t){var o=n?e:t[e];return null==o?o:o.apply(t,r)}))},m.pluck=function(t,e){return m.map(t,m.property(e))},m.where=function(t,e){return m.filter(t,m.matcher(e))},m.findWhere=function(t,e){return m.find(t,m.matcher(e))},m.max=function(t,e,r){var n,o,a=-1/0,i=-1/0;if(null==e&&null!=t)for(var s=0,l=(t=A(t)?t:m.values(t)).length;s<l;s++)(n=t[s])>a&&(a=n);else e=y(e,r),m.each(t,(function(t,r,n){((o=e(t,r,n))>i||o===-1/0&&a===-1/0)&&(a=t,i=o)}));return a},m.min=function(t,e,r){var n,o,a=1/0,i=1/0;if(null==e&&null!=t)for(var s=0,l=(t=A(t)?t:m.values(t)).length;s<l;s++)(n=t[s])<a&&(a=n);else e=y(e,r),m.each(t,(function(t,r,n){((o=e(t,r,n))<i||o===1/0&&a===1/0)&&(a=t,i=o)}));return a},m.shuffle=function(t){for(var e,r=A(t)?t:m.values(t),n=r.length,o=Array(n),a=0;a<n;a++)(e=m.random(0,a))!==a&&(o[a]=o[e]),o[e]=r[a];return o},m.sample=function(t,e,r){return null==e||r?(A(t)||(t=m.values(t)),t[m.random(t.length-1)]):m.shuffle(t).slice(0,Math.max(0,e))},m.sortBy=function(t,e,r){return e=y(e,r),m.pluck(m.map(t,(function(t,r,n){return{value:t,index:r,criteria:e(t,r,n)}})).sort((function(t,e){var r=t.criteria,n=e.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return t.index-e.index})),"value")};var N=function(t){return function(e,r,n){var o={};return r=y(r,n),m.each(e,(function(n,a){var i=r(n,a,e);t(o,n,i)})),o}};m.groupBy=N((function(t,e,r){m.has(t,r)?t[r].push(e):t[r]=[e]})),m.indexBy=N((function(t,e,r){t[r]=e})),m.countBy=N((function(t,e,r){m.has(t,r)?t[r]++:t[r]=1})),m.toArray=function(t){return t?m.isArray(t)?c.call(t):A(t)?m.map(t,m.identity):m.values(t):[]},m.size=function(t){return null==t?0:A(t)?t.length:m.keys(t).length},m.partition=function(t,e,r){e=y(e,r);var n=[],o=[];return m.each(t,(function(t,r,a){(e(t,r,a)?n:o).push(t)})),[n,o]},m.first=m.head=m.take=function(t,e,r){if(null!=t)return null==e||r?t[0]:m.initial(t,t.length-e)},m.initial=function(t,e,r){return c.call(t,0,Math.max(0,t.length-(null==e||r?1:e)))},m.last=function(t,e,r){if(null!=t)return null==e||r?t[t.length-1]:m.rest(t,Math.max(0,t.length-e))},m.rest=m.tail=m.drop=function(t,e,r){return c.call(t,null==e||r?1:e)},m.compact=function(t){return m.filter(t,m.identity)};var M=function(t,e,r,n){for(var o=[],a=0,i=n||0,s=k(t);i<s;i++){var l=t[i];if(A(l)&&(m.isArray(l)||m.isArguments(l))){e||(l=M(l,e,r));var c=0,u=l.length;for(o.length+=u;c<u;)o[a++]=l[c++]}else r||(o[a++]=l)}return o};function S(t){return function(e,r,n){r=y(r,n);for(var o=k(e),a=t>0?0:o-1;a>=0&&a<o;a+=t)if(r(e[a],a,e))return a;return-1}}function O(t,e,r){return function(n,o,a){var i=0,s=k(n);if("number"==typeof a)t>0?i=a>=0?a:Math.max(a+s,i):s=a>=0?Math.min(a+1,s):a+s+1;else if(r&&a&&s)return n[a=r(n,o)]===o?a:-1;if(o!=o)return(a=e(c.call(n,i,s),m.isNaN))>=0?a+i:-1;for(a=t>0?i:s-1;a>=0&&a<s;a+=t)if(n[a]===o)return a;return-1}}m.flatten=function(t,e){return M(t,e,!1)},m.without=function(t){return m.difference(t,c.call(arguments,1))},m.uniq=m.unique=function(t,e,r,n){m.isBoolean(e)||(n=r,r=e,e=!1),null!=r&&(r=y(r,n));for(var o=[],a=[],i=0,s=k(t);i<s;i++){var l=t[i],c=r?r(l,i,t):l;e?(i&&a===c||o.push(l),a=c):r?m.contains(a,c)||(a.push(c),o.push(l)):m.contains(o,l)||o.push(l)}return o},m.union=function(){return m.uniq(M(arguments,!0,!0))},m.intersection=function(t){for(var e=[],r=arguments.length,n=0,o=k(t);n<o;n++){var a=t[n];if(!m.contains(e,a)){for(var i=1;i<r&&m.contains(arguments[i],a);i++);i===r&&e.push(a)}}return e},m.difference=function(t){var e=M(arguments,!0,!0,1);return m.filter(t,(function(t){return!m.contains(e,t)}))},m.zip=function(){return m.unzip(arguments)},m.unzip=function(t){for(var e=t&&m.max(t,k).length||0,r=Array(e),n=0;n<e;n++)r[n]=m.pluck(t,n);return r},m.object=function(t,e){for(var r={},n=0,o=k(t);n<o;n++)e?r[t[n]]=e[n]:r[t[n][0]]=t[n][1];return r},m.findIndex=S(1),m.findLastIndex=S(-1),m.sortedIndex=function(t,e,r,n){for(var o=(r=y(r,n,1))(e),a=0,i=k(t);a<i;){var s=Math.floor((a+i)/2);r(t[s])<o?a=s+1:i=s}return a},m.indexOf=O(1,m.findIndex,m.sortedIndex),m.lastIndexOf=O(-1,m.findLastIndex),m.range=function(t,e,r){null==e&&(e=t||0,t=0),r=r||1;for(var n=Math.max(Math.ceil((e-t)/r),0),o=Array(n),a=0;a<n;a++,t+=r)o[a]=t;return o};var T=function(t,e,r,n,o){if(!(n instanceof e))return t.apply(r,o);var a=x(t.prototype),i=t.apply(a,o);return m.isObject(i)?i:a};m.bind=function(t,e){if(_&&t.bind===_)return _.apply(t,c.call(arguments,1));if(!m.isFunction(t))throw new TypeError("Bind must be called on a function");var r=c.call(arguments,2),n=function(){return T(t,n,e,this,r.concat(c.call(arguments)))};return n},m.partial=function(t){var e=c.call(arguments,1),r=function(){for(var n=0,o=e.length,a=Array(o),i=0;i<o;i++)a[i]=e[i]===m?arguments[n++]:e[i];for(;n<arguments.length;)a.push(arguments[n++]);return T(t,r,this,this,a)};return r},m.bindAll=function(t){var e,r,n=arguments.length;if(n<=1)throw new Error("bindAll must be passed function names");for(e=1;e<n;e++)t[r=arguments[e]]=m.bind(t[r],t);return t},m.memoize=function(t,e){var r=function(n){var o=r.cache,a=""+(e?e.apply(this,arguments):n);return m.has(o,a)||(o[a]=t.apply(this,arguments)),o[a]};return r.cache={},r},m.delay=function(t,e){var r=c.call(arguments,2);return setTimeout((function(){return t.apply(null,r)}),e)},m.defer=m.partial(m.delay,m,1),m.throttle=function(t,e,r){var n,o,a,i=null,s=0;r||(r={});var l=function(){s=!1===r.leading?0:m.now(),i=null,a=t.apply(n,o),i||(n=o=null)};return function(){var c=m.now();s||!1!==r.leading||(s=c);var u=e-(c-s);return n=this,o=arguments,u<=0||u>e?(i&&(clearTimeout(i),i=null),s=c,a=t.apply(n,o),i||(n=o=null)):i||!1===r.trailing||(i=setTimeout(l,u)),a}},m.debounce=function(t,e,r){var n,o,a,i,s,l=function(){var c=m.now()-i;c<e&&c>=0?n=setTimeout(l,e-c):(n=null,r||(s=t.apply(a,o),n||(a=o=null)))};return function(){a=this,o=arguments,i=m.now();var c=r&&!n;return n||(n=setTimeout(l,e)),c&&(s=t.apply(a,o),a=o=null),s}},m.wrap=function(t,e){return m.partial(e,t)},m.negate=function(t){return function(){return!t.apply(this,arguments)}},m.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},m.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},m.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},m.once=m.partial(m.before,2);var B=!{toString:null}.propertyIsEnumerable("toString"),C=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function F(t,e){var r=C.length,n=t.constructor,o=m.isFunction(n)&&n.prototype||i,a="constructor";for(m.has(t,a)&&!m.contains(e,a)&&e.push(a);r--;)(a=C[r])in t&&t[a]!==o[a]&&!m.contains(e,a)&&e.push(a)}m.keys=function(t){if(!m.isObject(t))return[];if(p)return p(t);var e=[];for(var r in t)m.has(t,r)&&e.push(r);return B&&F(t,e),e},m.allKeys=function(t){if(!m.isObject(t))return[];var e=[];for(var r in t)e.push(r);return B&&F(t,e),e},m.values=function(t){for(var e=m.keys(t),r=e.length,n=Array(r),o=0;o<r;o++)n[o]=t[e[o]];return n},m.mapObject=function(t,e,r){e=y(e,r);for(var n,o=m.keys(t),a=o.length,i={},s=0;s<a;s++)i[n=o[s]]=e(t[n],n,t);return i},m.pairs=function(t){for(var e=m.keys(t),r=e.length,n=Array(r),o=0;o<r;o++)n[o]=[e[o],t[e[o]]];return n},m.invert=function(t){for(var e={},r=m.keys(t),n=0,o=r.length;n<o;n++)e[t[r[n]]]=r[n];return e},m.functions=m.methods=function(t){var e=[];for(var r in t)m.isFunction(t[r])&&e.push(r);return e.sort()},m.extend=w(m.allKeys),m.extendOwn=m.assign=w(m.keys),m.findKey=function(t,e,r){e=y(e,r);for(var n,o=m.keys(t),a=0,i=o.length;a<i;a++)if(e(t[n=o[a]],n,t))return n},m.pick=function(t,e,r){var n,o,a={},i=t;if(null==i)return a;m.isFunction(e)?(o=m.allKeys(i),n=g(e,r)):(o=M(arguments,!1,!1,1),n=function(t,e,r){return e in r},i=Object(i));for(var s=0,l=o.length;s<l;s++){var c=o[s],u=i[c];n(u,c,i)&&(a[c]=u)}return a},m.omit=function(t,e,r){if(m.isFunction(e))e=m.negate(e);else{var n=m.map(M(arguments,!1,!1,1),String);e=function(t,e){return!m.contains(n,e)}}return m.pick(t,e,r)},m.defaults=w(m.allKeys,!0),m.create=function(t,e){var r=x(t);return e&&m.extendOwn(r,e),r},m.clone=function(t){return m.isObject(t)?m.isArray(t)?t.slice():m.extend({},t):t},m.tap=function(t,e){return e(t),t},m.isMatch=function(t,e){var r=m.keys(e),n=r.length;if(null==t)return!n;for(var o=Object(t),a=0;a<n;a++){var i=r[a];if(e[i]!==o[i]||!(i in o))return!1}return!0};var I=function(t,e,r,n){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof m&&(t=t._wrapped),e instanceof m&&(e=e._wrapped);var o=u.call(t);if(o!==u.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}var a="[object Array]"===o;if(!a){if("object"!=typeof t||"object"!=typeof e)return!1;var i=t.constructor,s=e.constructor;if(i!==s&&!(m.isFunction(i)&&i instanceof i&&m.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}n=n||[];for(var l=(r=r||[]).length;l--;)if(r[l]===t)return n[l]===e;if(r.push(t),n.push(e),a){if((l=t.length)!==e.length)return!1;for(;l--;)if(!I(t[l],e[l],r,n))return!1}else{var c,d=m.keys(t);if(l=d.length,m.keys(e).length!==l)return!1;for(;l--;)if(c=d[l],!m.has(e,c)||!I(t[c],e[c],r,n))return!1}return r.pop(),n.pop(),!0};m.isEqual=function(t,e){return I(t,e)},m.isEmpty=function(t){return null==t||(A(t)&&(m.isArray(t)||m.isString(t)||m.isArguments(t))?0===t.length:0===m.keys(t).length)},m.isElement=function(t){return!(!t||1!==t.nodeType)},m.isArray=f||function(t){return"[object Array]"===u.call(t)},m.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],(function(t){m["is"+t]=function(e){return u.call(e)==="[object "+t+"]"}})),m.isArguments(arguments)||(m.isArguments=function(t){return m.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(t){return"function"==typeof t||!1}),m.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},m.isNaN=function(t){return m.isNumber(t)&&t!==+t},m.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===u.call(t)},m.isNull=function(t){return null===t},m.isUndefined=function(t){return void 0===t},m.has=function(t,e){return null!=t&&d.call(t,e)},m.noConflict=function(){return r._=o,this},m.identity=function(t){return t},m.constant=function(t){return function(){return t}},m.noop=function(){},m.property=b,m.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},m.matcher=m.matches=function(t){return t=m.extendOwn({},t),function(e){return m.isMatch(e,t)}},m.times=function(t,e,r){var n=Array(Math.max(0,t));e=g(e,r,1);for(var o=0;o<t;o++)n[o]=e(o);return n},m.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},m.now=Date.now||function(){return(new Date).getTime()};var j={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},R=m.invert(j),L=function(t){var e=function(e){return t[e]},r="(?:"+m.keys(t).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(o,e):t}};m.escape=L(j),m.unescape=L(R),m.result=function(t,e,r){var n=null==t?void 0:t[e];return void 0===n&&(n=r),m.isFunction(n)?n.call(t):n};var P=0;m.uniqueId=function(t){var e=++P+"";return t?t+e:e},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,U={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g,$=function(t){return"\\"+U[t]};m.template=function(t,e,r){!e&&r&&(e=r),e=m.defaults({},e,m.templateSettings);var n=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(n,(function(e,r,n,i,s){return a+=t.slice(o,s).replace(q,$),o=s+e.length,r?a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),e})),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var i=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var s=function(t){return i.call(this,t,m)},l=e.variable||"obj";return s.source="function("+l+"){\n"+a+"}",s},m.chain=function(t){var e=m(t);return e._chain=!0,e};var H=function(t,e){return t._chain?m(e).chain():e};m.mixin=function(t){m.each(m.functions(t),(function(e){var r=m[e]=t[e];m.prototype[e]=function(){var t=[this._wrapped];return l.apply(t,arguments),H(this,r.apply(m,t))}}))},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=a[t];m.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],H(this,r)}})),m.each(["concat","join","slice"],(function(t){var e=a[t];m.prototype[t]=function(){return H(this,e.apply(this._wrapped,arguments))}})),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},void 0===(n=function(){return m}.apply(e,[]))||(t.exports=n)}).call(this)},function(t,e,r){var n=r(2);t.exports=function(t){var e,r,o={};for(o.row_nodes=t.col_nodes,o.col_nodes=t.row_nodes,o.links=[],r=0;r<t.links.length;r++)(e={}).source=t.links[r].target,e.target=t.links[r].source,e.value=t.links[r].value,n.has(t.links[r],"highlight")&&(e.highlight=t.links[r].highlight),n.has(t.links[r],"value_up")&&(e.value_up=t.links[r].value_up),n.has(t.links[r],"value_dn")&&(e.value_dn=t.links[r].value_dn),n.has(t.links[r],"info")&&(e.info=t.links[r].info),o.links.push(e);return o}},function(t,e,r){var n=r(3);t.exports=function(t){var e={},r={};n.each(t,(function(t){var e=n.keys(t);n.each(e,(function(e){"nodes"!=e&&(_.has(r,e)||(r[e]=[]),r[e].push(t[e]),r[e]=n.uniq(r[e]))}))}));var o=n.keys(r);n.each(o,(function(t){var o=r[t],a=o.length,i="categorical";n.each(o,(function(t){"number"==typeof t&&(i="numerical")})),a>1&&(e[t]=i)}));var a={};return a.possible_filters=e,a.filter_data=r,a}},function(t,e){t.exports=function(t,e){var r=t[e].sort((function(t,e){return e-t}))[0];return r=String(r)}},function(t,e){t.exports=function(){return{row_label_scale:1,col_label_scale:1,super_labels:!1,super:{},show_label_tooltips:!0,show_tile_tooltips:!0,transpose:!1,tile_colors:["#FF0000","#1C86EE"],bar_colors:["#FF0000","#1C86EE"],cat_value_colors:["#2F4F4F","#9370DB"],outline_colors:["orange","black"],highlight_color:"#FFFF00",tile_title:!1,input_domain:0,opacity_scale:"linear",do_zoom:!0,is_zoom:0,is_slider_drag:!1,is_cropping:!1,background_color:"#FFFFFF",super_border_color:"#F5F5F5",outer_margins:{top:0,bottom:0,left:0,right:0},ini_expand:!1,grey_border_width:2,tile_click_hlight:!1,super_label_scale:1,make_tile_tooltip:function(t){return t.info},ini_view:null,requested_view:null,use_sidebar:!0,title:null,about:null,sidebar_width:160,sidebar_icons:!0,row_search_placeholder:"Row",buffer_width:10,show_sim_mat:!1,cat_colors:null,resize:!0,clamp_opacity:.85,expand_button:!0,max_allow_fs:20,dendro_filter:{row:!1,col:!1},cat_filter:{row:!1,col:!1},crop_filter_nodes:{row:!1,col:!1},row_tip_callback:null,col_tip_callback:null,tile_tip_callback:null,matrix_update_callback:null,cat_update_callback:null,dendro_callback:null,dendro_click_callback:null,new_row_cats:null,make_modals:!0,show_viz_border:!1}}},function(t,e,r){var n=r(3);t.exports=function(t){var e=!1;if(t.network_data.row_nodes_names.length==t.network_data.col_nodes_names.length){var r=t.network_data.row_nodes_names,o=t.network_data.col_nodes_names;e=!0,n.each(r,(function(t){var n=r.indexOf(t);t!==o[n]&&(e=!1)}))}return e&&(t.expand_button=!1),e}},function(t,e,r){var n=r(3);t.exports=function(t){var e=!0;return n.each(t,(function(t){String(t.name).indexOf(": ")<0&&(e=!1)})),e}},function(t,e,r){var n=r(11),o=r(65),a=r(66),i=r(5),s=r(67),l=r(88);t.exports=function(t){var e=$.extend(!0,{},t),r=e;if(r.inst_nodes={},r.inst_nodes.row_nodes=r.network_data.row_nodes,r.inst_nodes.col_nodes=r.network_data.col_nodes,null!==r.ini_view){var c=r.ini_view,u=i(r.network_data.views);r.viz={},r.viz.possible_filters=u.possible_filters,r.viz.filter_data=u.filter_data,c=a(r,c),r.network_data=n(e,r,c),r.requested_view=c}return(r=s(r)).use_sidebar&&(r.sidebar=o(r)),r.zoom_info=l(),r}},function(t,e,r){var n=r(12),o=r(64);t.exports=function(t,e,r){var a=t.network_data.views,i=!1;_.has(a[0],"enr_score_type")&&(i=!0);var s=o(e,a,r);i&&0==s.length&&(s=o(e,a,r={N_row_sum:"all",N_col_sum:"10"}));var l,c=s[0];if(void 0!==c){var u=c.nodes;l=n(t,u)}else l=t.network_data;return l}},function(t,e,r){var n=r(2),o=r(13),a=r(3),i=o.create();i.import(r(26)),i.import(r(63)),t.exports=function(t,e){var r=t.network_data.links,o=n.pluck(e.row_nodes,"name"),s=n.pluck(e.col_nodes,"name"),l=i.matrix(i.zeros([e.row_nodes.length,e.col_nodes.length]));l=l.toArray();var c=a.filter(r,(function(t){var e=t.name.split("_")[0],r=t.name.split("_")[1],n=a.indexOf(o,e),i=a.indexOf(s,r);if(n>-1&i>-1)return t.source=n,t.target=i,l[n][i]=t.value,t})),u={};return u.row_nodes=e.row_nodes,u.row_nodes_names=o,u.col_nodes=e.col_nodes,u.col_nodes_names=s,u.links=c,u.all_links=r,u.mat=l,u.views=t.network_data.views,_.has(t.network_data,"cat_colors")&&(u.cat_colors=t.network_data.cat_colors),u}},function(t,e,r){t.exports=r(14)},function(t,e,r){var n=r(15).isFactory,o=r(17),a=r(21),i=r(23),s=r(25);e.create=function(t){if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var e=[],r=[],l=a.mixin({});l.type={},l.expression={transform:{},mathWithTransform:{}},l.typed=o.create(l.type);var c={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function u(t){if(!n(t))throw new Error("Factory object with properties `type`, `name`, and `factory` expected");var o,a=e.indexOf(t);return-1===a?(o=!0===t.math?t.factory(l.type,c,u,l.typed,l):t.factory(l.type,c,u,l.typed),e.push(t),r.push(o)):o=r[a],o}return l.import=u(i),l.config=u(s),l.expression.mathWithTransform.config=l.config,t&&l.config(t),l}},function(t,e,r){"use strict";var n=r(16);e.clone=function t(r){var o=typeof r;if("number"===o||"string"===o||"boolean"===o||null==r)return r;if("function"==typeof r.clone)return r.clone();if(Array.isArray(r))return r.map((function(e){return t(e)}));if(r instanceof Number)return new Number(r.valueOf());if(r instanceof String)return new String(r.valueOf());if(r instanceof Boolean)return new Boolean(r.valueOf());if(r instanceof Date)return new Date(r.valueOf());if(n(r))return r;if(r instanceof RegExp)throw new TypeError("Cannot clone "+r);return e.map(r,t)},e.map=function(t,r){var n={};for(var o in t)e.hasOwnProperty(t,o)&&(n[o]=r(t[o]));return n},e.extend=function(t,r){for(var n in r)e.hasOwnProperty(r,n)&&(t[n]=r[n]);return t},e.deepExtend=function t(r,n){if(Array.isArray(n))throw new TypeError("Arrays are not supported by deepExtend");for(var o in n)if(e.hasOwnProperty(n,o))if(n[o]&&n[o].constructor===Object)void 0===r[o]&&(r[o]={}),r[o].constructor===Object?t(r[o],n[o]):r[o]=n[o];else{if(Array.isArray(n[o]))throw new TypeError("Arrays are not supported by deepExtend");r[o]=n[o]}return r},e.deepEqual=function(t,r){var n,o,a;if(Array.isArray(t)){if(!Array.isArray(r))return!1;if(t.length!=r.length)return!1;for(o=0,a=t.length;o<a;o++)if(!e.deepEqual(t[o],r[o]))return!1;return!0}if(t instanceof Object){if(Array.isArray(r)||!(r instanceof Object))return!1;for(n in t)if(!e.deepEqual(t[n],r[n]))return!1;for(n in r)if(!e.deepEqual(t[n],r[n]))return!1;return!0}return typeof t==typeof r&&t==r},e.canDefineProperty=function(){try{if(Object.defineProperty)return Object.defineProperty({},"x",{get:function(){}}),!0}catch(t){}return!1},e.lazy=function(t,r,n){if(e.canDefineProperty()){var o,a=!0;Object.defineProperty(t,r,{get:function(){return a&&(o=n(),a=!1),o},set:function(t){o=t,a=!1},configurable:!0,enumerable:!0})}else t[r]=n()},e.traverse=function(t,e){var r=t;if(e)for(var n=e.split("."),o=0;o<n.length;o++){var a=n[o];a in r||(r[a]={}),r=r[a]}return r},e.hasOwnProperty=function(t,e){return t&&Object.hasOwnProperty.call(t,e)},e.isFactory=function(t){return t&&"function"==typeof t.factory}},function(t,e){t.exports=function(t){return t&&t.constructor.prototype.isBigNumber||!1}},function(t,e,r){var n=r(18),o=r(19).digits,a=r(16),i=r(20),s=function(){return s=n.create,n};e.create=function(t){t.isNumber=function(t){return"number"==typeof t},t.isComplex=function(e){return t.Complex&&e instanceof t.Complex||!1},t.isBigNumber=a,t.isFraction=function(e){return t.Fraction&&e instanceof t.Fraction||!1},t.isUnit=function(t){return t&&t.constructor.prototype.isUnit||!1},t.isString=function(t){return"string"==typeof t},t.isArray=Array.isArray,t.isMatrix=i,t.isDenseMatrix=function(t){return t&&t.isDenseMatrix&&t.constructor.prototype.isMatrix||!1},t.isSparseMatrix=function(t){return t&&t.isSparseMatrix&&t.constructor.prototype.isMatrix||!1},t.isRange=function(t){return t&&t.constructor.prototype.isRange||!1},t.isIndex=function(t){return t&&t.constructor.prototype.isIndex||!1},t.isBoolean=function(t){return"boolean"==typeof t},t.isResultSet=function(t){return t&&t.constructor.prototype.isResultSet||!1},t.isHelp=function(t){return t&&t.constructor.prototype.isHelp||!1},t.isFunction=function(t){return"function"==typeof t},t.isDate=function(t){return t instanceof Date},t.isRegExp=function(t){return t instanceof RegExp},t.isObject=function(t){return"object"==typeof t},t.isNull=function(t){return null===t},t.isUndefined=function(t){return void 0===t},t.isAccessorNode=function(t){return t&&t.isAccessorNode&&t.constructor.prototype.isNode||!1},t.isArrayNode=function(t){return t&&t.isArrayNode&&t.constructor.prototype.isNode||!1},t.isAssignmentNode=function(t){return t&&t.isAssignmentNode&&t.constructor.prototype.isNode||!1},t.isBlockNode=function(t){return t&&t.isBlockNode&&t.constructor.prototype.isNode||!1},t.isConditionalNode=function(t){return t&&t.isConditionalNode&&t.constructor.prototype.isNode||!1},t.isConstantNode=function(t){return t&&t.isConstantNode&&t.constructor.prototype.isNode||!1},t.isFunctionAssignmentNode=function(t){return t&&t.isFunctionAssignmentNode&&t.constructor.prototype.isNode||!1},t.isFunctionNode=function(t){return t&&t.isFunctionNode&&t.constructor.prototype.isNode||!1},t.isIndexNode=function(t){return t&&t.isIndexNode&&t.constructor.prototype.isNode||!1},t.isNode=function(t){return t&&t.isNode&&t.constructor.prototype.isNode||!1},t.isObjectNode=function(t){return t&&t.isObjectNode&&t.constructor.prototype.isNode||!1},t.isOperatorNode=function(t){return t&&t.isOperatorNode&&t.constructor.prototype.isNode||!1},t.isParenthesisNode=function(t){return t&&t.isParenthesisNode&&t.constructor.prototype.isNode||!1},t.isRangeNode=function(t){return t&&t.isRangeNode&&t.constructor.prototype.isNode||!1},t.isSymbolNode=function(t){return t&&t.isSymbolNode&&t.constructor.prototype.isNode||!1},t.isChain=function(t){return t&&t.constructor.prototype.isChain||!1};var e=s();return e.types=[{name:"number",test:t.isNumber},{name:"Complex",test:t.isComplex},{name:"BigNumber",test:t.isBigNumber},{name:"Fraction",test:t.isFraction},{name:"Unit",test:t.isUnit},{name:"string",test:t.isString},{name:"Array",test:t.isArray},{name:"Matrix",test:t.isMatrix},{name:"DenseMatrix",test:t.isDenseMatrix},{name:"SparseMatrix",test:t.isSparseMatrix},{name:"Range",test:t.isRange},{name:"Index",test:t.isIndex},{name:"boolean",test:t.isBoolean},{name:"ResultSet",test:t.isResultSet},{name:"Help",test:t.isHelp},{name:"function",test:t.isFunction},{name:"Date",test:t.isDate},{name:"RegExp",test:t.isRegExp},{name:"Object",test:t.isObject},{name:"null",test:t.isNull},{name:"undefined",test:t.isUndefined},{name:"OperatorNode",test:t.isOperatorNode},{name:"ConstantNode",test:t.isConstantNode},{name:"SymbolNode",test:t.isSymbolNode},{name:"ParenthesisNode",test:t.isParenthesisNode},{name:"FunctionNode",test:t.isFunctionNode},{name:"FunctionAssignmentNode",test:t.isFunctionAssignmentNode},{name:"ArrayNode",test:t.isArrayNode},{name:"AssignmentNode",test:t.isAssignmentNode},{name:"BlockNode",test:t.isBlockNode},{name:"ConditionalNode",test:t.isConditionalNode},{name:"IndexNode",test:t.isIndexNode},{name:"RangeNode",test:t.isRangeNode},{name:"Node",test:t.isNode}],e.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(o(e)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t.BigNumber(e)}},{from:"number",to:"Complex",convert:function(e){return new t.Complex(e,0)}},{from:"number",to:"string",convert:function(t){return t+""}},{from:"BigNumber",to:"Complex",convert:function(e){return new t.Complex(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return new t.Complex(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){if(new t.Fraction(e).valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return new t.Fraction(e)}},{from:"string",to:"number",convert:function(t){var e=Number(t);if(isNaN(e))throw new Error('Cannot convert "'+t+'" to a number');return e}},{from:"string",to:"BigNumber",convert:function(e){try{return new t.BigNumber(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){try{return new t.Fraction(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){try{return new t.Complex(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(e){return new t.BigNumber(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return new t.Fraction(+e)}},{from:"boolean",to:"string",convert:function(t){return+t}},{from:"null",to:"number",convert:function(){return 0}},{from:"null",to:"string",convert:function(){return"null"}},{from:"null",to:"BigNumber",convert:function(){return new t.BigNumber(0)}},{from:"null",to:"Fraction",convert:function(){return new t.Fraction(0)}},{from:"Array",to:"Matrix",convert:function(e){return new t.DenseMatrix(e)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}],e}},function(t,e,r){var n,o,a;o=[],void 0===(a="function"==typeof(n=function(){return function t(){function e(t){for(var e,r=0;r<m.types.length;r++){var n=m.types[r];if(n.name===t){e=n.test;break}}if(!e){var o;for(r=0;r<m.types.length;r++)if((n=m.types[r]).name.toLowerCase()==t.toLowerCase()){o=n.name;break}throw new Error('Unknown type "'+t+'"'+(o?'. Did you mean "'+o+'"?':""))}return e}function r(t){for(var e="",r=0;r<t.length;r++){var n=t[r];if(n.signatures&&""!=n.name)if(""==e)e=n.name;else if(e!=n.name){var o=new Error("Function names do not match (expected: "+e+", actual: "+n.name+")");throw o.data={actual:n.name,expected:e},o}}return e}function n(t,e,r,n,o){var a,i=u(n),s=o?o.split(","):null,l=t||"unnamed",c=s&&d(s,"any"),f={fn:t,index:r,actual:n,expected:s};a=s?e>r&&!c?"Unexpected type of argument in function "+l+" (expected: "+s.join(" or ")+", actual: "+i+", index: "+r+")":"Too few arguments in function "+l+" (expected: "+s.join(" or ")+", index: "+r+")":"Too many arguments in function "+l+" (expected: "+r+", actual: "+e+")";var p=new TypeError(a);return p.data=f,p}function o(t){this.name=t||"refs",this.categories={}}function a(t,e){if("string"==typeof t){var r=t.trim(),n="..."===r.substr(0,3);if(n&&(r=r.substr(3)),""===r)this.types=["any"];else{this.types=r.split("|");for(var o=0;o<this.types.length;o++)this.types[o]=this.types[o].trim()}}else{if(!Array.isArray(t)){if(t instanceof a)return t.clone();throw new Error("String or Array expected")}this.types=t}this.conversions=[],this.varArgs=n||e||!1,this.anyType=-1!==this.types.indexOf("any")}function i(t,e){var r;if("string"==typeof t)r=""!==t?t.split(","):[];else{if(!Array.isArray(t))throw new Error("string or Array expected");r=t}this.params=new Array(r.length),this.anyType=!1,this.varArgs=!1;for(var n=0;n<r.length;n++){var o=new a(r[n]);if(this.params[n]=o,o.anyType&&(this.anyType=!0),n===r.length-1)this.varArgs=o.varArgs;else if(o.varArgs)throw new SyntaxError('Unexpected variable arguments operator "..."')}this.fn=e}function s(t,e,r,n){this.path=t||[],this.param=t[t.length-1]||null,this.signature=e||null,this.childs=r||[],this.fallThrough=n||!1}function l(t,e,r){var n,o,i,c=e.length,u=[];for(n=0;n<t.length;n++)(o=t[n]).params.length!==c||i||(i=o),null!=o.params[c]&&u.push(o);u.sort((function(t,e){return a.compare(t.params[c],e.params[c])}));var f=[];for(n=0;n<u.length;n++){var p=(o=u[n]).params[c],_=f.filter((function(t){return t.param.overlapping(p)}))[0];if(_){if(_.param.varArgs)throw new Error('Conflicting types "'+_.param+'" and "'+p+'"');_.signatures.push(o)}else f.push({param:p,signatures:[o]})}var h=[];for(n=0;n<r.length;n++)r[n].paramsStartWith(e)&&h.push(r[n]);var v=!1;for(n=0;n<h.length;n++)if(!d(t,h[n])){v=!0;break}var m=new Array(f.length);for(n=0;n<f.length;n++){var g=f[n];m[n]=l(g.signatures,e.concat(g.param),h)}return new s(e,i,m,v)}function c(t,e){var r=new o,a=function(t){var e,r,n={},o=[];for(var a in t)if(t.hasOwnProperty(a)){if((e=new i(a,t[a])).ignore())continue;var s=e.expand();for(r=0;r<s.length;r++){var l=s[r],c=l.toString(),u=n[c];if(u){var f=i.compare(l,u);if(f<0)n[c]=l;else if(0===f)throw new Error('Signature "'+c+'" is defined twice')}else n[c]=l}}for(c in n)n.hasOwnProperty(c)&&o.push(n[c]);for(o.sort((function(t,e){return i.compare(t,e)})),r=0;r<o.length;r++)if((e=o[r]).varArgs)for(var p=e.params.length-1,_=e.params[p],h=0;h<_.types.length;){if(_.conversions[h])for(var v=_.types[h],m=0;m<o.length;m++){var g=o[m],y=g.params[p];if(g!==e&&y&&d(y.types,v)&&!y.conversions[p]){_.types.splice(h,1),_.conversions.splice(h,1),h--;break}}h++}return o}(e);if(0==a.length)throw new Error("No signatures provided");var s=l(a,[],function(t){for(var e=[],r=0;r<t.length;r++)t[r].anyType&&e.push(t[r]);return e}(a)),c=[],u=(t||"").replace(/[^a-zA-Z0-9_$]/g,"_"),f=function(t){for(var e=[],r=0;r<t;r++)e[r]="arg"+r;return e}(function(t){for(var e=0,r=0;r<t.length;r++){var n=t[r].params.length;n>e&&(e=n)}return e}(a));c.push("function "+u+"("+f.join(", ")+") {"),c.push(' "use strict";'),c.push(" var name = "+JSON.stringify(t||"")+";"),c.push(s.toCode(r," ",!1)),c.push("}");var p=[r.toCode(),"return "+c.join("\n")].join("\n"),_=new Function(r.name,"createError",p)(r,n);return _.signatures=function(t){for(var e={},r=0;r<t.length;r++){var n=t[r];n.fn&&!n.hasConversions()&&(e[n.params.join(",")]=n.fn)}return e}(a),_}function u(t){for(var e,r=0;r<m.types.length;r++){var n=m.types[r];if("Object"===n.name)e=n;else if(n.test(t))return n.name}return e&&e.test(t)?e.name:"unknown"}function d(t,e){return-1!==t.indexOf(e)}function f(t){return t[t.length-1]}o.prototype.add=function(t,e){var r=e||"fn";this.categories[r]||(this.categories[r]=[]);var n=this.categories[r].indexOf(t);return-1==n&&(n=this.categories[r].length,this.categories[r].push(t)),r+n},o.prototype.toCode=function(){var t=[],e=this.name+".categories",r=this.categories;for(var n in r)if(r.hasOwnProperty(n))for(var o=r[n],a=0;a<o.length;a++)t.push("var "+n+a+" = "+e+"['"+n+"']["+a+"];");return t.join("\n")},a.compare=function(t,e){if(t.anyType)return 1;if(e.anyType)return-1;if(d(t.types,"Object"))return 1;if(d(e.types,"Object"))return-1;if(t.hasConversions()){if(e.hasConversions()){var r,n,o;for(r=0;r<t.conversions.length;r++)if(void 0!==t.conversions[r]){n=t.conversions[r];break}for(r=0;r<e.conversions.length;r++)if(void 0!==e.conversions[r]){o=e.conversions[r];break}return m.conversions.indexOf(n)-m.conversions.indexOf(o)}return 1}if(e.hasConversions())return-1;var a,i;for(r=0;r<m.types.length;r++)if(m.types[r].name===t.types[0]){a=r;break}for(r=0;r<m.types.length;r++)if(m.types[r].name===e.types[0]){i=r;break}return a-i},a.prototype.overlapping=function(t){for(var e=0;e<this.types.length;e++)if(d(t.types,this.types[e]))return!0;return!1},a.prototype.matches=function(t){return this.anyType||t.anyType||this.overlapping(t)},a.prototype.clone=function(){var t=new a(this.types.slice(),this.varArgs);return t.conversions=this.conversions.slice(),t},a.prototype.hasConversions=function(){return this.conversions.length>0},a.prototype.contains=function(t){for(var e=0;e<this.types.length;e++)if(t[this.types[e]])return!0;return!1},a.prototype.toString=function(t){for(var e=[],r={},n=0;n<this.types.length;n++){var o=this.conversions[n],a=t&&o?o.to:this.types[n];a in r||(r[a]=!0,e.push(a))}return(this.varArgs?"...":"")+e.join("|")},i.prototype.clone=function(){return new i(this.params.slice(),this.fn)},i.prototype.expand=function(){var t=[];return function e(r,n){if(n.length<r.params.length){var o,s,l,c=r.params[n.length];if(c.varArgs){for(s=c.clone(),o=0;o<m.conversions.length;o++)if(l=m.conversions[o],!d(c.types,l.from)&&d(c.types,l.to)){var u=s.types.length;s.types[u]=l.from,s.conversions[u]=l}e(r,n.concat(s))}else{for(o=0;o<c.types.length;o++)e(r,n.concat(new a(c.types[o])));for(o=0;o<m.conversions.length;o++)l=m.conversions[o],!d(c.types,l.from)&&d(c.types,l.to)&&((s=new a(l.from)).conversions[0]=l,e(r,n.concat(s)))}}else t.push(new i(n,r.fn))}(this,[]),t},i.compare=function(t,e){if(t.params.length>e.params.length)return 1;if(t.params.length<e.params.length)return-1;var r,n=t.params.length,o=0,i=0;for(r=0;r<n;r++)t.params[r].hasConversions()&&o++,e.params[r].hasConversions()&&i++;if(o>i)return 1;if(o<i)return-1;for(r=0;r<t.params.length;r++){var s=a.compare(t.params[r],e.params[r]);if(0!==s)return s}return 0},i.prototype.hasConversions=function(){for(var t=0;t<this.params.length;t++)if(this.params[t].hasConversions())return!0;return!1},i.prototype.ignore=function(){for(var t={},e=0;e<m.ignore.length;e++)t[m.ignore[e]]=!0;for(e=0;e<this.params.length;e++)if(this.params[e].contains(t))return!0;return!1},i.prototype.paramsStartWith=function(t){if(0===t.length)return!0;for(var e=f(this.params),r=f(t),n=0;n<t.length;n++){var o=this.params[n]||(e.varArgs?e:null),a=t[n]||(r.varArgs?r:null);if(!o||!a||!o.matches(a))return!1}return!0},i.prototype.toCode=function(t,e){for(var r=new Array(this.params.length),n=0;n<this.params.length;n++){var o=this.params[n],a=o.conversions[0];o.varArgs?r[n]="varArgs":r[n]=a?t.add(a.convert,"convert")+"(arg"+n+")":"arg"+n}var i=this.fn?t.add(this.fn,"signature"):void 0;return i?e+"return "+i+"("+r.join(", ")+"); // signature: "+this.params.join(", "):[].join("\n")},i.prototype.toString=function(){return this.params.join(", ")},s.prototype.toCode=function(t,r){var n=[];if(this.param){var o=this.path.length-1,a=this.param.conversions[0],i="// type: "+(a?a.from+" (convert to "+a.to+")":this.param);if(this.param.varArgs)if(this.param.anyType)n.push(r+"if (arguments.length > "+o+") {"),n.push(r+" var varArgs = [];"),n.push(r+" for (var i = "+o+"; i < arguments.length; i++) {"),n.push(r+" varArgs.push(arguments[i]);"),n.push(r+" }"),n.push(this.signature.toCode(t,r+" ")),n.push(r+"}");else{for(var s=function(r,n){for(var o=[],a=0;a<r.length;a++)o[a]=t.add(e(r[a]),"test")+"("+n+")";return o.join(" || ")}.bind(this),l=this.param.types,c=[],u=0;u<l.length;u++)void 0===this.param.conversions[u]&&c.push(l[u]);for(n.push(r+"if ("+s(l,"arg"+o)+") { "+i),n.push(r+" var varArgs = [arg"+o+"];"),n.push(r+" for (var i = "+(o+1)+"; i < arguments.length; i++) {"),n.push(r+" if ("+s(c,"arguments[i]")+") {"),n.push(r+" varArgs.push(arguments[i]);"),u=0;u<l.length;u++){var d=this.param.conversions[u];if(d){var f=t.add(e(l[u]),"test"),p=t.add(d.convert,"convert");n.push(r+" }"),n.push(r+" else if ("+f+"(arguments[i])) {"),n.push(r+" varArgs.push("+p+"(arguments[i]));")}}n.push(r+" } else {"),n.push(r+" throw createError(name, arguments.length, i, arguments[i], '"+c.join(",")+"');"),n.push(r+" }"),n.push(r+" }"),n.push(this.signature.toCode(t,r+" ")),n.push(r+"}")}else if(this.param.anyType)n.push(r+"// type: any"),n.push(this._innerCode(t,r));else{var _=this.param.types[0];f="any"!==_?t.add(e(_),"test"):null,n.push(r+"if ("+f+"(arg"+o+")) { "+i),n.push(this._innerCode(t,r+" ")),n.push(r+"}")}}else n.push(this._innerCode(t,r));return n.join("\n")},s.prototype._innerCode=function(t,e){var r,n=[];for(this.signature&&(n.push(e+"if (arguments.length === "+this.path.length+") {"),n.push(this.signature.toCode(t,e+" ")),n.push(e+"}")),r=0;r<this.childs.length;r++)n.push(this.childs[r].toCode(t,e));if(!this.fallThrough||this.param&&this.param.anyType){var o=this._exceptions(t,e);o&&n.push(o)}return n.join("\n")},s.prototype._exceptions=function(t,e){var r=this.path.length;if(0===this.childs.length)return[e+"if (arguments.length > "+r+") {",e+" throw createError(name, arguments.length, "+r+", arguments["+r+"]);",e+"}"].join("\n");for(var n={},o=[],a=0;a<this.childs.length;a++){var i=this.childs[a];if(i.param)for(var s=0;s<i.param.types.length;s++){var l=i.param.types[s];l in n||i.param.conversions[s]||(n[l]=!0,o.push(l))}}return e+"throw createError(name, arguments.length, "+r+", arguments["+r+"], '"+o.join(",")+"');"};var p=[{name:"number",test:function(t){return"number"==typeof t}},{name:"string",test:function(t){return"string"==typeof t}},{name:"boolean",test:function(t){return"boolean"==typeof t}},{name:"Function",test:function(t){return"function"==typeof t}},{name:"Array",test:Array.isArray},{name:"Date",test:function(t){return t instanceof Date}},{name:"RegExp",test:function(t){return t instanceof RegExp}},{name:"Object",test:function(t){return"object"==typeof t}},{name:"null",test:function(t){return null===t}},{name:"undefined",test:function(t){return void 0===t}}],_={},h=[],v=[],m={config:_,types:p,conversions:h,ignore:v};return(m=c("typed",{Object:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(t[n]);return c(r(e),t)},"string, Object":c,"...Function":function(t){for(var e,n=r(t),o={},a=0;a<t.length;a++){var i=t[a];if("object"!=typeof i.signatures)throw(e=new TypeError("Function is no typed-function (index: "+a+")")).data={index:a},e;for(var s in i.signatures)if(i.signatures.hasOwnProperty(s))if(o.hasOwnProperty(s)){if(i.signatures[s]!==o[s])throw(e=new Error('Signature "'+s+'" is defined twice')).data={signature:s},e}else o[s]=i.signatures[s]}return c(n,o)}})).config=_,m.types=p,m.conversions=h,m.ignore=v,m.create=t,m.find=function(t,e){if(!t.signatures)throw new TypeError("Function is no typed-function");var r;if("string"==typeof e){r=e.split(",");for(var n=0;n<r.length;n++)r[n]=r[n].trim()}else{if(!Array.isArray(e))throw new TypeError("String array or a comma separated string expected");r=e}var o=r.join(","),a=t.signatures[o];if(a)return a;throw new TypeError("Signature not found (signature: "+(t.name||"unnamed")+"("+r.join(", ")+"))")},m.convert=function(t,e){var r=u(t);if(e===r)return t;for(var n=0;n<m.conversions.length;n++){var o=m.conversions[n];if(o.from===r&&o.to===e)return o.convert(t)}throw new Error("Cannot convert from "+r+" to "+e)},m.addType=function(t){if(!t||"string"!=typeof t.name||"function"!=typeof t.test)throw new TypeError("Object with properties {name: string, test: function} expected");m.types.push(t)},m.addConversion=function(t){if(!t||"string"!=typeof t.from||"string"!=typeof t.to||"function"!=typeof t.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");m.conversions.push(t)},m}()})?n.apply(e,o):n)||(t.exports=a)},function(t,e){"use strict";function r(t){for(var e=[],r=0;r<t;r++)e.push(0);return e}e.isNumber=function(t){return"number"==typeof t},e.isInteger=function(t){return!!isFinite(t)&&t==Math.round(t)},e.sign=Math.sign||function(t){return t>0?1:t<0?-1:0},e.format=function(t,r){if("function"==typeof r)return r(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var n="auto",o=void 0;switch(r&&(r.notation&&(n=r.notation),e.isNumber(r)?o=r:r.precision&&(o=r.precision)),n){case"fixed":return e.toFixed(t,o);case"exponential":return e.toExponential(t,o);case"engineering":return e.toEngineering(t,o);case"auto":return e.toPrecision(t,o,r&&r.exponential).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],e=arguments[4];return"."!==t?t+e:e}));default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", or "fixed".')}},e.splitNumber=function(t){var e=String(t).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var r=e[1],n=e[2],o=parseFloat(e[4]||"0"),a=n.indexOf(".");o+=-1!==a?a-1:n.length-1;var i=n.replace(".","").replace(/^0*/,(function(t){return o-=t.length,""})).replace(/0*$/,"").split("").map((function(t){return parseInt(t)}));return 0===i.length&&(i.push(0),o++),{sign:r,coefficients:i,exponent:o}},e.toEngineering=function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var o=e.roundDigits(e.splitNumber(t),n),a=o.exponent,i=o.coefficients,s=a%3==0?a:a<0?a-3-a%3:a-a%3,l=a>=0?a:Math.abs(s);i.length-1<l&&(i=i.concat(r(l-(i.length-1))));for(var c=Math.abs(a-s),u=1;--c>=0;)u++;var d=i.slice(u).join(""),f=d.match(/[1-9]/)?"."+d:"",p=i.slice(0,u).join("")+f+"e"+(a>=0?"+":"")+s.toString();return o.sign+p},e.toFixed=function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var o=e.splitNumber(t),a=e.roundDigits(o,o.exponent+1+(n||0)),i=a.coefficients,s=a.exponent+1,l=s+(n||0);return i.length<l&&(i=i.concat(r(l-i.length))),s<0&&(i=r(1-s).concat(i),s=1),n&&i.splice(s,0,0===s?"0.":"."),a.sign+i.join("")},e.toExponential=function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var o=e.splitNumber(t),a=n?e.roundDigits(o,n):o,i=a.coefficients,s=a.exponent;i.length<n&&(i=i.concat(r(n-i.length)));var l=i.shift();return a.sign+l+(i.length>0?"."+i.join(""):"")+"e"+(s>=0?"+":"")+s},e.toPrecision=function(t,n,o){if(isNaN(t)||!isFinite(t))return String(t);var a=o&&void 0!==o.lower?o.lower:.001,i=o&&void 0!==o.upper?o.upper:1e5,s=e.splitNumber(t),l=Math.abs(Math.pow(10,s.exponent));if(l<a||l>=i)return e.toExponential(t,n);var c=n?e.roundDigits(s,n):s,u=c.coefficients,d=c.exponent;u.length<n&&(u=u.concat(r(n-u.length))),u=u.concat(r(d-u.length+1+(u.length<n?n-u.length:0)));var f=d>0?d:0;return f<(u=r(-d).concat(u)).length-1&&u.splice(f+1,0,"."),c.sign+u.join("")},e.roundDigits=function(t,e){for(var r={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},n=r.coefficients;e<=0;)n.unshift(0),r.exponent++,e++;if(n.length>e&&n.splice(e,n.length-e)[0]>=5){var o=e-1;for(n[o]++;10===n[o];)n.pop(),0===o&&(n.unshift(0),r.exponent++,o++),n[--o]++}return r},e.digits=function(t){return t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length},e.DBL_EPSILON=Number.EPSILON||2220446049250313e-31,e.nearlyEqual=function(t,r,n){if(null==n)return t==r;if(t==r)return!0;if(isNaN(t)||isNaN(r))return!1;if(isFinite(t)&&isFinite(r)){var o=Math.abs(t-r);return o<e.DBL_EPSILON||o<=Math.max(Math.abs(t),Math.abs(r))*n}return!1}},function(t,e){"use strict";t.exports=function(t){return t&&t.constructor.prototype.isMatrix||!1}},function(t,e,r){var n=r(22);e.mixin=function(t){var e=new n;return t.on=e.on.bind(e),t.off=e.off.bind(e),t.once=e.once.bind(e),t.emit=e.emit.bind(e),t}},function(t,e){function r(){}r.prototype={on:function(t,e,r){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:r}),this},once:function(t,e,r){var n=this;function o(){n.off(t,o),e.apply(r,arguments)}return o._=e,this.on(t,o,r)},emit:function(t){for(var e=[].slice.call(arguments,1),r=((this.e||(this.e={}))[t]||[]).slice(),n=0,o=r.length;n<o;n++)r[n].fn.apply(r[n].ctx,e);return this},off:function(t,e){var r=this.e||(this.e={}),n=r[t],o=[];if(n&&e)for(var a=0,i=n.length;a<i;a++)n[a].fn!==e&&n[a].fn._!==e&&o.push(n[a]);return o.length?r[t]=o:delete r[t],this}},t.exports=r},function(t,e,r){"use strict";var n=r(15).lazy,o=r(15).isFactory,a=r(15).traverse,i=r(24);e.math=!0,e.name="import",e.factory=function(t,e,r,s,l){function c(t,e,r){if(r.wrap&&"function"==typeof e&&(e=function(t){var e=function(){for(var e=[],r=0,n=arguments.length;r<n;r++){var o=arguments[r];e[r]=o&&o.valueOf()}return t.apply(l,e)};t.transform&&(e.transform=t.transform);return e}(e)),p(l[t])&&p(e))return e=r.override?s(t,e.signatures):s(l[t],e),l[t]=e,u(t,e),void l.emit("import",t,(function(){return e}));if(void 0===l[t]||r.override)return l[t]=e,u(t,e),void l.emit("import",t,(function(){return e}));if(!r.silent)throw new Error('Cannot import "'+t+'": already exists')}function u(t,e){e&&"function"==typeof e.transform?(l.expression.transform[t]=e.transform,_(t)&&(l.expression.mathWithTransform[t]=e.transform)):(delete l.expression.transform[t],_(t)&&(l.expression.mathWithTransform[t]=e))}function d(t,e){if("string"==typeof t.name){var o=t.name,i=o in l.expression.transform,c=t.path?a(l,t.path):l,u=c.hasOwnProperty(o)?c[o]:void 0,d=function(){var n=r(t);if(n&&"function"==typeof n.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(p(u)&&p(n))return e.override||(n=s(u,n)),n;if(void 0===u||e.override)return n;if(!e.silent)throw new Error('Cannot import "'+o+'": already exists')};!1!==t.lazy?(n(c,o,d),i||("expression.transform"===t.path||h(t))&&n(l.expression.mathWithTransform,o,d)):(c[o]=d(),i||("expression.transform"===t.path||h(t))&&(l.expression.mathWithTransform[o]=d())),l.emit("import",o,d,t.path)}else r(t)}function f(e){return"function"==typeof e||"number"==typeof e||"string"==typeof e||"boolean"==typeof e||null===e||e&&t.isUnit(e)||e&&t.isComplex(e)||e&&t.isBigNumber(e)||e&&t.isFraction(e)||e&&t.isMatrix(e)||e&&Array.isArray(e)}function p(t){return"function"==typeof t&&"object"==typeof t.signatures}function _(t){return!v.hasOwnProperty(t)}function h(t){return void 0===t.path&&!v.hasOwnProperty(t.name)}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function t(e,r){var n=arguments.length;if(1!==n&&2!==n)throw new i("import",n,1,2);if(r||(r={}),o(e))d(e,r);else if(Array.isArray(e))e.forEach((function(e){t(e,r)}));else if("object"==typeof e){for(var a in e)if(e.hasOwnProperty(a)){var s=e[a];f(s)?c(a,s,r):o(e)?d(e,r):t(s,r)}}else if(!r.silent)throw new TypeError("Factory, Object, or Array expected")}},e.lazy=!0},function(t,e){"use strict";function r(t,e,n,o){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.fn=t,this.count=e,this.min=n,this.max=o,this.message="Wrong number of arguments in function "+t+" ("+e+" provided, "+n+(null!=o?"-"+o:"")+" expected)",this.stack=(new Error).stack}r.prototype=new Error,r.prototype.constructor=Error,r.prototype.name="ArgumentsError",r.prototype.isArgumentsError=!0,t.exports=r},function(t,e,r){"use strict";var n=r(15);function o(t,e,r){if(void 0!==t[e]&&(o=r,a=t[e],-1===o.indexOf(a))){var n=function(t,e){return t.map((function(t){return t.toLowerCase()})).indexOf(e.toLowerCase())}(r,t[e]);-1!==n?(console.warn('Warning: Wrong casing for configuration option "'+e+'", should be "'+r[n]+'" instead of "'+t[e]+'".'),t[e]=r[n]):console.warn('Warning: Unknown value "'+t[e]+'" for configuration option "'+e+'". Available options: '+r.map(JSON.stringify).join(", ")+".")}var o,a}e.name="config",e.math=!0,e.factory=function(t,e,r,a,i){var s=["Matrix","Array"],l=["number","BigNumber","Fraction"];function c(t){if(t){var r=n.map(e,n.clone);o(t,"matrix",s),o(t,"number",l),n.deepExtend(e,t);var a=n.map(e,n.clone),c=n.map(t,n.clone);return i.emit("config",a,r,c),a}return n.map(e,n.clone)}return c.MATRIX=s,c.NUMBER=l,c}},function(t,e,r){t.exports=[r(27),r(37),r(39),r(42),r(52),r(58),r(59),r(60),r(61),r(44),r(62)]},function(t,e,r){"use strict";var n=r(28).string.isString;e.name="Matrix",e.path="type",e.factory=function(t,e,r,o){function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator")}return a.prototype.type="Matrix",a.prototype.isMatrix=!0,a.storage=function(t){if(!n(t))throw new TypeError("format must be a string value");var e=a._storage[t];if(!e)throw new SyntaxError("Unsupported matrix storage format: "+t);return e},a._storage={},a.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},a.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},a.prototype.create=function(t,e){throw new Error("Cannot invoke create on a Matrix interface")},a.prototype.subset=function(t,e,r){throw new Error("Cannot invoke subset on a Matrix interface")},a.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},a.prototype.set=function(t,e,r){throw new Error("Cannot invoke set on a Matrix interface")},a.prototype.resize=function(t,e){throw new Error("Cannot invoke resize on a Matrix interface")},a.prototype.reshape=function(t,e){throw new Error("Cannot invoke reshape on a Matrix interface")},a.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},a.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},a.prototype.map=function(t,e){throw new Error("Cannot invoke map on a Matrix interface")},a.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},a.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},a.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},a.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},a.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},a}},function(t,e,r){"use strict";e.array=r(29),e.boolean=r(35),e.function=r(36),e.number=r(19),e.object=r(15),e.string=r(30),e.types=r(32),e.emitter=r(21)},function(t,e,r){"use strict";var n=r(19),o=r(30),a=(r(15),r(32),r(33)),i=r(34);function s(t,e,r){var n,o=t.length;if(o!=e[r])throw new a(o,e[r]);if(r<e.length-1){var i=r+1;for(n=0;n<o;n++){var l=t[n];if(!Array.isArray(l))throw new a(e.length-1,e.length,"<");s(t[n],e,i)}}else for(n=0;n<o;n++)if(Array.isArray(t[n]))throw new a(e.length+1,e.length,">")}function l(t,r,n,o){var a,i,s=t.length,c=r[n],u=Math.min(s,c);if(t.length=c,n<r.length-1){var d=n+1;for(a=0;a<u;a++)i=t[a],Array.isArray(i)||(i=[i],t[a]=i),l(i,r,d,o);for(a=u;a<c;a++)i=[],t[a]=i,l(i,r,d,o)}else{for(a=0;a<u;a++)for(;Array.isArray(t[a]);)t[a]=t[a][0];if(o!==e.UNINITIALIZED)for(a=u;a<c;a++)t[a]=o}}function c(t,e){var r,n=[];if(0===e.length){if(0===t.length)throw new a(null,null,"!=");return t.shift()}for(r=0;r<e[0];r+=1)n.push(c(t,e.slice(1)));return n}function u(t,e,r){var n,o;if(r<e){var a=r+1;for(n=0,o=t.length;n<o;n++)t[n]=u(t[n],e,a)}else for(;Array.isArray(t);)t=t[0];return t}function d(t,e,r){var n,o;if(Array.isArray(t)){var a=r+1;for(n=0,o=t.length;n<o;n++)t[n]=d(t[n],e,a)}else for(var i=r;i<e;i++)t=[t];return t}e.size=function(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e},e.validate=function(t,e){if(0==e.length){if(Array.isArray(t))throw new a(t.length,0)}else s(t,e,0)},e.validateIndex=function(t,e){if(!n.isNumber(t)||!n.isInteger(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||"number"==typeof e&&t>=e)throw new i(t,e)},e.UNINITIALIZED={},e.resize=function(t,e,r){if(!Array.isArray(t)||!Array.isArray(e))throw new TypeError("Array expected");if(0===e.length)throw new Error("Resizing to scalar is not supported");return e.forEach((function(t){if(!n.isNumber(t)||!n.isInteger(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+o.format(e)+")")})),l(t,e,0,void 0!==r?r:0),t},e.reshape=function(t,r){var n,o=e.flatten(t),i=function(t){return t.reduce((function(t,e){return t*e}))};if(!Array.isArray(t)||!Array.isArray(r))throw new TypeError("Array expected");if(0===r.length)throw new a(0,i(e.size(t)),"!=");try{n=c(o,r)}catch(n){if(n instanceof a)throw new a(i(r),i(e.size(t)),"!=");throw n}if(o.length>0)throw new a(i(r),i(e.size(t)),"!=");return n},e.squeeze=function(t,r){for(var n=r||e.size(t);Array.isArray(t)&&1===t.length;)t=t[0],n.shift();for(var o=n.length;1===n[o-1];)o--;return o<n.length&&(t=u(t,o,0),n.length=o),t},e.unsqueeze=function(t,r,n,o){var a=o||e.size(t);if(n)for(var i=0;i<n;i++)t=[t],a.unshift(1);for(t=d(t,r,0);a.length<r;)a.push(1);return t},e.flatten=function(t){if(!Array.isArray(t))return t;var e=[];return t.forEach((function t(r){Array.isArray(r)?r.forEach(t):e.push(r)})),e},e.map=function(t,e){return Array.prototype.map.call(t,e)},e.forEach=function(t,e){Array.prototype.forEach.call(t,e)},e.filter=function(t,r){if(1!==e.size(t).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(t,r)},e.filterRegExp=function(t,r){if(1!==e.size(t).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(t,(function(t){return r.test(t)}))},e.join=function(t,e){return Array.prototype.join.call(t,e)},e.identify=function(t){if(!Array.isArray(t))throw new TypeError("Array input expected");if(0===t.length)return t;var e=[],r=0;e[0]={value:t[0],identifier:0};for(var n=1;n<t.length;n++)t[n]===t[n-1]?r++:r=0,e.push({value:t[n],identifier:r});return e},e.generalize=function(t){if(!Array.isArray(t))throw new TypeError("Array input expected");if(0===t.length)return t;for(var e=[],r=0;r<t.length;r++)e.push(t[r].value);return e},e.isArray=Array.isArray},function(t,e,r){"use strict";var n=r(19).format,o=r(31).format,a=r(16);function i(t,r){if(Array.isArray(t)){for(var n="[",o=t.length,a=0;a<o;a++)0!=a&&(n+=", "),n+=i(t[a],r);return n+="]"}return e.format(t,r)}e.isString=function(t){return"string"==typeof t},e.endsWith=function(t,e){var r=t.length-e.length,n=t.length;return t.substring(r,n)===e},e.format=function(t,r){if("number"==typeof t)return n(t,r);if(a(t))return o(t,r);if(function(t){return t&&"object"==typeof t&&"number"==typeof t.s&&"number"==typeof t.n&&"number"==typeof t.d||!1}(t))return r&&"decimal"===r.fraction?t.toString():t.s*t.n+"/"+t.d;if(Array.isArray(t))return i(t,r);if(e.isString(t))return'"'+t+'"';if("function"==typeof t)return t.syntax?String(t.syntax):"function";if(t&&"object"==typeof t){if("function"==typeof t.format)return t.format(r);if(t&&t.toString()!=={}.toString())return t.toString();var s=[];for(var l in t)t.hasOwnProperty(l)&&s.push('"'+l+'": '+e.format(t[l],r));return"{"+s.join(", ")+"}"}return String(t)},e.stringify=function(t){for(var e=String(t),r="",n=0;n<e.length;){var o=e.charAt(n);"\\"===o?(r+=o,n++,""!==(o=e.charAt(n))&&-1!=='"\\/bfnrtu'.indexOf(o)||(r+="\\"),r+=o):r+='"'===o?'\\"':o,n++}return'"'+r+'"'},e.escape=function(t){var e=String(t);return e=e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}},function(t,e){e.format=function(t,r){if("function"==typeof r)return r(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var n="auto",o=void 0;switch(void 0!==r&&(r.notation&&(n=r.notation),"number"==typeof r?o=r:r.precision&&(o=r.precision)),n){case"fixed":return e.toFixed(t,o);case"exponential":return e.toExponential(t,o);case"auto":var a=.001,i=1e5;r&&r.exponential&&(void 0!==r.exponential.lower&&(a=r.exponential.lower),void 0!==r.exponential.upper&&(i=r.exponential.upper));t.constructor.toExpNeg,t.constructor.toExpPos;if(t.constructor.config({toExpNeg:Math.round(Math.log(a)/Math.LN10),toExpPos:Math.round(Math.log(i)/Math.LN10)}),t.isZero())return"0";var s=t.abs();return(s.gte(a)&&s.lt(i)?t.toSignificantDigits(o).toFixed():e.toExponential(t,o)).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],e=arguments[4];return"."!==t?t+e:e}));default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", or "fixed".')}},e.toExponential=function(t,e){return void 0!==e?t.toExponential(e-1):t.toExponential()},e.toFixed=function(t,e){return t.toFixed(e||0)}},function(t,e){"use strict";e.type=function(t){var e=typeof t;return"object"===e?null===t?"null":Array.isArray(t)?"Array":t instanceof Date?"Date":t instanceof RegExp?"RegExp":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":"Object":"function"===e?"Function":e}},function(t,e){"use strict";function r(t,e,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=e,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=(new Error).stack}r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="DimensionError",r.prototype.isDimensionError=!0,t.exports=r},function(t,e){"use strict";function r(t,e,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}r.prototype=new RangeError,r.prototype.constructor=RangeError,r.prototype.name="IndexError",r.prototype.isIndexError=!0,t.exports=r},function(t,e){"use strict";e.isBoolean=function(t){return"boolean"==typeof t}},function(t,e){e.memoize=function(t,e){return function r(){"object"!=typeof r.cache&&(r.cache={});for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=e?e(n):JSON.stringify(n);return a in r.cache?r.cache[a]:r.cache[a]=t.apply(t,n)}},e.maxArgumentCount=function(t){return Object.keys(t.signatures||{}).reduce((function(t,e){var r=(e.match(/,/g)||[]).length+1;return Math.max(t,r)}),-1)},e.callWithRightArgumentCount=function(t,e,r){return Object.keys(t.signatures||{}).reduce((function(t,e){var r=(e.match(/,/g)||[]).length+1;return Math.max(t,r)}),-1)}},function(t,e,r){"use strict";var n=r(28),o=r(33),a=(r(38).getSafeProperty,r(38).setSafeProperty,n.string),i=n.array,s=n.object,l=n.number,c=Array.isArray,u=l.isNumber,d=l.isInteger,f=a.isString,p=i.validateIndex;e.name="DenseMatrix",e.path="type",e.factory=function(t,e,l,_){var h=l(r(27));function v(e,r){if(!(this instanceof v))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!f(r))throw new Error("Invalid datatype: "+r);if(t.isMatrix(e))"DenseMatrix"===e.type?(this._data=s.clone(e._data),this._size=s.clone(e._size),this._datatype=r||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=r||e._datatype);else if(e&&c(e.data)&&c(e.size))this._data=e.data,this._size=e.size,this._datatype=r||e.datatype;else if(c(e))this._data=z(e),this._size=i.size(this._data),i.validate(this._data,this._size),this._datatype=r;else{if(e)throw new TypeError("Unsupported type of data ("+n.types.type(e)+")");this._data=[],this._size=[0],this._datatype=r}}function m(e,r){if(!t.isIndex(r))throw new TypeError("Invalid index");if(r.isScalar())return e.get(r.min());var n=r.size();if(n.length!=e._size.length)throw new o(n.length,e._size.length);for(var a=r.min(),i=r.max(),s=0,l=e._size.length;s<l;s++)p(a[s],e._size[s]),p(i[s],e._size[s]);return new v(g(e._data,r,n.length,0),e._datatype)}function g(t,e,r,n){var o=n===r-1,a=e.dimension(n);return o?a.map((function(e){return p(e,t.length),t[e]})).valueOf():a.map((function(o){return p(o,t.length),g(t[o],e,r,n+1)})).valueOf()}function y(e,r,n,a){if(!r||!0!==r.isIndex)throw new TypeError("Invalid index");var l,c=r.size(),u=r.isScalar();if(t.isMatrix(n)?(l=n.size(),n=n.valueOf()):l=i.size(n),u){if(0!==l.length)throw new TypeError("Scalar expected");e.set(r.min(),n,a)}else{if(c.length<e._size.length)throw new o(c.length,e._size.length,"<");if(l.length<c.length){for(var d=0,f=0;1===c[d]&&1===l[d];)d++;for(;1===c[d];)f++,d++;n=i.unsqueeze(n,c.length,f,l)}if(!s.deepEqual(c,l))throw new o(c,l,">");b(e,r.max().map((function(t){return t+1})),a);var p=c.length;w(e._data,r,n,p,0)}return e}function w(t,e,r,n,o){var a=o===n-1,i=e.dimension(o);a?i.forEach((function(e,n){p(e),t[e]=r[n[0]]})):i.forEach((function(a,i){p(a),w(t[a],e,r[i[0]],n,o+1)}))}v.prototype=new h,v.prototype.type="DenseMatrix",v.prototype.isDenseMatrix=!0,v.prototype.storage=function(){return"dense"},v.prototype.datatype=function(){return this._datatype},v.prototype.create=function(t,e){return new v(t,e)},v.prototype.subset=function(t,e,r){switch(arguments.length){case 1:return m(this,t);case 2:case 3:return y(this,t,e,r);default:throw new SyntaxError("Wrong number of arguments")}},v.prototype.get=function(t){if(!c(t))throw new TypeError("Array expected");if(t.length!=this._size.length)throw new o(t.length,this._size.length);for(var e=0;e<t.length;e++)p(t[e],this._size[e]);for(var r=this._data,n=0,a=t.length;n<a;n++){var i=t[n];p(i,r.length),r=r[i]}return r},v.prototype.set=function(t,e,r){if(!c(t))throw new TypeError("Array expected");if(t.length<this._size.length)throw new o(t.length,this._size.length,"<");var n,a,i;b(this,t.map((function(t){return t+1})),r);var s=this._data;for(n=0,a=t.length-1;n<a;n++)i=t[n],p(i,s.length),s=s[i];return i=t[t.length-1],p(i,s.length),s[i]=e,this},v.prototype.resize=function(t,e,r){if(!c(t))throw new TypeError("Array expected");var n=r?this.clone():this;return x(n,t,e)};var x=function(t,e,r){if(0===e.length){for(var n=t._data;c(n);)n=n[0];return n}return t._size=e.slice(0),t._data=i.resize(t._data,t._size,r),t};function b(t,e,r){for(var n=t._size.slice(0),o=!1;n.length<e.length;)n.push(0),o=!0;for(var a=0,i=e.length;a<i;a++)e[a]>n[a]&&(n[a]=e[a],o=!0);o&&x(t,n,r)}function z(t){for(var e=0,r=t.length;e<r;e++){var n=t[e];c(n)?t[e]=z(n):n&&!0===n.isMatrix&&(t[e]=z(n.valueOf()))}return t}return v.prototype.reshape=function(t,e){var r=e?this.clone():this;return r._data=i.reshape(r._data,t),r._size=t.slice(0),r},v.prototype.clone=function(){return new v({data:s.clone(this._data),size:s.clone(this._size),datatype:this._datatype})},v.prototype.size=function(){return this._size.slice(0)},v.prototype.map=function(t){var e=this,r=function(n,o){return c(n)?n.map((function(t,e){return r(t,o.concat(e))})):t(n,o,e)};return new v({data:r(this._data,[]),size:s.clone(this._size),datatype:this._datatype})},v.prototype.forEach=function(t){var e=this,r=function(n,o){c(n)?n.forEach((function(t,e){r(t,o.concat(e))})):t(n,o,e)};r(this._data,[])},v.prototype.toArray=function(){return s.clone(this._data)},v.prototype.valueOf=function(){return this._data},v.prototype.format=function(t){return a.format(this._data,t)},v.prototype.toString=function(){return a.format(this._data)},v.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},v.prototype.diagonal=function(e){if(e){if(t.isBigNumber(e)&&(e=e.toNumber()),!u(e)||!d(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var r=e>0?e:0,n=e<0?-e:0,o=this._size[0],a=this._size[1],i=Math.min(o-n,a-r),s=[],l=0;l<i;l++)s[l]=this._data[l+n][l+r];return new v({data:s,size:[i],datatype:this._datatype})},v.diagonal=function(e,r,n,o,a){if(!c(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(t.isBigNumber(e)&&(e=e.toNumber()),!u(e)||!d(e)||e<1)throw new Error("Size values must be positive integers");return e})),n){if(t.isBigNumber(n)&&(n=n.toNumber()),!u(n)||!d(n))throw new TypeError("The parameter k must be an integer number")}else n=0;o&&f(a)&&(o=_.convert(o,a));var s,l=n>0?n:0,p=n<0?-n:0,h=e[0],m=e[1],g=Math.min(h-p,m-l);if(c(r)){if(r.length!==g)throw new Error("Invalid value array length");s=function(t){return r[t]}}else if(t.isMatrix(r)){var y=r.size();if(1!==y.length||y[0]!==g)throw new Error("Invalid matrix length");s=function(t){return r.get([t])}}else s=function(){return r};o||(o=t.isBigNumber(s(0))?new t.BigNumber(0):0);var w=[];if(e.length>0){w=i.resize(w,e,o);for(var x=0;x<g;x++)w[x+p][x+l]=s(x)}return new v({data:w,size:[h,m]})},v.fromJSON=function(t){return new v(t)},v.prototype.swapRows=function(t,e){if(!(u(t)&&d(t)&&u(e)&&d(e)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return p(t,this._size[0]),p(e,this._size[0]),v._swapRows(t,e,this._data),this},v._swapRows=function(t,e,r){var n=r[t];r[t]=r[e],r[e]=n},t.Matrix._storage.dense=v,t.Matrix._storage.default=v,v},e.lazy=!1},function(t,e,r){"use strict";var n=r(15).hasOwnProperty;function o(t,e){return!(!t||"object"!=typeof t)&&(!!n(s,e)||!(e in Object.prototype)&&!(e in Function.prototype))}function a(t,e){return!(!t||"function"!=typeof t[e])&&(!(n(t,e)&&t.__proto__&&e in t.__proto__)&&(!!n(l,e)||!(e in Object.prototype)&&!(e in Function.prototype)))}function i(t){return"object"==typeof t&&t&&t.constructor===Object}var s={length:!0,name:!0},l={toString:!0,valueOf:!0,toLocaleString:!0};e.getSafeProperty=function(t,e){if(i(t)&&o(t,e))return t[e];if("function"==typeof t[e]&&a(t,e))throw new Error('Cannot access method "'+e+'" as a property');throw new Error('No access to property "'+e+'"')},e.setSafeProperty=function(t,e,r){if(i(t)&&o(t,e))return t[e]=r;throw new Error('No access to property "'+e+'"')},e.isSafeProperty=o,e.validateSafeMethod=function(t,e){if(!a(t,e))throw new Error('No access to method "'+e+'"')},e.isSafeMethod=a,e.isPlainObject=i},function(t,e,r){"use strict";var n=r(28),o=r(33),a=n.array,i=n.object,s=n.string,l=n.number,c=Array.isArray,u=l.isNumber,d=l.isInteger,f=s.isString,p=a.validateIndex;e.name="SparseMatrix",e.path="type",e.factory=function(t,e,_,h){var v=_(r(27)),m=_(r(40));function g(e,r){if(!(this instanceof g))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!f(r))throw new Error("Invalid datatype: "+r);if(t.isMatrix(e))y(this,e,r);else if(e&&c(e.index)&&c(e.ptr)&&c(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=r||e.datatype;else if(c(e))w(this,e,r);else{if(e)throw new TypeError("Unsupported type of data ("+n.types.type(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=r}}var y=function(t,e,r){"SparseMatrix"===e.type?(t._values=e._values?i.clone(e._values):void 0,t._index=i.clone(e._index),t._ptr=i.clone(e._ptr),t._size=i.clone(e._size),t._datatype=r||e._datatype):w(t,e.valueOf(),r||e._datatype)},w=function(t,e,r){t._values=[],t._index=[],t._ptr=[],t._datatype=r;var n=e.length,o=0,a=m,i=0;if(f(r)&&(a=h.find(m,[r,r])||m,i=h.convert(0,r)),n>0){var s=0;do{t._ptr.push(t._index.length);for(var l=0;l<n;l++){var u=e[l];if(c(u)){if(0===s&&o<u.length&&(o=u.length),s<u.length){var d=u[s];a(d,i)||(t._values.push(d),t._index.push(l))}}else 0===s&&o<1&&(o=1),a(u,i)||(t._values.push(u),t._index.push(l))}s++}while(s<o)}t._ptr.push(t._index.length),t._size=[n,o]};g.prototype=new v,g.prototype.type="SparseMatrix",g.prototype.isSparseMatrix=!0,g.prototype.storage=function(){return"sparse"},g.prototype.datatype=function(){return this._datatype},g.prototype.create=function(t,e){return new g(t,e)},g.prototype.density=function(){var t=this._size[0],e=this._size[1];return 0!==t&&0!==e?this._index.length/(t*e):0},g.prototype.subset=function(t,e,r){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return x(this,t);case 2:case 3:return b(this,t,e,r);default:throw new SyntaxError("Wrong number of arguments")}};var x=function(e,r){if(!t.isIndex(r))throw new TypeError("Invalid index");if(r.isScalar())return e.get(r.min());var n,a,i,s,l=r.size();if(l.length!=e._size.length)throw new o(l.length,e._size.length);var c=r.min(),u=r.max();for(n=0,a=e._size.length;n<a;n++)p(c[n],e._size[n]),p(u[n],e._size[n]);var d=e._values,f=e._index,_=e._ptr,h=r.dimension(0),v=r.dimension(1),m=[],y=[];h.forEach((function(t,e){y[t]=e[0],m[t]=!0}));var w=d?[]:void 0,x=[],b=[];return v.forEach((function(t){for(b.push(x.length),i=_[t],s=_[t+1];i<s;i++)n=f[i],!0===m[n]&&(x.push(y[n]),w&&w.push(d[i]))})),b.push(x.length),new g({values:w,index:x,ptr:b,size:l,datatype:e._datatype})},b=function(e,r,n,s){if(!r||!0!==r.isIndex)throw new TypeError("Invalid index");var l,c=r.size(),u=r.isScalar();if(t.isMatrix(n)?(l=n.size(),n=n.toArray()):l=a.size(n),u){if(0!==l.length)throw new TypeError("Scalar expected");e.set(r.min(),n,s)}else{if(1!==c.length&&2!==c.length)throw new o(c.length,e._size.length,"<");if(l.length<c.length){for(var d=0,f=0;1===c[d]&&1===l[d];)d++;for(;1===c[d];)f++,d++;n=a.unsqueeze(n,c.length,f,l)}if(!i.deepEqual(c,l))throw new o(c,l,">");for(var p=r.min()[0],_=r.min()[1],h=l[0],v=l[1],m=0;m<h;m++)for(var g=0;g<v;g++){var y=n[m][g];e.set([m+p,g+_],y,s)}}return e};g.prototype.get=function(t){if(!c(t))throw new TypeError("Array expected");if(t.length!=this._size.length)throw new o(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var e=t[0],r=t[1];p(e,this._size[0]),p(r,this._size[1]);var n=z(e,this._ptr[r],this._ptr[r+1],this._index);return n<this._ptr[r+1]&&this._index[n]===e?this._values[n]:0},g.prototype.set=function(t,e,r){if(!c(t))throw new TypeError("Array expected");if(t.length!=this._size.length)throw new o(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var n=t[0],a=t[1],i=this._size[0],s=this._size[1],l=m,u=0;f(this._datatype)&&(l=h.find(m,[this._datatype,this._datatype])||m,u=h.convert(0,this._datatype)),(n>i-1||a>s-1)&&(E(this,Math.max(n+1,i),Math.max(a+1,s),r),i=this._size[0],s=this._size[1]),p(n,i),p(a,s);var d=z(n,this._ptr[a],this._ptr[a+1],this._index);return d<this._ptr[a+1]&&this._index[d]===n?l(e,u)?k(d,a,this._values,this._index,this._ptr):this._values[d]=e:A(d,n,a,e,this._values,this._index,this._ptr),this};var z=function(t,e,r,n){if(r-e==0)return r;for(var o=e;o<r;o++)if(n[o]===t)return o;return e},k=function(t,e,r,n,o){r.splice(t,1),n.splice(t,1);for(var a=e+1;a<o.length;a++)o[a]--},A=function(t,e,r,n,o,a,i){o.splice(t,0,n),a.splice(t,0,e);for(var s=r+1;s<i.length;s++)i[s]++};g.prototype.resize=function(t,e,r){if(!c(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");t.forEach((function(e){if(!l.isNumber(e)||!l.isInteger(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+s.format(t)+")")}));var n=r?this.clone():this;return E(n,t[0],t[1],e)};var E=function(t,e,r,n){var o=n||0,a=m,i=0;f(t._datatype)&&(a=h.find(m,[t._datatype,t._datatype])||m,i=h.convert(0,t._datatype),o=h.convert(o,t._datatype));var s,l,c,u=!a(o,i),d=t._size[0],p=t._size[1];if(r>p){for(l=p;l<r;l++)if(t._ptr[l]=t._values.length,u)for(s=0;s<d;s++)t._values.push(o),t._index.push(s);t._ptr[r]=t._values.length}else r<p&&(t._ptr.splice(r+1,p-r),t._values.splice(t._ptr[r],t._values.length),t._index.splice(t._ptr[r],t._index.length));if(p=r,e>d){if(u){var _=0;for(l=0;l<p;l++){t._ptr[l]=t._ptr[l]+_,c=t._ptr[l+1]+_;var v=0;for(s=d;s<e;s++,v++)t._values.splice(c+v,0,o),t._index.splice(c+v,0,s),_++}t._ptr[p]=t._values.length}}else if(e<d){var g=0;for(l=0;l<p;l++){t._ptr[l]=t._ptr[l]-g;var y=t._ptr[l],w=t._ptr[l+1]-g;for(c=y;c<w;c++)(s=t._index[c])>e-1&&(t._values.splice(c,1),t._index.splice(c,1),g++)}t._ptr[l]=t._values.length}return t._size[0]=e,t._size[1]=r,t};g.prototype.reshape=function(t,e){if(!c(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");if(t.forEach((function(e){if(!l.isNumber(e)||!l.isInteger(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+s.format(t)+")")})),this._size[0]*this._size[1]!=t[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=e?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var n=[],o=0;o<r._ptr.length;o++)for(var a=0;a<r._ptr[o+1]-r._ptr[o];a++)n.push(o);var i=r._values.slice(),u=r._index.slice();for(o=0;o<r._index.length;o++){var d=u[o],f=n[o],p=d*r._size[1]+f;n[o]=p%t[1],u[o]=Math.floor(p/t[1])}r._values.length=0,r._index.length=0,r._ptr.length=t[1]+1,r._size=t.slice();for(o=0;o<r._ptr.length;o++)r._ptr[o]=0;for(var _=0;_<i.length;_++){o=u[_],a=n[_];var h=i[_],v=z(o,r._ptr[a],r._ptr[a+1],r._index);A(v,o,a,h,r._values,r._index,r._ptr)}return r},g.prototype.clone=function(){return new g({values:this._values?i.clone(this._values):void 0,index:i.clone(this._index),ptr:i.clone(this._ptr),size:i.clone(this._size),datatype:this._datatype})},g.prototype.size=function(){return this._size.slice(0)},g.prototype.map=function(t,e){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var r=this,n=this._size[0],o=this._size[1];return N(this,0,n-1,0,o-1,(function(e,n,o){return t(e,[n,o],r)}),e)};var N=function(t,e,r,n,o,a,i){var s=[],l=[],c=[],u=m,d=0;f(t._datatype)&&(u=h.find(m,[t._datatype,t._datatype])||m,d=h.convert(0,t._datatype));for(var p=function(t,e,r){t=a(t,e,r),u(t,d)||(s.push(t),l.push(e))},_=n;_<=o;_++){c.push(s.length);for(var v=t._ptr[_],y=t._ptr[_+1],w=e,x=v;x<y;x++){var b=t._index[x];if(b>=e&&b<=r){if(!i)for(var z=w;z<b;z++)p(0,z-e,_-n);p(t._values[x],b-e,_-n)}w=b+1}if(!i)for(var k=w;k<=r;k++)p(0,k-e,_-n)}return c.push(s.length),new g({values:s,index:l,ptr:c,size:[r-e+1,o-n+1]})};g.prototype.forEach=function(t,e){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var r=this,n=this._size[0],o=this._size[1],a=0;a<o;a++){for(var i=this._ptr[a],s=this._ptr[a+1],l=0,c=i;c<s;c++){var u=this._index[c];if(!e)for(var d=l;d<u;d++)t(0,[d,a],r);t(this._values[c],[u,a],r),l=u+1}if(!e)for(var f=l;f<n;f++)t(0,[f,a],r)}},g.prototype.toArray=function(){return M(this._values,this._index,this._ptr,this._size,!0)},g.prototype.valueOf=function(){return M(this._values,this._index,this._ptr,this._size,!1)};var M=function(t,e,r,n,o){var a,s,l=n[0],c=n[1],u=[];for(a=0;a<l;a++)for(u[a]=[],s=0;s<c;s++)u[a][s]=0;for(s=0;s<c;s++)for(var d=r[s],f=r[s+1],p=d;p<f;p++)u[a=e[p]][s]=t?o?i.clone(t[p]):t[p]:1;return u};return g.prototype.format=function(t){for(var e=this._size[0],r=this._size[1],n=this.density(),o="Sparse Matrix ["+s.format(e,t)+" x "+s.format(r,t)+"] density: "+s.format(n,t)+"\n",a=0;a<r;a++)for(var i=this._ptr[a],l=this._ptr[a+1],c=i;c<l;c++){var u=this._index[c];o+="\n ("+s.format(u,t)+", "+s.format(a,t)+") ==> "+(this._values?s.format(this._values[c],t):"X")}return o},g.prototype.toString=function(){return s.format(this.toArray())},g.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},g.prototype.diagonal=function(e){if(e){if(t.isBigNumber(e)&&(e=e.toNumber()),!u(e)||!d(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var r=e>0?e:0,n=e<0?-e:0,o=this._size[0],a=this._size[1],i=Math.min(o-n,a-r),s=[],l=[],c=[];c[0]=0;for(var f=r;f<a&&s.length<i;f++)for(var p=this._ptr[f],_=this._ptr[f+1],h=p;h<_;h++){var v=this._index[h];if(v===f-r+n){s.push(this._values[h]),l[s.length-1]=v-n;break}}return c.push(s.length),new g({values:s,index:l,ptr:c,size:[i,1]})},g.fromJSON=function(t){return new g(t)},g.diagonal=function(e,r,n,o,a){if(!c(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(t.isBigNumber(e)&&(e=e.toNumber()),!u(e)||!d(e)||e<1)throw new Error("Size values must be positive integers");return e})),n){if(t.isBigNumber(n)&&(n=n.toNumber()),!u(n)||!d(n))throw new TypeError("The parameter k must be an integer number")}else n=0;var i=m,s=0;f(a)&&(i=h.find(m,[a,a])||m,s=h.convert(0,a));var l,p=n>0?n:0,_=n<0?-n:0,v=e[0],y=e[1],w=Math.min(v-_,y-p);if(c(r)){if(r.length!==w)throw new Error("Invalid value array length");l=function(t){return r[t]}}else if(t.isMatrix(r)){var x=r.size();if(1!==x.length||x[0]!==w)throw new Error("Invalid matrix length");l=function(t){return r.get([t])}}else l=function(){return r};for(var b=[],z=[],k=[],A=0;A<y;A++){k.push(b.length);var E=A-p;if(E>=0&&E<w){var N=l(E);i(N,s)||(z.push(E+_),b.push(N))}}return k.push(b.length),new g({values:b,index:z,ptr:k,size:[v,y]})},g.prototype.swapRows=function(t,e){if(!(u(t)&&d(t)&&u(e)&&d(e)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return p(t,this._size[0]),p(e,this._size[0]),g._swapRows(t,e,this._size[1],this._values,this._index,this._ptr),this},g._forEachRow=function(t,e,r,n,o){for(var a=n[t],i=n[t+1],s=a;s<i;s++)o(r[s],e[s])},g._swapRows=function(t,e,r,n,o,a){for(var i=0;i<r;i++){var s=a[i],l=a[i+1],c=z(t,s,l,o),u=z(e,s,l,o);if(c<l&&u<l&&o[c]===t&&o[u]===e){if(n){var d=n[c];n[c]=n[u],n[u]=d}}else if(c<l&&o[c]===t&&(u>=l||o[u]!==e)){var f=n?n[c]:void 0;o.splice(u,0,e),n&&n.splice(u,0,f),o.splice(u<=c?c+1:c,1),n&&n.splice(u<=c?c+1:c,1)}else if(u<l&&o[u]===e&&(c>=l||o[c]!==t)){var p=n?n[u]:void 0;o.splice(c,0,t),n&&n.splice(c,0,p),o.splice(c<=u?u+1:u,1),n&&n.splice(c<=u?u+1:u,1)}}},t.Matrix._storage.sparse=g,g},e.lazy=!1},function(t,e,r){"use strict";var n=r(19).nearlyEqual,o=r(41);e.factory=function(t,e,r,a){var i=a("equalScalar",{"boolean, boolean":function(t,e){return t===e},"number, number":function(t,r){return t===r||n(t,r,e.epsilon)},"BigNumber, BigNumber":function(t,r){return t.eq(r)||o(t,r,e.epsilon)},"Fraction, Fraction":function(t,e){return t.equals(e)},"Complex, Complex":function(t,e){return t.equals(e)},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return i(t.value,e.value)},"string, string":function(t,e){return t===e}});return i}},function(t,e){"use strict";t.exports=function(t,e,r){if(null==r)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var n=t.minus(e).abs();if(n.isZero())return!0;var o=t.constructor.max(t.abs(),e.abs());return n.lte(o.times(r))}return!1}},function(t,e,r){"use strict";e.name="Spa",e.path="type",e.factory=function(t,e,n){var o=n(r(43)),a=n(r(40));function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new t.FibonacciHeap}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(t,e){if(this._values[t])this._values[t].value=e;else{var r=this._heap.insert(t,e);this._values[t]=r}},i.prototype.get=function(t){var e=this._values[t];return e?e.value:0},i.prototype.accumulate=function(t,e){var r=this._values[t];r?r.value=o(r.value,e):(r=this._heap.insert(t,e),this._values[t]=r)},i.prototype.forEach=function(t,e,r){var n=this._heap,o=this._values,i=[],s=n.extractMinimum();for(s&&i.push(s);s&&s.key<=e;)s.key>=t&&(a(s.value,0)||r(s.key,s.value,this)),(s=n.extractMinimum())&&i.push(s);for(var l=0;l<i.length;l++){var c=i[l];o[(s=n.insert(c.key,c.value)).key]=s}},i.prototype.swap=function(t,e){var r=this._values[t],n=this._values[e];if(!r&&n)r=this._heap.insert(t,n.value),this._heap.remove(n),this._values[t]=r,this._values[e]=void 0;else if(r&&!n)n=this._heap.insert(e,r.value),this._heap.remove(r),this._values[e]=n,this._values[t]=void 0;else if(r&&n){var o=r.value;r.value=n.value,n.value=o}},i}},function(t,e,r){"use strict";var n=r(15).extend;e.name="add",e.factory=function(t,e,o,a){var i=o(r(44)),s=o(r(45)),l=r(46),c=o(r(47)),u=o(r(48)),d=o(r(49)),f=o(r(50)),p=o(r(51)),_=a("add",n({"Matrix, Matrix":function(t,e){var r;switch(t.storage()){case"sparse":switch(e.storage()){case"sparse":r=u(t,e,s);break;default:r=c(e,t,s,!0)}break;default:switch(e.storage()){case"sparse":r=c(t,e,s,!1);break;default:r=f(t,e,s)}}return r},"Array, Array":function(t,e){return _(i(t),i(e)).valueOf()},"Array, Matrix":function(t,e){return _(i(t),e)},"Matrix, Array":function(t,e){return _(t,i(e))},"Matrix, any":function(t,e){var r;switch(t.storage()){case"sparse":r=d(t,e,s,!1);break;default:r=p(t,e,s,!1)}return r},"any, Matrix":function(t,e){var r;switch(e.storage()){case"sparse":r=d(e,t,s,!0);break;default:r=p(e,t,s,!0)}return r},"Array, any":function(t,e){return p(i(t),e,s,!1).valueOf()},"any, Array":function(t,e){return p(i(e),t,s,!0).valueOf()},"any, any":s,"Array | Matrix | any, Array | Matrix | any, ...any":function(t,e,r){for(var n=_(t,e),o=0;o<r.length;o++)n=_(n,r[o]);return n}},s.signatures));return _.toTex={2:"\\left(${args[0]}"+l.operators.add+"${args[1]}\\right)"},_}},function(t,e){"use strict";e.name="matrix",e.factory=function(t,e,r,n){var o=n("matrix",{"":function(){return a([])},string:function(t){return a([],t)},"string, string":function(t,e){return a([],t,e)},Array:function(t){return a(t)},Matrix:function(t){return a(t,t.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});return o.toTex={0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},o;function a(e,r,n){return new(t.Matrix.storage(r||"default"))(e,n)}}},function(t,e){"use strict";e.factory=function(t,e,r,n){var o=n("add",{"number, number":function(t,e){return t+e},"Complex, Complex":function(t,e){return t.add(e)},"BigNumber, BigNumber":function(t,e){return t.plus(e)},"Fraction, Fraction":function(t,e){return t.add(e)},"Unit, Unit":function(t,e){if(null==t.value)throw new Error("Parameter x contains a unit with undefined value");if(null==e.value)throw new Error("Parameter y contains a unit with undefined value");if(!t.equalBase(e))throw new Error("Units do not match");var r=t.clone();return r.value=o(r.value,e.value),r.fixPrefix=!1,r}});return o}},function(t,e){"use strict";e.symbols={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},e.operators={transpose:"^\\top",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},e.defaultTemplate="\\mathrm{${name}}\\left(${args}\\right)";var r={deg:"^\\circ"};e.toSymbol=function(t,n){if(n=void 0!==n&&n)return r.hasOwnProperty(t)?r[t]:"\\mathrm{"+t+"}";if(e.symbols.hasOwnProperty(t))return e.symbols[t];if(-1!==t.indexOf("_")){var o=t.indexOf("_");return e.toSymbol(t.substring(0,o))+"_{"+e.toSymbol(t.substring(o+1))+"}"}return t}},function(t,e,r){"use strict";var n=r(33);e.name="algorithm01",e.factory=function(t,e,r,o){var a=t.DenseMatrix;return function(t,e,r,i){var s=t._data,l=t._size,c=t._datatype,u=e._values,d=e._index,f=e._ptr,p=e._size,_=e._datatype;if(l.length!==p.length)throw new n(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,v,m=l[0],g=l[1],y="string"==typeof c&&c===_?c:void 0,w=y?o.find(r,[y,y]):r,x=[];for(h=0;h<m;h++)x[h]=[];var b=[],z=[];for(v=0;v<g;v++){for(var k=v+1,A=f[v],E=f[v+1],N=A;N<E;N++)b[h=d[N]]=i?w(u[N],s[h][v]):w(s[h][v],u[N]),z[h]=k;for(h=0;h<m;h++)z[h]===k?x[h][v]=b[h]:x[h][v]=s[h][v]}return new a({data:x,size:[m,g],datatype:y})}}},function(t,e,r){"use strict";var n=r(33);e.name="algorithm04",e.factory=function(t,e,o,a){var i=o(r(40)),s=t.SparseMatrix;return function(t,e,r){var o=t._values,l=t._index,c=t._ptr,u=t._size,d=t._datatype,f=e._values,p=e._index,_=e._ptr,h=e._size,v=e._datatype;if(u.length!==h.length)throw new n(u.length,h.length);if(u[0]!==h[0]||u[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+h+")");var m,g=u[0],y=u[1],w=i,x=0,b=r;"string"==typeof d&&d===v&&(m=d,w=a.find(i,[m,m]),x=a.convert(0,m),b=a.find(r,[m,m]));var z,k,A,E,N,M=o&&f?[]:void 0,S=[],O=[],T=new s({values:M,index:S,ptr:O,size:[g,y],datatype:m}),B=o&&f?[]:void 0,C=o&&f?[]:void 0,F=[],I=[];for(k=0;k<y;k++){O[k]=S.length;var j=k+1;for(E=c[k],N=c[k+1],A=E;A<N;A++)z=l[A],S.push(z),F[z]=j,B&&(B[z]=o[A]);for(E=_[k],N=_[k+1],A=E;A<N;A++)if(F[z=p[A]]===j){if(B){var R=b(B[z],f[A]);w(R,x)?F[z]=null:B[z]=R}}else S.push(z),I[z]=j,C&&(C[z]=f[A]);if(B&&C)for(A=O[k];A<S.length;)F[z=S[A]]===j?(M[A]=B[z],A++):I[z]===j?(M[A]=C[z],A++):S.splice(A,1)}return O[y]=S.length,T}}},function(t,e){"use strict";e.name="algorithm10",e.factory=function(t,e,r,n){var o=t.DenseMatrix;return function(t,e,r,a){var i=t._values,s=t._index,l=t._ptr,c=t._size,u=t._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d,f=c[0],p=c[1],_=r;"string"==typeof u&&(d=u,e=n.convert(e,d),_=n.find(r,[d,d]));for(var h=[],v=new o({data:h,size:[f,p],datatype:d}),m=[],g=[],y=0;y<p;y++){for(var w=y+1,x=l[y],b=l[y+1],z=x;z<b;z++){var k=s[z];m[k]=i[z],g[k]=w}for(var A=0;A<f;A++)0===y&&(h[A]=[]),g[A]===w?h[A][y]=a?_(e,m[A]):_(m[A],e):h[A][y]=e}return v}}},function(t,e,r){"use strict";var n=r(28),o=r(33);n.string.isString;e.name="algorithm13",e.factory=function(t,e,r,n){var a=t.DenseMatrix,i=function(t,e,r,n,o,a){var s=[];if(e===r.length-1)for(var l=0;l<n;l++)s[l]=t(o[l],a[l]);else for(var c=0;c<n;c++)s[c]=i(t,e+1,r,r[e+1],o[c],a[c]);return s};return function(t,e,r){var s,l=t._data,c=t._size,u=t._datatype,d=e._data,f=e._size,p=e._datatype,_=[];if(c.length!==f.length)throw new o(c.length,f.length);for(var h=0;h<c.length;h++){if(c[h]!==f[h])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+f+")");_[h]=c[h]}var v=r;"string"==typeof u&&u===p&&(s=u,e=n.convert(e,s),v=n.find(r,[s,s]));var m=_.length>0?i(v,0,_,_[0],l,d):[];return new a({data:m,size:_,datatype:s})}}},function(t,e,r){"use strict";var n=r(15).clone;e.name="algorithm14",e.factory=function(t,e,r,o){var a=t.DenseMatrix,i=function(t,e,r,n,o,a,s){var l=[];if(e===r.length-1)for(var c=0;c<n;c++)l[c]=s?t(a,o[c]):t(o[c],a);else for(var u=0;u<n;u++)l[u]=i(t,e+1,r,r[e+1],o[u],a,s);return l};return function(t,e,r,s){var l,c=t._data,u=t._size,d=t._datatype,f=r;"string"==typeof d&&(l=d,e=o.convert(e,l),f=o.find(r,[l,l]));var p=u.length>0?i(f,0,u,u[0],c,e,s):[];return new a({data:p,size:n(u),datatype:l})}}},function(t,e,r){"use strict";e.name="FibonacciHeap",e.path="type",e.factory=function(t,e,n,o){var a=n(r(53)),i=n(r(57)),s=1/Math.log((1+Math.sqrt(5))/2);function l(){if(!(this instanceof l))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}l.prototype.type="FibonacciHeap",l.prototype.isFibonacciHeap=!0,l.prototype.insert=function(t,e){var r={key:t,value:e,degree:0};if(this._minimum){var n=this._minimum;r.left=n,r.right=n.right,n.right=r,r.right.left=r,a(t,n.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},l.prototype.size=function(){return this._size},l.prototype.clear=function(){this._minimum=null,this._size=0},l.prototype.isEmpty=function(){return 0===this._size},l.prototype.extractMinimum=function(){var t=this._minimum;if(null===t)return t;for(var e=this._minimum,r=t.degree,n=t.child;r>0;){var o=n.right;n.left.right=n.right,n.right.left=n.left,n.left=e,n.right=e.right,e.right=n,n.right.left=n,n.parent=null,n=o,r--}return t.left.right=t.right,t.right.left=t.left,t==t.right?e=null:(e=t.right,e=f(e,this._size)),this._size--,this._minimum=e,t},l.prototype.remove=function(t){this._minimum=c(this._minimum,t,-1),this.extractMinimum()};var c=function(t,e,r){e.key=r;var n=e.parent;return n&&a(e.key,n.key)&&(u(t,e,n),d(t,n)),a(e.key,t.key)&&(t=e),t},u=function(t,e,r){e.left.right=e.right,e.right.left=e.left,r.degree--,r.child==e&&(r.child=e.right),0===r.degree&&(r.child=null),e.left=t,e.right=t.right,t.right=e,e.right.left=e,e.parent=null,e.mark=!1},d=function(t,e){var r=e.parent;r&&(e.mark?(u(t,e,r),d(r)):e.mark=!0)},f=function(t,e){var r,n,o,l=Math.floor(Math.log(e)*s)+1,c=new Array(l),u=0,d=t;if(d)for(u++,d=d.right;d!==t;)u++,d=d.right;for(;u>0;){for(var f=d.degree,p=d.right;r=c[f];){if(i(d.key,r.key)){var _=r;r=d,d=_}o=d,(n=r).left.right=n.right,n.right.left=n.left,n.parent=o,o.child?(n.left=o.child,n.right=o.child.right,o.child.right=n,n.right.left=n):(o.child=n,n.right=n,n.left=n),o.degree++,n.mark=!1,c[f]=null,f++}c[f]=d,d=p,u--}t=null;for(var h=0;h<l;h++)(r=c[h])&&(t?(r.left.right=r.right,r.right.left=r.left,r.left=t,r.right=t.right,t.right=r,r.right.left=r,a(r.key,t.key)&&(t=r)):t=r);return t};return l}},function(t,e,r){"use strict";var n=r(19).nearlyEqual,o=r(41);e.name="smaller",e.factory=function(t,e,a,i){var s=a(r(44)),l=a(r(54)),c=a(r(55)),u=a(r(56)),d=a(r(50)),f=a(r(51)),p=r(46),_=i("smaller",{"boolean, boolean":function(t,e){return t<e},"number, number":function(t,r){return t<r&&!n(t,r,e.epsilon)},"BigNumber, BigNumber":function(t,r){return t.lt(r)&&!o(t,r,e.epsilon)},"Fraction, Fraction":function(t,e){return-1===t.compare(e)},"Complex, Complex":function(t,e){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return _(t.value,e.value)},"string, string":function(t,e){return t<e},"Matrix, Matrix":function(t,e){var r;switch(t.storage()){case"sparse":switch(e.storage()){case"sparse":r=c(t,e,_);break;default:r=l(e,t,_,!0)}break;default:switch(e.storage()){case"sparse":r=l(t,e,_,!1);break;default:r=d(t,e,_)}}return r},"Array, Array":function(t,e){return _(s(t),s(e)).valueOf()},"Array, Matrix":function(t,e){return _(s(t),e)},"Matrix, Array":function(t,e){return _(t,s(e))},"Matrix, any":function(t,e){var r;switch(t.storage()){case"sparse":r=u(t,e,_,!1);break;default:r=f(t,e,_,!1)}return r},"any, Matrix":function(t,e){var r;switch(e.storage()){case"sparse":r=u(e,t,_,!0);break;default:r=f(e,t,_,!0)}return r},"Array, any":function(t,e){return f(s(t),e,_,!1).valueOf()},"any, Array":function(t,e){return f(s(e),t,_,!0).valueOf()}});return _.toTex={2:"\\left(${args[0]}"+p.operators.smaller+"${args[1]}\\right)"},_}},function(t,e,r){"use strict";var n=r(33);e.name="algorithm03",e.factory=function(t,e,r,o){var a=t.DenseMatrix;return function(t,e,r,i){var s=t._data,l=t._size,c=t._datatype,u=e._values,d=e._index,f=e._ptr,p=e._size,_=e._datatype;if(l.length!==p.length)throw new n(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,v=l[0],m=l[1],g=0,y=r;"string"==typeof c&&c===_&&(h=c,g=o.convert(0,h),y=o.find(r,[h,h]));for(var w=[],x=0;x<v;x++)w[x]=[];for(var b=[],z=[],k=0;k<m;k++){for(var A=k+1,E=f[k],N=f[k+1],M=E;M<N;M++){var S=d[M];b[S]=i?y(u[M],s[S][k]):y(s[S][k],u[M]),z[S]=A}for(var O=0;O<v;O++)z[O]===A?w[O][k]=b[O]:w[O][k]=i?y(g,s[O][k]):y(s[O][k],g)}return new a({data:w,size:[v,m],datatype:h})}}},function(t,e,r){"use strict";var n=r(33);e.name="algorithm07",e.factory=function(t,e,r,o){var a=t.DenseMatrix,i=function(t,e,r,n,o){for(var a=t._values,i=t._index,s=t._ptr,l=s[e],c=s[e+1];l<c;l++){var u=i[l];r[u]=o,n[u]=a[l]}};return function(t,e,r){var s=t._size,l=t._datatype,c=e._size,u=e._datatype;if(s.length!==c.length)throw new n(s.length,c.length);if(s[0]!==c[0]||s[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+c+")");var d,f,p,_=s[0],h=s[1],v=0,m=r;"string"==typeof l&&l===u&&(d=l,v=o.convert(0,d),m=o.find(r,[d,d]));var g=[];for(f=0;f<_;f++)g[f]=[];var y=new a({data:g,size:[_,h],datatype:d}),w=[],x=[],b=[],z=[];for(p=0;p<h;p++){var k=p+1;for(i(t,p,b,w,k),i(e,p,z,x,k),f=0;f<_;f++){var A=b[f]===k?w[f]:v,E=z[f]===k?x[f]:v;g[f][p]=m(A,E)}}return y}}},function(t,e){"use strict";e.name="algorithm12",e.factory=function(t,e,r,n){var o=t.DenseMatrix;return function(t,e,r,a){var i=t._values,s=t._index,l=t._ptr,c=t._size,u=t._datatype;if(!i)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d,f=c[0],p=c[1],_=r;"string"==typeof u&&(d=u,e=n.convert(e,d),_=n.find(r,[d,d]));for(var h=[],v=new o({data:h,size:[f,p],datatype:d}),m=[],g=[],y=0;y<p;y++){for(var w=y+1,x=l[y],b=l[y+1],z=x;z<b;z++){var k=s[z];m[k]=i[z],g[k]=w}for(var A=0;A<f;A++)0===y&&(h[A]=[]),g[A]===w?h[A][y]=a?_(e,m[A]):_(m[A],e):h[A][y]=a?_(e,0):_(0,e)}return v}}},function(t,e,r){"use strict";var n=r(19).nearlyEqual,o=r(41);e.name="larger",e.factory=function(t,e,a,i){var s=a(r(44)),l=a(r(54)),c=a(r(55)),u=a(r(56)),d=a(r(50)),f=a(r(51)),p=r(46),_=i("larger",{"boolean, boolean":function(t,e){return t>e},"number, number":function(t,r){return t>r&&!n(t,r,e.epsilon)},"BigNumber, BigNumber":function(t,r){return t.gt(r)&&!o(t,r,e.epsilon)},"Fraction, Fraction":function(t,e){return 1===t.compare(e)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(t,e){if(!t.equalBase(e))throw new Error("Cannot compare units with different base");return _(t.value,e.value)},"string, string":function(t,e){return t>e},"Matrix, Matrix":function(t,e){var r;switch(t.storage()){case"sparse":switch(e.storage()){case"sparse":r=c(t,e,_);break;default:r=l(e,t,_,!0)}break;default:switch(e.storage()){case"sparse":r=l(t,e,_,!1);break;default:r=d(t,e,_)}}return r},"Array, Array":function(t,e){return _(s(t),s(e)).valueOf()},"Array, Matrix":function(t,e){return _(s(t),e)},"Matrix, Array":function(t,e){return _(t,s(e))},"Matrix, any":function(t,e){var r;switch(t.storage()){case"sparse":r=u(t,e,_,!1);break;default:r=f(t,e,_,!1)}return r},"any, Matrix":function(t,e){var r;switch(e.storage()){case"sparse":r=u(e,t,_,!0);break;default:r=f(e,t,_,!0)}return r},"Array, any":function(t,e){return f(s(t),e,_,!1).valueOf()},"any, Array":function(t,e){return f(s(e),t,_,!0).valueOf()}});return _.toTex={2:"\\left(${args[0]}"+p.operators.larger+"${args[1]}\\right)"},_}},function(t,e,r){"use strict";var n=r(28),o=n.string,a=n.object,i=Array.isArray,s=o.isString;e.name="ImmutableDenseMatrix",e.path="type",e.factory=function(t,e,o){var l=o(r(37)),c=o(r(53));function u(e,r){if(!(this instanceof u))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!s(r))throw new Error("Invalid datatype: "+r);if(t.isMatrix(e)||i(e)){var o=new l(e,r);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(e&&i(e.data)&&i(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+n.types.type(e)+")");this._data=[],this._size=[0],this._datatype=r,this._min=null,this._max=null}}return u.prototype=new l,u.prototype.type="ImmutableDenseMatrix",u.prototype.isImmutableDenseMatrix=!0,u.prototype.subset=function(e){switch(arguments.length){case 1:var r=l.prototype.subset.call(this,e);return t.isMatrix(r)?new u({data:r._data,size:r._size,datatype:r._datatype}):r;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},u.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},u.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},u.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},u.prototype.clone=function(){return new u({data:a.clone(this._data),size:a.clone(this._size),datatype:this._datatype})},u.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},u.fromJSON=function(t){return new u(t)},u.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},u.prototype.min=function(){if(null===this._min){var t=null;this.forEach((function(e){(null===t||c(e,t))&&(t=e)})),this._min=null!==t?t:void 0}return this._min},u.prototype.max=function(){if(null===this._max){var t=null;this.forEach((function(e){(null===t||c(t,e))&&(t=e)})),this._max=null!==t?t:void 0}return this._max},u}},function(t,e,r){"use strict";var n=r(15).clone,o=r(19).isInteger;e.name="Index",e.path="type",e.factory=function(t){function e(n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var o=0,a=arguments.length;o<a;o++){var i=arguments[o];if(t.isRange(i))this._dimensions.push(i),this._isScalar=!1;else if(Array.isArray(i)||t.isMatrix(i)){var s=r(i.valueOf());this._dimensions.push(s);var l=s.size();1===l.length&&1===l[0]||(this._isScalar=!1)}else if("number"==typeof i)this._dimensions.push(r([i]));else{if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(i)}}}function r(e){for(var r=0,n=e.length;r<n;r++)if("number"!=typeof e[r]||!o(e[r]))throw new TypeError("Index parameters must be positive integer numbers");return new t.ImmutableDenseMatrix(e)}return e.prototype.type="Index",e.prototype.isIndex=!0,e.prototype.clone=function(){var t=new e;return t._dimensions=n(this._dimensions),t._isScalar=this._isScalar,t},e.create=function(t){var r=new e;return e.apply(r,t),r},e.prototype.size=function(){for(var t=[],e=0,r=this._dimensions.length;e<r;e++){var n=this._dimensions[e];t[e]="string"==typeof n?1:n.size()[0]}return t},e.prototype.max=function(){for(var t=[],e=0,r=this._dimensions.length;e<r;e++){var n=this._dimensions[e];t[e]="string"==typeof n?n:n.max()}return t},e.prototype.min=function(){for(var t=[],e=0,r=this._dimensions.length;e<r;e++){var n=this._dimensions[e];t[e]="string"==typeof n?n:n.min()}return t},e.prototype.forEach=function(t){for(var e=0,r=this._dimensions.length;e<r;e++)t(this._dimensions[e],e,this)},e.prototype.dimension=function(t){return this._dimensions[t]||null},e.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&"string"==typeof this._dimensions[0]},e.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},e.prototype.isScalar=function(){return this._isScalar},e.prototype.toArray=function(){for(var t=[],e=0,r=this._dimensions.length;e<r;e++){var n=this._dimensions[e];t.push("string"==typeof n?n:n.toArray())}return t},e.prototype.valueOf=e.prototype.toArray,e.prototype.toString=function(){for(var t=[],e=0,r=this._dimensions.length;e<r;e++){var n=this._dimensions[e];"string"==typeof n?t.push(JSON.stringify(n)):t.push(n.toString())}return"["+t.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},e.fromJSON=function(t){return e.create(t.dimensions)},e}},function(t,e,r){"use strict";var n=r(19);e.name="Range",e.path="type",e.factory=function(t,e,r,o){function a(e,r,n){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(null!=e)if(t.isBigNumber(e))e=e.toNumber();else if("number"!=typeof e)throw new TypeError("Parameter start must be a number");if(null!=r)if(t.isBigNumber(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter end must be a number");if(null!=n)if(t.isBigNumber(n))n=n.toNumber();else if("number"!=typeof n)throw new TypeError("Parameter step must be a number");this.start=null!=e?parseFloat(e):0,this.end=null!=r?parseFloat(r):0,this.step=null!=n?parseFloat(n):1}return a.prototype.type="Range",a.prototype.isRange=!0,a.parse=function(t){if("string"!=typeof t)return null;var e=t.split(":").map((function(t){return parseFloat(t)}));if(e.some((function(t){return isNaN(t)})))return null;switch(e.length){case 2:return new a(e[0],e[1]);case 3:return new a(e[0],e[2],e[1]);default:return null}},a.prototype.clone=function(){return new a(this.start,this.end,this.step)},a.prototype.size=function(){var t=0,e=this.start,r=this.step,o=this.end-e;return n.sign(r)==n.sign(o)?t=Math.ceil(o/r):0==o&&(t=0),isNaN(t)&&(t=0),[t]},a.prototype.min=function(){var t=this.size()[0];return t>0?this.step>0?this.start:this.start+(t-1)*this.step:void 0},a.prototype.max=function(){var t=this.size()[0];return t>0?this.step>0?this.start+(t-1)*this.step:this.start:void 0},a.prototype.forEach=function(t){var e=this.start,r=this.step,n=this.end,o=0;if(r>0)for(;e<n;)t(e,[o],this),e+=r,o++;else if(r<0)for(;e>n;)t(e,[o],this),e+=r,o++},a.prototype.map=function(t){var e=[];return this.forEach((function(r,n,o){e[n[0]]=t(r,n,o)})),e},a.prototype.toArray=function(){var t=[];return this.forEach((function(e,r){t[r[0]]=e})),t},a.prototype.valueOf=function(){return this.toArray()},a.prototype.format=function(t){var e=n.format(this.start,t);return 1!=this.step&&(e+=":"+n.format(this.step,t)),e+=":"+n.format(this.end,t)},a.prototype.toString=function(){return this.format()},a.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},a.fromJSON=function(t){return new a(t.start,t.end,t.step)},a}},function(t,e){"use strict";e.name="index",e.factory=function(t,e,r,n){return n("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e){var r=e.map((function(e){return t.isBigNumber(e)?e.toNumber():Array.isArray(e)||t.isMatrix(e)?e.map((function(e){return t.isBigNumber(e)?e.toNumber():e})):e})),n=new t.Index;return t.Index.apply(n,r),n}})}},function(t,e){"use strict";e.name="sparse",e.factory=function(t,e,r,n){var o=t.SparseMatrix,a=n("sparse",{"":function(){return new o([])},string:function(t){return new o([],t)},"Array | Matrix":function(t){return new o(t)},"Array | Matrix, string":function(t,e){return new o(t,e)}});return a.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},a}},function(t,e,r){"use strict";var n=r(19).isInteger,o=r(29).resize;e.name="zeros",e.factory=function(t,e,a,i){var s=a(r(44)),l=i("zeros",{"":function(){return"Array"===e.matrix?c([]):c([],"default")},"...number | BigNumber | string":function(t){if("string"==typeof t[t.length-1]){var r=t.pop();return c(t,r)}return"Array"===e.matrix?c(t):c(t,"default")},Array:c,Matrix:function(t){var e=t.storage();return c(t.valueOf(),e)},"Array | Matrix, string":function(t,e){return c(t.valueOf(),e)}});return l.toTex=void 0,l;function c(e,r){var a=function(e){var r=!1;return e.forEach((function(e,n,o){t.isBigNumber(e)&&(r=!0,o[n]=e.toNumber())})),r}(e)?new t.BigNumber(0):0;if(function(t){t.forEach((function(t){if("number"!=typeof t||!n(t)||t<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),r){var i=s(r);return e.length>0?i.resize(e,a):i}var l=[];return e.length>0?o(l,e,a):l}}},function(t,e,r){var n=r(2),o=r(6),a=r(3);t.exports=function(t,e,r){var i,s,l=a.keys(r);a.each(l,(function(t){i=r[t],/[^a-z_]/i.test(i)&&(i=parseInt(i,10)),s=!1,a.each(e,(function(e){n.has(e,t)&&(s=!0)})),s&&(e=a.filter(e,(function(e){return e[t]==i})))}));var c,u,d=[],f=!1;return a.each(e,(function(e){c=!0,a.each(a.keys(t.viz.possible_filters),(function(r){u=o(t.viz.filter_data,r),e[r]!=u&&(c=!1)})),c?!1===f&&(f=!0,d.push(e)):d.push(e)})),d}},function(t,e){t.exports=function(t){var e={wrapper:{},row_search:{}};return 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,r){var n=r(3);t.exports=function(t,e){var r=n.keys(e)[0];return n.each(n.keys(t.viz.possible_filters),(function(n){if(n!=r&&!d3.select(t.root+" .slider_"+n).empty()){var o=d3.select(t.root+" .slider_"+n).attr("current_state");e[n]=o}})),e}},function(t,e,r){var n=r(68),o=r(69),a=r(71),i=r(72),s=r(73),l=r(74),c=r(75),u=r(76),d=r(81),f=r(83),p=r(2),h=r(5),v=r(84);t.exports=function(t,e=!0){return t.labels=n(t),t.viz=function(t,e=!0){var 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.cat_bar_width=180,r.cat_bar_height=20,r.tree_menu_width=400,r.tree_menu_height=237,r.tree_menu_x_offset=20,r.filter_menu_width=500,r.filter_menu_height=237,r.filter_menu_x_offset=20,r.update_button_width=100,r.viz_svg=r.viz_wrapper+" .viz_svg",r.zoom_element=r.viz_wrapper+" .viz_svg",r.uni_duration=1e3,r.bottom_space=10,r.run_trans=!1,r.duration=1e3,r.resize=t.resize,p.has(t,"size")?r.fixed_size=t.size:r.fixed_size=!1;r.border_fraction=65,r.uni_margin=5,r.super_labels={},r.super_labels.margin={},r.super_labels.dim={},r.super_labels.margin.left=r.grey_border_width,r.super_labels.margin.top=r.grey_border_width,r.super_labels.dim.width=0,t.labels.super_labels&&(r.super_labels.dim.width=15*t.labels.super_label_scale);r.triangle_opacity=.6,r.norm_labels={},r.norm_labels.width={},r.dendro_room={},r.show_dendrogram?r.dendro_room.symbol_width=10:r.dendro_room.symbol_width=0;r.cat_colors=t.cat_colors,r=v(t,r,e),0==_.has(t,"group_level")&&(r.show_dendrogram&&(t.group_level={}),0==_.has(t,"group_level")&&(t.group_level={}),t.group_level.row=5,t.group_level.col=5);r.dendro_opacity=.35,r.spillover_col_slant=r.norm_labels.width.col;var n=h(t.network_data.views);return r.possible_filters=n.possible_filters,r.filter_data=n.filter_data,r.viz_nodes={},r.viz_nodes.row=t.network_data.row_nodes_names,r.viz_nodes.col=t.network_data.col_nodes_names,r.viz_nodes.curr_row=t.network_data.row_nodes_names,r.viz_nodes.curr_col=t.network_data.col_nodes_names,r.x_offset=0,r}(t,e),o(t),(t=a(t)).viz=i(t.viz),t.viz=s(t.viz),t.viz=l(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t=c(t),t=u(t),t=d(t),t=f(t)}},function(t,e,r){var n=r(3);t.exports=function(t){var e={};return e.super_label_scale=t.super_label_scale,e.super_labels=t.super_labels,e.super_label_fs=13.8,e.super_labels&&(e.super={},e.super.row=t.super.row,e.super.col=t.super.col),e.show_label_tooltips=t.show_label_tooltips,e.row_max_char=n.max(t.network_data.row_nodes,(function(t){return t.name.length})).name.length,e.col_max_char=n.max(t.network_data.col_nodes,(function(t){return t.name.length})).name.length,e.max_allow_fs=t.max_allow_fs,e}},function(t,e,r){var n=r(70);t.exports=function(t){d3.select(t.root+" .viz_wrapper").empty()&&(d3.select(t.root).append("div").classed("sidebar_wrapper",!0),d3.select(t.root).append("div").classed("viz_wrapper",!0));var e=n(t);d3.select(t.root+" .sidebar_wrapper").style("float","left").style("width",t.sidebar_width+"px").style("height",e.height+"px").style("overflow","hidden"),d3.select(t.viz.viz_wrapper).style("float","left").style("width",e.width+"px").style("height",e.height+"px")}},function(t,e){t.exports=function(t){var e,r={},n=t.buffer_width,o=d3.select(t.root).style("width").replace("px",""),a=d3.select(t.root).style("height").replace("px","");return!1===t.viz.is_expand?(e=t.viz.outer_margins,r.width=o-t.sidebar_width-n):(e=t.viz.outer_margins,r.width=o-n),r.top=e.top,r.left=e.left,t.viz.resize?r.height=a:(t.viz.is_expand?r.width=t.viz.fixed_size.width:r.width=t.viz.fixed_size.width-t.sidebar_width,r.height=t.viz.fixed_size.height),r}},function(t,e){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){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){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)).rangeBand()/2;r>t.norm_labels.width.col&&(e*=t.norm_labels.width.col/r);return t.clust.dim={},t.clust.dim.width=e,t}},function(t,e){t.exports=function(t){var e=t.svg_dim.height-t.clust.margin.top-t.dendro_room.col-t.bottom_space;return t.clust.dim.height=e,t}},function(t,e,r){var n=r(3);t.exports=function(t){var e=Math.abs(n.max(t.network_data.col_nodes,(function(t){return Math.abs(t.value)})).value);return t.labels.bar_scale_col=d3.scale.linear().domain([0,e]).range([0,.75*t.viz.norm_labels.width.col]),e=Math.abs(n.max(t.network_data.row_nodes,(function(t){return Math.abs(t.value)})).value),t.labels.bar_scale_row=d3.scale.linear().domain([0,e]).range([0,t.viz.norm_labels.width.row]),t}},function(t,e,r){var n=r(77),o=r(79),a=r(3);t.exports=function(t){var e;return t.matrix=n(t),t.viz.x_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]),a.each(["row","col"],(function(r){"custom"===(e=t.viz.inst_order[r])&&(e="clust"),"row"===r?t.viz.x_scale.domain(t.matrix.orders[e+"_"+r]):t.viz.y_scale.domain(t.matrix.orders[e+"_"+r])})),t.viz.border_width={},t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,o(t),t}},function(t,e,r){var n=r(2),o=r(78),a=r(3);t.exports=function(t){var e={},r=t.network_data;e.tile_colors=t.tile_colors,e.bar_colors=t.bar_colors,e.outline_colors=t.outline_colors,e.hlight_color=t.highlight_color,e.tile_title=t.tile_title,e.show_tile_tooltips=t.show_tile_tooltips,e.make_tile_tooltip=t.make_tile_tooltip,e.distance_metric="cosine",e.linkage_type="average",e.filter_state="no-filter",e.normalization_state="no-normalization",e.click_hlight_x=-666,e.click_hlight_y=-666,e.click_hlight_row=-666,e.click_hlight_col=-666,e.def_large_matrix=2e4,e.opacity_function=t.opacity_scale,e.orders={},a.each(["row","col"],(function(o){var i,s=r[(i="row"===o?"col":"row")+"_nodes"],l=s.length,c=n.pluck(s,"name").sort(),u=a.map(c,(function(t){return r[i+"_nodes_names"].indexOf(t)}));e.orders["alpha_"+o]=u;var d=["clust","rank"];_.has(s[0],"rankvar")&&d.push("rankvar"),t.viz.all_cats[i].length>0&&a.each(t.viz.all_cats[i],(function(t){t=t.replace("-","_"),d.push(t+"_index")})),a.each(d,(function(t){var r=d3.range(l).sort((function(e,r){return s[r][t]-s[e][t]}));e.orders[t+"_"+o]=r}))})),n.has(r,"all_links")?e.max_link=a.max(r.all_links,(function(t){return Math.abs(t.value)})).value:e.max_link=a.max(r.links,(function(t){return Math.abs(t.value)})).value,e.abs_max_val=Math.abs(e.max_link)*t.clamp_opacity,0===t.input_domain?"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,e.abs_max_val]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,e.abs_max_val]).clamp(!0).range([0,1])):"linear"===e.opacity_function?e.opacity_scale=d3.scale.linear().domain([0,t.input_domain]).clamp(!0).range([0,1]):"log"===e.opacity_function&&(e.opacity_scale=d3.scale.log().domain([.001,t.input_domain]).clamp(!0).range([0,1]));var i=n.has(r.links[0],"value_up"),s=n.has(r.links[0],"value_dn");return e.tile_type=i||s?"updn":"simple",n.has(r.links[0],"highlight")?e.highlight=1:e.highlight=0,e.matrix=o(r),e.wait_tooltip=0,e}},function(t,e,r){var n=r(2);t.exports=function(t){var e,r,o=[];return r=!!n.has(t.links[0],"value_orig"),t.row_nodes.forEach((function(a,i){o[i]={},o[i].name=t.row_nodes[i].name,o[i].row_index=i,o[i].row_data=d3.range(t.col_nodes.length).map((function(o){return e=n.has(t.links[0],"value_up")||n.has(t.links[0],"value_dn")?{pos_x:o,pos_y:i,value:0,value_up:0,value_dn:0,highlight:0}:{pos_x:o,pos_y:i,value:0,highlight:0},r&&(e.value_orig=0),e}))})),t.links.forEach((function(t){o[t.source].row_data[t.target].value=t.value,o[t.source].row_data[t.target].row_name=t.row_name,o[t.source].row_data[t.target].col_name=t.col_name,(n.has(t,"value_up")||n.has(t,"value_dn"))&&(o[t.source].row_data[t.target].value_up=t.value_up,o[t.source].row_data[t.target].value_dn=t.value_dn),r&&(o[t.source].row_data[t.target].value_orig=t.value_orig),t.highlight&&(o[t.source].row_data[t.target].highlight=t.highlight),t.info&&(o[t.source].row_data[t.target].info=t.info)})),o}},function(t,e,r){var n=r(80);t.exports=function(t){var e=3/t.viz.rect_height;t.viz.ds_zt=2;var r=Math.floor(Math.log(e)/Math.log(2));if(t.viz.rect_height<2&&r>0){var o;t.viz.ds_opacity_scale=d3.scale.linear().domain([1,100]).range([1,2]).clamp(!0),t.viz.ds_num_levels=r,t.viz.ds=[],t.matrix.ds_matrix=[];for(var a=t.viz.inst_order.row,i=$.extend(!0,{},t.matrix.matrix),s=0;s<r;s++){t.viz.ds_level=0,(o={}).height=3,o.num_levels=r;var l=Math.pow(2,s);o.zt=l,o.num_rows=Math.round(t.viz.clust.dim.height/(o.height/l)),o.x_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.width]),o.x_scale.domain(t.matrix.orders[a+"_row"]),o.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]),o.y_scale.domain(d3.range(o.num_rows+1)),o.rect_height=o.y_scale.rangeBand()-t.viz.border_width.y,t.viz.ds.push(o);var c=n(t,i,s);t.matrix.ds_matrix.push(c)}t.viz.viz_nodes.row=d3.range(t.matrix.ds_matrix[0].length).map(String)}else t.viz.ds=null,t.viz.ds_level=-1,t.viz.ds_num_levels=0}},function(t,e,r){var n=r(3);t.exports=function(t,e,r){var o,a,i,s=t.viz.ds[r].num_rows,l=t.network_data.row_nodes.length/s,c=t.viz.ds_opacity_scale(l),u=t.viz.clust.dim.height/s,d=[],f=s+1;for(a=0;a<f;a++)(o={}).row_index=a,o.name=String(a),o.all_names=[],d.push(o);n.each(e,(function(e){var r=t.viz.y_scale(e.row_index),n=Math.round(r/u),o=e.row_data;if(d[n].all_names.push(e.name),_.has(d[n],"row_data"))for(i=0;i<o.length;i++)d[n].row_data[i].value=d[n].row_data[i].value+o[i].value;else{var a=[];for(i=0;i<o.length;i++)a[i]=o[i];d[n].row_data=a}})),n.each(d,(function(t){var e=t.row_data,r=t.all_names.length;n.each(e,(function(t){t.value=t.value/r*c}))}));var p=[];return n.each(d,(function(t){p=p.concat(t.all_names)})),d}},function(t,e,r){var n=r(82);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=t.viz.x_scale.rangeBand()/2;return t.viz.square_zoom=t.viz.norm_labels.width.col/e*.75,t.viz=n(t.viz),t}},function(t,e){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_ratio={},t.zoom_ratio.x=e/r,t.zoom_ratio.y=1,t.zoom_ratio.x<1&&(t.zoom_ratio.y=1/t.zoom_ratio.x,t.zoom_ratio.x=1),t}},function(t,e){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,r){var n=r(85),o=r(2),a=r(86),i=r(87),s=r(3);t.exports=function(t,e,r=!0){var l,c,u;e.show_categories={},e.all_cats={},e.cat_names={},e.cat_info={};var d={row:null,col:null};e.cat_colors={},e.cat_colors.value_opacity=d;var f=0;return s.each(["row","col"],(function(n){e.show_categories[n]=!1,e.all_cats[n]=[];var d=s.keys(t.network_data[n+"_nodes"][0]);d=d.sort(),s.each(d,(function(t){t.indexOf("cat-")>=0&&(e.show_categories[n]=!0,e.all_cats[n].push(t))})),e.cat_info[n]=null,e.show_categories[n]&&(e.cat_colors[n]={},e.cat_info[n]={},e.cat_names[n]={},s.each(e.all_cats[n],(function(r){var d=t.network_data[n+"_nodes"][0];"string"==typeof d[r]&&d[r].indexOf(": ")>0?(l=d[r].split(": ")[0],e.cat_names[n][r]=l):e.cat_names[n][r]=r;var p=o.pluck(t.network_data[n+"_nodes"],r),_=[];s.each(p,(function(t){var e;e=t.indexOf(": ")>0?t.split(": ")[1]:t,_.push(e)}));var h=s.uniq(p).sort();if("cat_strings"===(c=i(h)).type){var v=s.countBy(_);c.cat_hist=v}else c.cat_hist=null;e.cat_info[n][r]=c,e.cat_colors[n][r]={},s.each(h,(function(t,o){u=a.get_random_color(o+f),e.cat_colors[n][r][t]=u,"string"==typeof t&&(t.indexOf("Not ")>=0||t.indexOf(": false")>0)&&(e.cat_colors[n][r][t]="#eee"),f+=1}))}))),_.has(t.network_data,"cat_colors")&&!0===r&&(e.cat_colors[n]=t.network_data.cat_colors[n]),t.sim_mat&&(e.cat_colors.col=e.cat_colors.row)})),e.cat_colors=e.cat_colors,e.cat_colors.opacity=.6,e.cat_colors.active_opacity=.9,e=n(t,e)}},function(t,e,r){var n=r(3);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,n.each(["row","col"],(function(n){e.norm_labels.width[n]=o(t.labels[n+"_max_char"])*t[n+"_label_scale"],e["num_"+n+"_nodes"]=t.network_data[n+"_nodes"].length,e.dendro_room[n]="row"===n?e.dendro_room.symbol_width:e.dendro_room.symbol_width+3*e.uni_margin;var a,i=e.all_cats[n].length;e.show_categories[n]?(r=(i-1)*e.cat_room.separation,a="row"===n?i+1:i,e.cat_room[n]=a*e.cat_room.symbol_width+r):e.cat_room[n]="row"==n?e.cat_room.symbol_width:0})),e}},function(t,e){var r;function n(){return r.length}r=["#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:function(){return"#EEE"},get_random_color:function(t){return r[t%n()]},get_num_colors:n}},function(t,e,r){var n=r(3);t.exports=function(t){var e=t[0],r=!1,o=!1,a="cat_strings",i=NaN,s=[],l=null,c=": ";if("string"==typeof e&&e.indexOf(c)>-1&&(r=!0,e=e.split(c)[1]),0==isNaN(e)&&(o=!0),o&&(a="cat_values",n.each(t,(function(t){r&&(t=t.split(c)[1]),!0===isNaN(t)?a="cat_strings":(t=parseFloat(t),s.push(t))}))),"cat_values"===a){var u=n.max(s,(function(t){return Math.abs(t)}));i=Math.abs(u),l=d3.scale.linear().domain([0,i]).range([0,1])}var d={};return d.type=a,d.max_abs_val=i,d.cat_scale=l,d}},function(t,e){t.exports=function(){var t={zoom_x:1,zoom_y:1,trans_x:0,trans_y:0};return t}},function(t,e,r){var n=r(90),o=r(101),a=r(133),i=r(141),s=r(142),l=r(153),c=r(163),u=r(185),d=r(190),f=r(148),p=r(191),_=r(192),h=r(193),v=r(196),m=r(3);t.exports=function(t){var e=t.params;d3.select(e.viz.viz_wrapper+" svg").remove();var r=d3.select(e.viz.viz_wrapper).append("svg").attr("class","viz_svg").attr("id","svg_"+e.root.replace("#","")).attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height).attr("is_zoom",0).attr("stopped_zoom",1);function g(){var t=e.viz.super_border_color;return(e.viz.is_expand||0==e.show_viz_border)&&(t="white"),t}r.append("rect").attr("class","super_background").style("width",e.viz.svg_dim.width).style("height",e.viz.svg_dim.height).style("fill","white"),n(e,r),o(t),e.viz.show_dendrogram&&(p(t),_(t),v(t)),a(t),-1===e.viz.ds_level&&m.each(["row","col"],(function(t){Number(d3.select("."+t+"_label_group").select("text").style("font-size").replace("px",""))>8&&d3.selectAll(e.root+" ."+t+"_label_group").each((function(){f(e,this,t)}))})),d(t),e.viz.show_categories.col&&u(t),s(t),e.labels.super_labels&&i(e),h(t),d3.select(e.viz.viz_svg).append("rect").classed("left_border",!0).classed("borders",!0).attr("fill",g).attr("width",e.viz.grey_border_width).attr("height",e.viz.svg_dim.height).attr("transform","translate(0,0)"),d3.select(e.viz.viz_svg).append("rect").classed("right_border",!0).classed("borders",!0).attr("fill",g).attr("width",e.viz.grey_border_width).attr("height",e.viz.svg_dim.height).attr("transform",(function(){return"translate("+(e.viz.svg_dim.width-e.viz.grey_border_width)+",0)"})),d3.select(e.viz.viz_svg).append("rect").classed("top_border",!0).classed("borders",!0).attr("fill",g).attr("width",e.viz.svg_dim.width).attr("height",e.viz.grey_border_width).attr("transform",(function(){return"translate(0,0)"})),d3.select(e.viz.viz_svg).append("rect").classed("bottom_border",!0).classed("borders",!0).attr("fill",g).attr("width",e.viz.svg_dim.width).attr("height",e.viz.grey_border_width).attr("transform",(function(){return"translate(0,"+(e.viz.svg_dim.height-e.viz.grey_border_width)+")"})),l(t),c(t),e.viz.do_zoom&&d3.select(e.viz.zoom_element).call(e.zoom_behavior),d3.select(e.viz.zoom_element).on("dblclick.zoom",null)}},function(t,e,r){var n=r(2),o=r(91),a=r(92),i=r(93);t.exports=function(t,e){var r,s=t.network_data,l=[];(r=e.append("g").attr("class","clust_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.clust.margin.top+")").append("g").attr("class","clust_group").classed("clust_group",!0)).append("rect").classed("background",!0).classed("grey_background",!0).style("fill","#eee").style("opacity",.25).attr("width",t.viz.clust.dim.width).attr("height",t.viz.clust.dim.height),null===t.viz.ds?i(t,t.matrix.matrix,"all",t.viz.ds_level):i(t,t.matrix.ds_matrix[0],"all",t.viz.ds_level),"function"==typeof t.click_tile?d3.selectAll(t.root+" .tile").on("click",(function(e){var r={};r.row=t.network_data.row_nodes[e.pos_y].name,r.col=t.network_data.col_nodes[e.pos_x].name,r.value=e.value,n.has(e,"value_up")&&(r.value_up=e.value_up),n.has(e,"value_dn")&&(r.value_dn=e.value_dn),n.has(e,"info")&&(r.info=e.info),t.click_tile(r),a(t,this)})):t.tile_click_hlight&&d3.selectAll(t.root+" .tile").on("click",(function(){a(t,this)}));var c={};return c.enter=0,o(t,c,0),{get_clust_group:function(){return r},get_matrix:function(){return l},get_nodes:function(t){return"row"===t?s.row_nodes:s.col_nodes}}}},function(t,e){t.exports=function(t,e,r){}},function(t,e){t.exports=function(t,e){d3.select(e).each((function(r){var n=r.pos_x,o=r.pos_y;if(d3.selectAll(t.root+" .click_hlight").remove(),n!=t.matrix.click_hlight_x||o!=t.matrix.click_hlight_y){t.matrix.click_hlight_x=n,t.matrix.click_hlight_y=o;var a=.85,i=6*t.viz.border_width.x,s=6*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",s).attr("fill",t.matrix.hlight_color).attr("transform",(function(){return"translate("+t.viz.x_scale(n)+",0)"})).attr("opacity",a),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("left_hlight",!0).attr("width",i).attr("height",t.viz.y_scale.rangeBand()-.99*s).attr("fill",t.matrix.hlight_color).attr("transform",(function(){return"translate("+t.viz.x_scale(n)+","+.99*s+")"})).attr("opacity",a),d3.select(e.parentNode).append("rect").classed("click_hlight",!0).classed("right_hlight",!0).attr("width",i).attr("height",t.viz.y_scale.rangeBand()-.99*s).attr("fill",t.matrix.hlight_color).attr("transform",(function(){return"translate("+(t.viz.x_scale(n)+t.viz.x_scale.rangeBand()-i)+","+.99*s+")"})).attr("opacity",a),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*i})).attr("height",s).attr("fill",t.matrix.hlight_color).attr("transform",(function(){return"translate("+(t.viz.x_scale(n)+.99*i)+","+(t.viz.y_scale.rangeBand()-s)+")"})).attr("opacity",a)}else t.matrix.click_hlight_x=-666,t.matrix.click_hlight_y=-666}))}},function(t,e,r){var n=r(94),o=r(100),a=r(3);t.exports=function(t,e,r="all",i=-1){var s=t.viz.y_scale,l=!0,c="row";if(i>=0&&(s=t.viz.ds[i].y_scale,l=!1,c="ds"+String(i)+"_row"),l)var u=o().attr("class",(function(){var e=t.viz.root_tips.replace(".","");return e+" d3-tip "+e+"_tile_tip"})).style("display","none").direction("nw").offset([0,0]).html((function(e){var r,n=String(e.value.toFixed(3));if(t.keep_orig){var o=String(e.value_orig.toFixed(3));r="<p>"+e.row_name+" and "+e.col_name+"</p><p> normalized value: "+n+"</p><div> original value: "+o+"</div>"}else r="<p>"+e.row_name+" and "+e.col_name+"</p><div> value: "+n+"</div>";return r}));else u=null;var d=[];"all"===r?d=e:a.each(e,(function(t){a.contains(r,t.name)&&d.push(t)})),d3.select(t.root+" .clust_group").selectAll(".row").data(d,(function(t){return t.name})).enter().append("g").classed(c,!0).attr("transform",(function(t){return"translate(0,"+s(t.row_index)+")"})).each((function(e){n(t,e,u,this,i)})),-1===t.viz.ds_level&&null!=u&&d3.selectAll(t.root+" .row").call(u)}},function(t,e,r){var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99),l=r(3);t.exports=function(t,e,r,c,u=-1){var d,f=e.row_data,p=t.viz.rect_height;u>=0&&(p=t.viz.ds[u].rect_height),d=!1===!!_.has(t.network_data.links[0],"value_orig")?l.filter(f,(function(t){return 0!==t.value})):f;var h=d3.select(c).selectAll("rect").data(d,(function(t){return t.col_name})).enter().append("rect").attr("class","tile row_tile").attr("width",t.viz.rect_width).attr("height",p).style("fill",(function(e){return"NaN"===e.value_orig?"#000000":e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]})).style("fill-opacity",(function(e){return"NaN"===e.value_orig?.175:t.matrix.opacity_scale(Math.abs(e.value))})).attr("transform",(function(e){return s(t,e)}));if(h.on("mouseover",(function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];a(t,this,r,n)})).on("mouseout",(function(){i(t,this,r)})),"updn"==t.matrix.tile_type){var v=l.filter(f,(function(t){return 0!=t.value_up||0!=t.value_dn}));d3.select(c).selectAll(".tile_up").data(v,(function(t){return t.col_name})).enter().append("path").attr("class","tile_up").attr("d",(function(){return n(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(...e){a(t,this,r,e)})).on("mouseout",(function(){i(t,this,r)})),d3.select(c).selectAll(".tile_dn").data(v,(function(t){return t.col_name})).enter().append("path").attr("class","tile_dn").attr("d",(function(){return o(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(...e){a(t,this,r,e)})).on("mouseout",(function(){i(t,this,r)})),h.each((function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()}))}t.matrix.tile_title&&h.append("title").text((function(t){return"value: "+t.value}))}},function(t,e){t.exports=function(t){var e=t.viz.x_scale.rangeBand()-t.viz.border_width.x;return"M0,0 L0, "+(t.viz.y_scale.rangeBand()-t.viz.border_width.y)+" L"+e+",0 Z"}},function(t,e){t.exports=function(t){var e=t.viz.x_scale.rangeBand()-t.viz.border_width.x;return"M0, "+(t.viz.y_scale.rangeBand()-t.viz.border_width.y)+" L"+e+", "+(t.viz.y_scale.rangeBand()-t.viz.border_width.y)+" L"+e+",0 Z"}},function(t,e,r){var n=r(3);t.exports=function(t,e,r,o){var a,i=o[0],s=[].slice.call(o);d3.select(e).classed("hovering",!0),n.each(["row","col"],(function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight",(function(t){return i[e+"_name"].replace(/_/g," ")===t.name?"bold":"normal"}))})),s.push(e),clearTimeout(a),a=setTimeout((function(){if(d3.select(e).classed("hovering")){if(0===Number(d3.select(t.root+" .viz_svg").attr("is_zoom"))&&t.matrix.show_tile_tooltips&&null!==r&&(d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","block"),r.show.apply(e,s),null!=t.tile_tip_callback)){var n=s[0];t.tile_tip_callback(n)}}}),1e3,e)}},function(t,e,r){var n=r(3);t.exports=function(t,e,r){d3.select(e).classed("hovering",!1),d3.selectAll(t.viz.root_tips+"_tile_tip").style("display","none"),n.each(["row","col"],(function(e){d3.selectAll(t.root+" ."+e+"_label_group text").style("font-weight","normal")})),null!=r&&r.hide()}},function(t,e){t.exports=function(t,e){return"translate("+((e.pos_x in t.viz.x_scale.domain()?t.viz.x_scale(e.pos_x):0)+.5*t.viz.border_width.x)+","+.5*t.viz.border_width.y+")"}},function(t,e){t.exports=function(){var t=function(){return"n"},e=function(){return[0,0]},r=function(){return" "},n=function(){var t=d3.select(document.createElement("div"));return t.style({position:"absolute",opacity:0,pointerEvents:"none",boxSizing:"border-box"}),t.node()}(),o=null,a=null,i=null;function s(t){o=function(t){if("svg"==(t=t.node()).tagName.toLowerCase())return t;return t.ownerSVGElement}(t),a=o.createSVGPoint(),document.body.appendChild(n)}s.show=function(){var o=Array.prototype.slice.call(arguments);o[o.length-1]instanceof SVGElement&&(i=o.pop());var a,u=r.apply(this,o),p=e.apply(this,o),_=t.apply(this,o),h=d3.select(n),v=0;for(h.html(u).style({opacity:1,"pointer-events":"all"}).style("z-index",99);v--;)h.classed(c[v],!1);if(a=l.get(_).apply(this),h.classed(_,!0).style({top:a.top+p[0]+"px",left:a.left+p[1]+"px"}),!1===f(this)){var m=d3.select(this).attr("class");m.indexOf("tile")>=0&&setTimeout(d,5e3,this)}return s},s.hide=function(){return d3.select(n).style({opacity:0,"pointer-events":"none"}),s},s.attr=function(t){if(arguments.length<2&&"string"==typeof t)return d3.select(n).attr(t);var e=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d3.select(n),e),s},s.style=function(t){if(arguments.length<2&&"string"==typeof t)return d3.select(n).style(t);var e=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d3.select(n),e),s},s.direction=function(e){return arguments.length?(t=null==e?e:d3.functor(e),s):t},s.offset=function(t){return arguments.length?(e=null==t?t:d3.functor(t),s):e},s.html=function(t){return arguments.length?(r=null==t?t:d3.functor(t),s):r};var l=d3.map({n:function(){var t=u();return{top:t.n.y-n.offsetHeight,left:t.n.x-n.offsetWidth/2}},s:function(){var t=u();return{top:t.s.y,left:t.s.x-n.offsetWidth/2}},e:function(){var t=u();return{top:t.e.y-n.offsetHeight/2,left:t.e.x}},w:function(){var t=u();return{top:t.w.y-n.offsetHeight/2,left:t.w.x-n.offsetWidth}},nw:function(){var t=u();return{top:t.nw.y-n.offsetHeight,left:t.nw.x-n.offsetWidth}},ne:function(){var t=u();return{top:t.ne.y-n.offsetHeight,left:t.ne.x}},sw:function(){var t=u();return{top:t.sw.y,left:t.sw.x-n.offsetWidth}},se:function(){var t=u();return{top:t.se.y,left:t.e.x}},south_custom:function(){var t=u();return{top:t.s.y,left:t.s.x}}}),c=l.keys();function u(){var t=i||d3.event.target,e={},r=t.getScreenCTM(),n=t.getBBox(),o=n.width,s=n.height,l=n.x,c=n.y,u=document.documentElement.scrollTop||document.body.scrollTop,d=document.documentElement.scrollLeft||document.body.scrollLeft;return r.a=1,r.d=1,r.e=r.e+d,r.f=r.f+u,a.x=l,a.y=c,e.nw=a.matrixTransform(r),a.x=a.x+o,e.ne=a.matrixTransform(r),a.y=a.y+s,e.se=a.matrixTransform(r),a.x=a.x-o,e.sw=a.matrixTransform(r),a.y=a.y-s/2,e.w=a.matrixTransform(r),a.x=a.x+o,e.e=a.matrixTransform(r),a.x=a.x-o/2,a.y=a.y-s/2,e.n=a.matrixTransform(r),a.y=a.y+s,e.s=a.matrixTransform(r),e}function d(t){d3.select(t).classed("hovering")&&d3.selectAll(".d3-tip").transition().duration(250).style("opacity",0).style("display","none")}function f(t){return t&&"[object Function]"==={}.toString.call(t)}return s}},function(t,e,r){var n=r(102);t.exports=function(t,e){var r,o=t.params;r=d3.select(o.viz.viz_svg+" .row_container").empty()?d3.select(o.viz.viz_svg).append("g").classed("row_container",!0).attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"):d3.select(o.viz.viz_svg).select(".row_container").attr("transform","translate("+o.viz.norm_labels.margin.left+","+o.viz.clust.margin.top+")"),d3.select(o.root+" .row_white_background").empty()&&r.append("rect").classed("row_white_background",!0).classed("white_bars",!0).attr("fill",o.viz.background_color).attr("width",o.viz.label_background.row).attr("height",30*o.viz.clust.dim.height+"px"),d3.select(o.root+" .row_label_container").empty()?r.append("g").classed("row_label_container",!0).attr("transform","translate("+o.viz.norm_labels.width.row+",0)").append("g").classed("row_label_zoom_container",!0):r.select(o.root+" .row_label_container").attr("transform","translate("+o.viz.norm_labels.width.row+",0)"),-1===o.viz.ds_level&&n(t,"all",e)}},function(t,e,r){var n=r(2),o=r(103),a=r(104),i=r(132),s=r(3);t.exports=function(t,e="all",r=0){var l=t.params,c=[];"all"===e?c=l.network_data.row_nodes:s.each(l.network_data.row_nodes,(function(t){s.contains(e,t.name)&&c.push(t)}));var u=d3.select(l.root+" .row_label_zoom_container").selectAll("g").data(c,(function(t){return t.name})).enter().append("g").classed("row_label_group",!0),d=l.network_data.row_nodes_names;u.attr("transform",(function(t){var e=s.indexOf(d,t.name);return"translate(0,"+l.viz.y_scale(e)+")"})),u.on("dblclick",(function(e){var r=this.__data__.name;a(t,this,r),l.tile_click_hlight&&o(this,e.ini)})),i(l),u.insert("rect").style("opacity",0),u.append("text").attr("y",.5*l.viz.rect_height+.35*l.labels.default_fs_row).attr("text-anchor","end").style("font-size",l.labels.default_fs_row+"px").text((function(t){return n.normal_name(t)})).attr("pointer-events","none").style("opacity",0).style("cursor","default").transition().delay(r).duration(r).style("opacity",1),u.each((function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",l.viz.y_scale.rangeBand()).style("fill",(function(){return"yellow"})).style("opacity",(function(t){var e=0;return 1===t.target&&(e=1),e}))})),n.has(l.network_data.row_nodes[0],"value")&&u.append("rect").classed("row_bars",!0).attr("width",(function(t){return l.labels.bar_scale_row(Math.abs(t.value))})).attr("x",(function(t){return-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){t.exports=function(t,e,r){if(r!=t.click_hlight_row){var n=6*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",.85),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",.85).attr("transform",(function(){return"translate(0,"+(t.viz.y_scale.rangeBand()-n)+")"}))}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_row=-666}},function(t,e,r){var n=r(105),o=r(106),a=r(88),i=r(131),s=r(79),l=r(3);t.exports=function(t,e,r){var c=t.params,u=i(c);if(1===u.zoom_y&&1===u.zoom_x){c.viz.inst_order.row="custom",o(t,"col"),d3.selectAll(c.root+" .toggle_col_order .btn").classed("active",!1),c.viz.run_trans=!0;var d=$.extend(!0,{},c.matrix.matrix),f=c.network_data.row_nodes,p=c.network_data.col_nodes,_=[];f.forEach((function(t){_.push(t.name)})),r=l.indexOf(_,r),_=[],p.forEach((function(t,e){_.push(d[r].row_data[e].value)}));var h,v=d3.range(_.length).sort((function(t,e){return _[e]-_[t]}));c.viz.x_scale.domain(v),c.matrix.orders.custom_row=v,h=c.network_data.links.length>c.matrix.def_large_matrix?d3.select(c.root+" .viz_svg"):d3.select(c.root+" .viz_svg").transition().duration(2500);var m=c.network_data.col_nodes_names;h.select(".col_zoom_container").selectAll(".col_label_text").attr("transform",(function(t){var e=l.indexOf(m,t.name);return"translate("+c.viz.x_scale(e)+")rotate(-90)"})),h.selectAll(".col_cat_group").attr("transform",(function(t){var e=l.indexOf(m,t.name);return"translate("+c.viz.x_scale(e)+",0)"})),-1===c.viz.ds_level&&(h.selectAll(".tile").attr("transform",(function(t){return"translate("+c.viz.x_scale(t.pos_x)+",0)"})),h.selectAll(".tile_up").attr("transform",(function(t){return"translate("+c.viz.x_scale(t.pos_x)+",0)"})),h.selectAll(".tile_dn").attr("transform",(function(t){return"translate("+c.viz.x_scale(t.pos_x)+",0)"}))),d3.selectAll(c.root+" .row_label_group").select("rect").style("opacity",0),d3.select(e).select("rect").style("opacity",1),n(c),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=a(),setTimeout((function(){c.viz.run_trans=!1}),2500),c.viz.ds_num_levels>0&&c.viz.ds_level>=0&&s(c)}}},function(t,e){t.exports=function(t){var e=6*t.viz.border_width.x,r=6*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.x_scale.rangeBand()).attr("height",r).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",e).attr("height",t.viz.y_scale.rangeBand()-.99*r).transition().duration(2500).attr("transform",(function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*r+")"})),d3.select(t.root+" .right_hlight").attr("width",e).attr("height",t.viz.y_scale.rangeBand()-.99*r).transition().duration(2500).attr("transform",(function(){return"translate("+(t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.x_scale.rangeBand()-e)+","+.99*r+")"})),d3.select(t.root+" .bottom_hlight").attr("width",(function(){return t.viz.x_scale.rangeBand()-1.98*e})).attr("height",r).transition().duration(2500).attr("transform",(function(){return"translate("+(t.viz.x_scale(t.matrix.click_hlight_x)+.99*e)+","+(t.viz.y_scale.rangeBand()-r)+")"}))}},function(t,e,r){var n=r(107);t.exports=function(t,e,r=1500){var o=t.params;"row"===e&&"clust"===o.viz.inst_order.col&&setTimeout(n,r,t,"row",!0),"col"===e&&"clust"===o.viz.inst_order.row&&setTimeout(n,r,t,"col",!0),"clust"!=o.viz.inst_order.row&&!1===o.viz.dendro_filter.col&&(d3.selectAll(o.root+" .col_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null),d3.select(o.root+" .col_slider_group").style("opacity",0),d3.selectAll(o.root+" .col_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null)),"clust"!=o.viz.inst_order.col&&!1===o.viz.dendro_filter.row&&(d3.selectAll(o.root+" .row_dendro_group").style("opacity",0).on("mouseover",null).on("mouseout",null).on("click",null),d3.select(o.root+" .row_slider_group").style("opacity",0),d3.selectAll(o.root+" .row_dendro_crop_buttons").style("opacity",0).on("mouseover",null).on("mouseout",null))}},function(t,e,r){var n=r(108),o=r(109),a=r(110),i=r(100),s=r(112),l=r(115);t.exports=function(t,e,r=!1){var c,u,d=t.params;"both"===e&&(e="row"),c="row"===e?"col":"row","clust"===d.viz.inst_order[c]&&d3.select(d.root+" ."+e+"_slider_group").style("opacity",1),d.viz.show_dendrogram&&(u="row"===e?n(d):o(d),!1===d3.select(t.params.root+" ."+e+"_dendro_crop_buttons").empty()&&s(t,e));var f=d.viz.dendro_opacity;function p(t,r,n){if(d3.select(t).classed("hovering")){var o=d.viz.root_tips+"_"+e+"_dendro_tip";d3.select(o+" .cat_graph").empty()&&null!==d.viz.cat_info[e]&&l(d,e,r,u[n],o,!0),d3.selectAll(d.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",1)}}var _;d3.selectAll(t.params.viz.root_tips+"_"+e+"_dendro_tip").remove(),d3.selectAll(d.root+" ."+e+"_dendro_group").empty()?_=!1:(_=!0,d3.selectAll(d.root+" ."+e+"_dendro_group").remove());var h=i().attr("class",(function(){var t=d.viz.root_tips.replace(".","");return t+" d3-tip "+t+"_"+e+"_dendro_tip"})).direction("nw").offset([0,-5]).style("display","none").style("opacity",0);h.html((function(){return'<div class="cluster_info_container"></div>Click for cluster information <br>and additional options.'})),r&&(_=!1);var v,m,g,y,w,x,b,z=d3.select(d.root+" ."+e+"_dendro_container").selectAll("path").data(u,(function(t){return t.name})).enter().append("path").style("opacity",0).attr("class",e+"_dendro_group").style("fill","black");z.attr("d",(function(t){return"row"===e?(v=0,m=t.pos_top,g=30,y=t.pos_mid,w=0,x=t.pos_bot):(v=t.pos_top,m=0,g=t.pos_mid,y=30,w=t.pos_bot,x=0),"M"+v+","+m+" L"+g+", "+y+" L"+w+","+x+" Z"})),z.on("mouseover",(function(r,n){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"),a(d,this,r,e),h.show(r),d3.select(d.viz.root_tips+"_"+e+"_dendro_tip").style("opacity",0),setTimeout(p,500,this,r,n)})).on("mouseout",(function(){"clust"===d.viz.inst_order[c]&&d3.select(this).style("opacity",f),d3.selectAll(d.root+" .dendro_shadow").remove(),d3.select(this).classed("hovering",!1),h.hide(this)})).on("click",(function(r,n){$(d.root+" .dendro_info").modal("toggle");var o=r.all_names.join(", ");d3.select(d.root+" .dendro_info input").attr("value",o);var a=d.root+" .dendro_info";d3.selectAll(".dendro_info .cluster_info_container .cat_graph").remove(),null!==d.viz.cat_info[e]&&l(d,e,r,u[n],a),null!=t.params.dendro_click_callback&&t.params.dendro_click_callback(this)})).call(h),b="clust"===d.viz.inst_order[c]?f:0,_?d3.select(d.root+" ."+e+"_dendro_container").selectAll("path").transition().delay(1e3).duration(1e3).style("opacity",b):d3.select(d.root+" ."+e+"_dendro_container").selectAll("path").style("opacity",b)}},function(t,e,r){var n=r(3);t.exports=function(t){var e={},r=t.group_level.row,o=t.network_data.row_nodes,a=t.network_data.row_nodes_names;n.each(o,(function(o){var i=o.group[r],s=n.indexOf(a,o.name),l=t.viz.y_scale(s),c=l+t.viz.y_scale.rangeBand();!1===n.has(e,i)&&(e[i]={},e[i].name_top=o.name,e[i].name_bot=o.name,e[i].pos_top=l,e[i].pos_bot=c,e[i].pos_mid=(l+c)/2,e[i].name=i,e[i].all_names=[],e[i].inst_rc="row"),e[i].all_names.push(o.name),l<e[i].pos_top&&(e[i].name_top=o.name,e[i].pos_top=l,e[i].pos_mid=(l+e[i].pos_bot)/2),c>e[i].pos_bot&&(e[i].name_bot=o.name,e[i].pos_bot=c,e[i].pos_mid=(e[i].pos_top+c)/2)}));var i=[];return n.each(e,(function(t){i.push(t)})),i}},function(t,e,r){var n=r(3);t.exports=function(t){var e={},r=t.group_level.col,o=t.network_data.col_nodes,a=t.network_data.col_nodes_names;n.each(o,(function(o){var i=o.group[r],s=n.indexOf(a,o.name),l=t.viz.x_scale(s),c=l+t.viz.x_scale.rangeBand();!1===n.has(e,i)&&(e[i]={},e[i].name_top=o.name,e[i].name_bot=o.name,e[i].pos_top=l,e[i].pos_bot=c,e[i].pos_mid=(l+c)/2,e[i].name=i,e[i].all_names=[],e[i].inst_rc="col"),e[i].all_names.push(o.name),l<e[i].pos_top&&(e[i].name_top=o.name,e[i].pos_top=l,e[i].pos_mid=(l+e[i].pos_bot)/2),c>e[i].pos_bot&&(e[i].name_bot=o.name,e[i].pos_bot=c,e[i].pos_mid=(e[i].pos_top+c)/2)}));var i=[];return n.each(e,(function(t){i.push(t)})),i}},function(t,e,r){var n=r(111);t.exports=function(t,e,r,o){d3.selectAll(t.root+" ."+o+"_dendro_crop_buttons")[0].length>1?setTimeout((function(){d3.select(e).classed("hovering")&&!1===t.is_slider_drag&&(d3.select(e).style("opacity",.7),!1===d3.select(t.viz.viz_svg).classed("running_update")&&("row"===o?"clust"===t.viz.inst_order.col&&n(t,e,o,r):"col"===o?"clust"===t.viz.inst_order.row&&n(t,e,o,r):"both"===o&&("clust"===t.viz.inst_order.col&&n(t,e,"row",r),"clust"===t.viz.inst_order.row&&n(t,e,"col",r))))}),500):d3.selectAll(t.root+" .dendro_shadow").remove()}},function(t,e){t.exports=function(t,e,r,n){var o,a=.2;d3.selectAll(t.root+" .dendro_shadow").remove(),"row"==r?(d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",n.pos_top+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.height-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",t.viz.clust.dim.width+"px").attr("height",o+"px").attr("transform","translate(0,"+n.pos_bot+")").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a)):"col"===r&&(d3.select(t.root+" .clust_group").append("rect").attr("width",n.pos_top+"px").attr("height",t.viz.clust.dim.height+"px").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a),o=t.viz.clust.dim.width-n.pos_bot,d3.select(t.root+" .clust_group").append("rect").attr("width",o+"px").attr("height",t.viz.clust.dim.height+"px").attr("transform","translate("+n.pos_bot+",0)").attr("fill","black").classed("dendro_shadow",!0).attr("opacity",a))}},function(t,e,r){var n=r(108),o=r(109),a=r(100),i=r(110),s=r(113),l=r(114);t.exports=function(t,e){var r,c,u=t.params,d=.6*u.viz.dendro_opacity;"row"===e?(r=n(u),c="col"):(r=o(u),c="row");var f,p,_,h,v,m,g,y=a().attr("class",(function(){var t=u.viz.root_tips.replace(".","");return t+" d3-tip "+t+"_"+e+"_dendro_crop_tip"})).direction("nw").style("display","none").offset([5,-5]);d3.selectAll(u.viz.root_tips+"_"+e+"_dendro_crop_tip").remove(),d3.selectAll(u.root+" ."+e+"_dendro_crop_buttons").remove();var w,x,b,z=.25,k=e+"_dendro_crop_buttons";function A(t){d3.select(t).classed("hovering")&&d3.selectAll(u.viz.root_tips+"_"+e+"_dendro_crop_tip").style("opacity",1).style("display","block")}!1===d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter")?(f=d3.select(u.root+" ."+e+"_dendro_icons_group").selectAll("path").data(r,(function(t){return t.name})).enter().append("path").classed(k,!0).attr("d",(function(t){w=10,x=10;var r=t.pos_bot-t.pos_top;"row"===e?(r<45&&(w=r*z),p=x,_=-w,h=0,v=0,m=x,g=w,b=w):(r<45&&(x=r*z),p=-x,_=w,h=0,v=0,m=x,g=w,b=x);return d3.select(this)[0][0].__data__.tri_dim=b,"M"+p+","+_+" L"+h+", "+v+" L"+m+","+g+" Z"})),y.html((function(){return"Click to crop cluster"}))):(f=d3.select(u.root+" ."+e+"_dendro_icons_group").selectAll("path").data(r,(function(t){return t.name})).enter().append("path").classed(k,!0).attr("d",(function(t){w=10,x=12;var r=t.pos_bot-t.pos_top;"row"===e?(r<45&&(w=r*z),p=0,_=-w,h=x,v=0,m=0,g=w):(r<45&&(x=r*z),p=-x,_=0,h=0,v=w,m=x,g=0);return d3.select(this)[0][0].__data__.tri_dim=10,"M"+p+","+_+" L"+h+", "+v+" L"+m+","+g+" Z"})),y.html((function(){return"Click to undo crop"}))),f.style("cursor","pointer").style("opacity",(function(){return d})).attr("transform",(function(t){var r,n;return"row"===e?(r=u.viz.uni_margin,n=t.pos_mid):(r=t.pos_mid,n=u.viz.uni_margin),"translate("+r+","+n+")"})).on("mouseover",(function(t){d3.select(this).classed("hovering",!0),y.show(t),i(u,this,t,e),d3.selectAll(u.viz.root_tips+"_"+e+"_dendro_crop_tip").style("opacity",0).style("display","block"),setTimeout(A,500,this)})).on("mouseout",(function(){d3.select(this).classed("hovering",!1),d3.selectAll(u.root+" .dendro_shadow").remove(),d3.select(this).style("opacity",d),y.hide(this)})).on("click",(function(r){d3.select(this).style("opacity",.9).transition().duration(1e3).style("opacity",0),d3.selectAll(u.root+" .dendro_shadow").remove(),!1===t.params.dendro_filter.row&&!1===t.params.dendro_filter.col&&!1===t.params.cat_filter.row&&!1===t.params.cat_filter.col?(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"===u.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(y),"clust"!=u.viz.inst_order[c]&&d3.select(u.root+" ."+e+"_dendro_icons_group").selectAll("path").style("display","none"),l(u,u.zoom_info,e)}},function(t,e){t.exports=function(t,e,r){var n={};if(!1===t.params.dendro_filter.row&&!1===t.params.dendro_filter.col&&!1===t.params.cat_filter.row&&!1===t.params.cat_filter.col){d3.select(t.params.root+" ."+r+"_slider_group").style("opacity",.35).style("pointer-events","none"),n[r]=e.all_names;var o=t.params.network_data[r+"_nodes_names"],a=t.params.network_data.row_nodes,i=t.params.network_data.col_nodes;t.filter_viz_using_names(n),t.params.inst_nodes.row_nodes=a,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]=o}else n[r]=t.params.dendro_filter[r],t.filter_viz_using_names(n),t.params.dendro_filter[r]=!1}},function(t,e){t.exports=function(t,e,r){function n(t,e){var r;e*t<10?r=1:r=t/(10/e);return r}"row"===r?d3.select(t.root+" .row_dendro_icons_group").selectAll("path").attr("transform",(function(r){return"translate("+t.viz.uni_margin+","+r.pos_mid+") scale(1, "+1/n(e.zoom_y,d3.select(this).data()[0].tri_dim)+")"})):d3.select(t.root+" .col_dendro_icons_group").selectAll("path").attr("transform",(function(r){return"translate("+r.pos_mid+","+t.viz.uni_margin+") scale("+1/n(e.zoom_x,d3.select(this).data()[0].tri_dim)+", 1)"}))}},function(t,e,r){var n=r(116),o=r(3),a=r(129),i=r(130);t.exports=function(t,e,r,s,l,c=!1){"both"===e&&(e="row");var u=n(t,r,e);if(u.length>0){var d=d3.select(l+" .cluster_info_container"),f=370,p=177,_=!1;null!=u[0].bar_data[0][5]&&(f+=100,p=p+150-47,_=!0);var h=s.all_names.length,v=4;if(_){v=5;var m=u[0].bar_data;h=0,o.each(m,(function(t){h+=t[5]}))}var g=20;o.each(u.slice(0,3),(function(t){var e=t.bar_data.length;e>25&&(e=25),g+=27*(e+1)})),c&&d.append("text").text("Cluster Information");var y=d.append("div").style("margin-top","5px").classed("cat_graph",!0).append("svg").style("height",g+"px").style("width",f+"px");d.style("margin-bottom","5px"),y.append("rect").classed("cat_background",!0).attr("height",g+"px").attr("width",f+"px").attr("fill","white").attr("opacity",1),u=u.slice(0,3);var w=d3.scale.linear().domain([0,1e5]).range([20,30]),x=27;if(o.each(u,(function(e){var r=e.bar_data[0][v],n=w(r),o=y.append("g").classed("cat_graph_group",!0).attr("transform","translate(10, "+x+")"),s=o.append("g").classed("cat_bar_container",!0).attr("transform","translate(0, 10)").selectAll("g").data(e.bar_data).enter().append("g").attr("transform",(function(t,e){return"translate(0,"+23*e+")"}));a(t,e,o,27,v,25,s),i(t,o,s,4,_,n,v,h),x+=27*(e.bar_data.length+1)})),c){var b=d3.select(l),z=b.style("top").split(".px")[0],k=b.style("left").split(".px")[0],A=0,E=0;"row"===e?(A=0,E=p):(A=g+32,E=30),b.style("top",(function(){return String(parseInt(z,10)-A)+"px"})).style("left",(function(){return String(parseInt(k,10)-E)+"px"}))}}}},function(t,e,r){var n=r(117),o=r(3);t.exports=function(t,e,r){"both"===r&&(r="row");var a,i=e.all_names,s=[],l=t.network_data[r+"_nodes"],c=null,u=!1;o.each(l,(function(t){a=t.name,i.indexOf(a)>=0&&s.push(t)}));var d=[];if(null!==t.viz.cat_info[r]){for(var f,p,h,v=t.viz.cat_info[r],m=o.keys(v),g=[],y=[],w=0;w<m.length;w++)h="cat-"+String(w),"cat_strings"===t.viz.cat_info[r][h].type?(f=t.viz.cat_names[r][h],y.push(f),g.push(h)):"number in clust"===t.viz.cat_names[r][h]&&(c=h,u=!0);var x,b,z={},k={},A=4;if(u&&(A=5),b=f===h,y.length>0){var E,N=i.length;o.each(g,(function(e){if(p=e.split("-")[1],f=y[p],b)if(e.indexOf("-")>=0){var a=parseInt(e.split("-")[1],10)+1;f="Category "+String(a)}else f="Category";var i,l;z[f]={},o.each(s,(function(t){(E=t[e]).indexOf(": ")>=0&&(E=E.split(": ")[1]),E in z[f]?(z[f][E].num_nodes=z[f][E].num_nodes+1,null!=c&&(z[f][E].num_nodes_ds=z[f][E].num_nodes_ds+parseInt(t[c].split(": ")[1],10))):(z[f][E]={},z[f][E].num_nodes=1,null!=c&&(z[f][E].num_nodes_ds=parseInt(t[c].split(": ")[1],10)))})),(k={}).type_name=f,k.num_in_clust=N,x=[];var u=z[f];for(var h in u){var v=t.viz.cat_info[r][e].cat_hist[h]/t.network_data[r+"_nodes"].length;l=b?h:f+": "+h;var m=u[h].num_nodes,g=n(m,N,v);if(_.has(u[h],"num_nodes_ds"))var w=u[h].num_nodes_ds;else w=null;i=t.viz.cat_colors[r][e][l],x.push([e,l,u[h],i,m,w,g])}x.sort((function(t,e){return e[A]-t[A]})),k.bar_data=x,d.push(k)}))}}return d}},function(t,e,r){var n=r(118),o=r(13).create();o.import(r(119)),t.exports=function(t,e,r){var a,i=o.factorial;function s(t,e,r){return r=i(e)/(i(t)*i(e-t))*(Math.pow(r,t)*Math.pow(1-r,e-t))}return a=function(t,e,r){for(var n=0,o=t;o<e+1;o++)n+=s(o,e,r);return n}(t,e,r),isNaN(a)&&(a=function(t,e,r){for(var o=(t-e*r)/Math.sqrt(e*r*(1-r)),i=n.z,s=n.p,l=-1,c=!1,u=0;u<i.length;u++)o<i[u]&&!1===c&&(l=u,c=!0);return-1===l&&(l=i.length-1),a=s[l]}(t,e,r)),a}},function(t,e){t.exports={p:[.5,.4800611941616275,.460172162722971,.4403823076297575,.42074029056089696,.4012936743170763,.3820885778110473,.3631693488243809,.3445782583896758,.32635522028791997,.3085375387259869,.29115968678834636,.27425311775007355,.2578461108058647,.24196365222307303,.2266273523768682,.2118553985833967,.19766254312269238,.18406012534675947,.17105612630848183,.15865525393145707,.1468590563758959,.13566606094638267,.12507193563715024,.11506967022170828,.10564977366685535,.09680048458561036,.08850799143740196,.08075665923377107,.0735292596096483,.06680720126885807,.06057075800205901,.054799291699557974,.049471468033648075,.044565462758543006,.040059156863817086,.03593031911292579,.03215677479561371,.028716559816001783,.02558805952163861,.022750131948179195,.020182215405704383,.017864420562816542,.0157776073910905,.013903447513498595,.012224472655044696,.010724110021675795,.009386705534838566,.008197535924596114,.007142810735271415,.006209665325776132,.005386145954066684,.004661188023718747,.004024588542758303,.0034669738030406647,.002979763235054555,.002555130330427929,.0021859614549132405,.0018658133003840339,.0015888696473648667,.0013498980316300933,.0011442068310226977,.0009676032132183563,.0008163523128285604,.0006871379379158471,.0005770250423907659,.00048342414238377663,.0004040578018640207,.0003369292656768799,.00028029327681617744,.00023262907903552502,.00019261557563563279,.00015910859015753364,.00013112015442048433,.00010779973347738823,8841728520080377e-20,7234804392511979e-20,59058912418922374e-21,48096344017602614e-21,39075596597787456e-21,3167124183311986e-20,2560881647404149e-20,20657506912546683e-21,16623763729652213e-21,1334574901590631e-20,10688525774934402e-21,8539905470991794e-21,6806876599334031e-21,5412543907703841e-21,4293514469971858e-21,33976731247300535e-22,26822957796388472e-22,2112454702502842e-21,16596751443714555e-22,13008074539172771e-22,10170832425687032e-22,7.933281519755892e-7,6.173073720091925e-7,4.791832765903185e-7,3.710674079633327e-7,2.8665157187919333e-7,2.2090503226954194e-7,1.6982674071475937e-7,1.3024322953320117e-7,9.96442631693347e-8,7.6049605164887e-8,5.790134039964557e-8,4.397711594005869e-8,3.332044848542845e-8,2.518491005446105e-8,1.898956246588768e-8,1.4283479893922661e-8,1.0717590258310852e-8,8.022391850663474e-9,5.99037140106353e-9,4.462172453901611e-9,3.3157459783261365e-9,2.4578650618080152e-9,1.8175078630994235e-9,1.3407124440918662e-9,9.865876450376946e-10,7.242291705137605e-10,5.303423262948808e-10,3.8741473466756636e-10,2.823158037043268e-10,2.0522634252189396e-10,1.4882282217622966e-10,1.0765746385121517e-10,7768847581709776e-26,5592507575942645e-26,4016000583859088e-26,2876854173604311e-26,2055788909399508e-26,14654650977302715e-27,10420976987965154e-27,7392257778017794e-27,5230957544144525e-27,3692499427235561e-27,2600126965638173e-27,1826431061976961e-27,1279812543885835e-27,8945889558769844e-28,623784446333152e-27,43388950271780343e-29,3010627981117422e-28,20838581586720548e-29,14388386381575764e-29,9910342749547509e-29,6809224890620016e-29,46670115887190274e-30,31908916729108844e-30,21762912097085575e-30,14806537490047908e-30,10048965656526223e-30,6803311540773901e-30,4594627435778562e-30,3095358771958668e-30,20801863521393674e-31,1394517146659261e-30,9325575771681205e-31,622096057427174e-30,4139701816273122e-31,2747959392398221e-31,18196213635266084e-32,12019351542735647e-32,7919726314642476e-32,52055697448902465e-33,3413148326458146e-32,2232393197288031e-32,1456514112590909e-32,947953482220325e-32,6154425590850395e-33,3985804962848151e-33,25749715380118873e-34,16594208699647519e-34,10667637375474856e-34,6840807685935497e-34,4375964799309017e-34,27923343749396233e-35,17774117841455144e-35,11285884059538324e-35,7.148417011269684e-20,4.516591491435403e-20,2.846677408460209e-20,1.7897488120140146e-20,1.1224633591327901e-20,7022284240441541e-36,438238629906646e-35,27281535713460872e-37,16941535024881097e-37,10494515075362604e-37,6484814453077208e-37,39972212057261192e-38,24577864834723153e-38,1507493168810159e-37,9223413524939353e-38,5629282311376514e-38,34271987941135974e-39,20813752194932085e-39,12609160670206559e-39],z:[0,.05,.1,.15000000000000002,.2,.25,.30000000000000004,.35000000000000003,.4,.45,.5,.55,.6000000000000001,.65,.7000000000000001,.75,.8,.8500000000000001,.9,.9500000000000001,1,1.05,1.1,1.1500000000000001,1.2000000000000002,1.25,1.3,1.35,1.4000000000000001,1.4500000000000002,1.5,1.55,1.6,1.6500000000000001,1.7000000000000002,1.75,1.8,1.85,1.9000000000000001,1.9500000000000002,2,2.0500000000000003,2.1,2.15,2.2,2.25,2.3000000000000003,2.35,2.4000000000000004,2.45,2.5,2.5500000000000003,2.6,2.6500000000000004,2.7,2.75,2.8000000000000003,2.85,2.9000000000000004,2.95,3,3.0500000000000003,3.1,3.1500000000000004,3.2,3.25,3.3000000000000003,3.35,3.4000000000000004,3.45,3.5,3.5500000000000003,3.6,3.6500000000000004,3.7,3.75,3.8000000000000003,3.85,3.9000000000000004,3.95,4,4.05,4.1000000000000005,4.15,4.2,4.25,4.3,4.3500000000000005,4.4,4.45,4.5,4.55,4.6000000000000005,4.65,4.7,4.75,4.800000000000001,4.8500000000000005,4.9,4.95,5,5.050000000000001,5.1000000000000005,5.15,5.2,5.25,5.300000000000001,5.3500000000000005,5.4,5.45,5.5,5.550000000000001,5.6000000000000005,5.65,5.7,5.75,5.800000000000001,5.8500000000000005,5.9,5.95,6,6.050000000000001,6.1000000000000005,6.15,6.2,6.25,6.300000000000001,6.3500000000000005,6.4,6.45,6.5,6.550000000000001,6.6000000000000005,6.65,6.7,6.75,6.800000000000001,6.8500000000000005,6.9,6.95,7,7.050000000000001,7.1000000000000005,7.15,7.2,7.25,7.300000000000001,7.3500000000000005,7.4,7.45,7.5,7.550000000000001,7.6000000000000005,7.65,7.7,7.75,7.800000000000001,7.8500000000000005,7.9,7.95,8,8.05,8.1,8.15,8.200000000000001,8.25,8.3,8.35,8.4,8.450000000000001,8.5,8.55,8.6,8.65,8.700000000000001,8.75,8.8,8.85,8.9,8.950000000000001,9,9.05,9.1,9.15,9.200000000000001,9.25,9.3,9.35,9.4,9.450000000000001,9.5,9.55,9.600000000000001,9.65,9.700000000000001,9.75,9.8,9.850000000000001,9.9,9.950000000000001]}},function(t,e,r){"use strict";var n=r(120);e.name="factorial",e.factory=function(t,e,o,a){var i=o(r(121)),s=r(46),l=a("factorial",{number:function(t){if(t<0)throw new Error("Value must be non-negative");return i(t+1)},BigNumber:function(t){if(t.isNegative())throw new Error("Value must be non-negative");return i(t.plus(1))},"Array | Matrix":function(t){return n(t,l)}});return l.toTex={1:"\\left(${args[0]}\\right)"+s.operators.factorial},l}},function(t,e){"use strict";t.exports=function t(e,r,n){return e&&"function"==typeof e.map?e.map((function(e){return t(e,r,n)})):r(e)}},function(t,e,r){"use strict";var n=r(120),o=r(19).isInteger;var a=4.7421875,i=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.name="gamma",e.factory=function(t,e,s,l){var c=s(r(122)),u=s(r(125)),d=l("gamma",{number:function(t){var e,r;if(o(t)){if(t<=0)return isFinite(t)?1/0:NaN;if(t>171)return 1/0;for(var n=t-2,s=t-1;n>1;)s*=n,n--;return 0==s&&(s=1),s}if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*d(1-t));if(t>=171.35)return 1/0;if(t>85){var l=t*t,c=l*t,u=c*t,f=u*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*l)-139/(51840*c)-571/(2488320*u)+163879/(209018880*f)+5246819/(75246796800*f*t))}--t,r=i[0];for(var p=1;p<i.length;++p)r+=i[p]/(t+p);return e=t+a+.5,Math.sqrt(2*Math.PI)*Math.pow(e,t+.5)*Math.exp(-e)*r},Complex:function(e){var r,n;if(0==e.im)return d(e.re);e=new t.Complex(e.re-1,e.im),n=new t.Complex(i[0],0);for(var o=1;o<i.length;++o){var s=e.re+o,l=s*s+e.im*e.im;0!=l?(n.re+=i[o]*s/l,n.im+=-i[o]*e.im/l):n.re=i[o]<0?-1/0:1/0}r=new t.Complex(e.re+a+.5,e.im);var f=Math.sqrt(2*Math.PI);e.re+=.5;var p=u(r,e);0==p.im?p.re*=f:(0==p.re||(p.re*=f),p.im*=f);var _=Math.exp(-r.re);return r.re=_*Math.cos(-r.im),r.im=_*Math.sin(-r.im),c(c(p,r),n)},BigNumber:function(r){if(r.isInteger())return r.isNegative()||r.isZero()?new t.BigNumber(1/0):function(r){if(r.isZero())return new t.BigNumber(1);var n=e.precision+(0|Math.log(r.toNumber())),o=new(t.BigNumber.clone({precision:n}))(r),a=r.toNumber()-1;for(;a>1;)o=o.times(a),a--;return new t.BigNumber(o.toPrecision(t.BigNumber.precision))}(r.minus(1));if(!r.isFinite())return new t.BigNumber(r.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")},"Array | Matrix":function(t){return n(t,d)}});return d.toTex={1:"\\Gamma\\left(${args[0]}\\right)"},d}},function(t,e,r){"use strict";var n=r(15).extend,o=r(29);e.name="multiply",e.factory=function(t,e,a,i){var s=r(46),l=a(r(44)),c=a(r(45)),u=a(r(123)),d=a(r(40)),f=a(r(124)),p=a(r(51)),_=t.DenseMatrix,h=t.SparseMatrix,v=i("multiply",n({"Array, Array":function(e,r){m(o.size(e),o.size(r));var n=v(l(e),l(r));return t.isMatrix(n)?n.valueOf():n},"Matrix, Matrix":function(t,e){var r=t.size(),n=e.size();return m(r,n),1===r.length?1===n.length?g(t,e,r[0]):y(t,e):1===n.length?x(t,e):b(t,e)},"Matrix, Array":function(t,e){return v(t,l(e))},"Array, Matrix":function(t,e){return v(l(t,e.storage()),e)},"Matrix, any":function(t,e){var r;switch(t.storage()){case"sparse":r=f(t,e,u,!1);break;case"dense":r=p(t,e,u,!1)}return r},"any, Matrix":function(t,e){var r;switch(e.storage()){case"sparse":r=f(e,t,u,!0);break;case"dense":r=p(e,t,u,!0)}return r},"Array, any":function(t,e){return p(l(t),e,u,!1).valueOf()},"any, Array":function(t,e){return p(l(e),t,u,!0).valueOf()},"any, any":u,"Array | Matrix | any, Array | Matrix | any, ...any":function(t,e,r){for(var n=v(t,e),o=0;o<r.length;o++)n=v(n,r[o]);return n}},u.signatures)),m=function(t,e){switch(t.length){case 1:switch(e.length){case 1:if(t[0]!==e[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(t[0]!==e[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+t[0]+") must match Matrix rows ("+e[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+e.length+" dimensions)")}break;case 2:switch(e.length){case 1:if(t[1]!==e[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+t[1]+") must match Vector length ("+e[0]+")");break;case 2:if(t[1]!==e[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+t[1]+") must match Matrix B rows ("+e[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+e.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+t.length+" dimensions)")}},g=function(t,e,r){if(0===r)throw new Error("Cannot multiply two empty vectors");var n,o=t._data,a=t._datatype,s=e._data,l=e._datatype,d=c,f=u;a&&l&&a===l&&"string"==typeof a&&(n=a,d=i.find(c,[n,n]),f=i.find(u,[n,n]));for(var p=f(o[0],s[0]),_=1;_<r;_++)p=d(p,f(o[_],s[_]));return p},y=function(t,e){switch(e.storage()){case"dense":return w(t,e)}throw new Error("Not implemented")},w=function(t,e){var r,n=t._data,o=t._size,a=t._datatype,s=e._data,l=e._size,d=e._datatype,f=o[0],p=l[1],h=c,v=u;a&&d&&a===d&&"string"==typeof a&&(r=a,h=i.find(c,[r,r]),v=i.find(u,[r,r]));for(var m=[],g=0;g<p;g++){for(var y=v(n[0],s[0][g]),w=1;w<f;w++)y=h(y,v(n[w],s[w][g]));m[g]=y}return new _({data:m,size:[p],datatype:r})},x=function(t,e){switch(t.storage()){case"dense":return z(t,e);case"sparse":return E(t,e)}},b=function(t,e){switch(t.storage()){case"dense":switch(e.storage()){case"dense":return k(t,e);case"sparse":return A(t,e)}break;case"sparse":switch(e.storage()){case"dense":return N(t,e);case"sparse":return M(t,e)}}},z=function(t,e){var r,n=t._data,o=t._size,a=t._datatype,s=e._data,l=e._datatype,d=o[0],f=o[1],p=c,h=u;a&&l&&a===l&&"string"==typeof a&&(r=a,p=i.find(c,[r,r]),h=i.find(u,[r,r]));for(var v=[],m=0;m<d;m++){for(var g=n[m],y=h(g[0],s[0]),w=1;w<f;w++)y=p(y,h(g[w],s[w]));v[m]=y}return new _({data:v,size:[d],datatype:r})},k=function(t,e){var r,n=t._data,o=t._size,a=t._datatype,s=e._data,l=e._size,d=e._datatype,f=o[0],p=o[1],h=l[1],v=c,m=u;a&&d&&a===d&&"string"==typeof a&&(r=a,v=i.find(c,[r,r]),m=i.find(u,[r,r]));for(var g=[],y=0;y<f;y++){var w=n[y];g[y]=[];for(var x=0;x<h;x++){for(var b=m(w[0],s[0][x]),z=1;z<p;z++)b=v(b,m(w[z],s[z][x]));g[y][x]=b}}return new _({data:g,size:[f,h],datatype:r})},A=function(t,e){var r=t._data,n=t._size,o=t._datatype,a=e._values,s=e._index,l=e._ptr,f=e._size,p=e._datatype;if(!a)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var _,v=n[0],m=f[1],g=c,y=u,w=d,x=0;o&&p&&o===p&&"string"==typeof o&&(_=o,g=i.find(c,[_,_]),y=i.find(u,[_,_]),w=i.find(d,[_,_]),x=i.convert(0,_));for(var b=[],z=[],k=[],A=new h({values:b,index:z,ptr:k,size:[v,m],datatype:_}),E=0;E<m;E++){k[E]=z.length;var N=l[E],M=l[E+1];if(M>N)for(var S=0,O=0;O<v;O++){for(var T,B=O+1,C=N;C<M;C++){var F=s[C];S!==B?(T=y(r[O][F],a[C]),S=B):T=g(T,y(r[O][F],a[C]))}S!==B||w(T,x)||(z.push(O),b.push(T))}}return k[m]=z.length,A},E=function(t,e){var r=t._values,n=t._index,o=t._ptr,a=t._datatype;if(!r)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var s,l=e._data,f=e._datatype,p=t._size[0],_=e._size[0],v=[],m=[],g=[],y=c,w=u,x=d,b=0;a&&f&&a===f&&"string"==typeof a&&(s=a,y=i.find(c,[s,s]),w=i.find(u,[s,s]),x=i.find(d,[s,s]),b=i.convert(0,s));var z=[],k=[];g[0]=0;for(var A=0;A<_;A++){var E=l[A];if(!x(E,b))for(var N=o[A],M=o[A+1],S=N;S<M;S++){var O=n[S];k[O]?z[O]=y(z[O],w(E,r[S])):(k[O]=!0,m.push(O),z[O]=w(E,r[S]))}}for(var T=m.length,B=0;B<T;B++){var C=m[B];v[B]=z[C]}return g[1]=m.length,new h({values:v,index:m,ptr:g,size:[p,1],datatype:s})},N=function(t,e){var r=t._values,n=t._index,o=t._ptr,a=t._datatype;if(!r)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var s,l=e._data,f=e._datatype,p=t._size[0],_=e._size[0],v=e._size[1],m=c,g=u,y=d,w=0;a&&f&&a===f&&"string"==typeof a&&(s=a,m=i.find(c,[s,s]),g=i.find(u,[s,s]),y=i.find(d,[s,s]),w=i.convert(0,s));for(var x=[],b=[],z=[],k=new h({values:x,index:b,ptr:z,size:[p,v],datatype:s}),A=[],E=[],N=0;N<v;N++){z[N]=b.length;for(var M=N+1,S=0;S<_;S++){var O=l[S][N];if(!y(O,w))for(var T=o[S],B=o[S+1],C=T;C<B;C++){var F=n[C];E[F]!==M?(E[F]=M,b.push(F),A[F]=g(O,r[C])):A[F]=m(A[F],g(O,r[C]))}}for(var I=z[N],j=b.length,R=I;R<j;R++){var L=b[R];x[R]=A[L]}}return z[v]=b.length,k},M=function(t,e){var r,n=t._values,o=t._index,a=t._ptr,s=t._datatype,l=e._values,d=e._index,f=e._ptr,p=e._datatype,_=t._size[0],v=e._size[1],m=n&&l,g=c,y=u;s&&p&&s===p&&"string"==typeof s&&(r=s,g=i.find(c,[r,r]),y=i.find(u,[r,r]));for(var w,x,b,z,k,A,E,N,M=m?[]:void 0,S=[],O=[],T=new h({values:M,index:S,ptr:O,size:[_,v],datatype:r}),B=m?[]:void 0,C=[],F=0;F<v;F++){O[F]=S.length;var I=F+1;for(k=f[F],A=f[F+1],z=k;z<A;z++)if(N=d[z],m)for(x=a[N],b=a[N+1],w=x;w<b;w++)C[E=o[w]]!==I?(C[E]=I,S.push(E),B[E]=y(l[z],n[w])):B[E]=g(B[E],y(l[z],n[w]));else for(x=a[N],b=a[N+1],w=x;w<b;w++)C[E=o[w]]!==I&&(C[E]=I,S.push(E));if(m)for(var j=O[F],R=S.length,L=j;L<R;L++){var P=S[L];M[L]=B[P]}}return O[v]=S.length,T};return v.toTex={2:"\\left(${args[0]}"+s.operators.multiply+"${args[1]}\\right)"},v}},function(t,e){"use strict";e.factory=function(t,e,r,n){var o=n("multiplyScalar",{"number, number":function(t,e){return t*e},"Complex, Complex":function(t,e){return t.mul(e)},"BigNumber, BigNumber":function(t,e){return t.times(e)},"Fraction, Fraction":function(t,e){return t.mul(e)},"number | Fraction | BigNumber | Complex, Unit":function(t,e){var r=e.clone();return r.value=null===r.value?r._normalize(t):o(r.value,t),r},"Unit, number | Fraction | BigNumber | Complex":function(t,e){var r=t.clone();return r.value=null===r.value?r._normalize(e):o(r.value,e),r},"Unit, Unit":function(t,e){return t.multiply(e)}});return o}},function(t,e,r){"use strict";e.name="algorithm11",e.factory=function(t,e,n,o){var a=n(r(40)),i=t.SparseMatrix;return function(t,e,r,n){var s=t._values,l=t._index,c=t._ptr,u=t._size,d=t._datatype;if(!s)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f,p=u[0],_=u[1],h=a,v=0,m=r;"string"==typeof d&&(f=d,h=o.find(a,[f,f]),v=o.convert(0,f),e=o.convert(e,f),m=o.find(r,[f,f]));for(var g=[],y=[],w=[],x=new i({values:g,index:y,ptr:w,size:[p,_],datatype:f}),b=0;b<_;b++){w[b]=y.length;for(var z=c[b],k=c[b+1],A=z;A<k;A++){var E=l[A],N=n?m(e,s[A]):m(s[A],e);h(N,v)||(y.push(E),g.push(N))}}return w[_]=y.length,x}}},function(t,e,r){"use strict";var n=r(19).isInteger,o=r(29).size;e.name="pow",e.factory=function(t,e,a,i){var s=r(46),l=a(r(126)),c=a(r(122)),u=a(r(44)),d=a(r(127)),f=a(r(128)),p=i("pow",{"number, number":_,"Complex, Complex":function(t,e){return t.pow(e)},"BigNumber, BigNumber":function(r,n){return n.isInteger()||r>=0||e.predictable?r.pow(n):new t.Complex(r.toNumber(),0).pow(n.toNumber(),0)},"Fraction, Fraction":function(t,r){if(1!==r.d){if(e.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return _(t.valueOf(),r.valueOf())}return t.pow(r)},"Array, number":h,"Array, BigNumber":function(t,e){return h(t,e.toNumber())},"Matrix, number":v,"Matrix, BigNumber":function(t,e){return v(t,e.toNumber())},"Unit, number":function(t,e){return t.pow(e)}});function _(r,o){if(e.predictable&&!n(o)&&r<0)try{var a=d(o),i=f(a);if((o===i||Math.abs((o-i)/o)<1e-14)&&a.d%2==1)return(a.n%2==0?1:-1)*Math.pow(-r,o)}catch(t){}return r*r<1&&o===1/0||r*r>1&&o===-1/0?0:e.predictable&&(r<-1&&o===1/0||r>-1&&r<0&&o===-1/0)?NaN:n(o)||r>=0||e.predictable?Math.pow(r,o):new t.Complex(r,0).pow(o,0)}function h(t,e){if(!n(e)||e<0)throw new TypeError("For A^b, b must be a positive integer (value is "+e+")");var r=o(t);if(2!=r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!=r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");for(var a=l(r[0]).valueOf(),i=t;e>=1;)1==(1&e)&&(a=c(i,a)),e>>=1,i=c(i,i);return a}function v(t,e){return u(h(t.valueOf(),e))}return p.toTex={2:"\\left(${args[0]}\\right)"+s.operators.pow+"{${args[1]}}"},p}},function(t,e,r){"use strict";var n=r(29),o=r(19).isInteger;e.name="eye",e.factory=function(t,e,a,i){var s=a(r(44)),l=i("eye",{"":function(){return"Matrix"===e.matrix?s([]):[]},string:function(t){return s(t)},"number | BigNumber":function(t){return u(t,t,"Matrix"===e.matrix?"default":void 0)},"number | BigNumber, string":function(t,e){return u(t,t,e)},"number | BigNumber, number | BigNumber":function(t,r){return u(t,r,"Matrix"===e.matrix?"default":void 0)},"number | BigNumber, number | BigNumber, string":function(t,e,r){return u(t,e,r)},Array:function(t){return c(t)},"Array, string":function(t,e){return c(t,e)},Matrix:function(t){return c(t.valueOf(),t.storage())},"Matrix, string":function(t,e){return c(t.valueOf(),e)}});return l.toTex=void 0,l;function c(t,e){switch(t.length){case 0:return e?s(e):[];case 1:return u(t[0],t[0],e);case 2:return u(t[0],t[1],e);default:throw new Error("Vector containing two values expected")}}function u(e,r,a){var i=t.isBigNumber(e)||t.isBigNumber(r)?t.BigNumber:null;if(t.isBigNumber(e)&&(e=e.toNumber()),t.isBigNumber(r)&&(r=r.toNumber()),!o(e)||e<1)throw new Error("Parameters in function eye must be positive integers");if(!o(r)||r<1)throw new Error("Parameters in function eye must be positive integers");var s=i?new t.BigNumber(1):1,l=i?new i(0):0,c=[e,r];if(a)return t.Matrix.storage(a).diagonal(c,s,0,l);for(var u=n.resize([],c,l),d=e<r?e:r,f=0;f<d;f++)u[f][f]=s;return u}}},function(t,e,r){"use strict";var n=r(120);e.name="fraction",e.factory=function(t,e,r,o){var a=o("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new t.Fraction(e)},string:function(e){return new t.Fraction(e)},"number, number":function(e,r){return new t.Fraction(e,r)},BigNumber:function(e){return new t.Fraction(e.toString())},Fraction:function(t){return t},Object:function(e){return new t.Fraction(e)},"Array | Matrix":function(t){return n(t,a)}});return a}},function(t,e,r){"use strict";var n=r(120);e.name="number",e.factory=function(t,e,r,o){var a=o("number",{"":function(){return 0},number:function(t){return t},string:function(t){var e=Number(t);if(isNaN(e))throw new SyntaxError('String "'+t+'" is no valid number');return e},BigNumber:function(t){return t.toNumber()},Fraction:function(t){return t.valueOf()},Unit:function(t){throw new Error("Second argument with valueless unit expected")},"Unit, string | Unit":function(t,e){return t.toNumber(e)},"Array | Matrix":function(t){return n(t,a)}});return a.toTex={0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},a}},function(t,e){t.exports=function(t,e,r,n,o,a,i){var s=t.viz.cat_bar_width,l=t.viz.cat_bar_height,c=e.bar_data[0][o];e.bar_data=e.bar_data.slice(0,a);var u=e.type_name;u.length>=25&&(u=u.slice(0,25)+".."),r.append("text").classed("cat_graph_title",!0).text(u).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",800);r.append("line").attr("x1",0).attr("x2",s).attr("y1",4).attr("y2",4).attr("stroke","blue").attr("stroke-width",1).attr("opacity",1);var d=d3.scale.linear().domain([0,c]).range([0,s]);i.append("rect").attr("height",l+"px").attr("width",(function(t){return d(t[o])+"px"})).attr("fill",(function(t){return t[3]})).attr("opacity",t.viz.cat_colors.opacity).attr("stroke","grey").attr("stroke-width","0.5px"),i.append("text").classed("bar_labels",!0).text((function(t){var e=t[1];return e.indexOf(": ")>0&&(e=e.split(": ")[1]),e.indexOf("<p>")>0&&(e=e.split("<p>")[0]),e.length>=25&&(e=e.slice(0,25)+".."),e})).attr("transform",(function(){return"translate(5, "+.75*l+")"})).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","right")}},function(t,e){t.exports=function(t,e,r,n,o,a,i,s){var l=t.viz.cat_bar_width,c=t.viz.cat_bar_height;e.append("text").text("Count").attr("transform",(function(){return"translate("+(l+a)+", 0)"})),e.append("text").text("Pct").attr("transform",(function(){return"translate("+(l+a+60)+", 0)"})),e.append("text").text("P-val").attr("transform",(function(){return"translate("+(l+a+115)+", 0)"})),o&&e.append("text").text("Clusters").attr("transform",(function(){return"translate("+(l+150)+", 0)"}));r.append("text").classed("count_labels",!0).text((function(t){var e=t[i];return e=e.toLocaleString(),String(e)})).attr("transform",(function(){return"translate("+(l+a+35)+", "+.75*c+")"})).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),r.append("text").classed("count_labels",!0).text((function(t){var e=t[i]/s*100;return e=(e=Math.round(10*e)/10).toLocaleString(),String(e)})).attr("transform",(function(){return"translate("+(l+a+35+47)+", "+.75*c+")"})).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),r.append("text").classed("count_labels",!0).text((function(t){var e=t[6];return e=e<.001?(e=parseFloat(e.toPrecision(3))).toExponential():parseFloat(e.toPrecision(2))})).attr("transform",(function(){return"translate("+(l+a+35+112)+", "+.75*c+")"})).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end"),o&&r.append("text").classed("count_labels",!0).text((function(t){return String(t[n].toLocaleString())})).attr("transform",(function(){return"translate("+(l+35+150+20)+", "+.75*c+")"})).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("font-weight",400).attr("text-anchor","end")}},function(t,e){t.exports=function(t){var e={},r=d3.select(t.root+" .clust_group").attr("transform");return null!=r&&r.indexOf("scale")>0?(e.zoom_x=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[0]),e.zoom_y=parseFloat(r.split("scale")[1].replace("(","").replace(")","").split(",")[1])):(e.zoom_x=1,e.zoom_y=1),e}},function(t,e,r){var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_row_tip").remove();var e=t.viz.root_tips.replace(".",""),r=n().attr("class",(function(){return e+" d3-tip "+e+"_row_tip"})).direction("e").offset([0,10]).style("display","none").html((function(t){return"<span>"+t.name.replace(/_/g," ").split("#")[0]+"</span>"}));d3.select(t.viz.viz_wrapper).select(t.root+" .row_container").call(r),d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",(function(e){d3.select(t.viz.root_tips+"_row_tip").classed(e.name,!0),d3.selectAll(t.viz.root_tips+"_row_tip").style("display","block"),d3.select(this).select("text").classed("active",!0),r.show(e),null!=t.row_tip_callback&&t.row_tip_callback(t.viz.root_tips,e)})).on("mouseout",(function(e){d3.selectAll(t.viz.root_tips+"_row_tip").style("display","none").classed(e.name,!1),d3.select(this).select("text").classed("active",!1),r.hide(e)}))}else d3.select(t.root+" .row_label_zoom_container").selectAll("g").on("mouseover",(function(){d3.select(this).select("text").classed("active",!0)})).on("mouseout",(function(){d3.select(this).select("text").classed("active",!1)}))}},function(t,e,r){var n=r(2),o=r(134),a=r(135),i=r(104),s=r(139),l=r(140);t.exports=function(t,e=0){var r,c=t.params,u=c.network_data.col_nodes,d=c.viz.x_scale.rangeBand()/2+c.viz.border_width.x;d3.select(c.root+" .col_container").empty()?((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+")")).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+")")).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(u,(function(t){return t.name})).enter().append("g").attr("class","col_label_text").attr("transform",(function(t){var e=t.col_index;return"translate("+c.viz.x_scale(e)+", 0) rotate(-90)"})).append("g").attr("class","col_label_group").attr("transform","translate("+c.viz.x_scale.rangeBand()/2+","+d+") rotate(45)").on("mouseover",(function(){d3.select(this).select("text").classed("active",!0)})).on("mouseout",(function(){d3.select(this).select("text").classed("active",!1)}));n.has(c.network_data.col_nodes[0],"value")&&f.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),f.append("text").attr("x",0).attr("y",.64*c.viz.x_scale.rangeBand()).attr("dx",c.viz.border_width.x).attr("text-anchor","start").attr("full_name",(function(t){return t.name})).style("font-size",c.labels.default_fs_col+"px").style("cursor","default").text((function(t){return n.normal_name(t)})).style("opacity",0).transition().delay(e).duration(e).style("opacity",1),s(c),f.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"),o(c,this,t.ini)):c.tile_click_hlight&&o(c,this,t.ini)})).on("dblclick",(function(e){var r=this.__data__.name;if(c.sim_mat){a(t,this,r);var n=d3.selectAll(c.root+" .row_label_group").filter((function(t){return t.name==r}))[0][0];i(t,n,r)}else a(t,this,r);c.tile_click_hlight&&o(c,this,e.ini)}))}},function(t,e){t.exports=function(t,e,r){if(r!=t.click_hlight_col){t.click_hlight_col=r;var n=6*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",.85).attr("transform",(function(){return"translate("+-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin)+",0)"})),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",.85).attr("transform",(function(){var e=t.viz.x_scale.rangeBand()-n;return"translate("+-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin)+","+e+")"}))}else d3.selectAll(t.root+" .click_hlight").remove(),t.click_hlight_col=-666}},function(t,e,r){var n=r(105),o=r(106),a=r(136),i=r(88),s=r(131),l=r(79),c=r(3);t.exports=function(t,e,r){var u=t.params,d=s(u);if(1===d.zoom_y&&1===d.zoom_x){u.viz.inst_order.col="custom",o(t,"col"),d3.selectAll(u.root+" .toggle_row_order .btn").classed("active",!1),u.viz.run_trans=!0;var f=$.extend(!0,{},u.matrix.matrix),p=u.network_data.row_nodes,_=u.network_data.col_nodes,h=[];_.forEach((function(t){h.push(t.name)}));var v=c.indexOf(h,r);h=[],p.forEach((function(t,e){h.push(f[e].row_data[v].value)}));var m,g=d3.range(h.length).sort((function(t,e){return h[e]-h[t]}));u.viz.y_scale.domain(g),u.matrix.orders.custom_col=g;var y=u.network_data.row_nodes_names;if((m=u.network_data.links.length>u.matrix.def_large_matrix?d3.select(u.root+" .viz_svg"):d3.select(u.root+" .viz_svg").transition().duration(2500)).selectAll(".row_cat_group").attr("transform",(function(t){var e=c.indexOf(y,t.name);return"translate(0,"+u.viz.y_scale(e)+")"})),m.select(".row_label_zoom_container").selectAll(".row_label_group").attr("transform",(function(t){var e=c.indexOf(y,t.name);return"translate(0,"+u.viz.y_scale(e)+")"})),-1===u.viz.ds_level&&m.selectAll(".row").attr("transform",(function(t){var e=c.indexOf(y,t.name);return"translate(0,"+u.viz.y_scale(e)+")"})),d3.selectAll(u.root+" .col_label_text").select(".highlight_rect").style("opacity",0),d3.select(e).select(".highlight_rect").style("opacity",1),u.network_data.links.forEach((function(t){t.x=u.viz.x_scale(t.target),t.y=u.viz.y_scale(t.source)})),n(u),u.zoom_info=i(),setTimeout((function(){u.viz.run_trans=!1}),2500),u.viz.ds_num_levels>0&&u.viz.ds_level>=0){l(u);a(t,!0,!0,!0)}}}},function(t,e,r){var n=r(137),o=r(93),a=r(102),i=r(138),s=r(3);t.exports=function(t,e=!1,r=!1,l=!1){var c=t.params,u=c.zoom_info,d=c.viz.ds_level,f=c.viz.ds_level;(null===c.viz.ds||(d=Math.floor(Math.log(u.zoom_y)/Math.log(c.viz.ds_zt)))>c.viz.ds_num_levels-1)&&(d=-1);var p,_=!1;-1==f?d>=0&&(_=!0):d<f&&(_=!0),!0===e||!0===_?(p=d,e=!0,c.viz.ds_level=p):p=f;var h,v,m={};if(m.min_x=Math.abs(u.trans_x)/u.zoom_x-6*c.viz.rect_width,m.min_y=Math.abs(u.trans_y)/u.zoom_y-6*c.viz.rect_height,m.max_x=Math.abs(u.trans_x)/u.zoom_x+c.viz.clust.dim.width/u.zoom_x+5*c.viz.rect_width,m.max_y=Math.abs(u.trans_y)/u.zoom_y+c.viz.clust.dim.height/u.zoom_y+5*c.viz.rect_height,n(c,m),!1===l?h=s.difference(c.viz.viz_nodes.row,c.viz.viz_nodes.curr_row):(h="all",d3.selectAll(c.root+" .ds"+String(p)+"_row").remove()),null!=c.viz.ds){var g=".ds"+String(c.viz.ds_level)+"_row";d3.selectAll(g).style("display","block")}if(p>=0&&(d3.selectAll(c.root+" .row").remove(),d3.selectAll(c.viz.root_tips+"_tile_tip").remove(),d3.selectAll(c.viz.root_tips+"_row_tip").remove()),p<0?(v=c.matrix.matrix,i(c)):(v=c.matrix.ds_matrix[p],d3.selectAll(c.root+" .row_cat_group path").remove()),!0===r&&d3.selectAll(c.root+" .row_cat_group path").remove(),!0===e&&(p>=0?d3.selectAll(c.root+" .ds"+String(p)+"_row").each((function(t){!1===s.contains(c.viz.viz_nodes.row,t.name)&&d3.select(this).remove()})):d3.selectAll(c.root+" .row").each((function(t){!1===s.contains(c.viz.viz_nodes.row,t.name)&&d3.select(this).remove()})),d3.selectAll(c.root+" .row_label_group").each((function(t){!1===s.contains(c.viz.viz_nodes.row,t.name)&&d3.select(this).remove()})),p!=f&&(h=c.viz.viz_nodes.row,d3.selectAll(c.root+" .ds"+String(f)+"_row").remove())),(h.length>=1||"all"===h)&&o(c,v,h,p),-1===p&&(!1===r||e)){var y=[];d3.selectAll(c.root+" .row_label_group").each((function(t){y.push(t.name)}));var w=s.difference(c.viz.viz_nodes.row,y);w.length>1&&a(t,w)}}},function(t,e){t.exports=function(t,e){var r,n=[],o=[],a=t.viz.y_scale,i=t.viz.ds_level,s=t.network_data.row_nodes_names,l=".row";i>=0&&(a=t.viz.ds[i].y_scale,s=d3.range(t.matrix.ds_matrix[i].length).map(String),l=".ds"+String(i)+"_row");for(var c=0;c<s.length;c++)(r=a(c))<e.max_y&&r>e.min_y&&n.push(s[c]);d3.selectAll(t.root+" "+l).each((function(t){o.push(t.name)})),t.viz.viz_nodes.row=n,t.viz.viz_nodes.curr_row=o}},function(t,e){t.exports=function(t){!0===d3.select(t.root+" .row_cat_group path").empty()&&d3.selectAll(t.root+" .row_cat_group").append("path").attr("d",(function(){return"M "+(t.viz.cat_room.symbol_width-1)+",0 L 1,"+t.viz.y_scale.rangeBand()/2+" L "+(t.viz.cat_room.symbol_width-1)+","+t.viz.y_scale.rangeBand()+" Z"})).attr("fill","#eee").style("opacity",t.viz.triangle_opacity)}},function(t,e,r){var n=r(100);t.exports=function(t){if(t.labels.show_label_tooltips){d3.selectAll(t.viz.root_tips+"_col_tip").remove();var e=n().attr("class",(function(){var e=t.viz.root_tips.replace(".","");return e+" d3-tip "+e+"_col_tip"})).direction("w").offset([20,0]).style("display","none").html((function(t){return"<span>"+t.name.replace(/_/g," ").split("#")[0]+"</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(t.viz.root_tips+"_col_tip").style("display","block"),e.show(r),null!=t.col_tip_callback&&t.col_tip_callback(r)})).on("mouseout",(function(){e.hide(this),d3.selectAll(t.viz.root_tips+"_col_tip").style("display","none")}))}}},function(t,e){t.exports=function(t){var e=.36*t.viz.x_scale.rangeBand(),r=-t.viz.border_width.x,n=t.viz.x_scale.rangeBand()-e;return"M "+r+",0 L "+-(t.viz.x_scale.rangeBand()-e+t.viz.border_width.x)+",0 L "+-t.viz.border_width.x+","+n+" Z"}},function(t,e){t.exports=function(t){d3.select(t.viz.viz_svg).append("rect").attr("fill",t.viz.background_color).attr("height",t.viz.super_labels.dim.width+"px").attr("width","3000px").classed("super_col_bkg",!0).classed("white_bars",!0).attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.super_labels.margin.top+")"),d3.select(t.viz.viz_svg).append("text").attr("class","super_col").text(t.labels.super.col).attr("text-anchor","center").attr("transform",(function(){var e=d3.select(this)[0][0].getBBox().width;return"translate("+(t.viz.clust.dim.width/2+t.viz.norm_labels.width.row-e/2)+","+t.viz.super_labels.dim.width+")"})).style("font-size",(function(){return t.labels.super_label_fs*t.labels.super_label_scale+"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(){return"translate("+t.viz.super_labels.dim.width+","+(t.viz.clust.dim.height/2+t.viz.norm_labels.width.col)+")"})),d3.select(t.root+" .super_row").append("text").text(t.labels.super.row).attr("text-anchor","center").attr("transform",(function(){return"translate(0,"+(d3.select(this)[0][0].getBBox().width/2+t.viz.norm_labels.width.col)+"), rotate(-90)"})).style("font-size",(function(){return t.labels.super_label_fs*t.labels.super_label_scale+"px"})).style("font-weight",300)}},function(t,e,r){var n=r(143),o=r(144),a=r(152),i=r(112);t.exports=function(t){var e=t.params,r=e.viz;d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 1000,-1000, L 1000,0 Z").attr("fill",r.background_color).attr("class","right_slant_triangle").attr("transform","translate("+r.clust.dim.width+","+r.norm_labels.width.col+")"),d3.select(r.root+" .col_container").append("path").style("stroke-width","0").attr("d","M 0,0 L 500,-500, L 0,-500 Z").attr("fill",r.background_color).attr("class","left_slant_triangle").attr("transform","translate(-1,"+r.norm_labels.width.col+")");var s=r.clust.margin.top+r.uni_margin/5;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",r.clust.margin.left).attr("height",s).attr("class","top_left_white");var l=r.cat_room.col+1.5*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",2*r.clust.dim.width).attr("height",l).attr("class","top_right_white").attr("transform",(function(){return"translate("+(r.clust.margin.left+r.clust.dim.width)+", "+(r.norm_labels.width.col+r.norm_labels.margin.top-r.uni_margin)+")"})),d=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;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",.65).style("cursor","default").attr("transform",(function(t){var e=parseInt(t.split("-")[1],10),n=f+1.25*r.cat_room.symbol_width*e;return"translate("+d+","+n+")"})).text((function(t){return n(r,t,"col")})),a(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 u=d3.select(r.viz_svg).append("g").classed("bottom_spillover_container",!0).attr("transform",(function(){return"translate(0,"+f+")"}));u.append("rect").attr("class","bottom_spillover").attr("fill",r.background_color).attr("width",r.svg_dim.width).attr("height",2*r.svg_dim.height),d=r.clust.margin.left,f=0,u.append("g").classed("col_dendro_icons_container",!0).attr("transform","translate("+d+","+f+")").append("g").classed("col_dendro_icons_group",!0),e.viz.show_dendrogram&&i(t,"col");var d=r.clust.margin.left+r.clust.dim.width,f=r.clust.margin.top+r.clust.dim.height,p=r.cat_room.col+r.clust.dim.width,_=r.cat_room.row+10*r.uni_margin;d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",p).attr("height",_).attr("transform",(function(){return"translate("+d+","+f+")"})).classed("white_bars",!0).classed("dendro_corner_spillover",!0),d=0,f=r.clust.margin.top+r.clust.dim.height,p=r.clust.margin.left,_=10*r.clust.dim.height,d3.select(r.viz_svg).append("rect").attr("fill",r.background_color).attr("width",p).attr("height",_).attr("transform",(function(){return"translate("+d+","+f+")"})).classed("white_bars",!0).classed("dendro_col_spillover",!0),o(t)}},function(t,e){t.exports=function(t,e,r){var n;t.cat_names[r][e]===e?n="Category "+(parseInt(e.split("-")[1],10)+1):n=t.cat_names[r][e];return n}},function(t,e,r){var n=r(145),o=r(3);t.exports=function(t){var e=t.params;o.each(["row","col"],(function(r){e.viz.show_categories[r]&&d3.selectAll(e.root+" ."+r+"_cat_super").on("dblclick",(function(){e.sim_mat&&(r="both"),d3.selectAll(e.root+" .toggle_"+r+"_order .btn").classed("active",!1);var o=this.__data__.replace("-","_")+"_index";e.viz.sim_mat?(n(t,o,"row"),n(t,o,"col")):n(t,o,r)}))}))}},function(t,e,r){var n=r(106),o=r(136),a=r(88),i=r(79),s=r(146),l=r(131),c=r(3);t.exports=function(t,e,r){var u,d,f=t.params,p=l(f),_=0;1==p.zoom_y&&1==p.zoom_x||(s(t,0,0,1),_=1200),"row"===r?u="col":"col"===r&&(u="row"),f.viz.run_trans=!0,"row"===u?f.viz.inst_order.row=e:"col"===u&&(f.viz.inst_order.col=e),f.viz.show_dendrogram&&n(t,r),"row"===u?f.viz.x_scale.domain(f.matrix.orders[f.viz.inst_order.row+"_row"]):"col"==u&&f.viz.y_scale.domain(f.matrix.orders[f.viz.inst_order.col+"_col"]),d=d3.selectAll(f.root+" .tile")[0].length<f.matrix.def_large_matrix?d3.select(f.root+" .viz_svg").transition().duration(2500).delay(_):d3.select(f.root+" .viz_svg");var h=f.network_data.row_nodes_names,v=f.network_data.col_nodes_names;if(-1===f.viz.ds_level&&(d.selectAll(".row").attr("transform",(function(t){var e=c.indexOf(h,t.name);return"translate(0,"+f.viz.y_scale(e)+")"})).selectAll(".tile").attr("transform",(function(t){return"translate("+f.viz.x_scale(t.pos_x)+" , 0)"})),d.selectAll(".tile_up").attr("transform",(function(t){return"translate("+f.viz.x_scale(t.pos_x)+" , 0)"})),d.selectAll(".tile_dn").attr("transform",(function(t){return"translate("+f.viz.x_scale(t.pos_x)+" , 0)"}))),d.select(".row_label_zoom_container").selectAll(".row_label_group").attr("transform",(function(t){var e=c.indexOf(h,t.name);return"translate(0,"+f.viz.y_scale(e)+")"})),d.select(".col_zoom_container").selectAll(".col_label_text").attr("transform",(function(t){var e=c.indexOf(v,t.name);return"translate("+f.viz.x_scale(e)+") rotate(-90)"})),d.selectAll(".row_cat_group").attr("transform",(function(t){var e=c.indexOf(h,t.name);return"translate(0,"+f.viz.y_scale(e)+")"})),d.selectAll(".col_cat_group").attr("transform",(function(t){var e=c.indexOf(v,t.name);return"translate("+f.viz.x_scale(e)+",0)"})),f.network_data.links.forEach((function(t){t.x=f.viz.x_scale(t.target),t.y=f.viz.y_scale(t.source)})),f.zoom_info=a(),f.viz.ds_num_levels>0&&f.viz.ds_level>=0){i(f);o(t,!0,!0,!0)}setTimeout((function(){f.viz.run_trans=!1}),2500)}},function(t,e,r){var n=r(2),o=r(147),a=r(136),i=r(88),s=r(151),l=r(3);t.exports=function(t,e,r,c){var u=t.params;if(d3.selectAll(u.viz.root_tips).style("display","none"),u.zoom_info=i(),a(t),!u.viz.run_trans){var d=u.viz.clust.dim.height/2,f=d/c;if(r>=d-f){var p=d-r,_=-d/c+p;r+=_}r<-(d-f)&&(r+=_=d/c-(p=d+r));var h,v=c,m=700,g=-(v-1)*d;d3.select(u.root+" .clust_group").transition().duration(m).attr("transform","translate("+[0,0+g]+") scale(1,"+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_label_zoom_container").transition().duration(m).attr("transform","translate("+[0,g]+") scale("+v+","+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_cat_container").transition().duration(m).attr("transform","translate("+[0,g]+") scale(1,"+v+")translate("+[0,r]+")"),d3.select(u.root+" .row_dendro_container").transition().duration(m).attr("transform","translate("+[0,g]+") scale(1,"+v+")translate("+[u.viz.uni_margin/2,r]+")"),l.each(["row","col"],(function(t){h=d3.select(u.root+" ."+t+"_dendro_crop_buttons").style("opacity"),d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").style("opacity",0),setTimeout(x,700,t,h)})),d3.select(u.root+" .col_zoom_container").transition().duration(m).attr("transform"," scale(1,1)translate("+[e,0]+")"),d3.select(u.root+" .col_cat_container").transition().duration(m).attr("transform"," scale(1,1)translate("+[e,0]+")"),d3.select(u.root+" .col_dendro_container").transition().duration(m).attr("transform"," scale(1,1)translate("+[e,u.viz.uni_margin/2]+")");var y=u.viz.clust.margin.top+g+r*v,w=u.viz.clust.margin.left+e;u.zoom_behavior.scale(v).translate([w,y]),o(u),!1===d3.select(u.root+" .row_label_zoom_container text").empty()&&d3.select(u.root+" .row_label_zoom_container").each((function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",.5*t.x).attr("y",0).attr("width",.5*t.width).attr("height",u.viz.y_scale.rangeBand()).style("fill","yellow")})),d3.select(u.root+" .row_dendro_icons_group").attr("transform","translate("+[0,0+g]+") scale(1,"+v+")translate("+[e,r]+")"),d3.select(u.root+" .row_dendro_icons_group").selectAll("path").attr("transform",(function(t){return"translate("+u.viz.uni_margin+","+t.pos_mid+") scale(1, "+1/v+")"})),d3.select(u.root+" .col_dendro_icons_group").attr("transform",(function(){return" scale(1,"+v+")"})),d3.select(u.root+" .col_dendro_icons_group").selectAll("path").attr("transform",(function(t){return"translate("+t.pos_mid+","+u.viz.uni_margin+") scale(1,1)"})),n.has(u.network_data.col_nodes[0],"value")&&d3.selectAll(u.root+" .col_bars").attr("width",(function(t){var e=0;return t.value>0&&(e=u.labels.bar_scale_col(t.value)/1),e})),n.has(u.network_data.row_nodes[0],"value")&&d3.selectAll(u.root+" .row_bars").transition().duration(m).attr("width",(function(t){return u.labels.bar_scale_row(Math.abs(t.value))/v})).attr("x",(function(t){return-u.labels.bar_scale_row(Math.abs(t.value))/v})),s(u)}function x(t,e){d3.selectAll(u.root+" ."+t+"_dendro_crop_buttons").transition().duration(m).style("opacity",e)}}},function(t,e,r){var n=r(2),o=r(148),a=r(149);t.exports=function(t){d3.selectAll(t.root+" .row_label_group").select("text").text((function(t){return n.normal_name(t)})),d3.selectAll(t.root+" .col_label_text").select("text").text((function(t){return n.normal_name(t)})),a(t),d3.selectAll(t.root+" .row_label_group").each((function(){o(t,this,"row")})),d3.selectAll(t.root+" .col_label_group").each((function(){o(t,this,"col")}))}},function(t,e){t.exports=function(t,e,r){if("none"!=d3.select(e).style("display")){var n,o,a,i,s,l,c,u,d,f=t.viz.norm_labels.width[r];n="row"===r?t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale():t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale(),d3.select(e).select("text").each((function(t){d=t.name.length}));var p=d3.select(e).select("text").node().getBBox().width;if((o=v(p,n))>f)for(u=1;u<d;u++)o>f&&(d3.select(e).select("text").text(_),p=d3.select(e).select("text").node().getBBox().width,o=v(p,n));else if(o<.75*f)for(u=1;u<d;u++)o<.75*f&&(d3.select(e).select("text").text(h),p=d3.select(e).select("text").node().getBBox().width,o=v(p,n))}function _(){return s=d3.select(this).text(),i=s.length,c=i-3,a=s.substring(0,c)+".."}function h(t){return s=d3.select(this).text(),i=".."===s.slice(-2)?s.length-2:s.length,l=t.name,c=i+2,(a=l.substring(0,c)+"..").length>l.length&&(a=l),a}function v(t,e){return o=e<1?t:t*e}}},function(t,e,r){var n=r(150);t.exports=function(t){var e,r=t.labels.default_fs_row,o=n(t);o.row>3&&(o.row>t.labels.max_allow_fs?((e=t.viz.zoom_ratio.y?t.zoom_behavior.scale()/t.viz.zoom_ratio.y:t.zoom_behavior.scale())<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)),o.col>3&&(o.col>t.labels.max_allow_fs?((e=t.viz.zoom_ratio.x>1?t.zoom_behavior.scale()/t.viz.zoom_ratio.x:t.zoom_behavior.scale())<1&&(e=1),(r=t.labels.max_allow_fs/e)>.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){t.exports=function(t){var e={};return t.viz.zoom_ratio.x>1?(e.row=t.labels.default_fs_row*t.zoom_behavior.scale(),e.col=t.labels.default_fs_col*t.zoom_behavior.scale()):(e.row=t.labels.default_fs_row*t.zoom_behavior.scale()/t.viz.zoom_ratio.y,e.col=t.labels.default_fs_col*t.zoom_behavior.scale()),e}},function(t,e){t.exports=function(t){t.zoom_info.zoom_x*t.viz.border_width.x>1?d3.selectAll(t.root+" .vert_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .vert_lines").select("line").style("display","none"),t.zoom_info.zoom_y*t.viz.border_width.y>1?d3.selectAll(t.root+" .horz_lines").select("line").style("display","block").style("opacity",0).transition().style("opacity",1):d3.selectAll(t.root+" .horz_lines").select("line").style("display","none")}},function(t,e,r){var n=r(143),o=r(100);t.exports=function(t){var e=t.params,r=e.viz;d3.select(e.root+" .row_cat_label_container").empty()&&(d3.select(t.params.viz.viz_svg).append("g").classed("row_cat_label_container",!0),d3.select(t.params.viz.viz_svg+" .row_cat_label_container").append("g").classed("row_cat_label_bar_container",!0));var a=r.clust.margin.left+r.clust.dim.width+r.uni_margin,i=r.norm_labels.margin.top+r.norm_labels.width.col+2.5*r.uni_margin,s=1.15*r.cat_room.symbol_width;d3.select(e.root+" .row_cat_label_container").attr("transform",(function(){return a=r.norm_labels.margin.left+r.norm_labels.width.row+r.cat_room.symbol_width+2.75*r.uni_margin,i=r.clust.margin.top-r.uni_margin,"translate("+a+","+i+") 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 l=o().attr("class",(function(){var t=e.viz.root_tips.replace(".","");return t+" d3-tip "+t+"_row_cat_super"})).direction("south_custom").offset([50,-75]).style("display","none").style("opacity",0).html((function(t){var o,a=e.network_data.row_nodes[0][t];a.indexOf("<p>")>-1?o=a.split(": ")[0]+"<p>"+a.split("<p>")[1]:o=n(r,t,"row");return o})),c=1.25*r.cat_room.symbol_width,u=.9*c;if(d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("text").style("width","100px").style("height",u+"px").classed("row_cat_super",!0).style("font-size",s+"px").style("opacity",.65).style("cursor","default").attr("transform",(function(t){return"translate(0,"+1.25*r.cat_room.symbol_width*parseInt(t.split("-")[1],10)+")"})).text((function(t){return n(r,t,"row")})),d3.select(e.root+" .row_cat_label_container").selectAll().data(r.all_cats.row).enter().append("rect").classed("row_cat_super",!0).classed("row_cat_selection_bar",!0).style("height",u+"px").style("fill","green").style("width","120px").style("opacity",0).attr("transform",(function(t){return"translate(0,"+c*(parseInt(t.split("-")[1],10)-.75)+")"})).on("mouseover",(function(t){d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","block").style("opacity",1),l.show(t)})).on("mouseout",(function(){l.hide(this),d3.selectAll(".d3-tip").style("display","none"),d3.selectAll(e.viz.root_tips+"_row_cat_super").style("display","none").style("opacity",0)})),!1===d3.select(e.root+" .row_cat_selection_bar").empty()&&d3.selectAll(e.root+" .row_cat_selection_bar").call(l),_.has(e.network_data,"row_cat_bars")){d3.select(e.root+" .enr_title").remove();var d=d3.select(e.root+" .viz_svg").append("g").classed("enr_title",!0).attr("transform",(function(){var t=d3.select(e.root+" .row_cat_label_container").attr("transform").split("(")[1].split(")")[0],r=Number(t.split(",")[0])-10;return"translate("+String(r)+", 0)"}));d.append("rect").attr("width",e.viz.cat_room.row).attr("height",25).attr("fill","white");var f=e.network_data.enrichrgram_lib.substring(0,40);d.append("text").attr("transform","translate(0, 17)").text(f.replace(/_/g," ")).style("font-size","15px").attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),d3.selectAll(e.root+" .enrichr_bars").remove();var p=e.viz.clust.margin.top-35,h=e.network_data.row_cat_bars[0],v=d3.scale.linear().domain([0,h]).range([0,p]);d3.select(e.root+" .row_cat_label_bar_container").selectAll().data(e.network_data.row_cat_bars).enter().append("rect").classed("enrichr_bars",!0).attr("height",u+"px").attr("fill","red").attr("width",(function(t){return v(t)+"px"})).attr("opacity",.4).attr("transform",(function(t,e){return"translate(0, "+c*(e-.75)+")"}))}}},function(t,e,r){var n=r(154);t.exports=function(t){var e=t.params;d3.select(e.root+" .expand_button").on("click",null);(d3.select(e.root+" .expand_button").empty()?d3.select(e.viz.viz_svg).append("text").attr("class","expand_button"):d3.select(e.root+" .expand_button")).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-family","FontAwesome").attr("font-size","30px").text((function(){return!1===e.viz.is_expand?"":""})).attr("y","25px").attr("x","25px").style("cursor","pointer").style("opacity",.4).on("mouseover",(function(){d3.select(this).style("opacity",.75)})).on("mouseout",(function(){d3.select(this).style("opacity",.4)})).on("click",(function(){!1===e.viz.is_expand?(d3.select(this).text((function(){return""})),e.viz.is_expand=!0,d3.selectAll(e.root+" .borders").style("fill","white"),d3.select(e.root+" .sidebar_wrapper").style("display","none")):(d3.select(this).text((function(){return""})),e.viz.is_expand=!1,d3.selectAll(e.root+" .borders").style("fill","#eee"),d3.select(e.root+" .viz_wrapper").style("width","100px"),d3.select(e.root+" .sidebar_wrapper").style("display","block")),d3.select(e.viz.viz_svg).style("opacity",.5);var r=500;1==e.viz.run_trans&&(r=2500),setTimeout(n,r,t)}))}},function(t,e,r){var n=r(2),o=r(155),a=r(163),i=r(164),s=r(165),l=r(166),c=r(167),u=r(168),d=r(169),f=r(170),p=r(171),_=r(172),h=r(173),v=r(174),m=r(175),g=r(176),y=r(177),w=r(178),x=r(147),b=r(107),z=r(106),k=r(136),A=r(70),E=r(179),N=r(152),M=r(144),S=r(180),O=r(181),T=r(182),B=r(183),C=r(88),F=r(184),I=r(3);t.exports=function(t){var e=t.params,r=A(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=g(e)).zoom_info=C(),i(e);var j=d3.select(e.viz.viz_svg);I.each(e.network_data.links,(function(t){t.x=e.viz.x_scale(t.target),t.y=e.viz.y_scale(t.source)})),j.on(".zoom",null),e.zoom_behavior.scaleExtent([1,e.viz.square_zoom*e.viz.zoom_ratio.x]).on("zoom",(function(){o(t)})),e.viz.do_zoom&&j.call(e.zoom_behavior),a(t),j.attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height),j.select(".super_background").style("width",e.viz.svg_dim.width).style("height",e.viz.svg_dim.height),j.select(".grey_background").attr("width",e.viz.clust.dim.width).attr("height",e.viz.clust.dim.height),setTimeout(E,100,e);var R=e.network_data.row_nodes,L=n.pluck(R,"name");y(e,j),j.selectAll(".highlighting_rect").attr("width",.8*e.viz.x_scale.rangeBand()).attr("height",.8*e.viz.y_scale.rangeBand()),f(e),d(e,j),p(e,j),j.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}))})),j.selectAll(".row_label_group").select("text").attr("y",.5*e.viz.rect_height+.35*e.labels.default_fs_row),n.has(e.network_data.row_nodes[0],"value")&&w(t,j),j.selectAll(".row_cat_group").attr("transform",(function(t){var r=I.indexOf(L,t.name);return"translate(0, "+e.viz.y_scale(r)+")"})),j.selectAll(".row_cat_group").select("path").attr("d",(function(){return"M "+(e.viz.cat_room.symbol_width-1)+",0 L 1,"+e.viz.rect_height/2+" L "+(e.viz.cat_room.symbol_width-1)+","+e.viz.rect_height+" Z"}));e.viz.show_dendrogram?(b(t,"row",true),b(t,"col",true),s(e,j),z(t,"row",0),z(t,"col",0)):s(e,j),_(e,j),h(e,j),v(e,j),m(e,j),l(e,j),c(e.viz,j),F(e),u(e,j),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+")"),-1===t.params.viz.ds_level&&k(t),N(t),d3.select(e.viz.viz_svg).style("opacity",1),M(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"),setTimeout(O,500,t),setTimeout(B,500,t),setTimeout(T,500,t)}},function(t,e,r){var n=r(156),o=r(161),a=r(162);t.exports=function(t){var e=t.params,r={};if(r.zoom_x=d3.event.scale,r.zoom_y=d3.event.scale,r.trans_x=e.zoom_behavior.translate()[0]-e.viz.clust.margin.left,r.trans_y=e.zoom_behavior.translate()[1]-e.viz.clust.margin.top,d3.selectAll(e.viz.root_tips).style("display","none"),e.zoom_info=o(e,r),e.zoom_info=a(e,r),!1===e.is_slider_drag&&!1===e.is_cropping){var i=e.zoom_info.trans_x+e.viz.clust.margin.left,s=e.zoom_info.trans_y+e.viz.clust.margin.top;e.zoom_behavior.translate([i,s]),t.params=e,n(t)}}},function(t,e,r){var n=r(149),o=r(136),a=r(157),i=r(114),s=r(131),l=r(158),c=r(160);t.exports=function(t){var e=t.params,r=e.zoom_info,u=s(e);d3.select(e.root+" .clust_group").attr("transform","translate("+[r.trans_x,r.trans_y]+") scale("+r.zoom_x+","+r.zoom_y+")"),d3.select(e.root+" .row_label_zoom_container").attr("transform","translate("+[0,r.trans_y]+") scale("+r.zoom_y+")"),d3.select(e.root+" .col_zoom_container").attr("transform","translate("+[r.trans_x,0]+") scale("+r.zoom_x+")"),d3.select(e.root+" .row_cat_container").attr("transform","translate("+[0,r.trans_y]+") scale( 1,"+r.zoom_y+")"),d3.select(e.root+" .row_dendro_container").attr("transform","translate("+[e.viz.uni_margin/2,r.trans_y]+") scale( 1,"+r.zoom_y+")"),d3.select(e.root+" .row_dendro_icons_group").attr("transform",(function(){return"translate("+[0,r.trans_y]+") "+("scale(1, "+r.zoom_y+")")})),d3.select(e.root+" .col_dendro_icons_group").attr("transform",(function(){return"translate("+[r.trans_x,0]+")"+("scale("+r.zoom_x+", 1)")})),i(e,r,"row"),i(e,r,"col"),d3.select(e.root+" .col_cat_container").attr("transform","translate("+[r.trans_x,0]+") scale("+r.zoom_x+",1)"),d3.select(e.root+" .col_dendro_container").attr("transform","translate("+[r.trans_x,e.viz.uni_margin/2]+") scale("+r.zoom_x+",1)"),a(e,r),d3.select(e.root+" .viz_svg").attr("is_zoom",(function(){var t=Number(d3.select(e.root+" .viz_svg").attr("is_zoom"));return d3.select(e.root+" .viz_svg").attr("stopped_zoom",1),t+1}));if(n(e),r.zoom_y<=u.zoom_y){var d=!1;r.zoom_y<u.zoom_y&&(d=!0);o(t,!1,d)}setTimeout((function(){d3.select(e.root+" .viz_svg").attr("is_zoom",(function(){return Number(d3.select(e.root+" .viz_svg").attr("is_zoom"))-1}))}),50),setTimeout((function(t){var e=t.params;!0===c(e)&&setTimeout(l,50,t)}),100,t)}},function(t,e,r){var n=r(2);t.exports=function(t){var e=t.zoom_info;n.has(t.network_data.row_nodes[0],"value")&&d3.selectAll(t.root+" .row_bars").attr("width",(function(r){return t.labels.bar_scale_row(Math.abs(r.value))/e.zoom_y})).attr("x",(function(r){return-t.labels.bar_scale_row(Math.abs(r.value))/e.zoom_y})),n.has(t.network_data.col_nodes[0],"value")&&d3.selectAll(t.root+" .col_bars").attr("width",(function(r){var n=0;return r.value>0&&(n=t.labels.bar_scale_col(r.value)/e.zoom_x),n}))}},function(t,e,r){var n=r(149),o=r(148),a=r(159),i=r(151),s=r(136),l=r(160),c=r(3);t.exports=function(t){var e=t.params;if(!0===l(e)){c.each(["row","col"],(function(t){d3.selectAll(e.root+" ."+t+"_label_group").select("text").style("opacity",1),d3.selectAll(e.root+" ."+t+"_cat_group").select("path").style("display","block")})),s(t,!0),d3.selectAll(e.viz.root_tips).style("display","block"),d3.selectAll(e.root+" .row_label_group").select("text").style("display","none"),d3.selectAll(e.root+" .row_label_group").select("text").style("display","block"),d3.select(e.root+" .viz_svg").attr("stopped_zoom",0),d3.selectAll(e.root+" .row_label_group").select("text").style("display","block"),d3.selectAll(e.root+" .col_label_group").select("text").style("display","block"),i(e),t.params.viz.x_offset=0;c.each(["row","col"],(function(t){a(e,t)<150&&d3.selectAll(e.root+" ."+t+"_label_group").each((function(){o(e,this,t)}))})),r(),n(e),setTimeout(r,100)}function r(){c.each(["row","col"],(function(t){d3.selectAll(e.root+" ."+t+"_label_group").filter((function(){return"none"!=d3.select(this).style("display")})).select("text").style("font-size",(function(){return Number(d3.select(this).style("font-size").replace("px",""))}))}))}}},function(t,e){t.exports=function(t,e){var r;return"row"===e?(r=1e4,-1===t.viz.ds_level&&(r=d3.selectAll(t.root+" .row")[0].length)):"col"===e&&(r=d3.selectAll(t.root+" ."+e+"_label_text").filter((function(){return"none"!=d3.select(this).style("display")}))[0].length),r}},function(t,e){t.exports=function(t){var e=Number(d3.select(t.root+" .viz_svg").attr("is_zoom")),r=Number(d3.select(t.root+" .viz_svg").attr("stopped_zoom")),n=!1;return 0===e&&0!=r&&(n=!0),n}},function(t,e){t.exports=function(t,e){var r=t.viz;return r.zoom_ratio.y>1&&(e.zoom_y<r.zoom_ratio.y?(e.trans_y=0,e.zoom_y=1):e.zoom_y=e.zoom_y/r.zoom_ratio.y),e.pan_room_y=(e.zoom_y-1)*r.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){t.exports=function(t,e){var r=t.viz;return r.zoom_ratio.x>1&&(e.zoom_x<r.zoom_ratio.x?e.zoom_x=1:e.zoom_x=e.zoom_x/r.zoom_ratio.x),e.pan_room_x=(e.zoom_x-1)*r.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){var n=r(146);t.exports=function(t){var e=t.params;d3.selectAll(e.viz.zoom_element).on("dblclick.zoom",null),d3.select(e.viz.zoom_element).on("dblclick",(function(){n(t,0,0,1)}))}},function(t,e){t.exports=function(t){var e=-0*(t.viz.clust.dim.height/2);d3.select(t.root+" .clust_group").attr("transform","translate("+[0,0+e]+") scale(1,1)translate("+[0,0]+")"),d3.select(t.root+" .row_label_zoom_container").attr("transform","translate("+[0,e]+") scale(1,1)translate("+[0,0]+")"),d3.select(t.root+" .row_cat_container").attr("transform","translate("+[0,e]+") scale(1,1)translate("+[0,0]+")"),d3.select(t.root+" .row_dendro_container").attr("transform","translate("+[0,e]+") scale(1,1)translate("+[t.viz.uni_margin/2,0]+")"),d3.select(t.root+" .col_zoom_container").attr("transform"," scale(1,1)translate("+[0,0]+")"),d3.select(t.root+" .col_cat_container").attr("transform"," scale(1,1)translate("+[0,0]+")"),d3.select(t.root+" .col_dendro_container").attr("transform"," scale(1,1)translate("+[0,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){return"translate(7,"+t.pos_mid+") scale(1, 1)"}))}},function(t,e,r){var n=r(3);t.exports=function(t,e,r=!1){var o={};!1===r?o.run_transition=!1:o=r;var a,i,s,l=t.viz.duration,c=t.network_data.col_nodes,u=t.network_data.col_nodes_names;o.run_transition?(a=e.transition().delay(o.update).duration(l),e.selectAll(".col_cat_group").data(c,(function(t){return t.name})).transition().delay(o.update).duration(l).attr("transform",(function(e){var r=n.indexOf(u,e.name);return"translate("+t.viz.x_scale(r)+",0)"})),e.selectAll(".col_dendro_group").data(c,(function(t){return t.name})).transition().delay(o.update).duration(l).attr("transform",(function(e){var r=n.indexOf(u,e.name);return"translate("+t.viz.x_scale(r)+",0)"}))):(a=e,e.selectAll(".col_cat_group").data(c,(function(t){return t.name})).attr("transform",(function(e){var r=n.indexOf(u,e.name);return"translate("+t.viz.x_scale(r)+",0)"})),d3.select(t.root).selectAll(".col_dendro_group").data(c,(function(t){return t.name})).attr("transform",(function(e){var r=n.indexOf(u,e.name);return"translate("+t.viz.x_scale(r)+",0)"}))),n.each(["row","col"],(function(e){var r=t.viz.all_cats[e].length;for(i=0;i<r;i++)s="."+e+"_cat_rect_"+String(i),"row"===e?a.selectAll(s).attr("height",t.viz.y_scale.rangeBand()):a.selectAll(s).attr("width",t.viz.x_scale.rangeBand())}));var d=t.viz.clust.margin.left+t.viz.clust.dim.width,f=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+","+f+")"),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,f=t.viz.clust.margin.top+t.viz.clust.dim.height;var _=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",_+"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,f=0,d3.select(t.root+" .col_dendro_icons_container").attr("transform","translate("+d+","+f+")")}},function(t,e){t.exports=function(t,e,r=!1){var n,o={},a=t.viz.duration;!1===r?o.run_transition=!1:o=r,(n=o.run_transition?e.transition().delay(o.update).duration(a):e).select(".super_col_bkg").attr("height",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.grey_border_width+")"),n.select(".super_col").attr("transform",(function(){return"translate("+(t.viz.clust.dim.width/2+t.viz.norm_labels.width.row)+","+t.viz.super_labels.dim.width+")"})),n.select(".super_row_bkg").attr("width",t.viz.super_labels.dim.width+"px").attr("transform","translate("+t.viz.grey_border_width+",0)"),n.select(".super_row").attr("transform",(function(){return"translate("+t.viz.super_labels.dim.width+","+(t.viz.clust.dim.height/2+t.viz.norm_labels.width.col)+")"}))}},function(t,e){t.exports=function(t,e,r=!1){var n,o={},a=t.duration;!1===r?o.run_transition=!1:o=r,(n=o.run_transition?e.transition().delay(o.update).duration(a):e).select(t.root+" .right_slant_triangle").attr("transform","translate("+t.clust.dim.width+","+t.norm_labels.width.col+")"),n.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;n.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);n.select(t.root+" .right_spillover_container").attr("transform",(function(){return"translate("+s+", 0)"})),l=t.norm_labels.margin.top+t.norm_labels.width.col,n.select(t.root+" .right_spillover_container rect").attr("transform",(function(){return"translate( 0,"+l+")"})),n.select(t.root+" .right_spillover").attr("height",t.svg_dim.height+"px");var c=t.clust.margin.left+t.clust.dim.width,u=l,d=t.dendro_room.row+t.uni_margin,f=t.cat_room.col+t.uni_margin;d3.select(t.root+" .dendro_row_spillover").attr("width",d).attr("height",f).attr("transform",(function(){return"translate("+c+","+u+")"})),c=0,u=t.clust.margin.top+t.clust.dim.height,d=t.clust.margin.left,f=10*t.clust.dim.height,n.select(".dendro_col_spillover").attr("width",d).attr("height",f).attr("transform",(function(){return"translate("+c+","+u+")"})),c=t.clust.margin.left+t.clust.dim.width,u=t.clust.margin.top+t.clust.dim.height,d=t.cat_room.col+t.clust.dim.width,f=t.cat_room.row+t.uni_margin,n.select(".dendro_corner_spillover").attr("width",d).attr("height",f).attr("transform",(function(){return"translate("+c+","+u+")"})),c=t.clust.margin.left+t.clust.dim.width+t.uni_margin,u=t.norm_labels.margin.top+t.norm_labels.width.col+2.5*t.uni_margin;t.show_categories.col&&d3.selectAll(t.root+" .col_cat_super").attr("transform",(function(e){var r=parseInt(e.split("-")[1],10),n=u+1.2*t.cat_room.symbol_width*r;return"translate("+c+","+n+")"})),t.show_categories.row&&d3.select(t.root+" .row_cat_label_container").attr("transform",(function(){return c=t.norm_labels.margin.left+t.norm_labels.width.row+t.cat_room.symbol_width+2.75*t.uni_margin,u=t.clust.margin.top-t.uni_margin,"translate("+c+","+u+") rotate(-90)"})),u=t.show_dendrogram?t.clust.margin.top+t.clust.dim.height+t.dendro_room.col-2*t.uni_margin:t.clust.margin.top+t.clust.dim.height,d3.select(t.root+" .bottom_spillover_container").attr("transform",(function(){return"translate(0,"+u+")"})),n.select(t.root+" .bottom_spillover").attr("width",t.svg_dim.width).attr("height",2*t.svg_dim.height);var p=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",p).attr("transform",(function(){return"translate("+(t.clust.margin.left+t.clust.dim.width)+", "+(t.norm_labels.width.col+t.norm_labels.margin.top-t.uni_margin)+")"}))}},function(t,e){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(){return"translate("+(t.viz.svg_dim.width-t.viz.grey_border_width)+",0)"})),e.select(".top_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",(function(){return"translate(0,0)"})),e.select(".bottom_border").attr("width",t.viz.svg_dim.width).attr("height",t.viz.grey_border_width).attr("transform",(function(){return"translate(0,"+(t.viz.svg_dim.height-t.viz.grey_border_width)+")"}))}},function(t,e,r){var n=r(3);t.exports=function(t,e,r=!1){var o,a={},i=t.viz.duration,s=t.network_data.row_nodes,l=t.network_data.row_nodes_names;!1===r?a.run_transition=!1:a=r,a.run_transition?(e.selectAll(".row_label_group").data(s,(function(t){return t.name})).transition().delay(a.update).duration(i).attr("transform",(function(e){var r=n.indexOf(l,e.name);return"translate(0,"+t.viz.y_scale(r)+")"})).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),o=e.transition().delay(a.update).duration(i)):(e.selectAll(".row_label_group").data(s,(function(t){return t.name})).attr("transform",(function(e){var r=n.indexOf(l,e.name);return"translate(0,"+t.viz.y_scale(r)+")"})).attr("y",.5*t.viz.rect_height+.35*t.labels.default_fs_row),o=e),o.select(t.root+" .row_container").attr("transform","translate("+t.viz.norm_labels.margin.left+","+t.viz.clust.margin.top+")"),o.select(t.root+" .row_container").select(".white_bars").attr("width",t.viz.label_background.row).attr("height",30*t.viz.clust.dim.height+"px"),o.select(t.root+" .row_container").select(".row_label_container").attr("transform","translate("+t.viz.norm_labels.width.row+",0)")}},function(t,e){t.exports=function(t){var e=6*t.viz.border_width.x,r=6*t.viz.border_width.y;d3.select(t.root+" .top_hlight").attr("width",t.viz.rect_width).attr("height",r).attr("transform",(function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+",0)"})),d3.select(t.root+" .left_hlight").attr("width",e).attr("height",t.viz.rect_width-.99*r).attr("transform",(function(){return"translate("+t.viz.x_scale(t.matrix.click_hlight_x)+","+.99*r+")"})),d3.select(t.root+" .right_hlight").attr("width",e).attr("height",t.viz.rect_height-.99*r).attr("transform",(function(){return"translate("+(t.viz.x_scale(t.matrix.click_hlight_x)+t.viz.rect_width-e)+","+.99*r+")"})),d3.select(t.root+" .bottom_hlight").attr("width",(function(){return t.viz.rect_width-1.98*e})).attr("height",r).attr("transform",(function(){return"translate("+(t.viz.x_scale(t.matrix.click_hlight_x)+.99*e)+","+(t.viz.rect_height-r)+")"})),d3.select(t.root+" .row_top_hlight").attr("width",t.viz.svg_dim.width).attr("height",r),d3.select(t.root+" .row_bottom_hlight").attr("width",t.viz.svg_dim.width).attr("height",r).attr("transform",(function(){return"translate(0,"+(t.viz.rect_height-r)+")"})),d3.select(t.root+" .col_top_hlight").attr("width",t.viz.clust.dim.height).attr("height",e).attr("transform",(function(){return"translate("+-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin)+",0)"})),d3.select(t.root+" .col_bottom_hlight").attr("width",t.viz.clust.dim.height).attr("height",e).attr("transform",(function(){var r=t.viz.rect_width-e;return"translate("+-(t.viz.clust.dim.height+t.viz.cat_room.col+t.viz.uni_margin)+","+r+")"}))}},function(t,e){t.exports=function(t,e,r=!1){var n,o={},a=t.viz.duration;!1===r?o.run_transition=!1:o=r,(n=o.run_transition?e.transition().delay(o.update).duration(a):e).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(){return t.viz.clust.dim.height}));var i=t.viz.clust.margin.left+t.viz.clust.dim.width,s=t.viz.clust.margin.top;n.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,n.select(" .col_dendro_outer_container").attr("transform",(function(){return"translate("+i+","+s+")"}))}},function(t,e,r){var n=r(3);t.exports=function(t,e,r=!1){var o,a={},i=t.viz.duration,s=t.network_data.col_nodes,l=t.network_data.col_nodes_names;!1===r?a.run_transition=!1:a=r,a.run_transition?(o=e.transition().delay(a.update).duration(i),e.selectAll(".col_label_text").data(s,(function(t){return t.name})).transition().delay(a.update).duration(i).attr("transform",(function(e){var r=n.indexOf(l,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"}))):(o=e,e.selectAll(".col_label_text").data(s,(function(t){return t.name})).attr("transform",(function(e){var r=n.indexOf(l,e.name);return"translate("+t.viz.x_scale(r)+", 0) rotate(-90)"})));var c=t.viz.x_scale.rangeBand()/2+t.viz.border_width.x;o.select(t.root+" .col_container").attr("transform","translate("+t.viz.clust.margin.left+","+t.viz.norm_labels.margin.top+")"),o.select(t.root+" .col_container").select(".white_bars").attr("width",30*t.viz.clust.dim.width+"px").attr("height",t.viz.label_background.col),o.select(t.root+" .col_container").select(".col_label_outer_container").attr("transform","translate(0,"+t.viz.norm_labels.width.col+")"),o.selectAll(".col_label_group").attr("transform","translate("+t.viz.x_scale.rangeBand()/2+","+c+") rotate(45)"),o.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){var n=r(2);t.exports=function(t,e){e.selectAll(".col_label_group").select("text").style("font-size",t.labels.default_fs_col+"px").text((function(t){return n.normal_name(t)})),e.selectAll(".col_label_group").each((function(){d3.select(this).select("text")[0][0].getBBox()}))}},function(t,e,r){var n=r(140);t.exports=function(t,e,r=!1){var o=e.selectAll(".col_label_group").select("path"),a={},i=t.viz.duration;!1===r?a.run_transition=!1:a=r,(a.run_transition?o.transition().delay(a.update).duration(i):o).attr("d",(function(){return n(t)})).attr("fill","#eee")}},function(t,e,r){var n=r(2);t.exports=function(t,e,r=!1){var o={};!1===r?o.run_transition=!1:o=r,n.has(t.network_data.col_nodes[0],"value")&&e.selectAll(".col_bars").data(t.network_data.col_nodes,(function(t){return t.name})).attr("width",(function(e){var r=0;return e.value>0&&(r=t.labels.bar_scale_col(e.value)),r})).attr("height",.66*t.viz.rect_width)}},function(t,e,r){var n=r(71),o=r(74),a=r(73),i=r(83),s=r(82),l=r(3);t.exports=function(t){if((t=n(t)).viz=a(t.viz),t.viz=o(t.viz),t.sim_mat&&(t.viz.clust.dim.width<=t.viz.clust.dim.height?t.viz.clust.dim.height=t.viz.clust.dim.width:t.viz.clust.dim.width=t.viz.clust.dim.height),t.viz=s(t.viz),t.viz.x_scale.rangeBands([0,t.viz.clust.dim.width]),t.viz.y_scale.rangeBands([0,t.viz.clust.dim.height]),t.viz.border_width.x=t.viz.x_scale.rangeBand()/t.viz.border_fraction,t.viz.border_width.y=t.viz.y_scale.rangeBand()/t.viz.border_fraction,t.viz.rect_width=t.viz.x_scale.rangeBand()-t.viz.border_width.x,t.viz.rect_height=t.viz.y_scale.rangeBand()-t.viz.border_width.y,null!=t.viz.ds)for(var e;e<t.viz.ds.length;e++)t.viz.ds[e].rect_height=t.viz.ds[e].y_scale.rangeBand()-t.viz.border_width.y;return t.viz.ds_num_levels>0&&l.each(t.viz.ds,(function(e){e.y_scale=d3.scale.ordinal().rangeBands([0,t.viz.clust.dim.height]),e.y_scale.domain(d3.range(e.num_rows+1)),e.rect_height=e.y_scale.rangeBand()-t.viz.border_width.y})),t.viz.square_zoom=t.viz.norm_labels.width.col/(t.viz.rect_width/2),t=i(t)}},function(t,e,r){var n=r(95),o=r(96),a=r(99),i=r(3);t.exports=function(t,e){var r=t.network_data.row_nodes_names;if(-1===t.viz.ds_level)e.selectAll(".row").attr("transform",(function(e){var n=i.indexOf(r,e.name);return"translate(0,"+t.viz.y_scale(n)+")"})),e.selectAll(".row").selectAll(".tile").attr("transform",(function(e){return a(t,e)})).attr("width",t.viz.rect_width).attr("height",t.viz.rect_height),e.selectAll(".row").selectAll(".tile_up").attr("d",(function(){return n(t)})).attr("transform",(function(e){return a(t,e)})),e.selectAll(".row").selectAll(".tile_dn").attr("d",(function(){return o(t)})).attr("transform",(function(e){return a(t,e)}));else{var s=t.viz.ds_level,l=".ds"+String(s)+"_row",c=t.viz.ds[s].rect_height;e.selectAll(l).attr("transform",(function(e){return"translate(0,"+t.viz.ds[s].y_scale(e.row_index)+")"})),e.selectAll(l).selectAll(".tile").attr("transform",(function(e){return a(t,e)})).attr("width",t.viz.rect_width).attr("height",c)}}},function(t,e,r){var n=r(75);t.exports=function(t,e){var r=t.params;r=n(r),e.selectAll(".row_bars").attr("width",(function(t){return r.labels.bar_scale_row(Math.abs(t.value))})).attr("x",(function(t){return-r.labels.bar_scale_row(Math.abs(t.value))})).attr("height",r.viz.y_scale.rangeBand())}},function(t,e){t.exports=function(t){var e=d3.select(t.root+" .clust_container").attr("transform"),r=Number(e.split("(")[1].split(",")[0]),n=Number(e.split(",")[1].replace(")","")),o=r+t.viz.clust.dim.width/2,a=n+t.viz.clust.dim.height/2;d3.select(t.root+" .play_button").attr("transform",(function(){return"translate("+o+","+a+")"}))}},function(t,e){t.exports=function(t,e="row"){var r,n,o=t.params.viz;if("row"===e){var a=o.svg_dim.width-3*o.uni_margin;(r=o.clust.margin.left+o.clust.dim.width+5.25*o.dendro_room.row+2)>a&&(r=a),n=o.clust.margin.top+3*o.uni_margin+30}else r=2*o.uni_margin,n=o.clust.margin.top+o.clust.dim.height+o.dendro_room.col-2*o.uni_margin;d3.select(t.params.root+" ."+e+"_slider_group").attr("transform",(function(){return"row"===e?"translate("+(r+=.8*o.dendro_room.row)+","+n+")":"translate("+r+","+n+"), rotate(-90)"})).style("opacity",1)}},function(t,e){t.exports=function(t){var e,r,n=t.params.viz,o=n.svg_dim.width-3*n.uni_margin;(e=n.clust.margin.left+n.clust.dim.width+5.25*n.dendro_room.row)>o&&(e=o),r=n.clust.margin.top+3*n.uni_margin+90,d3.select(t.params.root+" .tree_icon").attr("transform",(function(){return"translate("+e+","+(r-=75)+")"})).style("opacity",1)}},function(t,e){t.exports=function(t){var e,r,n=t.params.viz,o=n.svg_dim.width-3*n.uni_margin;(e=n.clust.margin.left+n.clust.dim.width+4*n.dendro_room.row+7)>o&&(e=o),r=n.clust.margin.top+3*n.uni_margin+152,d3.select(t.params.root+" .filter_icon").attr("transform",(function(){return"translate("+e+","+(r-=75)+")"})).style("opacity",1)}},function(t,e){t.exports=function(t){var e=t.params;if(!1===d3.select(e.root+" .tree_menu").empty()){var r=t.params.viz.tree_menu_width;d3.select(e.root+" .tree_menu").attr("transform",(function(){var t={};return t.x=e.viz.clust.dim.width+e.viz.clust.margin.left-r+30,t.y=e.viz.clust.margin.top+15,"translate("+t.x+", "+t.y+")"}))}}},function(t,e){t.exports=function(t,e=0){var r=0;e>0&&(r=2e3);var n=d3.selectAll(t.root+" .horz_lines"),o=d3.selectAll(t.root+" .vert_lines");n.style("opacity",0).attr("transform",(function(e){var r=e.row_index;return"translate( 0,"+t.viz.y_scale(r)+") rotate(0)"})).transition().duration(e).delay(r).style("opacity",1),n.append("line").attr("x1",0).attr("x2",t.viz.clust.dim.width).style("stroke-width",(function(){return t.viz.border_width.y+"px"})),o.style("opacity",0).attr("transform",(function(e){var r=e.col_index;return"translate("+t.viz.x_scale(r)+") rotate(-90)"})).transition().duration(e).delay(r).style("opacity",1),o.append("line").attr("x1",0).attr("x2",-t.viz.clust.dim.height).style("stroke-width",(function(){return t.viz.border_width.x+"px"}))}},function(t,e,r){var n=r(186),o=r(100),a=r(187),i=r(188),s=r(189),l=r(3);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(){return"translate(0,"+(e.viz.norm_labels.width.col+2)+")"})).append("g").attr("class","col_cat_container"):d3.select(e.root+" .col_container").select("col_cat_outer_container").attr("transform",(function(){return"translate(0,"+(e.viz.norm_labels.width.col+2)+")"})),d3.selectAll(e.viz.root_tips+"_col_cat_tip").remove();var r=o().attr("class",(function(){var t=e.viz.root_tips.replace(".","");return t+" d3-tip "+t+"_col_cat_tip"})).direction("s").offset([5,0]).style("display","none").html((function(t){return n(e,t,this,"col")}));d3.select(e.root+" .col_cat_container").selectAll("g").data(e.network_data.col_nodes,(function(t){return t.name})).enter().append("g").attr("class","col_cat_group").attr("transform",(function(t){var r=l.indexOf(e.network_data.col_nodes_names,t.name);return"translate("+e.viz.x_scale(r)+",0)"})),d3.select(e.root+" .col_cat_container").selectAll(".col_cat_group").call(r),d3.selectAll(e.root+" .col_cat_group").each((function(){var t,n=this;l.each(e.viz.all_cats.col,(function(o){var l=parseInt(o.split("-")[1],10),c="col_cat_rect_"+String(l);(t=d3.select(n).select("."+c).empty()?d3.select(n).append("rect").attr("class",c).attr("cat",o).attr("transform",(function(){var t=e.viz.cat_room.symbol_width+e.viz.cat_room.separation;return"translate(0,"+l*t+")"})).on("click",(function(t){if(d3.select(this).classed("cat_strings")){var r=s(e,t,this,"col");$(e.root+" .dendro_info").modal("toggle");var n=r.join(", ");d3.select(e.root+" .dendro_info input").attr("value",n)}})):d3.select(n).select("."+c)).attr("width",e.viz.x_scale.rangeBand()).attr("height",e.viz.cat_room.symbol_width).style("fill",(function(t){var r=t[o];return e.viz.cat_colors.col[o][r]})).on("mouseover",r.show).on("mouseout",(function(){r.hide(this),a(e),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")})),i(e.viz,"col",t,o)}))}))}},function(t,e,r){var n=r(143),o=r(3);t.exports=function(t,e,r,a){d3.selectAll(t.viz.root_tips+"_col_cat_tip").style("display","block"),d3.selectAll(t.viz.root_tips+"_row_cat_tip").style("display","block");var i=d3.select(r).attr("cat"),s=n(t.viz,i,a),l=e[i];"string"==typeof l&&l.indexOf(": ")>=0&&(l=l.split(": ")[1]);var c="<div>"+s+": "+l+"</div> <div> <br>Click for Category Menu </div>";return d3.select(r).classed("hovering",!0),setTimeout((function(){var e=!1;if(d3.select(r).classed("hovering")){var n=[a];t.viz.sim_mat&&(n=["row","col"]),o.each(n,(function(r){"string"==typeof l&&l.indexOf("Not ")<0&&"false"!=l&&(e=!0),e&&d3.selectAll(t.root+" ."+r+"_cat_group").selectAll("rect").style("opacity",(function(e){var r=d3.select(this).style("opacity");if(d3.select(this).classed("cat_strings")&&!1===d3.select(this).classed("filtered_cat")){var n,o=d3.select(this).attr("cat");n=e[o].indexOf(": ")>=0?e[o].split(": ")[1]:e[o],r=o===i&&n===l?t.viz.cat_colors.active_opacity:t.viz.cat_colors.opacity/4}return r}))}))}}),500),c}},function(t,e,r){var n=r(3);t.exports=function(t){n.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")&&!1===d3.select(this).classed("filtered_cat")&&(e=t.viz.cat_colors.opacity),e}))}))}},function(t,e){t.exports=function(t,e,r,n,o=!1){function a(t){return"string"==typeof t&&t.indexOf(": ")>-1&&(t=t.split(": ")[1]),parseFloat(t)}"cat_strings"===t.cat_info[e][n].type?o?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 o=a(r[n]);return t.cat_info[e][n].cat_scale(Math.abs(o))})).style("fill",(function(e){return a(e[n])>0?t.cat_value_colors[0]:t.cat_value_colors[1]}))}},function(t,e,r){var n=r(2),o=r(3);t.exports=function(t,e,r,a){var i=d3.select(r).attr("cat"),s=e[i],l=t.network_data[a+"_nodes"],c=o.filter(l,(function(t){return t[i]==s}));return n.pluck(c,"name")}},function(t,e,r){var n=r(186),o=r(100),a=r(187),i=r(188),s=r(189),l=r(3);t.exports=function(t,e=!1){var 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(){return r.viz.clust.dim.height})):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(){return r.viz.clust.dim.height})),d3.selectAll(r.viz.root_tips+"_row_cat_tip").remove();var c,u,d=o().attr("class",(function(){var t=r.viz.root_tips.replace(".","");return t+" d3-tip "+t+"_row_cat_tip"})).direction("e").offset([5,0]).style("display","none").html((function(t){return n(r,t,this,"row")}));d3.select(r.root+" .row_cat_container").selectAll("g").data(r.network_data.row_nodes,(function(t){return t.name})).enter().append("g").attr("class","row_cat_group").attr("transform",(function(t){var e=l.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(d),d3.selectAll(r.root+" .row_cat_group rect").remove(),r.viz.show_categories.row&&d3.selectAll(r.root+" .row_cat_group").each((function(){u=this,l.each(r.viz.all_cats.row,(function(t){var n=parseInt(t.split("-")[1],10),o="row_cat_rect_"+String(n);(c=d3.select(u).select("."+o).empty()?d3.select(u).append("rect").attr("class",o).attr("cat",t):d3.select(u).select("."+o)).attr("width",r.viz.cat_room.symbol_width).attr("height",r.viz.y_scale.rangeBand()).style("fill",(function(e){var n=e[t];return r.viz.cat_colors.row[t][n]})).attr("x",(function(){return r.viz.cat_room.symbol_width+r.viz.uni_margin/2+"px"})).attr("transform",(function(){var t=r.viz.cat_room.symbol_width+r.viz.cat_room.separation;return"translate("+n*t+",0)"})).on("click",(function(t){if(d3.select(this).classed("cat_strings")){var e=s(r,t,this,"row");$(r.root+" .dendro_info").modal("toggle");var n=e.join(", ");d3.select(r.root+" .dendro_info input").attr("value",n)}})).on("mouseover",d.show).on("mouseout",(function(){d.hide(this),a(r),d3.select(this).classed("hovering",!1),d3.selectAll(".d3-tip").style("display","none")})),i(r.viz,"row",c,t,e)}))}))}},function(t,e,r){var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.dendro_room.row+e.viz.uni_margin,o=e.viz.clust.margin.left+e.viz.clust.dim.width,a=e.viz.clust.margin.top;d3.select(e.root+" .row_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").append("rect").classed("row_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",r+"px").attr("height",e.viz.svg_dim.height),d3.select(e.root+" .row_dendro_outer_container").append("g").attr("class","row_dendro_container").attr("transform","translate("+e.viz.uni_margin/2+",0)")):(d3.select(e.root+" .viz_svg").select("row_dendro_outer_container").attr("transform","translate("+o+","+a+")"),d3.select(e.root+" .row_dendro_outer_container").select(".row_dendro_spillover").attr("width",r+"px").attr("height",e.viz.svg_dim.height)),n(t,"row",!1),"clust"!=e.viz.inst_order.col&&d3.selectAll(e.root+" .row_dendro_group").remove()}},function(t,e,r){var n=r(107);t.exports=function(t){var e=t.params,r=e.viz.clust.margin.left,o=e.viz.clust.margin.top+e.viz.clust.dim.height,a=e.viz.dendro_room.col+e.viz.uni_margin;d3.select(e.root+" .col_dendro_outer_container").empty()?(d3.select(e.root+" .viz_svg").append("g").attr("class","col_dendro_outer_container").attr("transform","translate("+r+","+o+")"),d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",a+"px"),d3.select(e.root+" .col_dendro_outer_container").append("g").attr("class","col_dendro_container").attr("transform","translate(0,"+e.viz.uni_margin/2+")"),d3.select(e.root+" .col_dendro_outer_container").append("rect").classed("col_dendro_spillover_top",!0).attr("fill",e.viz.background_color).attr("width",e.viz.svg_dim.width).attr("height",e.viz.svg_dim.height).attr("transform","translate(0,"+e.viz.dendro_room.col+")")):(d3.select(e.root+" .viz_svg").select("col_dendro_outer_container").attr("transform","translate("+r+","+o+")"),d3.select(e.root+" .col_dendro_outer_container").select(".col_dendro_spillover").attr("width",e.viz.svg_dim.width).attr("height",a+"px")),n(t,"col",!1),"clust"!=e.viz.inst_order.row&&d3.selectAll(e.root+" .col_dendro_group").remove()}},function(t,e,r){var n=r(194);t.exports=function(t){n(t,"row"),n(t,"col")}},function(t,e,r){var n=r(195),o=r(180);t.exports=function(t,e){var r=100,a=d3.behavior.drag().on("drag",(function(){t.params.is_slider_drag=!0;var o=d3.event.y;o<0&&(o=0);o>r&&(o=r);this.nextSibling&&this.parentNode.appendChild(this);var a=10-(o=d3.round(o,-1))/10;d3.select(this).attr("transform","translate(0, "+o+")"),n(t,e,a)})).on("dragend",(function(){t.params.is_slider_drag=!1})),i=d3.select(t.params.root+" .viz_svg").append("g").classed(e+"_slider_group",!0);o(t,e);i.append("rect").classed(e+"_slider_background",!0).attr("height","120px").attr("width","30px").attr("fill",t.params.viz.background_color).attr("transform",(function(){return"translate(-10, -5)"})).style("opacity",0),i.append("line").style("stroke-width",r/7+"px").style("stroke","black").style("stroke-linecap","round").style("opacity",0).attr("y1",0).attr("y2",(function(){return 98})).on("click",s);i.append("path").style("fill","black").attr("transform","translate(-2.5, 0)").attr("d",(function(){return"M0,0 L0, 100 L10,0 Z"})).style("opacity",.35).on("click",s);function s(){var r=d3.mouse(this),o=d3.round(r[1],-1);d3.select(t.params.root+" ."+e+"_group_circle").attr("transform","translate(0, "+o+")"),n(t,e,10-o/10)}i.append("circle").classed(e+"_group_circle",!0).attr("r",8).attr("transform",(function(){return"translate(0, 50)"})).style("fill","blue").style("opacity",.35).on("mouseover",(function(){d3.select(this).style("opacity",.6)})).on("mouseout",(function(){d3.select(this).style("opacity",.35)})).call(a)}},function(t,e,r){var n=r(107);t.exports=function(t,e,r){var o=t.params;"row"===e?o.group_level.row=r:"col"===e&&(o.group_level.col=r);n(t,e,!0)}},function(t,e,r){var n=r(112);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,o=d3.select(e.viz_svg).append("g").classed("right_spillover_container",!0).attr("transform",(function(){return"translate("+r+", 0)"})),a=e.norm_labels.margin.top+e.norm_labels.width.col;o.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,"+a+")"}));var i=0,s=e.clust.margin.top;o.append("g").classed("row_dendro_icons_container",!0).attr("transform","translate("+i+","+s+")").append("g").classed("row_dendro_icons_group",!0),n(t,"row"),i=e.clust.margin.left+e.clust.dim.width,s=a;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){var n=r(198),o=r(199),a=r(201),i=r(202),s=r(204),l=r(205),c=r(207),u=r(208),d=r(231),f=r(232),p=r(233),_=r(234),h=r(235),v=r(236);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),h(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;!1===t.params.viz.is_expand&&(r=n(e,r,d),r-=1500),r=n(e,r,o),r=n(e,r,a),r=n(t,r,i),r=n(e,r,p),r=n(e,r,s),r=n(e,r,v),r=n(e,r,f),r=n(e,r,l),r=n(e,r,c),r=n(t,r,u),r=n(e,r,d),r=n(e,r,_)}}},function(t,e){t.exports=function(t,e,r){setTimeout(r().run,e,t);return e+=r().get_duration()}},function(t,e,r){var n=r(200);t.exports=function(){return{run:function(t){setTimeout(n,0,t,"Clustergrammer allows users to generate\ninteractive and sharable visualizations\nby uploading a matrix",4500),setTimeout(n,4500,t,"This demo will quickly overview some\nof Clustergrammer's interactive features",4500)},get_duration:function(){return 1e4}}}},function(t,e){t.exports=function(t,e,r){var n=e.split("\n");n.length<3&&n.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 o=0;o<n.length;o++){var a=o+1,i=d3.select(t.root+" .demo_group").select("#text_"+a).text(n[o])[0][0].getBBox(),s=1.3*Number(d3.select(".demo_group").select("text").style("font-size").replace("px",""));d3.select(t.root+" .demo_group").select(".rect_"+a).style("fill","white").attr("width",i.width+20).attr("height",i.height).attr("x",-10).attr("y",i.y+o*s).style("opacity",.9)}}},function(t,e,r){var n=r(200),o=r(146);t.exports=function(){return{run:function(t){var e=t.params;n(e,"Zoom and pan by\nscrolling and dragging",4e3),setTimeout(o,1500,t,0,0,4)},get_duration:function(){return 4e3}}}},function(t,e,r){var n=r(200),o=r(146),a=r(203);t.exports=function(){return{run:function(t){var e=t.params;n(e,"Reset zoom by double-clicking\n",4e3),setTimeout(a,2e3,e,"double",300,300),setTimeout(o,2400,t,0,0,1)},get_duration:function(){return 4500}}}},function(t,e){t.exports=function(t,e,r,n){var o=d3.select(t.root+" .viz_svg").append("circle").attr("cx",r).attr("cy",n).attr("r",25).style("stroke","black").style("stroke-width","3px").style("fill","#007f00").style("opacity",.5);"double"===e?o.transition().duration(200).style("opacity",0).transition().duration(50).style("opacity",.5).transition().duration(200).style("opacity",0).remove():o.transition().duration(200).style("opacity",0).transition().duration(250).remove()}},function(t,e,r){var n=r(200),o=r(203);t.exports=function(){function t(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:function(e){n(e,"Reorder the matrix based on a single\nrow or column by double-clicking a\nlabel",7e3);var r=function(t,e){return d3.selectAll(t.root+" .row_label_group").filter((function(){return this.__data__.name==e}))[0][0]}(e,"EGFR"),a=d3.select(r).attr("transform"),i=d3.select(e.root+" .clust_container").attr("transform").split(",")[1].replace(")",""),s=.9*e.viz.norm_labels.width.row,l=a.split(",")[1].replace(")",""),c=String(Number(l)+Number(i)+e.viz.rect_height/2);setTimeout(o,4e3,e,"double",s,c),setTimeout(t,4300,e,r)},get_duration:function(){return 8e3}}}},function(t,e,r){var n=r(200),o=r(206);t.exports=function(){function t(t,e,r){var n=d3.selectAll(".toggle_"+e+"_order .btn").filter((function(){return this.__data__==r}))[0];$(n).click()}return{run:function(e){n(e,"Reorder all rows and columns\nby clicking the reorder\n buttons",9e3),setTimeout(o,3e3,e,"toggle_col_order"),setTimeout(t,3500,e,"col","rank"),setTimeout(o,7e3,e,"toggle_row_order"),setTimeout(t,7500,e,"row","rank")},get_duration:function(){return 11e3}}}},function(t,e){t.exports=function(t,e,r=4e3){e.indexOf("slider")<0?d3.select(t.root+" ."+e).style("background","#007f00").style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("background","#FFFFFF").style("box-shadow","none"):d3.select(t.root+" ."+e).style("box-shadow","0px 0px 10px 5px #007f00").transition().duration(1).delay(r).style("box-shadow","none")}},function(t,e,r){var n=r(200),o=r(206),a=r(146);t.exports=function(){function t(t,e){$(t.root+" .gene_search_box").val(e),$(t.root+" .gene_search_box").autocomplete("search",e)}function e(t){$(t.root+" .submit_gene_button").click(),$(t.root+" .gene_search_box").autocomplete("search","")}return{run:function(r){var i=r.params;n(i,"Search for rows using\nthe search box",5e3);var s=2500;setTimeout(o,s,i,"gene_search_container"),setTimeout(t,3500,i,"E"),setTimeout(t,4e3,i,"EG"),setTimeout(t,4500,i,"EGF"),setTimeout(t,5e3,i,"EGFR"),setTimeout(e,5500,i),setTimeout(a,7500,r,0,0,1)},get_duration:function(){return 1e4}}}},function(t,e,r){var n=r(200),o=r(206),a=r(209);t.exports=function(){function t(t,e,r,n){var o,i=t.params,s={};s[e]=r,a(t,s),$(i.root+" .slider_"+e).slider("value",n),o="N_row_sum"===e?"sum":"variance",d3.select(i.root+" .title_"+e).text("Top rows "+o+": "+r)}return{run:function(e){var r=e.params,a="Filter rows based on sum or\nvariance using the sliders";n(r,a,4e3);var i="N_row_sum";setTimeout(o,5e3,r,"slider_N_row_sum",13e3),a="Filter: Top 20 rows by sum",setTimeout(n,5e3,r,a,4e3),setTimeout(t,5300,e,i,20,1),a="Filter: Top 10 rows by sum",setTimeout(n,1e4,r,a,4e3),setTimeout(t,10300,e,i,10,2),a="Filter: All rows",setTimeout(n,15e3,r,a,4e3),setTimeout(t,15300,e,i,"all",0)},get_duration:function(){return 19500}}}},function(t,e,r){var n=r(11),o=r(210),a=r(211),i=r(3);t.exports=function(t,e){o(t.params);var r=n(t.config,t.params,e);d3.select(t.params.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!0).classed("fa-undo",!1).classed("active_cropping",!1),i.each(["row","col"],(function(e){d3.select(t.params.root+" ."+e+"_dendro_icons_group").classed("ran_filter",!1),d3.select(t.params.root+" ."+e+"_dendro_icons_container").style("display","block")})),a(t,r)}},function(t,e){t.exports=function(t){d3.selectAll(t.root+" .btn").attr("disabled",!0),d3.select(t.viz.viz_svg).style("opacity",.7)}},function(t,e,r){var n=r(10),o=r(212),a=r(213),i=r(153),s=r(185),l=r(190),c=r(191),u=r(192),d=r(224),f=r(226),p=r(163),_=r(227),h=r(152),v=r(228),m=r(155),g=r(230),y=r(84);t.exports=function(t,e){d3.select(t.params.viz.viz_svg).classed("running_update",!0),d3.selectAll(t.params.root+" .ds"+String(t.params.viz.ds_level)+"_row").remove(),null!=t.params.matrix_update_callback&&t.params.matrix_update_callback();var r=t.params.matrix.distance_metric,w=t.params.matrix.linkage_type,x=t.params.matrix.filter_state,b=t.params.matrix.normalization_state,z=t.params.group_level,k=t.params.crop_filter_nodes,A=jQuery.extend(!0,{},t.config),E=null;if(null!=t.params.new_row_cats){v(t.params.new_row_cats,e.row_nodes),E=t.params.new_row_cats,t.params.new_row_cats=E;t.params.viz=y(t.params,t.params.viz,!0)}A.network_data=e,A.inst_order=t.params.viz.inst_order,A.input_domain=t.params.matrix.opacity_scale.domain()[1],_(A,t.params),A.ini_view=null,A.current_col_cat=t.params.current_col_cat,A.cat_colors=t.params.viz.cat_colors;var N=n(A),M=o(t.params,N);function S(){d3.selectAll(".dendro_shadow").remove()}function O(){d3.select(t.params.viz.viz_svg).classed("running_update",!1)}t.params=N,t.params.zoom_behavior=d3.behavior.zoom().scaleExtent([1,t.params.viz.square_zoom*t.params.viz.zoom_ratio.x]).on("zoom",(function(){m(t)})),t.params.matrix.distance_metric=r,t.params.matrix.linkage_type=w,t.params.matrix.filter_state=x,t.params.matrix.normalization_state=b,t.params.group_level=z,t.params.crop_filter_nodes=k,0===t.params.viz.ds_num_levels?a(t,e,M):g(t),d3.select(t.params.viz.viz_svg).style("opacity",.7),l(t),h(t),t.params.viz.show_categories.col&&s(t),t.params.viz.show_dendrogram&&(c(t),u(t)),i(t),d3.select(t.params.viz.viz_svg).call(t.params.zoom_behavior),p(t),d(t),t.params.viz.run_trans=!0,setTimeout(f,2500,t.params),setTimeout(S,50),setTimeout(S,100),setTimeout(S,500),setTimeout(S,1e3),setTimeout(S,1500),setTimeout((function(){d3.select(t.params.viz.viz_svg).transition().duration(250).style("opacity",1),setTimeout(O,1e3)}),M.enter)}},function(t,e,r){var n=r(3);t.exports=function(t,e){var r=t.network_data.row_nodes,o=t.network_data.col_nodes,a=n.map(r,(function(t){return t.name})),i=n.map(o,(function(t){return t.name})),s=a.concat(i),l=e.network_data.row_nodes,c=e.network_data.col_nodes,u=n.map(l,(function(t){return t.name})),d=n.map(c,(function(t){return t.name})),f=u.concat(d),p=n.difference(s,f).length,_=n.difference(f,s).length,h={};h.update=p>0?1e3:0,h.enter=_>0?1e3:0,h.enter=h.enter+h.update,h.run_transition=!0;var v=t.network_data.links.length,m=e.network_data.links.length,g=.5*e.matrix.def_large_matrix;return(v>g||m>g)&&(h.run_transition=!1,h.update=0,h.enter=0),h}},function(t,e,r){var n=r(214),o=r(101),a=r(133),i=r(215),s=r(219),l=r(91),c=r(220),u=r(223),d=r(147),f=r(100);t.exports=function(t,e,r){var p=t.params;d3.selectAll(p.viz.root_tips).remove();var _=f().attr("class",(function(){var t=p.viz.root_tips.replace(".","");return t+" d3-tip "+t+"_tile_tip"})).direction("nw").offset([0,0]).style("display","none").html((function(t){var e,r=String(t.value.toFixed(3));if(p.keep_orig){var n=String(t.value_orig.toFixed(3));e="<p>"+t.row_name+" and "+t.col_name+"</p><p> normalized value: "+r+"</p><div> original value: "+n+"</div>"}else e="<p>"+t.row_name+" and "+t.col_name+"</p><div> value: "+r+"</div>";return e}));d3.select(p.root+" .clust_group").call(_),u(p);for(var h=1e3,v=e.row_nodes,m=e.col_nodes,g=e.links,y=0;y<g.length;y++){var w=g[y];g[y].name=v[w.source].name+"_"+m[w.target].name}var x=d3.select(p.root+" .clust_group").selectAll(".row").data(p.matrix.matrix,(function(t){return t.name}));r.run_transition?x.transition().delay(r.update).duration(h).attr("transform",(function(t){var e=t.row_index;return"translate(0,"+p.viz.y_scale(e)+")"})):x.attr("transform",(function(t){var e=t.row_index;return"translate(0,"+p.viz.y_scale(e)+")"})),d3.select(p.root+" .clust_group").selectAll(".row").each((function(t){i(p,t,r,h,this,_)})),d3.selectAll(p.root+" .horz_lines").remove(),d3.selectAll(p.root+" .vert_lines").remove(),s(p,r,h),n(t,h,r),c(p,r,h,_),o(t,h),a(t,h),l(p,r,h),setTimeout(d,2e3,p)}},function(t,e,r){var n=r(2),o=r(74),a=r(71),i=r(73),s=r(164),l=r(165),c=r(166),u=r(167),d=r(169),f=r(171),p=r(172),_=r(173),h=r(174),v=r(175),m=r(178),g=r(83),y=r(82),w=r(88),x=r(3);t.exports=function(t,e=0,r=null){null===r&&((r={}).enter=0,r.update=0,r.run_transition=!1);var b=t.params,z=t.params.network_data.row_nodes;b.zoom_info=w();var k=b.network_data.row_nodes_names;s(b),(b=a(b)).viz=i(b.viz),b.viz=o(b.viz),b.sim_mat&&(b.viz.clust.dim.width<=b.viz.clust.dim.height?b.viz.clust.dim.height=b.viz.clust.dim.width:b.viz.clust.dim.width=b.viz.clust.dim.height),b.viz=y(b.viz),b.viz.x_scale.rangeBands([0,b.viz.clust.dim.width]),b.viz.y_scale.rangeBands([0,b.viz.clust.dim.height]),b.viz.square_zoom=b.viz.norm_labels.width.col/(b.viz.x_scale.rangeBand()/2),b.zoom_behavior.scaleExtent([1,b.viz.square_zoom*b.viz.zoom_ratio.x]),b.viz.border_width.x=b.viz.x_scale.rangeBand()/b.viz.border_fraction,b.viz.border_width.y=b.viz.y_scale.rangeBand()/b.viz.border_fraction,b=g(b);var A=d3.select(b.viz.viz_wrapper).select("svg");A.select(b.root+" .grey_background").transition().delay(r.update).duration(e).attr("width",b.viz.clust.dim.width).attr("height",b.viz.clust.dim.height),d(b,A,r),A.selectAll(".row_label_group").select("text").style("font-size",b.labels.default_fs_row+"px").text((function(t){return n.normal_name(t)})),A.selectAll(".row_label_group").each((function(){var t=d3.select(this).select("text")[0][0].getBBox();d3.select(this).select("rect").attr("x",t.x).attr("y",0).attr("width",t.width).attr("height",b.viz.y_scale.rangeBand()).style("fill","yellow").style("opacity",(function(t){var e=0;return 1===t.target&&(e=1),e}))})),f(b,A,r),r.run_transition?(A.selectAll(".row_label_group").select("text").transition().delay(r.update).duration(e).attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,(function(t){return t.name})).transition().delay(r.update).duration(e).attr("transform",(function(t){var e=x.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})),A.selectAll(".row_cat_group").select("path").transition().delay(r.update).duration(e).attr("d",(function(){return"M "+(b.viz.cat_room.symbol_width-1)+",0 L 1,"+b.viz.y_scale.rangeBand()/2+" L "+(b.viz.cat_room.symbol_width-1)+","+b.viz.y_scale.rangeBand()+" Z"})),A.selectAll(".row_dendro_group").data(z,(function(t){return t.name})).transition().delay(r.update).duration(e).attr("transform",(function(t){var e=x.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}))):(A.selectAll(".row_label_group").select("text").attr("y",.5*b.viz.rect_height+.35*b.labels.default_fs_row),A.selectAll(".row_cat_group").data(z,(function(t){return t.name})).attr("transform",(function(t){var e=x.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"})),A.selectAll(".row_cat_group").select("path").attr("d",(function(){return"M "+(b.viz.cat_room.symbol_width-1)+",0 L 1,"+b.viz.y_scale.rangeBand()/2+" L "+(b.viz.cat_room.symbol_width-1)+","+b.viz.y_scale.rangeBand()+" Z"})),A.selectAll(".row_dendro_group").data(z,(function(t){return t.name})).attr("transform",(function(t){var e=x.indexOf(k,t.name);return"translate(0, "+b.viz.y_scale(e)+")"}))),n.has(b.network_data.row_nodes[0],"value")&&m(t,A),p(b,A,r),_(b,A),h(b,A,r),v(b,A,r),l(b,A,r),c(b,A,r),u(b.viz,A,r),b.zoom_behavior.scale(1).translate([b.viz.clust.margin.left,b.viz.clust.margin.top])}},function(t,e,r){var n=r(216),o=r(217),a=r(218),i=r(97),s=r(98),l=r(99),c=r(3);t.exports=function(t,e,r,u,d,f){var p=e.row_data,_=c.filter(p,(function(t){return 0!=t.value})),h=d3.select(d).selectAll(".tile").data(_,(function(t){return t.col_name}));n(t,r,h,p,d);var v=h.on("mouseover",(function(...e){i(t,this,f,e)})).on("mouseout",(function(){s(t,this,f)})),m=t.network_data.col_nodes_names;r.run_transition?v.transition().delay(r.update).duration(u).attr("width",t.viz.rect_width).attr("height",t.viz.rect_height).attr("transform",(function(e){return c.contains(m,e.col_name)?l(t,e):"translate(0,0)"})):v.attr("width",t.viz.rect_width).attr("height",t.viz.rect_height).attr("transform",(function(e){return c.contains(m,e.col_name)?l(t,e):"translate(0,0)"})),"updn"==t.matrix.tile_type&&a(t,p,d,r,u,h,f),o(t,r,u,h,f)}},function(t,e,r){var n=r(3);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 i=n.filter(o,(function(t){return 0!=t.value_up||0!=t.value_dn})),s=d3.select(a).selectAll(".tile_up").data(i,(function(t){return t.col_name}));e.run_transition?s.exit().transition().duration(300).attr("fill","0").remove():s.exit().attr("fill",0).remove();var l=d3.select(a).selectAll(".tile_dn").data(i,(function(t){return t.col_name}));e.run_transition?l.exit().transition().duration(300).attr("fill",0).remove():l.exit().attr("fill",0).remove()}}},function(t,e,r){var n=r(97),o=r(98),a=r(99);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(...e){n(t,this,s,e)})).on("mouseout",(function(){o(t,this,s)})).attr("fill-opacity",0).attr("transform",(function(e){return a(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){return t.matrix.opacity_scale(Math.abs(e.value))})):l.style("fill",(function(e){return e.value>0?t.matrix.tile_colors[0]:t.matrix.tile_colors[1]})).attr("fill-opacity",(function(e){return t.matrix.opacity_scale(Math.abs(e.value))})),l.each((function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()}))}},function(t,e,r){var n=r(95),o=r(96),a=r(97),i=r(98),s=r(99),l=r(3);t.exports=function(t,e,r,c,u,d,f){var p=l.filter(e,(function(t){return 0!=t.value_up||0!=t.value_dn})),_=d3.select(r).selectAll(".tile_up").data(p,(function(t){return t.col_name})).on("mouseover",(function(...e){a(t,this,f,e)})).on("mouseout",(function(){i(t,this,f)}));c.run_transition?_.transition().delay(c.update).duration(u).attr("d",(function(){return n(t)})).attr("transform",(function(e){return s(t,e)})):_.attr("d",(function(){return n(t)})).attr("transform",(function(e){return s(t,e)}));var h=d3.select(r).selectAll(".tile_dn").data(p,(function(t){return t.col_name})).on("mouseover",(function(...e){a(t,this,f,e)})).on("mouseout",(function(){i(t,this,f)}));c.run_transition?h.transition().delay(c.update).duration(u).attr("d",(function(){return o(t)})).attr("transform",(function(e){return s(t,e)})):h.attr("d",(function(){return o(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){t.exports=function(t,e,r){var n=t.network_data.row_nodes,o=t.network_data.col_nodes,a=d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,(function(t){return t.name})).exit();e.run_transition?a.transition().duration(r).style("opacity",0).remove():a.style("opacity",0).remove(),d3.selectAll(t.root+" .row_label_group").data(n,(function(t){return t.name})).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_group").data(o,(function(t){return t.name})).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_cat_group").data(n,(function(t){return t.name})).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .row_dendro_group").data(n,(function(t){return t.name})).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_label_text").data(o,(function(t){return t.name})).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .horz_lines").data(n,(function(t){return t.name})).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .vert_lines").data(o,(function(t){return t.name})).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_cat_group").data(o,(function(t){return t.name})).exit().transition().duration(r).style("opacity",0).remove(),d3.selectAll(t.root+" .col_dendro_group").data(o,(function(t){return t.name})).exit().transition().duration(r).style("opacity",0).remove()}},function(t,e,r){var n=r(221);t.exports=function(t,e,r,o){d3.select(t.root+" .clust_group").selectAll(".row").data(t.matrix.matrix,(function(t){return t.name})).enter().append("g").classed("row",!0).attr("transform",(function(e){return"translate(0,"+t.viz.y_scale(e.row_index)+")"})).each((function(a){n(t,a,e,r,o,this)}))}},function(t,e,r){var n=r(222),o=r(97),a=r(98),i=r(99),s=r(3);t.exports=function(t,e,r,l,c,u){var d=e.row_data,f=s.filter(d,(function(t){return 0!==t.value})),p=d3.select(u).selectAll("rect").data(f,(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(...e){o(t,this,c,e)})).on("mouseout",(function(){a(t,this,c)}));p.style("fill-opacity",0).transition().delay(r.enter).duration(l).style("fill-opacity",(function(e){return t.matrix.opacity_scale(Math.abs(e.value))})),p.attr("transform",(function(e){return i(t,e)})),"updn"==t.matrix.tile_type&&n(t,d,u,c,r,l,p)}},function(t,e,r){var n=r(95),o=r(96),a=r(99),i=r(3);t.exports=function(t,e,r,s,l,c,u){var d=i.filter(e,(function(t){return 0!=t.value_up||0!=t.value_dn}));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 n(t)})).attr("transform",(function(e){return a(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&&s.show(e)})).on("mouseout",(function(){d3.selectAll(t.root+" text").classed("active",!1),t.matrix.show_tile_tooltips&&s.hide()})).style("fill-opacity",0).transition().delay(l.enter).duration(c).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})),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 o(t)})).attr("transform",(function(e){return a(t,e)})).style("fill",(function(){return t.matrix.tile_colors[1]})).on("mouseover",(function(e){d3.selectAll(t.root+" .row_label_group text").classed("active",(function(t){return e.row_name===t.name})),d3.selectAll(t.root+" .col_label_text text").classed("active",(function(t){return e.col_name===t.name})),t.matrix.show_tile_tooltips&&s.show(e)})).on("mouseout",(function(){d3.selectAll(t.root+" text").classed("active",!1),t.matrix.show_tile_tooltips&&s.hide()})).style("fill-opacity",0).transition().delay(l.enter).duration(c).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})),u.each((function(t){Math.abs(t.value_up)>0&&Math.abs(t.value_dn)>0&&d3.select(this).remove()}))}},function(t,e){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(){return"translate(0,"+(t.viz.norm_labels.width.col+2)+")"}))}},function(t,e,r){r(195);var n=r(145),o=r(144),a=r(225),i=r(3);t.exports=function(t){var e,r=t.params,s=d3.select(r.root+" .gene_search_box")[0][0],l=new Awesomplete(s,{minChars:1,maxItems:15}),c=t.params.network_data.row_nodes_names;if(l.list=c,d3.selectAll(".awesomplete ul").style("z-index",99),$(r.root+" .gene_search_box").keyup((function(e){if(13===e.keyCode){var n=$(r.root+" .gene_search_box").val();a(t,n,c)}})),$(r.root+" .submit_gene_button").off().click((function(){var e=$(r.root+" .gene_search_box").val();a(t,e,c)})),e=r.sim_mat?["both"]:["row","col"],i.each(e,(function(e){$(r.root+" .toggle_"+e+"_order .btn").off().click((function(o){var a=$(o.target).attr("name").replace("_row","").replace("_col","");d3.selectAll(r.root+" .toggle_"+e+"_order .btn").classed("active",!1),d3.select(this).classed("active",!0),"both"!=e?n(t,a,e):(n(t,a,"row"),n(t,a,"col"))}))})),o(t),d3.select(t.params.root+" .opacity_slider").select("#handle-one").empty()){var u=d3.slider().snap(!0).value(1).min(.1).max(1.9).step(.1).on("slide",(function(e,r){!function(e,r){var n=2-r,o=t.params.matrix.abs_max_val*n;t.params.matrix.opacity_scale.domain([0,o]),d3.selectAll(t.params.root+" .tile").style("fill-opacity",(function(e){return t.params.matrix.opacity_scale(Math.abs(e.value))}))}(0,r)}));d3.select(t.params.root+" .opacity_slider").call(u)}}},function(t,e,r){var n=r(146),o=r(3);t.exports=function(t,e,r){if(-1!==r.indexOf(e)){d3.selectAll(t.params.root+" .row_label_group").select("rect").style("opacity",0);var a=o.indexOf(r,e),i=t.params.viz.y_scale(a),s=t.params.viz.clust.dim.height/2-i,l=t.params.viz.zoom_ratio.x;n(t,0,s,l),t.params.zoom_info.zoom_y=l,d3.selectAll(t.params.root+" .row_label_group").filter((function(t){return t.name===e})).select("rect").style("opacity",1)}}},function(t,e){t.exports=function(t){!1===t.dendro_filter.row&&"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),!1===t.dendro_filter.col&&"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,r){var n=r(3);t.exports=function(t,e){n.each(["row","col"],(function(r){var n;n="row"===r?"col":"row",d3.selectAll(e.root+" .toggle_"+n+"_order .btn").filter((function(){return d3.select(this).attr("name")===t.inst_order[r]})).classed("active",!0)}))}},function(t,e,r){var n=r(229),o=r(2),a=r(3);t.exports=function(t,e,r=!1){var i,s,l,c,u,d,f,p,_=0,h=0;a.each(e,(function(e){c=e.name,!0===r&&(c.indexOf(" ")?c=c.split(" ")[0]:c.indexOf("_")&&(c=c.split("_")[0])),_=0,n(e),a.each(t,(function(t){if(i=t.cat_title,s=t.cats,u="false",h=-1,p=0,a.each(s,(function(t){d=t.cat_name,l=t.members,a.contains(l,c)&&(u=d,h=p),p+=1})),o.has(t,"pval")){var r=t.pval.toExponential();f=i+": "+u+"<p> Pval "+String(r)+"</p>"}else f=-1===i.indexOf("cat-")?i+": "+u:u;e["cat-"+String(_)]=f,e["cat_"+String(_)+"_index"]=h,_+=1}))}))}},function(t,e,r){var n=r(3);t.exports=function(t){var e=n.keys(t);n.each(e,(function(e){e.indexOf("cat-")>-1&&delete t[e],e.indexOf("cat_")>-1&&delete t[e]}))}},function(t,e,r){var n=r(214),o=r(133),a=r(136),i=r(223);t.exports=function(t){d3.selectAll(t.params.root+" .row_cat_group").remove(),d3.selectAll(t.params.root+" .row_label_group").remove(),d3.selectAll(t.params.root+" .row").remove();a(t,!0,!0,!0),o(t);var e=t.params.network_data.col_nodes;d3.selectAll(t.params.root+" .col_label_group").data(e,(function(t){return t.name})).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_label_text").data(e,(function(t){return t.name})).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_cat_group").data(e,(function(t){return t.name})).exit().style("opacity",0).remove(),d3.selectAll(t.params.root+" .col_dendro_group").data(e,(function(t){return t.name})).exit().style("opacity",0).remove(),i(t.params);var r={enter:0,update:0,run_transition:!1};n(t,0,r)}},function(t,e,r){var n=r(203);t.exports=function(){function t(t){$(t.root+" .expand_button").d3Click()}function e(t){r(t,"row","clust"),r(t,"col","clust")}function r(t,e,r){var n=d3.selectAll(".toggle_"+e+"_order .btn").filter((function(){return this.__data__==r}))[0];$(n).click()}return jQuery.fn.d3Click=function(){this.each((function(t,e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(r)}))},{run:function(r){var o=Number(d3.select(r.root+" .expand_button").attr("x").replace("px","")),a=Number(d3.select(r.root+" .expand_button").attr("y").replace("px",""));setTimeout(n,0,r,"single",o,a),setTimeout(t,400,r),setTimeout(e,1500,r)},get_duration:function(){return 3500}}}},function(t,e,r){var n=r(200),o=r(206),a=r(195);t.exports=function(){function t(t,e,r){$(cgm.params.root+" .slider_col").slider("value",r/10),a(cgm,e,r)}return{run:function(e){n(e,"Identify row and column groups\nof varying sizes using the\nsliders and dendrogram",1e4),setTimeout(o,3e3,e,"slider_col",7e3),setTimeout(t,4e3,e,"row",3),setTimeout(t,5e3,e,"row",4),setTimeout(t,6e3,e,"row",5),setTimeout(t,7e3,e,"row",6),setTimeout(t,8e3,e,"row",7),setTimeout(t,9e3,e,"row",5)},get_duration:function(){return 11e3}}}},function(t,e,r){var n=r(200),o=r(203);t.exports=function(){function t(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:function(e){n(e,"Row and column categories\ncan be use to reorder\nby double-clicking",7e3);var r=d3.selectAll(e.root+" .col_cat_super").filter((function(){return"cat-1"===this.__data__}))[0],a=d3.select(".col_cat_super").attr("transform"),i=Number(a.split("(")[1].split(",")[0].replace(")",""))+20,s=Number(a.split(",")[1].replace(")",""));setTimeout(o,4e3,e,"double",i,s),setTimeout(t,4300,e,r)},get_duration:function(){return 8e3}}}},function(t,e,r){var n=r(200),o=r(235);t.exports=function(){function t(t){d3.select(t.root+" .play_button").classed("running_demo",!1),o(t,!0)}return{run:function(e){setTimeout(n,0,e,"Clustergrammer is built with gene\nexpression data in mind and interfaces\nwith several Ma'ayan lab web tools",4500),setTimeout(n,4500,e,"The example data being visualized is\ngene expression data obtained from the\nCancer Cell Line Encyclopedia",4500),setTimeout(n,9e3,e,"For more information please view\nthe help documentation",4500),setTimeout(t,14e3,e)},get_duration:function(){return 12e3}}}},function(t,e){t.exports=function(t,e){!1===e?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){var n=r(200),o=r(203);t.exports=function(){function t(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:function(e){n(e,"View additional controls\nby clicking the menu button",4e3);var r=Number(d3.select(e.root+" .expand_button").attr("x").replace("px","")),a=Number(d3.select(e.root+" .expand_button").attr("y").replace("px",""));setTimeout(o,3e3,e,"single",r,a),setTimeout(t,3400,e)},get_duration:function(){return 5e3}}}},function(t,e,r){var n=r(238),o=r(239);t.exports=function(){var t=this.params;n(this);o(t,30)}},function(t,e,r){var n=r(179);t.exports=function(t){var e=t.params;if(d3.select(e.root+" .play_button").empty()){var r=d3.select(e.root+" .viz_svg").append("g").classed("play_button",!0).classed("running_demo",!1);n(e),r.append("circle").style("r",45).style("fill","white").style("stroke","black").style("stroke-width","3px").style("opacity",.5),r.append("path").attr("d",(function(){return"M-15,-22 l 40,22 l -40,22 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){t.exports=function(t,e){if(d3.select(t.root+" .demo_group").empty()){var r=d3.select(t.root+" .clust_container").attr("transform"),n=Number(r.split("(")[1].split(",")[0]),o=Number(r.split(",")[1].replace(")","")),a=d3.select(t.root+" .viz_svg").append("g").classed("demo_group",!0).attr("transform",(function(){return"translate("+(n+20)+","+(o+40)+")"}));a.append("rect").classed("rect_1",!0),a.append("rect").classed("rect_2",!0),a.append("rect").classed("rect_3",!0);var i=1.3*e;a.append("text").attr("id","text_1").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif'),a.append("text").attr("id","text_2").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",(function(){return"translate(0,"+String(i)+")"})),a.append("text").attr("id","text_3").attr("font-size",e+"px").attr("font-weight",1e3).attr("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').attr("transform",(function(){return"translate(0,"+String(2*i)+")"}))}}},function(t,e,r){var n=r(12),o=r(211);t.exports=function(t){var e=n(this.config,t);o(this,e)}},function(t,e,r){var n=r(12),o=r(211),a=r(3);t.exports=function(t,e=!1){var r,i,s=(r=!1===e?this:e).params,l={};a.each(["row","col"],(function(e){var r=s.inst_nodes[e+"_nodes"];if(_.has(t,e))if(t[e].length>0){var n=t[e];i=$.grep(r,(function(t){return $.inArray(t.name,n)>-1}))}else i=r;else i=r;l[e+"_nodes"]=i}));var c=r.params.network_data.row_nodes,u=r.params.network_data.col_nodes,d=n(r.config,l);o(r,d),c.length>r.params.inst_nodes.row_nodes.length&&(r.params.inst_nodes.row_nodes=c),u.length>r.params.inst_nodes.col_nodes.length&&(r.params.inst_nodes.col_nodes=u)}},function(t,e,r){var n=r(190),o=r(67),a=r(154),i=r(228);t.exports=function(t,e){null!=t.params.cat_update_callback&&t.params.cat_update_callback(this);var r=t.params.viz.cat_colors.col;i(e,t.params.network_data.row_nodes,!0),i(e,t.params.inst_nodes.row_nodes,!0),t.params=o(t.params,!1),n(t,!0),a(t),t.params.new_row_cats=e,t.params.viz.cat_colors.col=r}},function(t,e,r){var n=r(190),o=r(67),a=r(154),i=r(228),s=r(244);t.exports=function(t=!0){var e=this,r=s(e),l=e.params.viz.cat_colors.col;if(i(r,e.params.network_data.row_nodes),i(r,e.params.inst_nodes.row_nodes),e.params.new_row_cats=r,e.params.viz.cat_colors.col=l,t){e.params=o(e.params,!0),n(e,!0),a(e)}}},function(t,e,r){var n=r(3);t.exports=function(t){var e,r,o,a,i,s,l,c=t.config.network_data.row_nodes,u=": ",d=[],f=c[0],p=n.keys(f),_={};n.each(p,(function(t){t.indexOf("cat-")>=0&&(i=f[t],l=parseInt(t.split("cat-")[1],10),s=i.indexOf(u)>=0?i.split(u)[0]:t,_[l]=s)}));var h,v=n.keys(_).sort();return n.each(v,(function(t){(h={}).cat_title=_[t],h.cats=[],d.push(h)})),n.each(c,(function(t){var i=n.keys(t);n.each(i,(function(i){if(i.indexOf("cat-")>-1){a=t[i],l=parseInt(i.split("cat-")[1],10);var s=i;a=t[i];var c=t[i],f=t.name;c.indexOf(u)>-1?(s=c.split(u)[0],a=c.split(u)[1]):(s=i,a=c),0===d.length?function(t,n,o){(e={}).cat_title=t,e.cats=[],(r={}).cat_name=n,r.members=[],r.members.push(o),e.cats.push(r),d.push(e)}(s,a,f):(!1,n.each(d,(function(t){s===t.cat_title&&(!0,o=!1,n.each(t.cats,(function(t){a===t.cat_name&&(o=!0,t.members.push(f))})),!1===o&&((r={}).cat_name=a,r.members=[],r.members.push(f),t.cats.push(r)))})))}}))})),d}},function(t,e,r){var n=r(209),o=r(246);t.exports=function(t,e,r){var a={};a[e]=r,n(t,a),o(t,e,r)}},function(t,e,r){var n=r(247),o=r(3);t.exports=function(t,e,r){var a,i,s=t.params;d3.select(s.root+" .slider_"+e).attr("current_state",r),o.each(o.keys(s.viz.possible_filters),(function(r){if(a=e.indexOf("row")>-1?"row":e.indexOf("col")>-1?"col":"neither",i=r.indexOf("row")>-1?"row":r.indexOf("col")>-1?"col":"neither",e!=r&&"neither"!=a&&a==i){var o=n(s,r);t.slider_functions[r].value(0),d3.select(s.root+" .title_"+r).text(o.text+o.state),d3.select(s.root+" .slider_"+r).attr("current_state",o.state)}}));var l=n(s,e);d3.select(s.root+" .title_"+e).text(l.text+r+l.suffix)}},function(t,e,r){var n=r(6),o=r(3);t.exports=function(t,e){var r={},a={},i={};return r.state=n(t.viz.filter_data,e),i.top=e.split("_")[0],i.node=e.split("_")[1],i.measure=e.split("_")[2],"row"===i.node?a.node="rows":a.node="columns","N"===i.top&&(r.suffix=""),"pct"===i.top&&(r.suffix="%"),"sum"==i.measure?a.measure="sum":"var"==i.measure&&(a.measure="variance"),"sum"===i.measure&&(r.text="Top "+a.node+" "+a.measure+": "),"var"===i.measure&&(r.text="Top "+a.node+" "+a.measure+": "),o.keys(t.viz.possible_filters).indexOf("enr_score_type")>-1&&"col"===i.node&&(r.text="Top Enriched Terms: ",r.suffix=""),r}},function(t,e,r){var n=r(249),o=r(250);t.exports=function(){var t=n(),e=this.params,r=o(e);t(new Blob([r],{type:"text/plain;charset=utf-8"}),"clustergrammer.txt")}},function(t,e){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){"use strict";var e=t.document,r=t.URL||t.webkitURL||t,n=e.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in n,a=t.webkitRequestFileSystem,i=t.requestFileSystem||a||t.mozRequestFileSystem,s=function(e){(t.setImmediate||t.setTimeout)((function(){throw e}),0)},l="application/octet-stream",c=0,u=[],d=function(t,e,r){for(var n=(e=[].concat(e)).length;n--;){var o=t["on"+e[n]];if("function"==typeof o)try{o.call(t,r||t)}catch(t){s(t)}}},f=function(r,s){var f,p,_,h,v,m=this,g=r.type,y=!1,w=function(){var e=(t.URL||t.webkitURL||t).createObjectURL(r);return u.push(e),e},x=function(){d(m,"writestart progress write writeend".split(" "))},b=function(){!y&&f||(f=w()),p&&(p.location.href=f),m.readyState=m.DONE,x()},z=function(t){return function(){if(m.readyState!==m.DONE)return t.apply(this,arguments)}},k={create:!0,exclusive:!1};if(m.readyState=m.INIT,s||(s="download"),o)return f=w(),n.href=f,n.download=s,h=n,(v=e.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,t,0,0,0,0,0,!1,!1,!1,!1,0,null),h.dispatchEvent(v),m.readyState=m.DONE,void x();t.chrome&&g&&g!==l&&(_=r.slice||r.webkitSlice,r=_.call(r,0,r.size,l),y=!0),a&&"download"!==s&&(s+=".download"),p=g===l||a?t:t.open(),i?(c+=r.size,i(t.TEMPORARY,c,z((function(t){t.root.getDirectory("saved",k,z((function(t){var e=function(){t.getFile(s,k,z((function(t){t.createWriter(z((function(e){e.onwriteend=function(e){p.location.href=t.toURL(),u.push(t),m.readyState=m.DONE,d(m,"writeend",e)},e.onerror=function(){var t=e.error;t.code!==t.ABORT_ERR&&b()},"writestart progress write abort".split(" ").forEach((function(t){e["on"+t]=m["on"+t]})),e.write(r),m.abort=function(){e.abort(),m.readyState=m.DONE},m.readyState=m.WRITING})),b)})),b)};t.getFile(s,{create:!1},z((function(t){t.remove(),e()})),z((function(t){t.code===t.NOT_FOUND_ERR?e():b()})))})),b)})),b)):b()},p=f.prototype;return p.abort=function(){var t=this;t.readyState=t.DONE,d(t,"abort")},p.readyState=p.INIT=0,p.WRITING=1,p.DONE=2,p.error=p.onwritestart=p.onprogress=p.onwrite=p.onabort=p.onerror=p.onwriteend=null,t.addEventListener("unload",(function(){for(var t=u.length;t--;){var e=u[t];"string"==typeof e?r.revokeObjectURL(e):e.remove()}u.length=0}),!1),function(t,e){return new f(t,e)}}(self);return t}},function(t,e,r){var n=r(251),o=r(3);t.exports=function(t){var e,r=t.matrix,a={};o.each(["row","col"],(function(n){var o;o="row"===n?"col":"row",e=t.inst_order[n],a[o]=r.orders[e+"_"+n]}));for(var i,s="\t",l=t.network_data.row_nodes,c=t.network_data.col_nodes,u=0;u<a.col.length;u++){var d=c[a.col[u]],f=n(t,d,"col");u<a.col.length-1?s=s+f+"\t":s+=f}return s+="\n",o.each(a.row,(function(e){i=r.matrix[e].row_data;var o=l[e],c=n(t,o,"row");s=s+c+"\t";for(var u=0;u<a.col.length;u++){var d=a.col[u];u<a.col.length-1?s=s+String(i[d].value)+"\t":s+=String(i[d].value)}s+="\n"})),s}},function(t,e){t.exports=function(t,e,r){var n,o=e.name,a=t.viz.all_cats[r].length;if(a>0){o="('"+o+"'";for(var i=0;i<a;i++)n="cat-"+String(i),o=o+", '"+String(e[n])+"'";o+=")"}else o=String(o);return o}},function(t,e,r){var n=r(253),o=r(3);t.exports=function(){var t=this,e=t.params,r=e.viz.clust.dim.width,a=e.viz.clust.dim.height,i=d3.scale.linear().domain([0,r]).range([0,r]),s=d3.scale.linear().domain([0,a]).range([0,a]);d3.select(e.root+" .clust_container").append("g").classed("brush_group",!0),t.params.is_cropping=!0;var l=d3.svg.brush().x(i).y(s).on("brushend",(function(){d3.select(t.params.root+" .col_dendro_icons_container").style("display","none"),d3.select(t.params.root+" .row_dendro_icons_container").style("display","none");var r=l.extent(),a=r[0],i=r[1],s=a[0],c=i[0],u=a[1],d=i[1];if(s!=c&&u!=d){setTimeout(n,500,t);var f=function(t,r,n,a,i,s){t>r&&(t=s[0],r=i[0]);n>a&&(n=s[1],a=i[1]);n-=e.viz.rect_height,t-=e.viz.rect_width;var l={row:[],col:[]};return o.each(e.matrix.matrix,(function(t){var r=e.viz.y_scale(t.row_index);r>n&&r<a&&l.row.push(t.name)})),d3.selectAll(e.root+" .col_label_text").each((function(e){var n=d3.select(this).attr("transform"),o=Number(n.split(",")[0].split("(")[1]);o>t&&o<r&&l.col.push(e.name)})),l}(s,c,u,d,a,i);t.filter_viz_using_names(f),d3.select(e.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!1).classed("fa-undo",!0)}}));d3.select(e.root+" .brush_group").call(l),d3.selectAll(e.root+" .extent").style("opacity",.2).style("fill","black")}},function(t,e){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 n,o,a,i;i=function(t){return function(){"use strict";var e,r,n,o,a,i,s=0,l=100,c=.01,u=!1,d="horizontal",f=!1,p=50,_=1,h=!1,v=t.dispatch("slide","slideend"),m=t.format(".2%"),g=t.format(".0"),y=null;function w(c){c.each((function(){r||(r=t.scale.linear().domain([s,l])),e=e||r.domain()[0];var c=t.select(this).classed("d3-slider d3-slider-"+d,!0),u=t.behavior.drag();if(u.on("dragend",(function(){v.slideend(t.event,e)})),"array"==k(e)&&2==e.length?(o=c.append("a").classed("d3-slider-handle",!0).attr("xlink:href","#").attr("id","handle-one").on("click",N).call(u),y=c.append("a").classed("d3-slider-handle",!0).attr("id","handle-two").attr("xlink:href","#").on("click",N).call(u)):o=c.append("a").classed("d3-slider-handle",!0).attr("xlink:href","#").attr("id","handle-one").on("click",N).call(u),"horizontal"===d){if(c.on("click",(function(){if("array"!=k(e)){var n=Math.max(0,Math.min(i,t.event.offsetX||t.event.layerX));x(r.invert?b(r.invert(n/i)):z(n/i))}})),"array"==k(e)&&2==e.length){a=t.select(this).append("div").classed("d3-slider-range",!0),o.style("left",m(r(e[0]))),a.style("left",m(r(e[0]))),u.on("drag",A);var h=100-parseFloat(m(r(e[1])));y.style("left",m(r(e[1]))),a.style("right",h+"%"),u.on("drag",A)}else o.style("left",m(r(e))),u.on("drag",A);i=parseInt(c.style("width"),10)}else{if(c.on("click",(function(){if("array"!=k(e)){var n=i-Math.max(0,Math.min(i,t.event.offsetY||t.event.layerY));x(r.invert?b(r.invert(n/i)):z(n/i))}})),u.on("drag",E),"array"==k(e)&&2==e.length){a=t.select(this).append("div").classed("d3-slider-range-vertical",!0),o.style("bottom",m(r(e[0]))),a.style("bottom",m(r(e[0]))),u.on("drag",E);var w=100-parseFloat(m(r(e[1])));y.style("bottom",m(r(e[1]))),a.style("top",w+"%"),u.on("drag",E)}else o.style("bottom",m(r(e))),u.on("drag",E);i=parseInt(c.style("height"),10)}function A(){"handle-one"===t.event.sourceEvent.target.id?_=1:"handle-two"==t.event.sourceEvent.target.id&&(_=2);var e=Math.max(0,Math.min(i,t.event.x));x(r.invert?b(r.invert(e/i)):z(e/i))}function E(){"handle-one"===t.event.sourceEvent.target.id?_=1:"handle-two"==t.event.sourceEvent.target.id&&(_=2);var e=i-Math.max(0,Math.min(i,t.event.y));x(r.invert?b(r.invert(e/i)):z(e/i))}function N(){t.event.stopPropagation()}f&&function(e){"boolean"==typeof f&&(f=t.svg.axis().ticks(Math.round(i/100)).tickFormat(g).orient("horizontal"===d?"bottom":"right")),n=r.ticks?r.copy().range([0,i]):r.copy().rangePoints([0,i],.5),f.scale(n);var o=e.append("svg").classed("d3-slider-axis d3-slider-axis-"+f.orient(),!0).on("click",N),a=o.append("g");"horizontal"===d?(o.style("margin-left",-p+"px"),o.attr({width:i+2*p,height:p}),"top"===f.orient()?(o.style("top",-p+"px"),a.attr("transform","translate("+p+","+p+")")):a.attr("transform","translate("+p+",0)")):(o.style("top",-p+"px"),o.attr({width:p,height:i+2*p}),"left"===f.orient()?(o.style("left",-p+"px"),a.attr("transform","translate("+p+","+p+")")):a.attr("transform","translate(0,"+p+")")),a.call(f)}(c)}))}function x(n){var i="array"==k(e)&&2==e.length?e[_-1]:e,s=m(r(b(i))),l=m(r(b(n))),c="horizontal"===d?"left":"bottom";if(s!==l){if("array"==k(e)&&2==e.length?(e[_-1]=n,t.event&&v.slide(t.event,e)):t.event&&v.slide(t.event.sourceEvent||t.event,e=n),e[0]>=e[1])return;if(1===_)"array"==k(e)&&2==e.length&&("left"===c?a.style("left",l):a.style("bottom",l)),u?o.transition().styleTween(c,(function(){return t.interpolate(s,l)})).duration("number"==typeof u?u:250):o.style(c,l);else{var f=100-parseFloat(l),p=100-parseFloat(l);"left"===c?a.style("right",f+"%"):a.style("top",p+"%"),u?y.transition().styleTween(c,(function(){return t.interpolate(s,l)})).duration("number"==typeof u?u:250):y.style(c,l)}}}function b(t){if(t===r.domain()[0]||t===r.domain()[1])return t;var e=t;if(h)e=z(r(t));else{var n=(t-r.domain()[0])%c;e=t-n,2*Math.abs(n)>=c&&(e+=n>0?c:-c)}return e}function z(t){var e=r.ticks?r.ticks():r.domain(),n=e.map((function(e){return t-r(e)})),o=-1,a=0,i=r.ticks?r.range()[1]:r.rangeExtent()[1];do{o++,Math.abs(n[o])<i&&(i=Math.abs(n[o]),a=o)}while(n[o]>0&&o<n.length-1);return e[a]}function k(t){return{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}return w.min=function(t){return arguments.length?(s=t,w):s},w.max=function(t){return arguments.length?(l=t,w):l},w.step=function(t){return arguments.length?(c=t,w):c},w.animate=function(t){return arguments.length?(u=t,w):u},w.orientation=function(t){return arguments.length?(d=t,w):d},w.axis=function(t){return arguments.length?(f=t,w):f},w.margin=function(t){return arguments.length?(p=t,w):p},w.value=function(t){return arguments.length?(e&&x(b(t)),e=t,w):e},w.snap=function(t){return arguments.length?(h=t,w):h},w.scale=function(t){return arguments.length?(r=t,w):r},t.rebind(w,v,"on"),w}},o=[r(255)],void 0===(a="function"==typeof(n=i)?n.apply(e,o):n)||(t.exports=a)},function(t,e){t.exports=d3},function(t,e){!function(){var e=function(t,r){var n=this;this.input=o(t),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),r=r||{},function(t,e,r){for(var n in e){var o=e[n],a=t.input.getAttribute("data-"+n.toLowerCase());t[n]="number"==typeof o?parseInt(a):!1===o?null!==a:o instanceof Function?null:a,t[n]||0===t[n]||(t[n]=n in r?r[n]:o)}}(this,{minChars:2,maxItems:10,autoFirst:!1,data:e.DATA,filter:e.FILTER_CONTAINS,sort:e.SORT_BYLENGTH,item:e.ITEM,replace:e.REPLACE},r),this.index=-1,this.container=o.create("div",{className:"awesomplete",around:t}),this.ul=o.create("ul",{hidden:"hidden",inside:this.container}),this.status=o.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-relevant":"additions",inside:this.container}),o.bind(this.input,{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(t){var e=t.keyCode;n.opened&&(13===e&&n.selected?(t.preventDefault(),n.select()):27===e?n.close({reason:"esc"}):38!==e&&40!==e||(t.preventDefault(),n[38===e?"previous":"next"]()))}}),o.bind(this.input.form,{submit:this.close.bind(this,{reason:"submit"})}),o.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(),n.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")||r.list||[],e.all.push(this)};function r(t){var e=Array.isArray(t)?{label:t[0],value:t[1]}:"object"==typeof t&&"label"in t&&"value"in t?t:{label:t,value:t};this.label=e.label||e.value,this.value=e.value}e.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=o(t))&&t.children){var e=[];n.apply(t.children).forEach((function(t){if(!t.disabled){var r=t.textContent.trim(),n=t.value||r,o=t.label||r;""!==n&&e.push({label:o,value:n})}})),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return!this.ul.hasAttribute("hidden")},close:function(t){this.opened&&(this.ul.setAttribute("hidden",""),this.index=-1,o.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.ul.removeAttribute("hidden"),this.autoFirst&&-1===this.index&&this.goto(0),o.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,o.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e){if(t?this.index=o.siblingIndex(t):t=this.ul.children[this.index],t){var r=this.suggestions[this.index];o.fire(this.input,"awesomplete-select",{text:r,origin:e||t})&&(this.replace(r),this.close({reason:"select"}),o.fire(this.input,"awesomplete-selectcomplete",{text:r}))}},evaluate:function(){var t=this,e=this.input.value;e.length>=this.minChars&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map((function(n){return new r(t.data(n,e))})).filter((function(r){return t.filter(r,e)})).sort(this.sort).slice(0,this.maxItems),this.suggestions.forEach((function(r){t.ul.appendChild(t.item(r,e))})),0===this.ul.children.length?this.close({reason:"nomatches"}):this.open()):this.close({reason:"nomatches"})}},e.all=[],e.FILTER_CONTAINS=function(t,e){return RegExp(o.regExpEscape(e.trim()),"i").test(t)},e.FILTER_STARTSWITH=function(t,e){return RegExp("^"+o.regExpEscape(e.trim()),"i").test(t)},e.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t<e?-1:1},e.ITEM=function(t,e){var r=""===e?t:t.replace(RegExp(o.regExpEscape(e.trim()),"gi"),"<mark>$&</mark>");return o.create("li",{innerHTML:r,"aria-selected":"false"})},e.REPLACE=function(t){this.input.value=t.value},e.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 n=Array.prototype.slice;function o(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function a(t,e){return n.call((e||document).querySelectorAll(t))}function i(){a("input.awesomplete").forEach((function(t){new e(t)}))}o.create=function(t,e){var r=document.createElement(t);for(var n in e){var a=e[n];if("inside"===n)o(a).appendChild(r);else if("around"===n){var i=o(a);i.parentNode.insertBefore(r,i),r.appendChild(i)}else n in r?r[n]=a:r.setAttribute(n,a)}return r},o.bind=function(t,e){if(t)for(var r in e){var n=e[r];r.split(/\s+/).forEach((function(e){t.addEventListener(e,n)}))}},o.fire=function(t,e,r){var n=document.createEvent("HTMLEvents");for(var o in n.initEvent(e,!0,!0),r)n[o]=r[o];return t.dispatchEvent(n)},o.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},o.siblingIndex=function(t){for(var e=0;t=t.previousElementSibling;e++);return e},"undefined"!=typeof Document&&("loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i)),e.$=o,e.$$=a,"undefined"!=typeof self&&(self.Awesomplete=e),"object"==typeof t&&t.exports&&(t.exports=e)}()},function(t,e,r){var n=r(258);"string"==typeof n&&(n=[[t.id,n,""]]);r(260)(n,{});n.locals&&(t.exports=n.locals)},function(t,e,r){(t.exports=r(259)()).push([t.id,".d3-slider {\n position: relative;\n font-family: Verdana,Arial,sans-serif;\n font-size: 1.1em;\n border: 1px solid #aaaaaa;\n z-index: 2;\n}\n\n.d3-slider-horizontal {\n height: .8em;\n} \n\n.d3-slider-range {\n background:#2980b9;\n left:0px;\n right:0px;\n height: 0.8em;\n position: absolute;\n}\n\n.d3-slider-range-vertical {\n background:#2980b9;\n left:0px;\n right:0px;\n position: absolute;\n top:0;\n}\n\n.d3-slider-vertical {\n width: .8em;\n height: 100px;\n} \n\n.d3-slider-handle {\n position: absolute;\n width: 1.2em;\n height: 1.2em;\n border: 1px solid #d3d3d3;\n border-radius: 4px;\n background: #eee;\n background: linear-gradient(to bottom, #eee 0%, #ddd 100%);\n z-index: 3;\n}\n\n.d3-slider-handle:hover {\n border: 1px solid #999999;\n}\n\n.d3-slider-horizontal .d3-slider-handle {\n top: -.3em;\n margin-left: -.6em;\n}\n\n.d3-slider-axis {\n position: relative;\n z-index: 1; \n}\n\n.d3-slider-axis-bottom {\n top: .8em;\n}\n\n.d3-slider-axis-right {\n left: .8em;\n}\n\n.d3-slider-axis path {\n stroke-width: 0;\n fill: none;\n}\n\n.d3-slider-axis line {\n fill: none;\n stroke: #aaa;\n shape-rendering: crispEdges;\n}\n\n.d3-slider-axis text {\n font-size: 11px;\n}\n\n.d3-slider-vertical .d3-slider-handle {\n left: -.25em;\n margin-left: 0;\n margin-bottom: -.6em; \n}",""])},function(t,e){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 n={},o=0;o<this.length;o++){var a=this[o][0];"number"==typeof a&&(n[a]=!0)}for(o=0;o<e.length;o++){var i=e[o];"number"==typeof i[0]&&n[i[0]]||(r&&!i[2]?i[2]=r:r&&(i[2]="("+i[2]+") and ("+r+")"),t.push(i))}},t}},function(t,e,r){var n={},o=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}},a=o((function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())})),i=o((function(){return document.head||document.getElementsByTagName("head")[0]})),s=null,l=0,c=[];function u(t,e){for(var r=0;r<t.length;r++){var o=t[r],a=n[o.id];if(a){a.refs++;for(var i=0;i<a.parts.length;i++)a.parts[i](o.parts[i]);for(;i<o.parts.length;i++)a.parts.push(h(o.parts[i],e))}else{var s=[];for(i=0;i<o.parts.length;i++)s.push(h(o.parts[i],e));n[o.id]={id:o.id,refs:1,parts:s}}}}function d(t){for(var e=[],r={},n=0;n<t.length;n++){var o=t[n],a=o[0],i={css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(i):e.push(r[a]={id:a,parts:[i]})}return e}function f(t,e){var r=i(),n=c[c.length-1];if("top"===t.insertAt)n?n.nextSibling?r.insertBefore(e,n.nextSibling):r.appendChild(e):r.insertBefore(e,r.firstChild),c.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");r.appendChild(e)}}function p(t){t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function _(t){var e=document.createElement("style");return e.type="text/css",f(t,e),e}function h(t,e){var r,n,o;if(e.singleton){var a=l++;r=s||(s=_(e)),n=g.bind(null,r,a,!1),o=g.bind(null,r,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(t){var e=document.createElement("link");return e.rel="stylesheet",f(t,e),e}(e),n=w.bind(null,r),o=function(){p(r),r.href&&URL.revokeObjectURL(r.href)}):(r=_(e),n=y.bind(null,r),o=function(){p(r)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}t.exports=function(t,e){void 0===(e=e||{}).singleton&&(e.singleton=a()),void 0===e.insertAt&&(e.insertAt="bottom");var r=d(t);return u(r,e),function(t){for(var o=[],a=0;a<r.length;a++){var i=r[a];(s=n[i.id]).refs--,o.push(s)}t&&u(d(t),e);for(a=0;a<o.length;a++){var s;if(0===(s=o[a]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete n[s.id]}}}};var v,m=(v=[],function(t,e){return v[t]=e,v.filter(Boolean).join("\n")});function g(t,e,r,n){var o=r?"":n.css;if(t.styleSheet)t.styleSheet.cssText=m(e,o);else{var a=document.createTextNode(o),i=t.childNodes;i[e]&&t.removeChild(i[e]),i.length?t.insertBefore(a,i[e]):t.appendChild(a)}}function y(t,e){var r=e.css,n=e.media;if(n&&t.setAttribute("media",n),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}function w(t,e){var r=e.css,n=e.sourceMap;n&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var o=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(o),a&&URL.revokeObjectURL(a)}},function(t,e,r){var n=r(262);"string"==typeof n&&(n=[[t.id,n,""]]);r(260)(n,{});n.locals&&(t.exports=n.locals)},function(t,e,r){(t.exports=r(259)()).push([t.id,'[hidden] { display: none; }\n\n.visually-hidden {\n\tposition: absolute;\n\tclip: rect(0, 0, 0, 0);\n}\n\ndiv.awesomplete {\n\tdisplay: inline-block;\n\tposition: relative;\n}\n\ndiv.awesomplete > input {\n\tdisplay: block;\n}\n\ndiv.awesomplete > ul {\n\tposition: absolute;\n\tleft: 0;\n\tz-index: 1;\n\tmin-width: 100%;\n\tbox-sizing: border-box;\n\tlist-style: none;\n\tpadding: 0;\n\tborder-radius: .3em;\n\tmargin: .2em 0 0;\n\tbackground: hsla(0,0%,100%,.9);\n\tbackground: linear-gradient(to bottom right, white, hsla(0,0%,100%,.8));\n\tborder: 1px solid rgba(0,0,0,.3);\n\tbox-shadow: .05em .2em .6em rgba(0,0,0,.2);\n\ttext-shadow: none;\n}\n\ndiv.awesomplete > ul[hidden],\ndiv.awesomplete > ul:empty {\n\tdisplay: none;\n}\n\n@supports (transform: scale(0)) {\n\tdiv.awesomplete > ul {\n\t\ttransition: .3s cubic-bezier(.4,.2,.5,1.4);\n\t\ttransform-origin: 1.43em -.43em;\n\t}\n\t\n\tdiv.awesomplete > ul[hidden],\n\tdiv.awesomplete > ul:empty {\n\t\topacity: 0;\n\t\ttransform: scale(0);\n\t\tdisplay: block;\n\t\ttransition-timing-function: ease;\n\t}\n}\n\n\t/* Pointer */\n\tdiv.awesomplete > ul:before {\n\t\tcontent: "";\n\t\tposition: absolute;\n\t\ttop: -.43em;\n\t\tleft: 1em;\n\t\twidth: 0; height: 0;\n\t\tpadding: .4em;\n\t\tbackground: white;\n\t\tborder: inherit;\n\t\tborder-right: 0;\n\t\tborder-bottom: 0;\n\t\t-webkit-transform: rotate(45deg);\n\t\ttransform: rotate(45deg);\n\t}\n\n\tdiv.awesomplete > ul > li {\n\t\tposition: relative;\n\t\tpadding: .2em .5em;\n\t\tcursor: pointer;\n\t}\n\t\n\tdiv.awesomplete > ul > li:hover {\n\t\tbackground: hsl(200, 40%, 80%);\n\t\tcolor: black;\n\t}\n\t\n\tdiv.awesomplete > ul > li[aria-selected="true"] {\n\t\tbackground: hsl(205, 40%, 40%);\n\t\tcolor: white;\n\t}\n\t\n\t\tdiv.awesomplete mark {\n\t\t\tbackground: hsl(65, 100%, 50%);\n\t\t}\n\t\t\n\t\tdiv.awesomplete li:hover mark {\n\t\t\tbackground: hsl(68, 100%, 41%);\n\t\t}\n\t\t\n\t\tdiv.awesomplete li[aria-selected="true"] mark {\n\t\t\tbackground: hsl(86, 100%, 21%);\n\t\t\tcolor: inherit;\n\t\t}',""])},function(t,e,r){var n=r(224),o=r(264),a=r(269),i=r(270),s=r(271),l=r(272),c=r(274),u=r(276),d=r(277),f=r(3);t.exports=function(t){var e=t.params,r=d3.select(e.root+" .sidebar_wrapper");e.viz.is_expand&&r.style("display","none"),r.append("div").classed("title_section",!0),null!=e.sidebar.title&&r.select(".title_section").append("h4").style("margin-left","20px").style("margin-top","5px").style("margin-bottom","0px").text(e.sidebar.title),r.append("div").style("padding-right","2px").classed("about_section",!0),null!=e.sidebar.about&&r.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),r.append("div").classed("icons_section",!0).style("text-align","center"),t.params.make_modals&&c(e),e.sidebar.icons&&l(t,r),i(e,r),a(r,e),u(r);var p=f.keys(e.viz.possible_filters);p.indexOf("enr_score_type")>-1&&p.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),t.slider_functions={},f.each(p,(function(e){o(t,e)})),n(t),null!==e.ini_view&&(s(e),e.ini_view=null),d(t)}},function(t,e,r){var n=r(265),o=r(268);t.exports=function(t,e){var r=t.params,a=d3.select(r.root+" .sidebar_wrapper").append("div").classed("div_filters",!0).style("padding-left","10px").style("padding-right","10px");"numerical"==r.viz.possible_filters[e]?n(t,e,a):"categorical"==r.viz.possible_filters[e]&&o(t,e,a)}},function(t,e,r){var n=r(247),o=r(266),a=r(6),i=r(64);d3.slider=r(254);var s=r(3);t.exports=function(t,e,r){var l=t.params,c={},u=s.keys(l.viz.possible_filters);s.each(u,(function(t){if(t!=e){var r=a(l.viz.filter_data,t);c[t]=r}}));var d=n(l,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 f=l.network_data.views,p=i(l,f,c),_=(p=p.sort((function(t,r){return r[e]-t[e]}))).length-1,h=0;if(null!==l.requested_view&&e in l.requested_view){var v=l.requested_view[e];if("all"!=v){var m=p.map((function(t){return t[e]})).indexOf(v);m>0&&(h=m)}}var g=d3.slider().value(h).min(0).max(_).step(1).on("slide",(function(r,n){y(t,e,p,n)})).on("slideend",(function(r,n){y(t,e,p,n)}));t.slider_functions[e]=g,d3.select(t.params.root+" .slider_"+e).call(g);var y=s.debounce(o,800)}},function(t,e,r){var n=r(209),o=r(246),a=r(267),i=r(66),s=r(3);t.exports=function(t,e,r,l){if(!1===d3.select(t.params.viz.viz_svg).classed("running_update")){var c=t.params,u=r[l][e];o(t,e,u),c=a(c);var d={};if(d[e]=u,d=i(c,d),s.has(r[0],"enr_score_type")){var f=d3.select(c.root+" .toggle_enr_score_type").attr("current_state");d.enr_score_type=f}n(t,d)}}},function(t,e,r){var n=r(3);t.exports=function(t){var e;return n.each(["row","col"],(function(r){e="row"===r?"col":"row",!1===d3.select(t.root+" .toggle_"+e+"_order .active").empty()?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){var n=r(66);t.exports=function(t,e,r,o){var a=o.append("div").classed("categorical_filter",!0).classed("toggle_"+r,!0).classed("btn-group-vertical",!0).style("width","100%").style("margin-top","10px").attr("current_state","combined_score"),i=e.viz.filter_data[r],s={combined_score:"Combined Score",pval:"P-Value",zscore:"Z-score"};a.selectAll("button").data(i).enter().append("button").attr("type","button").classed("btn",!0).classed("btn-primary",!0).classed(".filter_button",!0).classed("active",(function(t){var e=!1;return"combined_score"==t&&(e=!0),e})).attr("name",(function(t){return t})).html((function(t){return s[t]})),$(e.root+" .categorical_filter .btn").off().click((function(){d3.selectAll(e.root+" .categorical_filter .btn").classed("active",!1),d3.select(this).classed("active",!0);var t=d3.select(this).attr("name");n(e,{enr_score_type:t}),d3.select(e.root+" .toggle_enr_score_type").attr("current_state",t)}))}},function(t,e){t.exports=function(t,e){var r=t.append("div").classed("gene_search_container",!0).style("padding-left","10px").style("padding-right","10px").style("margin-top","10px");r.append("input").classed("form-control",!0).classed("gene_search_box",!0).classed("sidebar_text",!0).attr("type","text").attr("placeholder",e.sidebar.row_search.placeholder).style("height",e.sidebar.row_search.box.height+"px").style("margin-top","10px"),r.append("div").classed("gene_search_button",!0).style("margin-top","5px").attr("data-toggle","buttons").append("button").classed("sidebar_text",!0).html("Search").attr("type","button").classed("btn",!0).classed("btn-primary",!0).classed("submit_gene_button",!0).style("width","100%").style("font-size","14px")}},function(t,e,r){var n=r(3);t.exports=function(t,e){var r,o,a,i,s={row:"Row",col:"Column",both:""},l=e.append("div").style("padding-left","10px").style("padding-right","10px").classed("reorder_section",!0);i=t.sim_mat?["both"]:["row","col"],n.each(i,(function(e){var i;r={clust:"Cluster",rank:"Rank by Sum",rankvar:"Rank by Variance",ini:"Initial Order",alpha:"Alphabetically"},i="row"===e?"col":"row",o=Object.keys(t.matrix.orders);var c,u=[];n.each(o,(function(t){t.indexOf(i)>-1&&(t=t.replace("_row","").replace("_col","")).indexOf("cat_")<0&&u.push(t)})),n.keys(t.viz.filter_data).indexOf("enr_score_type")>-1&&(u=["clust","rank"]),u=(u=n.uniq(u)).sort(),c="both"!=e?" Order":"Reorder Matrix",l.append("div").classed("sidebar_button_text",!0).style("clear","both").style("margin-top","10px").html(s[e]+c),l.append("div").classed("btn-group-vertical",!0).style("width","100%").classed("toggle_"+e+"_order",!0).attr("role","group").selectAll(".button").data(u).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){var n=r(247),o=r(3);t.exports=function(t){o.each(o.keys(t.ini_view),(function(e){var r=t.ini_view[e];if("numerical"===t.viz.possible_filters[e]){"all"!=r&&(r=parseInt(r,10)),t.viz.filter_data[e].indexOf(r)<=-1&&(r="all");var o=n(t,e);d3.select(t.root+" .title_"+e).text(o.text+r+o.suffix),d3.select(t.root+" .slider_"+e).attr("current_state",r)}}))}},function(t,e,r){var n=r(249),o=r(146),a=r(253),i=r(273);t.exports=function(t,e){var r=t.params,s=n(),l=e.select(".icons_section").style("margin-top","7px").style("margin-left","5%"),c="22%",u="0px",d="0px";l.append("div").classed("clust_icon",!0).style("float","left").style("width",c).style("padding-left",u).style("padding-right",d).append("i").classed("fa",!0).classed("fa-share-alt",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",(function(){$(r.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%"),l.append("div").classed("clust_icon",!0).style("float","left").style("width",c).style("padding-left",u).style("padding-right",d).append("i").classed("fa",!0).classed("fa-camera",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",(function(){$(r.root+" .picture_info").modal("toggle")})).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Take snapshot").style("left","-100%"),l.append("div").classed("clust_icon",!0).style("float","left").style("width",c).style("padding-left",u).style("padding-right",d).append("i").classed("fa",!0).classed("fa fa-cloud-download",!0).classed("icon_buttons",!0).style("font-size","25px").on("click",(function(){t.save_matrix()})).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Download matrix").style("left","-200%"),l.append("div").classed("clust_icon",!0).style("float","left").style("width",c).style("padding-left",u).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(!1===t.params.dendro_filter.row&&!1===t.params.dendro_filter.col){var e=d3.select(this).classed("fa-crop"),n=d3.select(this).classed("fa-undo");e&&(t.params.crop_filter_nodes={},t.params.crop_filter_nodes.row_nodes=t.params.network_data.row_nodes,t.params.crop_filter_nodes.col_nodes=t.params.network_data.col_nodes,t.brush_crop_matrix(),!1===d3.select(this).classed("active_cropping")?d3.select(this).classed("active_cropping",!0).style("color","red"):(d3.select(this).classed("active_cropping",!1).style("color","#337ab7"),a(t))),n&&(d3.select(r.root+" .crop_button").style("color","#337ab7").classed("fa-crop",!0).classed("fa-undo",!1),t.filter_viz_using_nodes(t.params.crop_filter_nodes),d3.select(t.params.root+" .col_dendro_icons_container").style("display","block"),d3.select(t.params.root+" .row_dendro_icons_container").style("display","block")),o(t,0,0,1)}})).classed("sidebar_tooltip",!0).append("span").classed("sidebar_tooltip_text",!0).html("Crop matrix").style("left","-400%"),d3.select(r.root+" .download_buttons").append("p").append("a").html("Download SVG").on("click",(function(){!function(){d3.select(r.root+" .expand_button").style("opacity",0);var t=d3.select(r.root+" .viz_svg").attr("title","test2").attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML,e=new Blob([t],{type:"image/svg+xml"});s(e,"clustergrammer.svg"),d3.select(r.root+" .expand_button").style("opacity",.4)}()}));var f="svg_"+r.root.replace("#","");d3.select(r.root+" .download_buttons").append("p").append("a").html("Download PNG").on("click",(function(){d3.select(r.root+" .expand_button").style("opacity",0),i.saveSvgAsPng(document.getElementById(f),"clustergrammer.png"),d3.select(r.root+" .expand_button").style("opacity",.4)}))}},function(t,e,r){var n;!function(){var o=void 0!==e&&e||{}||this;function a(t){if(!((e=t)instanceof HTMLElement||e instanceof SVGElement))throw new Error("an HTMLElement or SVGElement is required; got "+t);var e}function i(t,e,r){for(var n=e.selectorRemap,o=e.modifyStyle,a="",i=[],s=document.styleSheets,l=0;l<s.length;l++){try{var c=s[l].cssRules}catch(t){console.warn("Stylesheet could not be loaded: "+s[l].href);continue}if(null!=c)for(var u,d=0;d<c.length;d++,u=null){var f=c[d];if(void 0!==f.style){var p;try{p=f.selectorText}catch(t){console.warn('The following CSS rule has an invalid selector: "'+f+'"',t)}try{p&&(u=t.querySelector(p)||t.parentNode.querySelector(p))}catch(t){console.warn('Invalid CSS selector "'+p+'"',t)}if(u){var _=n?n(f.selectorText):f.selectorText,h=o?o(f.style.cssText):f.style.cssText;a+=_+" { "+h+" }\n"}else if(f.cssText.match(/^@font-face/)){var v=/url\(["']?(.+?)["']?\)/,m=f.cssText.match(v),g=m&&m[1]||"";g.match(/^data:/)&&(g=""),g?(g.startsWith("../")?g=s[l].href+"/../"+g:g.startsWith("./")&&(g=s[l].href+"/."+g),i.push({text:f.cssText,fontUrlRegexp:v,format:y(g),url:g})):a+=f.cssText+"\n"}}}}function y(t){for(var e={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},r=Object.keys(e),n=0;n<r.length;++n){var o=r[n];if(t.indexOf("."+o)>0)return e[o]}return console.error("Unknown font format for "+t+"; Fonts may not be working correctly"),"application/octet-stream"}!function t(e){if(e.length>0){n(e.pop())}else r(a);function n(r){var n=new XMLHttpRequest;function o(e){console.warn("Failed to load font from: "+r.url),console.warn(e),a+=r.text+"\n",t()}function i(r,n){var o='url("data:'+r.format+";base64,"+n+'")';a+=r.text.replace(r.fontUrlRegexp,o)+"\n",setTimeout((function(){t(e)}),0)}n.addEventListener("load",(function(){var t=function(t){for(var e="",r=new Uint8Array(t),n=r.byteLength,o=0;o<n;o++)e+=String.fromCharCode(r[o]);return window.btoa(e)}(n.response);i(r,t)})),n.addEventListener("error",o),n.addEventListener("abort",o),n.open("GET",r.url),n.responseType="arraybuffer",n.send()}}(i)}function s(t,e,r){var n=t.viewBox&&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 null==n||isNaN(parseFloat(n))?0:n}function l(t){for(var e=window.atob(t.split(",")[1]),r=t.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(e.length),o=new Uint8Array(n),a=0;a<e.length;a++)o[a]=e.charCodeAt(a);return new Blob([n],{type:r})}o.prepareSvg=function(t,e,r){a(t),(e=e||{}).scale=e.scale||1,e.responsive=e.responsive||!1;var n="http://www.w3.org/2000/xmlns/";!function(t,e){a(t);var r=t.querySelectorAll("image"),n=r.length,o=function(){0===n&&e()};o();for(var i=0;i<r.length;i++)!function(t){var e=t.getAttributeNS("http://www.w3.org/1999/xlink","href");if(e&&(r=e.value)&&0==r.lastIndexOf("http",0)&&-1==r.lastIndexOf(window.location.host))console.warn("Cannot render embedded images linking to external hosts: "+e.value);else{var r,a=document.createElement("canvas"),i=a.getContext("2d"),s=new Image;s.crossOrigin="anonymous",(e=e||t.getAttribute("href"))?(s.src=e,s.onload=function(){a.width=s.width,a.height=s.height,i.drawImage(s,0,0),t.setAttributeNS("http://www.w3.org/1999/xlink","href",a.toDataURL("image/png")),n--,o()},s.onerror=function(){console.log("Could not load "+e),n--,o()}):(n--,o())}}(r[i])}(t,(function(){var o,a,l=document.createElement("div"),c=t.cloneNode(!0);if("svg"==t.tagName)o=e.width||s(t,c,"width"),a=e.height||s(t,c,"height");else{if(!t.getBBox)return void console.error("Attempted to render non-SVG element",t);var u=t.getBBox();o=u.x+u.width,a=u.y+u.height,c.setAttribute("transform",c.getAttribute("transform").replace(/translate\(.*?\)/,""));var d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.appendChild(c),c=d}c.setAttribute("version","1.1"),c.getAttribute("xmlns")||c.setAttributeNS(n,"xmlns","http://www.w3.org/2000/svg"),c.getAttribute("xmlns:xlink")||c.setAttributeNS(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),e.responsive?(c.removeAttribute("width"),c.removeAttribute("height"),c.setAttribute("preserveAspectRatio","xMinYMin meet")):(c.setAttribute("width",o*e.scale),c.setAttribute("height",a*e.scale)),c.setAttribute("viewBox",[e.left||0,e.top||0,o,a].join(" "));for(var f=c.querySelectorAll("foreignObject > *"),p=0;p<f.length;p++)f[p].getAttribute("xmlns")||f[p].setAttributeNS(n,"xmlns","http://www.w3.org/1999/xhtml");l.appendChild(c),i(t,e,(function(t){var e=document.createElement("style");e.setAttribute("type","text/css"),e.innerHTML="<![CDATA[\n"+t+"\n]]>";var n=document.createElement("defs");if(n.appendChild(e),c.insertBefore(n,c.firstChild),r){var i=l.innerHTML;i=i.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href'),r(i,o,a)}}))}))},o.svgAsDataUri=function(t,e,r){o.prepareSvg(t,e,(function(t){var e,n="data:image/svg+xml;base64,"+window.btoa((e='<?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" [<!ENTITY nbsp " ">]>'+t,e=(e=encodeURIComponent(e)).replace(/%([0-9A-F]{2})/g,(function(t,e){var r=String.fromCharCode("0x"+e);return"%"===r?"%25":r})),decodeURIComponent(e)));r&&r(n)}))},o.svgAsPngUri=function(t,e,r){a(t),(e=e||{}).encoderType=e.encoderType||"image/png",e.encoderOptions=e.encoderOptions||.8;var n=function(t,n,o){var a,i=document.createElement("canvas"),s=i.getContext("2d");i.width=n,i.height=o,e.canvg?e.canvg(i,t):s.drawImage(t,0,0),e.backgroundColor&&(s.globalCompositeOperation="destination-over",s.fillStyle=e.backgroundColor,s.fillRect(0,0,i.width,i.height));try{a=i.toDataURL(e.encoderType,e.encoderOptions)}catch(t){if("undefined"!=typeof SecurityError&&t instanceof SecurityError||"SecurityError"==t.name)return void console.error("Rendered SVG images cannot be downloaded in this browser.");throw t}r(a)};e.canvg?o.prepareSvg(t,e,n):o.svgAsDataUri(t,e,(function(t){var e=new Image;e.onload=function(){n(e,e.width,e.height)},e.onerror=function(){console.error("There was an error loading the data URI as an image on the following SVG\n",window.atob(t.slice(26)),"\n","Open the following link to see browser's diagnosis\n",t)},e.src=t}))},o.download=function(t,e){if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(l(e),t);else{var r=document.createElement("a");if("download"in r){r.download=t,r.style.display="none",document.body.appendChild(r);try{var n=l(e),o=URL.createObjectURL(n);r.href=o,r.onclick=function(){requestAnimationFrame((function(){URL.revokeObjectURL(o)}))}}catch(t){console.warn("This browser does not support object URLs. Falling back to string URL."),r.href=e}r.click(),document.body.removeChild(r)}else window.open(e,"_temp","menubar=no,toolbar=no,status=no")}},o.saveSvg=function(t,e,r){a(t),r=r||{},o.svgAsDataUri(t,r,(function(t){o.download(e,t)}))},o.saveSvgAsPng=function(t,e,r){a(t),r=r||{},o.svgAsPngUri(t,r,(function(t){o.download(e,t)}))},void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n)}()},function(t,e,r){var n=r(275);t.exports=function(t){var e=n(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=n(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 o=n(t,"dendro_info");o.header.append("h4").classed("modal-title",!0).html("Cluster Information"),o.body.append("g").classed("cluster_info_container",!0),o.body.append("div").classed("dendro_text",!0).append("input").classed("bootstrap_highlight",!0).classed("current_names",!0).style("width","100%")}},function(t,e){t.exports=function(t,e){var r={},n=d3.select(t.root).append("div").classed("modal",!0).classed("fade",!0).classed(e,!0).attr("role","dialog").append("div").classed("modal-dialog",!0).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){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)}},function(t,e,r){var n=r(3);t.exports=function(t){var e=t.params;d3.select(e.root+" .sidebar_wrapper").append("div").classed("sidebar_text",!0).style("padding-left","10px").style("padding-top","5px").text("Matrix Values");var r=e.sidebar.width-20,o=1.2*r,a=r+10,i=e.network_data,s=n.max(i.links,(function(t){return t.value})).value,l=n.min(i.links,(function(t){return t.value})).value,c=d3.select(e.root+" .sidebar_wrapper").append("svg").attr("height","39px").attr("width",o+"px"),u=c.append("defs").append("linearGradient").attr("id",e.root.replace("#","")+"_linear-gradient"),d="none";l>=0?(u.append("stop").attr("offset","0%").attr("stop-color","white"),u.append("stop").attr("offset","100%").attr("stop-color",e.matrix.tile_colors[0]),d="all_postiive"):s<=0?(u.append("stop").attr("offset","0%").attr("stop-color",e.matrix.tile_colors[1]),u.append("stop").attr("offset","100%").attr("stop-color","white"),d="all_negative"):(u.append("stop").attr("offset","0%").attr("stop-color",e.matrix.tile_colors[1]),u.append("stop").attr("offset","50%").attr("stop-color","white"),u.append("stop").attr("offset","100%").attr("stop-color",e.matrix.tile_colors[0])),c.append("rect").classed("background",!0).attr("height","13px").attr("width",r+"px").attr("fill","url(#"+e.root.replace("#","")+"_linear-gradient)").attr("transform","translate(10, 3)").attr("stroke","grey").attr("stroke-width","0.25px");var f=Math.abs(Math.round(10*e.matrix.max_link)/10);c.append("text").text((function(){return"all_postiive"===d?0:"-"+f.toLocaleString()})).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",300).style("font-size",13).attr("transform","translate(10,33)").attr("text-anchor","start"),c.append("text").text(f.toLocaleString()).text((function(){return"all_negative"===d?0:f.toLocaleString()})).style("font-family",'"Helvetica Neue", Helvetica, Arial, sans-serif').style("font-weight",300).style("font-size",13).attr("transform","translate("+a+",33)").attr("text-anchor","end")}}]);