]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/static/js/nv.d3.min.js
Use latest and greatest NVD3.
[xonotic/xonstat.git] / xonstat / static / js / nv.d3.min.js
1 /* nvd3 version 1.6.0 (https://github.com/liquidpele/nvd3) 2014-11-23 */
2 !function(){var a=window.nv||{};window.nv=a,a.dev=!0,a.tooltip=a.tooltip||{},a.utils=a.utils||{},a.models=a.models||{},a.charts={},a.graphs=[],a.logs={},a.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),a.dev&&(a.dispatch.on("render_start",function(){a.logs.startTime=+new Date}),a.dispatch.on("render_end",function(){a.logs.endTime=+new Date,a.logs.totalTime=a.logs.endTime-a.logs.startTime,a.log("total",a.logs.totalTime)})),a.log=function(){if(a.dev&&window.console&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(a.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind){var b=Function.prototype.bind.call(console.log,console);b.apply(console,arguments)}return arguments[arguments.length-1]},a.deprecated=function(b){a.dev&&console&&console.warn&&console.warn("`"+b+"` has been deprecated.")},a.render=function(b){b=b||1,a.render.active=!0,a.dispatch.render_start(),setTimeout(function(){for(var c,d,e=0;b>e&&(d=a.render.queue[e]);e++)c=d.generate(),typeof d.callback==typeof Function&&d.callback(c),a.graphs.push(c);a.render.queue.splice(0,e),a.render.queue.length?setTimeout(arguments.callee,0):(a.dispatch.render_end(),a.render.active=!1)},0)},a.render.active=!1,a.render.queue=[],a.addGraph=function(b){typeof arguments[0]==typeof Function&&(b={generate:arguments[0],callback:arguments[1]}),a.render.queue.push(b),a.render.active||a.render()},a.interactiveGuideline=function(){"use strict";function b(l){l.each(function(l){function m(){var a=d3.mouse(this),d=a[0],e=a[1],i=!0,j=!1;if(k&&(d=d3.event.offsetX,e=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(i=!1),d3.event.target.className.baseVal.match("nv-legend")&&(j=!0)),i&&(d-=f.left,e-=f.top),0>d||0>e||d>o||e>p||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||j){if(k&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&d3.event.relatedTarget.className.match(c.nvPointerEventsClass))return;return h.elementMouseout({mouseX:d,mouseY:e}),void b.renderGuideLine(null)}var l=g.invert(d);h.elementMousemove({mouseX:d,mouseY:e,pointXValue:l}),"dblclick"===d3.event.type&&h.elementDblclick({mouseX:d,mouseY:e,pointXValue:l}),"click"===d3.event.type&&h.elementClick({mouseX:d,mouseY:e,pointXValue:l})}var n=d3.select(this),o=d||960,p=e||400,q=n.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([l]),r=q.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer");r.append("g").attr("class","nv-interactiveGuideLine"),j&&(j.on("mousemove",m,!0).on("mouseout",m,!0).on("dblclick",m).on("click",m),b.renderGuideLine=function(b){if(i){var c=q.select(".nv-interactiveGuideLine").selectAll("line").data(null!=b?[a.utils.NaNtoZero(b)]:[],String);c.enter().append("line").attr("class","nv-guideline").attr("x1",function(a){return a}).attr("x2",function(a){return a}).attr("y1",p).attr("y2",0),c.exit().remove()}})})}var c=a.models.tooltip(),d=null,e=null,f={left:0,top:0},g=d3.scale.linear(),h=(d3.scale.linear(),d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick")),i=!0,j=null,k="ActiveXObject"in window;return b.dispatch=h,b.tooltip=c,b.margin=function(a){return arguments.length?(f.top="undefined"!=typeof a.top?a.top:f.top,f.left="undefined"!=typeof a.left?a.left:f.left,b):f},b.width=function(a){return arguments.length?(d=a,b):d},b.height=function(a){return arguments.length?(e=a,b):e},b.xScale=function(a){return arguments.length?(g=a,b):g},b.showGuideLine=function(a){return arguments.length?(i=a,b):i},b.svgContainer=function(a){return arguments.length?(j=a,b):j},b},a.interactiveBisect=function(a,b,c){"use strict";if(!(a instanceof Array))return null;"function"!=typeof c&&(c=function(a){return a.x});var d=d3.bisector(c).left,e=d3.max([0,d(a,b)-1]),f=c(a[e],e);if("undefined"==typeof f&&(f=e),f===b)return e;var g=d3.min([e+1,a.length-1]),h=c(a[g],g);return"undefined"==typeof h&&(h=g),Math.abs(h-b)>=Math.abs(f-b)?e:g},a.nearestValueIndex=function(a,b,c){"use strict";var d=1/0,e=null;return a.forEach(function(a,f){var g=Math.abs(b-a);d>=g&&c>g&&(d=g,e=f)}),e},function(){"use strict";window.nv.tooltip={},window.nv.models.tooltip=function(){function b(){if(l){var a=d3.select(l);"svg"!==a.node().tagName&&(a=a.select("svg"));var b=a.node()?a.attr("viewBox"):null;if(b){b=b.split(" ");var c=parseInt(a.style("width"))/b[2];n.left=n.left*c,n.top=n.top*c}}}function c(a){var b;b=d3.select(l?l:"body");var c=b.select(".nvtooltip");return null===c.node()&&(c=b.append("div").attr("class","nvtooltip "+(k?k:"xy-tooltip")).attr("id",p)),c.node().innerHTML=a,c.style("top",0).style("left",0).style("opacity",0),c.selectAll("div, table, td, tr").classed(q,!0),c.classed(q,!0),c.node()}function d(){if(o&&u(f)){b();var e=n.left,k=null!=j?j:n.top,p=c(t(f));if(m=p,l){var q=l.getElementsByTagName("svg")[0],r=(q?q.getBoundingClientRect():l.getBoundingClientRect(),{left:0,top:0});if(q){var s=q.getBoundingClientRect(),v=l.getBoundingClientRect(),w=s.top;if(0>w){var x=l.getBoundingClientRect();w=Math.abs(w)>x.height?0:w}r.top=Math.abs(w-v.top),r.left=Math.abs(s.left-v.left)}e+=l.offsetLeft+r.left-2*l.scrollLeft,k+=l.offsetTop+r.top-2*l.scrollTop}return i&&i>0&&(k=Math.floor(k/i)*i),a.tooltip.calcTooltipPosition([e,k],g,h,p),d}}var e=null,f=null,g="w",h=50,i=25,j=null,k=null,l=null,m=null,n={left:null,top:null},o=!0,p="nvtooltip-"+Math.floor(1e5*Math.random()),q="nv-pointer-events-none",r=function(a){return a},s=function(a){return a},t=function(a){if(null!=e)return e;if(null==a)return"";var b=d3.select(document.createElement("table")),c=b.selectAll("thead").data([a]).enter().append("thead");c.append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(s(a.value));var d=b.selectAll("tbody").data([a]).enter().append("tbody"),f=d.selectAll("tr").data(function(a){return a.series}).enter().append("tr").classed("highlight",function(a){return a.highlight});f.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(a){return a.color}),f.append("td").classed("key",!0).html(function(a){return a.key}),f.append("td").classed("value",!0).html(function(a,b){return r(a.value,b)}),f.selectAll("td").each(function(a){if(a.highlight){var b=d3.scale.linear().domain([0,1]).range(["#fff",a.color]),c=.6;d3.select(this).style("border-bottom-color",b(c)).style("border-top-color",b(c))}});var g=b.node().outerHTML;return void 0!==a.footer&&(g+="<div class='footer'>"+a.footer+"</div>"),g},u=function(a){return a&&a.series&&a.series.length>0?!0:!1};return d.nvPointerEventsClass=q,d.content=function(a){return arguments.length?(e=a,d):e},d.tooltipElem=function(){return m},d.contentGenerator=function(a){return arguments.length?("function"==typeof a&&(t=a),d):t},d.data=function(a){return arguments.length?(f=a,d):f},d.gravity=function(a){return arguments.length?(g=a,d):g},d.distance=function(a){return arguments.length?(h=a,d):h},d.snapDistance=function(a){return arguments.length?(i=a,d):i},d.classes=function(a){return arguments.length?(k=a,d):k},d.chartContainer=function(a){return arguments.length?(l=a,d):l},d.position=function(a){return arguments.length?(n.left="undefined"!=typeof a.left?a.left:n.left,n.top="undefined"!=typeof a.top?a.top:n.top,d):n},d.fixedTop=function(a){return arguments.length?(j=a,d):j},d.enabled=function(a){return arguments.length?(o=a,d):o},d.valueFormatter=function(a){return arguments.length?("function"==typeof a&&(r=a),d):r},d.headerFormatter=function(a){return arguments.length?("function"==typeof a&&(s=a),d):s},d.id=function(){return p},d},a.tooltip.show=function(b,c,d,e,f,g){var h=document.createElement("div");h.className="nvtooltip "+(g?g:"xy-tooltip");var i=f;(!f||f.tagName.match(/g|svg/i))&&(i=document.getElementsByTagName("body")[0]),h.style.left=0,h.style.top=0,h.style.opacity=0,"string"!=typeof c?h.appendChild(c):h.innerHTML=c,i.appendChild(h),f&&(b[0]=b[0]-f.scrollLeft,b[1]=b[1]-f.scrollTop),a.tooltip.calcTooltipPosition(b,d,e,h)},a.tooltip.findFirstNonSVGParent=function(a){for(;null!==a.tagName.match(/^g|svg$/i);)a=a.parentNode;return a},a.tooltip.findTotalOffsetTop=function(a,b){var c=b;do isNaN(a.offsetTop)||(c+=a.offsetTop);while(a=a.offsetParent);return c},a.tooltip.findTotalOffsetLeft=function(a,b){var c=b;do isNaN(a.offsetLeft)||(c+=a.offsetLeft);while(a=a.offsetParent);return c},a.tooltip.calcTooltipPosition=function(b,c,d,e){var f,g,h=parseInt(e.offsetHeight),i=parseInt(e.offsetWidth),j=a.utils.windowSize().width,k=a.utils.windowSize().height,l=window.pageYOffset,m=window.pageXOffset;k=window.innerWidth>=document.body.scrollWidth?k:k-16,j=window.innerHeight>=document.body.scrollHeight?j:j-16,c=c||"s",d=d||20;var n=function(b){return a.tooltip.findTotalOffsetTop(b,g)},o=function(b){return a.tooltip.findTotalOffsetLeft(b,f)};switch(c){case"e":f=b[0]-i-d,g=b[1]-h/2;var p=o(e),q=n(e);m>p&&(f=b[0]+d>m?b[0]+d:m-p+f),l>q&&(g=l-q+g),q+h>l+k&&(g=l+k-q+g-h);break;case"w":f=b[0]+d,g=b[1]-h/2;var p=o(e),q=n(e);p+i>j&&(f=b[0]-i-d),l>q&&(g=l+5),q+h>l+k&&(g=l+k-q+g-h);break;case"n":f=b[0]-i/2-5,g=b[1]+d;var p=o(e),q=n(e);m>p&&(f=m+5),p+i>j&&(f=f-i/2+5),q+h>l+k&&(g=l+k-q+g-h);break;case"s":f=b[0]-i/2,g=b[1]-h-d;var p=o(e),q=n(e);m>p&&(f=m+5),p+i>j&&(f=f-i/2+5),l>q&&(g=l);break;case"none":f=b[0],g=b[1]-d;var p=o(e),q=n(e)}return e.style.left=f+"px",e.style.top=g+"px",e.style.opacity=1,e.style.position="absolute",e},a.tooltip.cleanup=function(){for(var a=document.getElementsByClassName("nvtooltip"),b=[];a.length;)b.push(a[0]),a[0].style.transitionDelay="0 !important",a[0].style.opacity=0,a[0].className="nvtooltip-pending-removal";setTimeout(function(){for(;b.length;){var a=b.pop();a.parentNode.removeChild(a)}},500)}}(),a.utils.windowSize=function(){var a={width:640,height:480};return document.body&&document.body.offsetWidth&&(a.width=document.body.offsetWidth,a.height=document.body.offsetHeight),"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth&&(a.width=document.documentElement.offsetWidth,a.height=document.documentElement.offsetHeight),window.innerWidth&&window.innerHeight&&(a.width=window.innerWidth,a.height=window.innerHeight),a},a.utils.windowResize=function(b){return window.addEventListener?window.addEventListener("resize",b):a.log("ERROR: Failed to bind to window.resize with: ",b),{callback:b,clear:function(){window.removeEventListener("resize",b)}}},a.utils.getColor=function(b){return arguments.length&&b instanceof Array?function(a,c){return a.color||b[c%b.length]}:a.utils.defaultColor()},a.utils.defaultColor=function(){var a=d3.scale.category20().range();return function(b,c){return b.color||a[c%a.length]}},a.utils.customTheme=function(a,b,c){b=b||function(a){return a.key},c=c||d3.scale.category20().range();var d=c.length;return function(e){var f=b(e);return"function"==typeof a[f]?a[f]():void 0!==a[f]?a[f]:(d||(d=c.length),d-=1,c[d])}},a.utils.pjax=function(b,c){var d=function(d){d3.html(d,function(d){var e=d3.select(c).node();e.parentNode.replaceChild(d3.select(d).select(c).node(),e),a.utils.pjax(b,c)})};d3.selectAll(b).on("click",function(){history.pushState(this.href,this.textContent,this.href),d(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&d(d3.event.state)})},a.utils.calcApproxTextWidth=function(a){if("function"==typeof a.style&&"function"==typeof a.text){var b=parseInt(a.style("font-size").replace("px","")),c=a.text().length;return c*b*.5}return 0},a.utils.NaNtoZero=function(a){return"number"!=typeof a||isNaN(a)||null===a||1/0===a||a===-1/0?0:a},d3.selection.prototype.watchTransition=function(a){var b=[this].concat([].slice.call(arguments,1));return a.transition.apply(a,b)},a.utils.renderWatch=function(b,c){if(!(this instanceof a.utils.renderWatch))return new a.utils.renderWatch(b,c);var d=void 0!==c?c:250,e=[],f=this;this.models=function(a){return a=[].slice.call(arguments,0),a.forEach(function(a){a.__rendered=!1,function(a){a.dispatch.on("renderEnd",function(){a.__rendered=!0,f.renderEnd("model")})}(a),e.indexOf(a)<0&&e.push(a)}),this},this.reset=function(a){void 0!==a&&(d=a),e=[]},this.transition=function(a,b,c){if(b=arguments.length>1?[].slice.call(arguments,1):[],c=b.length>1?b.pop():void 0!==d?d:250,a.__rendered=!1,e.indexOf(a)<0&&e.push(a),0===c)return a.__rendered=!0,a.delay=function(){return this},a.duration=function(){return this},a;a.__rendered=0===a.length?!0:a.every(function(a){return!a.length})?!0:!1;var g=0;return a.transition().duration(c).each(function(){++g}).each("end",function(){0===--g&&(a.__rendered=!0,f.renderEnd.apply(this,b))})},this.renderEnd=function(){e.every(function(a){return a.__rendered})&&(e.forEach(function(a){a.__rendered=!1}),b.renderEnd.apply(this,arguments))}},a.utils.deepExtend=function(b){var c=arguments.length>1?[].slice.call(arguments,1):[];c.forEach(function(c){for(key in c){var d=b[key]instanceof Array,e="object"==typeof b[key],f="object"==typeof c[key];e&&!d&&f?a.utils.deepExtend(b[key],c[key]):b[key]=c[key]}})},a.utils.state=function(){if(!(this instanceof a.utils.state))return new a.utils.state;var b={},c=function(){},d=function(){return{}},e=null,f=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(a){c(a,!0)}),this.getter=function(a){return d=a,this},this.setter=function(a,b){return b||(b=function(){}),c=function(c,d){a(c),d&&b()},this},this.init=function(b){e=e||{},a.utils.deepExtend(e,b)};var g=function(){var a=d();if(JSON.stringify(a)===JSON.stringify(b))return!1;for(var c in a)void 0===b[c]&&(b[c]={}),b[c]=a[c],f=!0;return!0};this.update=function(){e&&(c(e,!1),e=null),g.call(this)&&this.dispatch.change(b)}},a.utils.optionsFunc=function(b){return a.deprecated("nv.utils.optionsFunc"),b&&d3.map(b).forEach(function(a,b){"function"==typeof this[a]&&this[a](b)}.bind(this)),this},a.utils.calcTicksX=function(b,c){var d=1,e=0;for(e;e<c.length;e+=1){var f=c[e]&&c[e].values?c[e].values.length:0;d=f>d?f:d}return a.log("Requested number of ticks: ",b),a.log("Calculated max values to be: ",d),b=b>d?b=d-1:b,b=1>b?1:b,b=Math.floor(b),a.log("Calculating tick count as: ",b),b},a.utils.calcTicksY=function(b,c){return a.utils.calcTicksX(b,c)},a.utils.initOption=function(a,b){a[b]=function(c){return arguments.length?(a._options[b]=c,a):a._options[b]}},a.utils.initOptions=function(b){var c=Object.getOwnPropertyNames(b._options);for(var d in c)a.utils.initOption(b,c[d])},a.utils.inheritOptions=function(a,b){var c=Object.getOwnPropertyNames(b._options);c.unshift(b),c.unshift(a),d3.rebind.apply(this,c)},a.utils.initSVG=function(a){a.classed({"nvd3-svg":!0})},a.models.axis=function(){"use strict";function b(f){return t.reset(),f.each(function(b){var f=d3.select(this);a.utils.initSVG(f);var q=f.selectAll("g.nv-wrap.nv-axis").data([b]),r=q.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),u=(r.append("g"),q.select("g"));null!==o?c.ticks(o):("top"==c.orient()||"bottom"==c.orient())&&c.ticks(Math.abs(g.range()[1]-g.range()[0])/100),u.watchTransition(t,"axis").call(c),s=s||c.scale();var v=c.tickFormat();null==v&&(v=s.tickFormat());var w=u.selectAll("text.nv-axislabel").data([h||null]);switch(w.exit().remove(),c.orient()){case"top":w.enter().append("text").attr("class","nv-axislabel");var x;if(x=g.range().length<2?0:2===g.range().length?g.range()[1]:g.range()[g.range().length-1]+(g.range()[1]-g.range()[0]),w.attr("text-anchor","middle").attr("y",0).attr("x",x/2),i){var y=q.selectAll("g.nv-axisMaxMin").data(g.domain());y.enter().append("g").attr("class","nv-axisMaxMin").append("text"),y.exit().remove(),y.attr("transform",function(a){return"translate("+g(a)+",0)"}).select("text").attr("dy","-0.5em").attr("y",-c.tickPadding()).attr("text-anchor","middle").text(function(a){var b=v(a);return(""+b).match("NaN")?"":b}),y.watchTransition(t,"min-max top").attr("transform",function(a,b){return"translate("+g.range()[b]+",0)"})}break;case"bottom":var z=p+36,A=30,B=u.selectAll("g").select("text");if(k%360){B.each(function(){var a=this.getBoundingClientRect().width;a>A&&(A=a)});var C=Math.abs(Math.sin(k*Math.PI/180)),z=(C?C*A:A)+30;B.attr("transform",function(){return"rotate("+k+" 0,0)"}).style("text-anchor",k%360>0?"start":"end")}w.enter().append("text").attr("class","nv-axislabel");var x;if(x=g.range().length<2?0:2===g.range().length?g.range()[1]:g.range()[g.range().length-1]+(g.range()[1]-g.range()[0]),w.attr("text-anchor","middle").attr("y",z).attr("x",x/2),i){var y=q.selectAll("g.nv-axisMaxMin").data([g.domain()[0],g.domain()[g.domain().length-1]]);y.enter().append("g").attr("class","nv-axisMaxMin").append("text"),y.exit().remove(),y.attr("transform",function(a){return"translate("+(g(a)+(n?g.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",c.tickPadding()).attr("transform",function(){return"rotate("+k+" 0,0)"}).style("text-anchor",k?k%360>0?"start":"end":"middle").text(function(a){var b=v(a);return(""+b).match("NaN")?"":b}),y.watchTransition(t,"min-max bottom").attr("transform",function(a){return"translate("+(g(a)+(n?g.rangeBand()/2:0))+",0)"})}m&&B.attr("transform",function(a,b){return"translate(0,"+(b%2==0?"0":"12")+")"});break;case"right":if(w.enter().append("text").attr("class","nv-axislabel"),w.style("text-anchor",l?"middle":"begin").attr("transform",l?"rotate(90)":"").attr("y",l?-Math.max(d.right,e)+12:-10).attr("x",l?g.range()[0]/2:c.tickPadding()),i){var y=q.selectAll("g.nv-axisMaxMin").data(g.domain());y.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),y.exit().remove(),y.attr("transform",function(a){return"translate(0,"+g(a)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",c.tickPadding()).style("text-anchor","start").text(function(a){var b=v(a);return(""+b).match("NaN")?"":b}),y.watchTransition(t,"min-max right").attr("transform",function(a,b){return"translate(0,"+g.range()[b]+")"}).select("text").style("opacity",1)}break;case"left":if(w.enter().append("text").attr("class","nv-axislabel"),w.style("text-anchor",l?"middle":"end").attr("transform",l?"rotate(-90)":"").attr("y",l?-Math.max(d.left,e)+25-(p||0):-10).attr("x",l?-g.range()[0]/2:-c.tickPadding()),i){var y=q.selectAll("g.nv-axisMaxMin").data(g.domain());y.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),y.exit().remove(),y.attr("transform",function(a){return"translate(0,"+s(a)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-c.tickPadding()).attr("text-anchor","end").text(function(a){var b=v(a);return(""+b).match("NaN")?"":b}),y.watchTransition(t,"min-max right").attr("transform",function(a,b){return"translate(0,"+g.range()[b]+")"}).select("text").style("opacity",1)}}if(w.text(function(a){return a}),!i||"left"!==c.orient()&&"right"!==c.orient()||(u.selectAll("g").each(function(a){d3.select(this).select("text").attr("opacity",1),(g(a)<g.range()[1]+10||g(a)>g.range()[0]-10)&&((a>1e-10||-1e-10>a)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),g.domain()[0]==g.domain()[1]&&0==g.domain()[0]&&q.selectAll("g.nv-axisMaxMin").style("opacity",function(a,b){return b?0:1})),i&&("top"===c.orient()||"bottom"===c.orient())){var D=[];q.selectAll("g.nv-axisMaxMin").each(function(a,b){try{D.push(b?g(a)-this.getBoundingClientRect().width-4:g(a)+this.getBoundingClientRect().width+4)}catch(c){D.push(b?g(a)-4:g(a)+4)}}),u.selectAll("g").each(function(a){(g(a)<D[0]||g(a)>D[1])&&(a>1e-10||-1e-10>a?d3.select(this).remove():d3.select(this).select("text").remove())})}j&&u.selectAll(".tick").filter(function(){return!parseFloat(Math.round(1e5*this.__data__)/1e6)&&void 0!==this.__data__}).classed("zero",!0),s=g.copy()}),t.renderEnd("axis immediate"),b}var c=d3.svg.axis(),d={top:0,right:0,bottom:0,left:0},e=75,f=60,g=d3.scale.linear(),h=null,i=!0,j=!0,k=0,l=!0,m=!1,n=!1,o=null,p=0,q=250,r=d3.dispatch("renderEnd");c.scale(g).orient("bottom").tickFormat(function(a){return a});var s,t=a.utils.renderWatch(r,q);return b.axis=c,b.dispatch=r,d3.rebind(b,c,"orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"),d3.rebind(b,g,"domain","range","rangeBand","rangeBands"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(d.top="undefined"!=typeof a.top?a.top:d.top,d.right="undefined"!=typeof a.right?a.right:d.right,d.bottom="undefined"!=typeof a.bottom?a.bottom:d.bottom,d.left="undefined"!=typeof a.left?a.left:d.left,b):d},b.width=function(a){return arguments.length?(e=a,b):e},b.ticks=function(a){return arguments.length?(o=a,b):o},b.height=function(a){return arguments.length?(f=a,b):f},b.axisLabel=function(a){return arguments.length?(h=a,b):h},b.showMaxMin=function(a){return arguments.length?(i=a,b):i},b.highlightZero=function(a){return arguments.length?(j=a,b):j},b.scale=function(a){return arguments.length?(g=a,c.scale(g),n="function"==typeof g.rangeBands,d3.rebind(b,g,"domain","range","rangeBand","rangeBands"),b):g},b.rotateYLabel=function(a){return arguments.length?(l=a,b):l},b.rotateLabels=function(a){return arguments.length?(k=a,b):k},b.staggerLabels=function(a){return arguments.length?(m=a,b):m},b.axisLabelDistance=function(a){return arguments.length?(p=a,b):p},b.duration=function(a){return arguments.length?(q=a,t.reset(q),b):q},b},a.models.bullet=function(){"use strict";function b(d){return d.each(function(b,d){var o=m-c.left-c.right,r=n-c.top-c.bottom,s=d3.select(this);a.utils.initSVG(s);{var t=f.call(this,b,d).slice().sort(d3.descending),u=g.call(this,b,d).slice().sort(d3.descending),v=h.call(this,b,d).slice().sort(d3.descending),w=i.call(this,b,d).slice(),x=j.call(this,b,d).slice(),y=k.call(this,b,d).slice(),z=d3.scale.linear().domain(d3.extent(d3.merge([l,t]))).range(e?[o,0]:[0,o]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(z.range())}this.__chart__=z;var A=d3.min(t),B=d3.max(t),C=t[1],D=s.selectAll("g.nv-wrap.nv-bullet").data([b]),E=D.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),F=E.append("g"),G=D.select("g");F.append("rect").attr("class","nv-range nv-rangeMax"),F.append("rect").attr("class","nv-range nv-rangeAvg"),F.append("rect").attr("class","nv-range nv-rangeMin"),F.append("rect").attr("class","nv-measure"),F.append("path").attr("class","nv-markerTriangle"),D.attr("transform","translate("+c.left+","+c.top+")");var H=function(a){return Math.abs(z(a)-z(0))},I=function(a){return z(0>a?a:0)};G.select("rect.nv-rangeMax").attr("height",r).attr("width",H(B>0?B:A)).attr("x",I(B>0?B:A)).datum(B>0?B:A),G.select("rect.nv-rangeAvg").attr("height",r).attr("width",H(C)).attr("x",I(C)).datum(C),G.select("rect.nv-rangeMin").attr("height",r).attr("width",H(B)).attr("x",I(B)).attr("width",H(B>0?A:B)).attr("x",I(B>0?A:B)).datum(B>0?A:B),G.select("rect.nv-measure").style("fill",p).attr("height",r/3).attr("y",r/3).attr("width",0>v?z(0)-z(v[0]):z(v[0])-z(0)).attr("x",I(v)).on("mouseover",function(){q.elementMouseover({value:v[0],label:y[0]||"Current",pos:[z(v[0]),r/2]})}).on("mouseout",function(){q.elementMouseout({value:v[0],label:y[0]||"Current"})});var J=r/6;u[0]?G.selectAll("path.nv-markerTriangle").attr("transform",function(){return"translate("+z(u[0])+","+r/2+")"}).attr("d","M0,"+J+"L"+J+","+-J+" "+-J+","+-J+"Z").on("mouseover",function(){q.elementMouseover({value:u[0],label:x[0]||"Previous",pos:[z(u[0]),r/2]})}).on("mouseout",function(){q.elementMouseout({value:u[0],label:x[0]||"Previous"})}):G.selectAll("path.nv-markerTriangle").remove(),D.selectAll(".nv-range").on("mouseover",function(a,b){var c=w[b]||(b?1==b?"Mean":"Minimum":"Maximum");q.elementMouseover({value:a,label:c,pos:[z(a),r/2]})}).on("mouseout",function(a,b){var c=w[b]||(b?1==b?"Mean":"Minimum":"Maximum");q.elementMouseout({value:a,label:c})})}),b}var c={top:0,right:0,bottom:0,left:0},d="left",e=!1,f=function(a){return a.ranges},g=function(a){return a.markers?a.markers:[0]},h=function(a){return a.measures},i=function(a){return a.rangeLabels?a.rangeLabels:[]},j=function(a){return a.markerLabels?a.markerLabels:[]},k=function(a){return a.measureLabels?a.measureLabels:[]},l=[0],m=380,n=30,o=null,p=a.utils.getColor(["#1f77b4"]),q=d3.dispatch("elementMouseover","elementMouseout");return b.dispatch=q,b.options=a.utils.optionsFunc.bind(b),b.orient=function(a){return arguments.length?(d=a,e="right"==d||"bottom"==d,b):d},b.ranges=function(a){return arguments.length?(f=a,b):f},b.markers=function(a){return arguments.length?(g=a,b):g},b.measures=function(a){return arguments.length?(h=a,b):h},b.forceX=function(a){return arguments.length?(l=a,b):l},b.width=function(a){return arguments.length?(m=a,b):m},b.height=function(a){return arguments.length?(n=a,b):n},b.margin=function(a){return arguments.length?(c.top="undefined"!=typeof a.top?a.top:c.top,c.right="undefined"!=typeof a.right?a.right:c.right,c.bottom="undefined"!=typeof a.bottom?a.bottom:c.bottom,c.left="undefined"!=typeof a.left?a.left:c.left,b):c},b.tickFormat=function(a){return arguments.length?(o=a,b):o},b.color=function(c){return arguments.length?(p=a.utils.getColor(c),b):p},b},a.models.bulletChart=function(){"use strict";function b(d){return d.each(function(n,r){var s=d3.select(this);a.utils.initSVG(s);var t=(j||parseInt(s.style("width"))||960)-f.left-f.right,u=k-f.top-f.bottom,v=this;if(b.update=function(){b(d)},b.container=this,!n||!g.call(this,n,r)){var w=s.selectAll(".nv-noData").data([o]);return w.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),w.attr("x",f.left+t/2).attr("y",18+f.top+u/2).text(function(a){return a}),b}s.selectAll(".nv-noData").remove();var x=g.call(this,n,r).slice().sort(d3.descending),y=h.call(this,n,r).slice().sort(d3.descending),z=i.call(this,n,r).slice().sort(d3.descending),A=s.selectAll("g.nv-wrap.nv-bulletChart").data([n]),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),C=B.append("g"),D=A.select("g");C.append("g").attr("class","nv-bulletWrap"),C.append("g").attr("class","nv-titles"),A.attr("transform","translate("+f.left+","+f.top+")");var E=d3.scale.linear().domain([0,Math.max(x[0],y[0],z[0])]).range(e?[t,0]:[0,t]),F=this.__chart__||d3.scale.linear().domain([0,1/0]).range(E.range());this.__chart__=E;var G=C.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(k-f.top-f.bottom)/2+")");G.append("text").attr("class","nv-title").text(function(a){return a.title}),G.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(a){return a.subtitle}),c.width(t).height(u);var H=D.select(".nv-bulletWrap");d3.transition(H).call(c);var I=l||E.tickFormat(t/100),J=D.selectAll("g.nv-tick").data(E.ticks(t/50),function(a){return this.textContent||I(a)}),K=J.enter().append("g").attr("class","nv-tick").attr("transform",function(a){return"translate("+F(a)+",0)"}).style("opacity",1e-6);K.append("line").attr("y1",u).attr("y2",7*u/6),K.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*u/6).text(I);var L=d3.transition(J).attr("transform",function(a){return"translate("+E(a)+",0)"}).style("opacity",1);L.select("line").attr("y1",u).attr("y2",7*u/6),L.select("text").attr("y",7*u/6),d3.transition(J.exit()).attr("transform",function(a){return"translate("+E(a)+",0)"}).style("opacity",1e-6).remove(),p.on("tooltipShow",function(a){a.key=n.title,m&&q(a,v.parentNode)})}),d3.timer.flush(),b}var c=a.models.bullet(),d="left",e=!1,f={top:5,right:40,bottom:20,left:120},g=function(a){return a.ranges},h=function(a){return a.markers?a.markers:[0]},i=function(a){return a.measures},j=null,k=55,l=null,m=!0,n=function(a,b,c){return"<h3>"+b+"</h3><p>"+c+"</p>"},o="No Data Available.",p=d3.dispatch("tooltipShow","tooltipHide"),q=function(c,d){var e=c.pos[0]+(d.offsetLeft||0)+f.left,g=c.pos[1]+(d.offsetTop||0)+f.top,h=n(c.key,c.label,c.value,c,b);a.tooltip.show([e,g],h,c.value<0?"e":"w",null,d)};return c.dispatch.on("elementMouseover.tooltip",function(a){p.tooltipShow(a)}),c.dispatch.on("elementMouseout.tooltip",function(a){p.tooltipHide(a)}),p.on("tooltipHide",function(){m&&a.tooltip.cleanup()}),b.dispatch=p,b.bullet=c,d3.rebind(b,c,"color"),b.options=a.utils.optionsFunc.bind(b),b.orient=function(a){return arguments.length?(d=a,e="right"==d||"bottom"==d,b):d},b.ranges=function(a){return arguments.length?(g=a,b):g},b.markers=function(a){return arguments.length?(h=a,b):h},b.measures=function(a){return arguments.length?(i=a,b):i},b.width=function(a){return arguments.length?(j=a,b):j},b.height=function(a){return arguments.length?(k=a,b):k},b.margin=function(a){return arguments.length?(f.top="undefined"!=typeof a.top?a.top:f.top,f.right="undefined"!=typeof a.right?a.right:f.right,f.bottom="undefined"!=typeof a.bottom?a.bottom:f.bottom,f.left="undefined"!=typeof a.left?a.left:f.left,b):f},b.tickFormat=function(a){return arguments.length?(l=a,b):l},b.tooltips=function(a){return arguments.length?(m=a,b):m},b.tooltipContent=function(a){return arguments.length?(n=a,b):n},b.noData=function(a){return arguments.length?(o=a,b):o},b},a.models.cumulativeLineChart=function(){"use strict";function b(x){return I.reset(),I.models(f),q&&I.models(g),r&&I.models(h),x.each(function(x){function F(){d3.select(b.container).style("cursor","ew-resize")}function I(){H.x=d3.event.x,H.i=Math.round(G.invert(H.x)),N()}function M(){d3.select(b.container).style("cursor","auto"),z.index=H.i,D.stateChange(z)}function N(){fb.data([H]);var a=b.duration();b.duration(0),b.update(),b.duration(a)}var O=d3.select(this);a.utils.initSVG(O),O.classed("nv-chart-"+y,!0);var P=this,Q=(n||parseInt(O.style("width"))||960)-l.left-l.right,R=(o||parseInt(O.style("height"))||400)-l.top-l.bottom;if(b.update=function(){0===E?O.call(b):O.transition().duration(E).call(b)},b.container=this,z.setter(L(x),b.update).getter(K(x)).update(),z.disabled=x.map(function(a){return!!a.disabled}),!A){var S;A={};for(S in z)A[S]=z[S]instanceof Array?z[S].slice(0):z[S]}var T=d3.behavior.drag().on("dragstart",F).on("drag",I).on("dragend",M);if(!(x&&x.length&&x.filter(function(a){return a.values.length}).length)){var U=O.selectAll(".nv-noData").data([B]);return U.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),U.attr("x",l.left+Q/2).attr("y",l.top+R/2).text(function(a){return a}),b}if(O.selectAll(".nv-noData").remove(),d=f.xScale(),e=f.yScale(),w)f.yDomain(null);else{var V=x.filter(function(a){return!a.disabled}).map(function(a){var b=d3.extent(a.values,f.y());return b[0]<-.95&&(b[0]=-.95),[(b[0]-b[1])/(1+b[1]),(b[1]-b[0])/(1+b[0])]}),W=[d3.min(V,function(a){return a[0]}),d3.max(V,function(a){return a[1]})];f.yDomain(W)}G.domain([0,x[0].values.length-1]).range([0,Q]).clamp(!0);var x=c(H.i,x),X=v?"none":"all",Y=O.selectAll("g.nv-wrap.nv-cumulativeLine").data([x]),Z=Y.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),$=Y.select("g");if(Z.append("g").attr("class","nv-interactive"),Z.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),Z.append("g").attr("class","nv-y nv-axis"),Z.append("g").attr("class","nv-background"),Z.append("g").attr("class","nv-linesWrap").style("pointer-events",X),Z.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),Z.append("g").attr("class","nv-legendWrap"),Z.append("g").attr("class","nv-controlsWrap"),p&&(i.width(Q),$.select(".nv-legendWrap").datum(x).call(i),l.top!=i.height()&&(l.top=i.height(),R=(o||parseInt(O.style("height"))||400)-l.top-l.bottom),$.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")),u){var _=[{key:"Re-scale y-axis",disabled:!w}];j.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),$.select(".nv-controlsWrap").datum(_).attr("transform","translate(0,"+-l.top+")").call(j)
3 }Y.attr("transform","translate("+l.left+","+l.top+")"),s&&$.select(".nv-y.nv-axis").attr("transform","translate("+Q+",0)");var ab=x.filter(function(a){return a.tempDisabled});Y.select(".tempDisabled").remove(),ab.length&&Y.append("text").attr("class","tempDisabled").attr("x",Q/2).attr("y","-.71em").style("text-anchor","end").text(ab.map(function(a){return a.key}).join(", ")+" values cannot be calculated for this time period."),v&&(k.width(Q).height(R).margin({left:l.left,top:l.top}).svgContainer(O).xScale(d),Y.select(".nv-interactive").call(k)),Z.select(".nv-background").append("rect"),$.select(".nv-background rect").attr("width",Q).attr("height",R),f.y(function(a){return a.display.y}).width(Q).height(R).color(x.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!x[b].disabled&&!x[b].tempDisabled}));var bb=$.select(".nv-linesWrap").datum(x.filter(function(a){return!a.disabled&&!a.tempDisabled}));bb.call(f),x.forEach(function(a,b){a.seriesIndex=b});var cb=x.filter(function(a){return!a.disabled&&!!C(a)}),db=$.select(".nv-avgLinesWrap").selectAll("line").data(cb,function(a){return a.key}),eb=function(a){var b=e(C(a));return 0>b?0:b>R?R:b};db.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(a){return f.color()(a,a.seriesIndex)}).attr("x1",0).attr("x2",Q).attr("y1",eb).attr("y2",eb),db.style("stroke-opacity",function(a){var b=e(C(a));return 0>b||b>R?0:1}).attr("x1",0).attr("x2",Q).attr("y1",eb).attr("y2",eb),db.exit().remove();var fb=bb.selectAll(".nv-indexLine").data([H]);fb.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(T),fb.attr("transform",function(a){return"translate("+G(a.i)+",0)"}).attr("height",R),q&&(g.scale(d).ticks(a.utils.calcTicksX(Q/70,x)).tickSize(-R,0),$.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),$.select(".nv-x.nv-axis").call(g)),r&&(h.scale(e).ticks(a.utils.calcTicksY(R/36,x)).tickSize(-Q,0),$.select(".nv-y.nv-axis").call(h)),$.select(".nv-background rect").on("click",function(){H.x=d3.mouse(this)[0],H.i=Math.round(G.invert(H.x)),z.index=H.i,D.stateChange(z),N()}),f.dispatch.on("elementClick",function(a){H.i=a.pointIndex,H.x=G(H.i),z.index=H.i,D.stateChange(z),N()}),j.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,w=!a.disabled,z.rescaleY=w,D.stateChange(z),b.update()}),i.dispatch.on("stateChange",function(a){for(var c in a)z[c]=a[c];D.stateChange(z),b.update()}),k.dispatch.on("elementMousemove",function(c){f.clearHighlights();var d,e,i,j=[];if(x.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(g,h){e=a.interactiveBisect(g.values,c.pointXValue,b.x()),f.highlightPoint(h,e,!0);var k=g.values[e];"undefined"!=typeof k&&("undefined"==typeof d&&(d=k),"undefined"==typeof i&&(i=b.xScale()(b.x()(k,e))),j.push({key:g.key,value:b.y()(k,e),color:m(g,g.seriesIndex)}))}),j.length>2){var n=b.yScale().invert(c.mouseY),o=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),p=.03*o,q=a.nearestValueIndex(j.map(function(a){return a.value}),n,p);null!==q&&(j[q].highlight=!0)}var r=g.tickFormat()(b.x()(d,e),e);k.tooltip.position({left:i+l.left,top:c.mouseY+l.top}).chartContainer(P.parentNode).enabled(t).valueFormatter(function(a){return h.tickFormat()(a)}).data({value:r,series:j})(),k.renderGuideLine(i)}),k.dispatch.on("elementMouseout",function(){D.tooltipHide(),f.clearHighlights()}),D.on("tooltipShow",function(a){t&&J(a,P.parentNode)}),D.on("changeState",function(a){"undefined"!=typeof a.disabled&&(x.forEach(function(b,c){b.disabled=a.disabled[c]}),z.disabled=a.disabled),"undefined"!=typeof a.index&&(H.i=a.index,H.x=G(H.i),z.index=a.index,fb.data([H])),"undefined"!=typeof a.rescaleY&&(w=a.rescaleY),b.update()})}),I.renderEnd("cumulativeLineChart immediate"),b}function c(a,b){return N||(N=f.y()),b.map(function(b){if(!b.values)return b;var c=b.values[a];if(null==c)return b;var d=N(c,a);return-.95>d&&!F?(b.tempDisabled=!0,b):(b.tempDisabled=!1,b.values=b.values.map(function(a,b){return a.display={y:(N(a,b)-d)/(1+d)},a}),b)})}var d,e,f=a.models.line(),g=a.models.axis(),h=a.models.axis(),i=a.models.legend(),j=a.models.legend(),k=a.interactiveGuideline(),l={top:30,right:30,bottom:50,left:60},m=a.utils.defaultColor(),n=null,o=null,p=!0,q=!0,r=!0,s=!1,t=!0,u=!0,v=!1,w=!0,x=function(a,b,c){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},y=f.id(),z=a.utils.state(),A=null,B="No Data Available.",C=function(a){return a.average},D=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),E=250,F=!1;z.index=0,z.rescaleY=w,g.orient("bottom").tickPadding(7),h.orient(s?"right":"left"),j.updateState(!1);var G=d3.scale.linear(),H={i:0,x:0},I=a.utils.renderWatch(D,E),J=function(c,d){var e=c.pos[0]+(d.offsetLeft||0),i=c.pos[1]+(d.offsetTop||0),j=g.tickFormat()(f.x()(c.point,c.pointIndex)),k=h.tickFormat()(f.y()(c.point,c.pointIndex)),l=x(c.series.key,j,k,c,b);a.tooltip.show([e,i],l,null,null,d)},K=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),index:H.i,rescaleY:w}}},L=function(a){return function(b){void 0!==b.index&&(H.i=b.index),void 0!==b.rescaleY&&(w=b.rescaleY),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};f.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+l.left,a.pos[1]+l.top],D.tooltipShow(a)}),f.dispatch.on("elementMouseout.tooltip",function(a){D.tooltipHide(a)}),D.on("tooltipHide",function(){t&&a.tooltip.cleanup()}),b.dispatch=D,b.lines=f,b.legend=i,b.xAxis=g,b.yAxis=h,b.interactiveLayer=k,b.state=z,d3.rebind(b,f,"defined","isArea","x","y","xScale","yScale","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","useVoronoi","id"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(l.top="undefined"!=typeof a.top?a.top:l.top,l.right="undefined"!=typeof a.right?a.right:l.right,l.bottom="undefined"!=typeof a.bottom?a.bottom:l.bottom,l.left="undefined"!=typeof a.left?a.left:l.left,b):l},b.width=function(a){return arguments.length?(n=a,b):n},b.height=function(a){return arguments.length?(o=a,b):o},b.color=function(c){return arguments.length?(m=a.utils.getColor(c),i.color(m),b):m},b.rescaleY=function(a){return arguments.length?(w=a,b):w},b.showControls=function(a){return arguments.length?(u=a,b):u},b.useInteractiveGuideline=function(a){return arguments.length?(v=a,a===!0&&(b.interactive(!1),b.useVoronoi(!1)),b):v},b.showLegend=function(a){return arguments.length?(p=a,b):p},b.showXAxis=function(a){return arguments.length?(q=a,b):q},b.showYAxis=function(a){return arguments.length?(r=a,b):r},b.rightAlignYAxis=function(a){return arguments.length?(s=a,h.orient(a?"right":"left"),b):s},b.tooltips=function(a){return arguments.length?(t=a,b):t},b.tooltipContent=function(a){return arguments.length?(x=a,b):x},b.state=function(c){return a.deprecated("cululativeLineChart.state"),arguments.length?(z=c,b):z};for(var M in z)b.state[M]=z[M];b.defaultState=function(a){return arguments.length?(A=a,b):A},b.noData=function(a){return arguments.length?(B=a,b):B},b.average=function(a){return arguments.length?(C=a,b):C},b.transitionDuration=function(c){return a.deprecated("cumulativeLineChart.transitionDuration"),b.duration(c)},b.duration=function(a){return arguments.length?(E=a,f.duration(E),g.duration(E),h.duration(E),I.reset(E),b):E},b.noErrorCheck=function(a){return arguments.length?(F=a,b):F};var N=null;return b},a.models.discreteBar=function(){"use strict";function b(l){return x.reset(),l.each(function(b){var l=j-i.left-i.right,w=k-i.top-i.bottom,y=d3.select(this);a.utils.initSVG(y),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var z=c&&d?[]:b.map(function(a){return a.values.map(function(a,b){return{x:o(a,b),y:p(a,b),y0:a.y0}})});m.domain(c||d3.merge(z).map(function(a){return a.x})).rangeBands(e||[0,l],.1),n.domain(d||d3.extent(d3.merge(z).map(function(a){return a.y}).concat(q))),n.range(s?f||[w-(n.domain()[0]<0?12:0),n.domain()[1]>0?12:0]:f||[w,0]),g=g||m,h=h||n.copy().range([n(0),n(0)]);{var A=y.selectAll("g.nv-wrap.nv-discretebar").data([b]),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar"),C=B.append("g");A.select("g")}C.append("g").attr("class","nv-groups"),A.attr("transform","translate("+i.left+","+i.top+")");var D=A.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});D.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),D.exit().watchTransition(x,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),D.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),D.watchTransition(x,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var E=D.selectAll("g.nv-bar").data(function(a){return a.values});E.exit().remove();var F=E.enter().append("g").attr("transform",function(a,b){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", "+n(0)+")"}).on("mouseover",function(a,c){d3.select(this).classed("hover",!0),u.elementMouseover({value:p(a,c),point:a,series:b[a.series],pos:[m(o(a,c))+m.rangeBand()*(a.series+.5)/b.length,n(p(a,c))],pointIndex:c,seriesIndex:a.series,e:d3.event})}).on("mouseout",function(a,c){d3.select(this).classed("hover",!1),u.elementMouseout({value:p(a,c),point:a,series:b[a.series],pointIndex:c,seriesIndex:a.series,e:d3.event})}).on("click",function(a,c){u.elementClick({value:p(a,c),point:a,series:b[a.series],pos:[m(o(a,c))+m.rangeBand()*(a.series+.5)/b.length,n(p(a,c))],pointIndex:c,seriesIndex:a.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(a,c){u.elementDblClick({value:p(a,c),point:a,series:b[a.series],pos:[m(o(a,c))+m.rangeBand()*(a.series+.5)/b.length,n(p(a,c))],pointIndex:c,seriesIndex:a.series,e:d3.event}),d3.event.stopPropagation()});F.append("rect").attr("height",0).attr("width",.9*m.rangeBand()/b.length),s?(F.append("text").attr("text-anchor","middle"),E.select("text").text(function(a,b){return t(p(a,b))}).watchTransition(x,"discreteBar: bars text").attr("x",.9*m.rangeBand()/2).attr("y",function(a,b){return p(a,b)<0?n(p(a,b))-n(0)+12:-4})):E.selectAll("text").remove(),E.attr("class",function(a,b){return p(a,b)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(a,b){return a.color||r(a,b)}).style("stroke",function(a,b){return a.color||r(a,b)}).select("rect").attr("class",v).watchTransition(x,"discreteBar: bars rect").attr("width",.9*m.rangeBand()/b.length),E.watchTransition(x,"discreteBar: bars").attr("transform",function(a,b){var c=m(o(a,b))+.05*m.rangeBand(),d=p(a,b)<0?n(0):n(0)-n(p(a,b))<1?n(0)-1:n(p(a,b));return"translate("+c+", "+d+")"}).select("rect").attr("height",function(a,b){return Math.max(Math.abs(n(p(a,b))-n(d&&d[0]||0))||1)}),g=m.copy(),h=n.copy()}),x.renderEnd("discreteBar immediate"),b}var c,d,e,f,g,h,i={top:0,right:0,bottom:0,left:0},j=960,k=500,l=Math.floor(1e4*Math.random()),m=d3.scale.ordinal(),n=d3.scale.linear(),o=function(a){return a.x},p=function(a){return a.y},q=[0],r=a.utils.defaultColor(),s=!1,t=d3.format(",.2f"),u=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),v="discreteBar",w=250,x=a.utils.renderWatch(u,w);return b.dispatch=u,b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(o=a,b):o},b.y=function(a){return arguments.length?(p=a,b):p},b.margin=function(a){return arguments.length?(i.top="undefined"!=typeof a.top?a.top:i.top,i.right="undefined"!=typeof a.right?a.right:i.right,i.bottom="undefined"!=typeof a.bottom?a.bottom:i.bottom,i.left="undefined"!=typeof a.left?a.left:i.left,b):i},b.width=function(a){return arguments.length?(j=a,b):j},b.height=function(a){return arguments.length?(k=a,b):k},b.xScale=function(a){return arguments.length?(m=a,b):m},b.yScale=function(a){return arguments.length?(n=a,b):n},b.xDomain=function(a){return arguments.length?(c=a,b):c},b.yDomain=function(a){return arguments.length?(d=a,b):d},b.xRange=function(a){return arguments.length?(e=a,b):e},b.yRange=function(a){return arguments.length?(f=a,b):f},b.forceY=function(a){return arguments.length?(q=a,b):q},b.color=function(c){return arguments.length?(r=a.utils.getColor(c),b):r},b.id=function(a){return arguments.length?(l=a,b):l},b.showValues=function(a){return arguments.length?(s=a,b):s},b.valueFormat=function(a){return arguments.length?(t=a,b):t},b.rectClass=function(a){return arguments.length?(v=a,b):v},b.duration=function(a){return arguments.length?(w=a,x.reset(w),b):w},b},a.models.discreteBarChart=function(){"use strict";function b(k){return v.reset(),v.models(e),l&&v.models(f),m&&v.models(g),k.each(function(k){var q=d3.select(this),v=this;a.utils.initSVG(q);var w=(i||parseInt(q.style("width"))||960)-h.left-h.right,x=(j||parseInt(q.style("height"))||400)-h.top-h.bottom;if(b.update=function(){s.beforeUpdate(),q.transition().duration(t).call(b)},b.container=this,!(k&&k.length&&k.filter(function(a){return a.values.length}).length)){var y=q.selectAll(".nv-noData").data([r]);return y.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),y.attr("x",h.left+w/2).attr("y",h.top+x/2).text(function(a){return a}),b}q.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var z=q.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([k]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),B=A.append("defs"),C=z.select("g");A.append("g").attr("class","nv-x nv-axis"),A.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),A.append("g").attr("class","nv-barsWrap"),C.attr("transform","translate("+h.left+","+h.top+")"),n&&C.select(".nv-y.nv-axis").attr("transform","translate("+w+",0)"),e.width(w).height(x);var D=C.select(".nv-barsWrap").datum(k.filter(function(a){return!a.disabled}));if(D.transition().call(e),B.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),C.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",c.rangeBand()*(o?2:1)).attr("height",16).attr("x",-c.rangeBand()/(o?1:2)),l){f.scale(c).ticks(a.utils.calcTicksX(w/100,k)).tickSize(-x,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+(d.range()[0]+(e.showValues()&&d.domain()[0]<0?16:0))+")"),C.select(".nv-x.nv-axis").call(f);var E=C.select(".nv-x.nv-axis").selectAll("g");o&&E.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}m&&(g.scale(d).ticks(a.utils.calcTicksY(x/36,k)).tickSize(-w,0),C.select(".nv-y.nv-axis").call(g)),C.select(".nv-zeroLine line").attr("x1",0).attr("x2",w).attr("y1",d(0)).attr("y2",d(0)),s.on("tooltipShow",function(a){p&&u(a,v.parentNode)})}),v.renderEnd("discreteBar chart immediate"),b}var c,d,e=a.models.discreteBar(),f=a.models.axis(),g=a.models.axis(),h={top:15,right:10,bottom:50,left:60},i=null,j=null,k=a.utils.getColor(),l=!0,m=!0,n=!1,o=!1,p=!0,q=function(a,b,c){return"<h3>"+b+"</h3><p>"+c+"</p>"},r="No Data Available.",s=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate","renderEnd"),t=250;f.orient("bottom").highlightZero(!1).showMaxMin(!1).tickFormat(function(a){return a}),g.orient(n?"right":"left").tickFormat(d3.format(",.1f"));var u=function(c,d){var h=c.pos[0]+(d.offsetLeft||0),i=c.pos[1]+(d.offsetTop||0),j=f.tickFormat()(e.x()(c.point,c.pointIndex)),k=g.tickFormat()(e.y()(c.point,c.pointIndex)),l=q(c.series.key,j,k,c,b);a.tooltip.show([h,i],l,c.value<0?"n":"s",null,d)},v=a.utils.renderWatch(s,t);return e.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+h.left,a.pos[1]+h.top],s.tooltipShow(a)}),e.dispatch.on("elementMouseout.tooltip",function(a){s.tooltipHide(a)}),s.on("tooltipHide",function(){p&&a.tooltip.cleanup()}),b.dispatch=s,b.discretebar=e,b.xAxis=f,b.yAxis=g,d3.rebind(b,e,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","id","showValues","valueFormat"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(h.top="undefined"!=typeof a.top?a.top:h.top,h.right="undefined"!=typeof a.right?a.right:h.right,h.bottom="undefined"!=typeof a.bottom?a.bottom:h.bottom,h.left="undefined"!=typeof a.left?a.left:h.left,b):h},b.width=function(a){return arguments.length?(i=a,b):i},b.height=function(a){return arguments.length?(j=a,b):j},b.color=function(c){return arguments.length?(k=a.utils.getColor(c),e.color(k),b):k},b.showXAxis=function(a){return arguments.length?(l=a,b):l},b.showYAxis=function(a){return arguments.length?(m=a,b):m},b.rightAlignYAxis=function(a){return arguments.length?(n=a,g.orient(a?"right":"left"),b):n},b.staggerLabels=function(a){return arguments.length?(o=a,b):o},b.tooltips=function(a){return arguments.length?(p=a,b):p},b.tooltipContent=function(a){return arguments.length?(q=a,b):q},b.noData=function(a){return arguments.length?(r=a,b):r},b.transitionDuration=function(c){return a.deprecated("discreteBar.transitionDuration"),b.duration(c)},b.duration=function(a){return arguments.length?(t=a,v.reset(t),e.duration(t),f.duration(t),g.duration(t),b):t},b},a.models.distribution=function(){"use strict";function b(k){return m.reset(),k.each(function(b){var k=(e-("x"===g?d.left+d.right:d.top+d.bottom),"x"==g?"y":"x"),l=d3.select(this);a.utils.initSVG(l),c=c||j;var n=l.selectAll("g.nv-distribution").data([b]),o=n.enter().append("g").attr("class","nvd3 nv-distribution"),p=(o.append("g"),n.select("g"));n.attr("transform","translate("+d.left+","+d.top+")");var q=p.selectAll("g.nv-dist").data(function(a){return a},function(a){return a.key});q.enter().append("g"),q.attr("class",function(a,b){return"nv-dist nv-series-"+b}).style("stroke",function(a,b){return i(a,b)});var r=q.selectAll("line.nv-dist"+g).data(function(a){return a.values});r.enter().append("line").attr(g+"1",function(a,b){return c(h(a,b))}).attr(g+"2",function(a,b){return c(h(a,b))}),m.transition(q.exit().selectAll("line.nv-dist"+g),"dist exit").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}).style("stroke-opacity",0).remove(),r.attr("class",function(a,b){return"nv-dist"+g+" nv-dist"+g+"-"+b}).attr(k+"1",0).attr(k+"2",f),m.transition(r,"dist").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}),c=j.copy()}),m.renderEnd("distribution immediate"),b}var c,d={top:0,right:0,bottom:0,left:0},e=400,f=8,g="x",h=function(a){return a[g]},i=a.utils.defaultColor(),j=d3.scale.linear(),k=250,l=d3.dispatch("renderEnd"),m=a.utils.renderWatch(l,k);return b.options=a.utils.optionsFunc.bind(b),b.dispatch=l,b.margin=function(a){return arguments.length?(d.top="undefined"!=typeof a.top?a.top:d.top,d.right="undefined"!=typeof a.right?a.right:d.right,d.bottom="undefined"!=typeof a.bottom?a.bottom:d.bottom,d.left="undefined"!=typeof a.left?a.left:d.left,b):d},b.width=function(a){return arguments.length?(e=a,b):e},b.axis=function(a){return arguments.length?(g=a,b):g},b.size=function(a){return arguments.length?(f=a,b):f},b.getData=function(a){return arguments.length?(h=d3.functor(a),b):h},b.scale=function(a){return arguments.length?(j=a,b):j},b.color=function(c){return arguments.length?(i=a.utils.getColor(c),b):i},b.duration=function(a){return arguments.length?(k=a,m.reset(k),b):k},b},a.models.historicalBar=function(){"use strict";function b(w){return w.each(function(b){v.reset();var w=h-g.left-g.right,x=i-g.top-g.bottom,y=d3.select(this);a.utils.initSVG(y),k.domain(c||d3.extent(b[0].values.map(m).concat(o))),k.range(q?e||[.5*w/b[0].values.length,w*(b[0].values.length-.5)/b[0].values.length]:e||[0,w]),l.domain(d||d3.extent(b[0].values.map(n).concat(p))).range(f||[x,0]),k.domain()[0]===k.domain()[1]&&k.domain(k.domain()[0]?[k.domain()[0]-.01*k.domain()[0],k.domain()[1]+.01*k.domain()[1]]:[-1,1]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]+.01*l.domain()[0],l.domain()[1]-.01*l.domain()[1]]:[-1,1]);var z=y.selectAll("g.nv-wrap.nv-historicalBar-"+j).data([b[0].values]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+j),B=A.append("defs"),C=A.append("g"),D=z.select("g");C.append("g").attr("class","nv-bars"),z.attr("transform","translate("+g.left+","+g.top+")"),y.on("click",function(a,b){t.chartClick({data:a,index:b,pos:d3.event,id:j})}),B.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),z.select("#nv-chart-clip-path-"+j+" rect").attr("width",w).attr("height",x),D.attr("clip-path",r?"url(#nv-chart-clip-path-"+j+")":"");var E=z.select(".nv-bars").selectAll(".nv-bar").data(function(a){return a},function(a,b){return m(a,b)});E.exit().remove();E.enter().append("rect").attr("x",0).attr("y",function(b,c){return a.utils.NaNtoZero(l(Math.max(0,n(b,c))))}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.abs(l(n(b,c))-l(0)))}).attr("transform",function(a,c){return"translate("+(k(m(a,c))-w/b[0].values.length*.45)+",0)"}).on("mouseover",function(a,c){u&&(d3.select(this).classed("hover",!0),t.elementMouseover({point:a,series:b[0],pos:[k(m(a,c)),l(n(a,c))],pointIndex:c,seriesIndex:0,e:d3.event}))}).on("mouseout",function(a,c){u&&(d3.select(this).classed("hover",!1),t.elementMouseout({point:a,series:b[0],pointIndex:c,seriesIndex:0,e:d3.event}))}).on("click",function(a,b){u&&(t.elementClick({value:n(a,b),data:a,index:b,pos:[k(m(a,b)),l(n(a,b))],e:d3.event,id:j}),d3.event.stopPropagation())}).on("dblclick",function(a,b){u&&(t.elementDblClick({value:n(a,b),data:a,index:b,pos:[k(m(a,b)),l(n(a,b))],e:d3.event,id:j}),d3.event.stopPropagation())});E.attr("fill",function(a,b){return s(a,b)}).attr("class",function(a,b,c){return(n(a,b)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+c+"-"+b}).watchTransition(v,"bars").attr("transform",function(a,c){return"translate("+(k(m(a,c))-w/b[0].values.length*.45)+",0)"}).attr("width",w/b[0].values.length*.9),E.watchTransition(v,"bars").attr("y",function(b,c){var d=n(b,c)<0?l(0):l(0)-l(n(b,c))<1?l(0)-1:l(n(b,c));return a.utils.NaNtoZero(d)}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.max(Math.abs(l(n(b,c))-l(0)),1))})}),v.renderEnd("historicalBar immediate"),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=960,i=500,j=Math.floor(1e4*Math.random()),k=d3.scale.linear(),l=d3.scale.linear(),m=function(a){return a.x},n=function(a){return a.y},o=[],p=[0],q=!1,r=!0,s=a.utils.defaultColor(),t=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),u=!0,v=a.utils.renderWatch(t,0);return b.highlightPoint=function(a,b){d3.select(".nv-historicalBar-"+j).select(".nv-bars .nv-bar-0-"+a).classed("hover",b)},b.clearHighlights=function(){d3.select(".nv-historicalBar-"+j).select(".nv-bars .nv-bar.hover").classed("hover",!1)},b.dispatch=t,b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(m=a,b):m},b.y=function(a){return arguments.length?(n=a,b):n},b.margin=function(a){return arguments.length?(g.top="undefined"!=typeof a.top?a.top:g.top,g.right="undefined"!=typeof a.right?a.right:g.right,g.bottom="undefined"!=typeof a.bottom?a.bottom:g.bottom,g.left="undefined"!=typeof a.left?a.left:g.left,b):g},b.width=function(a){return arguments.length?(h=a,b):h},b.height=function(a){return arguments.length?(i=a,b):i},b.xScale=function(a){return arguments.length?(k=a,b):k},b.yScale=function(a){return arguments.length?(l=a,b):l},b.xDomain=function(a){return arguments.length?(c=a,b):c},b.yDomain=function(a){return arguments.length?(d=a,b):d},b.xRange=function(a){return arguments.length?(e=a,b):e},b.yRange=function(a){return arguments.length?(f=a,b):f},b.forceX=function(a){return arguments.length?(o=a,b):o},b.forceY=function(a){return arguments.length?(p=a,b):p},b.padData=function(a){return arguments.length?(q=a,b):q},b.clipEdge=function(a){return arguments.length?(r=a,b):r},b.color=function(c){return arguments.length?(s=a.utils.getColor(c),b):s},b.id=function(a){return arguments.length?(j=a,b):j},b.interactive=function(){return arguments.length?(u=!1,b):u},b},a.models.historicalBarChart=function(){"use strict";function b(t){return t.each(function(B){A.reset(),A.models(e),o&&A.models(f),p&&A.models(g);var C=d3.select(this),D=this;a.utils.initSVG(C);var E=(l||parseInt(C.style("width"))||960)-j.left-j.right,F=(m||parseInt(C.style("height"))||400)-j.top-j.bottom;if(b.update=function(){C.transition().duration(y).call(b)},b.container=this,u.disabled=B.map(function(a){return!!a.disabled}),!v){var G;v={};for(G in u)v[G]=u[G]instanceof Array?u[G].slice(0):u[G]}if(!(B&&B.length&&B.filter(function(a){return a.values.length}).length)){var H=C.selectAll(".nv-noData").data([w]);return H.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),H.attr("x",j.left+E/2).attr("y",j.top+F/2).text(function(a){return a}),b}C.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var I=C.selectAll("g.nv-wrap.nv-historicalBarChart").data([B]),J=I.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),K=I.select("g");J.append("g").attr("class","nv-x nv-axis"),J.append("g").attr("class","nv-y nv-axis"),J.append("g").attr("class","nv-barsWrap"),J.append("g").attr("class","nv-legendWrap"),J.append("g").attr("class","nv-interactive"),n&&(h.width(E),K.select(".nv-legendWrap").datum(B).call(h),j.top!=h.height()&&(j.top=h.height(),F=(m||parseInt(C.style("height"))||400)-j.top-j.bottom),I.select(".nv-legendWrap").attr("transform","translate(0,"+-j.top+")")),I.attr("transform","translate("+j.left+","+j.top+")"),q&&K.select(".nv-y.nv-axis").attr("transform","translate("+E+",0)"),r&&(i.width(E).height(F).margin({left:j.left,top:j.top}).svgContainer(C).xScale(c),I.select(".nv-interactive").call(i)),e.width(E).height(F).color(B.map(function(a,b){return a.color||k(a,b)}).filter(function(a,b){return!B[b].disabled}));var L=K.select(".nv-barsWrap").datum(B.filter(function(a){return!a.disabled}));L.transition().call(e),o&&(f.scale(c).tickSize(-F,0),K.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),K.select(".nv-x.nv-axis").transition().call(f)),p&&(g.scale(d).ticks(a.utils.calcTicksY(F/36,B)).tickSize(-E,0),K.select(".nv-y.nv-axis").transition().call(g)),i.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,h,l,m=[];B.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f){h=a.interactiveBisect(f.values,c.pointXValue,b.x()),e.highlightPoint(h,!0);var g=f.values[h];"undefined"!=typeof g&&("undefined"==typeof d&&(d=g),"undefined"==typeof l&&(l=b.xScale()(b.x()(g,h))),m.push({key:f.key,value:b.y()(g,h),color:k(f,f.seriesIndex)}))});var n=f.tickFormat()(b.x()(d,h));i.tooltip.position({left:l+j.left,top:c.mouseY+j.top}).chartContainer(D.parentNode).enabled(s).valueFormatter(function(a){return g.tickFormat()(a)}).data({value:n,series:m})(),i.renderGuideLine(l)}),i.dispatch.on("elementMouseout",function(){x.tooltipHide(),e.clearHighlights()}),h.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,B.filter(function(a){return!a.disabled}).length||B.map(function(a){return a.disabled=!1,I.selectAll(".nv-series").classed("disabled",!1),a}),u.disabled=B.map(function(a){return!!a.disabled}),x.stateChange(u),t.transition().call(b)}),h.dispatch.on("legendDblclick",function(a){B.forEach(function(a){a.disabled=!0}),a.disabled=!1,u.disabled=B.map(function(a){return!!a.disabled}),x.stateChange(u),b.update()}),x.on("tooltipShow",function(a){s&&z(a,D.parentNode)}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&(B.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),b.update()})}),A.renderEnd("historicalBarChart immediate"),b}var c,d,e=a.models.historicalBar(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.interactiveGuideline(),j={top:30,right:90,bottom:50,left:90},k=a.utils.defaultColor(),l=null,m=null,n=!1,o=!0,p=!0,q=!1,r=!1,s=!0,t=function(a,b,c){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},u={},v=null,w="No Data Available.",x=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),y=250;f.orient("bottom").tickPadding(7),g.orient(q?"right":"left");var z=function(c,d){if(d){var h=d3.select(d).select("svg"),i=h.node()?h.attr("viewBox"):null;if(i){i=i.split(" ");var j=parseInt(h.style("width"))/i[2];c.pos[0]=c.pos[0]*j,c.pos[1]=c.pos[1]*j}}var k=c.pos[0]+(d.offsetLeft||0),l=c.pos[1]+(d.offsetTop||0),m=f.tickFormat()(e.x()(c.point,c.pointIndex)),n=g.tickFormat()(e.y()(c.point,c.pointIndex)),o=t(c.series.key,m,n,c,b);a.tooltip.show([k,l],o,null,null,d)},A=a.utils.renderWatch(x,0);return e.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],x.tooltipShow(a)}),e.dispatch.on("elementMouseout.tooltip",function(a){x.tooltipHide(a)}),x.on("tooltipHide",function(){s&&a.tooltip.cleanup()}),b.dispatch=x,b.bars=e,b.legend=h,b.xAxis=f,b.yAxis=g,b.interactiveLayer=i,d3.rebind(b,e,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id","interpolate","highlightPoint","clearHighlights"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(j.top="undefined"!=typeof a.top?a.top:j.top,j.right="undefined"!=typeof a.right?a.right:j.right,j.bottom="undefined"!=typeof a.bottom?a.bottom:j.bottom,j.left="undefined"!=typeof a.left?a.left:j.left,b):j},b.width=function(a){return arguments.length?(l=a,b):l},b.height=function(a){return arguments.length?(m=a,b):m},b.color=function(c){return arguments.length?(k=a.utils.getColor(c),h.color(k),b):k},b.showLegend=function(a){return arguments.length?(n=a,b):n},b.showXAxis=function(a){return arguments.length?(o=a,b):o},b.showYAxis=function(a){return arguments.length?(p=a,b):p},b.rightAlignYAxis=function(a){return arguments.length?(q=a,g.orient(a?"right":"left"),b):q},b.tooltips=function(a){return arguments.length?(s=a,b):s},b.tooltipContent=function(a){return arguments.length?(t=a,b):t},b.state=function(a){return arguments.length?(u=a,b):u},b.defaultState=function(a){return arguments.length?(v=a,b):v},b.noData=function(a){return arguments.length?(w=a,b):w},b.transitionDuration=function(a){return arguments.length?(y=a,b):y},b.useInteractiveGuideline=function(a){return arguments.length?(r=a,a===!0&&b.interactive(!1),b):r},b},a.models.legend=function(){"use strict";function b(m){return m.each(function(b){var m=d-c.left-c.right,n=d3.select(this);a.utils.initSVG(n);var o=n.selectAll("g.nv-legend").data([b]),p=(o.enter().append("g").attr("class","nvd3 nv-legend").append("g"),o.select("g"));o.attr("transform","translate("+c.left+","+c.top+")");var q=p.selectAll(".nv-series").data(function(a){return a}),r=q.enter().append("g").attr("class","nv-series").on("mouseover",function(a,b){l.legendMouseover(a,b)}).on("mouseout",function(a,b){l.legendMouseout(a,b)}).on("click",function(a,c){l.legendClick(a,c),j&&(k?(b.forEach(function(a){a.disabled=!0}),a.disabled=!1):(a.disabled=!a.disabled,b.every(function(a){return a.disabled})&&b.forEach(function(a){a.disabled=!1})),l.stateChange({disabled:b.map(function(a){return!!a.disabled})}))}).on("dblclick",function(a,c){l.legendDblclick(a,c),j&&(b.forEach(function(a){a.disabled=!0}),a.disabled=!1,l.stateChange({disabled:b.map(function(a){return!!a.disabled})}))});if(r.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),r.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8"),q.classed("disabled",function(a){return a.disabled}),q.exit().remove(),q.select("circle").style("fill",function(a,b){return a.color||g(a,b)}).style("stroke",function(a,b){return a.color||g(a,b)}),q.select("text").text(f),h){var s=[];q.each(function(){var b,c=d3.select(this).select("text");try{if(b=c.node().getComputedTextLength(),0>=b)throw Error()}catch(d){b=a.utils.calcApproxTextWidth(c)}s.push(b+28)});for(var t=0,u=0,v=[];m>u&&t<s.length;)v[t]=s[t],u+=s[t++];
4 for(0===t&&(t=1);u>m&&t>1;){v=[],t--;for(var w=0;w<s.length;w++)s[w]>(v[w%t]||0)&&(v[w%t]=s[w]);u=v.reduce(function(a,b){return a+b})}for(var x=[],y=0,z=0;t>y;y++)x[y]=z,z+=v[y];q.attr("transform",function(a,b){return"translate("+x[b%t]+","+(5+20*Math.floor(b/t))+")"}),i?p.attr("transform","translate("+(d-c.right-u)+","+c.top+")"):p.attr("transform","translate(0,"+c.top+")"),e=c.top+c.bottom+20*Math.ceil(s.length/t)}else{var A,B=5,C=5,D=0;q.attr("transform",function(){var a=d3.select(this).select("text").node().getComputedTextLength()+28;return A=C,d<c.left+c.right+A+a&&(C=A=5,B+=20),C+=a,C>D&&(D=C),"translate("+A+","+B+")"}),p.attr("transform","translate("+(d-c.right-D)+","+c.top+")"),e=c.top+c.bottom+B+15}}),b}var c={top:5,right:0,bottom:5,left:0},d=400,e=20,f=function(a){return a.key},g=a.utils.defaultColor(),h=!0,i=!0,j=!0,k=!1,l=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange");return b.dispatch=l,b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(c.top="undefined"!=typeof a.top?a.top:c.top,c.right="undefined"!=typeof a.right?a.right:c.right,c.bottom="undefined"!=typeof a.bottom?a.bottom:c.bottom,c.left="undefined"!=typeof a.left?a.left:c.left,b):c},b.width=function(a){return arguments.length?(d=a,b):d},b.height=function(a){return arguments.length?(e=a,b):e},b.key=function(a){return arguments.length?(f=a,b):f},b.color=function(c){return arguments.length?(g=a.utils.getColor(c),b):g},b.align=function(a){return arguments.length?(h=a,b):h},b.rightAlign=function(a){return arguments.length?(i=a,b):i},b.updateState=function(a){return arguments.length?(j=a,b):j},b.radioButtonMode=function(a){return arguments.length?(k=a,b):k},b},a.models.line=function(){"use strict";function b(p){return t.reset(),t.models(e),p.each(function(b){var p=g-f.left-f.right,q=h-f.top-f.bottom,u=d3.select(this);a.utils.initSVG(u),c=e.xScale(),d=e.yScale(),r=r||c,s=s||d;var v=u.selectAll("g.nv-wrap.nv-line").data([b]),w=v.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),x=w.append("defs"),y=w.append("g"),z=v.select("g");y.append("g").attr("class","nv-groups"),y.append("g").attr("class","nv-scatterWrap"),v.attr("transform","translate("+f.left+","+f.top+")"),e.width(p).height(q);var A=v.select(".nv-scatterWrap");A.call(e),x.append("clipPath").attr("id","nv-edge-clip-"+e.id()).append("rect"),v.select("#nv-edge-clip-"+e.id()+" rect").attr("width",p).attr("height",q>0?q:0),z.attr("clip-path",n?"url(#nv-edge-clip-"+e.id()+")":""),A.attr("clip-path",n?"url(#nv-edge-clip-"+e.id()+")":"");var B=v.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),B.exit().remove(),B.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return i(a,b)}).style("stroke",function(a,b){return i(a,b)}),B.watchTransition(t,"line: groups").style("stroke-opacity",1).style("fill-opacity",.5);var C=B.selectAll("path.nv-area").data(function(a){return m(a)?[a]:[]});C.enter().append("path").attr("class","nv-area").attr("d",function(b){return d3.svg.area().interpolate(o).defined(l).x(function(b,c){return a.utils.NaNtoZero(r(j(b,c)))}).y0(function(b,c){return a.utils.NaNtoZero(s(k(b,c)))}).y1(function(){return s(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])}),B.exit().selectAll("path.nv-area").remove(),C.watchTransition(t,"line: areaPaths").attr("d",function(b){return d3.svg.area().interpolate(o).defined(l).x(function(b,d){return a.utils.NaNtoZero(c(j(b,d)))}).y0(function(b,c){return a.utils.NaNtoZero(d(k(b,c)))}).y1(function(){return d(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])});var D=B.selectAll("path.nv-line").data(function(a){return[a.values]});D.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(o).defined(l).x(function(b,c){return a.utils.NaNtoZero(r(j(b,c)))}).y(function(b,c){return a.utils.NaNtoZero(s(k(b,c)))})),D.watchTransition(t,"line: linePaths").attr("d",d3.svg.line().interpolate(o).defined(l).x(function(b,d){return a.utils.NaNtoZero(c(j(b,d)))}).y(function(b,c){return a.utils.NaNtoZero(d(k(b,c)))})),r=c.copy(),s=d.copy()}),t.renderEnd("line immediate"),b}var c,d,e=a.models.scatter(),f={top:0,right:0,bottom:0,left:0},g=960,h=500,i=a.utils.defaultColor(),j=function(a){return a.x},k=function(a){return a.y},l=function(a,b){return!isNaN(k(a,b))&&null!==k(a,b)},m=function(a){return a.area},n=!1,o="linear",p=250,q=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");e.size(16).sizeDomain([16,256]);var r,s,t=a.utils.renderWatch(q,p);return b.dispatch=q,b.scatter=e,e.dispatch.on("elementClick",function(){q.elementClick.apply(this,arguments)}),e.dispatch.on("elementMouseover",function(){q.elementMouseover.apply(this,arguments)}),e.dispatch.on("elementMouseout",function(){q.elementMouseout.apply(this,arguments)}),d3.rebind(b,e,"id","interactive","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","forceX","forceY","forceSize","clipVoronoi","useVoronoi","clipRadius","padData","highlightPoint","clearHighlights"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(f.top="undefined"!=typeof a.top?a.top:f.top,f.right="undefined"!=typeof a.right?a.right:f.right,f.bottom="undefined"!=typeof a.bottom?a.bottom:f.bottom,f.left="undefined"!=typeof a.left?a.left:f.left,b):f},b.width=function(a){return arguments.length?(g=a,b):g},b.height=function(a){return arguments.length?(h=a,b):h},b.x=function(a){return arguments.length?(j=a,e.x(a),b):j},b.y=function(a){return arguments.length?(k=a,e.y(a),b):k},b.clipEdge=function(a){return arguments.length?(n=a,b):n},b.color=function(c){return arguments.length?(i=a.utils.getColor(c),e.color(i),b):i},b.interpolate=function(a){return arguments.length?(o=a,b):o},b.defined=function(a){return arguments.length?(l=a,b):l},b.isArea=function(a){return arguments.length?(m=d3.functor(a),b):m},b.duration=function(a){return arguments.length?(p=a,t.reset(p),e.duration(p),b):p},b},a.models.lineChart=function(){"use strict";function b(t){return A.reset(),A.models(e),o&&A.models(f),p&&A.models(g),t.each(function(t){var A=d3.select(this),D=this;a.utils.initSVG(A);var E=(l||parseInt(A.style("width"))||960)-j.left-j.right,F=(m||parseInt(A.style("height"))||400)-j.top-j.bottom;if(b.update=function(){0===y?A.call(b):A.transition().duration(y).call(b)},b.container=this,u.setter(C(t),b.update).getter(B(t)).update(),u.disabled=t.map(function(a){return!!a.disabled}),!v){var G;v={};for(G in u)v[G]=u[G]instanceof Array?u[G].slice(0):u[G]}if(!(t&&t.length&&t.filter(function(a){return a.values.length}).length)){var H=A.selectAll(".nv-noData").data([w]);return H.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),H.attr("x",j.left+E/2).attr("y",j.top+F/2).text(function(a){return a}),b}A.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var I=A.selectAll("g.nv-wrap.nv-lineChart").data([t]),J=I.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),K=I.select("g");J.append("rect").style("opacity",0),J.append("g").attr("class","nv-x nv-axis"),J.append("g").attr("class","nv-y nv-axis"),J.append("g").attr("class","nv-linesWrap"),J.append("g").attr("class","nv-legendWrap"),J.append("g").attr("class","nv-interactive"),K.select("rect").attr("width",E).attr("height",F>0?F:0),n&&(h.width(E),K.select(".nv-legendWrap").datum(t).call(h),j.top!=h.height()&&(j.top=h.height(),F=(m||parseInt(A.style("height"))||400)-j.top-j.bottom),I.select(".nv-legendWrap").attr("transform","translate(0,"+-j.top+")")),I.attr("transform","translate("+j.left+","+j.top+")"),q&&K.select(".nv-y.nv-axis").attr("transform","translate("+E+",0)"),r&&(i.width(E).height(F).margin({left:j.left,top:j.top}).svgContainer(A).xScale(c),I.select(".nv-interactive").call(i)),e.width(E).height(F).color(t.map(function(a,b){return a.color||k(a,b)}).filter(function(a,b){return!t[b].disabled}));var L=K.select(".nv-linesWrap").datum(t.filter(function(a){return!a.disabled}));L.call(e),o&&(f.scale(c).ticks(a.utils.calcTicksX(E/100,t)).tickSize(-F,0),K.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),K.select(".nv-x.nv-axis").call(f)),p&&(g.scale(d).ticks(a.utils.calcTicksY(F/36,t)).tickSize(-E,0),K.select(".nv-y.nv-axis").call(g)),h.dispatch.on("stateChange",function(a){for(var c in a)u[c]=a[c];x.stateChange(u),b.update()}),i.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,h,l,m=[];if(t.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f,g){h=a.interactiveBisect(f.values,c.pointXValue,b.x()),e.highlightPoint(g,h,!0);var i=f.values[h];"undefined"!=typeof i&&("undefined"==typeof d&&(d=i),"undefined"==typeof l&&(l=b.xScale()(b.x()(i,h))),m.push({key:f.key,value:b.y()(i,h),color:k(f,f.seriesIndex)}))}),m.length>2){var n=b.yScale().invert(c.mouseY),o=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),p=.03*o,q=a.nearestValueIndex(m.map(function(a){return a.value}),n,p);null!==q&&(m[q].highlight=!0)}var r=f.tickFormat()(b.x()(d,h));i.tooltip.position({left:l+j.left,top:c.mouseY+j.top}).chartContainer(D.parentNode).enabled(s).valueFormatter(function(a){return g.tickFormat()(a)}).data({value:r,series:m})(),i.renderGuideLine(l)}),i.dispatch.on("elementClick",function(c){var d,f=[];t.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(e){var g=a.interactiveBisect(e.values,c.pointXValue,b.x()),h=e.values[g];if("undefined"!=typeof h){"undefined"==typeof d&&(d=b.xScale()(b.x()(h,g)));var i=b.yScale()(b.y()(h,g));f.push({point:h,pointIndex:g,pos:[d,i],seriesIndex:e.seriesIndex,series:e})}}),e.dispatch.elementClick(f)}),i.dispatch.on("elementMouseout",function(){x.tooltipHide(),e.clearHighlights()}),x.on("tooltipShow",function(a){s&&z(a,D.parentNode)}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&t.length===a.disabled.length&&(t.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),b.update()})}),A.renderEnd("lineChart immediate"),b}var c,d,e=a.models.line(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.interactiveGuideline(),j={top:30,right:20,bottom:50,left:60},k=a.utils.defaultColor(),l=null,m=null,n=!0,o=!0,p=!0,q=!1,r=!1,s=!0,t=function(a,b,c){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},u=a.utils.state(),v=null,w="No Data Available.",x=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),y=250;f.orient("bottom").tickPadding(7),g.orient(q?"right":"left");var z=function(c,d){var h=c.pos[0]+(d.offsetLeft||0),i=c.pos[1]+(d.offsetTop||0),j=f.tickFormat()(e.x()(c.point,c.pointIndex)),k=g.tickFormat()(e.y()(c.point,c.pointIndex)),l=t(c.series.key,j,k,c,b);a.tooltip.show([h,i],l,null,null,d)},A=a.utils.renderWatch(x,y),B=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},C=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};e.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],x.tooltipShow(a)}),e.dispatch.on("elementMouseout.tooltip",function(a){x.tooltipHide(a)}),x.on("tooltipHide",function(){s&&a.tooltip.cleanup()}),b.dispatch=x,b.lines=e,b.legend=h,b.xAxis=f,b.yAxis=g,b.interactiveLayer=i,b.state=u,d3.rebind(b,e,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","useVoronoi","id","interpolate"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(j.top="undefined"!=typeof a.top?a.top:j.top,j.right="undefined"!=typeof a.right?a.right:j.right,j.bottom="undefined"!=typeof a.bottom?a.bottom:j.bottom,j.left="undefined"!=typeof a.left?a.left:j.left,b):j},b.width=function(a){return arguments.length?(l=a,b):l},b.height=function(a){return arguments.length?(m=a,b):m},b.color=function(c){return arguments.length?(k=a.utils.getColor(c),h.color(k),b):k},b.showLegend=function(a){return arguments.length?(n=a,b):n},b.showXAxis=function(a){return arguments.length?(o=a,b):o},b.showYAxis=function(a){return arguments.length?(p=a,b):p},b.rightAlignYAxis=function(a){return arguments.length?(q=a,g.orient(a?"right":"left"),b):q},b.useInteractiveGuideline=function(a){return arguments.length?(r=a,a===!0&&(b.interactive(!1),b.useVoronoi(!1)),b):r},b.tooltips=function(a){return arguments.length?(s=a,b):s},b.tooltipContent=function(a){return arguments.length?(t=a,b):t},b.state=function(c){return a.deprecated("lineChart.state"),arguments.length?(u=c,b):u};for(var D in u)b.state[D]=u[D];return b.defaultState=function(a){return arguments.length?(v=a,b):v},b.noData=function(a){return arguments.length?(w=a,b):w},b.transitionDuration=function(c){return a.deprecated("lineChart.transitionDuration"),b.duration(c)},b.duration=function(a){return arguments.length?(y=a,A.reset(y),e.duration(y),f.duration(y),g.duration(y),b):y},b},a.models.linePlusBarChart=function(){"use strict";function b(o){return o.each(function(o){var p=d3.select(this),t=this;a.utils.initSVG(p);var B=(m||parseInt(p.style("width"))||960)-l.left-l.right,C=(n||parseInt(p.style("height"))||400)-l.top-l.bottom;if(b.update=function(){p.transition().call(b)},u.setter(A(o),b.update).getter(z(o)).update(),u.disabled=o.map(function(a){return!!a.disabled}),!v){var D;v={};for(D in u)v[D]=u[D]instanceof Array?u[D].slice(0):u[D]}if(!(o&&o.length&&o.filter(function(a){return a.values.length}).length)){var E=p.selectAll(".nv-noData").data([w]);return E.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),E.attr("x",l.left+B/2).attr("y",l.top+C/2).text(function(a){return a}),b}p.selectAll(".nv-noData").remove();var F=o.filter(function(a){return!a.disabled&&a.bar}),G=o.filter(function(a){return!a.bar});c=G.filter(function(a){return!a.disabled}).length&&G.filter(function(a){return!a.disabled})[0].values.length?f.xScale():g.xScale(),d=g.yScale(),e=f.yScale();var H=d3.select(this).selectAll("g.nv-wrap.nv-linePlusBar").data([o]),I=H.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),J=H.select("g");I.append("g").attr("class","nv-x nv-axis"),I.append("g").attr("class","nv-y1 nv-axis"),I.append("g").attr("class","nv-y2 nv-axis"),I.append("g").attr("class","nv-barsWrap"),I.append("g").attr("class","nv-linesWrap"),I.append("g").attr("class","nv-legendWrap"),r&&(k.width(B/2),J.select(".nv-legendWrap").datum(o.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(a.bar?" (left axis)":" (right axis)"),a})).call(k),l.top!=k.height()&&(l.top=k.height(),C=(n||parseInt(p.style("height"))||400)-l.top-l.bottom),J.select(".nv-legendWrap").attr("transform","translate("+B/2+","+-l.top+")")),H.attr("transform","translate("+l.left+","+l.top+")"),f.width(B).height(C).color(o.map(function(a,b){return a.color||q(a,b)}).filter(function(a,b){return!o[b].disabled&&!o[b].bar})),g.width(B).height(C).color(o.map(function(a,b){return a.color||q(a,b)}).filter(function(a,b){return!o[b].disabled&&o[b].bar}));var K=J.select(".nv-barsWrap").datum(F.length?F:[{values:[]}]),L=J.select(".nv-linesWrap").datum(G[0]&&!G[0].disabled?G:[{values:[]}]);d3.transition(K).call(g),d3.transition(L).call(f),h.scale(c).ticks(a.utils.calcTicksX(B/100,o)).tickSize(-C,0),J.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),d3.transition(J.select(".nv-x.nv-axis")).call(h),i.scale(d).ticks(a.utils.calcTicksY(C/36,o)).tickSize(-B,0),d3.transition(J.select(".nv-y1.nv-axis")).style("opacity",F.length?1:0).call(i),j.scale(e).ticks(a.utils.calcTicksY(C/36,o)).tickSize(F.length?0:-B,0),J.select(".nv-y2.nv-axis").style("opacity",G.length?1:0).attr("transform","translate("+B+",0)"),d3.transition(J.select(".nv-y2.nv-axis")).call(j),k.dispatch.on("stateChange",function(a){for(var c in a)u[c]=a[c];x.stateChange(u),b.update()}),x.on("tooltipShow",function(a){s&&y(a,t.parentNode)}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&(o.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),b.update()})}),b}var c,d,e,f=a.models.line(),g=a.models.historicalBar(),h=a.models.axis(),i=a.models.axis(),j=a.models.axis(),k=a.models.legend(),l={top:30,right:60,bottom:50,left:60},m=null,n=null,o=function(a){return a.x},p=function(a){return a.y},q=a.utils.defaultColor(),r=!0,s=!0,t=function(a,b,c){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},u=a.utils.state(),v=null,w="No Data Available.",x=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");g.padData(!0),f.clipEdge(!1).padData(!0),h.orient("bottom").tickPadding(7).highlightZero(!1),i.orient("left"),j.orient("right");var y=function(c,d){var e=c.pos[0]+(d.offsetLeft||0),g=c.pos[1]+(d.offsetTop||0),k=h.tickFormat()(f.x()(c.point,c.pointIndex)),l=(c.series.bar?i:j).tickFormat()(f.y()(c.point,c.pointIndex)),m=t(c.series.key,k,l,c,b);a.tooltip.show([e,g],m,c.value<0?"n":"s",null,d)},z=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},A=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};f.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+l.left,a.pos[1]+l.top],x.tooltipShow(a)}),f.dispatch.on("elementMouseout.tooltip",function(a){x.tooltipHide(a)}),g.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+l.left,a.pos[1]+l.top],x.tooltipShow(a)}),g.dispatch.on("elementMouseout.tooltip",function(a){x.tooltipHide(a)}),x.on("tooltipHide",function(){s&&a.tooltip.cleanup()}),b.dispatch=x,b.legend=k,b.lines=f,b.bars=g,b.xAxis=h,b.y1Axis=i,b.y2Axis=j,b.state=u,d3.rebind(b,f,"defined","size","clipVoronoi","interpolate"),b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(o=a,f.x(a),g.x(a),b):o},b.y=function(a){return arguments.length?(p=a,f.y(a),g.y(a),b):p},b.margin=function(a){return arguments.length?(l.top="undefined"!=typeof a.top?a.top:l.top,l.right="undefined"!=typeof a.right?a.right:l.right,l.bottom="undefined"!=typeof a.bottom?a.bottom:l.bottom,l.left="undefined"!=typeof a.left?a.left:l.left,b):l},b.width=function(a){return arguments.length?(m=a,b):m},b.height=function(a){return arguments.length?(n=a,b):n},b.color=function(c){return arguments.length?(q=a.utils.getColor(c),k.color(q),b):q},b.showLegend=function(a){return arguments.length?(r=a,b):r},b.tooltips=function(a){return arguments.length?(s=a,b):s},b.tooltipContent=function(a){return arguments.length?(t=a,b):t},b.state=function(c){return a.deprecated("linePlusBarChart.state"),arguments.length?(u=c,b):u};for(var B in u)b.state[B]=u[B];return b.defaultState=function(a){return arguments.length?(v=a,b):v},b.noData=function(a){return arguments.length?(w=a,b):w},b},a.models.linePlusBarWithFocusChart=function(){"use strict";function b(G){return G.each(function(G){function P(a){var b=+("e"==a),c=b?1:-1,d=W/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function Q(){u.empty()||u.extent(E),ib.data([u.empty()?e.domain():E]).each(function(a){var b=e(a[0])-e.range()[0],c=e.range()[1]-e(a[1]);d3.select(this).select(".left").attr("width",0>b?0:b),d3.select(this).select(".right").attr("x",e(a[1])).attr("width",0>c?0:c)})}function R(){E=u.empty()?null:u.extent(),c=u.empty()?e.domain():u.extent(),I.brush({extent:c,brush:u}),Q(),l.width(U).height(V).color(G.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!G[b].disabled&&G[b].bar})),j.width(U).height(V).color(G.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!G[b].disabled&&!G[b].bar}));var b=db.select(".nv-focus .nv-barsWrap").datum(Z.length?Z.map(function(a){return{key:a.key,values:a.values.filter(function(a,b){return l.x()(a,b)>=c[0]&&l.x()(a,b)<=c[1]})}}):[{values:[]}]),h=db.select(".nv-focus .nv-linesWrap").datum($[0].disabled?[{values:[]}]:$.map(function(a){return{key:a.key,values:a.values.filter(function(a,b){return j.x()(a,b)>=c[0]&&j.x()(a,b)<=c[1]})}}));d=Z.length?l.xScale():j.xScale(),n.scale(d).ticks(a.utils.calcTicksX(U/100,G)).tickSize(-V,0),n.domain([Math.ceil(c[0]),Math.floor(c[1])]),db.select(".nv-x.nv-axis").transition().duration(J).call(n),b.transition().duration(J).call(l),h.transition().duration(J).call(j),db.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),p.scale(f).ticks(a.utils.calcTicksY(V/36,G)).tickSize(-U,0),db.select(".nv-focus .nv-y1.nv-axis").style("opacity",Z.length?1:0),q.scale(g).ticks(a.utils.calcTicksY(V/36,G)).tickSize(Z.length?0:-U,0),db.select(".nv-focus .nv-y2.nv-axis").style("opacity",$.length?1:0).attr("transform","translate("+d.range()[1]+",0)"),db.select(".nv-focus .nv-y1.nv-axis").transition().duration(J).call(p),db.select(".nv-focus .nv-y2.nv-axis").transition().duration(J).call(q)}var S=d3.select(this),T=this;a.utils.initSVG(S);var U=(x||parseInt(S.style("width"))||960)-v.left-v.right,V=(y||parseInt(S.style("height"))||400)-v.top-v.bottom-z,W=z-w.top-w.bottom;if(b.update=function(){S.transition().duration(J).call(b)},b.container=this,K.setter(O(G),b.update).getter(N(G)).update(),K.disabled=G.map(function(a){return!!a.disabled}),!L){var X;L={};for(X in K)L[X]=K[X]instanceof Array?K[X].slice(0):K[X]}if(!(G&&G.length&&G.filter(function(a){return a.values.length}).length)){var Y=S.selectAll(".nv-noData").data([H]);return Y.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),Y.attr("x",v.left+U/2).attr("y",v.top+V/2).text(function(a){return a}),b}S.selectAll(".nv-noData").remove();var Z=G.filter(function(a){return!a.disabled&&a.bar}),$=G.filter(function(a){return!a.bar});d=l.xScale(),e=o.scale(),f=l.yScale(),g=j.yScale(),h=m.yScale(),i=k.yScale();var _=G.filter(function(a){return!a.disabled&&a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})}),ab=G.filter(function(a){return!a.disabled&&!a.bar}).map(function(a){return a.values.map(function(a,b){return{x:A(a,b),y:B(a,b)}})});d.range([0,U]),e.domain(d3.extent(d3.merge(_.concat(ab)),function(a){return a.x})).range([0,U]);var bb=S.selectAll("g.nv-wrap.nv-linePlusBar").data([G]),cb=bb.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),db=bb.select("g");cb.append("g").attr("class","nv-legendWrap");var eb=cb.append("g").attr("class","nv-focus");eb.append("g").attr("class","nv-x nv-axis"),eb.append("g").attr("class","nv-y1 nv-axis"),eb.append("g").attr("class","nv-y2 nv-axis"),eb.append("g").attr("class","nv-barsWrap"),eb.append("g").attr("class","nv-linesWrap");var fb=cb.append("g").attr("class","nv-context");fb.append("g").attr("class","nv-x nv-axis"),fb.append("g").attr("class","nv-y1 nv-axis"),fb.append("g").attr("class","nv-y2 nv-axis"),fb.append("g").attr("class","nv-barsWrap"),fb.append("g").attr("class","nv-linesWrap"),fb.append("g").attr("class","nv-brushBackground"),fb.append("g").attr("class","nv-x nv-brush"),D&&(t.width(U/2),db.select(".nv-legendWrap").datum(G.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(a.bar?" (left axis)":" (right axis)"),a})).call(t),v.top!=t.height()&&(v.top=t.height(),V=(y||parseInt(S.style("height"))||400)-v.top-v.bottom-z),db.select(".nv-legendWrap").attr("transform","translate("+U/2+","+-v.top+")")),bb.attr("transform","translate("+v.left+","+v.top+")"),m.width(U).height(W).color(G.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!G[b].disabled&&G[b].bar})),k.width(U).height(W).color(G.map(function(a,b){return a.color||C(a,b)}).filter(function(a,b){return!G[b].disabled&&!G[b].bar}));var gb=db.select(".nv-context .nv-barsWrap").datum(Z.length?Z:[{values:[]}]),hb=db.select(".nv-context .nv-linesWrap").datum($[0].disabled?[{values:[]}]:$);db.select(".nv-context").attr("transform","translate(0,"+(V+v.bottom+w.top)+")"),gb.transition().call(m),hb.transition().call(k),u.x(e).on("brush",R),E&&u.extent(E);var ib=db.select(".nv-brushBackground").selectAll("g").data([E||u.extent()]),jb=ib.enter().append("g");jb.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",W),jb.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",W);var kb=db.select(".nv-x.nv-brush").call(u);kb.selectAll("rect").attr("height",W),kb.selectAll(".resize").append("path").attr("d",P),o.ticks(a.utils.calcTicksX(U/100,G)).tickSize(-W,0),db.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+h.range()[0]+")"),db.select(".nv-context .nv-x.nv-axis").transition().call(o),r.scale(h).ticks(W/36).tickSize(-U,0),db.select(".nv-context .nv-y1.nv-axis").style("opacity",Z.length?1:0).attr("transform","translate(0,"+e.range()[0]+")"),db.select(".nv-context .nv-y1.nv-axis").transition().call(r),s.scale(i).ticks(W/36).tickSize(Z.length?0:-U,0),db.select(".nv-context .nv-y2.nv-axis").style("opacity",$.length?1:0).attr("transform","translate("+e.range()[1]+",0)"),db.select(".nv-context .nv-y2.nv-axis").transition().call(s),t.dispatch.on("stateChange",function(a){for(var c in a)K[c]=a[c];I.stateChange(K),b.update()}),I.on("tooltipShow",function(a){F&&M(a,T.parentNode)}),I.on("changeState",function(a){"undefined"!=typeof a.disabled&&(G.forEach(function(b,c){b.disabled=a.disabled[c]}),K.disabled=a.disabled),b.update()}),R()}),b}var c,d,e,f,g,h,i,j=a.models.line(),k=a.models.line(),l=a.models.historicalBar(),m=a.models.historicalBar(),n=a.models.axis(),o=a.models.axis(),p=a.models.axis(),q=a.models.axis(),r=a.models.axis(),s=a.models.axis(),t=a.models.legend(),u=d3.svg.brush(),v={top:30,right:30,bottom:30,left:60},w={top:0,right:30,bottom:20,left:60},x=null,y=null,z=100,A=function(a){return a.x},B=function(a){return a.y},C=a.utils.defaultColor(),D=!0,E=null,F=!0,G=function(a,b,c){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},H="No Data Available.",I=d3.dispatch("tooltipShow","tooltipHide","brush","stateChange","changeState"),J=0,K=a.utils.state(),L=null;j.clipEdge(!0),k.interactive(!1),n.orient("bottom").tickPadding(5),p.orient("left"),q.orient("right"),o.orient("bottom").tickPadding(5),r.orient("left"),s.orient("right");var M=function(d,e){c&&(d.pointIndex+=Math.ceil(c[0]));var f=d.pos[0]+(e.offsetLeft||0),g=d.pos[1]+(e.offsetTop||0),h=n.tickFormat()(j.x()(d.point,d.pointIndex)),i=(d.series.bar?p:q).tickFormat()(j.y()(d.point,d.pointIndex)),k=G(d.series.key,h,i,d,b);a.tooltip.show([f,g],k,d.value<0?"n":"s",null,e)},N=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},O=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};j.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+v.left,a.pos[1]+v.top],I.tooltipShow(a)}),j.dispatch.on("elementMouseout.tooltip",function(a){I.tooltipHide(a)}),l.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+v.left,a.pos[1]+v.top],I.tooltipShow(a)}),l.dispatch.on("elementMouseout.tooltip",function(a){I.tooltipHide(a)}),I.on("tooltipHide",function(){F&&a.tooltip.cleanup()}),b.dispatch=I,b.legend=t,b.lines=j,b.lines2=k,b.bars=l,b.bars2=m,b.xAxis=n,b.x2Axis=o,b.y1Axis=p,b.y2Axis=q,b.y3Axis=r,b.y4Axis=s,b.state=K,d3.rebind(b,j,"defined","size","clipVoronoi","interpolate"),b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(A=a,j.x(a),l.x(a),b):A},b.y=function(a){return arguments.length?(B=a,j.y(a),l.y(a),b):B},b.margin=function(a){return arguments.length?(v.top="undefined"!=typeof a.top?a.top:v.top,v.right="undefined"!=typeof a.right?a.right:v.right,v.bottom="undefined"!=typeof a.bottom?a.bottom:v.bottom,v.left="undefined"!=typeof a.left?a.left:v.left,b):v},b.width=function(a){return arguments.length?(x=a,b):x},b.height=function(a){return arguments.length?(y=a,b):y},b.color=function(c){return arguments.length?(C=a.utils.getColor(c),t.color(C),b):C},b.showLegend=function(a){return arguments.length?(D=a,b):D},b.tooltips=function(a){return arguments.length?(F=a,b):F},b.tooltipContent=function(a){return arguments.length?(G=a,b):G},b.state=function(c){return a.deprecated("linePlusBarWithFocusChart.state"),arguments.length?(K=c,b):K};for(var P in K)b.state[P]=K[P];return b.noData=function(a){return arguments.length?(H=a,b):H},b.brushExtent=function(a){return arguments.length?(E=a,b):E},b},a.models.lineWithFocusChart=function(){"use strict";function b(x){return x.each(function(x){function G(a){var b=+("e"==a),c=b?1:-1,d=N/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function H(){n.empty()||n.extent(v),W.data([n.empty()?e.domain():v]).each(function(a){var b=e(a[0])-c.range()[0],d=c.range()[1]-e(a[1]);d3.select(this).select(".left").attr("width",0>b?0:b),d3.select(this).select(".right").attr("x",e(a[1])).attr("width",0>d?0:d)})}function I(){v=n.empty()?null:n.extent();var a=n.empty()?e.domain():n.extent();if(!(Math.abs(a[0]-a[1])<=1)){z.brush({extent:a,brush:n}),H();var b=S.select(".nv-focus .nv-linesWrap").datum(x.filter(function(a){return!a.disabled}).map(function(b){return{key:b.key,area:b.area,values:b.values.filter(function(b,c){return g.x()(b,c)>=a[0]&&g.x()(b,c)<=a[1]})}}));b.transition().duration(A).call(g),S.select(".nv-focus .nv-x.nv-axis").transition().duration(A).call(i),S.select(".nv-focus .nv-y.nv-axis").transition().duration(A).call(j)}}var J=d3.select(this),K=this;a.utils.initSVG(J);var L=(r||parseInt(J.style("width"))||960)-o.left-o.right,M=(s||parseInt(J.style("height"))||400)-o.top-o.bottom-t,N=t-p.top-p.bottom;if(b.update=function(){J.transition().duration(A).call(b)},b.container=this,B.setter(F(x),b.update).getter(E(x)).update(),B.disabled=x.map(function(a){return!!a.disabled}),!C){var O;C={};for(O in B)C[O]=B[O]instanceof Array?B[O].slice(0):B[O]}if(!(x&&x.length&&x.filter(function(a){return a.values.length}).length)){var P=J.selectAll(".nv-noData").data([y]);return P.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),P.attr("x",o.left+L/2).attr("y",o.top+M/2).text(function(a){return a}),b}J.selectAll(".nv-noData").remove(),c=g.xScale(),d=g.yScale(),e=h.xScale(),f=h.yScale();var Q=J.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([x]),R=Q.enter().append("g").attr("class","nvd3 nv-wrap nv-lineWithFocusChart").append("g"),S=Q.select("g");R.append("g").attr("class","nv-legendWrap");var T=R.append("g").attr("class","nv-focus");T.append("g").attr("class","nv-x nv-axis"),T.append("g").attr("class","nv-y nv-axis"),T.append("g").attr("class","nv-linesWrap");var U=R.append("g").attr("class","nv-context");U.append("g").attr("class","nv-x nv-axis"),U.append("g").attr("class","nv-y nv-axis"),U.append("g").attr("class","nv-linesWrap"),U.append("g").attr("class","nv-brushBackground"),U.append("g").attr("class","nv-x nv-brush"),u&&(m.width(L),S.select(".nv-legendWrap").datum(x).call(m),o.top!=m.height()&&(o.top=m.height(),M=(s||parseInt(J.style("height"))||400)-o.top-o.bottom-t),S.select(".nv-legendWrap").attr("transform","translate(0,"+-o.top+")")),Q.attr("transform","translate("+o.left+","+o.top+")"),g.width(L).height(M).color(x.map(function(a,b){return a.color||q(a,b)}).filter(function(a,b){return!x[b].disabled})),h.defined(g.defined()).width(L).height(N).color(x.map(function(a,b){return a.color||q(a,b)}).filter(function(a,b){return!x[b].disabled})),S.select(".nv-context").attr("transform","translate(0,"+(M+o.bottom+p.top)+")");var V=S.select(".nv-context .nv-linesWrap").datum(x.filter(function(a){return!a.disabled}));d3.transition(V).call(h),i.scale(c).ticks(a.utils.calcTicksX(L/100,x)).tickSize(-M,0),j.scale(d).ticks(a.utils.calcTicksY(M/36,x)).tickSize(-L,0),S.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+M+")"),n.x(e).on("brush",function(){var a=b.transitionDuration();
5 b.transitionDuration(0),I(),b.transitionDuration(a)}),v&&n.extent(v);var W=S.select(".nv-brushBackground").selectAll("g").data([v||n.extent()]),X=W.enter().append("g");X.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",N),X.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",N);var Y=S.select(".nv-x.nv-brush").call(n);Y.selectAll("rect").attr("height",N),Y.selectAll(".resize").append("path").attr("d",G),I(),k.scale(e).ticks(a.utils.calcTicksX(L/100,x)).tickSize(-N,0),S.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),d3.transition(S.select(".nv-context .nv-x.nv-axis")).call(k),l.scale(f).ticks(a.utils.calcTicksY(N/36,x)).tickSize(-L,0),d3.transition(S.select(".nv-context .nv-y.nv-axis")).call(l),S.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),m.dispatch.on("stateChange",function(a){for(var c in a)B[c]=a[c];z.stateChange(B),b.update()}),z.on("tooltipShow",function(a){w&&D(a,K.parentNode)}),z.on("changeState",function(a){"undefined"!=typeof a.disabled&&x.forEach(function(b,c){b.disabled=a.disabled[c]}),b.update()})}),b}var c,d,e,f,g=a.models.line(),h=a.models.line(),i=a.models.axis(),j=a.models.axis(),k=a.models.axis(),l=a.models.axis(),m=a.models.legend(),n=d3.svg.brush(),o={top:30,right:30,bottom:30,left:60},p={top:0,right:30,bottom:20,left:60},q=a.utils.defaultColor(),r=null,s=null,t=100,u=!0,v=null,w=!0,x=function(a,b,c){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},y="No Data Available.",z=d3.dispatch("tooltipShow","tooltipHide","brush","stateChange","changeState"),A=250,B=a.utils.state(),C=null;g.clipEdge(!0),h.interactive(!1),i.orient("bottom").tickPadding(5),j.orient("left"),k.orient("bottom").tickPadding(5),l.orient("left");var D=function(c,d){var e=c.pos[0]+(d.offsetLeft||0),f=c.pos[1]+(d.offsetTop||0),h=i.tickFormat()(g.x()(c.point,c.pointIndex)),k=j.tickFormat()(g.y()(c.point,c.pointIndex)),l=x(c.series.key,h,k,c,b);a.tooltip.show([e,f],l,null,null,d)},E=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},F=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};g.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+o.left,a.pos[1]+o.top],z.tooltipShow(a)}),g.dispatch.on("elementMouseout.tooltip",function(a){z.tooltipHide(a)}),z.on("tooltipHide",function(){w&&a.tooltip.cleanup()}),b.dispatch=z,b.legend=m,b.lines=g,b.lines2=h,b.xAxis=i,b.yAxis=j,b.x2Axis=k,b.y2Axis=l,b.state=B,d3.rebind(b,g,"defined","isArea","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id"),b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(g.x(a),h.x(a),b):g.x},b.y=function(a){return arguments.length?(g.y(a),h.y(a),b):g.y},b.margin=function(a){return arguments.length?(o.top="undefined"!=typeof a.top?a.top:o.top,o.right="undefined"!=typeof a.right?a.right:o.right,o.bottom="undefined"!=typeof a.bottom?a.bottom:o.bottom,o.left="undefined"!=typeof a.left?a.left:o.left,b):o},b.margin2=function(a){return arguments.length?(p=a,b):p},b.width=function(a){return arguments.length?(r=a,b):r},b.height=function(a){return arguments.length?(s=a,b):s},b.height2=function(a){return arguments.length?(t=a,b):t},b.color=function(c){return arguments.length?(q=a.utils.getColor(c),m.color(q),b):q},b.showLegend=function(a){return arguments.length?(u=a,b):u},b.tooltips=function(a){return arguments.length?(w=a,b):w},b.tooltipContent=function(a){return arguments.length?(x=a,b):x},b.state=function(c){return a.deprecated("lineWithFocusChart.state"),arguments.length?(B=c,b):B};for(var G in B)b.state[G]=B[G];return b.defaultState=function(a){return arguments.length?(C=a,b):C},b.interpolate=function(a){return arguments.length?(g.interpolate(a),h.interpolate(a),b):g.interpolate()},b.noData=function(a){return arguments.length?(y=a,b):y},b.xTickFormat=function(a){return arguments.length?(i.tickFormat(a),k.tickFormat(a),b):i.tickFormat()},b.yTickFormat=function(a){return arguments.length?(j.tickFormat(a),l.tickFormat(a),b):j.tickFormat()},b.brushExtent=function(a){return arguments.length?(v=a,b):v},b.transitionDuration=function(a){return arguments.length?(A=a,b):A},b},a.models.multiBar=function(){"use strict";function b(C){return B.reset(),C.each(function(b){var C=k-j.left-j.right,D=l-j.top-j.bottom,E=d3.select(this);a.utils.initSVG(E);w&&b.length&&(w=[{values:b[0].values.map(function(a){return{x:a.x,y:0,series:a.series,size:.01}})}]),t&&(b=d3.layout.stack().offset(u).values(function(a){return a.values}).y(q)(!b.length&&w?w:b)),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})}),t&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e,e-=b.size):(b.y1=b.size+d,d+=b.size)})});var F=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),y0:a.y0,y1:a.y1}})});m.domain(d||d3.merge(F).map(function(a){return a.x})).rangeBands(f||[0,C],z),n.domain(e||d3.extent(d3.merge(F).map(function(a){return t?a.y>0?a.y1:a.y1+a.y:a.y}).concat(r))).range(g||[D,0]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]:[-1,1]),n.domain()[0]===n.domain()[1]&&n.domain(n.domain()[0]?[n.domain()[0]+.01*n.domain()[0],n.domain()[1]-.01*n.domain()[1]]:[-1,1]),h=h||m,i=i||n;var G=E.selectAll("g.nv-wrap.nv-multibar").data([b]),H=G.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),I=H.append("defs"),J=H.append("g"),K=G.select("g");J.append("g").attr("class","nv-groups"),G.attr("transform","translate("+j.left+","+j.top+")"),I.append("clipPath").attr("id","nv-edge-clip-"+o).append("rect"),G.select("#nv-edge-clip-"+o+" rect").attr("width",C).attr("height",D),K.attr("clip-path",s?"url(#nv-edge-clip-"+o+")":"");var L=G.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});L.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var M=B.transition(L.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(250,y)).attr("y",function(a){return i(t?a.y0:0)}).attr("height",0).remove();M.delay&&M.delay(function(a,c){return c*y/b[0].values.length}),L.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return v(a,b)}).style("stroke",function(a,b){return v(a,b)}),L.style("stroke-opacity",1).style("fill-opacity",.75);var N=L.selectAll("rect.nv-bar").data(function(a){return w&&!b.length?w.values:a.values});N.exit().remove();N.enter().append("rect").attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(a,c,d){return t?0:d*m.rangeBand()/b.length}).attr("y",function(a){return i(t?a.y0:0)}).attr("height",0).attr("width",m.rangeBand()/(t?1:b.length)).attr("transform",function(a,b){return"translate("+m(p(a,b))+",0)"});N.style("fill",function(a,b,c){return v(a,c,b)}).style("stroke",function(a,b,c){return v(a,c,b)}).on("mouseover",function(a,c){d3.select(this).classed("hover",!0),A.elementMouseover({value:q(a,c),point:a,series:b[a.series],pos:[m(p(a,c))+m.rangeBand()*(t?b.length/2:a.series+.5)/b.length,n(q(a,c)+(t?a.y0:0))],pointIndex:c,seriesIndex:a.series,e:d3.event})}).on("mouseout",function(a,c){d3.select(this).classed("hover",!1),A.elementMouseout({value:q(a,c),point:a,series:b[a.series],pointIndex:c,seriesIndex:a.series,e:d3.event})}).on("click",function(a,c){A.elementClick({value:q(a,c),point:a,series:b[a.series],pos:[m(p(a,c))+m.rangeBand()*(t?b.length/2:a.series+.5)/b.length,n(q(a,c)+(t?a.y0:0))],pointIndex:c,seriesIndex:a.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(a,c){A.elementDblClick({value:q(a,c),point:a,series:b[a.series],pos:[m(p(a,c))+m.rangeBand()*(t?b.length/2:a.series+.5)/b.length,n(q(a,c)+(t?a.y0:0))],pointIndex:c,seriesIndex:a.series,e:d3.event}),d3.event.stopPropagation()}),N.attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(a,b){return"translate("+m(p(a,b))+",0)"}),x&&(c||(c=b.map(function(){return!0})),N.style("fill",function(a,b,d){return d3.rgb(x(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(x(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}));var O=N.watchTransition(B,"multibar",Math.min(250,y)).delay(function(a,c){return c*y/b[0].values.length});t?O.attr("y",function(a){return n(t?a.y1:0)}).attr("height",function(a){return Math.max(Math.abs(n(a.y+(t?a.y0:0))-n(t?a.y0:0)),1)}).attr("x",function(a){return t?0:a.series*m.rangeBand()/b.length}).attr("width",m.rangeBand()/(t?1:b.length)):O.attr("x",function(a){return a.series*m.rangeBand()/b.length}).attr("width",m.rangeBand()/b.length).attr("y",function(a,b){return q(a,b)<0?n(0):n(0)-n(q(a,b))<1?n(0)-1:n(q(a,b))||0}).attr("height",function(a,b){return Math.max(Math.abs(n(q(a,b))-n(0)),1)||0}),h=m.copy(),i=n.copy()}),B.renderEnd("multibar immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=d3.scale.ordinal(),n=d3.scale.linear(),o=Math.floor(1e4*Math.random()),p=function(a){return a.x},q=function(a){return a.y},r=[0],s=!0,t=!1,u="zero",v=a.utils.defaultColor(),w=!1,x=null,y=1e3,z=.1,A=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),B=a.utils.renderWatch(A,y);return b.dispatch=A,b.x=function(a){return arguments.length?(p=a,b):p},b.y=function(a){return arguments.length?(q=a,b):q},b.margin=function(a){return arguments.length?(j.top="undefined"!=typeof a.top?a.top:j.top,j.right="undefined"!=typeof a.right?a.right:j.right,j.bottom="undefined"!=typeof a.bottom?a.bottom:j.bottom,j.left="undefined"!=typeof a.left?a.left:j.left,b):j},b.width=function(a){return arguments.length?(k=a,b):k},b.height=function(a){return arguments.length?(l=a,b):l},b.xScale=function(a){return arguments.length?(m=a,b):m},b.yScale=function(a){return arguments.length?(n=a,b):n},b.xDomain=function(a){return arguments.length?(d=a,b):d},b.yDomain=function(a){return arguments.length?(e=a,b):e},b.xRange=function(a){return arguments.length?(f=a,b):f},b.yRange=function(a){return arguments.length?(g=a,b):g},b.forceY=function(a){return arguments.length?(r=a,b):r},b.stacked=function(a){return arguments.length?(t=a,b):t},b.stackOffset=function(a){return arguments.length?(u=a,b):u},b.clipEdge=function(a){return arguments.length?(s=a,b):s},b.color=function(c){return arguments.length?(v=a.utils.getColor(c),b):v},b.barColor=function(c){return arguments.length?(x=a.utils.getColor(c),b):x},b.disabled=function(a){return arguments.length?(c=a,b):c},b.id=function(a){return arguments.length?(o=a,b):o},b.hideable=function(a){return arguments.length?(w=a,b):w},b.groupSpacing=function(a){return arguments.length?(z=a,b):z},b.duration=function(a){return arguments.length?(y=a,B.reset(y),b):y},b.delay=function(c){return a.deprecated("multiBar.delay"),b.duration(c)},b.options=a.utils.optionsFunc.bind(b),b},a.models.multiBarChart=function(){"use strict";function b(w){return D.reset(),D.models(e),p&&D.models(f),q&&D.models(g),w.each(function(w){var D=d3.select(this),I=this;a.utils.initSVG(D);var J=(k||parseInt(D.style("width"))||960)-j.left-j.right,K=(l||parseInt(D.style("height"))||400)-j.top-j.bottom;if(b.update=function(){0===C?D.call(b):D.transition().duration(C).call(b)},b.container=this,x.setter(H(w),b.update).getter(G(w)).update(),x.disabled=w.map(function(a){return!!a.disabled}),!y){var L;y={};for(L in x)y[L]=x[L]instanceof Array?x[L].slice(0):x[L]}if(!(w&&w.length&&w.filter(function(a){return a.values.length}).length)){var M=D.selectAll(".nv-noData").data([z]);return M.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),M.attr("x",j.left+J/2).attr("y",j.top+K/2).text(function(a){return a}),b}D.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var N=D.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([w]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),P=N.select("g");if(O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y nv-axis"),O.append("g").attr("class","nv-barsWrap"),O.append("g").attr("class","nv-legendWrap"),O.append("g").attr("class","nv-controlsWrap"),o&&(h.width(J-B()),e.barColor()&&w.forEach(function(a,b){a.color=d3.rgb("#ccc").darker(1.5*b).toString()}),P.select(".nv-legendWrap").datum(w).call(h),j.top!=h.height()&&(j.top=h.height(),K=(l||parseInt(D.style("height"))||400)-j.top-j.bottom),P.select(".nv-legendWrap").attr("transform","translate("+B()+","+-j.top+")")),n){var Q=[{key:"Grouped",disabled:e.stacked()},{key:"Stacked",disabled:!e.stacked()}];i.width(B()).color(["#444","#444","#444"]),P.select(".nv-controlsWrap").datum(Q).attr("transform","translate(0,"+-j.top+")").call(i)}N.attr("transform","translate("+j.left+","+j.top+")"),r&&P.select(".nv-y.nv-axis").attr("transform","translate("+J+",0)"),e.disabled(w.map(function(a){return a.disabled})).width(J).height(K).color(w.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!w[b].disabled}));var R=P.select(".nv-barsWrap").datum(w.filter(function(a){return!a.disabled}));if(R.call(e),p){f.scale(c).ticks(a.utils.calcTicksX(J/100,w)).tickSize(-K,0),P.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),P.select(".nv-x.nv-axis").call(f);var S=P.select(".nv-x.nv-axis > g").selectAll("g");if(S.selectAll("line, text").style("opacity",1),t){var T=function(a,b){return"translate("+a+","+b+")"},U=5,V=17;S.selectAll("text").attr("transform",function(a,b,c){return T(0,c%2==0?U:V)});var W=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;P.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(a,b){return T(0,0===b||W%2!==0?V:U)})}s&&S.filter(function(a,b){return b%Math.ceil(w[0].values.length/(J/100))!==0}).selectAll("text, line").style("opacity",0),u&&S.selectAll(".tick text").attr("transform","rotate("+u+" 0,0)").style("text-anchor",u>0?"start":"end"),P.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}q&&(g.scale(d).ticks(a.utils.calcTicksY(K/36,w)).tickSize(-J,0),P.select(".nv-y.nv-axis").call(g)),h.dispatch.on("stateChange",function(a){for(var c in a)x[c]=a[c];A.stateChange(x),b.update()}),i.dispatch.on("legendClick",function(a){if(a.disabled){switch(Q=Q.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":e.stacked(!1);break;case"Stacked":e.stacked(!0)}x.stacked=e.stacked(),A.stateChange(x),b.update()}}),A.on("tooltipShow",function(a){v&&F(a,I.parentNode)}),A.on("changeState",function(a){"undefined"!=typeof a.disabled&&(w.forEach(function(b,c){b.disabled=a.disabled[c]}),x.disabled=a.disabled),"undefined"!=typeof a.stacked&&(e.stacked(a.stacked),x.stacked=a.stacked,E=a.stacked),b.update()})}),D.renderEnd("multibarchart immediate"),b}var c,d,e=a.models.multiBar(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.legend(),j={top:30,right:20,bottom:50,left:60},k=null,l=null,m=a.utils.defaultColor(),n=!0,o=!0,p=!0,q=!0,r=!1,s=!0,t=!1,u=0,v=!0,w=function(a,b,c){return"<h3>"+a+"</h3><p>"+c+" on "+b+"</p>"},x=a.utils.state(),y=null,z="No Data Available.",A=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),B=function(){return n?180:0},C=250;x.stacked=!1,e.stacked(!1),f.orient("bottom").tickPadding(7).highlightZero(!0).showMaxMin(!1).tickFormat(function(a){return a}),g.orient(r?"right":"left").tickFormat(d3.format(",.1f")),i.updateState(!1);var D=a.utils.renderWatch(A),E=!1,F=function(c,d){var h=c.pos[0]+(d.offsetLeft||0),i=c.pos[1]+(d.offsetTop||0),j=f.tickFormat()(e.x()(c.point,c.pointIndex)),k=g.tickFormat()(e.y()(c.point,c.pointIndex)),l=w(c.series.key,j,k,c,b);a.tooltip.show([h,i],l,c.value<0?"n":"s",null,d)},G=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:E}}},H=function(a){return function(b){void 0!==b.stacked&&(E=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};e.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],A.tooltipShow(a)}),e.dispatch.on("elementMouseout.tooltip",function(a){A.tooltipHide(a)}),A.on("tooltipHide",function(){v&&a.tooltip.cleanup()}),b.dispatch=A,b.multibar=e,b.legend=h,b.xAxis=f,b.yAxis=g,b.state=x,d3.rebind(b,e,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","clipEdge","id","stacked","stackOffset","delay","barColor","groupSpacing"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(j.top="undefined"!=typeof a.top?a.top:j.top,j.right="undefined"!=typeof a.right?a.right:j.right,j.bottom="undefined"!=typeof a.bottom?a.bottom:j.bottom,j.left="undefined"!=typeof a.left?a.left:j.left,b):j},b.width=function(a){return arguments.length?(k=a,b):k},b.height=function(a){return arguments.length?(l=a,b):l},b.color=function(c){return arguments.length?(m=a.utils.getColor(c),h.color(m),b):m},b.showControls=function(a){return arguments.length?(n=a,b):n},b.showLegend=function(a){return arguments.length?(o=a,b):o},b.showXAxis=function(a){return arguments.length?(p=a,b):p},b.showYAxis=function(a){return arguments.length?(q=a,b):q},b.rightAlignYAxis=function(a){return arguments.length?(r=a,g.orient(a?"right":"left"),b):r},b.reduceXTicks=function(a){return arguments.length?(s=a,b):s},b.rotateLabels=function(a){return arguments.length?(u=a,b):u},b.staggerLabels=function(a){return arguments.length?(t=a,b):t},b.tooltip=function(a){return arguments.length?(w=a,b):w},b.tooltips=function(a){return arguments.length?(v=a,b):v},b.tooltipContent=function(a){return arguments.length?(w=a,b):w},b.state=function(c){return a.deprecated("multiBarChart.state"),arguments.length?(x=c,b):x};for(var I in x)b.state[I]=x[I];return b.defaultState=function(a){return arguments.length?(y=a,b):y},b.noData=function(a){return arguments.length?(z=a,b):z},b.transitionDuration=function(c){return a.deprecated("multiBarChart.transitionDuration"),b.duration(c)},b.duration=function(a){return arguments.length?(C=a,e.duration(C),f.duration(C),g.duration(C),D.reset(C),b):C},b},a.models.multiBarHorizontal=function(){"use strict";function b(m){return C.reset(),m.each(function(b){var m=k-j.left-j.right,z=l-j.top-j.bottom,A=d3.select(this);a.utils.initSVG(A),u&&(b=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(q)(b)),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})}),u&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e-b.size,e-=b.size):(b.y1=d,d+=b.size)})});var D=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),y0:a.y0,y1:a.y1}})});n.domain(d||d3.merge(D).map(function(a){return a.x})).rangeBands(f||[0,z],.1),o.domain(e||d3.extent(d3.merge(D).map(function(a){return u?a.y>0?a.y1+a.y:a.y1:a.y}).concat(r))),o.range(v&&!u?g||[o.domain()[0]<0?x:0,m-(o.domain()[1]>0?x:0)]:g||[0,m]),h=h||n,i=i||d3.scale.linear().domain(o.domain()).range([o(0),o(0)]);{var E=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([b]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),G=(F.append("defs"),F.append("g"));E.select("g")}G.append("g").attr("class","nv-groups"),E.attr("transform","translate("+j.left+","+j.top+")");var H=E.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});H.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),H.exit().watchTransition(C,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),H.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return s(a,b)}).style("stroke",function(a,b){return s(a,b)}),H.watchTransition(C,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",.75);var I=H.selectAll("g.nv-bar").data(function(a){return a.values});I.exit().remove();var J=I.enter().append("g").attr("transform",function(a,c,d){return"translate("+i(u?a.y0:0)+","+(u?0:d*n.rangeBand()/b.length+n(p(a,c)))+")"});J.append("rect").attr("width",0).attr("height",n.rangeBand()/(u?1:b.length)),I.on("mouseover",function(a,c){d3.select(this).classed("hover",!0),B.elementMouseover({value:q(a,c),point:a,series:b[a.series],pos:[o(q(a,c)+(u?a.y0:0)),n(p(a,c))+n.rangeBand()*(u?b.length/2:a.series+.5)/b.length],pointIndex:c,seriesIndex:a.series,e:d3.event})}).on("mouseout",function(a,c){d3.select(this).classed("hover",!1),B.elementMouseout({value:q(a,c),point:a,series:b[a.series],pointIndex:c,seriesIndex:a.series,e:d3.event})}).on("click",function(a,c){B.elementClick({value:q(a,c),point:a,series:b[a.series],pos:[n(p(a,c))+n.rangeBand()*(u?b.length/2:a.series+.5)/b.length,o(q(a,c)+(u?a.y0:0))],pointIndex:c,seriesIndex:a.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(a,c){B.elementDblClick({value:q(a,c),point:a,series:b[a.series],pos:[n(p(a,c))+n.rangeBand()*(u?b.length/2:a.series+.5)/b.length,o(q(a,c)+(u?a.y0:0))],pointIndex:c,seriesIndex:a.series,e:d3.event}),d3.event.stopPropagation()}),J.append("text"),v&&!u?(I.select("text").attr("text-anchor",function(a,b){return q(a,b)<0?"end":"start"}).attr("y",n.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){return y(q(a,b))}),I.watchTransition(C,"multibarhorizontal: bars").select("text").attr("x",function(a,b){return q(a,b)<0?-4:o(q(a,b))-o(0)+4})):I.selectAll("text").text(""),w&&!u?(J.append("text").classed("nv-bar-label",!0),I.select("text.nv-bar-label").attr("text-anchor",function(a,b){return q(a,b)<0?"start":"end"}).attr("y",n.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){return p(a,b)}),I.watchTransition(C,"multibarhorizontal: bars").select("text.nv-bar-label").attr("x",function(a,b){return q(a,b)<0?o(0)-o(q(a,b))+4:-4})):I.selectAll("text.nv-bar-label").text(""),I.attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}),t&&(c||(c=b.map(function(){return!0})),I.style("fill",function(a,b,d){return d3.rgb(t(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(t(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()})),u?I.watchTransition(C,"multibarhorizontal: bars").attr("transform",function(a,b){return"translate("+o(a.y1)+","+n(p(a,b))+")"}).select("rect").attr("width",function(a,b){return Math.abs(o(q(a,b)+a.y0)-o(a.y0))}).attr("height",n.rangeBand()):I.watchTransition(C,"multibarhorizontal: bars").attr("transform",function(a,c){return"translate("+o(q(a,c)<0?q(a,c):0)+","+(a.series*n.rangeBand()/b.length+n(p(a,c)))+")"}).select("rect").attr("height",n.rangeBand()/b.length).attr("width",function(a,b){return Math.max(Math.abs(o(q(a,b))-o(0)),1)}),h=n.copy(),i=o.copy()}),C.renderEnd("multibarHorizontal immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=d3.scale.ordinal(),o=d3.scale.linear(),p=function(a){return a.x},q=function(a){return a.y},r=[0],s=a.utils.defaultColor(),t=null,u=!1,v=!1,w=!1,x=60,y=d3.format(",.2f"),z=1200,A=250,B=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),C=a.utils.renderWatch(B,A);return b.dispatch=B,b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(p=a,b):p},b.y=function(a){return arguments.length?(q=a,b):q},b.margin=function(a){return arguments.length?(j.top="undefined"!=typeof a.top?a.top:j.top,j.right="undefined"!=typeof a.right?a.right:j.right,j.bottom="undefined"!=typeof a.bottom?a.bottom:j.bottom,j.left="undefined"!=typeof a.left?a.left:j.left,b):j},b.width=function(a){return arguments.length?(k=a,b):k},b.height=function(a){return arguments.length?(l=a,b):l},b.xScale=function(a){return arguments.length?(n=a,b):n},b.yScale=function(a){return arguments.length?(o=a,b):o},b.xDomain=function(a){return arguments.length?(d=a,b):d},b.yDomain=function(a){return arguments.length?(e=a,b):e},b.xRange=function(a){return arguments.length?(f=a,b):f},b.yRange=function(a){return arguments.length?(g=a,b):g},b.forceY=function(a){return arguments.length?(r=a,b):r},b.stacked=function(a){return arguments.length?(u=a,b):u},b.color=function(c){return arguments.length?(s=a.utils.getColor(c),b):s},b.barColor=function(c){return arguments.length?(t=a.utils.getColor(c),b):t},b.disabled=function(a){return arguments.length?(c=a,b):c},b.id=function(a){return arguments.length?(m=a,b):m},b.delay=function(a){return arguments.length?(z=a,b):z},b.showValues=function(a){return arguments.length?(v=a,b):v},b.showBarLabels=function(a){return arguments.length?(w=a,b):w},b.valueFormat=function(a){return arguments.length?(y=a,b):y},b.valuePadding=function(a){return arguments.length?(x=a,b):x},b.duration=function(a){return arguments.length?(A=a,C.reset(A),b):A},b},a.models.multiBarHorizontalChart=function(){"use strict";function b(t){return D.reset(),D.models(e),p&&D.models(f),q&&D.models(g),t.each(function(t){var D=d3.select(this),E=this;a.utils.initSVG(D);var F=(k||parseInt(D.style("width"))||960)-j.left-j.right,G=(l||parseInt(D.style("height"))||400)-j.top-j.bottom;if(b.update=function(){D.transition().duration(z).call(b)},b.container=this,r=e.stacked(),u.setter(C(t),b.update).getter(B(t)).update(),u.disabled=t.map(function(a){return!!a.disabled}),!v){var H;v={};for(H in u)v[H]=u[H]instanceof Array?u[H].slice(0):u[H]}if(!(t&&t.length&&t.filter(function(a){return a.values.length}).length)){var I=D.selectAll(".nv-noData").data([w]);return I.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),I.attr("x",j.left+F/2).attr("y",j.top+G/2).text(function(a){return a}),b}D.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var J=D.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([t]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),L=J.select("g");if(K.append("g").attr("class","nv-x nv-axis"),K.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),K.append("g").attr("class","nv-barsWrap"),K.append("g").attr("class","nv-legendWrap"),K.append("g").attr("class","nv-controlsWrap"),o&&(h.width(F-y()),e.barColor()&&t.forEach(function(a,b){a.color=d3.rgb("#ccc").darker(1.5*b).toString()}),L.select(".nv-legendWrap").datum(t).call(h),j.top!=h.height()&&(j.top=h.height(),G=(l||parseInt(D.style("height"))||400)-j.top-j.bottom),L.select(".nv-legendWrap").attr("transform","translate("+y()+","+-j.top+")")),n){var M=[{key:"Grouped",disabled:e.stacked()},{key:"Stacked",disabled:!e.stacked()}];i.width(y()).color(["#444","#444","#444"]),L.select(".nv-controlsWrap").datum(M).attr("transform","translate(0,"+-j.top+")").call(i)}J.attr("transform","translate("+j.left+","+j.top+")"),e.disabled(t.map(function(a){return a.disabled})).width(F).height(G).color(t.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!t[b].disabled}));var N=L.select(".nv-barsWrap").datum(t.filter(function(a){return!a.disabled}));if(N.transition().call(e),p){f.scale(c).ticks(a.utils.calcTicksY(G/24,t)).tickSize(-F,0),L.select(".nv-x.nv-axis").call(f);var O=L.select(".nv-x.nv-axis").selectAll("g");O.selectAll("line, text")}q&&(g.scale(d).ticks(a.utils.calcTicksX(F/100,t)).tickSize(-G,0),L.select(".nv-y.nv-axis").attr("transform","translate(0,"+G+")"),L.select(".nv-y.nv-axis").call(g)),L.select(".nv-zeroLine line").attr("x1",d(0)).attr("x2",d(0)).attr("y1",0).attr("y2",-G),h.dispatch.on("stateChange",function(a){for(var c in a)u[c]=a[c];x.stateChange(u),b.update()}),i.dispatch.on("legendClick",function(a){if(a.disabled){switch(M=M.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":e.stacked(!1);break;case"Stacked":e.stacked(!0)}u.stacked=e.stacked(),x.stateChange(u),r=e.stacked(),b.update()}}),x.on("tooltipShow",function(a){s&&A(a,E.parentNode)}),x.on("changeState",function(a){"undefined"!=typeof a.disabled&&(t.forEach(function(b,c){b.disabled=a.disabled[c]}),u.disabled=a.disabled),"undefined"!=typeof a.stacked&&(e.stacked(a.stacked),u.stacked=a.stacked,r=a.stacked),b.update()})}),D.renderEnd("multibar horizontal chart immediate"),b}var c,d,e=a.models.multiBarHorizontal(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend().height(30),i=a.models.legend().height(30),j={top:30,right:20,bottom:50,left:60},k=null,l=null,m=a.utils.defaultColor(),n=!0,o=!0,p=!0,q=!0,r=!1,s=!0,t=function(a,b,c){return"<h3>"+a+" - "+b+"</h3><p>"+c+"</p>"},u=a.utils.state(),v=null,w="No Data Available.",x=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),y=function(){return n?180:0},z=250;u.stacked=!1,e.stacked(r),f.orient("left").tickPadding(5).highlightZero(!1).showMaxMin(!1).tickFormat(function(a){return a}),g.orient("bottom").tickFormat(d3.format(",.1f")),i.updateState(!1);var A=function(c,d){var h=c.pos[0]+(d.offsetLeft||0),i=c.pos[1]+(d.offsetTop||0),j=f.tickFormat()(e.x()(c.point,c.pointIndex)),k=g.tickFormat()(e.y()(c.point,c.pointIndex)),l=t(c.series.key,j,k,c,b);a.tooltip.show([h,i],l,c.value<0?"e":"w",null,d)},B=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:r}}},C=function(a){return function(b){void 0!==b.stacked&&(r=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},D=a.utils.renderWatch(x,z);e.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],x.tooltipShow(a)}),e.dispatch.on("elementMouseout.tooltip",function(a){x.tooltipHide(a)}),x.on("tooltipHide",function(){s&&a.tooltip.cleanup()}),b.dispatch=x,b.multibar=e,b.legend=h,b.xAxis=f,b.yAxis=g,b.state=u,d3.rebind(b,e,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","clipEdge","id","delay","showValues","showBarLabels","valueFormat","stacked","barColor"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(j.top="undefined"!=typeof a.top?a.top:j.top,j.right="undefined"!=typeof a.right?a.right:j.right,j.bottom="undefined"!=typeof a.bottom?a.bottom:j.bottom,j.left="undefined"!=typeof a.left?a.left:j.left,b):j},b.width=function(a){return arguments.length?(k=a,b):k},b.height=function(a){return arguments.length?(l=a,b):l},b.color=function(c){return arguments.length?(m=a.utils.getColor(c),h.color(m),b):m},b.showControls=function(a){return arguments.length?(n=a,b):n},b.showLegend=function(a){return arguments.length?(o=a,b):o},b.showXAxis=function(a){return arguments.length?(p=a,b):p},b.showYAxis=function(a){return arguments.length?(q=a,b):q},b.tooltip=function(a){return arguments.length?(t=a,b):t},b.tooltips=function(a){return arguments.length?(s=a,b):s},b.tooltipContent=function(a){return arguments.length?(t=a,b):t},b.state=function(c){return a.deprecated("multiBarHorizontalChart.state"),arguments.length?(u=c,b):u};for(var E in u)b.state[E]=u[E];return b.defaultState=function(a){return arguments.length?(v=a,b):v},b.noData=function(a){return arguments.length?(w=a,b):w},b.transitionDuration=function(c){return a.deprecated("multiBarHorizontalChart.transitionDuration"),b.duration(c)},b.duration=function(a){return arguments.length?(z=a,D.reset(z),e.duration(z),f.duration(z),g.duration(z),b):z},b},a.models.multiChart=function(){"use strict";function b(l){return l.each(function(l){var m=d3.select(this),n=this;a.utils.initSVG(m),b.update=function(){m.transition().call(b)},b.container=this;var D=(h||parseInt(m.style("width"))||960)-f.left-f.right,E=(i||parseInt(m.style("height"))||400)-f.top-f.bottom,F=l.filter(function(a){return!a.disabled&&"line"==a.type&&1==a.yAxis}),G=l.filter(function(a){return!a.disabled&&"line"==a.type&&2==a.yAxis
6 }),H=l.filter(function(a){return!a.disabled&&"bar"==a.type&&1==a.yAxis}),I=l.filter(function(a){return!a.disabled&&"bar"==a.type&&2==a.yAxis}),J=l.filter(function(a){return!a.disabled&&"area"==a.type&&1==a.yAxis}),K=l.filter(function(a){return!a.disabled&&"area"==a.type&&2==a.yAxis}),L=l.filter(function(a){return!a.disabled&&1==a.yAxis}).map(function(a){return a.values.map(function(a){return{x:a.x,y:a.y}})}),M=l.filter(function(a){return!a.disabled&&2==a.yAxis}).map(function(a){return a.values.map(function(a){return{x:a.x,y:a.y}})});c.domain(d3.extent(d3.merge(L.concat(M)),function(a){return a.x})).range([0,D]);var N=m.selectAll("g.wrap.multiChart").data([l]),O=N.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");O.append("g").attr("class","x axis"),O.append("g").attr("class","y1 axis"),O.append("g").attr("class","y2 axis"),O.append("g").attr("class","lines1Wrap"),O.append("g").attr("class","lines2Wrap"),O.append("g").attr("class","bars1Wrap"),O.append("g").attr("class","bars2Wrap"),O.append("g").attr("class","stack1Wrap"),O.append("g").attr("class","stack2Wrap"),O.append("g").attr("class","legendWrap");var P=N.select("g");j&&(A.width(D/2),P.select(".legendWrap").datum(l.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(1==a.yAxis?"":" (right axis)"),a})).call(A),f.top!=A.height()&&(f.top=A.height(),E=(i||parseInt(m.style("height"))||400)-f.top-f.bottom),P.select(".legendWrap").attr("transform","translate("+D/2+","+-f.top+")")),r.width(D).height(E).interpolate(o).color(l.map(function(a,b){return a.color||g[b%g.length]}).filter(function(a,b){return!l[b].disabled&&1==l[b].yAxis&&"line"==l[b].type})),s.width(D).height(E).interpolate(o).color(l.map(function(a,b){return a.color||g[b%g.length]}).filter(function(a,b){return!l[b].disabled&&2==l[b].yAxis&&"line"==l[b].type})),t.width(D).height(E).color(l.map(function(a,b){return a.color||g[b%g.length]}).filter(function(a,b){return!l[b].disabled&&1==l[b].yAxis&&"bar"==l[b].type})),u.width(D).height(E).color(l.map(function(a,b){return a.color||g[b%g.length]}).filter(function(a,b){return!l[b].disabled&&2==l[b].yAxis&&"bar"==l[b].type})),v.width(D).height(E).color(l.map(function(a,b){return a.color||g[b%g.length]}).filter(function(a,b){return!l[b].disabled&&1==l[b].yAxis&&"area"==l[b].type})),w.width(D).height(E).color(l.map(function(a,b){return a.color||g[b%g.length]}).filter(function(a,b){return!l[b].disabled&&2==l[b].yAxis&&"area"==l[b].type})),P.attr("transform","translate("+f.left+","+f.top+")");var Q=P.select(".lines1Wrap").datum(F),R=P.select(".bars1Wrap").datum(H),S=P.select(".stack1Wrap").datum(J),T=P.select(".lines2Wrap").datum(G),U=P.select(".bars2Wrap").datum(I),V=P.select(".stack2Wrap").datum(K),W=J.length?J.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[],X=K.length?K.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[];p.domain(d||d3.extent(d3.merge(L).concat(W),function(a){return a.y})).range([0,E]),q.domain(e||d3.extent(d3.merge(M).concat(X),function(a){return a.y})).range([0,E]),r.yDomain(p.domain()),t.yDomain(p.domain()),v.yDomain(p.domain()),s.yDomain(q.domain()),u.yDomain(q.domain()),w.yDomain(q.domain()),J.length&&d3.transition(S).call(v),K.length&&d3.transition(V).call(w),H.length&&d3.transition(R).call(t),I.length&&d3.transition(U).call(u),F.length&&d3.transition(Q).call(r),G.length&&d3.transition(T).call(s),x.ticks(a.utils.calcTicksX(D/100,l)).tickSize(-E,0),P.select(".x.axis").attr("transform","translate(0,"+E+")"),d3.transition(P.select(".x.axis")).call(x),y.ticks(a.utils.calcTicksY(E/36,l)).tickSize(-D,0),d3.transition(P.select(".y1.axis")).call(y),z.ticks(a.utils.calcTicksY(E/36,l)).tickSize(-D,0),d3.transition(P.select(".y2.axis")).call(z),P.select(".y2.axis").style("opacity",M.length?1:0).attr("transform","translate("+c.range()[1]+",0)"),A.dispatch.on("stateChange",function(){b.update()}),B.on("tooltipShow",function(a){k&&C(a,n.parentNode)})}),b}var c,d,e,f={top:30,right:20,bottom:50,left:60},g=a.utils.defaultColor(),h=null,i=null,j=!0,k=!0,l=function(a,b,c){return"<h3>"+a+"</h3><p>"+c+" at "+b+"</p>"},m=function(a){return a.x},n=function(a){return a.y},o="monotone",c=d3.scale.linear(),p=d3.scale.linear(),q=d3.scale.linear(),r=a.models.line().yScale(p),s=a.models.line().yScale(q),t=a.models.multiBar().stacked(!1).yScale(p),u=a.models.multiBar().stacked(!1).yScale(q),v=a.models.stackedArea().yScale(p),w=a.models.stackedArea().yScale(q),x=a.models.axis().scale(c).orient("bottom").tickPadding(5),y=a.models.axis().scale(p).orient("left"),z=a.models.axis().scale(q).orient("right"),A=a.models.legend().height(30),B=d3.dispatch("tooltipShow","tooltipHide"),C=function(c,d){var e=c.pos[0]+(d.offsetLeft||0),f=c.pos[1]+(d.offsetTop||0),g=x.tickFormat()(r.x()(c.point,c.pointIndex)),h=(2==c.series.yAxis?z:y).tickFormat()(r.y()(c.point,c.pointIndex)),i=l(c.series.key,g,h,c,b);a.tooltip.show([e,f],i,void 0,void 0,d.offsetParent)};return r.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+f.left,a.pos[1]+f.top],B.tooltipShow(a)}),r.dispatch.on("elementMouseout.tooltip",function(a){B.tooltipHide(a)}),s.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+f.left,a.pos[1]+f.top],B.tooltipShow(a)}),s.dispatch.on("elementMouseout.tooltip",function(a){B.tooltipHide(a)}),t.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+f.left,a.pos[1]+f.top],B.tooltipShow(a)}),t.dispatch.on("elementMouseout.tooltip",function(a){B.tooltipHide(a)}),u.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+f.left,a.pos[1]+f.top],B.tooltipShow(a)}),u.dispatch.on("elementMouseout.tooltip",function(a){B.tooltipHide(a)}),v.dispatch.on("tooltipShow",function(a){return Math.round(100*v.y()(a.point))?(a.pos=[a.pos[0]+f.left,a.pos[1]+f.top],void B.tooltipShow(a)):(setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0),!1)}),v.dispatch.on("tooltipHide",function(a){B.tooltipHide(a)}),w.dispatch.on("tooltipShow",function(a){return Math.round(100*w.y()(a.point))?(a.pos=[a.pos[0]+f.left,a.pos[1]+f.top],void B.tooltipShow(a)):(setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0),!1)}),w.dispatch.on("tooltipHide",function(a){B.tooltipHide(a)}),r.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+f.left,a.pos[1]+f.top],B.tooltipShow(a)}),r.dispatch.on("elementMouseout.tooltip",function(a){B.tooltipHide(a)}),s.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+f.left,a.pos[1]+f.top],B.tooltipShow(a)}),s.dispatch.on("elementMouseout.tooltip",function(a){B.tooltipHide(a)}),B.on("tooltipHide",function(){k&&a.tooltip.cleanup()}),b.dispatch=B,b.lines1=r,b.lines2=s,b.bars1=t,b.bars2=u,b.stack1=v,b.stack2=w,b.xAxis=x,b.yAxis1=y,b.yAxis2=z,b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(m=a,r.x(a),t.x(a),b):m},b.y=function(a){return arguments.length?(n=a,r.y(a),t.y(a),b):n},b.yDomain1=function(a){return arguments.length?(d=a,b):d},b.yDomain2=function(a){return arguments.length?(e=a,b):e},b.margin=function(a){return arguments.length?(f=a,b):f},b.width=function(a){return arguments.length?(h=a,b):h},b.height=function(a){return arguments.length?(i=a,b):i},b.color=function(a){return arguments.length?(g=a,A.color(a),b):g},b.showLegend=function(a){return arguments.length?(j=a,b):j},b.tooltips=function(a){return arguments.length?(k=a,b):k},b.tooltipContent=function(a){return arguments.length?(l=a,b):l},b.interpolate=function(a){return arguments.length?(o=a,b):o},b},a.models.ohlcBar=function(){"use strict";function b(w){return w.each(function(b){var w=h-g.left-g.right,y=i-g.top-g.bottom,z=d3.select(this);a.utils.initSVG(z),k.domain(c||d3.extent(b[0].values.map(m).concat(s))),k.range(u?e||[.5*w/b[0].values.length,w*(b[0].values.length-.5)/b[0].values.length]:e||[0,w]),l.domain(d||[d3.min(b[0].values.map(r).concat(t)),d3.max(b[0].values.map(q).concat(t))]).range(f||[y,0]),k.domain()[0]===k.domain()[1]&&k.domain(k.domain()[0]?[k.domain()[0]-.01*k.domain()[0],k.domain()[1]+.01*k.domain()[1]]:[-1,1]),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]+.01*l.domain()[0],l.domain()[1]-.01*l.domain()[1]]:[-1,1]);var A=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([b[0].values]),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),C=B.append("defs"),D=B.append("g"),E=A.select("g");D.append("g").attr("class","nv-ticks"),A.attr("transform","translate("+g.left+","+g.top+")"),z.on("click",function(a,b){x.chartClick({data:a,index:b,pos:d3.event,id:j})}),C.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),A.select("#nv-chart-clip-path-"+j+" rect").attr("width",w).attr("height",y),E.attr("clip-path",v?"url(#nv-chart-clip-path-"+j+")":"");var F=A.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});F.exit().remove();F.enter().append("path").attr("class",function(a,b,c){return(o(a,b)>p(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}).attr("d",function(a,c){var d=w/b[0].values.length*.9;return"m0,0l0,"+(l(o(a,c))-l(q(a,c)))+"l"+-d/2+",0l"+d/2+",0l0,"+(l(r(a,c))-l(o(a,c)))+"l0,"+(l(p(a,c))-l(r(a,c)))+"l"+d/2+",0l"+-d/2+",0z"}).attr("transform",function(a,b){return"translate("+k(m(a,b))+","+l(q(a,b))+")"}).on("mouseover",function(a,c){d3.select(this).classed("hover",!0),x.elementMouseover({point:a,series:b[0],pos:[k(m(a,c)),l(n(a,c))],pointIndex:c,seriesIndex:0,e:d3.event})}).on("mouseout",function(a,c){d3.select(this).classed("hover",!1),x.elementMouseout({point:a,series:b[0],pointIndex:c,seriesIndex:0,e:d3.event})}).on("click",function(a,b){x.elementClick({value:n(a,b),data:a,index:b,pos:[k(m(a,b)),l(n(a,b))],e:d3.event,id:j}),d3.event.stopPropagation()}).on("dblclick",function(a,b){x.elementDblClick({value:n(a,b),data:a,index:b,pos:[k(m(a,b)),l(n(a,b))],e:d3.event,id:j}),d3.event.stopPropagation()});F.attr("class",function(a,b,c){return(o(a,b)>p(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}),d3.transition(F).attr("transform",function(a,b){return"translate("+k(m(a,b))+","+l(q(a,b))+")"}).attr("d",function(a,c){var d=w/b[0].values.length*.9;return"m0,0l0,"+(l(o(a,c))-l(q(a,c)))+"l"+-d/2+",0l"+d/2+",0l0,"+(l(r(a,c))-l(o(a,c)))+"l0,"+(l(p(a,c))-l(r(a,c)))+"l"+d/2+",0l"+-d/2+",0z"})}),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=960,i=500,j=Math.floor(1e4*Math.random()),k=d3.scale.linear(),l=d3.scale.linear(),m=function(a){return a.x},n=function(a){return a.y},o=function(a){return a.open},p=function(a){return a.close},q=function(a){return a.high},r=function(a){return a.low},s=[],t=[],u=!1,v=!0,w=a.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return b.dispatch=x,b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(m=a,b):m},b.y=function(a){return arguments.length?(n=a,b):n},b.open=function(a){return arguments.length?(o=a,b):o},b.close=function(a){return arguments.length?(p=a,b):p},b.high=function(a){return arguments.length?(q=a,b):q},b.low=function(a){return arguments.length?(r=a,b):r},b.margin=function(a){return arguments.length?(g.top="undefined"!=typeof a.top?a.top:g.top,g.right="undefined"!=typeof a.right?a.right:g.right,g.bottom="undefined"!=typeof a.bottom?a.bottom:g.bottom,g.left="undefined"!=typeof a.left?a.left:g.left,b):g},b.width=function(a){return arguments.length?(h=a,b):h},b.height=function(a){return arguments.length?(i=a,b):i},b.xScale=function(a){return arguments.length?(k=a,b):k},b.yScale=function(a){return arguments.length?(l=a,b):l},b.xDomain=function(a){return arguments.length?(c=a,b):c},b.yDomain=function(a){return arguments.length?(d=a,b):d},b.xRange=function(a){return arguments.length?(e=a,b):e},b.yRange=function(a){return arguments.length?(f=a,b):f},b.forceX=function(a){return arguments.length?(s=a,b):s},b.forceY=function(a){return arguments.length?(t=a,b):t},b.padData=function(a){return arguments.length?(u=a,b):u},b.clipEdge=function(a){return arguments.length?(v=a,b):v},b.color=function(c){return arguments.length?(w=a.utils.getColor(c),b):w},b.id=function(a){return arguments.length?(j=a,b):j},b},a.models.pie=function(){"use strict";function b(k){return A.reset(),k.each(function(b){function k(a){a.endAngle=isNaN(a.endAngle)?0:a.endAngle,a.startAngle=isNaN(a.startAngle)?0:a.startAngle,r||(a.innerRadius=0);var b=d3.interpolate(this._current,a);return this._current=b(0),function(a){return L(b(a))}}var B=e-c.left-c.right,C=f-c.top-c.bottom,D=Math.min(B,C)/2,E=D-D/5,F=d3.select(this);a.utils.initSVG(F);var G=F.selectAll(".nv-wrap.nv-pie").data(b),H=G.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+i),I=H.append("g"),J=G.select("g"),K=I.append("g").attr("class","nv-pie");I.append("g").attr("class","nv-pieLabels"),G.attr("transform","translate("+c.left+","+c.top+")"),J.select(".nv-pie").attr("transform","translate("+B/2+","+C/2+")"),J.select(".nv-pieLabels").attr("transform","translate("+B/2+","+C/2+")"),F.on("click",function(a,b){z.chartClick({data:a,index:b,pos:d3.event,id:i})});var L=d3.svg.arc().outerRadius(E),M=d3.svg.arc().outerRadius(E+5);w&&(L.startAngle(w),M.startAngle(w)),x&&(L.endAngle(x),M.endAngle(x)),r&&(L.innerRadius(D*y),M.innerRadius(D*y));var N=d3.layout.pie().sort(null).value(function(a){return a.disabled?0:h(a)});if(r&&s){var O=K.append("g").attr("class","nv-pie");O.append("text").style("text-anchor","middle").attr("class","nv-pie-title").text(function(){return s}).attr("dy","0.35em").attr("transform",function(){return"translate(0, "+u+")"})}var P=G.select(".nv-pie").selectAll(".nv-slice").data(N),Q=G.select(".nv-pieLabels").selectAll(".nv-label").data(N);P.exit().remove(),Q.exit().remove();var R=P.enter().append("g");R.attr("class","nv-slice"),R.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),t&&d3.select(this).select("path").transition().duration(70).attr("d",M),z.elementMouseover({label:g(a.data),value:h(a.data),point:a.data,pointIndex:b,pos:[d3.event.pageX,d3.event.pageY],id:i,color:d3.select(this).style("fill")})}),R.on("mouseout",function(a,b){d3.select(this).classed("hover",!1),t&&d3.select(this).select("path").transition().duration(50).attr("d",L),z.elementMouseout({label:g(a.data),value:h(a.data),point:a.data,index:b,id:i})}),R.on("click",function(a,b){z.elementClick({label:g(a.data),value:h(a.data),point:a.data,index:b,pos:d3.event,id:i}),d3.event.stopPropagation()}),R.on("dblclick",function(a,b){z.elementDblClick({label:g(a.data),value:h(a.data),point:a.data,index:b,pos:d3.event,id:i}),d3.event.stopPropagation()}),P.attr("fill",function(a,b){return j(a,b)}),P.attr("stroke",function(a,b){return j(a,b)});R.append("path").each(function(a){this._current=a});if(P.select("path").transition().attr("d",L).attrTween("d",k),m){var S=d3.svg.arc().innerRadius(0);if(n)var S=L;o&&(S=d3.svg.arc().outerRadius(L.outerRadius())),Q.enter().append("g").classed("nv-label",!0).each(function(a){var b=d3.select(this);b.attr("transform",function(a){if(v){a.outerRadius=E+10,a.innerRadius=E+15;var b=(a.startAngle+a.endAngle)/2*(180/Math.PI);return(a.startAngle+a.endAngle)/2<Math.PI?b-=90:b+=90,"translate("+S.centroid(a)+") rotate("+b+")"}return a.outerRadius=D+10,a.innerRadius=D+15,"translate("+S.centroid(a)+")"}),b.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),b.append("text").style("text-anchor",v?(a.startAngle+a.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")});var T={},U=14,V=140,W=function(a){return Math.floor(a[0]/V)*V+","+Math.floor(a[1]/U)*U};Q.watchTransition(A,"pie labels").attr("transform",function(a){if(v){a.outerRadius=E+10,a.innerRadius=E+15;var b=(a.startAngle+a.endAngle)/2*(180/Math.PI);return(a.startAngle+a.endAngle)/2<Math.PI?b-=90:b+=90,"translate("+S.centroid(a)+") rotate("+b+")"}a.outerRadius=D+10,a.innerRadius=D+15;var c=S.centroid(a);if(a.value){var d=W(c);T[d]&&(c[1]-=U),T[W(c)]=!0}return"translate("+c+")"}),Q.select(".nv-label text").style("text-anchor",v?(d.startAngle+d.endAngle)/2<Math.PI?"start":"end":"middle").text(function(a){var b=(a.endAngle-a.startAngle)/(2*Math.PI),c={key:g(a.data),value:h(a.data),percent:l(b)};return a.value&&b>q?c[p]:""})}}),A.renderEnd("pie immediate"),b}var c={top:0,right:0,bottom:0,left:0},e=500,f=500,g=function(a){return a.x},h=function(a){return a.y},i=Math.floor(1e4*Math.random()),j=a.utils.defaultColor(),k=d3.format(",.2f"),l=d3.format("%"),m=!0,n=!0,o=!1,p="key",q=.02,r=!1,s=!1,t=!0,u=0,v=!1,w=!1,x=!1,y=.5,z=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),A=a.utils.renderWatch(z);return b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return e},set:function(a){e=a}},height:{get:function(){return f},set:function(a){f=a}},showLabels:{get:function(){return m},set:function(a){m=a}},title:{get:function(){return s},set:function(a){s=a}},titleOffset:{get:function(){return u},set:function(a){u=a}},labelThreshold:{get:function(){return q},set:function(a){q=a}},labelFormat:{get:function(){return l},set:function(a){l=a}},valueFormat:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return g},set:function(a){g=a}},id:{get:function(){return i},set:function(a){i=a}},endAngle:{get:function(){return x},set:function(a){x=a}},startAngle:{get:function(){return w},set:function(a){w=a}},donutRatio:{get:function(){return y},set:function(a){y=a}},pieLabelsOutside:{get:function(){return n},set:function(a){n=a}},donutLabelsOutside:{get:function(){return o},set:function(a){o=a}},labelSunbeamLayout:{get:function(){return v},set:function(a){v=a}},donut:{get:function(){return r},set:function(a){r=a}},growOnHover:{get:function(){return t},set:function(a){t=a}},margin:{get:function(){return c},set:function(a){c.top="undefined"!=typeof a.top?a.top:c.top,c.right="undefined"!=typeof a.right?a.right:c.right,c.bottom="undefined"!=typeof a.bottom?a.bottom:c.bottom,c.left="undefined"!=typeof a.left?a.left:c.left}},y:{get:function(){return h},set:function(a){h=d3.functor(a)}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}},labelType:{get:function(){return p},set:function(a){p=a||"key"}}}),a.utils.initOptions(b),b},a.models.pieChart=function(){"use strict";function b(i){return r.reset(),r.models(c),i.each(function(i){var j=d3.select(this);a.utils.initSVG(j);var k=(f||parseInt(j.style("width"),10)||960)-e.left-e.right,o=(g||parseInt(j.style("height"),10)||400)-e.top-e.bottom;if(b.update=function(){j.transition().call(b)},b.container=this,l.setter(t(i),b.update).getter(s(i)).update(),l.disabled=i.map(function(a){return!!a.disabled}),!m){var q;m={};for(q in l)m[q]=l[q]instanceof Array?l[q].slice(0):l[q]}if(!i||!i.length){var r=j.selectAll(".nv-noData").data([n]);return r.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),r.attr("x",e.left+k/2).attr("y",e.top+o/2).text(function(a){return a}),b}j.selectAll(".nv-noData").remove();var u=j.selectAll("g.nv-wrap.nv-pieChart").data([i]),v=u.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),w=u.select("g");v.append("g").attr("class","nv-pieWrap"),v.append("g").attr("class","nv-legendWrap"),h&&(d.width(k).key(c.x()),u.select(".nv-legendWrap").datum(i).call(d),e.top!=d.height()&&(e.top=d.height(),o=(g||parseInt(j.style("height"))||400)-e.top-e.bottom),u.select(".nv-legendWrap").attr("transform","translate(0,"+-e.top+")")),u.attr("transform","translate("+e.left+","+e.top+")"),c.width(k).height(o);var x=w.select(".nv-pieWrap").datum([i]);d3.transition(x).call(c),d.dispatch.on("stateChange",function(a){for(var c in a)l[c]=a[c];p.stateChange(l),b.update()}),c.dispatch.on("elementMouseout.tooltip",function(a){p.tooltipHide(a)}),p.on("changeState",function(a){"undefined"!=typeof a.disabled&&(i.forEach(function(b,c){b.disabled=a.disabled[c]}),l.disabled=a.disabled),b.update()})}),r.renderEnd("pieChart immediate"),b}var c=a.models.pie(),d=a.models.legend(),e={top:30,right:20,bottom:20,left:20},f=null,g=null,h=!0,i=a.utils.defaultColor(),j=!0,k=function(a,b,c){return'<h3 style="background-color: '+c.color+'">'+a+"</h3><p>"+b+"</p>"},l=a.utils.state(),m=null,n="No Data Available.",o=250,p=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),q=function(d,e){var f=c.x()(d.point),g=d.pos[0]+(e&&e.offsetLeft||0),h=d.pos[1]+(e&&e.offsetTop||0),i=c.valueFormat()(c.y()(d.point)),j=k(f,i,d,b);a.tooltip.show([g,h],j,d.value<0?"n":"s",null,e)},r=a.utils.renderWatch(p),s=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},t=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return c.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],p.tooltipShow(a)}),p.on("tooltipShow",function(a){j&&q(a)}),p.on("tooltipHide",function(){j&&a.tooltip.cleanup()}),b.legend=d,b.dispatch=p,b.pie=c,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return n},set:function(a){n=a}},tooltipContent:{get:function(){return k},set:function(a){k=a}},tooltips:{get:function(){return j},set:function(a){j=a}},showLegend:{get:function(){return h},set:function(a){h=a}},defaultState:{get:function(){return m},set:function(a){m=a}},color:{get:function(){return i},set:function(a){i=a,d.color(i),c.color(i)}},duration:{get:function(){return o},set:function(a){o=a,r.reset(o)}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.scatter=function(){"use strict";function b(N){return P.reset(),N.each(function(b){function N(){if(!w)return!1;var a=d3.merge(b.map(function(a,b){return a.values.map(function(a,c){var d=o(a,c),e=p(a,c);return[l(d)+1e-7*Math.random(),m(e)+1e-7*Math.random(),b,c,a]}).filter(function(a,b){return y(a[4],b)})}));if(M===!0){if(C){var c=U.select("defs").selectAll(".nv-point-clips").data([k]).enter();c.append("clipPath").attr("class","nv-point-clips").attr("id","nv-points-clip-"+k);var d=U.select("#nv-points-clip-"+k).selectAll("circle").data(a);d.enter().append("circle").attr("r",D),d.exit().remove(),d.attr("cx",function(a){return a[0]}).attr("cy",function(a){return a[1]}),U.select(".nv-point-paths").attr("clip-path","url(#nv-points-clip-"+k+")")}a.length&&(a.push([l.range()[0]-20,m.range()[0]-20,null,null]),a.push([l.range()[1]+20,m.range()[1]+20,null,null]),a.push([l.range()[0]-20,m.range()[0]+20,null,null]),a.push([l.range()[1]+20,m.range()[1]-20,null,null]));var e=d3.geom.polygon([[-10,-10],[-10,i+10],[h+10,i+10],[h+10,-10]]),f=d3.geom.voronoi(a).map(function(b,c){return{data:e.clip(b),series:a[c][2],point:a[c][3]}}),j=U.select(".nv-point-paths").selectAll("path").data(f);j.enter().append("path").attr("class",function(a,b){return"nv-path-"+b}),j.exit().remove(),j.attr("d",function(a){return a&&a.data&&0!==a.data.length?"M"+a.data.join("L")+"Z":"M 0 0"});var n=function(a,c){if(O)return 0;var d=b[a.series];if("undefined"!=typeof d){var e=d.values[a.point];c({point:e,series:d,pos:[l(o(e,a.point))+g.left,m(p(e,a.point))+g.top],seriesIndex:a.series,pointIndex:a.point})}};j.on("click",function(a){n(a,L.elementClick)}).on("dblclick",function(a){n(a,L.elementDblClick)}).on("mouseover",function(a){n(a,L.elementMouseover)}).on("mouseout",function(a){n(a,L.elementMouseout)})}else U.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementClick({point:e,series:d,pos:[l(o(e,c))+g.left,m(p(e,c))+g.top],seriesIndex:a.series,pointIndex:c})}).on("mouseover",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementMouseover({point:e,series:d,pos:[l(o(e,c))+g.left,m(p(e,c))+g.top],seriesIndex:a.series,pointIndex:c})}).on("mouseout",function(a,c){if(O||!b[a.series])return 0;var d=b[a.series],e=d.values[c];L.elementMouseout({point:e,series:d,seriesIndex:a.series,pointIndex:c})});O=!1}var Q=h-g.left-g.right,R=i-g.top-g.bottom,S=d3.select(this);a.utils.initSVG(S),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var T=E&&F&&I?[]:d3.merge(b.map(function(a){return a.values.map(function(a,b){return{x:o(a,b),y:p(a,b),size:q(a,b)}})}));l.domain(E||d3.extent(T.map(function(a){return a.x}).concat(t))),l.range(z&&b[0]?G||[(Q*A+Q)/(2*b[0].values.length),Q-Q*(1+A)/(2*b[0].values.length)]:G||[0,Q]),m.domain(F||d3.extent(T.map(function(a){return a.y}).concat(u))).range(H||[R,0]),n.domain(I||d3.extent(T.map(function(a){return a.size}).concat(v))).range(J||[16,256]),(l.domain()[0]===l.domain()[1]||m.domain()[0]===m.domain()[1])&&(K=!0),l.domain()[0]===l.domain()[1]&&l.domain(l.domain()[0]?[l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]:[-1,1]),m.domain()[0]===m.domain()[1]&&m.domain(m.domain()[0]?[m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]:[-1,1]),isNaN(l.domain()[0])&&l.domain([-1,1]),isNaN(m.domain()[0])&&m.domain([-1,1]),c=c||l,d=d||m,e=e||n;var U=S.selectAll("g.nv-wrap.nv-scatter").data([b]),V=U.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+k+(K?" nv-single-point":"")),W=V.append("defs"),X=V.append("g"),Y=U.select("g");X.append("g").attr("class","nv-groups"),X.append("g").attr("class","nv-point-paths"),U.attr("transform","translate("+g.left+","+g.top+")"),W.append("clipPath").attr("id","nv-edge-clip-"+k).append("rect"),U.select("#nv-edge-clip-"+k+" rect").attr("width",Q).attr("height",R>0?R:0),Y.attr("clip-path",B?"url(#nv-edge-clip-"+k+")":""),O=!0;var Z=U.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});if(Z.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),Z.exit().remove(),Z.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),Z.watchTransition(P,"scatter: groups").style("fill",function(a,b){return j(a,b)}).style("stroke",function(a,b){return j(a,b)}).style("stroke-opacity",1).style("fill-opacity",.5),s){var $=Z.selectAll("circle.nv-point").data(function(a){return a.values},x);$.enter().append("circle").style("fill",function(a){return a.color}).style("stroke",function(a){return a.color}).attr("cx",function(b,d){return a.utils.NaNtoZero(c(o(b,d)))}).attr("cy",function(b,c){return a.utils.NaNtoZero(d(p(b,c)))}).attr("r",function(a,b){return Math.sqrt(n(q(a,b))/Math.PI)}),$.exit().remove(),Z.exit().selectAll("path.nv-point").watchTransition(P,"scatter exit").attr("cx",function(b,c){return a.utils.NaNtoZero(l(o(b,c)))}).attr("cy",function(b,c){return a.utils.NaNtoZero(m(p(b,c)))}).remove(),$.each(function(a,b){d3.select(this).classed("nv-point",!0).classed("nv-point-"+b,!0).classed("hover",!1)}),$.watchTransition(P,"scatter points").attr("cx",function(b,c){return a.utils.NaNtoZero(l(o(b,c)))}).attr("cy",function(b,c){return a.utils.NaNtoZero(m(p(b,c)))}).attr("r",function(a,b){return Math.sqrt(n(q(a,b))/Math.PI)})}else{var $=Z.selectAll("path.nv-point").data(function(a){return a.values});$.enter().append("path").style("fill",function(a){return a.color}).style("stroke",function(a){return a.color}).attr("transform",function(a,b){return"translate("+c(o(a,b))+","+d(p(a,b))+")"}).attr("d",d3.svg.symbol().type(r).size(function(a,b){return n(q(a,b))})),$.exit().remove(),Z.exit().selectAll("path.nv-point").watchTransition(P,"scatter exit").attr("transform",function(a,b){return"translate("+l(o(a,b))+","+m(p(a,b))+")"}).remove(),$.each(function(a,b){d3.select(this).classed("nv-point",!0).classed("nv-point-"+b,!0).classed("hover",!1)}),$.watchTransition(P,"scatter points").attr("transform",function(a,b){return"translate("+l(o(a,b))+","+m(p(a,b))+")"}).attr("d",d3.svg.symbol().type(r).size(function(a,b){return n(q(a,b))}))}clearTimeout(f),f=setTimeout(N,300),c=l.copy(),d=m.copy(),e=n.copy()}),P.renderEnd("scatter immediate"),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=960,i=500,j=a.utils.defaultColor(),k=Math.floor(1e5*Math.random()),l=d3.scale.linear(),m=d3.scale.linear(),n=d3.scale.linear(),o=function(a){return a.x},p=function(a){return a.y},q=function(a){return a.size||1},r=function(a){return a.shape||"circle"},s=!0,t=[],u=[],v=[],w=!0,x=null,y=function(a){return!a.notActive},z=!1,A=.1,B=!1,C=!0,D=function(){return 25},E=null,F=null,G=null,H=null,I=null,J=null,K=!1,L=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),M=!0,N=250,O=!1,P=a.utils.renderWatch(L,N);return b.clearHighlights=function(){d3.selectAll(".nv-chart-"+k+" .nv-point.hover").classed("hover",!1)},b.highlightPoint=function(a,b,c){d3.select(".nv-chart-"+k+" .nv-series-"+a+" .nv-point-"+b).classed("hover",c)},L.on("elementMouseover.point",function(a){w&&b.highlightPoint(a.seriesIndex,a.pointIndex,!0)}),L.on("elementMouseout.point",function(a){w&&b.highlightPoint(a.seriesIndex,a.pointIndex,!1)}),b.dispatch=L,b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(o=d3.functor(a),b):o},b.y=function(a){return arguments.length?(p=d3.functor(a),b):p},b.size=function(a){return arguments.length?(q=d3.functor(a),b):q},b.margin=function(a){return arguments.length?(g.top="undefined"!=typeof a.top?a.top:g.top,g.right="undefined"!=typeof a.right?a.right:g.right,g.bottom="undefined"!=typeof a.bottom?a.bottom:g.bottom,g.left="undefined"!=typeof a.left?a.left:g.left,b):g},b.width=function(a){return arguments.length?(h=a,b):h},b.height=function(a){return arguments.length?(i=a,b):i},b.xScale=function(a){return arguments.length?(l=a,b):l},b.yScale=function(a){return arguments.length?(m=a,b):m},b.zScale=function(a){return arguments.length?(n=a,b):n},b.xDomain=function(a){return arguments.length?(E=a,b):E},b.yDomain=function(a){return arguments.length?(F=a,b):F},b.sizeDomain=function(a){return arguments.length?(I=a,b):I},b.xRange=function(a){return arguments.length?(G=a,b):G},b.yRange=function(a){return arguments.length?(H=a,b):H},b.sizeRange=function(a){return arguments.length?(J=a,b):J},b.forceX=function(a){return arguments.length?(t=a,b):t},b.forceY=function(a){return arguments.length?(u=a,b):u},b.forceSize=function(a){return arguments.length?(v=a,b):v},b.interactive=function(a){return arguments.length?(w=a,b):w},b.pointKey=function(a){return arguments.length?(x=a,b):x},b.pointActive=function(a){return arguments.length?(y=a,b):y},b.padData=function(a){return arguments.length?(z=a,b):z},b.padDataOuter=function(a){return arguments.length?(A=a,b):A},b.clipEdge=function(a){return arguments.length?(B=a,b):B},b.clipVoronoi=function(a){return arguments.length?(C=a,b):C},b.useVoronoi=function(a){return arguments.length?(M=a,M===!1&&(C=!1),b):M},b.clipRadius=function(a){return arguments.length?(D=a,b):D},b.color=function(c){return arguments.length?(j=a.utils.getColor(c),b):j},b.shape=function(a){return arguments.length?(r=a,b):r},b.onlyCircles=function(a){return arguments.length?(s=a,b):s},b.id=function(a){return arguments.length?(k=a,b):k},b.singlePoint=function(a){return arguments.length?(K=a,b):K},b.duration=function(a){return arguments.length?(N=a,P.reset(N),b):N},b},a.models.scatterChart=function(){"use strict";function b(B){return L.reset(),L.models(c),u&&L.models(d),v&&L.models(e),r&&L.models(h),s&&L.models(i),B.each(function(B){function C(){if(z)return X.select(".nv-point-paths").style("pointer-events","all"),!1;X.select(".nv-point-paths").style("pointer-events","none");var a=d3.mouse(this);n.distortion(y).focus(a[0]),o.distortion(y).focus(a[1]),X.select(".nv-scatterWrap").call(c),u&&X.select(".nv-x.nv-axis").call(d),v&&X.select(".nv-y.nv-axis").call(e),X.select(".nv-distributionX").datum(B.filter(function(a){return!a.disabled})).call(h),X.select(".nv-distributionY").datum(B.filter(function(a){return!a.disabled})).call(i)}var D=d3.select(this),L=this;
7 a.utils.initSVG(D);var Q=(k||parseInt(D.style("width"))||960)-j.left-j.right,R=(l||parseInt(D.style("height"))||400)-j.top-j.bottom;if(b.update=function(){0===I?D.call(b):D.transition().duration(I).call(b)},b.container=this,E.setter(P(B),b.update).getter(O(B)).update(),E.disabled=B.map(function(a){return!!a.disabled}),!F){var S;F={};for(S in E)F[S]=E[S]instanceof Array?E[S].slice(0):E[S]}if(!(B&&B.length&&B.filter(function(a){return a.values.length}).length)){var T=D.selectAll(".nv-noData").data([H]);return T.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),T.attr("x",j.left+Q/2).attr("y",j.top+R/2).text(function(a){return a}),b}D.selectAll(".nv-noData").remove(),J=J||n,K=K||o;var U=D.selectAll("g.nv-wrap.nv-scatterChart").data([B]),V=U.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+c.id()),W=V.append("g"),X=U.select("g");if(W.append("rect").attr("class","nvd3 nv-background"),W.append("g").attr("class","nv-x nv-axis"),W.append("g").attr("class","nv-y nv-axis"),W.append("g").attr("class","nv-scatterWrap"),W.append("g").attr("class","nv-distWrap"),W.append("g").attr("class","nv-legendWrap"),W.append("g").attr("class","nv-controlsWrap"),t){var Y=x?Q/2:Q;f.width(Y),U.select(".nv-legendWrap").datum(B).call(f),j.top!=f.height()&&(j.top=f.height(),R=(l||parseInt(D.style("height"))||400)-j.top-j.bottom),U.select(".nv-legendWrap").attr("transform","translate("+(Q-Y)+","+-j.top+")")}if(x&&(g.width(180).color(["#444"]),X.select(".nv-controlsWrap").datum(N).attr("transform","translate(0,"+-j.top+")").call(g)),U.attr("transform","translate("+j.left+","+j.top+")"),w&&X.select(".nv-y.nv-axis").attr("transform","translate("+Q+",0)"),c.width(Q).height(R).color(B.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!B[b].disabled})),0!==p&&c.xDomain(null),0!==q&&c.yDomain(null),U.select(".nv-scatterWrap").datum(B.filter(function(a){return!a.disabled})).call(c),0!==p){var Z=n.domain()[1]-n.domain()[0];c.xDomain([n.domain()[0]-p*Z,n.domain()[1]+p*Z])}if(0!==q){var $=o.domain()[1]-o.domain()[0];c.yDomain([o.domain()[0]-q*$,o.domain()[1]+q*$])}(0!==q||0!==p)&&U.select(".nv-scatterWrap").datum(B.filter(function(a){return!a.disabled})).call(c),u&&(d.scale(n).ticks(d.ticks()&&d.ticks().length?d.ticks():a.utils.calcTicksX(Q/100,B)).tickSize(-R,0),X.select(".nv-x.nv-axis").attr("transform","translate(0,"+o.range()[0]+")").call(d)),v&&(e.scale(o).ticks(e.ticks()&&e.ticks().length?e.ticks():a.utils.calcTicksY(R/36,B)).tickSize(-Q,0),X.select(".nv-y.nv-axis").call(e)),r&&(h.getData(c.x()).scale(n).width(Q).color(B.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!B[b].disabled})),W.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),X.select(".nv-distributionX").attr("transform","translate(0,"+o.range()[0]+")").datum(B.filter(function(a){return!a.disabled})).call(h)),s&&(i.getData(c.y()).scale(o).width(R).color(B.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!B[b].disabled})),W.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),X.select(".nv-distributionY").attr("transform","translate("+(w?Q:-i.size())+",0)").datum(B.filter(function(a){return!a.disabled})).call(i)),d3.fisheye&&(X.select(".nv-background").attr("width",Q).attr("height",R),X.select(".nv-background").on("mousemove",C),X.select(".nv-background").on("click",function(){z=!z}),c.dispatch.on("elementClick.freezeFisheye",function(){z=!z})),g.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,y=a.disabled?0:2.5,X.select(".nv-background").style("pointer-events",a.disabled?"none":"all"),X.select(".nv-point-paths").style("pointer-events",a.disabled?"all":"none"),a.disabled?(n.distortion(y).focus(0),o.distortion(y).focus(0),X.select(".nv-scatterWrap").call(c),X.select(".nv-x.nv-axis").call(d),X.select(".nv-y.nv-axis").call(e)):z=!1,G.stateChange(E),b.update()}),f.dispatch.on("stateChange",function(a){for(var c in a)E[c]=a[c];G.stateChange(E),b.update()}),c.dispatch.on("elementMouseover.tooltip",function(a){d3.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",function(){return a.pos[1]-R}),d3.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos[0]+h.size()),a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],G.tooltipShow(a)}),G.on("tooltipShow",function(a){A&&M(a,L.parentNode)}),G.on("changeState",function(a){"undefined"!=typeof a.disabled&&(B.forEach(function(b,c){b.disabled=a.disabled[c]}),E.disabled=a.disabled),b.update()}),J=n.copy(),K=o.copy()}),L.renderEnd("scatterChart immediate"),b}var c=a.models.scatter(),d=a.models.axis(),e=a.models.axis(),f=a.models.legend(),g=a.models.legend(),h=a.models.distribution(),i=a.models.distribution(),j={top:30,right:20,bottom:50,left:75},k=null,l=null,m=a.utils.defaultColor(),n=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):c.xScale(),o=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):c.yScale(),p=0,q=0,r=!1,s=!1,t=!0,u=!0,v=!0,w=!1,x=!!d3.fisheye,y=0,z=!1,A=!0,B=function(a,b){return"<strong>"+b+"</strong>"},C=function(a,b,c){return"<strong>"+c+"</strong>"},D=null,E=a.utils.state(),F=null,G=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),H="No Data Available.",I=250;c.xScale(n).yScale(o),d.orient("bottom").tickPadding(10),e.orient(w?"right":"left").tickPadding(10),h.axis("x"),i.axis("y"),g.updateState(!1);var J,K,L=a.utils.renderWatch(G,I),M=function(f,g){var h=f.pos[0]+(g.offsetLeft||0),i=f.pos[1]+(g.offsetTop||0),k=f.pos[0]+(g.offsetLeft||0),l=o.range()[0]+j.top+(g.offsetTop||0),m=n.range()[0]+j.left+(g.offsetLeft||0),p=f.pos[1]+(g.offsetTop||0),q=d.tickFormat()(c.x()(f.point,f.pointIndex)),r=e.tickFormat()(c.y()(f.point,f.pointIndex));null!=B&&a.tooltip.show([k,l],B(f.series.key,q,r,f,b),"n",1,g,"x-nvtooltip"),null!=C&&a.tooltip.show([m,p],C(f.series.key,q,r,f,b),"e",1,g,"y-nvtooltip"),null!=D&&a.tooltip.show([h,i],D(f.series.key,q,r,f,b),f.value<0?"n":"s",null,g)},N=[{key:"Magnify",disabled:!0}],O=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},P=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};c.dispatch.on("elementMouseout.tooltip",function(a){G.tooltipHide(a),d3.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),d3.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",i.size())}),G.on("tooltipHide",function(){A&&a.tooltip.cleanup()}),b.dispatch=G,b.scatter=c,b.legend=f,b.controls=g,b.xAxis=d,b.yAxis=e,b.distX=h,b.distY=i,b.state=E,d3.rebind(b,c,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(j.top="undefined"!=typeof a.top?a.top:j.top,j.right="undefined"!=typeof a.right?a.right:j.right,j.bottom="undefined"!=typeof a.bottom?a.bottom:j.bottom,j.left="undefined"!=typeof a.left?a.left:j.left,b):j},b.width=function(a){return arguments.length?(k=a,b):k},b.height=function(a){return arguments.length?(l=a,b):l},b.color=function(c){return arguments.length?(m=a.utils.getColor(c),f.color(m),h.color(m),i.color(m),b):m},b.showDistX=function(a){return arguments.length?(r=a,b):r},b.showDistY=function(a){return arguments.length?(s=a,b):s},b.showControls=function(a){return arguments.length?(x=a,b):x},b.showLegend=function(a){return arguments.length?(t=a,b):t},b.showXAxis=function(a){return arguments.length?(u=a,b):u},b.showYAxis=function(a){return arguments.length?(v=a,b):v},b.rightAlignYAxis=function(a){return arguments.length?(w=a,e.orient(a?"right":"left"),b):w},b.fisheye=function(a){return arguments.length?(y=a,b):y},b.xPadding=function(a){return arguments.length?(p=a,b):p},b.yPadding=function(a){return arguments.length?(q=a,b):q},b.tooltips=function(a){return arguments.length?(A=a,b):A},b.tooltipContent=function(a){return arguments.length?(D=a,b):D},b.tooltipXContent=function(a){return arguments.length?(B=a,b):B},b.tooltipYContent=function(a){return arguments.length?(C=a,b):C},b.state=function(c){return a.deprecated("scatterChart.state"),arguments.length?(E=c,b):E};for(var Q in E)b.state[Q]=E[Q];return b.defaultState=function(a){return arguments.length?(F=a,b):F},b.noData=function(a){return arguments.length?(H=a,b):H},b.duration=function(a){return arguments.length?(I=a,L.reset(I),c.duration(I),d.duration(I),e.duration(I),h.duration(I),i.duration(I),b):I},b.transitionDuration=function(c){return a.deprecated("scatterChart.transitionDuration"),b.duration(c)},b},a.models.scatterPlusLineChart=function(){"use strict";function b(z){return J.reset(),J.models(c),s&&J.models(d),t&&J.models(e),p&&J.models(h),q&&J.models(i),z.each(function(z){function A(){if(x)return W.select(".nv-point-paths").style("pointer-events","all"),!1;W.select(".nv-point-paths").style("pointer-events","none");var a=d3.mouse(this);n.distortion(w).focus(a[0]),o.distortion(w).focus(a[1]),W.select(".nv-scatterWrap").datum(z.filter(function(a){return!a.disabled})).call(c),s&&W.select(".nv-x.nv-axis").call(d),t&&W.select(".nv-y.nv-axis").call(e),W.select(".nv-distributionX").datum(z.filter(function(a){return!a.disabled})).call(h),W.select(".nv-distributionY").datum(z.filter(function(a){return!a.disabled})).call(i)}var B=d3.select(this),O=this;a.utils.initSVG(B);var P=(k||parseInt(B.style("width"))||960)-j.left-j.right,Q=(l||parseInt(B.style("height"))||400)-j.top-j.bottom;if(b.update=function(){0===G?B.call(b):B.transition().duration(G).call(b)},b.container=this,C.setter(N(z),b.update).getter(M(z)).update(),C.disabled=z.map(function(a){return!!a.disabled}),!D){var R;D={};for(R in C)D[R]=C[R]instanceof Array?C[R].slice(0):C[R]}if(!(z&&z.length&&z.filter(function(a){return a.values.length}).length)){var S=B.selectAll(".nv-noData").data([F]);return S.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),S.attr("x",j.left+P/2).attr("y",j.top+Q/2).text(function(a){return a}),J.renderEnd("scatter immediate"),b}B.selectAll(".nv-noData").remove(),n=c.xScale(),o=c.yScale(),H=H||n,I=I||o;var T=B.selectAll("g.nv-wrap.nv-scatterChart").data([z]),U=T.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+c.id()),V=U.append("g"),W=T.select("g");V.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),V.append("g").attr("class","nv-x nv-axis"),V.append("g").attr("class","nv-y nv-axis"),V.append("g").attr("class","nv-scatterWrap"),V.append("g").attr("class","nv-regressionLinesWrap"),V.append("g").attr("class","nv-distWrap"),V.append("g").attr("class","nv-legendWrap"),V.append("g").attr("class","nv-controlsWrap"),T.attr("transform","translate("+j.left+","+j.top+")"),u&&W.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)"),r&&(f.width(P/2),T.select(".nv-legendWrap").datum(z).call(f),j.top!=f.height()&&(j.top=f.height(),Q=(l||parseInt(B.style("height"))||400)-j.top-j.bottom),T.select(".nv-legendWrap").attr("transform","translate("+P/2+","+-j.top+")")),v&&(g.width(180).color(["#444"]),W.select(".nv-controlsWrap").datum(L).attr("transform","translate(0,"+-j.top+")").call(g)),c.width(P).height(Q).color(z.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!z[b].disabled})),T.select(".nv-scatterWrap").datum(z.filter(function(a){return!a.disabled})).call(c),T.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+c.id()+")");var X=T.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(a){return a});X.enter().append("g").attr("class","nv-regLines");{var Y=X.selectAll(".nv-regLine").data(function(a){return[a]});Y.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0)}Y.watchTransition(J,"scatterPlusLineChart: regline").attr("x1",n.range()[0]).attr("x2",n.range()[1]).attr("y1",function(a){return o(n.domain()[0]*a.slope+a.intercept)}).attr("y2",function(a){return o(n.domain()[1]*a.slope+a.intercept)}).style("stroke",function(a,b,c){return m(a,c)}).style("stroke-opacity",function(a){return a.disabled||"undefined"==typeof a.slope||"undefined"==typeof a.intercept?0:1}),s&&(d.scale(n).ticks(d.ticks()?d.ticks():a.utils.calcTicksX(P/100,z)).tickSize(-Q,0),W.select(".nv-x.nv-axis").attr("transform","translate(0,"+o.range()[0]+")").call(d)),t&&(e.scale(o).ticks(e.ticks()?e.ticks():a.utils.calcTicksY(Q/36,z)).tickSize(-P,0),W.select(".nv-y.nv-axis").call(e)),p&&(h.getData(c.x()).scale(n).width(P).color(z.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!z[b].disabled})),V.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),W.select(".nv-distributionX").attr("transform","translate(0,"+o.range()[0]+")").datum(z.filter(function(a){return!a.disabled})).call(h)),q&&(i.getData(c.y()).scale(o).width(Q).color(z.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!z[b].disabled})),V.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),W.select(".nv-distributionY").attr("transform","translate("+(u?P:-i.size())+",0)").datum(z.filter(function(a){return!a.disabled})).call(i)),d3.fisheye&&(W.select(".nv-background").attr("width",P).attr("height",Q),W.select(".nv-background").on("mousemove",A),W.select(".nv-background").on("click",function(){x=!x}),c.dispatch.on("elementClick.freezeFisheye",function(){x=!x})),g.dispatch.on("legendClick",function(a){a.disabled=!a.disabled,w=a.disabled?0:2.5,W.select(".nv-background").style("pointer-events",a.disabled?"none":"all"),W.select(".nv-point-paths").style("pointer-events",a.disabled?"all":"none"),a.disabled?(n.distortion(w).focus(0),o.distortion(w).focus(0),W.select(".nv-scatterWrap").call(c),W.select(".nv-x.nv-axis").call(d),W.select(".nv-y.nv-axis").call(e)):x=!1,C.fisheye=w,E.stateChange(C),b.update()}),f.dispatch.on("stateChange",function(a){for(var c in a)C[c]=a[c];E.stateChange(C),b.update()}),c.dispatch.on("elementMouseover.tooltip",function(a){d3.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.pos[1]-Q),d3.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos[0]+h.size()),a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],E.tooltipShow(a)}),E.on("tooltipShow",function(a){y&&K(a,O.parentNode)}),E.on("changeState",function(a){"undefined"!=typeof a.disabled&&(z.forEach(function(b,c){b.disabled=a.disabled[c]}),C.disabled=a.disabled),"undefined"!=typeof a.fisheye&&(C.fisheye=a.fisheye,w=a.fisheye),b.update()}),H=n.copy(),I=o.copy()}),J.renderEnd("scatter with line immediate"),b}var c=a.models.scatter(),d=a.models.axis(),e=a.models.axis(),f=a.models.legend(),g=a.models.legend(),h=a.models.distribution(),i=a.models.distribution(),j={top:30,right:20,bottom:50,left:75},k=null,l=null,m=a.utils.defaultColor(),n=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):c.xScale(),o=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):c.yScale(),p=!1,q=!1,r=!0,s=!0,t=!0,u=!1,v=!!d3.fisheye,w=0,x=!1,y=!0,z=function(a,b){return"<strong>"+b+"</strong>"},A=function(a,b,c){return"<strong>"+c+"</strong>"},B=function(a,b,c,d){return"<h3>"+a+"</h3><p>"+d+"</p>"},C=a.utils.state(),D=null,E=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),F="No Data Available.",G=250;C.fisheye=0,c.xScale(n).yScale(o),d.orient("bottom").tickPadding(10),e.orient(u?"right":"left").tickPadding(10),h.axis("x"),i.axis("y"),g.updateState(!1);var H,I,J=a.utils.renderWatch(E,G),K=function(f,g){var h=f.pos[0]+(g.offsetLeft||0),i=f.pos[1]+(g.offsetTop||0),k=f.pos[0]+(g.offsetLeft||0),l=o.range()[0]+j.top+(g.offsetTop||0),m=n.range()[0]+j.left+(g.offsetLeft||0),p=f.pos[1]+(g.offsetTop||0),q=d.tickFormat()(c.x()(f.point,f.pointIndex)),r=e.tickFormat()(c.y()(f.point,f.pointIndex));null!=z&&a.tooltip.show([k,l],z(f.series.key,q,r,f,b),"n",1,g,"x-nvtooltip"),null!=A&&a.tooltip.show([m,p],A(f.series.key,q,r,f,b),"e",1,g,"y-nvtooltip"),null!=B&&a.tooltip.show([h,i],B(f.series.key,q,r,f.point.tooltip,f,b),f.value<0?"n":"s",null,g)},L=[{key:"Magnify",disabled:!0}],M=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),fisheye:w}}},N=function(a){return function(b){void 0!==b.fisheye&&(w=b.fisheye),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};c.dispatch.on("elementMouseout.tooltip",function(a){E.tooltipHide(a),d3.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),d3.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",i.size())}),E.on("tooltipHide",function(){y&&a.tooltip.cleanup()}),b.dispatch=E,b.scatter=c,b.legend=f,b.controls=g,b.xAxis=d,b.yAxis=e,b.distX=h,b.distY=i,b.state=C,d3.rebind(b,c,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(j.top="undefined"!=typeof a.top?a.top:j.top,j.right="undefined"!=typeof a.right?a.right:j.right,j.bottom="undefined"!=typeof a.bottom?a.bottom:j.bottom,j.left="undefined"!=typeof a.left?a.left:j.left,b):j},b.width=function(a){return arguments.length?(k=a,b):k},b.height=function(a){return arguments.length?(l=a,b):l},b.color=function(c){return arguments.length?(m=a.utils.getColor(c),f.color(m),h.color(m),i.color(m),b):m},b.showDistX=function(a){return arguments.length?(p=a,b):p},b.showDistY=function(a){return arguments.length?(q=a,b):q},b.showControls=function(a){return arguments.length?(v=a,b):v},b.showLegend=function(a){return arguments.length?(r=a,b):r},b.showXAxis=function(a){return arguments.length?(s=a,b):s},b.showYAxis=function(a){return arguments.length?(t=a,b):t},b.rightAlignYAxis=function(a){return arguments.length?(u=a,e.orient(a?"right":"left"),b):u},b.fisheye=function(a){return arguments.length?(w=a,b):w},b.tooltips=function(a){return arguments.length?(y=a,b):y},b.tooltipContent=function(a){return arguments.length?(B=a,b):B},b.tooltipXContent=function(a){return arguments.length?(z=a,b):z},b.tooltipYContent=function(a){return arguments.length?(A=a,b):A},b.state=function(c){return a.deprecated("scatterPlusLineChart.state"),arguments.length?(C=c,b):C};for(var O in C)b.state[O]=C[O];return b.defaultState=function(a){return arguments.length?(D=a,b):D},b.noData=function(a){return arguments.length?(F=a,b):F},b.transitionDuration=function(c){return a.deprecated("scatterPlusLineChart.transitionDuration"),b.duration(c)},b.duration=function(a){return arguments.length?(G=a,b):G},b},a.models.sparkline=function(){"use strict";function b(j){return j.each(function(b){var j=h-g.left-g.right,p=i-g.top-g.bottom,q=d3.select(this);a.utils.initSVG(q),k.domain(c||d3.extent(b,m)).range(e||[0,j]),l.domain(d||d3.extent(b,n)).range(f||[p,0]);{var r=q.selectAll("g.nv-wrap.nv-sparkline").data([b]),s=r.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");s.append("g"),r.select("g")}r.attr("transform","translate("+g.left+","+g.top+")");var t=r.selectAll("path").data(function(a){return[a]});t.enter().append("path"),t.exit().remove(),t.style("stroke",function(a,b){return a.color||o(a,b)}).attr("d",d3.svg.line().x(function(a,b){return k(m(a,b))}).y(function(a,b){return l(n(a,b))}));var u=r.selectAll("circle.nv-point").data(function(a){function b(b){if(-1!=b){var c=a[b];return c.pointIndex=b,c}return null}var c=a.map(function(a,b){return n(a,b)}),d=b(c.lastIndexOf(l.domain()[1])),e=b(c.indexOf(l.domain()[0])),f=b(c.length-1);return[e,d,f].filter(function(a){return null!=a})});u.enter().append("circle"),u.exit().remove(),u.attr("cx",function(a){return k(m(a,a.pointIndex))}).attr("cy",function(a){return l(n(a,a.pointIndex))}).attr("r",2).attr("class",function(a){return m(a,a.pointIndex)==k.domain()[1]?"nv-point nv-currentValue":n(a,a.pointIndex)==l.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),b}var c,d,e,f,g={top:2,right:0,bottom:2,left:0},h=400,i=32,j=!0,k=d3.scale.linear(),l=d3.scale.linear(),m=function(a){return a.x},n=function(a){return a.y},o=a.utils.getColor(["#000"]);return b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(g.top="undefined"!=typeof a.top?a.top:g.top,g.right="undefined"!=typeof a.right?a.right:g.right,g.bottom="undefined"!=typeof a.bottom?a.bottom:g.bottom,g.left="undefined"!=typeof a.left?a.left:g.left,b):g},b.width=function(a){return arguments.length?(h=a,b):h},b.height=function(a){return arguments.length?(i=a,b):i},b.x=function(a){return arguments.length?(m=d3.functor(a),b):m},b.y=function(a){return arguments.length?(n=d3.functor(a),b):n},b.xScale=function(a){return arguments.length?(k=a,b):k},b.yScale=function(a){return arguments.length?(l=a,b):l},b.xDomain=function(a){return arguments.length?(c=a,b):c},b.yDomain=function(a){return arguments.length?(d=a,b):d},b.xRange=function(a){return arguments.length?(e=a,b):e},b.yRange=function(a){return arguments.length?(f=a,b):f},b.animate=function(a){return arguments.length?(j=a,b):j},b.color=function(c){return arguments.length?(o=a.utils.getColor(c),b):o},b},a.models.sparklinePlus=function(){"use strict";function b(m){return m.each(function(q){function r(){if(!j){var a=B.selectAll(".nv-hoverValue").data(i),b=a.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);a.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),a.attr("transform",function(a){return"translate("+c(e.x()(q[a],a))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),i.length&&(b.append("line").attr("x1",0).attr("y1",-f.top).attr("x2",0).attr("y2",v),b.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-f.top).attr("text-anchor","end").attr("dy",".9em"),B.select(".nv-hoverValue .nv-xValue").text(k(e.x()(q[i[0]],i[0]))),b.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-f.top).attr("text-anchor","start").attr("dy",".9em"),B.select(".nv-hoverValue .nv-yValue").text(l(e.y()(q[i[0]],i[0]))))}}function s(){function a(a,b){for(var c=Math.abs(e.x()(a[0],0)-b),d=0,f=0;f<a.length;f++)Math.abs(e.x()(a[f],f)-b)<c&&(c=Math.abs(e.x()(a[f],f)-b),d=f);return d}if(!j){var b=d3.mouse(this)[0]-f.left;i=[a(q,Math.round(c.invert(b)))],r()}}var t=d3.select(this);a.utils.initSVG(t);var u=(g||parseInt(t.style("width"))||960)-f.left-f.right,v=(h||parseInt(t.style("height"))||400)-f.top-f.bottom;if(b.update=function(){b(m)},b.container=this,!q||!q.length){var w=t.selectAll(".nv-noData").data([p]);return w.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),w.attr("x",f.left+u/2).attr("y",f.top+v/2).text(function(a){return a}),b}t.selectAll(".nv-noData").remove();var x=e.y()(q[q.length-1],q.length-1);c=e.xScale(),d=e.yScale();var y=t.selectAll("g.nv-wrap.nv-sparklineplus").data([q]),z=y.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus"),A=z.append("g"),B=y.select("g");A.append("g").attr("class","nv-sparklineWrap"),A.append("g").attr("class","nv-valueWrap"),A.append("g").attr("class","nv-hoverArea"),y.attr("transform","translate("+f.left+","+f.top+")");var C=B.select(".nv-sparklineWrap");e.width(u).height(v),C.call(e);var D=B.select(".nv-valueWrap"),E=D.selectAll(".nv-currentValue").data([x]);E.enter().append("text").attr("class","nv-currentValue").attr("dx",o?-8:8).attr("dy",".9em").style("text-anchor",o?"end":"start"),E.attr("x",u+(o?f.right:0)).attr("y",n?function(a){return d(a)}:0).style("fill",e.color()(q[q.length-1],q.length-1)).text(l(x)),A.select(".nv-hoverArea").append("rect").on("mousemove",s).on("click",function(){j=!j}).on("mouseout",function(){i=[],r()}),B.select(".nv-hoverArea rect").attr("transform",function(){return"translate("+-f.left+","+-f.top+")"}).attr("width",u+f.left+f.right).attr("height",v+f.top)}),b}var c,d,e=a.models.sparkline(),f={top:15,right:100,bottom:10,left:50},g=null,h=null,i=[],j=!1,k=d3.format(",r"),l=d3.format(",.2f"),m=!0,n=!0,o=!1,p="No Data Available.";return b.sparkline=e,d3.rebind(b,e,"x","y","xScale","yScale","color"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(f.top="undefined"!=typeof a.top?a.top:f.top,f.right="undefined"!=typeof a.right?a.right:f.right,f.bottom="undefined"!=typeof a.bottom?a.bottom:f.bottom,f.left="undefined"!=typeof a.left?a.left:f.left,b):f},b.width=function(a){return arguments.length?(g=a,b):g},b.height=function(a){return arguments.length?(h=a,b):h},b.xTickFormat=function(a){return arguments.length?(k=a,b):k},b.yTickFormat=function(a){return arguments.length?(l=a,b):l},b.showValue=function(a){return arguments.length?(m=a,b):m},b.alignValue=function(a){return arguments.length?(n=a,b):n},b.rightAlignValue=function(a){return arguments.length?(o=a,b):o},b.noData=function(a){return arguments.length?(p=a,b):p},b},a.models.stackedArea=function(){"use strict";function b(l){return t.reset(),t.models(q),l.each(function(l){var r=f-e.left-e.right,u=g-e.top-e.bottom,v=d3.select(this);a.utils.initSVG(v),c=q.xScale(),d=q.yScale();var w=l;l.forEach(function(a,b){a.seriesIndex=b,a.values=a.values.map(function(a,c){return a.index=c,a.seriesIndex=b,a})});var x=l.filter(function(a){return!a.disabled});l=d3.layout.stack().order(n).offset(m).values(function(a){return a.values}).x(j).y(k).out(function(a,b,c){var d=0===k(a)?0:c;a.display={y:d,y0:b}})(x);var y=v.selectAll("g.nv-wrap.nv-stackedarea").data([l]),z=y.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),A=z.append("defs"),B=z.append("g"),C=y.select("g");B.append("g").attr("class","nv-areaWrap"),B.append("g").attr("class","nv-scatterWrap"),y.attr("transform","translate("+e.left+","+e.top+")"),q.width(r).height(u).x(j).y(function(a){return a.display.y+a.display.y0}).forceY([0]).color(l.map(function(a){return a.color||h(a,a.seriesIndex)}));var D=C.select(".nv-scatterWrap").datum(l);D.call(q),A.append("clipPath").attr("id","nv-edge-clip-"+i).append("rect"),y.select("#nv-edge-clip-"+i+" rect").attr("width",r).attr("height",u),C.attr("clip-path",p?"url(#nv-edge-clip-"+i+")":"");var E=d3.svg.area().x(function(a,b){return c(j(a,b))}).y0(function(a){return d(a.display.y0)}).y1(function(a){return d(a.display.y+a.display.y0)}).interpolate(o),F=d3.svg.area().x(function(a,b){return c(j(a,b))}).y0(function(a){return d(a.display.y0)}).y1(function(a){return d(a.display.y0)}),G=C.select(".nv-areaWrap").selectAll("path.nv-area").data(function(a){return a});G.enter().append("path").attr("class",function(a,b){return"nv-area nv-area-"+b}).attr("d",function(a){return F(a.values,a.seriesIndex)}).on("mouseover",function(a){d3.select(this).classed("hover",!0),s.areaMouseover({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on("mouseout",function(a){d3.select(this).classed("hover",!1),s.areaMouseout({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on("click",function(a){d3.select(this).classed("hover",!1),s.areaClick({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}),G.exit().remove(),G.style("fill",function(a){return a.color||h(a,a.seriesIndex)}).style("stroke",function(a){return a.color||h(a,a.seriesIndex)}),G.watchTransition(t,"stackedArea path").attr("d",function(a,b){return E(a.values,b)}),q.dispatch.on("elementMouseover.area",function(a){C.select(".nv-chart-"+i+" .nv-area-"+a.seriesIndex).classed("hover",!0)}),q.dispatch.on("elementMouseout.area",function(a){C.select(".nv-chart-"+i+" .nv-area-"+a.seriesIndex).classed("hover",!1)}),b.d3_stackedOffset_stackPercent=function(a){var b,c,d,e=a.length,f=a[0].length,g=1/e,h=[];for(c=0;f>c;++c){for(b=0,d=0;b<w.length;b++)d+=k(w[b].values[c]);if(d)for(b=0;e>b;b++)a[b][c][1]/=d;else for(b=0;e>b;b++)a[b][c][1]=g}for(c=0;f>c;++c)h[c]=0;return h}}),t.renderEnd("stackedArea immediate"),b}var c,d,e={top:0,right:0,bottom:0,left:0},f=960,g=500,h=a.utils.defaultColor(),i=Math.floor(1e5*Math.random()),j=function(a){return a.x},k=function(a){return a.y},l="stack",m="zero",n="default",o="linear",p=!1,q=a.models.scatter(),r=250,s=d3.dispatch("tooltipShow","tooltipHide","areaClick","areaMouseover","areaMouseout","renderEnd");q.interactive(!1),q.size(2.2).sizeDomain([2.2,2.2]);var t=a.utils.renderWatch(s,r);return q.dispatch.on("elementClick.area",function(a){s.areaClick(a)}),q.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],s.tooltipShow(a)}),q.dispatch.on("elementMouseout.tooltip",function(a){s.tooltipHide(a)}),b.dispatch=s,b.scatter=q,d3.rebind(b,q,"interactive","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","forceX","forceY","forceSize","clipVoronoi","useVoronoi","clipRadius","highlightPoint","clearHighlights"),b.options=a.utils.optionsFunc.bind(b),b.x=function(a){return arguments.length?(j=d3.functor(a),b):j},b.y=function(a){return arguments.length?(k=d3.functor(a),b):k},b.margin=function(a){return arguments.length?(e.top="undefined"!=typeof a.top?a.top:e.top,e.right="undefined"!=typeof a.right?a.right:e.right,e.bottom="undefined"!=typeof a.bottom?a.bottom:e.bottom,e.left="undefined"!=typeof a.left?a.left:e.left,b):e},b.width=function(a){return arguments.length?(f=a,b):f},b.height=function(a){return arguments.length?(g=a,b):g},b.clipEdge=function(a){return arguments.length?(p=a,b):p},b.color=function(c){return arguments.length?(h=a.utils.getColor(c),b):h},b.offset=function(a){return arguments.length?(m=a,b):m},b.order=function(a){return arguments.length?(n=a,b):n},b.style=function(a){if(!arguments.length)return l;switch(l=a){case"stack":b.offset("zero"),b.order("default");break;case"stream":b.offset("wiggle"),b.order("inside-out");break;case"stream-center":b.offset("silhouette"),b.order("inside-out");break;case"expand":b.offset("expand"),b.order("default");break;case"stack_percent":b.offset(b.d3_stackedOffset_stackPercent),b.order("default")}return b},b.interpolate=function(a){return arguments.length?(o=a,b):o},b.duration=function(a){return arguments.length?(r=a,t.reset(r),q.duration(r),b):r},b},a.models.stackedAreaChart=function(){"use strict";function b(v){return F.reset(),F.models(e),q&&F.models(f),r&&F.models(g),v.each(function(v){var F=d3.select(this),K=this;a.utils.initSVG(F);var L=(l||parseInt(F.style("width"))||960)-k.left-k.right,M=(m||parseInt(F.style("height"))||400)-k.top-k.bottom;if(b.update=function(){F.transition().duration(E).call(b)},b.container=this,x.setter(J(v),b.update).getter(I(v)).update(),x.disabled=v.map(function(a){return!!a.disabled}),!y){var N;y={};for(N in x)y[N]=x[N]instanceof Array?x[N].slice(0):x[N]}if(!(v&&v.length&&v.filter(function(a){return a.values.length}).length)){var O=F.selectAll(".nv-noData").data([z]);return O.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),O.attr("x",k.left+L/2).attr("y",k.top+M/2).text(function(a){return a}),b}F.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var P=F.selectAll("g.nv-wrap.nv-stackedAreaChart").data([v]),Q=P.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),R=P.select("g");if(Q.append("rect").style("opacity",0),Q.append("g").attr("class","nv-x nv-axis"),Q.append("g").attr("class","nv-y nv-axis"),Q.append("g").attr("class","nv-stackedWrap"),Q.append("g").attr("class","nv-legendWrap"),Q.append("g").attr("class","nv-controlsWrap"),Q.append("g").attr("class","nv-interactive"),R.select("rect").attr("width",L).attr("height",M),p){var S=o?L-B:L;h.width(S),R.select(".nv-legendWrap").datum(v).call(h),k.top!=h.height()&&(k.top=h.height(),M=(m||parseInt(F.style("height"))||400)-k.top-k.bottom),R.select(".nv-legendWrap").attr("transform","translate("+(L-S)+","+-k.top+")")
8 }if(o){var T=[{key:D.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=e.style(),style:"stack"},{key:D.stream||"Stream",metaKey:"Stream",disabled:"stream"!=e.style(),style:"stream"},{key:D.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=e.style(),style:"expand"},{key:D.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=e.style(),style:"stack_percent"}];B=C.length/3*260,T=T.filter(function(a){return-1!==C.indexOf(a.metaKey)}),i.width(B).color(["#444","#444","#444"]),R.select(".nv-controlsWrap").datum(T).call(i),k.top!=Math.max(i.height(),h.height())&&(k.top=Math.max(i.height(),h.height()),M=(m||parseInt(F.style("height"))||400)-k.top-k.bottom),R.select(".nv-controlsWrap").attr("transform","translate(0,"+-k.top+")")}P.attr("transform","translate("+k.left+","+k.top+")"),s&&R.select(".nv-y.nv-axis").attr("transform","translate("+L+",0)"),t&&(j.width(L).height(M).margin({left:k.left,top:k.top}).svgContainer(F).xScale(c),P.select(".nv-interactive").call(j)),e.width(L).height(M);var U=R.select(".nv-stackedWrap").datum(v);U.transition().call(e),q&&(f.scale(c).ticks(a.utils.calcTicksX(L/100,v)).tickSize(-M,0),R.select(".nv-x.nv-axis").attr("transform","translate(0,"+M+")"),R.select(".nv-x.nv-axis").transition().duration(0).call(f)),r&&(g.scale(d).ticks("wiggle"==e.offset()?0:a.utils.calcTicksY(M/36,v)).tickSize(-L,0).setTickFormat("expand"==e.style()||"stack_percent"==e.style()?d3.format("%"):w),R.select(".nv-y.nv-axis").transition().duration(0).call(g)),e.dispatch.on("areaClick.toggle",function(a){v.forEach(1===v.filter(function(a){return!a.disabled}).length?function(a){a.disabled=!1}:function(b,c){b.disabled=c!=a.seriesIndex}),x.disabled=v.map(function(a){return!!a.disabled}),A.stateChange(x),b.update()}),h.dispatch.on("stateChange",function(a){for(var c in a)x[c]=a[c];A.stateChange(x),b.update()}),i.dispatch.on("legendClick",function(a){a.disabled&&(T=T.map(function(a){return a.disabled=!0,a}),a.disabled=!1,e.style(a.style),x.style=e.style(),A.stateChange(x),b.update())}),j.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,h,i,l=[];if(v.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(f,g){h=a.interactiveBisect(f.values,c.pointXValue,b.x()),e.highlightPoint(g,h,!0);var j=f.values[h];if("undefined"!=typeof j){"undefined"==typeof d&&(d=j),"undefined"==typeof i&&(i=b.xScale()(b.x()(j,h)));var k="expand"==e.style()?j.display.y:b.y()(j,h);l.push({key:f.key,value:k,color:n(f,f.seriesIndex),stackedValue:j.display})}}),l.reverse(),l.length>2){var m=b.yScale().invert(c.mouseY),o=null;l.forEach(function(a,b){m=Math.abs(m);var c=Math.abs(a.stackedValue.y0),d=Math.abs(a.stackedValue.y);return m>=c&&d+c>=m?void(o=b):void 0}),null!=o&&(l[o].highlight=!0)}var p=f.tickFormat()(b.x()(d,h)),q="expand"==e.style()?function(a){return d3.format(".1%")(a)}:function(a){return g.tickFormat()(a)};j.tooltip.position({left:i+k.left,top:c.mouseY+k.top}).chartContainer(K.parentNode).enabled(u).valueFormatter(q).data({value:p,series:l})(),j.renderGuideLine(i)}),j.dispatch.on("elementMouseout",function(){A.tooltipHide(),e.clearHighlights()}),A.on("tooltipShow",function(a){u&&H(a,K.parentNode)}),A.on("changeState",function(a){"undefined"!=typeof a.disabled&&v.length===a.disabled.length&&(v.forEach(function(b,c){b.disabled=a.disabled[c]}),x.disabled=a.disabled),"undefined"!=typeof a.style&&(e.style(a.style),G=a.style),b.update()})}),F.renderEnd("stacked Area chart immediate"),b}var c,d,e=a.models.stackedArea(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.legend(),j=a.interactiveGuideline(),k={top:30,right:25,bottom:50,left:60},l=null,m=null,n=a.utils.defaultColor(),o=!0,p=!0,q=!0,r=!0,s=!1,t=!1,u=!0,v=function(a,b,c){return"<h3>"+a+"</h3><p>"+c+" on "+b+"</p>"},w=d3.format(",.2f"),x=a.utils.state(),y=null,z="No Data Available.",A=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState","renderEnd"),B=250,C=["Stacked","Stream","Expanded"],D={},E=250;x.style=e.style(),f.orient("bottom").tickPadding(7),g.orient(s?"right":"left"),i.updateState(!1);var F=a.utils.renderWatch(A),G=e.style(),H=function(c,d){var h=c.pos[0]+(d.offsetLeft||0),i=c.pos[1]+(d.offsetTop||0),j=f.tickFormat()(e.x()(c.point,c.pointIndex)),k=g.tickFormat()(e.y()(c.point,c.pointIndex)),l=v(c.series.key,j,k,c,b);a.tooltip.show([h,i],l,c.value<0?"n":"s",null,d)},I=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),style:e.style()}}},J=function(a){return function(b){void 0!==b.style&&(G=b.style),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};e.dispatch.on("tooltipShow",function(a){a.pos=[a.pos[0]+k.left,a.pos[1]+k.top],A.tooltipShow(a)}),e.dispatch.on("tooltipHide",function(a){A.tooltipHide(a)}),A.on("tooltipHide",function(){u&&a.tooltip.cleanup()}),b.dispatch=A,b.stacked=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.interactiveLayer=j,b.state=x,d3.rebind(b,e,"x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","sizeDomain","interactive","useVoronoi","offset","order","style","clipEdge","forceX","forceY","forceSize","interpolate"),b.options=a.utils.optionsFunc.bind(b),b.margin=function(a){return arguments.length?(k.top="undefined"!=typeof a.top?a.top:k.top,k.right="undefined"!=typeof a.right?a.right:k.right,k.bottom="undefined"!=typeof a.bottom?a.bottom:k.bottom,k.left="undefined"!=typeof a.left?a.left:k.left,b):k},b.width=function(a){return arguments.length?(l=a,b):l},b.height=function(a){return arguments.length?(m=a,b):m},b.color=function(c){return arguments.length?(n=a.utils.getColor(c),h.color(n),e.color(n),b):n},b.showControls=function(a){return arguments.length?(o=a,b):o},b.showLegend=function(a){return arguments.length?(p=a,b):p},b.showXAxis=function(a){return arguments.length?(q=a,b):q},b.showYAxis=function(a){return arguments.length?(r=a,b):r},b.rightAlignYAxis=function(a){return arguments.length?(s=a,g.orient(a?"right":"left"),b):s},b.useInteractiveGuideline=function(a){return arguments.length?(t=a,a===!0&&(b.interactive(!1),b.useVoronoi(!1)),b):t},b.tooltip=function(a){return arguments.length?(v=a,b):v},b.tooltips=function(a){return arguments.length?(u=a,b):u},b.tooltipContent=function(a){return arguments.length?(v=a,b):v},b.state=function(c){return a.deprecated("stackedAreaChart.state"),arguments.length?(x=c,b):x};for(var K in x)b.state[K]=x[K];return b.defaultState=function(a){return arguments.length?(y=a,b):y},b.noData=function(a){return arguments.length?(z=a,b):z},b.transitionDuration=function(c){return a.deprecated("lineChart.transitionDuration"),b.duration(c)},b.controlsData=function(a){return arguments.length?(C=a,b):C},b.controlLabels=function(a){return arguments.length?"object"!=typeof a?D:(D=a,b):D},g.setTickFormat=g.tickFormat,g.tickFormat=function(a){return arguments.length?(w=a,g):w},b.duration=function(a){return arguments.length?(E=a,F.reset(E),e.duration(E),f.duration(E),g.duration(E),b):E},b},a.version="1.6.0"}();