File manager - Edit - /usr/share/php/SebastianBergmann/CodeCoverage/Report/Html/Renderer/Template/js/nv.d3.min.js
Back
(function(){var a={};a.dev=!1,a.tooltip=a.tooltip||{},a.utils=a.utils||{},a.models=a.models||{},a.charts={},a.logs={},a.dom={},a.dispatch=d3.dispatch('render_start','render_end'),Function.prototype.bind||(Function.prototype.bind=function(b){if(typeof this!="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var d=Array.prototype.slice.call(arguments,1),e=this,a=function(){},c=function(){return e.apply(this instanceof a&&b?this:b,d.concat(Array.prototype.slice.call(arguments)))};return a.prototype=this.prototype,c.prototype=new a,c}),a.dev&&(a.dispatch.on('render_start',function(b){a.logs.startTime=+new Date}),a.dispatch.on('render_end',function(b){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&&typeof console.log=="function"&&Function.prototype.bind){var b=Function.prototype.bind.call(console.log,console);b.apply(console,arguments)}return arguments[arguments.length-1]},a.deprecated=function(a,b){console&&console.warn&&console.warn('nvd3 warning: `'+a+'` has been deprecated. ',b||'')},a.render=function(b){b=b||1,a.render.active=!0,a.dispatch.render_start();var c=function(){for(var e=0,d,f;e<b&&(d=a.render.queue[e]);e++)f=d.generate(),typeof d.callback==typeof Function&&d.callback(f);a.render.queue.splice(0,e),a.render.queue.length?setTimeout(c):(a.dispatch.render_end(),a.render.active=!1)};setTimeout(c)},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()},typeof module!='undefined'&&typeof exports!='undefined'&&(module.exports=a),typeof window!='undefined'&&(window.nv=a),a.dom.write=function(a){return window.fastdom!==void 0?fastdom.write(a):a()},a.dom.read=function(a){return window.fastdom!==void 0?fastdom.read(a):a()},a.interactiveGuideline=function(){"use strict";var d=a.models.tooltip(),j,g,c,h,e,i,f,k;d.duration(0).hideDelay(0)._isInteractiveLayer(!0).hidden(!1),j=null,g=null,c={left:0,top:0},h=d3.scale.linear(),e=d3.dispatch('elementMousemove','elementMouseout','elementClick','elementDblclick'),i=!0,f=null,k="ActiveXObject"in window;function b(l){l.each(function(r){var o=d3.select(this),p=j||960,m=g||400,n=o.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([r]),q=n.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer");if(q.append("g").attr("class","nv-interactiveGuideLine"),!f)return;function l(){var i=d3.mouse(this),a=i[0],f=i[1],j=!0,l=!1,g;if(k&&(a=d3.event.offsetX,f=d3.event.offsetY,d3.event.target.tagName!=="svg"&&(j=!1),d3.event.target.className.baseVal.match("nv-legend")&&(l=!0)),j&&(a-=c.left,f-=c.top),a<0||f<0||a>p||f>m||d3.event.relatedTarget&&d3.event.relatedTarget.ownerSVGElement===void 0||l){if(k)if(d3.event.relatedTarget&&d3.event.relatedTarget.ownerSVGElement===void 0&&(d3.event.relatedTarget.className===void 0||d3.event.relatedTarget.className.match(d.nvPointerEventsClass)))return;e.elementMouseout({mouseX:a,mouseY:f}),b.renderGuideLine(null),d.hidden(!0);return}d.hidden(!1),g=h.invert(a),e.elementMousemove({mouseX:a,mouseY:f,pointXValue:g}),d3.event.type==="dblclick"&&e.elementDblclick({mouseX:a,mouseY:f,pointXValue:g}),d3.event.type==='click'&&e.elementClick({mouseX:a,mouseY:f,pointXValue:g})}f.on("touchmove",l).on("mousemove",l,!0).on("mouseout",l,!0).on("dblclick",l).on("click",l),b.guideLine=null,b.renderGuideLine=function(c){if(!i)return;if(b.guideLine&&b.guideLine.attr("x1")===c)return;a.dom.write(function(){var b=n.select(".nv-interactiveGuideLine").selectAll("line").data(c!=null?[a.utils.NaNtoZero(c)]:[],String);b.enter().append("line").attr("class","nv-guideline").attr("x1",function(a){return a}).attr("x2",function(a){return a}).attr("y1",m).attr("y2",0),b.exit().remove()})}})}return b.dispatch=e,b.tooltip=d,b.margin=function(a){return arguments.length?(c.top=typeof a.top!='undefined'?a.top:c.top,c.left=typeof a.left!='undefined'?a.left:c.left,b):c},b.width=function(a){return arguments.length?(j=a,b):j},b.height=function(a){return arguments.length?(g=a,b):g},b.xScale=function(a){return arguments.length?(h=a,b):h},b.showGuideLine=function(a){return arguments.length?(i=a,b):i},b.svgContainer=function(a){return arguments.length?(f=a,b):f},b},a.interactiveBisect=function(d,f,j){"use strict";var b,h,i,a,c,e,g;return d instanceof Array?(typeof j!='function'?b=function(a){return a.x}:b=j,h=function(a,c){return b(a)-c},i=d3.bisector(h).left,a=d3.max([0,i(d,f)-1]),c=b(d[a]),typeof c=='undefined'&&(c=a),c===f)?a:(e=d3.min([a+1,d.length-1]),g=b(d[e]),typeof g=='undefined'&&(g=e),Math.abs(g-f)>=Math.abs(c-f))?a:e:null},a.nearestValueIndex=function(c,d,e){"use strict";var a=1/0,b=null;return c.forEach(function(f,g){var c=Math.abs(d-f);f!=null&&c<=a&&c<e&&(a=c,b=g)}),b},function(){"use strict";a.models.tooltip=function(){var m=null,p='w',e=25,i=0,l=null,j=null,c=null,k=!0,w=400,f=null,b=null,d={left:null,top:null},h={left:0,top:0},o=!0,x=100,q=!0,r=!1,y="nvtooltip-"+Math.floor(Math.random()*1e5),t="nv-pointer-events-none",u=function(a,b){return a},v=function(a){return a},n=function(a,b){return a},s=function(a){var c,e,f,b,d;return a===null?'':(c=d3.select(document.createElement("table")),q&&(e=c.selectAll("thead").data([a]).enter().append("thead"),e.append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(v(a.value))),f=c.selectAll("tbody").data([a]).enter().append("tbody"),b=f.selectAll("tr").data(function(a){return a.series}).enter().append("tr").classed("highlight",function(a){return a.highlight}),b.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(a){return a.color}),b.append("td").classed("key",!0).html(function(a,b){return n(a.key,b)}),b.append("td").classed("value",!0).html(function(a,b){return u(a.value,b)}),b.selectAll("td").each(function(c){var a,b;c.highlight&&(a=d3.scale.linear().domain([0,1]).range(["#fff",c.color]),b=.6,d3.select(this).style("border-bottom-color",a(b)).style("border-top-color",a(b)))}),d=c.node().outerHTML,a.footer!==void 0&&(d+="<div class='footer'>"+a.footer+"</div>"),d)},A=function(a){if(a&&a.series){if(a.series instanceof Array)return!!a.series.length;if(a.series instanceof Object)return a.series=[a.series],!0}return!1},z=function(c){if(!b)return;a.dom.read(function(){var m=parseInt(b.offsetHeight,10),q=parseInt(b.offsetWidth,10),r=a.utils.windowSize().width,n=a.utils.windowSize().height,j=window.pageYOffset,o=window.pageXOffset,g,d,t,s,l,i,u,y,v,z,A;switch(n=window.innerWidth>=document.body.scrollWidth?n:n-16,r=window.innerHeight>=document.body.scrollHeight?r:r-16,t=function(a){var b=d;do isNaN(a.offsetTop)||(b+=a.offsetTop),a=a.offsetParent;while(a)return b},s=function(a){var b=g;do isNaN(a.offsetLeft)||(b+=a.offsetLeft),a=a.offsetParent;while(a)return b},p){case'e':g=c[0]-q-e,d=c[1]-m/2,l=s(b),i=t(b),l<o&&(g=c[0]+e>o?c[0]+e:o-l+g),i<j&&(d=j-i+d),i+m>j+n&&(d=j+n-i+d-m);break;case'w':g=c[0]+e,d=c[1]-m/2,l=s(b),i=t(b),l+q>r&&(g=c[0]-q-e),i<j&&(d=j+5),i+m>j+n&&(d=j+n-i+d-m);break;case'n':g=c[0]-q/2-5,d=c[1]+e,l=s(b),i=t(b),l<o&&(g=o+5),l+q>r&&(g=g-q/2+5),i+m>j+n&&(d=j+n-i+d-m);break;case's':g=c[0]-q/2,d=c[1]-m-e,l=s(b),i=t(b),l<o&&(g=o+5),l+q>r&&(g=g-q/2+5),j>i&&(d=j);break;case'none':g=c[0],d=c[1]-e,l=s(b),i=t(b);break}g-=h.left,d-=h.top,u=b.getBoundingClientRect(),j=window.pageYOffset||document.documentElement.scrollTop,o=window.pageXOffset||document.documentElement.scrollLeft,y='translate('+(u.left+o)+'px, '+(u.top+j)+'px)',v='translate('+g+'px, '+d+'px)',z=d3.interpolateString(y,v),A=f.style('opacity')<.1,k?f.transition().delay(w).duration(0).style('opacity',0):f.interrupt().transition().duration(A?0:x).styleTween('transform',function(a){return z},'important').style('-webkit-transform',v).style('opacity',1)})};function B(){var a,b,e;c&&(a=d3.select(c),a.node().tagName!=="svg"&&(a=a.select("svg")),b=a.node()?a.attr('viewBox'):null,b&&(b=b.split(' '),e=parseInt(a.style('width'),10)/b[2],d.left=d.left*e,d.top=d.top*e))}function C(){if(!f){var a;c?a=c:a=document.body,f=d3.select(a).append("div").attr("class","nvtooltip "+(j||"xy-tooltip")).attr("id",y),f.style("top",0).style("left",0),f.style('opacity',0),f.selectAll("div, table, td, tr").classed(t,!0),f.classed(t,!0),b=f.node()}}function g(){var f,e;if(!o)return;if(!A(m))return;return B(),f=d.left,e=l!==null?l:d.top,a.dom.write(function(){C();var d=s(m);d&&(b.innerHTML=d),c&&r?a.dom.read(function(){var d=c.getElementsByTagName("svg")[0],b={left:0,top:0},g,h,a,j;d&&(g=d.getBoundingClientRect(),h=c.getBoundingClientRect(),a=g.top,a<0&&(j=c.getBoundingClientRect(),a=Math.abs(a)>j.height?0:a),b.top=Math.abs(a-h.top),b.left=Math.abs(g.left-h.left)),f+=c.offsetLeft+b.left-2*c.scrollLeft,e+=c.offsetTop+b.top-2*c.scrollTop,i&&i>0&&(e=Math.floor(e/i)*i),z([f,e])}):z([f,e])}),g}return g.nvPointerEventsClass=t,g.options=a.utils.optionsFunc.bind(g),g._options=Object.create({},{duration:{get:function(){return x},set:function(a){x=a}},gravity:{get:function(){return p},set:function(a){p=a}},distance:{get:function(){return e},set:function(a){e=a}},snapDistance:{get:function(){return i},set:function(a){i=a}},classes:{get:function(){return j},set:function(a){j=a}},chartContainer:{get:function(){return c},set:function(a){c=a}},fixedTop:{get:function(){return l},set:function(a){l=a}},enabled:{get:function(){return o},set:function(a){o=a}},hideDelay:{get:function(){return w},set:function(a){w=a}},contentGenerator:{get:function(){return s},set:function(a){s=a}},valueFormatter:{get:function(){return u},set:function(a){u=a}},headerFormatter:{get:function(){return v},set:function(a){v=a}},keyFormatter:{get:function(){return n},set:function(a){n=a}},headerEnabled:{get:function(){return q},set:function(a){q=a}},_isInteractiveLayer:{get:function(){return r},set:function(a){r=!!a}},position:{get:function(){return d},set:function(a){d.left=a.left!==void 0?a.left:d.left,d.top=a.top!==void 0?a.top:d.top}},offset:{get:function(){return h},set:function(a){h.left=a.left!==void 0?a.left:h.left,h.top=a.top!==void 0?a.top:h.top}},hidden:{get:function(){return k},set:function(a){k!=a&&(k=!!a,g())}},data:{get:function(){return m},set:function(a){a.point&&(a.value=a.point.x,a.series=a.series||{},a.series.value=a.point.y,a.series.color=a.point.color||a.series.color),m=a}},tooltipElem:{get:function(){return b},set:function(a){}},id:{get:function(){return y},set:function(a){}}}),a.utils.initOptions(g),g}}(),a.utils.windowSize=function(){var a={width:640,height:480};return window.innerWidth&&window.innerHeight?(a.width=window.innerWidth,a.height=window.innerHeight,a):document.compatMode=='CSS1Compat'&&document.documentElement&&document.documentElement.offsetWidth?(a.width=document.documentElement.offsetWidth,a.height=document.documentElement.offsetHeight,a):document.body&&document.body.offsetWidth?(a.width=document.body.offsetWidth,a.height=document.body.offsetHeight,a):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){if(b===void 0)return a.utils.defaultColor();if(Array.isArray(b)){var c=d3.scale.ordinal().range(b);return function(a,b){var d=b===void 0?a:b;return a.color||c(d)}}return b},a.utils.defaultColor=function(){return a.utils.getColor(d3.scale.category20().range())},a.utils.customTheme=function(c,d,a){d=d||function(a){return a.key},a=a||d3.scale.category20().range();var b=a.length;return function(f,g){var e=d(f);return typeof c[e]=='function'?c[e]():c[e]!==void 0?c[e]:(b||(b=a.length),b=b-1,a[b])}},a.utils.pjax=function(c,b){var d=function(d){d3.html(d,function(e){var d=d3.select(b).node();d.parentNode.replaceChild(d3.select(e).select(b).node(),d),a.utils.pjax(c,b)})};d3.selectAll(c).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){var b,c;return typeof a.style=='function'&&typeof a.text=='function'?(b=parseInt(a.style("font-size").replace("px",""),10),c=a.text().length,c*b*.5):0},a.utils.NaNtoZero=function(a){return typeof a!='number'||isNaN(a)||a===null||a===1/0||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(f,d){var c,b,e;if(!(this instanceof a.utils.renderWatch))return new a.utils.renderWatch(f,d);c=d!==void 0?d:250,b=[],e=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(b){a.__rendered=!0,e.renderEnd('model')})}(a),b.indexOf(a)<0&&b.push(a)}),this},this.reset=function(a){a!==void 0&&(c=a),b=[]},this.transition=function(a,d,f){if(d=arguments.length>1?[].slice.call(arguments,1):[],d.length>1?f=d.pop():f=c!==void 0?c:250,a.__rendered=!1,b.indexOf(a)<0&&b.push(a),f===0)return a.__rendered=!0,a.delay=function(){return this},a.duration=function(){return this},a;a.length===0?a.__rendered=!0:a.every(function(a){return!a.length})?a.__rendered=!0:a.__rendered=!1;var g=0;return a.transition().duration(f).each(function(){++g}).each('end',function(b,c){--g===0&&(a.__rendered=!0,e.renderEnd.apply(this,d))})},this.renderEnd=function(){b.every(function(a){return a.__rendered})&&(b.forEach(function(a){a.__rendered=!1}),f.renderEnd.apply(this,arguments))}},a.utils.deepExtend=function(b){var c=arguments.length>1?[].slice.call(arguments,1):[];c.forEach(function(d){var c,e,f,g;for(c in d)e=b[c]instanceof Array,f=typeof b[c]=='object',g=typeof d[c]=='object',f&&!e&&g?a.utils.deepExtend(b[c],d[c]):b[c]=d[c]})},a.utils.state=function(){var c,h,d,e,b,f,g;if(!(this instanceof a.utils.state))return new a.utils.state;c={},h=this,d=function(){},e=function(){return{}},b=null,f=null,this.dispatch=d3.dispatch('change','set'),this.dispatch.on('set',function(a){d(a,!0)}),this.getter=function(a){return e=a,this},this.setter=function(b,a){return a||(a=function(){}),d=function(c,d){b(c),d&&a()},this},this.init=function(c){b=b||{},a.utils.deepExtend(b,c)},g=function(){var b=e(),a;if(JSON.stringify(b)===JSON.stringify(c))return!1;for(a in b)c[a]===void 0&&(c[a]={}),c[a]=b[a],f=!0;return!0},this.update=function(){b&&(d(b,!1),b=null),g.call(this)&&this.dispatch.change(c)}},a.utils.optionsFunc=function(a){return a&&d3.map(a).forEach(function(a,b){typeof this[a]=="function"&&this[a](b)}.bind(this)),this},a.utils.calcTicksX=function(b,e){var c=1,d=0,f;for(d;d<e.length;d+=1)f=e[d]&&e[d].values?e[d].values.length:0,c=f>c?f:c;return a.log("Requested number of ticks: ",b),a.log("Calculated max values to be: ",c),b=b>c?b=c-1:b,b=b<1?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._calls&&a._calls[b]?a[b]=a._calls[b]:(a[b]=function(c){return arguments.length?(a._overrides[b]=!0,a._options[b]=c,a):a._options[b]},a['_'+b]=function(c){return arguments.length?(a._overrides[b]||(a._options[b]=c),a):a._options[b]})},a.utils.initOptions=function(b){var c,d,e;b._overrides=b._overrides||{},c=Object.getOwnPropertyNames(b._options||{}),d=Object.getOwnPropertyNames(b._calls||{}),c=c.concat(d);for(e in c)a.utils.initOption(b,c[e])},a.utils.inheritOptionsD3=function(b,c,a){b._d3options=a.concat(b._d3options||[]),a.unshift(c),a.unshift(b),d3.rebind.apply(this,a)},a.utils.arrayUnique=function(a){return a.sort().filter(function(c,b){return!b||c!=a[b-1]})},a.utils.symbolMap=d3.map(),a.utils.symbol=function(){var c,d=64;function b(e,f){var b=c.call(this,e,f),g=d.call(this,e,f);return d3.svg.symbolTypes.indexOf(b)!==-1?d3.svg.symbol().type(b).size(g)():a.utils.symbolMap.get(b)(g)}return b.type=function(a){return arguments.length?(c=d3.functor(a),b):c},b.size=function(a){return arguments.length?(d=d3.functor(a),b):d},b},a.utils.inheritOptions=function(b,c){var d=Object.getOwnPropertyNames(c._options||{}),f=Object.getOwnPropertyNames(c._calls||{}),g=c._inherited||[],h=c._d3options||[],e=d.concat(f).concat(g).concat(h);e.unshift(c),e.unshift(b),d3.rebind.apply(this,e),b._inherited=a.utils.arrayUnique(d.concat(f).concat(g).concat(d).concat(b._inherited||[])),b._d3options=a.utils.arrayUnique(h.concat(b._d3options||[]))},a.utils.initSVG=function(a){a.classed({'nvd3-svg':!0})},a.utils.sanitizeHeight=function(a,b){return a||parseInt(b.style('height'),10)||400},a.utils.sanitizeWidth=function(a,b){return a||parseInt(b.style('width'),10)||960},a.utils.availableHeight=function(c,d,b){return a.utils.sanitizeHeight(c,d)-b.top-b.bottom},a.utils.availableWidth=function(c,d,b){return a.utils.sanitizeWidth(c,d)-b.left-b.right},a.utils.noData=function(g,b){var c=g.options(),d=c.margin(),e=c.noData(),h=e==null?["No Data Available."]:[e],i=a.utils.availableHeight(c.height(),b,d),j=a.utils.availableWidth(c.width(),b,d),k=d.left+j/2,l=d.top+i/2,f;b.selectAll('g').remove(),f=b.selectAll('.nv-noData').data(h),f.enter().append('text').attr('class','nvd3 nv-noData').attr('dy','-.7em').style('text-anchor','middle'),f.attr('x',k).attr('y',l).text(function(a){return a})},a.models.axis=function(){"use strict";var c=d3.svg.axis(),b=d3.scale.linear(),d={top:0,right:0,bottom:0,left:0},k=75,s=60,q=null,h=!0,i=0,f=!0,o=!1,p=!1,m=null,n=0,l=250,r=d3.dispatch('renderEnd'),j,g;c.scale(b).orient('bottom').tickFormat(function(a){return a}),g=a.utils.renderWatch(r,l);function e(l){return g.reset(),l.each(function(E){var B=d3.select(this),s,D,F,t,u,l,z,e,r,w,A,y,x,C,v;switch(a.utils.initSVG(B),s=B.selectAll('g.nv-wrap.nv-axis').data([E]),D=s.enter().append('g').attr('class','nvd3 nv-wrap nv-axis'),F=D.append('g'),t=s.select('g'),m!==null?c.ticks(m):(c.orient()=='top'||c.orient()=='bottom')&&c.ticks(Math.abs(b.range()[1]-b.range()[0])/100),t.watchTransition(g,'axis').call(c),j=j||c.scale(),u=c.tickFormat(),u==null&&(u=j.tickFormat()),l=t.selectAll('text.nv-axislabel').data([q||null]),l.exit().remove(),c.orient()){case'top':l.enter().append('text').attr('class','nv-axislabel'),b.range().length<2?r=0:b.range().length===2?r=b.range()[1]:r=b.range()[b.range().length-1]+(b.range()[1]-b.range()[0]),l.attr('text-anchor','middle').attr('y',0).attr('x',r/2),h&&(e=s.selectAll('g.nv-axisMaxMin').data(b.domain()),e.enter().append('g').attr('class',function(b,a){return['nv-axisMaxMin','nv-axisMaxMin-x',a==0?'nv-axisMin-x':'nv-axisMax-x'].join(' ')}).append('text'),e.exit().remove(),e.attr('transform',function(c,d){return'translate('+a.utils.NaNtoZero(b(c))+',0)'}).select('text').attr('dy','-0.5em').attr('y',-c.tickPadding()).attr('text-anchor','middle').text(function(b,c){var a=u(b);return(''+a).match('NaN')?'':a}),e.watchTransition(g,'min-max top').attr('transform',function(d,c){return'translate('+a.utils.NaNtoZero(b.range()[c])+',0)'}));break;case'bottom':z=n+36,w=30,A=0,y=t.selectAll('g').select("text"),x='',i%360&&(y.each(function(c,d){var a=this.getBoundingClientRect(),b=a.width;A=a.height,b>w&&(w=b)}),x='rotate('+i+' 0,'+(A/2+c.tickPadding())+')',C=Math.abs(Math.sin(i*Math.PI/180)),z=(C?C*w:w)+30,y.attr('transform',x).style('text-anchor',i%360>0?'start':'end')),l.enter().append('text').attr('class','nv-axislabel'),b.range().length<2?r=0:b.range().length===2?r=b.range()[1]:r=b.range()[b.range().length-1]+(b.range()[1]-b.range()[0]),l.attr('text-anchor','middle').attr('y',z).attr('x',r/2),h&&(e=s.selectAll('g.nv-axisMaxMin').data([b.domain()[0],b.domain()[b.domain().length-1]]),e.enter().append('g').attr('class',function(b,a){return['nv-axisMaxMin','nv-axisMaxMin-x',a==0?'nv-axisMin-x':'nv-axisMax-x'].join(' ')}).append('text'),e.exit().remove(),e.attr('transform',function(c,d){return'translate('+a.utils.NaNtoZero(b(c)+(p?b.rangeBand()/2:0))+',0)'}).select('text').attr('dy','.71em').attr('y',c.tickPadding()).attr('transform',x).style('text-anchor',i?i%360>0?'start':'end':'middle').text(function(b,c){var a=u(b);return(''+a).match('NaN')?'':a}),e.watchTransition(g,'min-max bottom').attr('transform',function(c,d){return'translate('+a.utils.NaNtoZero(b(c)+(p?b.rangeBand()/2:0))+',0)'})),o&&y.attr('transform',function(b,a){return'translate(0,'+(a%2==0?'0':'12')+')'});break;case'right':l.enter().append('text').attr('class','nv-axislabel'),l.style('text-anchor',f?'middle':'begin').attr('transform',f?'rotate(90)':'').attr('y',f?-Math.max(d.right,k)+12:-10).attr('x',f?d3.max(b.range())/2:c.tickPadding()),h&&(e=s.selectAll('g.nv-axisMaxMin').data(b.domain()),e.enter().append('g').attr('class',function(b,a){return['nv-axisMaxMin','nv-axisMaxMin-y',a==0?'nv-axisMin-y':'nv-axisMax-y'].join(' ')}).append('text').style('opacity',0),e.exit().remove(),e.attr('transform',function(c,d){return'translate(0,'+a.utils.NaNtoZero(b(c))+')'}).select('text').attr('dy','.32em').attr('y',0).attr('x',c.tickPadding()).style('text-anchor','start').text(function(b,c){var a=u(b);return(''+a).match('NaN')?'':a}),e.watchTransition(g,'min-max right').attr('transform',function(d,c){return'translate(0,'+a.utils.NaNtoZero(b.range()[c])+')'}).select('text').style('opacity',1));break;case'left':l.enter().append('text').attr('class','nv-axislabel'),l.style('text-anchor',f?'middle':'end').attr('transform',f?'rotate(-90)':'').attr('y',f?-Math.max(d.left,k)+25-(n||0):-10).attr('x',f?-d3.max(b.range())/2:-c.tickPadding()),h&&(e=s.selectAll('g.nv-axisMaxMin').data(b.domain()),e.enter().append('g').attr('class',function(b,a){return['nv-axisMaxMin','nv-axisMaxMin-y',a==0?'nv-axisMin-y':'nv-axisMax-y'].join(' ')}).append('text').style('opacity',0),e.exit().remove(),e.attr('transform',function(b,c){return'translate(0,'+a.utils.NaNtoZero(j(b))+')'}).select('text').attr('dy','.32em').attr('y',0).attr('x',-c.tickPadding()).attr('text-anchor','end').text(function(b,c){var a=u(b);return(''+a).match('NaN')?'':a}),e.watchTransition(g,'min-max right').attr('transform',function(d,c){return'translate(0,'+a.utils.NaNtoZero(b.range()[c])+')'}).select('text').style('opacity',1));break}l.text(function(a){return a}),h&&(c.orient()==='left'||c.orient()==='right')&&(t.selectAll('g').each(function(a,c){d3.select(this).select('text').attr('opacity',1),(b(a)<b.range()[1]+10||b(a)>b.range()[0]-10)&&((a>1e-10||a<-1e-10)&&d3.select(this).attr('opacity',0),d3.select(this).select('text').attr('opacity',0))}),b.domain()[0]==b.domain()[1]&&b.domain()[0]==0&&s.selectAll('g.nv-axisMaxMin').style('opacity',function(b,a){return a?0:1})),h&&(c.orient()==='top'||c.orient()==='bottom')&&(v=[],s.selectAll('g.nv-axisMaxMin').each(function(a,c){try{c?v.push(b(a)-this.getBoundingClientRect().width-4):v.push(b(a)+this.getBoundingClientRect().width+4)}catch(d){c?v.push(b(a)-4):v.push(b(a)+4)}}),t.selectAll('g').each(function(a,c){(b(a)<v[0]||b(a)>v[1])&&(a>1e-10||a<-1e-10?d3.select(this).remove():d3.select(this).select('text').remove())})),t.selectAll('.tick').filter(function(a){return!parseFloat(Math.round(a*1e5)/1e6)&&a!==void 0}).classed('zero',!0),j=b.copy()}),g.renderEnd('axis immediate'),e}return e.axis=c,e.dispatch=r,e.options=a.utils.optionsFunc.bind(e),e._options=Object.create({},{axisLabelDistance:{get:function(){return n},set:function(a){n=a}},staggerLabels:{get:function(){return o},set:function(a){o=a}},rotateLabels:{get:function(){return i},set:function(a){i=a}},rotateYLabel:{get:function(){return f},set:function(a){f=a}},showMaxMin:{get:function(){return h},set:function(a){h=a}},axisLabel:{get:function(){return q},set:function(a){q=a}},height:{get:function(){return s},set:function(a){s=a}},ticks:{get:function(){return m},set:function(a){m=a}},width:{get:function(){return k},set:function(a){k=a}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},duration:{get:function(){return l},set:function(a){l=a,g.reset(l)}},scale:{get:function(){return b},set:function(d){b=d,c.scale(b),p=typeof b.rangeBands=='function',a.utils.inheritOptionsD3(e,b,['domain','range','rangeBand','rangeBands'])}}}),a.utils.initOptions(e),a.utils.inheritOptionsD3(e,c,['orient','tickValues','tickSubdivide','tickSize','tickPadding','tickFormat']),a.utils.inheritOptionsD3(e,b,['domain','range','rangeBand','rangeBands']),e},a.models.boxPlot=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},m=960,p=500,u=Math.floor(Math.random()*1e4),d=d3.scale.ordinal(),c=d3.scale.linear(),i=function(a){return a.x},v=function(a){return a.y},b=a.utils.defaultColor(),q=null,l,k,n,o,f=d3.dispatch('elementMouseover','elementMouseout','elementMousemove','renderEnd'),j=250,r=null,g=a.utils.renderWatch(f,j),t,s;function h(u){return g.reset(),u.each(function(u){var F=m-e.left-e.right,E=p-e.top-e.bottom,A,D,C,y,G,h,w,v,x,z,B;q=d3.select(this),a.utils.initSVG(q),d.domain(l||u.map(function(a,b){return i(a,b)})).rangeBands(n||[0,F],.1),A=[],k||(D=d3.min(u.map(function(a){var b=[];return b.push(a.values.Q1),a.values.hasOwnProperty('whisker_low')&&a.values.whisker_low!==null&&b.push(a.values.whisker_low),a.values.hasOwnProperty('outliers')&&a.values.outliers!==null&&(b=b.concat(a.values.outliers)),d3.min(b)})),C=d3.max(u.map(function(a){var b=[];return b.push(a.values.Q3),a.values.hasOwnProperty('whisker_high')&&a.values.whisker_high!==null&&b.push(a.values.whisker_high),a.values.hasOwnProperty('outliers')&&a.values.outliers!==null&&(b=b.concat(a.values.outliers)),d3.max(b)})),A=[D,C]),c.domain(k||A),c.range(o||[E,0]),s=s||d,t=t||c.copy().range([c(0),c(0)]),y=q.selectAll('g.nv-wrap').data([u]),G=y.enter().append('g').attr('class','nvd3 nv-wrap'),y.attr('transform','translate('+e.left+','+e.top+')'),h=y.selectAll('.nv-boxplot').data(function(a){return a}),w=h.enter().append('g').style('stroke-opacity',1e-6).style('fill-opacity',1e-6),h.attr('class','nv-boxplot').attr('transform',function(a,b,c){return'translate('+(d(i(a,b))+d.rangeBand()*.05)+', 0)'}).classed('hover',function(a){return a.hover}),h.watchTransition(g,'nv-boxplot: boxplots').style('stroke-opacity',1).style('fill-opacity',.75).delay(function(b,a){return a*j/u.length}).attr('transform',function(a,b){return'translate('+(d(i(a,b))+d.rangeBand()*.05)+', 0)'}),h.exit().remove(),w.each(function(a,c){var d=d3.select(this);['low','high'].forEach(function(e){a.values.hasOwnProperty('whisker_'+e)&&a.values['whisker_'+e]!==null&&(d.append('line').style('stroke',a.color?a.color:b(a,c)).attr('class','nv-boxplot-whisker nv-boxplot-'+e),d.append('line').style('stroke',a.color?a.color:b(a,c)).attr('class','nv-boxplot-tick nv-boxplot-'+e))})}),v=h.selectAll('.nv-boxplot-outlier').data(function(a){return a.values.hasOwnProperty('outliers')&&a.values.outliers!==null?a.values.outliers:[]}),v.enter().append('circle').style('fill',function(a,d,c){return b(a,c)}).style('stroke',function(a,d,c){return b(a,c)}).on('mouseover',function(a,d,c){d3.select(this).classed('hover',!0),f.elementMouseover({series:{key:a,color:b(a,c)},e:d3.event})}).on('mouseout',function(a,d,c){d3.select(this).classed('hover',!1),f.elementMouseout({series:{key:a,color:b(a,c)},e:d3.event})}).on('mousemove',function(a,b){f.elementMousemove({e:d3.event})}),v.attr('class','nv-boxplot-outlier'),v.watchTransition(g,'nv-boxplot: nv-boxplot-outlier').attr('cx',d.rangeBand()*.45).attr('cy',function(a,b,d){return c(a)}).attr('r','3'),v.exit().remove(),x=function(){return r===null?d.rangeBand()*.9:Math.min(75,d.rangeBand()*.9)},z=function(){return d.rangeBand()*.45-x()/2},B=function(){return d.rangeBand()*.45+x()/2},['low','high'].forEach(function(a){var b=a==='low'?'Q1':'Q3';h.select('line.nv-boxplot-whisker.nv-boxplot-'+a).watchTransition(g,'nv-boxplot: boxplots').attr('x1',d.rangeBand()*.45).attr('y1',function(b,d){return c(b.values['whisker_'+a])}).attr('x2',d.rangeBand()*.45).attr('y2',function(a,d){return c(a.values[b])}),h.select('line.nv-boxplot-tick.nv-boxplot-'+a).watchTransition(g,'nv-boxplot: boxplots').attr('x1',z).attr('y1',function(b,d){return c(b.values['whisker_'+a])}).attr('x2',B).attr('y2',function(b,d){return c(b.values['whisker_'+a])})}),['low','high'].forEach(function(a){w.selectAll('.nv-boxplot-'+a).on('mouseover',function(c,e,d){d3.select(this).classed('hover',!0),f.elementMouseover({series:{key:c.values['whisker_'+a],color:b(c,d)},e:d3.event})}).on('mouseout',function(c,e,d){d3.select(this).classed('hover',!1),f.elementMouseout({series:{key:c.values['whisker_'+a],color:b(c,d)},e:d3.event})}).on('mousemove',function(a,b){f.elementMousemove({e:d3.event})})}),w.append('rect').attr('class','nv-boxplot-box').on('mouseover',function(a,c){d3.select(this).classed('hover',!0),f.elementMouseover({key:a.label,value:a.label,series:[{key:'Q3',value:a.values.Q3,color:a.color||b(a,c)},{key:'Q2',value:a.values.Q2,color:a.color||b(a,c)},{key:'Q1',value:a.values.Q1,color:a.color||b(a,c)}],data:a,index:c,e:d3.event})}).on('mouseout',function(a,c){d3.select(this).classed('hover',!1),f.elementMouseout({key:a.label,value:a.label,series:[{key:'Q3',value:a.values.Q3,color:a.color||b(a,c)},{key:'Q2',value:a.values.Q2,color:a.color||b(a,c)},{key:'Q1',value:a.values.Q1,color:a.color||b(a,c)}],data:a,index:c,e:d3.event})}).on('mousemove',function(a,b){f.elementMousemove({e:d3.event})}),h.select('rect.nv-boxplot-box').watchTransition(g,'nv-boxplot: boxes').attr('y',function(a,b){return c(a.values.Q3)}).attr('width',x).attr('x',z).attr('height',function(a,b){return Math.abs(c(a.values.Q3)-c(a.values.Q1))||1}).style('fill',function(a,c){return a.color||b(a,c)}).style('stroke',function(a,c){return a.color||b(a,c)}),w.append('line').attr('class','nv-boxplot-median'),h.select('line.nv-boxplot-median').watchTransition(g,'nv-boxplot: boxplots line').attr('x1',z).attr('y1',function(a,b){return c(a.values.Q2)}).attr('x2',B).attr('y2',function(a,b){return c(a.values.Q2)}),s=d.copy(),t=c.copy()}),g.renderEnd('nv-boxplot immediate'),h}return h.dispatch=f,h.options=a.utils.optionsFunc.bind(h),h._options=Object.create({},{width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return p},set:function(a){p=a}},maxBoxWidth:{get:function(){return r},set:function(a){r=a}},x:{get:function(){return i},set:function(a){i=a}},y:{get:function(){return v},set:function(a){v=a}},xScale:{get:function(){return d},set:function(a){d=a}},yScale:{get:function(){return c},set:function(a){c=a}},xDomain:{get:function(){return l},set:function(a){l=a}},yDomain:{get:function(){return k},set:function(a){k=a}},xRange:{get:function(){return n},set:function(a){n=a}},yRange:{get:function(){return o},set:function(a){o=a}},id:{get:function(){return u},set:function(a){u=a}},margin:{get:function(){return e},set:function(a){e.top=a.top!==void 0?a.top:e.top,e.right=a.right!==void 0?a.right:e.right,e.bottom=a.bottom!==void 0?a.bottom:e.bottom,e.left=a.left!==void 0?a.left:e.left}},color:{get:function(){return b},set:function(c){b=a.utils.getColor(c)}},duration:{get:function(){return j},set:function(a){j=a,g.reset(j)}}}),a.utils.initOptions(h),h},a.models.boxPlotChart=function(){"use strict";var d=a.models.boxPlot(),h=a.models.axis(),g=a.models.axis(),b={top:15,right:10,bottom:50,left:60},r=null,s=null,t=a.utils.getColor(),l=!0,m=!0,o=!1,k=!1,f=a.models.tooltip(),p="No Data Available.",q=d3.dispatch('tooltipShow','tooltipHide','beforeUpdate','renderEnd'),e=250,j,n,i;h.orient('bottom').showMaxMin(!1).tickFormat(function(a){return a}),g.orient(o?'right':'left').tickFormat(d3.format(',.1f')),f.duration(0),i=a.utils.renderWatch(q,e);function c(f){return i.reset(),i.models(d),l&&i.models(h),m&&i.models(g),f.each(function(t){var i=d3.select(this),C=this,u,v,x,y,w,z,f,A,B;if(a.utils.initSVG(i),u=(r||parseInt(i.style('width'))||960)-b.left-b.right,v=(s||parseInt(i.style('height'))||400)-b.top-b.bottom,c.update=function(){q.beforeUpdate(),i.transition().duration(e).call(c)},c.container=this,!t||!t.length||!t.filter(function(a){return a.values.hasOwnProperty("Q1")&&a.values.hasOwnProperty("Q2")&&a.values.hasOwnProperty("Q3")}).length)return x=i.selectAll('.nv-noData').data([p]),x.enter().append('text').attr('class','nvd3 nv-noData').attr('dy','-.7em').style('text-anchor','middle'),x.attr('x',b.left+u/2).attr('y',b.top+v/2).text(function(a){return a}),c;i.selectAll('.nv-noData').remove(),n=d.xScale(),j=d.yScale().clamp(!0),y=i.selectAll('g.nv-wrap.nv-boxPlotWithAxes').data([t]),w=y.enter().append('g').attr('class','nvd3 nv-wrap nv-boxPlotWithAxes').append('g'),z=w.append('defs'),f=y.select('g'),w.append('g').attr('class','nv-x nv-axis'),w.append('g').attr('class','nv-y nv-axis').append('g').attr('class','nv-zeroLine').append('line'),w.append('g').attr('class','nv-barsWrap'),f.attr('transform','translate('+b.left+','+b.top+')'),o&&f.select(".nv-y.nv-axis").attr("transform","translate("+u+",0)"),d.width(u).height(v),A=f.select('.nv-barsWrap').datum(t.filter(function(a){return!a.disabled})),A.transition().call(d),z.append('clipPath').attr('id','nv-x-label-clip-'+d.id()).append('rect'),f.select('#nv-x-label-clip-'+d.id()+' rect').attr('width',n.rangeBand()*(k?2:1)).attr('height',16).attr('x',-n.rangeBand()/(k?1:2)),l&&(h.scale(n).ticks(a.utils.calcTicksX(u/100,t)).tickSize(-v,0),f.select('.nv-x.nv-axis').attr('transform','translate(0,'+j.range()[0]+')'),f.select('.nv-x.nv-axis').call(h),B=f.select('.nv-x.nv-axis').selectAll('g'),k&&B.selectAll('text').attr('transform',function(b,c,a){return'translate(0,'+(a%2==0?'5':'17')+')'})),m&&(g.scale(j).ticks(Math.floor(v/36)).tickSize(-u,0),f.select('.nv-y.nv-axis').call(g)),f.select(".nv-zeroLine line").attr("x1",0).attr("x2",u).attr("y1",j(0)).attr("y2",j(0))}),i.renderEnd('nv-boxplot chart immediate'),c}return d.dispatch.on('elementMouseover.tooltip',function(a){f.data(a).hidden(!1)}),d.dispatch.on('elementMouseout.tooltip',function(a){f.data(a).hidden(!0)}),d.dispatch.on('elementMousemove.tooltip',function(a){f.position({top:d3.event.pageY,left:d3.event.pageX})()}),c.dispatch=q,c.boxplot=d,c.xAxis=h,c.yAxis=g,c.tooltip=f,c.options=a.utils.optionsFunc.bind(c),c._options=Object.create({},{width:{get:function(){return r},set:function(a){r=a}},height:{get:function(){return s},set:function(a){s=a}},staggerLabels:{get:function(){return k},set:function(a){k=a}},showXAxis:{get:function(){return l},set:function(a){l=a}},showYAxis:{get:function(){return m},set:function(a){m=a}},tooltips:{get:function(){return tooltips},set:function(a){tooltips=a}},tooltipContent:{get:function(){return f},set:function(a){f=a}},noData:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return b},set:function(a){b.top=a.top!==void 0?a.top:b.top,b.right=a.right!==void 0?a.right:b.right,b.bottom=a.bottom!==void 0?a.bottom:b.bottom,b.left=a.left!==void 0?a.left:b.left}},duration:{get:function(){return e},set:function(a){e=a,i.reset(e),d.duration(e),h.duration(e),g.duration(e)}},color:{get:function(){return t},set:function(b){t=a.utils.getColor(b),d.color(t)}},rightAlignYAxis:{get:function(){return o},set:function(a){o=a,g.orient(a?'right':'left')}}}),a.utils.inheritOptions(c,d),a.utils.initOptions(c),c},a.models.bullet=function(){"use strict";var b={top:0,right:0,bottom:0,left:0},e='left',n=!1,m=function(a){return a.ranges},g=function(a){return a.markers?a.markers:[0]},h=function(a){return a.measures},q=function(a){return a.rangeLabels?a.rangeLabels:[]},p=function(a){return a.markerLabels?a.markerLabels:[]},r=function(a){return a.measureLabels?a.measureLabels:[]},k=[0],l=380,f=30,j=null,o=null,i=a.utils.getColor(['#1f77b4']),c=d3.dispatch('elementMouseover','elementMouseout','elementMousemove');function d(e){return e.each(function(t,u){var G=l-b.left-b.right,s=f-b.top-b.bottom,B,J,o,H,K,z,e,D,v,d,F,C,I,y,E,N,A,M,x,w,L;j=d3.select(this),a.utils.initSVG(j),B=m.call(this,t,u).slice().sort(d3.descending),J=g.call(this,t,u).slice().sort(d3.descending),o=h.call(this,t,u).slice().sort(d3.descending),H=q.call(this,t,u).slice(),K=p.call(this,t,u).slice(),z=r.call(this,t,u).slice(),e=d3.scale.linear().domain(d3.extent(d3.merge([k,B]))).range(n?[G,0]:[0,G]),D=this.__chart__||d3.scale.linear().domain([0,1/0]).range(e.range()),this.__chart__=e,v=d3.min(B),d=d3.max(B),F=B[1],C=j.selectAll('g.nv-wrap.nv-bullet').data([t]),I=C.enter().append('g').attr('class','nvd3 nv-wrap nv-bullet'),y=I.append('g'),E=C.select('g'),y.append('rect').attr('class','nv-range nv-rangeMax'),y.append('rect').attr('class','nv-range nv-rangeAvg'),y.append('rect').attr('class','nv-range nv-rangeMin'),y.append('rect').attr('class','nv-measure'),C.attr('transform','translate('+b.left+','+b.top+')'),N=function(a){return Math.abs(D(a)-D(0))},A=function(a){return Math.abs(e(a)-e(0))},M=function(a){return a<0?D(a):D(0)},x=function(a){return a<0?e(a):e(0)},E.select('rect.nv-rangeMax').attr('height',s).attr('width',A(d>0?d:v)).attr('x',x(d>0?d:v)).datum(d>0?d:v),E.select('rect.nv-rangeAvg').attr('height',s).attr('width',A(F)).attr('x',x(F)).datum(F),E.select('rect.nv-rangeMin').attr('height',s).attr('width',A(d)).attr('x',x(d)).attr('width',A(d>0?v:d)).attr('x',x(d>0?v:d)).datum(d>0?v:d),E.select('rect.nv-measure').style('fill',i).attr('height',s/3).attr('y',s/3).attr('width',o<0?e(0)-e(o[0]):e(o[0])-e(0)).attr('x',x(o)).on('mouseover',function(){c.elementMouseover({value:o[0],label:z[0]||'Current',color:d3.select(this).style("fill")})}).on('mousemove',function(){c.elementMousemove({value:o[0],label:z[0]||'Current',color:d3.select(this).style("fill")})}).on('mouseout',function(){c.elementMouseout({value:o[0],label:z[0]||'Current',color:d3.select(this).style("fill")})}),w=s/6,L=J.map(function(a,b){return{value:a,label:K[b]}}),y.selectAll("path.nv-markerTriangle").data(L).enter().append('path').attr('class','nv-markerTriangle').attr('transform',function(a){return'translate('+e(a.value)+','+s/2+')'}).attr('d','M0,'+w+'L'+w+','+-w+' '+-w+','+-w+'Z').on('mouseover',function(a){c.elementMouseover({value:a.value,label:a.label||'Previous',color:d3.select(this).style("fill"),pos:[e(a.value),s/2]})}).on('mousemove',function(a){c.elementMousemove({value:a.value,label:a.label||'Previous',color:d3.select(this).style("fill")})}).on('mouseout',function(a,b){c.elementMouseout({value:a.value,label:a.label||'Previous',color:d3.select(this).style("fill")})}),C.selectAll('.nv-range').on('mouseover',function(b,a){var d=H[a]||(a?a==1?"Mean":"Minimum":"Maximum");c.elementMouseover({value:b,label:d,color:d3.select(this).style("fill")})}).on('mousemove',function(){c.elementMousemove({value:o[0],label:z[0]||'Previous',color:d3.select(this).style("fill")})}).on('mouseout',function(b,a){var d=H[a]||(a?a==1?"Mean":"Minimum":"Maximum");c.elementMouseout({value:b,label:d,color:d3.select(this).style("fill")})})}),d}return d.dispatch=c,d.options=a.utils.optionsFunc.bind(d),d._options=Object.create({},{ranges:{get:function(){return m},set:function(a){m=a}},markers:{get:function(){return g},set:function(a){g=a}},measures:{get:function(){return h},set:function(a){h=a}},forceX:{get:function(){return k},set:function(a){k=a}},width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return f},set:function(a){f=a}},tickFormat:{get:function(){return o},set:function(a){o=a}},margin:{get:function(){return b},set:function(a){b.top=a.top!==void 0?a.top:b.top,b.right=a.right!==void 0?a.right:b.right,b.bottom=a.bottom!==void 0?a.bottom:b.bottom,b.left=a.left!==void 0?a.left:b.left}},orient:{get:function(){return e},set:function(a){e=a,n=e=='right'||e=='bottom'}},color:{get:function(){return i},set:function(b){i=a.utils.getColor(b)}}}),a.utils.initOptions(d),d},a.models.bulletChart=function(){"use strict";var e=a.models.bullet(),d=a.models.tooltip(),g='left',n=!1,b={top:5,right:40,bottom:20,left:120},f=function(a){return a.ranges},k=function(a){return a.markers?a.markers:[0]},m=function(a){return a.measures},l=null,h=55,j=null,i=null,o=null,p=d3.dispatch('tooltipShow','tooltipHide');d.duration(0).headerEnabled(!1);function c(d){return d.each(function(p,s){var r=d3.select(this),q,o,H,D,E,G,t,C,w,z,g,v,I,J,A,F,y,u,x,B;if(a.utils.initSVG(r),q=a.utils.availableWidth(l,r,b),o=h-b.top-b.bottom,H=this,c.update=function(){c(d)},c.container=this,!p||!f.call(this,p,s))return a.utils.noData(c,r),c;r.selectAll('.nv-noData').remove(),D=f.call(this,p,s).slice().sort(d3.descending),E=k.call(this,p,s).slice().sort(d3.descending),G=m.call(this,p,s).slice().sort(d3.descending),t=r.selectAll('g.nv-wrap.nv-bulletChart').data([p]),C=t.enter().append('g').attr('class','nvd3 nv-wrap nv-bulletChart'),w=C.append('g'),z=t.select('g'),w.append('g').attr('class','nv-bulletWrap'),w.append('g').attr('class','nv-titles'),t.attr('transform','translate('+b.left+','+b.top+')'),g=d3.scale.linear().domain([0,Math.max(D[0],E[0],G[0])]).range(n?[q,0]:[0,q]),v=this.__chart__||d3.scale.linear().domain([0,1/0]).range(g.range()),this.__chart__=g,I=function(a){return Math.abs(v(a)-v(0))},J=function(a){return Math.abs(g(a)-g(0))},A=w.select('.nv-titles').append('g').attr('text-anchor','end').attr('transform','translate(-6,'+(h-b.top-b.bottom)/2+')'),A.append('text').attr('class','nv-title').text(function(a){return a.title}),A.append('text').attr('class','nv-subtitle').attr('dy','1em').text(function(a){return a.subtitle}),e.width(q).height(o),F=z.select('.nv-bulletWrap'),d3.transition(F).call(e),y=j||g.tickFormat(q/100),u=z.selectAll('g.nv-tick').data(g.ticks(i||q/50),function(a){return this.textContent||y(a)}),x=u.enter().append('g').attr('class','nv-tick').attr('transform',function(a){return'translate('+v(a)+',0)'}).style('opacity',1e-6),x.append('line').attr('y1',o).attr('y2',o*7/6),x.append('text').attr('text-anchor','middle').attr('dy','1em').attr('y',o*7/6).text(y),B=d3.transition(u).attr('transform',function(a){return'translate('+g(a)+',0)'}).style('opacity',1),B.select('line').attr('y1',o).attr('y2',o*7/6),B.select('text').attr('y',o*7/6),d3.transition(u.exit()).attr('transform',function(a){return'translate('+g(a)+',0)'}).style('opacity',1e-6).remove()}),d3.timer.flush(),c}return e.dispatch.on('elementMouseover.tooltip',function(a){a.series={key:a.label,value:a.value,color:a.color},d.data(a).hidden(!1)}),e.dispatch.on('elementMouseout.tooltip',function(a){d.hidden(!0)}),e.dispatch.on('elementMousemove.tooltip',function(a){d.position({top:d3.event.pageY,left:d3.event.pageX})()}),c.bullet=e,c.dispatch=p,c.tooltip=d,c.options=a.utils.optionsFunc.bind(c),c._options=Object.create({},{ranges:{get:function(){return f},set:function(a){f=a}},markers:{get:function(){return k},set:function(a){k=a}},measures:{get:function(){return m},set:function(a){m=a}},width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return h},set:function(a){h=a}},tickFormat:{get:function(){return j},set:function(a){j=a}},ticks:{get:function(){return i},set:function(a){i=a}},noData:{get:function(){return o},set:function(a){o=a}},tooltips:{get:function(){return d.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),d.enabled(!!b)}},tooltipContent:{get:function(){return d.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),d.contentGenerator(b)}},margin:{get:function(){return b},set:function(a){b.top=a.top!==void 0?a.top:b.top,b.right=a.right!==void 0?a.right:b.right,b.bottom=a.bottom!==void 0?a.bottom:b.bottom,b.left=a.left!==void 0?a.left:b.left}},orient:{get:function(){return g},set:function(a){g=a,n=g=='right'||g=='bottom'}}}),a.utils.inheritOptions(c,e),a.utils.initOptions(c),c},a.models.candlestickBar=function(){"use strict";var d={top:0,right:0,bottom:0,left:0},v=null,p=null,j=Math.floor(Math.random()*1e4),g,c=d3.scale.linear(),b=d3.scale.linear(),i=function(a){return a.x},m=function(a){return a.y},h=function(a){return a.open},f=function(a){return a.close},k=function(a){return a.high},l=function(a){return a.low},s=[],o=[],q=!1,r=!0,x=a.utils.defaultColor(),z=!1,t,u,n,w,y=d3.dispatch('tooltipShow','tooltipHide','stateChange','changeState','renderEnd','chartClick','elementClick','elementDblClick','elementMouseover','elementMouseout','elementMousemove');function e(x){return x.each(function(e){var z,B,x,A,C,F,H,G,D,E,I,J;g=d3.select(this),z=a.utils.availableWidth(v,g,d),B=a.utils.availableHeight(p,g,d),a.utils.initSVG(g),x=z/e[0].values.length*.45,c.domain(t||d3.extent(e[0].values.map(i).concat(s))),q?c.range(n||[z*.5/e[0].values.length,z*(e[0].values.length-.5)/e[0].values.length]):c.range(n||[5+x/2,z-x/2-5]),b.domain(u||[d3.min(e[0].values.map(l).concat(o)),d3.max(e[0].values.map(k).concat(o))]).range(w||[B,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-c.domain()[0]*.01,c.domain()[1]+c.domain()[1]*.01]):c.domain([-1,1])),b.domain()[0]===b.domain()[1]&&(b.domain()[0]?b.domain([b.domain()[0]+b.domain()[0]*.01,b.domain()[1]-b.domain()[1]*.01]):b.domain([-1,1])),A=d3.select(this).selectAll('g.nv-wrap.nv-candlestickBar').data([e[0].values]),C=A.enter().append('g').attr('class','nvd3 nv-wrap nv-candlestickBar'),F=C.append('defs'),H=C.append('g'),G=A.select('g'),H.append('g').attr('class','nv-ticks'),A.attr('transform','translate('+d.left+','+d.top+')'),g.on('click',function(a,b){y.chartClick({data:a,index:b,pos:d3.event,id:j})}),F.append('clipPath').attr('id','nv-chart-clip-path-'+j).append('rect'),A.select('#nv-chart-clip-path-'+j+' rect').attr('width',z).attr('height',B),G.attr('clip-path',r?'url(#nv-chart-clip-path-'+j+')':''),D=A.select('.nv-ticks').selectAll('.nv-tick').data(function(a){return a}),D.exit().remove(),E=D.enter().append('g').attr('class',function(b,a,c){return(h(b,a)>f(b,a)?'nv-tick negative':'nv-tick positive')+' nv-tick-'+c+'-'+a}),I=E.append('line').attr('class','nv-candlestick-lines').attr('transform',function(a,b){return'translate('+c(i(a,b))+',0)'}).attr('x1',0).attr('y1',function(a,c){return b(k(a,c))}).attr('x2',0).attr('y2',function(a,c){return b(l(a,c))}),J=E.append('rect').attr('class','nv-candlestick-rects nv-bars').attr('transform',function(a,d){return'translate('+(c(i(a,d))-x/2)+','+(b(m(a,d))-(h(a,d)>f(a,d)?b(f(a,d))-b(h(a,d)):0))+')'}).attr('x',0).attr('y',0).attr('width',x).attr('height',function(d,e){var a=h(d,e),c=f(d,e);return a>c?b(c)-b(a):b(a)-b(c)}),g.selectAll('.nv-candlestick-lines').transition().attr('transform',function(a,b){return'translate('+c(i(a,b))+',0)'}).attr('x1',0).attr('y1',function(a,c){return b(k(a,c))}).attr('x2',0).attr('y2',function(a,c){return b(l(a,c))}),g.selectAll('.nv-candlestick-rects').transition().attr('transform',function(a,d){return'translate('+(c(i(a,d))-x/2)+','+(b(m(a,d))-(h(a,d)>f(a,d)?b(f(a,d))-b(h(a,d)):0))+')'}).attr('x',0).attr('y',0).attr('width',x).attr('height',function(d,e){var a=h(d,e),c=f(d,e);return a>c?b(c)-b(a):b(a)-b(c)})}),e}return e.highlightPoint=function(a,b){e.clearHighlights(),g.select(".nv-candlestickBar .nv-tick-0-"+a).classed("hover",b)},e.clearHighlights=function(){g.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},e.dispatch=y,e.options=a.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return v},set:function(a){v=a}},height:{get:function(){return p},set:function(a){p=a}},xScale:{get:function(){return c},set:function(a){c=a}},yScale:{get:function(){return b},set:function(a){b=a}},xDomain:{get:function(){return t},set:function(a){t=a}},yDomain:{get:function(){return u},set:function(a){u=a}},xRange:{get:function(){return n},set:function(a){n=a}},yRange:{get:function(){return w},set:function(a){w=a}},forceX:{get:function(){return s},set:function(a){s=a}},forceY:{get:function(){return o},set:function(a){o=a}},padData:{get:function(){return q},set:function(a){q=a}},clipEdge:{get:function(){return r},set:function(a){r=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return z},set:function(a){z=a}},x:{get:function(){return i},set:function(a){i=a}},y:{get:function(){return m},set:function(a){m=a}},open:{get:function(){return h()},set:function(a){h=a}},close:{get:function(){return f()},set:function(a){f=a}},high:{get:function(){return k},set:function(a){k=a}},low:{get:function(){return l},set:function(a){l=a}},margin:{get:function(){return d},set:function(a){d.top=a.top!=void 0?a.top:d.top,d.right=a.right!=void 0?a.right:d.right,d.bottom=a.bottom!=void 0?a.bottom:d.bottom,d.left=a.left!=void 0?a.left:d.left}},color:{get:function(){return x},set:function(b){x=a.utils.getColor(b)}}}),a.utils.initOptions(e),e},a.models.cumulativeLineChart=function(){"use strict";var f=a.models.line(),l=a.models.axis(),i=a.models.axis(),n=a.models.legend(),r=a.models.legend(),m=a.interactiveGuideline(),j=a.models.tooltip(),c={top:30,right:30,bottom:50,left:60},s=a.utils.defaultColor(),B=null,y=null,C=!0,w=!0,z=!0,A=!1,E=!0,v=!1,g=!0,J=f.id(),d=a.utils.state(),o=null,G=null,t=function(a){return a.average},k=d3.dispatch('stateChange','changeState','renderEnd'),L=250,h=250,D=!1,u,F,q,e,p,H,I,x;d.index=0,d.rescaleY=g,l.orient('bottom').tickPadding(7),i.orient(A?'right':'left'),j.valueFormatter(function(a,b){return i.tickFormat()(a,b)}).headerFormatter(function(a,b){return l.tickFormat()(a,b)}),r.updateState(!1),q=d3.scale.linear(),e={i:0,x:0},p=a.utils.renderWatch(k,h),H=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),index:e.i,rescaleY:g}}},I=function(a){return function(b){b.index!==void 0&&(e.i=b.index),b.rescaleY!==void 0&&(g=b.rescaleY),b.active!==void 0&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};function b(j){return p.reset(),p.models(f),w&&p.models(l),z&&p.models(i),j.each(function(j){var p=d3.select(this),aa,D,G,M,$,T,Y,ab,N,L,x,X,U,S,Z,Q,O,P;if(a.utils.initSVG(p),p.classed('nv-chart-'+J,!0),aa=this,D=a.utils.availableWidth(B,p,c),G=a.utils.availableHeight(y,p,c),b.update=function(){h===0?p.call(b):p.transition().duration(h).call(b)},b.container=this,d.setter(I(j),b.update).getter(H(j)).update(),d.disabled=j.map(function(a){return!!a.disabled}),!o){o={};for(M in d)d[M]instanceof Array?o[M]=d[M].slice(0):o[M]=d[M]}$=d3.behavior.drag().on('dragstart',_).on('drag',W).on('dragend',V);function _(a,c){d3.select(b.container).style('cursor','ew-resize')}function W(a,b){e.x=d3.event.x,e.i=Math.round(q.invert(e.x)),R()}function V(a,c){d3.select(b.container).style('cursor','auto'),d.index=e.i,k.stateChange(d)}if(!j||!j.length||!j.filter(function(a){return a.values.length}).length)return a.utils.noData(b,p),b;p.selectAll('.nv-noData').remove(),F=f.xScale(),u=f.yScale(),g?f.yDomain(null):(T=j.filter(function(a){return!a.disabled}).map(function(b,c){var a=d3.extent(b.values,f.y());return a[0]<-.95&&(a[0]=-.95),[(a[0]-a[1])/(1+a[1]),(a[1]-a[0])/(1+a[0])]}),Y=[d3.min(T,function(a){return a[0]}),d3.max(T,function(a){return a[1]})],f.yDomain(Y)),q.domain([0,j[0].values.length-1]).range([0,D]).clamp(!0),j=K(e.i,j),ab=v?"none":"all",N=p.selectAll('g.nv-wrap.nv-cumulativeLine').data([j]),L=N.enter().append('g').attr('class','nvd3 nv-wrap nv-cumulativeLine').append('g'),x=N.select('g'),L.append('g').attr('class','nv-interactive'),L.append('g').attr('class','nv-x nv-axis').style("pointer-events","none"),L.append('g').attr('class','nv-y nv-axis'),L.append('g').attr('class','nv-background'),L.append('g').attr('class','nv-linesWrap').style("pointer-events",ab),L.append('g').attr('class','nv-avgLinesWrap').style("pointer-events","none"),L.append('g').attr('class','nv-legendWrap'),L.append('g').attr('class','nv-controlsWrap'),C&&(n.width(D),x.select('.nv-legendWrap').datum(j).call(n),c.top!=n.height()&&(c.top=n.height(),G=a.utils.availableHeight(y,p,c)),x.select('.nv-legendWrap').attr('transform','translate(0,'+-c.top+')')),E&&(X=[{key:'Re-scale y-axis',disabled:!g}],r.width(140).color(['#444','#444','#444']).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),x.select('.nv-controlsWrap').datum(X).attr('transform','translate(0,'+-c.top+')').call(r)),N.attr('transform','translate('+c.left+','+c.top+')'),A&&x.select(".nv-y.nv-axis").attr("transform","translate("+D+",0)"),U=j.filter(function(a){return a.tempDisabled}),N.select('.tempDisabled').remove(),U.length&&N.append('text').attr('class','tempDisabled').attr('x',D/2).attr('y','-.71em').style('text-anchor','end').text(U.map(function(a){return a.key}).join(', ')+' values cannot be calculated for this time period.'),v&&(m.width(D).height(G).margin({left:c.left,top:c.top}).svgContainer(p).xScale(F),N.select(".nv-interactive").call(m)),L.select('.nv-background').append('rect'),x.select('.nv-background rect').attr('width',D).attr('height',G),f.y(function(a){return a.display.y}).width(D).height(G).color(j.map(function(a,b){return a.color||s(a,b)}).filter(function(b,a){return!j[a].disabled&&!j[a].tempDisabled})),S=x.select('.nv-linesWrap').datum(j.filter(function(a){return!a.disabled&&!a.tempDisabled})),S.call(f),j.forEach(function(a,b){a.seriesIndex=b}),Z=j.filter(function(a){return!a.disabled&&!!t(a)}),Q=x.select(".nv-avgLinesWrap").selectAll("line").data(Z,function(a){return a.key}),O=function(b){var a=u(t(b));return a<0?0:a>G?G:a},Q.enter().append('line').style('stroke-width',2).style('stroke-dasharray','10,10').style('stroke',function(a,b){return f.color()(a,a.seriesIndex)}).attr('x1',0).attr('x2',D).attr('y1',O).attr('y2',O),Q.style('stroke-opacity',function(b){var a=u(t(b));return a<0||a>G?0:1}).attr('x1',0).attr('x2',D).attr('y1',O).attr('y2',O),Q.exit().remove(),P=S.selectAll('.nv-indexLine').data([e]),P.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($),P.attr('transform',function(a){return'translate('+q(a.i)+',0)'}).attr('height',G),w&&(l.scale(F)._ticks(a.utils.calcTicksX(D/70,j)).tickSize(-G,0),x.select('.nv-x.nv-axis').attr('transform','translate(0,'+u.range()[0]+')'),x.select('.nv-x.nv-axis').call(l)),z&&(i.scale(u)._ticks(a.utils.calcTicksY(G/36,j)).tickSize(-D,0),x.select('.nv-y.nv-axis').call(i));function R(){P.data([e]);var a=b.duration();b.duration(0),b.update(),b.duration(a)}x.select('.nv-background rect').on('click',function(){e.x=d3.mouse(this)[0],e.i=Math.round(q.invert(e.x)),d.index=e.i,k.stateChange(d),R()}),f.dispatch.on('elementClick',function(a){e.i=a.pointIndex,e.x=q(e.i),d.index=e.i,k.stateChange(d),R()}),r.dispatch.on('legendClick',function(a,c){a.disabled=!a.disabled,g=!a.disabled,d.rescaleY=g,k.stateChange(d),b.update()}),n.dispatch.on('stateChange',function(a){for(var c in a)d[c]=a[c];k.stateChange(d),b.update()}),m.dispatch.on('elementMousemove',function(k){var h,d,g,e,o,p,q,n,r;f.clearHighlights(),e=[],j.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(c,j){d=a.interactiveBisect(c.values,k.pointXValue,b.x()),f.highlightPoint(j,d,!0);var i=c.values[d];if(typeof i=='undefined')return;typeof h=='undefined'&&(h=i),typeof g=='undefined'&&(g=b.xScale()(b.x()(i,d))),e.push({key:c.key,value:b.y()(i,d),color:s(c,c.seriesIndex)})}),e.length>2&&(o=b.yScale().invert(k.mouseY),p=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),q=.03*p,n=a.nearestValueIndex(e.map(function(a){return a.value}),o,q),n!==null&&(e[n].highlight=!0)),r=l.tickFormat()(b.x()(h,d),d),m.tooltip.position({left:g+c.left,top:k.mouseY+c.top}).chartContainer(aa.parentNode).valueFormatter(function(a,b){return i.tickFormat()(a)}).data({value:r,series:e})(),m.renderGuideLine(g)}),m.dispatch.on("elementMouseout",function(a){f.clearHighlights()}),k.on('changeState',function(a){typeof a.disabled!='undefined'&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),d.disabled=a.disabled),typeof a.index!='undefined'&&(e.i=a.index,e.x=q(e.i),d.index=a.index,P.data([e])),typeof a.rescaleY!='undefined'&&(g=a.rescaleY),b.update()})}),p.renderEnd('cumulativeLineChart immediate'),b}f.dispatch.on('elementMouseover.tooltip',function(a){var c={x:b.x()(a.point),y:b.y()(a.point),color:a.point.color};a.point=c,j.data(a).position(a.pos).hidden(!1)}),f.dispatch.on('elementMouseout.tooltip',function(a){j.hidden(!0)}),x=null;function K(a,b){return x||(x=f.y()),b.map(function(b,e){var d,c;return b.values?(d=b.values[a],d==null)?b:(c=x(d,a),c<-.95&&!D)?(b.tempDisabled=!0,b):(b.tempDisabled=!1,b.values=b.values.map(function(a,b){return a.display={y:(x(a,b)-c)/(1+c)},a}),b):b})}return b.dispatch=k,b.lines=f,b.legend=n,b.controls=r,b.xAxis=l,b.yAxis=i,b.interactiveLayer=m,b.state=d,b.tooltip=j,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return B},set:function(a){B=a}},height:{get:function(){return y},set:function(a){y=a}},rescaleY:{get:function(){return g},set:function(a){g=a}},showControls:{get:function(){return E},set:function(a){E=a}},showLegend:{get:function(){return C},set:function(a){C=a}},average:{get:function(){return t},set:function(a){t=a}},defaultState:{get:function(){return o},set:function(a){o=a}},noData:{get:function(){return G},set:function(a){G=a}},showXAxis:{get:function(){return w},set:function(a){w=a}},showYAxis:{get:function(){return z},set:function(a){z=a}},noErrorCheck:{get:function(){return D},set:function(a){D=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),j.contentGenerator(b)}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}},color:{get:function(){return s},set:function(b){s=a.utils.getColor(b),n.color(s)}},useInteractiveGuideline:{get:function(){return v},set:function(a){v=a,a===!0&&(b.interactive(!1),b.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return A},set:function(a){A=a,i.orient(a?'right':'left')}},duration:{get:function(){return h},set:function(a){h=a,f.duration(h),l.duration(h),i.duration(h),p.reset(h)}}}),a.utils.inheritOptions(b,f),a.utils.initOptions(b),b},a.models.discreteBar=function(){"use strict";var c={top:0,right:0,bottom:0,left:0},q=960,s=500,y=Math.floor(Math.random()*1e4),u,d=d3.scale.ordinal(),b=d3.scale.linear(),j=function(a){return a.x},e=function(a){return a.y},r=[0],m=a.utils.defaultColor(),n=!1,x=d3.format(',.2f'),o,i,p,l,g=d3.dispatch('chartClick','elementClick','elementDblClick','elementMouseover','elementMouseout','elementMousemove','renderEnd'),t='discreteBar',k=250,f=a.utils.renderWatch(g,k),w,v;function h(k){return f.reset(),k.each(function(k){var D=q-c.left-c.right,A=s-c.top-c.bottom,B,z,E,F,G,y,h,C;u=d3.select(this),a.utils.initSVG(u),k.forEach(function(a,b){a.values.forEach(function(a){a.series=b})}),B=o&&i?[]:k.map(function(a){return a.values.map(function(a,b){return{x:j(a,b),y:e(a,b),y0:a.y0}})}),d.domain(o||d3.merge(B).map(function(a){return a.x})).rangeBands(p||[0,D],.1),b.domain(i||d3.extent(d3.merge(B).map(function(a){return a.y}).concat(r))),n?b.range(l||[A-(b.domain()[0]<0?12:0),b.domain()[1]>0?12:0]):b.range(l||[A,0]),v=v||d,w=w||b.copy().range([b(0),b(0)]),z=u.selectAll('g.nv-wrap.nv-discretebar').data([k]),E=z.enter().append('g').attr('class','nvd3 nv-wrap nv-discretebar'),F=E.append('g'),G=z.select('g'),F.append('g').attr('class','nv-groups'),z.attr('transform','translate('+c.left+','+c.top+')'),y=z.select('.nv-groups').selectAll('.nv-group').data(function(a){return a},function(a){return a.key}),y.enter().append('g').style('stroke-opacity',1e-6).style('fill-opacity',1e-6),y.exit().watchTransition(f,'discreteBar: exit groups').style('stroke-opacity',1e-6).style('fill-opacity',1e-6).remove(),y.attr('class',function(b,a){return'nv-group nv-series-'+a}).classed('hover',function(a){return a.hover}),y.watchTransition(f,'discreteBar: groups').style('stroke-opacity',1).style('fill-opacity',.75),h=y.selectAll('g.nv-bar').data(function(a){return a.values}),h.exit().remove(),C=h.enter().append('g').attr('transform',function(a,c,e){return'translate('+(d(j(a,c))+d.rangeBand()*.05)+', '+b(0)+')'}).on('mouseover',function(a,b){d3.select(this).classed('hover',!0),g.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on('mouseout',function(a,b){d3.select(this).classed('hover',!1),g.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on('mousemove',function(a,b){g.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on('click',function(a,b){g.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on('dblclick',function(a,b){g.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),C.append('rect').attr('height',0).attr('width',d.rangeBand()*.9/k.length),n?(C.append('text').attr('text-anchor','middle'),h.select('text').text(function(a,b){return x(e(a,b))}).watchTransition(f,'discreteBar: bars text').attr('x',d.rangeBand()*.9/2).attr('y',function(a,c){return e(a,c)<0?b(e(a,c))-b(0)+12:-4})):h.selectAll('text').remove(),h.attr('class',function(a,b){return e(a,b)<0?'nv-bar negative':'nv-bar positive'}).style('fill',function(a,b){return a.color||m(a,b)}).style('stroke',function(a,b){return a.color||m(a,b)}).select('rect').attr('class',t).watchTransition(f,'discreteBar: bars rect').attr('width',d.rangeBand()*.9/k.length),h.watchTransition(f,'discreteBar: bars').attr('transform',function(a,c){var f=d(j(a,c))+d.rangeBand()*.05,g=e(a,c)<0?b(0):b(0)-b(e(a,c))<1?b(0)-1:b(e(a,c));return'translate('+f+', '+g+')'}).select('rect').attr('height',function(a,c){return Math.max(Math.abs(b(e(a,c))-b(i&&i[0]||0))||1)}),v=d.copy(),w=b.copy()}),f.renderEnd('discreteBar immediate'),h}return h.dispatch=g,h.options=a.utils.optionsFunc.bind(h),h._options=Object.create({},{width:{get:function(){return q},set:function(a){q=a}},height:{get:function(){return s},set:function(a){s=a}},forceY:{get:function(){return r},set:function(a){r=a}},showValues:{get:function(){return n},set:function(a){n=a}},x:{get:function(){return j},set:function(a){j=a}},y:{get:function(){return e},set:function(a){e=a}},xScale:{get:function(){return d},set:function(a){d=a}},yScale:{get:function(){return b},set:function(a){b=a}},xDomain:{get:function(){return o},set:function(a){o=a}},yDomain:{get:function(){return i},set:function(a){i=a}},xRange:{get:function(){return p},set:function(a){p=a}},yRange:{get:function(){return l},set:function(a){l=a}},valueFormat:{get:function(){return x},set:function(a){x=a}},id:{get:function(){return y},set:function(a){y=a}},rectClass:{get:function(){return t},set:function(a){t=a}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}},color:{get:function(){return m},set:function(b){m=a.utils.getColor(b)}},duration:{get:function(){return k},set:function(a){k=a,f.reset(k)}}}),a.utils.initOptions(h),h},a.models.discreteBarChart=function(){"use strict";var c=a.models.discreteBar(),h=a.models.axis(),g=a.models.axis(),e=a.models.tooltip(),d={top:15,right:10,bottom:50,left:60},s=null,r=null,p=a.utils.getColor(),m=!0,o=!0,n=!1,k=!1,t=null,q=d3.dispatch('beforeUpdate','renderEnd'),f=250,j,l,i;h.orient('bottom').showMaxMin(!1).tickFormat(function(a){return a}),g.orient(n?'right':'left').tickFormat(d3.format(',.1f')),e.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).keyFormatter(function(a,b){return h.tickFormat()(a,b)}),i=a.utils.renderWatch(q,f);function b(e){return i.reset(),i.models(c),m&&i.models(h),o&&i.models(g),e.each(function(i){var p=d3.select(this),A=this,t,v,w,u,x,e,y,z;if(a.utils.initSVG(p),t=a.utils.availableWidth(s,p,d),v=a.utils.availableHeight(r,p,d),b.update=function(){q.beforeUpdate(),p.transition().duration(f).call(b)},b.container=this,!i||!i.length||!i.filter(function(a){return a.values.length}).length)return a.utils.noData(b,p),b;p.selectAll('.nv-noData').remove(),l=c.xScale(),j=c.yScale().clamp(!0),w=p.selectAll('g.nv-wrap.nv-discreteBarWithAxes').data([i]),u=w.enter().append('g').attr('class','nvd3 nv-wrap nv-discreteBarWithAxes').append('g'),x=u.append('defs'),e=w.select('g'),u.append('g').attr('class','nv-x nv-axis'),u.append('g').attr('class','nv-y nv-axis').append('g').attr('class','nv-zeroLine').append('line'),u.append('g').attr('class','nv-barsWrap'),e.attr('transform','translate('+d.left+','+d.top+')'),n&&e.select(".nv-y.nv-axis").attr("transform","translate("+t+",0)"),c.width(t).height(v),y=e.select('.nv-barsWrap').datum(i.filter(function(a){return!a.disabled})),y.transition().call(c),x.append('clipPath').attr('id','nv-x-label-clip-'+c.id()).append('rect'),e.select('#nv-x-label-clip-'+c.id()+' rect').attr('width',l.rangeBand()*(k?2:1)).attr('height',16).attr('x',-l.rangeBand()/(k?1:2)),m&&(h.scale(l)._ticks(a.utils.calcTicksX(t/100,i)).tickSize(-v,0),e.select('.nv-x.nv-axis').attr('transform','translate(0,'+(j.range()[0]+(c.showValues()&&j.domain()[0]<0?16:0))+')'),e.select('.nv-x.nv-axis').call(h),z=e.select('.nv-x.nv-axis').selectAll('g'),k&&z.selectAll('text').attr('transform',function(b,c,a){return'translate(0,'+(a%2==0?'5':'17')+')'})),o&&(g.scale(j)._ticks(a.utils.calcTicksY(v/36,i)).tickSize(-t,0),e.select('.nv-y.nv-axis').call(g)),e.select(".nv-zeroLine line").attr("x1",0).attr("x2",t).attr("y1",j(0)).attr("y2",j(0))}),i.renderEnd('discreteBar chart immediate'),b}return c.dispatch.on('elementMouseover.tooltip',function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},e.data(a).hidden(!1)}),c.dispatch.on('elementMouseout.tooltip',function(a){e.hidden(!0)}),c.dispatch.on('elementMousemove.tooltip',function(a){e.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=q,b.discretebar=c,b.xAxis=h,b.yAxis=g,b.tooltip=e,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return s},set:function(a){s=a}},height:{get:function(){return r},set:function(a){r=a}},staggerLabels:{get:function(){return k},set:function(a){k=a}},showXAxis:{get:function(){return m},set:function(a){m=a}},showYAxis:{get:function(){return o},set:function(a){o=a}},noData:{get:function(){return t},set:function(a){t=a}},tooltips:{get:function(){return e.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),e.enabled(!!b)}},tooltipContent:{get:function(){return e.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),e.contentGenerator(b)}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},duration:{get:function(){return f},set:function(a){f=a,i.reset(f),c.duration(f),h.duration(f),g.duration(f)}},color:{get:function(){return p},set:function(b){p=a.utils.getColor(b),c.color(p)}},rightAlignYAxis:{get:function(){return n},set:function(a){n=a,g.orient(a?'right':'left')}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.distribution=function(){"use strict";var d={top:0,right:0,bottom:0,left:0},l=400,j=8,c='x',e=function(a){return a[c]},k=a.utils.defaultColor(),f=d3.scale.linear(),n,i=250,m=d3.dispatch('renderEnd'),g=a.utils.renderWatch(m,i),h;function b(i){return g.reset(),i.each(function(p){var t=l-(c==='x'?d.left+d.right:d.top+d.bottom),n=c=='x'?'y':'x',o=d3.select(this),m,r,s,q,b,i;a.utils.initSVG(o),h=h||f,m=o.selectAll('g.nv-distribution').data([p]),r=m.enter().append('g').attr('class','nvd3 nv-distribution'),s=r.append('g'),q=m.select('g'),m.attr('transform','translate('+d.left+','+d.top+')'),b=q.selectAll('g.nv-dist').data(function(a){return a},function(a){return a.key}),b.enter().append('g'),b.attr('class',function(b,a){return'nv-dist nv-series-'+a}).style('stroke',function(a,b){return k(a,b)}),i=b.selectAll('line.nv-dist'+c).data(function(a){return a.values}),i.enter().append('line').attr(c+'1',function(a,b){return h(e(a,b))}).attr(c+'2',function(a,b){return h(e(a,b))}),g.transition(b.exit().selectAll('line.nv-dist'+c),'dist exit').attr(c+'1',function(a,b){return f(e(a,b))}).attr(c+'2',function(a,b){return f(e(a,b))}).style('stroke-opacity',0).remove(),i.attr('class',function(b,a){return'nv-dist'+c+' nv-dist'+c+'-'+a}).attr(n+'1',0).attr(n+'2',j),g.transition(i,'dist').attr(c+'1',function(a,b){return f(e(a,b))}).attr(c+'2',function(a,b){return f(e(a,b))}),h=f.copy()}),g.renderEnd('distribution immediate'),b}return b.options=a.utils.optionsFunc.bind(b),b.dispatch=m,b.margin=function(a){return arguments.length?(d.top=typeof a.top!='undefined'?a.top:d.top,d.right=typeof a.right!='undefined'?a.right:d.right,d.bottom=typeof a.bottom!='undefined'?a.bottom:d.bottom,d.left=typeof a.left!='undefined'?a.left:d.left,b):d},b.width=function(a){return arguments.length?(l=a,b):l},b.axis=function(a){return arguments.length?(c=a,b):c},b.size=function(a){return arguments.length?(j=a,b):j},b.getData=function(a){return arguments.length?(e=d3.functor(a),b):e},b.scale=function(a){return arguments.length?(f=a,b):f},b.color=function(c){return arguments.length?(k=a.utils.getColor(c),b):k},b.duration=function(a){return arguments.length?(i=a,g.reset(i),b):i},b},a.models.furiousLegend=function(){"use strict";var b={top:5,right:0,bottom:5,left:0},h=400,j=20,n=function(a){return a.key},f=a.utils.getColor(),l=!0,k=28,o=!0,i=!0,m=!1,d=!1,e=d3.dispatch('legendClick','legendDblclick','legendMouseover','legendMouseout','stateChange'),c='classic';function g(q){q.each(function(M){var H=h-b.left-b.right,J=d3.select(this),E,N,B,q,z,A,L,G,w,s,g,x,u,t,I,y,K,D,v,F,C;switch(a.utils.initSVG(J),E=J.selectAll('g.nv-legend').data([M]),N=E.enter().append('g').attr('class','nvd3 nv-legend').append('g'),B=E.select('g'),E.attr('transform','translate('+b.left+','+b.top+')'),q=B.selectAll('.nv-series').data(function(a){return c!='furious'?a:a.filter(function(a){return!!d||!a.disengaged})}),z=q.enter().append('g').attr('class','nv-series'),c=='classic'?(z.append('circle').style('stroke-width',2).attr('class','nv-legend-symbol').attr('r',5),A=q.select('circle')):c=='furious'&&(z.append('rect').style('stroke-width',2).attr('class','nv-legend-symbol').attr('rx',3).attr('ry',3),A=q.select('rect'),z.append('g').attr('class','nv-check-box').property('innerHTML','<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr('transform','translate(-10,-8)scale(0.5)'),L=q.select('.nv-check-box'),L.each(function(a,b){d3.select(this).selectAll('path').attr('stroke',p(a,b))})),z.append('text').attr('text-anchor','start').attr('class','nv-legend-text').attr('dy','.32em').attr('dx','8'),G=q.select('text.nv-legend-text'),q.on('mouseover',function(a,b){e.legendMouseover(a,b)}).on('mouseout',function(a,b){e.legendMouseout(a,b)}).on('click',function(a,g){var b,f;e.legendClick(a,g),b=q.data(),i&&(c=='classic'?m?(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})):c=='furious'&&(d?(a.disengaged=!a.disengaged,a.userDisabled=a.userDisabled==void 0?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled):d||(a.disabled=!a.disabled,a.userDisabled=a.disabled,f=b.filter(function(a){return!a.disengaged}),f.every(function(a){return a.userDisabled})&&b.forEach(function(a){a.disabled=a.userDisabled=!1}))),e.stateChange({disabled:b.map(function(a){return!!a.disabled}),disengaged:b.map(function(a){return!!a.disengaged})}))}).on('dblclick',function(a,f){if(c=='furious'&&d)return;if(e.legendDblclick(a,f),i){var b=q.data();b.forEach(function(a){a.disabled=!0,c=='furious'&&(a.userDisabled=a.disabled)}),a.disabled=!1,c=='furious'&&(a.userDisabled=a.disabled),e.stateChange({disabled:b.map(function(a){return!!a.disabled})})}}),q.classed('nv-disabled',function(a){return a.userDisabled}),q.exit().remove(),G.attr('fill',p).text(n),c){case'furious':w=23;break;case'classic':w=20}if(l){for(s=[],q.each(function(d,e){var c=d3.select(this).select('text'),b;try{if(b=c.node().getComputedTextLength(),b<=0)throw Error()}catch(d){b=a.utils.calcApproxTextWidth(c)}s.push(b+k)}),g=0,x=0,u=[];x<H&&g<s.length;)u[g]=s[g],x+=s[g++];for(g===0&&(g=1);x>H&&g>1;){u=[],g--;for(t=0;t<s.length;t++)s[t]>(u[t%g]||0)&&(u[t%g]=s[t]);x=u.reduce(function(a,b,c,d){return a+b})}I=[];for(y=0,K=0;y<g;y++)I[y]=K,K+=u[y];q.attr('transform',function(b,a){return'translate('+I[a%g]+','+(5+Math.floor(a/g)*w)+')'}),o?B.attr('transform','translate('+(h-b.right-x)+','+b.top+')'):B.attr('transform','translate(0,'+b.top+')'),j=b.top+b.bottom+Math.ceil(s.length/g)*w}else D=5,v=5,F=0,q.attr('transform',function(c,d){var a=d3.select(this).select('text').node().getComputedTextLength()+k;return C=v,h<b.left+b.right+C+a&&(v=C=5,D+=w),v+=a,v>F&&(F=v),'translate('+C+','+D+')'}),B.attr('transform','translate('+(h-b.right-F)+','+b.top+')'),j=b.top+b.bottom+D+15;c=='furious'&&A.attr('width',function(b,a){return G[0][a].getComputedTextLength()+27}).attr('height',18).attr('y',-9).attr('x',-15),A.style('fill',r).style('stroke',function(a,b){return a.color||f(a,b)})});function p(a,b){if(c!='furious')return'#000';if(d)return a.disengaged?f(a,b):'#fff';if(!d)return!!a.disabled?f(a,b):'#fff'}function r(a,b){return d&&c=='furious'?a.disengaged?'#fff':f(a,b):!!a.disabled?'#fff':f(a,b)}return g}return g.dispatch=e,g.options=a.utils.optionsFunc.bind(g),g._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return j},set:function(a){j=a}},key:{get:function(){return n},set:function(a){n=a}},align:{get:function(){return l},set:function(a){l=a}},rightAlign:{get:function(){return o},set:function(a){o=a}},padding:{get:function(){return k},set:function(a){k=a}},updateState:{get:function(){return i},set:function(a){i=a}},radioButtonMode:{get:function(){return m},set:function(a){m=a}},expanded:{get:function(){return d},set:function(a){d=a}},vers:{get:function(){return c},set:function(a){c=a}},margin:{get:function(){return b},set:function(a){b.top=a.top!==void 0?a.top:b.top,b.right=a.right!==void 0?a.right:b.right,b.bottom=a.bottom!==void 0?a.bottom:b.bottom,b.left=a.left!==void 0?a.left:b.left}},color:{get:function(){return f},set:function(b){f=a.utils.getColor(b)}}}),a.utils.initOptions(g),g},a.models.historicalBar=function(){"use strict";var d={top:0,right:0,bottom:0,left:0},r=null,v=null,h=Math.floor(Math.random()*1e4),g=null,c=d3.scale.linear(),b=d3.scale.linear(),k=function(a){return a.x},e=function(a){return a.y},u=[],t=[0],w=!1,o=!0,n=a.utils.defaultColor(),p,q,m,s,i=d3.dispatch('chartClick','elementClick','elementDblClick','elementMouseover','elementMouseout','elementMousemove','renderEnd'),j=!0,l=a.utils.renderWatch(i,0);function f(x){return x.each(function(f){var x,B,y,A,C,D,E,z;l.reset(),g=d3.select(this),x=a.utils.availableWidth(r,g,d),B=a.utils.availableHeight(v,g,d),a.utils.initSVG(g),c.domain(p||d3.extent(f[0].values.map(k).concat(u))),w?c.range(m||[x*.5/f[0].values.length,x*(f[0].values.length-.5)/f[0].values.length]):c.range(m||[0,x]),b.domain(q||d3.extent(f[0].values.map(e).concat(t))).range(s||[B,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-c.domain()[0]*.01,c.domain()[1]+c.domain()[1]*.01]):c.domain([-1,1])),b.domain()[0]===b.domain()[1]&&(b.domain()[0]?b.domain([b.domain()[0]+b.domain()[0]*.01,b.domain()[1]-b.domain()[1]*.01]):b.domain([-1,1])),y=g.selectAll('g.nv-wrap.nv-historicalBar-'+h).data([f[0].values]),A=y.enter().append('g').attr('class','nvd3 nv-wrap nv-historicalBar-'+h),C=A.append('defs'),D=A.append('g'),E=y.select('g'),D.append('g').attr('class','nv-bars'),y.attr('transform','translate('+d.left+','+d.top+')'),g.on('click',function(a,b){i.chartClick({data:a,index:b,pos:d3.event,id:h})}),C.append('clipPath').attr('id','nv-chart-clip-path-'+h).append('rect'),y.select('#nv-chart-clip-path-'+h+' rect').attr('width',x).attr('height',B),E.attr('clip-path',o?'url(#nv-chart-clip-path-'+h+')':''),z=y.select('.nv-bars').selectAll('.nv-bar').data(function(a){return a},function(a,b){return k(a,b)}),z.exit().remove(),z.enter().append('rect').attr('x',0).attr('y',function(c,d){return a.utils.NaNtoZero(b(Math.max(0,e(c,d))))}).attr('height',function(c,d){return a.utils.NaNtoZero(Math.abs(b(e(c,d))-b(0)))}).attr('transform',function(a,b){return'translate('+(c(k(a,b))-x/f[0].values.length*.45)+',0)'}).on('mouseover',function(a,b){if(!j)return;d3.select(this).classed('hover',!0),i.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on('mouseout',function(a,b){if(!j)return;d3.select(this).classed('hover',!1),i.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on('mousemove',function(a,b){if(!j)return;i.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on('click',function(a,b){if(!j)return;i.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on('dblclick',function(a,b){if(!j)return;i.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),z.attr('fill',function(a,b){return n(a,b)}).attr('class',function(b,a,c){return(e(b,a)<0?'nv-bar negative':'nv-bar positive')+' nv-bar-'+c+'-'+a}).watchTransition(l,'bars').attr('transform',function(a,b){return'translate('+(c(k(a,b))-x/f[0].values.length*.45)+',0)'}).attr('width',x/f[0].values.length*.9),z.watchTransition(l,'bars').attr('y',function(c,d){var f=e(c,d)<0?b(0):b(0)-b(e(c,d))<1?b(0)-1:b(e(c,d));return a.utils.NaNtoZero(f)}).attr('height',function(c,d){return a.utils.NaNtoZero(Math.max(Math.abs(b(e(c,d))-b(0)),1))})}),l.renderEnd('historicalBar immediate'),f}return f.highlightPoint=function(a,b){g.select(".nv-bars .nv-bar-0-"+a).classed("hover",b)},f.clearHighlights=function(){g.select(".nv-bars .nv-bar.hover").classed("hover",!1)},f.dispatch=i,f.options=a.utils.optionsFunc.bind(f),f._options=Object.create({},{width:{get:function(){return r},set:function(a){r=a}},height:{get:function(){return v},set:function(a){v=a}},forceX:{get:function(){return u},set:function(a){u=a}},forceY:{get:function(){return t},set:function(a){t=a}},padData:{get:function(){return w},set:function(a){w=a}},x:{get:function(){return k},set:function(a){k=a}},y:{get:function(){return e},set:function(a){e=a}},xScale:{get:function(){return c},set:function(a){c=a}},yScale:{get:function(){return b},set:function(a){b=a}},xDomain:{get:function(){return p},set:function(a){p=a}},yDomain:{get:function(){return q},set:function(a){q=a}},xRange:{get:function(){return m},set:function(a){m=a}},yRange:{get:function(){return s},set:function(a){s=a}},clipEdge:{get:function(){return o},set:function(a){o=a}},id:{get:function(){return h},set:function(a){h=a}},interactive:{get:function(){return j},set:function(a){j=a}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b)}}}),a.utils.initOptions(f),f},a.models.historicalBarChart=function(z){"use strict";var d=z||a.models.historicalBar(),i=a.models.axis(),f=a.models.axis(),h=a.models.legend(),j=a.interactiveGuideline(),g=a.models.tooltip(),c={top:30,right:90,bottom:50,left:90},k=a.utils.defaultColor(),x=null,r=null,w=!1,s=!0,p=!0,q=!1,v=!1,e={},o=null,y=null,l=d3.dispatch('tooltipHide','stateChange','changeState','renderEnd'),m=250,t,u,n;i.orient('bottom').tickPadding(7),f.orient(q?'right':'left'),g.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return f.tickFormat()(a,b)}).headerFormatter(function(a,b){return i.tickFormat()(a,b)}),n=a.utils.renderWatch(l,0);function b(g){return g.each(function(y){var z,G,B,E,C,D,F,A,H;if(n.reset(),n.models(d),s&&n.models(i),p&&n.models(f),z=d3.select(this),G=this,a.utils.initSVG(z),B=a.utils.availableWidth(x,z,c),E=a.utils.availableHeight(r,z,c),b.update=function(){z.transition().duration(m).call(b)},b.container=this,e.disabled=y.map(function(a){return!!a.disabled}),!o){o={};for(C in e)e[C]instanceof Array?o[C]=e[C].slice(0):o[C]=e[C]}if(!y||!y.length||!y.filter(function(a){return a.values.length}).length)return a.utils.noData(b,z),b;z.selectAll('.nv-noData').remove(),u=d.xScale(),t=d.yScale(),D=z.selectAll('g.nv-wrap.nv-historicalBarChart').data([y]),F=D.enter().append('g').attr('class','nvd3 nv-wrap nv-historicalBarChart').append('g'),A=D.select('g'),F.append('g').attr('class','nv-x nv-axis'),F.append('g').attr('class','nv-y nv-axis'),F.append('g').attr('class','nv-barsWrap'),F.append('g').attr('class','nv-legendWrap'),F.append('g').attr('class','nv-interactive'),w&&(h.width(B),A.select('.nv-legendWrap').datum(y).call(h),c.top!=h.height()&&(c.top=h.height(),E=a.utils.availableHeight(r,z,c)),D.select('.nv-legendWrap').attr('transform','translate(0,'+-c.top+')')),D.attr('transform','translate('+c.left+','+c.top+')'),q&&A.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)"),v&&(j.width(B).height(E).margin({left:c.left,top:c.top}).svgContainer(z).xScale(u),D.select(".nv-interactive").call(j)),d.width(B).height(E).color(y.map(function(a,b){return a.color||k(a,b)}).filter(function(b,a){return!y[a].disabled})),H=A.select('.nv-barsWrap').datum(y.filter(function(a){return!a.disabled})),H.transition().call(d),s&&(i.scale(u)._ticks(a.utils.calcTicksX(B/100,y)).tickSize(-E,0),A.select('.nv-x.nv-axis').attr('transform','translate(0,'+t.range()[0]+')'),A.select('.nv-x.nv-axis').transition().call(i)),p&&(f.scale(t)._ticks(a.utils.calcTicksY(E/36,y)).tickSize(-B,0),A.select('.nv-y.nv-axis').transition().call(f)),j.dispatch.on('elementMousemove',function(m){var h,e,g,l,n;d.clearHighlights(),l=[],y.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(c,i){e=a.interactiveBisect(c.values,m.pointXValue,b.x()),d.highlightPoint(e,!0);var f=c.values[e];if(f===void 0)return;h===void 0&&(h=f),g===void 0&&(g=b.xScale()(b.x()(f,e))),l.push({key:c.key,value:b.y()(f,e),color:k(c,c.seriesIndex),data:c.values[e]})}),n=i.tickFormat()(b.x()(h,e)),j.tooltip.position({left:g+c.left,top:m.mouseY+c.top}).chartContainer(G.parentNode).valueFormatter(function(a,b){return f.tickFormat()(a)}).data({value:n,index:e,series:l})(),j.renderGuideLine(g)}),j.dispatch.on("elementMouseout",function(a){l.tooltipHide(),d.clearHighlights()}),h.dispatch.on('legendClick',function(a,c){a.disabled=!a.disabled,y.filter(function(a){return!a.disabled}).length||y.map(function(a){return a.disabled=!1,D.selectAll('.nv-series').classed('disabled',!1),a}),e.disabled=y.map(function(a){return!!a.disabled}),l.stateChange(e),g.transition().call(b)}),h.dispatch.on('legendDblclick',function(a){y.forEach(function(a){a.disabled=!0}),a.disabled=!1,e.disabled=y.map(function(a){return!!a.disabled}),l.stateChange(e),b.update()}),l.on('changeState',function(a){typeof a.disabled!='undefined'&&(y.forEach(function(b,c){b.disabled=a.disabled[c]}),e.disabled=a.disabled),b.update()})}),n.renderEnd('historicalBarChart immediate'),b}return d.dispatch.on('elementMouseover.tooltip',function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},g.data(a).hidden(!1)}),d.dispatch.on('elementMouseout.tooltip',function(a){g.hidden(!0)}),d.dispatch.on('elementMousemove.tooltip',function(a){g.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=l,b.bars=d,b.legend=h,b.xAxis=i,b.yAxis=f,b.interactiveLayer=j,b.tooltip=g,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return x},set:function(a){x=a}},height:{get:function(){return r},set:function(a){r=a}},showLegend:{get:function(){return w},set:function(a){w=a}},showXAxis:{get:function(){return s},set:function(a){s=a}},showYAxis:{get:function(){return p},set:function(a){p=a}},defaultState:{get:function(){return o},set:function(a){o=a}},noData:{get:function(){return y},set:function(a){y=a}},tooltips:{get:function(){return g.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),g.enabled(!!b)}},tooltipContent:{get:function(){return g.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),g.contentGenerator(b)}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),h.color(k),d.color(k)}},duration:{get:function(){return m},set:function(a){m=a,n.reset(m),f.duration(m),i.duration(m)}},rightAlignYAxis:{get:function(){return q},set:function(a){q=a,f.orient(a?'right':'left')}},useInteractiveGuideline:{get:function(){return v},set:function(a){v=a,a===!0&&b.interactive(!1)}}}),a.utils.inheritOptions(b,d),a.utils.initOptions(b),b},a.models.ohlcBarChart=function(){var b=a.models.historicalBarChart(a.models.ohlcBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(c){var a=c.series[0].data,d=a.open<a.close?"2ca02c":"d62728";return'<h3 style="color: #'+d+'">'+c.value+'</h3>'+'<table>'+'<tr><td>open:</td><td>'+b.yAxis.tickFormat()(a.open)+'</td></tr>'+'<tr><td>close:</td><td>'+b.yAxis.tickFormat()(a.close)+'</td></tr>'+'<tr><td>high</td><td>'+b.yAxis.tickFormat()(a.high)+'</td></tr>'+'<tr><td>low:</td><td>'+b.yAxis.tickFormat()(a.low)+'</td></tr>'+'</table>'}),b},a.models.candlestickBarChart=function(){var b=a.models.historicalBarChart(a.models.candlestickBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(c){var a=c.series[0].data,d=a.open<a.close?"2ca02c":"d62728";return'<h3 style="color: #'+d+'">'+c.value+'</h3>'+'<table>'+'<tr><td>open:</td><td>'+b.yAxis.tickFormat()(a.open)+'</td></tr>'+'<tr><td>close:</td><td>'+b.yAxis.tickFormat()(a.close)+'</td></tr>'+'<tr><td>high</td><td>'+b.yAxis.tickFormat()(a.high)+'</td></tr>'+'<tr><td>low:</td><td>'+b.yAxis.tickFormat()(a.low)+'</td></tr>'+'</table>'}),b},a.models.legend=function(){"use strict";var b={top:5,right:0,bottom:5,left:0},g=400,h=20,m=function(a){return a.key},i=a.utils.getColor(),n=!0,k=32,o=!0,j=!0,l=!1,d=!1,e=d3.dispatch('legendClick','legendDblclick','legendMouseover','legendMouseout','stateChange'),c='classic';function f(r){r.each(function(L){var I=g-b.left-b.right,H=d3.select(this),E,N,y,i,C,B,u,M,G,r,t,f,x,w,J,D,K,F,A,z,v,O;switch(a.utils.initSVG(H),E=H.selectAll('g.nv-legend').data([L]),N=E.enter().append('g').attr('class','nvd3 nv-legend').append('g'),y=E.select('g'),E.attr('transform','translate('+b.left+','+b.top+')'),i=y.selectAll('.nv-series').data(function(a){return c!='furious'?a:a.filter(function(a){return!!d||!a.disengaged})}),C=i.enter().append('g').attr('class','nv-series'),c){case'furious':u=23;break;case'classic':u=20}if(c=='classic'?(C.append('circle').style('stroke-width',2).attr('class','nv-legend-symbol').attr('r',5),B=i.select('circle')):c=='furious'&&(C.append('rect').style('stroke-width',2).attr('class','nv-legend-symbol').attr('rx',3).attr('ry',3),B=i.select('.nv-legend-symbol'),C.append('g').attr('class','nv-check-box').property('innerHTML','<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr('transform','translate(-10,-8)scale(0.5)'),M=i.select('.nv-check-box'),M.each(function(a,b){d3.select(this).selectAll('path').attr('stroke',p(a,b))})),C.append('text').attr('text-anchor','start').attr('class','nv-legend-text').attr('dy','.32em').attr('dx','8'),G=i.select('text.nv-legend-text'),i.on('mouseover',function(a,b){e.legendMouseover(a,b)}).on('mouseout',function(a,b){e.legendMouseout(a,b)}).on('click',function(a,g){var b,f;e.legendClick(a,g),b=i.data(),j&&(c=='classic'?l?(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})):c=='furious'&&(d?(a.disengaged=!a.disengaged,a.userDisabled=a.userDisabled==void 0?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled):d||(a.disabled=!a.disabled,a.userDisabled=a.disabled,f=b.filter(function(a){return!a.disengaged}),f.every(function(a){return a.userDisabled})&&b.forEach(function(a){a.disabled=a.userDisabled=!1}))),e.stateChange({disabled:b.map(function(a){return!!a.disabled}),disengaged:b.map(function(a){return!!a.disengaged})}))}).on('dblclick',function(a,f){if(c=='furious'&&d)return;if(e.legendDblclick(a,f),j){var b=i.data();b.forEach(function(a){a.disabled=!0,c=='furious'&&(a.userDisabled=a.disabled)}),a.disabled=!1,c=='furious'&&(a.userDisabled=a.disabled),e.stateChange({disabled:b.map(function(a){return!!a.disabled})})}}),i.classed('nv-disabled',function(a){return a.userDisabled}),i.exit().remove(),G.attr('fill',p).text(m),r=0,n){for(t=[],i.each(function(d,e){var c=d3.select(this).select('text'),b;try{if(b=c.node().getComputedTextLength(),b<=0)throw Error()}catch(d){b=a.utils.calcApproxTextWidth(c)}t.push(b+k)}),f=0,x=[],r=0;r<I&&f<t.length;)x[f]=t[f],r+=t[f++];for(f===0&&(f=1);r>I&&f>1;){x=[],f--;for(w=0;w<t.length;w++)t[w]>(x[w%f]||0)&&(x[w%f]=t[w]);r=x.reduce(function(a,b,c,d){return a+b})}J=[];for(D=0,K=0;D<f;D++)J[D]=K,K+=x[D];i.attr('transform',function(b,a){return'translate('+J[a%f]+','+(5+Math.floor(a/f)*u)+')'}),o?y.attr('transform','translate('+(g-b.right-r)+','+b.top+')'):y.attr('transform','translate(0,'+b.top+')'),h=b.top+b.bottom+Math.ceil(t.length/f)*u}else F=5,A=5,z=0,i.attr('transform',function(c,d){var a=d3.select(this).select('text').node().getComputedTextLength()+k;return v=A,g<b.left+b.right+v+a&&(A=v=5,F+=u),A+=a,A>z&&(z=A),r<v+z&&(r=v+z),'translate('+v+','+F+')'}),y.attr('transform','translate('+(g-b.right-z)+','+b.top+')'),h=b.top+b.bottom+F+15;c=='furious'&&(B.attr('width',function(b,a){return G[0][a].getComputedTextLength()+27}).attr('height',18).attr('y',-9).attr('x',-15),N.insert('rect',':first-child').attr('class','nv-legend-bg').attr('fill','#eee').attr('opacity',0),O=y.select('.nv-legend-bg'),O.transition().duration(300).attr('x',-u).attr('width',r+u-12).attr('height',h+10).attr('y',-b.top-10).attr('opacity',d?1:0)),B.style('fill',q).style('fill-opacity',s).style('stroke',q)});function p(a,b){if(c!='furious')return'#000';if(d)return a.disengaged?'#000':'#fff';if(!d)return a.color||(a.color=i(a,b)),!!a.disabled?a.color:'#fff'}function q(a,b){return d&&c=='furious'?a.disengaged?'#eee':a.color||i(a,b):a.color||i(a,b)}function s(a,b){return d&&c=='furious'?1:!!a.disabled?0:1}return f}return f.dispatch=e,f.options=a.utils.optionsFunc.bind(f),f._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},key:{get:function(){return m},set:function(a){m=a}},align:{get:function(){return n},set:function(a){n=a}},rightAlign:{get:function(){return o},set:function(a){o=a}},padding:{get:function(){return k},set:function(a){k=a}},updateState:{get:function(){return j},set:function(a){j=a}},radioButtonMode:{get:function(){return l},set:function(a){l=a}},expanded:{get:function(){return d},set:function(a){d=a}},vers:{get:function(){return c},set:function(a){c=a}},margin:{get:function(){return b},set:function(a){b.top=a.top!==void 0?a.top:b.top,b.right=a.right!==void 0?a.right:b.right,b.bottom=a.bottom!==void 0?a.bottom:b.bottom,b.left=a.left!==void 0?a.left:b.left}},color:{get:function(){return i},set:function(b){i=a.utils.getColor(b)}}}),a.utils.initOptions(f),f},a.models.line=function(){"use strict";var b=a.models.scatter(),d={top:0,right:0,bottom:0,left:0},s=960,t=500,q=null,v=1.5,l=a.utils.defaultColor(),i=function(a){return a.x},f=function(a){return a.y},j=function(a,b){return!isNaN(f(a,b))&&f(a,b)!==null},u=function(a){return a.area},r=!1,k="linear",m=250,p=d3.dispatch('elementClick','elementMouseover','elementMouseout','renderEnd'),c,o,n,h,g;b.pointSize(16).pointDomain([16,256]),g=a.utils.renderWatch(p,m);function e(m){return g.reset(),g.models(b),m.each(function(E){var x,p,m,y,D,w,C,A,e,B,z;q=d3.select(this),x=a.utils.availableWidth(s,q,d),p=a.utils.availableHeight(t,q,d),a.utils.initSVG(q),o=b.xScale(),c=b.yScale(),n=n||o,h=h||c,m=q.selectAll('g.nv-wrap.nv-line').data([E]),y=m.enter().append('g').attr('class','nvd3 nv-wrap nv-line'),D=y.append('defs'),w=y.append('g'),C=m.select('g'),w.append('g').attr('class','nv-groups'),w.append('g').attr('class','nv-scatterWrap'),m.attr('transform','translate('+d.left+','+d.top+')'),b.width(x).height(p),A=m.select('.nv-scatterWrap'),A.call(b),D.append('clipPath').attr('id','nv-edge-clip-'+b.id()).append('rect'),m.select('#nv-edge-clip-'+b.id()+' rect').attr('width',x).attr('height',p>0?p:0),C.attr('clip-path',r?'url(#nv-edge-clip-'+b.id()+')':''),A.attr('clip-path',r?'url(#nv-edge-clip-'+b.id()+')':''),e=m.select('.nv-groups').selectAll('.nv-group').data(function(a){return a},function(a){return a.key}),e.enter().append('g').style('stroke-opacity',1e-6).style('stroke-width',function(a){return a.strokeWidth||v}).style('fill-opacity',1e-6),e.exit().remove(),e.attr('class',function(a,b){return(a.classed||'')+' nv-group nv-series-'+b}).classed('hover',function(a){return a.hover}).style('fill',function(a,b){return l(a,b)}).style('stroke',function(a,b){return l(a,b)}),e.watchTransition(g,'line: groups').style('stroke-opacity',1).style('fill-opacity',function(a){return a.fillOpacity||.5}),B=e.selectAll('path.nv-area').data(function(a){return u(a)?[a]:[]}),B.enter().append('path').attr('class','nv-area').attr('d',function(b){return d3.svg.area().interpolate(k).defined(j).x(function(b,c){return a.utils.NaNtoZero(n(i(b,c)))}).y0(function(b,c){return a.utils.NaNtoZero(h(f(b,c)))}).y1(function(a,b){return h(c.domain()[0]<=0?c.domain()[1]>=0?0:c.domain()[1]:c.domain()[0])}).apply(this,[b.values])}),e.exit().selectAll('path.nv-area').remove(),B.watchTransition(g,'line: areaPaths').attr('d',function(b){return d3.svg.area().interpolate(k).defined(j).x(function(b,c){return a.utils.NaNtoZero(o(i(b,c)))}).y0(function(b,d){return a.utils.NaNtoZero(c(f(b,d)))}).y1(function(a,b){return c(c.domain()[0]<=0?c.domain()[1]>=0?0:c.domain()[1]:c.domain()[0])}).apply(this,[b.values])}),z=e.selectAll('path.nv-line').data(function(a){return[a.values]}),z.enter().append('path').attr('class','nv-line').attr('d',d3.svg.line().interpolate(k).defined(j).x(function(b,c){return a.utils.NaNtoZero(n(i(b,c)))}).y(function(b,c){return a.utils.NaNtoZero(h(f(b,c)))})),z.watchTransition(g,'line: linePaths').attr('d',d3.svg.line().interpolate(k).defined(j).x(function(b,c){return a.utils.NaNtoZero(o(i(b,c)))}).y(function(b,d){return a.utils.NaNtoZero(c(f(b,d)))})),n=o.copy(),h=c.copy()}),g.renderEnd('line immediate'),e}return e.dispatch=p,e.scatter=b,b.dispatch.on('elementClick',function(){p.elementClick.apply(this,arguments)}),b.dispatch.on('elementMouseover',function(){p.elementMouseover.apply(this,arguments)}),b.dispatch.on('elementMouseout',function(){p.elementMouseout.apply(this,arguments)}),e.options=a.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return s},set:function(a){s=a}},height:{get:function(){return t},set:function(a){t=a}},defined:{get:function(){return j},set:function(a){j=a}},interpolate:{get:function(){return k},set:function(a){k=a}},clipEdge:{get:function(){return r},set:function(a){r=a}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},duration:{get:function(){return m},set:function(a){m=a,g.reset(m),b.duration(m)}},isArea:{get:function(){return u},set:function(a){u=d3.functor(a)}},x:{get:function(){return i},set:function(a){i=a,b.x(a)}},y:{get:function(){return f},set:function(a){f=a,b.y(a)}},color:{get:function(){return l},set:function(c){l=a.utils.getColor(c),b.color(l)}}}),a.utils.inheritOptions(e,b),a.utils.initOptions(e),e},a.models.lineChart=function(){"use strict";var d=a.models.line(),j=a.models.axis(),f=a.models.axis(),k=a.models.legend(),h=a.interactiveGuideline(),i=a.models.tooltip(),c={top:30,right:20,bottom:50,left:60},n=a.utils.defaultColor(),x=null,q=null,v=!0,s=!0,r=!0,p=!1,t=!1,g=a.utils.state(),m=null,y=null,o=d3.dispatch('tooltipShow','tooltipHide','stateChange','changeState','renderEnd'),e=250,u,w,l,z,A;j.orient('bottom').tickPadding(7),f.orient(p?'right':'left'),i.valueFormatter(function(a,b){return f.tickFormat()(a,b)}).headerFormatter(function(a,b){return j.tickFormat()(a,b)}),l=a.utils.renderWatch(o,e),z=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},A=function(a){return function(b){b.active!==void 0&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};function b(i){return l.reset(),l.models(d),s&&l.models(j),r&&l.models(f),i.each(function(i){var l=d3.select(this),G=this,B,C,D,F,E,y,H;if(a.utils.initSVG(l),B=a.utils.availableWidth(x,l,c),C=a.utils.availableHeight(q,l,c),b.update=function(){e===0?l.call(b):l.transition().duration(e).call(b)},b.container=this,g.setter(A(i),b.update).getter(z(i)).update(),g.disabled=i.map(function(a){return!!a.disabled}),!m){m={};for(D in g)g[D]instanceof Array?m[D]=g[D].slice(0):m[D]=g[D]}if(!i||!i.length||!i.filter(function(a){return a.values.length}).length)return a.utils.noData(b,l),b;l.selectAll('.nv-noData').remove(),w=d.xScale(),u=d.yScale(),F=l.selectAll('g.nv-wrap.nv-lineChart').data([i]),E=F.enter().append('g').attr('class','nvd3 nv-wrap nv-lineChart').append('g'),y=F.select('g'),E.append("rect").style("opacity",0),E.append('g').attr('class','nv-x nv-axis'),E.append('g').attr('class','nv-y nv-axis'),E.append('g').attr('class','nv-linesWrap'),E.append('g').attr('class','nv-legendWrap'),E.append('g').attr('class','nv-interactive'),y.select("rect").attr("width",B).attr("height",C>0?C:0),v&&(k.width(B),y.select('.nv-legendWrap').datum(i).call(k),c.top!=k.height()&&(c.top=k.height(),C=a.utils.availableHeight(q,l,c)),F.select('.nv-legendWrap').attr('transform','translate(0,'+-c.top+')')),F.attr('transform','translate('+c.left+','+c.top+')'),p&&y.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)"),t&&(h.width(B).height(C).margin({left:c.left,top:c.top}).svgContainer(l).xScale(w),F.select(".nv-interactive").call(h)),d.width(B).height(C).color(i.map(function(a,b){return a.color||n(a,b)}).filter(function(b,a){return!i[a].disabled})),H=y.select('.nv-linesWrap').datum(i.filter(function(a){return!a.disabled})),H.call(d),s&&(j.scale(w)._ticks(a.utils.calcTicksX(B/100,i)).tickSize(-C,0),y.select('.nv-x.nv-axis').attr('transform','translate(0,'+u.range()[0]+')'),y.select('.nv-x.nv-axis').call(j)),r&&(f.scale(u)._ticks(a.utils.calcTicksY(C/36,i)).tickSize(-B,0),y.select('.nv-y.nv-axis').call(f)),k.dispatch.on('stateChange',function(a){for(var c in a)g[c]=a[c];o.stateChange(g),b.update()}),h.dispatch.on('elementMousemove',function(k){var l,e,m,g,p,q,r,o,s;d.clearHighlights(),g=[],i.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(c,i){var f,h;if(e=a.interactiveBisect(c.values,k.pointXValue,b.x()),f=c.values[e],h=b.y()(f,e),h!=null&&d.highlightPoint(i,e,!0),f===void 0)return;l===void 0&&(l=f),m===void 0&&(m=b.xScale()(b.x()(f,e))),g.push({key:c.key,value:h,color:n(c,c.seriesIndex)})}),g.length>2&&(p=b.yScale().invert(k.mouseY),q=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),r=.03*q,o=a.nearestValueIndex(g.map(function(a){return a.value}),p,r),o!==null&&(g[o].highlight=!0)),s=j.tickFormat()(b.x()(l,e)),h.tooltip.position({left:k.mouseX+c.left,top:k.mouseY+c.top}).chartContainer(G.parentNode).valueFormatter(function(a,b){return a==null?"N/A":f.tickFormat()(a)}).data({value:s,index:e,series:g})(),h.renderGuideLine(m)}),h.dispatch.on('elementClick',function(f){var c,e=[];i.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(d){var g=a.interactiveBisect(d.values,f.pointXValue,b.x()),h=d.values[g],i;if(typeof h=='undefined')return;typeof c=='undefined'&&(c=b.xScale()(b.x()(h,g))),i=b.yScale()(b.y()(h,g)),e.push({point:h,pointIndex:g,pos:[c,i],seriesIndex:d.seriesIndex,series:d})}),d.dispatch.elementClick(e)}),h.dispatch.on("elementMouseout",function(a){d.clearHighlights()}),o.on('changeState',function(a){typeof a.disabled!='undefined'&&i.length===a.disabled.length&&(i.forEach(function(b,c){b.disabled=a.disabled[c]}),g.disabled=a.disabled),b.update()})}),l.renderEnd('lineChart immediate'),b}return d.dispatch.on('elementMouseover.tooltip',function(a){i.data(a).position(a.pos).hidden(!1)}),d.dispatch.on('elementMouseout.tooltip',function(a){i.hidden(!0)}),b.dispatch=o,b.lines=d,b.legend=k,b.xAxis=j,b.yAxis=f,b.interactiveLayer=h,b.tooltip=i,b.dispatch=o,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return x},set:function(a){x=a}},height:{get:function(){return q},set:function(a){q=a}},showLegend:{get:function(){return v},set:function(a){v=a}},showXAxis:{get:function(){return s},set:function(a){s=a}},showYAxis:{get:function(){return r},set:function(a){r=a}},defaultState:{get:function(){return m},set:function(a){m=a}},noData:{get:function(){return y},set:function(a){y=a}},tooltips:{get:function(){return i.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),i.enabled(!!b)}},tooltipContent:{get:function(){return i.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),i.contentGenerator(b)}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}},duration:{get:function(){return e},set:function(a){e=a,l.reset(e),d.duration(e),j.duration(e),f.duration(e)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),k.color(n),d.color(n)}},rightAlignYAxis:{get:function(){return p},set:function(a){p=a,f.orient(p?'right':'left')}},useInteractiveGuideline:{get:function(){return t},set:function(a){t=a,t&&(d.interactive(!1),d.useVoronoi(!1))}}}),a.utils.inheritOptions(b,d),a.utils.initOptions(b),b},a.models.linePlusBarChart=function(){"use strict";var e=a.models.line(),o=a.models.line(),d=a.models.historicalBar(),q=a.models.historicalBar(),p=a.models.axis(),u=a.models.axis(),v=a.models.axis(),s=a.models.axis(),x=a.models.axis(),w=a.models.axis(),i=a.models.legend(),f=d3.svg.brush(),h=a.models.tooltip(),c={top:30,right:30,bottom:30,left:60},I={top:0,right:30,bottom:20,left:60},E=null,C=null,z=function(a){return a.x},A=function(a){return a.y},n=a.utils.defaultColor(),L=!0,B=!0,J=!1,M=!0,t=50,m=null,N=null,y=d3.dispatch('brush','stateChange','changeState'),k=0,j=a.utils.state(),D=null,H=' (left axis)',F=' (right axis)',l,r,g,K,P,G,O,Q,R;e.clipEdge(!0),o.interactive(!1),p.orient('bottom').tickPadding(5),v.orient('left'),s.orient('right'),u.orient('bottom').tickPadding(5),x.orient('left'),w.orient('right'),h.headerEnabled(!0).headerFormatter(function(a,b){return p.tickFormat()(a,b)}),Q=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},R=function(a){return function(b){b.active!==void 0&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};function b(h){return h.each(function(h){var V=d3.select(this),an=this,S,W,T,Z,U,X,ak,aj,$,aa,N,_,Y,ae,ai,ag,ah,ab,ac,ad;if(a.utils.initSVG(V),S=a.utils.availableWidth(E,V,c),W=a.utils.availableHeight(C,V,c)-(B?t:0),T=t-I.top-I.bottom,b.update=function(){V.transition().duration(k).call(b)},b.container=this,j.setter(R(h),b.update).getter(Q(h)).update(),j.disabled=h.map(function(a){return!!a.disabled}),!D){D={};for(Z in j)j[Z]instanceof Array?D[Z]=j[Z].slice(0):D[Z]=j[Z]}if(!h||!h.length||!h.filter(function(a){return a.values.length}).length)return a.utils.noData(b,V),b;V.selectAll('.nv-noData').remove(),U=h.filter(function(a){return!a.disabled&&a.bar}),X=h.filter(function(a){return!a.bar}),r=d.xScale(),g=u.scale(),K=d.yScale(),P=e.yScale(),G=q.yScale(),O=o.yScale(),ak=h.filter(function(a){return!a.disabled&&a.bar}).map(function(a){return a.values.map(function(a,b){return{x:z(a,b),y:A(a,b)}})}),aj=h.filter(function(a){return!a.disabled&&!a.bar}).map(function(a){return a.values.map(function(a,b){return{x:z(a,b),y:A(a,b)}})}),r.range([0,S]),g.domain(d3.extent(d3.merge(ak.concat(aj)),function(a){return a.x})).range([0,S]),$=V.selectAll('g.nv-wrap.nv-linePlusBar').data([h]),aa=$.enter().append('g').attr('class','nvd3 nv-wrap nv-linePlusBar').append('g'),N=$.select('g'),aa.append('g').attr('class','nv-legendWrap'),_=aa.append('g').attr('class','nv-focus'),_.append('g').attr('class','nv-x nv-axis'),_.append('g').attr('class','nv-y1 nv-axis'),_.append('g').attr('class','nv-y2 nv-axis'),_.append('g').attr('class','nv-barsWrap'),_.append('g').attr('class','nv-linesWrap'),Y=aa.append('g').attr('class','nv-context'),Y.append('g').attr('class','nv-x nv-axis'),Y.append('g').attr('class','nv-y1 nv-axis'),Y.append('g').attr('class','nv-y2 nv-axis'),Y.append('g').attr('class','nv-barsWrap'),Y.append('g').attr('class','nv-linesWrap'),Y.append('g').attr('class','nv-brushBackground'),Y.append('g').attr('class','nv-x nv-brush'),L&&(ae=i.align()?S/2:S,ai=i.align()?ae:0,i.width(ae),N.select('.nv-legendWrap').datum(h.map(function(a){return a.originalKey=a.originalKey===void 0?a.key:a.originalKey,a.key=a.originalKey+(a.bar?H:F),a})).call(i),c.top!=i.height()&&(c.top=i.height(),W=a.utils.availableHeight(C,V,c)-t),N.select('.nv-legendWrap').attr('transform','translate('+ai+','+-c.top+')')),$.attr('transform','translate('+c.left+','+c.top+')'),N.select('.nv-context').style('display',B?'initial':'none'),q.width(S).height(T).color(h.map(function(a,b){return a.color||n(a,b)}).filter(function(b,a){return!h[a].disabled&&h[a].bar})),o.width(S).height(T).color(h.map(function(a,b){return a.color||n(a,b)}).filter(function(b,a){return!h[a].disabled&&!h[a].bar})),ag=N.select('.nv-context .nv-barsWrap').datum(U.length?U:[{values:[]}]),ah=N.select('.nv-context .nv-linesWrap').datum(X[0].disabled?[{values:[]}]:X),N.select('.nv-context').attr('transform','translate(0,'+(W+c.bottom+I.top)+')'),ag.transition().call(q),ah.transition().call(o),M&&(u._ticks(a.utils.calcTicksX(S/100,h)).tickSize(-T,0),N.select('.nv-context .nv-x.nv-axis').attr('transform','translate(0,'+G.range()[0]+')'),N.select('.nv-context .nv-x.nv-axis').transition().call(u)),J&&(x.scale(G)._ticks(T/36).tickSize(-S,0),w.scale(O)._ticks(T/36).tickSize(U.length?0:-S,0),N.select('.nv-context .nv-y3.nv-axis').style('opacity',U.length?1:0).attr('transform','translate(0,'+g.range()[0]+')'),N.select('.nv-context .nv-y2.nv-axis').style('opacity',X.length?1:0).attr('transform','translate('+g.range()[1]+',0)'),N.select('.nv-context .nv-y1.nv-axis').transition().call(x),N.select('.nv-context .nv-y2.nv-axis').transition().call(w)),f.x(g).on('brush',af),m&&f.extent(m),ab=N.select('.nv-brushBackground').selectAll('g').data([m||f.extent()]),ac=ab.enter().append('g'),ac.append('rect').attr('class','left').attr('x',0).attr('y',0).attr('height',T),ac.append('rect').attr('class','right').attr('x',0).attr('y',0).attr('height',T),ad=N.select('.nv-x.nv-brush').call(f),ad.selectAll('rect').attr('height',T),ad.selectAll('.resize').append('path').attr('d',al),i.dispatch.on('stateChange',function(a){for(var c in a)j[c]=a[c];y.stateChange(j),b.update()}),y.on('changeState',function(a){typeof a.disabled!='undefined'&&(h.forEach(function(b,c){b.disabled=a.disabled[c]}),j.disabled=a.disabled),b.update()});function al(d){var c=+(d=='e'),b=c?1:-1,a=T/3;return'M'+.5*b+','+a+'A6,6 0 0 '+c+' '+6.5*b+','+(a+6)+'V'+(2*a-6)+'A6,6 0 0 '+c+' '+.5*b+','+2*a+'Z'+'M'+2.5*b+','+(a+8)+'V'+(2*a-8)+'M'+4.5*b+','+(a+8)+'V'+(2*a-8)}function am(){f.empty()||f.extent(m),ab.data([f.empty()?g.domain():m]).each(function(a,d){var b=g(a[0])-g.range()[0],c=g.range()[1]-g(a[1]);d3.select(this).select('.left').attr('width',b<0?0:b),d3.select(this).select('.right').attr('x',g(a[1])).attr('width',c<0?0:c)})}function af(){var b,c;m=f.empty()?null:f.extent(),l=f.empty()?g.domain():f.extent(),y.brush({extent:l,brush:f}),am(),d.width(S).height(W).color(h.map(function(a,b){return a.color||n(a,b)}).filter(function(b,a){return!h[a].disabled&&h[a].bar})),e.width(S).height(W).color(h.map(function(a,b){return a.color||n(a,b)}).filter(function(b,a){return!h[a].disabled&&!h[a].bar})),b=N.select('.nv-focus .nv-barsWrap').datum(U.length?U.map(function(a,b){return{key:a.key,values:a.values.filter(function(a,b){return d.x()(a,b)>=l[0]&&d.x()(a,b)<=l[1]})}}):[{values:[]}]),c=N.select('.nv-focus .nv-linesWrap').datum(X[0].disabled?[{values:[]}]:X.map(function(a,b){return{area:a.area,fillOpacity:a.fillOpacity,key:a.key,values:a.values.filter(function(a,b){return e.x()(a,b)>=l[0]&&e.x()(a,b)<=l[1]})}})),U.length?r=d.xScale():r=e.xScale(),p.scale(r)._ticks(a.utils.calcTicksX(S/100,h)).tickSize(-W,0),p.domain([Math.ceil(l[0]),Math.floor(l[1])]),N.select('.nv-x.nv-axis').transition().duration(k).call(p),b.transition().duration(k).call(d),c.transition().duration(k).call(e),N.select('.nv-focus .nv-x.nv-axis').attr('transform','translate(0,'+K.range()[0]+')'),v.scale(K)._ticks(a.utils.calcTicksY(W/36,h)).tickSize(-S,0),s.scale(P)._ticks(a.utils.calcTicksY(W/36,h)).tickSize(U.length?0:-S,0),N.select('.nv-focus .nv-y1.nv-axis').style('opacity',U.length?1:0),N.select('.nv-focus .nv-y2.nv-axis').style('opacity',X.length&&!X[0].disabled?1:0).attr('transform','translate('+r.range()[1]+',0)'),N.select('.nv-focus .nv-y1.nv-axis').transition().duration(k).call(v),N.select('.nv-focus .nv-y2.nv-axis').transition().duration(k).call(s)}af()}),b}return e.dispatch.on('elementMouseover.tooltip',function(a){h.duration(100).valueFormatter(function(a,b){return s.tickFormat()(a,b)}).data(a).position(a.pos).hidden(!1)}),e.dispatch.on('elementMouseout.tooltip',function(a){h.hidden(!0)}),d.dispatch.on('elementMouseover.tooltip',function(a){a.value=b.x()(a.data),a.series={value:b.y()(a.data),color:a.color},h.duration(0).valueFormatter(function(a,b){return v.tickFormat()(a,b)}).data(a).hidden(!1)}),d.dispatch.on('elementMouseout.tooltip',function(a){h.hidden(!0)}),d.dispatch.on('elementMousemove.tooltip',function(a){h.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=y,b.legend=i,b.lines=e,b.lines2=o,b.bars=d,b.bars2=q,b.xAxis=p,b.x2Axis=u,b.y1Axis=v,b.y2Axis=s,b.y3Axis=x,b.y4Axis=w,b.tooltip=h,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 C},set:function(a){C=a}},showLegend:{get:function(){return L},set:function(a){L=a}},brushExtent:{get:function(){return m},set:function(a){m=a}},noData:{get:function(){return N},set:function(a){N=a}},focusEnable:{get:function(){return B},set:function(a){B=a}},focusHeight:{get:function(){return t},set:function(a){t=a}},focusShowAxisX:{get:function(){return M},set:function(a){M=a}},focusShowAxisY:{get:function(){return J},set:function(a){J=a}},legendLeftAxisHint:{get:function(){return H},set:function(a){H=a}},legendRightAxisHint:{get:function(){return F},set:function(a){F=a}},tooltips:{get:function(){return h.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),h.enabled(!!b)}},tooltipContent:{get:function(){return h.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),h.contentGenerator(b)}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}},duration:{get:function(){return k},set:function(a){k=a}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),i.color(n)}},x:{get:function(){return z},set:function(a){z=a,e.x(a),o.x(a),d.x(a),q.x(a)}},y:{get:function(){return A},set:function(a){A=a,e.y(a),o.y(a),d.y(a),q.y(a)}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.lineWithFocusChart=function(){"use strict";var c=a.models.line(),i=a.models.line(),h=a.models.axis(),g=a.models.axis(),r=a.models.axis(),q=a.models.axis(),o=a.models.legend(),e=d3.svg.brush(),k=a.models.tooltip(),n=a.interactiveGuideline(),d={top:30,right:30,bottom:30,left:60},B={top:0,right:30,bottom:20,left:60},p=a.utils.defaultColor(),A=null,u=null,t=50,y=!1,z=!0,l=null,C=null,x=d3.dispatch('brush','stateChange','changeState'),f=250,m=a.utils.state(),s=null,v,w,D,j,E,F;c.clipEdge(!0).duration(0),i.interactive(!1),h.orient('bottom').tickPadding(5),g.orient('left'),r.orient('bottom').tickPadding(5),q.orient('left'),k.valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return h.tickFormat()(a,b)}),E=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},F=function(a){return function(b){b.active!==void 0&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};function b(k){return k.each(function(k){var H=d3.select(this),W=this,G,I,J,K,M,O,C,N,L,T,R,S,Q;if(a.utils.initSVG(H),G=a.utils.availableWidth(A,H,d),I=a.utils.availableHeight(u,H,d)-t,J=t-B.top-B.bottom,b.update=function(){H.transition().duration(f).call(b)},b.container=this,m.setter(F(k),b.update).getter(E(k)).update(),m.disabled=k.map(function(a){return!!a.disabled}),!s){s={};for(K in m)m[K]instanceof Array?s[K]=m[K].slice(0):s[K]=m[K]}if(!k||!k.length||!k.filter(function(a){return a.values.length}).length)return a.utils.noData(b,H),b;H.selectAll('.nv-noData').remove(),w=c.xScale(),D=c.yScale(),j=i.xScale(),v=i.yScale(),M=H.selectAll('g.nv-wrap.nv-lineWithFocusChart').data([k]),O=M.enter().append('g').attr('class','nvd3 nv-wrap nv-lineWithFocusChart').append('g'),C=M.select('g'),O.append('g').attr('class','nv-legendWrap'),N=O.append('g').attr('class','nv-focus'),N.append('g').attr('class','nv-x nv-axis'),N.append('g').attr('class','nv-y nv-axis'),N.append('g').attr('class','nv-linesWrap'),N.append('g').attr('class','nv-interactive'),L=O.append('g').attr('class','nv-context'),L.append('g').attr('class','nv-x nv-axis'),L.append('g').attr('class','nv-y nv-axis'),L.append('g').attr('class','nv-linesWrap'),L.append('g').attr('class','nv-brushBackground'),L.append('g').attr('class','nv-x nv-brush'),z&&(o.width(G),C.select('.nv-legendWrap').datum(k).call(o),d.top!=o.height()&&(d.top=o.height(),I=a.utils.availableHeight(u,H,d)-t),C.select('.nv-legendWrap').attr('transform','translate(0,'+-d.top+')')),M.attr('transform','translate('+d.left+','+d.top+')'),y&&(n.width(G).height(I).margin({left:d.left,top:d.top}).svgContainer(H).xScale(w),M.select(".nv-interactive").call(n)),c.width(G).height(I).color(k.map(function(a,b){return a.color||p(a,b)}).filter(function(b,a){return!k[a].disabled})),i.defined(c.defined()).width(G).height(J).color(k.map(function(a,b){return a.color||p(a,b)}).filter(function(b,a){return!k[a].disabled})),C.select('.nv-context').attr('transform','translate(0,'+(I+d.bottom+B.top)+')'),T=C.select('.nv-context .nv-linesWrap').datum(k.filter(function(a){return!a.disabled})),d3.transition(T).call(i),h.scale(w)._ticks(a.utils.calcTicksX(G/100,k)).tickSize(-I,0),g.scale(D)._ticks(a.utils.calcTicksY(I/36,k)).tickSize(-G,0),C.select('.nv-focus .nv-x.nv-axis').attr('transform','translate(0,'+I+')'),e.x(j).on('brush',function(){P()}),l&&e.extent(l),R=C.select('.nv-brushBackground').selectAll('g').data([l||e.extent()]),S=R.enter().append('g'),S.append('rect').attr('class','left').attr('x',0).attr('y',0).attr('height',J),S.append('rect').attr('class','right').attr('x',0).attr('y',0).attr('height',J),Q=C.select('.nv-x.nv-brush').call(e),Q.selectAll('rect').attr('height',J),Q.selectAll('.resize').append('path').attr('d',U),P(),r.scale(j)._ticks(a.utils.calcTicksX(G/100,k)).tickSize(-J,0),C.select('.nv-context .nv-x.nv-axis').attr('transform','translate(0,'+v.range()[0]+')'),d3.transition(C.select('.nv-context .nv-x.nv-axis')).call(r),q.scale(v)._ticks(a.utils.calcTicksY(J/36,k)).tickSize(-G,0),d3.transition(C.select('.nv-context .nv-y.nv-axis')).call(q),C.select('.nv-context .nv-x.nv-axis').attr('transform','translate(0,'+v.range()[0]+')'),o.dispatch.on('stateChange',function(a){for(var c in a)m[c]=a[c];x.stateChange(m),b.update()}),n.dispatch.on('elementMousemove',function(l){var m,f,o,i,r,s,t,q,u;c.clearHighlights(),i=[],k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(g,n){var h=e.empty()?j.domain():e.extent(),k=g.values.filter(function(a,b){return c.x()(a,b)>=h[0]&&c.x()(a,b)<=h[1]}),d,q;if(f=a.interactiveBisect(k,l.pointXValue,c.x()),d=k[f],q=b.y()(d,f),q!=null&&c.highlightPoint(n,f,!0),d===void 0)return;m===void 0&&(m=d),o===void 0&&(o=b.xScale()(b.x()(d,f))),i.push({key:g.key,value:b.y()(d,f),color:p(g,g.seriesIndex)})}),i.length>2&&(r=b.yScale().invert(l.mouseY),s=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),t=.03*s,q=a.nearestValueIndex(i.map(function(a){return a.value}),r,t),q!==null&&(i[q].highlight=!0)),u=h.tickFormat()(b.x()(m,f)),n.tooltip.position({left:l.mouseX+d.left,top:l.mouseY+d.top}).chartContainer(W.parentNode).valueFormatter(function(a,b){return a==null?"N/A":g.tickFormat()(a)}).data({value:u,index:f,series:i})(),n.renderGuideLine(o)}),n.dispatch.on("elementMouseout",function(a){c.clearHighlights()}),x.on('changeState',function(a){typeof a.disabled!='undefined'&&k.forEach(function(b,c){b.disabled=a.disabled[c]}),b.update()});function U(d){var c=+(d=='e'),b=c?1:-1,a=J/3;return'M'+.5*b+','+a+'A6,6 0 0 '+c+' '+6.5*b+','+(a+6)+'V'+(2*a-6)+'A6,6 0 0 '+c+' '+.5*b+','+2*a+'Z'+'M'+2.5*b+','+(a+8)+'V'+(2*a-8)+'M'+4.5*b+','+(a+8)+'V'+(2*a-8)}function V(){e.empty()||e.extent(l),R.data([e.empty()?j.domain():l]).each(function(a,d){var b=j(a[0])-w.range()[0],c=G-j(a[1]);d3.select(this).select('.left').attr('width',b<0?0:b),d3.select(this).select('.right').attr('x',j(a[1])).attr('width',c<0?0:c)})}function P(){var a,b;if(l=e.empty()?null:e.extent(),a=e.empty()?j.domain():e.extent(),Math.abs(a[0]-a[1])<=1)return;x.brush({extent:a,brush:e}),V(),b=C.select('.nv-focus .nv-linesWrap').datum(k.filter(function(a){return!a.disabled}).map(function(b,d){return{key:b.key,area:b.area,values:b.values.filter(function(b,d){return c.x()(b,d)>=a[0]&&c.x()(b,d)<=a[1]})}})),b.transition().duration(f).call(c),C.select('.nv-focus .nv-x.nv-axis').transition().duration(f).call(h),C.select('.nv-focus .nv-y.nv-axis').transition().duration(f).call(g)}}),b}return c.dispatch.on('elementMouseover.tooltip',function(a){k.data(a).position(a.pos).hidden(!1)}),c.dispatch.on('elementMouseout.tooltip',function(a){k.hidden(!0)}),b.dispatch=x,b.legend=o,b.lines=c,b.lines2=i,b.xAxis=h,b.yAxis=g,b.x2Axis=r,b.y2Axis=q,b.interactiveLayer=n,b.tooltip=k,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return A},set:function(a){A=a}},height:{get:function(){return u},set:function(a){u=a}},focusHeight:{get:function(){return t},set:function(a){t=a}},showLegend:{get:function(){return z},set:function(a){z=a}},brushExtent:{get:function(){return l},set:function(a){l=a}},defaultState:{get:function(){return s},set:function(a){s=a}},noData:{get:function(){return C},set:function(a){C=a}},tooltips:{get:function(){return k.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),k.enabled(!!b)}},tooltipContent:{get:function(){return k.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),k.contentGenerator(b)}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},color:{get:function(){return p},set:function(b){p=a.utils.getColor(b),o.color(p)}},interpolate:{get:function(){return c.interpolate()},set:function(a){c.interpolate(a),i.interpolate(a)}},xTickFormat:{get:function(){return h.tickFormat()},set:function(a){h.tickFormat(a),r.tickFormat(a)}},yTickFormat:{get:function(){return g.tickFormat()},set:function(a){g.tickFormat(a),q.tickFormat(a)}},duration:{get:function(){return f},set:function(a){f=a,g.duration(f),q.duration(f),h.duration(f),r.duration(f)}},x:{get:function(){return c.x()},set:function(a){c.x(a),i.x(a)}},y:{get:function(){return c.y()},set:function(a){c.y(a),i.y(a)}},useInteractiveGuideline:{get:function(){return y},set:function(a){y=a,y&&(c.interactive(!1),c.useVoronoi(!1))}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.multiBar=function(){"use strict";var d={top:0,right:0,bottom:0,left:0},x=960,C=500,c=d3.scale.ordinal(),b=d3.scale.linear(),p=Math.floor(Math.random()*1e4),y=null,q=function(a){return a.x},e=function(a){return a.y},B=[0],A=!0,f=!1,u='zero',m=a.utils.defaultColor(),i=!1,n=null,h,g=500,s,r,v,w,t=.1,j=d3.dispatch('chartClick','elementClick','elementDblClick','elementMouseover','elementMouseout','elementMousemove','renderEnd'),o=a.utils.renderWatch(j,g),D=0,z,l;function k(E){return o.reset(),E.each(function(k){var K=x-d.left-d.right,L=C-d.top-d.bottom,E,S,G,J,I,N,R,Q,P,H,M,F,T,O;y=d3.select(this),a.utils.initSVG(y),E=0,S=function(a,b){return!!(a.series===k.length-1&&b===k[0].values.length-1)},i&&k.length&&(i=[{values:k[0].values.map(function(a){return{x:a.x,y:0,series:a.series,size:.01}})}]),f&&(G=d3.layout.stack().offset(u).values(function(a){return a.values}).y(e)(!k.length&&i?i:k),G.forEach(function(b,a){b.nonStackable?(k[a].nonStackableSeries=E++,G[a]=k[a]):a>0&&G[a-1].nonStackable&&G[a].values.map(function(b,c){b.y0-=G[a-1].values[c].y,b.y1=b.y0+b.y})}),k=G),k.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),f&&k[0].values.map(function(d,c){var a=0,b=0;k.map(function(e,f){if(!k[f].nonStackable){var d=e.values[c];d.size=Math.abs(d.y),d.y<0?(d.y1=b,b=b-d.size):(d.y1=d.size+a,a=a+d.size)}})}),J=s&&r?[]:k.map(function(a,b){return a.values.map(function(a,c){return{x:q(a,c),y:e(a,c),y0:a.y0,y1:a.y1,idx:b}})}),c.domain(s||d3.merge(J).map(function(a){return a.x})).rangeBands(v||[0,K],t),b.domain(r||d3.extent(d3.merge(J).map(function(a){var b=a.y;return f&&!k[a.idx].nonStackable&&(a.y>0?b=a.y1:b=a.y1+a.y),b}).concat(B))).range(w||[L,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-c.domain()[0]*.01,c.domain()[1]+c.domain()[1]*.01]):c.domain([-1,1])),b.domain()[0]===b.domain()[1]&&(b.domain()[0]?b.domain([b.domain()[0]+b.domain()[0]*.01,b.domain()[1]-b.domain()[1]*.01]):b.domain([-1,1])),z=z||c,l=l||b,I=y.selectAll('g.nv-wrap.nv-multibar').data([k]),N=I.enter().append('g').attr('class','nvd3 nv-wrap nv-multibar'),R=N.append('defs'),Q=N.append('g'),P=I.select('g'),Q.append('g').attr('class','nv-groups'),I.attr('transform','translate('+d.left+','+d.top+')'),R.append('clipPath').attr('id','nv-edge-clip-'+p).append('rect'),I.select('#nv-edge-clip-'+p+' rect').attr('width',K).attr('height',L),P.attr('clip-path',A?'url(#nv-edge-clip-'+p+')':''),H=I.select('.nv-groups').selectAll('.nv-group').data(function(a){return a},function(b,a){return a}),H.enter().append('g').style('stroke-opacity',1e-6).style('fill-opacity',1e-6),M=o.transition(H.exit().selectAll('rect.nv-bar'),'multibarExit',Math.min(100,g)).attr('y',function(a,c,d){var b=l(0)||0;return f&&k[a.series]&&!k[a.series].nonStackable&&(b=l(a.y0)),b}).attr('height',0).remove(),M.delay&&M.delay(function(c,a){var b=a*(g/(D+1))-a;return b}),H.attr('class',function(b,a){return'nv-group nv-series-'+a}).classed('hover',function(a){return a.hover}).style('fill',function(a,b){return m(a,b)}).style('stroke',function(a,b){return m(a,b)}),H.style('stroke-opacity',1).style('fill-opacity',.75),F=H.selectAll('rect.nv-bar').data(function(a){return i&&!k.length?i.values:a.values}),F.exit().remove(),T=F.enter().append('rect').attr('class',function(a,b){return e(a,b)<0?'nv-bar negative':'nv-bar positive'}).attr('x',function(b,d,a){return f&&!k[a].nonStackable?0:a*c.rangeBand()/k.length}).attr('y',function(a,c,b){return l(f&&!k[b].nonStackable?a.y0:0)||0}).attr('height',0).attr('width',function(b,d,a){return c.rangeBand()/(f&&!k[a].nonStackable?1:k.length)}).attr('transform',function(a,b){return'translate('+c(q(a,b))+',0)'}),F.style('fill',function(a,b,c){return m(a,c,b)}).style('stroke',function(a,b,c){return m(a,c,b)}).on('mouseover',function(a,b){d3.select(this).classed('hover',!0),j.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on('mouseout',function(a,b){d3.select(this).classed('hover',!1),j.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on('mousemove',function(a,b){j.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on('click',function(a,b){j.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on('dblclick',function(a,b){j.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),F.attr('class',function(a,b){return e(a,b)<0?'nv-bar negative':'nv-bar positive'}).attr('transform',function(a,b){return'translate('+c(q(a,b))+',0)'}),n&&(h||(h=k.map(function(){return!0})),F.style('fill',function(a,b,c){return d3.rgb(n(a,b)).darker(h.map(function(b,a){return a}).filter(function(b,a){return!h[a]})[c]).toString()}).style('stroke',function(a,b,c){return d3.rgb(n(a,b)).darker(h.map(function(b,a){return a}).filter(function(b,a){return!h[a]})[c]).toString()})),O=F.watchTransition(o,'multibar',Math.min(250,g)).delay(function(b,a){return a*g/k[0].values.length}),f?O.attr('y',function(c,d,f){var a=0;return k[f].nonStackable?e(c,d)<0?a=b(0):b(0)-b(e(c,d))<-1?a=b(0)-1:a=b(e(c,d))||0:a=b(c.y1),a}).attr('height',function(a,c,d){return k[d].nonStackable?Math.max(Math.abs(b(e(a,c))-b(0)),1)||0:Math.max(Math.abs(b(a.y+a.y0)-b(a.y0)),1)}).attr('x',function(d,e,b){var a=0;return k[b].nonStackable&&(a=d.series*c.rangeBand()/k.length,k.length!==E&&(a=k[b].nonStackableSeries*c.rangeBand()/(E*2))),a}).attr('width',function(d,e,b){if(!k[b].nonStackable)return c.rangeBand();var a=c.rangeBand()/E;return k.length!==E&&(a=c.rangeBand()/(E*2)),a}):O.attr('x',function(a,b){return a.series*c.rangeBand()/k.length}).attr('width',c.rangeBand()/k.length).attr('y',function(a,c){return e(a,c)<0?b(0):b(0)-b(e(a,c))<1?b(0)-1:b(e(a,c))||0}).attr('height',function(a,c){return Math.max(Math.abs(b(e(a,c))-b(0)),1)||0}),z=c.copy(),l=b.copy(),k[0]&&k[0].values&&(D=k[0].values.length)}),o.renderEnd('multibar immediate'),k}return k.dispatch=j,k.options=a.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return x},set:function(a){x=a}},height:{get:function(){return C},set:function(a){C=a}},x:{get:function(){return q},set:function(a){q=a}},y:{get:function(){return e},set:function(a){e=a}},xScale:{get:function(){return c},set:function(a){c=a}},yScale:{get:function(){return b},set:function(a){b=a}},xDomain:{get:function(){return s},set:function(a){s=a}},yDomain:{get:function(){return r},set:function(a){r=a}},xRange:{get:function(){return v},set:function(a){v=a}},yRange:{get:function(){return w},set:function(a){w=a}},forceY:{get:function(){return B},set:function(a){B=a}},stacked:{get:function(){return f},set:function(a){f=a}},stackOffset:{get:function(){return u},set:function(a){u=a}},clipEdge:{get:function(){return A},set:function(a){A=a}},disabled:{get:function(){return h},set:function(a){h=a}},id:{get:function(){return p},set:function(a){p=a}},hideable:{get:function(){return i},set:function(a){i=a}},groupSpacing:{get:function(){return t},set:function(a){t=a}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},duration:{get:function(){return g},set:function(a){g=a,o.reset(g)}},color:{get:function(){return m},set:function(b){m=a.utils.getColor(b)}},barColor:{get:function(){return n},set:function(b){n=b?a.utils.getColor(b):null}}}),a.utils.initOptions(k),k},a.models.multiBarChart=function(){"use strict";var c=a.models.multiBar(),j=a.models.axis(),h=a.models.axis(),g=a.models.legend(),n=a.models.legend(),f=a.models.tooltip(),d={top:30,right:20,bottom:50,left:60},z=null,r=null,t=a.utils.defaultColor(),s=!0,l={},y=!0,u=!0,v=!0,p=!1,C=!0,B=!1,o=0,e=a.utils.state(),m=null,E=null,q=d3.dispatch('stateChange','changeState','renderEnd'),A=function(){return s?180:0},i=250,D,w,k,x,F,G;e.stacked=!1,c.stacked(!1),j.orient('bottom').tickPadding(7).showMaxMin(!1).tickFormat(function(a){return a}),h.orient(p?'right':'left').tickFormat(d3.format(',.1f')),f.duration(0).valueFormatter(function(a,b){return h.tickFormat()(a,b)}).headerFormatter(function(a,b){return j.tickFormat()(a,b)}),n.updateState(!1),k=a.utils.renderWatch(q),x=!1,F=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:x}}},G=function(a){return function(b){b.stacked!==void 0&&(x=b.stacked),b.active!==void 0&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};function b(f){return k.reset(),k.models(c),u&&k.models(j),v&&k.models(h),f.each(function(f){var E=d3.select(this),T=this,H,K,I,M,J,k,N,S,L,Q,O,P,R;if(a.utils.initSVG(E),H=a.utils.availableWidth(z,E,d),K=a.utils.availableHeight(r,E,d),b.update=function(){i===0?E.call(b):E.transition().duration(i).call(b)},b.container=this,e.setter(G(f),b.update).getter(F(f)).update(),e.disabled=f.map(function(a){return!!a.disabled}),!m){m={};for(I in e)e[I]instanceof Array?m[I]=e[I].slice(0):m[I]=e[I]}if(!f||!f.length||!f.filter(function(a){return a.values.length}).length)return a.utils.noData(b,E),b;E.selectAll('.nv-noData').remove(),D=c.xScale(),w=c.yScale(),M=E.selectAll('g.nv-wrap.nv-multiBarWithLegend').data([f]),J=M.enter().append('g').attr('class','nvd3 nv-wrap nv-multiBarWithLegend').append('g'),k=M.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-controlsWrap'),y&&(g.width(H-A()),k.select('.nv-legendWrap').datum(f).call(g),d.top!=g.height()&&(d.top=g.height(),K=a.utils.availableHeight(r,E,d)),k.select('.nv-legendWrap').attr('transform','translate('+A()+','+-d.top+')')),s&&(N=[{key:l.grouped||'Grouped',disabled:c.stacked()},{key:l.stacked||'Stacked',disabled:!c.stacked()}],n.width(A()).color(['#444','#444','#444']),k.select('.nv-controlsWrap').datum(N).attr('transform','translate(0,'+-d.top+')').call(n)),M.attr('transform','translate('+d.left+','+d.top+')'),p&&k.select(".nv-y.nv-axis").attr("transform","translate("+H+",0)"),c.disabled(f.map(function(a){return a.disabled})).width(H).height(K).color(f.map(function(a,b){return a.color||t(a,b)}).filter(function(b,a){return!f[a].disabled})),S=k.select('.nv-barsWrap').datum(f.filter(function(a){return!a.disabled})),S.call(c),u&&(j.scale(D)._ticks(a.utils.calcTicksX(H/100,f)).tickSize(-K,0),k.select('.nv-x.nv-axis').attr('transform','translate(0,'+w.range()[0]+')'),k.select('.nv-x.nv-axis').call(j),L=k.select('.nv-x.nv-axis > g').selectAll('g'),L.selectAll('line, text').style('opacity',1),B&&(Q=function(a,b){return"translate("+a+","+b+")"},O=5,P=17,L.selectAll("text").attr('transform',function(b,c,a){return Q(0,a%2==0?O:P)}),R=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length,k.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(b,a){return Q(0,a===0||R%2!==0?P:O)})),C&&L.filter(function(b,a){return a%Math.ceil(f[0].values.length/(H/100))!==0}).selectAll('text, line').style('opacity',0),o&&L.selectAll('.tick text').attr('transform','rotate('+o+' 0,0)').style('text-anchor',o>0?'start':'end'),k.select('.nv-x.nv-axis').selectAll('g.nv-axisMaxMin text').style('opacity',1)),v&&(h.scale(w)._ticks(a.utils.calcTicksY(K/36,f)).tickSize(-H,0),k.select('.nv-y.nv-axis').call(h)),g.dispatch.on('stateChange',function(a){for(var c in a)e[c]=a[c];q.stateChange(e),b.update()}),n.dispatch.on('legendClick',function(a,d){if(!a.disabled)return;switch(N=N.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case'Grouped':case l.grouped:c.stacked(!1);break;case'Stacked':case l.stacked:c.stacked(!0);break}e.stacked=c.stacked(),q.stateChange(e),b.update()}),q.on('changeState',function(a){typeof a.disabled!='undefined'&&(f.forEach(function(b,c){b.disabled=a.disabled[c]}),e.disabled=a.disabled),typeof a.stacked!='undefined'&&(c.stacked(a.stacked),e.stacked=a.stacked,x=a.stacked),b.update()})}),k.renderEnd('multibarchart immediate'),b}return c.dispatch.on('elementMouseover.tooltip',function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},f.data(a).hidden(!1)}),c.dispatch.on('elementMouseout.tooltip',function(a){f.hidden(!0)}),c.dispatch.on('elementMousemove.tooltip',function(a){f.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=q,b.multibar=c,b.legend=g,b.controls=n,b.xAxis=j,b.yAxis=h,b.state=e,b.tooltip=f,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return z},set:function(a){z=a}},height:{get:function(){return r},set:function(a){r=a}},showLegend:{get:function(){return y},set:function(a){y=a}},showControls:{get:function(){return s},set:function(a){s=a}},controlLabels:{get:function(){return l},set:function(a){l=a}},showXAxis:{get:function(){return u},set:function(a){u=a}},showYAxis:{get:function(){return v},set:function(a){v=a}},defaultState:{get:function(){return m},set:function(a){m=a}},noData:{get:function(){return E},set:function(a){E=a}},reduceXTicks:{get:function(){return C},set:function(a){C=a}},rotateLabels:{get:function(){return o},set:function(a){o=a}},staggerLabels:{get:function(){return B},set:function(a){B=a}},tooltips:{get:function(){return f.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),f.enabled(!!b)}},tooltipContent:{get:function(){return f.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),f.contentGenerator(b)}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},duration:{get:function(){return i},set:function(a){i=a,c.duration(i),j.duration(i),h.duration(i),k.reset(i)}},color:{get:function(){return t},set:function(b){t=a.utils.getColor(b),g.color(t)}},rightAlignYAxis:{get:function(){return p},set:function(a){p=a,h.orient(p?'right':'left')}},barColor:{get:function(){return c.barColor},set:function(a){c.barColor(a),g.color(function(b,a){return d3.rgb('#ccc').darker(a*1.5).toString()})}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.multiBarHorizontal=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},A=960,B=500,C=Math.floor(Math.random()*1e4),D=null,d=d3.scale.ordinal(),b=d3.scale.linear(),j=function(a){return a.x},c=function(a){return a.y},n=function(a){return a.yErr},w=[0],p=a.utils.defaultColor(),m=null,h,f=!1,v=!1,E=!1,t=60,x=.1,l=d3.format(',.2f'),F=1200,o,u,y,s,q=250,i=d3.dispatch('chartClick','elementClick','elementDblClick','elementMouseover','elementMouseout','elementMousemove','renderEnd'),g=a.utils.renderWatch(i,q),r,z;function k(q){return g.reset(),q.each(function(k){var H=A-e.left-e.right,K=B-e.top-e.bottom,I,G,J,M,L,N,C,q,F;D=d3.select(this),a.utils.initSVG(D),f&&(k=d3.layout.stack().offset('zero').values(function(a){return a.values}).y(c)(k)),k.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),f&&k[0].values.map(function(d,c){var a=0,b=0;k.map(function(e){var d=e.values[c];d.size=Math.abs(d.y),d.y<0?(d.y1=b-d.size,b=b-d.size):(d.y1=a,a=a+d.size)})}),I=o&&u?[]:k.map(function(a){return a.values.map(function(a,b){return{x:j(a,b),y:c(a,b),y0:a.y0,y1:a.y1}})}),d.domain(o||d3.merge(I).map(function(a){return a.x})).rangeBands(y||[0,K],x),b.domain(u||d3.extent(d3.merge(I).map(function(a){return f?a.y>0?a.y1+a.y:a.y1:a.y}).concat(w))),v&&!f?b.range(s||[b.domain()[0]<0?t:0,H-(b.domain()[1]>0?t:0)]):b.range(s||[0,H]),z=z||d,r=r||d3.scale.linear().domain(b.domain()).range([b(0),b(0)]),G=d3.select(this).selectAll('g.nv-wrap.nv-multibarHorizontal').data([k]),J=G.enter().append('g').attr('class','nvd3 nv-wrap nv-multibarHorizontal'),M=J.append('defs'),L=J.append('g'),N=G.select('g'),L.append('g').attr('class','nv-groups'),G.attr('transform','translate('+e.left+','+e.top+')'),C=G.select('.nv-groups').selectAll('.nv-group').data(function(a){return a},function(b,a){return a}),C.enter().append('g').style('stroke-opacity',1e-6).style('fill-opacity',1e-6),C.exit().watchTransition(g,'multibarhorizontal: exit groups').style('stroke-opacity',1e-6).style('fill-opacity',1e-6).remove(),C.attr('class',function(b,a){return'nv-group nv-series-'+a}).classed('hover',function(a){return a.hover}).style('fill',function(a,b){return p(a,b)}).style('stroke',function(a,b){return p(a,b)}),C.watchTransition(g,'multibarhorizontal: groups').style('stroke-opacity',1).style('fill-opacity',.75),q=C.selectAll('g.nv-bar').data(function(a){return a.values}),q.exit().remove(),F=q.enter().append('g').attr('transform',function(a,b,c){return'translate('+r(f?a.y0:0)+','+(f?0:c*d.rangeBand()/k.length+d(j(a,b)))+')'}),F.append('rect').attr('width',0).attr('height',d.rangeBand()/(f?1:k.length)),q.on('mouseover',function(a,b){d3.select(this).classed('hover',!0),i.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on('mouseout',function(a,b){d3.select(this).classed('hover',!1),i.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on('mouseout',function(a,b){i.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on('mousemove',function(a,b){i.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on('click',function(a,b){i.elementClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}).on('dblclick',function(a,b){i.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),n(k[0],0)&&(F.append('polyline'),q.select('polyline').attr('fill','none').attr('points',function(e,g){var a=n(e,g),c=.8*d.rangeBand()/((f?1:k.length)*2),h;return a=a.length?a:[-Math.abs(a),Math.abs(a)],a=a.map(function(a){return b(a)-b(0)}),h=[[a[0],-c],[a[0],c],[a[0],0],[a[1],0],[a[1],-c],[a[1],c]],h.map(function(a){return a.join(',')}).join(' ')}).attr('transform',function(a,e){var g=d.rangeBand()/((f?1:k.length)*2);return'translate('+(c(a,e)<0?0:b(c(a,e))-b(0))+', '+g+')'})),F.append('text'),v&&!f?(q.select('text').attr('text-anchor',function(a,b){return c(a,b)<0?'end':'start'}).attr('y',d.rangeBand()/(k.length*2)).attr('dy','.32em').text(function(d,e){var b=l(c(d,e)),a=n(d,e);return a===void 0?b:a.length?b+'+'+l(Math.abs(a[1]))+'-'+l(Math.abs(a[0])):b+'±'+l(Math.abs(a))}),q.watchTransition(g,'multibarhorizontal: bars').select('text').attr('x',function(a,d){return c(a,d)<0?-4:b(c(a,d))-b(0)+4})):q.selectAll('text').text(''),E&&!f?(F.append('text').classed('nv-bar-label',!0),q.select('text.nv-bar-label').attr('text-anchor',function(a,b){return c(a,b)<0?'start':'end'}).attr('y',d.rangeBand()/(k.length*2)).attr('dy','.32em').text(function(a,b){return j(a,b)}),q.watchTransition(g,'multibarhorizontal: bars').select('text.nv-bar-label').attr('x',function(a,d){return c(a,d)<0?b(0)-b(c(a,d))+4:-4})):q.selectAll('text.nv-bar-label').text(''),q.attr('class',function(a,b){return c(a,b)<0?'nv-bar negative':'nv-bar positive'}),m&&(h||(h=k.map(function(){return!0})),q.style('fill',function(a,b,c){return d3.rgb(m(a,b)).darker(h.map(function(b,a){return a}).filter(function(b,a){return!h[a]})[c]).toString()}).style('stroke',function(a,b,c){return d3.rgb(m(a,b)).darker(h.map(function(b,a){return a}).filter(function(b,a){return!h[a]})[c]).toString()})),f?q.watchTransition(g,'multibarhorizontal: bars').attr('transform',function(a,c){return'translate('+b(a.y1)+','+d(j(a,c))+')'}).select('rect').attr('width',function(a,d){return Math.abs(b(c(a,d)+a.y0)-b(a.y0))}).attr('height',d.rangeBand()):q.watchTransition(g,'multibarhorizontal: bars').attr('transform',function(a,e){return'translate('+(c(a,e)<0?b(c(a,e)):b(0))+','+(a.series*d.rangeBand()/k.length+d(j(a,e)))+')'}).select('rect').attr('height',d.rangeBand()/k.length).attr('width',function(a,d){return Math.max(Math.abs(b(c(a,d))-b(0)),1)}),z=d.copy(),r=b.copy()}),g.renderEnd('multibarHorizontal immediate'),k}return k.dispatch=i,k.options=a.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return A},set:function(a){A=a}},height:{get:function(){return B},set:function(a){B=a}},x:{get:function(){return j},set:function(a){j=a}},y:{get:function(){return c},set:function(a){c=a}},yErr:{get:function(){return n},set:function(a){n=a}},xScale:{get:function(){return d},set:function(a){d=a}},yScale:{get:function(){return b},set:function(a){b=a}},xDomain:{get:function(){return o},set:function(a){o=a}},yDomain:{get:function(){return u},set:function(a){u=a}},xRange:{get:function(){return y},set:function(a){y=a}},yRange:{get:function(){return s},set:function(a){s=a}},forceY:{get:function(){return w},set:function(a){w=a}},stacked:{get:function(){return f},set:function(a){f=a}},showValues:{get:function(){return v},set:function(a){v=a}},disabled:{get:function(){return h},set:function(a){h=a}},id:{get:function(){return C},set:function(a){C=a}},valueFormat:{get:function(){return l},set:function(a){l=a}},valuePadding:{get:function(){return t},set:function(a){t=a}},groupSpacing:{get:function(){return x},set:function(a){x=a}},margin:{get:function(){return e},set:function(a){e.top=a.top!==void 0?a.top:e.top,e.right=a.right!==void 0?a.right:e.right,e.bottom=a.bottom!==void 0?a.bottom:e.bottom,e.left=a.left!==void 0?a.left:e.left}},duration:{get:function(){return q},set:function(a){q=a,g.reset(q)}},color:{get:function(){return p},set:function(b){p=a.utils.getColor(b)}},barColor:{get:function(){return m},set:function(b){m=b?a.utils.getColor(b):null}}}),a.utils.initOptions(k),k},a.models.multiBarHorizontalChart=function(){"use strict";var c=a.models.multiBarHorizontal(),i=a.models.axis(),j=a.models.axis(),h=a.models.legend().height(30),o=a.models.legend().height(30),f=a.models.tooltip(),d={top:30,right:20,bottom:50,left:60},y=null,u=null,t=a.utils.defaultColor(),r=!0,q={},w=!0,p=!0,v=!0,m=!1,e=a.utils.state(),k=null,A=null,n=d3.dispatch('stateChange','changeState','renderEnd'),x=function(){return r?180:0},g=250,z,s,B,C,l;e.stacked=!1,c.stacked(m),i.orient('left').tickPadding(5).showMaxMin(!1).tickFormat(function(a){return a}),j.orient('bottom').tickFormat(d3.format(',.1f')),f.duration(0).valueFormatter(function(a,b){return j.tickFormat()(a,b)}).headerFormatter(function(a,b){return i.tickFormat()(a,b)}),o.updateState(!1),B=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:m}}},C=function(a){return function(b){b.stacked!==void 0&&(m=b.stacked),b.active!==void 0&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},l=a.utils.renderWatch(n,g);function b(f){return l.reset(),l.models(c),p&&l.models(i),v&&l.models(j),f.each(function(f){var A=d3.select(this),L=this,G,D,E,H,F,l,I,J,K;if(a.utils.initSVG(A),G=a.utils.availableWidth(y,A,d),D=a.utils.availableHeight(u,A,d),b.update=function(){A.transition().duration(g).call(b)},b.container=this,m=c.stacked(),e.setter(C(f),b.update).getter(B(f)).update(),e.disabled=f.map(function(a){return!!a.disabled}),!k){k={};for(E in e)e[E]instanceof Array?k[E]=e[E].slice(0):k[E]=e[E]}if(!f||!f.length||!f.filter(function(a){return a.values.length}).length)return a.utils.noData(b,A),b;A.selectAll('.nv-noData').remove(),z=c.xScale(),s=c.yScale(),H=A.selectAll('g.nv-wrap.nv-multiBarHorizontalChart').data([f]),F=H.enter().append('g').attr('class','nvd3 nv-wrap nv-multiBarHorizontalChart').append('g'),l=H.select('g'),F.append('g').attr('class','nv-x nv-axis'),F.append('g').attr('class','nv-y nv-axis').append('g').attr('class','nv-zeroLine').append('line'),F.append('g').attr('class','nv-barsWrap'),F.append('g').attr('class','nv-legendWrap'),F.append('g').attr('class','nv-controlsWrap'),w&&(h.width(G-x()),l.select('.nv-legendWrap').datum(f).call(h),d.top!=h.height()&&(d.top=h.height(),D=a.utils.availableHeight(u,A,d)),l.select('.nv-legendWrap').attr('transform','translate('+x()+','+-d.top+')')),r&&(I=[{key:q.grouped||'Grouped',disabled:c.stacked()},{key:q.stacked||'Stacked',disabled:!c.stacked()}],o.width(x()).color(['#444','#444','#444']),l.select('.nv-controlsWrap').datum(I).attr('transform','translate(0,'+-d.top+')').call(o)),H.attr('transform','translate('+d.left+','+d.top+')'),c.disabled(f.map(function(a){return a.disabled})).width(G).height(D).color(f.map(function(a,b){return a.color||t(a,b)}).filter(function(b,a){return!f[a].disabled})),J=l.select('.nv-barsWrap').datum(f.filter(function(a){return!a.disabled})),J.transition().call(c),p&&(i.scale(z)._ticks(a.utils.calcTicksY(D/24,f)).tickSize(-G,0),l.select('.nv-x.nv-axis').call(i),K=l.select('.nv-x.nv-axis').selectAll('g'),K.selectAll('line, text')),v&&(j.scale(s)._ticks(a.utils.calcTicksX(G/100,f)).tickSize(-D,0),l.select('.nv-y.nv-axis').attr('transform','translate(0,'+D+')'),l.select('.nv-y.nv-axis').call(j)),l.select(".nv-zeroLine line").attr("x1",s(0)).attr("x2",s(0)).attr("y1",0).attr("y2",-D),h.dispatch.on('stateChange',function(a){for(var c in a)e[c]=a[c];n.stateChange(e),b.update()}),o.dispatch.on('legendClick',function(a,d){if(!a.disabled)return;switch(I=I.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case'Grouped':c.stacked(!1);break;case'Stacked':c.stacked(!0);break}e.stacked=c.stacked(),n.stateChange(e),m=c.stacked(),b.update()}),n.on('changeState',function(a){typeof a.disabled!='undefined'&&(f.forEach(function(b,c){b.disabled=a.disabled[c]}),e.disabled=a.disabled),typeof a.stacked!='undefined'&&(c.stacked(a.stacked),e.stacked=a.stacked,m=a.stacked),b.update()})}),l.renderEnd('multibar horizontal chart immediate'),b}return c.dispatch.on('elementMouseover.tooltip',function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},f.data(a).hidden(!1)}),c.dispatch.on('elementMouseout.tooltip',function(a){f.hidden(!0)}),c.dispatch.on('elementMousemove.tooltip',function(a){f.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=n,b.multibar=c,b.legend=h,b.controls=o,b.xAxis=i,b.yAxis=j,b.state=e,b.tooltip=f,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return y},set:function(a){y=a}},height:{get:function(){return u},set:function(a){u=a}},showLegend:{get:function(){return w},set:function(a){w=a}},showControls:{get:function(){return r},set:function(a){r=a}},controlLabels:{get:function(){return q},set:function(a){q=a}},showXAxis:{get:function(){return p},set:function(a){p=a}},showYAxis:{get:function(){return v},set:function(a){v=a}},defaultState:{get:function(){return k},set:function(a){k=a}},noData:{get:function(){return A},set:function(a){A=a}},tooltips:{get:function(){return f.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),f.enabled(!!b)}},tooltipContent:{get:function(){return f.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),f.contentGenerator(b)}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},duration:{get:function(){return g},set:function(a){g=a,l.reset(g),c.duration(g),i.duration(g),j.duration(g)}},color:{get:function(){return t},set:function(b){t=a.utils.getColor(b),h.color(t)}},barColor:{get:function(){return c.barColor},set:function(a){c.barColor(a),h.color(function(b,a){return d3.rgb('#ccc').darker(a*1.5).toString()})}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.multiChart=function(){"use strict";var c={top:30,right:20,bottom:50,left:60},v=a.utils.defaultColor(),x=null,p=null,s=!0,B=null,u,t,y=function(a){return a.x},z=function(a){return a.y},r='monotone',A=!0,q=d3.scale.linear(),k=d3.scale.linear(),m=d3.scale.linear(),g=a.models.line().yScale(k),j=a.models.line().yScale(m),e=a.models.multiBar().stacked(!1).yScale(k),i=a.models.multiBar().stacked(!1).yScale(m),f=a.models.stackedArea().yScale(k),h=a.models.stackedArea().yScale(m),w=a.models.axis().scale(q).orient('bottom').tickPadding(5),n=a.models.axis().scale(k).orient('left'),o=a.models.axis().scale(m).orient('right'),l=a.models.legend().height(30),d=a.models.tooltip(),C=d3.dispatch();function b(y){return y.each(function(y){var D=d3.select(this),$=this,B,A,O,N,M,K,F,G,H,I,L,C,z,E,P,_,Z,S,T,U,V,W,X,Y;if(a.utils.initSVG(D),b.update=function(){D.transition().call(b)},b.container=this,B=a.utils.availableWidth(x,D,c),A=a.utils.availableHeight(p,D,c),O=y.filter(function(a){return a.type=='line'&&a.yAxis==1}),N=y.filter(function(a){return a.type=='line'&&a.yAxis==2}),M=y.filter(function(a){return a.type=='bar'&&a.yAxis==1}),K=y.filter(function(a){return a.type=='bar'&&a.yAxis==2}),F=y.filter(function(a){return a.type=='area'&&a.yAxis==1}),G=y.filter(function(a){return a.type=='area'&&a.yAxis==2}),!y||!y.length||!y.filter(function(a){return a.values.length}).length)return a.utils.noData(b,D),b;D.selectAll('.nv-noData').remove(),H=y.filter(function(a){return!a.disabled&&a.yAxis==1}).map(function(a){return a.values.map(function(a,b){return{x:a.x,y:a.y}})}),I=y.filter(function(a){return!a.disabled&&a.yAxis==2}).map(function(a){return a.values.map(function(a,b){return{x:a.x,y:a.y}})}),q.domain(d3.extent(d3.merge(H.concat(I)),function(a){return a.x})).range([0,B]),L=D.selectAll('g.wrap.multiChart').data([y]),C=L.enter().append('g').attr('class','wrap nvd3 multiChart').append('g'),C.append('g').attr('class','nv-x nv-axis'),C.append('g').attr('class','nv-y1 nv-axis'),C.append('g').attr('class','nv-y2 nv-axis'),C.append('g').attr('class','lines1Wrap'),C.append('g').attr('class','lines2Wrap'),C.append('g').attr('class','bars1Wrap'),C.append('g').attr('class','bars2Wrap'),C.append('g').attr('class','stack1Wrap'),C.append('g').attr('class','stack2Wrap'),C.append('g').attr('class','legendWrap'),z=L.select('g'),E=y.map(function(b,a){return y[a].color||v(b,a)}),s&&(P=l.align()?B/2:B,_=l.align()?P:0,l.width(P),l.color(E),z.select('.legendWrap').datum(y.map(function(a){return a.originalKey=a.originalKey===void 0?a.key:a.originalKey,a.key=a.originalKey+(a.yAxis==1?'':' (right axis)'),a})).call(l),c.top!=l.height()&&(c.top=l.height(),A=a.utils.availableHeight(p,D,c)),z.select('.legendWrap').attr('transform','translate('+_+','+-c.top+')')),g.width(B).height(A).interpolate(r).color(E.filter(function(b,a){return!y[a].disabled&&y[a].yAxis==1&&y[a].type=='line'})),j.width(B).height(A).interpolate(r).color(E.filter(function(b,a){return!y[a].disabled&&y[a].yAxis==2&&y[a].type=='line'})),e.width(B).height(A).color(E.filter(function(b,a){return!y[a].disabled&&y[a].yAxis==1&&y[a].type=='bar'})),i.width(B).height(A).color(E.filter(function(b,a){return!y[a].disabled&&y[a].yAxis==2&&y[a].type=='bar'})),f.width(B).height(A).color(E.filter(function(b,a){return!y[a].disabled&&y[a].yAxis==1&&y[a].type=='area'})),h.width(B).height(A).color(E.filter(function(b,a){return!y[a].disabled&&y[a].yAxis==2&&y[a].type=='area'})),z.attr('transform','translate('+c.left+','+c.top+')'),Z=z.select('.lines1Wrap').datum(O.filter(function(a){return!a.disabled})),S=z.select('.bars1Wrap').datum(M.filter(function(a){return!a.disabled})),T=z.select('.stack1Wrap').datum(F.filter(function(a){return!a.disabled})),U=z.select('.lines2Wrap').datum(N.filter(function(a){return!a.disabled})),V=z.select('.bars2Wrap').datum(K.filter(function(a){return!a.disabled})),W=z.select('.stack2Wrap').datum(G.filter(function(a){return!a.disabled})),X=F.length?F.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}]):[],Y=G.length?G.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}]):[],k.domain(u||d3.extent(d3.merge(H).concat(X),function(a){return a.y})).range([0,A]),m.domain(t||d3.extent(d3.merge(I).concat(Y),function(a){return a.y})).range([0,A]),g.yDomain(k.domain()),e.yDomain(k.domain()),f.yDomain(k.domain()),j.yDomain(m.domain()),i.yDomain(m.domain()),h.yDomain(m.domain()),F.length&&d3.transition(T).call(f),G.length&&d3.transition(W).call(h),M.length&&d3.transition(S).call(e),K.length&&d3.transition(V).call(i),O.length&&d3.transition(Z).call(g),N.length&&d3.transition(U).call(j),w._ticks(a.utils.calcTicksX(B/100,y)).tickSize(-A,0),z.select('.nv-x.nv-axis').attr('transform','translate(0,'+A+')'),d3.transition(z.select('.nv-x.nv-axis')).call(w),n._ticks(a.utils.calcTicksY(A/36,y)).tickSize(-B,0),d3.transition(z.select('.nv-y1.nv-axis')).call(n),o._ticks(a.utils.calcTicksY(A/36,y)).tickSize(-B,0),d3.transition(z.select('.nv-y2.nv-axis')).call(o),z.select('.nv-y1.nv-axis').classed('nv-disabled',!H.length).attr('transform','translate('+q.range()[0]+',0)'),z.select('.nv-y2.nv-axis').classed('nv-disabled',!I.length).attr('transform','translate('+q.range()[1]+',0)'),l.dispatch.on('stateChange',function(a){b.update()});function J(a){var b=y[a.seriesIndex].yAxis===2?o:n;a.value=a.point.x,a.series={value:a.point.y,color:a.point.color},d.duration(100).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).position(a.pos).hidden(!1)}function Q(a){var b=y[a.seriesIndex].yAxis===2?o:n;a.point.x=f.x()(a.point),a.point.y=f.y()(a.point),d.duration(100).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).position(a.pos).hidden(!1)}function R(a){var b=y[a.data.series].yAxis===2?o:n;a.value=e.x()(a.data),a.series={value:e.y()(a.data),color:a.color},d.duration(0).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).hidden(!1)}g.dispatch.on('elementMouseover.tooltip',J),j.dispatch.on('elementMouseover.tooltip',J),g.dispatch.on('elementMouseout.tooltip',function(a){d.hidden(!0)}),j.dispatch.on('elementMouseout.tooltip',function(a){d.hidden(!0)}),f.dispatch.on('elementMouseover.tooltip',Q),h.dispatch.on('elementMouseover.tooltip',Q),f.dispatch.on('elementMouseout.tooltip',function(a){d.hidden(!0)}),h.dispatch.on('elementMouseout.tooltip',function(a){d.hidden(!0)}),e.dispatch.on('elementMouseover.tooltip',R),i.dispatch.on('elementMouseover.tooltip',R),e.dispatch.on('elementMouseout.tooltip',function(a){d.hidden(!0)}),i.dispatch.on('elementMouseout.tooltip',function(a){d.hidden(!0)}),e.dispatch.on('elementMousemove.tooltip',function(a){d.position({top:d3.event.pageY,left:d3.event.pageX})()}),i.dispatch.on('elementMousemove.tooltip',function(a){d.position({top:d3.event.pageY,left:d3.event.pageX})()})}),b}return b.dispatch=C,b.lines1=g,b.lines2=j,b.bars1=e,b.bars2=i,b.stack1=f,b.stack2=h,b.xAxis=w,b.yAxis1=n,b.yAxis2=o,b.tooltip=d,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return x},set:function(a){x=a}},height:{get:function(){return p},set:function(a){p=a}},showLegend:{get:function(){return s},set:function(a){s=a}},yDomain1:{get:function(){return u},set:function(a){u=a}},yDomain2:{get:function(){return t},set:function(a){t=a}},noData:{get:function(){return B},set:function(a){B=a}},interpolate:{get:function(){return r},set:function(a){r=a}},tooltips:{get:function(){return d.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),d.enabled(!!b)}},tooltipContent:{get:function(){return d.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),d.contentGenerator(b)}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}},color:{get:function(){return v},set:function(b){v=a.utils.getColor(b)}},x:{get:function(){return y},set:function(a){y=a,g.x(a),j.x(a),e.x(a),i.x(a),f.x(a),h.x(a)}},y:{get:function(){return z},set:function(a){z=a,g.y(a),j.y(a),f.y(a),h.y(a),e.y(a),i.y(a)}},useVoronoi:{get:function(){return A},set:function(a){A=a,g.useVoronoi(a),j.useVoronoi(a),f.useVoronoi(a),h.useVoronoi(a)}}}),a.utils.initOptions(b),b},a.models.ohlcBar=function(){"use strict";var d={top:0,right:0,bottom:0,left:0},s=null,w=null,j=Math.floor(Math.random()*1e4),g=null,c=d3.scale.linear(),b=d3.scale.linear(),l=function(a){return a.x},o=function(a){return a.y},f=function(a){return a.open},k=function(a){return a.close},h=function(a){return a.high},i=function(a){return a.low},r=[],p=[],q=!1,t=!0,n=a.utils.defaultColor(),z=!1,u,v,m,x,y=d3.dispatch('tooltipShow','tooltipHide','stateChange','changeState','renderEnd','chartClick','elementClick','elementDblClick','elementMouseover','elementMouseout','elementMousemove');function e(z){return z.each(function(e){var z,D,A,B,E,F,G,H,C;g=d3.select(this),z=a.utils.availableWidth(s,g,d),D=a.utils.availableHeight(w,g,d),a.utils.initSVG(g),A=z/e[0].values.length*.9,c.domain(u||d3.extent(e[0].values.map(l).concat(r))),q?c.range(m||[z*.5/e[0].values.length,z*(e[0].values.length-.5)/e[0].values.length]):c.range(m||[5+A/2,z-A/2-5]),b.domain(v||[d3.min(e[0].values.map(i).concat(p)),d3.max(e[0].values.map(h).concat(p))]).range(x||[D,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-c.domain()[0]*.01,c.domain()[1]+c.domain()[1]*.01]):c.domain([-1,1])),b.domain()[0]===b.domain()[1]&&(b.domain()[0]?b.domain([b.domain()[0]+b.domain()[0]*.01,b.domain()[1]-b.domain()[1]*.01]):b.domain([-1,1])),B=d3.select(this).selectAll('g.nv-wrap.nv-ohlcBar').data([e[0].values]),E=B.enter().append('g').attr('class','nvd3 nv-wrap nv-ohlcBar'),F=E.append('defs'),G=E.append('g'),H=B.select('g'),G.append('g').attr('class','nv-ticks'),B.attr('transform','translate('+d.left+','+d.top+')'),g.on('click',function(a,b){y.chartClick({data:a,index:b,pos:d3.event,id:j})}),F.append('clipPath').attr('id','nv-chart-clip-path-'+j).append('rect'),B.select('#nv-chart-clip-path-'+j+' rect').attr('width',z).attr('height',D),H.attr('clip-path',t?'url(#nv-chart-clip-path-'+j+')':''),C=B.select('.nv-ticks').selectAll('.nv-tick').data(function(a){return a}),C.exit().remove(),C.enter().append('path').attr('class',function(b,a,c){return(f(b,a)>k(b,a)?'nv-tick negative':'nv-tick positive')+' nv-tick-'+c+'-'+a}).attr('d',function(a,c){return'm0,0l0,'+(b(f(a,c))-b(h(a,c)))+'l'+-A/2+',0l'+A/2+',0l0,'+(b(i(a,c))-b(f(a,c)))+'l0,'+(b(k(a,c))-b(i(a,c)))+'l'+A/2+',0l'+-A/2+',0z'}).attr('transform',function(a,d){return'translate('+c(l(a,d))+','+b(h(a,d))+')'}).attr('fill',function(a,b){return n[0]}).attr('stroke',function(a,b){return n[0]}).attr('x',0).attr('y',function(a,c){return b(Math.max(0,o(a,c)))}).attr('height',function(a,c){return Math.abs(b(o(a,c))-b(0))}),C.attr('class',function(b,a,c){return(f(b,a)>k(b,a)?'nv-tick negative':'nv-tick positive')+' nv-tick-'+c+'-'+a}),d3.transition(C).attr('transform',function(a,d){return'translate('+c(l(a,d))+','+b(h(a,d))+')'}).attr('d',function(a,c){var d=z/e[0].values.length*.9;return'm0,0l0,'+(b(f(a,c))-b(h(a,c)))+'l'+-d/2+',0l'+d/2+',0l0,'+(b(i(a,c))-b(f(a,c)))+'l0,'+(b(k(a,c))-b(i(a,c)))+'l'+d/2+',0l'+-d/2+',0z'})}),e}return e.highlightPoint=function(a,b){e.clearHighlights(),g.select(".nv-ohlcBar .nv-tick-0-"+a).classed("hover",b)},e.clearHighlights=function(){g.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},e.dispatch=y,e.options=a.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return s},set:function(a){s=a}},height:{get:function(){return w},set:function(a){w=a}},xScale:{get:function(){return c},set:function(a){c=a}},yScale:{get:function(){return b},set:function(a){b=a}},xDomain:{get:function(){return u},set:function(a){u=a}},yDomain:{get:function(){return v},set:function(a){v=a}},xRange:{get:function(){return m},set:function(a){m=a}},yRange:{get:function(){return x},set:function(a){x=a}},forceX:{get:function(){return r},set:function(a){r=a}},forceY:{get:function(){return p},set:function(a){p=a}},padData:{get:function(){return q},set:function(a){q=a}},clipEdge:{get:function(){return t},set:function(a){t=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return z},set:function(a){z=a}},x:{get:function(){return l},set:function(a){l=a}},y:{get:function(){return o},set:function(a){o=a}},open:{get:function(){return f()},set:function(a){f=a}},close:{get:function(){return k()},set:function(a){k=a}},high:{get:function(){return h},set:function(a){h=a}},low:{get:function(){return i},set:function(a){i=a}},margin:{get:function(){return d},set:function(a){d.top=a.top!=void 0?a.top:d.top,d.right=a.right!=void 0?a.right:d.right,d.bottom=a.bottom!=void 0?a.bottom:d.bottom,d.left=a.left!=void 0?a.left:d.left}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b)}}}),a.utils.initOptions(e),e},a.models.parallelCoordinates=function(){"use strict";var c={top:30,right:0,bottom:10,left:0},k=null,j=null,e=d3.scale.ordinal(),b={},d=[],n=[],o=a.utils.defaultColor(),l=[],h=[],i=[],m=1,g=d3.dispatch('brush','elementMouseover','elementMouseout');function f(p){return p.each(function(w){var x=d3.select(this),y=a.utils.availableWidth(k,x,c),t=a.utils.availableHeight(j,x,c),E,r,F,B,H,O,J,I,s,p,C,D,G,u,f,q,A;a.utils.initSVG(x),h=w,e.rangePoints([0,y],1).domain(d),E={},d.forEach(function(c){var a=d3.extent(w,function(a){return+a[c]});return E[c]=!1,a[0]===void 0&&(E[c]=!0,a[0]=0,a[1]=0),a[0]===a[1]&&(a[0]=a[0]-1,a[1]=a[1]+1),b[c]=d3.scale.linear().domain(a).range([(t-12)*.9,0]),b[c].brush=d3.svg.brush().y(b[c]).on('brush',K),c!='name'}),r=x.selectAll('g.nv-wrap.nv-parallelCoordinates').data([w]),F=r.enter().append('g').attr('class','nvd3 nv-wrap nv-parallelCoordinates'),B=F.append('g'),H=r.select('g'),B.append('g').attr('class','nv-parallelCoordinates background'),B.append('g').attr('class','nv-parallelCoordinates foreground'),B.append('g').attr('class','nv-parallelCoordinates missingValuesline'),r.attr('transform','translate('+c.left+','+c.top+')'),O=d3.svg.line().interpolate('cardinal').tension(m),J=d3.svg.axis().orient('left'),I=d3.behavior.drag().on('dragstart',L).on('drag',M).on('dragend',N),C=e.range()[1]-e.range()[0],D=[],G=[0+C/2,t-12,y-C/2,t-12],s=r.select('.missingValuesline').selectAll('line').data([G]),s.enter().append('line'),s.exit().remove(),s.attr("x1",function(a){return a[0]}).attr("y1",function(a){return a[1]}).attr("x2",function(a){return a[2]}).attr("y2",function(a){return a[3]}),p=r.select('.missingValuesline').selectAll('text').data(["undefined values"]),p.append('text').data(["undefined values"]),p.enter().append('text'),p.exit().remove(),p.attr("y",t).attr("x",y-92-C/2).text(function(a){return a}),u=r.select('.background').selectAll('path').data(w),u.enter().append('path'),u.exit().remove(),u.attr('d',v),f=r.select('.foreground').selectAll('path').data(w),f.enter().append('path'),f.exit().remove(),f.attr('d',v).attr('stroke',o),f.on("mouseover",function(a,b){d3.select(this).classed('hover',!0),g.elementMouseover({label:a.name,data:a.data,index:b,pos:[d3.mouse(this.parentNode)[0],d3.mouse(this.parentNode)[1]]})}),f.on("mouseout",function(a,b){d3.select(this).classed('hover',!1),g.elementMouseout({label:a.name,data:a.data,index:b})}),q=H.selectAll('.dimension').data(d),A=q.enter().append('g').attr('class','nv-parallelCoordinates dimension'),A.append('g').attr('class','nv-parallelCoordinates nv-axis'),A.append('g').attr('class','nv-parallelCoordinates-brush'),A.append('text').attr('class','nv-parallelCoordinates nv-label'),q.attr('transform',function(a){return'translate('+e(a)+',0)'}),q.exit().remove(),q.select('.nv-label').style("cursor","move").attr('dy','-1em').attr('text-anchor','middle').text(String).on("mouseover",function(a,b){g.elementMouseover({dim:a,pos:[d3.mouse(this.parentNode.parentNode)[0],d3.mouse(this.parentNode.parentNode)[1]]})}).on("mouseout",function(a,b){g.elementMouseout({dim:a})}).call(I),q.select('.nv-axis').each(function(a,c){d3.select(this).call(J.scale(b[a]).tickFormat(d3.format(n[c])))}),q.select('.nv-parallelCoordinates-brush').each(function(a){d3.select(this).call(b[a].brush)}).selectAll('rect').attr('x',-8).attr('width',16);function v(a){return O(d.map(function(c){var d,g,f,h;return isNaN(a[c])||isNaN(parseFloat(a[c]))?(d=b[c].domain(),g=b[c].range(),f=d[0]-(d[1]-d[0])/9,D.indexOf(c)<0&&(h=d3.scale.linear().domain([f,d[1]]).range([t-12,g[1]]),b[c].brush.y(h),D.push(c)),[e(c),b[c](f)]):(D.length>0?(s.style("display","inline"),p.style("display","inline")):(s.style("display","none"),p.style("display","none")),[e(c),b[c](a[c])])}))}function K(){var c=d.filter(function(a){return!b[a].brush.empty()}),a=c.map(function(a){return b[a].brush.extent()});l=[],c.forEach(function(c,b){l[b]={dimension:c,extent:a[b]}}),h=[],f.style('display',function(d){var e=c.every(function(c,e){return!!(isNaN(d[c])&&a[e][0]==b[c].brush.y().domain()[0])||a[e][0]<=d[c]&&d[c]<=a[e][1]});return e&&h.push(d),e?null:'none'}),g.brush({filters:l,active:h})}function L(a,b){i[a]=this.parentNode.__origin__=e(a),u.attr("visibility","hidden")}function M(a,b){i[a]=Math.min(y,Math.max(0,this.parentNode.__origin__+=d3.event.x)),f.attr("d",v),d.sort(function(a,b){return z(a)-z(b)}),e.domain(d),q.attr("transform",function(a){return"translate("+z(a)+")"})}function N(a,b){delete this.parentNode.__origin__,delete i[a],d3.select(this.parentNode).attr("transform","translate("+e(a)+")"),f.attr("d",v),u.attr("d",v).attr("visibility",null)}function z(a){var b=i[a];return b==null?e(a):b}}),f}return f.dispatch=g,f.options=a.utils.optionsFunc.bind(f),f._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return j},set:function(a){j=a}},dimensionNames:{get:function(){return d},set:function(a){d=a}},dimensionFormats:{get:function(){return n},set:function(a){n=a}},lineTension:{get:function(){return m},set:function(a){m=a}},dimensions:{get:function(){return d},set:function(b){a.deprecated('dimensions','use dimensionNames instead'),d=b}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}},color:{get:function(){return o},set:function(b){o=a.utils.getColor(b)}}}),a.utils.initOptions(f),f},a.models.pie=function(){"use strict";var b={top:0,right:0,bottom:0,left:0},A=500,z=500,r=function(a){return a.x},p=function(a){return a.y},s=Math.floor(Math.random()*1e4),t=null,v=a.utils.defaultColor(),l=d3.format(',.2f'),y=!0,d=!1,n="key",x=.02,h=!1,q=!1,w=!0,D=0,j=!1,g=!1,u=!1,f=!1,o=0,m=.5,k=[],c=d3.dispatch('chartClick','elementClick','elementDblClick','elementMouseover','elementMouseout','elementMousemove','renderEnd'),e=[],B=[],C=a.utils.renderWatch(c);function i(E){return C.reset(),E.each(function(R){var N=A-b.left-b.right,M=z-b.top-b.bottom,F=Math.min(N,M)/2,G=[],Q=[],Z,_,i,I,$,V,U,Y,J,K,P,L,O,H,ab,E,T,S,W,X;if(t=d3.select(this),k.length===0){Z=F-F/5,_=m*F;for(i=0;i<R[0].length;i++)G.push(Z),Q.push(_)}else G=k.map(function(a){return(a.outer-a.outer/5)*F}),Q=k.map(function(a){return(a.inner-a.inner/5)*F}),m=d3.min(k.map(function(a){return a.inner-a.inner/5}));a.utils.initSVG(t),I=t.selectAll('.nv-wrap.nv-pie').data(R),$=I.enter().append('g').attr('class','nvd3 nv-wrap nv-pie nv-chart-'+s),V=$.append('g'),U=I.select('g'),Y=V.append('g').attr('class','nv-pie'),V.append('g').attr('class','nv-pieLabels'),I.attr('transform','translate('+b.left+','+b.top+')'),U.select('.nv-pie').attr('transform','translate('+N/2+','+M/2+')'),U.select('.nv-pieLabels').attr('transform','translate('+N/2+','+M/2+')'),t.on('click',function(a,b){c.chartClick({data:a,index:b,pos:d3.event,id:s})}),e=[],B=[];for(i=0;i<R[0].length;i++)J=d3.svg.arc().outerRadius(G[i]),K=d3.svg.arc().outerRadius(G[i]+5),g!==!1&&(J.startAngle(g),K.startAngle(g)),f!==!1&&(J.endAngle(f),K.endAngle(f)),h&&(J.innerRadius(Q[i]),K.innerRadius(Q[i])),J.cornerRadius&&o&&(J.cornerRadius(o),K.cornerRadius(o)),e.push(J),B.push(K);if(P=d3.layout.pie().sort(null).value(function(a){return a.disabled?0:p(a)}),P.padAngle&&u&&P.padAngle(u),h&&q&&(Y.append("text").attr('class','nv-pie-title'),I.select('.nv-pie-title').style("text-anchor","middle").text(function(a){return q}).style("font-size",Math.min(N,M)*m*2/(q.length+2)+"px").attr("dy","0.35em").attr('transform',function(a,b){return'translate(0, '+D+')'})),L=I.select('.nv-pie').selectAll('.nv-slice').data(P),O=I.select('.nv-pieLabels').selectAll('.nv-label').data(P),L.exit().remove(),O.exit().remove(),H=L.enter().append('g'),H.attr('class','nv-slice'),H.on('mouseover',function(b,a){d3.select(this).classed('hover',!0),w&&d3.select(this).select("path").transition().duration(70).attr("d",B[a]),c.elementMouseover({data:b.data,index:a,color:d3.select(this).style("fill")})}),H.on('mouseout',function(b,a){d3.select(this).classed('hover',!1),w&&d3.select(this).select("path").transition().duration(50).attr("d",e[a]),c.elementMouseout({data:b.data,index:a})}),H.on('mousemove',function(a,b){c.elementMousemove({data:a.data,index:b})}),H.on('click',function(a,b){c.elementClick({data:a.data,index:b,color:d3.select(this).style("fill")})}),H.on('dblclick',function(a,b){c.elementDblClick({data:a.data,index:b,color:d3.select(this).style("fill")})}),L.attr('fill',function(a,b){return v(a.data,b)}),L.attr('stroke',function(a,b){return v(a.data,b)}),ab=H.append('path').each(function(a){this._current=a}),L.select('path').transition().attr('d',function(a,b){return e[b](a)}).attrTween('d',aa),y){E=[];for(i=0;i<R[0].length;i++)E.push(e[i]),d?h&&(E[i]=d3.svg.arc().outerRadius(e[i].outerRadius()),g!==!1&&E[i].startAngle(g),f!==!1&&E[i].endAngle(f)):h||E[i].innerRadius(0);O.enter().append("g").classed("nv-label",!0).each(function(b,c){var a=d3.select(this);a.attr('transform',function(a,b){if(j){a.outerRadius=G[b]+10,a.innerRadius=G[b]+15;var c=(a.startAngle+a.endAngle)/2*(180/Math.PI);return(a.startAngle+a.endAngle)/2<Math.PI?c-=90:c+=90,'translate('+E[b].centroid(a)+') rotate('+c+')'}return a.outerRadius=F+10,a.innerRadius=F+15,'translate('+E[b].centroid(a)+')'}),a.append('rect').style('stroke','#fff').style('fill','#fff').attr("rx",3).attr("ry",3),a.append('text').style('text-anchor',j?(b.startAngle+b.endAngle)/2<Math.PI?'start':'end':'middle').style('fill','#000')}),T={},S=14,W=140,X=function(a){return Math.floor(a[0]/W)*W+','+Math.floor(a[1]/S)*S},O.watchTransition(C,'pie labels').attr('transform',function(a,c){var d,b,e;return j?(a.outerRadius=G[c]+10,a.innerRadius=G[c]+15,d=(a.startAngle+a.endAngle)/2*(180/Math.PI),(a.startAngle+a.endAngle)/2<Math.PI?d-=90:d+=90,'translate('+E[c].centroid(a)+') rotate('+d+')'):(a.outerRadius=F+10,a.innerRadius=F+15,b=E[c].centroid(a),a.value&&(e=X(b),T[e]&&(b[1]-=S),T[X(b)]=!0),'translate('+b+')')}),O.select(".nv-label text").style('text-anchor',function(a,b){return j?(a.startAngle+a.endAngle)/2<Math.PI?'start':'end':'middle'}).text(function(a,d){var c=(a.endAngle-a.startAngle)/(2*Math.PI),b='';if(!a.value||c<x)return'';if(typeof n=='function')b=n(a,d,{key:r(a.data),value:p(a.data),percent:l(c)});else switch(n){case'key':b=r(a.data);break;case'value':b=l(p(a.data));break;case'percent':b=d3.format('%')(c);break}return b})}function ac(b){var a=(b.startAngle+b.endAngle)*90/Math.PI-90;return a>90?a-180:a}function aa(a,c){a.endAngle=isNaN(a.endAngle)?0:a.endAngle,a.startAngle=isNaN(a.startAngle)?0:a.startAngle,h||(a.innerRadius=0);var b=d3.interpolate(this._current,a);return this._current=b(0),function(a){return e[c](b(a))}}}),C.renderEnd('pie immediate'),i}return i.dispatch=c,i.options=a.utils.optionsFunc.bind(i),i._options=Object.create({},{arcsRadius:{get:function(){return k},set:function(a){k=a}},width:{get:function(){return A},set:function(a){A=a}},height:{get:function(){return z},set:function(a){z=a}},showLabels:{get:function(){return y},set:function(a){y=a}},title:{get:function(){return q},set:function(a){q=a}},titleOffset:{get:function(){return D},set:function(a){D=a}},labelThreshold:{get:function(){return x},set:function(a){x=a}},valueFormat:{get:function(){return l},set:function(a){l=a}},x:{get:function(){return r},set:function(a){r=a}},id:{get:function(){return s},set:function(a){s=a}},endAngle:{get:function(){return f},set:function(a){f=a}},startAngle:{get:function(){return g},set:function(a){g=a}},padAngle:{get:function(){return u},set:function(a){u=a}},cornerRadius:{get:function(){return o},set:function(a){o=a}},donutRatio:{get:function(){return m},set:function(a){m=a}},labelsOutside:{get:function(){return d},set:function(a){d=a}},labelSunbeamLayout:{get:function(){return j},set:function(a){j=a}},donut:{get:function(){return h},set:function(a){h=a}},growOnHover:{get:function(){return w},set:function(a){w=a}},pieLabelsOutside:{get:function(){return d},set:function(b){d=b,a.deprecated('pieLabelsOutside','use labelsOutside instead')}},donutLabelsOutside:{get:function(){return d},set:function(b){d=b,a.deprecated('donutLabelsOutside','use labelsOutside instead')}},labelFormat:{get:function(){return l},set:function(b){l=b,a.deprecated('labelFormat','use valueFormat instead')}},margin:{get:function(){return b},set:function(a){b.top=typeof a.top!='undefined'?a.top:b.top,b.right=typeof a.right!='undefined'?a.right:b.right,b.bottom=typeof a.bottom!='undefined'?a.bottom:b.bottom,b.left=typeof a.left!='undefined'?a.left:b.left}},y:{get:function(){return p},set:function(a){p=d3.functor(a)}},color:{get:function(){return v},set:function(b){v=a.utils.getColor(b)}},labelType:{get:function(){return n},set:function(a){n=a||'key'}}}),a.utils.initOptions(i),i},a.models.pieChart=function(){"use strict";var d=a.models.pie(),e=a.models.legend(),f=a.models.tooltip(),c={top:30,right:20,bottom:20,left:20},q=null,o=null,m=!0,i="top",j=a.utils.defaultColor(),g=a.utils.state(),h=null,p=null,n=250,k=d3.dispatch('tooltipShow','tooltipHide','stateChange','changeState','renderEnd'),l,r,s;f.headerEnabled(!1).duration(0).valueFormatter(function(a,b){return d.valueFormat()(a,b)}),l=a.utils.renderWatch(k),r=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},s=function(a){return function(b){b.active!==void 0&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};function b(f){return l.reset(),l.models(d),f.each(function(f){var j=d3.select(this),y,l,t,n,p,v,w,u,x;if(a.utils.initSVG(j),y=this,l=a.utils.availableWidth(q,j,c),t=a.utils.availableHeight(o,j,c),b.update=function(){j.transition().call(b)},b.container=this,g.setter(s(f),b.update).getter(r(f)).update(),g.disabled=f.map(function(a){return!!a.disabled}),!h){h={};for(n in g)g[n]instanceof Array?h[n]=g[n].slice(0):h[n]=g[n]}if(!f||!f.length)return a.utils.noData(b,j),b;j.selectAll('.nv-noData').remove(),p=j.selectAll('g.nv-wrap.nv-pieChart').data([f]),v=p.enter().append('g').attr('class','nvd3 nv-wrap nv-pieChart').append('g'),w=p.select('g'),v.append('g').attr('class','nv-pieWrap'),v.append('g').attr('class','nv-legendWrap'),m&&(i==="top"?(e.width(l).key(d.x()),p.select('.nv-legendWrap').datum(f).call(e),c.top!=e.height()&&(c.top=e.height(),t=a.utils.availableHeight(o,j,c)),p.select('.nv-legendWrap').attr('transform','translate(0,'+-c.top+')')):i==="right"&&(u=a.models.legend().width(),l/2<u&&(u=l/2),e.height(t).key(d.x()),e.width(u),l-=e.width(),p.select('.nv-legendWrap').datum(f).call(e).attr('transform','translate('+l+',0)'))),p.attr('transform','translate('+c.left+','+c.top+')'),d.width(l).height(t),x=w.select('.nv-pieWrap').datum([f]),d3.transition(x).call(d),e.dispatch.on('stateChange',function(a){for(var c in a)g[c]=a[c];k.stateChange(g),b.update()}),k.on('changeState',function(a){typeof a.disabled!='undefined'&&(f.forEach(function(b,c){b.disabled=a.disabled[c]}),g.disabled=a.disabled),b.update()})}),l.renderEnd('pieChart immediate'),b}return d.dispatch.on('elementMouseover.tooltip',function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},f.data(a).hidden(!1)}),d.dispatch.on('elementMouseout.tooltip',function(a){f.hidden(!0)}),d.dispatch.on('elementMousemove.tooltip',function(a){f.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.legend=e,b.dispatch=k,b.pie=d,b.tooltip=f,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return p},set:function(a){p=a}},showLegend:{get:function(){return m},set:function(a){m=a}},legendPosition:{get:function(){return i},set:function(a){i=a}},defaultState:{get:function(){return h},set:function(a){h=a}},tooltips:{get:function(){return f.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),f.enabled(!!b)}},tooltipContent:{get:function(){return f.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),f.contentGenerator(b)}},color:{get:function(){return j},set:function(a){j=a,e.color(j),d.color(j)}},duration:{get:function(){return n},set:function(a){n=a,l.reset(n)}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}}}),a.utils.inheritOptions(b,d),a.utils.initOptions(b),b},a.models.scatter=function(){"use strict";var d={top:0,right:0,bottom:0,left:0},r=null,q=null,k=a.utils.defaultColor(),n=Math.floor(Math.random()*1e5),i=null,b=d3.scale.linear(),c=d3.scale.linear(),j=d3.scale.linear(),g=function(a){return a.x},f=function(a){return a.y},p=function(a){return a.size||1},z=function(a){return a.shape||'circle'},F=[],M=[],L=[],o=!0,w=function(a){return!a.notActive},E=!1,u=.1,J=!1,D=!0,I=!1,H=function(){return 25},C=null,A=null,B=null,N=null,s=null,K=null,P=!1,e=d3.dispatch('elementClick','elementDblClick','elementMouseover','elementMouseout','renderEnd'),y=!0,x=250,l=!1,m=a.utils.renderWatch(e,x),Q=[16,256],O,v,t,G;function h(x){return m.reset(),x.each(function(h){var R,U,V,x,W,Y,X,Z,S,T;i=d3.select(this),R=a.utils.availableWidth(r,i,d),U=a.utils.availableHeight(q,i,d),a.utils.initSVG(i),h.forEach(function(a,b){a.values.forEach(function(a){a.series=b})}),V=C&&A&&s?[]:d3.merge(h.map(function(a){return a.values.map(function(a,b){return{x:g(a,b),y:f(a,b),size:p(a,b)}})})),b.domain(C||d3.extent(V.map(function(a){return a.x}).concat(F))),E&&h[0]?b.range(B||[(R*u+R)/(2*h[0].values.length),R-R*(1+u)/(2*h[0].values.length)]):b.range(B||[0,R]),c.domain(A||d3.extent(V.map(function(a){return a.y}).concat(M))).range(N||[U,0]),j.domain(s||d3.extent(V.map(function(a){return a.size}).concat(L))).range(K||Q),P=b.domain()[0]===b.domain()[1]||c.domain()[0]===c.domain()[1],b.domain()[0]===b.domain()[1]&&(b.domain()[0]?b.domain([b.domain()[0]-b.domain()[0]*.01,b.domain()[1]+b.domain()[1]*.01]):b.domain([-1,1])),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-c.domain()[0]*.01,c.domain()[1]+c.domain()[1]*.01]):c.domain([-1,1])),isNaN(b.domain()[0])&&b.domain([-1,1]),isNaN(c.domain()[0])&&c.domain([-1,1]),v=v||b,t=t||c,G=G||j,x=i.selectAll('g.nv-wrap.nv-scatter').data([h]),W=x.enter().append('g').attr('class','nvd3 nv-wrap nv-scatter nv-chart-'+n),Y=W.append('defs'),X=W.append('g'),Z=x.select('g'),x.classed('nv-single-point',P),X.append('g').attr('class','nv-groups'),X.append('g').attr('class','nv-point-paths'),W.append('g').attr('class','nv-point-clips'),x.attr('transform','translate('+d.left+','+d.top+')'),Y.append('clipPath').attr('id','nv-edge-clip-'+n).append('rect'),x.select('#nv-edge-clip-'+n+' rect').attr('width',R).attr('height',U>0?U:0),Z.attr('clip-path',J?'url(#nv-edge-clip-'+n+')':'');function _(){var a,n,p,m,s,j;if(l=!1,!o)return!1;if(y===!0){if(a=d3.merge(h.map(function(a,d){return a.values.map(function(a,e){var h=g(a,e),i=f(a,e);return[b(h)+Math.random()*1e-4,c(i)+Math.random()*1e-4,d,e,a]}).filter(function(a,b){return w(a[4],b)})})),a.length==0)return!1;a.length<3&&(a.push([b.range()[0]-20,c.range()[0]-20,null,null]),a.push([b.range()[1]+20,c.range()[1]+20,null,null]),a.push([b.range()[0]-20,c.range()[0]+20,null,null]),a.push([b.range()[1]+20,c.range()[1]-20,null,null])),n=d3.geom.polygon([[-10,-10],[-10,q+10],[r+10,q+10],[r+10,-10]]),p=d3.geom.voronoi(a).map(function(c,b){return{data:n.clip(c),series:a[b][2],point:a[b][3]}}),x.select('.nv-point-paths').selectAll('path').remove(),m=x.select('.nv-point-paths').selectAll('path').data(p),s=m.enter().append("svg:path").attr("d",function(a){return!a||!a.data||a.data.length===0?'M 0 0':"M"+a.data.join(",")+"Z"}).attr("id",function(b,a){return"nv-path-"+a}).attr("clip-path",function(b,a){return"url(#nv-clip-"+a+")"}),I&&s.style("fill",d3.rgb(230,230,230)).style('fill-opacity',.4).style('stroke-opacity',1).style("stroke",d3.rgb(200,200,200)),D&&(x.select('.nv-point-clips').selectAll('clipPath').remove(),x.select('.nv-point-clips').selectAll("clipPath").data(a).enter().append("svg:clipPath").attr("id",function(b,a){return"nv-clip-"+a}).append("svg:circle").attr('cx',function(a){return a[0]}).attr('cy',function(a){return a[1]}).attr('r',H)),j=function(e,q){var j,a,m,o,p,n;if(l)return 0;if(j=h[e.series],j===void 0)return;a=j.values[e.point],a.color=k(j,e.series),a.x=g(a),a.y=f(a),m=i.node().getBoundingClientRect(),o=window.pageYOffset||document.documentElement.scrollTop,p=window.pageXOffset||document.documentElement.scrollLeft,n={left:b(g(a,e.point))+m.left+p+d.left+10,top:c(f(a,e.point))+m.top+o+d.top+10},q({point:a,series:j,pos:n,seriesIndex:e.series,pointIndex:e.point})},m.on('click',function(a){j(a,e.elementClick)}).on('dblclick',function(a){j(a,e.elementDblClick)}).on('mouseover',function(a){j(a,e.elementMouseover)}).on('mouseout',function(a,b){j(a,e.elementMouseout)})}else x.select('.nv-groups').selectAll('.nv-group').selectAll('.nv-point').on('click',function(i,a){if(l||!h[i.series])return 0;var k=h[i.series],j=k.values[a];e.elementClick({point:j,series:k,pos:[b(g(j,a))+d.left,c(f(j,a))+d.top],seriesIndex:i.series,pointIndex:a})}).on('dblclick',function(i,a){if(l||!h[i.series])return 0;var k=h[i.series],j=k.values[a];e.elementDblClick({point:j,series:k,pos:[b(g(j,a))+d.left,c(f(j,a))+d.top],seriesIndex:i.series,pointIndex:a})}).on('mouseover',function(i,a){if(l||!h[i.series])return 0;var m=h[i.series],j=m.values[a];e.elementMouseover({point:j,series:m,pos:[b(g(j,a))+d.left,c(f(j,a))+d.top],seriesIndex:i.series,pointIndex:a,color:k(i,a)})}).on('mouseout',function(a,b){if(l||!h[a.series])return 0;var c=h[a.series],d=c.values[b];e.elementMouseout({point:d,series:c,seriesIndex:a.series,pointIndex:b,color:k(a,b)})})}l=!0,S=x.select('.nv-groups').selectAll('.nv-group').data(function(a){return a},function(a){return a.key}),S.enter().append('g').style('stroke-opacity',1e-6).style('fill-opacity',1e-6),S.exit().remove(),S.attr('class',function(b,a){return'nv-group nv-series-'+a}).classed('hover',function(a){return a.hover}),S.watchTransition(m,'scatter: groups').style('fill',function(a,b){return k(a,b)}).style('stroke',function(a,b){return k(a,b)}).style('stroke-opacity',1).style('fill-opacity',.5),T=S.selectAll('path.nv-point').data(function(a){return a.values.map(function(a,b){return[a,b]}).filter(function(a,b){return w(a[0],b)})}),T.enter().append('path').style('fill',function(a){return a.color}).style('stroke',function(a){return a.color}).attr('transform',function(a){return'translate('+v(g(a[0],a[1]))+','+t(f(a[0],a[1]))+')'}).attr('d',a.utils.symbol().type(function(a){return z(a[0])}).size(function(a){return j(p(a[0],a[1]))})),T.exit().remove(),S.exit().selectAll('path.nv-point').watchTransition(m,'scatter exit').attr('transform',function(a){return'translate('+b(g(a[0],a[1]))+','+c(f(a[0],a[1]))+')'}).remove(),T.each(function(a){d3.select(this).classed('nv-point',!0).classed('nv-point-'+a[1],!0).classed('nv-noninteractive',!o).classed('hover',!1)}),T.watchTransition(m,'scatter points').attr('transform',function(a){return'translate('+b(g(a[0],a[1]))+','+c(f(a[0],a[1]))+')'}).attr('d',a.utils.symbol().type(function(a){return z(a[0])}).size(function(a){return j(p(a[0],a[1]))})),clearTimeout(O),O=setTimeout(_,300),v=b.copy(),t=c.copy(),G=j.copy()}),m.renderEnd('scatter immediate'),h}return h.dispatch=e,h.options=a.utils.optionsFunc.bind(h),h._calls=new function(){this.clearHighlights=function(){return a.dom.write(function(){i.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(b,c,d){a.dom.write(function(){i.select(" .nv-series-"+b+" .nv-point-"+c).classed("hover",d)})}},e.on('elementMouseover.point',function(a){o&&h._calls.highlightPoint(a.seriesIndex,a.pointIndex,!0)}),e.on('elementMouseout.point',function(a){o&&h._calls.highlightPoint(a.seriesIndex,a.pointIndex,!1)}),h._options=Object.create({},{width:{get:function(){return r},set:function(a){r=a}},height:{get:function(){return q},set:function(a){q=a}},xScale:{get:function(){return b},set:function(a){b=a}},yScale:{get:function(){return c},set:function(a){c=a}},pointScale:{get:function(){return j},set:function(a){j=a}},xDomain:{get:function(){return C},set:function(a){C=a}},yDomain:{get:function(){return A},set:function(a){A=a}},pointDomain:{get:function(){return s},set:function(a){s=a}},xRange:{get:function(){return B},set:function(a){B=a}},yRange:{get:function(){return N},set:function(a){N=a}},pointRange:{get:function(){return K},set:function(a){K=a}},forceX:{get:function(){return F},set:function(a){F=a}},forceY:{get:function(){return M},set:function(a){M=a}},forcePoint:{get:function(){return L},set:function(a){L=a}},interactive:{get:function(){return o},set:function(a){o=a}},pointActive:{get:function(){return w},set:function(a){w=a}},padDataOuter:{get:function(){return u},set:function(a){u=a}},padData:{get:function(){return E},set:function(a){E=a}},clipEdge:{get:function(){return J},set:function(a){J=a}},clipVoronoi:{get:function(){return D},set:function(a){D=a}},clipRadius:{get:function(){return H},set:function(a){H=a}},showVoronoi:{get:function(){return I},set:function(a){I=a}},id:{get:function(){return n},set:function(a){n=a}},x:{get:function(){return g},set:function(a){g=d3.functor(a)}},y:{get:function(){return f},set:function(a){f=d3.functor(a)}},pointSize:{get:function(){return p},set:function(a){p=d3.functor(a)}},pointShape:{get:function(){return z},set:function(a){z=d3.functor(a)}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},duration:{get:function(){return x},set:function(a){x=a,m.reset(x)}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b)}},useVoronoi:{get:function(){return y},set:function(a){y=a,y===!1&&(D=!1)}}}),a.utils.initOptions(h),h},a.models.scatterChart=function(){"use strict";var d=a.models.scatter(),p=a.models.axis(),n=a.models.axis(),o=a.models.legend(),m=a.models.distribution(),l=a.models.distribution(),f=a.models.tooltip(),c={top:30,right:20,bottom:50,left:75},z=null,v=null,e=null,h=a.utils.defaultColor(),k=d.xScale(),i=d.yScale(),t=!1,y=!1,A=!0,x=!0,u=!0,s=!1,g=a.utils.state(),q=null,w=d3.dispatch('stateChange','changeState','renderEnd'),B=null,r=250,C,D,j,E,F;d.xScale(k).yScale(i),p.orient('bottom').tickPadding(10),n.orient(s?'right':'left').tickPadding(10),m.axis('x'),l.axis('y'),f.headerFormatter(function(a,b){return p.tickFormat()(a,b)}).valueFormatter(function(a,b){return n.tickFormat()(a,b)}),j=a.utils.renderWatch(w,r),E=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},F=function(a){return function(b){b.active!==void 0&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};function b(B){return j.reset(),j.models(d),x&&j.models(p),u&&j.models(n),t&&j.models(m),y&&j.models(l),B.each(function(B){var Q=this,I,J,K,H,O,G,L,P,M,N;if(e=d3.select(this),a.utils.initSVG(e),I=a.utils.availableWidth(z,e,c),J=a.utils.availableHeight(v,e,c),b.update=function(){r===0?e.call(b):e.transition().duration(r).call(b)},b.container=this,g.setter(F(B),b.update).getter(E(B)).update(),g.disabled=B.map(function(a){return!!a.disabled}),!q){q={};for(K in g)g[K]instanceof Array?q[K]=g[K].slice(0):q[K]=g[K]}if(!B||!B.length||!B.filter(function(a){return a.values.length}).length)return a.utils.noData(b,e),j.renderEnd('scatter immediate'),b;e.selectAll('.nv-noData').remove(),k=d.xScale(),i=d.yScale(),H=e.selectAll('g.nv-wrap.nv-scatterChart').data([B]),O=H.enter().append('g').attr('class','nvd3 nv-wrap nv-scatterChart nv-chart-'+d.id()),G=O.append('g'),L=H.select('g'),G.append('rect').attr('class','nvd3 nv-background').style("pointer-events","none"),G.append('g').attr('class','nv-x nv-axis'),G.append('g').attr('class','nv-y nv-axis'),G.append('g').attr('class','nv-scatterWrap'),G.append('g').attr('class','nv-regressionLinesWrap'),G.append('g').attr('class','nv-distWrap'),G.append('g').attr('class','nv-legendWrap'),s&&L.select(".nv-y.nv-axis").attr("transform","translate("+I+",0)"),A&&(P=I,o.width(P),H.select('.nv-legendWrap').datum(B).call(o),c.top!=o.height()&&(c.top=o.height(),J=a.utils.availableHeight(v,e,c)),H.select('.nv-legendWrap').attr('transform','translate(0,'+-c.top+')')),H.attr('transform','translate('+c.left+','+c.top+')'),d.width(I).height(J).color(B.map(function(a,b){return a.color=a.color||h(a,b),a.color}).filter(function(b,a){return!B[a].disabled})),H.select('.nv-scatterWrap').datum(B.filter(function(a){return!a.disabled})).call(d),H.select('.nv-regressionLinesWrap').attr('clip-path','url(#nv-edge-clip-'+d.id()+')'),M=H.select('.nv-regressionLinesWrap').selectAll('.nv-regLines').data(function(a){return a}),M.enter().append('g').attr('class','nv-regLines'),N=M.selectAll('.nv-regLine').data(function(a){return[a]}),N.enter().append('line').attr('class','nv-regLine').style('stroke-opacity',0),N.filter(function(a){return a.intercept&&a.slope}).watchTransition(j,'scatterPlusLineChart: regline').attr('x1',k.range()[0]).attr('x2',k.range()[1]).attr('y1',function(a,b){return i(k.domain()[0]*a.slope+a.intercept)}).attr('y2',function(a,b){return i(k.domain()[1]*a.slope+a.intercept)}).style('stroke',function(a,c,b){return h(a,b)}).style('stroke-opacity',function(a,b){return a.disabled||typeof a.slope=='undefined'||typeof a.intercept=='undefined'?0:1}),x&&(p.scale(k)._ticks(a.utils.calcTicksX(I/100,B)).tickSize(-J,0),L.select('.nv-x.nv-axis').attr('transform','translate(0,'+i.range()[0]+')').call(p)),u&&(n.scale(i)._ticks(a.utils.calcTicksY(J/36,B)).tickSize(-I,0),L.select('.nv-y.nv-axis').call(n)),t&&(m.getData(d.x()).scale(k).width(I).color(B.map(function(a,b){return a.color||h(a,b)}).filter(function(b,a){return!B[a].disabled})),G.select('.nv-distWrap').append('g').attr('class','nv-distributionX'),L.select('.nv-distributionX').attr('transform','translate(0,'+i.range()[0]+')').datum(B.filter(function(a){return!a.disabled})).call(m)),y&&(l.getData(d.y()).scale(i).width(J).color(B.map(function(a,b){return a.color||h(a,b)}).filter(function(b,a){return!B[a].disabled})),G.select('.nv-distWrap').append('g').attr('class','nv-distributionY'),L.select('.nv-distributionY').attr('transform','translate('+(s?I:-l.size())+',0)').datum(B.filter(function(a){return!a.disabled})).call(l)),o.dispatch.on('stateChange',function(a){for(var c in a)g[c]=a[c];w.stateChange(g),b.update()}),w.on('changeState',function(a){typeof a.disabled!='undefined'&&(B.forEach(function(b,c){b.disabled=a.disabled[c]}),g.disabled=a.disabled),b.update()}),d.dispatch.on('elementMouseout.tooltip',function(a){f.hidden(!0),e.select('.nv-chart-'+d.id()+' .nv-series-'+a.seriesIndex+' .nv-distx-'+a.pointIndex).attr('y1',0),e.select('.nv-chart-'+d.id()+' .nv-series-'+a.seriesIndex+' .nv-disty-'+a.pointIndex).attr('x2',l.size())}),d.dispatch.on('elementMouseover.tooltip',function(a){e.select('.nv-series-'+a.seriesIndex+' .nv-distx-'+a.pointIndex).attr('y1',a.pos.top-J-c.top),e.select('.nv-series-'+a.seriesIndex+' .nv-disty-'+a.pointIndex).attr('x2',a.pos.left+m.size()-c.left),f.position(a.pos).data(a).hidden(!1)}),C=k.copy(),D=i.copy()}),j.renderEnd('scatter with line immediate'),b}return b.dispatch=w,b.scatter=d,b.legend=o,b.xAxis=p,b.yAxis=n,b.distX=m,b.distY=l,b.tooltip=f,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return z},set:function(a){z=a}},height:{get:function(){return v},set:function(a){v=a}},container:{get:function(){return e},set:function(a){e=a}},showDistX:{get:function(){return t},set:function(a){t=a}},showDistY:{get:function(){return y},set:function(a){y=a}},showLegend:{get:function(){return A},set:function(a){A=a}},showXAxis:{get:function(){return x},set:function(a){x=a}},showYAxis:{get:function(){return u},set:function(a){u=a}},defaultState:{get:function(){return q},set:function(a){q=a}},noData:{get:function(){return B},set:function(a){B=a}},duration:{get:function(){return r},set:function(a){r=a}},tooltips:{get:function(){return f.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),f.enabled(!!b)}},tooltipContent:{get:function(){return f.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),f.contentGenerator(b)}},tooltipXContent:{get:function(){return f.contentGenerator()},set:function(b){a.deprecated('tooltipContent','This option is removed, put values into main tooltip.')}},tooltipYContent:{get:function(){return f.contentGenerator()},set:function(b){a.deprecated('tooltipContent','This option is removed, put values into main tooltip.')}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}},rightAlignYAxis:{get:function(){return s},set:function(a){s=a,n.orient(a?'right':'left')}},color:{get:function(){return h},set:function(b){h=a.utils.getColor(b),o.color(h),m.color(h),l.color(h)}}}),a.utils.inheritOptions(b,d),a.utils.initOptions(b),b},a.models.sparkline=function(){"use strict";var b={top:2,right:0,bottom:2,left:0},o=400,j=32,i=null,p=!0,e=d3.scale.linear(),c=d3.scale.linear(),f=function(a){return a.x},d=function(a){return a.y},k=a.utils.getColor(['#000']),l,h,m,n;function g(p){return p.each(function(p){var t=o-b.left-b.right,u=j-b.top-b.bottom,g,s,v,w,q,r;i=d3.select(this),a.utils.initSVG(i),e.domain(l||d3.extent(p,f)).range(m||[0,t]),c.domain(h||d3.extent(p,d)).range(n||[u,0]),g=i.selectAll('g.nv-wrap.nv-sparkline').data([p]),s=g.enter().append('g').attr('class','nvd3 nv-wrap nv-sparkline'),v=s.append('g'),w=g.select('g'),g.attr('transform','translate('+b.left+','+b.top+')'),q=g.selectAll('path').data(function(a){return[a]}),q.enter().append('path'),q.exit().remove(),q.style('stroke',function(a,b){return a.color||k(a,b)}).attr('d',d3.svg.line().x(function(a,b){return e(f(a,b))}).y(function(a,b){return c(d(a,b))})),r=g.selectAll('circle.nv-point').data(function(e){var a=e.map(function(a,b){return d(a,b)}),f,g,h;function b(a){if(a!=-1){var b=e[a];return b.pointIndex=a,b}return null}return f=b(a.lastIndexOf(c.domain()[1])),g=b(a.indexOf(c.domain()[0])),h=b(a.length-1),[g,f,h].filter(function(a){return a!=null})}),r.enter().append('circle'),r.exit().remove(),r.attr('cx',function(a,b){return e(f(a,a.pointIndex))}).attr('cy',function(a,b){return c(d(a,a.pointIndex))}).attr('r',2).attr('class',function(a,b){return f(a,a.pointIndex)==e.domain()[1]?'nv-point nv-currentValue':d(a,a.pointIndex)==c.domain()[0]?'nv-point nv-minValue':'nv-point nv-maxValue'})}),g}return g.options=a.utils.optionsFunc.bind(g),g._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return j},set:function(a){j=a}},xDomain:{get:function(){return l},set:function(a){l=a}},yDomain:{get:function(){return h},set:function(a){h=a}},xRange:{get:function(){return m},set:function(a){m=a}},yRange:{get:function(){return n},set:function(a){n=a}},xScale:{get:function(){return e},set:function(a){e=a}},yScale:{get:function(){return c},set:function(a){c=a}},animate:{get:function(){return p},set:function(a){p=a}},x:{get:function(){return f},set:function(a){f=d3.functor(a)}},y:{get:function(){return d},set:function(a){d=d3.functor(a)}},margin:{get:function(){return b},set:function(a){b.top=a.top!==void 0?a.top:b.top,b.right=a.right!==void 0?a.right:b.right,b.bottom=a.bottom!==void 0?a.bottom:b.bottom,b.left=a.left!==void 0?a.left:b.left}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b)}}}),a.utils.initOptions(g),g},a.models.sparklinePlus=function(){"use strict";var c=a.models.sparkline(),b={top:15,right:100,bottom:10,left:50},k=null,l=null,e=[],h=!1,n=d3.format(',r'),g=d3.format(',.2f'),m=!0,j=!0,f=!1,p=null,i,o;function d(p){return p.each(function(p){var q=d3.select(this),v,u,w,t,B,s,r,z,A,y;if(a.utils.initSVG(q),v=a.utils.availableWidth(k,q,b),u=a.utils.availableHeight(l,q,b),d.update=function(){q.call(d)},d.container=this,!p||!p.length)return a.utils.noData(d,q),d;q.selectAll('.nv-noData').remove(),w=c.y()(p[p.length-1],p.length-1),i=c.xScale(),o=c.yScale(),t=q.selectAll('g.nv-wrap.nv-sparklineplus').data([p]),B=t.enter().append('g').attr('class','nvd3 nv-wrap nv-sparklineplus'),s=B.append('g'),r=t.select('g'),s.append('g').attr('class','nv-sparklineWrap'),s.append('g').attr('class','nv-valueWrap'),s.append('g').attr('class','nv-hoverArea'),t.attr('transform','translate('+b.left+','+b.top+')'),z=r.select('.nv-sparklineWrap'),c.width(v).height(u),z.call(c),m&&(A=r.select('.nv-valueWrap'),y=A.selectAll('.nv-currentValue').data([w]),y.enter().append('text').attr('class','nv-currentValue').attr('dx',f?-8:8).attr('dy','.9em').style('text-anchor',f?'end':'start'),y.attr('x',v+(f?b.right:0)).attr('y',j?function(a){return o(a)}:0).style('fill',c.color()(p[p.length-1],p.length-1)).text(g(w))),s.select('.nv-hoverArea').append('rect').on('mousemove',C).on('click',function(){h=!h}).on('mouseout',function(){e=[],x()}),r.select('.nv-hoverArea rect').attr('transform',function(a){return'translate('+-b.left+','+-b.top+')'}).attr('width',v+b.left+b.right).attr('height',u+b.top);function x(){var a,d;if(h)return;if(a=r.selectAll('.nv-hoverValue').data(e),d=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('+i(c.x()(p[a],a))+',0)'}).transition().duration(250).style('stroke-opacity',1).style('fill-opacity',1),!e.length)return;d.append('line').attr('x1',0).attr('y1',-b.top).attr('x2',0).attr('y2',u),d.append('text').attr('class','nv-xValue').attr('x',-6).attr('y',-b.top).attr('text-anchor','end').attr('dy','.9em'),r.select('.nv-hoverValue .nv-xValue').text(n(c.x()(p[e[0]],e[0]))),d.append('text').attr('class','nv-yValue').attr('x',6).attr('y',-b.top).attr('text-anchor','start').attr('dy','.9em'),r.select('.nv-hoverValue .nv-yValue').text(g(c.y()(p[e[0]],e[0])))}function C(){if(h)return;var a=d3.mouse(this)[0]-b.left;function d(b,d){for(var e=Math.abs(c.x()(b[0],0)-d),f=0,a=0;a<b.length;a++)Math.abs(c.x()(b[a],a)-d)<e&&(e=Math.abs(c.x()(b[a],a)-d),f=a);return f}e=[d(p,Math.round(i.invert(a)))],x()}}),d}return d.sparkline=c,d.options=a.utils.optionsFunc.bind(d),d._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},xTickFormat:{get:function(){return n},set:function(a){n=a}},yTickFormat:{get:function(){return g},set:function(a){g=a}},showLastValue:{get:function(){return m},set:function(a){m=a}},alignValue:{get:function(){return j},set:function(a){j=a}},rightAlignValue:{get:function(){return f},set:function(a){f=a}},noData:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return b},set:function(a){b.top=a.top!==void 0?a.top:b.top,b.right=a.right!==void 0?a.right:b.right,b.bottom=a.bottom!==void 0?a.bottom:b.bottom,b.left=a.left!==void 0?a.left:b.left}}}),a.utils.inheritOptions(d,c),a.utils.initOptions(d),d},a.models.stackedArea=function(){"use strict";var d={top:0,right:0,bottom:0,left:0},q=960,s=500,l=a.utils.defaultColor(),j=Math.floor(Math.random()*1e5),t=null,h=function(a){return a.x},m=function(a){return a.y},r='stack',p='zero',u='default',i='linear',n=!1,o,k,c=a.models.scatter(),f=250,e=d3.dispatch('areaClick','areaMouseover','areaMouseout','renderEnd','elementClick','elementMouseover','elementMouseout'),g;c.pointSize(2.2).pointDomain([2.2,2.2]),g=a.utils.renderWatch(e,f);function b(f){return g.reset(),g.models(c),f.each(function(f){var B=q-d.left-d.right,z=s-d.top-d.bottom,x,C,v,y,G,A,r,D,E,F,w;t=d3.select(this),a.utils.initSVG(t),o=c.xScale(),k=c.yScale(),x=f,f.forEach(function(a,b){a.seriesIndex=b,a.values=a.values.map(function(a,c){return a.index=c,a.seriesIndex=b,a})}),C=f.filter(function(a){return!a.disabled}),f=d3.layout.stack().order(u).offset(p).values(function(a){return a.values}).x(h).y(m).out(function(a,b,c){a.display={y:c,y0:b}})(C),v=t.selectAll('g.nv-wrap.nv-stackedarea').data([f]),y=v.enter().append('g').attr('class','nvd3 nv-wrap nv-stackedarea'),G=y.append('defs'),A=y.append('g'),r=v.select('g'),A.append('g').attr('class','nv-areaWrap'),A.append('g').attr('class','nv-scatterWrap'),v.attr('transform','translate('+d.left+','+d.top+')'),c.forceY().length==0&&c.forceY().push(0),c.width(B).height(z).x(h).y(function(a){return a.display.y+a.display.y0}).forceY([0]).color(f.map(function(a,b){return a.color||l(a,a.seriesIndex)})),D=r.select('.nv-scatterWrap').datum(f),D.call(c),G.append('clipPath').attr('id','nv-edge-clip-'+j).append('rect'),v.select('#nv-edge-clip-'+j+' rect').attr('width',B).attr('height',z),r.attr('clip-path',n?'url(#nv-edge-clip-'+j+')':''),E=d3.svg.area().x(function(a,b){return o(h(a,b))}).y0(function(a){return k(a.display.y0)}).y1(function(a){return k(a.display.y+a.display.y0)}).interpolate(i),F=d3.svg.area().x(function(a,b){return o(h(a,b))}).y0(function(a){return k(a.display.y0)}).y1(function(a){return k(a.display.y0)}),w=r.select('.nv-areaWrap').selectAll('path.nv-area').data(function(a){return a}),w.enter().append('path').attr('class',function(b,a){return'nv-area nv-area-'+a}).attr('d',function(a,b){return F(a.values,a.seriesIndex)}).on('mouseover',function(a,b){d3.select(this).classed('hover',!0),e.areaMouseover({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on('mouseout',function(a,b){d3.select(this).classed('hover',!1),e.areaMouseout({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on('click',function(a,b){d3.select(this).classed('hover',!1),e.areaClick({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}),w.exit().remove(),w.style('fill',function(a,b){return a.color||l(a,a.seriesIndex)}).style('stroke',function(a,b){return a.color||l(a,a.seriesIndex)}),w.watchTransition(g,'stackedArea path').attr('d',function(a,b){return E(a.values,b)}),c.dispatch.on('elementMouseover.area',function(a){r.select('.nv-chart-'+j+' .nv-area-'+a.seriesIndex).classed('hover',!0)}),c.dispatch.on('elementMouseout.area',function(a){r.select('.nv-chart-'+j+' .nv-area-'+a.seriesIndex).classed('hover',!1)}),b.d3_stackedOffset_stackPercent=function(c){var e=c.length,f=c[0].length,a,b,d,g=[];for(b=0;b<f;++b){for(a=0,d=0;a<x.length;a++)d+=m(x[a].values[b]);if(d)for(a=0;a<e;a++)c[a][b][1]/=d;else for(a=0;a<e;a++)c[a][b][1]=0}for(b=0;b<f;++b)g[b]=0;return g}}),g.renderEnd('stackedArea immediate'),b}return b.dispatch=e,b.scatter=c,c.dispatch.on('elementClick',function(){e.elementClick.apply(this,arguments)}),c.dispatch.on('elementMouseover',function(){e.elementMouseover.apply(this,arguments)}),c.dispatch.on('elementMouseout',function(){e.elementMouseout.apply(this,arguments)}),b.interpolate=function(a){return arguments.length?(i=a,b):i},b.duration=function(a){return arguments.length?(f=a,g.reset(f),c.duration(f),b):f},b.dispatch=e,b.scatter=c,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return q},set:function(a){q=a}},height:{get:function(){return s},set:function(a){s=a}},clipEdge:{get:function(){return n},set:function(a){n=a}},offset:{get:function(){return p},set:function(a){p=a}},order:{get:function(){return u},set:function(a){u=a}},interpolate:{get:function(){return i},set:function(a){i=a}},x:{get:function(){return h},set:function(a){h=d3.functor(a)}},y:{get:function(){return m},set:function(a){m=d3.functor(a)}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},color:{get:function(){return l},set:function(b){l=a.utils.getColor(b)}},style:{get:function(){return r},set:function(a){switch(r=a,r){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');break}}},duration:{get:function(){return f},set:function(a){f=a,g.reset(f),c.duration(f)}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.stackedAreaChart=function(){"use strict";var c=a.models.stackedArea(),i=a.models.axis(),f=a.models.axis(),g=a.models.legend(),m=a.models.legend(),h=a.interactiveGuideline(),j=a.models.tooltip(),d={top:30,right:25,bottom:50,left:60},C=null,q=null,s=a.utils.defaultColor(),v=!0,z=!0,y=!0,w=!0,r=!1,B=!1,e=a.utils.state(),p=null,E=null,l=d3.dispatch('stateChange','changeState','renderEnd'),A=250,x=['Stacked','Stream','Expanded'],n={},k=250,D,H,u,t,o,F,I,J,G;e.style=c.style(),i.orient('bottom').tickPadding(7),f.orient(r?'right':'left'),j.headerFormatter(function(a,b){return i.tickFormat()(a,b)}).valueFormatter(function(a,b){return f.tickFormat()(a,b)}),h.tooltip.headerFormatter(function(a,b){return i.tickFormat()(a,b)}).valueFormatter(function(a,b){return f.tickFormat()(a,b)}),u=null,t=null,m.updateState(!1),o=a.utils.renderWatch(l),F=c.style(),I=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),style:c.style()}}},J=function(a){return function(b){b.style!==void 0&&(F=b.style),b.active!==void 0&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},G=d3.format('%');function b(j){return o.reset(),o.models(c),y&&o.models(i),w&&o.models(f),j.each(function(j){var o=d3.select(this),T=this,K,L,N,P,M,E,R,O,U,Q,S;if(a.utils.initSVG(o),K=a.utils.availableWidth(C,o,d),L=a.utils.availableHeight(q,o,d),b.update=function(){o.transition().duration(k).call(b)},b.container=this,e.setter(J(j),b.update).getter(I(j)).update(),e.disabled=j.map(function(a){return!!a.disabled}),!p){p={};for(N in e)e[N]instanceof Array?p[N]=e[N].slice(0):p[N]=e[N]}if(!j||!j.length||!j.filter(function(a){return a.values.length}).length)return a.utils.noData(b,o),b;o.selectAll('.nv-noData').remove(),D=c.xScale(),H=c.yScale(),P=o.selectAll('g.nv-wrap.nv-stackedAreaChart').data([j]),M=P.enter().append('g').attr('class','nvd3 nv-wrap nv-stackedAreaChart').append('g'),E=P.select('g'),M.append("rect").style("opacity",0),M.append('g').attr('class','nv-x nv-axis'),M.append('g').attr('class','nv-y nv-axis'),M.append('g').attr('class','nv-stackedWrap'),M.append('g').attr('class','nv-legendWrap'),M.append('g').attr('class','nv-controlsWrap'),M.append('g').attr('class','nv-interactive'),E.select("rect").attr("width",K).attr("height",L),z&&(R=v?K-A:K,g.width(R),E.select('.nv-legendWrap').datum(j).call(g),d.top!=g.height()&&(d.top=g.height(),L=a.utils.availableHeight(q,o,d)),E.select('.nv-legendWrap').attr('transform','translate('+(K-R)+','+-d.top+')')),v&&(O=[{key:n.stacked||'Stacked',metaKey:'Stacked',disabled:c.style()!='stack',style:'stack'},{key:n.stream||'Stream',metaKey:'Stream',disabled:c.style()!='stream',style:'stream'},{key:n.expanded||'Expanded',metaKey:'Expanded',disabled:c.style()!='expand',style:'expand'},{key:n.stack_percent||'Stack %',metaKey:'Stack_Percent',disabled:c.style()!='stack_percent',style:'stack_percent'}],A=x.length/3*260,O=O.filter(function(a){return x.indexOf(a.metaKey)!==-1}),m.width(A).color(['#444','#444','#444']),E.select('.nv-controlsWrap').datum(O).call(m),d.top!=Math.max(m.height(),g.height())&&(d.top=Math.max(m.height(),g.height()),L=a.utils.availableHeight(q,o,d)),E.select('.nv-controlsWrap').attr('transform','translate(0,'+-d.top+')')),P.attr('transform','translate('+d.left+','+d.top+')'),r&&E.select(".nv-y.nv-axis").attr("transform","translate("+K+",0)"),B&&(h.width(K).height(L).margin({left:d.left,top:d.top}).svgContainer(o).xScale(D),P.select(".nv-interactive").call(h)),c.width(K).height(L),U=E.select('.nv-stackedWrap').datum(j),U.transition().call(c),y&&(i.scale(D)._ticks(a.utils.calcTicksX(K/100,j)).tickSize(-L,0),E.select('.nv-x.nv-axis').attr('transform','translate(0,'+L+')'),E.select('.nv-x.nv-axis').transition().duration(0).call(i)),w&&(c.offset()==='wiggle'?Q=0:Q=a.utils.calcTicksY(L/36,j),f.scale(H)._ticks(Q).tickSize(-K,0),c.style()==='expand'||c.style()==='stack_percent'?(S=f.tickFormat(),(!u||S!==G)&&(u=S),f.tickFormat(G)):u&&(f.tickFormat(u),u=null),E.select('.nv-y.nv-axis').transition().duration(0).call(f)),c.dispatch.on('areaClick.toggle',function(a){j.filter(function(a){return!a.disabled}).length===1?j.forEach(function(a){a.disabled=!1}):j.forEach(function(b,c){b.disabled=c!=a.seriesIndex}),e.disabled=j.map(function(a){return!!a.disabled}),l.stateChange(e),b.update()}),g.dispatch.on('stateChange',function(a){for(var c in a)e[c]=a[c];l.stateChange(e),b.update()}),m.dispatch.on('legendClick',function(a,d){if(!a.disabled)return;O=O.map(function(a){return a.disabled=!0,a}),a.disabled=!1,c.style(a.style),e.style=c.style(),l.stateChange(e),b.update()}),h.dispatch.on('elementMousemove',function(o){var m,e,g,f,k,q,n,p,l;c.clearHighlights(),f=[],j.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(h,k){var d,i,j;if(e=a.interactiveBisect(h.values,o.pointXValue,b.x()),d=h.values[e],i=b.y()(d,e),i!=null&&c.highlightPoint(k,e,!0),typeof d=='undefined')return;typeof m=='undefined'&&(m=d),typeof g=='undefined'&&(g=b.xScale()(b.x()(d,e))),j=c.style()=='expand'?d.display.y:b.y()(d,e),f.push({key:h.key,value:j,color:s(h,h.seriesIndex),stackedValue:d.display})}),f.reverse(),f.length>2&&(k=b.yScale().invert(o.mouseY),q=1/0,n=null,f.forEach(function(b,d){var a,c;if(k=Math.abs(k),a=Math.abs(b.stackedValue.y0),c=Math.abs(b.stackedValue.y),k>=a&&k<=c+a){n=d;return}}),n!=null&&(f[n].highlight=!0)),p=i.tickFormat()(b.x()(m,e)),l=h.tooltip.valueFormatter(),c.style()==='expand'||c.style()==='stack_percent'?(t||(t=l),l=d3.format(".1%")):t&&(l=t,t=null),h.tooltip.position({left:g+d.left,top:o.mouseY+d.top}).chartContainer(T.parentNode).valueFormatter(l).data({value:p,series:f})(),h.renderGuideLine(g)}),h.dispatch.on("elementMouseout",function(a){c.clearHighlights()}),l.on('changeState',function(a){typeof a.disabled!='undefined'&&j.length===a.disabled.length&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),e.disabled=a.disabled),typeof a.style!='undefined'&&(c.style(a.style),F=a.style),b.update()})}),o.renderEnd('stacked Area chart immediate'),b}return c.dispatch.on('elementMouseover.tooltip',function(a){a.point.x=c.x()(a.point),a.point.y=c.y()(a.point),j.data(a).position(a.pos).hidden(!1)}),c.dispatch.on('elementMouseout.tooltip',function(a){j.hidden(!0)}),b.dispatch=l,b.stacked=c,b.legend=g,b.controls=m,b.xAxis=i,b.yAxis=f,b.interactiveLayer=h,b.tooltip=j,b.dispatch=l,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return C},set:function(a){C=a}},height:{get:function(){return q},set:function(a){q=a}},showLegend:{get:function(){return z},set:function(a){z=a}},showXAxis:{get:function(){return y},set:function(a){y=a}},showYAxis:{get:function(){return w},set:function(a){w=a}},defaultState:{get:function(){return p},set:function(a){p=a}},noData:{get:function(){return E},set:function(a){E=a}},showControls:{get:function(){return v},set:function(a){v=a}},controlLabels:{get:function(){return n},set:function(a){n=a}},controlOptions:{get:function(){return x},set:function(a){x=a}},tooltips:{get:function(){return j.enabled()},set:function(b){a.deprecated('tooltips','use chart.tooltip.enabled() instead'),j.enabled(!!b)}},tooltipContent:{get:function(){return j.contentGenerator()},set:function(b){a.deprecated('tooltipContent','use chart.tooltip.contentGenerator() instead'),j.contentGenerator(b)}},margin:{get:function(){return d},set:function(a){d.top=a.top!==void 0?a.top:d.top,d.right=a.right!==void 0?a.right:d.right,d.bottom=a.bottom!==void 0?a.bottom:d.bottom,d.left=a.left!==void 0?a.left:d.left}},duration:{get:function(){return k},set:function(a){k=a,o.reset(k),c.duration(k),i.duration(k),f.duration(k)}},color:{get:function(){return s},set:function(b){s=a.utils.getColor(b),g.color(s),c.color(s)}},rightAlignYAxis:{get:function(){return r},set:function(a){r=a,f.orient(r?'right':'left')}},useInteractiveGuideline:{get:function(){return B},set:function(a){B=!!a,b.interactive(!a),b.useVoronoi(!a),c.scatter.interactive(!a)}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.sunburst=function(){"use strict";var b={top:0,right:0,bottom:0,left:0},o=null,l=null,m="count",q={count:function(a){return 1},size:function(a){return a.size}},k=Math.floor(Math.random()*1e4),e=null,n=a.utils.defaultColor(),j=500,h=d3.dispatch('chartClick','elementClick','elementDblClick','elementMousemove','elementMouseover','elementMouseout','renderEnd'),g=d3.scale.linear().range([0,2*Math.PI]),f=d3.scale.sqrt(),t=d3.layout.partition().sort(null).value(function(a){return 1}),i=d3.svg.arc().startAngle(function(a){return Math.max(0,Math.min(2*Math.PI,g(a.x)))}).endAngle(function(a){return Math.max(0,Math.min(2*Math.PI,g(a.x+a.dx)))}).innerRadius(function(a){return Math.max(0,f(a.y))}).outerRadius(function(a){return Math.max(0,f(a.y+a.dy))}),s=a.utils.renderWatch(h),p,r,c;function d(u){return s.reset(),u.each(function(s){var u,v,w,d,x,y,z;e=d3.select(this),u=a.utils.availableWidth(o,e,b),v=a.utils.availableHeight(l,e,b),w=Math.min(u,v)/2,a.utils.initSVG(e),x=e.selectAll('.nv-wrap.nv-sunburst').data(s),y=x.enter().append('g').attr('class','nvd3 nv-wrap nv-sunburst nv-chart-'+k),z=y.selectAll('nv-sunburst'),x.attr('transform','translate('+u/2+','+v/2+')'),e.on('click',function(a,b){h.chartClick({data:a,index:b,pos:d3.event,id:k})}),f.range([0,w]),c=c||s,r=s[0],t.value(q[m]||q.count),d=z.data(t.nodes).enter().append("path").attr("d",i).style("fill",function(a){return n((a.children?a:a.parent).name)}).style("stroke","#FFF").on("click",function(a){p!==c&&c!==a&&(p=c),c=a,d.transition().duration(j).attrTween("d",B(a))}).each(A).on("dblclick",function(a){p.parent==a&&d.transition().duration(j).attrTween("d",B(r))}).each(A).on('mouseover',function(a,b){d3.select(this).classed('hover',!0).style('opacity',.8),h.elementMouseover({data:a,color:d3.select(this).style("fill")})}).on('mouseout',function(a,b){d3.select(this).classed('hover',!1).style('opacity',1),h.elementMouseout({data:a})}).on('mousemove',function(a,b){h.elementMousemove({data:a})});function A(a){a.x0=a.x,a.dx0=a.dx}function C(a,d){var e=d3.interpolate({x:a.x0,dx:a.dx0},a),f;function b(c){var b=e(c);return a.x0=b.x,a.dx0=b.dx,i(b)}return d==0?(f=d3.interpolate(g.domain(),[c.x,c.x+c.dx]),function(a){return g.domain(f(a)),b(a)}):b}function B(a){var b=d3.interpolate(g.domain(),[a.x,a.x+a.dx]),c=d3.interpolate(f.domain(),[a.y,1]),d=d3.interpolate(f.range(),[a.y?20:0,w]);return function(a,e){return e?function(b){return i(a)}:function(e){return g.domain(b(e)),f.domain(c(e)).range(d(e)),i(a)}}}}),s.renderEnd('sunburst immediate'),d}return d.dispatch=h,d.options=a.utils.optionsFunc.bind(d),d._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return l},set:function(a){l=a}},mode:{get:function(){return m},set:function(a){m=a}},id:{get:function(){return k},set:function(a){k=a}},duration:{get:function(){return j},set:function(a){j=a}},margin:{get:function(){return b},set:function(a){b.top=a.top!=void 0?a.top:b.top,b.right=a.right!=void 0?a.right:b.right,b.bottom=a.bottom!=void 0?a.bottom:b.bottom,b.left=a.left!=void 0?a.left:b.left}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b)}}}),a.utils.initOptions(d),d},a.models.sunburstChart=function(){"use strict";var d=a.models.sunburst(),f=a.models.tooltip(),c={top:30,right:20,bottom:20,left:20},l=null,m=null,h=a.utils.defaultColor(),n=Math.round(Math.random()*1e5),j=null,k=null,e=250,i=d3.dispatch('tooltipShow','tooltipHide','stateChange','changeState','renderEnd'),g=a.utils.renderWatch(i);f.headerEnabled(!1).duration(0).valueFormatter(function(a,b){return a});function b(f){return g.reset(),g.models(d),f.each(function(g){var f=d3.select(this),p,j,k,h,n,o,i;if(a.utils.initSVG(f),p=this,j=a.utils.availableWidth(l,f,c),k=a.utils.availableHeight(m,f,c),b.update=function(){e===0?f.call(b):f.transition().duration(e).call(b)},b.container=this,!g||!g.length)return a.utils.noData(b,f),b;f.selectAll('.nv-noData').remove(),h=f.selectAll('g.nv-wrap.nv-sunburstChart').data(g),n=h.enter().append('g').attr('class','nvd3 nv-wrap nv-sunburstChart').append('g'),o=h.select('g'),n.append('g').attr('class','nv-sunburstWrap'),h.attr('transform','translate('+c.left+','+c.top+')'),d.width(j).height(k),i=o.select('.nv-sunburstWrap').datum(g),d3.transition(i).call(d)}),g.renderEnd('sunburstChart immediate'),b}return d.dispatch.on('elementMouseover.tooltip',function(a){a.series={key:a.data.name,value:a.data.size,color:a.color},f.data(a).hidden(!1)}),d.dispatch.on('elementMouseout.tooltip',function(a){f.hidden(!0)}),d.dispatch.on('elementMousemove.tooltip',function(a){f.position({top:d3.event.pageY,left:d3.event.pageX})()}),b.dispatch=i,b.sunburst=d,b.tooltip=f,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return k},set:function(a){k=a}},defaultState:{get:function(){return j},set:function(a){j=a}},color:{get:function(){return h},set:function(a){h=a,d.color(h)}},duration:{get:function(){return e},set:function(a){e=a,g.reset(e),d.duration(e)}},margin:{get:function(){return c},set:function(a){c.top=a.top!==void 0?a.top:c.top,c.right=a.right!==void 0?a.right:c.right,c.bottom=a.bottom!==void 0?a.bottom:c.bottom,c.left=a.left!==void 0?a.left:c.left}}}),a.utils.inheritOptions(b,d),a.utils.initOptions(b),b},a.version="1.8.1"})()
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0.16 |
proxy
|
phpinfo
|
Settings