-
Notifications
You must be signed in to change notification settings - Fork 3
/
iobio.viz.min.js
2 lines (2 loc) · 51.2 KB
/
iobio.viz.min.js
1
2
!function t(e,n,r){function i(o,l){if(!n[o]){if(!e[o]){var u="function"==typeof require&&require;if(!l&&u)return u(o,!0);if(a)return a(o,!0);var s=new Error("Cannot find module '"+o+"'");throw s.code="MODULE_NOT_FOUND",s}var c=n[o]={exports:{}};e[o][0].call(c.exports,function(t){var n=e[o][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(t,e,n){var r,i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===a.call(t)},l=function(t){"use strict";if(!t||"[object Object]"!==a.call(t))return!1;var e=i.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&i.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!n)return!1;var o;for(o in t);return o===r||i.call(t,o)};e.exports=function u(){"use strict";var t,e,n,i,a,s,c=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof c?(p=c,c=arguments[1]||{},d=2):("object"!=typeof c&&"function"!=typeof c||null==c)&&(c={});d<f;++d)if(t=arguments[d],null!=t)for(e in t)n=c[e],i=t[e],c!==i&&(p&&i&&(l(i)||(a=o(i)))?(a?(a=!1,s=n&&o(n)?n:[]):s=n&&l(n)?n:{},c[e]=u(p,s,i)):i!==r&&(c[e]=i));return c}},{}],2:[function(t,e,n){var r=function(){function t(t){t=t.sort(function(t,n){return e(n)-e(t)});var l=t.map(function(t,n){return e.call(this,t,n)}),u=n.call(this,l),s=u[2],c=u[0],d=1.5*(c-s);if(o){var f=[],p=[];l.forEach(function(t){t>=s-d&&t<=c+d?p.push(t):f.push(t)}),l=p}var h=r&&r.call(this,l),g=h&&h.map(function(t){return+l[t]}),x={quartiles:u,whiskers:g};return a&&(x.outliers=f||[]),i&&(x.data=t),x}var e=function(t){return+t},n=function(t){return[d3.quantile(t,.25),d3.quantile(t,.5),d3.quantile(t,.75)]},r=function(t){return[0,t.length-1]},i=!0,a=!0,o=!0;return t.value=function(n){return arguments.length?(e=n,t):e},t.includeData=function(e){return arguments.length?(i=e,t):i},t.includeOutliers=function(e){return arguments.length?(a=e,t):a},t.modifiedBoxPlot=function(e){return arguments.length?(o=e,t):o},t.quartiles=function(e){return arguments.length?(n=e,t):n},t};e.exports=r},{}],3:[function(t,e,n){var r=t("../utils.js"),i=function(){function t(t){for(var a=[],o={},l=r.getUID(),u=[t];null!=(node=u.pop());)if(node._visited!=l){a.push(node),node._visited=l;var s=o[i(node)]||(o[i(node)]=[]);if(s.push(node),1==s.length)node.y=0;else for(var c=0;c<s.length;c++)s[c].y=2*(c/(s.length-1)||0)-1;var d=[].concat(e(node),n(node));u=u.concat(d.filter(function(t){return t._visited!=l}))}return a}var e=function(t){return t.sources},n=function(t){return t.targets},i=function(t){return t.position};return t.links=function(t){var e=[];return t.forEach(function(t){(t.targets||[]).map(function(n){e.push({source:t,target:n})})}),e},t.sources=function(t){return arguments.length?(e=t,chart):e},t.targets=function(t){return arguments.length?(n=t,chart):n},t.position=function(t){return arguments.length?(i=t,chart):i},t};e.exports=i},{"../utils.js":10}],4:[function(t,e,n){var r={};r.pileup=t("./pileup.js"),r.graph=t("./graph.js"),r.pointSmooth=t("./pointSmooth.js"),r.outlier=t("./outlier.js"),r.box=t("./box.js"),e.exports=r},{"./box.js":2,"./graph.js":3,"./outlier.js":5,"./pileup.js":6,"./pointSmooth.js":7}],5:[function(t,e,n){var r=function(){function t(t){var r=d3.min(t,function(t,e){return n(t)}),i=d3.max(t,function(t,e){return n(t)}),a=Math.abs(r)+Math.abs(i),o=d3.scale.linear().domain([r,i]).range([0,a]);t=t.sort(function(t,e){var r=n(t),i=n(e);return r>i?1:r<i?-1:0});var l=e(t,o,.25),u=e(t,o,.75),s=1.5*(u-l),c=t.filter(function(t){return o(n(t))>=Math.max(l-s,0)&&o(n(t))<=u+s});return c}function e(t,e,i){for(var a,o,l=t.reduce(function(t,e,n,i){return t+r(e)},0)-1,u=l*i+1,s=Math.floor(u),c=0,d=0;d<t.length;d++)if(c+=r(t[d]),void 0==o&&c>=s-1&&(o=e(n(t[d]))),void 0==a&&c>=s){a=e(n(t[d]));break}var f=+o,p=u-s;return p?f+p*(a-f):f}var n=function(t){return t[0]},r=function(t){return t[1]};return t.value=function(e){return arguments.length?(n=e,t):n},t.count=function(e){return arguments.length?(r=e,t):r},t};e.exports=r},{}],6:[function(t,e,n){var r=function(){function t(o){var l=o.map(function(r,i){return[+e.call(t,r,i),+n.call(t,r,i)]}),u=d3.scale.linear().domain([l[0][0],l[l.length-1][1]]).range([0,i]),s=d3.range(o.length);null!=r&&s.sort("default"===r?function(t,e){return l[e][0]-l[t][0]}:function(t,e){return r(o[t],o[e])});var c,d=[],f=[];return s.forEach(function(t){var e=l[t][0],n=l[t][1];c=void 0;for(var r=0;r<f.length;r++)if(u(f[r])+a<u(e)){c=r,f[r]=n;break}void 0==c&&(c=f.length,f.push(n)),d[t]={data:o[t],x:e,w:n-e,y:c}}),d}var e=function(t){return t.start},n=function(t){return t.end},r="default",i=400,a=0;return t.start=function(n){return arguments.length?(e=n,t):e},t.end=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=e,t):i},t.buffer=function(e){return arguments.length?(a=e,t):a},t.sort=function(e){return arguments.length?(r=e,t):r},t};e.exports=r},{}],7:[function(t,e,n){function r(t,e){var n=t[0],a=t[t.length-1];if(t.length<3)return t;for(var o=-1,l=0,u=1;u<t.length-1;u++){var s=i(t[u],n,a);s>l&&(l=s,o=u)}if(l>e){var c=t.slice(0,o+1),d=t.slice(o),f=r(c,e),p=r(d,e),h=f.slice(0,f.length-1).concat(p);return h}return[n,a]}function i(t,e,n){var r,i,a;return e.pos==n.pos?r=Math.abs(t.pos-e.pos):(i=(n.depth-e.depth)/(n.pos-e.pos),a=e.depth-i*e.pos,r=Math.abs(i*t.pos-t.depth+a)/Math.sqrt(Math.pow(i,2)+1)),r}var a=function(){function t(a){var o=a.map(function(r,i){return{data:r,pos:+e.call(t,r,i),depth:+n.call(t,r,i)}}),l=parseInt(epsilonRate*(o[o.length-1].pos-o[0].pos)/i);return o=r(o,l)}var e=function(t){return t.pos},n=function(t){return t.depth},i=400;return epsilonRate=.3,t.pos=function(n){return arguments.length?(e=n,t):e},t.depth=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=e,t):i},t.epsilonRate=function(e){return arguments.length?(epsilonRate=e,t):epsilonRate},t};e.exports=a},{}],8:[function(t,e,n){var r={};r.variant=t("./variant.js"),e.exports=r},{"./variant.js":9}],9:[function(t,e,n){var r=function(){function t(t,o){a.source(function(t){return{x:i(t)*t.y,y:t.x+Math.abs(t.w/2)}}).target(function(t){return{x:0,y:t.x+t.w/2+Math.abs(t.w/2)}}).projection(function(t){return[t.y,t.x]});var l=i(t),u=Math.abs(5*l/6),s=1*l/6+n(t),c=2*l/6+n(t),d=.625*l+n(t),f=1.145*l+n(t);return r(t)<=Math.abs(u/2)?"M"+e(t)+","+n(t)+" C"+e(t)+","+s+" "+parseInt(e(t)+r(t)/2-u/2)+","+c+" "+parseInt(e(t)+r(t)/2-u/2)+","+d+" C"+parseInt(e(t)+r(t)/2-u/2)+","+f+" "+parseInt(e(t)+r(t)/2+u/2)+","+f+" "+parseInt(e(t)+r(t)/2+u/2)+","+d+" C"+parseInt(e(t)+r(t)/2+u/2)+","+c+" "+parseInt(e(t)+r(t))+","+s+" "+parseInt(e(t)+r(t))+","+n(t):a(t)+a({x:e(t),y:n(t),w:-r(t)})}var e=function(t){return t.x},n=function(t){return t.y},r=function(t){return t.w},i=function(t){return t.h},a=d3.svg.diagonal();return t.xValue=function(n){return arguments.length?(e=n,t):e},t.yValue=function(e){return arguments.length?(n=e,t):n},t.wValue=function(e){return arguments.length?(r=e,t):r},t.hValue=function(e){return arguments.length?(i=e,t):i},t};e.exports=r},{}],10:[function(t,e,n){function r(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}e.exports.format_unit_names=function(t){return t/1e6>=1?t=t/1e6+"M":t/1e3>=1&&(t=t/1e3+"K"),t},e.exports.format_percent=function(t,e){for(var e=e||1,n=1,r=0;r<e;r++)n*=10;var i=parseInt(t*(100*n))/n;return i},e.exports.getUID=function(t){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}var n=t||"-";return e()+e()+n+e()+n+e()+n+e()+n+e()+e()+e()},e.exports.value_accessor=function(t,e,n){return"function"==typeof t?t(e,n):t},e.exports.tooltipHelper=function(e,n,r){var i=t("./utils.js");e.on("mouseover",function(t,e){i.showTooltip(n,r,t)}).on("mouseout",function(t){i.hideTooltip(n)})},e.exports.showTooltip=function(e,n,r){var i=t("./utils.js"),a=i.value_accessor(n,r),o=a?.9:0,l=e.node().getBoundingClientRect().height;e.transition().duration(200).style("opacity",o),e.html(a).style("left",d3.event.clientX+8+"px").style("text-align","left").style("top",d3.event.clientY-l-8+"px")},e.exports.endAll=function(t,e){var n;t.empty()?e():(n=t.size(),t.each("end",function(){n--,0===n&&e()}))},e.exports.addStylesToSvg=function(t){for(var e="",n=document.styleSheets,r=0;r<n.length;r++){var i=n[r].cssRules;if(null!=i)for(var a=0;a<i.length;a++){var o=i[a];if("undefined"!=typeof o.style){var l=t.querySelectorAll(o.selectorText);l.length>0&&(e+=o.selectorText+" { "+o.style.cssText+" }\n")}}}var u=document.createElement("style");u.setAttribute("type","text/css"),u.innerHTML=e;var s=document.createElement("defs");s.appendChild(u),t.insertBefore(s,t.firstChild)},e.exports.hideTooltip=function(t){t.transition().duration(500).style("opacity",0)},e.exports.rebind=function(t,e){for(var n,i=1,a=arguments.length;++i<a;)t[n=arguments[i]]=r(t,e,e[n]);return t}},{"./utils.js":10}],11:[function(t,e,n){(function(n){var r=n.iobio||{};n.iobio=r,"object"==typeof e&&(e.exports=r),r.viz=t("./viz/viz.js"),r.viz.layout=t("./layout/layout.js"),r.viz.svg=t("./svg/svg.js"),r.viz.utils=t("./utils.js")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./layout/layout.js":4,"./svg/svg.js":8,"./utils.js":10,"./viz/viz.js":26}],12:[function(t,e,n){var r=function(){function e(t,e){var d={};a(d,c,e),r.call(this,t,d);var f=r.x(),p=r.y(),h=r.id();xValue=r.xValue(),yValue=r.yValue(),wValue=r.wValue(),yAxis=r.yAxis(),color=r.color(),transitionDuration=r.transitionDuration(),"down"==u&&(p.range([p.range()[1],p.range()[0]]),yAxis&&t.select(".iobio-y.iobio-axis").transition().duration(0).call(yAxis));var g=t.select("g.iobio-container").classed("iobio-alignment",!0),x=g.selectAll(".alignment").data(t.datum());if(x.enter().append("g").attr("id",function(t){return h(t)}).attr("class","alignment").attr("transform",function(t,e){var n="translate("+parseInt(f(xValue(t,e)+wValue(t,e)/2))+","+parseInt(p(yValue(t,e))-l/2)+")";return o&&"reverse"==o(t,e)?n+" rotate(180)":n}).style("fill",color).append("polygon").attr("points",function(t){var e=l;return o?"-0.1,"+-e/2+" 0,"+-e/2+" 0.1,0 0,"+e/2+" -0.1,"+e/2:"-0.1,"+-e/2+" 0,"+-e/2+" 0,"+e/2+" -0.1,"+e/2}),x.exit(),x.transition().duration(transitionDuration).attr("transform",function(t,e){var n="translate("+parseInt(f(xValue(t,e)+wValue(t,e)/2))+","+parseInt(p(yValue(t,e))-l/2)+")";return o&&"reverse"==o(t,e)?n+" rotate(180)":n}).style("fill",color),x.select("polygon").transition().duration(transitionDuration).attr("points",function(t,e){var n=f(xValue(t,e)+wValue(t,e))-f(xValue(t,e)),r=l,i=Math.min(5,n);return o?-n/2+","+-r/2+" "+(n/2-i)+","+-r/2+" "+n/2+",0 "+(n/2-i)+","+r/2+" "+-n/2+","+r/2:-n/2+","+-r/2+" "+n/2+","+-r/2+" "+n/2+","+r/2+" "+-n/2+","+r/2}),n){var v=d3.select(".iobio-tooltip");i.tooltipHelper(g.selectAll(".alignment"),v,n)}s.forEach(function(t){g.selectAll(".alignment").on(t.event,t.listener)})}var n,r=t("./base.js")(),i=t("../utils.js"),a=t("extend"),o=null,l=4,u="down",s=[],c={};return r.rebind(e),e.directionValue=function(t){return arguments.length?(o=t,e):o},e.orientation=function(t){return arguments.length?(u=t,e):u},e.on=function(t,n){return arguments.length?(s.push({event:t,listener:n}),e):s},e.tooltip=function(t){return arguments.length?(n=t,e):n},e};e.exports=r},{"../utils.js":10,"./base.js":15,extend:1}],13:[function(t,e,n){var r=function(){function e(t,e){var u={};a(u,l,e),r.call(this,t,u);var s=r.x(),c=r.y(),d=r.id(),f=r.xValue(),p=r.yValue(),h=r.wValue(),g=r.keyValue(),x=r.color(),v=r.transitionDuration(),b=r.height()-r.margin().top-r.margin().bottom;if(b<0)return console.log("Negative inner height "+b+" calculated for bar chart. Change height or margins."),void console.trace();var y=t.select("g.iobio-container").classed("iobio-bar",!0),m=y.selectAll(".rect").data(t.datum(),g);if(m.exit().remove(),m.enter().append("g").attr("id",d).attr("class","rect").style("fill",x).append("rect").attr("y",function(t){return b}).attr("x",function(t,e){return s(f(t,e))}).attr("width",function(t,e){return s(f(t,e)+h(t,e))-s(f(t,e))}).attr("height",function(t){return 0}),m.style("fill",x).select("rect").transition().duration(v).attr("x",function(t,e){return s(f(t,e))}).attr("y",function(t,e){return c(p(t,e))}).attr("width",function(t,e){return s(f(t,e)+h(t,e))-s(f(t,e))}).attr("height",function(t,e){return b-c(p(t,e))}),n){var w=d3.select(".iobio-tooltip");i.tooltipHelper(y.selectAll(".rect"),w,n)}o.forEach(function(t){m.on(t.event,t.listener)})}var n,r=t("./base.js")(),i=t("../utils.js"),a=t("extend"),o=[],l={yMin:0};return r.rebind(e),e.on=function(t,n){return arguments.length?(o.push({event:t,listener:n}),e):o},e.tooltip=function(t){return arguments.length?(n=t,e):n},e.rebind=function(t){r.rebind(t),i.rebind(t,this,"rebind")},e};e.exports=r},{"../utils.js":10,"./base.js":15,extend:1}],14:[function(t,e,n){var r=function(){function e(t,n){var o={};a(o,u,n),r=e.height(),t.selectAll("div").data([0,0]).enter().append("div").attr("class",function(t,e){return"iobio-bar-"+e+" iobio-barViewer"});var s=i().height(r*l).xValue(e.xValue()).yValue(e.yValue()).wValue(e.wValue()).xAxis(e.xAxis()).yAxis(e.yAxis()).margin(e.margin()).width(e.width()).y(e.y()).x(e.x()).id(e.id()).color(e.color()).tooltip(e.tooltip()).transitionDuration(e.transitionDuration()),c=t.select(".iobio-bar-0").datum(t.datum());s(c,o);var d=i().xValue(e.xValue()).yValue(e.yValue()).wValue(e.wValue()).xAxis(e.xAxis()).yAxis(null).margin(e.margin()).width(e.width()).transitionDuration(e.transitionDuration()).id(e.id()).color(e.color()).tooltip(e.tooltip()).height(r*(1-l)).brush("brush",function(){var t=d.x(),e=d.brush(),n=e.empty()?t.domain():e.extent(),r=f.datum().filter(function(t,e){return d.xValue()(t,e)>=n[0]&&d.xValue()(t,e)<=n[1]});o.xMin=n[0],o.xMax=n[1],o.globalBar=d,s(c.datum(r),o)}),f=t.select(".iobio-bar-1").datum(t.datum());d(f,o)}var n,r,i=t("./bar.js"),a=(t("../utils.js"),t("extend")),o=[],l=.8,u={},s=i();return s.rebind(e),e.sizeRatio=function(t){return arguments.length?(l=t,e):l},e.on=function(t,n){return arguments.length?(o.push({event:t,listener:n}),e):o},e.tooltip=function(t){return arguments.length?(n=t,e):n},e};e.exports=r},{"../utils.js":10,"./bar.js":13,extend:1}],15:[function(t,e,n){var r=t("../utils.js"),i=t("extend"),a=function(){function t(e,r){var x={};i(x,V,r);var v=d3.select(e.node()),b=e.datum(),A=v.selectAll("svg").data([0]);t.svg=A;var j=A.enter().append("svg").append("g").attr("class","iobio-container"),k=A.select("g");A.attr("width",l).attr("height",u),k.attr("transform","translate("+o.left+","+o.top+")");var M=A.node().getBoundingClientRect(),_=0!=M.width?M.width:l,R=0!=M.height?M.height:u,I=R-o.top-o.bottom;A.attr("viewBox","0 0 "+_+" "+R),a&&A.attr("preserveAspectRatio",a),v.style("-webkit-flex","1 1 auto"),v.style("flex","1 1 auto"),v.style("-webkit-order","1"),v.style("order","1"),b=b.map(function(t,e){return[p.call(b,t,e),h.call(b,t,e),g.call(b,t,e)]});var D=void 0===x.xMin||null===x.xMin?d3.min(b,function(t){return t[0]}):x.xMin,P=void 0===x.xMax||null===x.xMax?d3.max(b,function(t){return t[0]+t[2]}):x.xMax;s.domain([D,P]),s.range([0,_-o.left-o.right]);var C=void 0===x.yMin||null===x.yMin?d3.min(b,function(t){return t[1]&&t[1].constructor===Array?d3.min(t[1]):t[1]}):x.yMin,S=void 0===x.yMax||null===x.yMax?d3.max(b,function(t){return t[1]&&t[1].constructor===Array?d3.max(t[1]):t[1]}):x.yMax;if(C=C||0,S=S||0,c.domain([C,S]).range([I,0]),j.append("g").attr("class","iobio-glyphs"),j.append("g").attr("class","iobio-x iobio-axis").attr("transform","translate(0,"+c.range()[0]+")"),j.append("g").attr("class","iobio-y iobio-axis"),j.append("g").attr("class","iobio-x iobio-brush"),d3.select(".iobio-tooltip").empty()&&d3.select("body").append("div").attr("class","iobio-tooltip").style("opacity",0),d&&k.select(".iobio-x.iobio-axis").transition().duration(w).call(d),f&&k.select(".iobio-y.iobio-axis").transition().duration(w).call(f),n){var T=d3.select(".iobio-tooltip");A.on("mouseover",function(e,r){var i={x:parseInt(s.invert(d3.event.pageX-A.node().getBoundingClientRect().left-o.left)),y:parseInt(c.invert(d3.event.pageY-A.node().getBoundingClientRect().top-o.top))},a=n.call(t,A,i)?.9:0;T.transition().duration(w).style("opacity",a),T.html(n.call(t,A,i)).style("left",d3.event.pageX+"px").style("text-align","left").style("top",d3.event.pageY-24+"px")}).on("mouseout",function(t){T.transition().duration(500).style("opacity",0)}).on("mousemove",function(){var e={x:parseInt(s.invert(d3.event.pageX-A.node().getBoundingClientRect().left-o.left)),y:parseInt(c.invert(d3.event.pageY-A.node().getBoundingClientRect().top-o.top))},r=n.call(t,A,e)?.9:0;T.style("opacity",r),T.html(n.call(t,A,e)).style("left",d3.event.pageX+"px").style("top",d3.event.pageY-24+"px")})}return(m.on("brushend")||m.on("brushstart")||m.on("brush"))&&(m.x(s),A.select(".iobio-brush").call(m).selectAll("rect").attr("y",-6).attr("height",I+6)),y.forEach(function(e){var n=e.listener?function(){e.listener.call(t,A)}:null;A.on(e.event,n)}),b}var e,n,a,o={top:0,right:0,bottom:0,left:0},l="100%",u="100%",s=d3.scale.linear().nice(),c=d3.scale.linear().nice(),d=d3.svg.axis().scale(s).orient("bottom").tickFormat(r.format_unit_names).ticks(5),f=d3.svg.axis().scale(c).orient("left").ticks(5),p=function(t){return t[0]},h=function(t){return t[1]},g=function(t){return t[2]||1},x=function(t){return null},v=d3.scale.category10(),b=function(t,e){return v(e)},y=[],m=d3.svg.brush(),w=400,V={};return t.margin=function(e){return arguments.length?(o=e,t):o},t.width=function(e){return arguments.length?(l=e,t):l},t.height=function(e){return arguments.length?(u=e,t):u},t.x=function(e){return arguments.length?(s=e,t):s},t.y=function(e){return arguments.length?(c=e,t):c},t.xValue=function(e){return arguments.length?(p=e,t):p},t.yValue=function(e){return arguments.length?(h=e,t):h},t.wValue=function(e){return arguments.length?(g=e,t):g},t.keyValue=function(n){return arguments.length?(e=n,t):e},t.id=function(e){return arguments.length?(x=e,t):x},t.xAxis=function(e){return arguments.length?(d=e,t):d},t.yAxis=function(e){return arguments.length?(f=e,t):f},t.preserveAspectRatio=function(e){return arguments.length?(a=e,t):a},t.getBoundingClientRect=function(t){return this.svg.node().getBoundingClientRect()},t.transitionDuration=function(e){return arguments.length?(w=e,t):w},t.color=function(e){return arguments.length?(b=e,t):b},t.brush=function(e,n){return arguments.length?(m.on(e,function(){n.call(this,m)}),t):m},t.onChart=function(e,n){return arguments.length?(y.push({event:e,listener:n}),t):y},t.tooltipChart=function(e){return arguments.length?(n=e,t):n},t.rebind=function(t){r.rebind(t,this,"rebind","margin","width","height","x","y","id","xValue","yValue","wValue","keyValue","xAxis","yAxis","brush","onChart","tooltipChart","preserveAspectRatio","getBoundingClientRect","transitionDuration","color")},t};e.exports=a},{"../utils.js":10,extend:1}],16:[function(t,e,n){var r=function(){function e(t,o){var j={};a(j,A,o);var k=w&&j.sort?w(t.datum(),y):t.datum();k=b?V(k,y):k,j.yMin=void 0==j.yMin?d3.min(k,function(t){return+d(t)[1]}):j.yMin,j.yMax=void 0==j.yMax?d3.max(k,function(t){return+d(t)[0]}):j.yMax,r.wValue(function(){return 1}).call(this,t,j);var M=r.y(),_=r.id(),R=r.xValue(),I=(r.yValue(),r.wValue(),r.keyValue()),D=d3.select(".iobio-tooltip"),P=r.color(),C=r.transitionDuration(),S=r.getBoundingClientRect().width-r.margin().left-r.margin().right;x.domain(k.map(function(t,e){return e}));var T=0;k.forEach(function(t,e){T+=p(t,e)});var B=k.length,L=S/(2*u+l*(B-1)+(1-l)*T),E=L-L*l,q=0,z=[];k.forEach(function(t,e){z.push(q),q+=E*p(t,e)+L*l}),x.range(z);var N=t.select("g.iobio-container").classed("iobio-box",!0).select("g.iobio-glyphs").classed("iobio-box",!0),H=N.selectAll(".box").data(k,I);H.enter().append("g").attr("id",_).style("fill",P).attr("transform",function(t,e){return"translate("+x(R(t,e))+", 0)"}),H.exit().transition().duration(g).remove(),H.attr("class",function(t,e){return"box "+i.value_accessor(v,t,e)}),H.transition().duration(C).attr("transform",function(t,e){return"translate("+x(R(t,e))+", 0)"}).attr("data-median",function(t){return f(t)[1]});var O=H.selectAll(".center").data(function(t,e){return[t]});O.enter().insert("line","rect").attr("class","center").attr("x1",function(t,e,n){return E*p(t,n)/2}).attr("y1",function(t){return M(d(t)[0])}).attr("x2",function(t,e,n){return E*p(t,n)/2}).attr("y2",function(t){return M(d(t)[1])}).style("opacity",0),O.exit().remove(),O.transition().duration(C).attr("y1",function(t){return M(d(t)[0])}).attr("y2",function(t){return M(d(t)[1])}).style("opacity",1);var F=H.selectAll(".compressionNumber").data(function(t){return[t]});F.enter().append("text").attr("class","compressionNumber").attr("x",function(t,e,n){return E*p(t,n)/2}).attr("y",function(t){return M(d(t)[0])-10}).text(function(t,e,n){return m(t,n,E)}).style("text-anchor","middle").style("opacity",0).style("fill","rgb(200,200,200").on("click",function(n){n.compressedBoxes.forEach(function(t){t.uncompressable=!0}),e(t,{sort:!1})}),F.filter(function(t,e,n){return null==m(t,e,E)}).remove(),F.transition().duration(C).attr("x",function(t,e,n){return E*p(t,n)/2}).attr("y",function(t){return M(d(t)[0])-7}).style("opacity",1).text(function(t,e,n){return m(t,n,E)});var W=H.selectAll(".rect").data(function(t){return[t]});W.enter().append("rect").attr("class","rect").attr("y",function(t){return M(f(t)[0])}).attr("x",function(t,e,n){return E*p(t,n)/2}).attr("width",function(t,e){return 0}).attr("height",function(t){return M(f(t)[2])-M(f(t)[0])}),W.exit().remove(),W.transition().duration(C).attr("y",function(t,e){return M(f(t)[0])}).attr("x",function(t,e){return 0}).attr("width",function(t,e,n){return E*p(t,n)}).attr("height",function(t){return M(f(t)[2])-M(f(t)[0])}),i.tooltipHelper(H,D,n);var U=H.selectAll(".median").data(function(t){return[t]});U.enter().append("line").attr("class","median").attr("x1",function(t,e,n){return E*p(t,n)/2}).attr("y1",function(t){return M(f(t)[1])}).attr("x2",function(t,e,n){return E*p(t,n)/2}).attr("y2",function(t){return M(f(t)[1])}),U.exit().remove(),U.transition().duration(C).attr("x1",0).attr("y1",function(t){return M(f(t)[1])}).attr("x2",function(t,e,n){return E*p(t,n)}).attr("y2",function(t){return M(f(t)[1])});var X=H.selectAll(".whisker").data(function(t,e){var n=d(t),r=p(t,e)*E;return[[n[0],r],[n[1],r]]});if("circle"==i.value_accessor(h,E)?(X.enter().append("circle").attr("class","whisker").attr("cx",function(t,e){return t[1]/2}).attr("cy",function(t,e){return M(t[0])}).attr("r",0),X.exit().remove(),t.selectAll(".whisker").transition().duration(C).attr("cx",function(t,e){return t[1]/2}).attr("cy",function(t,e){return M(t[0])}).attr("r",function(t,e){return t[1]/2})):(X.enter().append("line").attr("class","whisker").attr("x1",function(t,e){return t[1]/2}).attr("y1",function(t,e){return M(t[0])}).attr("x2",function(t,e){return t[1]/2}).attr("y2",function(t,e){return M(t[0])}),X.exit().remove(),t.selectAll(".whisker").transition().duration(C).attr("x1",0).attr("y1",function(t,e){return M(t[0])}).attr("x2",function(t,e){return t[1]}).attr("y2",function(t,e){return M(t[0])})),s){var Y=H.selectAll(".label").data(function(t){return f(t).concat(d(t))});Y.enter().append("text").attr("class","label").attr("x",function(t,e){return E+2}).attr("y",M).attr("alignment-baseline","middle").text(function(t,e){return c[e]}),Y.exit().remove(),Y.transition().duration(C).attr("x",function(t,e){return E+2}).attr("y",M).text(function(t,e){return c[e]})}i.tooltipHelper(X,D,function(t){return t})}var n,r=t("./base.js")(),i=t("../utils.js"),a=t("extend"),o=[],l=.1,u=0,s=!1,c=["q3","median","q1","whisker","whisker"],d=function(t,e){return t.whiskers},f=function(t,e){return t.quartiles},p=function(t,e){return 1},h="line",g=0,v="",b=!1,y=.2,m=function(t,e,n){if(t.totalBoxes){var r=n*p(t,e),i=t.totalBoxes.toString().length;return r/i>3?t.totalBoxes:null}return null};x=d3.scale.ordinal();var w=function(t,e){return t.sort(function(t,n){var r=(f(t)[1]-f(n)[1])/((f(t)[1]+f(n)[1])/2),i=(f(t)[0]-f(n)[0])/((f(t)[0]+f(n)[0])/2),a=(f(t)[2]-f(n)[2])/((f(t)[2]+f(n)[2])/2);return Math.abs(r)>e?r:i+a})},V=function(t,e){var n,r=[];return t.forEach(function(t){if(!n)return n={},void a(!0,n,t);var i=Math.abs(1-f(n)[1]/f(t)[1])<e,o=Math.abs(1-f(n)[0]/f(t)[0])<e,l=Math.abs(1-f(n)[2]/f(t)[2])<e;i&&o&&l&&!t.uncompressable?(n.totalBoxes=n.totalBoxes||1,n.compressedBoxes=n.compressedBoxes||[],f(n)[1]=(f(n)[1]*n.totalBoxes+f(t)[1])/(n.totalBoxes+1),f(n)[0]=(f(n)[0]*n.totalBoxes+f(t)[0])/(n.totalBoxes+1),f(n)[2]=(f(n)[2]*n.totalBoxes+f(t)[2])/(n.totalBoxes+1),n.totalBoxes+=1,n.compressedBoxes.push(t)):(r.push(n),n={},a(!0,n,t))}),r};r.xValue(function(t,e){return e});var A={sort:!0};return r.rebind(e),e.showLabels=function(t){return arguments.length?(s=t,e):s},e.labels=function(t){return arguments.length?(c=t,e):c},e.whiskersValue=function(t){return arguments.length?(d=t,e):d},e.quartilesValue=function(t){return arguments.length?(f=t,e):f},e.boxWidthRatio=function(t){return arguments.length?(p=t,e):p},e.sort=function(t){return arguments.length?(w=t,e):w},e.compress=function(t){return arguments.length?(b=t,e):b},e.compressFunc=function(t){return arguments.length?(V=t,e):V},e.compression=function(t){return arguments.length?(y=t,e):y},e.compressionNumberLabel=function(t){return arguments.length?(m=t,e):m},e.outerPadding=function(t){return arguments.length?(u=t,e):u},e.padding=function(t){return arguments.length?(l=t,e):l},e.whiskerType=function(t){return arguments.length?(h=t,e):h},e.exitTransitionDuration=function(t){return arguments.length?(g=t,e):g},e["class"]=function(t){return arguments.length?(v=t,e):v},e.on=function(t,n){return arguments.length?(o.push({event:t,listener:n}),e):o},e.tooltip=function(t){return arguments.length?(n=t,e):n},e.rebind=function(t){r.rebind(t),i.rebind(t,this,"rebind","showLabels","labels","whiskersValue","quartilesValue","boxWidthRatio","sort","compress","compressFunc","compression","compressionNumberLabel","outerPadding","padding","whiskerType","preserveAspectRatio","exitTransitionDuration","class")},e};e.exports=r},{"../utils.js":10,"./base.js":15,extend:1}],17:[function(t,e,n){var r=function(){function e(t,n){var u={};l(u,c,n),r=e.height(),t.selectAll("div").data([0,0]).enter().append("div").attr("class",function(t,e){return"iobio-box-"+e+" iobio-boxViewer"}),i=o().height(r*s).xValue(e.xValue()).yValue(e.yValue()).wValue(e.wValue()).xAxis(e.xAxis()).yAxis(e.yAxis()).whiskersValue(e.whiskersValue()).quartilesValue(e.quartilesValue()).boxWidthRatio(e.boxWidthRatio()).sort(e.sort()).compress(e.compress()).compressFunc(e.compressFunc()).compression(e.compression()).compressionNumberLabel(e.compressionNumberLabel()).outerPadding(e.outerPadding()).padding(e.padding()).whiskerType(e.whiskerType())["class"](e["class"]()).margin(e.margin()).width(e.width()).preserveAspectRatio(e.preserveAspectRatio()).y(e.y()).x(e.x()).id(e.id()).keyValue(e.keyValue()).color(e.color()).tooltip(e.tooltip()).transitionDuration(e.transitionDuration());var d=t.select(".iobio-box-0").datum(t.datum());i(d,u),a=o().xValue(e.xValue()).yValue(e.yValue()).wValue(e.wValue()).xAxis(e.xAxis()).yAxis(null).whiskersValue(e.whiskersValue()).quartilesValue(e.quartilesValue()).boxWidthRatio(e.boxWidthRatio()).sort(e.sort()).compress(e.compress()).compressFunc(e.compressFunc()).compression(e.compression()).compressionNumberLabel(e.compressionNumberLabel()).outerPadding(e.outerPadding()).padding(e.padding()).whiskerType(e.whiskerType())["class"](e["class"]()).margin(e.margin()).width(e.width()).preserveAspectRatio(e.preserveAspectRatio()).transitionDuration(e.transitionDuration()).id(e.id()).keyValue(e.keyValue()).color(e.color()).tooltip(e.tooltip()).height(r*(1-s)).brush("brush",function(){var t=a.x(),e=a.brush(),n=e.empty()?t.domain():e.extent(),r=f.datum().filter(function(t,e){return a.xValue()(t,e)>=n[0]&&a.xValue()(t,e)<=n[1]});u.xMin=n[0],u.xMax=n[1],u.globalbox=a,u.sort=!1,i(d.datum(r),u)});var f=t.select(".iobio-box-1").datum(t.datum());a(f,u)}var n,r,i,a,o=t("./box.js"),l=(t("../utils.js"),t("extend")),u=[],s=.8,c={},d=o();return d.rebind(e),e.sizeRatio=function(t){return arguments.length?(s=t,e):s},e.on=function(t,n){return arguments.length?(u.push({event:t,listener:n}),e):u},e.tooltip=function(t){return arguments.length?(n=t,e):n},e.focalbox=function(t){return arguments.length?(i=t,e):i},e.globalbox=function(t){return arguments.length?(a=t,e):a},e};e.exports=r},{"../utils.js":10,"./box.js":16,extend:1}],18:[function(t,e,n){var r=function(){function e(t,i){var u={};extend(u,c,i),a=e.height(),t.selectAll("div").data([0,0]).enter().append("div").attr("class",function(t,e){return"iobio-box-"+e+" iobio-boxViewer"}),o=n().height(a*s).xValue(e.xValue()).yValue(e.yValue()).wValue(e.wValue()).xAxis(e.xAxis()).yAxis(e.yAxis()).whiskersValue(e.whiskersValue()).quartilesValue(e.quartilesValue()).boxWidthRatio(e.boxWidthRatio()).sort(e.sort()).compress(e.compress()).compressFunc(e.compressFunc()).compression(e.compression()).compressionNumberLabel(e.compressionNumberLabel()).outerPadding(e.outerPadding()).padding(e.padding()).whiskerType(e.whiskerType())["class"](e["class"]()).margin(e.margin()).width(e.width()).preserveAspectRatio(e.preserveAspectRatio()).y(e.y()).x(e.x()).id(e.id()).keyValue(e.keyValue()).color(e.color()).tooltip(e.tooltip()).transitionDuration(e.transitionDuration());var d=t.select(".iobio-box-0").datum(t.datum());o(d,u),l=r.xValue(e.xValue()).yValue(e.yValue()).wValue(e.wValue()).xAxis(e.xAxis()).yAxis(null).margin(e.margin()).width(e.width()).preserveAspectRatio(e.preserveAspectRatio()).transitionDuration(e.transitionDuration()).id(e.id()).keyValue(e.keyValue()).height(a*(1-s)).brush("brush",function(){var t=l.x(),e=l.brush(),n=e.empty()?t.domain():e.extent(),r=f.datum().filter(function(t,e){return l.xValue()(t,e)>=n[0]&&l.xValue()(t,e)<=n[1]});u.xMin=n[0],u.xMax=n[1],u.globalbox=l,u.sort=!1,o(d.datum(r),u)});var f=t.select(".iobio-box-1").datum(t.datum());l(f,u),setTimeout(function(){var t='<?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">',e=d3.select(".iobio-box-0 svg g.iobio-glyphs").node();utils.addStylesToSvg(e);var n=(new XMLSerializer).serializeToString(e),r='<svg xmlns="http://www.w3.org/2000/svg" width="960" height="400">'+n+"</svg>",i=new Blob([t+r],{type:"image/svg+xml;charset=utf-8"}),a=window.URL.createObjectURL(i),o=l.height()-l.margin().top-l.margin().bottom,u=l.width(),s=d3.select(".iobio-box-1 .iobio-glyphs").append("foreignObject").attr("width",u).attr("height",o).append("xhtml:img").attr("width",u).attr("height",o).node();s.src=a},e.transitionDuration())}var n=t("./box.js"),r=t("./base.js")();utils=t("../utils.js"),extend=t("extend");var i,a,o,l,u=[],s=.8,c={},d=n();return d.rebind(e),e.sizeRatio=function(t){return arguments.length?(s=t,e):s},e.on=function(t,n){return arguments.length?(u.push({event:t,listener:n}),e):u},e.tooltip=function(t){return arguments.length?(i=t,e):i},e.focalbox=function(t){return arguments.length?(o=t,e):o},e.globalbox=function(t){return arguments.length?(l=t,e):l},e};e.exports=r},{"../utils.js":10,"./base.js":15,"./box.js":16,extend:1}],19:[function(t,e,n){var r=function(){function e(t,e){var b={};l(b,v,e),d=d||s/2,p=p||s/2,f=f||s,a.call(this,t,b);var y=a.x(),m=a.y(),w=a.id(),V=(a.xValue(),a.yValue(),a.wValue(),a.color()),A=a.transitionDuration(),j=t.select("g.iobio-container").classed("iobio-gene",!0);j.select(".iobio-axis").attr("transform","translate(0,-25)");var k=j.selectAll(".transcript").data(t.datum());if(k.exit().remove(),k.enter().append("g").attr("class","transcript").attr("id",w).attr("transform",function(t,e){return"translate(0,0)"}),k.selectAll(".reference").data(function(t){return[[h(t),g(t)]]}).enter().append("line").attr("class","reference").attr("x1",function(t){
return y(t[0])}).attr("x2",function(t){return y(t[1])}).attr("y1",s/2).attr("y2",s/2),k.selectAll(".name").data(function(t){return[[h(t),x(t)]]}).enter().append("text").attr("class","name").attr("x",function(t){return y(t[0])-5}).attr("y",s/2).attr("text-anchor","end").attr("alignment-baseline","middle").text(function(t){return t[1]}).style("fill-opacity",0),k.selectAll(".arrow").data(n).enter().append("path").attr("class","arrow").attr("d",r),k.selectAll(".feature").data(function(t){return t.features.filter(function(t){var e=t.feature_type.toLowerCase();return"utr"==e||"cds"==e})}).enter().append("g").attr("class",function(t){return t.feature_type.toLowerCase()+" feature"}).style("fill",V).append("rect").attr("rx",c).attr("ry",c).attr("x",function(t){return y(t.start)}).attr("width",function(t){return y(t.end)-y(t.start)}).attr("y",s/2).attr("height",0),k.transition().duration(A).attr("transform",function(t,e){return"translate(0,"+m(e)+")"}),k.selectAll(".reference").transition().duration(A).attr("x1",function(t){return y(t[0])}).attr("x2",function(t){return y(t[1])}),k.selectAll(".arrow").transition().duration(A).attr("d",r),k.selectAll(".name").transition().duration(A).attr("x",function(t){return y(t[0])-5}).attr("y",s/2).text(function(t){return t[1]}).style("fill-opacity",1),k.selectAll(".feature").style("fill",V).selectAll("rect").sort(function(t,e){return parseInt(t.start)-parseInt(e.start)}).transition().duration(A).attr("x",function(t){return y(t.start)}).attr("width",function(t){return y(t.end)-y(t.start)}).attr("y",function(t){return"utr"==t.feature_type.toLowerCase()?(s-d)/2:(s-f)/2}).attr("height",function(t){return"utr"==t.feature_type.toLowerCase()?d:f}),i){var M=d3.select(".iobio-tooltip");o.tooltipHelper(k.selectAll(".utr,.cds"),M,i)}u.forEach(function(t){j.selectAll(".transcript").on(t.event,t.listener)})}function n(t){for(var e=0,n=0,r=t.features.filter(function(t){var e=t.feature_type.toLowerCase();return"utr"==e||"cds"==e}).sort(function(t,e){return parseInt(t.start)-parseInt(e.start)}),i=0;i<r.length-1;i++){var a=parseInt(r[i+1].start)-parseInt(r[i].end);e<a&&(e=a,n=parseInt(r[i].end)+e/2)}return t.center=n,[t]}function r(t){var n=e.x(),r=parseInt(t.strand+"5"),i="M ";return i+=n(t.center)+" "+(s-p)/2,i+=" L "+parseInt(n(t.center)+r)+" "+s/2,i+=" L "+n(t.center)+" "+parseInt(s+p)/2}var i,a=t("./base.js")(),o=t("../utils.js"),l=t("extend"),u=[],s=20,c=1,d=void 0,f=void 0,p=void 0,h=function(t){return t.start},g=function(t){return t.end},x=function(t){return t.transcript_id},v={};return a.yAxis(null).xValue(function(t){return h(t)}).yValue(function(t,e){return e}).wValue(function(t){return g(t)-h(t)}),a.rebind(e),e.trackHeight=function(t){return arguments.length?(s=t,e):s},e.utrHeight=function(t){return arguments.length?(d=t,e):d},e.cdsHeight=function(t){return arguments.length?(f=t,e):f},e.arrowHeight=function(t){return arguments.length?(p=t,e):p},e.start=function(t){return arguments.length?(h=t,e):h},e.end=function(t){return arguments.length?(g=t,e):g},e.title=function(t){return arguments.length?(x=t,e):x},e.on=function(t,n){return arguments.length?(u.push({event:t,listener:n}),e):u},e.tooltip=function(t){return arguments.length?(i=t,e):i},e};e.exports=r},{"../utils.js":10,"./base.js":15,extend:1}],20:[function(t,e,n){var r=function(e){function n(t,e){t.each(function(){var t=d3.select(this),n={};i(n,a,e),n.datumTransform&&t.datum(n.datumTransform(t.datum())),r.call(this,t,n);var o=r.x(),l=r.y(),u=(r.id(),r.xValue()),s=r.yValue(),c=(r.wValue(),r.transitionDuration());color=r.color();var d=d3.svg.line().interpolate("linear").x(function(t,e){return+o(u(t,e))}).y(function(t,e){return+l(s(t,e))}),f=t.select("g.iobio-container").classed("iobio-line",!0),p=f.selectAll(".line").data([0]).enter().append("path").attr("class","line").attr("d",d(t.datum())).style("stroke",color).style("stroke-width","2").style("fill","none"),h=f.select("path.line"),g=h.node().getTotalLength();p.attr("stroke-dasharray",g+" "+g).attr("stroke-dashoffset",g),h.transition().duration(c).attr("d",d(t.datum())).ease("linear").attr("stroke-dashoffset",0),setTimeout(function(){h.attr("stroke-dasharray",null)},c)})}var r=t("./base.js")(),i=(t("../utils.js"),t("extend")),a={};return r.rebind(n),n};e.exports=r},{"../utils.js":10,"./base.js":15,extend:1}],21:[function(t,e,n){var r=function(){function e(t,r){e.selection=t;var p={};i(p,f,r);s=p.selected||"all";var h,g=e.xValue(),x=e.margin(),v=e.width(),b=e.height(),y=e.x(),m=e.transitionDuration(),w=iobio.viz.layout.pointSmooth().size(v).pos(function(t,e){return(t.globalPos||0)+g(t,e)}).epsilonRate(d),V=0,A=[];if(t.datum().forEach(function(t,n){if("all"==s){t.globalPos=V;var r=o(t,n);V+=e.xValue()(r[r.length-1],n),r.forEach(function(e){e.globalPos=t.globalPos}),A=A.concat(r)}else t.globalPos=0,s==a(t,n)&&(A=o(t,n))}),t.select(".iobio-multi-line.line-panel").node()||t.append("div").attr("class","iobio-multi-line line-panel").style("height",parseInt(b)+"px"),p.noLine&&"all"==s){var j=A[A.length-1].globalPos+g(A[A.length-1]);y.range([0,v-x.left-x.right]).domain([0,j])}else"all"==s?(n.yAxis(null).xAxis(null).call(this,t.select(".line-panel").datum(w(A)),p),t.select(".iobio-brush").selectAll("*").remove(),t.select(".iobio-axis.iobio-x").selectAll("*").remove()):(e.selectedGlobalpos=h,A.forEach(function(t){t.globalPos=0}),A.length>0&&(y.domain([A[0].pos,A.slice(-1)[0].pos]),n.yAxis(null).xAxis(l.scale(y)).call(this,t.select(".line-panel").datum(w(A)),p)));t.selectAll(".iobio-multi-line.button-panel").data([0]).enter().append("div").attr("class","iobio-multi-line button-panel").style("width",v-x.left-x.right).append("svg").style("width","100%");var k=t.select(".button-panel svg").selectAll(".button").data(t.datum(),function(t,e){return a(t,e)});k.exit().style("display","none");var M=k.enter().append("g").attr("class","button").attr("transform",function(t){return"translate("+y(t.globalPos)+")"}).attr("id",function(t,e){return"iobio-button-"+a(t,e)});M.append("rect").attr("width",function(t,e){var n=o(t,e),r=parseInt(g(n[n.length-1],e))+parseInt(t.globalPos),i=y(r)-y(parseInt(t.globalPos));return i+"px"}).attr("height","20px").style("fill",c).append("title").text(a),M.append("text").attr("y",10).attr("x",function(t,e){var n=o(t,e),r=parseInt(g(n[n.length-1],e))+parseInt(t.globalPos),i=(y(r)-y(parseInt(t.globalPos)))/2;return i+"px"}).attr("alignment-baseline","middle").attr("text-anchor","middle"),k.transition().duration(m).style("display",function(t,e){return"all"==s||s==a(t,e)?"block":"none"}).attr("transform",function(t,e){return"translate("+y(t.globalPos)+")"}),k.select("rect").transition().duration(m).attr("width",function(t,e){var n=o(t,e),r=parseInt(g(n[n.length-1],e))+parseInt(t.globalPos),i=y(r)-y(parseInt(t.globalPos));return i+"px"}),k.select("text").transition().duration(m).attr("x",function(t,e){var n=o(t,e),r=parseInt(g(n[n.length-1],e))+parseInt(t.globalPos),i=(y(r)-y(parseInt(t.globalPos)))/2;return i+"px"}).text(function(t,e){var n=o(t,e),r=parseInt(g(n[n.length-1],e))+parseInt(t.globalPos),i=y(r)-y(parseInt(t.globalPos)),l=a(t,e);this.textContent=l;var u=this.getComputedTextLength();if(u<=i)return l});var _;u.forEach(function(t){"click"==t.event?_=t.listener:k.on(t.event,t.listener)}),k.on("click",function(n,r){n.globalPos,n.globalPos+g(n.data[n.data.length-1],r);e(t,{selected:a(n,r)}),_&&_.call(this,n)}),"all"!=s&&t.select(".line-panel .iobio-container").append("text").attr("id","iobio-button-all").attr("x",x.left+5).attr("y",0).text("< All").on("click",function(){this.remove(),e(t),_&&_.call(this)})}var n=t("./line.js")(),r=t("../utils.js"),i=t("extend"),a=function(t){return t[0]},o=function(t){return t[1]},l=d3.svg.axis().orient("bottom").tickFormat(r.format_unit_names).ticks(5),u=[],s="all",c=d3.scale.category20(),d=.1,f={};return n.rebind(e),e.dataValue=function(t){return arguments.length?(o=t,e):o},e.color=function(t){return arguments.length?(c=t,e):c},e.epsilonRate=function(t){return arguments.length?(d=t,e):d},e.nameValue=function(t){return arguments.length?(a=t,e):a},e.getSelected=function(t){return s},e.setSelected=function(t){return e(this.selection,{selected:t}),e},e.lineChart=function(t){return arguments.length?(n=t,e):n},e.trigger=function(t,e){this.selection.select("#iobio-button-"+e).each(function(n,r){var i=n.find(function(t){return a(t)==e}),o=d3.select(this).on(t);o&&o.apply(this,[i,r])})},e.on=function(t,n){return arguments.length?(u.push({event:t,listener:n}),e):u},e};e.exports=r},{"../utils.js":10,"./line.js":20,extend:1}],22:[function(t,e,n){var r=function(){function e(t,a){var h={};c(h,b,a),o=d3.svg.arc().outerRadius(f).innerRadius(p),u.xAxis(null).yAxis(null),u.call(this,t,h);var y=u.color(),m=u.id(),w=u.transitionDuration();d=0,t.datum().forEach(function(t){d+=t.data});var V=u.getBoundingClientRect(),A=t.select("g.iobio-container").classed("iobio-pie",!0).attr("transform","translate("+V.width/2+","+V.height/2+")"),j=A.selectAll(".arc").data(t.datum()),k=j.enter().append("g").attr("id",m).attr("class","arc").style("fill",y);if(k.append("path").attr("d",function(t,e){return o(w&&w>0?{data:t.data,value:0,startAngle:0,endAngle:0,padAngle:0}:t)}).each(function(t){this._current={data:t.data,value:0,startAngle:0,endAngle:0,padAngle:0}}),k.append("text").attr("transform",function(t){return"translate("+i(t,.5)+")"}).attr("text-anchor","middle").attr("alignment-baseline","middle"),void 0!=w&&w>=0&&(j.style("fill",y).select("path").transition().duration(w).attrTween("d",n).call(s.endAll,function(){var t=g.find(function(t){return"end"==t.event});t&&t.listener.call(e)}),j.select("text").transition().duration(w).attr("transform",function(t){var e=r(t,.55)*(180/Math.PI)-180;return"translate("+i(t,.55)+") rotate("+e+")"}).text(function(t,n){if(x){var r=.55*(e.innerRadius()+e.radius()),i=o.startAngle.call(t)(t),a=o.endAngle.call(t)(t),l=a-i,u=Math.sin(l/2)*r*2,s=parseInt(d3.select(this).style("font-size"));return s<=u?x(t,n):void 0}})),j.exit().remove(),A.selectAll(".iobio-center-text").data([0]).enter().append("foreignObject").attr("x",-p).attr("y",-p/2).attr("width",2*p).attr("height",p).attr("class","iobio-center-text"),A.selectAll(".iobio-center-text").html(v(t.datum(),d)),l){var M=d3.select(".iobio-tooltip");s.tooltipHelper(A.selectAll(".arc"),M,l)}g.forEach(function(t){j.on(t.event,t.listener)})}function n(t){var e=d3.interpolate(this._current,t);return this._current=e(0),function(t){return o(e(t))}}function r(t,n){var r=((e.innerRadius()+e.radius())*n,o.startAngle.call(t)),i=o.endAngle.call(t);return a=(r(t)+i(t))/2-Math.PI/2,a}function i(t,n){var i=(e.innerRadius()+e.radius())*n,a=r(t,n);return[Math.cos(a)*i,Math.sin(a)*i]}var o,l,u=t("./base.js")(),s=t("../utils.js"),c=t("extend"),d=0,f=90,p=0,h=0,g=[],x="",v=function(t,e){var n=t[0].data,r=s.format_percent(n/e);return"<div class='iobio-percent'>"+r+"%</div><div class='iobio-count'>"+n+"</div>"},b={};return u.rebind(e),e.padding=function(t){return arguments.length?(h=t,e):h},e.radius=function(t){return arguments.length?(f=t,e):f},e.innerRadius=function(t){return arguments.length?(p=t,e):p},e.nameValue=function(t){return arguments.length?(x=t,e):x},e.text=function(t){return arguments.length?v=t:v},e.on=function(t,n){return arguments.length?(g.push({event:t,listener:n}),e):g},e.tooltip=function(t){return arguments.length?(l=t,e):l},e};e.exports=r},{"../utils.js":10,"./base.js":15,extend:1}],23:[function(t,e,n){var r=function(){function e(t,a){o={},d(o,h,a),x=t,r=d3.svg.arc().innerRadius(e.innerRadius()).outerRadius(e.radius()),f.forEach(function(t){p[t.event]=t.listener}),s.nameValue(g).radius(e.radius()).innerRadius(e.innerRadius()).padding(e.padding()).transitionDuration(0).color(e.color()).text(function(t,e){return""});var l=p.end;l&&s.on("end",function(){l.call(e)}),s(t,o),m=t.selectAll(".arc"),m.on("mouseover",function(t,r){d3.select(this).attr("cursor","pointer"),e._selectSlice.call(this,t,r,null,!0),d3.select(this).select("path").style("stroke","darkturquoise").style("stroke-width","2").style("opacity",1),n&&c.showTooltip(d3.select(".iobio-tooltip"),n,t);var i=p.mouseover;i&&i.call(e,t,r)}).on("mouseout",function(t){d3.select(this).attr("cursor","default"),0==b.length&&this!=v&&d3.select(this).select("path").transition().duration(150).attr("transform","translate(0,0)"),d3.select(this).select("path").style("stroke-width","0"),n&&c.hideTooltip(d3.select(".iobio-tooltip"));var r=p.mouseout;r&&r.call(e,t,i)}).on("click",function(t,n){e._clickSlice(this,t,n,!0);var r=p.click;r&&r.call(e,t,n)});var u=t.select(".iobio-pie");u.append("circle").attr("id","all-circle").attr("cx",0).attr("cy",0).attr("r",25).attr("stroke","lightgrey").attr("fill","transparent").on("mouseover",function(t){d3.select(this).attr("cursor","pointer")}).on("mouseout",function(t){d3.select(this).attr("cursor","default")}).on("click",function(t){d3.select(this).classed("selected",!0),e._clickAllSlices(t);var n=p.clickall;n&&n.call(e,t)}),u.append("text").attr("id","all-text").attr("dy",".35em").style("text-anchor","middle").style("pointer-events","none").attr("class","inside").text(function(t){return"All"})}var n,r,o,l,u=t("./base.js")(),s=t("./pie.js")(),c=t("../utils.js"),d=t("extend"),f=[],p={},h={},g=function(t){return t.data.name},x=null,v=null,b=[],y=null,m=null;return u.rebind(e),e.on=function(t,n){return arguments.length?(f.push({event:t,listener:n}),e):f},e.tooltip=function(t){return arguments.length?(n=t,e):n},e.name=function(t){return arguments.length?g=t:g},e.text=function(t){return arguments.length?l=t:l},e.padding=function(t){return arguments.length?(padding=t,e):padding},e.radius=function(t){return arguments.length?(radius=t,e):radius},e.innerRadius=function(t){return arguments.length?(innerRadius=t,e):innerRadius},e._clickSlice=function(t,n,r,i){if(i&&x.select("circle#all-circle.selected").classed("selected",!1),i)if(b.length>0){for(var r=0;r<b.length;r++)e._unclickSlice(b[r]);b.length=0}else v&&e._unclickSlice(v);d3.select(t).selectAll("text").attr("class","chartlabelSelected");var a=n.startAngle+(n.endAngle-n.startAngle)/2;a=(a-Math.PI/2)*-1;var o=Math.cos(a)*radius*.1,l=Math.sin(a)*radius*-.1;d3.select(t).select("path").attr("transform","rotate(0)").transition().duration(200).attr("transform","translate("+o+","+l+")"),i?v=t:b.push(t)},e._unclickSlice=function(t){d3.select(t).select("path").transition().duration(150).attr("transform","translate(0,0)"),d3.select(t).selectAll("text").attr("class","chartlabel");e._arcLabelPosition(t.__data__,.55);return e},e._selectSlice=function(t,n,i,a){var l=this;if(i?(l=i,y=i):a&&y&&(d3.select(y).select("path").transition().duration(150).attr("transform","translate(0,0)"),y=null),o.showTooltip){_tooltip().transition().duration(200).style("opacity",.9);var u=r.centroid(t),s=l.getScreenCTM().translate(+l.getAttribute("cx"),+l.getAttribute("cy"));_tooltip().html(g(t.data)).style("visibility","visible").style("left",s.e+u[0]+"px").style("top",s.f+u[1]-18+"px")}if(l!=v){var c=t.startAngle+(t.endAngle-t.startAngle)/2;c=(c-Math.PI/2)*-1;var d=Math.cos(c)*radius*.1,f=Math.sin(c)*radius*-.1;d3.select(l).select("path").attr("transform","rotate(0)").transition().duration(200).attr("transform","translate("+d+","+f+")")}return e},e._arcLabelPosition=function(t,n){var i=(e.innerRadius()+e.radius())*n,o=r.startAngle.call(t),l=r.endAngle.call(t);return a=(o(t)+l(t))/2-Math.PI/2,[Math.cos(a)*i,Math.sin(a)*i]},e._clickAllSlices=function(t){x.select("circle#all-circle").classed("selected",!0),b.length=0;for(var n=0;n<t.length;n++){var r=m.selectAll("d.arc")[n].parentNode;e._clickSlice(r,r.__data__,n,!1)}return e},e.clickSlice=function(t){var n=m.selectAll("d.arc")[t].parentNode;return e._clickSlice(n,n.__data__,t,!0),e._selectSlice(n.__data__,t,n),v=n,e},e.clickAllSlices=function(t){e._clickAllSlices(t);var n=p.clickall;if(n){var r=x.select("circle#all-circle.selected");n.call(e,r)}return e},e};e.exports=r},{"../utils.js":10,"./base.js":15,"./pie.js":22,extend:1}],24:[function(t,e,n){var r=function(){function e(t,e){var c={};a(c,s,e),r.call(this,t,c);var d=r.y(),f=r.x(),p=r.id(),h=r.xValue(),g=r.yValue(),x=r.wValue(),v=r.keyValue(),b=r.color(),y=r.transitionDuration(),m=r.height()-r.margin().top-r.margin().bottom;if(m<0)return console.log("Negative inner height "+m+" calculated for scatter chart. Change height or margins."),void console.trace();var w=t.select("g.iobio-container").classed("iobio-scatter",!0),V=w.selectAll(".dot").data(t.datum(),v);if(V.exit().remove(),"circle"==u?(V.enter().append("g").attr("id",p).style("fill",b).append("circle").attr("cy",function(t,e){return d(g(t,e))}).attr("cx",function(t,e){return f(h(t,e))}).attr("r",function(t,e){return 0}),V.attr("class",function(t,e){return"dot "+i.value_accessor(l,t,e)}).style("fill",b).select("circle").transition().duration(y).attr("cx",function(t,e){return f(h(t,e))}).attr("cy",function(t,e){return d(g(t,e))}).attr("r",function(t,e){return(f(h(t,e)+x(t,e))-f(h(t,e)))/2})):"x"==u&&(V.enter().append("g").attr("id",p).attr("class","dot").style("fill",b).style("font-size","0.1").append("text").attr("x",function(t,e){return f(h(t,e))}).attr("y",function(t,e){return d(g(t,e))}).attr("text-anchor","middle").attr("alignment-baseline","middle").text("x"),V.attr("class",function(t,e){return"dot "+i.value_accessor(l,t,e)}).transition().duration(y).style("fill",b).style("font-size",function(t,e){return f(h(t,e)+x(t,e))-f(h(t,e))}).select("text").attr("x",function(t,e){return f(h(t,e))}).attr("y",function(t,e){return d(g(t,e))}).text("x")),n){var A=d3.select(".iobio-tooltip");i.tooltipHelper(w.selectAll(".dot"),A,n)}o.forEach(function(t){V.on(t.event,t.listener)})}var n,r=t("./base.js")(),i=t("../utils.js"),a=t("extend"),o=[],l="",u="x",s={yMin:0};return r.rebind(e),e.on=function(t,n){return arguments.length?(o.push({event:t,listener:n}),e):o},e.tooltip=function(t){return arguments.length?(n=t,e):n},e["class"]=function(t){return arguments.length?(l=t,e):l},e.symbol=function(t){return arguments.length?(u=t,e):u},e.rebind=function(t){r.rebind(t),i.rebind(t,this,"rebind","class","symbol")},e};e.exports=r},{"../utils.js":10,"./base.js":15,extend:1}],25:[function(t,e,n){var r=function(){function e(t,n){var o={};a(o,u,n),r=e.height(),t.selectAll("div").data([0,0]).enter().append("div").attr("class",function(t,e){return"iobio-scatter-"+e+" iobio-scatterViewer"});var s=i().height(r*l).xValue(e.xValue()).yValue(e.yValue()).wValue(e.wValue()).xAxis(e.xAxis()).yAxis(e.yAxis()).symbol(e.symbol())["class"](e["class"]()).margin(e.margin()).width(e.width()).y(e.y()).x(e.x()).id(e.id()).color(e.color()).tooltip(e.tooltip()).transitionDuration(e.transitionDuration()),c=t.select(".iobio-scatter-0").datum(t.datum());s(c,o);var d=i().xValue(e.xValue()).yValue(e.yValue()).wValue(e.wValue()).xAxis(e.xAxis()).yAxis(null).symbol(e.symbol())["class"](e["class"]()).margin(e.margin()).width(e.width()).transitionDuration(e.transitionDuration()).id(e.id()).color(e.color()).tooltip(e.tooltip()).height(r*(1-l)).brush("brush",function(){var t=d.x(),e=d.brush(),n=e.empty()?t.domain():e.extent(),r=f.datum().filter(function(t,e){return d.xValue()(t,e)>=n[0]&&d.xValue()(t,e)<=n[1]});o.xMin=n[0],o.xMax=n[1],o.globalscatter=d,s(c.datum(r),o)}),f=t.select(".iobio-scatter-1").datum(t.datum());d(f,o)}var n,r,i=t("./scatter.js"),a=(t("../utils.js"),t("extend")),o=[],l=.8,u={},s=i();return s.rebind(e),e.sizeRatio=function(t){return arguments.length?(l=t,e):l},e.on=function(t,n){return arguments.length?(o.push({event:t,listener:n}),e):o},e.tooltip=function(t){return arguments.length?(n=t,e):n},e};e.exports=r},{"../utils.js":10,"./scatter.js":24,extend:1}],26:[function(t,e,n){var r={};r.base=t("./base.js"),r.pie=t("./pie.js"),r.pieChooser=t("./pieChooser.js"),r.alignment=t("./alignment.js"),r.line=t("./line.js"),r.bar=t("./bar.js"),r.barViewer=t("./barViewer.js"),r.gene=t("./gene.js"),r.multiLine=t("./multiLine.js"),r.box=t("./box.js"),r.boxViewer=t("./boxViewer.js"),r.boxViewer2=t("./boxViewer2.js"),r.scatter=t("./scatter.js"),r.scatterViewer=t("./scatterViewer.js"),e.exports=r},{"./alignment.js":12,"./bar.js":13,"./barViewer.js":14,"./base.js":15,"./box.js":16,"./boxViewer.js":17,"./boxViewer2.js":18,"./gene.js":19,"./line.js":20,"./multiLine.js":21,"./pie.js":22,"./pieChooser.js":23,"./scatter.js":24,"./scatterViewer.js":25}]},{},[11]);