diff --git a/build/nv.d3.js b/build/nv.d3.js index 1f92c778f..799ae333a 100644 --- a/build/nv.d3.js +++ b/build/nv.d3.js @@ -6719,18 +6719,22 @@ Check equality of 2 array wrapEnter.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')'); var gEnter = wrapEnter.append('g'); - var g = gEnter.select('g'); + var g = gEnter; var backgroundAppend=gEnter.append('g').attr('class', 'nv-background').append('rect'); - var xAxisAppend=gEnter.append('g').attr('class', 'nv-x nv-axis'); - xAxisAppend = container.selectAll('g.nv-wrap.nv-focus').select('.nv-x'); - var yAxisAppend=gEnter.append('g').attr('class', 'nv-y nv-axis'); + var xAxisAppendFocus=gEnter.append('g').attr('class', 'nv-x nv-axis'); + xAxisAppendFocus= container.selectAll('.nv-focus').select('.nv-x.nv-axis'); + var yAxisAppendFocus=gEnter.append('g').attr('class', 'nv-y nv-axis'); + yAxisAppendFocus=container.selectAll('.nv-focus').select('.nv-x.nv-axis'); var contentWrapAppend=gEnter.append('g').attr('class', 'nv-contentWrap'); + contentWrapAppend=container.selectAll('.nv-focus').select('.nv-contentWrap'); var brushBackgroundAppend=gEnter.append('g').attr('class', 'nv-brushBackground'); + brushBackgroundAppend=container.selectAll('.nv-focus').select('.nv-brushBackground'); var xBrushAppend=gEnter.append('g').attr('class', 'nv-x nv-brush'); + xBrushAppend=container.selectAll('.nv-focus').select('.nv-x.nv-brush'); if (rightAlignYAxis) { - yAxisAppend + yAxisAppendFocus .attr("transform", "translate(" + availableWidth + ",0)"); } @@ -6802,9 +6806,9 @@ Check equality of 2 array xAxis .tickSizeInner(-availableHeight); - xAxisAppend + xAxisAppendFocus .attr('transform', 'translate(0,' + y.range()[0] + ')'); - var xs=d3.transition(xAxisAppend) + var xs=xAxisAppendFocus.transition() .call(xAxis); //xs.merge(xAxisAppend); } @@ -6816,7 +6820,7 @@ Check equality of 2 array yAxis .tickSizeInner( -availableWidth); - var ys=yAxisAppend + var ys=xAxisAppendFocus .call(yAxis); //ys.merge(yAxisAppend); } @@ -6867,13 +6871,13 @@ Check equality of 2 array } - function onBrush(event, shouldDispatch) { - brushExtent = event.selection === null ? null : brush.extent(); - var extent = event.selection === null ? x.domain() : brush.extent(); - dispatch.call('brush', this, {extent: extent, brush: brush}); + function onBrush(shouldDispatch) { + brushExtent = brush.extent().length ? brush.extent() : null; + var extent = brush.extent().length ? brush.extent() : x.domain(); + dispatch.call('brush', null, {extent: extent, brush: brush}); updateBrushBG(); if (shouldDispatch) { - dispatch.call('brush', this, extent); + dispatch.call('brush', null, extent); } } }); @@ -10120,7 +10124,7 @@ Options for chart: var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-lineChart'); var gEnter = wrapEnter.append('g'); - var g = gEnter.select('g'); + var g = gEnter; var legendWrapAppend=gEnter.append('g').attr('class', 'nv-legendWrap'); legendWrapAppend = container.selectAll('g.nv-wrap.nv-lineChart').select('.nv-legendWrap'); @@ -10249,9 +10253,9 @@ Options for chart: .style('display', focusEnable ? 'initial' : 'none') .attr('transform', 'translate(0,' + ( availableHeight + margin.bottom + focus.margin().top) + ')') .call(focus); - //s.merge(gEnter); + // s.merge(gEnter); var extent = focus.brush.extent()=== null ? focus.xDomain() : focus.brush.extent(); - if (extent !== null) { + if (extent !== null && extent.length) { onBrush(extent); } } @@ -10951,14 +10955,14 @@ Options for chart: function updateBrushBG(event) { - if (!(event.selection === null)) brush.extent(brushExtent); + if (!(event === null)) brush.extent(brushExtent); brushBG - .data([event.selection === null ? x2.domain() : brushExtent]) - .each(function(d,i) { - var leftWidth = x2(d[0]) - x2.range()[0], - rightWidth = x2.range()[1] - x2(d[1]); + .data([event === null ? x2.domain() : brushExtent]) + .each(function(d, i) { + var leftWidth = x2(d[0]) - x2.range()[0]; + var rightWidth = x2.range()[1] - x2(d[1]); d3.select(this).select('.left') - .attr('width', leftWidth < 0 ? 0 : leftWidth); + .attr('width', leftWidth < 0 ? 0 : leftWidth); d3.select(this).select('.right') .attr('x', x2(d[1])) @@ -10967,9 +10971,9 @@ Options for chart: } function onBrush(event) { - brushExtent = event.selection === null ? null : brush.extent(); - extent = event.selection === null ? x2.domain() : brush.extent(); - dispatch.call('brush', this, {extent: extent, brush: brush}); + brushExtent = event === null ? null : event.selection; + var extent = event === null ? x.domain() : event.selection; + dispatch.call('brush', this, { extent: extent, brush: brush }); updateBrushBG(event); // Prepare Main (Focus) Bars and Lines @@ -16764,16 +16768,20 @@ Options for chart: chart._calls = new function() { this.clearHighlights = function () { nv.dom.write(function() { - container.selectAll(".nv-point.hover").classed("hover", false); + if(container) { + container.selectAll(".nv-point.hover").classed("hover", false); + } }); return null; }; this.highlightPoint = function (seriesIndex, pointIndex, isHoverOver) { nv.dom.write(function() { - container.select('.nv-groups') - .selectAll(".nv-series-" + seriesIndex) - .selectAll(".nv-point-" + pointIndex) - .classed("hover", isHoverOver); + if(container) { + container.select('.nv-groups') + .selectAll(".nv-series-" + seriesIndex) + .selectAll(".nv-point-" + pointIndex) + .classed("hover", isHoverOver); + } }); }; }; @@ -18360,7 +18368,7 @@ Options for chart: .attr('transform', 'translate(0,' + ( availableHeight + margin.bottom + focus.margin().top) + ')') .datum(data.filter(function(d) { return !d.disabled; })) .call(focus); - var extent = (d3.event==null || d3.event.selection === null) ? focus.xDomain() : focus.brush.extent(); + var extent = (d3.event==null || d3.event.selection === null) ? focus.xDomain() : focus.brush.selection(); if(extent !== null){ onBrush(extent); } @@ -19233,6 +19241,6 @@ Options for chart: }; - nv.version = "1.8.9"; + nv.version = "1.8.10"; })(); //# sourceMappingURL=nv.d3.js.map diff --git a/build/nv.d3.min.js b/build/nv.d3.min.js index 846e88734..3ff125d71 100644 --- a/build/nv.d3.min.js +++ b/build/nv.d3.min.js @@ -1 +1 @@ -!function(){var t={};t.dev=!1,t.tooltip=t.tooltip||{},t.utils=t.utils||{},t.models=t.models||{},t.charts={},t.logs={},t.dom={},"undefined"!=typeof module&&"undefined"!=typeof exports&&"undefined"==typeof d3&&(d3=require("d3")),t.dispatch=d3.dispatch("start","end"),d3.functor=function t(e){return"function"==typeof e?e:function(){return e}},d3.rebind=function t(e,n,r){return function(){var t=r.apply(n,arguments);return t===n?e:t}},Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),t.dev&&(t.dispatch.on("start",function(e){t.logs.startTime=+new Date}),t.dispatch.on("end",function(e){t.logs.endTime=+new Date,t.logs.totalTime=t.logs.endTime-t.logs.startTime,t.log("total",t.logs.totalTime)})),t.log=function(){return t.dev&&window.console&&console.log&&console.log.apply?console.log.apply(console,arguments):t.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind&&Function.prototype.bind.call(console.log,console).apply(console,arguments),arguments[arguments.length-1]},t.deprecated=function(t,e){console&&console.warn&&console.warn("nvd3 warning: `"+t+"` has been deprecated. ",e||"")},t.render=function e(n){n=n||1,t.render.active=!0,t.dispatch.call("start");var r=function(){for(var e,i,o=0;oh||r>g||void 0===t.target||s){if(u&&t.target&&(void 0===t.target.className||t.target.className.match(l.nvPointerEventsClass)))return;o.call("elementMouseout",this,{mouseX:n,mouseY:r}),c.renderGuideLine(null),l.hidden(!0);return}l.hidden(!1);var f="function"==typeof i.rangeBands,p=void 0;if(f){var v=d3.bisect(i.range(),n)-1;if(i.range()[v]+i.rangeBand()>=n)p=i.domain()[d3.bisect(i.range(),n)-1];else{o.call("elementMouseout",this,{mouseX:n,mouseY:r}),c.renderGuideLine(null),l.hidden(!0);return}}else p=i.invert(n);if("mousemove"===t.type&&o.call("elementMousemove",this,{mouseX:n,mouseY:r,pointXValue:p}),"dblclick"===t.type&&o.call("elementDblclick",this,{mouseX:n,mouseY:r,pointXValue:p}),"click"===t.type&&o.call("elementClick",this,{mouseX:n,mouseY:r,pointXValue:p}),"mousedown"===t.type&&o.call("elementMouseDown",this,{mouseX:n,mouseY:r,pointXValue:p}),"mouseup"===t.type&&o.call("elementMouseUp",this,{mouseX:n,mouseY:r,pointXValue:p}),"touchmove"===t.type){l.hidden(!0);return}}d3.select(this).selectAll("g.nv-wrap.nv-interactiveLineLayer").data([f]).enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer").append("g").attr("class","nv-interactiveGuideLine"),s&&(s.on("touchmove",v).on("mousemove",v,!0).on("mouseout",v,!0).on("mousedown",v,!0).on("mouseup",v,!0).on("dblclick",v).on("click",v),c.guideLine=null,c.renderGuideLine=function(e){a&&p.select(".nv-interactiveGuideLine").selectAll("line").data(null!=e?[t.utils.NaNtoZero(e)]:[],String).join(t=>t.append("line").attr("class","nv-guideline"),t=>t,t=>t.remove()).attr("x1",function(t){return t}).attr("x2",function(t){return t}).attr("y1",g).attr("y2",0)})})}return l.duration(0).hideDelay(0).hidden(!1),c.dispatch=o,c.tooltip=l,c.margin=function(t){return arguments.length?(e.top=void 0!==t.top?t.top:e.top,e.left=void 0!==t.left?t.left:e.left,c):e},c.width=function(t){return arguments.length?(n=t,c):n},c.height=function(t){return arguments.length?(r=t,c):r},c.xScale=function(t){return arguments.length?(i=t,c):i},c.showGuideLine=function(t){return arguments.length?(a=t,c):a},c.svgContainer=function(t){return arguments.length?(s=t,c):s},c},t.interactiveBisect=function(t,e,n){"use strict";if(!(t instanceof Array))return null;r="function"!=typeof n?function(t){return t.x}:n;var r,i=function(t,e){return r(t)-e},o=d3.bisector(i).left,a=d3.max([0,o(t,e)-1]),s=r(t[a]);if(void 0===s&&(s=a),s===e)return a;var l=d3.min([a+1,t.length-1]),u=r(t[l]);return(void 0===u&&(u=l),Math.abs(u-e)>=Math.abs(s-e))?a:l},t.nearestValueIndex=function(t,e,n){"use strict";var r=1/0,i=null;return t.forEach(function(t,o){var a=Math.abs(e-t);null!=t&&a<=r&&a"+t.footer+""),i},b=function(){var t=getCoordinates(),e={left:t.mouseX,top:t.mouseY};if("none"!=getComputedStyle(document.body).transform){var n=document.body.getBoundingClientRect();e.left-=n.left,e.top-=n.top}return e},_=function(e){if(e&&e.series){if(t.utils.isArray(e.series))return!0;if(t.utils.isObject(e.series))return e.series=[e.series],!0}return!1},k=function(t){var e,n,o,a=u.node()?u.node().offsetHeight:0,s=u.node()?u.node().offsetWidth:0,l=document.documentElement.clientWidth;switch(r){case"e":e=-s-i,n=-(a/2),t.left+e<0&&(e=i),(o=t.top+n)<0&&(n-=o);break;case"w":e=i,n=-(a/2),t.left+e+s>l&&(e=-s-i),(o=t.top+n)<0&&(n-=o);break;case"n":e=-(s/2)-5,n=i,(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"s":e=-(s/2),n=-a-i,t.top+n<0&&(n=i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"center":e=-(s/2),n=-(a/2);break;default:e=0,n=0}return{left:e,top:n}},w=function(){t.dom.read(function(){let t=b(),e=k(t),n=t.left+e.left,r=t.top+e.top;if(s)u.interrupt().transition().delay(l).duration(0).style("opacity",0);else if(u){let i="translate("+c.left+"px, "+c.top+"px)",o="translate("+Math.round(n)+"px, "+Math.round(r)+"px)",a=d3.interpolateString(i,o),f=.1>parseFloat(u.style.opacity),h=d3.transition().duration(f?0:p).ease(d3.easeLinear);u.interrupt().transition(h).styleTween("transform",function(){return a},"important").styleTween("-webkit-transform",function(){return a}).style("-ms-transform",o).style("opacity",1)}c.left=n,c.top=r})};function A(){if(f&&_(n))return t.dom.write(function(){u&&u.node()||((u=d3.select(document.body).selectAll("#"+e).data([1])).enter().append("div").attr("class","nvtooltip "+(a||"xy-tooltip")).attr("id",e).style("top",0).style("left",0).style("opacity",0).style("position","absolute").selectAll("div, table, td, tr").classed(v,!0).classed(v,!0),u.exit().remove());var t=y(n,u.node());t&&u.node()&&(u.node().innerHTML=t),w()}),A}return A.nvPointerEventsClass=v,A.options=t.utils.optionsFunc.bind(A),A._options=Object.create({},{duration:{get:function(){return p},set:function(t){p=t}},gravity:{get:function(){return r},set:function(t){r=t}},distance:{get:function(){return i},set:function(t){i=t}},snapDistance:{get:function(){return o},set:function(t){o=t}},classes:{get:function(){return a},set:function(t){a=t}},enabled:{get:function(){return f},set:function(t){f=t}},hideDelay:{get:function(){return l},set:function(t){l=t,h=d3.transition().delay(l).duration(0)}},contentGenerator:{get:function(){return y},set:function(t){y=t}},valueFormatter:{get:function(){return m},set:function(t){m=t}},headerFormatter:{get:function(){return $},set:function(t){$=t}},keyFormatter:{get:function(){return x},set:function(t){x=t}},headerEnabled:{get:function(){return g},set:function(t){g=t}},position:{get:function(){return b},set:function(t){b=t}},chartContainer:{get:function(){return document.body},set:function(e){t.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(e){t.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(e){t.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return s},set:function(t){s!=t&&(s=!!t,A())}},data:{get:function(){return n},set:function(t){t.point&&(t.value=t.point.x,t.series=t.series||{},t.series.value=t.point.y,t.series.color=t.point.color||t.series.color),n=t}},node:{get:function(){return u.node()},set:function(t){}},id:{get:function(){return e},set:function(t){}}}),t.utils.initOptions(A),A},t.utils.windowSize=function(){var t={width:640,height:480};return window.innerWidth&&window.innerHeight?(t.width=window.innerWidth,t.height=window.innerHeight,t):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(t.width=document.documentElement.offsetWidth,t.height=document.documentElement.offsetHeight,t):(document.body&&document.body.offsetWidth&&(t.width=document.body.offsetWidth,t.height=document.body.offsetHeight),t)},t.utils.isArray=Array.isArray,t.utils.isObject=function(t){return null!==t&&"object"==typeof t},t.utils.isFunction=function(t){return"function"==typeof t},t.utils.isDate=function(t){return"[object Date]"===toString.call(t)},t.utils.isNumber=function(t){return!isNaN(t)&&"number"==typeof t},t.utils.windowResize=function(e){return window.addEventListener?window.addEventListener("resize",e):t.log("ERROR: Failed to bind to window.resize with: ",e),{callback:e,clear:function(){window.removeEventListener("resize",e)}}},t.utils.getColor=function(e){if(void 0===e||t.utils.isArray(e)&&0===e.length)return t.utils.defaultColor();if(!t.utils.isArray(e))return e;var n=[];if(d3.min(e)===e[0]){n.push(0);for(var r=1;r0;r--)n.push(r);n.push(0)}var i=d3.scaleOrdinal().range(e);return function(t,e){return t.color||i(void 0===e?t:e)}},t.utils.defaultColor=function(){return t.utils.getColor(d3.scaleOrdinal(d3.schemeSet3).range())},t.utils.customTheme=function(e,n,r){n=n||function(t){return t.key};var i=(r=r||d3.scaleOrdinal(d3.schemeAccent).range()).length;return function(o,a){var s=n(o);return t.utils.isFunction(e[s])?e[s]():void 0!==e[s]?e[s]:(i||(i=r.length),r[i-=1])}},t.utils.pjax=function(e,n){var r=function(r){d3.html(r,function(r){var i=d3.select(n).node();i.parentNode.replaceChild(d3.select(r).select(n).node(),i),t.utils.pjax(e,n)})};d3.selectAll(e).on("click",function(t){history.pushState(this.href,this.textContent,this.href),r(this.href),t.preventDefault()}),d3.select(window).on("popstate",function(t){t.state&&r(t.state)})},t.utils.calcApproxTextWidth=function(e){if(t.utils.isFunction(e.style)&&t.utils.isFunction(e.text)){var n=parseInt(e.style("font-size").replace("px",""),10),r=e.text().length;return t.utils.NaNtoZero(r*n*.5)}return 0},t.utils.NaNtoZero=function(e){return!t.utils.isNumber(e)||isNaN(e)||null===e||e===1/0||e===-1/0?0:e},d3.selection.prototype.watchTransition=function(t){var e=[this].concat([].slice.call(arguments,1));return t.transition.apply(t,e)},t.utils.renderWatch=function(e,n){if(!(this instanceof t.utils.renderWatch))return new t.utils.renderWatch(e,n);var r=void 0!==n?n:250,i=[],o=this;this.models=function(t){return t=[].slice.call(arguments,0),t.forEach(function(t){t.__rendered=!1,function(t){t.dispatch.on("renderEnd",function(e){t.__rendered=!0,o.renderEnd("model")})}(t),0>i.indexOf(t)&&i.push(t)}),this},this.reset=function(t){void 0!==t&&(r=t),i=[]},this.transition=function(t,e,n){if(e=arguments.length>1?[].slice.call(arguments,1):[],n=e.length>1?e.pop():void 0!==r?r:250,this.t=d3.transition().duration(n).ease(d3.easeLinear),t.__rendered=!1,0>i.indexOf(t)&&i.push(t),0===n)return t.__rendered=!0,t.delay=function(){return this},t.duration=function(){return this},t;0===t.length?t.__rendered=!0:t.filter(function(t,e){return void 0!==t&&!t.length})?t.__rendered=!0:t.__rendered=!1;var a=0;return t.transition(this.t).each(function(){++a}).on("end",function(n,r){0==--a&&(t.__rendered=!0,o.renderEnd.apply(this,e))})},this.renderEnd=function(){i.every(function(t){return t.__rendered})&&(i.forEach(function(t){t.__rendered=!1}),e.apply("renderEnd",this,arguments))}},t.utils.deepExtend=function(e){var n=arguments.length>1?[].slice.call(arguments,1):[];n.forEach(function(n){for(var r in n){var i=t.utils.isArray(e[r]),o=t.utils.isObject(e[r]),a=t.utils.isObject(n[r]);o&&!i&&a?t.utils.deepExtend(e[r],n[r]):e[r]=n[r]}})},t.utils.state=function(){if(!(this instanceof t.utils.state))return new t.utils.state;var e={},n=function(){},r=function(){return{}},i=null,o=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(t){n(t,!0)}),this.getter=function(t){return r=t,this},this.setter=function(t,e){return e||(e=function(){}),n=function(n,r){t(n),r&&e()},this},this.init=function(e){i=i||{},t.utils.deepExtend(i,e)};var a=function(){var t=r();if(JSON.stringify(t)===JSON.stringify(e))return!1;for(var n in t)void 0===e[n]&&(e[n]={}),e[n]=t[n],o=!0;return!0};this.update=function(){i&&(n(i,!1),i=null),a.call(this)&&this.dispatch.call("change",this,e)}},t.utils.optionsFunc=function(e){return e&&new Map(e).each(((e,n)=>{t.utils.isFunction(this[e])&&this[e](n)}).bind(this)),this},t.utils.calcTicksX=function(e,n){for(var r=1,i=0;ir?o:r}return t.log("Requested number of ticks: ",e),t.log("Calculated max values to be: ",r),e=Math.floor(e=(e=e>r?e=r-1:e)<1?1:e),t.log("Calculating tick count as: ",e),e},t.utils.calcTicksY=function(e,n,r){if(!r)return t.utils.calcTicksX(e,n);for(var i=1,o=0;oi?a:i;return t.log("Requested number of ticks: ",e),t.log("Calculated max values to be: ",i),e=Math.floor(e=(e=e>i?i-1:e)<1?1:e),t.log("Calculating tick count as: ",e),e},t.utils.initOption=function(t,e){t._calls&&t._calls[e]?t[e]=t._calls[e]:(t[e]=function(n){return arguments.length?(t._overrides[e]=!0,t._options[e]=n,t):t._options[e]},t["_"+e]=function(n){return arguments.length?(t._overrides[e]||(t._options[e]=n),t):t._options[e]})},t.utils.initOptions=function(e){e._overrides=e._overrides||{};var n=Object.getOwnPropertyNames(e._options||{}),r=Object.getOwnPropertyNames(e._calls||{});for(var i in n=n.concat(r))t.utils.initOption(e,n[i])},t.utils.inheritOptionsD3=function(e,n,r){e._d3options=r.concat(e._d3options||[]),e._d3options=(e._d3options||[]).filter(function(t,e,n){return n.indexOf(t)===e}),r.unshift(n),r.unshift(e),t.utils.rebind.apply(this,r)},t.utils.arrayUnique=function(t){return t.sort().filter(function(e,n){return!n||e!=t[n-1]})},t.utils.symbolMap=new Map,t.utils.typeMap=new Map().set("circle",d3.symbolCircle).set("cross",d3.symbolCross).set("diamond",d3.symbolDiamond).set("square",d3.symbolSquare).set("star",d3.symbolStar).set("triangle-up",d3.symbolTriangle).set("wye",d3.symbolWye),t.utils.symbol=function(){var e,n=64;function r(r,i){var o=e.call(this,r,i),a=n.call(this,r,i);return void 0===t.utils.symbolMap.get(o)?d3.symbol().type(t.utils.typeMap.get(o)).size(a)():t.utils.symbolMap.get(o)(a)}return r.type=function(t){return arguments.length?(e="function"==typeof t?t:function(){return t},r):e},r.size=function(t){return arguments.length?(n="function"==typeof t?t:function(){return t},r):n},r},t.utils.inheritOptions=function(e,n){var r=Object.getOwnPropertyNames(n._options||{}),i=Object.getOwnPropertyNames(n._calls||{}),o=n._inherited||[],a=n._d3options||[],s=r.concat(i).concat(o).concat(a);s.unshift(n),s.unshift(e),t.utils.rebind.apply(this,s),e._inherited=t.utils.arrayUnique(r.concat(i).concat(o).concat(r).concat(e._inherited||[])),e._d3options=t.utils.arrayUnique(a.concat(e._d3options||[]))},t.utils.rebind=function(e,n){for(var r,i=1,o=arguments.length;++ie&&(i.pop(),l.text(i.join(" ")),i=[t],l=n.append("tspan").attr("x",0).attr("y",a).attr("dy",1.1*++o+s+"em").text(t))})},t.utils.arrayEquals=function(e,n){if(e===n)return!0;if(!e||!n||e.length!=n.length)return!1;for(var r=0,i=e.length;rt);var b=t.utils.renderWatch(y,x);function _(l){return b.reset(),l.each(function(l){var x,y,_,k,w=d3.select(this);t.utils.initSVG(w);var A=w.selectAll("g.nv-wrap.nv-axis").data([l]),C=A.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),M=(C=C.merge(A)).append("g");M.select("g"),M=C.select("g"),null!==v?e.ticks(v):("top"===n||"bottom"===n)&&e.ticks(Math.abs(o.range()[1]-o.range()[0])/100),M.watchTransition(b,"axis").call(e),r=r||e.scale();var L=e.tickFormat();null==L&&(L=r.tickFormat()),M.attr("fill",""),M.attr("font-size",$),M.attr("font-family","");var S=M.selectAll("text.nv-axislabel").data([u||null]);switch(S.exit().remove(),void 0!==$&&M.selectAll("g").select("text").style("font-size",$),n){case"top":y=m+36;var x=S.enter().append("text").attr("class","nv-axislabel");if(x=w.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel"),k=0,1===o.range().length?k=g?2*o.range()[0]+o.bandwidth():0:2===o.range().length?k=g?o.range()[0]+o.range()[1]+o.bandwidth():o.range()[1]:o.range().length>2&&(k=o.range()[o.range().length-1]+(o.range()[1]-o.range()[0])),x.attr("text-anchor","middle").attr("y",-y).attr("x",k/2),c){_=M.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")).merge(M);var E=(_=w.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data(o.domain()).join("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" "))).select("text");E.empty()&&_.append("text"),_.exit().remove(),_.attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(o(e))+",0)"}).select("text").attr("dy","-0.5em").attr("y",-e.tickPadding()).attr("text-anchor","middle").text(function(t,e){var n=(i||L)(t);return(""+n).match("NaN")?"":n}),_.watchTransition(b,"min-max top").attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(o.range()[n])+",0)"})}break;case"bottom":y=m+36;var F=30,W=0,D=M.selectAll("g").select("text"),I="";if(f%360){D.attr("transform",""),D.each(function(t,e){var n=this.getBoundingClientRect(),r=n.width;W=n.height,r>F&&(F=r)}),I="rotate("+f+" 0,"+(W/2+e.tickPadding())+")";var T=Math.abs(Math.sin(f*Math.PI/180));y=(T?T*F:F)+30,D.attr("transform",I).style("text-anchor",f%360>0?"start":"end")}else h?D.attr("transform",function(t,e){return"translate(0,"+(e%2==0?"0":"12")+")"}):D.attr("transform","translate(0,0)");if(x=S.enter().append("text").attr("class","nv-axislabel"),x=w.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel"),k=0,1===o.range().length?k=g?2*o.range()[0]+o.bandwidth():0:2===o.range().length?k=g?o.range()[0]+o.range()[1]+o.bandwidth():o.range()[1]:o.range().length>2&&(k=o.range()[o.range().length-1]+(o.range()[1]-o.range()[0])),x.attr("text-anchor","middle").attr("y",y).attr("x",k/2),c){_=M.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")).merge(M);var E=(_=w.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data([o.domain()[0],o.domain()[o.domain().length-1]]).join("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" "))).select("text");E.empty()&&_.append("text"),_.exit().remove(),_.attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(o(e)+(g?o.bandwidth()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",e.tickPadding()).attr("transform",I).style("text-anchor",f?f%360>0?"start":"end":"middle").text(function(t,e){var n=(i||L)(t);return(""+n).match("NaN")?"":n}),_.watchTransition(b,"min-max bottom").attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(o(e)+(g?o.bandwidth()/2:0))+",0)"})}break;case"right":if(x=S.enter().append("text").attr("class","nv-axislabel"),(x=w.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel")).style("text-anchor",p?"middle":"begin").attr("transform",p?"rotate(90)":"").attr("y",p?-Math.max(a.right,s)+12-(m||0):-10).attr("x",p?d3.max(o.range())/2:e.tickPadding()),c){_=M.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-y",0===e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")).merge(M);var E=(_=w.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data(o.domain()).join("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-y",0===e?"nv-axisMin-y":"nv-axisMax-y"].join(" "))).select("text");E.empty()&&_.append("text").style("opacity",0),_.exit().remove(),_.attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(o(e))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",e.tickPadding()).style("text-anchor","start").text(function(t,e){var n=(i||L)(t);return(""+n).match("NaN")?"":n}),_.watchTransition(b,"min-max right").attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(o.range()[n])+")"}).select("text").style("opacity",1)}break;case"left":if(x=S.enter().append("text").attr("class","nv-axislabel"),(x=w.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel")).style("text-anchor",p?"middle":"end").attr("transform",p?"rotate(-90)":"").attr("y",p?-Math.max(a.left,s)+25-(m||0):-10).attr("x",p?-d3.max(o.range())/2:-e.tickPadding()),c){_=M.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-y",0===e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")).merge(M);var E=(_=w.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data(o.domain()).join("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-y",0===e?"nv-axisMin-y":"nv-axisMax-y"].join(" "))).select("text");E.empty()&&_.append("text").style("opacity",0),_.exit().remove(),_.attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(r(e))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-e.tickPadding()).attr("text-anchor","end").text(function(t,e){var n=(i||L)(t);return(""+n).match("NaN")?"":n}),_.watchTransition(b,"min-max right").attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(o.range()[n])+")"}).select("text").style("opacity",1)}}if(x.text(function(t){return t}),c&&("left"===n||"right"===n)&&(M.selectAll("g").each(function(t,e){d3.select(this).select("text").attr("opacity",1),(o(t)o.range()[0]-10)&&((t>1e-10||t<-.0000000001)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),o.domain()[0]==o.domain()[1]&&0==o.domain()[0]&&A.selectAll("g.nv-axisMaxMin").style("opacity",function(t,e){return e?0:1})),c&&("top"===n||"bottom"===n)){var O=[];_.each(function(t,e){try{e?O.push(o(t)-this.getBoundingClientRect().width-4):O.push(o(t)+this.getBoundingClientRect().width+4)}catch(n){e?O.push(o(t)-4):O.push(o(t)+4)}}),M.selectAll("g").each(function(t,e){(o(t)O[1])&&(t>1e-10||t<-.0000000001?d3.select(this).remove():d3.select(this).select("text").remove())})}M.selectAll(".tick").filter(function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t}).classed("zero",!0),M.selectAll(".tick text").each(function(t){var e=d3.select(this);setTimeout(function(){var t;if(e.node().getComputedTextLength()>120){var n=e.text().substring(0,10)+"...";e.text(n)}},100)}),r=o.copy()}),b.renderEnd("axis immediate"),_}return _.axis=e,_.dispatch=y,_.options=t.utils.optionsFunc.bind(_),_._options=Object.create({},{axisLabelDistance:{get:function(){return m},set:function(t){m=t}},staggerLabels:{get:function(){return h},set:function(t){h=t}},rotateLabels:{get:function(){return f},set:function(t){f=t}},rotateYLabel:{get:function(){return p},set:function(t){p=t}},showMaxMin:{get:function(){return c},set:function(t){c=t}},axisLabel:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return l},set:function(t){l=t}},ticks:{get:function(){return v},set:function(t){v=t}},width:{get:function(){return s},set:function(t){s=t}},fontSize:{get:function(){return $},set:function(t){$=t}},tickFormatMaxMin:{get:function(){return i},set:function(t){i=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left}},duration:{get:function(){return x},set:function(t){x=t,b.reset(x)}},scale:{get:function(){return o},set:function(n){o=n,e.scale(o),g="function"==typeof o.rangeBands,t.utils.inheritOptionsD3(_,o,["domain","range"])}}}),t.utils.initOptions(_),t.utils.inheritOptionsD3(_,e,["tickValues","tickSubdivide","tickSizeInner","tickSizeOuter","tickPadding","tickFormat"]),t.utils.inheritOptionsD3(_,o,["domain","range"]),_},t.models.boxPlot=function(){"use strict";var e,n,r,i,o,a,s={top:0,right:0,bottom:0,left:0},l=960,u=500,c=Math.floor(1e4*Math.random()),f=d3.scaleBand(),p=d3.scaleLinear(),h=function(t){return t.label},g=function(t){return t.values.Q1},v=function(t){return t.values.Q2},m=function(t){return t.values.Q3},$=function(t){return t.values.whisker_low},x=function(t){return t.values.whisker_high},y=function(t){return t.color},b=function(t){return t.values.outliers},_=function(t,e,n){return t},k=function(t,e,n){return t},w=function(t,e,n){},A=t.utils.defaultColor(),C=null,M=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),L=250,S=null,E=t.utils.renderWatch(M,L);function F(c){return E.reset(),c.each(function(c){var F=l-s.left-s.right,W=u-s.top-s.bottom;C=d3.select(this),t.utils.initSVG(C),f.domain(r||c.map(function(t,e){return h(t,e)})).range(i||[0,F],.1);var D=[];if(!o){var I,T,O=[];c.forEach(function(t,e){var n=g(t),r=m(t),i=$(t),o=x(t),a=b(t);a&&a.forEach(function(t,e){O.push(_(t,e,void 0))}),i&&O.push(i),n&&O.push(n),r&&O.push(r),o&&O.push(o)}),D=[I=d3.min(O),T=d3.max(O)]}p.domain(o||D),p.range(a||[W,0]),e=e||f,n=n||p.copy().range([p(0),p(0)]);var P=C.selectAll("g.nv-wrap").data([c]).enter().append("g").attr("class","nvd3 nv-wrap");P.attr("transform","translate("+s.left+","+s.top+")");var B=P.selectAll(".nv-boxplot").data(function(t){return t}),N=B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);N.attr("class","nv-boxplot").attr("transform",function(t,e,n){return"translate("+(f(h(t,e))+.05*f.bandwidth())+", 0)"}).classed("hover",function(t){return t.hover}),N.watchTransition(E,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay(function(t,e){return e*L/c.length}).attr("transform",function(t,e){return"translate("+(f(h(t,e))+.05*f.bandwidth())+", 0)"}),B.exit().remove(),N.each(function(t,e){var n=d3.select(this);[$,x].forEach(function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===$?"low":"high";n.append("line").style("stroke",y(t)||A(t,e)).attr("class","nv-boxplot-whisker nv-boxplot-"+i),n.append("line").style("stroke",y(t)||A(t,e)).attr("class","nv-boxplot-tick nv-boxplot-"+i)}})});var z=function(){return null===S?.9*f.bandwidth():Math.min(75,.9*f.bandwidth())},V=function(){return .45*f.bandwidth()-z()/2},Y=function(){return .45*f.bandwidth()+z()/2};[$,x].forEach(function(t){var e=t===$?"low":"high",n=t===$?g:m;N.select("line.nv-boxplot-whisker.nv-boxplot-"+e).watchTransition(E,"nv-boxplot: boxplots").attr("x1",.45*f.bandwidth()).attr("y1",function(e,n){return p(t(e))}).attr("x2",.45*f.bandwidth()).attr("y2",function(t,e){return p(n(t))}),N.select("line.nv-boxplot-tick.nv-boxplot-"+e).watchTransition(E,"nv-boxplot: boxplots").attr("x1",V).attr("y1",function(e,n){return p(t(e))}).attr("x2",Y).attr("y2",function(e,n){return p(t(e))})}),[$,x].forEach(function(t){var e=t===$?"low":"high";N.selectAll(".nv-boxplot-"+e).on("mouseover",function(e,n,r,i){setCoordinates(e.pageX,e.pageY),d3.select(this).classed("hover",!0),M.call("elementMouseover",this,{series:{key:t(n),color:y(n)||A(n,i)},e:e})}).on("mouseout",function(e,n,r,i){d3.select(this).classed("hover",!1),M.call("elementMouseout",this,{series:{key:t(n),color:y(n)||A(n,i)},e:e})}).on("mousemove",function(t,e,n){M.call("elementMousemove",this,{e:t})})}),N.append("rect").attr("class","nv-boxplot-box").on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0),M.call("elementMouseover",this,{key:h(e),value:h(e),series:[{key:"Q3",value:m(e),color:y(e)||A(e,n)},{key:"Q2",value:v(e),color:y(e)||A(e,n)},{key:"Q1",value:g(e),color:y(e)||A(e,n)}],data:e,index:e.index,e:t})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),M.call("elementMouseout",this,{key:h(e),value:h(e),series:[{key:"Q3",value:m(e),color:y(e)||A(e,n)},{key:"Q2",value:v(e),color:y(e)||A(e,n)},{key:"Q1",value:g(e),color:y(e)||A(e,n)}],data:e,index:e.index,e:t})}).on("mousemove",function(t,e,n){M.call("elementMousemove",this,{e:t})}).watchTransition(E,"nv-boxplot: boxes").attr("y",function(t,e){return p(m(t))}).attr("width",z).attr("x",V).attr("height",function(t,e){return Math.abs(p(m(t))-p(g(t)))||1}).style("fill",function(t,e){return y(t)||A(t,e)}).style("stroke",function(t,e){return y(t)||A(t,e)}),N.append("line").attr("class","nv-boxplot-median").watchTransition(E,"nv-boxplot: boxplots line").attr("x1",V).attr("y1",function(t,e){return p(v(t))}).attr("x2",Y).attr("y2",function(t,e){return p(v(t))});var H=N.selectAll(".nv-boxplot-outlier").data(function(t){return b(t)||[]});H.enter().append("circle").style("fill",function(t,e,n){return w(t,e,n)||A(t,n)}).style("stroke",function(t,e,n){return w(t,e,n)||A(t,n)}).style("z-index",9e3).on("mouseover",function(t,e,n,r){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0),M.call("elementMouseover",this,{series:{key:k(e,n,r),color:w(e,n,r)||A(e,r)},e:t})}).on("mouseout",function(t,e,n,r){d3.select(this).classed("hover",!1),M.call("elementMouseout",this,{series:{key:k(e,n,r),color:w(e,n,r)||A(e,r)},e:t})}).on("mousemove",function(t,e,n){M.call("elementMousemove",this,{e:t})}),H.attr("class","nv-boxplot-outlier"),H.watchTransition(E,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*f.bandwidth()).attr("cy",function(t,e,n){return p(_(t,e,n))}).attr("r","3"),H.exit().remove(),e=f.copy(),n=p.copy()}),E.renderEnd("nv-boxplot immediate"),F}return F.dispatch=M,F.options=t.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return u},set:function(t){u=t}},maxBoxWidth:{get:function(){return S},set:function(t){S=t}},x:{get:function(){return h},set:function(t){h=t}},q1:{get:function(){return g},set:function(t){g=t}},q2:{get:function(){return v},set:function(t){v=t}},q3:{get:function(){return m},set:function(t){m=t}},wl:{get:function(){return $},set:function(t){$=t}},wh:{get:function(){return x},set:function(t){x=t}},itemColor:{get:function(){return y},set:function(t){y=t}},outliers:{get:function(){return b},set:function(t){b=t}},outlierValue:{get:function(){return _},set:function(t){_=t}},outlierLabel:{get:function(){return k},set:function(t){k=t}},outlierColor:{get:function(){return w},set:function(t){w=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return p},set:function(t){p=t}},xDomain:{get:function(){return r},set:function(t){r=t}},yDomain:{get:function(){return o},set:function(t){o=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return a},set:function(t){a=t}},id:{get:function(){return c},set:function(t){c=t}},y:{get:function(){return console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead."),{}},set:function(t){console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead.")}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},color:{get:function(){return A},set:function(e){A=t.utils.getColor(e)}},duration:{get:function(){return L},set:function(t){L=t,E.reset(L)}}}),t.utils.initOptions(F),F},t.models.boxPlotChart=function(){"use strict";var e,n,r=t.models.boxPlot(),i=t.models.axis(d3.axisBottom(d3.scaleBand()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a={top:15,right:10,bottom:50,left:60},s=null,l=null,u=t.utils.getColor(),c=!0,f=!0,p=!1,h=!1,g=t.models.tooltip(),v="No Data Available.",m=d3.dispatch("beforeUpdate","renderEnd"),$=250,x=d3.transition().duration($).ease(d3.easeLinear);i.showMaxMin(!1).scale(),i.tickFormat(function(t){return t}),o.scale(),o.tickFormat(d3.format(",.1f")),g.duration(0);var y=t.utils.renderWatch(m,$);function b(u){return y.reset(),y.models(r),c&&y.models(i),f&&y.models(o),u.each(function(u){var g=d3.select(this);t.utils.initSVG(g);var x=(s||parseInt(g.style("width"))||960)-a.left-a.right,y=(l||parseInt(g.style("height"))||400)-a.top-a.bottom;if(b.update=function(){m.call("beforeUpdate",this),g.transition().duration($).call(b)},b.container=this,u&&u.length)g.selectAll(".nv-noData").remove();else{var _=g.selectAll(".nv-noData").data([v]);return _.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),_.attr("x",a.left+x/2).attr("y",a.top+y/2).text(function(t){return t}),b}e=r.xScale(),n=r.yScale().clamp(!0);var k=g.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),A=w.append("defs");k.select("g");var C=w.append("g").attr("class","nv-x nv-axis");C=g.selectAll("g.nv-wrap.nv-boxPlotWithAxes").select(".nv-x");var M=w.append("g").attr("class","nv-y nv-axis"),L=M.append("g").attr("class","nv-zeroLine").append("line"),S=w.append("g").attr("class","nv-barsWrap");if(w.attr("transform","translate("+a.left+","+a.top+")"),p&&M.attr("transform","translate("+x+",0)"),r.width(x).height(y),S.datum(u.filter(function(t){return!t.disabled})).transition().call(r),A.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect").attr("width",e.bandwidth()*(h?2:1)).attr("height",16).attr("x",-e.bandwidth()/(h?1:2)),c){i.scale(e)._ticks(t.utils.calcTicksX(x/100,u)),i.tickSizeInner(-y),C.attr("transform","translate(0,"+n.range()[0]+")"),C.call(i);var E=C.select("g.nvd3.nv-wrap.nv-axis").selectAll("g");h&&E.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})}f&&(o.scale(n)._ticks(Math.floor(y/36)),o.tickSizeInner(-x),M.call(o)),L.attr("x1",0).attr("x2",x).attr("y1",n(0)).attr("y2",n(0))}),y.renderEnd("nv-boxplot chart immediate"),b}return r.dispatch.on("elementMouseover.tooltip",function(t){g.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){g.data(t).hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){g()}),b.dispatch=m,b.boxplot=r,b.xAxis=i,b.yAxis=o,b.tooltip=g,b.options=t.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},staggerLabels:{get:function(){return h},set:function(t){h=t}},showXAxis:{get:function(){return c},set:function(t){c=t}},showYAxis:{get:function(){return f},set:function(t){f=t}},tooltipContent:{get:function(){return g},set:function(t){g=t}},noData:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left}},duration:{get:function(){return $},set:function(t){$=t,y.reset($),x=d3.transition().duration($).ease(d3.easeLinear),r.duration($),i.duration($),o.duration($)}},color:{get:function(){return u},set:function(e){u=t.utils.getColor(e),r.color(u)}},rightAlignYAxis:{get:function(){return p},set:function(t){p=t,o.orient(t?"right":"left")}}}),t.utils.inheritOptions(b,r),t.utils.initOptions(b),b},t.models.bullet=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},n="left",r=!1,i=function(t){return t.ranges},o=function(t){return t.markers?t.markers:[]},a=function(t){return t.markerLines?t.markerLines:[0]},s=function(t){return t.measures},l=function(t){return t.rangeLabels?t.rangeLabels:[]},u=function(t){return t.markerLabels?t.markerLabels:[]},c=function(t){return t.markerLineLabels?t.markerLineLabels:[]},f=function(t){return t.measureLabels?t.measureLabels:[]},p=[0],h=380,g=30,v=null,m=null,$=t.utils.getColor(["#1f77b4"]),x=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),y=["Maximum","Mean","Minimum"],b=["Max","Avg","Min"],_=1e3,k=d3.transition().duration(_).ease(d3.easeLinear);function w(t,e){var n=t.slice();t.sort(function(t,r){var i=n.indexOf(t),o=n.indexOf(r);return d3.descending(e[i],e[o])})}function A(n){return n.each(function(n,m){var _=h-e.left-e.right,k=g-e.top-e.bottom;v=d3.select(this),t.utils.initSVG(v);var A=i.call(this,n,m).slice(),C=o.call(this,n,m).slice(),M=a.call(this,n,m).slice(),L=s.call(this,n,m).slice(),S=l.call(this,n,m).slice(),E=u.call(this,n,m).slice(),F=c.call(this,n,m).slice(),W=f.call(this,n,m).slice();w(S,A),w(E,C),w(F,M),w(W,L),A.sort(d3.descending),C.sort(d3.descending),M.sort(d3.descending),L.sort(d3.descending);var D=d3.scaleLinear().domain(d3.extent(d3.merge([p,A]))).range(r?[_,0]:[0,_]);this.__chart__||d3.scaleLinear().domain([0,1/0]).range(D.range()),this.__chart__=D,d3.min(A),d3.max(A),A[1];for(var I=v.selectAll("g.nv-wrap.nv-bullet").data([n]),T=I.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),O=I.select("g"),m=0,P=A.length;mv(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}),I.append("line").attr("class","nv-candlestick-lines").attr("transform",function(t,e){return"translate("+c(p(t,e))+",0)"}).attr("x1",0).attr("y1",function(t,e){return f(m(t,e))}).attr("x2",0).attr("y2",function(t,e){return f($(t,e))}),I.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",function(t,e){return"translate("+(c(p(t,e))-M/2)+","+(f(h(t,e))-(g(t,e)>v(t,e)?f(v(t,e))-f(g(t,e)):0))+")"}).attr("x",0).attr("y",0).attr("width",M).attr("height",function(t,e){var n=g(t,e),r=v(t,e);return n>r?f(r)-f(n):f(n)-f(r)}),I.select(".nv-candlestick-lines").transition().attr("transform",function(t,e){return"translate("+c(p(t,e))+",0)"}).attr("x1",0).attr("y1",function(t,e){return f(m(t,e))}).attr("x2",0).attr("y2",function(t,e){return f($(t,e))}),I.select(".nv-candlestick-rects").transition().attr("transform",function(t,e){return"translate("+(c(p(t,e))-M/2)+","+(f(h(t,e))-(g(t,e)>v(t,e)?f(v(t,e))-f(g(t,e)):0))+")"}).attr("x",0).attr("y",0).attr("width",M).attr("height",function(t,e){var n=g(t,e),r=v(t,e);return n>r?f(r)-f(n):f(n)-f(r)})}),C}return C.highlightPoint=function(t,n){C.clearHighlights(),e.select(".nv-candlestickBar .nv-tick-0-"+t).classed("hover",n)},C.clearHighlights=function(){e.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceX:{get:function(){return x},set:function(t){x=t}},forceY:{get:function(){return y},set:function(t){y=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return _},set:function(t){_=t}},id:{get:function(){return u},set:function(t){u=t}},interactive:{get:function(){return w},set:function(t){w=t}},x:{get:function(){return p},set:function(t){p=t}},y:{get:function(){return h},set:function(t){h=t}},open:{get:function(){return g()},set:function(t){g=t}},close:{get:function(){return v()},set:function(t){v=t}},high:{get:function(){return m},set:function(t){m=t}},low:{get:function(){return $},set:function(t){$=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!=t.top?t.top:a.top,a.right=void 0!=t.right?t.right:a.right,a.bottom=void 0!=t.bottom?t.bottom:a.bottom,a.left=void 0!=t.left?t.left:a.left}},color:{get:function(){return k},set:function(e){k=t.utils.getColor(e)}}}),t.utils.initOptions(C),C},t.models.cumulativeLineChart=function(){"use strict";var e,n,r=t.models.line(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=t.models.legend(),s=t.models.legend(),l=t.interactiveGuideline(),u=t.models.tooltip(),c={top:30,right:30,bottom:50,left:60},f=null,p=t.utils.defaultColor(),h=null,g=null,v=!0,m=!0,$=!0,x=!1,y=!0,b=!1,_=!0,k="top",w=r.id(),A=t.utils.state(),C=null,M=null,L=function(t){return t.average},S=d3.dispatch("stateChange","changeState","renderEnd"),E=250,F=d3.transition().duration(E).ease(d3.easeLinear),W=!1;A.index=0,A.rescaleY=_,i.tickPadding(7),u.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.updateState(!1);var D,I=d3.scaleLinear(),T={i:0,x:0},O=t.utils.renderWatch(S,E);function P(u){return O.reset(),O.models(r),m&&O.models(i),$&&O.models(o),u.each(function(u){var k,M,F,O=d3.select(this);t.utils.initSVG(O),O.classed("nv-chart-"+w,!0);var z,V,Y=t.utils.availableWidth(h,O,c),H=t.utils.availableHeight(g,O,c);if(P.update=function(){0===E?O.call(P):O.transition().duration(E).call(P)},P.container=this,A.setter((z=u,function(t){void 0!==t.index&&(T.i=t.index),void 0!==t.rescaleY&&(_=t.rescaleY),void 0!==t.active&&z.forEach(function(e,n){e.disabled=!t.active[n]})}),P.update).getter((V=u,function(){return{active:V.map(function(t){return!t.disabled}),index:T.i,rescaleY:_}})).update(),A.disabled=u.map(function(t){return!!t.disabled}),!C)for(F in C={},A)A[F]instanceof Array?C[F]=A[F].slice(0):C[F]=A[F];var X=d3.drag().on("start",function t(e,n){d3.select(P.container).style("cursor","ew-resize")}).on("drag",function t(e,n,r){T.x=e.x,T.i=Math.round(I.invert(T.x)),td()}).on("end",function t(e,n){d3.select(P.container).style("cursor","auto"),A.index=T.i,S.call("stateChange",this,A)});if(!u||!u.length||!u.filter(function(t){return t.values.length}).length)return t.utils.noData(P,O),P;O.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale(),I.domain([0,u[0].values.length-1]).range([0,Y]).clamp(!0);var u=(k=T.i,M=u,B||(B=r.y()),M.map(function(t,e){if(!t.values)return t;var n=t.values[k];if(null==n)return t;var r=B(n,k);return 1e-5>Math.abs(r)&&!W?(t.tempDisabled=!0,t):(t.tempDisabled=!1,t.values=t.values.map(function(t,e){return t.display={y:(B(t,e)-r)/r},t}),t)}));void 0===D&&(D=N(u)),_?r.yDomain(null):(r.yDomain(D),r.clipEdge(!0));var G=b?"none":"all",R=O.selectAll("g.nv-wrap.nv-cumulativeLine").data([u]),Z=u.filter(function(t){return!t.disabled&&!t.tempDisabled}),q=R.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine"),j=q.append("g");j.select("g");var K=j.append("g").attr("class","nv-interactive");K=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-interactive");var Q=j.append("g").attr("class","nv-x nv-axis").style("pointer-events","none");Q=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-x");var U=j.append("g").attr("class","nv-y nv-axis");U=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-y");var J=j.append("g").attr("class","nv-background");J=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-background");var tt=j.append("g").data([Z]).attr("class","nv-linesWrap nvd3-svg").style("pointer-events",G),te=j.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none");te=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-avgLinesWrap");var tn=j.append("g").attr("class","nv-legendWrap"),tr=j.append("g").attr("class","nv-controlsWrap");if(tr=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-controlsWrap"),tn=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-legendWrap"),v?(a.width(Y),tn.datum(u).call(a),f||a.height()===c.top||(c.top=a.height(),H=t.utils.availableHeight(g,O,c)),tn.attr("transform","translate(0,"+-c.top+")")):tn.selectAll("*").remove(),q.attr("transform","translate("+c.left+","+c.top+")"),y){var ti=[{key:"Re-scale y-axis",disabled:!_}];s.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),tr.datum(ti).attr("transform","translate(0,"+-c.top+")").call(s)}else tr.selectAll("*").remove();x&&U.attr("transform","translate("+Y+",0)");var to=u.filter(function(t){return t.tempDisabled});q.select(".tempDisabled").remove(),to.length&&q.append("text").attr("class","tempDisabled").attr("x",Y/2).attr("y","-.71em").style("text-anchor","end").text(to.map(function(t){return t.key}).join(", ")+" values cannot be calculated for this time period."),b&&(l.width(Y).height(H).margin({left:c.left,top:c.top}).svgContainer(O).xScale(e),K.call(l));var ta=J.select("rect");ta.empty()&&J.append("rect"),ta.attr("width",Y).attr("height",H),r.y(function(t){return t.display.y}).width(Y).height(H).color(u.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!u[e].disabled&&!u[e].tempDisabled})),(tt=O.selectAll("g.nv-linesWrap.nvd3-svg").data([Z]).merge(tt)).call(r),u.forEach(function(t,e){t.seriesIndex=e});var ts=u.filter(function(t){return!t.disabled&&!!L(t)}),tl=te.selectAll("line").data(ts,function(t){return t.key}),tu=function(t){var e=n(L(t));return e<0?0:e>H?H:e};tl.exit().remove(),tl.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(t,e){return r.color()(t,t.seriesIndex)}).attr("x1",0).attr("x2",Y).attr("y1",tu).attr("y2",tu).style("stroke-opacity",function(t){var e=n(L(t));return e<0||e>H?0:1}).attr("x1",0).attr("x2",Y).attr("y1",tu).attr("y2",tu).merge(tl);var tc=tt.selectAll(".nv-indexLine").data([T]);function td(){tc.data([T]);var t=P.duration();P.duration(0),P.update(),P.duration(t)}tc.merge(tc.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(X)).attr("transform",function(t){return"translate("+I(t.i)+",0)"}).attr("height",H).merge(tc),m&&(i.scale(e)._ticks(t.utils.calcTicksX(Y/70,u)),i.tickSizeInner(-H),Q.attr("transform","translate(0,"+n.range()[0]+")"),Q.call(i).merge(R.select(".nv-x.nv-axis"))),$&&(o.scale(n)._ticks(t.utils.calcTicksY(H/36,u)),o.tickSizeInner(-Y),U.call(o)),ta.on("click",function(t){T.x=d3.pointer(t)[0],T.i=Math.round(I.invert(T.x)),A.index=T.i,S.call("stateChange",ta,A),td()}),r.dispatch.on("elementClick",function(t){T.i=t.pointIndex,T.x=I(T.i),A.index=T.i,S.call("stateChange",r,A),td()}),s.dispatch.on("legendClick",function(t,e,n){e.disabled=!e.disabled,_=!e.disabled,A.rescaleY=_,_||(D=N(u)),S.call("stateChange",this,A),P.update()}),a.dispatch.on("stateChange",function(t){for(var e in t)A[e]=t[e];S.call("stateChange",this,t),P.update()}),l.dispatch.on("elementMousemove",function(e){r.clearHighlights();var n,a,s,c=[];if(u.filter(function(t,e){return t.seriesIndex=e,!(t.disabled||t.tempDisabled)}).forEach(function(i,o){a=t.interactiveBisect(i.values,e.pointXValue,P.x()),r.highlightPoint(o,a,!0);var l=i.values[a];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=P.xScale()(P.x()(l,a))),c.push({key:i.key,value:P.y()(l,a),color:p(i,i.seriesIndex)}))}),c.length>2){var f=P.yScale().invert(e.mouseY),h=Math.abs(P.yScale().domain()[0]-P.yScale().domain()[1]),g=t.nearestValueIndex(c.map(function(t){return t.value}),f,.03*h);null!==g&&(c[g].highlight=!0)}var v=i.tickFormat()(P.x()(n,a),a);l.tooltip.valueFormatter(function(t,e){return o.tickFormat()(t)}).data({value:v,series:c})(),l.renderGuideLine(s)}),l.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),S.on("changeState",function(t){void 0!==t.disabled&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),A.disabled=t.disabled),void 0!==t.index&&(T.i=t.index,T.x=I(T.i),A.index=t.index,tc.data([T])),void 0!==t.rescaleY&&(_=t.rescaleY),P.update()})}),O.renderEnd("cumulativeLineChart immediate"),P}r.dispatch.on("elementMouseover.tooltip",function(t){var e={x:P.x()(t.point),y:P.y()(t.point),color:t.point.color};t.point=e,u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)});var B=null;function N(t){var e=t.filter(function(t){return!(t.disabled||t.tempDisabled)}).map(function(t,e){return d3.extent(t.values,function(t){return t.display.y})});return[d3.min(e,function(t){return t[0]}),d3.max(e,function(t){return t[1]})]}return P.dispatch=S,P.lines=r,P.legend=a,P.controls=s,P.xAxis=i,P.yAxis=o,P.interactiveLayer=l,P.state=A,P.tooltip=u,P.options=t.utils.optionsFunc.bind(P),P._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},showControls:{get:function(){return y},set:function(t){y=t}},showLegend:{get:function(){return v},set:function(t){v=t}},legendPosition:{get:function(){return k},set:function(t){k=t}},average:{get:function(){return L},set:function(t){L=t}},defaultState:{get:function(){return C},set:function(t){C=t}},noData:{get:function(){return M},set:function(t){M=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return $},set:function(t){$=t}},noErrorCheck:{get:function(){return W},set:function(t){W=t}},rescaleY:{get:function(){return _},set:function(t){_=t,P.state.rescaleY=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,f=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),a.color(p)}},useInteractiveGuideline:{get:function(){return b},set:function(t){b=t,!0===t&&(P.interactive(!1),P.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t}},duration:{get:function(){return E},set:function(t){E=t,r.duration(E),i.duration(E),o.duration(E),O.reset(E),F=d3.transition().duration(E).ease(d3.easeLinear)}}}),t.utils.inheritOptions(P,r),t.utils.initOptions(P),P},t.models.differenceChart=function(){"use strict";var e=void 0,n=t.models.multiChart(),r=t.models.focus(t.models.line()),i=function t(e){var n;return(n=e.y0,void 0!==n)?e.y0:e.y},o=function t(e){return e.x},a="x",s=function t(e){return e.y};d3.transition().duration(300).ease(d3.easeLinear);var l=null,u=null,c=null,f=null,p={top:30,right:50,bottom:20,left:70},h={top:0,right:0,bottom:0,left:0},g=!0,v=getInterpolationType(v),m=1,$=d3.scaleTime(),x=d3.timeFormat([["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",function(){return!0}]]);function y(o){o.each(function(o){e=d3.select(this);var a=(o||[]).filter(function(t){return!t.disabled});if(!o||!a.length)return t.utils.noData(y,e),y;var s=b(o),g=t.utils.availableHeight(c,e,p)-r.height(),m=t.utils.availableWidth(f,e,p);e.attr("class","nv-differenceChart"),t.utils.initSVG(e),y.container=this,n.margin(p).color(d3.scaleOrdinal(d3.schemeCategory10).range()).y(i).width(f).height(g).interpolate(v).useInteractiveGuideline(!0),n.interactiveLayer.tooltip.valueFormatter(function(t,e,n){if(n.key===u||n.key===l){var r=Math.abs(n.data.y0-n.data.y1);return 0===r?"-":r}return t}),n.stack1.areaY1(function(t){return n.stack1.scatter.yScale()(t.display.y)}),n.stack1.transformData(function(t){t.display={y:t.y1,y0:t.y0}}),n.xAxis.scale($),n.xAxis.tickFormat(x);var _=s.filter(function(t){return!t.disabled}).map(function(t){return t.values}),k=d3.extent(d3.merge(_),function(t){var e;return(e=t).x});n.xAxis.domain(k).range([0,m]);var w=d3.extent(d3.merge(_),function(t){return i(t)});n.yDomain1(w),n.yAxis1.tickFormat(d3.format(",.1f")),n.yAxis2.tickFormat(d3.format(",.1f")),r.width(m),r.margin(h),r.xScale($.copy()),r.xAxis.tickFormat(x),r.xAxis.rotateLabels(0);var A=e.append("g").attr("class","nv-focusWrap").style("display","initial").attr("transform","translate("+p.left+", "+(g+r.margin().top)+")").datum(s.filter(function(t){return"line"===t.type})).call(r);return A.datum(s).call(n),r.dispatch.on("brush",function(t){var e=s.map(function(e){var n=-1,r=-1;e.values.some(function(e,i){return -1===n&&e.x>=t[0]&&(n=i),-1===r&&e.x>=t[1]&&(r=i,!0)});for(var i=e.values.slice(n,r),o=0;i.length<2&&o<5;)n-=1,r+=1,i=e.values.slice(n,r),o++;return Object.assign({},e,{values:i})});A.datum(e),n.xAxis.domain(t),n.update()}),y.update=function(){A.selectAll("*").remove(),A.transition().duration(300).call(y)},y})}function b(t){var e=t.slice(0),n=e.every(function(t){return t.processed}),r=e.filter(function(t){return"actual"===t.type}),i=e.filter(function(t){return"expected"===t.type});if(n)return e;if(!r.length||!i.length)return[];var c=i[0].key+" minus "+r[0].key+" (Predicted > Actual)",f=i[0].key+" minus "+r[0].key+" (Predicted < Actual)",p=[{key:l||c,type:"area",values:[],yAxis:1,color:"rgba(44,160,44,.9)",processed:!0,noHighlightSeries:!0},{key:u||f,type:"area",values:[],yAxis:1,color:"rgba(234,39,40,.9)",processed:!0,noHighlightSeries:!0},{key:r[0].key,type:"line",values:[],yAxis:1,color:"#666666",processed:!0,strokeWidth:m}];g&&(p[3]={key:i[0].key,type:"line",values:[],yAxis:1,color:"#aec7e8",processed:!0,strokeWidth:m});var h=r[0].values.reduce(function(t,e,n){return t[o(e)]=s(e),t},{}),v=i[0].values.reduce(function(t,e,n){return t[o(e)]=s(e),t},{});return Object.keys(h).forEach(function(t,e){var n=h[t],r=v[t],i={};i[a]=t;var s=o(i),l=r-n;isNaN(l)?(p[1].values[e]={x:s,y0:n,y1:n},p[0].values[e]={x:s,y0:n,y1:n}):l<0?(p[1].values[e]={x:s,y0:n,y1:r},p[0].values[e]={x:s,y0:n,y1:n}):(p[0].values[e]={x:s,y0:n,y1:r},p[1].values[e]={x:s,y0:n,y1:n}),p[2].values[e]={x:s,y:n},g&&(p[3].values[e]={x:s,y:r})}),p}return y.options=t.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function t(){return f},set:function t(e){f=e}},height:{get:function t(){return c},set:function t(e){c=e}},strokeWidth:{get:function t(){return m},set:function t(e){m=e}},x:{get:function t(){return o},set:function t(e){o=e}},keyForXValue:{get:function t(){return a},set:function t(e){a=e}},y:{get:function t(){return s},set:function t(e){s=e}},xScale:{get:function t(){return $},set:function t(e){$=e}},keyForActualLessThanPredicted:{get:function t(){return l},set:function t(e){l=e}},keyForActualGreaterThanPredicted:{get:function t(){return u},set:function t(e){u=e}},showPredictedLine:{get:function t(){return g},set:function t(e){g=e}},tickFormat:{get:function t(){return x},set:function t(e){x=e}},interpolate:{get:function t(){return v},set:function t(e){v=e}},focusMargin:{get:function t(){return h},set:function t(e){h.top=void 0!==e.top?e.top:h.top,h.right=void 0!==e.right?e.right:h.right,h.bottom=void 0!==e.bottom?e.bottom:h.bottom,h.left=void 0!==e.left?e.left:h.left}},margin:{get:function t(){return p},set:function t(e){p.top=void 0!==e.top?e.top:p.top,p.right=void 0!==e.right?e.right:p.right,p.bottom=void 0!==e.bottom?e.bottom:p.bottom,p.left=void 0!==e.left?e.left:p.left}}}),y.xAxis=n.xAxis,y.yAxis=n.yAxis1,y.multiChart=n,y.focus=r,y.processData=b,t.utils.inheritOptions(y,n),t.utils.initOptions(y),y},t.models.discreteBar=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,f=Math.floor(1e4*Math.random()),p=d3.scaleBand(),h=d3.scaleLinear(),g=function(t){return t.x},v=function(t){return t.y},m=[0],$=t.utils.defaultColor(),x=0,y=!1,b=d3.format(",.2f"),_=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),k="discreteBar",w=250,A=t.utils.renderWatch(_,w);function C(f){return A.reset(),f.each(function(f){var w=u-l.left-l.right,C=c-l.top-l.bottom;r=d3.select(this),t.utils.initSVG(r),f.forEach(function(t,e){t.values.forEach(function(t){t.series=e,t.seriesIndex=e})});var M=i&&o?[]:f.map(function(t){return t.values.map(function(t,e){return{x:g(t,e),y:v(t,e),y0:t.y0}})});p.domain(i||d3.merge(M).map(function(t){return t.x})).range(a||[0,w],.1),h.domain(o||d3.extent(d3.merge(M).map(function(t){return t.y}).concat(m))),y?h.range(s||[C-(h.domain()[0]<0?12:0),h.domain()[1]>0?12:0]):h.range(s||[C,0]),e=e||p,n=n||h.copy().range([h(0),h(0)]);var L=r.selectAll("g.nv-wrap.nv-discretebar").data([f]).enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar");L.attr("transform","translate("+l.left+","+l.top+")");var S=L.append("g");S.select("g");var E=S.append("g").attr("class","nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key}).enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);E.exit().watchTransition(A,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),E.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}),E.watchTransition(A,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var F=E.selectAll("g.nv-bar").data(function(t){return t.values});F.exit().remove();var W=F.enter().append("g").attr("transform",function(t,e,n){return"translate("+(p(g(t,e))+.05*p.bandwidth())+", "+h(0)+")"}).on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0),_.call("elementMouseover",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),_.call("elementMouseout",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e,n){_.call("elementMousemove",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("click",function(t,e,n){_.call("elementClick",this,{data:e,index:e.index,color:d3.select(this).style("fill"),event:t,element:this}),t.stopPropagation()}).on("dblclick",function(t,e,n){_.call("elementDblClick",this,{data:e,index:e.index,color:d3.select(this).style("fill")}),t.stopPropagation()}),D=W.append("rect").attr("height",0).attr("width",.9*p.bandwidth()/f.length);y?W.append("text").attr("text-anchor","middle").text(function(t,e){return b(v(t,e))}).watchTransition(A,"discreteBar: bars text").attr("x",.9*p.bandwidth()/2).attr("y",function(t,e){return 0>v(t,e)?h(v(t,e))-h(0)+12:-4}):D.selectAll("text").remove(),W.attr("class",function(t,e){return 0>v(t,e)?"nv-bar negative":"nv-bar positive"}).style("fill",function(t,e){return t.color||$(t,e)}).style("stroke",function(t,e){return t.color||$(t,e)}).select("rect").attr("rx",x).attr("class",k).watchTransition(A,"discreteBar: bars rect").attr("width",.9*p.bandwidth()/f.length),W.watchTransition(A,"discreteBar: bars").attr("transform",function(t,e){var n=p(g(t,e))+.05*p.bandwidth(),r=0>v(t,e)?h(0):h(0)-h(v(t,e))<1?h(0)-1:h(v(t,e));return"translate("+n+", "+r+")"}).select("rect").attr("height",function(t,e){return Math.max(Math.abs(h(v(t,e))-h(0)),1)}),e=p.copy(),n=h.copy()}),A.renderEnd("discreteBar immediate"),C}return C.dispatch=_,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},forceY:{get:function(){return m},set:function(t){m=t}},showValues:{get:function(){return y},set:function(t){y=t}},cornerRadius:{get:function(){return x},set:function(t){x=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},xScale:{get:function(){return p},set:function(t){p=t}},yScale:{get:function(){return h},set:function(t){h=t}},xDomain:{get:function(){return i},set:function(t){i=t}},yDomain:{get:function(){return o},set:function(t){o=t}},xRange:{get:function(){return a},set:function(t){a=t}},yRange:{get:function(){return s},set:function(t){s=t}},valueFormat:{get:function(){return b},set:function(t){b=t}},id:{get:function(){return f},set:function(t){f=t}},rectClass:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},color:{get:function(){return $},set:function(e){$=t.utils.getColor(e)}},duration:{get:function(){return w},set:function(t){w=t,A.reset(w)}}}),t.utils.initOptions(C),C},t.models.discreteBarChart=function(){"use strict";var e,n,r=t.models.discreteBar(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=t.models.legend(),s=t.models.tooltip(),l={top:15,right:10,bottom:50,left:60},u=null,c=null,f=null,p=t.utils.getColor(),h=!1,g=!0,v=!0,m=!1,$=!1,x=!1,y=0,b=null,_=d3.dispatch("beforeUpdate","renderEnd"),k=250,w=d3.transition().duration(k).ease(d3.easeLinear);i.showMaxMin(!1),i.tickFormat(function(t){return t}),o.tickFormat(d3.format(",.1f")),s.duration(0).headerEnabled(!1).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).keyFormatter(function(t,e){return i.tickFormat()(t,e)});var A=t.utils.renderWatch(_,k);function C(s){return A.reset(),A.models(r),g&&A.models(i),v&&A.models(o),s.each(function(s){var p=d3.select(this),b=this;t.utils.initSVG(p);var w=t.utils.availableWidth(c,p,l),A=t.utils.availableHeight(f,p,l);if(C.update=function(){_.call("beforeUpdate",b),p.transition().duration(k).call(C)},C.container=this,!s||!s.length||!s.filter(function(t){return t.values.length}).length)return t.utils.noData(C,p),C;p.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var M=p.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]).enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g");M.attr("transform","translate("+l.left+","+l.top+")");var L=M.append("defs"),S=M.select("g"),E=M.append("g").attr("class","nv-x nv-axis");E=p.selectAll("g.nv-wrap.nv-discreteBarWithAxes").select(".nv-x");var F=M.append("g").attr("class","nv-y nv-axis"),W=F.append("g").attr("class","nv-zeroLine").append("line"),D=M.append("g").attr("class","nv-barsWrap"),I=M.append("g").attr("class","nv-legendWrap");if(I=p.selectAll("g.nv-wrap.nv-discreteBarWithAxes").select(".nv-legendWrap"),h?(a.width(w),I.datum(s).call(a),u||a.height()===l.top||(l.top=a.height(),A=t.utils.availableHeight(f,p,l)),I.attr("transform","translate(0,"+-l.top+")")):I.selectAll("*").remove(),m&&F.attr("transform","translate("+w+",0)"),r.width(w).height(A),D.datum(s.filter(function(t){return!t.disabled})).transition().duration(0).call(r),L.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect").attr("width",e.bandwidth()*($?2:1)).attr("height",16).attr("x",-e.bandwidth()/($?1:2)),g){i.scale(e)._ticks(t.utils.calcTicksX(w/100,s)),i.tickSizeInner(-A),E.attr("transform","translate(0,"+(n.range()[0]+(r.showValues()&&n.domain()[0]<0?16:0))+")"),E.call(i);var T=E.select("g.nvd3.nv-wrap.nv-axis").selectAll("g");$&&T.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}),y&&T.selectAll(".tick text").attr("transform","rotate("+y+" 0,0)").style("text-anchor",y>0?"start":"end"),x&&S.selectAll(".tick text").call(t.utils.wrapTicks,C.xAxis.bandwidth())}v&&(o.scale(n)._ticks(t.utils.calcTicksY(A/36,s,r.y())),o.tickSizeInner(-w),F.call(o)),W.attr("x1",0).attr("x2",m?-w:w).attr("y1",n(0)).attr("y2",n(0))}),A.renderEnd("discreteBar chart immediate"),C}return r.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:C.x()(t.data),value:C.y()(t.data),color:t.color},s.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){s.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){s()}),C.dispatch=_,C.discretebar=r,C.legend=a,C.xAxis=i,C.yAxis=o,C.tooltip=s,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return h},set:function(t){h=t}},staggerLabels:{get:function(){return $},set:function(t){$=t}},rotateLabels:{get:function(){return y},set:function(t){y=t}},wrapLabels:{get:function(){return x},set:function(t){x=!!t}},showXAxis:{get:function(){return g},set:function(t){g=t}},showYAxis:{get:function(){return v},set:function(t){v=t}},noData:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return k},set:function(t){k=t,A.reset(k),w=d3.transition().duration(k).ease(d3.easeLinear),r.duration(k),i.duration(k),o.duration(k)}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),r.color(p),a.color(p)}},rightAlignYAxis:{get:function(){return m},set:function(t){m=t,o.orient(t?"right":"left")}}}),t.utils.inheritOptions(C,r),t.utils.initOptions(C),C},t.models.distribution=function(){"use strict";var e,n={top:0,right:0,bottom:0,left:0},r=400,i=8,o="x",a=function(t){return t[o]},s=t.utils.defaultColor(),l=d3.scaleLinear(),u=250,c=d3.dispatch("renderEnd"),f=t.utils.renderWatch(c,u);function p(r){return f.reset(),r.each(function(r){"x"===o?(n.left,n.right):(n.top,n.bottom);var u="x"==o?"y":"x",c=d3.select(this);t.utils.initSVG(c),e=e||l;var p=c.selectAll("g.nv-distribution").data([r]),h=p.enter().append("g").attr("class","nvd3 nv-distribution");h.attr("transform","translate("+n.left+","+n.top+")");var g=h.append("g");p.select("g");var v=g.selectAll("g.nv-dist").data(function(t){return t},function(t){return t.key});v.enter().append("g").attr("class",function(t,e){return"nv-dist nv-series-"+e}).style("stroke",function(t,e){return s(t,e)});var m=v.selectAll("line.nv-dist"+o).data(function(t){return t.values});m.enter().append("line").attr(o+"1",function(t,n){return e(a(t,n))}).attr(o+"2",function(t,n){return e(a(t,n))}),f.transition(v.exit().selectAll("line.nv-dist"+o),"dist exit").attr(o+"1",function(t,e){return l(a(t,e))}).attr(o+"2",function(t,e){return l(a(t,e))}).style("stroke-opacity",0).remove(),m.attr("class",function(t,e){return"nv-dist"+o+" nv-dist"+o+"-"+e}).attr(u+"1",0).attr(u+"2",i),f.transition(m,"dist").attr(o+"1",function(t,e){return l(a(t,e))}).attr(o+"2",function(t,e){return l(a(t,e))}),e=l.copy()}),f.renderEnd("distribution immediate"),p}return p.options=t.utils.optionsFunc.bind(p),p.dispatch=c,p.margin=function(t){return arguments.length?(n.top=void 0!==t.top?t.top:n.top,n.right=void 0!==t.right?t.right:n.right,n.bottom=void 0!==t.bottom?t.bottom:n.bottom,n.left=void 0!==t.left?t.left:n.left,p):n},p.width=function(t){return arguments.length?(r=t,p):r},p.axis=function(t){return arguments.length?(o=t,p):o},p.size=function(t){return arguments.length?(i=t,p):i},p.getData=function(t){return arguments.length?(a="function"==typeof t?t:function(){return t},p):a},p.scale=function(t){return arguments.length?(l=t,p):l},p.color=function(e){return arguments.length?(s=t.utils.getColor(e),p):s},p.duration=function(t){return arguments.length?(u=t,f.reset(u),p):u},p},t.models.distroPlot=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,f=Math.floor(1e4*Math.random()),p=d3.scaleBand(),h=d3.scaleLinear(),g=function(t){return t.label},v=function(t){return t.value},m=function(t){return t.color},$=function(t){return t.values.q1},x=function(t){return t.values.q2},y=function(t){return t.values.q3},b=function(t){return t.values.mean},_=function(t){return t.values.wl[L]},k=function(t){return t.values.wu[L]},w=function(t){return t.values.min},A=function(t){return t.values.max},C=function(t){return t.values.dev},M=!1,L="iqr",S=!1,E=!1,F=!1,W=!1,D=!0,I=.7,T=!0,O="scott",P=!0,B=50,N=3,z=t.utils.defaultColor(),V=null,Y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),H=250,X=null;function G(t,e){void 0===e&&(e="scott");var n,r,i,o=(r=(n=t).sort(d3.ascending),i=(d3.quantile(r,.75)-d3.quantile(r,.25))/1.349,d3.min([d3.deviation(r),i])),a=t.length;return"scott"===e?Math.pow(1.059*o*a,-.2):Math.pow(.9*o*a,-.2)}function R(t){function e(t,e){var n,r,i,o,a=t.map(function(t){return F&&K.add(F(t)),v(t)}).sort(d3.ascending),s=d3.quantile(a,.25),l=d3.quantile(a,.75),u=l-s,c=l+1.5*u,f=s-1.5*u,p={iqr:d3.max([d3.min(a),d3.min(a.filter(function(t){return t>f}))]),minmax:d3.min(a),stddev:d3.mean(a)-d3.deviation(a)},g={iqr:d3.min([d3.max(a),d3.max(a.filter(function(t){return tg.iqr,n.isOutlierStdDev=n.datumg.stddev,n.randX=Math.random()*I*(1==Math.floor(2*Math.random())?1:-1)}):a.forEach(function(t,n){x.push({object_constancy:t.object_constancy,datum:t,key:e,isOutlier:tg.iqr,isOutlierStdDev:tg.stddev,randX:Math.random()*I*(1==Math.floor(2*Math.random())?1:-1)})}),isNaN(parseFloat(O))&&(n=-1!=["scott","silverman"].indexOf(O)?G(a,O):G(a));var y=(i=(r=n,function(t){return 1>=Math.abs(t/=r)?.75*(1-t*t)/r:0}),o=h._ticks(B),function(t){return o.map(function(e){var n=d3.mean(t,function(t){return i(e-t)});return{x:e,y:n}})}),b=P?function t(e,n){if(n[0]===n[1])return e;var r=e.reduce(function(t,e){return e.x>=n[0]&&e.x<=n[1]&&t.push(e),t},[]);return n[0]r[r.length-1].x&&r.push({x:n[1],y:r[r.length-1].y}),r}(y(a),d3.extent(a)):y(a),_=d3.scaleLinear().domain([0,d3.max(b,function(t){return t.y})]).clamp(!0);Q.push(_);var k={count:a.length,num_outlier:x.filter(function(t){return t.isOutlier}).length,sum:d3.sum(a),mean:$,q1:s,q2:m,q3:l,wl:p,wu:g,iqr:u,min:d3.min(a),max:d3.max(a),dev:d3.deviation(a),observations:x,key:e,kde:b,notch:1.57*u/Math.sqrt(a.length)};return F&&U.push({key:e,values:k}),k}if(t.forEach(function(t,e){t.object_constancy=e+"_"+v(t)+"_"+g(t)}),F){K=new Set;var n,r=d3.group().key(function(t){return g(t)}).key(function(t){return F(t)}).rollup(function(t){return e(t,g(t[0]))}).entries(t);K=K.values();for(var i=r.map(function(t){return t.key}),o=[],a=0;a').attr("transform","translate(-10,-8)scale(0.5)"),w.select(".nv-check-box").each(function(t,e){d3.select(this).selectAll("path").attr("stroke",x(t,e))})}var M=A.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");switch((A=w.merge(A)).on("mouseover",function(t,e,n){g.call("legendMouseover",t,e,n)}).on("mouseout",function(t,e,n){g.call("legendMouseout",t,e,n)}).on("click",function(t,e,n){g.call("legendClick",t,e,n);var r=A.data();f&&("classic"==v?p?(r.forEach(function(t){t.disabled=!0}),e.disabled=!1):(e.disabled=!e.disabled,r.every(function(t){return t.disabled})&&r.forEach(function(t){t.disabled=!1})):"furious"==v&&(h?(e.disengaged=!e.disengaged,e.userDisabled=void 0==e.userDisabled?!!e.disabled:e.userDisabled,e.disabled=e.disengaged||e.userDisabled):!h&&(e.disabled=!e.disabled,e.userDisabled=e.disabled,r.filter(function(t){return!t.disengaged}).every(function(t){return t.userDisabled})&&r.forEach(function(t){t.disabled=t.userDisabled=!1}))),g.call("stateChange",this,{disabled:r.map(function(t){return!!t.disabled}),disengaged:r.map(function(t){return!!t.disengaged})}))}).on("dblclick",function(t,e,n){if(("furious"!=v||!h)&&(g.call("legendDblclick",this,t,e,n),f)){var r=A.data();r.forEach(function(t){t.disabled=!0,"furious"==v&&(t.userDisabled=t.disabled)}),e.disabled=!1,"furious"==v&&(e.userDisabled=e.disabled),g.call("stateChange",this,{disabled:r.map(function(t){return!!t.disabled})})}}),A.classed("nv-disabled",function(t){return t.userDisabled}),A.exit().remove(),M.attr("fill",x(d,I)).text(function(t){return o(i(t))}),v){case"furious":P=23;break;case"classic":P=20}if(l){var L=[];A.each(function(e,n){if(o(i(e))&&o(i(e)).length>s){var r,a,l=o(i(e)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(e)))}else r=d3.select(this).select("text");try{if((a=r.node().getComputedTextLength())<=0)throw Error()}catch(c){a=t.utils.calcApproxTextWidth(r)}L.push(a+u)});for(var S=0,E=0,F=[];E<$&&S$&&S>1;){F=[],S--;for(var W=0;W(F[W%S]||0)&&(F[W%S]=L[W]);E=F.reduce(function(t,e,n,r){return t+e})}for(var D=[],I=0,T=0;IV&&(V=z),"translate("+B+","+N+")"}),k.attr("transform","translate("+(n-e.right-V)+","+e.top+")"),r=e.top+e.bottom+N+15}"furious"==v&&O.attr("width",function(t,e){return M[0][e].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),O.style("fill",y).style("stroke",function(t,e){return t.color||a(t,e)})}),m}return m.dispatch=g,m.options=t.utils.optionsFunc.bind(m),m._options=Object.create({},{width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},key:{get:function(){return i},set:function(t){i=t}},keyFormatter:{get:function(){return o},set:function(t){o=t}},align:{get:function(){return l},set:function(t){l=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return f},set:function(t){f=t}},radioButtonMode:{get:function(){return p},set:function(t){p=t}},expanded:{get:function(){return h},set:function(t){h=t}},vers:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return e},set:function(t){e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left}},color:{get:function(){return a},set:function(e){a=t.utils.getColor(e)}}}),t.utils.initOptions(m),m},t.models.heatMap=function(){"use strict";var e,n,r,i,o,a,s,l,u,c,f,p,h={top:0,right:0,bottom:0,left:0},g=960,v=500,m=Math.floor(1e4*Math.random()),$=d3.scaleBand(),x=d3.scaleBand(),y=!1,b=function(t){return t.x},_=function(t){return t.y},k=function(t){return t.value},w=!0,A=function(t){return"number"==typeof t?t.toFixed(0):t},C=!1,M=2,L=4,S=!1,E=!0,F=t.utils.defaultColor(),W=t.utils.defaultColor(),D="#bcbcbc",I="",T=5,O=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),P=250,B=function(t){return n/3},N=function(t){return r/3},z=!1;function V(t){var e=d3.median(t),n=t.map(function(t){return Math.abs(t-e)});return d3.median(n)}function Y(t){var e=S?to(t):k(t);return H()&&!isNaN(e)||void 0!==e?y(e):D}function H(){return"number"==typeof K[0]}function X(){d3.selectAll(".cell-hover").classed("cell-hover",!1),d3.selectAll(".no-hover").classed("no-hover",!1),d3.selectAll(".row-hover").classed("row-hover",!1),d3.selectAll(".column-hover").classed("column-hover",!1)}var G=function(t){var e=S?A(to(t)):A(k(t));return H()&&!isNaN(e)||void 0!==e?e:I};function R(t){return Object.keys(t).sort(function(e,n){return t[e]-t[n]})}function Z(t,e){return Object.keys(t).filter(function(n){return t[n]===e})[0]}var q={},j={},K=[],Q=[],U=[],J=[],tt=t.utils.renderWatch(O,P),te=["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],tn=function(t){return t._cellPos},tr=function(t){return tn(t).ix},ti=function(t){return tn(t).iy},to=function(t){return tn(t).norm},ta=function(t){return tn(t).idx};function ts(m){return tt.reset(),m.each(function(m){e=(q={},j={},K=[],Q=[],U=[],J=[],D=[],I={},P=0,tn=0,tl=0,(A=m).forEach(function(t){var e,n,r,i=b(t),o=_(t),a=k(t);i in q||(q[i]=P,P++,I[i]={},"function"==typeof u&&Q.push(u(t))),o in j||(j[o]=tn,tn++,I[i][o]={},"function"==typeof c&&U.push(c(t))),-1==K.indexOf(a)&&K.push(a),t._cellPos={idx:tl,ix:q[i],iy:j[o]},tl++,ts=[i,o],(e=J,n=ts,r=JSON.stringify(n),e.some(function(t){return JSON.stringify(t)===r}))?-1==D.indexOf(i+o)&&(D.push(i+o),console.warn("The row/column position "+i+"/"+o+" has multiple values; ensure each cell has only a single value.")):(J.push(ts),I[i][o]=t)}),K=K.sort(),tu=[],Object.keys(j).forEach(function(t){Object.keys(q).forEach(function(e){var n=I[e][t];if(n)tu.push(n);else{var r={idx:tl,ix:q[e],iy:j[t]};tl++,tu.push({_cellPos:r})}})}),S?function t(e){if(-1!=["centerRow","robustCenterRow","centerScaleRow","robustCenterScaleRow","centerColumn","robustCenterColumn","centerScaleColumn","robustCenterScaleColumn","centerAll","robustCenterAll","centerScaleAll","robustCenterScaleAll"].indexOf(S)){Object.keys(q),Object.keys(j);var n,r,i,o=!!S.includes("Scale"),a=S.includes("robust")?"median":"mean",s=S.includes("Row")?"row":S.includes("Column")?"col":null,l=(n=e,r=s,i={},n.forEach(function(t,e){"row"==r?(ti(t) in i||(i[ti(t)]=[]),i[ti(t)].push(k(t))):"col"==r?(tr(t) in i||(i[tr(t)]=[]),i[tr(t)].push(k(t))):null==r&&(0 in i||(i[0]=[]),i[0].push(k(t)))}),i),u={},c={};for(var f in l)u[f]="mean"==a?d3.mean(l[f]):d3.median(l[f]),o&&(c[f]="mean"==a?d3.deviation(l[f]):V(l[f]));e.forEach(function(t,e){if(H()){if("row"==s)var n=ti(t);else if("col"==s)var n=tr(t);else if(null==s)var n=0;var r=k(t)-u[n];o?t._cellPos.norm=r/c[n]:t._cellPos.norm=r}else t._cellPos.norm=k(t)})}else S=!1;return e}(tu):tu);var A,D,I,P,tn,ts,tl,tu,tc=g-h.left-h.right,td=v-h.top-h.bottom;r=tc/Object.keys(q).length,n=C?r/C:td/Object.keys(j).length,C&&(td=n*Object.keys(j).length-h.top-h.bottom),i=d3.select(this),t.utils.initSVG(i),$.domain(o||R(q)).range(s||[0,tc-L/2]),x.domain(a||R(j)).range(l||[0,td-L/2]),(y=H()?d3.scaleQuantize():d3.scaleOrdinal()).domain(p||(H()?S?d3.extent(e,function(t){return to(t)}):d3.extent(K):H()?void 0:K)).range(f||te);var tf=i.selectAll("g.nv-heatMapWrap").data([e]),tp=tf.enter().append("g").attr("class","nvd3 nv-heatMapWrap");tp.append("g").attr("class","cellWrap"),tf.watchTransition(tt,"nv-wrap: heatMapWrap").attr("transform","translate("+h.left+","+h.top+")"),tp.append("g").attr("class","cellGrid").style("opacity",1e-6);var th=tp.select(".cellGrid").selectAll(".gridLines.verticalGrid").data(Object.values(q).concat([Object.values(q).length]));th.enter().append("line").attr("class","gridLines verticalGrid"),th.exit().remove();var tg=tp.select(".cellGrid").selectAll(".gridLines.horizontalGrid").data(Object.values(j).concat([Object.values(j).length]));tg.enter().append("line").attr("class","gridLines horizontalGrid"),tg.exit().remove();var tv=tp.select(".cellWrap").selectAll(".nv-cell").data(function(t){return t},function(t){return ta(t)});tp.append("g").attr("class","xMetaWrap").attr("transform",function(){return"translate(0,"+(-B()-L-T)+")"});var tm=tp.select(".xMetaWrap").selectAll(".x-meta").data(Q);tm.enter().append("rect").attr("class","x-meta meta").attr("width",r-L).attr("height",B()).attr("transform","translate(0,0)").attr("fill",function(t){return F(t)}),tp.append("g").attr("class","yMetaWrap").attr("transform",function(t,e){return"translate("+(-N()-L-T)+",0)"});var t$=tp.select(".yMetaWrap").selectAll(".y-meta").data(U);t$.enter().append("rect").attr("class","y-meta meta").attr("width",N()).attr("height",n-L).attr("transform",function(t,e){return"translate(0,0)"}).attr("fill",function(t,e){return W(t)}),tm.exit().remove(),t$.exit().remove();var tx=tv.enter().append("g").style("opacity",1e-6).attr("transform",function(t){return"translate(0,"+ti(t)*n+")"}).attr("data-row",function(t){return ti(t)}).attr("data-column",function(t){return tr(t)});tx.append("rect"),tx.append("text").attr("text-anchor","middle").attr("dy",4).attr("class","cell-text"),tv.selectAll("rect").watchTransition(tt,"heatMap: rect").attr("width",r-L).attr("height",n-L).attr("rx",M).attr("ry",M).style("stroke",function(t){return Y(t)}),tv.attr("class",function(t){return isNaN(k(t))?"nv-cell cell-missing":"nv-cell"}).watchTransition(tt,"heatMap: cells").style({opacity:1,fill:function(t){return Y(t)}}).attr("transform",function(t){return"translate("+tr(t)*r+","+ti(t)*n+")"}).attr("class",function(t){return isNaN(k(t))?"nv-cell cell-missing":"nv-cell"}),tv.exit().remove(),tv.selectAll("text").watchTransition(tt,"heatMap: cells text").text(function(t){return G(t)}).attr("x",function(t){return(r-L)/2}).attr("y",function(t){return(n-L)/2}).style("fill",function(t){return function t(e){if(!E)return"black";var n,r=d3.rgb(e),i=r.r,o=r.g;return(299*i+587*o+114*r.b)/1e3>=128?"#404040":"#EDEDED"}(Y(t))}).style("opacity",function(){return w?1:0}),tp.selectAll(".verticalGrid").watchTransition(tt,"heatMap: gridLines").attr("y1",0).attr("y2",td-L).attr("x1",function(t){return t*r-L/2}).attr("x2",function(t){return t*r-L/2});var ty=Object.keys(j).length;tp.selectAll(".horizontalGrid").watchTransition(tt,"heatMap: gridLines").attr("x1",function(t){return 0==t||t==ty?-L:0}).attr("x2",function(t){return 0==t||t==ty?tc:tc-L}).attr("y1",function(t){return t*n-L/2}).attr("y2",function(t){return t*n-L/2}),tp.select(".cellGrid").watchTransition(tt,"heatMap: gridLines").style({"stroke-width":L,opacity:function(){return z?1:1e-6}}),tp.selectAll(".x-meta"),tp.selectAll(".y-meta");var tb=tp.selectAll(".meta");tm.watchTransition(tt,"heatMap: xMetaRect").attr("width",r-L).attr("height",B()).attr("transform",function(t,e){return"translate("+e*r+",0)"}),t$.watchTransition(tt,"heatMap: yMetaRect").attr("width",N()).attr("height",n-L).attr("transform",function(t,e){return"translate(0,"+e*n+")"}),tp.select(".xMetaWrap").watchTransition(tt,"heatMap: xMetaWrap").attr("transform",function(t,e){return"translate(0,"+(-B()-L-T)+")"}).style("opacity",function(){return!1!==u?1:0}),tp.select(".yMetaWrap").watchTransition(tt,"heatMap: yMetaWrap").attr("transform",function(t,e){return"translate("+(-N()-L-T)+",0)"}).style("opacity",function(){return!1!==c?1:0}),tv.on("mouseover",function(t,e){var n=ta(t),r=tr(t),i=ti(t);d3.selectAll(".nv-cell").each(function(t){n==ta(t)?(d3.select(this).classed("cell-hover",!0),d3.select(this).classed("no-hover",!1)):(d3.select(this).classed("no-hover",!0),d3.select(this).classed("cell-hover",!1)),r==tr(t)&&(d3.select(this).classed("no-hover",!1),d3.select(this).classed("column-hover",!0)),i==ti(t)&&(d3.select(this).classed("no-hover",!1),d3.select(this).classed("row-hover",!0))}),d3.selectAll(".x-meta").each(function(t,e){e==r?(d3.select(this).classed("cell-hover",!0),d3.select(this).classed("no-hover",!1)):(d3.select(this).classed("no-hover",!0),d3.select(this).classed("cell-hover",!1))}),d3.selectAll(".y-meta").each(function(t,e){e==i?(d3.select(this).classed("cell-hover",!0),d3.select(this).classed("no-hover",!1)):(d3.select(this).classed("no-hover",!0),d3.select(this).classed("cell-hover",!1))}),O.call("elementMouseover",this,{value:Z(q,r)+" & "+Z(j,i),series:{value:G(t),color:d3.select(this).select("rect").style("fill")},e:d3.event})}).on("mouseout",function(t,e){d3.select(this).select("rect").node().getBBox();var n=d3.pointer(d3.select(".nv-heatMap").node()),r=n[0],i=n[1];(r+L>=tc||i+L>=td||r<0||i<0)&&(X(),O.call("elementMouseout",this,{e:d3.event}))}).on("mousemove",function(t,e){O.call("elementMousemove",this,{e:d3.event})}),tb.on("mouseover",function(t,e){var n=-1!=d3.select(this).attr("class").indexOf("x-meta");d3.selectAll(".nv-cell").each(function(t){n&&e==tr(t)?(d3.select(this).classed("column-hover",!0),d3.select(this).classed("no-hover",!1)):n||e-Q.length!=ti(t)?(d3.select(this).classed("no-hover",!0),d3.select(this).classed("column-hover",!1),d3.select(this).classed("row-hover",!1)):(d3.select(this).classed("row-hover",!0),d3.select(this).classed("no-hover",!1)),d3.select(this).classed("cell-hover",!1)}),d3.selectAll(".meta").classed("no-hover",!0),d3.select(this).classed("cell-hover",!0),d3.select(this).classed("no-hover",!1),O.call("elementMouseover",this,{value:n?"Column meta":"Row meta",series:{value:t,color:d3.select(this).style("fill")}})}).on("mouseout",function(t,e){var n=-1!=d3.select(this).attr("class").indexOf("x-meta");d3.select(this).node().getBBox();var r=d3.pointer(d3.select(n?".xMetaWrap":".yMetaWrap").node()),i=r[0],o=r[1];(o<0||i<0||n&&i+L>=tc||!n&&o+L>=td)&&(X(),O.call("elementMouseout",this,{e:d3.event}))}).on("mousemove",function(t,e){O.call("elementMousemove",this,{e:d3.event})})}),tt.renderEnd("heatMap immediate"),ts}return ts.dispatch=O,ts.options=t.utils.optionsFunc.bind(ts),ts._options=Object.create({},{width:{get:function(){return g},set:function(t){g=t}},height:{get:function(){return v},set:function(t){v=t}},showCellValues:{get:function(){return w},set:function(t){w=t}},x:{get:function(){return b},set:function(t){b=t}},y:{get:function(){return _},set:function(t){_=t}},cellValue:{get:function(){return k},set:function(t){k=t}},missingDataColor:{get:function(){return D},set:function(t){D=t}},missingDataLabel:{get:function(){return I},set:function(t){I=t}},xScale:{get:function(){return $},set:function(t){$=t}},yScale:{get:function(){return x},set:function(t){x=t}},colorScale:{get:function(){return y},set:function(t){y=t}},xDomain:{get:function(){return o},set:function(t){o=t}},yDomain:{get:function(){return a},set:function(t){a=t}},xRange:{get:function(){return s},set:function(t){s=t}},yRange:{get:function(){return l},set:function(t){l=t}},colorRange:{get:function(){return f},set:function(t){f=t}},colorDomain:{get:function(){return p},set:function(t){p=t}},xMeta:{get:function(){return u},set:function(t){u=t}},yMeta:{get:function(){return c},set:function(t){c=t}},xMetaColorScale:{get:function(){return color},set:function(e){color=t.utils.getColor(e)}},yMetaColorScale:{get:function(){return color},set:function(e){color=t.utils.getColor(e)}},cellAspectRatio:{get:function(){return C},set:function(t){C=t}},cellRadius:{get:function(){return M},set:function(t){M=t}},cellHeight:{get:function(){return n}},cellWidth:{get:function(){return r}},normalize:{get:function(){return S},set:function(t){S=t}},cellBorderWidth:{get:function(){return L},set:function(t){L=t}},highContrastText:{get:function(){return E},set:function(t){E=t}},cellValueFormat:{get:function(){return A},set:function(t){A=t}},id:{get:function(){return m},set:function(t){m=t}},metaOffset:{get:function(){return T},set:function(t){T=t}},xMetaHeight:{get:function(){return B},set:function(t){B=t}},yMetaWidth:{get:function(){return N},set:function(t){N=t}},showGrid:{get:function(){return z},set:function(t){z=t}},margin:{get:function(){return h},set:function(t){h.top=void 0!==t.top?t.top:h.top,h.right=void 0!==t.right?t.right:h.right,h.bottom=void 0!==t.bottom?t.bottom:h.bottom,h.left=void 0!==t.left?t.left:h.left}},duration:{get:function(){return P},set:function(t){P=t,tt.reset(P)}}}),t.utils.initOptions(ts),ts},t.models.heatMapChart=function(){"use strict";var e,n,r=t.models.heatMap(),i=t.models.legend(),o=(t.models.legend(),t.models.legend(),t.models.tooltip()),a=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),s=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),l={top:20,right:10,bottom:50,left:60},u=null,c=null,f=null,p=(t.utils.getColor(),!0),h=!1,g=!0,v=!0,m="left",$="top",x=0,y=null,b=d3.dispatch("beforeUpdate","renderEnd"),_=250;d3.transition().duration(_).ease(d3.easeLinear),a.showMaxMin(!1).tickFormat(function(t){return t}),s.showMaxMin(!1).tickFormat(function(t){return t}),o.duration(0).headerEnabled(!0).keyFormatter(function(t,e){return a.tickFormat()(t,e)});var k=t.utils.renderWatch(b,_);function w(o){return k.reset(),k.models(r),k.models(a),k.models(s),o.each(function(o){var u=d3.select(this);t.utils.initSVG(u);var y=t.utils.availableWidth(c,u,l),A=t.utils.availableHeight(f,u,l);if(w.update=function(){b.call("beforeUpdate",this),u.transition().duration(_).call(w)},w.container=this,!o||!o.length)return t.utils.noData(w,u),w;u.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale();var C=u.selectAll("g.nv-wrap").data([o]),M=C.enter().append("g");M.attr("transform","translate("+l.left+","+l.top+")");var L=M.attr("class","nvd3 nv-wrap").append("g"),S=C.select("g"),E=L.append("g").attr("class","nv-heatMap"),F=L.append("g").attr("class","nv-legendWrap"),W=L.append("g").attr("class","nv-x nv-axis");W=u.selectAll("g.nv-wrap.nv-heatMap").select(".nv-x");var D=L.append("g").attr("class","nv-y nv-axis");F=u.selectAll("g.nv-wrap").select(".nv-legendWrap"),r.width(y).height(A),E.datum(o.filter(function(t){return!t.disabled})).transition().call(r),r.cellAspectRatio()&&(A=r.cellHeight()*n.domain().length,r.height(A)),a.scale(e)._ticks(t.utils.calcTicksX(y/100,o)),a.tickSizeInner(-A);var I=W;I.call(a).watchTransition(k,"heatMap: axisX").selectAll(".tick").style("opacity",function(){return g?1:0}),I.select("g.nvd3.nv-wrap.nv-axis").selectAll("g").selectAll(".tick text").attr("transform",function(t,e,n){return"translate(0, "+(h?n%2==0?"5":"17":"0")+") rotate("+(0!=x?x:"0")+" 0,0)"}).style("text-anchor",x>0?"start":x<0?"end":"middle");var T=-5;if("function"==typeof r.xMeta()&&(I.selectAll("text").style("text-anchor","middle"),T=-r.xMetaHeight()()/2-r.metaOffset()+3),"bottom"==$){if(I.watchTransition(k,"heatMap: axisX").attr("transform","translate(0,"+(A-T)+")"),!1!==r.xMeta()){var O=A+r.metaOffset()+r.cellBorderWidth();S.select(".xMetaWrap").watchTransition(k,"heatMap: xMetaWrap").attr("transform",function(t,e){return"translate(0,"+O+")"})}}else I.watchTransition(k,"heatMap: axisX").attr("transform","translate(0,"+T+")");s.scale(n)._ticks(t.utils.calcTicksY(A/36,o)),s.tickSizeInner(-y);var P=D;P.call(s).watchTransition(k,"heatMap: axisY").selectAll(".tick").style("opacity",function(){return v?1:0});var B=-5;if("function"==typeof r.yMeta()&&(P.selectAll("text").style("text-anchor","middle"),B=-r.yMetaWidth()()/2-r.metaOffset()),"right"==m){if(P.attr("transform","translate("+(y-B)+",0)"),!1!==r.yMeta()){var O=y+r.metaOffset()+r.cellBorderWidth();S.select(".yMetaWrap").watchTransition(k,"heatMap: yMetaWrap").attr("transform",function(t,e){return"translate("+O+",0)"})}}else P.attr("transform","translate("+B+",0)");var N,z,V=F;i.width(y).color(r.colorScale().range());var Y=(N="string"==typeof(z=r.colorScale()).domain()[0]?z.domain():z.range().map(function(t){var e=z.invertExtent(t);return null===e[0]&&(e[0]=z.domain()[0]),null===e[1]&&(e[1]=z.domain()[1]),e})).map(function(t){return Array.isArray(t)?{key:t[0].toFixed(1)+" - "+t[1].toFixed(1)}:{key:t}});V.datum(Y).call(i).attr("transform","translate(0,"+("top"==$?A:-30)+")"),V.watchTransition(k,"heatMap: nv-legendWrap").style("opacity",function(){return p?1:0})}),d3.selectAll(".nv-axis").selectAll("line").style("stroke-opacity",0),yAxisAppend.select("path.domain").remove(),k.renderEnd("heatMap chart immediate"),w}return r.dispatch.on("elementMouseover.tooltip",function(t){o.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){o.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){o()}),w.dispatch=b,w.heatMap=r,w.legend=i,w.xAxis=a,w.yAxis=s,w.tooltip=o,w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return g},set:function(t){g=t}},showYAxis:{get:function(){return v},set:function(t){v=t}},staggerLabels:{get:function(){return h},set:function(t){h=t}},rotateLabels:{get:function(){return x},set:function(t){x=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return _},set:function(t){_=t,k.reset(_),r.duration(_),a.duration(_),s.duration(_)}},alignYAxis:{get:function(){return m},set:function(t){m=t}},alignXAxis:{get:function(){return $},set:function(t){$=t}}}),t.utils.inheritOptions(w,r),t.utils.initOptions(w),w},t.models.historicalBar=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scaleLinear(),f=d3.scaleLinear(),p=function(t){return t.x},h=function(t){return t.y},g=[],v=[0],m=!1,$=!0,x=t.utils.defaultColor(),y=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),b=!0,_=t.utils.renderWatch(y,0);function k(w){return w.each(function(k){_.reset(),u=d3.select(this);var w=t.utils.availableWidth(a,u,o),A=t.utils.availableHeight(s,u,o);t.utils.initSVG(u),c.domain(e||d3.extent(k[0].values.map(p).concat(g))),m?c.range(r||[.5*w/k[0].values.length,w*(k[0].values.length-.5)/k[0].values.length]):c.range(r||[0,w]),f.domain(n||d3.extent(k[0].values.map(h).concat(v))).range(i||[A,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+.01*f.domain()[0],f.domain()[1]-.01*f.domain()[1]]):f.domain([-1,1]));var C=u.selectAll("g.nv-wrap.nv-historicalBar-"+l).data([k[0].values]).enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+l);C.attr("transform","translate("+o.left+","+o.top+")");var M=C.append("defs"),L=C.append("g"),S=C.select("g"),E=L.append("g").attr("class","nv-bars");u.on("click",function(t,e,n){y.call("chartClick",this,{data:e,index:e.index,pos:t,id:l})}),M.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect").attr("width",w).attr("height",A),S.attr("clip-path",$?"url(#nv-chart-clip-path-"+l+")":"");var F=E.selectAll(".nv-bar").data(function(t){return t},function(t,e){return p(t,e)});F.exit().remove();var W=F.enter().append("rect").attr("x",0).attr("y",function(e,n){return t.utils.NaNtoZero(f(Math.max(0,h(e,n))))}).attr("height",function(e,n){return t.utils.NaNtoZero(Math.abs(f(h(e,n))-f(0)))}).attr("transform",function(t,e){return"translate("+(c(p(t,e))-w/k[0].values.length*.45)+",0)"}).on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),b&&(d3.select(this).classed("hover",!0),y.call("elementMouseover",this,{data:e,index:e.index,color:d3.select(this).style("fill")}))}).on("mouseout",function(t,e,n){b&&(d3.select(this).classed("hover",!1),y.call("elementMouseout",this,{data:e,index:e.index,color:d3.select(this).style("fill")}))}).on("mousemove",function(t,e,n){b&&y.call("elementMousemove",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("click",function(t,e,n){b&&(y.call("elementClick",this,{data:e,index:e.index,color:d3.select(this).style("fill"),event:d3.event,element:this}),t.stopPropagation())}).on("dblclick",function(t,e,n){b&&(y.call("elementDblClick",this,{data:e,index:e.index,color:d3.select(this).style("fill")}),t.stopPropagation())});W.attr("fill",function(t,e){return x(t,e)}).attr("class",function(t,e,n){return(0>h(t,e)?"nv-bar negative":"nv-bar positive")+" nv-bar-0-"+e}).watchTransition(_,"bars").attr("transform",function(t,e){return"translate("+(c(p(t,e))-w/k[0].values.length*.45)+",0)"}).attr("width",w/k[0].values.length*.9),W.watchTransition(_,"bars").attr("y",function(e,n){var r=0>h(e,n)?f(0):f(0)-f(h(e,n))<1?f(0)-1:f(h(e,n));return t.utils.NaNtoZero(r)}).attr("height",function(e,n){return t.utils.NaNtoZero(Math.max(Math.abs(f(h(e,n))-f(0)),1))})}),_.renderEnd("historicalBar immediate"),k}return k.highlightPoint=function(t,e){u.select(".nv-bars .nv-bar-0-"+t).classed("hover",e)},k.clearHighlights=function(){u.select(".nv-bars .nv-bar.hover").classed("hover",!1)},k.dispatch=y,k.options=t.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return g},set:function(t){g=t}},forceY:{get:function(){return v},set:function(t){v=t}},padData:{get:function(){return m},set:function(t){m=t}},x:{get:function(){return p},set:function(t){p=t}},y:{get:function(){return h},set:function(t){h=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},clipEdge:{get:function(){return $},set:function(t){$=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return x},set:function(e){x=t.utils.getColor(e)}}}),t.utils.initOptions(k),k},t.models.historicalBarChart=function(e){"use strict";var n,r,i=e||t.models.historicalBar(),o=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),a=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),s=t.models.legend(),l=t.interactiveGuideline(),u=t.models.tooltip(),c={top:30,right:90,bottom:50,left:90},f=null,p=t.utils.defaultColor(),h=null,g=null,v=!1,m=!0,$=!0,x=!1,y=!1,b={},_=null,k=null,w=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),A=250;o.tickPadding(7),u.duration(0).headerEnabled(!1).valueFormatter(function(t,e){return a.tickFormat()(t,e)}).headerFormatter(function(t,e){return o.tickFormat()(t,e)});var C=t.utils.renderWatch(w,0);function M(e){return e.each(function(u){C.reset(),C.models(i),m&&C.models(o),$&&C.models(a);var k,L=d3.select(this);t.utils.initSVG(L);var S=t.utils.availableWidth(h,L,c),E=t.utils.availableHeight(g,L,c);if(M.update=function(){L.transition().duration(A).call(M)},M.container=this,b.disabled=u.map(function(t){return!!t.disabled}),!_)for(k in _={},b)b[k]instanceof Array?_[k]=b[k].slice(0):_[k]=b[k];if(!u||!u.length||!u.filter(function(t){return t.values.length}).length)return t.utils.noData(M,L),M;L.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale();var F=L.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]),W=F.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart"),D=W.append("g");W.select("g");var I=D.append("g").attr("class","nv-x nv-axis");I=L.selectAll("g.nv-wrap.nv-historicalBarChart").select(".nv-x");var T=D.append("g").attr("class","nv-y nv-axis"),O=D.append("g").attr("class","nv-barsWrap"),P=D.append("g").attr("class","nv-legendWrap"),B=D.append("g").attr("class","nv-interactive");P=L.selectAll("g.nv-wrap.nv-historicalBarChart").select(".nv-legendWrap"),v?(s.width(S),P.datum(u).call(s),f||s.height()===c.top||(c.top=s.height(),E=t.utils.availableHeight(g,L,c)),P.attr("transform","translate(0,"+-c.top+")")):P.selectAll("*").remove(),W.attr("transform","translate("+c.left+","+c.top+")"),x&&T.attr("transform","translate("+S+",0)"),y&&(l.width(S).height(E).margin({left:c.left,top:c.top}).svgContainer(L).xScale(n),B.call(l)),i.width(S).height(E).color(u.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!u[e].disabled})),O.datum(u.filter(function(t){return!t.disabled})).transition().call(i),m&&(o.scale(n)._ticks(t.utils.calcTicksX(S/100,u)),o.tickSizeInner(-E),I.attr("transform","translate(0,"+r.range()[0]+")"),I.transition().call(o)),$&&(a.scale(r)._ticks(t.utils.calcTicksY(E/36,u)),a.tickSizeInner(-S),T.transition().call(a)),l.dispatch.on("elementMousemove",function(e){i.clearHighlights();var n,r,s,c=[];u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(o,a){r=t.interactiveBisect(o.values,e.pointXValue,M.x()),i.highlightPoint(r,!0);var l=o.values[r];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=M.xScale()(M.x()(l,r))),c.push({key:o.key,value:M.y()(l,r),color:p(o,o.seriesIndex),data:o.values[r]}))});var f=o.tickFormat()(M.x()(n,r));l.tooltip.valueFormatter(function(t,e){return a.tickFormat()(t)}).data({value:f,index:r,series:c})(),l.renderGuideLine(s)}),l.dispatch.on("elementMouseout",function(t){w.call("tooltipHide",this),i.clearHighlights()}),s.dispatch.on("legendClick",function(t,n,r){n.disabled=!n.disabled,u.filter(function(t){return!t.disabled}).length||u.map(function(t){return t.disabled=!1,F.selectAll(".nv-series").classed("disabled",!1),t}),b.disabled=u.map(function(t){return!!t.disabled}),w.call("stateChange",this,b),e.transition().call(M)}),s.dispatch.on("legendDblclick",function(t){u.forEach(function(t){t.disabled=!0}),t.disabled=!1,b.disabled=u.map(function(t){return!!t.disabled}),w.call("stateChange",this,b),M.update()}),w.on("changeState",function(t){void 0!==t.disabled&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),b.disabled=t.disabled),M.update()})}),C.renderEnd("historicalBarChart immediate"),M}return i.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:M.x()(t.data),value:M.y()(t.data),color:t.color},u.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),i.dispatch.on("elementMousemove.tooltip",function(t){u()}),M.dispatch=w,M.bars=i,M.legend=s,M.xAxis=o,M.yAxis=a,M.interactiveLayer=l,M.tooltip=u,M.options=t.utils.optionsFunc.bind(M),M._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},showLegend:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return $},set:function(t){$=t}},defaultState:{get:function(){return _},set:function(t){_=t}},noData:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,f=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),s.color(p),i.color(p)}},duration:{get:function(){return A},set:function(t){A=t,C.reset(A),a.duration(A),o.duration(A)}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t}},useInteractiveGuideline:{get:function(){return y},set:function(t){y=t,!0===t&&M.interactive(!1)}}}),t.utils.inheritOptions(M,i),t.utils.initOptions(M),M},t.models.ohlcBarChart=function(){var e=t.models.historicalBarChart(t.models.ohlcBar());return e.useInteractiveGuideline(!0),e.interactiveLayer.tooltip.contentGenerator(function(t){var n=t.series[0].data;return'

'+t.value+"

open:"+e.yAxis.tickFormat()(n.open)+"
close:"+e.yAxis.tickFormat()(n.close)+"
high"+e.yAxis.tickFormat()(n.high)+"
low:"+e.yAxis.tickFormat()(n.low)+"
"}),e},t.models.candlestickBarChart=function(){var e=t.models.historicalBarChart(t.models.candlestickBar());return e.useInteractiveGuideline(!0),e.interactiveLayer.tooltip.contentGenerator(function(t){var n=t.series[0].data;return'

'+t.value+"

open:"+e.yAxis.tickFormat()(n.open)+"
close:"+e.yAxis.tickFormat()(n.close)+"
high"+e.yAxis.tickFormat()(n.high)+"
low:"+e.yAxis.tickFormat()(n.low)+"
"}),e},t.models.legend=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},o=function(t){return t},a=t.utils.getColor(),s=20,l=!0,u=32,c=!0,f=!0,p=!0,h=!1,g=!1,v=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),m="classic";function $(x){function y(t,e){return"furious"!=m?"#000":g?t.disengaged?"#000":"#fff":g?void 0:(t.color||(t.color=a(t,e)),t.disabled?t.color:"#fff")}function b(t,e){return g&&"furious"==m&&t.disengaged?"#eee":t.color||a(t,e)}function _(t,e){return g&&"furious"==m?1:t.disabled?0:1}return x.each(function(a){var $=n-e.left-e.right,x=d3.select(this);t.utils.initSVG(x),x.selectAll("g.nv-legend").remove();var k=x.selectAll("g.nv-legend").data([a]).enter().append("g").attr("class","nvd3 nv-legend");c?k.attr("transform","translate("+-e.right+","+e.top+")"):k.attr("transform","translate("+e.left+","+e.top+")");var w=k.append("g");w.select("g");var A=x.selectAll("g.nv-legend").select("g").selectAll(".nv-series").data(function(t){return"furious"!=m?t:t.filter(function(t){return!!g||!t.disengaged})}),C=A.enter().append("g").attr("class","nv-series");switch(C=A.merge(C),m){case"furious":B=23;break;case"classic":B=20}if("classic"==m)C.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),P=C.select(".nv-legend-symbol");else if("furious"==m){C.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),P=C.select(".nv-legend-symbol"),C.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)").each(function(t,e){d3.select(this).selectAll("path").attr("stroke",y(t,e))})}C.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var M=C.select("text.nv-legend-text");C.on("mouseover",function(t,e,n){v.call("legendMouseover",C,t,e,n)}).on("mouseout",function(t,e,n){v.call("legendMouseout",C,t,e,n)}).on("click",function(t,e,n){v.call("legendClick",C,t,e,n);var r=C.data();f&&("classic"==m?h?(r.forEach(function(t){t.disabled=!0}),e.disabled=!1):(e.disabled=!e.disabled,r.every(function(t){return t.disabled})&&r.forEach(function(t){t.disabled=!1})):"furious"==m&&(g?(e.disengaged=!e.disengaged,e.userDisabled=void 0==e.userDisabled?!!e.disabled:e.userDisabled,e.disabled=e.disengaged||e.userDisabled):!g&&(e.disabled=!e.disabled,e.userDisabled=e.disabled,r.filter(function(t){return!t.disengaged}).every(function(t){return t.userDisabled})&&r.forEach(function(t){t.disabled=t.userDisabled=!1}))),v.call("stateChange",A,{disabled:r.map(function(t){return!!t.disabled}),disengaged:r.map(function(t){return!!t.disengaged})}))}).on("dblclick",function(t,e,n){if(p&&("furious"!=m||!g)&&(v.call("legendDblclick",C,t,e,n),f)){var r=C.data();r.forEach(function(t){t.disabled=!0,"furious"==m&&(t.userDisabled=t.disabled)}),e.disabled=!1,"furious"==m&&(e.userDisabled=e.disabled),v.call("stateChange",C,{disabled:r.map(function(t){return!!t.disabled})})}}),C.classed("nv-disabled",function(t){return t.userDisabled}),C.exit().remove(),M.attr("fill",y).text(function(t){return o(i(t))});var L=0;if(l){var S=[];C.each(function(e,n){if(o(i(e))&&o(i(e)).length>s){var r,a,l=o(i(e)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(e)))}else r=d3.select(this).select("text");try{if((a=r.node().getComputedTextLength())<=0)throw Error()}catch(c){a=t.utils.calcApproxTextWidth(r)}S.push(a+u)});var E=0,F=[];for(L=0;L<$&&E$&&E>1;){F=[],E--;for(var W=0;W(F[W%E]||0)&&(F[W%E]=S[W]);L=F.reduce(function(t,e,n,r){return t+e})}for(var D=[],I=0,T=0;IY&&(Y=V),L0?_:0),A.attr("clip-path",g?"url(#nv-edge-clip-"+r.id()+")":""),C.attr("clip-path",g?"url(#nv-edge-clip-"+r.id()+")":"");var M=s.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key}),L=M.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",function(t){return t.strokeWidth||l}).style("fill-opacity",1e-6);M.exit().remove(),(L=M.merge(L)).attr("class",function(t,e){return(t.classed||"")+" nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return u(t,e)}).style("stroke",function(t,e){return u(t,e)}),L.watchTransition(b,"line: groups").style("stroke-opacity",1).style("fill-opacity",function(t){return t.fillOpacity||.5});var S=s.select(".nv-groups").selectAll(".nv-group").selectAll("path.nv-area").data(function(t){return h(t)?[t]:[]}),E=S.enter().append("path").attr("class","nv-area").attr("d",function(e){return d3.area().curve(getInterpolationType(v)).defined(p).x(function(e,n){return t.utils.NaNtoZero(x(c(e,n)))}).y0(function(e,n){return t.utils.NaNtoZero(y(f(e,n)))}).y1(function(t,e){return y(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[e.values])});M.exit().selectAll("path.nv-area").remove(),(E=S.merge(E)).watchTransition(b,"line: areaPaths").attr("d",function(r){return d3.area().curve(getInterpolationType(v)).defined(p).x(function(n,r){return t.utils.NaNtoZero(e(c(n,r)))}).y0(function(e,r){return t.utils.NaNtoZero(n(f(e,r)))}).y1(function(t,e){return n(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[r.values])});var F=L.selectAll("path.nv-line").data(function(t){return[t.values]}),W=F.enter().append("path").attr("class","nv-line").attr("d",d3.line().curve(getInterpolationType(v)).defined(p).x(function(e,n){return t.utils.NaNtoZero(x(c(e,n)))}).y(function(e,n){return t.utils.NaNtoZero(y(f(e,n)))}));(W=F.merge(W)).watchTransition(b,"line: linePaths").attr("d",d3.line().curve(getInterpolationType(v)).defined(p).x(function(n,r){return t.utils.NaNtoZero(e(c(n,r)))}).y(function(e,r){return t.utils.NaNtoZero(n(f(e,r)))})),x=e.copy(),y=n.copy()}),b.renderEnd("line immediate"),_}return _.dispatch=$,_.scatter=r,r.dispatch.on("elementClick",function(){$.apply("elementClick",this,arguments)}),r.dispatch.on("elementMouseover",function(){$.apply("elementMouseover",this,arguments)}),r.dispatch.on("elementMouseout",function(){$.apply("elementMouseout",this,arguments)}),_.options=t.utils.optionsFunc.bind(_),_._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},defined:{get:function(){return p},set:function(t){p=t}},interpolate:{get:function(){return v},set:function(t){v=t}},clipEdge:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},duration:{get:function(){return m},set:function(t){m=t,b.reset(m),r.duration(m)}},isArea:{get:function(){return h},set:function(t){h="function"==typeof t?t:function(){return t}}},x:{get:function(){return c},set:function(t){c=t,r.x(t)}},y:{get:function(){return f},set:function(t){f=t,r.y(t)}},color:{get:function(){return u},set:function(e){u=t.utils.getColor(e),r.color(u)}}}),t.utils.inheritOptions(_,r),t.utils.initOptions(_),_},t.models.lineChart=function(){"use strict";var e,n,r=t.models.line(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=t.models.legend(),s=t.interactiveGuideline(),l=t.models.tooltip(),u=t.models.focus(t.models.line()),c={top:30,right:20,bottom:50,left:60},f=null,p=t.utils.defaultColor(),h=null,g=null,v=!0,m="top",$=!0,x=!0,y=!1,b=!1,_=!1,k=t.utils.state(),w=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),M=250,L=d3.transition().duration(M).ease(d3.easeLinear);i.tickPadding(7),r.clipEdge(!0).duration(0),l.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.tooltip.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)});var S=t.utils.renderWatch(C,M);function E(l){return S.reset(),S.models(r),$&&S.models(i),x&&S.models(o),l.each(function(l){var A,L=d3.select(this);t.utils.initSVG(L);var S,F,W=t.utils.availableWidth(h,L,c),D=t.utils.availableHeight(g,L,c)-(_?u.height():0);if(E.update=function(){0===M?L.call(E):L.transition().duration(M).call(E)},E.container=this,k.setter((S=l,function(t){void 0!==t.active&&S.forEach(function(e,n){e.disabled=!t.active[n]})}),E.update).getter((F=l,function(){return{active:F.map(function(t){return!t.disabled})}})).update(),k.disabled=l.map(function(t){return!!t.disabled}),!w)for(A in w={},k)k[A]instanceof Array?w[A]=k[A].slice(0):w[A]=k[A];if(!l||!l.length||!l.filter(function(t){return t.values.length}).length)return t.utils.noData(E,L),E;L.selectAll(".nv-noData").remove(),u.dispatch.on("brush",function(t){Q(t)}),e=r.xScale(),n=r.yScale();var I=l.filter(function(t){return!t.disabled}),T=L.selectAll("g.nv-wrap.nv-lineChart").data([l]).enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart"),O=T.append("g"),P=O.select("g"),B=O.append("g").attr("class","nv-legendWrap");B=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-legendWrap");var N=O.append("g").attr("class","nv-focus"),z=N.append("g").attr("class","nv-background").append("rect"),V=N.append("g").attr("class","nv-x nv-axis");V=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-x");var Y=N.append("g").attr("class","nv-y nv-axis");Y=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-y");var H=N.append("g").attr("class","nv-linesWrap");H=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-linesWrap");var X=N.append("g").attr("class","nv-interactive");X=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-interactive");var G=O.append("g").attr("class","nv-focusWrap");G=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-focusWrap"),v?(a.width(W),B.datum(l).call(a),"bottom"===m?(c.bottom=i.height()+a.height(),D=t.utils.availableHeight(g,L,c),B.attr("transform","translate(0,"+(D+i.height())+")")):"top"===m&&(f||a.height()===c.top||(c.top=a.height(),D=t.utils.availableHeight(g,L,c)-(_?u.height():0)),B.attr("transform","translate(0,"+-c.top+")"))):B.selectAll("*").remove(),T.attr("transform","translate("+c.left+","+c.top+")"),y&&Y.attr("transform","translate("+W+",0)"),b&&(s.width(W).height(D).margin({left:c.left,top:c.top}).svgContainer(L).xScale(e),X.call(s)),z.attr("width",W).attr("height",D),r.width(W).height(D).color(l.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!l[e].disabled}));var R=L.selectAll("g.nv-linesWrap.nvd3-svg").data([I]);function Z(){$&&V.transition().duration(M).call(i)}function q(){x&&Y.transition().duration(M).call(o)}if(R=R.merge(H),$&&(i.scale(e)._ticks(t.utils.calcTicksX(W/100,l)),i.tickSizeInner(-D)),x&&(o.scale(n)._ticks(t.utils.calcTicksY(D/36,l)),o.tickSizeInner(-W)),V.attr("transform","translate(0,"+D+")"),_){u.width(W),G.style("display",_?"initial":"none").attr("transform","translate(0,"+(D+c.bottom+u.margin().top)+")").call(u);var j=null===u.brush.extent()?u.xDomain():u.brush.extent();null!==j&&Q(j)}else R.transition().call(r),Z(),q();function K(t){var e=+("e"==t),n=e?1:-1,r=D/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)}function Q(t){P.select(".nv-focus .nv-linesWrap").datum(l.filter(function(t){return!t.disabled}).map(function(e,n){return{key:e.key,area:e.area,classed:e.classed,values:e.values.filter(function(e,n){return r.x()(e,n)>=t[0]&&r.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}})).transition().duration(M).call(r),Z(),q()}a.dispatch.on("stateChange",function(t){for(var e in t)k[e]=t[e];C.call("stateChange",this,t),E.update()}),s.dispatch.on("elementMousemove",function(n){r.clearHighlights();var i,a,c,f=[];if(l.filter(function(t,e){return t.seriesIndex=e,!t.disabled&&!t.disableTooltip}).forEach(function(o,s){var l=null!=u.brush.extent()?e.domain():u.xScale().domain(),h=o.values.filter(function(t,e){return l[0]<=l[1]?r.x()(t,e)>=l[0]&&r.x()(t,e)<=l[1]:r.x()(t,e)>=l[1]&&r.x()(t,e)<=l[0]});if(h.length>0){var g=h[a=t.interactiveBisect(h,n.pointXValue,r.x())],v=E.y()(g,a);if(null!==v&&r.highlightPoint(s,o.values.indexOf(g),!0),void 0===g)return;void 0===i&&(i=g),void 0===c&&(c=E.xScale()(E.x()(g,a))),f.push({key:o.key,value:v,color:p(o,o.seriesIndex),data:g})}}),f.length>2){var h=E.yScale().invert(n.mouseY),g=Math.abs(E.yScale().domain()[0]-E.yScale().domain()[1]),v=t.nearestValueIndex(f.map(function(t){return t.value}),h,.03*g);null!==v&&(f[v].highlight=!0)}var m=function(t,e){return null==t?"N/A":o.tickFormat()(t)};void 0!==a&&(s.tooltip.valueFormatter(s.tooltip.valueFormatter()||m).data({value:E.x()(i,a),index:a,series:f})(),s.renderGuideLine(c))}),s.dispatch.on("elementClick",function(e){var n,i=[];l.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(r){var o=t.interactiveBisect(r.values,e.pointXValue,E.x()),a=r.values[o];if(void 0!==a){void 0===n&&(n=E.xScale()(E.x()(a,o)));var s=E.yScale()(E.y()(a,o));i.push({point:a,pointIndex:o,pos:[n,s],seriesIndex:r.seriesIndex,series:r})}}),r.dispatch.call("elementClick",this,i)}),s.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),C.on("changeState",function(t){void 0!==t.disabled&&l.length===t.disabled.length&&(l.forEach(function(e,n){e.disabled=t.disabled[n]}),k.disabled=t.disabled),E.update()})}),S.renderEnd("lineChart immediate"),E}return r.dispatch.on("elementMouseover.tooltip",function(t){t.series.disableTooltip||l.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){l.hidden(!0)}),E.dispatch=C,E.lines=r,E.legend=a,E.focus=u,E.xAxis=i,E.x2Axis=u.xAxis,E.yAxis=o,E.y2Axis=u.yAxis,E.interactiveLayer=s,E.tooltip=l,E.state=k,E.dispatch=C,E.options=t.utils.optionsFunc.bind(E),E._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},showLegend:{get:function(){return v},set:function(t){v=t}},legendPosition:{get:function(){return m},set:function(t){m=t}},showXAxis:{get:function(){return $},set:function(t){$=t}},showYAxis:{get:function(){return x},set:function(t){x=t}},defaultState:{get:function(){return w},set:function(t){w=t}},noData:{get:function(){return A},set:function(t){A=t}},focusEnable:{get:function(){return _},set:function(t){_=t}},focusHeight:{get:function(){return u.height()},set:function(t){u.height(t)}},focusShowAxisX:{get:function(){return u.showXAxis()},set:function(t){u.showXAxis(t)}},focusShowAxisY:{get:function(){return u.showYAxis()},set:function(t){u.showYAxis(t)}},brushExtent:{get:function(){return u.brushExtent()},set:function(t){u.brushExtent(t)}},focusMargin:{get:function(){return u.margin},set:function(t){void 0!==t.top&&(c.top=t.top,f=t.top),u.margin.right=void 0!==t.right?t.right:u.margin.right,u.margin.bottom=void 0!==t.bottom?t.bottom:u.margin.bottom,u.margin.left=void 0!==t.left?t.left:u.margin.left}},margin:{get:function(){return c},set:function(t){c.top=void 0!==t.top?t.top:c.top,c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return M},set:function(t){M=t,S.reset(M),L=d3.transition().duration(M).ease(d3.easeLinear),r.duration(M),u.duration(M),i.duration(M),o.duration(M)}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),a.color(p),r.color(p),u.color(p)}},interpolate:{get:function(){return r.interpolate()},set:function(t){r.interpolate(t),u.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t),u.xTickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t),u.yTickFormat(t)}},x:{get:function(){return r.x()},set:function(t){r.x(t),u.x(t)}},y:{get:function(){return r.y()},set:function(t){r.y(t),u.y(t)}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,o.orient(y?"right":"left")}},useInteractiveGuideline:{get:function(){return b},set:function(t){(b=t)&&(r.interactive(!1),r.useVoronoi(!1))}}}),t.utils.inheritOptions(E,r),t.utils.initOptions(E),E},t.models.lineWithFocusChart=function(){return t.models.lineChart().margin({bottom:30}).focusEnable(!0)},t.models.linePlusBarChart=function(){"use strict";var e,n,r,i,o,a,s,l=t.models.line(),u=t.models.line(),c=t.models.historicalBar(),f=t.models.historicalBar(),p=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),h=t.models.axis(d3.axisTop(d3.scaleLinear()),"top"),g=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),v=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),m=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),$=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),x=t.models.legend(),y=d3.brush(),b=t.models.tooltip(),_={top:30,right:30,bottom:30,left:60},k=null,w={top:0,right:30,bottom:20,left:60},A=null,C=null,M=function(t){return t.x},L=function(t){return t.y},S=t.utils.defaultColor(),E=!0,F=!0,W=!1,D=!0,I=50,T=null,O=null,P=d3.dispatch("brush","stateChange","changeState"),B=0,N=(d3.transition().duration(B).ease(d3.easeLinear),t.utils.state()),z=null,V=" (left axis)",Y=" (right axis)",H=!1;l.clipEdge(!0),u.interactive(!1),u.pointActive(function(t){return!1}),p.tickPadding(5),h.tickPadding(5),b.headerEnabled(!0).headerFormatter(function(t,e){return p.tickFormat()(t,e)});var X=function(t){return t.every(function(t){return t.disabled})};function G(b){return b.each(function(b){var O,R=d3.select(this);t.utils.initSVG(R);var Z,q,j=t.utils.availableWidth(A,R,_),K=t.utils.availableHeight(C,R,_)-(F?I:0),Q=I-w.top-w.bottom;if(G.update=function(){R.transition().duration(B).call(G)},G.container=this,N.setter((Z=b,function(t){void 0!==t.active&&Z.forEach(function(e,n){e.disabled=!t.active[n]})}),G.update).getter((q=b,function(){return{active:q.map(function(t){return!t.disabled})}})).update(),N.disabled=b.map(function(t){return!!t.disabled}),!z)for(O in z={},N)N[O]instanceof Array?z[O]=N[O].slice(0):z[O]=N[O];if(!b||!b.length||!b.filter(function(t){return t.values.length}).length)return t.utils.noData(G,R),G;R.selectAll(".nv-noData").remove();var U=b.filter(function(t){return!t.disabled&&t.bar}),J=b.filter(function(t){return!t.bar});n=U.length&&!H?c.xScale():l.xScale(),r=h.scale(),i=H?l.yScale():c.yScale(),o=H?c.yScale():l.yScale(),a=H?u.yScale():f.yScale(),s=H?f.yScale():u.yScale();var tt=b.filter(function(t){return!t.disabled&&(H?!t.bar:t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:M(t,e),y:L(t,e)}})}),te=b.filter(function(t){return!t.disabled&&(H?t.bar:!t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:M(t,e),y:L(t,e)}})});n.range([0,j]),r.domain(d3.extent(d3.merge(tt.concat(te)),function(t){return t.x})).range([0,j]);var tn=R.selectAll("g.nv-wrap.nv-linePlusBar").data([b]).enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar"),tr=tn.append("g"),ti=tr.select("g"),to=tr.append("g").attr("class","nv-legendWrap");to=R.selectAll("g.nv-wrap.nv-linePlusBar").select(".nv-legendWrap");var ta=tr.append("g").attr("class","nv-focus"),ts=ta.append("g").attr("class","nv-x nv-axis");ts=R.selectAll("g.nv-wrap.nv-linePlusBar").select(".nv-x");var tl=ta.append("g").attr("class","nv-y1 nv-axis"),tu=ta.append("g").attr("class","nv-y2 nv-axis"),tc=ta.append("g").attr("class","nv-barsWrap"),td=ta.append("g").attr("class","nv-linesWrap"),tf=tr.append("g").attr("class","nv-context"),tp=tf.append("g").attr("class","nv-x nv-axis"),th=tf.append("g").attr("class","nv-y1 nv-axis"),tg=tf.append("g").attr("class","nv-y2 nv-axis"),tv=tf.append("g").attr("class","nv-barsWrap"),tm=tf.append("g").attr("class","nv-linesWrap"),t$=tf.append("g").attr("class","nv-brushBackground"),tx=tf.append("g").attr("class","nv-x nv-brush");if(E){var ty=x.align()?j/2:j,tb=x.align()?ty:0;x.width(ty),to.datum(b.map(function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,H?t.key=t.originalKey+(t.bar?Y:V):t.key=t.originalKey+(t.bar?V:Y),t})).call(x),k||x.height()===_.top||(_.top=x.height(),K=t.utils.availableHeight(C,R,_)-I),to.attr("transform","translate("+tb+","+-_.top+")")}else to.selectAll("*").remove();tn.attr("transform","translate("+_.left+","+_.top+")"),tf.style("display",F?"initial":"none"),f.width(j).height(Q).color(b.map(function(t,e){return t.color||S(t,e)}).filter(function(t,e){return!b[e].disabled&&b[e].bar})),u.width(j).height(Q).color(b.map(function(t,e){return t.color||S(t,e)}).filter(function(t,e){return!b[e].disabled&&!b[e].bar}));var t_=tv.datum(U.length?U:[{values:[]}]),tk=tm.datum(X(J)?[{values:[]}]:J.filter(function(t){return!t.disabled}));tf.attr("transform","translate(0,"+(K+_.bottom+w.top)+")"),t_.transition().call(f),tk.transition().call(u),D&&(h._ticks(t.utils.calcTicksX(j/100,b)),h.tickSizeInner(-Q),ts.attr("transform","translate(0,"+a.range()[0]+")"),ts.transition().call(h)),W&&(m.scale(a)._ticks(Q/36),m.tickSizeInner(-j),$.scale(s)._ticks(Q/36),$.tickSizeInner(U.length?0:-j),ti.select(".nv-context .nv-y3.nv-axis").style("opacity",U.length?1:0).attr("transform","translate(0,"+r.range()[0]+")"),tg.style("opacity",J.length?1:0).attr("transform","translate("+r.range()[1]+",0)"),th.transition().call(m),tg.transition().call($)),y.on("brush",tC),T&&y.extent(T);var tw=t$.selectAll("g").data([T||y.extent()]),tA=tw.enter().append("g");tA.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",Q),tA.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",Q);var t0=tx.call(y);function tC(a){T=null===a.selection?null:y.extent(),e=null===a.selection?r.domain():y.extent(),P.call("brush",this,{extent:e,brush:y}),null!==(s=a).selection&&y.extent(T),tw.data([null===s.selection?r.domain():T]).each(function(t,e){var n=r(t[0])-r.range()[0],i=r.range()[1]-r(t[1]);d3.select(this).select(".left").attr("width",n<0?0:n),d3.select(this).select(".right").attr("x",r(t[1])).attr("width",i<0?0:i)}),c.width(j).height(K).color(b.map(function(t,e){return t.color||S(t,e)}).filter(function(t,e){return!b[e].disabled&&b[e].bar})),l.width(j).height(K).color(b.map(function(t,e){return t.color||S(t,e)}).filter(function(t,e){return!b[e].disabled&&!b[e].bar}));var s,u=tc.datum(U.length?U.map(function(t,n){return{key:t.key,values:t.values.filter(function(t,n){return c.x()(t,n)>=e[0]&&c.x()(t,n)<=e[1]})}}):[{values:[]}]),f=td.datum(X(J)?[{values:[]}]:J.filter(function(t){return!t.disabled}).map(function(t,n){return{area:t.area,fillOpacity:t.fillOpacity,strokeWidth:t.strokeWidth,key:t.key,values:t.values.filter(function(t,n){return l.x()(t,n)>=e[0]&&l.x()(t,n)<=e[1]})}}));n=U.length&&!H?c.xScale():l.xScale(),p.scale(n)._ticks(t.utils.calcTicksX(j/100,b)),p.tickSizeInner(-K),p.domain([Math.ceil(e[0]),Math.floor(e[1])]),ts.transition().duration(B).call(p),u.transition().duration(B).call(c),f.transition().duration(B).call(l),tp.attr("transform","translate(0,"+i.range()[0]+")"),g.scale(i)._ticks(t.utils.calcTicksY(K/36,b)),g.tickSizeInner(-j),v.scale(o)._ticks(t.utils.calcTicksY(K/36,b)),H?v.tickSizeInner(J.length?0:-j,0):v.tickSizeInner(U.length?0:-j);var h=U.length?1:0,m=J.length&&!X(J)?1:0,$=H?m:h,x=H?h:m;tl.style("opacity",$),tu.style("opacity",x).attr("transform","translate("+n.range()[1]+",0)"),tl.transition().duration(B).call(g),tu.transition().duration(B).call(v)}t0.selectAll("rect").attr("height",Q),t0.selectAll(".resize").append("path").attr("d",function t(e){var n=+("e"==e),r=n?1:-1,i=Q/3;return"M"+.5*r+","+i+"A6,6 0 0 "+n+" "+6.5*r+","+(i+6)+"V"+(2*i-6)+"A6,6 0 0 "+n+" "+.5*r+","+2*i+"ZM"+2.5*r+","+(i+8)+"V"+(2*i-8)+"M"+4.5*r+","+(i+8)+"V"+(2*i-8)}),x.dispatch.on("stateChange",function(t){for(var e in t)N[e]=t[e];P.call("stateChange",this,t),G.update()}),P.on("changeState",function(t){void 0!==t.disabled&&(b.forEach(function(e,n){e.disabled=t.disabled[n]}),N.disabled=t.disabled),G.update()}),tC(event)}),G}return l.dispatch.on("elementMouseover.tooltip",function(t){b.duration(100).valueFormatter(function(t,e){return(H?{main:g,focus:m}:{main:v,focus:$}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),l.dispatch.on("elementMouseout.tooltip",function(t){b.hidden(!0)}),c.dispatch.on("elementMouseover.tooltip",function(t){t.value=G.x()(t.data),t.series={value:G.y()(t.data),color:t.color},b.duration(0).valueFormatter(function(t,e){return(H?{main:v,focus:$}:{main:g,focus:m}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(t){b.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(t){b()}),G.dispatch=P,G.legend=x,G.lines=l,G.lines2=u,G.bars=c,G.bars2=f,G.xAxis=p,G.x2Axis=h,G.y1Axis=g,G.y2Axis=v,G.y3Axis=m,G.y4Axis=$,G.tooltip=b,G.options=t.utils.optionsFunc.bind(G),G._options=Object.create({},{width:{get:function(){return A},set:function(t){A=t}},height:{get:function(){return C},set:function(t){C=t}},showLegend:{get:function(){return E},set:function(t){E=t}},brushExtent:{get:function(){return T},set:function(t){T=t}},noData:{get:function(){return O},set:function(t){O=t}},focusEnable:{get:function(){return F},set:function(t){F=t}},focusHeight:{get:function(){return I},set:function(t){I=t}},focusShowAxisX:{get:function(){return D},set:function(t){D=t}},focusShowAxisY:{get:function(){return W},set:function(t){W=t}},legendLeftAxisHint:{get:function(){return V},set:function(t){V=t}},legendRightAxisHint:{get:function(){return Y},set:function(t){Y=t}},margin:{get:function(){return _},set:function(t){void 0!==t.top&&(_.top=t.top,k=t.top),_.right=void 0!==t.right?t.right:_.right,_.bottom=void 0!==t.bottom?t.bottom:_.bottom,_.left=void 0!==t.left?t.left:_.left}},focusMargin:{get:function(){return w},set:function(t){w.top=void 0!==t.top?t.top:w.top,w.right=void 0!==t.right?t.right:w.right,w.bottom=void 0!==t.bottom?t.bottom:w.bottom,w.left=void 0!==t.left?t.left:w.left}},duration:{get:function(){return B},set:function(t){B=t}},color:{get:function(){return S},set:function(e){S=t.utils.getColor(e),x.color(S)}},x:{get:function(){return M},set:function(t){M=t,l.x(t),u.x(t),c.x(t),f.x(t)}},y:{get:function(){return L},set:function(t){L=t,l.y(t),u.y(t),c.y(t),f.y(t)}},switchYAxisOrder:{get:function(){return H},set:function(t){if(H!==t){var e=g;g=v,v=e;var n=m;m=$,$=n}H=t}}}),t.utils.inheritOptions(G,l),t.utils.initOptions(G),G},t.models.multiBar=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,f=d3.scaleBand(),p=d3.scaleLinear(),h=Math.floor(1e4*Math.random()),g=null,v=function(t){return t.x},m=function(t){return t.y},$=[0],x=!0,y=!1,b=d3.stackOffsetNone,_=t.utils.defaultColor(),k=!1,w=null,A=500,C=.1,M=.75,L=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),S=t.utils.renderWatch(L,A),E=0;function F(W){return S.reset(),W.each(function(F){var W=u-l.left-l.right,D=c-l.top-l.bottom;g=d3.select(this),t.utils.initSVG(g);var I=0;if(k&&F.length&&(k=[{values:F[0].values.map(function(t){return{x:t.x,y:0,series:F[t.seriesIndex],size:.01}})}]),y){var T=F;F.forEach(function(t,e){t.seriesIndex=e,t.values=t.values.map(function(t,n){return t.index=n,t.seriesIndex=e,t})});var O=[];F[0].values.forEach(function(t){O.push({x:t.x})}),F.forEach(function(t,e,n){t.display={y:e,y0:n},t.values.forEach(function(e){O[e.index][t.key]=e.y})});var P=F.map(t=>t.key),B=d3.stack().keys(P).offset(b).value(function(t,e){return t[e]})(!O.length&&k?k:O),N=[];B.forEach(function(t,e){t.seriesIndex=e;var n=[];t.map(function(t,r){return n.push({x:r,y:t[1]-t[0],y0:t[0],index:r,series:e,seriesIndex:e,display:{y:t[1]-t[0],y0:t[0]}}),n}),N.push({key:P[e],nonStackable:T[e].nonStackable,values:n})}),N.forEach(function(t,e){t.nonStackable?(F[e].nonStackableSeries=I++,N[e]=F[e]):e>0&&N[e-1].nonStackable&&N[e].values.map(function(t,n){t.y0-=N[e-1].values[n].y,t.y1=t.y0+t.y})}),F=N}F.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.seriesIndex=e,n.key=t.key})}),y&&F.length>0&&F[0].values.map(function(t,e){var n=0,r=0;F.map(function(t,i){if(!F[i].nonStackable){var o=t.values[e];o.size=Math.abs(o.y),o.y<0?(o.y1=r,r-=o.size):(o.y1=o.size+n,n+=o.size)}})});var z=n&&r?[]:F.map(function(t,e){return t.values.map(function(t,n){return{x:v(t,n),y:m(t,n),y0:t.y0,y1:t.y1,idx:e}})});f.domain(n||d3.merge(z).map(function(t){return t.x})).range(i||[0,W]).paddingInner(C).paddingOuter(C),p.domain(r||d3.extent(d3.merge(z).map(function(t){var e=t.y;return y&&!F[t.idx].nonStackable&&(e=t.y>0?t.y1:t.y1+t.y),e}).concat($))).range(o||[D,0]),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]-.01*f.domain()[0],f.domain()[1]+.01*f.domain()[1]]):f.domain([-1,1])),p.domain()[0]===p.domain()[1]&&(p.domain()[0]?p.domain([p.domain()[0]+.01*p.domain()[0],p.domain()[1]-.01*p.domain()[1]]):p.domain([-1,1])),a=a||f,s=s||p;var V=g.selectAll("g.nv-wrap.nv-multibar").data([F]).enter().append("g").attr("class","nvd3 nv-wrap nv-multibar");V.attr("transform","translate("+l.left+","+l.top+")");var Y=V.append("defs"),H=V.append("g");H.select("g"),H.append("g").attr("class","nv-groups"),Y.append("clipPath").attr("id","nv-edge-clip-"+h).append("rect").attr("width",W).attr("height",D),H.attr("clip-path",x?"url(#nv-edge-clip-"+h+")":"");var X=g.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t,e){return e});X.exit().remove();var G=X.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);G=X.merge(G);var R=S.transition(G.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,A)).attr("y",function(t,e,n){var r=s(0)||0;return y&&F[t.seriesIndex]&&!F[t.seriesIndex].nonStackable&&(r=s(t.y0)),r}).attr("height",0).remove();R.delay&&R.delay(function(t,e){return e*(A/(E+1))-e}),G.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return _(t,e)}).style("stroke",function(t,e){return _(t,e)}),G.style("stroke-opacity",1).style("fill-opacity",M);var Z=g.select(".nv-groups").selectAll(".nv-group").selectAll("rect.nv-bar").data(function(t,e){return k&&!F.length?k.values:F[e]?F[e].values:[]});Z.exit().remove();var q=Z.enter().append("rect").attr("class",function(t,e){return 0>m(t,e)?"nv-bar negative":"nv-bar positive"}).attr("x",function(t,e,n){return y&&!F[t.seriesIndex].nonStackable?0:t.seriesIndex*f.bandwidth()/F.length}).attr("y",function(t,e,n){return s(y&&!F[t.seriesIndex].nonStackable?t.y0:0)||0}).attr("height",0).attr("width",function(t,e,n){return f.bandwidth()/(y&&!F[t.seriesIndex].nonStackable?1:F.length)}).attr("transform",function(t,e){return"translate("+f(v(t,e))+",0)"});(q=Z.merge(q)).style("fill",function(t,e,n){return _(t,t.seriesIndex,e)}).style("stroke",function(t,e,n){return _(t,t.seriesIndex,e)}).on("mouseover",function(t,e,n,r){d3.select(this).classed("hover",!0),setCoordinates(t.pageX,t.pageY),L.call("elementMouseover",this,{data:e,index:e.index,series:F[e.seriesIndex],color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n,r){d3.select(this).classed("hover",!1),L.call("elementMouseout",this,{data:e,index:e.index,series:F[e.seriesIndex],color:d3.select(this).style("fill")})}).on("mousemove",function(t,e,n,r){L.call("elementMousemove",this,{data:e,index:e.index,series:F[e.seriesIndex],color:d3.select(this).style("fill")})}).on("click",function(t,e,n,r){L.call("elementClick",this,{data:e,index:e.index,series:F[e.seriesIndex],color:d3.select(this).style("fill"),event:t,element:this}),t.stopPropagation()}).on("dblclick",function(t,e,n,r){L.call("elementDblClick",this,{data:e,index:e,index,series:F[e.seriesIndex],color:d3.select(this).style("fill")}),t.stopPropagation()}),q.attr("class",function(t,e){return 0>m(t,e)?"nv-bar negative":"nv-bar positive"}).attr("transform",function(t,e){return"translate("+f(v(t,e))+",0)"}),w&&(e||(e=F.map(function(){return!0})),q.style("fill",function(t,n,r){return d3.rgb(w(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[t.seriesIndex]).toString()}).style("stroke",function(t,n,r){return d3.rgb(w(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[t.seriesIndex]).toString()}));var j=q.watchTransition(S,"multibar",Math.min(250,A)).delay(function(t,e){return e*A/F[0].values.length});y?j.attr("y",function(t,e,n){var r=0;return F[t.seriesIndex].nonStackable?0>m(t,e)?p(0):p(0)-p(m(t,e))<-1?p(0)-1:p(m(t,e))||0:p(t.y1)}).attr("height",function(t,e,n){return F[t.seriesIndex].nonStackable?Math.max(Math.abs(p(m(t,e))-p(0)),0)||0:Math.max(Math.abs(p(t.y+t.y0)-p(t.y0)),0)}).attr("x",function(t,e,n){var r=0;return F[t.seriesIndex].nonStackable&&(r=t.seriesIndex*f.bandwidth()/F.length,F.length!==I&&(r=F[t.seriesIndex].nonStackableSeries*f.bandwidth()/(2*I))),r}).attr("width",function(t,e,n){if(!F[t.seriesIndex].nonStackable)return f.bandwidth();var r=f.bandwidth()/I;return F.length!==I&&(r=f.bandwidth()/(2*I)),r}):j.attr("x",function(t,e){return t.seriesIndex*f.bandwidth()/F.length}).attr("width",f.bandwidth()/F.length).attr("y",function(t,e){return 0>m(t,e)?p(0):p(0)-p(m(t,e))<1?p(0)-1:p(m(t,e))||0}).attr("height",function(t,e){return Math.max(Math.abs(p(m(t,e))-p(0)),1)||0}),a=f.copy(),s=p.copy(),F[0]&&F[0].values&&(E=F[0].values.length)}),S.renderEnd("multibar immediate"),F}return F.dispatch=L,F.options=t.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return v},set:function(t){v=t}},y:{get:function(){return m},set:function(t){m=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return p},set:function(t){p=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return $},set:function(t){$=t}},stacked:{get:function(){return y},set:function(t){y=t}},stackOffset:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return x},set:function(t){x=t}},disabled:{get:function(){return e},set:function(t){e=t}},id:{get:function(){return h},set:function(t){h=t}},hideable:{get:function(){return k},set:function(t){k=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return M},set:function(t){M=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return A},set:function(t){A=t,S.reset(A)}},color:{get:function(){return _},set:function(e){_=t.utils.getColor(e)}},barColor:{get:function(){return w},set:function(e){w=e?t.utils.getColor(e):null}}}),t.utils.initOptions(F),F},t.models.multiBarChart=function(){"use strict";var e,n,r=t.models.multiBar(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=t.interactiveGuideline(),s=t.models.legend(),l=t.models.legend(),u=t.models.tooltip(),c={top:30,right:20,bottom:50,left:60},f=null,p=null,h=null,g=t.utils.defaultColor(),v=!0,m={},$=!0,x=null,y=!0,b=!0,_=!1,k=!0,w=!1,A=!1,C=0,M=t.utils.state(),L=null,S=null,E=d3.dispatch("stateChange","changeState","renderEnd"),F=function(){return v?180:0},W=250,D=(d3.transition().duration(W).ease(d3.easeLinear),!1);M.stacked=!1,r.stacked(!1),i.tickPadding(7),i.showMaxMin(!1).tickFormat(function(t){return t}),o.tickFormat(d3.format(",.1f")),u.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),l.updateState(!1);var I=t.utils.renderWatch(E),T=!1;function O(S){return I.reset(),I.models(r),y&&I.models(i),b&&I.models(o),S.each(function(S){var I,P=d3.select(this);t.utils.initSVG(P);var B,N,z=t.utils.availableWidth(p,P,c),V=t.utils.availableHeight(h,P,c);if(O.update=function(){0===W?P.call(O):P.transition().duration(W).call(O)},O.container=this,M.setter((B=S,function(t){void 0!==t.stacked&&(T=t.stacked),void 0!==t.active&&B.forEach(function(e,n){e.disabled=!t.active[n]})}),O.update).getter((N=S,function(){return{active:N.map(function(t){return!t.disabled}),stacked:T}})).update(),M.disabled=S.map(function(t){return!!t.disabled}),!L)for(I in L={},M)M[I]instanceof Array?L[I]=M[I].slice(0):L[I]=M[I];if(!S||!S.length||!S.filter(function(t){return t.values.length}).length)return t.utils.noData(O,P),O;P.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale();var Y=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([S]).enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend"),H=Y.append("g");H.select("g");var X=H.append("g").attr("class","nv-x nv-axis");X=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-x");var G=H.append("g").attr("class","nv-y nv-axis");G=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-y");var R=H.append("g").attr("class","nv-barsWrap");R=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-barsWrap");var Z=H.append("g").attr("class","nv-legendWrap");Z=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-legendWrap");var q=H.append("g").attr("class","nv-controlsWrap");q=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-controlsWrap");var j=H.append("g").attr("class","nv-interactive");if(j=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-interactive"),$?"bottom"===x?(s.width(z-c.right),Z.datum(S).call(s),c.bottom=i.height()+s.height(),V=t.utils.availableHeight(h,P,c),Z.attr("transform","translate(0,"+(V+i.height())+")")):(s.width(z-F()),Z.datum(S).call(s),f||s.height()===c.top||(c.top=s.height(),V=t.utils.availableHeight(h,P,c)),Z.attr("transform","translate("+F()+","+-c.top+")")):Z.selectAll("*").remove(),Y.attr("transform","translate("+c.left+","+c.top+")"),v){var K=[{key:m.grouped||"Grouped",disabled:r.stacked()},{key:m.stacked||"Stacked",disabled:!r.stacked()}];l.width(F()).color(["#444","#444","#444"]),q.datum(K).attr("transform","translate(0,"+-c.top+")").call(l)}else q.selectAll("*").remove();_&&G.attr("transform","translate("+z+",0)"),r.disabled(S.map(function(t){return t.disabled})).width(z).height(V).color(S.map(function(t,e){return t.color||g(t,e)}).filter(function(t,e){return!S[e].disabled}));var Q=P.select(".nv-multiBarWithLegend").selectAll(".nv-barsWrap").data([S.filter(function(t){return!t.disabled})]);if((Q=Q.merge(R)).call(r),y){i.scale(e)._ticks(t.utils.calcTicksX(z/100,S)),i.tickSizeInner(-V),X.attr("transform","translate(0,"+n.range()[0]+")"),X.call(i);var U=X.select("g.nvd3.nv-wrap.nv-axis").selectAll("g");if(U.selectAll("line, text").style("opacity",1),w){var J=function(t,e){return"translate("+t+","+e+")"};U.selectAll("text").attr("transform",function(t,e,n){return J(0,n%2==0?5:17)});var tt=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text").nodes().length;U.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(t,e){return J(0,0===e||tt%2!=0?17:5)})}A&&H.selectAll(".tick text").call(t.utils.wrapTicks,O.xScale().bandwidth()),k&&U.filter(function(t,e){return e%Math.ceil(S[0].values.length/(z/100))!=0}).selectAll("text, line").style("opacity",0),C&&U.selectAll(".tick text").attr("transform","rotate("+C+" 0,0)").style("text-anchor",C>0?"start":"end"),X.selectAll("g.nv-axisMaxMin text").style("opacity",1)}b&&(o.scale(n)._ticks(t.utils.calcTicksY(V/36,S)),o.tickSizeInner(-z),G.call(o)),D&&(a.width(z).height(V).margin({left:c.left,top:c.top}).svgContainer(P).xScale(e),j.call(a)),s.dispatch.on("stateChange",function(t){for(var e in t)M[e]=t[e];E.call("stateChange",this,t),O.update()}),l.dispatch.on("legendClick",function(t,e,n){if(e.disabled){switch(K=K.map(function(t){return t.disabled=!0,t}),e.disabled=!1,e.key){case"Grouped":case m.grouped:r.stacked(!1);break;case"Stacked":case m.stacked:r.stacked(!0)}M.stacked=r.stacked(),E.call("stateChange",this,M),O.update()}}),E.on("changeState",function(t){void 0!==t.disabled&&(S.forEach(function(e,n){e.disabled=t.disabled[n]}),M.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),M.stacked=t.stacked,T=t.stacked),O.update()}),D?(a.dispatch.on("elementMousemove",function(t){if(void 0!=t.pointXValue){var n,r,i,o,s=[];S.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(a,l){r=e.domain().indexOf(t.pointXValue);var u=a.values[r];void 0!==u&&(o=u.x,void 0===n&&(n=u),void 0===i&&(i=t.mouseX),s.push({key:a.key,value:O.y()(u,r),color:g(a,a.seriesIndex),data:a.values[r]}))}),a.tooltip.data({value:o,index:r,series:s})(),a.renderGuideLine(i)}}),a.dispatch.on("elementMouseout",function(t){a.tooltip.hidden(!0)})):(r.dispatch.on("elementMouseover.tooltip",function(t){t.value=O.x()(t.data),t.series={key:t.data.key,value:O.y()(t.data),color:t.color},u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){u()}))}),I.renderEnd("multibarchart immediate"),O}return O.dispatch=E,O.multibar=r,O.legend=s,O.controls=l,O.xAxis=i,O.yAxis=o,O.state=M,O.tooltip=u,O.interactiveLayer=a,O.options=t.utils.optionsFunc.bind(O),O._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return $},set:function(t){$=t}},legendPosition:{get:function(){return x},set:function(t){x=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return m},set:function(t){m=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return L},set:function(t){L=t}},noData:{get:function(){return S},set:function(t){S=t}},reduceXTicks:{get:function(){return k},set:function(t){k=t}},rotateLabels:{get:function(){return C},set:function(t){C=t}},staggerLabels:{get:function(){return w},set:function(t){w=t}},wrapLabels:{get:function(){return A},set:function(t){A=!!t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,f=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return W},set:function(t){W=t,r.duration(W),i.duration(W),o.duration(W),I.reset(W)}},color:{get:function(){return g},set:function(e){g=t.utils.getColor(e),s.color(g)}},rightAlignYAxis:{get:function(){return _},set:function(t){_=t}},useInteractiveGuideline:{get:function(){return D},set:function(t){D=t}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),s.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(O,r),t.utils.initOptions(O),O},t.models.multiBarHorizontal=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,f=Math.floor(1e4*Math.random()),p=null,h=d3.scaleBand(),g=d3.scaleLinear(),v=function(t){return t.x},m=function(t){return t.y},$=function(t){return t.yErr},x=[0],y=t.utils.defaultColor(),b=null,_=!1,k=!1,w=60,A=.1,C=.75,M=d3.format(",.2f"),L=250,S=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=t.utils.renderWatch(S,L);function F(f){return E.reset(),f.each(function(f){var L=u-l.left-l.right,F=c-l.top-l.bottom;if(p=d3.select(this),t.utils.initSVG(p),_){var W=f;f.forEach(function(t,e){t.seriesIndex=e,t.values=t.values.map(function(t,n){return t.index=n,t.series=e,t.seriesIndex=e,t})});var D=[];f[0].values.forEach(function(t){D.push({x:t.x})}),f.forEach(function(t,e,n){t.display={y:e,y0:n},t.values.forEach(function(e){D[e.index][t.key]=e.y})});var I=f.map(t=>t.key);f=d3.stack().keys(I).offset(d3.stackOffsetNone).value(function(t,e){return t[e]})(D);var T=[];f.forEach(function(t,e){t.seriesIndex=e,t.x=Array.from(Array(t.length).keys());var n=[];t.map(function(t,r){return n.push({label:W[e].values[r].label,x:r,y:t[1]-t[0],y0:t[0],series:e,seriesIndex:e,index:r}),n}),T.push({values:n,key:I[e],seriesIndex:e})}),f=T}f.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.seriesIndex=e,n.key=t.key})}),_&&f[0].values.map(function(t,e){var n=0,r=0;f.map(function(t){var i=t.values[e];i.size=Math.abs(i.y),i.y<0?(i.y1=r-i.size,r-=i.size):(i.y1=n,n+=i.size)})});var O=i&&o?[]:f.map(function(t){return t.values.map(function(t,e){return{x:v(t,e),y:m(t,e),y0:t.y0,y1:t.y1}})});h.domain(i||d3.merge(O).map(function(t){return t.x})).range(a||[0,F]).paddingInner(A).paddingOuter(A),g.domain(o||d3.extent(d3.merge(O).map(function(t){return _?t.y>0?t.y1+t.y:t.y1:t.y}).concat(x))),k&&!_?g.range(s||[g.domain()[0]<0?w:0,L-(g.domain()[1]>0?w:0)]):g.range(s||[0,L]),e=e||h,n=n||d3.scaleLinear().domain(g.domain()).range([g(0),g(0)]);var P=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([f]).enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal");P.attr("transform","translate("+l.left+","+l.top+")"),P.append("defs");var B=P.append("g");B.select("g"),B.append("g").attr("class","nv-groups");var N=d3.select(this).selectAll("g.nv-groups").selectAll(".nv-group").data(f),z=N.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);N.exit().remove();var V=N.merge(z);V.exit().watchTransition(E,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),V.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return y(t,e)}).style("stroke",function(t,e){return y(t,e)}),V.watchTransition(E,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",C);var Y=V.selectAll("g.nv-bar").data(function(t){return t.values});Y.exit().remove();var H=Y.enter().append("g").attr("transform",function(t,e,r){var i=r.indexOf(this);return"translate("+n(_?t.y0:0)+","+(_?0:i*h.bandwidth()/f.length+h(v(t,e)))+")"});(Y=Y.merge(H)).select("rect").remove(),Y.append("rect").attr("width",0).attr("height",h.bandwidth()/(_?1:f.length)),Y.on("mouseover",function(t,e,n){d3.select(this).classed("hover",!0),setCoordinates(t.pageX,t.pageY),S.call("elementMouseover",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),S.call("elementMouseout",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n){S.call("elementMouseout",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e,n){S.call("elementMousemove",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("click",function(t,e,n){S.call("elementClick",this,{data:e,index:e.index,color:d3.select(this).style("fill"),event:t,element:this}),t.stopPropagation()}).on("dblclick",function(t,e,n){S.call("elementDblClick",this,{data:e,index:e.index,color:d3.select(this).style("fill")}),t.stopPropagation()}),$(f[0],0)&&(H.append("polyline"),Y.select("polyline").attr("fill","none").attr("points",function(t,e){var n=$(t,e),r=.8*h.bandwidth()/((_?1:f.length)*2);return[[(n=(n=n.length?n:[-Math.abs(n),Math.abs(n)]).map(function(n){return g(n+(0>m(t,e)?0:m(t,e)))-g(0)}))[0],-r],[n[0],r],[n[0],0],[n[1],0],[n[1],-r],[n[1],r]].map(function(t){return t.join(",")}).join(" ")}).attr("transform",function(t,e){return"translate(0, "+h.bandwidth()/((_?1:f.length)*2)+")"})),H.append("text"),k&&!_?(Y.select("text").attr("text-anchor",function(t,e){return 0>m(t,e)?"end":"start"}).attr("y",h.bandwidth()/(2*f.length)).attr("dy",".32em").text(function(t,e){var n=M(m(t,e)).replace(/\.0+%$/,"%"),r=$(t,e);return void 0===r?n:r.length?n+"+"+M(Math.abs(r[1]))+"-"+M(Math.abs(r[0])):n+"\xb1"+M(Math.abs(r))}),Y.watchTransition(E,"multibarhorizontal: bars").select("text").attr("x",function(t,e){return 0>m(t,e)?-4:g(m(t,e))-g(0)+4})):Y.selectAll("text").text(""),Y.selectAll("text.nv-bar-label").text(""),Y.attr("class",function(t,e){return 0>m(t,e)?"nv-bar negative":"nv-bar positive"}),b&&(r||(r=f.map(function(){return!0})),Y.style("fill",function(t,e,n){return d3.rgb(b(t,e)).darker(r.map(function(t,e){return e}).filter(function(t,e){return!r[e]})[n]).toString()}).style("stroke",function(t,e,n){return d3.rgb(b(t,e)).darker(r.map(function(t,e){return e}).filter(function(t,e){return!r[e]})[n]).toString()})),_?Y.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(t,e){return"translate("+g(t.y1)+","+h(v(t,e))+")"}).select("rect").attr("width",function(t,e){return Math.abs(g(m(t,e)+t.y0)-g(t.y0))||0}).attr("height",h.bandwidth()):Y.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(t,e){return"translate("+(0>m(t,e)?g(m(t,e)):g(0))+","+(t.series*h.bandwidth()/f.length+h(v(t,e)))+")"}).select("rect").attr("height",h.bandwidth()/f.length).attr("width",function(t,e){return Math.max(Math.abs(g(m(t,e))-g(0)),1)||0}),e=h.copy(),n=g.copy()}),E.renderEnd("multibarHorizontal immediate"),F}return F.dispatch=S,F.options=t.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return v},set:function(t){v=t}},y:{get:function(){return m},set:function(t){m=t}},yErr:{get:function(){return $},set:function(t){$=t}},xScale:{get:function(){return h},set:function(t){h=t}},yScale:{get:function(){return g},set:function(t){g=t}},xDomain:{get:function(){return i},set:function(t){i=t}},yDomain:{get:function(){return o},set:function(t){o=t}},xRange:{get:function(){return a},set:function(t){a=t}},yRange:{get:function(){return s},set:function(t){s=t}},forceY:{get:function(){return x},set:function(t){x=t}},stacked:{get:function(){return _},set:function(t){_=t}},showValues:{get:function(){return k},set:function(t){k=t}},disabled:{get:function(){return r},set:function(t){r=t}},id:{get:function(){return f},set:function(t){f=t}},valueFormat:{get:function(){return M},set:function(t){M=t}},valuePadding:{get:function(){return w},set:function(t){w=t}},groupSpacing:{get:function(){return A},set:function(t){A=t}},fillOpacity:{get:function(){return C},set:function(t){C=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return L},set:function(t){L=t,E.reset(L)}},color:{get:function(){return y},set:function(e){y=t.utils.getColor(e)}},barColor:{get:function(){return b},set:function(e){b=e?t.utils.getColor(e):null}}}),t.utils.initOptions(F),F},t.models.multiBarHorizontalChart=function(){"use strict";var e,n,r=t.models.multiBarHorizontal(),i=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),o=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),a=t.models.legend().height(30),s=t.models.legend().height(30),l=t.models.tooltip(),u={top:30,right:20,bottom:50,left:60},c=null,f=null,p=null,h=t.utils.defaultColor(),g=!0,v="top",m={},$=!0,x="top",y=!0,b=!0,_=!1,k=t.utils.state(),w=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),M=function(){return g?180:0},L=250;k.stacked=!1,r.stacked(_),i.tickPadding(5),i.showMaxMin(!1).tickFormat(function(t){return t}),o.tickFormat(d3.format(",.1f")),l.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.updateState(!1);var S=t.utils.renderWatch(C,L);function E(l){return S.reset(),S.models(r),y&&S.models(i),b&&S.models(o),l.each(function(l){var A,S=d3.select(this);t.utils.initSVG(S);var F,W,D=t.utils.availableWidth(f,S,u),I=t.utils.availableHeight(p,S,u);if(E.update=function(){S.transition().duration(L).call(E)},E.container=this,_=r.stacked(),k.setter((F=l,function(t){void 0!==t.stacked&&(_=t.stacked),void 0!==t.active&&F.forEach(function(e,n){e.disabled=!t.active[n]})}),E.update).getter((W=l,function(){return{active:W.map(function(t){return!t.disabled}),stacked:_}})).update(),k.disabled=l.map(function(t){return!!t.disabled}),!w)for(A in w={},k)k[A]instanceof Array?w[A]=k[A].slice(0):w[A]=k[A];if(!l||!l.length||!l.filter(function(t){return t.values.length}).length)return t.utils.noData(E,S),E;S.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var T=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([l]).enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart"),O=T.append("g");O.select("g");var P=O.append("g").attr("class","nv-x nv-axis");P=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-x");var B=O.append("g").attr("class","nv-y nv-axis"),N=B.append("g").attr("class","nv-zeroLine").append("line");B=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-y"),N=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart.nv-zeroLine").select("line");var z=O.append("g").attr("class","nv-barsWrap");z=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-barsWrap");var V=O.append("g").attr("class","nv-legendWrap");V=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-legendWrap");var Y=O.append("g").attr("class","nv-controlsWrap");if(z=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-controlsWrap"),$?(a.width(D-M()),V.datum(l).call(a),"bottom"===x?(u.bottom=i.height()+a.height(),I=t.utils.availableHeight(p,S,u),V.attr("transform","translate("+M()+","+(I+i.height())+")")):"top"===x&&(c||a.height()===u.top||(u.top=a.height(),I=t.utils.availableHeight(p,S,u)),V.attr("transform","translate("+M()+","+-u.top+")"))):V.selectAll("*").remove(),T.attr("transform","translate("+u.left+","+u.top+")"),g){var H=[{key:m.grouped||"Grouped",disabled:r.stacked()},{key:m.stacked||"Stacked",disabled:!r.stacked()}];s.width(M()).color(["#444","#444","#444"]),"bottom"===v?(u.bottom=i.height()+a.height(),I=t.utils.availableHeight(p,S,u),Y.datum(H).attr("transform","translate(0,"+(I+i.height())+")").call(s)):"top"===v&&Y.datum(H).attr("transform","translate(0,"+-u.top+")").call(s)}else Y.selectAll("*").remove();r.disabled(l.map(function(t){return t.disabled})).width(D).height(I).color(l.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!l[e].disabled})),(z=S.select(".nv-multiBarHorizontalChart").selectAll(".nv-barsWrap").data([l.filter(function(t){return!t.disabled})]).merge(z)).transition().call(r),y&&(i.scale(e)._ticks(t.utils.calcTicksY(I/24,l)),i.tickSizeInner(-D),P.call(i),P.select("g.nvd3.nv-wrap.nv-axis").selectAll("g").selectAll("line, text")),b&&(o.scale(n)._ticks(t.utils.calcTicksX(D/100,l)),o.tickSizeInner(-I),B.attr("transform","translate(0,"+I+")"),B.call(o)),N.attr("x1",n(0)).attr("x2",n(0)).attr("y1",0).attr("y2",-I),a.dispatch.on("stateChange",function(t){for(var e in t)k[e]=t[e];C.call("stateChange",this,t),E.update()}),s.dispatch.on("legendClick",function(t,e,n){if(e.disabled){switch(H=H.map(function(t){return t.disabled=!0,t}),e.disabled=!1,e.key){case"Grouped":case m.grouped:r.stacked(!1);break;case"Stacked":case m.stacked:r.stacked(!0)}k.stacked=r.stacked(),C.call("stateChange",this,k),_=r.stacked(),E.update()}}),C.on("changeState",function(t){void 0!==t.disabled&&(l.forEach(function(e,n){e.disabled=t.disabled[n]}),k.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),k.stacked=t.stacked,_=t.stacked),E.update()})}),S.renderEnd("multibar horizontal chart immediate"),E}return r.dispatch.on("elementMouseover.tooltip",function(t){t.value=E.x()(t.data),t.series={key:t.data.key,value:E.y()(t.data),color:t.color},l.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){l.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){l()}),E.dispatch=C,E.multibar=r,E.legend=a,E.controls=s,E.xAxis=i,E.yAxis=o,E.state=k,E.tooltip=l,E.options=t.utils.optionsFunc.bind(E),E._options=Object.create({},{width:{get:function(){return f},set:function(t){f=t}},height:{get:function(){return p},set:function(t){p=t}},showLegend:{get:function(){return $},set:function(t){$=t}},legendPosition:{get:function(){return x},set:function(t){x=t}},controlsPosition:{get:function(){return v},set:function(t){v=t}},showControls:{get:function(){return g},set:function(t){g=t}},controlLabels:{get:function(){return m},set:function(t){m=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return w},set:function(t){w=t}},noData:{get:function(){return A},set:function(t){A=t}},margin:{get:function(){return u},set:function(t){void 0!==t.top&&(u.top=t.top,c=t.top),u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return L},set:function(t){L=t,S.reset(L),r.duration(L),i.duration(L),o.duration(L)}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e),a.color(h)}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),a.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(E,r),t.utils.initOptions(E),E},t.models.multiChart=function(){"use strict";var e,n,r={top:30,right:20,bottom:50,left:60},i=null,o=t.utils.defaultColor(),a=null,s=null,l=!0,u=null,c=function(t){return t.x},f=function(t){return t.y},p=getInterpolationType(p),h=!0,g=t.interactiveGuideline(),v=!1,m=" (right axis)",$=250,x=d3.scaleLinear(),y=d3.scaleLinear(),b=d3.scaleLinear(),_=t.models.line().yScale(y).duration($),k=t.models.line().yScale(b).duration($),w=t.models.scatter().yScale(y).duration($),A=t.models.scatter().yScale(b).duration($),C=t.models.multiBar().stacked(!1).yScale(y).duration($),M=t.models.multiBar().stacked(!1).yScale(b).duration($),L=t.models.stackedArea().yScale(y).duration($),S=t.models.stackedArea().yScale(b).duration($),E=t.models.axis(d3.axisBottom(x),"bottom").tickPadding(5).duration($),F=t.models.axis(d3.axisLeft(y),"left").duration($),W=t.models.axis(d3.axisRight(b),"right").duration($),D=t.models.legend().height(30),I=t.models.tooltip(),T=d3.dispatch(),O=[_,k,w,A,C,M,L,S];function P(u){return u.each(function(u){var h=d3.select(this);t.utils.initSVG(h),P.update=function(){h.call(P)},P.container=this;var $=t.utils.availableWidth(a,h,r),B=t.utils.availableHeight(s,h,r),N=u.filter(function(t){return"line"==t.type&&1==t.yAxis}),z=u.filter(function(t){return"line"==t.type&&2==t.yAxis}),V=u.filter(function(t){return"scatter"==t.type&&1==t.yAxis}),Y=u.filter(function(t){return"scatter"==t.type&&2==t.yAxis}),H=u.filter(function(t){return"bar"==t.type&&1==t.yAxis}),X=u.filter(function(t){return"bar"==t.type&&2==t.yAxis}),G=u.filter(function(t){return"area"==t.type&&1==t.yAxis}),R=u.filter(function(t){return"area"==t.type&&2==t.yAxis});if(!u||!u.length||!u.filter(function(t){return t.values.length}).length)return t.utils.noData(P,h),P;h.selectAll(".nv-noData").remove();var Z=u.filter(function(t){return!t.disabled&&1==t.yAxis}).map(function(t){return t.values.map(function(t,e){return{x:c(t),y:f(t)}})}),q=u.filter(function(t){return!t.disabled&&2==t.yAxis}).map(function(t){return t.values.map(function(t,e){return{x:c(t),y:f(t)}})});x.domain(d3.extent(d3.merge(Z.concat(q)),function(t){return t.x})).range([0,$]);var j=h.selectAll("g.wrap.multiChart").data([u]),K=j.enter().append("g").attr("class","wrap nvd3 multiChart"),Q=K.append("g"),U=Q.append("g").attr("class","nv-x nv-axis");U=h.selectAll("g.wrap.multiChart").select(".nv-x");var J=Q.append("g").attr("class","nv-y1 nv-axis"),tt=Q.append("g").attr("class","nv-y2 nv-axis"),te=Q.append("g").attr("class","stack1Wrap"),tn=Q.append("g").attr("class","stack2Wrap"),tr=Q.append("g").attr("class","bars1Wrap"),ti=Q.append("g").attr("class","bars2Wrap"),to=Q.append("g").attr("class","scatters1Wrap"),ta=Q.append("g").attr("class","scatters2Wrap"),ts=Q.append("g").attr("class","lines1Wrap"),tl=Q.append("g").attr("class","lines2Wrap"),tu=Q.append("g").attr("class","legendWrap"),tc=Q.append("g").attr("class","nv-interactive");tu=h.selectAll("g.wrap.nv-multiChart").select(".nv-legendWrap"),j.select("g");var td=u.map(function(t,e){return u[e].color||o(t,e)});if(l){var tf=D.align()?$/2:$,tp=D.align()?tf:0;D.width(tf),D.color(td),tu.datum(u.map(function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=t.originalKey+(1==t.yAxis?"":m),t})).call(D),i||D.height()===r.top||(r.top=D.height(),B=t.utils.availableHeight(s,h,r)),tu.attr("transform","translate("+tp+","+-r.top+")")}else tu.selectAll("*").remove();K.attr("transform","translate("+r.left+","+r.top+")"),_.width($).height(B).interpolate(p).color(td.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"line"==u[e].type})),k.width($).height(B).interpolate(p).color(td.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"line"==u[e].type})),w.width($).height(B).color(td.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"scatter"==u[e].type})),A.width($).height(B).color(td.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"scatter"==u[e].type})),C.width($).height(B).color(td.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"bar"==u[e].type})),M.width($).height(B).color(td.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"bar"==u[e].type})),L.width($).height(B).interpolate(p).color(td.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"area"==u[e].type})),S.width($).height(B).interpolate(p).color(td.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"area"==u[e].type})),ts.datum(N.filter(function(t){return!t.disabled})),to.datum(V.filter(function(t){return!t.disabled})),tr.datum(H.filter(function(t){return!t.disabled})),te.datum(G.filter(function(t){return!t.disabled})),tl.datum(z.filter(function(t){return!t.disabled})),ta.datum(Y.filter(function(t){return!t.disabled})),ti.datum(X.filter(function(t){return!t.disabled})),tn.datum(R.filter(function(t){return!t.disabled}));var th=[];if(C.stacked()&&H.length){var th=H.filter(function(t){return!t.disabled}).map(function(t){return t.values});th.length>0&&(th=th.reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})}))}H.length&&th.push({x:0,y:0});var tg=[];if(M.stacked()&&X.length){var tg=X.filter(function(t){return!t.disabled}).map(function(t){return t.values});tg.length>0&&(tg=tg.reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})}))}function tv(t){return d3.transpose(t).map(function(t){return t.map(function(t){return t.y})}).map(function(t){return d3.sum(t)})}if(X.length&&tg.push({x:0,y:0}),y.domain(e||d3.extent(d3.merge(Z).concat(th),function(t){return t.y})).range([0,B]),b.domain(n||d3.extent(d3.merge(q).concat(tg),function(t){return t.y})).range([0,B]),_.yDomain(y.domain()),w.yDomain(y.domain()),C.stacked()){var tm=y.domain([0,d3.max(tv(Z))]).range([0,B]);C.yDomain(tm.domain())}else C.yDomain(y.domain());if(L.yDomain(y.domain()),k.yDomain(b.domain()),A.yDomain(b.domain()),M.stacked()){var t$=b.domain([0,d3.max(tv(q))]).range([0,B]);M.yDomain(t$.domain())}else M.yDomain(b.domain());function tx(t){var e=2===t.series.yAxis?W:F;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},I.duration(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function ty(t){var e=2===t.series.yAxis?W:F;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},I.duration(100).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function tb(t){var e=2===t.series.yAxis?W:F;t.point.x=L.x()(t.point),t.point.y=L.y()(t.point),I.duration(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function t_(t){var e=2===t.series.yAxis?W:F;t.value=C.x()(t.data),t.series={value:C.y()(t.data),color:t.color,key:t.data.key},I.duration(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function tk(){for(var t=0,e=O.length;t=u[0]&&P.x()(t,e)<=u[1]}),f=c[r=t.interactiveBisect(c,e.pointXValue,P.x())],p=P.y()(f,r);null===p||isNaN(p)||s.noHighlightSeries||function t(e,n,r,i){var o={line:{yAxis1:{chart:_,data:N},yAxis2:{chart:k,data:z}},scatter:{yAxis1:{chart:w,data:V},yAxis2:{chart:A,data:Y}},bar:{yAxis1:{chart:C,data:H},yAxis2:{chart:M,data:X}},area:{yAxis1:{chart:L,data:G},yAxis2:{chart:S,data:R}}},a=o[e.type]["yAxis"+e.yAxis].chart,s=o[e.type]["yAxis"+e.yAxis].data.reduce(function(t,n,r){return n.key===e.key?r:t},0);try{a.highlightPoint(s,n,r,void 0)}catch(l){}}(s,r,!0),void 0!==f&&(void 0===n&&(n=f),void 0===i&&(i=x(P.x()(f,r))),a.push({key:s.key,value:p,color:o(s,s.seriesIndex),data:f,yAxis:2==s.yAxis?W:F}))});var s=function(t,e){var n=a[e].yAxis;return null==t?"N/A":n.tickFormat()(t)};g.tooltip.headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(g.tooltip.valueFormatter()||s).data({value:P.x()(n,r),index:r,series:a})(),g.renderGuideLine(i)}),g.dispatch.on("elementMouseout",function(t){tk()})):(_.dispatch.on("elementMouseover.tooltip",tx),k.dispatch.on("elementMouseover.tooltip",tx),_.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),k.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),w.dispatch.on("elementMouseover.tooltip",ty),A.dispatch.on("elementMouseover.tooltip",ty),w.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),A.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),L.dispatch.on("elementMouseover.tooltip",tb),S.dispatch.on("elementMouseover.tooltip",tb),L.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),S.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),C.dispatch.on("elementMouseover.tooltip",t_),M.dispatch.on("elementMouseover.tooltip",t_),C.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),M.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),C.dispatch.on("elementMousemove.tooltip",function(t){I()}),M.dispatch.on("elementMousemove.tooltip",function(t){I()}))}),P}return P.dispatch=T,P.legend=D,P.lines1=_,P.lines2=k,P.scatters1=w,P.scatters2=A,P.bars1=C,P.bars2=M,P.stack1=L,P.stack2=S,P.xAxis=E,P.yAxis1=F,P.yAxis2=W,P.tooltip=I,P.interactiveLayer=g,P.options=t.utils.optionsFunc.bind(P),P._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},xScale:{get:function(){return x},set:function(t){x=t,E.scale(x)}},yDomain1:{get:function(){return e},set:function(t){e=t}},yDomain2:{get:function(){return n},set:function(t){n=t}},noData:{get:function(){return u},set:function(t){u=t}},interpolate:{get:function(){return p},set:function(t){p=t}},legendRightAxisHint:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return r},set:function(t){void 0!==t.top&&(r.top=t.top,i=t.top),r.right=void 0!==t.right?t.right:r.right,r.bottom=void 0!==t.bottom?t.bottom:r.bottom,r.left=void 0!==t.left?t.left:r.left}},color:{get:function(){return o},set:function(e){o=t.utils.getColor(e)}},x:{get:function(){return c},set:function(t){c=t,_.x(t),k.x(t),w.x(t),A.x(t),C.x(t),M.x(t),L.x(t),S.x(t)}},y:{get:function(){return f},set:function(t){f=t,_.y(t),k.y(t),w.y(t),A.y(t),L.y(t),S.y(t),C.y(t),M.y(t)}},useVoronoi:{get:function(){return h},set:function(t){h=t,_.useVoronoi(t),k.useVoronoi(t),L.useVoronoi(t),S.useVoronoi(t)}},useInteractiveGuideline:{get:function(){return v},set:function(t){(v=t)&&(_.interactive(!1),_.useVoronoi(!1),k.interactive(!1),k.useVoronoi(!1),L.interactive(!1),L.useVoronoi(!1),S.interactive(!1),S.useVoronoi(!1),w.interactive(!1),A.interactive(!1))}},duration:{get:function(){return $},set:function(t){$=t,[_,k,L,S,w,A,E,F,W].forEach(function(t){t.duration($)})}}}),t.utils.initOptions(P),P},t.models.ohlcBar=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scaleLinear(),f=d3.scaleLinear(),p=function(t){return t.x},h=function(t){return t.y},g=function(t){return t.open},v=function(t){return t.close},m=function(t){return t.high},$=function(t){return t.low},x=[],y=[],b=!1,_=!0,k=t.utils.defaultColor(),w=!1,A=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(w){return w.each(function(w){u=d3.select(this);var C=t.utils.availableWidth(a,u,o),M=t.utils.availableHeight(s,u,o);t.utils.initSVG(u);var L=C/w[0].values.length*.9;c.domain(e||d3.extent(w[0].values.map(p).concat(x))),b?c.range(r||[.5*C/w[0].values.length,C*(w[0].values.length-.5)/w[0].values.length]):c.range(r||[5+L/2,C-L/2-5]),f.domain(n||[d3.min(w[0].values.map($).concat(y)),d3.max(w[0].values.map(m).concat(y))]).range(i||[M,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+.01*f.domain()[0],f.domain()[1]-.01*f.domain()[1]]):f.domain([-1,1]));var S=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([w[0].values]).enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar");S.attr("transform","translate("+o.left+","+o.top+")");var E=S.append("defs"),F=S.append("g");F.select("g");var W=F.append("g").attr("class","nv-ticks");u.on("click",function(t,e,n){A.call("chartClick",this,{data:e,index:e.index,pos:t,id:l})}),E.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect").attr("width",C).attr("height",M),F.attr("clip-path",_?"url(#nv-chart-clip-path-"+l+")":"");var D=W.selectAll(".nv-tick").data(function(t){return t});D.exit().remove(),D.enter().append("path").attr("class",function(t,e,n){return(g(t,e)>v(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}).attr("d",function(t,e){return"m0,0l0,"+(f(g(t,e))-f(m(t,e)))+"l"+-L/2+",0l"+L/2+",0l0,"+(f($(t,e))-f(g(t,e)))+"l0,"+(f(v(t,e))-f($(t,e)))+"l"+L/2+",0l"+-L/2+",0z"}).attr("transform",function(t,e){return"translate("+c(p(t,e))+","+f(m(t,e))+")"}).attr("fill",function(t,e){return k[0]}).attr("stroke",function(t,e){return k[0]}).attr("x",0).attr("y",function(t,e){return f(Math.max(0,h(t,e)))}).attr("height",function(t,e){return Math.abs(f(h(t,e))-f(0))}),D.attr("class",function(t,e,n){return(g(t,e)>v(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}),D.transition().duration(0).attr("transform",function(t,e){return"translate("+c(p(t,e))+","+f(m(t,e))+")"}).attr("d",function(t,e){var n=C/w[0].values.length*.9;return"m0,0l0,"+(f(g(t,e))-f(m(t,e)))+"l"+-n/2+",0l"+n/2+",0l0,"+(f($(t,e))-f(g(t,e)))+"l0,"+(f(v(t,e))-f($(t,e)))+"l"+n/2+",0l"+-n/2+",0z"})}),C}return C.highlightPoint=function(t,e){C.clearHighlights(),u.select(".nv-ohlcBar .nv-tick-0-"+t).classed("hover",e)},C.clearHighlights=function(){u.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},forceX:{get:function(){return x},set:function(t){x=t}},forceY:{get:function(){return y},set:function(t){y=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return _},set:function(t){_=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return w},set:function(t){w=t}},x:{get:function(){return p},set:function(t){p=t}},y:{get:function(){return h},set:function(t){h=t}},open:{get:function(){return g()},set:function(t){g=t}},close:{get:function(){return v()},set:function(t){v=t}},high:{get:function(){return m},set:function(t){m=t}},low:{get:function(){return $},set:function(t){$=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!=t.top?t.top:o.top,o.right=void 0!=t.right?t.right:o.right,o.bottom=void 0!=t.bottom?t.bottom:o.bottom,o.left=void 0!=t.left?t.left:o.left}},color:{get:function(){return k},set:function(e){k=t.utils.getColor(e)}}}),t.utils.initOptions(C),C},t.models.parallelCoordinates=function(){"use strict";var e,n,r,i={top:30,right:0,bottom:10,left:0},o=null,a=null,s=null,l=null,u=d3.scalePoint(),c={},f="undefined values",p=[],h=[],g=[],v=!0,m=t.utils.defaultColor(),$=[],x=[],y=[],b=[],_=1,k=d3.line(),w=d3.axisLeft(d3.scaleLinear()),A=d3.dispatch("start","brush","end","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),C=t.utils.renderWatch(A);function M(L){return C.reset(),L.each(function(C){var M,L,S=d3.select(this);if(s=t.utils.availableWidth(o,S,i),l=t.utils.availableHeight(a,S,i),t.utils.initSVG(S),void 0===C[0].values){var E=[];C.forEach(function(t){var e={};Object.keys(t).forEach(function(n){"name"!==n&&(e[n]=t[n])}),E.push({key:t.name,values:e})}),C=E}var F=C.map(function(t){return t.values});0===x.length&&(x=C),g=p.sort(function(t,e){return t.currentPosition-e.currentPosition}).map(function(t){return t.key}),h=p.filter(function(t){return!t.disabled}),u.range([0,s],1).domain(h.map(function(t){return t.key}));var W={},D=!1,I=[];g.forEach(function(t){var e=d3.extent(F,function(e){return+e[t]}),n=e[0],r=e[1],i=!1;(isNaN(n)||isNaN(r))&&(i=!0,n=0,r=0),n===r&&(n-=1,r+=1);var o=$.filter(function(e){return e.dimension==t});0!==o.length&&(i?(n=c[t].domain()[0],r=c[t].domain()[1]):!o[0].hasOnlyNaN&&v?(n=n>o[0].extent[0]?o[0].extent[0]:n,r=rb.indexOf(e.key)){var o=d3.scaleLinear().domain([i,n[1]]).range([l-12,r[1]]);c[e.key].brush.extent([[o.range()[0],0],[o.range()[1],1]]),b.push(e.key)}if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key])))return[u(e.key),c[e.key](i)]}return void 0!==M&&(b.length>0||D?(M.style("display","inline"),L.style("display","inline")):(M.style("display","none"),L.style("display","none"))),[u(e.key),c[e.key](t.values[e.key])]}))}function j(t){$.forEach(function(e){var n=c[e.dimension].brush.extent();e.hasOnlyNaN&&(e.extent[1]=(c[e.dimension].domain()[1]-n[0])*(e.extent[1]-e.extent[0])/(W[e.dimension]-e.extent[0])+n[0]),e.hasNaN&&(e.extent[0]=n[0]),t&&c[e.dimension].brush.extent(e.extent)}),r.select(".nv-brushBackground").each(function(t){d3.select(this).call(c[t.key].brush)}).selectAll("rect").attr("x",-8).attr("width",16),J()}function K(){!1===v&&(v=!0,j(!0))}function Q(t){R=(G=g.filter(function(e){return null!==t.selection})).map(function(t){return c[t].brush.extent()}),$=[],G.forEach(function(t,e){$[e]={dimension:t,extent:R[e],hasNaN:!1,hasOnlyNaN:!1}}),x=[],e.style("display",function(t){var e=G.every(function(e,n){return!!(isNaN(t.values[e])||isNaN(parseFloat(t.values[e])))&&R[n][0]==c[e].brush.extent()[1][0]||R[n][0]<=t.values[e]&&t.values[e]<=R[n][1]&&!isNaN(parseFloat(t.values[e]))});return e&&x.push(t),e?null:"none"}),J(),A.call("brush",this,{filters:$,active:x})}function U(){var t=G.length>0;$.forEach(function(t){t.extent[0]===c[t.dimension].brush.extent()[1]&&b.indexOf(t.dimension)>=0&&(t.hasNaN=!0),t.extent[1]c[t.key].domain()[0]&&(I[t.key]=[n[0].extent[1]]),n[0].extent[0]>=c[t.key].domain()[0]&&I[t.key].push(n[0].extent[0])),d3.select(this).call(w.scale(c[t.key]).tickFormat(t.format).tickValues(I[t.key]))})}function tt(t){var e=y[t];return null==e?u(t):e}x=[],e.style("display",function(t){var e=G.every(function(e,n){return!!(isNaN(t.values[e])||isNaN(parseFloat(t.values[e])))&&R[n][0]==c[e].brush.extent()[1][0]||R[n][0]<=t.values[e]&&t.values[e]<=R[n][1]&&!isNaN(parseFloat(t.values[e]))});return e&&x.push(t),e?null:"none"}),($.length>0||!t.utils.arrayEquals(x,Z))&&A.call("activeChanged",this,x)}),M}return M.dispatch=A,M.options=t.utils.optionsFunc.bind(M),M._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},dimensionData:{get:function(){return p},set:function(t){p=t}},displayBrush:{get:function(){return v},set:function(t){v=t}},filters:{get:function(){return $},set:function(t){$=t}},active:{get:function(){return x},set:function(t){x=t}},lineTension:{get:function(){return _},set:function(t){_=t}},undefinedValuesLabel:{get:function(){return f},set:function(t){f=t}},dimensions:{get:function(){return p.map(function(t){return t.key})},set:function(e){t.deprecated("dimensions","use dimensionData instead"),0===p.length?e.forEach(function(t){p.push({key:t})}):e.forEach(function(t,e){p[e].key=t})}},dimensionNames:{get:function(){return p.map(function(t){return t.key})},set:function(e){t.deprecated("dimensionNames","use dimensionData instead"),g=[],0===p.length?e.forEach(function(t){p.push({key:t})}):e.forEach(function(t,e){p[e].key=t})}},dimensionFormats:{get:function(){return p.map(function(t){return t.format})},set:function(e){t.deprecated("dimensionFormats","use dimensionData instead"),0===p.length?e.forEach(function(t){p.push({format:t})}):e.forEach(function(t,e){p[e].format=t})}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return m},set:function(e){m=t.utils.getColor(e)}}}),t.utils.initOptions(M),M},t.models.parallelCoordinatesChart=function(){"use strict";var e=t.models.parallelCoordinates(),n=t.models.legend(),r=t.models.tooltip();t.models.tooltip();var i={top:0,right:0,bottom:0,left:0},o=null,a=null,s=null,l=!0,u=t.utils.defaultColor(),c=t.utils.state(),f=[],p=!0,h=null,g=null,v="undefined",m=d3.dispatch("dimensionsOrder","end","stateChange","changeState","renderEnd"),$=t.utils.renderWatch(m);function x(r){return $.reset(),$.models(e),r.each(function(r){var u,g=d3.select(this);t.utils.initSVG(g);var v,$,y=this,b=t.utils.availableWidth(a,g,i),_=t.utils.availableHeight(s,g,i);if(x.update=function(){g.call(x)},x.container=this,c.setter((v=f,function(t){void 0!==t.active&&v.forEach(function(e,n){e.disabled=!t.active[n]})}),x.update).getter(($=f,function(){return{active:$.map(function(t){return!t.disabled})}})).update(),c.disabled=f.map(function(t){return!!t.disabled}),(f=f.map(function(t){return t.disabled=!!t.disabled,t})).forEach(function(t,e){t.originalPosition=isNaN(t.originalPosition)?e:t.originalPosition,t.currentPosition=isNaN(t.currentPosition)?e:t.currentPosition}),!h)for(u in h={},c)c[u]instanceof Array?h[u]=c[u].slice(0):h[u]=c[u];if(!r||!r.length)return t.utils.noData(x,g),x;g.selectAll(".nv-noData").remove();var k=g.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([r]).enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart");k.attr("transform","translate("+i.left+","+i.top+")");var w=k.append("g");k.select("g");var A=w.append("g").attr("class","nv-parallelCoordinatesWrap"),C=w.append("g").attr("class","nv-legendWrap");C=g.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").select(".nv-legendWrap"),w.select("rect").attr("width",b).attr("height",_>0?_:0),l?(n.width(b).color(function(t){return"rgb(188,190,192)"}),C.datum(f.sort(function(t,e){return t.originalPosition-e.originalPosition})).call(n),o||n.height()===i.top||(i.top=n.height(),_=t.utils.availableHeight(s,g,i)),C.attr("transform","translate( 0 ,"+-i.top+")")):C.selectAll("*").remove(),e.width(b).height(_).dimensionData(f).displayBrush(p),A.datum(r).transition().duration(0).call(e),e.dispatch.on("end",function(t,e){e?(p=!0,m.call("end",this,t)):p=!1}),n.dispatch.on("stateChange",function(t){for(var e in t)c[e]=t[e];m.call("stateChange",y,t),x.update()}),e.dispatch.on("dimensionsOrder",function(t){f.sort(function(t,e){return t.currentPosition-e.currentPosition});var e=!1;f.forEach(function(t,n){t.currentPosition=n,t.currentPosition!==t.originalPosition&&(e=!0)}),m.call("dimensionsOrder",f,e)}),m.on("changeState",function(t){void 0!==t.disabled&&(f.forEach(function(e,n){e.disabled=t.disabled[n]}),c.disabled=t.disabled),x.update()})}),$.renderEnd("parraleleCoordinateChart immediate"),x}return r.contentGenerator(function(t){var e='";return 0!==t.series.length&&(e+='',t.series.forEach(function(t){e=e+'"}),e+=""),e+="
'+t.key+"
'+t.key+''+t.value+"
"}),e.dispatch.on("elementMouseover.tooltip",function(t){var e={key:t.label,color:t.color,series:[]};t.values&&(Object.keys(t.values).forEach(function(n){var r,i=t.dimensions.filter(function(t){return t.key===n})[0];i&&(r=isNaN(t.values[n])||isNaN(parseFloat(t.values[n]))?v:i.format(t.values[n]),e.series.push({idx:i.currentPosition,key:n,value:r,color:i.color}))}),e.series.sort(function(t,e){return t.idx-e.idx})),r.data(e).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){r.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){r()}),x.dispatch=m,x.parallelCoordinates=e,x.legend=n,x.tooltip=r,x.options=t.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},defaultState:{get:function(){return h},set:function(t){h=t}},dimensionData:{get:function(){return f},set:function(t){f=t}},displayBrush:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return g},set:function(t){g=t}},nanValue:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,o=t.top),i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return u},set:function(r){u=t.utils.getColor(r),n.color(u),e.color(u)}}}),t.utils.inheritOptions(x,e),t.utils.initOptions(x),x},t.models.pie=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},n=500,r=500,i=function(t){return t.x},o=function(t){return t.y},a=Math.floor(1e4*Math.random()),s=null,l=t.utils.defaultColor(),u=d3.format(",.2f"),c=!0,f=!1,p="key",h=.02,g=!1,v=!1,m=!1,$=!0,x=0,y=!1,b=!1,_=!1,k=!1,w=0,A=.5,C=250,M=d3.transition().duration(C).ease(d3.easeLinear),L=(d3.transition().duration(70).ease(d3.easeLinear),d3.transition().duration(50).ease(d3.easeLinear),[]),S=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=[],F=[],W=t.utils.renderWatch(S);function D(M){return W.reset(),M.each(function(M){var D=n-e.left-e.right,I=r-e.top-e.bottom,T=Math.min(D,I)/2,O=[],P=[];if(s=d3.select(this),0===L.length)for(var B=T-T/10,N=A*T,z=0;z=h&&(tt[te(r)]&&(r[1]-=14),tt[te(r)]=!0),"translate("+r+")"}),J.select(".nv-label text").style("text-anchor",function(t,e){return y?(t.startAngle+t.endAngle)/290?e-180:e}}),W.renderEnd("pie immediate"),D}return D.dispatch=S,D.options=t.utils.optionsFunc.bind(D),D._options=Object.create({},{arcsRadius:{get:function(){return L},set:function(t){L=t}},width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},showLabels:{get:function(){return c},set:function(t){c=t}},title:{get:function(){return m},set:function(t){m=t}},titleOffset:{get:function(){return x},set:function(t){x=t}},labelThreshold:{get:function(){return h},set:function(t){h=t}},hideOverlapLabels:{get:function(){return g},set:function(t){g=t}},valueFormat:{get:function(){return u},set:function(t){u=t}},x:{get:function(){return i},set:function(t){i=t}},id:{get:function(){return a},set:function(t){a=t}},endAngle:{get:function(){return k},set:function(t){k=t}},startAngle:{get:function(){return b},set:function(t){b=t}},padAngle:{get:function(){return _},set:function(t){_=t}},cornerRadius:{get:function(){return w},set:function(t){w=t}},donutRatio:{get:function(){return A},set:function(t){A=t}},labelsOutside:{get:function(){return f},set:function(t){f=t}},labelSunbeamLayout:{get:function(){return y},set:function(t){y=t}},donut:{get:function(){return v},set:function(t){v=t}},growOnHover:{get:function(){return $},set:function(t){$=t}},pieLabelsOutside:{get:function(){return f},set:function(e){f=e,t.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return f},set:function(e){f=e,t.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return u},set:function(e){u=e,t.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return e},set:function(t){e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left}},duration:{get:function(){return C},set:function(t){C=t,W.reset(C),M=d3.transition().duration(C).ease(d3.easeLinear)}},y:{get:function(){return o},set:function(t){o="function"==typeof t?t:function(){return t}}},color:{get:function(){return l},set:function(e){l=t.utils.getColor(e)}},labelType:{get:function(){return p},set:function(t){p=t||"key"}}}),t.utils.initOptions(D),D},t.models.pieChart=function(){"use strict";var e=t.models.pie(),n=t.models.legend(),r=t.models.tooltip(),i={top:30,right:20,bottom:20,left:20},o=null,a=null,s=null,l=!1,u=!0,c="top",f=t.utils.defaultColor(),p=t.utils.state(),h=null,g=null,v=250,m=d3.dispatch("stateChange","changeState","renderEnd");r.duration(0).headerEnabled(!1).valueFormatter(function(t,n){return e.valueFormat()(t,n)});var $=t.utils.renderWatch(m);function x(r){return $.reset(),$.models(e),r.each(function(r){var l,f=d3.select(this);t.utils.initSVG(f);var g,v,$=t.utils.availableWidth(a,f,i),y=t.utils.availableHeight(s,f,i);if(x.update=function(){f.transition().call(x)},x.container=this,p.setter((g=r,function(t){void 0!==t.active&&g.forEach(function(e,n){e.disabled=!t.active[n]})}),x.update).getter((v=r,function(){return{active:v.map(function(t){return!t.disabled})}})).update(),p.disabled=r.map(function(t){return!!t.disabled}),!h)for(l in h={},p)p[l]instanceof Array?h[l]=p[l].slice(0):h[l]=p[l];if(!r||!r.length)return t.utils.noData(x,f),x;f.selectAll(".nv-noData").remove();var b=f.selectAll("g.nv-wrap.nv-pieChart").data([r]).enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart");b.append("g");var _=b.select("g"),k=_.append("g").attr("class","nv-pieWrap");k=f.selectAll("g.nv-wrap.nv-pieChart").select(".nv-pieWrap");var w=_.append("g").attr("class","nv-legendWrap");if(w=f.selectAll("g.nv-wrap.nv-pieChart").select(".nv-legendWrap"),u){if("top"===c)n.width($).key(e.x()),w.datum(r).call(n),o||n.height()===i.top||(i.top=n.height(),y=t.utils.availableHeight(s,f,i)),w.attr("transform","translate(0,"+-i.top+")");else if("right"===c){var A=t.models.legend().width();$/2a.indexOf(t.target)&&a.push(t.target)})}),l=a,++u;s&&(e=u,o.forEach(function(t){t.sourceLinks.length||(t.x=e-1)})),r=(i[0]-n)/(u-1),o.forEach(function(t){t.x*=r})}(),function t(e){var n,s=d3.group().key(function(t){return t.x}).sortKeys(d3.ascending).entries(o).map(function(t){return t.values});n=d3.min(s,function(t){return(i[1]-(t.length-1)*r)/d3.sum(t,g)}),s.forEach(function(t){t.forEach(function(t,e){t.y=e,t.dy=t.value*n})}),a.forEach(function(t){t.dy=t.value*n}),p(),h();for(var l=1;e>0;--e)c(l*=.99),p(),h(),u(l),p(),h();function u(t){s.forEach(function(n,r){n.forEach(function(n){if(n.targetLinks.length){var r=d3.sum(n.targetLinks,e)/d3.sum(n.targetLinks,g);n.y+=(r-f(n))*t}})});function e(t){return(t.source.y+t.sy+t.dy/2)*t.value}}function c(t){s.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var r=d3.sum(n.sourceLinks,e)/d3.sum(n.sourceLinks,g);n.y+=(r-f(n))*t}})});function e(t){return(t.target.y+t.ty+t.dy/2)*t.value}}function p(){s.forEach(function(t){var e,n,o,a=0,s=t.length;for(t.sort(v),o=0;o0&&(e.y+=n),a=e.y+e.dy+r;if((n=a-r-i[1])>0)for(a=e.y-=n,o=s-2;o>=0;--o)(n=(e=t[o]).y+e.dy+r-a)>0&&(e.y-=n),a=e.y})}function v(t,e){return t.y-e.y}}(t)},u=function(){h()},c=function(){var t=.5;function e(e){var n=e.source.x+e.source.dx,r=e.target.x,i=d3.interpolateNumber(n,r),o=i(t),a=i(1-t),s=e.source.y+e.sy+e.dy/2,l=e.target.y+e.ty+e.dy/2;return"M"+n+","+s+"C"+o+","+s+" "+a+","+l+" "+r+","+l}return e.curvature=function(n){return arguments.length?(t=+n,e):t},e},f=function(t){return t.y+t.dy/2};function p(){o.forEach(function(t){t.targetLinks.length||(t.x=d3.min(t.sourceLinks,function(t){return t.target.x})-1)})}function h(){function t(t,e){return t.source.y-e.source.y}function e(t,e){return t.target.y-e.target.y}o.forEach(function(n){n.sourceLinks.sort(e),n.targetLinks.sort(t)}),o.forEach(function(t){var e=0,n=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=n,n+=t.dy})})}function g(t){return t.value}return e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{nodeWidth:{get:function(){return n},set:function(t){n=+t}},nodePadding:{get:function(){return r},set:function(t){r=t}},nodes:{get:function(){return o},set:function(t){o=t}},links:{get:function(){return a},set:function(t){a=t}},size:{get:function(){return i},set:function(t){i=t}},sinksRight:{get:function(){return s},set:function(t){s=t}},layout:{get:function(){l(32)},set:function(t){l(t)}},relayout:{get:function(){u()},set:function(t){}},center:{get:function(){return f()},set:function(t){"function"==typeof t&&(f=t)}},link:{get:function(){return c()},set:function(t){return"function"==typeof t&&(c=t),c()}}}),t.utils.initOptions(e),e},t.models.sankeyChart=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=t.models.sankey(),r=600,i=400,o=36,a=40,s="units",l=void 0,u=d3.format(",.0f"),c=function(t){return u(t)+" "+s},f=d3.scaleOrdinal(d3.schemeAccent),p=function(t){return t.source.name+" → "+t.target.name+"\n"+c(t.value)},h=function(t){return t.color=f(t.name.replace(/ .*/,""))},g=function(t){return d3.rgb(t.color).darker(2)},v=function(t){return t.name+"\n"+c(t.value)},m=function(t,e){t.append("text").attr("x",0).attr("y",0).attr("class","nvd3-sankey-chart-error").attr("text-anchor","middle").text(e)};function $(t){return t.each(function(e){var s={nodes:[{node:1,name:"Test 1"},{node:2,name:"Test 2"},{node:3,name:"Test 3"},{node:4,name:"Test 4"},{node:5,name:"Test 5"},{node:6,name:"Test 6"}],links:[{source:0,target:1,value:2295},{source:0,target:5,value:1199},{source:1,target:2,value:1119},{source:1,target:5,value:1176},{source:2,target:3,value:487},{source:2,target:5,value:632},{source:3,target:4,value:301},{source:3,target:5,value:186}]},u=!1,c=!1;if(("object"==typeof e.nodes&&e.nodes.length)>=0&&("object"==typeof e.links&&e.links.length)>=0&&(u=!0),e.nodes&&e.nodes.length>0&&e.links&&e.links.length>0&&(c=!0),!u)return console.error("NVD3 Sankey chart error:","invalid data format for",e),console.info("Valid data format is: ",s,JSON.stringify(s)),m(t,"Error loading chart, data is invalid"),!1;if(!c)return m(t,"No data available"),!1;var f=t.append("svg").attr("width",r).attr("height",i).append("g").attr("class","nvd3 nv-wrap nv-sankeyChart");n.nodeWidth(o).nodePadding(a).size([r,i]);var $=n.link();n.nodes(e.nodes).links(e.links).layout(32).center(l);var x=f.append("g").selectAll(".link").data(e.links).enter().append("path").attr("class","link").attr("d",$).style("stroke-width",function(t){return Math.max(1,t.dy)}).sort(function(t,e){return e.dy-t.dy});x.append("title").text(p);var y=f.append("g").selectAll(".node").data(e.nodes).enter().append("g").attr("class","node").attr("transform",function(t){return"translate("+t.x+","+t.y+")"}).call(d3.drag().subject(function(t){return t}).on("start",function(){this.parentNode.appendChild(this)}).on("drag",function t(e,r){d3.select(this).attr("transform","translate("+r.x+","+(r.y=Math.max(0,Math.min(i-r.dy,e.y)))+")"),n.relayout(),x.attr("d",$)}));y.append("rect").attr("height",function(t){return t.dy}).attr("width",n.nodeWidth()).style("fill",h).style("stroke",g).append("title").text(v),y.append("text").attr("x",-6).attr("y",function(t){return t.dy/2}).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).text(function(t){return t.name}).filter(function(t){return t.xMath.abs(e[r][0]-e[r+1][0])&&1e-4>Math.abs(e[r][1]-e[r+1][1])?e.splice(r+1,1):r++;var i=Array.from(d3.Delaunay.from(e,t=>t[0],t=>t[1]).voronoi([n[0][0],n[0][1],n[2][0],n[2][1]]).cellPolygons()).map(function(t,n){return{data:t,series:e[n][2],point:e[n][3]}}),o=td.selectAll("path").data(i).enter().append("svg:path").attr("d",function(t){return t&&t.data&&0!==t.data.length?"M"+t.data.join(",")+"Z":"M 0 0"}).attr("id",function(t,e){return"nv-path-"+e}).attr("clip-path",function(t,e){return"url(#nv-clip-"+g+"-"+e+")"});D&&o.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),W&&(tf.selectAll("*").remove(),tf.selectAll("clipPath").data(e).enter().append("svg:clipPath").attr("id",function(t,e){return"nv-clip-"+g+"-"+e}).append("svg:circle").attr("cx",function(t){return t[0]}).attr("cy",function(t){return t[1]}).attr("r",I));var a=function(t,e,n,r){if(Z)return 0;setCoordinates(e.pageX,e.pageY);var i=X[n.seriesIndex||n.series];if(void 0!==i){var o=i.values[n.point];o.color=p(i,n.seriesIndex),o.x=y(o),o.y=b(o);var a=v.node().getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=window.pageXOffset||document.documentElement.scrollLeft,c={left:m(y(o,n.point))+a.left+l+u.left+10,top:$(b(o,n.point))+a.top+s+u.top+10};Y.call(r,this,{point:o,series:i,pos:c,relativePos:[m(y(o,n.point))+u.left,$(b(o,n.point))+u.top],seriesIndex:n.seriesIndex||n.series,pointIndex:n.point,event:d3.event,element:t})}};o.on("click",function(t,e){a(this,t,e,"elementClick")}).on("dblclick",function(t,e){a(this,t,e,"elementDblClick")}).on("mouseover",function(t,e){a(this,t,e,"elementMouseover")}).on("mouseout",function(t,e,n){a(this,t,e,"elementMouseout")})}else v.selectAll(".nv-group").selectAll(".nv-point").on("click",function(t,e){if(Z||!X[t[0].series])return 0;var n=X[t[0].series],r=n.values[e];Y.call("elementClick",this,{point:r,series:n,pos:[m(y(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(y(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e,event:d3.event,element:this})}).on("dblclick",function(t,e){if(Z||!X[t[0].series])return 0;var n=X[t[0].series],r=n.values[e];Y.call("elementDblClick",this,{point:r,series:n,pos:[m(y(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(y(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e})}).on("mouseover",function(t,e){if(Z||!X[t[0].series])return 0;var n=X[t[0].series],r=n.values[e];Y.call("elementMouseover",this,{point:r,series:n,pos:[m(y(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(y(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e,color:p(t[0],e)})}).on("mouseout",function(t,e){if(Z||!X[t[0].series])return 0;var n=X[t[0].series],r=n.values[e];Y.call("elementMouseout",this,{point:r,series:n,pos:[m(y(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(y(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e,color:p(t[0],e)})})}ts.attr("transform","translate("+u.left+","+u.top+")"),tu.append("clipPath").attr("id","nv-edge-clip-"+g).append("rect").attr("transform","translate( -10, -10)").attr("width",K+20).attr("height",tt>0?tt+20:0),F&&tc.attr("clip-path",F?"url(#nv-edge-clip-"+g+")":""),Z=!0;var th=v.select("g.nv-groups").selectAll("g.nv-group").data(function(t){return t},function(t){return t.key}),tg=th.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).attr("class",function(t,e){return(t.classed||"")+" nv-group nv-series-"+e}).classed("nv-noninteractive",!M).classed("hover",function(t){return t.hover});th.exit().remove();var tv=th.merge(tg);tv.watchTransition(q,"scatter: groups").style("fill",function(t,e){return p(t,e)}).style("stroke",function(t,e){return t.pointBorderColor||h||p(t,e)}).style("stroke-opacity",1).style("fill-opacity",.5);var tm=tv.selectAll("path.nv-point").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return L(t[0],e)})}),t$=tm.enter().append("path").attr("class",function(t){return"nv-point nv-point-"+t[1]}).style("fill",function(t){return t.color}).style("stroke",function(t){return t.color}).attr("transform",function(r){return"translate("+t.utils.NaNtoZero(e(y(r[0],r[1])))+","+t.utils.NaNtoZero(n(b(r[0],r[1])))+")"}).attr("d",t.utils.symbol().type(function(t){return k(t[0])}).size(function(t){return x(_(t[0],t[1]))}));tm.exit().each(Q).remove();var tx=tm.merge(t$);if(tv.exit().selectAll("path.nv-point").watchTransition(q,"scatter exit").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(m(y(e[0],e[1])))+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"}).remove(),tx.filter(function(t){return U(t,"x",y,"y",b)||ti||to||ta}).watchTransition(q,"scatter points").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(m(y(e[0],e[1])))+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"}),tx.filter(function(t){return U(t,"shape",k,"size",_)||ti||to||ta}).watchTransition(q,"scatter points").attr("d",t.utils.symbol().type(function(t){return k(t[0])}).size(function(t){return x(_(t[0],t[1]))})),R){var ty=tv.selectAll(".nv-label").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return L(t[0],e)})}),tb=ty.enter().append("text").style("fill",function(t,e){return t.color}).style("stroke-opacity",0).style("fill-opacity",1).attr("transform",function(r){return"translate("+(t.utils.NaNtoZero(e(y(r[0],r[1])))+Math.sqrt(x(_(r[0],r[1]))/Math.PI)+2)+","+t.utils.NaNtoZero(n(b(r[0],r[1])))+")"}).text(function(t,e){return t[0].label});ty.exit().remove();var t_=ty.merge(tb);tv.exit().selectAll("path.nv-label").watchTransition(q,"scatter exit").attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(m(y(e[0],e[1])))+Math.sqrt(x(_(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"}).remove(),t_.each(function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)}),t_.watchTransition(q,"scatter labels").text(function(t,e){return t[0].label}).attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(m(y(e[0],e[1])))+Math.sqrt(x(_(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"})}G?(clearTimeout(l),l=setTimeout(tp,G)):tp(),e=m.copy(),n=$.copy(),r=x.copy(),a=c,s=f}),q.renderEnd("scatter immediate"),J}return J.dispatch=Y,J.options=t.utils.optionsFunc.bind(J),J._calls=new function(){this.clearHighlights=function(){return t.dom.write(function(){v.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(e,n,r){t.dom.write(function(){v.select(".nv-groups").selectAll(".nv-series-"+e).selectAll(".nv-point-"+n).classed("hover",r)})}},Y.on("elementMouseover.point",function(t){M&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)}),Y.on("elementMouseout.point",function(t){M&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!1)}),J._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},xScale:{get:function(){return m},set:function(t){m=t}},yScale:{get:function(){return $},set:function(t){$=t}},pointScale:{get:function(){return x},set:function(t){x=t}},xDomain:{get:function(){return T},set:function(t){T=t}},yDomain:{get:function(){return O},set:function(t){O=t}},pointDomain:{get:function(){return N},set:function(t){N=t}},xRange:{get:function(){return P},set:function(t){P=t}},yRange:{get:function(){return B},set:function(t){B=t}},pointRange:{get:function(){return z},set:function(t){z=t}},forceX:{get:function(){return w},set:function(t){w=t}},forceY:{get:function(){return A},set:function(t){A=t}},forcePoint:{get:function(){return C},set:function(t){C=t}},interactive:{get:function(){return M},set:function(t){M=t}},pointActive:{get:function(){return L},set:function(t){L=t}},padDataOuter:{get:function(){return E},set:function(t){E=t}},padData:{get:function(){return S},set:function(t){S=t}},clipEdge:{get:function(){return F},set:function(t){F=t}},clipVoronoi:{get:function(){return W},set:function(t){W=t}},clipRadius:{get:function(){return I},set:function(t){I=t}},showVoronoi:{get:function(){return D},set:function(t){D=t}},id:{get:function(){return g},set:function(t){g=t}},interactiveUpdateDelay:{get:function(){return G},set:function(t){G=t}},showLabels:{get:function(){return R},set:function(t){R=t}},pointBorderColor:{get:function(){return h},set:function(t){h=t}},x:{get:function(){return y},set:function(t){y="function"==typeof t?t:function(){return t}}},y:{get:function(){return b},set:function(t){b="function"==typeof t?t:function(){return t}}},pointSize:{get:function(){return _},set:function(t){_="function"==typeof t?t:function(){return t}}},pointShape:{get:function(){return k},set:function(t){k="function"==typeof t?t:function(){return t}}},margin:{get:function(){return u},set:function(t){u.top=void 0!==t.top?t.top:u.top,u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return X},set:function(t){X=t,q.reset(X)}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e)}},useVoronoi:{get:function(){return H},set:function(t){!1===(H=t)&&(W=!1)}}}),t.utils.initOptions(J),J},t.models.scatterChart=function(){"use strict";var e=t.models.scatter(),n=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),r=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),i=t.models.legend(),o=t.models.distribution(),a=t.models.distribution(),s=t.models.tooltip(),l={top:30,right:20,bottom:50,left:75},u=null,c=null,f=null,p=null,h=t.utils.defaultColor(),g=e.xScale(),v=e.yScale(),m=!1,$=!1,x=!0,y=!0,b=!0,_="top",k=!1,w=t.utils.state(),A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),M=null,L=250,S=d3.transition().duration(L).ease(d3.easeLinear),E=!1;e.xScale(g).yScale(v),n.tickPadding(10),r.tickPadding(10),o.axis("x"),a.axis("y"),s.headerFormatter(function(t,e){return n.tickFormat()(t,e)}).valueFormatter(function(t,e){return r.tickFormat()(t,e)});var F,W,D=t.utils.renderWatch(C,L);function I(_){return D.reset(),D.models(e),y&&D.models(n),b&&D.models(r),m&&D.models(o),$&&D.models(a),_.each(function(_){var M,S=this;p=d3.select(this),t.utils.initSVG(p);var T,O,P=t.utils.availableWidth(c,p,l),B=t.utils.availableHeight(f,p,l);if(I.update=function(){0===L?p.call(I):p.transition().duration(L).call(I)},I.container=this,w.setter((T=_,function(t){void 0!==t.active&&T.forEach(function(e,n){e.disabled=!t.active[n]})}),I.update).getter((O=_,function(){return{active:O.map(function(t){return!t.disabled})}})).update(),w.disabled=_.map(function(t){return!!t.disabled}),!A)for(M in A={},w)w[M]instanceof Array?A[M]=w[M].slice(0):A[M]=w[M];if(!_||!_.length||!_.filter(function(t){return t.values.length}).length)return t.utils.noData(I,p),D.renderEnd("scatter immediate"),I;p.selectAll(".nv-noData").remove(),g=e.xScale(),v=e.yScale(),_.forEach(function(t,e){t.seriesIndex=e});var N=p.selectAll("g.nv-wrap.nv-scatterChart").data([_]).enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+e.id()),z=N.append("g");z.select("g"),z.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none");var V=z.append("g").attr("class","nv-x nv-axis");V=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-x");var Y=z.append("g").attr("class","nv-y nv-axis");Y=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-y");var H=z.append("g").attr("class","nv-scatterWrap");H=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-scatterWrap");var X=z.append("g").attr("class","nv-regressionLinesWrap");X=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-regressionLinesWrap");var G=z.append("g").attr("class","nv-distWrap");G=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-distWrap");var R=z.append("g").attr("class","nv-legendWrap");k&&Y.attr("transform","translate("+P+",0)"),R=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-legendWrap"),x?(i.width(P),R.datum(_).call(i),u||i.height()===l.top||(l.top=i.height(),B=t.utils.availableHeight(f,p,l)),R.attr("transform","translate(0,"+-l.top+")")):R.selectAll("*").remove(),N.attr("transform","translate("+l.left+","+l.top+")"),e.width(P).height(B).color(_.map(function(t,e){return t.color=t.color||h(t,e),t.color}).filter(function(t,e){return!_[e].disabled})).showLabels(E),H.datum(_.filter(function(t){return!t.disabled})).call(e),X.attr("clip-path","url(#nv-edge-clip-"+e.id()+")"),X.selectAll(".nv-regLines").data(function(t){return t}).enter().append("g").attr("class","nv-regLines").selectAll(".nv-regLine").data(function(t){return[t]}).enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0).filter(function(t){return t.intercept&&t.slope}).watchTransition(D,"scatterPlusLineChart: regline").attr("x1",g.range()[0]).attr("x2",g.range()[1]).attr("y1",function(t,e){return v(g.domain()[0]*t.slope+t.intercept)}).attr("y2",function(t,e){return v(g.domain()[1]*t.slope+t.intercept)}).style("stroke",function(t,e,n){return h(t,n)}).style("stroke-opacity",function(t,e){return t.disabled||void 0===t.slope||void 0===t.intercept?0:1}),y&&(n.scale(g)._ticks(t.utils.calcTicksX(P/100,_)),n.tickSizeInner(-B),V.attr("transform","translate(0,"+v.range()[0]+")").call(n)),b&&(r.scale(v)._ticks(t.utils.calcTicksY(B/36,_)),r.tickSizeInner(-P),Y.call(r)),o.getData(e.x()).scale(g).width(P).color(_.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!_[e].disabled})),G.append("g").attr("class","nv-distributionX").attr("transform","translate(0,"+v.range()[0]+")").datum(_.filter(function(t){return!t.disabled})).call(o).style("opacity",function(){return m?"1":"1e-6"}).watchTransition(D,"scatterPlusLineChart").style("opacity",function(){return m?"1":"1e-6"}),a.getData(e.y()).scale(v).width(B).color(_.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!_[e].disabled})),G.append("g").attr("class","nv-distributionY").attr("transform","translate("+(k?P:-a.size())+",0)").datum(_.filter(function(t){return!t.disabled})).call(a).style("opacity",function(){return $?"1":"1e-6"}).watchTransition(D,"scatterPlusLineChart").style("opacity",function(){return $?"1":"1e-6"}),i.dispatch.on("stateChange",function(t){for(var e in t)w[e]=t[e];C.call("stateChange",S,t),I.update()}),C.on("changeState",function(t){void 0!==t.disabled&&(_.forEach(function(e,n){e.disabled=t.disabled[n]}),w.disabled=t.disabled),I.update()}),e.dispatch.on("elementMouseout.tooltip",function(t){s.hidden(!0),p.select(".nv-chart-"+e.id()+" .nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",0),p.select(".nv-chart-"+e.id()+" .nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",a.size())}),e.dispatch.on("elementMouseover.tooltip",function(t){p.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.relativePos[1]-B),p.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.relativePos[0]+o.size()),s.data(t).hidden(!1)}),F=g.copy(),W=v.copy()}),D.renderEnd("scatter with line immediate"),I}return I.dispatch=C,I.scatter=e,I.legend=i,I.xAxis=n,I.yAxis=r,I.distX=o,I.distY=a,I.tooltip=s,I.options=t.utils.optionsFunc.bind(I),I._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},container:{get:function(){return p},set:function(t){p=t}},showDistX:{get:function(){return m},set:function(t){m=t}},showDistY:{get:function(){return $},set:function(t){$=t}},legendPosition:{get:function(){return _},set:function(t){_=t}},showLegend:{get:function(){return x},set:function(t){x=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return M},set:function(t){M=t}},duration:{get:function(){return L},set:function(t){L=t,S=d3.transition().duration(L).ease(d3.easeLinear)}},showLabels:{get:function(){return E},set:function(t){E=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e),i.color(h),o.color(h),a.color(h)}}}),t.utils.inheritOptions(I,e),t.utils.initOptions(I),I},t.models.sparkline=function(){"use strict";var e,n,r,i,o={top:2,right:0,bottom:2,left:0},a=400,s=32,l=null,u=!0,c=d3.scaleLinear(),f=d3.scaleLinear(),p=function(t){return t.x},h=function(t){return t.y},g=t.utils.getColor(["#000"]),v=!0,m=!0,$=d3.dispatch("renderEnd"),x=t.utils.renderWatch($);function y(u){return x.reset(),u.each(function(u){var $=a-o.left-o.right,x=s-o.top-o.bottom;l=d3.select(this),t.utils.initSVG(l),c.domain(e||d3.extent(u,p)).range(r||[0,$]),f.domain(n||d3.extent(u,h)).range(i||[x,0]);var y=l.selectAll("g.nv-wrap.nv-sparkline").data([u]),b=y.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");b.append("g"),y.select("g"),b.attr("transform","translate("+o.left+","+o.top+")");var _=b.selectAll("path").data(function(t){return[t]});_.exit().remove();var k=_.enter().append("path");k.style("stroke",function(t,e){return t.color||g(t,e)}).attr("d",d3.line().x(function(t,e){return c(p(t,e))}).y(function(t,e){return f(h(t,e))})),k.merge(_);var w=b.selectAll("circle.nv-point").data(function(t){var e=t.map(function(t,e){return h(t,e)});function n(e){if(-1==e)return null;var n=t[e];return n.pointIndex=e,n}var r=n(e.lastIndexOf(f.domain()[1])),i=n(e.indexOf(f.domain()[0])),o=n(e.length-1);return[v?i:null,v?r:null,m?o:null].filter(function(t){return null!=t})});w.exit().remove();var A=w.enter().append("circle");A.attr("cx",function(t,e){return c(p(t,t.pointIndex))}).attr("cy",function(t,e){return f(h(t,t.pointIndex))}).attr("r",2).attr("class",function(t,e){return p(t,t.pointIndex)==c.domain()[1]?"nv-point nv-currentValue":h(t,t.pointIndex)==f.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"}),A.merge(w)}),x.renderEnd("sparkline immediate"),y}return y.options=t.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return f},set:function(t){f=t}},animate:{get:function(){return u},set:function(t){u=t}},showMinMaxPoints:{get:function(){return v},set:function(t){v=t}},showCurrentPoint:{get:function(){return m},set:function(t){m=t}},x:{get:function(){return p},set:function(t){p="function"==typeof t?t:function(){return t}}},y:{get:function(){return h},set:function(t){h="function"==typeof t?t:function(){return t}}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return g},set:function(e){g=t.utils.getColor(e)}}}),y.dispatch=$,t.utils.initOptions(y),y},t.models.sparklinePlus=function(){"use strict";var e,n,r=t.models.sparkline(),i={top:15,right:100,bottom:10,left:50},o=null,a=null,s=[],l=!1,u=d3.format(",r"),c=d3.format(",.2f"),f=!0,p=!0,h=!1,g=null,v=d3.dispatch("renderEnd");d3.transition().duration(250).ease(d3.easeLinear);var m=t.utils.renderWatch(v);function $(g){return m.reset(),m.models(r),g.each(function(g){var v=d3.select(this);t.utils.initSVG(v);var m=t.utils.availableWidth(o,v,i),x=t.utils.availableHeight(a,v,i);if($.update=function(){v.call($)},$.container=this,!g||!g.length)return t.utils.noData($,v),$;v.selectAll(".nv-noData").remove();var y=r.y()(g[g.length-1],g.length-1);e=r.xScale(),n=r.yScale();var b=v.selectAll("g.nv-wrap.nv-sparklineplus").data([g]),_=b.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus"),k=_.append("g");b.select("g");var w=k.append("g").attr("class","nv-sparklineWrap"),A=k.append("g").attr("class","nv-valueWrap"),C=k.append("g").attr("class","nv-hoverArea");if(_.attr("transform","translate("+i.left+","+i.top+")"),_.merge(b),r.width(m).height(x),w.call(r).merge(w),f){var M=A.selectAll(".nv-currentValue").data([y]),L=M.enter().append("text").attr("class","nv-currentValue").attr("dx",h?-8:8).attr("dy",".9em").style("text-anchor",h?"end":"start");L.attr("x",m+(h?i.right:0)).attr("y",p?function(t){return n(t)}:0).style("fill",r.color()(g[g.length-1],g.length-1)).text(c(y)),L.merge(M)}var S=C.append("rect").on("mousemove",function t(n){if(!l){var o=d3.pointer(n)[0]-i.left;s=[function t(e,n){for(var i=Math.abs(r.x()(e[0],0)-n),o=0,a=0;at.key);p=d3.stack().keys(L).order(g).offset(h).value(function(t,e){return t[e]})(M);var S=[];p.forEach(function(t,e){t.seriesIndex=e,t.x=Array.from(Array(t.length).keys());var n=[];t.map(function(t,r){return n.push({x:r,y:t[1]-t[0],y0:t[0],series:r,seriesIndex:e,index:r,display:{y:t[1]-t[0],y0:t[0]}}),n}),S.push({values:n,key:L[e],seriesIndex:e})}),p=S;var E=l.selectAll("g.nv-wrap.nv-stackedarea").data([p]).enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea");E.attr("transform","translate("+r.left+","+r.top+")");var F=E.append("defs"),W=E.append("g"),D=W.select("g"),I=W.append("g").attr("class","nv-areaWrap");I=l.selectAll("g.nv-wrap.nv-stackedarea").select(".nv-areaWrap");var T=W.append("g").attr("class","nv-scatterWrap");T=l.selectAll("g.nv-wrap.nv-stackedarea").select(".nv-scatterWrap"),0==$.forceY().length&&$.forceY().push(0),$.width(x).height(y).x(u).y(function(t){if(void 0!==t.display)return t.display.y+t.display.y0}).color(S.map(function(t,e){return t.color=t.color||a(t,t.seriesIndex),t.color})),T.datum(S).call($),F.append("clipPath").attr("id","nv-edge-clip-"+s).append("rect").attr("width",x).attr("height",y),m&&W.attr("clip-path",m?"url(#nv-edge-clip-"+s+")":"");var O=d3.area().defined(f).x(function(t,n){return e(u(t,n))}).y0(function(t){return n(t.display.y0)}).y1(b).curve(getInterpolationType(v)),P=d3.area().defined(f).x(function(t,n){return e(u(t,n))}).y0(function(t){return n(t.display.y0)}).y1(function(t){return n(t.display.y0)}),B=I.selectAll("path.nv-area").data(function(t){return t});B.exit().remove();var N=B.enter().append("path").attr("class",function(t,e){return"nv-area nv-area-"+e}).attr("d",function(t,e){return P(t.values,t.seriesIndex)}).on("mouseover",function(t,e,n){d3.select(this).classed("hover",!0),_.call("areaMouseover",this,{point:e,series:e.key,pos:[t.pageX,t.pageY],seriesIndex:e.seriesIndex})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),_.call("areaMouseout",this,{point:e,series:e.key,pos:[t.pageX,t.pageY],seriesIndex:e.seriesIndex})}).on("click",function(t,e,n){d3.select(this).classed("hover",!1),_.call("areaClick",this,{point:e,series:e.key,pos:[t.pageX,t.pageY],seriesIndex:e.seriesIndex})});(N=N.merge(B)).style("fill",function(t,e){return t.color||a(t,t.seriesIndex)}).style("stroke",function(t,e,n){return e.color||a(e,e.seriesIndex)}),N.watchTransition(k,"stackedArea path").attr("d",function(t,e){return O(t.values,t.seriesIndex)}),$.dispatch.on("elementMouseover.area",function(t){D.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!0)}),$.dispatch.on("elementMouseout.area",function(t){D.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!1)}),w.d3_stackedOffset_stackPercent=function(t){var e,n,r,i=t.length,o=t[0].length,a=[];for(n=0;n=t[0]&&r.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}})),tt.transition().duration(I).call(r),tl(),tu()}r.dispatch.on("areaClick.toggle",function(t){1===u.filter(function(t){return!t.disabled}).length?u.forEach(function(t){t.disabled=!1}):u.forEach(function(e,n){e.disabled=n!=t.seriesIndex}),M.disabled=u.map(function(t){return!!t.disabled}),E.call("stateChange",this,M),V.update()}),a.dispatch.on("stateChange",function(t){for(var e in t)M[e]=t[e];E.call("stateChange",this,t),V.update()}),s.dispatch.on("legendClick",function(t,e,n){e.disabled&&(ta=ta.map(function(t){return t.disabled=!0,t}),e.disabled=!1,r.style(e.style),M.style=r.style(),E.call("stateChange",this,M),V.update())}),l.dispatch.on("elementMousemove",function(e){r.clearHighlights();var n,i,o,a=[],s=0,c=!0,f=!1;if(u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(l,p){i=t.interactiveBisect(l.values,e.pointXValue,function(t,e){return t[0]});var h=l.values[i],g=V.y()({x:h[0],y:h[1]},i);if(null!=g&&g>0&&(r.highlightPoint(p,i,!0),f=!0),p!==u.length-1||f||r.highlightPoint(p,i,!0),void 0!==h){void 0===n&&(n=h),void 0===o&&(o=V.xScale()(V.x()({x:h[0],y:h[1]},i)));var m="expand"==r.style()?h[1]:V.y()({x:h[0],y:h[1]},i);a.push({key:l.key,value:+m,color:v(l,l.seriesIndex),point:h}),A&&"expand"!=r.style()&&null!=m&&(s+=+m,c=!1)}}),a.reverse(),a.length>2){var p=V.yScale().invert(e.mouseY),h=null;a.forEach(function(t,e){p=Math.abs(p);var n=Math.abs(t.point[0]),r=Math.abs(t.point[1]);if(p>=n&&p<=r+n){h=e;return}}),null!=h&&(a[h].highlight=!0)}A&&"expand"!=r.style()&&a.length>=2&&!c&&a.push({key:C,value:s,total:!0});var g=V.x()({x:n[0],y:n[1]},i),m=l.tooltip.valueFormatter();"expand"===r.style()||"stack_percent"===r.style()?(P||(P=m),m=d3.format(".1%")):P&&(m=P,P=null),l.tooltip.valueFormatter(m).data({value:g,series:a})(),l.renderGuideLine(o)}),l.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),c.dispatch.on("onBrush",function(t){td(t)}),E.on("changeState",function(t){void 0!==t.disabled&&u.length===t.disabled.length&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),M.disabled=t.disabled),void 0!==t.style&&(r.style(t.style),N=t.style),V.update()})}),B.renderEnd("stacked Area chart immediate"),V}return r.dispatch.on("elementMouseover.tooltip",function(t){t.point.x=r.x()(t.point),t.point.y=r.y()(t.point),u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),V.dispatch=E,V.stacked=r,V.legend=a,V.controls=s,V.xAxis=i,V.x2Axis=c.xAxis,V.yAxis=o,V.y2Axis=c.yAxis,V.interactiveLayer=l,V.tooltip=u,V.focus=c,V.dispatch=E,V.options=t.utils.optionsFunc.bind(V),V._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},showLegend:{get:function(){return $},set:function(t){$=t}},legendPosition:{get:function(){return x},set:function(t){x=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return L},set:function(t){L=t}},noData:{get:function(){return S},set:function(t){S=t}},showControls:{get:function(){return m},set:function(t){m=t}},controlLabels:{get:function(){return D},set:function(t){D=t}},controlOptions:{get:function(){return W},set:function(t){W=t}},showTotalInTooltip:{get:function(){return A},set:function(t){A=t}},totalLabel:{get:function(){return C},set:function(t){C=t}},focusEnable:{get:function(){return k},set:function(t){k=t}},focusHeight:{get:function(){return c.height()},set:function(t){c.height(t)}},brushExtent:{get:function(){return c.brushExtent()},set:function(t){c.brushExtent(t)}},margin:{get:function(){return f},set:function(t){void 0!==t.top&&(f.top=t.top,p=t.top),f.right=void 0!==t.right?t.right:f.right,f.bottom=void 0!==t.bottom?t.bottom:f.bottom,f.left=void 0!==t.left?t.left:f.left}},focusMargin:{get:function(){return c.margin},set:function(t){c.margin.top=void 0!==t.top?t.top:c.margin.top,c.margin.right=void 0!==t.right?t.right:c.margin.right,c.margin.bottom=void 0!==t.bottom?t.bottom:c.margin.bottom,c.margin.left=void 0!==t.left?t.left:c.margin.left}},duration:{get:function(){return I},set:function(t){I=t,B.reset(I),T=d3.transition().duration(I).ease(d3.easeLinear),r.duration(I),i.duration(I),o.duration(I)}},color:{get:function(){return v},set:function(e){v=t.utils.getColor(e),a.color(v),r.color(v),c.color(v)}},x:{get:function(){return r.x()},set:function(t){r.x(t),c.x(t)}},y:{get:function(){return r.y()},set:function(t){r.y(t),c.y(t)}},rightAlignYAxis:{get:function(){return _},set:function(t){_=t}},useInteractiveGuideline:{get:function(){return w},set:function(t){w=!!t,V.interactive(!t),V.useVoronoi(!t),r.scatter.interactive(!t)}}}),t.utils.inheritOptions(V,r),t.utils.initOptions(V),V},t.models.stackedAreaWithFocusChart=function(){return t.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},t.models.sunburst=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=600,s=600,l="count",u={count:function(t){return 1},value:function(t){return t.value||t.size},size:function(t){return t.value||t.size}},c=Math.floor(1e4*Math.random()),f=null,p=t.utils.defaultColor(),h=!1,g=function(t){return"count"===l?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},v=.02,m=function(t,e){return t.name>e.name},$=function(t,e){return void 0!==t.parent?t.name+"-"+t.parent.name+"-"+e:t.name},x=!0,y=500,b=d3.transition().duration(y).ease(d3.easeLinear),_=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),k=d3.scaleLinear().range([0,2*Math.PI]),w=d3.scaleSqrt(),A=d3.partition(),C={},M=d3.arc().startAngle(function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x)))}).endAngle(function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))}).innerRadius(function(t){return Math.max(0,w(t.y))}).outerRadius(function(t){return Math.max(0,w(t.y+t.dy))});function L(t){return S(t)>90?180:0}function S(t){var e=Math.max(0,Math.min(2*Math.PI,k(t.x))),n=Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)));return(e+n)/2*(180/Math.PI)-90}function E(t){var e,n=Math.max(0,Math.min(2*Math.PI,k(t.x)));return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))-n>v}function F(t,n){var r=d3.interpolate(k.domain(),[e.x,e.x+e.dx]),o=d3.interpolate(w.domain(),[e.y,1]),a=d3.interpolate(w.range(),[e.y?20:0,i]);return 0===n?function(){return M(t)}:function(e){return k.domain(r(e)),w.domain(o(e)).range(a(e)),M(t)}}function W(t){var e=d3.interpolate({x:t.x0,dx:t.x1-t.x0,y:t.y0,dy:t.y1-t.y0},t);return function(n){var r=e(n);return t.x0=r.x,t.x1=r.x+r.dx,t.y0=r.y,t.y1=r.y+r.dy,M(r)}}function D(t){var n=f.selectAll("text"),r=f.selectAll("path");n.transition().attr("opacity",0),e=t,r.transition().duration(y).attrTween("d",F).each("end",function(e){e.x>=t.x&&e.x=t.depth&&d3.select(this.parentNode).select("text").transition().duration(y).text(function(t){return g(t)}).attr("opacity",function(t){return E(t)?1:0}).attr("transform",function(){var n=this.getBBox().width;if(0===e.depth)return"translate("+-(n/2*1)+",0)";if(e.depth===t.depth)return"translate("+(w(e.y)+5)+",0)";var r=S(e),i=L(e);return 0===i?"rotate("+r+")translate("+(w(e.y)+5)+",0)":"rotate("+r+")translate("+(w(e.y)+n+5)+",0)rotate("+i+")"})})}var I=t.utils.renderWatch(_);function T(e){return I.reset(),e.each(function(e){f=d3.select(this),i=Math.min(n=t.utils.availableWidth(a,f,o),r=t.utils.availableHeight(s,f,o))/2,w.range([0,i]);var v=f.select("g.nvd3.nv-wrap.nv-sunburst");v[0]&&v[0][0]?v.attr("transform","translate("+(n/2+o.left+o.right)+","+(r/2+o.top+o.bottom)+")"):v=f.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+c).attr("transform","translate("+(n/2+o.left+o.right)+","+(r/2+o.top+o.bottom)+")"),f.on("click",function(t,e,n){_.call("chartClick",this,{data:e,index:e.index,pos:t,id:c})}),A(u[l]||u.count);var m=A.nodes(e[0]).reverse();!function t(e){e.forEach(function(t){var e,n,r,i=C[$(t)];i?(t.x1=i.x+i.dx,t.x0=i.x,t.y1=i.y+i.dy,t.y0=i.y):(t.x1=t.x+t.dx,t.x0=t.x,t.y1=t.y+t.dy,t.y0=t.y),e=t,C[n=$(e)]||(C[n]={}),(r=C[n]).dx=e.dx,r.x=e.x,r.dy=e.dy,r.y=e.y})}(m);var b=v.selectAll(".arc-container").data(m,$);b.enter().append("g").attr("class","arc-container").append("path").attr("d",M).style("fill",function(t){return t.color?t.color:x?p((t.children?t:t.parent).name):p(t.name)}).style("stroke","#FFF").on("click",function(t,e,n){D(e),_.call("elementClick",this,{data:e,index:e.index})}).on("mouseover",function(t,e,n){var r,i;setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0).style("opacity",.8),_.call("elementMouseover",this,{data:e,color:d3.select(this).style("fill"),percent:(i=Math.max(0,Math.min(2*Math.PI,k((r=e).x))),(Math.max(0,Math.min(2*Math.PI,k(r.x+r.dx)))-i)/(2*Math.PI))})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1).style("opacity",1),_.call("elementMouseout",this,{data:e})}).on("mousemove",function(t,e,n){_.call("elementMousemove",this,{data:e})}),b.each(function(t){d3.select(this).select("path").transition().duration(y).attrTween("d",W)}),h&&(b.selectAll("text").remove(),b.append("text").text(function(t){return g(t)}).transition().duration(y).attr("opacity",function(t){return E(t)?1:0}).attr("transform",function(t){var e=this.getBBox().width;if(0===t.depth)return"rotate(0)translate("+-(e/2*1)+",0)";var n=S(t),r=L(t);return 0===r?"rotate("+n+")translate("+(w(t.y)+5)+",0)":"rotate("+n+")translate("+(w(t.y)+e+5)+",0)rotate("+r+")"})),D(m[m.length-1]),b.exit().transition().duration(y).attr("opacity",0).each("end",function(t){C[$(t)]=void 0}).remove()}),I.renderEnd("sunburst immediate"),T}return T.dispatch=_,T.options=t.utils.optionsFunc.bind(T),T._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},mode:{get:function(){return l},set:function(t){l=t}},id:{get:function(){return c},set:function(t){c=t}},duration:{get:function(){return y},set:function(t){y=t,b=d3.transition().duration(y).ease(d3.easeLinear)}},groupColorByParent:{get:function(){return x},set:function(t){x=!!t}},showLabels:{get:function(){return h},set:function(t){h=!!t}},labelFormat:{get:function(){return g},set:function(t){g=t}},labelThreshold:{get:function(){return v},set:function(t){v=t}},sort:{get:function(){return m},set:function(t){m=t}},key:{get:function(){return $},set:function(t){$=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!=t.top?t.top:o.top,o.right=void 0!=t.right?t.right:o.right,o.bottom=void 0!=t.bottom?t.bottom:o.bottom,o.left=void 0!=t.left?t.left:o.left}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e)}}}),t.utils.initOptions(T),T},t.models.sunburstChart=function(){"use strict";var e=t.models.sunburst(),n=t.models.tooltip(),r={top:30,right:20,bottom:20,left:20},i=t.utils.defaultColor(),o=!1,a=null,s=null,l=250,u=d3.transition().duration(l).ease(d3.easeLinear),c=d3.dispatch("stateChange","changeState","renderEnd"),f=t.utils.renderWatch(c);function p(n){return f.reset(),f.models(e),n.each(function(n){var i=d3.select(this);t.utils.initSVG(i);var o=t.utils.availableWidth(null,i,r),a=t.utils.availableHeight(null,i,r);if(p.update=function(){0===l?i.call(p):i.transition().duration(l).call(p)},p.container=i,!n||!n.length)return t.utils.noData(p,i),p;i.selectAll(".nv-noData").remove(),e.width(o).height(a).margin(r),i.call(e)}),f.renderEnd("sunburstChart immediate"),p}return n.duration(0).headerEnabled(!1).valueFormatter(function(t){return t}),e.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:t.data.name,value:t.data.value||t.data.size,color:t.color,percent:t.percent},o||(delete t.percent,delete t.series.percent),n.data(t).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){n.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(t){n()}),p.dispatch=c,p.sunburst=e,p.tooltip=n,p.options=t.utils.optionsFunc.bind(p),p._options=Object.create({},{noData:{get:function(){return s},set:function(t){s=t}},defaultState:{get:function(){return a},set:function(t){a=t}},showTooltipPercent:{get:function(){return o},set:function(t){o=t}},color:{get:function(){return i},set:function(t){i=t,e.color(i)}},duration:{get:function(){return l},set:function(t){l=t,f.reset(l),u=d3.transition().duration(l).ease(d3.easeLinear),e.duration(l)}},margin:{get:function(){return r},set:function(t){r.top=void 0!==t.top?t.top:r.top,r.right=void 0!==t.right?t.right:r.right,r.bottom=void 0!==t.bottom?t.bottom:r.bottom,r.left=void 0!==t.left?t.left:r.left,e.margin(r)}}}),t.utils.inheritOptions(p,e),t.utils.initOptions(p),p},t.version="1.8.9"}(); +!function(){var t={};t.dev=!1,t.tooltip=t.tooltip||{},t.utils=t.utils||{},t.models=t.models||{},t.charts={},t.logs={},t.dom={},"undefined"!=typeof module&&"undefined"!=typeof exports&&"undefined"==typeof d3&&(d3=require("d3")),t.dispatch=d3.dispatch("start","end"),d3.functor=function t(e){return"function"==typeof e?e:function(){return e}},d3.rebind=function t(e,n,r){return function(){var t=r.apply(n,arguments);return t===n?e:t}},Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),t.dev&&(t.dispatch.on("start",function(e){t.logs.startTime=+new Date}),t.dispatch.on("end",function(e){t.logs.endTime=+new Date,t.logs.totalTime=t.logs.endTime-t.logs.startTime,t.log("total",t.logs.totalTime)})),t.log=function(){return t.dev&&window.console&&console.log&&console.log.apply?console.log.apply(console,arguments):t.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind&&Function.prototype.bind.call(console.log,console).apply(console,arguments),arguments[arguments.length-1]},t.deprecated=function(t,e){console&&console.warn&&console.warn("nvd3 warning: `"+t+"` has been deprecated. ",e||"")},t.render=function e(n){n=n||1,t.render.active=!0,t.dispatch.call("start");var r=function(){for(var e,i,o=0;oh||r>g||void 0===t.target||s){if(u&&t.target&&(void 0===t.target.className||t.target.className.match(l.nvPointerEventsClass)))return;o.call("elementMouseout",this,{mouseX:n,mouseY:r}),c.renderGuideLine(null),l.hidden(!0);return}l.hidden(!1);var f="function"==typeof i.rangeBands,p=void 0;if(f){var v=d3.bisect(i.range(),n)-1;if(i.range()[v]+i.rangeBand()>=n)p=i.domain()[d3.bisect(i.range(),n)-1];else{o.call("elementMouseout",this,{mouseX:n,mouseY:r}),c.renderGuideLine(null),l.hidden(!0);return}}else p=i.invert(n);if("mousemove"===t.type&&o.call("elementMousemove",this,{mouseX:n,mouseY:r,pointXValue:p}),"dblclick"===t.type&&o.call("elementDblclick",this,{mouseX:n,mouseY:r,pointXValue:p}),"click"===t.type&&o.call("elementClick",this,{mouseX:n,mouseY:r,pointXValue:p}),"mousedown"===t.type&&o.call("elementMouseDown",this,{mouseX:n,mouseY:r,pointXValue:p}),"mouseup"===t.type&&o.call("elementMouseUp",this,{mouseX:n,mouseY:r,pointXValue:p}),"touchmove"===t.type){l.hidden(!0);return}}d3.select(this).selectAll("g.nv-wrap.nv-interactiveLineLayer").data([f]).enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer").append("g").attr("class","nv-interactiveGuideLine"),s&&(s.on("touchmove",v).on("mousemove",v,!0).on("mouseout",v,!0).on("mousedown",v,!0).on("mouseup",v,!0).on("dblclick",v).on("click",v),c.guideLine=null,c.renderGuideLine=function(e){a&&p.select(".nv-interactiveGuideLine").selectAll("line").data(null!=e?[t.utils.NaNtoZero(e)]:[],String).join(t=>t.append("line").attr("class","nv-guideline"),t=>t,t=>t.remove()).attr("x1",function(t){return t}).attr("x2",function(t){return t}).attr("y1",g).attr("y2",0)})})}return l.duration(0).hideDelay(0).hidden(!1),c.dispatch=o,c.tooltip=l,c.margin=function(t){return arguments.length?(e.top=void 0!==t.top?t.top:e.top,e.left=void 0!==t.left?t.left:e.left,c):e},c.width=function(t){return arguments.length?(n=t,c):n},c.height=function(t){return arguments.length?(r=t,c):r},c.xScale=function(t){return arguments.length?(i=t,c):i},c.showGuideLine=function(t){return arguments.length?(a=t,c):a},c.svgContainer=function(t){return arguments.length?(s=t,c):s},c},t.interactiveBisect=function(t,e,n){"use strict";if(!(t instanceof Array))return null;r="function"!=typeof n?function(t){return t.x}:n;var r,i=function(t,e){return r(t)-e},o=d3.bisector(i).left,a=d3.max([0,o(t,e)-1]),s=r(t[a]);if(void 0===s&&(s=a),s===e)return a;var l=d3.min([a+1,t.length-1]),u=r(t[l]);return(void 0===u&&(u=l),Math.abs(u-e)>=Math.abs(s-e))?a:l},t.nearestValueIndex=function(t,e,n){"use strict";var r=1/0,i=null;return t.forEach(function(t,o){var a=Math.abs(e-t);null!=t&&a<=r&&a"+t.footer+""),i},b=function(){var t=getCoordinates(),e={left:t.mouseX,top:t.mouseY};if("none"!=getComputedStyle(document.body).transform){var n=document.body.getBoundingClientRect();e.left-=n.left,e.top-=n.top}return e},_=function(e){if(e&&e.series){if(t.utils.isArray(e.series))return!0;if(t.utils.isObject(e.series))return e.series=[e.series],!0}return!1},k=function(t){var e,n,o,a=u.node()?u.node().offsetHeight:0,s=u.node()?u.node().offsetWidth:0,l=document.documentElement.clientWidth;switch(r){case"e":e=-s-i,n=-(a/2),t.left+e<0&&(e=i),(o=t.top+n)<0&&(n-=o);break;case"w":e=i,n=-(a/2),t.left+e+s>l&&(e=-s-i),(o=t.top+n)<0&&(n-=o);break;case"n":e=-(s/2)-5,n=i,(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"s":e=-(s/2),n=-a-i,t.top+n<0&&(n=i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"center":e=-(s/2),n=-(a/2);break;default:e=0,n=0}return{left:e,top:n}},w=function(){t.dom.read(function(){let t=b(),e=k(t),n=t.left+e.left,r=t.top+e.top;if(s)u.interrupt().transition().delay(l).duration(0).style("opacity",0);else if(u){let i="translate("+c.left+"px, "+c.top+"px)",o="translate("+Math.round(n)+"px, "+Math.round(r)+"px)",a=d3.interpolateString(i,o),f=.1>parseFloat(u.style.opacity),h=d3.transition().duration(f?0:p).ease(d3.easeLinear);u.interrupt().transition(h).styleTween("transform",function(){return a},"important").styleTween("-webkit-transform",function(){return a}).style("-ms-transform",o).style("opacity",1)}c.left=n,c.top=r})};function A(){if(f&&_(n))return t.dom.write(function(){u&&u.node()||((u=d3.select(document.body).selectAll("#"+e).data([1])).enter().append("div").attr("class","nvtooltip "+(a||"xy-tooltip")).attr("id",e).style("top",0).style("left",0).style("opacity",0).style("position","absolute").selectAll("div, table, td, tr").classed(v,!0).classed(v,!0),u.exit().remove());var t=y(n,u.node());t&&u.node()&&(u.node().innerHTML=t),w()}),A}return A.nvPointerEventsClass=v,A.options=t.utils.optionsFunc.bind(A),A._options=Object.create({},{duration:{get:function(){return p},set:function(t){p=t}},gravity:{get:function(){return r},set:function(t){r=t}},distance:{get:function(){return i},set:function(t){i=t}},snapDistance:{get:function(){return o},set:function(t){o=t}},classes:{get:function(){return a},set:function(t){a=t}},enabled:{get:function(){return f},set:function(t){f=t}},hideDelay:{get:function(){return l},set:function(t){l=t,h=d3.transition().delay(l).duration(0)}},contentGenerator:{get:function(){return y},set:function(t){y=t}},valueFormatter:{get:function(){return m},set:function(t){m=t}},headerFormatter:{get:function(){return $},set:function(t){$=t}},keyFormatter:{get:function(){return x},set:function(t){x=t}},headerEnabled:{get:function(){return g},set:function(t){g=t}},position:{get:function(){return b},set:function(t){b=t}},chartContainer:{get:function(){return document.body},set:function(e){t.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(e){t.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(e){t.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return s},set:function(t){s!=t&&(s=!!t,A())}},data:{get:function(){return n},set:function(t){t.point&&(t.value=t.point.x,t.series=t.series||{},t.series.value=t.point.y,t.series.color=t.point.color||t.series.color),n=t}},node:{get:function(){return u.node()},set:function(t){}},id:{get:function(){return e},set:function(t){}}}),t.utils.initOptions(A),A},t.utils.windowSize=function(){var t={width:640,height:480};return window.innerWidth&&window.innerHeight?(t.width=window.innerWidth,t.height=window.innerHeight,t):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(t.width=document.documentElement.offsetWidth,t.height=document.documentElement.offsetHeight,t):(document.body&&document.body.offsetWidth&&(t.width=document.body.offsetWidth,t.height=document.body.offsetHeight),t)},t.utils.isArray=Array.isArray,t.utils.isObject=function(t){return null!==t&&"object"==typeof t},t.utils.isFunction=function(t){return"function"==typeof t},t.utils.isDate=function(t){return"[object Date]"===toString.call(t)},t.utils.isNumber=function(t){return!isNaN(t)&&"number"==typeof t},t.utils.windowResize=function(e){return window.addEventListener?window.addEventListener("resize",e):t.log("ERROR: Failed to bind to window.resize with: ",e),{callback:e,clear:function(){window.removeEventListener("resize",e)}}},t.utils.getColor=function(e){if(void 0===e||t.utils.isArray(e)&&0===e.length)return t.utils.defaultColor();if(!t.utils.isArray(e))return e;var n=[];if(d3.min(e)===e[0]){n.push(0);for(var r=1;r0;r--)n.push(r);n.push(0)}var i=d3.scaleOrdinal().range(e);return function(t,e){return t.color||i(void 0===e?t:e)}},t.utils.defaultColor=function(){return t.utils.getColor(d3.scaleOrdinal(d3.schemeSet3).range())},t.utils.customTheme=function(e,n,r){n=n||function(t){return t.key};var i=(r=r||d3.scaleOrdinal(d3.schemeAccent).range()).length;return function(o,a){var s=n(o);return t.utils.isFunction(e[s])?e[s]():void 0!==e[s]?e[s]:(i||(i=r.length),r[i-=1])}},t.utils.pjax=function(e,n){var r=function(r){d3.html(r,function(r){var i=d3.select(n).node();i.parentNode.replaceChild(d3.select(r).select(n).node(),i),t.utils.pjax(e,n)})};d3.selectAll(e).on("click",function(t){history.pushState(this.href,this.textContent,this.href),r(this.href),t.preventDefault()}),d3.select(window).on("popstate",function(t){t.state&&r(t.state)})},t.utils.calcApproxTextWidth=function(e){if(t.utils.isFunction(e.style)&&t.utils.isFunction(e.text)){var n=parseInt(e.style("font-size").replace("px",""),10),r=e.text().length;return t.utils.NaNtoZero(r*n*.5)}return 0},t.utils.NaNtoZero=function(e){return!t.utils.isNumber(e)||isNaN(e)||null===e||e===1/0||e===-1/0?0:e},d3.selection.prototype.watchTransition=function(t){var e=[this].concat([].slice.call(arguments,1));return t.transition.apply(t,e)},t.utils.renderWatch=function(e,n){if(!(this instanceof t.utils.renderWatch))return new t.utils.renderWatch(e,n);var r=void 0!==n?n:250,i=[],o=this;this.models=function(t){return t=[].slice.call(arguments,0),t.forEach(function(t){t.__rendered=!1,function(t){t.dispatch.on("renderEnd",function(e){t.__rendered=!0,o.renderEnd("model")})}(t),0>i.indexOf(t)&&i.push(t)}),this},this.reset=function(t){void 0!==t&&(r=t),i=[]},this.transition=function(t,e,n){if(e=arguments.length>1?[].slice.call(arguments,1):[],n=e.length>1?e.pop():void 0!==r?r:250,this.t=d3.transition().duration(n).ease(d3.easeLinear),t.__rendered=!1,0>i.indexOf(t)&&i.push(t),0===n)return t.__rendered=!0,t.delay=function(){return this},t.duration=function(){return this},t;0===t.length?t.__rendered=!0:t.filter(function(t,e){return void 0!==t&&!t.length})?t.__rendered=!0:t.__rendered=!1;var a=0;return t.transition(this.t).each(function(){++a}).on("end",function(n,r){0==--a&&(t.__rendered=!0,o.renderEnd.apply(this,e))})},this.renderEnd=function(){i.every(function(t){return t.__rendered})&&(i.forEach(function(t){t.__rendered=!1}),e.apply("renderEnd",this,arguments))}},t.utils.deepExtend=function(e){var n=arguments.length>1?[].slice.call(arguments,1):[];n.forEach(function(n){for(var r in n){var i=t.utils.isArray(e[r]),o=t.utils.isObject(e[r]),a=t.utils.isObject(n[r]);o&&!i&&a?t.utils.deepExtend(e[r],n[r]):e[r]=n[r]}})},t.utils.state=function(){if(!(this instanceof t.utils.state))return new t.utils.state;var e={},n=function(){},r=function(){return{}},i=null,o=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(t){n(t,!0)}),this.getter=function(t){return r=t,this},this.setter=function(t,e){return e||(e=function(){}),n=function(n,r){t(n),r&&e()},this},this.init=function(e){i=i||{},t.utils.deepExtend(i,e)};var a=function(){var t=r();if(JSON.stringify(t)===JSON.stringify(e))return!1;for(var n in t)void 0===e[n]&&(e[n]={}),e[n]=t[n],o=!0;return!0};this.update=function(){i&&(n(i,!1),i=null),a.call(this)&&this.dispatch.call("change",this,e)}},t.utils.optionsFunc=function(e){return e&&new Map(e).each(((e,n)=>{t.utils.isFunction(this[e])&&this[e](n)}).bind(this)),this},t.utils.calcTicksX=function(e,n){for(var r=1,i=0;ir?o:r}return t.log("Requested number of ticks: ",e),t.log("Calculated max values to be: ",r),e=Math.floor(e=(e=e>r?e=r-1:e)<1?1:e),t.log("Calculating tick count as: ",e),e},t.utils.calcTicksY=function(e,n,r){if(!r)return t.utils.calcTicksX(e,n);for(var i=1,o=0;oi?a:i;return t.log("Requested number of ticks: ",e),t.log("Calculated max values to be: ",i),e=Math.floor(e=(e=e>i?i-1:e)<1?1:e),t.log("Calculating tick count as: ",e),e},t.utils.initOption=function(t,e){t._calls&&t._calls[e]?t[e]=t._calls[e]:(t[e]=function(n){return arguments.length?(t._overrides[e]=!0,t._options[e]=n,t):t._options[e]},t["_"+e]=function(n){return arguments.length?(t._overrides[e]||(t._options[e]=n),t):t._options[e]})},t.utils.initOptions=function(e){e._overrides=e._overrides||{};var n=Object.getOwnPropertyNames(e._options||{}),r=Object.getOwnPropertyNames(e._calls||{});for(var i in n=n.concat(r))t.utils.initOption(e,n[i])},t.utils.inheritOptionsD3=function(e,n,r){e._d3options=r.concat(e._d3options||[]),e._d3options=(e._d3options||[]).filter(function(t,e,n){return n.indexOf(t)===e}),r.unshift(n),r.unshift(e),t.utils.rebind.apply(this,r)},t.utils.arrayUnique=function(t){return t.sort().filter(function(e,n){return!n||e!=t[n-1]})},t.utils.symbolMap=new Map,t.utils.typeMap=new Map().set("circle",d3.symbolCircle).set("cross",d3.symbolCross).set("diamond",d3.symbolDiamond).set("square",d3.symbolSquare).set("star",d3.symbolStar).set("triangle-up",d3.symbolTriangle).set("wye",d3.symbolWye),t.utils.symbol=function(){var e,n=64;function r(r,i){var o=e.call(this,r,i),a=n.call(this,r,i);return void 0===t.utils.symbolMap.get(o)?d3.symbol().type(t.utils.typeMap.get(o)).size(a)():t.utils.symbolMap.get(o)(a)}return r.type=function(t){return arguments.length?(e="function"==typeof t?t:function(){return t},r):e},r.size=function(t){return arguments.length?(n="function"==typeof t?t:function(){return t},r):n},r},t.utils.inheritOptions=function(e,n){var r=Object.getOwnPropertyNames(n._options||{}),i=Object.getOwnPropertyNames(n._calls||{}),o=n._inherited||[],a=n._d3options||[],s=r.concat(i).concat(o).concat(a);s.unshift(n),s.unshift(e),t.utils.rebind.apply(this,s),e._inherited=t.utils.arrayUnique(r.concat(i).concat(o).concat(r).concat(e._inherited||[])),e._d3options=t.utils.arrayUnique(a.concat(e._d3options||[]))},t.utils.rebind=function(e,n){for(var r,i=1,o=arguments.length;++ie&&(i.pop(),l.text(i.join(" ")),i=[t],l=n.append("tspan").attr("x",0).attr("y",a).attr("dy",1.1*++o+s+"em").text(t))})},t.utils.arrayEquals=function(e,n){if(e===n)return!0;if(!e||!n||e.length!=n.length)return!1;for(var r=0,i=e.length;rt);var b=t.utils.renderWatch(y,x);function _(l){return b.reset(),l.each(function(l){var x,y,_,k,w=d3.select(this);t.utils.initSVG(w);var A=w.selectAll("g.nv-wrap.nv-axis").data([l]),C=A.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),M=(C=C.merge(A)).append("g");M.select("g"),M=C.select("g"),null!==v?e.ticks(v):("top"===n||"bottom"===n)&&e.ticks(Math.abs(o.range()[1]-o.range()[0])/100),M.watchTransition(b,"axis").call(e),r=r||e.scale();var L=e.tickFormat();null==L&&(L=r.tickFormat()),M.attr("fill",""),M.attr("font-size",$),M.attr("font-family","");var S=M.selectAll("text.nv-axislabel").data([u||null]);switch(S.exit().remove(),void 0!==$&&M.selectAll("g").select("text").style("font-size",$),n){case"top":y=m+36;var x=S.enter().append("text").attr("class","nv-axislabel");if(x=w.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel"),k=0,1===o.range().length?k=g?2*o.range()[0]+o.bandwidth():0:2===o.range().length?k=g?o.range()[0]+o.range()[1]+o.bandwidth():o.range()[1]:o.range().length>2&&(k=o.range()[o.range().length-1]+(o.range()[1]-o.range()[0])),x.attr("text-anchor","middle").attr("y",-y).attr("x",k/2),c){_=M.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")).merge(M);var E=(_=w.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data(o.domain()).join("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" "))).select("text");E.empty()&&_.append("text"),_.exit().remove(),_.attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(o(e))+",0)"}).select("text").attr("dy","-0.5em").attr("y",-e.tickPadding()).attr("text-anchor","middle").text(function(t,e){var n=(i||L)(t);return(""+n).match("NaN")?"":n}),_.watchTransition(b,"min-max top").attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(o.range()[n])+",0)"})}break;case"bottom":y=m+36;var F=30,W=0,D=M.selectAll("g").select("text"),I="";if(f%360){D.attr("transform",""),D.each(function(t,e){var n=this.getBoundingClientRect(),r=n.width;W=n.height,r>F&&(F=r)}),I="rotate("+f+" 0,"+(W/2+e.tickPadding())+")";var T=Math.abs(Math.sin(f*Math.PI/180));y=(T?T*F:F)+30,D.attr("transform",I).style("text-anchor",f%360>0?"start":"end")}else h?D.attr("transform",function(t,e){return"translate(0,"+(e%2==0?"0":"12")+")"}):D.attr("transform","translate(0,0)");if(x=S.enter().append("text").attr("class","nv-axislabel"),x=w.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel"),k=0,1===o.range().length?k=g?2*o.range()[0]+o.bandwidth():0:2===o.range().length?k=g?o.range()[0]+o.range()[1]+o.bandwidth():o.range()[1]:o.range().length>2&&(k=o.range()[o.range().length-1]+(o.range()[1]-o.range()[0])),x.attr("text-anchor","middle").attr("y",y).attr("x",k/2),c){_=M.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")).merge(M);var E=(_=w.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data([o.domain()[0],o.domain()[o.domain().length-1]]).join("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" "))).select("text");E.empty()&&_.append("text"),_.exit().remove(),_.attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(o(e)+(g?o.bandwidth()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",e.tickPadding()).attr("transform",I).style("text-anchor",f?f%360>0?"start":"end":"middle").text(function(t,e){var n=(i||L)(t);return(""+n).match("NaN")?"":n}),_.watchTransition(b,"min-max bottom").attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(o(e)+(g?o.bandwidth()/2:0))+",0)"})}break;case"right":if(x=S.enter().append("text").attr("class","nv-axislabel"),(x=w.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel")).style("text-anchor",p?"middle":"begin").attr("transform",p?"rotate(90)":"").attr("y",p?-Math.max(a.right,s)+12-(m||0):-10).attr("x",p?d3.max(o.range())/2:e.tickPadding()),c){_=M.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-y",0===e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")).merge(M);var E=(_=w.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data(o.domain()).join("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-y",0===e?"nv-axisMin-y":"nv-axisMax-y"].join(" "))).select("text");E.empty()&&_.append("text").style("opacity",0),_.exit().remove(),_.attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(o(e))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",e.tickPadding()).style("text-anchor","start").text(function(t,e){var n=(i||L)(t);return(""+n).match("NaN")?"":n}),_.watchTransition(b,"min-max right").attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(o.range()[n])+")"}).select("text").style("opacity",1)}break;case"left":if(x=S.enter().append("text").attr("class","nv-axislabel"),(x=w.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel")).style("text-anchor",p?"middle":"end").attr("transform",p?"rotate(-90)":"").attr("y",p?-Math.max(a.left,s)+25-(m||0):-10).attr("x",p?-d3.max(o.range())/2:-e.tickPadding()),c){_=M.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-y",0===e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")).merge(M);var E=(_=w.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data(o.domain()).join("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-y",0===e?"nv-axisMin-y":"nv-axisMax-y"].join(" "))).select("text");E.empty()&&_.append("text").style("opacity",0),_.exit().remove(),_.attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(r(e))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-e.tickPadding()).attr("text-anchor","end").text(function(t,e){var n=(i||L)(t);return(""+n).match("NaN")?"":n}),_.watchTransition(b,"min-max right").attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(o.range()[n])+")"}).select("text").style("opacity",1)}}if(x.text(function(t){return t}),c&&("left"===n||"right"===n)&&(M.selectAll("g").each(function(t,e){d3.select(this).select("text").attr("opacity",1),(o(t)o.range()[0]-10)&&((t>1e-10||t<-.0000000001)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),o.domain()[0]==o.domain()[1]&&0==o.domain()[0]&&A.selectAll("g.nv-axisMaxMin").style("opacity",function(t,e){return e?0:1})),c&&("top"===n||"bottom"===n)){var O=[];_.each(function(t,e){try{e?O.push(o(t)-this.getBoundingClientRect().width-4):O.push(o(t)+this.getBoundingClientRect().width+4)}catch(n){e?O.push(o(t)-4):O.push(o(t)+4)}}),M.selectAll("g").each(function(t,e){(o(t)O[1])&&(t>1e-10||t<-.0000000001?d3.select(this).remove():d3.select(this).select("text").remove())})}M.selectAll(".tick").filter(function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t}).classed("zero",!0),M.selectAll(".tick text").each(function(t){var e=d3.select(this);setTimeout(function(){var t;if(e.node().getComputedTextLength()>120){var n=e.text().substring(0,10)+"...";e.text(n)}},100)}),r=o.copy()}),b.renderEnd("axis immediate"),_}return _.axis=e,_.dispatch=y,_.options=t.utils.optionsFunc.bind(_),_._options=Object.create({},{axisLabelDistance:{get:function(){return m},set:function(t){m=t}},staggerLabels:{get:function(){return h},set:function(t){h=t}},rotateLabels:{get:function(){return f},set:function(t){f=t}},rotateYLabel:{get:function(){return p},set:function(t){p=t}},showMaxMin:{get:function(){return c},set:function(t){c=t}},axisLabel:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return l},set:function(t){l=t}},ticks:{get:function(){return v},set:function(t){v=t}},width:{get:function(){return s},set:function(t){s=t}},fontSize:{get:function(){return $},set:function(t){$=t}},tickFormatMaxMin:{get:function(){return i},set:function(t){i=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left}},duration:{get:function(){return x},set:function(t){x=t,b.reset(x)}},scale:{get:function(){return o},set:function(n){o=n,e.scale(o),g="function"==typeof o.rangeBands,t.utils.inheritOptionsD3(_,o,["domain","range"])}}}),t.utils.initOptions(_),t.utils.inheritOptionsD3(_,e,["tickValues","tickSubdivide","tickSizeInner","tickSizeOuter","tickPadding","tickFormat"]),t.utils.inheritOptionsD3(_,o,["domain","range"]),_},t.models.boxPlot=function(){"use strict";var e,n,r,i,o,a,s={top:0,right:0,bottom:0,left:0},l=960,u=500,c=Math.floor(1e4*Math.random()),f=d3.scaleBand(),p=d3.scaleLinear(),h=function(t){return t.label},g=function(t){return t.values.Q1},v=function(t){return t.values.Q2},m=function(t){return t.values.Q3},$=function(t){return t.values.whisker_low},x=function(t){return t.values.whisker_high},y=function(t){return t.color},b=function(t){return t.values.outliers},_=function(t,e,n){return t},k=function(t,e,n){return t},w=function(t,e,n){},A=t.utils.defaultColor(),C=null,M=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),L=250,S=null,E=t.utils.renderWatch(M,L);function F(c){return E.reset(),c.each(function(c){var F=l-s.left-s.right,W=u-s.top-s.bottom;C=d3.select(this),t.utils.initSVG(C),f.domain(r||c.map(function(t,e){return h(t,e)})).range(i||[0,F],.1);var D=[];if(!o){var I,T,O=[];c.forEach(function(t,e){var n=g(t),r=m(t),i=$(t),o=x(t),a=b(t);a&&a.forEach(function(t,e){O.push(_(t,e,void 0))}),i&&O.push(i),n&&O.push(n),r&&O.push(r),o&&O.push(o)}),D=[I=d3.min(O),T=d3.max(O)]}p.domain(o||D),p.range(a||[W,0]),e=e||f,n=n||p.copy().range([p(0),p(0)]);var P=C.selectAll("g.nv-wrap").data([c]).enter().append("g").attr("class","nvd3 nv-wrap");P.attr("transform","translate("+s.left+","+s.top+")");var B=P.selectAll(".nv-boxplot").data(function(t){return t}),N=B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);N.attr("class","nv-boxplot").attr("transform",function(t,e,n){return"translate("+(f(h(t,e))+.05*f.bandwidth())+", 0)"}).classed("hover",function(t){return t.hover}),N.watchTransition(E,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay(function(t,e){return e*L/c.length}).attr("transform",function(t,e){return"translate("+(f(h(t,e))+.05*f.bandwidth())+", 0)"}),B.exit().remove(),N.each(function(t,e){var n=d3.select(this);[$,x].forEach(function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===$?"low":"high";n.append("line").style("stroke",y(t)||A(t,e)).attr("class","nv-boxplot-whisker nv-boxplot-"+i),n.append("line").style("stroke",y(t)||A(t,e)).attr("class","nv-boxplot-tick nv-boxplot-"+i)}})});var z=function(){return null===S?.9*f.bandwidth():Math.min(75,.9*f.bandwidth())},V=function(){return .45*f.bandwidth()-z()/2},Y=function(){return .45*f.bandwidth()+z()/2};[$,x].forEach(function(t){var e=t===$?"low":"high",n=t===$?g:m;N.select("line.nv-boxplot-whisker.nv-boxplot-"+e).watchTransition(E,"nv-boxplot: boxplots").attr("x1",.45*f.bandwidth()).attr("y1",function(e,n){return p(t(e))}).attr("x2",.45*f.bandwidth()).attr("y2",function(t,e){return p(n(t))}),N.select("line.nv-boxplot-tick.nv-boxplot-"+e).watchTransition(E,"nv-boxplot: boxplots").attr("x1",V).attr("y1",function(e,n){return p(t(e))}).attr("x2",Y).attr("y2",function(e,n){return p(t(e))})}),[$,x].forEach(function(t){var e=t===$?"low":"high";N.selectAll(".nv-boxplot-"+e).on("mouseover",function(e,n,r,i){setCoordinates(e.pageX,e.pageY),d3.select(this).classed("hover",!0),M.call("elementMouseover",this,{series:{key:t(n),color:y(n)||A(n,i)},e:e})}).on("mouseout",function(e,n,r,i){d3.select(this).classed("hover",!1),M.call("elementMouseout",this,{series:{key:t(n),color:y(n)||A(n,i)},e:e})}).on("mousemove",function(t,e,n){M.call("elementMousemove",this,{e:t})})}),N.append("rect").attr("class","nv-boxplot-box").on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0),M.call("elementMouseover",this,{key:h(e),value:h(e),series:[{key:"Q3",value:m(e),color:y(e)||A(e,n)},{key:"Q2",value:v(e),color:y(e)||A(e,n)},{key:"Q1",value:g(e),color:y(e)||A(e,n)}],data:e,index:e.index,e:t})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),M.call("elementMouseout",this,{key:h(e),value:h(e),series:[{key:"Q3",value:m(e),color:y(e)||A(e,n)},{key:"Q2",value:v(e),color:y(e)||A(e,n)},{key:"Q1",value:g(e),color:y(e)||A(e,n)}],data:e,index:e.index,e:t})}).on("mousemove",function(t,e,n){M.call("elementMousemove",this,{e:t})}).watchTransition(E,"nv-boxplot: boxes").attr("y",function(t,e){return p(m(t))}).attr("width",z).attr("x",V).attr("height",function(t,e){return Math.abs(p(m(t))-p(g(t)))||1}).style("fill",function(t,e){return y(t)||A(t,e)}).style("stroke",function(t,e){return y(t)||A(t,e)}),N.append("line").attr("class","nv-boxplot-median").watchTransition(E,"nv-boxplot: boxplots line").attr("x1",V).attr("y1",function(t,e){return p(v(t))}).attr("x2",Y).attr("y2",function(t,e){return p(v(t))});var H=N.selectAll(".nv-boxplot-outlier").data(function(t){return b(t)||[]});H.enter().append("circle").style("fill",function(t,e,n){return w(t,e,n)||A(t,n)}).style("stroke",function(t,e,n){return w(t,e,n)||A(t,n)}).style("z-index",9e3).on("mouseover",function(t,e,n,r){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0),M.call("elementMouseover",this,{series:{key:k(e,n,r),color:w(e,n,r)||A(e,r)},e:t})}).on("mouseout",function(t,e,n,r){d3.select(this).classed("hover",!1),M.call("elementMouseout",this,{series:{key:k(e,n,r),color:w(e,n,r)||A(e,r)},e:t})}).on("mousemove",function(t,e,n){M.call("elementMousemove",this,{e:t})}),H.attr("class","nv-boxplot-outlier"),H.watchTransition(E,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*f.bandwidth()).attr("cy",function(t,e,n){return p(_(t,e,n))}).attr("r","3"),H.exit().remove(),e=f.copy(),n=p.copy()}),E.renderEnd("nv-boxplot immediate"),F}return F.dispatch=M,F.options=t.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return u},set:function(t){u=t}},maxBoxWidth:{get:function(){return S},set:function(t){S=t}},x:{get:function(){return h},set:function(t){h=t}},q1:{get:function(){return g},set:function(t){g=t}},q2:{get:function(){return v},set:function(t){v=t}},q3:{get:function(){return m},set:function(t){m=t}},wl:{get:function(){return $},set:function(t){$=t}},wh:{get:function(){return x},set:function(t){x=t}},itemColor:{get:function(){return y},set:function(t){y=t}},outliers:{get:function(){return b},set:function(t){b=t}},outlierValue:{get:function(){return _},set:function(t){_=t}},outlierLabel:{get:function(){return k},set:function(t){k=t}},outlierColor:{get:function(){return w},set:function(t){w=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return p},set:function(t){p=t}},xDomain:{get:function(){return r},set:function(t){r=t}},yDomain:{get:function(){return o},set:function(t){o=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return a},set:function(t){a=t}},id:{get:function(){return c},set:function(t){c=t}},y:{get:function(){return console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead."),{}},set:function(t){console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead.")}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},color:{get:function(){return A},set:function(e){A=t.utils.getColor(e)}},duration:{get:function(){return L},set:function(t){L=t,E.reset(L)}}}),t.utils.initOptions(F),F},t.models.boxPlotChart=function(){"use strict";var e,n,r=t.models.boxPlot(),i=t.models.axis(d3.axisBottom(d3.scaleBand()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a={top:15,right:10,bottom:50,left:60},s=null,l=null,u=t.utils.getColor(),c=!0,f=!0,p=!1,h=!1,g=t.models.tooltip(),v="No Data Available.",m=d3.dispatch("beforeUpdate","renderEnd"),$=250,x=d3.transition().duration($).ease(d3.easeLinear);i.showMaxMin(!1).scale(),i.tickFormat(function(t){return t}),o.scale(),o.tickFormat(d3.format(",.1f")),g.duration(0);var y=t.utils.renderWatch(m,$);function b(u){return y.reset(),y.models(r),c&&y.models(i),f&&y.models(o),u.each(function(u){var g=d3.select(this);t.utils.initSVG(g);var x=(s||parseInt(g.style("width"))||960)-a.left-a.right,y=(l||parseInt(g.style("height"))||400)-a.top-a.bottom;if(b.update=function(){m.call("beforeUpdate",this),g.transition().duration($).call(b)},b.container=this,u&&u.length)g.selectAll(".nv-noData").remove();else{var _=g.selectAll(".nv-noData").data([v]);return _.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),_.attr("x",a.left+x/2).attr("y",a.top+y/2).text(function(t){return t}),b}e=r.xScale(),n=r.yScale().clamp(!0);var k=g.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),A=w.append("defs");k.select("g");var C=w.append("g").attr("class","nv-x nv-axis");C=g.selectAll("g.nv-wrap.nv-boxPlotWithAxes").select(".nv-x");var M=w.append("g").attr("class","nv-y nv-axis"),L=M.append("g").attr("class","nv-zeroLine").append("line"),S=w.append("g").attr("class","nv-barsWrap");if(w.attr("transform","translate("+a.left+","+a.top+")"),p&&M.attr("transform","translate("+x+",0)"),r.width(x).height(y),S.datum(u.filter(function(t){return!t.disabled})).transition().call(r),A.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect").attr("width",e.bandwidth()*(h?2:1)).attr("height",16).attr("x",-e.bandwidth()/(h?1:2)),c){i.scale(e)._ticks(t.utils.calcTicksX(x/100,u)),i.tickSizeInner(-y),C.attr("transform","translate(0,"+n.range()[0]+")"),C.call(i);var E=C.select("g.nvd3.nv-wrap.nv-axis").selectAll("g");h&&E.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})}f&&(o.scale(n)._ticks(Math.floor(y/36)),o.tickSizeInner(-x),M.call(o)),L.attr("x1",0).attr("x2",x).attr("y1",n(0)).attr("y2",n(0))}),y.renderEnd("nv-boxplot chart immediate"),b}return r.dispatch.on("elementMouseover.tooltip",function(t){g.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){g.data(t).hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){g()}),b.dispatch=m,b.boxplot=r,b.xAxis=i,b.yAxis=o,b.tooltip=g,b.options=t.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},staggerLabels:{get:function(){return h},set:function(t){h=t}},showXAxis:{get:function(){return c},set:function(t){c=t}},showYAxis:{get:function(){return f},set:function(t){f=t}},tooltipContent:{get:function(){return g},set:function(t){g=t}},noData:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left}},duration:{get:function(){return $},set:function(t){$=t,y.reset($),x=d3.transition().duration($).ease(d3.easeLinear),r.duration($),i.duration($),o.duration($)}},color:{get:function(){return u},set:function(e){u=t.utils.getColor(e),r.color(u)}},rightAlignYAxis:{get:function(){return p},set:function(t){p=t,o.orient(t?"right":"left")}}}),t.utils.inheritOptions(b,r),t.utils.initOptions(b),b},t.models.bullet=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},n="left",r=!1,i=function(t){return t.ranges},o=function(t){return t.markers?t.markers:[]},a=function(t){return t.markerLines?t.markerLines:[0]},s=function(t){return t.measures},l=function(t){return t.rangeLabels?t.rangeLabels:[]},u=function(t){return t.markerLabels?t.markerLabels:[]},c=function(t){return t.markerLineLabels?t.markerLineLabels:[]},f=function(t){return t.measureLabels?t.measureLabels:[]},p=[0],h=380,g=30,v=null,m=null,$=t.utils.getColor(["#1f77b4"]),x=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),y=["Maximum","Mean","Minimum"],b=["Max","Avg","Min"],_=1e3,k=d3.transition().duration(_).ease(d3.easeLinear);function w(t,e){var n=t.slice();t.sort(function(t,r){var i=n.indexOf(t),o=n.indexOf(r);return d3.descending(e[i],e[o])})}function A(n){return n.each(function(n,m){var _=h-e.left-e.right,k=g-e.top-e.bottom;v=d3.select(this),t.utils.initSVG(v);var A=i.call(this,n,m).slice(),C=o.call(this,n,m).slice(),M=a.call(this,n,m).slice(),L=s.call(this,n,m).slice(),S=l.call(this,n,m).slice(),E=u.call(this,n,m).slice(),F=c.call(this,n,m).slice(),W=f.call(this,n,m).slice();w(S,A),w(E,C),w(F,M),w(W,L),A.sort(d3.descending),C.sort(d3.descending),M.sort(d3.descending),L.sort(d3.descending);var D=d3.scaleLinear().domain(d3.extent(d3.merge([p,A]))).range(r?[_,0]:[0,_]);this.__chart__||d3.scaleLinear().domain([0,1/0]).range(D.range()),this.__chart__=D,d3.min(A),d3.max(A),A[1];for(var I=v.selectAll("g.nv-wrap.nv-bullet").data([n]),T=I.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),O=I.select("g"),m=0,P=A.length;mv(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}),I.append("line").attr("class","nv-candlestick-lines").attr("transform",function(t,e){return"translate("+c(p(t,e))+",0)"}).attr("x1",0).attr("y1",function(t,e){return f(m(t,e))}).attr("x2",0).attr("y2",function(t,e){return f($(t,e))}),I.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",function(t,e){return"translate("+(c(p(t,e))-M/2)+","+(f(h(t,e))-(g(t,e)>v(t,e)?f(v(t,e))-f(g(t,e)):0))+")"}).attr("x",0).attr("y",0).attr("width",M).attr("height",function(t,e){var n=g(t,e),r=v(t,e);return n>r?f(r)-f(n):f(n)-f(r)}),I.select(".nv-candlestick-lines").transition().attr("transform",function(t,e){return"translate("+c(p(t,e))+",0)"}).attr("x1",0).attr("y1",function(t,e){return f(m(t,e))}).attr("x2",0).attr("y2",function(t,e){return f($(t,e))}),I.select(".nv-candlestick-rects").transition().attr("transform",function(t,e){return"translate("+(c(p(t,e))-M/2)+","+(f(h(t,e))-(g(t,e)>v(t,e)?f(v(t,e))-f(g(t,e)):0))+")"}).attr("x",0).attr("y",0).attr("width",M).attr("height",function(t,e){var n=g(t,e),r=v(t,e);return n>r?f(r)-f(n):f(n)-f(r)})}),C}return C.highlightPoint=function(t,n){C.clearHighlights(),e.select(".nv-candlestickBar .nv-tick-0-"+t).classed("hover",n)},C.clearHighlights=function(){e.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceX:{get:function(){return x},set:function(t){x=t}},forceY:{get:function(){return y},set:function(t){y=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return _},set:function(t){_=t}},id:{get:function(){return u},set:function(t){u=t}},interactive:{get:function(){return w},set:function(t){w=t}},x:{get:function(){return p},set:function(t){p=t}},y:{get:function(){return h},set:function(t){h=t}},open:{get:function(){return g()},set:function(t){g=t}},close:{get:function(){return v()},set:function(t){v=t}},high:{get:function(){return m},set:function(t){m=t}},low:{get:function(){return $},set:function(t){$=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!=t.top?t.top:a.top,a.right=void 0!=t.right?t.right:a.right,a.bottom=void 0!=t.bottom?t.bottom:a.bottom,a.left=void 0!=t.left?t.left:a.left}},color:{get:function(){return k},set:function(e){k=t.utils.getColor(e)}}}),t.utils.initOptions(C),C},t.models.cumulativeLineChart=function(){"use strict";var e,n,r=t.models.line(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=t.models.legend(),s=t.models.legend(),l=t.interactiveGuideline(),u=t.models.tooltip(),c={top:30,right:30,bottom:50,left:60},f=null,p=t.utils.defaultColor(),h=null,g=null,v=!0,m=!0,$=!0,x=!1,y=!0,b=!1,_=!0,k="top",w=r.id(),A=t.utils.state(),C=null,M=null,L=function(t){return t.average},S=d3.dispatch("stateChange","changeState","renderEnd"),E=250,F=d3.transition().duration(E).ease(d3.easeLinear),W=!1;A.index=0,A.rescaleY=_,i.tickPadding(7),u.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.updateState(!1);var D,I=d3.scaleLinear(),T={i:0,x:0},O=t.utils.renderWatch(S,E);function P(u){return O.reset(),O.models(r),m&&O.models(i),$&&O.models(o),u.each(function(u){var k,M,F,O=d3.select(this);t.utils.initSVG(O),O.classed("nv-chart-"+w,!0);var z,V,Y=t.utils.availableWidth(h,O,c),H=t.utils.availableHeight(g,O,c);if(P.update=function(){0===E?O.call(P):O.transition().duration(E).call(P)},P.container=this,A.setter((z=u,function(t){void 0!==t.index&&(T.i=t.index),void 0!==t.rescaleY&&(_=t.rescaleY),void 0!==t.active&&z.forEach(function(e,n){e.disabled=!t.active[n]})}),P.update).getter((V=u,function(){return{active:V.map(function(t){return!t.disabled}),index:T.i,rescaleY:_}})).update(),A.disabled=u.map(function(t){return!!t.disabled}),!C)for(F in C={},A)A[F]instanceof Array?C[F]=A[F].slice(0):C[F]=A[F];var X=d3.drag().on("start",function t(e,n){d3.select(P.container).style("cursor","ew-resize")}).on("drag",function t(e,n,r){T.x=e.x,T.i=Math.round(I.invert(T.x)),td()}).on("end",function t(e,n){d3.select(P.container).style("cursor","auto"),A.index=T.i,S.call("stateChange",this,A)});if(!u||!u.length||!u.filter(function(t){return t.values.length}).length)return t.utils.noData(P,O),P;O.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale(),I.domain([0,u[0].values.length-1]).range([0,Y]).clamp(!0);var u=(k=T.i,M=u,B||(B=r.y()),M.map(function(t,e){if(!t.values)return t;var n=t.values[k];if(null==n)return t;var r=B(n,k);return 1e-5>Math.abs(r)&&!W?(t.tempDisabled=!0,t):(t.tempDisabled=!1,t.values=t.values.map(function(t,e){return t.display={y:(B(t,e)-r)/r},t}),t)}));void 0===D&&(D=N(u)),_?r.yDomain(null):(r.yDomain(D),r.clipEdge(!0));var G=b?"none":"all",R=O.selectAll("g.nv-wrap.nv-cumulativeLine").data([u]),Z=u.filter(function(t){return!t.disabled&&!t.tempDisabled}),q=R.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine"),j=q.append("g");j.select("g");var K=j.append("g").attr("class","nv-interactive");K=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-interactive");var Q=j.append("g").attr("class","nv-x nv-axis").style("pointer-events","none");Q=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-x");var U=j.append("g").attr("class","nv-y nv-axis");U=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-y");var J=j.append("g").attr("class","nv-background");J=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-background");var tt=j.append("g").data([Z]).attr("class","nv-linesWrap nvd3-svg").style("pointer-events",G),te=j.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none");te=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-avgLinesWrap");var tn=j.append("g").attr("class","nv-legendWrap"),tr=j.append("g").attr("class","nv-controlsWrap");if(tr=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-controlsWrap"),tn=O.selectAll("g.nv-wrap.nv-cumulativeLine").select(".nv-legendWrap"),v?(a.width(Y),tn.datum(u).call(a),f||a.height()===c.top||(c.top=a.height(),H=t.utils.availableHeight(g,O,c)),tn.attr("transform","translate(0,"+-c.top+")")):tn.selectAll("*").remove(),q.attr("transform","translate("+c.left+","+c.top+")"),y){var ti=[{key:"Re-scale y-axis",disabled:!_}];s.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),tr.datum(ti).attr("transform","translate(0,"+-c.top+")").call(s)}else tr.selectAll("*").remove();x&&U.attr("transform","translate("+Y+",0)");var to=u.filter(function(t){return t.tempDisabled});q.select(".tempDisabled").remove(),to.length&&q.append("text").attr("class","tempDisabled").attr("x",Y/2).attr("y","-.71em").style("text-anchor","end").text(to.map(function(t){return t.key}).join(", ")+" values cannot be calculated for this time period."),b&&(l.width(Y).height(H).margin({left:c.left,top:c.top}).svgContainer(O).xScale(e),K.call(l));var ta=J.select("rect");ta.empty()&&J.append("rect"),ta.attr("width",Y).attr("height",H),r.y(function(t){return t.display.y}).width(Y).height(H).color(u.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!u[e].disabled&&!u[e].tempDisabled})),(tt=O.selectAll("g.nv-linesWrap.nvd3-svg").data([Z]).merge(tt)).call(r),u.forEach(function(t,e){t.seriesIndex=e});var ts=u.filter(function(t){return!t.disabled&&!!L(t)}),tl=te.selectAll("line").data(ts,function(t){return t.key}),tu=function(t){var e=n(L(t));return e<0?0:e>H?H:e};tl.exit().remove(),tl.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(t,e){return r.color()(t,t.seriesIndex)}).attr("x1",0).attr("x2",Y).attr("y1",tu).attr("y2",tu).style("stroke-opacity",function(t){var e=n(L(t));return e<0||e>H?0:1}).attr("x1",0).attr("x2",Y).attr("y1",tu).attr("y2",tu).merge(tl);var tc=tt.selectAll(".nv-indexLine").data([T]);function td(){tc.data([T]);var t=P.duration();P.duration(0),P.update(),P.duration(t)}tc.merge(tc.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(X)).attr("transform",function(t){return"translate("+I(t.i)+",0)"}).attr("height",H).merge(tc),m&&(i.scale(e)._ticks(t.utils.calcTicksX(Y/70,u)),i.tickSizeInner(-H),Q.attr("transform","translate(0,"+n.range()[0]+")"),Q.call(i).merge(R.select(".nv-x.nv-axis"))),$&&(o.scale(n)._ticks(t.utils.calcTicksY(H/36,u)),o.tickSizeInner(-Y),U.call(o)),ta.on("click",function(t){T.x=d3.pointer(t)[0],T.i=Math.round(I.invert(T.x)),A.index=T.i,S.call("stateChange",ta,A),td()}),r.dispatch.on("elementClick",function(t){T.i=t.pointIndex,T.x=I(T.i),A.index=T.i,S.call("stateChange",r,A),td()}),s.dispatch.on("legendClick",function(t,e,n){e.disabled=!e.disabled,_=!e.disabled,A.rescaleY=_,_||(D=N(u)),S.call("stateChange",this,A),P.update()}),a.dispatch.on("stateChange",function(t){for(var e in t)A[e]=t[e];S.call("stateChange",this,t),P.update()}),l.dispatch.on("elementMousemove",function(e){r.clearHighlights();var n,a,s,c=[];if(u.filter(function(t,e){return t.seriesIndex=e,!(t.disabled||t.tempDisabled)}).forEach(function(i,o){a=t.interactiveBisect(i.values,e.pointXValue,P.x()),r.highlightPoint(o,a,!0);var l=i.values[a];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=P.xScale()(P.x()(l,a))),c.push({key:i.key,value:P.y()(l,a),color:p(i,i.seriesIndex)}))}),c.length>2){var f=P.yScale().invert(e.mouseY),h=Math.abs(P.yScale().domain()[0]-P.yScale().domain()[1]),g=t.nearestValueIndex(c.map(function(t){return t.value}),f,.03*h);null!==g&&(c[g].highlight=!0)}var v=i.tickFormat()(P.x()(n,a),a);l.tooltip.valueFormatter(function(t,e){return o.tickFormat()(t)}).data({value:v,series:c})(),l.renderGuideLine(s)}),l.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),S.on("changeState",function(t){void 0!==t.disabled&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),A.disabled=t.disabled),void 0!==t.index&&(T.i=t.index,T.x=I(T.i),A.index=t.index,tc.data([T])),void 0!==t.rescaleY&&(_=t.rescaleY),P.update()})}),O.renderEnd("cumulativeLineChart immediate"),P}r.dispatch.on("elementMouseover.tooltip",function(t){var e={x:P.x()(t.point),y:P.y()(t.point),color:t.point.color};t.point=e,u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)});var B=null;function N(t){var e=t.filter(function(t){return!(t.disabled||t.tempDisabled)}).map(function(t,e){return d3.extent(t.values,function(t){return t.display.y})});return[d3.min(e,function(t){return t[0]}),d3.max(e,function(t){return t[1]})]}return P.dispatch=S,P.lines=r,P.legend=a,P.controls=s,P.xAxis=i,P.yAxis=o,P.interactiveLayer=l,P.state=A,P.tooltip=u,P.options=t.utils.optionsFunc.bind(P),P._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},showControls:{get:function(){return y},set:function(t){y=t}},showLegend:{get:function(){return v},set:function(t){v=t}},legendPosition:{get:function(){return k},set:function(t){k=t}},average:{get:function(){return L},set:function(t){L=t}},defaultState:{get:function(){return C},set:function(t){C=t}},noData:{get:function(){return M},set:function(t){M=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return $},set:function(t){$=t}},noErrorCheck:{get:function(){return W},set:function(t){W=t}},rescaleY:{get:function(){return _},set:function(t){_=t,P.state.rescaleY=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,f=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),a.color(p)}},useInteractiveGuideline:{get:function(){return b},set:function(t){b=t,!0===t&&(P.interactive(!1),P.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t}},duration:{get:function(){return E},set:function(t){E=t,r.duration(E),i.duration(E),o.duration(E),O.reset(E),F=d3.transition().duration(E).ease(d3.easeLinear)}}}),t.utils.inheritOptions(P,r),t.utils.initOptions(P),P},t.models.differenceChart=function(){"use strict";var e=void 0,n=t.models.multiChart(),r=t.models.focus(t.models.line()),i=function t(e){var n;return(n=e.y0,void 0!==n)?e.y0:e.y},o=function t(e){return e.x},a="x",s=function t(e){return e.y};d3.transition().duration(300).ease(d3.easeLinear);var l=null,u=null,c=null,f=null,p={top:30,right:50,bottom:20,left:70},h={top:0,right:0,bottom:0,left:0},g=!0,v=getInterpolationType(v),m=1,$=d3.scaleTime(),x=d3.timeFormat([["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",function(){return!0}]]);function y(o){o.each(function(o){e=d3.select(this);var a=(o||[]).filter(function(t){return!t.disabled});if(!o||!a.length)return t.utils.noData(y,e),y;var s=b(o),g=t.utils.availableHeight(c,e,p)-r.height(),m=t.utils.availableWidth(f,e,p);e.attr("class","nv-differenceChart"),t.utils.initSVG(e),y.container=this,n.margin(p).color(d3.scaleOrdinal(d3.schemeCategory10).range()).y(i).width(f).height(g).interpolate(v).useInteractiveGuideline(!0),n.interactiveLayer.tooltip.valueFormatter(function(t,e,n){if(n.key===u||n.key===l){var r=Math.abs(n.data.y0-n.data.y1);return 0===r?"-":r}return t}),n.stack1.areaY1(function(t){return n.stack1.scatter.yScale()(t.display.y)}),n.stack1.transformData(function(t){t.display={y:t.y1,y0:t.y0}}),n.xAxis.scale($),n.xAxis.tickFormat(x);var _=s.filter(function(t){return!t.disabled}).map(function(t){return t.values}),k=d3.extent(d3.merge(_),function(t){var e;return(e=t).x});n.xAxis.domain(k).range([0,m]);var w=d3.extent(d3.merge(_),function(t){return i(t)});n.yDomain1(w),n.yAxis1.tickFormat(d3.format(",.1f")),n.yAxis2.tickFormat(d3.format(",.1f")),r.width(m),r.margin(h),r.xScale($.copy()),r.xAxis.tickFormat(x),r.xAxis.rotateLabels(0);var A=e.append("g").attr("class","nv-focusWrap").style("display","initial").attr("transform","translate("+p.left+", "+(g+r.margin().top)+")").datum(s.filter(function(t){return"line"===t.type})).call(r);return A.datum(s).call(n),r.dispatch.on("brush",function(t){var e=s.map(function(e){var n=-1,r=-1;e.values.some(function(e,i){return -1===n&&e.x>=t[0]&&(n=i),-1===r&&e.x>=t[1]&&(r=i,!0)});for(var i=e.values.slice(n,r),o=0;i.length<2&&o<5;)n-=1,r+=1,i=e.values.slice(n,r),o++;return Object.assign({},e,{values:i})});A.datum(e),n.xAxis.domain(t),n.update()}),y.update=function(){A.selectAll("*").remove(),A.transition().duration(300).call(y)},y})}function b(t){var e=t.slice(0),n=e.every(function(t){return t.processed}),r=e.filter(function(t){return"actual"===t.type}),i=e.filter(function(t){return"expected"===t.type});if(n)return e;if(!r.length||!i.length)return[];var c=i[0].key+" minus "+r[0].key+" (Predicted > Actual)",f=i[0].key+" minus "+r[0].key+" (Predicted < Actual)",p=[{key:l||c,type:"area",values:[],yAxis:1,color:"rgba(44,160,44,.9)",processed:!0,noHighlightSeries:!0},{key:u||f,type:"area",values:[],yAxis:1,color:"rgba(234,39,40,.9)",processed:!0,noHighlightSeries:!0},{key:r[0].key,type:"line",values:[],yAxis:1,color:"#666666",processed:!0,strokeWidth:m}];g&&(p[3]={key:i[0].key,type:"line",values:[],yAxis:1,color:"#aec7e8",processed:!0,strokeWidth:m});var h=r[0].values.reduce(function(t,e,n){return t[o(e)]=s(e),t},{}),v=i[0].values.reduce(function(t,e,n){return t[o(e)]=s(e),t},{});return Object.keys(h).forEach(function(t,e){var n=h[t],r=v[t],i={};i[a]=t;var s=o(i),l=r-n;isNaN(l)?(p[1].values[e]={x:s,y0:n,y1:n},p[0].values[e]={x:s,y0:n,y1:n}):l<0?(p[1].values[e]={x:s,y0:n,y1:r},p[0].values[e]={x:s,y0:n,y1:n}):(p[0].values[e]={x:s,y0:n,y1:r},p[1].values[e]={x:s,y0:n,y1:n}),p[2].values[e]={x:s,y:n},g&&(p[3].values[e]={x:s,y:r})}),p}return y.options=t.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function t(){return f},set:function t(e){f=e}},height:{get:function t(){return c},set:function t(e){c=e}},strokeWidth:{get:function t(){return m},set:function t(e){m=e}},x:{get:function t(){return o},set:function t(e){o=e}},keyForXValue:{get:function t(){return a},set:function t(e){a=e}},y:{get:function t(){return s},set:function t(e){s=e}},xScale:{get:function t(){return $},set:function t(e){$=e}},keyForActualLessThanPredicted:{get:function t(){return l},set:function t(e){l=e}},keyForActualGreaterThanPredicted:{get:function t(){return u},set:function t(e){u=e}},showPredictedLine:{get:function t(){return g},set:function t(e){g=e}},tickFormat:{get:function t(){return x},set:function t(e){x=e}},interpolate:{get:function t(){return v},set:function t(e){v=e}},focusMargin:{get:function t(){return h},set:function t(e){h.top=void 0!==e.top?e.top:h.top,h.right=void 0!==e.right?e.right:h.right,h.bottom=void 0!==e.bottom?e.bottom:h.bottom,h.left=void 0!==e.left?e.left:h.left}},margin:{get:function t(){return p},set:function t(e){p.top=void 0!==e.top?e.top:p.top,p.right=void 0!==e.right?e.right:p.right,p.bottom=void 0!==e.bottom?e.bottom:p.bottom,p.left=void 0!==e.left?e.left:p.left}}}),y.xAxis=n.xAxis,y.yAxis=n.yAxis1,y.multiChart=n,y.focus=r,y.processData=b,t.utils.inheritOptions(y,n),t.utils.initOptions(y),y},t.models.discreteBar=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,f=Math.floor(1e4*Math.random()),p=d3.scaleBand(),h=d3.scaleLinear(),g=function(t){return t.x},v=function(t){return t.y},m=[0],$=t.utils.defaultColor(),x=0,y=!1,b=d3.format(",.2f"),_=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),k="discreteBar",w=250,A=t.utils.renderWatch(_,w);function C(f){return A.reset(),f.each(function(f){var w=u-l.left-l.right,C=c-l.top-l.bottom;r=d3.select(this),t.utils.initSVG(r),f.forEach(function(t,e){t.values.forEach(function(t){t.series=e,t.seriesIndex=e})});var M=i&&o?[]:f.map(function(t){return t.values.map(function(t,e){return{x:g(t,e),y:v(t,e),y0:t.y0}})});p.domain(i||d3.merge(M).map(function(t){return t.x})).range(a||[0,w],.1),h.domain(o||d3.extent(d3.merge(M).map(function(t){return t.y}).concat(m))),y?h.range(s||[C-(h.domain()[0]<0?12:0),h.domain()[1]>0?12:0]):h.range(s||[C,0]),e=e||p,n=n||h.copy().range([h(0),h(0)]);var L=r.selectAll("g.nv-wrap.nv-discretebar").data([f]).enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar");L.attr("transform","translate("+l.left+","+l.top+")");var S=L.append("g");S.select("g");var E=S.append("g").attr("class","nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key}).enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);E.exit().watchTransition(A,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),E.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}),E.watchTransition(A,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var F=E.selectAll("g.nv-bar").data(function(t){return t.values});F.exit().remove();var W=F.enter().append("g").attr("transform",function(t,e,n){return"translate("+(p(g(t,e))+.05*p.bandwidth())+", "+h(0)+")"}).on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0),_.call("elementMouseover",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),_.call("elementMouseout",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e,n){_.call("elementMousemove",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("click",function(t,e,n){_.call("elementClick",this,{data:e,index:e.index,color:d3.select(this).style("fill"),event:t,element:this}),t.stopPropagation()}).on("dblclick",function(t,e,n){_.call("elementDblClick",this,{data:e,index:e.index,color:d3.select(this).style("fill")}),t.stopPropagation()}),D=W.append("rect").attr("height",0).attr("width",.9*p.bandwidth()/f.length);y?W.append("text").attr("text-anchor","middle").text(function(t,e){return b(v(t,e))}).watchTransition(A,"discreteBar: bars text").attr("x",.9*p.bandwidth()/2).attr("y",function(t,e){return 0>v(t,e)?h(v(t,e))-h(0)+12:-4}):D.selectAll("text").remove(),W.attr("class",function(t,e){return 0>v(t,e)?"nv-bar negative":"nv-bar positive"}).style("fill",function(t,e){return t.color||$(t,e)}).style("stroke",function(t,e){return t.color||$(t,e)}).select("rect").attr("rx",x).attr("class",k).watchTransition(A,"discreteBar: bars rect").attr("width",.9*p.bandwidth()/f.length),W.watchTransition(A,"discreteBar: bars").attr("transform",function(t,e){var n=p(g(t,e))+.05*p.bandwidth(),r=0>v(t,e)?h(0):h(0)-h(v(t,e))<1?h(0)-1:h(v(t,e));return"translate("+n+", "+r+")"}).select("rect").attr("height",function(t,e){return Math.max(Math.abs(h(v(t,e))-h(0)),1)}),e=p.copy(),n=h.copy()}),A.renderEnd("discreteBar immediate"),C}return C.dispatch=_,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},forceY:{get:function(){return m},set:function(t){m=t}},showValues:{get:function(){return y},set:function(t){y=t}},cornerRadius:{get:function(){return x},set:function(t){x=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},xScale:{get:function(){return p},set:function(t){p=t}},yScale:{get:function(){return h},set:function(t){h=t}},xDomain:{get:function(){return i},set:function(t){i=t}},yDomain:{get:function(){return o},set:function(t){o=t}},xRange:{get:function(){return a},set:function(t){a=t}},yRange:{get:function(){return s},set:function(t){s=t}},valueFormat:{get:function(){return b},set:function(t){b=t}},id:{get:function(){return f},set:function(t){f=t}},rectClass:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},color:{get:function(){return $},set:function(e){$=t.utils.getColor(e)}},duration:{get:function(){return w},set:function(t){w=t,A.reset(w)}}}),t.utils.initOptions(C),C},t.models.discreteBarChart=function(){"use strict";var e,n,r=t.models.discreteBar(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=t.models.legend(),s=t.models.tooltip(),l={top:15,right:10,bottom:50,left:60},u=null,c=null,f=null,p=t.utils.getColor(),h=!1,g=!0,v=!0,m=!1,$=!1,x=!1,y=0,b=null,_=d3.dispatch("beforeUpdate","renderEnd"),k=250,w=d3.transition().duration(k).ease(d3.easeLinear);i.showMaxMin(!1),i.tickFormat(function(t){return t}),o.tickFormat(d3.format(",.1f")),s.duration(0).headerEnabled(!1).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).keyFormatter(function(t,e){return i.tickFormat()(t,e)});var A=t.utils.renderWatch(_,k);function C(s){return A.reset(),A.models(r),g&&A.models(i),v&&A.models(o),s.each(function(s){var p=d3.select(this),b=this;t.utils.initSVG(p);var w=t.utils.availableWidth(c,p,l),A=t.utils.availableHeight(f,p,l);if(C.update=function(){_.call("beforeUpdate",b),p.transition().duration(k).call(C)},C.container=this,!s||!s.length||!s.filter(function(t){return t.values.length}).length)return t.utils.noData(C,p),C;p.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var M=p.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]).enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g");M.attr("transform","translate("+l.left+","+l.top+")");var L=M.append("defs"),S=M.select("g"),E=M.append("g").attr("class","nv-x nv-axis");E=p.selectAll("g.nv-wrap.nv-discreteBarWithAxes").select(".nv-x");var F=M.append("g").attr("class","nv-y nv-axis"),W=F.append("g").attr("class","nv-zeroLine").append("line"),D=M.append("g").attr("class","nv-barsWrap"),I=M.append("g").attr("class","nv-legendWrap");if(I=p.selectAll("g.nv-wrap.nv-discreteBarWithAxes").select(".nv-legendWrap"),h?(a.width(w),I.datum(s).call(a),u||a.height()===l.top||(l.top=a.height(),A=t.utils.availableHeight(f,p,l)),I.attr("transform","translate(0,"+-l.top+")")):I.selectAll("*").remove(),m&&F.attr("transform","translate("+w+",0)"),r.width(w).height(A),D.datum(s.filter(function(t){return!t.disabled})).transition().duration(0).call(r),L.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect").attr("width",e.bandwidth()*($?2:1)).attr("height",16).attr("x",-e.bandwidth()/($?1:2)),g){i.scale(e)._ticks(t.utils.calcTicksX(w/100,s)),i.tickSizeInner(-A),E.attr("transform","translate(0,"+(n.range()[0]+(r.showValues()&&n.domain()[0]<0?16:0))+")"),E.call(i);var T=E.select("g.nvd3.nv-wrap.nv-axis").selectAll("g");$&&T.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}),y&&T.selectAll(".tick text").attr("transform","rotate("+y+" 0,0)").style("text-anchor",y>0?"start":"end"),x&&S.selectAll(".tick text").call(t.utils.wrapTicks,C.xAxis.bandwidth())}v&&(o.scale(n)._ticks(t.utils.calcTicksY(A/36,s,r.y())),o.tickSizeInner(-w),F.call(o)),W.attr("x1",0).attr("x2",m?-w:w).attr("y1",n(0)).attr("y2",n(0))}),A.renderEnd("discreteBar chart immediate"),C}return r.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:C.x()(t.data),value:C.y()(t.data),color:t.color},s.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){s.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){s()}),C.dispatch=_,C.discretebar=r,C.legend=a,C.xAxis=i,C.yAxis=o,C.tooltip=s,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return h},set:function(t){h=t}},staggerLabels:{get:function(){return $},set:function(t){$=t}},rotateLabels:{get:function(){return y},set:function(t){y=t}},wrapLabels:{get:function(){return x},set:function(t){x=!!t}},showXAxis:{get:function(){return g},set:function(t){g=t}},showYAxis:{get:function(){return v},set:function(t){v=t}},noData:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return k},set:function(t){k=t,A.reset(k),w=d3.transition().duration(k).ease(d3.easeLinear),r.duration(k),i.duration(k),o.duration(k)}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),r.color(p),a.color(p)}},rightAlignYAxis:{get:function(){return m},set:function(t){m=t,o.orient(t?"right":"left")}}}),t.utils.inheritOptions(C,r),t.utils.initOptions(C),C},t.models.distribution=function(){"use strict";var e,n={top:0,right:0,bottom:0,left:0},r=400,i=8,o="x",a=function(t){return t[o]},s=t.utils.defaultColor(),l=d3.scaleLinear(),u=250,c=d3.dispatch("renderEnd"),f=t.utils.renderWatch(c,u);function p(r){return f.reset(),r.each(function(r){"x"===o?(n.left,n.right):(n.top,n.bottom);var u="x"==o?"y":"x",c=d3.select(this);t.utils.initSVG(c),e=e||l;var p=c.selectAll("g.nv-distribution").data([r]),h=p.enter().append("g").attr("class","nvd3 nv-distribution");h.attr("transform","translate("+n.left+","+n.top+")");var g=h.append("g");p.select("g");var v=g.selectAll("g.nv-dist").data(function(t){return t},function(t){return t.key});v.enter().append("g").attr("class",function(t,e){return"nv-dist nv-series-"+e}).style("stroke",function(t,e){return s(t,e)});var m=v.selectAll("line.nv-dist"+o).data(function(t){return t.values});m.enter().append("line").attr(o+"1",function(t,n){return e(a(t,n))}).attr(o+"2",function(t,n){return e(a(t,n))}),f.transition(v.exit().selectAll("line.nv-dist"+o),"dist exit").attr(o+"1",function(t,e){return l(a(t,e))}).attr(o+"2",function(t,e){return l(a(t,e))}).style("stroke-opacity",0).remove(),m.attr("class",function(t,e){return"nv-dist"+o+" nv-dist"+o+"-"+e}).attr(u+"1",0).attr(u+"2",i),f.transition(m,"dist").attr(o+"1",function(t,e){return l(a(t,e))}).attr(o+"2",function(t,e){return l(a(t,e))}),e=l.copy()}),f.renderEnd("distribution immediate"),p}return p.options=t.utils.optionsFunc.bind(p),p.dispatch=c,p.margin=function(t){return arguments.length?(n.top=void 0!==t.top?t.top:n.top,n.right=void 0!==t.right?t.right:n.right,n.bottom=void 0!==t.bottom?t.bottom:n.bottom,n.left=void 0!==t.left?t.left:n.left,p):n},p.width=function(t){return arguments.length?(r=t,p):r},p.axis=function(t){return arguments.length?(o=t,p):o},p.size=function(t){return arguments.length?(i=t,p):i},p.getData=function(t){return arguments.length?(a="function"==typeof t?t:function(){return t},p):a},p.scale=function(t){return arguments.length?(l=t,p):l},p.color=function(e){return arguments.length?(s=t.utils.getColor(e),p):s},p.duration=function(t){return arguments.length?(u=t,f.reset(u),p):u},p},t.models.distroPlot=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,f=Math.floor(1e4*Math.random()),p=d3.scaleBand(),h=d3.scaleLinear(),g=function(t){return t.label},v=function(t){return t.value},m=function(t){return t.color},$=function(t){return t.values.q1},x=function(t){return t.values.q2},y=function(t){return t.values.q3},b=function(t){return t.values.mean},_=function(t){return t.values.wl[L]},k=function(t){return t.values.wu[L]},w=function(t){return t.values.min},A=function(t){return t.values.max},C=function(t){return t.values.dev},M=!1,L="iqr",S=!1,E=!1,F=!1,W=!1,D=!0,I=.7,T=!0,O="scott",P=!0,B=50,N=3,z=t.utils.defaultColor(),V=null,Y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),H=250,X=null;function G(t,e){void 0===e&&(e="scott");var n,r,i,o=(r=(n=t).sort(d3.ascending),i=(d3.quantile(r,.75)-d3.quantile(r,.25))/1.349,d3.min([d3.deviation(r),i])),a=t.length;return"scott"===e?Math.pow(1.059*o*a,-.2):Math.pow(.9*o*a,-.2)}function R(t){function e(t,e){var n,r,i,o,a=t.map(function(t){return F&&K.add(F(t)),v(t)}).sort(d3.ascending),s=d3.quantile(a,.25),l=d3.quantile(a,.75),u=l-s,c=l+1.5*u,f=s-1.5*u,p={iqr:d3.max([d3.min(a),d3.min(a.filter(function(t){return t>f}))]),minmax:d3.min(a),stddev:d3.mean(a)-d3.deviation(a)},g={iqr:d3.min([d3.max(a),d3.max(a.filter(function(t){return tg.iqr,n.isOutlierStdDev=n.datumg.stddev,n.randX=Math.random()*I*(1==Math.floor(2*Math.random())?1:-1)}):a.forEach(function(t,n){x.push({object_constancy:t.object_constancy,datum:t,key:e,isOutlier:tg.iqr,isOutlierStdDev:tg.stddev,randX:Math.random()*I*(1==Math.floor(2*Math.random())?1:-1)})}),isNaN(parseFloat(O))&&(n=-1!=["scott","silverman"].indexOf(O)?G(a,O):G(a));var y=(i=(r=n,function(t){return 1>=Math.abs(t/=r)?.75*(1-t*t)/r:0}),o=h._ticks(B),function(t){return o.map(function(e){var n=d3.mean(t,function(t){return i(e-t)});return{x:e,y:n}})}),b=P?function t(e,n){if(n[0]===n[1])return e;var r=e.reduce(function(t,e){return e.x>=n[0]&&e.x<=n[1]&&t.push(e),t},[]);return n[0]r[r.length-1].x&&r.push({x:n[1],y:r[r.length-1].y}),r}(y(a),d3.extent(a)):y(a),_=d3.scaleLinear().domain([0,d3.max(b,function(t){return t.y})]).clamp(!0);Q.push(_);var k={count:a.length,num_outlier:x.filter(function(t){return t.isOutlier}).length,sum:d3.sum(a),mean:$,q1:s,q2:m,q3:l,wl:p,wu:g,iqr:u,min:d3.min(a),max:d3.max(a),dev:d3.deviation(a),observations:x,key:e,kde:b,notch:1.57*u/Math.sqrt(a.length)};return F&&U.push({key:e,values:k}),k}if(t.forEach(function(t,e){t.object_constancy=e+"_"+v(t)+"_"+g(t)}),F){K=new Set;var n,r=d3.group().key(function(t){return g(t)}).key(function(t){return F(t)}).rollup(function(t){return e(t,g(t[0]))}).entries(t);K=K.values();for(var i=r.map(function(t){return t.key}),o=[],a=0;a').attr("transform","translate(-10,-8)scale(0.5)"),w.select(".nv-check-box").each(function(t,e){d3.select(this).selectAll("path").attr("stroke",x(t,e))})}var M=A.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");switch((A=w.merge(A)).on("mouseover",function(t,e,n){g.call("legendMouseover",t,e,n)}).on("mouseout",function(t,e,n){g.call("legendMouseout",t,e,n)}).on("click",function(t,e,n){g.call("legendClick",t,e,n);var r=A.data();f&&("classic"==v?p?(r.forEach(function(t){t.disabled=!0}),e.disabled=!1):(e.disabled=!e.disabled,r.every(function(t){return t.disabled})&&r.forEach(function(t){t.disabled=!1})):"furious"==v&&(h?(e.disengaged=!e.disengaged,e.userDisabled=void 0==e.userDisabled?!!e.disabled:e.userDisabled,e.disabled=e.disengaged||e.userDisabled):!h&&(e.disabled=!e.disabled,e.userDisabled=e.disabled,r.filter(function(t){return!t.disengaged}).every(function(t){return t.userDisabled})&&r.forEach(function(t){t.disabled=t.userDisabled=!1}))),g.call("stateChange",this,{disabled:r.map(function(t){return!!t.disabled}),disengaged:r.map(function(t){return!!t.disengaged})}))}).on("dblclick",function(t,e,n){if(("furious"!=v||!h)&&(g.call("legendDblclick",this,t,e,n),f)){var r=A.data();r.forEach(function(t){t.disabled=!0,"furious"==v&&(t.userDisabled=t.disabled)}),e.disabled=!1,"furious"==v&&(e.userDisabled=e.disabled),g.call("stateChange",this,{disabled:r.map(function(t){return!!t.disabled})})}}),A.classed("nv-disabled",function(t){return t.userDisabled}),A.exit().remove(),M.attr("fill",x(d,I)).text(function(t){return o(i(t))}),v){case"furious":P=23;break;case"classic":P=20}if(l){var L=[];A.each(function(e,n){if(o(i(e))&&o(i(e)).length>s){var r,a,l=o(i(e)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(e)))}else r=d3.select(this).select("text");try{if((a=r.node().getComputedTextLength())<=0)throw Error()}catch(c){a=t.utils.calcApproxTextWidth(r)}L.push(a+u)});for(var S=0,E=0,F=[];E<$&&S$&&S>1;){F=[],S--;for(var W=0;W(F[W%S]||0)&&(F[W%S]=L[W]);E=F.reduce(function(t,e,n,r){return t+e})}for(var D=[],I=0,T=0;IV&&(V=z),"translate("+B+","+N+")"}),k.attr("transform","translate("+(n-e.right-V)+","+e.top+")"),r=e.top+e.bottom+N+15}"furious"==v&&O.attr("width",function(t,e){return M[0][e].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),O.style("fill",y).style("stroke",function(t,e){return t.color||a(t,e)})}),m}return m.dispatch=g,m.options=t.utils.optionsFunc.bind(m),m._options=Object.create({},{width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},key:{get:function(){return i},set:function(t){i=t}},keyFormatter:{get:function(){return o},set:function(t){o=t}},align:{get:function(){return l},set:function(t){l=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return f},set:function(t){f=t}},radioButtonMode:{get:function(){return p},set:function(t){p=t}},expanded:{get:function(){return h},set:function(t){h=t}},vers:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return e},set:function(t){e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left}},color:{get:function(){return a},set:function(e){a=t.utils.getColor(e)}}}),t.utils.initOptions(m),m},t.models.heatMap=function(){"use strict";var e,n,r,i,o,a,s,l,u,c,f,p,h={top:0,right:0,bottom:0,left:0},g=960,v=500,m=Math.floor(1e4*Math.random()),$=d3.scaleBand(),x=d3.scaleBand(),y=!1,b=function(t){return t.x},_=function(t){return t.y},k=function(t){return t.value},w=!0,A=function(t){return"number"==typeof t?t.toFixed(0):t},C=!1,M=2,L=4,S=!1,E=!0,F=t.utils.defaultColor(),W=t.utils.defaultColor(),D="#bcbcbc",I="",T=5,O=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),P=250,B=function(t){return n/3},N=function(t){return r/3},z=!1;function V(t){var e=d3.median(t),n=t.map(function(t){return Math.abs(t-e)});return d3.median(n)}function Y(t){var e=S?to(t):k(t);return H()&&!isNaN(e)||void 0!==e?y(e):D}function H(){return"number"==typeof K[0]}function X(){d3.selectAll(".cell-hover").classed("cell-hover",!1),d3.selectAll(".no-hover").classed("no-hover",!1),d3.selectAll(".row-hover").classed("row-hover",!1),d3.selectAll(".column-hover").classed("column-hover",!1)}var G=function(t){var e=S?A(to(t)):A(k(t));return H()&&!isNaN(e)||void 0!==e?e:I};function R(t){return Object.keys(t).sort(function(e,n){return t[e]-t[n]})}function Z(t,e){return Object.keys(t).filter(function(n){return t[n]===e})[0]}var q={},j={},K=[],Q=[],U=[],J=[],tt=t.utils.renderWatch(O,P),te=["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],tn=function(t){return t._cellPos},tr=function(t){return tn(t).ix},ti=function(t){return tn(t).iy},to=function(t){return tn(t).norm},ta=function(t){return tn(t).idx};function ts(m){return tt.reset(),m.each(function(m){e=(q={},j={},K=[],Q=[],U=[],J=[],D=[],I={},P=0,tn=0,tl=0,(A=m).forEach(function(t){var e,n,r,i=b(t),o=_(t),a=k(t);i in q||(q[i]=P,P++,I[i]={},"function"==typeof u&&Q.push(u(t))),o in j||(j[o]=tn,tn++,I[i][o]={},"function"==typeof c&&U.push(c(t))),-1==K.indexOf(a)&&K.push(a),t._cellPos={idx:tl,ix:q[i],iy:j[o]},tl++,ts=[i,o],(e=J,n=ts,r=JSON.stringify(n),e.some(function(t){return JSON.stringify(t)===r}))?-1==D.indexOf(i+o)&&(D.push(i+o),console.warn("The row/column position "+i+"/"+o+" has multiple values; ensure each cell has only a single value.")):(J.push(ts),I[i][o]=t)}),K=K.sort(),tu=[],Object.keys(j).forEach(function(t){Object.keys(q).forEach(function(e){var n=I[e][t];if(n)tu.push(n);else{var r={idx:tl,ix:q[e],iy:j[t]};tl++,tu.push({_cellPos:r})}})}),S?function t(e){if(-1!=["centerRow","robustCenterRow","centerScaleRow","robustCenterScaleRow","centerColumn","robustCenterColumn","centerScaleColumn","robustCenterScaleColumn","centerAll","robustCenterAll","centerScaleAll","robustCenterScaleAll"].indexOf(S)){Object.keys(q),Object.keys(j);var n,r,i,o=!!S.includes("Scale"),a=S.includes("robust")?"median":"mean",s=S.includes("Row")?"row":S.includes("Column")?"col":null,l=(n=e,r=s,i={},n.forEach(function(t,e){"row"==r?(ti(t) in i||(i[ti(t)]=[]),i[ti(t)].push(k(t))):"col"==r?(tr(t) in i||(i[tr(t)]=[]),i[tr(t)].push(k(t))):null==r&&(0 in i||(i[0]=[]),i[0].push(k(t)))}),i),u={},c={};for(var f in l)u[f]="mean"==a?d3.mean(l[f]):d3.median(l[f]),o&&(c[f]="mean"==a?d3.deviation(l[f]):V(l[f]));e.forEach(function(t,e){if(H()){if("row"==s)var n=ti(t);else if("col"==s)var n=tr(t);else if(null==s)var n=0;var r=k(t)-u[n];o?t._cellPos.norm=r/c[n]:t._cellPos.norm=r}else t._cellPos.norm=k(t)})}else S=!1;return e}(tu):tu);var A,D,I,P,tn,ts,tl,tu,tc=g-h.left-h.right,td=v-h.top-h.bottom;r=tc/Object.keys(q).length,n=C?r/C:td/Object.keys(j).length,C&&(td=n*Object.keys(j).length-h.top-h.bottom),i=d3.select(this),t.utils.initSVG(i),$.domain(o||R(q)).range(s||[0,tc-L/2]),x.domain(a||R(j)).range(l||[0,td-L/2]),(y=H()?d3.scaleQuantize():d3.scaleOrdinal()).domain(p||(H()?S?d3.extent(e,function(t){return to(t)}):d3.extent(K):H()?void 0:K)).range(f||te);var tf=i.selectAll("g.nv-heatMapWrap").data([e]),tp=tf.enter().append("g").attr("class","nvd3 nv-heatMapWrap");tp.append("g").attr("class","cellWrap"),tf.watchTransition(tt,"nv-wrap: heatMapWrap").attr("transform","translate("+h.left+","+h.top+")"),tp.append("g").attr("class","cellGrid").style("opacity",1e-6);var th=tp.select(".cellGrid").selectAll(".gridLines.verticalGrid").data(Object.values(q).concat([Object.values(q).length]));th.enter().append("line").attr("class","gridLines verticalGrid"),th.exit().remove();var tg=tp.select(".cellGrid").selectAll(".gridLines.horizontalGrid").data(Object.values(j).concat([Object.values(j).length]));tg.enter().append("line").attr("class","gridLines horizontalGrid"),tg.exit().remove();var tv=tp.select(".cellWrap").selectAll(".nv-cell").data(function(t){return t},function(t){return ta(t)});tp.append("g").attr("class","xMetaWrap").attr("transform",function(){return"translate(0,"+(-B()-L-T)+")"});var tm=tp.select(".xMetaWrap").selectAll(".x-meta").data(Q);tm.enter().append("rect").attr("class","x-meta meta").attr("width",r-L).attr("height",B()).attr("transform","translate(0,0)").attr("fill",function(t){return F(t)}),tp.append("g").attr("class","yMetaWrap").attr("transform",function(t,e){return"translate("+(-N()-L-T)+",0)"});var t$=tp.select(".yMetaWrap").selectAll(".y-meta").data(U);t$.enter().append("rect").attr("class","y-meta meta").attr("width",N()).attr("height",n-L).attr("transform",function(t,e){return"translate(0,0)"}).attr("fill",function(t,e){return W(t)}),tm.exit().remove(),t$.exit().remove();var tx=tv.enter().append("g").style("opacity",1e-6).attr("transform",function(t){return"translate(0,"+ti(t)*n+")"}).attr("data-row",function(t){return ti(t)}).attr("data-column",function(t){return tr(t)});tx.append("rect"),tx.append("text").attr("text-anchor","middle").attr("dy",4).attr("class","cell-text"),tv.selectAll("rect").watchTransition(tt,"heatMap: rect").attr("width",r-L).attr("height",n-L).attr("rx",M).attr("ry",M).style("stroke",function(t){return Y(t)}),tv.attr("class",function(t){return isNaN(k(t))?"nv-cell cell-missing":"nv-cell"}).watchTransition(tt,"heatMap: cells").style({opacity:1,fill:function(t){return Y(t)}}).attr("transform",function(t){return"translate("+tr(t)*r+","+ti(t)*n+")"}).attr("class",function(t){return isNaN(k(t))?"nv-cell cell-missing":"nv-cell"}),tv.exit().remove(),tv.selectAll("text").watchTransition(tt,"heatMap: cells text").text(function(t){return G(t)}).attr("x",function(t){return(r-L)/2}).attr("y",function(t){return(n-L)/2}).style("fill",function(t){return function t(e){if(!E)return"black";var n,r=d3.rgb(e),i=r.r,o=r.g;return(299*i+587*o+114*r.b)/1e3>=128?"#404040":"#EDEDED"}(Y(t))}).style("opacity",function(){return w?1:0}),tp.selectAll(".verticalGrid").watchTransition(tt,"heatMap: gridLines").attr("y1",0).attr("y2",td-L).attr("x1",function(t){return t*r-L/2}).attr("x2",function(t){return t*r-L/2});var ty=Object.keys(j).length;tp.selectAll(".horizontalGrid").watchTransition(tt,"heatMap: gridLines").attr("x1",function(t){return 0==t||t==ty?-L:0}).attr("x2",function(t){return 0==t||t==ty?tc:tc-L}).attr("y1",function(t){return t*n-L/2}).attr("y2",function(t){return t*n-L/2}),tp.select(".cellGrid").watchTransition(tt,"heatMap: gridLines").style({"stroke-width":L,opacity:function(){return z?1:1e-6}}),tp.selectAll(".x-meta"),tp.selectAll(".y-meta");var tb=tp.selectAll(".meta");tm.watchTransition(tt,"heatMap: xMetaRect").attr("width",r-L).attr("height",B()).attr("transform",function(t,e){return"translate("+e*r+",0)"}),t$.watchTransition(tt,"heatMap: yMetaRect").attr("width",N()).attr("height",n-L).attr("transform",function(t,e){return"translate(0,"+e*n+")"}),tp.select(".xMetaWrap").watchTransition(tt,"heatMap: xMetaWrap").attr("transform",function(t,e){return"translate(0,"+(-B()-L-T)+")"}).style("opacity",function(){return!1!==u?1:0}),tp.select(".yMetaWrap").watchTransition(tt,"heatMap: yMetaWrap").attr("transform",function(t,e){return"translate("+(-N()-L-T)+",0)"}).style("opacity",function(){return!1!==c?1:0}),tv.on("mouseover",function(t,e){var n=ta(t),r=tr(t),i=ti(t);d3.selectAll(".nv-cell").each(function(t){n==ta(t)?(d3.select(this).classed("cell-hover",!0),d3.select(this).classed("no-hover",!1)):(d3.select(this).classed("no-hover",!0),d3.select(this).classed("cell-hover",!1)),r==tr(t)&&(d3.select(this).classed("no-hover",!1),d3.select(this).classed("column-hover",!0)),i==ti(t)&&(d3.select(this).classed("no-hover",!1),d3.select(this).classed("row-hover",!0))}),d3.selectAll(".x-meta").each(function(t,e){e==r?(d3.select(this).classed("cell-hover",!0),d3.select(this).classed("no-hover",!1)):(d3.select(this).classed("no-hover",!0),d3.select(this).classed("cell-hover",!1))}),d3.selectAll(".y-meta").each(function(t,e){e==i?(d3.select(this).classed("cell-hover",!0),d3.select(this).classed("no-hover",!1)):(d3.select(this).classed("no-hover",!0),d3.select(this).classed("cell-hover",!1))}),O.call("elementMouseover",this,{value:Z(q,r)+" & "+Z(j,i),series:{value:G(t),color:d3.select(this).select("rect").style("fill")},e:d3.event})}).on("mouseout",function(t,e){d3.select(this).select("rect").node().getBBox();var n=d3.pointer(d3.select(".nv-heatMap").node()),r=n[0],i=n[1];(r+L>=tc||i+L>=td||r<0||i<0)&&(X(),O.call("elementMouseout",this,{e:d3.event}))}).on("mousemove",function(t,e){O.call("elementMousemove",this,{e:d3.event})}),tb.on("mouseover",function(t,e){var n=-1!=d3.select(this).attr("class").indexOf("x-meta");d3.selectAll(".nv-cell").each(function(t){n&&e==tr(t)?(d3.select(this).classed("column-hover",!0),d3.select(this).classed("no-hover",!1)):n||e-Q.length!=ti(t)?(d3.select(this).classed("no-hover",!0),d3.select(this).classed("column-hover",!1),d3.select(this).classed("row-hover",!1)):(d3.select(this).classed("row-hover",!0),d3.select(this).classed("no-hover",!1)),d3.select(this).classed("cell-hover",!1)}),d3.selectAll(".meta").classed("no-hover",!0),d3.select(this).classed("cell-hover",!0),d3.select(this).classed("no-hover",!1),O.call("elementMouseover",this,{value:n?"Column meta":"Row meta",series:{value:t,color:d3.select(this).style("fill")}})}).on("mouseout",function(t,e){var n=-1!=d3.select(this).attr("class").indexOf("x-meta");d3.select(this).node().getBBox();var r=d3.pointer(d3.select(n?".xMetaWrap":".yMetaWrap").node()),i=r[0],o=r[1];(o<0||i<0||n&&i+L>=tc||!n&&o+L>=td)&&(X(),O.call("elementMouseout",this,{e:d3.event}))}).on("mousemove",function(t,e){O.call("elementMousemove",this,{e:d3.event})})}),tt.renderEnd("heatMap immediate"),ts}return ts.dispatch=O,ts.options=t.utils.optionsFunc.bind(ts),ts._options=Object.create({},{width:{get:function(){return g},set:function(t){g=t}},height:{get:function(){return v},set:function(t){v=t}},showCellValues:{get:function(){return w},set:function(t){w=t}},x:{get:function(){return b},set:function(t){b=t}},y:{get:function(){return _},set:function(t){_=t}},cellValue:{get:function(){return k},set:function(t){k=t}},missingDataColor:{get:function(){return D},set:function(t){D=t}},missingDataLabel:{get:function(){return I},set:function(t){I=t}},xScale:{get:function(){return $},set:function(t){$=t}},yScale:{get:function(){return x},set:function(t){x=t}},colorScale:{get:function(){return y},set:function(t){y=t}},xDomain:{get:function(){return o},set:function(t){o=t}},yDomain:{get:function(){return a},set:function(t){a=t}},xRange:{get:function(){return s},set:function(t){s=t}},yRange:{get:function(){return l},set:function(t){l=t}},colorRange:{get:function(){return f},set:function(t){f=t}},colorDomain:{get:function(){return p},set:function(t){p=t}},xMeta:{get:function(){return u},set:function(t){u=t}},yMeta:{get:function(){return c},set:function(t){c=t}},xMetaColorScale:{get:function(){return color},set:function(e){color=t.utils.getColor(e)}},yMetaColorScale:{get:function(){return color},set:function(e){color=t.utils.getColor(e)}},cellAspectRatio:{get:function(){return C},set:function(t){C=t}},cellRadius:{get:function(){return M},set:function(t){M=t}},cellHeight:{get:function(){return n}},cellWidth:{get:function(){return r}},normalize:{get:function(){return S},set:function(t){S=t}},cellBorderWidth:{get:function(){return L},set:function(t){L=t}},highContrastText:{get:function(){return E},set:function(t){E=t}},cellValueFormat:{get:function(){return A},set:function(t){A=t}},id:{get:function(){return m},set:function(t){m=t}},metaOffset:{get:function(){return T},set:function(t){T=t}},xMetaHeight:{get:function(){return B},set:function(t){B=t}},yMetaWidth:{get:function(){return N},set:function(t){N=t}},showGrid:{get:function(){return z},set:function(t){z=t}},margin:{get:function(){return h},set:function(t){h.top=void 0!==t.top?t.top:h.top,h.right=void 0!==t.right?t.right:h.right,h.bottom=void 0!==t.bottom?t.bottom:h.bottom,h.left=void 0!==t.left?t.left:h.left}},duration:{get:function(){return P},set:function(t){P=t,tt.reset(P)}}}),t.utils.initOptions(ts),ts},t.models.heatMapChart=function(){"use strict";var e,n,r=t.models.heatMap(),i=t.models.legend(),o=(t.models.legend(),t.models.legend(),t.models.tooltip()),a=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),s=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),l={top:20,right:10,bottom:50,left:60},u=null,c=null,f=null,p=(t.utils.getColor(),!0),h=!1,g=!0,v=!0,m="left",$="top",x=0,y=null,b=d3.dispatch("beforeUpdate","renderEnd"),_=250;d3.transition().duration(_).ease(d3.easeLinear),a.showMaxMin(!1).tickFormat(function(t){return t}),s.showMaxMin(!1).tickFormat(function(t){return t}),o.duration(0).headerEnabled(!0).keyFormatter(function(t,e){return a.tickFormat()(t,e)});var k=t.utils.renderWatch(b,_);function w(o){return k.reset(),k.models(r),k.models(a),k.models(s),o.each(function(o){var u=d3.select(this);t.utils.initSVG(u);var y=t.utils.availableWidth(c,u,l),A=t.utils.availableHeight(f,u,l);if(w.update=function(){b.call("beforeUpdate",this),u.transition().duration(_).call(w)},w.container=this,!o||!o.length)return t.utils.noData(w,u),w;u.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale();var C=u.selectAll("g.nv-wrap").data([o]),M=C.enter().append("g");M.attr("transform","translate("+l.left+","+l.top+")");var L=M.attr("class","nvd3 nv-wrap").append("g"),S=C.select("g"),E=L.append("g").attr("class","nv-heatMap"),F=L.append("g").attr("class","nv-legendWrap"),W=L.append("g").attr("class","nv-x nv-axis");W=u.selectAll("g.nv-wrap.nv-heatMap").select(".nv-x");var D=L.append("g").attr("class","nv-y nv-axis");F=u.selectAll("g.nv-wrap").select(".nv-legendWrap"),r.width(y).height(A),E.datum(o.filter(function(t){return!t.disabled})).transition().call(r),r.cellAspectRatio()&&(A=r.cellHeight()*n.domain().length,r.height(A)),a.scale(e)._ticks(t.utils.calcTicksX(y/100,o)),a.tickSizeInner(-A);var I=W;I.call(a).watchTransition(k,"heatMap: axisX").selectAll(".tick").style("opacity",function(){return g?1:0}),I.select("g.nvd3.nv-wrap.nv-axis").selectAll("g").selectAll(".tick text").attr("transform",function(t,e,n){return"translate(0, "+(h?n%2==0?"5":"17":"0")+") rotate("+(0!=x?x:"0")+" 0,0)"}).style("text-anchor",x>0?"start":x<0?"end":"middle");var T=-5;if("function"==typeof r.xMeta()&&(I.selectAll("text").style("text-anchor","middle"),T=-r.xMetaHeight()()/2-r.metaOffset()+3),"bottom"==$){if(I.watchTransition(k,"heatMap: axisX").attr("transform","translate(0,"+(A-T)+")"),!1!==r.xMeta()){var O=A+r.metaOffset()+r.cellBorderWidth();S.select(".xMetaWrap").watchTransition(k,"heatMap: xMetaWrap").attr("transform",function(t,e){return"translate(0,"+O+")"})}}else I.watchTransition(k,"heatMap: axisX").attr("transform","translate(0,"+T+")");s.scale(n)._ticks(t.utils.calcTicksY(A/36,o)),s.tickSizeInner(-y);var P=D;P.call(s).watchTransition(k,"heatMap: axisY").selectAll(".tick").style("opacity",function(){return v?1:0});var B=-5;if("function"==typeof r.yMeta()&&(P.selectAll("text").style("text-anchor","middle"),B=-r.yMetaWidth()()/2-r.metaOffset()),"right"==m){if(P.attr("transform","translate("+(y-B)+",0)"),!1!==r.yMeta()){var O=y+r.metaOffset()+r.cellBorderWidth();S.select(".yMetaWrap").watchTransition(k,"heatMap: yMetaWrap").attr("transform",function(t,e){return"translate("+O+",0)"})}}else P.attr("transform","translate("+B+",0)");var N,z,V=F;i.width(y).color(r.colorScale().range());var Y=(N="string"==typeof(z=r.colorScale()).domain()[0]?z.domain():z.range().map(function(t){var e=z.invertExtent(t);return null===e[0]&&(e[0]=z.domain()[0]),null===e[1]&&(e[1]=z.domain()[1]),e})).map(function(t){return Array.isArray(t)?{key:t[0].toFixed(1)+" - "+t[1].toFixed(1)}:{key:t}});V.datum(Y).call(i).attr("transform","translate(0,"+("top"==$?A:-30)+")"),V.watchTransition(k,"heatMap: nv-legendWrap").style("opacity",function(){return p?1:0})}),d3.selectAll(".nv-axis").selectAll("line").style("stroke-opacity",0),yAxisAppend.select("path.domain").remove(),k.renderEnd("heatMap chart immediate"),w}return r.dispatch.on("elementMouseover.tooltip",function(t){o.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){o.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){o()}),w.dispatch=b,w.heatMap=r,w.legend=i,w.xAxis=a,w.yAxis=s,w.tooltip=o,w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return g},set:function(t){g=t}},showYAxis:{get:function(){return v},set:function(t){v=t}},staggerLabels:{get:function(){return h},set:function(t){h=t}},rotateLabels:{get:function(){return x},set:function(t){x=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return _},set:function(t){_=t,k.reset(_),r.duration(_),a.duration(_),s.duration(_)}},alignYAxis:{get:function(){return m},set:function(t){m=t}},alignXAxis:{get:function(){return $},set:function(t){$=t}}}),t.utils.inheritOptions(w,r),t.utils.initOptions(w),w},t.models.historicalBar=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scaleLinear(),f=d3.scaleLinear(),p=function(t){return t.x},h=function(t){return t.y},g=[],v=[0],m=!1,$=!0,x=t.utils.defaultColor(),y=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),b=!0,_=t.utils.renderWatch(y,0);function k(w){return w.each(function(k){_.reset(),u=d3.select(this);var w=t.utils.availableWidth(a,u,o),A=t.utils.availableHeight(s,u,o);t.utils.initSVG(u),c.domain(e||d3.extent(k[0].values.map(p).concat(g))),m?c.range(r||[.5*w/k[0].values.length,w*(k[0].values.length-.5)/k[0].values.length]):c.range(r||[0,w]),f.domain(n||d3.extent(k[0].values.map(h).concat(v))).range(i||[A,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+.01*f.domain()[0],f.domain()[1]-.01*f.domain()[1]]):f.domain([-1,1]));var C=u.selectAll("g.nv-wrap.nv-historicalBar-"+l).data([k[0].values]).enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+l);C.attr("transform","translate("+o.left+","+o.top+")");var M=C.append("defs"),L=C.append("g"),S=C.select("g"),E=L.append("g").attr("class","nv-bars");u.on("click",function(t,e,n){y.call("chartClick",this,{data:e,index:e.index,pos:t,id:l})}),M.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect").attr("width",w).attr("height",A),S.attr("clip-path",$?"url(#nv-chart-clip-path-"+l+")":"");var F=E.selectAll(".nv-bar").data(function(t){return t},function(t,e){return p(t,e)});F.exit().remove();var W=F.enter().append("rect").attr("x",0).attr("y",function(e,n){return t.utils.NaNtoZero(f(Math.max(0,h(e,n))))}).attr("height",function(e,n){return t.utils.NaNtoZero(Math.abs(f(h(e,n))-f(0)))}).attr("transform",function(t,e){return"translate("+(c(p(t,e))-w/k[0].values.length*.45)+",0)"}).on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),b&&(d3.select(this).classed("hover",!0),y.call("elementMouseover",this,{data:e,index:e.index,color:d3.select(this).style("fill")}))}).on("mouseout",function(t,e,n){b&&(d3.select(this).classed("hover",!1),y.call("elementMouseout",this,{data:e,index:e.index,color:d3.select(this).style("fill")}))}).on("mousemove",function(t,e,n){b&&y.call("elementMousemove",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("click",function(t,e,n){b&&(y.call("elementClick",this,{data:e,index:e.index,color:d3.select(this).style("fill"),event:d3.event,element:this}),t.stopPropagation())}).on("dblclick",function(t,e,n){b&&(y.call("elementDblClick",this,{data:e,index:e.index,color:d3.select(this).style("fill")}),t.stopPropagation())});W.attr("fill",function(t,e){return x(t,e)}).attr("class",function(t,e,n){return(0>h(t,e)?"nv-bar negative":"nv-bar positive")+" nv-bar-0-"+e}).watchTransition(_,"bars").attr("transform",function(t,e){return"translate("+(c(p(t,e))-w/k[0].values.length*.45)+",0)"}).attr("width",w/k[0].values.length*.9),W.watchTransition(_,"bars").attr("y",function(e,n){var r=0>h(e,n)?f(0):f(0)-f(h(e,n))<1?f(0)-1:f(h(e,n));return t.utils.NaNtoZero(r)}).attr("height",function(e,n){return t.utils.NaNtoZero(Math.max(Math.abs(f(h(e,n))-f(0)),1))})}),_.renderEnd("historicalBar immediate"),k}return k.highlightPoint=function(t,e){u.select(".nv-bars .nv-bar-0-"+t).classed("hover",e)},k.clearHighlights=function(){u.select(".nv-bars .nv-bar.hover").classed("hover",!1)},k.dispatch=y,k.options=t.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return g},set:function(t){g=t}},forceY:{get:function(){return v},set:function(t){v=t}},padData:{get:function(){return m},set:function(t){m=t}},x:{get:function(){return p},set:function(t){p=t}},y:{get:function(){return h},set:function(t){h=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},clipEdge:{get:function(){return $},set:function(t){$=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return x},set:function(e){x=t.utils.getColor(e)}}}),t.utils.initOptions(k),k},t.models.historicalBarChart=function(e){"use strict";var n,r,i=e||t.models.historicalBar(),o=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),a=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),s=t.models.legend(),l=t.interactiveGuideline(),u=t.models.tooltip(),c={top:30,right:90,bottom:50,left:90},f=null,p=t.utils.defaultColor(),h=null,g=null,v=!1,m=!0,$=!0,x=!1,y=!1,b={},_=null,k=null,w=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),A=250;o.tickPadding(7),u.duration(0).headerEnabled(!1).valueFormatter(function(t,e){return a.tickFormat()(t,e)}).headerFormatter(function(t,e){return o.tickFormat()(t,e)});var C=t.utils.renderWatch(w,0);function M(e){return e.each(function(u){C.reset(),C.models(i),m&&C.models(o),$&&C.models(a);var k,L=d3.select(this);t.utils.initSVG(L);var S=t.utils.availableWidth(h,L,c),E=t.utils.availableHeight(g,L,c);if(M.update=function(){L.transition().duration(A).call(M)},M.container=this,b.disabled=u.map(function(t){return!!t.disabled}),!_)for(k in _={},b)b[k]instanceof Array?_[k]=b[k].slice(0):_[k]=b[k];if(!u||!u.length||!u.filter(function(t){return t.values.length}).length)return t.utils.noData(M,L),M;L.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale();var F=L.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]),W=F.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart"),D=W.append("g");W.select("g");var I=D.append("g").attr("class","nv-x nv-axis");I=L.selectAll("g.nv-wrap.nv-historicalBarChart").select(".nv-x");var T=D.append("g").attr("class","nv-y nv-axis"),O=D.append("g").attr("class","nv-barsWrap"),P=D.append("g").attr("class","nv-legendWrap"),B=D.append("g").attr("class","nv-interactive");P=L.selectAll("g.nv-wrap.nv-historicalBarChart").select(".nv-legendWrap"),v?(s.width(S),P.datum(u).call(s),f||s.height()===c.top||(c.top=s.height(),E=t.utils.availableHeight(g,L,c)),P.attr("transform","translate(0,"+-c.top+")")):P.selectAll("*").remove(),W.attr("transform","translate("+c.left+","+c.top+")"),x&&T.attr("transform","translate("+S+",0)"),y&&(l.width(S).height(E).margin({left:c.left,top:c.top}).svgContainer(L).xScale(n),B.call(l)),i.width(S).height(E).color(u.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!u[e].disabled})),O.datum(u.filter(function(t){return!t.disabled})).transition().call(i),m&&(o.scale(n)._ticks(t.utils.calcTicksX(S/100,u)),o.tickSizeInner(-E),I.attr("transform","translate(0,"+r.range()[0]+")"),I.transition().call(o)),$&&(a.scale(r)._ticks(t.utils.calcTicksY(E/36,u)),a.tickSizeInner(-S),T.transition().call(a)),l.dispatch.on("elementMousemove",function(e){i.clearHighlights();var n,r,s,c=[];u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(o,a){r=t.interactiveBisect(o.values,e.pointXValue,M.x()),i.highlightPoint(r,!0);var l=o.values[r];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=M.xScale()(M.x()(l,r))),c.push({key:o.key,value:M.y()(l,r),color:p(o,o.seriesIndex),data:o.values[r]}))});var f=o.tickFormat()(M.x()(n,r));l.tooltip.valueFormatter(function(t,e){return a.tickFormat()(t)}).data({value:f,index:r,series:c})(),l.renderGuideLine(s)}),l.dispatch.on("elementMouseout",function(t){w.call("tooltipHide",this),i.clearHighlights()}),s.dispatch.on("legendClick",function(t,n,r){n.disabled=!n.disabled,u.filter(function(t){return!t.disabled}).length||u.map(function(t){return t.disabled=!1,F.selectAll(".nv-series").classed("disabled",!1),t}),b.disabled=u.map(function(t){return!!t.disabled}),w.call("stateChange",this,b),e.transition().call(M)}),s.dispatch.on("legendDblclick",function(t){u.forEach(function(t){t.disabled=!0}),t.disabled=!1,b.disabled=u.map(function(t){return!!t.disabled}),w.call("stateChange",this,b),M.update()}),w.on("changeState",function(t){void 0!==t.disabled&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),b.disabled=t.disabled),M.update()})}),C.renderEnd("historicalBarChart immediate"),M}return i.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:M.x()(t.data),value:M.y()(t.data),color:t.color},u.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),i.dispatch.on("elementMousemove.tooltip",function(t){u()}),M.dispatch=w,M.bars=i,M.legend=s,M.xAxis=o,M.yAxis=a,M.interactiveLayer=l,M.tooltip=u,M.options=t.utils.optionsFunc.bind(M),M._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},showLegend:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return $},set:function(t){$=t}},defaultState:{get:function(){return _},set:function(t){_=t}},noData:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,f=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),s.color(p),i.color(p)}},duration:{get:function(){return A},set:function(t){A=t,C.reset(A),a.duration(A),o.duration(A)}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t}},useInteractiveGuideline:{get:function(){return y},set:function(t){y=t,!0===t&&M.interactive(!1)}}}),t.utils.inheritOptions(M,i),t.utils.initOptions(M),M},t.models.ohlcBarChart=function(){var e=t.models.historicalBarChart(t.models.ohlcBar());return e.useInteractiveGuideline(!0),e.interactiveLayer.tooltip.contentGenerator(function(t){var n=t.series[0].data;return'

'+t.value+"

open:"+e.yAxis.tickFormat()(n.open)+"
close:"+e.yAxis.tickFormat()(n.close)+"
high"+e.yAxis.tickFormat()(n.high)+"
low:"+e.yAxis.tickFormat()(n.low)+"
"}),e},t.models.candlestickBarChart=function(){var e=t.models.historicalBarChart(t.models.candlestickBar());return e.useInteractiveGuideline(!0),e.interactiveLayer.tooltip.contentGenerator(function(t){var n=t.series[0].data;return'

'+t.value+"

open:"+e.yAxis.tickFormat()(n.open)+"
close:"+e.yAxis.tickFormat()(n.close)+"
high"+e.yAxis.tickFormat()(n.high)+"
low:"+e.yAxis.tickFormat()(n.low)+"
"}),e},t.models.legend=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},o=function(t){return t},a=t.utils.getColor(),s=20,l=!0,u=32,c=!0,f=!0,p=!0,h=!1,g=!1,v=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),m="classic";function $(x){function y(t,e){return"furious"!=m?"#000":g?t.disengaged?"#000":"#fff":g?void 0:(t.color||(t.color=a(t,e)),t.disabled?t.color:"#fff")}function b(t,e){return g&&"furious"==m&&t.disengaged?"#eee":t.color||a(t,e)}function _(t,e){return g&&"furious"==m?1:t.disabled?0:1}return x.each(function(a){var $=n-e.left-e.right,x=d3.select(this);t.utils.initSVG(x),x.selectAll("g.nv-legend").remove();var k=x.selectAll("g.nv-legend").data([a]).enter().append("g").attr("class","nvd3 nv-legend");c?k.attr("transform","translate("+-e.right+","+e.top+")"):k.attr("transform","translate("+e.left+","+e.top+")");var w=k.append("g");w.select("g");var A=x.selectAll("g.nv-legend").select("g").selectAll(".nv-series").data(function(t){return"furious"!=m?t:t.filter(function(t){return!!g||!t.disengaged})}),C=A.enter().append("g").attr("class","nv-series");switch(C=A.merge(C),m){case"furious":B=23;break;case"classic":B=20}if("classic"==m)C.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),P=C.select(".nv-legend-symbol");else if("furious"==m){C.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),P=C.select(".nv-legend-symbol"),C.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)").each(function(t,e){d3.select(this).selectAll("path").attr("stroke",y(t,e))})}C.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var M=C.select("text.nv-legend-text");C.on("mouseover",function(t,e,n){v.call("legendMouseover",C,t,e,n)}).on("mouseout",function(t,e,n){v.call("legendMouseout",C,t,e,n)}).on("click",function(t,e,n){v.call("legendClick",C,t,e,n);var r=C.data();f&&("classic"==m?h?(r.forEach(function(t){t.disabled=!0}),e.disabled=!1):(e.disabled=!e.disabled,r.every(function(t){return t.disabled})&&r.forEach(function(t){t.disabled=!1})):"furious"==m&&(g?(e.disengaged=!e.disengaged,e.userDisabled=void 0==e.userDisabled?!!e.disabled:e.userDisabled,e.disabled=e.disengaged||e.userDisabled):!g&&(e.disabled=!e.disabled,e.userDisabled=e.disabled,r.filter(function(t){return!t.disengaged}).every(function(t){return t.userDisabled})&&r.forEach(function(t){t.disabled=t.userDisabled=!1}))),v.call("stateChange",A,{disabled:r.map(function(t){return!!t.disabled}),disengaged:r.map(function(t){return!!t.disengaged})}))}).on("dblclick",function(t,e,n){if(p&&("furious"!=m||!g)&&(v.call("legendDblclick",C,t,e,n),f)){var r=C.data();r.forEach(function(t){t.disabled=!0,"furious"==m&&(t.userDisabled=t.disabled)}),e.disabled=!1,"furious"==m&&(e.userDisabled=e.disabled),v.call("stateChange",C,{disabled:r.map(function(t){return!!t.disabled})})}}),C.classed("nv-disabled",function(t){return t.userDisabled}),C.exit().remove(),M.attr("fill",y).text(function(t){return o(i(t))});var L=0;if(l){var S=[];C.each(function(e,n){if(o(i(e))&&o(i(e)).length>s){var r,a,l=o(i(e)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(e)))}else r=d3.select(this).select("text");try{if((a=r.node().getComputedTextLength())<=0)throw Error()}catch(c){a=t.utils.calcApproxTextWidth(r)}S.push(a+u)});var E=0,F=[];for(L=0;L<$&&E$&&E>1;){F=[],E--;for(var W=0;W(F[W%E]||0)&&(F[W%E]=S[W]);L=F.reduce(function(t,e,n,r){return t+e})}for(var D=[],I=0,T=0;IY&&(Y=V),L0?_:0),A.attr("clip-path",g?"url(#nv-edge-clip-"+r.id()+")":""),C.attr("clip-path",g?"url(#nv-edge-clip-"+r.id()+")":"");var M=s.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key}),L=M.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",function(t){return t.strokeWidth||l}).style("fill-opacity",1e-6);M.exit().remove(),(L=M.merge(L)).attr("class",function(t,e){return(t.classed||"")+" nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return u(t,e)}).style("stroke",function(t,e){return u(t,e)}),L.watchTransition(b,"line: groups").style("stroke-opacity",1).style("fill-opacity",function(t){return t.fillOpacity||.5});var S=s.select(".nv-groups").selectAll(".nv-group").selectAll("path.nv-area").data(function(t){return h(t)?[t]:[]}),E=S.enter().append("path").attr("class","nv-area").attr("d",function(e){return d3.area().curve(getInterpolationType(v)).defined(p).x(function(e,n){return t.utils.NaNtoZero(x(c(e,n)))}).y0(function(e,n){return t.utils.NaNtoZero(y(f(e,n)))}).y1(function(t,e){return y(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[e.values])});M.exit().selectAll("path.nv-area").remove(),(E=S.merge(E)).watchTransition(b,"line: areaPaths").attr("d",function(r){return d3.area().curve(getInterpolationType(v)).defined(p).x(function(n,r){return t.utils.NaNtoZero(e(c(n,r)))}).y0(function(e,r){return t.utils.NaNtoZero(n(f(e,r)))}).y1(function(t,e){return n(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[r.values])});var F=L.selectAll("path.nv-line").data(function(t){return[t.values]}),W=F.enter().append("path").attr("class","nv-line").attr("d",d3.line().curve(getInterpolationType(v)).defined(p).x(function(e,n){return t.utils.NaNtoZero(x(c(e,n)))}).y(function(e,n){return t.utils.NaNtoZero(y(f(e,n)))}));(W=F.merge(W)).watchTransition(b,"line: linePaths").attr("d",d3.line().curve(getInterpolationType(v)).defined(p).x(function(n,r){return t.utils.NaNtoZero(e(c(n,r)))}).y(function(e,r){return t.utils.NaNtoZero(n(f(e,r)))})),x=e.copy(),y=n.copy()}),b.renderEnd("line immediate"),_}return _.dispatch=$,_.scatter=r,r.dispatch.on("elementClick",function(){$.apply("elementClick",this,arguments)}),r.dispatch.on("elementMouseover",function(){$.apply("elementMouseover",this,arguments)}),r.dispatch.on("elementMouseout",function(){$.apply("elementMouseout",this,arguments)}),_.options=t.utils.optionsFunc.bind(_),_._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},defined:{get:function(){return p},set:function(t){p=t}},interpolate:{get:function(){return v},set:function(t){v=t}},clipEdge:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},duration:{get:function(){return m},set:function(t){m=t,b.reset(m),r.duration(m)}},isArea:{get:function(){return h},set:function(t){h="function"==typeof t?t:function(){return t}}},x:{get:function(){return c},set:function(t){c=t,r.x(t)}},y:{get:function(){return f},set:function(t){f=t,r.y(t)}},color:{get:function(){return u},set:function(e){u=t.utils.getColor(e),r.color(u)}}}),t.utils.inheritOptions(_,r),t.utils.initOptions(_),_},t.models.lineChart=function(){"use strict";var e,n,r=t.models.line(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=t.models.legend(),s=t.interactiveGuideline(),l=t.models.tooltip(),u=t.models.focus(t.models.line()),c={top:30,right:20,bottom:50,left:60},f=null,p=t.utils.defaultColor(),h=null,g=null,v=!0,m="top",$=!0,x=!0,y=!1,b=!1,_=!1,k=t.utils.state(),w=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),M=250,L=d3.transition().duration(M).ease(d3.easeLinear);i.tickPadding(7),r.clipEdge(!0).duration(0),l.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.tooltip.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)});var S=t.utils.renderWatch(C,M);function E(l){return S.reset(),S.models(r),$&&S.models(i),x&&S.models(o),l.each(function(l){var A,L=d3.select(this);t.utils.initSVG(L);var S,F,W=t.utils.availableWidth(h,L,c),D=t.utils.availableHeight(g,L,c)-(_?u.height():0);if(E.update=function(){0===M?L.call(E):L.transition().duration(M).call(E)},E.container=this,k.setter((S=l,function(t){void 0!==t.active&&S.forEach(function(e,n){e.disabled=!t.active[n]})}),E.update).getter((F=l,function(){return{active:F.map(function(t){return!t.disabled})}})).update(),k.disabled=l.map(function(t){return!!t.disabled}),!w)for(A in w={},k)k[A]instanceof Array?w[A]=k[A].slice(0):w[A]=k[A];if(!l||!l.length||!l.filter(function(t){return t.values.length}).length)return t.utils.noData(E,L),E;L.selectAll(".nv-noData").remove(),u.dispatch.on("brush",function(t){Q(t)}),e=r.xScale(),n=r.yScale();var I=l.filter(function(t){return!t.disabled}),T=L.selectAll("g.nv-wrap.nv-lineChart").data([l]).enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart"),O=T.append("g"),P=O,B=O.append("g").attr("class","nv-legendWrap");B=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-legendWrap");var N=O.append("g").attr("class","nv-focus"),z=N.append("g").attr("class","nv-background").append("rect"),V=N.append("g").attr("class","nv-x nv-axis");V=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-x");var Y=N.append("g").attr("class","nv-y nv-axis");Y=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-y");var H=N.append("g").attr("class","nv-linesWrap");H=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-linesWrap");var X=N.append("g").attr("class","nv-interactive");X=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-interactive");var G=O.append("g").attr("class","nv-focusWrap");G=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-focusWrap"),v?(a.width(W),B.datum(l).call(a),"bottom"===m?(c.bottom=i.height()+a.height(),D=t.utils.availableHeight(g,L,c),B.attr("transform","translate(0,"+(D+i.height())+")")):"top"===m&&(f||a.height()===c.top||(c.top=a.height(),D=t.utils.availableHeight(g,L,c)-(_?u.height():0)),B.attr("transform","translate(0,"+-c.top+")"))):B.selectAll("*").remove(),T.attr("transform","translate("+c.left+","+c.top+")"),y&&Y.attr("transform","translate("+W+",0)"),b&&(s.width(W).height(D).margin({left:c.left,top:c.top}).svgContainer(L).xScale(e),X.call(s)),z.attr("width",W).attr("height",D),r.width(W).height(D).color(l.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!l[e].disabled}));var R=L.selectAll("g.nv-linesWrap.nvd3-svg").data([I]);function Z(){$&&V.transition().duration(M).call(i)}function q(){x&&Y.transition().duration(M).call(o)}if(R=R.merge(H),$&&(i.scale(e)._ticks(t.utils.calcTicksX(W/100,l)),i.tickSizeInner(-D)),x&&(o.scale(n)._ticks(t.utils.calcTicksY(D/36,l)),o.tickSizeInner(-W)),V.attr("transform","translate(0,"+D+")"),_){u.width(W),G.style("display",_?"initial":"none").attr("transform","translate(0,"+(D+c.bottom+u.margin().top)+")").call(u);var j=null===u.brush.extent()?u.xDomain():u.brush.extent();null!==j&&j.length&&Q(j)}else R.transition().call(r),Z(),q();function K(t){var e=+("e"==t),n=e?1:-1,r=D/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)}function Q(t){P.select(".nv-focus .nv-linesWrap").datum(l.filter(function(t){return!t.disabled}).map(function(e,n){return{key:e.key,area:e.area,classed:e.classed,values:e.values.filter(function(e,n){return r.x()(e,n)>=t[0]&&r.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}})).transition().duration(M).call(r),Z(),q()}a.dispatch.on("stateChange",function(t){for(var e in t)k[e]=t[e];C.call("stateChange",this,t),E.update()}),s.dispatch.on("elementMousemove",function(n){r.clearHighlights();var i,a,c,f=[];if(l.filter(function(t,e){return t.seriesIndex=e,!t.disabled&&!t.disableTooltip}).forEach(function(o,s){var l=null!=u.brush.extent()?e.domain():u.xScale().domain(),h=o.values.filter(function(t,e){return l[0]<=l[1]?r.x()(t,e)>=l[0]&&r.x()(t,e)<=l[1]:r.x()(t,e)>=l[1]&&r.x()(t,e)<=l[0]});if(h.length>0){var g=h[a=t.interactiveBisect(h,n.pointXValue,r.x())],v=E.y()(g,a);if(null!==v&&r.highlightPoint(s,o.values.indexOf(g),!0),void 0===g)return;void 0===i&&(i=g),void 0===c&&(c=E.xScale()(E.x()(g,a))),f.push({key:o.key,value:v,color:p(o,o.seriesIndex),data:g})}}),f.length>2){var h=E.yScale().invert(n.mouseY),g=Math.abs(E.yScale().domain()[0]-E.yScale().domain()[1]),v=t.nearestValueIndex(f.map(function(t){return t.value}),h,.03*g);null!==v&&(f[v].highlight=!0)}var m=function(t,e){return null==t?"N/A":o.tickFormat()(t)};void 0!==a&&(s.tooltip.valueFormatter(s.tooltip.valueFormatter()||m).data({value:E.x()(i,a),index:a,series:f})(),s.renderGuideLine(c))}),s.dispatch.on("elementClick",function(e){var n,i=[];l.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(r){var o=t.interactiveBisect(r.values,e.pointXValue,E.x()),a=r.values[o];if(void 0!==a){void 0===n&&(n=E.xScale()(E.x()(a,o)));var s=E.yScale()(E.y()(a,o));i.push({point:a,pointIndex:o,pos:[n,s],seriesIndex:r.seriesIndex,series:r})}}),r.dispatch.call("elementClick",this,i)}),s.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),C.on("changeState",function(t){void 0!==t.disabled&&l.length===t.disabled.length&&(l.forEach(function(e,n){e.disabled=t.disabled[n]}),k.disabled=t.disabled),E.update()})}),S.renderEnd("lineChart immediate"),E}return r.dispatch.on("elementMouseover.tooltip",function(t){t.series.disableTooltip||l.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){l.hidden(!0)}),E.dispatch=C,E.lines=r,E.legend=a,E.focus=u,E.xAxis=i,E.x2Axis=u.xAxis,E.yAxis=o,E.y2Axis=u.yAxis,E.interactiveLayer=s,E.tooltip=l,E.state=k,E.dispatch=C,E.options=t.utils.optionsFunc.bind(E),E._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},showLegend:{get:function(){return v},set:function(t){v=t}},legendPosition:{get:function(){return m},set:function(t){m=t}},showXAxis:{get:function(){return $},set:function(t){$=t}},showYAxis:{get:function(){return x},set:function(t){x=t}},defaultState:{get:function(){return w},set:function(t){w=t}},noData:{get:function(){return A},set:function(t){A=t}},focusEnable:{get:function(){return _},set:function(t){_=t}},focusHeight:{get:function(){return u.height()},set:function(t){u.height(t)}},focusShowAxisX:{get:function(){return u.showXAxis()},set:function(t){u.showXAxis(t)}},focusShowAxisY:{get:function(){return u.showYAxis()},set:function(t){u.showYAxis(t)}},brushExtent:{get:function(){return u.brushExtent()},set:function(t){u.brushExtent(t)}},focusMargin:{get:function(){return u.margin},set:function(t){void 0!==t.top&&(c.top=t.top,f=t.top),u.margin.right=void 0!==t.right?t.right:u.margin.right,u.margin.bottom=void 0!==t.bottom?t.bottom:u.margin.bottom,u.margin.left=void 0!==t.left?t.left:u.margin.left}},margin:{get:function(){return c},set:function(t){c.top=void 0!==t.top?t.top:c.top,c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return M},set:function(t){M=t,S.reset(M),L=d3.transition().duration(M).ease(d3.easeLinear),r.duration(M),u.duration(M),i.duration(M),o.duration(M)}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),a.color(p),r.color(p),u.color(p)}},interpolate:{get:function(){return r.interpolate()},set:function(t){r.interpolate(t),u.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t),u.xTickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t),u.yTickFormat(t)}},x:{get:function(){return r.x()},set:function(t){r.x(t),u.x(t)}},y:{get:function(){return r.y()},set:function(t){r.y(t),u.y(t)}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,o.orient(y?"right":"left")}},useInteractiveGuideline:{get:function(){return b},set:function(t){(b=t)&&(r.interactive(!1),r.useVoronoi(!1))}}}),t.utils.inheritOptions(E,r),t.utils.initOptions(E),E},t.models.lineWithFocusChart=function(){return t.models.lineChart().margin({bottom:30}).focusEnable(!0)},t.models.linePlusBarChart=function(){"use strict";var e,n,r,i,o,a,s=t.models.line(),l=t.models.line(),u=t.models.historicalBar(),c=t.models.historicalBar(),f=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),p=t.models.axis(d3.axisTop(d3.scaleLinear()),"top"),h=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),g=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),v=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),m=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),$=t.models.legend(),x=d3.brush(),y=t.models.tooltip(),b={top:30,right:30,bottom:30,left:60},_=null,k={top:0,right:30,bottom:20,left:60},w=null,A=null,C=function(t){return t.x},M=function(t){return t.y},L=t.utils.defaultColor(),S=!0,E=!0,F=!1,W=!0,D=50,I=null,T=null,O=d3.dispatch("brush","stateChange","changeState"),P=0,B=(d3.transition().duration(P).ease(d3.easeLinear),t.utils.state()),N=null,z=" (left axis)",V=" (right axis)",Y=!1;s.clipEdge(!0),l.interactive(!1),l.pointActive(function(t){return!1}),f.tickPadding(5),p.tickPadding(5),y.headerEnabled(!0).headerFormatter(function(t,e){return f.tickFormat()(t,e)});var H=function(t){return t.every(function(t){return t.disabled})};function X(y){return y.each(function(y){var T,G=d3.select(this);t.utils.initSVG(G);var R,Z,q=t.utils.availableWidth(w,G,b),j=t.utils.availableHeight(A,G,b)-(E?D:0),K=D-k.top-k.bottom;if(X.update=function(){G.transition().duration(P).call(X)},X.container=this,B.setter((R=y,function(t){void 0!==t.active&&R.forEach(function(e,n){e.disabled=!t.active[n]})}),X.update).getter((Z=y,function(){return{active:Z.map(function(t){return!t.disabled})}})).update(),B.disabled=y.map(function(t){return!!t.disabled}),!N)for(T in N={},B)B[T]instanceof Array?N[T]=B[T].slice(0):N[T]=B[T];if(!y||!y.length||!y.filter(function(t){return t.values.length}).length)return t.utils.noData(X,G),X;G.selectAll(".nv-noData").remove();var Q=y.filter(function(t){return!t.disabled&&t.bar}),U=y.filter(function(t){return!t.bar});e=Q.length&&!Y?u.xScale():s.xScale(),n=p.scale(),r=Y?s.yScale():u.yScale(),i=Y?u.yScale():s.yScale(),o=Y?l.yScale():c.yScale(),a=Y?c.yScale():l.yScale();var J=y.filter(function(t){return!t.disabled&&(Y?!t.bar:t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:C(t,e),y:M(t,e)}})}),tt=y.filter(function(t){return!t.disabled&&(Y?t.bar:!t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:C(t,e),y:M(t,e)}})});e.range([0,q]),n.domain(d3.extent(d3.merge(J.concat(tt)),function(t){return t.x})).range([0,q]);var te=G.selectAll("g.nv-wrap.nv-linePlusBar").data([y]).enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar"),tn=te.append("g"),tr=tn.select("g"),ti=tn.append("g").attr("class","nv-legendWrap");ti=G.selectAll("g.nv-wrap.nv-linePlusBar").select(".nv-legendWrap");var to=tn.append("g").attr("class","nv-focus"),ta=to.append("g").attr("class","nv-x nv-axis");ta=G.selectAll("g.nv-wrap.nv-linePlusBar").select(".nv-x");var ts=to.append("g").attr("class","nv-y1 nv-axis"),tl=to.append("g").attr("class","nv-y2 nv-axis"),tu=to.append("g").attr("class","nv-barsWrap"),tc=to.append("g").attr("class","nv-linesWrap"),td=tn.append("g").attr("class","nv-context"),tf=td.append("g").attr("class","nv-x nv-axis"),tp=td.append("g").attr("class","nv-y1 nv-axis"),th=td.append("g").attr("class","nv-y2 nv-axis"),tg=td.append("g").attr("class","nv-barsWrap"),tv=td.append("g").attr("class","nv-linesWrap"),tm=td.append("g").attr("class","nv-brushBackground"),t$=td.append("g").attr("class","nv-x nv-brush");if(S){var tx=$.align()?q/2:q,ty=$.align()?tx:0;$.width(tx),ti.datum(y.map(function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,Y?t.key=t.originalKey+(t.bar?V:z):t.key=t.originalKey+(t.bar?z:V),t})).call($),_||$.height()===b.top||(b.top=$.height(),j=t.utils.availableHeight(A,G,b)-D),ti.attr("transform","translate("+ty+","+-b.top+")")}else ti.selectAll("*").remove();te.attr("transform","translate("+b.left+","+b.top+")"),td.style("display",E?"initial":"none"),c.width(q).height(K).color(y.map(function(t,e){return t.color||L(t,e)}).filter(function(t,e){return!y[e].disabled&&y[e].bar})),l.width(q).height(K).color(y.map(function(t,e){return t.color||L(t,e)}).filter(function(t,e){return!y[e].disabled&&!y[e].bar}));var tb=tg.datum(Q.length?Q:[{values:[]}]),t_=tv.datum(H(U)?[{values:[]}]:U.filter(function(t){return!t.disabled}));td.attr("transform","translate(0,"+(j+b.bottom+k.top)+")"),tb.transition().call(c),t_.transition().call(l),W&&(p._ticks(t.utils.calcTicksX(q/100,y)),p.tickSizeInner(-K),ta.attr("transform","translate(0,"+o.range()[0]+")"),ta.transition().call(p)),F&&(v.scale(o)._ticks(K/36),v.tickSizeInner(-q),m.scale(a)._ticks(K/36),m.tickSizeInner(Q.length?0:-q),tr.select(".nv-context .nv-y3.nv-axis").style("opacity",Q.length?1:0).attr("transform","translate(0,"+n.range()[0]+")"),th.style("opacity",U.length?1:0).attr("transform","translate("+n.range()[1]+",0)"),tp.transition().call(v),th.transition().call(m)),x.on("brush",t0),I&&x.extent(I);var tk=tm.selectAll("g").data([I||x.extent()]),tw=tk.enter().append("g");tw.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",K),tw.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",K);var tA=t$.call(x);function t0(o){I=null===o?null:o.selection;var a,l=null===o?e.domain():o.selection;O.call("brush",this,{extent:l,brush:x}),null!==(a=o)&&x.extent(I),tk.data([null===a?n.domain():I]).each(function(t,e){var r=n(t[0])-n.range()[0],i=n.range()[1]-n(t[1]);d3.select(this).select(".left").attr("width",r<0?0:r),d3.select(this).select(".right").attr("x",n(t[1])).attr("width",i<0?0:i)}),u.width(q).height(j).color(y.map(function(t,e){return t.color||L(t,e)}).filter(function(t,e){return!y[e].disabled&&y[e].bar})),s.width(q).height(j).color(y.map(function(t,e){return t.color||L(t,e)}).filter(function(t,e){return!y[e].disabled&&!y[e].bar}));var c=tu.datum(Q.length?Q.map(function(t,e){return{key:t.key,values:t.values.filter(function(t,e){return u.x()(t,e)>=l[0]&&u.x()(t,e)<=l[1]})}}):[{values:[]}]),p=tc.datum(H(U)?[{values:[]}]:U.filter(function(t){return!t.disabled}).map(function(t,e){return{area:t.area,fillOpacity:t.fillOpacity,strokeWidth:t.strokeWidth,key:t.key,values:t.values.filter(function(t,e){return s.x()(t,e)>=l[0]&&s.x()(t,e)<=l[1]})}}));e=Q.length&&!Y?u.xScale():s.xScale(),f.scale(e)._ticks(t.utils.calcTicksX(q/100,y)),f.tickSizeInner(-j),f.domain([Math.ceil(l[0]),Math.floor(l[1])]),ta.transition().duration(P).call(f),c.transition().duration(P).call(u),p.transition().duration(P).call(s),tf.attr("transform","translate(0,"+r.range()[0]+")"),h.scale(r)._ticks(t.utils.calcTicksY(j/36,y)),h.tickSizeInner(-q),g.scale(i)._ticks(t.utils.calcTicksY(j/36,y)),Y?g.tickSizeInner(U.length?0:-q,0):g.tickSizeInner(Q.length?0:-q);var v=Q.length?1:0,m=U.length&&!H(U)?1:0,$=Y?m:v,b=Y?v:m;ts.style("opacity",$),tl.style("opacity",b).attr("transform","translate("+e.range()[1]+",0)"),ts.transition().duration(P).call(h),tl.transition().duration(P).call(g)}tA.selectAll("rect").attr("height",K),tA.selectAll(".resize").append("path").attr("d",function t(e){var n=+("e"==e),r=n?1:-1,i=K/3;return"M"+.5*r+","+i+"A6,6 0 0 "+n+" "+6.5*r+","+(i+6)+"V"+(2*i-6)+"A6,6 0 0 "+n+" "+.5*r+","+2*i+"ZM"+2.5*r+","+(i+8)+"V"+(2*i-8)+"M"+4.5*r+","+(i+8)+"V"+(2*i-8)}),$.dispatch.on("stateChange",function(t){for(var e in t)B[e]=t[e];O.call("stateChange",this,t),X.update()}),O.on("changeState",function(t){void 0!==t.disabled&&(y.forEach(function(e,n){e.disabled=t.disabled[n]}),B.disabled=t.disabled),X.update()}),t0(event)}),X}return s.dispatch.on("elementMouseover.tooltip",function(t){y.duration(100).valueFormatter(function(t,e){return(Y?{main:h,focus:v}:{main:g,focus:m}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),s.dispatch.on("elementMouseout.tooltip",function(t){y.hidden(!0)}),u.dispatch.on("elementMouseover.tooltip",function(t){t.value=X.x()(t.data),t.series={value:X.y()(t.data),color:t.color},y.duration(0).valueFormatter(function(t,e){return(Y?{main:g,focus:m}:{main:h,focus:v}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),u.dispatch.on("elementMouseout.tooltip",function(t){y.hidden(!0)}),u.dispatch.on("elementMousemove.tooltip",function(t){y()}),X.dispatch=O,X.legend=$,X.lines=s,X.lines2=l,X.bars=u,X.bars2=c,X.xAxis=f,X.x2Axis=p,X.y1Axis=h,X.y2Axis=g,X.y3Axis=v,X.y4Axis=m,X.tooltip=y,X.options=t.utils.optionsFunc.bind(X),X._options=Object.create({},{width:{get:function(){return w},set:function(t){w=t}},height:{get:function(){return A},set:function(t){A=t}},showLegend:{get:function(){return S},set:function(t){S=t}},brushExtent:{get:function(){return I},set:function(t){I=t}},noData:{get:function(){return T},set:function(t){T=t}},focusEnable:{get:function(){return E},set:function(t){E=t}},focusHeight:{get:function(){return D},set:function(t){D=t}},focusShowAxisX:{get:function(){return W},set:function(t){W=t}},focusShowAxisY:{get:function(){return F},set:function(t){F=t}},legendLeftAxisHint:{get:function(){return z},set:function(t){z=t}},legendRightAxisHint:{get:function(){return V},set:function(t){V=t}},margin:{get:function(){return b},set:function(t){void 0!==t.top&&(b.top=t.top,_=t.top),b.right=void 0!==t.right?t.right:b.right,b.bottom=void 0!==t.bottom?t.bottom:b.bottom,b.left=void 0!==t.left?t.left:b.left}},focusMargin:{get:function(){return k},set:function(t){k.top=void 0!==t.top?t.top:k.top,k.right=void 0!==t.right?t.right:k.right,k.bottom=void 0!==t.bottom?t.bottom:k.bottom,k.left=void 0!==t.left?t.left:k.left}},duration:{get:function(){return P},set:function(t){P=t}},color:{get:function(){return L},set:function(e){L=t.utils.getColor(e),$.color(L)}},x:{get:function(){return C},set:function(t){C=t,s.x(t),l.x(t),u.x(t),c.x(t)}},y:{get:function(){return M},set:function(t){M=t,s.y(t),l.y(t),u.y(t),c.y(t)}},switchYAxisOrder:{get:function(){return Y},set:function(t){if(Y!==t){var e=h;h=g,g=e;var n=v;v=m,m=n}Y=t}}}),t.utils.inheritOptions(X,s),t.utils.initOptions(X),X},t.models.multiBar=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,f=d3.scaleBand(),p=d3.scaleLinear(),h=Math.floor(1e4*Math.random()),g=null,v=function(t){return t.x},m=function(t){return t.y},$=[0],x=!0,y=!1,b=d3.stackOffsetNone,_=t.utils.defaultColor(),k=!1,w=null,A=500,C=.1,M=.75,L=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),S=t.utils.renderWatch(L,A),E=0;function F(W){return S.reset(),W.each(function(F){var W=u-l.left-l.right,D=c-l.top-l.bottom;g=d3.select(this),t.utils.initSVG(g);var I=0;if(k&&F.length&&(k=[{values:F[0].values.map(function(t){return{x:t.x,y:0,series:F[t.seriesIndex],size:.01}})}]),y){var T=F;F.forEach(function(t,e){t.seriesIndex=e,t.values=t.values.map(function(t,n){return t.index=n,t.seriesIndex=e,t})});var O=[];F[0].values.forEach(function(t){O.push({x:t.x})}),F.forEach(function(t,e,n){t.display={y:e,y0:n},t.values.forEach(function(e){O[e.index][t.key]=e.y})});var P=F.map(t=>t.key),B=d3.stack().keys(P).offset(b).value(function(t,e){return t[e]})(!O.length&&k?k:O),N=[];B.forEach(function(t,e){t.seriesIndex=e;var n=[];t.map(function(t,r){return n.push({x:r,y:t[1]-t[0],y0:t[0],index:r,series:e,seriesIndex:e,display:{y:t[1]-t[0],y0:t[0]}}),n}),N.push({key:P[e],nonStackable:T[e].nonStackable,values:n})}),N.forEach(function(t,e){t.nonStackable?(F[e].nonStackableSeries=I++,N[e]=F[e]):e>0&&N[e-1].nonStackable&&N[e].values.map(function(t,n){t.y0-=N[e-1].values[n].y,t.y1=t.y0+t.y})}),F=N}F.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.seriesIndex=e,n.key=t.key})}),y&&F.length>0&&F[0].values.map(function(t,e){var n=0,r=0;F.map(function(t,i){if(!F[i].nonStackable){var o=t.values[e];o.size=Math.abs(o.y),o.y<0?(o.y1=r,r-=o.size):(o.y1=o.size+n,n+=o.size)}})});var z=n&&r?[]:F.map(function(t,e){return t.values.map(function(t,n){return{x:v(t,n),y:m(t,n),y0:t.y0,y1:t.y1,idx:e}})});f.domain(n||d3.merge(z).map(function(t){return t.x})).range(i||[0,W]).paddingInner(C).paddingOuter(C),p.domain(r||d3.extent(d3.merge(z).map(function(t){var e=t.y;return y&&!F[t.idx].nonStackable&&(e=t.y>0?t.y1:t.y1+t.y),e}).concat($))).range(o||[D,0]),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]-.01*f.domain()[0],f.domain()[1]+.01*f.domain()[1]]):f.domain([-1,1])),p.domain()[0]===p.domain()[1]&&(p.domain()[0]?p.domain([p.domain()[0]+.01*p.domain()[0],p.domain()[1]-.01*p.domain()[1]]):p.domain([-1,1])),a=a||f,s=s||p;var V=g.selectAll("g.nv-wrap.nv-multibar").data([F]).enter().append("g").attr("class","nvd3 nv-wrap nv-multibar");V.attr("transform","translate("+l.left+","+l.top+")");var Y=V.append("defs"),H=V.append("g");H.select("g"),H.append("g").attr("class","nv-groups"),Y.append("clipPath").attr("id","nv-edge-clip-"+h).append("rect").attr("width",W).attr("height",D),H.attr("clip-path",x?"url(#nv-edge-clip-"+h+")":"");var X=g.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t,e){return e});X.exit().remove();var G=X.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);G=X.merge(G);var R=S.transition(G.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,A)).attr("y",function(t,e,n){var r=s(0)||0;return y&&F[t.seriesIndex]&&!F[t.seriesIndex].nonStackable&&(r=s(t.y0)),r}).attr("height",0).remove();R.delay&&R.delay(function(t,e){return e*(A/(E+1))-e}),G.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return _(t,e)}).style("stroke",function(t,e){return _(t,e)}),G.style("stroke-opacity",1).style("fill-opacity",M);var Z=g.select(".nv-groups").selectAll(".nv-group").selectAll("rect.nv-bar").data(function(t,e){return k&&!F.length?k.values:F[e]?F[e].values:[]});Z.exit().remove();var q=Z.enter().append("rect").attr("class",function(t,e){return 0>m(t,e)?"nv-bar negative":"nv-bar positive"}).attr("x",function(t,e,n){return y&&!F[t.seriesIndex].nonStackable?0:t.seriesIndex*f.bandwidth()/F.length}).attr("y",function(t,e,n){return s(y&&!F[t.seriesIndex].nonStackable?t.y0:0)||0}).attr("height",0).attr("width",function(t,e,n){return f.bandwidth()/(y&&!F[t.seriesIndex].nonStackable?1:F.length)}).attr("transform",function(t,e){return"translate("+f(v(t,e))+",0)"});(q=Z.merge(q)).style("fill",function(t,e,n){return _(t,t.seriesIndex,e)}).style("stroke",function(t,e,n){return _(t,t.seriesIndex,e)}).on("mouseover",function(t,e,n,r){d3.select(this).classed("hover",!0),setCoordinates(t.pageX,t.pageY),L.call("elementMouseover",this,{data:e,index:e.index,series:F[e.seriesIndex],color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n,r){d3.select(this).classed("hover",!1),L.call("elementMouseout",this,{data:e,index:e.index,series:F[e.seriesIndex],color:d3.select(this).style("fill")})}).on("mousemove",function(t,e,n,r){L.call("elementMousemove",this,{data:e,index:e.index,series:F[e.seriesIndex],color:d3.select(this).style("fill")})}).on("click",function(t,e,n,r){L.call("elementClick",this,{data:e,index:e.index,series:F[e.seriesIndex],color:d3.select(this).style("fill"),event:t,element:this}),t.stopPropagation()}).on("dblclick",function(t,e,n,r){L.call("elementDblClick",this,{data:e,index:e,index,series:F[e.seriesIndex],color:d3.select(this).style("fill")}),t.stopPropagation()}),q.attr("class",function(t,e){return 0>m(t,e)?"nv-bar negative":"nv-bar positive"}).attr("transform",function(t,e){return"translate("+f(v(t,e))+",0)"}),w&&(e||(e=F.map(function(){return!0})),q.style("fill",function(t,n,r){return d3.rgb(w(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[t.seriesIndex]).toString()}).style("stroke",function(t,n,r){return d3.rgb(w(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[t.seriesIndex]).toString()}));var j=q.watchTransition(S,"multibar",Math.min(250,A)).delay(function(t,e){return e*A/F[0].values.length});y?j.attr("y",function(t,e,n){var r=0;return F[t.seriesIndex].nonStackable?0>m(t,e)?p(0):p(0)-p(m(t,e))<-1?p(0)-1:p(m(t,e))||0:p(t.y1)}).attr("height",function(t,e,n){return F[t.seriesIndex].nonStackable?Math.max(Math.abs(p(m(t,e))-p(0)),0)||0:Math.max(Math.abs(p(t.y+t.y0)-p(t.y0)),0)}).attr("x",function(t,e,n){var r=0;return F[t.seriesIndex].nonStackable&&(r=t.seriesIndex*f.bandwidth()/F.length,F.length!==I&&(r=F[t.seriesIndex].nonStackableSeries*f.bandwidth()/(2*I))),r}).attr("width",function(t,e,n){if(!F[t.seriesIndex].nonStackable)return f.bandwidth();var r=f.bandwidth()/I;return F.length!==I&&(r=f.bandwidth()/(2*I)),r}):j.attr("x",function(t,e){return t.seriesIndex*f.bandwidth()/F.length}).attr("width",f.bandwidth()/F.length).attr("y",function(t,e){return 0>m(t,e)?p(0):p(0)-p(m(t,e))<1?p(0)-1:p(m(t,e))||0}).attr("height",function(t,e){return Math.max(Math.abs(p(m(t,e))-p(0)),1)||0}),a=f.copy(),s=p.copy(),F[0]&&F[0].values&&(E=F[0].values.length)}),S.renderEnd("multibar immediate"),F}return F.dispatch=L,F.options=t.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return v},set:function(t){v=t}},y:{get:function(){return m},set:function(t){m=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return p},set:function(t){p=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return $},set:function(t){$=t}},stacked:{get:function(){return y},set:function(t){y=t}},stackOffset:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return x},set:function(t){x=t}},disabled:{get:function(){return e},set:function(t){e=t}},id:{get:function(){return h},set:function(t){h=t}},hideable:{get:function(){return k},set:function(t){k=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return M},set:function(t){M=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return A},set:function(t){A=t,S.reset(A)}},color:{get:function(){return _},set:function(e){_=t.utils.getColor(e)}},barColor:{get:function(){return w},set:function(e){w=e?t.utils.getColor(e):null}}}),t.utils.initOptions(F),F},t.models.multiBarChart=function(){"use strict";var e,n,r=t.models.multiBar(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=t.interactiveGuideline(),s=t.models.legend(),l=t.models.legend(),u=t.models.tooltip(),c={top:30,right:20,bottom:50,left:60},f=null,p=null,h=null,g=t.utils.defaultColor(),v=!0,m={},$=!0,x=null,y=!0,b=!0,_=!1,k=!0,w=!1,A=!1,C=0,M=t.utils.state(),L=null,S=null,E=d3.dispatch("stateChange","changeState","renderEnd"),F=function(){return v?180:0},W=250,D=(d3.transition().duration(W).ease(d3.easeLinear),!1);M.stacked=!1,r.stacked(!1),i.tickPadding(7),i.showMaxMin(!1).tickFormat(function(t){return t}),o.tickFormat(d3.format(",.1f")),u.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),l.updateState(!1);var I=t.utils.renderWatch(E),T=!1;function O(S){return I.reset(),I.models(r),y&&I.models(i),b&&I.models(o),S.each(function(S){var I,P=d3.select(this);t.utils.initSVG(P);var B,N,z=t.utils.availableWidth(p,P,c),V=t.utils.availableHeight(h,P,c);if(O.update=function(){0===W?P.call(O):P.transition().duration(W).call(O)},O.container=this,M.setter((B=S,function(t){void 0!==t.stacked&&(T=t.stacked),void 0!==t.active&&B.forEach(function(e,n){e.disabled=!t.active[n]})}),O.update).getter((N=S,function(){return{active:N.map(function(t){return!t.disabled}),stacked:T}})).update(),M.disabled=S.map(function(t){return!!t.disabled}),!L)for(I in L={},M)M[I]instanceof Array?L[I]=M[I].slice(0):L[I]=M[I];if(!S||!S.length||!S.filter(function(t){return t.values.length}).length)return t.utils.noData(O,P),O;P.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale();var Y=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([S]).enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend"),H=Y.append("g");H.select("g");var X=H.append("g").attr("class","nv-x nv-axis");X=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-x");var G=H.append("g").attr("class","nv-y nv-axis");G=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-y");var R=H.append("g").attr("class","nv-barsWrap");R=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-barsWrap");var Z=H.append("g").attr("class","nv-legendWrap");Z=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-legendWrap");var q=H.append("g").attr("class","nv-controlsWrap");q=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-controlsWrap");var j=H.append("g").attr("class","nv-interactive");if(j=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-interactive"),$?"bottom"===x?(s.width(z-c.right),Z.datum(S).call(s),c.bottom=i.height()+s.height(),V=t.utils.availableHeight(h,P,c),Z.attr("transform","translate(0,"+(V+i.height())+")")):(s.width(z-F()),Z.datum(S).call(s),f||s.height()===c.top||(c.top=s.height(),V=t.utils.availableHeight(h,P,c)),Z.attr("transform","translate("+F()+","+-c.top+")")):Z.selectAll("*").remove(),Y.attr("transform","translate("+c.left+","+c.top+")"),v){var K=[{key:m.grouped||"Grouped",disabled:r.stacked()},{key:m.stacked||"Stacked",disabled:!r.stacked()}];l.width(F()).color(["#444","#444","#444"]),q.datum(K).attr("transform","translate(0,"+-c.top+")").call(l)}else q.selectAll("*").remove();_&&G.attr("transform","translate("+z+",0)"),r.disabled(S.map(function(t){return t.disabled})).width(z).height(V).color(S.map(function(t,e){return t.color||g(t,e)}).filter(function(t,e){return!S[e].disabled}));var Q=P.select(".nv-multiBarWithLegend").selectAll(".nv-barsWrap").data([S.filter(function(t){return!t.disabled})]);if((Q=Q.merge(R)).call(r),y){i.scale(e)._ticks(t.utils.calcTicksX(z/100,S)),i.tickSizeInner(-V),X.attr("transform","translate(0,"+n.range()[0]+")"),X.call(i);var U=X.select("g.nvd3.nv-wrap.nv-axis").selectAll("g");if(U.selectAll("line, text").style("opacity",1),w){var J=function(t,e){return"translate("+t+","+e+")"};U.selectAll("text").attr("transform",function(t,e,n){return J(0,n%2==0?5:17)});var tt=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text").nodes().length;U.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(t,e){return J(0,0===e||tt%2!=0?17:5)})}A&&H.selectAll(".tick text").call(t.utils.wrapTicks,O.xScale().bandwidth()),k&&U.filter(function(t,e){return e%Math.ceil(S[0].values.length/(z/100))!=0}).selectAll("text, line").style("opacity",0),C&&U.selectAll(".tick text").attr("transform","rotate("+C+" 0,0)").style("text-anchor",C>0?"start":"end"),X.selectAll("g.nv-axisMaxMin text").style("opacity",1)}b&&(o.scale(n)._ticks(t.utils.calcTicksY(V/36,S)),o.tickSizeInner(-z),G.call(o)),D&&(a.width(z).height(V).margin({left:c.left,top:c.top}).svgContainer(P).xScale(e),j.call(a)),s.dispatch.on("stateChange",function(t){for(var e in t)M[e]=t[e];E.call("stateChange",this,t),O.update()}),l.dispatch.on("legendClick",function(t,e,n){if(e.disabled){switch(K=K.map(function(t){return t.disabled=!0,t}),e.disabled=!1,e.key){case"Grouped":case m.grouped:r.stacked(!1);break;case"Stacked":case m.stacked:r.stacked(!0)}M.stacked=r.stacked(),E.call("stateChange",this,M),O.update()}}),E.on("changeState",function(t){void 0!==t.disabled&&(S.forEach(function(e,n){e.disabled=t.disabled[n]}),M.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),M.stacked=t.stacked,T=t.stacked),O.update()}),D?(a.dispatch.on("elementMousemove",function(t){if(void 0!=t.pointXValue){var n,r,i,o,s=[];S.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(a,l){r=e.domain().indexOf(t.pointXValue);var u=a.values[r];void 0!==u&&(o=u.x,void 0===n&&(n=u),void 0===i&&(i=t.mouseX),s.push({key:a.key,value:O.y()(u,r),color:g(a,a.seriesIndex),data:a.values[r]}))}),a.tooltip.data({value:o,index:r,series:s})(),a.renderGuideLine(i)}}),a.dispatch.on("elementMouseout",function(t){a.tooltip.hidden(!0)})):(r.dispatch.on("elementMouseover.tooltip",function(t){t.value=O.x()(t.data),t.series={key:t.data.key,value:O.y()(t.data),color:t.color},u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){u()}))}),I.renderEnd("multibarchart immediate"),O}return O.dispatch=E,O.multibar=r,O.legend=s,O.controls=l,O.xAxis=i,O.yAxis=o,O.state=M,O.tooltip=u,O.interactiveLayer=a,O.options=t.utils.optionsFunc.bind(O),O._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return $},set:function(t){$=t}},legendPosition:{get:function(){return x},set:function(t){x=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return m},set:function(t){m=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return L},set:function(t){L=t}},noData:{get:function(){return S},set:function(t){S=t}},reduceXTicks:{get:function(){return k},set:function(t){k=t}},rotateLabels:{get:function(){return C},set:function(t){C=t}},staggerLabels:{get:function(){return w},set:function(t){w=t}},wrapLabels:{get:function(){return A},set:function(t){A=!!t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,f=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return W},set:function(t){W=t,r.duration(W),i.duration(W),o.duration(W),I.reset(W)}},color:{get:function(){return g},set:function(e){g=t.utils.getColor(e),s.color(g)}},rightAlignYAxis:{get:function(){return _},set:function(t){_=t}},useInteractiveGuideline:{get:function(){return D},set:function(t){D=t}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),s.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(O,r),t.utils.initOptions(O),O},t.models.multiBarHorizontal=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,f=Math.floor(1e4*Math.random()),p=null,h=d3.scaleBand(),g=d3.scaleLinear(),v=function(t){return t.x},m=function(t){return t.y},$=function(t){return t.yErr},x=[0],y=t.utils.defaultColor(),b=null,_=!1,k=!1,w=60,A=.1,C=.75,M=d3.format(",.2f"),L=250,S=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=t.utils.renderWatch(S,L);function F(f){return E.reset(),f.each(function(f){var L=u-l.left-l.right,F=c-l.top-l.bottom;if(p=d3.select(this),t.utils.initSVG(p),_){var W=f;f.forEach(function(t,e){t.seriesIndex=e,t.values=t.values.map(function(t,n){return t.index=n,t.series=e,t.seriesIndex=e,t})});var D=[];f[0].values.forEach(function(t){D.push({x:t.x})}),f.forEach(function(t,e,n){t.display={y:e,y0:n},t.values.forEach(function(e){D[e.index][t.key]=e.y})});var I=f.map(t=>t.key);f=d3.stack().keys(I).offset(d3.stackOffsetNone).value(function(t,e){return t[e]})(D);var T=[];f.forEach(function(t,e){t.seriesIndex=e,t.x=Array.from(Array(t.length).keys());var n=[];t.map(function(t,r){return n.push({label:W[e].values[r].label,x:r,y:t[1]-t[0],y0:t[0],series:e,seriesIndex:e,index:r}),n}),T.push({values:n,key:I[e],seriesIndex:e})}),f=T}f.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.seriesIndex=e,n.key=t.key})}),_&&f[0].values.map(function(t,e){var n=0,r=0;f.map(function(t){var i=t.values[e];i.size=Math.abs(i.y),i.y<0?(i.y1=r-i.size,r-=i.size):(i.y1=n,n+=i.size)})});var O=i&&o?[]:f.map(function(t){return t.values.map(function(t,e){return{x:v(t,e),y:m(t,e),y0:t.y0,y1:t.y1}})});h.domain(i||d3.merge(O).map(function(t){return t.x})).range(a||[0,F]).paddingInner(A).paddingOuter(A),g.domain(o||d3.extent(d3.merge(O).map(function(t){return _?t.y>0?t.y1+t.y:t.y1:t.y}).concat(x))),k&&!_?g.range(s||[g.domain()[0]<0?w:0,L-(g.domain()[1]>0?w:0)]):g.range(s||[0,L]),e=e||h,n=n||d3.scaleLinear().domain(g.domain()).range([g(0),g(0)]);var P=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([f]).enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal");P.attr("transform","translate("+l.left+","+l.top+")"),P.append("defs");var B=P.append("g");B.select("g"),B.append("g").attr("class","nv-groups");var N=d3.select(this).selectAll("g.nv-groups").selectAll(".nv-group").data(f),z=N.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);N.exit().remove();var V=N.merge(z);V.exit().watchTransition(E,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),V.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return y(t,e)}).style("stroke",function(t,e){return y(t,e)}),V.watchTransition(E,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",C);var Y=V.selectAll("g.nv-bar").data(function(t){return t.values});Y.exit().remove();var H=Y.enter().append("g").attr("transform",function(t,e,r){var i=r.indexOf(this);return"translate("+n(_?t.y0:0)+","+(_?0:i*h.bandwidth()/f.length+h(v(t,e)))+")"});(Y=Y.merge(H)).select("rect").remove(),Y.append("rect").attr("width",0).attr("height",h.bandwidth()/(_?1:f.length)),Y.on("mouseover",function(t,e,n){d3.select(this).classed("hover",!0),setCoordinates(t.pageX,t.pageY),S.call("elementMouseover",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),S.call("elementMouseout",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n){S.call("elementMouseout",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e,n){S.call("elementMousemove",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("click",function(t,e,n){S.call("elementClick",this,{data:e,index:e.index,color:d3.select(this).style("fill"),event:t,element:this}),t.stopPropagation()}).on("dblclick",function(t,e,n){S.call("elementDblClick",this,{data:e,index:e.index,color:d3.select(this).style("fill")}),t.stopPropagation()}),$(f[0],0)&&(H.append("polyline"),Y.select("polyline").attr("fill","none").attr("points",function(t,e){var n=$(t,e),r=.8*h.bandwidth()/((_?1:f.length)*2);return[[(n=(n=n.length?n:[-Math.abs(n),Math.abs(n)]).map(function(n){return g(n+(0>m(t,e)?0:m(t,e)))-g(0)}))[0],-r],[n[0],r],[n[0],0],[n[1],0],[n[1],-r],[n[1],r]].map(function(t){return t.join(",")}).join(" ")}).attr("transform",function(t,e){return"translate(0, "+h.bandwidth()/((_?1:f.length)*2)+")"})),H.append("text"),k&&!_?(Y.select("text").attr("text-anchor",function(t,e){return 0>m(t,e)?"end":"start"}).attr("y",h.bandwidth()/(2*f.length)).attr("dy",".32em").text(function(t,e){var n=M(m(t,e)).replace(/\.0+%$/,"%"),r=$(t,e);return void 0===r?n:r.length?n+"+"+M(Math.abs(r[1]))+"-"+M(Math.abs(r[0])):n+"\xb1"+M(Math.abs(r))}),Y.watchTransition(E,"multibarhorizontal: bars").select("text").attr("x",function(t,e){return 0>m(t,e)?-4:g(m(t,e))-g(0)+4})):Y.selectAll("text").text(""),Y.selectAll("text.nv-bar-label").text(""),Y.attr("class",function(t,e){return 0>m(t,e)?"nv-bar negative":"nv-bar positive"}),b&&(r||(r=f.map(function(){return!0})),Y.style("fill",function(t,e,n){return d3.rgb(b(t,e)).darker(r.map(function(t,e){return e}).filter(function(t,e){return!r[e]})[n]).toString()}).style("stroke",function(t,e,n){return d3.rgb(b(t,e)).darker(r.map(function(t,e){return e}).filter(function(t,e){return!r[e]})[n]).toString()})),_?Y.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(t,e){return"translate("+g(t.y1)+","+h(v(t,e))+")"}).select("rect").attr("width",function(t,e){return Math.abs(g(m(t,e)+t.y0)-g(t.y0))||0}).attr("height",h.bandwidth()):Y.watchTransition(E,"multibarhorizontal: bars").attr("transform",function(t,e){return"translate("+(0>m(t,e)?g(m(t,e)):g(0))+","+(t.series*h.bandwidth()/f.length+h(v(t,e)))+")"}).select("rect").attr("height",h.bandwidth()/f.length).attr("width",function(t,e){return Math.max(Math.abs(g(m(t,e))-g(0)),1)||0}),e=h.copy(),n=g.copy()}),E.renderEnd("multibarHorizontal immediate"),F}return F.dispatch=S,F.options=t.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return v},set:function(t){v=t}},y:{get:function(){return m},set:function(t){m=t}},yErr:{get:function(){return $},set:function(t){$=t}},xScale:{get:function(){return h},set:function(t){h=t}},yScale:{get:function(){return g},set:function(t){g=t}},xDomain:{get:function(){return i},set:function(t){i=t}},yDomain:{get:function(){return o},set:function(t){o=t}},xRange:{get:function(){return a},set:function(t){a=t}},yRange:{get:function(){return s},set:function(t){s=t}},forceY:{get:function(){return x},set:function(t){x=t}},stacked:{get:function(){return _},set:function(t){_=t}},showValues:{get:function(){return k},set:function(t){k=t}},disabled:{get:function(){return r},set:function(t){r=t}},id:{get:function(){return f},set:function(t){f=t}},valueFormat:{get:function(){return M},set:function(t){M=t}},valuePadding:{get:function(){return w},set:function(t){w=t}},groupSpacing:{get:function(){return A},set:function(t){A=t}},fillOpacity:{get:function(){return C},set:function(t){C=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return L},set:function(t){L=t,E.reset(L)}},color:{get:function(){return y},set:function(e){y=t.utils.getColor(e)}},barColor:{get:function(){return b},set:function(e){b=e?t.utils.getColor(e):null}}}),t.utils.initOptions(F),F},t.models.multiBarHorizontalChart=function(){"use strict";var e,n,r=t.models.multiBarHorizontal(),i=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),o=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),a=t.models.legend().height(30),s=t.models.legend().height(30),l=t.models.tooltip(),u={top:30,right:20,bottom:50,left:60},c=null,f=null,p=null,h=t.utils.defaultColor(),g=!0,v="top",m={},$=!0,x="top",y=!0,b=!0,_=!1,k=t.utils.state(),w=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),M=function(){return g?180:0},L=250;k.stacked=!1,r.stacked(_),i.tickPadding(5),i.showMaxMin(!1).tickFormat(function(t){return t}),o.tickFormat(d3.format(",.1f")),l.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.updateState(!1);var S=t.utils.renderWatch(C,L);function E(l){return S.reset(),S.models(r),y&&S.models(i),b&&S.models(o),l.each(function(l){var A,S=d3.select(this);t.utils.initSVG(S);var F,W,D=t.utils.availableWidth(f,S,u),I=t.utils.availableHeight(p,S,u);if(E.update=function(){S.transition().duration(L).call(E)},E.container=this,_=r.stacked(),k.setter((F=l,function(t){void 0!==t.stacked&&(_=t.stacked),void 0!==t.active&&F.forEach(function(e,n){e.disabled=!t.active[n]})}),E.update).getter((W=l,function(){return{active:W.map(function(t){return!t.disabled}),stacked:_}})).update(),k.disabled=l.map(function(t){return!!t.disabled}),!w)for(A in w={},k)k[A]instanceof Array?w[A]=k[A].slice(0):w[A]=k[A];if(!l||!l.length||!l.filter(function(t){return t.values.length}).length)return t.utils.noData(E,S),E;S.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var T=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([l]).enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart"),O=T.append("g");O.select("g");var P=O.append("g").attr("class","nv-x nv-axis");P=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-x");var B=O.append("g").attr("class","nv-y nv-axis"),N=B.append("g").attr("class","nv-zeroLine").append("line");B=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-y"),N=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart.nv-zeroLine").select("line");var z=O.append("g").attr("class","nv-barsWrap");z=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-barsWrap");var V=O.append("g").attr("class","nv-legendWrap");V=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-legendWrap");var Y=O.append("g").attr("class","nv-controlsWrap");if(z=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-controlsWrap"),$?(a.width(D-M()),V.datum(l).call(a),"bottom"===x?(u.bottom=i.height()+a.height(),I=t.utils.availableHeight(p,S,u),V.attr("transform","translate("+M()+","+(I+i.height())+")")):"top"===x&&(c||a.height()===u.top||(u.top=a.height(),I=t.utils.availableHeight(p,S,u)),V.attr("transform","translate("+M()+","+-u.top+")"))):V.selectAll("*").remove(),T.attr("transform","translate("+u.left+","+u.top+")"),g){var H=[{key:m.grouped||"Grouped",disabled:r.stacked()},{key:m.stacked||"Stacked",disabled:!r.stacked()}];s.width(M()).color(["#444","#444","#444"]),"bottom"===v?(u.bottom=i.height()+a.height(),I=t.utils.availableHeight(p,S,u),Y.datum(H).attr("transform","translate(0,"+(I+i.height())+")").call(s)):"top"===v&&Y.datum(H).attr("transform","translate(0,"+-u.top+")").call(s)}else Y.selectAll("*").remove();r.disabled(l.map(function(t){return t.disabled})).width(D).height(I).color(l.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!l[e].disabled})),(z=S.select(".nv-multiBarHorizontalChart").selectAll(".nv-barsWrap").data([l.filter(function(t){return!t.disabled})]).merge(z)).transition().call(r),y&&(i.scale(e)._ticks(t.utils.calcTicksY(I/24,l)),i.tickSizeInner(-D),P.call(i),P.select("g.nvd3.nv-wrap.nv-axis").selectAll("g").selectAll("line, text")),b&&(o.scale(n)._ticks(t.utils.calcTicksX(D/100,l)),o.tickSizeInner(-I),B.attr("transform","translate(0,"+I+")"),B.call(o)),N.attr("x1",n(0)).attr("x2",n(0)).attr("y1",0).attr("y2",-I),a.dispatch.on("stateChange",function(t){for(var e in t)k[e]=t[e];C.call("stateChange",this,t),E.update()}),s.dispatch.on("legendClick",function(t,e,n){if(e.disabled){switch(H=H.map(function(t){return t.disabled=!0,t}),e.disabled=!1,e.key){case"Grouped":case m.grouped:r.stacked(!1);break;case"Stacked":case m.stacked:r.stacked(!0)}k.stacked=r.stacked(),C.call("stateChange",this,k),_=r.stacked(),E.update()}}),C.on("changeState",function(t){void 0!==t.disabled&&(l.forEach(function(e,n){e.disabled=t.disabled[n]}),k.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),k.stacked=t.stacked,_=t.stacked),E.update()})}),S.renderEnd("multibar horizontal chart immediate"),E}return r.dispatch.on("elementMouseover.tooltip",function(t){t.value=E.x()(t.data),t.series={key:t.data.key,value:E.y()(t.data),color:t.color},l.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){l.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){l()}),E.dispatch=C,E.multibar=r,E.legend=a,E.controls=s,E.xAxis=i,E.yAxis=o,E.state=k,E.tooltip=l,E.options=t.utils.optionsFunc.bind(E),E._options=Object.create({},{width:{get:function(){return f},set:function(t){f=t}},height:{get:function(){return p},set:function(t){p=t}},showLegend:{get:function(){return $},set:function(t){$=t}},legendPosition:{get:function(){return x},set:function(t){x=t}},controlsPosition:{get:function(){return v},set:function(t){v=t}},showControls:{get:function(){return g},set:function(t){g=t}},controlLabels:{get:function(){return m},set:function(t){m=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return w},set:function(t){w=t}},noData:{get:function(){return A},set:function(t){A=t}},margin:{get:function(){return u},set:function(t){void 0!==t.top&&(u.top=t.top,c=t.top),u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return L},set:function(t){L=t,S.reset(L),r.duration(L),i.duration(L),o.duration(L)}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e),a.color(h)}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),a.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(E,r),t.utils.initOptions(E),E},t.models.multiChart=function(){"use strict";var e,n,r={top:30,right:20,bottom:50,left:60},i=null,o=t.utils.defaultColor(),a=null,s=null,l=!0,u=null,c=function(t){return t.x},f=function(t){return t.y},p=getInterpolationType(p),h=!0,g=t.interactiveGuideline(),v=!1,m=" (right axis)",$=250,x=d3.scaleLinear(),y=d3.scaleLinear(),b=d3.scaleLinear(),_=t.models.line().yScale(y).duration($),k=t.models.line().yScale(b).duration($),w=t.models.scatter().yScale(y).duration($),A=t.models.scatter().yScale(b).duration($),C=t.models.multiBar().stacked(!1).yScale(y).duration($),M=t.models.multiBar().stacked(!1).yScale(b).duration($),L=t.models.stackedArea().yScale(y).duration($),S=t.models.stackedArea().yScale(b).duration($),E=t.models.axis(d3.axisBottom(x),"bottom").tickPadding(5).duration($),F=t.models.axis(d3.axisLeft(y),"left").duration($),W=t.models.axis(d3.axisRight(b),"right").duration($),D=t.models.legend().height(30),I=t.models.tooltip(),T=d3.dispatch(),O=[_,k,w,A,C,M,L,S];function P(u){return u.each(function(u){var h=d3.select(this);t.utils.initSVG(h),P.update=function(){h.call(P)},P.container=this;var $=t.utils.availableWidth(a,h,r),B=t.utils.availableHeight(s,h,r),N=u.filter(function(t){return"line"==t.type&&1==t.yAxis}),z=u.filter(function(t){return"line"==t.type&&2==t.yAxis}),V=u.filter(function(t){return"scatter"==t.type&&1==t.yAxis}),Y=u.filter(function(t){return"scatter"==t.type&&2==t.yAxis}),H=u.filter(function(t){return"bar"==t.type&&1==t.yAxis}),X=u.filter(function(t){return"bar"==t.type&&2==t.yAxis}),G=u.filter(function(t){return"area"==t.type&&1==t.yAxis}),R=u.filter(function(t){return"area"==t.type&&2==t.yAxis});if(!u||!u.length||!u.filter(function(t){return t.values.length}).length)return t.utils.noData(P,h),P;h.selectAll(".nv-noData").remove();var Z=u.filter(function(t){return!t.disabled&&1==t.yAxis}).map(function(t){return t.values.map(function(t,e){return{x:c(t),y:f(t)}})}),q=u.filter(function(t){return!t.disabled&&2==t.yAxis}).map(function(t){return t.values.map(function(t,e){return{x:c(t),y:f(t)}})});x.domain(d3.extent(d3.merge(Z.concat(q)),function(t){return t.x})).range([0,$]);var j=h.selectAll("g.wrap.multiChart").data([u]),K=j.enter().append("g").attr("class","wrap nvd3 multiChart"),Q=K.append("g"),U=Q.append("g").attr("class","nv-x nv-axis");U=h.selectAll("g.wrap.multiChart").select(".nv-x");var J=Q.append("g").attr("class","nv-y1 nv-axis"),tt=Q.append("g").attr("class","nv-y2 nv-axis"),te=Q.append("g").attr("class","stack1Wrap"),tn=Q.append("g").attr("class","stack2Wrap"),tr=Q.append("g").attr("class","bars1Wrap"),ti=Q.append("g").attr("class","bars2Wrap"),to=Q.append("g").attr("class","scatters1Wrap"),ta=Q.append("g").attr("class","scatters2Wrap"),ts=Q.append("g").attr("class","lines1Wrap"),tl=Q.append("g").attr("class","lines2Wrap"),tu=Q.append("g").attr("class","legendWrap"),tc=Q.append("g").attr("class","nv-interactive");tu=h.selectAll("g.wrap.nv-multiChart").select(".nv-legendWrap"),j.select("g");var td=u.map(function(t,e){return u[e].color||o(t,e)});if(l){var tf=D.align()?$/2:$,tp=D.align()?tf:0;D.width(tf),D.color(td),tu.datum(u.map(function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=t.originalKey+(1==t.yAxis?"":m),t})).call(D),i||D.height()===r.top||(r.top=D.height(),B=t.utils.availableHeight(s,h,r)),tu.attr("transform","translate("+tp+","+-r.top+")")}else tu.selectAll("*").remove();K.attr("transform","translate("+r.left+","+r.top+")"),_.width($).height(B).interpolate(p).color(td.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"line"==u[e].type})),k.width($).height(B).interpolate(p).color(td.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"line"==u[e].type})),w.width($).height(B).color(td.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"scatter"==u[e].type})),A.width($).height(B).color(td.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"scatter"==u[e].type})),C.width($).height(B).color(td.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"bar"==u[e].type})),M.width($).height(B).color(td.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"bar"==u[e].type})),L.width($).height(B).interpolate(p).color(td.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"area"==u[e].type})),S.width($).height(B).interpolate(p).color(td.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"area"==u[e].type})),ts.datum(N.filter(function(t){return!t.disabled})),to.datum(V.filter(function(t){return!t.disabled})),tr.datum(H.filter(function(t){return!t.disabled})),te.datum(G.filter(function(t){return!t.disabled})),tl.datum(z.filter(function(t){return!t.disabled})),ta.datum(Y.filter(function(t){return!t.disabled})),ti.datum(X.filter(function(t){return!t.disabled})),tn.datum(R.filter(function(t){return!t.disabled}));var th=[];if(C.stacked()&&H.length){var th=H.filter(function(t){return!t.disabled}).map(function(t){return t.values});th.length>0&&(th=th.reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})}))}H.length&&th.push({x:0,y:0});var tg=[];if(M.stacked()&&X.length){var tg=X.filter(function(t){return!t.disabled}).map(function(t){return t.values});tg.length>0&&(tg=tg.reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})}))}function tv(t){return d3.transpose(t).map(function(t){return t.map(function(t){return t.y})}).map(function(t){return d3.sum(t)})}if(X.length&&tg.push({x:0,y:0}),y.domain(e||d3.extent(d3.merge(Z).concat(th),function(t){return t.y})).range([0,B]),b.domain(n||d3.extent(d3.merge(q).concat(tg),function(t){return t.y})).range([0,B]),_.yDomain(y.domain()),w.yDomain(y.domain()),C.stacked()){var tm=y.domain([0,d3.max(tv(Z))]).range([0,B]);C.yDomain(tm.domain())}else C.yDomain(y.domain());if(L.yDomain(y.domain()),k.yDomain(b.domain()),A.yDomain(b.domain()),M.stacked()){var t$=b.domain([0,d3.max(tv(q))]).range([0,B]);M.yDomain(t$.domain())}else M.yDomain(b.domain());function tx(t){var e=2===t.series.yAxis?W:F;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},I.duration(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function ty(t){var e=2===t.series.yAxis?W:F;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},I.duration(100).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function tb(t){var e=2===t.series.yAxis?W:F;t.point.x=L.x()(t.point),t.point.y=L.y()(t.point),I.duration(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function t_(t){var e=2===t.series.yAxis?W:F;t.value=C.x()(t.data),t.series={value:C.y()(t.data),color:t.color,key:t.data.key},I.duration(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function tk(){for(var t=0,e=O.length;t=u[0]&&P.x()(t,e)<=u[1]}),f=c[r=t.interactiveBisect(c,e.pointXValue,P.x())],p=P.y()(f,r);null===p||isNaN(p)||s.noHighlightSeries||function t(e,n,r,i){var o={line:{yAxis1:{chart:_,data:N},yAxis2:{chart:k,data:z}},scatter:{yAxis1:{chart:w,data:V},yAxis2:{chart:A,data:Y}},bar:{yAxis1:{chart:C,data:H},yAxis2:{chart:M,data:X}},area:{yAxis1:{chart:L,data:G},yAxis2:{chart:S,data:R}}},a=o[e.type]["yAxis"+e.yAxis].chart,s=o[e.type]["yAxis"+e.yAxis].data.reduce(function(t,n,r){return n.key===e.key?r:t},0);try{a.highlightPoint(s,n,r,void 0)}catch(l){}}(s,r,!0),void 0!==f&&(void 0===n&&(n=f),void 0===i&&(i=x(P.x()(f,r))),a.push({key:s.key,value:p,color:o(s,s.seriesIndex),data:f,yAxis:2==s.yAxis?W:F}))});var s=function(t,e){var n=a[e].yAxis;return null==t?"N/A":n.tickFormat()(t)};g.tooltip.headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(g.tooltip.valueFormatter()||s).data({value:P.x()(n,r),index:r,series:a})(),g.renderGuideLine(i)}),g.dispatch.on("elementMouseout",function(t){tk()})):(_.dispatch.on("elementMouseover.tooltip",tx),k.dispatch.on("elementMouseover.tooltip",tx),_.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),k.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),w.dispatch.on("elementMouseover.tooltip",ty),A.dispatch.on("elementMouseover.tooltip",ty),w.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),A.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),L.dispatch.on("elementMouseover.tooltip",tb),S.dispatch.on("elementMouseover.tooltip",tb),L.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),S.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),C.dispatch.on("elementMouseover.tooltip",t_),M.dispatch.on("elementMouseover.tooltip",t_),C.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),M.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),C.dispatch.on("elementMousemove.tooltip",function(t){I()}),M.dispatch.on("elementMousemove.tooltip",function(t){I()}))}),P}return P.dispatch=T,P.legend=D,P.lines1=_,P.lines2=k,P.scatters1=w,P.scatters2=A,P.bars1=C,P.bars2=M,P.stack1=L,P.stack2=S,P.xAxis=E,P.yAxis1=F,P.yAxis2=W,P.tooltip=I,P.interactiveLayer=g,P.options=t.utils.optionsFunc.bind(P),P._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},xScale:{get:function(){return x},set:function(t){x=t,E.scale(x)}},yDomain1:{get:function(){return e},set:function(t){e=t}},yDomain2:{get:function(){return n},set:function(t){n=t}},noData:{get:function(){return u},set:function(t){u=t}},interpolate:{get:function(){return p},set:function(t){p=t}},legendRightAxisHint:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return r},set:function(t){void 0!==t.top&&(r.top=t.top,i=t.top),r.right=void 0!==t.right?t.right:r.right,r.bottom=void 0!==t.bottom?t.bottom:r.bottom,r.left=void 0!==t.left?t.left:r.left}},color:{get:function(){return o},set:function(e){o=t.utils.getColor(e)}},x:{get:function(){return c},set:function(t){c=t,_.x(t),k.x(t),w.x(t),A.x(t),C.x(t),M.x(t),L.x(t),S.x(t)}},y:{get:function(){return f},set:function(t){f=t,_.y(t),k.y(t),w.y(t),A.y(t),L.y(t),S.y(t),C.y(t),M.y(t)}},useVoronoi:{get:function(){return h},set:function(t){h=t,_.useVoronoi(t),k.useVoronoi(t),L.useVoronoi(t),S.useVoronoi(t)}},useInteractiveGuideline:{get:function(){return v},set:function(t){(v=t)&&(_.interactive(!1),_.useVoronoi(!1),k.interactive(!1),k.useVoronoi(!1),L.interactive(!1),L.useVoronoi(!1),S.interactive(!1),S.useVoronoi(!1),w.interactive(!1),A.interactive(!1))}},duration:{get:function(){return $},set:function(t){$=t,[_,k,L,S,w,A,E,F,W].forEach(function(t){t.duration($)})}}}),t.utils.initOptions(P),P},t.models.ohlcBar=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scaleLinear(),f=d3.scaleLinear(),p=function(t){return t.x},h=function(t){return t.y},g=function(t){return t.open},v=function(t){return t.close},m=function(t){return t.high},$=function(t){return t.low},x=[],y=[],b=!1,_=!0,k=t.utils.defaultColor(),w=!1,A=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(w){return w.each(function(w){u=d3.select(this);var C=t.utils.availableWidth(a,u,o),M=t.utils.availableHeight(s,u,o);t.utils.initSVG(u);var L=C/w[0].values.length*.9;c.domain(e||d3.extent(w[0].values.map(p).concat(x))),b?c.range(r||[.5*C/w[0].values.length,C*(w[0].values.length-.5)/w[0].values.length]):c.range(r||[5+L/2,C-L/2-5]),f.domain(n||[d3.min(w[0].values.map($).concat(y)),d3.max(w[0].values.map(m).concat(y))]).range(i||[M,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+.01*f.domain()[0],f.domain()[1]-.01*f.domain()[1]]):f.domain([-1,1]));var S=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([w[0].values]).enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar");S.attr("transform","translate("+o.left+","+o.top+")");var E=S.append("defs"),F=S.append("g");F.select("g");var W=F.append("g").attr("class","nv-ticks");u.on("click",function(t,e,n){A.call("chartClick",this,{data:e,index:e.index,pos:t,id:l})}),E.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect").attr("width",C).attr("height",M),F.attr("clip-path",_?"url(#nv-chart-clip-path-"+l+")":"");var D=W.selectAll(".nv-tick").data(function(t){return t});D.exit().remove(),D.enter().append("path").attr("class",function(t,e,n){return(g(t,e)>v(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}).attr("d",function(t,e){return"m0,0l0,"+(f(g(t,e))-f(m(t,e)))+"l"+-L/2+",0l"+L/2+",0l0,"+(f($(t,e))-f(g(t,e)))+"l0,"+(f(v(t,e))-f($(t,e)))+"l"+L/2+",0l"+-L/2+",0z"}).attr("transform",function(t,e){return"translate("+c(p(t,e))+","+f(m(t,e))+")"}).attr("fill",function(t,e){return k[0]}).attr("stroke",function(t,e){return k[0]}).attr("x",0).attr("y",function(t,e){return f(Math.max(0,h(t,e)))}).attr("height",function(t,e){return Math.abs(f(h(t,e))-f(0))}),D.attr("class",function(t,e,n){return(g(t,e)>v(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}),D.transition().duration(0).attr("transform",function(t,e){return"translate("+c(p(t,e))+","+f(m(t,e))+")"}).attr("d",function(t,e){var n=C/w[0].values.length*.9;return"m0,0l0,"+(f(g(t,e))-f(m(t,e)))+"l"+-n/2+",0l"+n/2+",0l0,"+(f($(t,e))-f(g(t,e)))+"l0,"+(f(v(t,e))-f($(t,e)))+"l"+n/2+",0l"+-n/2+",0z"})}),C}return C.highlightPoint=function(t,e){C.clearHighlights(),u.select(".nv-ohlcBar .nv-tick-0-"+t).classed("hover",e)},C.clearHighlights=function(){u.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},forceX:{get:function(){return x},set:function(t){x=t}},forceY:{get:function(){return y},set:function(t){y=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return _},set:function(t){_=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return w},set:function(t){w=t}},x:{get:function(){return p},set:function(t){p=t}},y:{get:function(){return h},set:function(t){h=t}},open:{get:function(){return g()},set:function(t){g=t}},close:{get:function(){return v()},set:function(t){v=t}},high:{get:function(){return m},set:function(t){m=t}},low:{get:function(){return $},set:function(t){$=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!=t.top?t.top:o.top,o.right=void 0!=t.right?t.right:o.right,o.bottom=void 0!=t.bottom?t.bottom:o.bottom,o.left=void 0!=t.left?t.left:o.left}},color:{get:function(){return k},set:function(e){k=t.utils.getColor(e)}}}),t.utils.initOptions(C),C},t.models.parallelCoordinates=function(){"use strict";var e,n,r,i={top:30,right:0,bottom:10,left:0},o=null,a=null,s=null,l=null,u=d3.scalePoint(),c={},f="undefined values",p=[],h=[],g=[],v=!0,m=t.utils.defaultColor(),$=[],x=[],y=[],b=[],_=1,k=d3.line(),w=d3.axisLeft(d3.scaleLinear()),A=d3.dispatch("start","brush","end","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),C=t.utils.renderWatch(A);function M(L){return C.reset(),L.each(function(C){var M,L,S=d3.select(this);if(s=t.utils.availableWidth(o,S,i),l=t.utils.availableHeight(a,S,i),t.utils.initSVG(S),void 0===C[0].values){var E=[];C.forEach(function(t){var e={};Object.keys(t).forEach(function(n){"name"!==n&&(e[n]=t[n])}),E.push({key:t.name,values:e})}),C=E}var F=C.map(function(t){return t.values});0===x.length&&(x=C),g=p.sort(function(t,e){return t.currentPosition-e.currentPosition}).map(function(t){return t.key}),h=p.filter(function(t){return!t.disabled}),u.range([0,s],1).domain(h.map(function(t){return t.key}));var W={},D=!1,I=[];g.forEach(function(t){var e=d3.extent(F,function(e){return+e[t]}),n=e[0],r=e[1],i=!1;(isNaN(n)||isNaN(r))&&(i=!0,n=0,r=0),n===r&&(n-=1,r+=1);var o=$.filter(function(e){return e.dimension==t});0!==o.length&&(i?(n=c[t].domain()[0],r=c[t].domain()[1]):!o[0].hasOnlyNaN&&v?(n=n>o[0].extent[0]?o[0].extent[0]:n,r=rb.indexOf(e.key)){var o=d3.scaleLinear().domain([i,n[1]]).range([l-12,r[1]]);c[e.key].brush.extent([[o.range()[0],0],[o.range()[1],1]]),b.push(e.key)}if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key])))return[u(e.key),c[e.key](i)]}return void 0!==M&&(b.length>0||D?(M.style("display","inline"),L.style("display","inline")):(M.style("display","none"),L.style("display","none"))),[u(e.key),c[e.key](t.values[e.key])]}))}function j(t){$.forEach(function(e){var n=c[e.dimension].brush.extent();e.hasOnlyNaN&&(e.extent[1]=(c[e.dimension].domain()[1]-n[0])*(e.extent[1]-e.extent[0])/(W[e.dimension]-e.extent[0])+n[0]),e.hasNaN&&(e.extent[0]=n[0]),t&&c[e.dimension].brush.extent(e.extent)}),r.select(".nv-brushBackground").each(function(t){d3.select(this).call(c[t.key].brush)}).selectAll("rect").attr("x",-8).attr("width",16),J()}function K(){!1===v&&(v=!0,j(!0))}function Q(t){R=(G=g.filter(function(e){return null!==t.selection})).map(function(t){return c[t].brush.extent()}),$=[],G.forEach(function(t,e){$[e]={dimension:t,extent:R[e],hasNaN:!1,hasOnlyNaN:!1}}),x=[],e.style("display",function(t){var e=G.every(function(e,n){return!!(isNaN(t.values[e])||isNaN(parseFloat(t.values[e])))&&R[n][0]==c[e].brush.extent()[1][0]||R[n][0]<=t.values[e]&&t.values[e]<=R[n][1]&&!isNaN(parseFloat(t.values[e]))});return e&&x.push(t),e?null:"none"}),J(),A.call("brush",this,{filters:$,active:x})}function U(){var t=G.length>0;$.forEach(function(t){t.extent[0]===c[t.dimension].brush.extent()[1]&&b.indexOf(t.dimension)>=0&&(t.hasNaN=!0),t.extent[1]c[t.key].domain()[0]&&(I[t.key]=[n[0].extent[1]]),n[0].extent[0]>=c[t.key].domain()[0]&&I[t.key].push(n[0].extent[0])),d3.select(this).call(w.scale(c[t.key]).tickFormat(t.format).tickValues(I[t.key]))})}function tt(t){var e=y[t];return null==e?u(t):e}x=[],e.style("display",function(t){var e=G.every(function(e,n){return!!(isNaN(t.values[e])||isNaN(parseFloat(t.values[e])))&&R[n][0]==c[e].brush.extent()[1][0]||R[n][0]<=t.values[e]&&t.values[e]<=R[n][1]&&!isNaN(parseFloat(t.values[e]))});return e&&x.push(t),e?null:"none"}),($.length>0||!t.utils.arrayEquals(x,Z))&&A.call("activeChanged",this,x)}),M}return M.dispatch=A,M.options=t.utils.optionsFunc.bind(M),M._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},dimensionData:{get:function(){return p},set:function(t){p=t}},displayBrush:{get:function(){return v},set:function(t){v=t}},filters:{get:function(){return $},set:function(t){$=t}},active:{get:function(){return x},set:function(t){x=t}},lineTension:{get:function(){return _},set:function(t){_=t}},undefinedValuesLabel:{get:function(){return f},set:function(t){f=t}},dimensions:{get:function(){return p.map(function(t){return t.key})},set:function(e){t.deprecated("dimensions","use dimensionData instead"),0===p.length?e.forEach(function(t){p.push({key:t})}):e.forEach(function(t,e){p[e].key=t})}},dimensionNames:{get:function(){return p.map(function(t){return t.key})},set:function(e){t.deprecated("dimensionNames","use dimensionData instead"),g=[],0===p.length?e.forEach(function(t){p.push({key:t})}):e.forEach(function(t,e){p[e].key=t})}},dimensionFormats:{get:function(){return p.map(function(t){return t.format})},set:function(e){t.deprecated("dimensionFormats","use dimensionData instead"),0===p.length?e.forEach(function(t){p.push({format:t})}):e.forEach(function(t,e){p[e].format=t})}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return m},set:function(e){m=t.utils.getColor(e)}}}),t.utils.initOptions(M),M},t.models.parallelCoordinatesChart=function(){"use strict";var e=t.models.parallelCoordinates(),n=t.models.legend(),r=t.models.tooltip();t.models.tooltip();var i={top:0,right:0,bottom:0,left:0},o=null,a=null,s=null,l=!0,u=t.utils.defaultColor(),c=t.utils.state(),f=[],p=!0,h=null,g=null,v="undefined",m=d3.dispatch("dimensionsOrder","end","stateChange","changeState","renderEnd"),$=t.utils.renderWatch(m);function x(r){return $.reset(),$.models(e),r.each(function(r){var u,g=d3.select(this);t.utils.initSVG(g);var v,$,y=this,b=t.utils.availableWidth(a,g,i),_=t.utils.availableHeight(s,g,i);if(x.update=function(){g.call(x)},x.container=this,c.setter((v=f,function(t){void 0!==t.active&&v.forEach(function(e,n){e.disabled=!t.active[n]})}),x.update).getter(($=f,function(){return{active:$.map(function(t){return!t.disabled})}})).update(),c.disabled=f.map(function(t){return!!t.disabled}),(f=f.map(function(t){return t.disabled=!!t.disabled,t})).forEach(function(t,e){t.originalPosition=isNaN(t.originalPosition)?e:t.originalPosition,t.currentPosition=isNaN(t.currentPosition)?e:t.currentPosition}),!h)for(u in h={},c)c[u]instanceof Array?h[u]=c[u].slice(0):h[u]=c[u];if(!r||!r.length)return t.utils.noData(x,g),x;g.selectAll(".nv-noData").remove();var k=g.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([r]).enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart");k.attr("transform","translate("+i.left+","+i.top+")");var w=k.append("g");k.select("g");var A=w.append("g").attr("class","nv-parallelCoordinatesWrap"),C=w.append("g").attr("class","nv-legendWrap");C=g.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").select(".nv-legendWrap"),w.select("rect").attr("width",b).attr("height",_>0?_:0),l?(n.width(b).color(function(t){return"rgb(188,190,192)"}),C.datum(f.sort(function(t,e){return t.originalPosition-e.originalPosition})).call(n),o||n.height()===i.top||(i.top=n.height(),_=t.utils.availableHeight(s,g,i)),C.attr("transform","translate( 0 ,"+-i.top+")")):C.selectAll("*").remove(),e.width(b).height(_).dimensionData(f).displayBrush(p),A.datum(r).transition().duration(0).call(e),e.dispatch.on("end",function(t,e){e?(p=!0,m.call("end",this,t)):p=!1}),n.dispatch.on("stateChange",function(t){for(var e in t)c[e]=t[e];m.call("stateChange",y,t),x.update()}),e.dispatch.on("dimensionsOrder",function(t){f.sort(function(t,e){return t.currentPosition-e.currentPosition});var e=!1;f.forEach(function(t,n){t.currentPosition=n,t.currentPosition!==t.originalPosition&&(e=!0)}),m.call("dimensionsOrder",f,e)}),m.on("changeState",function(t){void 0!==t.disabled&&(f.forEach(function(e,n){e.disabled=t.disabled[n]}),c.disabled=t.disabled),x.update()})}),$.renderEnd("parraleleCoordinateChart immediate"),x}return r.contentGenerator(function(t){var e='";return 0!==t.series.length&&(e+='',t.series.forEach(function(t){e=e+'"}),e+=""),e+="
'+t.key+"
'+t.key+''+t.value+"
"}),e.dispatch.on("elementMouseover.tooltip",function(t){var e={key:t.label,color:t.color,series:[]};t.values&&(Object.keys(t.values).forEach(function(n){var r,i=t.dimensions.filter(function(t){return t.key===n})[0];i&&(r=isNaN(t.values[n])||isNaN(parseFloat(t.values[n]))?v:i.format(t.values[n]),e.series.push({idx:i.currentPosition,key:n,value:r,color:i.color}))}),e.series.sort(function(t,e){return t.idx-e.idx})),r.data(e).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){r.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){r()}),x.dispatch=m,x.parallelCoordinates=e,x.legend=n,x.tooltip=r,x.options=t.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},defaultState:{get:function(){return h},set:function(t){h=t}},dimensionData:{get:function(){return f},set:function(t){f=t}},displayBrush:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return g},set:function(t){g=t}},nanValue:{get:function(){return v},set:function(t){v=t}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,o=t.top),i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return u},set:function(r){u=t.utils.getColor(r),n.color(u),e.color(u)}}}),t.utils.inheritOptions(x,e),t.utils.initOptions(x),x},t.models.pie=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},n=500,r=500,i=function(t){return t.x},o=function(t){return t.y},a=Math.floor(1e4*Math.random()),s=null,l=t.utils.defaultColor(),u=d3.format(",.2f"),c=!0,f=!1,p="key",h=.02,g=!1,v=!1,m=!1,$=!0,x=0,y=!1,b=!1,_=!1,k=!1,w=0,A=.5,C=250,M=d3.transition().duration(C).ease(d3.easeLinear),L=(d3.transition().duration(70).ease(d3.easeLinear),d3.transition().duration(50).ease(d3.easeLinear),[]),S=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=[],F=[],W=t.utils.renderWatch(S);function D(M){return W.reset(),M.each(function(M){var D=n-e.left-e.right,I=r-e.top-e.bottom,T=Math.min(D,I)/2,O=[],P=[];if(s=d3.select(this),0===L.length)for(var B=T-T/10,N=A*T,z=0;z=h&&(tt[te(r)]&&(r[1]-=14),tt[te(r)]=!0),"translate("+r+")"}),J.select(".nv-label text").style("text-anchor",function(t,e){return y?(t.startAngle+t.endAngle)/290?e-180:e}}),W.renderEnd("pie immediate"),D}return D.dispatch=S,D.options=t.utils.optionsFunc.bind(D),D._options=Object.create({},{arcsRadius:{get:function(){return L},set:function(t){L=t}},width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},showLabels:{get:function(){return c},set:function(t){c=t}},title:{get:function(){return m},set:function(t){m=t}},titleOffset:{get:function(){return x},set:function(t){x=t}},labelThreshold:{get:function(){return h},set:function(t){h=t}},hideOverlapLabels:{get:function(){return g},set:function(t){g=t}},valueFormat:{get:function(){return u},set:function(t){u=t}},x:{get:function(){return i},set:function(t){i=t}},id:{get:function(){return a},set:function(t){a=t}},endAngle:{get:function(){return k},set:function(t){k=t}},startAngle:{get:function(){return b},set:function(t){b=t}},padAngle:{get:function(){return _},set:function(t){_=t}},cornerRadius:{get:function(){return w},set:function(t){w=t}},donutRatio:{get:function(){return A},set:function(t){A=t}},labelsOutside:{get:function(){return f},set:function(t){f=t}},labelSunbeamLayout:{get:function(){return y},set:function(t){y=t}},donut:{get:function(){return v},set:function(t){v=t}},growOnHover:{get:function(){return $},set:function(t){$=t}},pieLabelsOutside:{get:function(){return f},set:function(e){f=e,t.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return f},set:function(e){f=e,t.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return u},set:function(e){u=e,t.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return e},set:function(t){e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left}},duration:{get:function(){return C},set:function(t){C=t,W.reset(C),M=d3.transition().duration(C).ease(d3.easeLinear)}},y:{get:function(){return o},set:function(t){o="function"==typeof t?t:function(){return t}}},color:{get:function(){return l},set:function(e){l=t.utils.getColor(e)}},labelType:{get:function(){return p},set:function(t){p=t||"key"}}}),t.utils.initOptions(D),D},t.models.pieChart=function(){"use strict";var e=t.models.pie(),n=t.models.legend(),r=t.models.tooltip(),i={top:30,right:20,bottom:20,left:20},o=null,a=null,s=null,l=!1,u=!0,c="top",f=t.utils.defaultColor(),p=t.utils.state(),h=null,g=null,v=250,m=d3.dispatch("stateChange","changeState","renderEnd");r.duration(0).headerEnabled(!1).valueFormatter(function(t,n){return e.valueFormat()(t,n)});var $=t.utils.renderWatch(m);function x(r){return $.reset(),$.models(e),r.each(function(r){var l,f=d3.select(this);t.utils.initSVG(f);var g,v,$=t.utils.availableWidth(a,f,i),y=t.utils.availableHeight(s,f,i);if(x.update=function(){f.transition().call(x)},x.container=this,p.setter((g=r,function(t){void 0!==t.active&&g.forEach(function(e,n){e.disabled=!t.active[n]})}),x.update).getter((v=r,function(){return{active:v.map(function(t){return!t.disabled})}})).update(),p.disabled=r.map(function(t){return!!t.disabled}),!h)for(l in h={},p)p[l]instanceof Array?h[l]=p[l].slice(0):h[l]=p[l];if(!r||!r.length)return t.utils.noData(x,f),x;f.selectAll(".nv-noData").remove();var b=f.selectAll("g.nv-wrap.nv-pieChart").data([r]).enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart");b.append("g");var _=b.select("g"),k=_.append("g").attr("class","nv-pieWrap");k=f.selectAll("g.nv-wrap.nv-pieChart").select(".nv-pieWrap");var w=_.append("g").attr("class","nv-legendWrap");if(w=f.selectAll("g.nv-wrap.nv-pieChart").select(".nv-legendWrap"),u){if("top"===c)n.width($).key(e.x()),w.datum(r).call(n),o||n.height()===i.top||(i.top=n.height(),y=t.utils.availableHeight(s,f,i)),w.attr("transform","translate(0,"+-i.top+")");else if("right"===c){var A=t.models.legend().width();$/2a.indexOf(t.target)&&a.push(t.target)})}),l=a,++u;s&&(e=u,o.forEach(function(t){t.sourceLinks.length||(t.x=e-1)})),r=(i[0]-n)/(u-1),o.forEach(function(t){t.x*=r})}(),function t(e){var n,s=d3.group().key(function(t){return t.x}).sortKeys(d3.ascending).entries(o).map(function(t){return t.values});n=d3.min(s,function(t){return(i[1]-(t.length-1)*r)/d3.sum(t,g)}),s.forEach(function(t){t.forEach(function(t,e){t.y=e,t.dy=t.value*n})}),a.forEach(function(t){t.dy=t.value*n}),p(),h();for(var l=1;e>0;--e)c(l*=.99),p(),h(),u(l),p(),h();function u(t){s.forEach(function(n,r){n.forEach(function(n){if(n.targetLinks.length){var r=d3.sum(n.targetLinks,e)/d3.sum(n.targetLinks,g);n.y+=(r-f(n))*t}})});function e(t){return(t.source.y+t.sy+t.dy/2)*t.value}}function c(t){s.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var r=d3.sum(n.sourceLinks,e)/d3.sum(n.sourceLinks,g);n.y+=(r-f(n))*t}})});function e(t){return(t.target.y+t.ty+t.dy/2)*t.value}}function p(){s.forEach(function(t){var e,n,o,a=0,s=t.length;for(t.sort(v),o=0;o0&&(e.y+=n),a=e.y+e.dy+r;if((n=a-r-i[1])>0)for(a=e.y-=n,o=s-2;o>=0;--o)(n=(e=t[o]).y+e.dy+r-a)>0&&(e.y-=n),a=e.y})}function v(t,e){return t.y-e.y}}(t)},u=function(){h()},c=function(){var t=.5;function e(e){var n=e.source.x+e.source.dx,r=e.target.x,i=d3.interpolateNumber(n,r),o=i(t),a=i(1-t),s=e.source.y+e.sy+e.dy/2,l=e.target.y+e.ty+e.dy/2;return"M"+n+","+s+"C"+o+","+s+" "+a+","+l+" "+r+","+l}return e.curvature=function(n){return arguments.length?(t=+n,e):t},e},f=function(t){return t.y+t.dy/2};function p(){o.forEach(function(t){t.targetLinks.length||(t.x=d3.min(t.sourceLinks,function(t){return t.target.x})-1)})}function h(){function t(t,e){return t.source.y-e.source.y}function e(t,e){return t.target.y-e.target.y}o.forEach(function(n){n.sourceLinks.sort(e),n.targetLinks.sort(t)}),o.forEach(function(t){var e=0,n=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=n,n+=t.dy})})}function g(t){return t.value}return e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{nodeWidth:{get:function(){return n},set:function(t){n=+t}},nodePadding:{get:function(){return r},set:function(t){r=t}},nodes:{get:function(){return o},set:function(t){o=t}},links:{get:function(){return a},set:function(t){a=t}},size:{get:function(){return i},set:function(t){i=t}},sinksRight:{get:function(){return s},set:function(t){s=t}},layout:{get:function(){l(32)},set:function(t){l(t)}},relayout:{get:function(){u()},set:function(t){}},center:{get:function(){return f()},set:function(t){"function"==typeof t&&(f=t)}},link:{get:function(){return c()},set:function(t){return"function"==typeof t&&(c=t),c()}}}),t.utils.initOptions(e),e},t.models.sankeyChart=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=t.models.sankey(),r=600,i=400,o=36,a=40,s="units",l=void 0,u=d3.format(",.0f"),c=function(t){return u(t)+" "+s},f=d3.scaleOrdinal(d3.schemeAccent),p=function(t){return t.source.name+" → "+t.target.name+"\n"+c(t.value)},h=function(t){return t.color=f(t.name.replace(/ .*/,""))},g=function(t){return d3.rgb(t.color).darker(2)},v=function(t){return t.name+"\n"+c(t.value)},m=function(t,e){t.append("text").attr("x",0).attr("y",0).attr("class","nvd3-sankey-chart-error").attr("text-anchor","middle").text(e)};function $(t){return t.each(function(e){var s={nodes:[{node:1,name:"Test 1"},{node:2,name:"Test 2"},{node:3,name:"Test 3"},{node:4,name:"Test 4"},{node:5,name:"Test 5"},{node:6,name:"Test 6"}],links:[{source:0,target:1,value:2295},{source:0,target:5,value:1199},{source:1,target:2,value:1119},{source:1,target:5,value:1176},{source:2,target:3,value:487},{source:2,target:5,value:632},{source:3,target:4,value:301},{source:3,target:5,value:186}]},u=!1,c=!1;if(("object"==typeof e.nodes&&e.nodes.length)>=0&&("object"==typeof e.links&&e.links.length)>=0&&(u=!0),e.nodes&&e.nodes.length>0&&e.links&&e.links.length>0&&(c=!0),!u)return console.error("NVD3 Sankey chart error:","invalid data format for",e),console.info("Valid data format is: ",s,JSON.stringify(s)),m(t,"Error loading chart, data is invalid"),!1;if(!c)return m(t,"No data available"),!1;var f=t.append("svg").attr("width",r).attr("height",i).append("g").attr("class","nvd3 nv-wrap nv-sankeyChart");n.nodeWidth(o).nodePadding(a).size([r,i]);var $=n.link();n.nodes(e.nodes).links(e.links).layout(32).center(l);var x=f.append("g").selectAll(".link").data(e.links).enter().append("path").attr("class","link").attr("d",$).style("stroke-width",function(t){return Math.max(1,t.dy)}).sort(function(t,e){return e.dy-t.dy});x.append("title").text(p);var y=f.append("g").selectAll(".node").data(e.nodes).enter().append("g").attr("class","node").attr("transform",function(t){return"translate("+t.x+","+t.y+")"}).call(d3.drag().subject(function(t){return t}).on("start",function(){this.parentNode.appendChild(this)}).on("drag",function t(e,r){d3.select(this).attr("transform","translate("+r.x+","+(r.y=Math.max(0,Math.min(i-r.dy,e.y)))+")"),n.relayout(),x.attr("d",$)}));y.append("rect").attr("height",function(t){return t.dy}).attr("width",n.nodeWidth()).style("fill",h).style("stroke",g).append("title").text(v),y.append("text").attr("x",-6).attr("y",function(t){return t.dy/2}).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).text(function(t){return t.name}).filter(function(t){return t.xMath.abs(e[r][0]-e[r+1][0])&&1e-4>Math.abs(e[r][1]-e[r+1][1])?e.splice(r+1,1):r++;var i=Array.from(d3.Delaunay.from(e,t=>t[0],t=>t[1]).voronoi([n[0][0],n[0][1],n[2][0],n[2][1]]).cellPolygons()).map(function(t,n){return{data:t,series:e[n][2],point:e[n][3]}}),o=td.selectAll("path").data(i).enter().append("svg:path").attr("d",function(t){return t&&t.data&&0!==t.data.length?"M"+t.data.join(",")+"Z":"M 0 0"}).attr("id",function(t,e){return"nv-path-"+e}).attr("clip-path",function(t,e){return"url(#nv-clip-"+g+"-"+e+")"});D&&o.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),W&&(tf.selectAll("*").remove(),tf.selectAll("clipPath").data(e).enter().append("svg:clipPath").attr("id",function(t,e){return"nv-clip-"+g+"-"+e}).append("svg:circle").attr("cx",function(t){return t[0]}).attr("cy",function(t){return t[1]}).attr("r",I));var a=function(t,e,n,r){if(Z)return 0;setCoordinates(e.pageX,e.pageY);var i=X[n.seriesIndex||n.series];if(void 0!==i){var o=i.values[n.point];o.color=p(i,n.seriesIndex),o.x=y(o),o.y=b(o);var a=v.node().getBoundingClientRect(),s=window.pageYOffset||document.documentElement.scrollTop,l=window.pageXOffset||document.documentElement.scrollLeft,c={left:m(y(o,n.point))+a.left+l+u.left+10,top:$(b(o,n.point))+a.top+s+u.top+10};Y.call(r,this,{point:o,series:i,pos:c,relativePos:[m(y(o,n.point))+u.left,$(b(o,n.point))+u.top],seriesIndex:n.seriesIndex||n.series,pointIndex:n.point,event:d3.event,element:t})}};o.on("click",function(t,e){a(this,t,e,"elementClick")}).on("dblclick",function(t,e){a(this,t,e,"elementDblClick")}).on("mouseover",function(t,e){a(this,t,e,"elementMouseover")}).on("mouseout",function(t,e,n){a(this,t,e,"elementMouseout")})}else v.selectAll(".nv-group").selectAll(".nv-point").on("click",function(t,e){if(Z||!X[t[0].series])return 0;var n=X[t[0].series],r=n.values[e];Y.call("elementClick",this,{point:r,series:n,pos:[m(y(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(y(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e,event:d3.event,element:this})}).on("dblclick",function(t,e){if(Z||!X[t[0].series])return 0;var n=X[t[0].series],r=n.values[e];Y.call("elementDblClick",this,{point:r,series:n,pos:[m(y(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(y(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e})}).on("mouseover",function(t,e){if(Z||!X[t[0].series])return 0;var n=X[t[0].series],r=n.values[e];Y.call("elementMouseover",this,{point:r,series:n,pos:[m(y(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(y(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e,color:p(t[0],e)})}).on("mouseout",function(t,e){if(Z||!X[t[0].series])return 0;var n=X[t[0].series],r=n.values[e];Y.call("elementMouseout",this,{point:r,series:n,pos:[m(y(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(y(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e,color:p(t[0],e)})})}ts.attr("transform","translate("+u.left+","+u.top+")"),tu.append("clipPath").attr("id","nv-edge-clip-"+g).append("rect").attr("transform","translate( -10, -10)").attr("width",K+20).attr("height",tt>0?tt+20:0),F&&tc.attr("clip-path",F?"url(#nv-edge-clip-"+g+")":""),Z=!0;var th=v.select("g.nv-groups").selectAll("g.nv-group").data(function(t){return t},function(t){return t.key}),tg=th.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).attr("class",function(t,e){return(t.classed||"")+" nv-group nv-series-"+e}).classed("nv-noninteractive",!M).classed("hover",function(t){return t.hover});th.exit().remove();var tv=th.merge(tg);tv.watchTransition(q,"scatter: groups").style("fill",function(t,e){return p(t,e)}).style("stroke",function(t,e){return t.pointBorderColor||h||p(t,e)}).style("stroke-opacity",1).style("fill-opacity",.5);var tm=tv.selectAll("path.nv-point").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return L(t[0],e)})}),t$=tm.enter().append("path").attr("class",function(t){return"nv-point nv-point-"+t[1]}).style("fill",function(t){return t.color}).style("stroke",function(t){return t.color}).attr("transform",function(r){return"translate("+t.utils.NaNtoZero(e(y(r[0],r[1])))+","+t.utils.NaNtoZero(n(b(r[0],r[1])))+")"}).attr("d",t.utils.symbol().type(function(t){return k(t[0])}).size(function(t){return x(_(t[0],t[1]))}));tm.exit().each(Q).remove();var tx=tm.merge(t$);if(tv.exit().selectAll("path.nv-point").watchTransition(q,"scatter exit").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(m(y(e[0],e[1])))+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"}).remove(),tx.filter(function(t){return U(t,"x",y,"y",b)||ti||to||ta}).watchTransition(q,"scatter points").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(m(y(e[0],e[1])))+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"}),tx.filter(function(t){return U(t,"shape",k,"size",_)||ti||to||ta}).watchTransition(q,"scatter points").attr("d",t.utils.symbol().type(function(t){return k(t[0])}).size(function(t){return x(_(t[0],t[1]))})),R){var ty=tv.selectAll(".nv-label").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return L(t[0],e)})}),tb=ty.enter().append("text").style("fill",function(t,e){return t.color}).style("stroke-opacity",0).style("fill-opacity",1).attr("transform",function(r){return"translate("+(t.utils.NaNtoZero(e(y(r[0],r[1])))+Math.sqrt(x(_(r[0],r[1]))/Math.PI)+2)+","+t.utils.NaNtoZero(n(b(r[0],r[1])))+")"}).text(function(t,e){return t[0].label});ty.exit().remove();var t_=ty.merge(tb);tv.exit().selectAll("path.nv-label").watchTransition(q,"scatter exit").attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(m(y(e[0],e[1])))+Math.sqrt(x(_(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"}).remove(),t_.each(function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)}),t_.watchTransition(q,"scatter labels").text(function(t,e){return t[0].label}).attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(m(y(e[0],e[1])))+Math.sqrt(x(_(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"})}G?(clearTimeout(l),l=setTimeout(tp,G)):tp(),e=m.copy(),n=$.copy(),r=x.copy(),a=c,s=f}),q.renderEnd("scatter immediate"),J}return J.dispatch=Y,J.options=t.utils.optionsFunc.bind(J),J._calls=new function(){this.clearHighlights=function(){return t.dom.write(function(){v&&v.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(e,n,r){t.dom.write(function(){v&&v.select(".nv-groups").selectAll(".nv-series-"+e).selectAll(".nv-point-"+n).classed("hover",r)})}},Y.on("elementMouseover.point",function(t){M&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)}),Y.on("elementMouseout.point",function(t){M&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!1)}),J._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},xScale:{get:function(){return m},set:function(t){m=t}},yScale:{get:function(){return $},set:function(t){$=t}},pointScale:{get:function(){return x},set:function(t){x=t}},xDomain:{get:function(){return T},set:function(t){T=t}},yDomain:{get:function(){return O},set:function(t){O=t}},pointDomain:{get:function(){return N},set:function(t){N=t}},xRange:{get:function(){return P},set:function(t){P=t}},yRange:{get:function(){return B},set:function(t){B=t}},pointRange:{get:function(){return z},set:function(t){z=t}},forceX:{get:function(){return w},set:function(t){w=t}},forceY:{get:function(){return A},set:function(t){A=t}},forcePoint:{get:function(){return C},set:function(t){C=t}},interactive:{get:function(){return M},set:function(t){M=t}},pointActive:{get:function(){return L},set:function(t){L=t}},padDataOuter:{get:function(){return E},set:function(t){E=t}},padData:{get:function(){return S},set:function(t){S=t}},clipEdge:{get:function(){return F},set:function(t){F=t}},clipVoronoi:{get:function(){return W},set:function(t){W=t}},clipRadius:{get:function(){return I},set:function(t){I=t}},showVoronoi:{get:function(){return D},set:function(t){D=t}},id:{get:function(){return g},set:function(t){g=t}},interactiveUpdateDelay:{get:function(){return G},set:function(t){G=t}},showLabels:{get:function(){return R},set:function(t){R=t}},pointBorderColor:{get:function(){return h},set:function(t){h=t}},x:{get:function(){return y},set:function(t){y="function"==typeof t?t:function(){return t}}},y:{get:function(){return b},set:function(t){b="function"==typeof t?t:function(){return t}}},pointSize:{get:function(){return _},set:function(t){_="function"==typeof t?t:function(){return t}}},pointShape:{get:function(){return k},set:function(t){k="function"==typeof t?t:function(){return t}}},margin:{get:function(){return u},set:function(t){u.top=void 0!==t.top?t.top:u.top,u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return X},set:function(t){X=t,q.reset(X)}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e)}},useVoronoi:{get:function(){return H},set:function(t){!1===(H=t)&&(W=!1)}}}),t.utils.initOptions(J),J},t.models.scatterChart=function(){"use strict";var e=t.models.scatter(),n=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),r=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),i=t.models.legend(),o=t.models.distribution(),a=t.models.distribution(),s=t.models.tooltip(),l={top:30,right:20,bottom:50,left:75},u=null,c=null,f=null,p=null,h=t.utils.defaultColor(),g=e.xScale(),v=e.yScale(),m=!1,$=!1,x=!0,y=!0,b=!0,_="top",k=!1,w=t.utils.state(),A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),M=null,L=250,S=d3.transition().duration(L).ease(d3.easeLinear),E=!1;e.xScale(g).yScale(v),n.tickPadding(10),r.tickPadding(10),o.axis("x"),a.axis("y"),s.headerFormatter(function(t,e){return n.tickFormat()(t,e)}).valueFormatter(function(t,e){return r.tickFormat()(t,e)});var F,W,D=t.utils.renderWatch(C,L);function I(_){return D.reset(),D.models(e),y&&D.models(n),b&&D.models(r),m&&D.models(o),$&&D.models(a),_.each(function(_){var M,S=this;p=d3.select(this),t.utils.initSVG(p);var T,O,P=t.utils.availableWidth(c,p,l),B=t.utils.availableHeight(f,p,l);if(I.update=function(){0===L?p.call(I):p.transition().duration(L).call(I)},I.container=this,w.setter((T=_,function(t){void 0!==t.active&&T.forEach(function(e,n){e.disabled=!t.active[n]})}),I.update).getter((O=_,function(){return{active:O.map(function(t){return!t.disabled})}})).update(),w.disabled=_.map(function(t){return!!t.disabled}),!A)for(M in A={},w)w[M]instanceof Array?A[M]=w[M].slice(0):A[M]=w[M];if(!_||!_.length||!_.filter(function(t){return t.values.length}).length)return t.utils.noData(I,p),D.renderEnd("scatter immediate"),I;p.selectAll(".nv-noData").remove(),g=e.xScale(),v=e.yScale(),_.forEach(function(t,e){t.seriesIndex=e});var N=p.selectAll("g.nv-wrap.nv-scatterChart").data([_]).enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+e.id()),z=N.append("g");z.select("g"),z.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none");var V=z.append("g").attr("class","nv-x nv-axis");V=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-x");var Y=z.append("g").attr("class","nv-y nv-axis");Y=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-y");var H=z.append("g").attr("class","nv-scatterWrap");H=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-scatterWrap");var X=z.append("g").attr("class","nv-regressionLinesWrap");X=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-regressionLinesWrap");var G=z.append("g").attr("class","nv-distWrap");G=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-distWrap");var R=z.append("g").attr("class","nv-legendWrap");k&&Y.attr("transform","translate("+P+",0)"),R=p.selectAll("g.nv-wrap.nv-scatterChart").select(".nv-legendWrap"),x?(i.width(P),R.datum(_).call(i),u||i.height()===l.top||(l.top=i.height(),B=t.utils.availableHeight(f,p,l)),R.attr("transform","translate(0,"+-l.top+")")):R.selectAll("*").remove(),N.attr("transform","translate("+l.left+","+l.top+")"),e.width(P).height(B).color(_.map(function(t,e){return t.color=t.color||h(t,e),t.color}).filter(function(t,e){return!_[e].disabled})).showLabels(E),H.datum(_.filter(function(t){return!t.disabled})).call(e),X.attr("clip-path","url(#nv-edge-clip-"+e.id()+")"),X.selectAll(".nv-regLines").data(function(t){return t}).enter().append("g").attr("class","nv-regLines").selectAll(".nv-regLine").data(function(t){return[t]}).enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0).filter(function(t){return t.intercept&&t.slope}).watchTransition(D,"scatterPlusLineChart: regline").attr("x1",g.range()[0]).attr("x2",g.range()[1]).attr("y1",function(t,e){return v(g.domain()[0]*t.slope+t.intercept)}).attr("y2",function(t,e){return v(g.domain()[1]*t.slope+t.intercept)}).style("stroke",function(t,e,n){return h(t,n)}).style("stroke-opacity",function(t,e){return t.disabled||void 0===t.slope||void 0===t.intercept?0:1}),y&&(n.scale(g)._ticks(t.utils.calcTicksX(P/100,_)),n.tickSizeInner(-B),V.attr("transform","translate(0,"+v.range()[0]+")").call(n)),b&&(r.scale(v)._ticks(t.utils.calcTicksY(B/36,_)),r.tickSizeInner(-P),Y.call(r)),o.getData(e.x()).scale(g).width(P).color(_.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!_[e].disabled})),G.append("g").attr("class","nv-distributionX").attr("transform","translate(0,"+v.range()[0]+")").datum(_.filter(function(t){return!t.disabled})).call(o).style("opacity",function(){return m?"1":"1e-6"}).watchTransition(D,"scatterPlusLineChart").style("opacity",function(){return m?"1":"1e-6"}),a.getData(e.y()).scale(v).width(B).color(_.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!_[e].disabled})),G.append("g").attr("class","nv-distributionY").attr("transform","translate("+(k?P:-a.size())+",0)").datum(_.filter(function(t){return!t.disabled})).call(a).style("opacity",function(){return $?"1":"1e-6"}).watchTransition(D,"scatterPlusLineChart").style("opacity",function(){return $?"1":"1e-6"}),i.dispatch.on("stateChange",function(t){for(var e in t)w[e]=t[e];C.call("stateChange",S,t),I.update()}),C.on("changeState",function(t){void 0!==t.disabled&&(_.forEach(function(e,n){e.disabled=t.disabled[n]}),w.disabled=t.disabled),I.update()}),e.dispatch.on("elementMouseout.tooltip",function(t){s.hidden(!0),p.select(".nv-chart-"+e.id()+" .nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",0),p.select(".nv-chart-"+e.id()+" .nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",a.size())}),e.dispatch.on("elementMouseover.tooltip",function(t){p.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.relativePos[1]-B),p.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.relativePos[0]+o.size()),s.data(t).hidden(!1)}),F=g.copy(),W=v.copy()}),D.renderEnd("scatter with line immediate"),I}return I.dispatch=C,I.scatter=e,I.legend=i,I.xAxis=n,I.yAxis=r,I.distX=o,I.distY=a,I.tooltip=s,I.options=t.utils.optionsFunc.bind(I),I._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},container:{get:function(){return p},set:function(t){p=t}},showDistX:{get:function(){return m},set:function(t){m=t}},showDistY:{get:function(){return $},set:function(t){$=t}},legendPosition:{get:function(){return _},set:function(t){_=t}},showLegend:{get:function(){return x},set:function(t){x=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return M},set:function(t){M=t}},duration:{get:function(){return L},set:function(t){L=t,S=d3.transition().duration(L).ease(d3.easeLinear)}},showLabels:{get:function(){return E},set:function(t){E=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e),i.color(h),o.color(h),a.color(h)}}}),t.utils.inheritOptions(I,e),t.utils.initOptions(I),I},t.models.sparkline=function(){"use strict";var e,n,r,i,o={top:2,right:0,bottom:2,left:0},a=400,s=32,l=null,u=!0,c=d3.scaleLinear(),f=d3.scaleLinear(),p=function(t){return t.x},h=function(t){return t.y},g=t.utils.getColor(["#000"]),v=!0,m=!0,$=d3.dispatch("renderEnd"),x=t.utils.renderWatch($);function y(u){return x.reset(),u.each(function(u){var $=a-o.left-o.right,x=s-o.top-o.bottom;l=d3.select(this),t.utils.initSVG(l),c.domain(e||d3.extent(u,p)).range(r||[0,$]),f.domain(n||d3.extent(u,h)).range(i||[x,0]);var y=l.selectAll("g.nv-wrap.nv-sparkline").data([u]),b=y.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");b.append("g"),y.select("g"),b.attr("transform","translate("+o.left+","+o.top+")");var _=b.selectAll("path").data(function(t){return[t]});_.exit().remove();var k=_.enter().append("path");k.style("stroke",function(t,e){return t.color||g(t,e)}).attr("d",d3.line().x(function(t,e){return c(p(t,e))}).y(function(t,e){return f(h(t,e))})),k.merge(_);var w=b.selectAll("circle.nv-point").data(function(t){var e=t.map(function(t,e){return h(t,e)});function n(e){if(-1==e)return null;var n=t[e];return n.pointIndex=e,n}var r=n(e.lastIndexOf(f.domain()[1])),i=n(e.indexOf(f.domain()[0])),o=n(e.length-1);return[v?i:null,v?r:null,m?o:null].filter(function(t){return null!=t})});w.exit().remove();var A=w.enter().append("circle");A.attr("cx",function(t,e){return c(p(t,t.pointIndex))}).attr("cy",function(t,e){return f(h(t,t.pointIndex))}).attr("r",2).attr("class",function(t,e){return p(t,t.pointIndex)==c.domain()[1]?"nv-point nv-currentValue":h(t,t.pointIndex)==f.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"}),A.merge(w)}),x.renderEnd("sparkline immediate"),y}return y.options=t.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return f},set:function(t){f=t}},animate:{get:function(){return u},set:function(t){u=t}},showMinMaxPoints:{get:function(){return v},set:function(t){v=t}},showCurrentPoint:{get:function(){return m},set:function(t){m=t}},x:{get:function(){return p},set:function(t){p="function"==typeof t?t:function(){return t}}},y:{get:function(){return h},set:function(t){h="function"==typeof t?t:function(){return t}}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return g},set:function(e){g=t.utils.getColor(e)}}}),y.dispatch=$,t.utils.initOptions(y),y},t.models.sparklinePlus=function(){"use strict";var e,n,r=t.models.sparkline(),i={top:15,right:100,bottom:10,left:50},o=null,a=null,s=[],l=!1,u=d3.format(",r"),c=d3.format(",.2f"),f=!0,p=!0,h=!1,g=null,v=d3.dispatch("renderEnd");d3.transition().duration(250).ease(d3.easeLinear);var m=t.utils.renderWatch(v);function $(g){return m.reset(),m.models(r),g.each(function(g){var v=d3.select(this);t.utils.initSVG(v);var m=t.utils.availableWidth(o,v,i),x=t.utils.availableHeight(a,v,i);if($.update=function(){v.call($)},$.container=this,!g||!g.length)return t.utils.noData($,v),$;v.selectAll(".nv-noData").remove();var y=r.y()(g[g.length-1],g.length-1);e=r.xScale(),n=r.yScale();var b=v.selectAll("g.nv-wrap.nv-sparklineplus").data([g]),_=b.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus"),k=_.append("g");b.select("g");var w=k.append("g").attr("class","nv-sparklineWrap"),A=k.append("g").attr("class","nv-valueWrap"),C=k.append("g").attr("class","nv-hoverArea");if(_.attr("transform","translate("+i.left+","+i.top+")"),_.merge(b),r.width(m).height(x),w.call(r).merge(w),f){var M=A.selectAll(".nv-currentValue").data([y]),L=M.enter().append("text").attr("class","nv-currentValue").attr("dx",h?-8:8).attr("dy",".9em").style("text-anchor",h?"end":"start");L.attr("x",m+(h?i.right:0)).attr("y",p?function(t){return n(t)}:0).style("fill",r.color()(g[g.length-1],g.length-1)).text(c(y)),L.merge(M)}var S=C.append("rect").on("mousemove",function t(n){if(!l){var o=d3.pointer(n)[0]-i.left;s=[function t(e,n){for(var i=Math.abs(r.x()(e[0],0)-n),o=0,a=0;at.key);p=d3.stack().keys(L).order(g).offset(h).value(function(t,e){return t[e]})(M);var S=[];p.forEach(function(t,e){t.seriesIndex=e,t.x=Array.from(Array(t.length).keys());var n=[];t.map(function(t,r){return n.push({x:r,y:t[1]-t[0],y0:t[0],series:r,seriesIndex:e,index:r,display:{y:t[1]-t[0],y0:t[0]}}),n}),S.push({values:n,key:L[e],seriesIndex:e})}),p=S;var E=l.selectAll("g.nv-wrap.nv-stackedarea").data([p]).enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea");E.attr("transform","translate("+r.left+","+r.top+")");var F=E.append("defs"),W=E.append("g"),D=W.select("g"),I=W.append("g").attr("class","nv-areaWrap");I=l.selectAll("g.nv-wrap.nv-stackedarea").select(".nv-areaWrap");var T=W.append("g").attr("class","nv-scatterWrap");T=l.selectAll("g.nv-wrap.nv-stackedarea").select(".nv-scatterWrap"),0==$.forceY().length&&$.forceY().push(0),$.width(x).height(y).x(u).y(function(t){if(void 0!==t.display)return t.display.y+t.display.y0}).color(S.map(function(t,e){return t.color=t.color||a(t,t.seriesIndex),t.color})),T.datum(S).call($),F.append("clipPath").attr("id","nv-edge-clip-"+s).append("rect").attr("width",x).attr("height",y),m&&W.attr("clip-path",m?"url(#nv-edge-clip-"+s+")":"");var O=d3.area().defined(f).x(function(t,n){return e(u(t,n))}).y0(function(t){return n(t.display.y0)}).y1(b).curve(getInterpolationType(v)),P=d3.area().defined(f).x(function(t,n){return e(u(t,n))}).y0(function(t){return n(t.display.y0)}).y1(function(t){return n(t.display.y0)}),B=I.selectAll("path.nv-area").data(function(t){return t});B.exit().remove();var N=B.enter().append("path").attr("class",function(t,e){return"nv-area nv-area-"+e}).attr("d",function(t,e){return P(t.values,t.seriesIndex)}).on("mouseover",function(t,e,n){d3.select(this).classed("hover",!0),_.call("areaMouseover",this,{point:e,series:e.key,pos:[t.pageX,t.pageY],seriesIndex:e.seriesIndex})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),_.call("areaMouseout",this,{point:e,series:e.key,pos:[t.pageX,t.pageY],seriesIndex:e.seriesIndex})}).on("click",function(t,e,n){d3.select(this).classed("hover",!1),_.call("areaClick",this,{point:e,series:e.key,pos:[t.pageX,t.pageY],seriesIndex:e.seriesIndex})});(N=N.merge(B)).style("fill",function(t,e){return t.color||a(t,t.seriesIndex)}).style("stroke",function(t,e,n){return e.color||a(e,e.seriesIndex)}),N.watchTransition(k,"stackedArea path").attr("d",function(t,e){return O(t.values,t.seriesIndex)}),$.dispatch.on("elementMouseover.area",function(t){D.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!0)}),$.dispatch.on("elementMouseout.area",function(t){D.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!1)}),w.d3_stackedOffset_stackPercent=function(t){var e,n,r,i=t.length,o=t[0].length,a=[];for(n=0;n=t[0]&&r.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}})),tt.transition().duration(I).call(r),tl(),tu()}r.dispatch.on("areaClick.toggle",function(t){1===u.filter(function(t){return!t.disabled}).length?u.forEach(function(t){t.disabled=!1}):u.forEach(function(e,n){e.disabled=n!=t.seriesIndex}),M.disabled=u.map(function(t){return!!t.disabled}),E.call("stateChange",this,M),V.update()}),a.dispatch.on("stateChange",function(t){for(var e in t)M[e]=t[e];E.call("stateChange",this,t),V.update()}),s.dispatch.on("legendClick",function(t,e,n){e.disabled&&(ta=ta.map(function(t){return t.disabled=!0,t}),e.disabled=!1,r.style(e.style),M.style=r.style(),E.call("stateChange",this,M),V.update())}),l.dispatch.on("elementMousemove",function(e){r.clearHighlights();var n,i,o,a=[],s=0,c=!0,f=!1;if(u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(l,p){i=t.interactiveBisect(l.values,e.pointXValue,function(t,e){return t[0]});var h=l.values[i],g=V.y()({x:h[0],y:h[1]},i);if(null!=g&&g>0&&(r.highlightPoint(p,i,!0),f=!0),p!==u.length-1||f||r.highlightPoint(p,i,!0),void 0!==h){void 0===n&&(n=h),void 0===o&&(o=V.xScale()(V.x()({x:h[0],y:h[1]},i)));var m="expand"==r.style()?h[1]:V.y()({x:h[0],y:h[1]},i);a.push({key:l.key,value:+m,color:v(l,l.seriesIndex),point:h}),A&&"expand"!=r.style()&&null!=m&&(s+=+m,c=!1)}}),a.reverse(),a.length>2){var p=V.yScale().invert(e.mouseY),h=null;a.forEach(function(t,e){p=Math.abs(p);var n=Math.abs(t.point[0]),r=Math.abs(t.point[1]);if(p>=n&&p<=r+n){h=e;return}}),null!=h&&(a[h].highlight=!0)}A&&"expand"!=r.style()&&a.length>=2&&!c&&a.push({key:C,value:s,total:!0});var g=V.x()({x:n[0],y:n[1]},i),m=l.tooltip.valueFormatter();"expand"===r.style()||"stack_percent"===r.style()?(P||(P=m),m=d3.format(".1%")):P&&(m=P,P=null),l.tooltip.valueFormatter(m).data({value:g,series:a})(),l.renderGuideLine(o)}),l.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),c.dispatch.on("onBrush",function(t){td(t)}),E.on("changeState",function(t){void 0!==t.disabled&&u.length===t.disabled.length&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),M.disabled=t.disabled),void 0!==t.style&&(r.style(t.style),N=t.style),V.update()})}),B.renderEnd("stacked Area chart immediate"),V}return r.dispatch.on("elementMouseover.tooltip",function(t){t.point.x=r.x()(t.point),t.point.y=r.y()(t.point),u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),V.dispatch=E,V.stacked=r,V.legend=a,V.controls=s,V.xAxis=i,V.x2Axis=c.xAxis,V.yAxis=o,V.y2Axis=c.yAxis,V.interactiveLayer=l,V.tooltip=u,V.focus=c,V.dispatch=E,V.options=t.utils.optionsFunc.bind(V),V._options=Object.create({},{width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},showLegend:{get:function(){return $},set:function(t){$=t}},legendPosition:{get:function(){return x},set:function(t){x=t}},showXAxis:{get:function(){return y},set:function(t){y=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return L},set:function(t){L=t}},noData:{get:function(){return S},set:function(t){S=t}},showControls:{get:function(){return m},set:function(t){m=t}},controlLabels:{get:function(){return D},set:function(t){D=t}},controlOptions:{get:function(){return W},set:function(t){W=t}},showTotalInTooltip:{get:function(){return A},set:function(t){A=t}},totalLabel:{get:function(){return C},set:function(t){C=t}},focusEnable:{get:function(){return k},set:function(t){k=t}},focusHeight:{get:function(){return c.height()},set:function(t){c.height(t)}},brushExtent:{get:function(){return c.brushExtent()},set:function(t){c.brushExtent(t)}},margin:{get:function(){return f},set:function(t){void 0!==t.top&&(f.top=t.top,p=t.top),f.right=void 0!==t.right?t.right:f.right,f.bottom=void 0!==t.bottom?t.bottom:f.bottom,f.left=void 0!==t.left?t.left:f.left}},focusMargin:{get:function(){return c.margin},set:function(t){c.margin.top=void 0!==t.top?t.top:c.margin.top,c.margin.right=void 0!==t.right?t.right:c.margin.right,c.margin.bottom=void 0!==t.bottom?t.bottom:c.margin.bottom,c.margin.left=void 0!==t.left?t.left:c.margin.left}},duration:{get:function(){return I},set:function(t){I=t,B.reset(I),T=d3.transition().duration(I).ease(d3.easeLinear),r.duration(I),i.duration(I),o.duration(I)}},color:{get:function(){return v},set:function(e){v=t.utils.getColor(e),a.color(v),r.color(v),c.color(v)}},x:{get:function(){return r.x()},set:function(t){r.x(t),c.x(t)}},y:{get:function(){return r.y()},set:function(t){r.y(t),c.y(t)}},rightAlignYAxis:{get:function(){return _},set:function(t){_=t}},useInteractiveGuideline:{get:function(){return w},set:function(t){w=!!t,V.interactive(!t),V.useVoronoi(!t),r.scatter.interactive(!t)}}}),t.utils.inheritOptions(V,r),t.utils.initOptions(V),V},t.models.stackedAreaWithFocusChart=function(){return t.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},t.models.sunburst=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=600,s=600,l="count",u={count:function(t){return 1},value:function(t){return t.value||t.size},size:function(t){return t.value||t.size}},c=Math.floor(1e4*Math.random()),f=null,p=t.utils.defaultColor(),h=!1,g=function(t){return"count"===l?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},v=.02,m=function(t,e){return t.name>e.name},$=function(t,e){return void 0!==t.parent?t.name+"-"+t.parent.name+"-"+e:t.name},x=!0,y=500,b=d3.transition().duration(y).ease(d3.easeLinear),_=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),k=d3.scaleLinear().range([0,2*Math.PI]),w=d3.scaleSqrt(),A=d3.partition(),C={},M=d3.arc().startAngle(function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x)))}).endAngle(function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))}).innerRadius(function(t){return Math.max(0,w(t.y))}).outerRadius(function(t){return Math.max(0,w(t.y+t.dy))});function L(t){return S(t)>90?180:0}function S(t){var e=Math.max(0,Math.min(2*Math.PI,k(t.x))),n=Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)));return(e+n)/2*(180/Math.PI)-90}function E(t){var e,n=Math.max(0,Math.min(2*Math.PI,k(t.x)));return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))-n>v}function F(t,n){var r=d3.interpolate(k.domain(),[e.x,e.x+e.dx]),o=d3.interpolate(w.domain(),[e.y,1]),a=d3.interpolate(w.range(),[e.y?20:0,i]);return 0===n?function(){return M(t)}:function(e){return k.domain(r(e)),w.domain(o(e)).range(a(e)),M(t)}}function W(t){var e=d3.interpolate({x:t.x0,dx:t.x1-t.x0,y:t.y0,dy:t.y1-t.y0},t);return function(n){var r=e(n);return t.x0=r.x,t.x1=r.x+r.dx,t.y0=r.y,t.y1=r.y+r.dy,M(r)}}function D(t){var n=f.selectAll("text"),r=f.selectAll("path");n.transition().attr("opacity",0),e=t,r.transition().duration(y).attrTween("d",F).each("end",function(e){e.x>=t.x&&e.x=t.depth&&d3.select(this.parentNode).select("text").transition().duration(y).text(function(t){return g(t)}).attr("opacity",function(t){return E(t)?1:0}).attr("transform",function(){var n=this.getBBox().width;if(0===e.depth)return"translate("+-(n/2*1)+",0)";if(e.depth===t.depth)return"translate("+(w(e.y)+5)+",0)";var r=S(e),i=L(e);return 0===i?"rotate("+r+")translate("+(w(e.y)+5)+",0)":"rotate("+r+")translate("+(w(e.y)+n+5)+",0)rotate("+i+")"})})}var I=t.utils.renderWatch(_);function T(e){return I.reset(),e.each(function(e){f=d3.select(this),i=Math.min(n=t.utils.availableWidth(a,f,o),r=t.utils.availableHeight(s,f,o))/2,w.range([0,i]);var v=f.select("g.nvd3.nv-wrap.nv-sunburst");v[0]&&v[0][0]?v.attr("transform","translate("+(n/2+o.left+o.right)+","+(r/2+o.top+o.bottom)+")"):v=f.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+c).attr("transform","translate("+(n/2+o.left+o.right)+","+(r/2+o.top+o.bottom)+")"),f.on("click",function(t,e,n){_.call("chartClick",this,{data:e,index:e.index,pos:t,id:c})}),A(u[l]||u.count);var m=A.nodes(e[0]).reverse();!function t(e){e.forEach(function(t){var e,n,r,i=C[$(t)];i?(t.x1=i.x+i.dx,t.x0=i.x,t.y1=i.y+i.dy,t.y0=i.y):(t.x1=t.x+t.dx,t.x0=t.x,t.y1=t.y+t.dy,t.y0=t.y),e=t,C[n=$(e)]||(C[n]={}),(r=C[n]).dx=e.dx,r.x=e.x,r.dy=e.dy,r.y=e.y})}(m);var b=v.selectAll(".arc-container").data(m,$);b.enter().append("g").attr("class","arc-container").append("path").attr("d",M).style("fill",function(t){return t.color?t.color:x?p((t.children?t:t.parent).name):p(t.name)}).style("stroke","#FFF").on("click",function(t,e,n){D(e),_.call("elementClick",this,{data:e,index:e.index})}).on("mouseover",function(t,e,n){var r,i;setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0).style("opacity",.8),_.call("elementMouseover",this,{data:e,color:d3.select(this).style("fill"),percent:(i=Math.max(0,Math.min(2*Math.PI,k((r=e).x))),(Math.max(0,Math.min(2*Math.PI,k(r.x+r.dx)))-i)/(2*Math.PI))})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1).style("opacity",1),_.call("elementMouseout",this,{data:e})}).on("mousemove",function(t,e,n){_.call("elementMousemove",this,{data:e})}),b.each(function(t){d3.select(this).select("path").transition().duration(y).attrTween("d",W)}),h&&(b.selectAll("text").remove(),b.append("text").text(function(t){return g(t)}).transition().duration(y).attr("opacity",function(t){return E(t)?1:0}).attr("transform",function(t){var e=this.getBBox().width;if(0===t.depth)return"rotate(0)translate("+-(e/2*1)+",0)";var n=S(t),r=L(t);return 0===r?"rotate("+n+")translate("+(w(t.y)+5)+",0)":"rotate("+n+")translate("+(w(t.y)+e+5)+",0)rotate("+r+")"})),D(m[m.length-1]),b.exit().transition().duration(y).attr("opacity",0).each("end",function(t){C[$(t)]=void 0}).remove()}),I.renderEnd("sunburst immediate"),T}return T.dispatch=_,T.options=t.utils.optionsFunc.bind(T),T._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},mode:{get:function(){return l},set:function(t){l=t}},id:{get:function(){return c},set:function(t){c=t}},duration:{get:function(){return y},set:function(t){y=t,b=d3.transition().duration(y).ease(d3.easeLinear)}},groupColorByParent:{get:function(){return x},set:function(t){x=!!t}},showLabels:{get:function(){return h},set:function(t){h=!!t}},labelFormat:{get:function(){return g},set:function(t){g=t}},labelThreshold:{get:function(){return v},set:function(t){v=t}},sort:{get:function(){return m},set:function(t){m=t}},key:{get:function(){return $},set:function(t){$=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!=t.top?t.top:o.top,o.right=void 0!=t.right?t.right:o.right,o.bottom=void 0!=t.bottom?t.bottom:o.bottom,o.left=void 0!=t.left?t.left:o.left}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e)}}}),t.utils.initOptions(T),T},t.models.sunburstChart=function(){"use strict";var e=t.models.sunburst(),n=t.models.tooltip(),r={top:30,right:20,bottom:20,left:20},i=t.utils.defaultColor(),o=!1,a=null,s=null,l=250,u=d3.transition().duration(l).ease(d3.easeLinear),c=d3.dispatch("stateChange","changeState","renderEnd"),f=t.utils.renderWatch(c);function p(n){return f.reset(),f.models(e),n.each(function(n){var i=d3.select(this);t.utils.initSVG(i);var o=t.utils.availableWidth(null,i,r),a=t.utils.availableHeight(null,i,r);if(p.update=function(){0===l?i.call(p):i.transition().duration(l).call(p)},p.container=i,!n||!n.length)return t.utils.noData(p,i),p;i.selectAll(".nv-noData").remove(),e.width(o).height(a).margin(r),i.call(e)}),f.renderEnd("sunburstChart immediate"),p}return n.duration(0).headerEnabled(!1).valueFormatter(function(t){return t}),e.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:t.data.name,value:t.data.value||t.data.size,color:t.color,percent:t.percent},o||(delete t.percent,delete t.series.percent),n.data(t).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){n.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(t){n()}),p.dispatch=c,p.sunburst=e,p.tooltip=n,p.options=t.utils.optionsFunc.bind(p),p._options=Object.create({},{noData:{get:function(){return s},set:function(t){s=t}},defaultState:{get:function(){return a},set:function(t){a=t}},showTooltipPercent:{get:function(){return o},set:function(t){o=t}},color:{get:function(){return i},set:function(t){i=t,e.color(i)}},duration:{get:function(){return l},set:function(t){l=t,f.reset(l),u=d3.transition().duration(l).ease(d3.easeLinear),e.duration(l)}},margin:{get:function(){return r},set:function(t){r.top=void 0!==t.top?t.top:r.top,r.right=void 0!==t.right?t.right:r.right,r.bottom=void 0!==t.bottom?t.bottom:r.bottom,r.left=void 0!==t.left?t.left:r.left,e.margin(r)}}}),t.utils.inheritOptions(p,e),t.utils.initOptions(p),p},t.version="1.8.10"}(); diff --git a/package-lock.json b/package-lock.json index 7fb059789..2a0b5f8c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@wavemaker/nvd3", - "version": "1.8.9", + "version": "1.8.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1a5b77ba4..1f690a493 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wavemaker/nvd3", - "version": "1.8.9", + "version": "1.8.10", "description": "A reusable charting library written in d3.js", "url": "https://github.com/wavemaker/nvd3", "main": "build/nv.d3.min.js", diff --git a/src/nv.d3.js b/src/nv.d3.js index 1f92c778f..799ae333a 100644 --- a/src/nv.d3.js +++ b/src/nv.d3.js @@ -6719,18 +6719,22 @@ Check equality of 2 array wrapEnter.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')'); var gEnter = wrapEnter.append('g'); - var g = gEnter.select('g'); + var g = gEnter; var backgroundAppend=gEnter.append('g').attr('class', 'nv-background').append('rect'); - var xAxisAppend=gEnter.append('g').attr('class', 'nv-x nv-axis'); - xAxisAppend = container.selectAll('g.nv-wrap.nv-focus').select('.nv-x'); - var yAxisAppend=gEnter.append('g').attr('class', 'nv-y nv-axis'); + var xAxisAppendFocus=gEnter.append('g').attr('class', 'nv-x nv-axis'); + xAxisAppendFocus= container.selectAll('.nv-focus').select('.nv-x.nv-axis'); + var yAxisAppendFocus=gEnter.append('g').attr('class', 'nv-y nv-axis'); + yAxisAppendFocus=container.selectAll('.nv-focus').select('.nv-x.nv-axis'); var contentWrapAppend=gEnter.append('g').attr('class', 'nv-contentWrap'); + contentWrapAppend=container.selectAll('.nv-focus').select('.nv-contentWrap'); var brushBackgroundAppend=gEnter.append('g').attr('class', 'nv-brushBackground'); + brushBackgroundAppend=container.selectAll('.nv-focus').select('.nv-brushBackground'); var xBrushAppend=gEnter.append('g').attr('class', 'nv-x nv-brush'); + xBrushAppend=container.selectAll('.nv-focus').select('.nv-x.nv-brush'); if (rightAlignYAxis) { - yAxisAppend + yAxisAppendFocus .attr("transform", "translate(" + availableWidth + ",0)"); } @@ -6802,9 +6806,9 @@ Check equality of 2 array xAxis .tickSizeInner(-availableHeight); - xAxisAppend + xAxisAppendFocus .attr('transform', 'translate(0,' + y.range()[0] + ')'); - var xs=d3.transition(xAxisAppend) + var xs=xAxisAppendFocus.transition() .call(xAxis); //xs.merge(xAxisAppend); } @@ -6816,7 +6820,7 @@ Check equality of 2 array yAxis .tickSizeInner( -availableWidth); - var ys=yAxisAppend + var ys=xAxisAppendFocus .call(yAxis); //ys.merge(yAxisAppend); } @@ -6867,13 +6871,13 @@ Check equality of 2 array } - function onBrush(event, shouldDispatch) { - brushExtent = event.selection === null ? null : brush.extent(); - var extent = event.selection === null ? x.domain() : brush.extent(); - dispatch.call('brush', this, {extent: extent, brush: brush}); + function onBrush(shouldDispatch) { + brushExtent = brush.extent().length ? brush.extent() : null; + var extent = brush.extent().length ? brush.extent() : x.domain(); + dispatch.call('brush', null, {extent: extent, brush: brush}); updateBrushBG(); if (shouldDispatch) { - dispatch.call('brush', this, extent); + dispatch.call('brush', null, extent); } } }); @@ -10120,7 +10124,7 @@ Options for chart: var wrapEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-lineChart'); var gEnter = wrapEnter.append('g'); - var g = gEnter.select('g'); + var g = gEnter; var legendWrapAppend=gEnter.append('g').attr('class', 'nv-legendWrap'); legendWrapAppend = container.selectAll('g.nv-wrap.nv-lineChart').select('.nv-legendWrap'); @@ -10249,9 +10253,9 @@ Options for chart: .style('display', focusEnable ? 'initial' : 'none') .attr('transform', 'translate(0,' + ( availableHeight + margin.bottom + focus.margin().top) + ')') .call(focus); - //s.merge(gEnter); + // s.merge(gEnter); var extent = focus.brush.extent()=== null ? focus.xDomain() : focus.brush.extent(); - if (extent !== null) { + if (extent !== null && extent.length) { onBrush(extent); } } @@ -10951,14 +10955,14 @@ Options for chart: function updateBrushBG(event) { - if (!(event.selection === null)) brush.extent(brushExtent); + if (!(event === null)) brush.extent(brushExtent); brushBG - .data([event.selection === null ? x2.domain() : brushExtent]) - .each(function(d,i) { - var leftWidth = x2(d[0]) - x2.range()[0], - rightWidth = x2.range()[1] - x2(d[1]); + .data([event === null ? x2.domain() : brushExtent]) + .each(function(d, i) { + var leftWidth = x2(d[0]) - x2.range()[0]; + var rightWidth = x2.range()[1] - x2(d[1]); d3.select(this).select('.left') - .attr('width', leftWidth < 0 ? 0 : leftWidth); + .attr('width', leftWidth < 0 ? 0 : leftWidth); d3.select(this).select('.right') .attr('x', x2(d[1])) @@ -10967,9 +10971,9 @@ Options for chart: } function onBrush(event) { - brushExtent = event.selection === null ? null : brush.extent(); - extent = event.selection === null ? x2.domain() : brush.extent(); - dispatch.call('brush', this, {extent: extent, brush: brush}); + brushExtent = event === null ? null : event.selection; + var extent = event === null ? x.domain() : event.selection; + dispatch.call('brush', this, { extent: extent, brush: brush }); updateBrushBG(event); // Prepare Main (Focus) Bars and Lines @@ -16764,16 +16768,20 @@ Options for chart: chart._calls = new function() { this.clearHighlights = function () { nv.dom.write(function() { - container.selectAll(".nv-point.hover").classed("hover", false); + if(container) { + container.selectAll(".nv-point.hover").classed("hover", false); + } }); return null; }; this.highlightPoint = function (seriesIndex, pointIndex, isHoverOver) { nv.dom.write(function() { - container.select('.nv-groups') - .selectAll(".nv-series-" + seriesIndex) - .selectAll(".nv-point-" + pointIndex) - .classed("hover", isHoverOver); + if(container) { + container.select('.nv-groups') + .selectAll(".nv-series-" + seriesIndex) + .selectAll(".nv-point-" + pointIndex) + .classed("hover", isHoverOver); + } }); }; }; @@ -18360,7 +18368,7 @@ Options for chart: .attr('transform', 'translate(0,' + ( availableHeight + margin.bottom + focus.margin().top) + ')') .datum(data.filter(function(d) { return !d.disabled; })) .call(focus); - var extent = (d3.event==null || d3.event.selection === null) ? focus.xDomain() : focus.brush.extent(); + var extent = (d3.event==null || d3.event.selection === null) ? focus.xDomain() : focus.brush.selection(); if(extent !== null){ onBrush(extent); } @@ -19233,6 +19241,6 @@ Options for chart: }; - nv.version = "1.8.9"; + nv.version = "1.8.10"; })(); //# sourceMappingURL=nv.d3.js.map