@wavemaker/app-ng-runtime 12.0.0-next.45031 → 12.0.0-next.45501
Sign up to get free protection for your applications and to get access to all the features.
- app-ng-runtime/build-task/bundles/index.umd.js +405 -451
- app-ng-runtime/build-task/esm2022/data/form/form-field/form-field.build.mjs +2 -3
- app-ng-runtime/build-task/esm2022/public_api.mjs +1 -3
- app-ng-runtime/build-task/fesm2022/index.mjs +406 -454
- app-ng-runtime/build-task/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/build-task/public_api.d.ts +0 -2
- app-ng-runtime/components/base/bundles/index.umd.js +14 -62
- app-ng-runtime/components/base/components.module.d.ts +11 -12
- app-ng-runtime/components/base/esm2022/components.module.mjs +1 -5
- app-ng-runtime/components/base/esm2022/public_api.mjs +1 -2
- app-ng-runtime/components/base/esm2022/widgets/common/base/base.component.mjs +15 -25
- app-ng-runtime/components/base/fesm2022/index.mjs +15 -62
- app-ng-runtime/components/base/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/base/public_api.d.ts +0 -1
- app-ng-runtime/components/base/widgets/common/base/base.component.d.ts +5 -10
- app-ng-runtime/components/containers/wizard/bundles/index.umd.js +17 -0
- app-ng-runtime/components/containers/wizard/esm2022/wizard.component.mjs +18 -1
- app-ng-runtime/components/containers/wizard/fesm2022/index.mjs +17 -0
- app-ng-runtime/components/containers/wizard/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/containers/wizard/wizard.component.d.ts +1 -0
- app-ng-runtime/components/data/form/esm2022/form-field/form-field.directive.mjs +1 -3
- app-ng-runtime/components/data/form/fesm2022/index.mjs +0 -2
- app-ng-runtime/components/data/form/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js +11 -0
- app-ng-runtime/components/dialogs/default/esm2022/base-dialog.mjs +12 -1
- app-ng-runtime/components/dialogs/default/fesm2022/index.mjs +11 -0
- app-ng-runtime/components/dialogs/default/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/default/bundles/index.umd.js +63 -39
- app-ng-runtime/components/input/default/checkboxset/checkboxset.component.d.ts +0 -1
- app-ng-runtime/components/input/default/esm2022/checkboxset/checkboxset.component.mjs +5 -8
- app-ng-runtime/components/input/default/esm2022/radioset/radioset.component.mjs +5 -8
- app-ng-runtime/components/input/default/esm2022/select/select.component.mjs +57 -29
- app-ng-runtime/components/input/default/esm2022/text/base/base-input.mjs +1 -4
- app-ng-runtime/components/input/default/esm2022/text/locale/number-locale.mjs +2 -2
- app-ng-runtime/components/input/default/esm2022/textarea/textarea.component.mjs +4 -1
- app-ng-runtime/components/input/default/fesm2022/index.mjs +63 -39
- app-ng-runtime/components/input/default/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/default/radioset/radioset.component.d.ts +0 -1
- app-ng-runtime/components/input/default/select/select.component.d.ts +2 -4
- app-ng-runtime/components/input/default/textarea/textarea.component.d.ts +3 -2
- app-ng-runtime/components/input/epoch/bundles/index.umd.js +3 -0
- app-ng-runtime/components/input/epoch/esm2022/date-time/date-time.component.mjs +4 -1
- app-ng-runtime/components/input/epoch/fesm2022/index.mjs +3 -0
- app-ng-runtime/components/input/epoch/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/file-upload/bundles/index.umd.js +31 -5
- app-ng-runtime/components/input/file-upload/esm2022/file-upload.component.mjs +34 -8
- app-ng-runtime/components/input/file-upload/fesm2022/index.mjs +32 -6
- app-ng-runtime/components/input/file-upload/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/file-upload/file-upload.component.d.ts +6 -2
- app-ng-runtime/components/navigation/menu/bundles/index.umd.js +2 -2
- app-ng-runtime/components/navigation/menu/esm2022/menu.component.mjs +2 -2
- app-ng-runtime/components/navigation/menu/esm2022/nav/nav.component.mjs +2 -2
- app-ng-runtime/components/navigation/menu/fesm2022/index.mjs +2 -2
- app-ng-runtime/components/navigation/menu/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/core/bundles/index.umd.js +6 -16
- app-ng-runtime/core/enums/enums.d.ts +1 -2
- app-ng-runtime/core/esm2022/enums/enums.mjs +1 -2
- app-ng-runtime/core/esm2022/types/types.mjs +1 -4
- app-ng-runtime/core/esm2022/utils/build-utils.mjs +1 -6
- app-ng-runtime/core/esm2022/utils/utils.mjs +4 -3
- app-ng-runtime/core/fesm2022/index.mjs +4 -12
- app-ng-runtime/core/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/core/types/types.d.ts +1 -5
- app-ng-runtime/core/utils/utils.d.ts +1 -0
- app-ng-runtime/mobile/core/bundles/index.umd.js +18 -2
- app-ng-runtime/mobile/core/esm2022/native.xhr.mjs +19 -3
- app-ng-runtime/mobile/core/fesm2022/index.mjs +18 -2
- app-ng-runtime/mobile/core/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/runtime/base/bundles/index.umd.js +5 -288
- app-ng-runtime/runtime/base/esm2022/public_api.mjs +1 -2
- app-ng-runtime/runtime/base/esm2022/runtime-base.module.mjs +1 -6
- app-ng-runtime/runtime/base/esm2022/services/i18n.service.mjs +2 -2
- app-ng-runtime/runtime/base/esm2022/types/types.mjs +1 -2
- app-ng-runtime/runtime/base/fesm2022/index.mjs +4 -287
- app-ng-runtime/runtime/base/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/runtime/base/public_api.d.ts +0 -1
- app-ng-runtime/runtime/base/runtime-base.module.d.ts +8 -9
- app-ng-runtime/runtime/base/types/types.d.ts +1 -2
- app-ng-runtime/runtime/dynamic/bundles/index.umd.js +9 -27
- app-ng-runtime/runtime/dynamic/esm2022/app/app.module.mjs +2 -5
- app-ng-runtime/runtime/dynamic/esm2022/app/services/component-ref-provider.service.mjs +7 -23
- app-ng-runtime/runtime/dynamic/fesm2022/index.mjs +7 -26
- app-ng-runtime/runtime/dynamic/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/scripts/@wavemaker/nvd3/build/nv.d3.min.js +1 -1
- app-ng-runtime/scripts/datatable/datatable.js +6 -3
- app-ng-runtime/scripts/summernote/dist/summernote-lite.min.js +2 -3
- app-ng-runtime/transpiler/bundles/index.umd.js +0 -5
- app-ng-runtime/transpiler/esm2022/build.mjs +1 -4
- app-ng-runtime/transpiler/esm2022/imports.mjs +1 -3
- app-ng-runtime/transpiler/fesm2022/index.mjs +0 -5
- app-ng-runtime/transpiler/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/build-task/advanced/custom-widget-container/custom-widget-container.build.d.ts +0 -2
- app-ng-runtime/build-task/advanced/custom-widget-wrapper/custom-widget-wrapper.build.d.ts +0 -2
- app-ng-runtime/build-task/esm2022/advanced/custom-widget-container/custom-widget-container.build.mjs +0 -15
- app-ng-runtime/build-task/esm2022/advanced/custom-widget-wrapper/custom-widget-wrapper.build.mjs +0 -26
- app-ng-runtime/components/advanced/custom/.npmignore +0 -2
- app-ng-runtime/components/advanced/custom/bundles/index.umd.js +0 -232
- app-ng-runtime/components/advanced/custom/custom-widget-container/custom-widget-container.directive.d.ts +0 -19
- app-ng-runtime/components/advanced/custom/custom-widget-container/custom-widget.props.d.ts +0 -2
- app-ng-runtime/components/advanced/custom/custom-widget-prop.d.ts +0 -1
- app-ng-runtime/components/advanced/custom/custom-widget.directive.d.ts +0 -19
- app-ng-runtime/components/advanced/custom/custom-widget.module.d.ts +0 -10
- app-ng-runtime/components/advanced/custom/esm2022/custom-widget-container/custom-widget-container.directive.mjs +0 -102
- app-ng-runtime/components/advanced/custom/esm2022/custom-widget-container/custom-widget.props.mjs +0 -12
- app-ng-runtime/components/advanced/custom/esm2022/custom-widget-prop.mjs +0 -8
- app-ng-runtime/components/advanced/custom/esm2022/custom-widget.directive.mjs +0 -68
- app-ng-runtime/components/advanced/custom/esm2022/custom-widget.module.mjs +0 -32
- app-ng-runtime/components/advanced/custom/esm2022/index.mjs +0 -5
- app-ng-runtime/components/advanced/custom/esm2022/public_api.mjs +0 -4
- app-ng-runtime/components/advanced/custom/fesm2022/index.mjs +0 -215
- app-ng-runtime/components/advanced/custom/fesm2022/index.mjs.map +0 -1
- app-ng-runtime/components/advanced/custom/index.d.ts +0 -5
- app-ng-runtime/components/advanced/custom/package.json +0 -23
- app-ng-runtime/components/advanced/custom/public_api.d.ts +0 -3
- app-ng-runtime/components/base/esm2022/widgets/common/base/custom-widget-container.directive.mjs +0 -39
- app-ng-runtime/components/base/widgets/common/base/custom-widget-container.directive.d.ts +0 -14
- app-ng-runtime/runtime/base/components/base-custom-widget.component.d.ts +0 -72
- app-ng-runtime/runtime/base/esm2022/components/base-custom-widget.component.mjs +0 -288
@@ -1 +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;o<n&&(i=t.render.queue[o]);o++)e=i.generate(),typeof i.callback==typeof Function&&i.callback(e);t.render.queue.splice(0,o),t.render.queue.length?setTimeout(r):(t.dispatch.call("end"),t.render.active=!1)};setTimeout(r)},t.render.active=!1,t.render.queue=[],t.addGraph=function(e){typeof arguments[0]==typeof Function&&(e={generate:arguments[0],callback:arguments[1]}),t.render.queue.push(e),t.render.active||t.render()},"undefined"!=typeof module&&"undefined"!=typeof exports&&(module.exports=t),"undefined"!=typeof window&&(window.nv=t),t.dom.write=function(t){return void 0!==window.fastdom?fastdom.mutate(t):t()},t.dom.read=function(t){return void 0!==window.fastdom?fastdom.measure(t):t()};var e={};"use strict";setCoordinates=function(t,n){e.mouseX=t,e.mouseY=n},getCoordinates=function(t,n){return e},getInterpolationType=function(t){if(!t)return d3.curveLinear;switch(t){case"linear":return d3.curveLinear;case"cardinal":return d3.curveCatmullRom;case"step":return d3.curveStep}},t.interactiveGuideline=function(){"use strict";var e={left:0,top:0},n=null,r=null,i=d3.scaleLinear(),o=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick","elementMouseDown","elementMouseUp"),a=!0,s=null,l=t.models.tooltip(),u=window.ActiveXObject;function c(f){f.each(function(f){var p=d3.select(this),h=n||960,g=r||400;function v(t){var n=t.pageX-this.getBoundingClientRect().left-window.pageXOffset,r=t.pageY-this.getBoundingClientRect().top-window.pageYOffset,a=!0,s=!1;if(u&&(n=t.offsetX,r=t.offsetY,"svg"!==t.target.tagName&&(a=!1),t.target.className.baseVal.match("nv-legend")&&(s=!0)),setCoordinates(t.pageX,t.pageY),a&&(n-=e.left,r-=e.top),"mouseout"===t.type||n<0||r<0||n>h||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<n&&(r=a,i=o)}),i},t.models.tooltip=function(){"use strict";var e="nvtooltip-"+Math.floor(1e5*Math.random()),n=null,r="w",i=25,o=0,a=null,s=!0,l=200,u=null,c={left:null,top:null},f=!0,p=100,h=d3.transition().delay(l).duration(0),g=!0,v="nv-pointer-events-none",m=function(t,e,n){return t},$=function(t){return t},x=function(t,e){return t},y=function(t,e){if(null===t)return"";var n=d3.select(document.createElement("table"));g&&n.selectAll("thead").data([t]).enter().append("thead").append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html($(t.value));var r=n.selectAll("tbody").data([t]).enter().append("tbody").selectAll("tr").data(function(t){return t.series}).enter().append("tr").classed("highlight",function(t){return t.highlight});r.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(t){return t.color}),r.append("td").classed("key",!0).classed("total",function(t){return!!t.total}).html(function(t,e){return x(t.key,e)}),r.append("td").classed("value",!0).html(function(t,e){return m(t.value,e,t)}),r.filter(function(t,e){return void 0!==t.percent}).append("td").classed("percent",!0).html(function(t,e){return"("+d3.format(".0%")(t.percent)+")"}),r.selectAll("td").each(function(t){if(t.highlight){var e=d3.scaleLinear().domain([0,1]).range(["#fff",t.color]);d3.select(this).style("border-bottom-color",e(.6)).style("border-top-color",e(.6))}});var i=n.node().outerHTML;return void 0!==t.footer&&(i+="<div class='footer'>"+t.footer+"</div>"),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;r<e.length-1;r++)n.push(r);n.push(e.length-1)}else{n.push(e.length-1);for(var r=e.length-2;r>0;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;i<n.length;i+=1){var o=n[i]&&n[i].values?n[i].values.length:0;r=o>r?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;o<n.length;o+=1)for(var a,s=n[o]&&n[o].values?n[o].values:[],l=0;l<s.length;l+=1)i=(a=s[l]&&r(s[l])?r(s[l]):0)>i?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;++i<o;)e[r=arguments[i]]=t.utils.d3_rebind(e,n,n[r]);return e},t.utils.d3_rebind=function(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}},t.utils.initSVG=function(t){t.classed("nvd3-svg",!0)},t.utils.sanitizeHeight=function(t,e){return t||parseInt(e.style("height"),10)||400},t.utils.sanitizeWidth=function(t,e){return t||parseInt(e.style("width"),10)||960},t.utils.availableHeight=function(e,n,r){return Math.max(0,t.utils.sanitizeHeight(e,n)-r.top-r.bottom)},t.utils.availableWidth=function(e,n,r){return Math.max(0,t.utils.sanitizeWidth(e,n)-r.left-r.right)},t.utils.noData=function(e,n){var r=e.options(),i=r.margin(),o=r.noData(),a=t.utils.availableHeight(null,n,i),s=t.utils.availableWidth(null,n,i),l=i.left+s/2,u=i.top+a/2;n.selectAll("g").remove();var c=n.selectAll(".nv-noData").data(null==o?["No Data Available."]:[o]);c.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),c.attr("x",l).attr("y",u).text(function(t){return t})},t.utils.wrapTicks=function(t,e){t.each(function(){for(var t,n=d3.select(this),r=n.text().split(/\s+/).reverse(),i=[],o=0,a=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");t=r.pop();)i.push(t),l.text(i.join(" ")),l.node().getComputedTextLength()>e&&(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;r<i;r++)if(e[r]instanceof Array&&n[r]instanceof Array){if(!t.arrayEquals(e[r],n[r]))return!1}else if(e[r]!=n[r])return!1;return!0},t.utils.pointIsInArc=function(t,e,n){var r=n.innerRadius()(e),i=n.outerRadius()(e),o=n.startAngle()(e),a=n.endAngle()(e),s=t.x*t.x+t.y*t.y,l=Math.atan2(t.x,-t.y);return l=l<0?l+2*Math.PI:l,r*r<=s&&s<=i*i&&o<=l&&l<=a},t.models.axis=function(e,n){"use strict";var r,i,o=d3.scaleOrdinal(),a={top:0,right:0,bottom:0,left:0},s=75,l=60,u=null,c=!0,f=0,p=!0,h=!1,g=!1,v=null,m=0,$=void 0,x=250,y=d3.dispatch("renderEnd");e.tickFormat(t=>t);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()[1]+10||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[0]||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;m<P;m++){var B="nv-range nv-range"+m;m<=2&&(B=B+" nv-range"+b[m]),T.append("rect").attr("class",B)}T.append("rect").attr("class","nv-measure"),I.attr("transform","translate("+e.left+","+e.top+")");for(var N=function(t){return Math.abs(D(t)-D(0))},z=function(t){return t<0?D(t):D(0)},m=0,P=A.length;m<P;m++){var V=A[m];O.select("rect.nv-range"+m).datum(V).attr("height",k).transition().duration(1e3).attr("width",N(V)).attr("x",z(V))}O.select("rect.nv-measure").style("fill",$).attr("height",k/3).attr("y",k/3).on("mouseover",function(){x.call("elementMouseover",this,{value:L[0],label:W[0]||"Current",color:d3.select(this).style("fill")})}).on("mousemove",function(){x.call("elementMousemove",this,{value:L[0],label:W[0]||"Current",color:d3.select(this).style("fill")})}).on("mouseout",function(){x.call("elementMouseout",this,{value:L[0],label:W[0]||"Current",color:d3.select(this).style("fill")})}).transition().duration(1e3).attr("width",L<0?D(0)-D(L[0]):D(L[0])-D(0)).attr("x",z(L));var Y=k/6,H=C.map(function(t,e){return{value:t,label:E[e]}});T.selectAll("path.nv-markerTriangle").data(H).enter().append("path").attr("class","nv-markerTriangle").attr("d","M0,"+Y+"L"+Y+","+-Y+" "+-Y+","+-Y+"Z").on("mouseover",function(t){x.call("elementMouseover",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[D(t.value),k/2]})}).on("mousemove",function(t){x.call("elementMousemove",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){x.call("elementMouseout",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}),O.selectAll("path.nv-markerTriangle").data(H).transition().duration(1e3).attr("transform",function(t){return"translate("+D(t.value)+","+k/2+")"});var X=M.map(function(t,e){return{value:t,label:F[e]}});T.selectAll("line.nv-markerLine").data(X).enter().append("line").attr("cursor","").attr("class","nv-markerLine").attr("x1",function(t){return D(t.value)}).attr("y1","2").attr("x2",function(t){return D(t.value)}).attr("y2",k-2).on("mouseover",function(t){x.call("elementMouseover",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[D(t.value),k/2]})}).on("mousemove",function(t){x.call("elementMousemove",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){x.call("elementMouseout",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}),O.selectAll("line.nv-markerLine").data(X).transition().duration(1e3).attr("x1",function(t){return D(t.value)}).attr("x2",function(t){return D(t.value)}),I.selectAll(".nv-range").on("mouseover",function(t,e){var n=S[e]||y[e];x.call("elementMouseover",this,{value:t,label:n,color:d3.select(this).style("fill")})}).on("mousemove",function(){x.call("elementMousemove",this,{value:L[0],label:W[0]||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){var n=S[e]||y[e];x.call("elementMouseout",this,{value:t,label:n,color:d3.select(this).style("fill")})})}),A}return A.dispatch=x,A.options=t.utils.optionsFunc.bind(A),A._options=Object.create({},{ranges:{get:function(){return i},set:function(t){i=t}},markers:{get:function(){return o},set:function(t){o=t}},measures:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return p},set:function(t){p=t}},width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},tickFormat:{get:function(){return m},set:function(t){m=t}},duration:{get:function(){return _},set:function(t){_=t,k=d3.transition().duration(_).ease(d3.easeLinear)}},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}},orient:{get:function(){return n},set:function(t){r="right"==(n=t)||"bottom"==n}},color:{get:function(){return $},set:function(e){$=t.utils.getColor(e)}}}),t.utils.initOptions(A),A},t.models.bulletChart=function(){"use strict";var e=t.models.bullet(),n=t.models.tooltip(),r="left",i=!1,o={top:5,right:40,bottom:20,left:120},a=function(t){return t.ranges},s=function(t){return t.markers?t.markers:[]},l=function(t){return t.measures},u=null,c=55,f=null,p=null,h=null,g=d3.dispatch();function v(n){return n.each(function(r,h){var g=d3.select(this);t.utils.initSVG(g);var m=t.utils.availableWidth(u,g,o),$=c-o.top-o.bottom;if(v.update=function(){v(n)},v.container=this,!r||!a.call(this,r,h))return t.utils.noData(v,g),v;g.selectAll(".nv-noData").remove();var x=a.call(this,r,h).slice().sort(d3.descending),y=s.call(this,r,h).slice().sort(d3.descending),b=l.call(this,r,h).slice().sort(d3.descending),_=g.selectAll("g.nv-wrap.nv-bulletChart").data([r]);_.attr("transform","translate("+o.left+","+o.top+")");var k=_.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart").append("g"),w=_.select("g"),A=k.append("g").attr("class","nv-bulletWrap"),C=k.append("g").attr("class","nv-titles"),M=d3.scaleLinear().domain([0,Math.max(x[0],y[0]||0,b[0])]).range(i?[m,0]:[0,m]),L=this.__chart__||d3.scaleLinear().domain([0,1/0]).range(M.range());this.__chart__=M;var S=C.append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(c-o.top-o.bottom)/2+")");S.append("text").attr("class","nv-title").text(function(t){return t.title}),S.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(t){return t.subtitle}),e.width(m).height($),A.transition().call(e);var E=f||M.tickFormat(m/100),F=w.selectAll("g.nv-tick").data(M.ticks(p||m/50),function(t){return this.textContent||E(t)}),W=F.enter().append("g").attr("class","nv-tick").attr("transform",function(t){return"translate("+L(t)+",0)"}).style("opacity",1e-6);W.append("line").attr("y1",$).attr("y2",7*$/6),W.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*$/6).text(E);var D=F.transition().duration(e.duration()).attr("transform",function(t){return"translate("+M(t)+",0)"}).style("opacity",1);D.select("line").attr("y1",$).attr("y2",7*$/6),D.select("text").attr("y",7*$/6),W.transition().duration(e.duration()).attr("transform",function(t){return"translate("+M(t)+",0)"}).style("opacity",1e-6).remove()}),d3.timerFlush(),v}return n.duration(0).headerEnabled(!1),e.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:t.label,value:t.value,color:t.color},n.data(t).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){n.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(t){n()}),v.bullet=e,v.dispatch=g,v.tooltip=n,v.options=t.utils.optionsFunc.bind(v),v._options=Object.create({},{ranges:{get:function(){return a},set:function(t){a=t}},markers:{get:function(){return s},set:function(t){s=t}},measures:{get:function(){return l},set:function(t){l=t}},width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},tickFormat:{get:function(){return f},set:function(t){f=t}},ticks:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return h},set:function(t){h=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}},orient:{get:function(){return r},set:function(t){i="right"==(r=t)||"bottom"==r}}}),t.utils.inheritOptions(v,e),t.utils.initOptions(v),v},t.models.candlestickBar=function(){"use strict";var e,n,r,i,o,a={top:0,right:0,bottom:0,left:0},s=null,l=null,u=Math.floor(1e4*Math.random()),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(k){return k.each(function(k){e=d3.select(this);var w=t.utils.availableWidth(s,e,a),C=t.utils.availableHeight(l,e,a);t.utils.initSVG(e);var M=w/k[0].values.length*.45;c.domain(n||d3.extent(k[0].values.map(p).concat(x))),b?c.range(i||[.5*w/k[0].values.length,w*(k[0].values.length-.5)/k[0].values.length]):c.range(i||[5+M/2,w-M/2-5]),f.domain(r||[d3.min(k[0].values.map($).concat(y)),d3.max(k[0].values.map(m).concat(y))]).range(o||[C,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 L=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([k[0].values]),S=L.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar");S.attr("transform","translate("+a.left+","+a.top+")");var E=S.append("defs"),F=S.append("g");L.select("g");var W=F.append("g").attr("class","nv-ticks");e.on("click",function(t,e,n){A.call("chartClick",this,{data:e,index:e.index,pos:t,id:u})}),E.append("clipPath").attr("id","nv-chart-clip-path-"+u).append("rect").attr("width",w).attr("height",C),F.attr("clip-path",_?"url(#nv-chart-clip-path-"+u+")":"");var D=W.selectAll(".nv-tick").data(function(t){return t});D.exit().remove();var I=D.enter().append("g");I.attr("class",function(t,e,n){return(g(t,e)>v(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 t<c}))]),minmax:d3.max(a),stddev:d3.mean(a)+d3.deviation(a)},m=d3.median(a),$=d3.mean(a),x=[];void 0!==d3.beeswarm?(x=d3.beeswarm().data(t.map(function(t){return v(t)})).radius(N+1).orientation("vertical").side("symmetric").distributeOn(function(t){return h(t)}).arrange()).map(function(n,r){n.key=e,n.object_constancy=t[r].object_constancy,n.isOutlier=n.datum<p.iqr||n.datum>g.iqr,n.isOutlierStdDev=n.datum<p.stddev||n.datum>g.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:t<p.iqr||t>g.iqr,isOutlierStdDev:t<p.stddev||t>g.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[0].x&&r.unshift({x:n[0],y:r[0].y}),n[1]>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<i.length;a++)for(var s=0;s<K.length;s++)o.push(i[a]+"_"+K[s]);K=o,n=[],r.forEach(function(t){t.values.forEach(function(e){e.key=t.key+"_"+e.key}),n.push.apply(n,t.values)})}else n=d3.group().key(function(t){return g(t)}).rollup(function(t,n){return e(t)}).entries(t);return n}function Z(t){return F?j.find(function(e){return e.key==t}).values.map(function(t){return t.key}).sort(d3.ascending):t}function q(t){return"iqr"==L&&t.isOutlier||"stddev"==L&&t.isOutlierStdDev}var j,K=new Set,Q=[],U=[],J=t.utils.renderWatch(Y,H);function tt(f){return J.reset(),f.each(function(f){e=u-l.left-l.right,n=c-l.top-l.bottom,V=d3.select(this),t.utils.initSVG(V),h.domain(a||d3.extent(f.map(function(t){return v(t)}))).nice().range(s||[n,0]),void 0===j&&(j=R(f)),p.range(o||[0,e],.1).domain(i||F&&!T?K:j.map(function(t){return t.key}));var g=V.selectAll("g.nv-wrap").data([j]).enter().append("g").attr("class","nvd3 nv-wrap");g.watchTransition(J,"nv-wrap: wrap").attr("transform","translate("+l.left+","+l.top+")");var L,I=g.selectAll(".nv-distroplot-x-group").data(function(t){return t});I.each(function(t,e){d3.select(this).selectAll("line.nv-distroplot-middle").datum(t)}),L=I.enter().append("g").attr("class","nv-distroplot-x-group").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).style("fill",function(t,e){return m(t)||z(t,e)}).style("stroke",function(t,e){return m(t)||z(t,e)}),I.exit().remove();var O=function(){return p.bandwidth()},P=function(){return d3.min([X,.9*O()])},B=function(){return P()/2},H=function(){return B()-P()/2},G=function(){return B()+P()/2},Z=function(){return B()-P()/5},U=function(){return B()+P()/5};L.attr("transform",function(t){return"translate("+(p(t.key)+(O()-P())*.5)+", 0)"}),I.watchTransition(J,"nv-distroplot-x-group: distroplots").style("stroke-opacity",1).style("fill-opacity",.5).attr("transform",function(t){return"translate("+(p(t.key)+(O()-P())*.5)+", 0)"}),Q.map(function(t){t.range([P()/2,0])}),r||(D=!1,M||(M="random")),L.each(function(t,e){var n=d3.select(this);[_,k].forEach(function(t){var e=t===_?"low":"high";n.append("line").style("opacity",function(){return S?"1":"0"}).attr("class","nv-distroplot-whisker nv-distroplot-"+e),n.append("line").style("opacity",function(){return S?"0":"1"}).attr("class","nv-distroplot-tick nv-distroplot-"+e)})}),[_,k].forEach(function(t){var e=t===_?"low":"high",n=t===_?$:y;I.select("line.nv-distroplot-whisker.nv-distroplot-"+e).watchTransition(J,"nv-distroplot-x-group: distroplots").attr("x1",B()).attr("y1",function(e){return"violin"!=r?h(t(e)):h(x(e))}).attr("x2",B()).attr("y2",function(t){return"box"==r?h(n(t)):h(x(t))}).style("opacity",function(){return S?"0":"1"}),I.select("line.nv-distroplot-tick.nv-distroplot-"+e).watchTransition(J,"nv-distroplot-x-group: distroplots").attr("x1",function(t){return"violin"!=r?Z():B()}).attr("y1",function(e,n){return"violin"!=r?h(t(e)):h(x(e))}).attr("x2",function(t){return"violin"!=r?U():B()}).attr("y2",function(e,n){return"violin"!=r?h(t(e)):h(x(e))}).style("opacity",function(){return S?"0":"1"})}),[_,k].forEach(function(t){var e=t===_?"low":"high";L.selectAll(".nv-distroplot-"+e).on("mouseover",function(n,r,i,o){setCoordinates(n.pageX,n.pageY),d3.select(this.parentNode).selectAll("line.nv-distroplot-"+e).classed("hover",!0),Y.call("elementMouseover",this,{value:"low"==e?"Lower whisker":"Upper whisker",series:{key:t(r).toFixed(2),color:m(r)||z(r,o)},e:n})}).on("mouseout",function(n,r,i,o){d3.select(this.parentNode).selectAll("line.nv-distroplot-"+e).classed("hover",!1),Y.call("elementMouseout",this,{value:"low"==e?"Lower whisker":"Upper whisker",series:{key:t(r).toFixed(2),color:m(r)||z(r,o)},e:n})}).on("mousemove",function(t,e){Y.call("elementMousemove",this,{e:event})})}),L.each(function(t,e){var n=d3.select(this);["left","right"].forEach(function(t){["line","area"].forEach(function(e){n.append("path").attr("class","nv-distribution-"+e+" nv-distribution-"+t).attr("transform","rotate(90,0,0) translate(0,"+("left"==t?-P():0)+")"+("left"==t?"":" scale(1,-1)"))})}),L.selectAll(".nv-distribution-line").style("fill","none"),L.selectAll(".nv-distribution-area").style("stroke","none").style("opacity",.7)}),I.each(function(t,e){var n,i,o,a,s,l,u,c,f=d3.select(this),p="box"==r?(n=H(),i=Z(),o=B(),a=t,c="mean"==W?b(a):x(a),u=E?[{x:o,y:h($(a))},{x:n,y:h($(a))},{x:n,y:h((s=a,("mean"==W?b(s):x(s))-s.values.notch))},{x:i,y:h(c)},{x:n,y:h((l=a,("mean"==W?b(l):x(l))+l.values.notch))},{x:n,y:h(y(a))},{x:o,y:h(y(a))},]:[{x:o,y:h($(a))},{x:n,y:h($(a))},{x:n,y:h(c)},{x:n,y:h(c)},{x:n,y:h(c)},{x:n,y:h(y(a))},{x:o,y:h(y(a))},]):t.values.kde;f.selectAll("path").datum(p);var g=Q[e],v="box"==r?d3.curveLinear:d3.curveBasis;"box"==r||"violin"==r?["left","right"].forEach(function(t){I.selectAll(".nv-distribution-line.nv-distribution-"+t).attr("d",d3.line().x(function(t){return"box"==r?t.y:h(t.x)}).y(function(t){return"box"==r?t.x:g(t.y)}).curve(v)).attr("transform","rotate(90,0,0) translate(0,"+("left"==t?-P():0)+")"+("left"==t?"":" scale(1,-1)")).style("opacity",r?"1":"0"),I.selectAll(".nv-distribution-area.nv-distribution-"+t).attr("d",d3.area().x(function(t){return"box"==r?t.y:h(t.x)}).y(function(t){return"box"==r?t.x:g(t.y)}).y0(P()/2).curve(v)).attr("transform","rotate(90,0,0) translate(0,"+("left"==t?-P():0)+")"+("left"==t?"":" scale(1,-1)")).style("opacity",r?"1":"0")}):(I.selectAll(".nv-distribution-area").watchTransition(J,"nv-distribution-area: distroplots").style("opacity",r?"1":"0"),I.selectAll(".nv-distribution-line").watchTransition(J,"nv-distribution-line: distroplots").style("opacity",r?"1":"0"))}),I.selectAll("path").on("mouseover",function(t,e,n,r){setCoordinates(t.pageX,t.pageY),e=d3.select(this.parentNode).datum(),d3.select(this).classed("hover",!0),Y.call("elementMouseover",this,{key:e.key,value:"Group "+e.key+" stats",series:[{key:"max",value:A(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q3",value:y(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q2",value:x(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q1",value:$(e).toFixed(2),color:m(e)||z(e,r)},{key:"min",value:w(e).toFixed(2),color:m(e)||z(e,r)},{key:"mean",value:b(e).toFixed(2),color:m(e)||z(e,r)},{key:"std. dev.",value:C(e).toFixed(2),color:m(e)||z(e,r)},{key:"count",value:e.values.count,color:m(e)||z(e,r)},{key:"num. outliers",value:e.values.num_outlier,color:m(e)||z(e,r)},],data:e,index:e.index,e:t})}).on("mouseout",function(t,e,n,r){d3.select(this).classed("hover",!1),e=d3.select(this.parentNode).datum(),Y.call("elementMouseout",this,{key:e.key,value:"Group "+e.key+" stats",series:[{key:"max",value:A(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q3",value:y(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q2",value:x(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q1",value:$(e).toFixed(2),color:m(e)||z(e,r)},{key:"min",value:w(e).toFixed(2),color:m(e)||z(e,r)},{key:"mean",value:b(e).toFixed(2),color:m(e)||z(e,r)},{key:"std. dev.",value:C(e).toFixed(2),color:m(e)||z(e,r)},{key:"count",value:e.values.count,color:m(e)||z(e,r)},{key:"num. outliers",value:e.values.num_outlier,color:m(e)||z(e,r)},],data:e,index:e.index,e:t})}).on("mousemove",function(t,e,n){Y.call("elementMousemove",this,{e:t})}),L.append("line").attr("class",function(t){return"nv-distroplot-middle"}),I.selectAll("line.nv-distroplot-middle").watchTransition(J,"nv-distroplot-x-group: distroplots line").attr("x1",E?Z:"violin"!=r?H:Z()).attr("y1",function(t,e,n){return"mean"==W?h(b(t)):h(x(t))}).attr("x2",E?U:"violin"!=r?G:U()).attr("y2",function(t,e){return"mean"==W?h(b(t)):h(x(t))}).style("opacity",W?"1":"0"),I.selectAll(".nv-distroplot-middle").on("mouseover",function(t,e,n,r){if(setCoordinates(t.pageX,t.pageY),0!=d3.select(this).style("opacity")){var i=d3.select(this.parentNode).style("fill");d3.select(this).classed("hover",!0),Y.call("elementMouseover",this,{value:"mean"==W?"Mean":"Median",series:{key:"mean"==W?b(e).toFixed(2):x(e).toFixed(2),color:i},e:t})}}).on("mouseout",function(t,e,n,r){if(0!=d3.select(this).style("opacity")){d3.select(this).classed("hover",!1);var i=d3.select(this.parentNode).style("fill");Y.call("elementMouseout",this,{value:"mean"==W?"Mean":"Median",series:{key:"mean"==W?b(e).toFixed(2):x(e).toFixed(2),color:i},e:t})}}).on("mousemove",function(t,e,n){Y.call("elementMousemove",this,{e:t})});var tt=I.selectAll("g.nv-distroplot-observation").data(function(t){var e;return(e=t).values.observations},function(t){return t.object_constancy}),te=tt.enter().append("g").attr("class","nv-distroplot-observation");te.append("circle").style({opacity:0}),te.append("line").style("stroke-width",1).style({stroke:d3.rgb(85,85,85),opacity:0}),tt.exit().remove(),tt.attr("class",function(t){return"nv-distroplot-observation "+(q(t)&&"box"==r?"nv-distroplot-outlier":"nv-distroplot-non-outlier")}),"line"==M?I.selectAll("g.nv-distroplot-observation line").watchTransition(J,"nv-distrolot-x-group: nv-distoplot-observation").attr("x1",Z()+P()/4).attr("x2",U()-P()/4).attr("y1",function(t){return h(t.datum)}).attr("y2",function(t){return h(t.datum)}):(I.selectAll("g.nv-distroplot-observation circle").watchTransition(J,"nv-distroplot: nv-distroplot-observation").attr("cy",function(t){return h(t.datum)}).attr("r",N),I.selectAll("g.nv-distroplot-observation circle").watchTransition(J,"nv-distroplot: nv-distroplot-observation").attr("cx",function(t){return"swarm"==M?t.x+P()/2:"random"==M?P()/2+t.randX*P()/2:P()/2})),!1!==M&&(D?(I.selectAll(".nv-distroplot-outlier "+("line"==M?"line":"circle")).watchTransition(J,"nv-distroplot: nv-distroplot-observation").style("opacity",1),I.selectAll(".nv-distroplot-non-outlier "+("line"==M?"line":"circle")).watchTransition(J,"nv-distroplot: nv-distroplot-observation").style("opacity",0)):I.selectAll("line"==M?"line":"circle").watchTransition(J,"nv-distroplot: nv-distroplot-observation").style("opacity",1)),I.selectAll(".nv-distroplot-observation"+("line"==M?" circle":" line")).watchTransition(J,"nv-distroplot: nv-distoplot-observation").style("opacity",0),I.selectAll(".nv-distroplot-observation").on("mouseover",function(t,e,n,i){setCoordinates(t.pageX,t.pageY);var o=d3.select(this);if(!D||"box"!=r||q(e)){var a=d3.select(this.parentNode).style("fill");o.classed("hover",!0),Y.call("elementMouseover",this,{value:"box"==r&&q(e)?"Outlier":"Observation",series:{key:e.datum.toFixed(2),color:a},e:t})}}).on("mouseout",function(t,e,n,i){var o=d3.select(this),a=d3.select(this.parentNode).style("fill");o.classed("hover",!1),Y.call("elementMouseout",this,{value:"box"==r&&q(e)?"Outlier":"Observation",series:{key:e.datum.toFixed(2),color:a},e:t})}).on("mousemove",function(t,e,n){Y.call("elementMousemove",this,{e:t})})}),J.renderEnd("nv-distroplot-x-group immediate"),tt}return tt.dispatch=Y,tt.options=t.utils.optionsFunc.bind(tt),tt._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},maxBoxWidth:{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}},plotType:{get:function(){return r},set:function(t){r=t}},observationType:{get:function(){return M},set:function(t){M=t}},whiskerDef:{get:function(){return L},set:function(t){L=t}},notchBox:{get:function(){return E},set:function(t){E=t}},hideWhiskers:{get:function(){return S},set:function(t){S=t}},colorGroup:{get:function(){return F},set:function(t){F=t}},centralTendency:{get:function(){return W},set:function(t){W=t}},bandwidth:{get:function(){return O},set:function(t){O=t}},clampViolin:{get:function(){return P},set:function(t){P=t}},resolution:{get:function(){return B},set:function(t){B=t}},xScale:{get:function(){return p},set:function(t){p=t}},yScale:{get:function(){return h},set:function(t){h=t}},showOnlyOutliers:{get:function(){return D},set:function(t){D=t}},jitter:{get:function(){return I},set:function(t){I=t}},squash:{get:function(){return T},set:function(t){T=t}},pointSize:{get:function(){return N},set:function(t){N=t}},xDomain:{get:function(){return i},set:function(t){i=t}},yDomain:{get:function(){return a},set:function(t){a=t}},xRange:{get:function(){return o},set:function(t){o=t}},yRange:{get:function(){return s},set:function(t){s=t}},recalcData:{get:function(){j=R(V.datum())}},itemColor:{get:function(){return m},set:function(t){m=t}},id:{get:function(){return f},set:function(t){f=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 z},set:function(e){z=t.utils.getColor(e)}},duration:{get:function(){return H},set:function(t){H=t,J.reset(H)}}}),t.utils.initOptions(tt),tt},t.models.distroPlotChart=function(){"use strict";var e,n,r,i=t.models.distroPlot(),o=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),a=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),s={top:25,right:10,bottom:40,left:60},l=null,u=null,c=t.utils.getColor(),f=!0,p=!0,h=!1,g=!1,v=!1,m=!1,$=t.models.tooltip(),x="No Data Available.",y=d3.dispatch("stateChange","beforeUpdate","renderEnd"),b=500,_=d3.transition().duration(b).ease(d3.easeLinear);o.showMaxMin(!1).tickFormat(function(t){return t}),a.tickFormat(d3.format(",.1f")),$.duration(0);var k,w,A,C,M,L,S=t.utils.renderWatch(y,b);function E(t,e){var n=Object.getOwnPropertyNames(t),r=Object.getOwnPropertyNames(e);if(n.length!=r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i];if(t[o]!==e[o])return!1}return!0}function F(c){return S.reset(),S.models(i),f&&S.models(o),p&&S.models(a),c.each(function(c){var v=d3.select(this),m=this;t.utils.initSVG(v);var $=(l||parseInt(v.style("width"))||960)-s.left-s.right,_=(u||parseInt(v.style("height"))||400)-s.top-s.bottom;if(void 0===e&&(e=JSON.parse(JSON.stringify(c))),F.update=function(){y.call("beforeUpdate",m);var t,n=i.options();(k!==n.colorGroup()||w!==n.x()||A!==n.y()||M!==n.bandwidth()||C!==n.resolution()||L!==n.clampViolin()||!function t(e,n){if(e.length!==n.length)return!1;for(var r=e.length;r--;)if("object_constancy"in e[r]&&delete e[r].object_constancy,"object_constancy"in n[r]&&delete n[r].object_constancy,!E(e[r],n[r]))return!1;return!0}(t=c,e)&&(e=JSON.parse(JSON.stringify(t)),1))&&i.recalcData(),v.transition().duration(b).call(F)},F.container=this,"function"!=typeof d3.beeswarm&&"swarm"==F.options().observationType())return s.left,x='Please include the library https://github.com/Kcnarf/d3-beeswarm to use "swarm".',t.utils.noData(F,v),F;if(!c||!c.length)return t.utils.noData(F,v),F;v.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale().clamp(!0);var W=v.selectAll("g.nv-wrap.nv-distroPlot").data([c]),D=W.enter().append("g").attr("class","nvd3 nv-wrap nv-distroPlot").append("g"),I=D.append("defs"),T=W.select("g");if(D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),D.append("g").attr("class","nv-distroWrap"),D.attr("transform","translate("+s.left+","+s.top+")"),T.watchTransition(S,"nv-wrap: wrap").attr("transform","translate("+s.left+","+s.top+")"),h&&T.select(".nv-y.nv-axis").attr("transform","translate("+$+",0)"),i.width($).height(_),T.select(".nv-distroWrap").datum(c).transition().call(i),I.append("clipPath").attr("id","nv-x-label-clip-"+i.id()).append("rect").attr("width",n.range()*(g?2:1)).attr("height",16).attr("x",-n.range()/(g?1:2)),f){o.scale(n)._ticks(t.utils.calcTicksX($/100,c)),o.tickSizeInner(-_),T.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),T.select(".nv-x.nv-axis").call(o);var O=T.select(".nv-x.nv-axis").select("g.nvd3.nv-wrap.nv-axis").selectAll("g");g&&O.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})}p&&(a.scale(r)._ticks(Math.floor(_/36)),a.tickSizeInner(-$),T.select(".nv-y.nv-axis").call(a)),T.select(".nv-zeroLine line").attr("x1",0).attr("x2",$).attr("y1",r(0)).attr("y2",r(0)),k=i.options().colorGroup(),w=i.options().x(),A=i.options().y(),M=i.options().bandwidth(),C=i.options().resolution(),L=i.options().clampViolin()}),S.renderEnd("nv-distroplot chart immediate"),F}return s.top,i.dispatch.on("elementMouseover.tooltip",function(t){$.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){$.data(t).hidden(!0)}),i.dispatch.on("elementMousemove.tooltip",function(t){$()}),F.dispatch=y,F.distroplot=i,F.xAxis=o,F.yAxis=a,F.tooltip=$,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}},staggerLabels:{get:function(){return g},set:function(t){g=t}},showXAxis:{get:function(){return f},set:function(t){f=t}},showYAxis:{get:function(){return p},set:function(t){p=t}},tooltipContent:{get:function(){return $},set:function(t){$=t}},noData:{get:function(){return x},set:function(t){x=t}},defaultState:{get:function(){return defaultState},set:function(t){defaultState=t}},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}},duration:{get:function(){return b},set:function(t){b=t,S.reset(b),_=d3.transition().duration(b).ease(d3.easeLinear),i.duration(b),o.duration(b),a.duration(b)}},color:{get:function(){return c},set:function(e){c=t.utils.getColor(e),i.color(c)}},rightAlignYAxis:{get:function(){return h},set:function(t){h=t,a.orient(t?"right":"left")}},xLabel:{get:function(){return v},set:function(t){v=t,o.axisLabel(v)}},yLabel:{get:function(){return m},set:function(t){m=t,a.axisLabel(m)}}}),t.utils.inheritOptions(F,i),t.utils.initOptions(F),F},t.models.focus=function(e){"use strict";var n,r,e=e||t.models.line(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=d3.brush(),s={top:10,right:0,bottom:30,left:0},l=t.utils.defaultColor(),u=null,c=70,f=!0,p=!1,h=!1,g=null,v=250,m=d3.transition().duration(v).ease(d3.easeLinear),$=d3.dispatch("brush","onBrush","renderEnd"),x=!0;e.interactive(!1),e.pointActive(function(t){return!1});var y=t.utils.renderWatch($,v);function b(m){return y.reset(),y.models(e),f&&y.models(i),p&&y.models(o),m.each(function(m){var y=d3.select(this);t.utils.initSVG(y);var _=t.utils.availableWidth(u,y,s),k=c-s.top-s.bottom;b.update=function(){0===v?y.call(b):y.transition().duration(v).call(b)},b.container=this,n=e.xScale(),r=e.yScale();var w=y.selectAll("g.nv-focus").data([m]).enter().append("g").attr("class","nvd3 nv-focus");w.attr("transform","translate("+s.left+","+s.top+")");var A=w.append("g"),C=A.append("g").attr("class","nv-background").append("rect"),M=A.append("g").attr("class","nv-x nv-axis");M=y.selectAll(".nv-focus").select(".nv-x.nv-axis");var L=A.append("g").attr("class","nv-y nv-axis");L=y.selectAll(".nv-focus").select(".nv-x.nv-axis");var S=A.append("g").attr("class","nv-contentWrap");S=y.selectAll(".nv-focus").select(".nv-contentWrap");var E=A.append("g").attr("class","nv-brushBackground");E=y.selectAll(".nv-focus").select(".nv-brushBackground");var F=A.append("g").attr("class","nv-x nv-brush");F=y.selectAll(".nv-focus").select(".nv-x.nv-brush"),h&&L.attr("transform","translate("+_+",0)"),C.attr("width",_).attr("height",k),e.width(_).height(k).color(m.map(function(t,e){return t.color||l(t,e)}).filter(function(t,e){return!m[e].disabled})),S.datum(m.filter(function(t){return!t.disabled})),S.transition().call(e),a.on("brush",function(){T(x)}),a.on("end",function(t){x||$.call("brush",this,null===t.selection?n.domain():a.extent())}),g&&a.extent(g);var W=E.selectAll("g").data([g||a.extent()]),D=W.enter().append("g");D.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",k),D.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",k).merge(A);var I=F.call(a);function T(t){g=a.extent().length?a.extent():null;var e=a.extent().length?a.extent():n.domain();$.call("brush",null,{extent:e,brush:a}),null!=g&&a.extent(g),W.data([null===g?n.domain():g]).each(function(t,e){var r=n(t[0])-n.range()[0],i=_-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)}),t&&$.call("brush",null,e)}I.selectAll("rect").attr("height",k),I.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)}).merge(A),T(!0),C.attr("width",_).attr("height",k).merge(A),f&&(i.scale(n)._ticks(t.utils.calcTicksX(_/100,m)),i.tickSizeInner(-k),M.attr("transform","translate(0,"+r.range()[0]+")"),M.transition().call(i)),p&&(o.scale(r)._ticks(t.utils.calcTicksY(k/36,m)),o.tickSizeInner(-_),L.call(o)),M.attr("transform","translate(0,"+r.range()[0]+")").merge(A)}),y.renderEnd("focus immediate"),b}return b.dispatch=$,b.content=e,b.brush=a,b.xAxis=i,b.yAxis=o,b.options=t.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},showXAxis:{get:function(){return f},set:function(t){f=t}},showYAxis:{get:function(){return p},set:function(t){p=t}},brushExtent:{get:function(){return g},set:function(t){g=t}},syncBrushing:{get:function(){return x},set:function(t){x=t}},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}},duration:{get:function(){return v},set:function(t){v=t,y.reset(v),m=d3.transition().duration(v).ease(d3.easeLinear),e.duration(v),i.duration(v),o.duration(v)}},color:{get:function(){return l},set:function(n){l=t.utils.getColor(n),e.color(l)}},interpolate:{get:function(){return e.interpolate()},set:function(t){e.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t)}},x:{get:function(){return e.x()},set:function(t){e.x(t)}},y:{get:function(){return e.y()},set:function(t){e.y(t)}},rightAlignYAxis:{get:function(){return h},set:function(t){h=t,o.orient(h?"right":"left")}}}),t.utils.inheritOptions(b,e),t.utils.initOptions(b),b},t.models.forceDirectedGraph=function(){"use strict";var e={top:2,right:0,bottom:2,left:0},n=400,r=32,i=null,o=d3.dispatch("renderEnd"),a=t.utils.getColor(["#000"]),s=t.models.tooltip(),l=null,u=.1,c=.5,f=30,p=-120,h=.1,g=.8,v=.3,m=5,$=function(t){},x=function(t){},y=function(){return 0},b=function(){return 0},_=t.utils.renderWatch(o);function k(o){return _.reset(),o.each(function(o){i=d3.select(this),t.utils.initSVG(i);var l=t.utils.availableWidth(n,i,e),h=t.utils.availableHeight(r,i,e);if(i.attr("width",l).attr("height",h),!o||!o.links||!o.nodes)return t.utils.noData(k,i),k;i.selectAll(".nv-noData").remove(),i.selectAll("*").remove();var g=new Set;o.nodes.forEach(function(t){Object.keys(t).forEach(function(t){g.add(t)})});var y=d3.forceSimulation().nodes(o.nodes).force("link",d3.forceLink(o.links).strength(u).distance(f)).force("center",d3.forceCenter(l/2,h/2)).force("charge",d3.forceManyBody().strength(p)).alphaTarget(v).velocityDecay(c),b=i.selectAll(".link").data(o.links).enter().append("line").attr("class","nv-force-link").style("stroke-width",function(t){return Math.sqrt(t.value)}),_=i.selectAll(".node").data(o.nodes).enter().append("g").attr("class","nv-force-node").call(d3.drag().on("start",function(t,e){t.sourceEvent.stopPropagation(),t.active||y.alphaTarget(v).restart(),e.fx=e.x,e.fy=e.y}).on("drag",function(t,e){e.fx=t.x,e.fy=t.y}).on("end",function(t,e){t.active||y.alphaTarget(v),e.fx=null,e.fy=null}));_.append("circle").attr("r",m).style("fill",function(t){return a(t)}).on("mouseover",function(t){i.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.py),i.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.px);var e=a(t);t.series=[],g.forEach(function(n){t.series.push({color:e,key:n,value:t[n]})}),s.data(t).hidden(!1)}).on("mouseout",function(t){s.hidden(!0)}),s.headerFormatter(function(t){return"Node"}),x(b),$(_),y.on("tick",function(){b.attr("x1",function(t){return t.source.x}).attr("y1",function(t){return t.source.y}).attr("x2",function(t){return t.target.x}).attr("y2",function(t){return t.target.y}),_.attr("transform",function(t){return"translate("+t.x+", "+t.y+")"})})}),k}return k.options=t.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},linkStrength:{get:function(){return u},set:function(t){u=t}},friction:{get:function(){return c},set:function(t){c=t}},linkDist:{get:function(){return f},set:function(t){f=t}},charge:{get:function(){return p},set:function(t){p=t}},gravity:{get:function(){return h},set:function(t){h=t}},theta:{get:function(){return g},set:function(t){g=t}},alpha:{get:function(){return v},set:function(t){v=t}},radius:{get:function(){return m},set:function(t){m=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}}},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)}},noData:{get:function(){return l},set:function(t){l=t}},nodeExtras:{get:function(){return $},set:function(t){$=t}},linkExtras:{get:function(){return x},set:function(t){x=t}}}),k.dispatch=o,k.tooltip=s,t.utils.initOptions(k),k},t.models.furiousLegend=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=28,c=!0,f=!0,p=!1,h=!1,g=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),v="classic";function m($){function x(t,e){return"furious"!=v?"#000":h?t.disengaged?a(t,e):"#fff":h?void 0:t.disabled?a(t,e):"#fff"}function y(t,e){return h&&"furious"==v?t.disengaged?"#fff":a(t,e):t.disabled?"#fff":a(t,e)}return $.each(function(m){var $=n-e.left-e.right,b=d3.select(this);t.utils.initSVG(b);var _=b.selectAll("g.nv-legend").data([m]).enter().append("g").attr("class","nvd3 nv-legend");_.attr("transform","translate("+e.left+","+e.top+")");var k=_.append("g").select("g"),w=b.selectAll("g.nv-legend").select("g").selectAll(".nv-series").data(function(t){return"furious"!=v?t:t.filter(function(t){return!!h||!t.disengaged})}),A=w.enter().append("g").attr("class","nv-series");if("classic"==v)O=A.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5).select("circle");else if("furious"==v){var C=A.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3);O=C.select("rect"),C.append("g").attr("class","nv-check-box").property("innerHTML",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)"),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<L.length;)F[S]=L[S],E+=L[S++];for(0===S&&(S=1);E>$&&S>1;){F=[],S--;for(var W=0;W<L.length;W++)L[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;I<S;I++)D[I]=T,T+=F[I];A.attr("transform",function(t,e){return"translate("+D[e%S]+","+(5+Math.floor(e/S)*P)+")"}),c?k.attr("transform","translate("+(n-e.right-E)+","+e.top+")"):k.attr("transform","translate(0,"+e.top+")"),r=e.top+e.bottom+Math.ceil(L.length/S)*P}else{var O,P,B,N=5,z=5,V=0;A.attr("transform",function(t,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return B=z,n<e.left+e.right+B+i&&(z=B=5,N+=P),(z+=i)>V&&(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'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+t.value+"</h3><table><tr><td>open:</td><td>"+e.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+e.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+e.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+e.yAxis.tickFormat()(n.low)+"</td></tr></table>"}),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'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+t.value+"</h3><table><tr><td>open:</td><td>"+e.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+e.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+e.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+e.yAxis.tickFormat()(n.low)+"</td></tr></table>"}),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",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)").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<S.length;)F[E]=S[E],L+=S[E++];for(0===E&&(E=1);L>$&&E>1;){F=[],E--;for(var W=0;W<S.length;W++)S[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;I<E;I++)D[I]=T,T+=F[I];C.attr("transform",function(t,e){return"translate("+D[e%E]+","+(5+Math.floor(e/E)*B)+")"}),c?w.attr("transform","translate("+(n-e.right-L)+","+e.top+")"):w.attr("transform","translate(0,"+e.top+")"),r=e.top+e.bottom+Math.ceil(S.length/E)*B}else{var O,P,B,N,z=5,V=5,Y=0;C.attr("transform",function(t,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return N=V,n<e.left+e.right+N+i&&(V=N=5,z+=B),(V+=i)>Y&&(Y=V),L<N+Y&&(L=N+Y),"translate("+N+","+z+")"}),w.attr("transform","translate("+(n-e.right-Y)+","+e.top+")"),r=e.top+e.bottom+z+15}"furious"==m&&(P.attr("width",function(t,e){return C.select("text.nv-legend-text").nodes()[e].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),w.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0),w.select(".nv-legend-bg").transition().duration(300).attr("x",-B).attr("width",L+B-12).attr("height",r+10).attr("y",-e.top-10).attr("opacity",g?1:0)),P.style("fill",b).style("fill-opacity",_).style("stroke",b)}),$}return $.dispatch=v,$.options=t.utils.optionsFunc.bind($),$._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}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return f},set:function(t){f=t}},enableDoubleClick:{get:function(){return p},set:function(t){p=t}},radioButtonMode:{get:function(){return h},set:function(t){h=t}},expanded:{get:function(){return g},set:function(t){g=t}},vers:{get:function(){return m},set:function(t){m=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($),$},t.models.line=function(){"use strict";var e,n,r=t.models.scatter(),i={top:0,right:0,bottom:0,left:0},o=960,a=500,s=null,l=1.5,u=t.utils.defaultColor(),c=function(t){return t.x},f=function(t){return t.y},p=function(t,e){return!isNaN(f(t,e))&&null!==f(t,e)},h=function(t){return t.area},g=!1,v=d3.curveLinear,m=(d3.curveBasis,250),$=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");r.pointSize(16).pointDomain([16,256]);var x,y,b=t.utils.renderWatch($,m);function _(m){return b.reset(),b.models(r),m.each(function(m){s=d3.select(this);var $=t.utils.availableWidth(o,s,i),_=t.utils.availableHeight(a,s,i);t.utils.initSVG(s),e=r.xScale(),n=r.yScale(),x=x||e,y=y||n;var k=s.selectAll("g.nv-wrap.nv-line").data([m]).enter().append("g").attr("class","nvd3 nv-wrap nv-line").attr("transform","translate("+i.left+","+i.top+")"),w=k.append("defs"),A=k.append("g");A.append("g").attr("class","nv-groups"),A.append("g").attr("class","nv-scatterWrap");var C=s.select(".nv-scatterWrap");r.width($).height(_),C.call(r),w.append("clipPath").attr("id","nv-edge-clip-"+r.id()).append("rect").attr("width",$).attr("height",_>0?_: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<e;t++){var n=O[t];try{n.clearHighlights()}catch(r){}}}S.yDomain(b.domain()),G.length&&te.transition().call(L),R.length&&tn.transition().call(S),H.length&&tr.transition().call(C),X.length&&ti.transition().call(M),N.length&&ts.transition().call(_),z.length&&tl.transition().call(k),V.length&&to.transition().call(w),Y.length&&ta.transition().call(A),E._ticks(t.utils.calcTicksX($/100,u)),E.tickSizeInner(-B),U.attr("transform","translate(0,"+B+")"),U.transition().call(E),F._ticks(t.utils.calcTicksY(B/36,u)),F.tickSizeInner(-$),J.transition().call(F),W._ticks(t.utils.calcTicksY(B/36,u)),W.tickSizeInner(-$),tt.transition().call(W),J.classed("nv-disabled",!Z.length).attr("transform","translate("+x.range()[0]+",0)"),tt.classed("nv-disabled",!q.length).attr("transform","translate("+x.range()[1]+",0)"),D.dispatch.on("stateChange",function(t){T.call("stateChange",this,t),P.update()}),v&&(g.width($).height(B).margin({left:r.left,top:r.top}).svgContainer(h).xScale(x),tc.call(g)),v?(g.dispatch.on("elementMousemove",function(e){tk();var n,r,i,a=[];u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(s,l){var u=x.domain(),c=s.values.filter(function(t,e){return P.x()(t,e)>=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=r<o[0].extent[1]?o[0].extent[1]:r):o[0].hasNaN&&(r=r<o[0].extent[1]?o[0].extent[1]:r,W[t]=c[t].domain()[1],D=!0)),c[t]=d3.scaleLinear().domain([n,r]).range([(l-12)*.9,0]),b=[],c[t].brush=d3.brush().on("start",K).on("brush",Q).on("end",U)});var T=S.selectAll("g.nv-wrap.nv-parallelCoordinates").data([C]).enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates");T.attr("transform","translate("+i.left+","+i.top+")");var O=T.append("g"),P=T.select("g"),B=O.append("g").attr("class","nv-parallelCoordinates background"),N=O.append("g").attr("class","nv-parallelCoordinates foreground"),z=O.append("g").attr("class","nv-parallelCoordinates missingValuesline");k.curve(d3.curveCardinal.tension(_));var V=d3.drag().on("start",function t(e){y[e.key]=this.parentNode.__origin__=u(e.key),n.attr("visibility","hidden")}).on("drag",function t(n,i){y[i.key]=Math.min(s,Math.max(0,this.parentNode.__origin__+=n.x)),e.attr("d",q),h.sort(function(t,e){return tt(t.key)-tt(e.key)}),h.forEach(function(t,e){return t.currentPosition=e}),u.domain(h.map(function(t){return t.key})),r.attr("transform",function(t){return"translate("+tt(t.key)+")"})}).on("end",function t(r,i){delete this.parentNode.__origin__,delete y[r.key],d3.select(this.parentNode).attr("transform","translate("+u(r.key)+")"),e.attr("d",q),n.attr("d",q).attr("visibility",null),A.call("dimensionsOrder",this,h)}),Y=u.range()[1]-u.range()[0];if(Y=isNaN(Y)?u.range()[0]:Y,!isNaN(Y)){var H=[0+Y/2,l-12,s-Y/2,l-12];(M=z.selectAll("line").data([H])).enter().append("line"),M.exit().remove(),M.attr("x1",function(t){return t[0]}).attr("y1",function(t){return t[1]}).attr("x2",function(t){return t[2]}).attr("y2",function(t){return t[3]}),(L=z.selectAll("text").data([f])).append("text").data([f]),L.enter().append("text"),L.exit().remove(),L.attr("y",l).attr("x",s-92-Y/2).text(function(t){return t})}(n=B.selectAll("path").data(C)).enter().append("path"),n.exit().remove(),n.attr("d",q),(e=N.selectAll("path").data(C)).enter().append("path"),e.exit().remove(),e.attr("d",q).style("stroke-width",function(t,e){return isNaN(t.strokeWidth)&&(t.strokeWidth=1),t.strokeWidth}).attr("stroke",function(t,e){return t.color||m(t,e)}),e.on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0).style("stroke-width",e.strokeWidth+2+"px").style("stroke-opacity",1),A.call("elementMouseover",this,{label:e.name,color:e.color||m(e,n),values:e.values,dimensions:h})}),e.on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1).style("stroke-width",e.strokeWidth+"px").style("stroke-opacity",.7),A.call("elementMouseout",this,{label:e.name,index:e.index})}),e.on("mousemove",function(t,e){A.call("elementMousemove",this)}),e.on("click",function(t){A.call("elementClick",this,{id:t.id})});var X=(r=P.selectAll(".dimension").data(h)).enter().append("g").attr("class","nv-parallelCoordinates dimension");r.attr("transform",function(t){return"translate("+u(t.key)+",0)"}),X.append("g").attr("class","nv-axis"),X.append("text").attr("class","nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),A.call("elementMouseover",this,{label:e.tooltip||e.key,color:e.color})}).on("mouseout",function(t,e){A.call("elementMouseout",this,{label:t.tooltip})}).on("mousemove",function(t,e){A.call("elementMousemove",this)}).call(V),X.append("g").attr("class","nv-brushBackground"),r.exit().remove(),r.select(".nv-label").text(function(t){return t.key}),j(v);var G=g.filter(function(t){return null!==event.selection}),R=G.map(function(t){return c[t].brush.extent()}),Z=x.slice(0);function q(t){return k(h.map(function(e){if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key]))||D){var n=c[e.key].domain(),r=c[e.key].range(),i=n[0]-(n[1]-n[0])/9;if(0>b.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.dimension].domain()[0]&&(t.hasOnlyNaN=!0)}),A.call("end",x,t)}function J(){r.select(".nv-axis").each(function(t,e){var n=$.filter(function(e){return e.dimension==t.key});I[t.key]=c[t.key].domain(),0!=n.length&&v&&(I[t.key]=[],n[0].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='<table><thead><tr><td class="legend-color-guide"><div style="background-color:'+t.color+'"></div></td><td><strong>'+t.key+"</strong></td></tr></thead>";return 0!==t.series.length&&(e+='<tbody><tr><td height ="10px"></td></tr>',t.series.forEach(function(t){e=e+'<tr><td class="legend-color-guide"><div style="background-color:'+t.color+'"></div></td><td class="key">'+t.key+'</td><td class="value">'+t.value+"</td></tr>"}),e+="</tbody>"),e+="</table>"}),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<M.length;z++)O.push(B),P.push(N);else $?(O=L.map(function(t){return(t.outer-t.outer/10)*T}),P=L.map(function(t){return(t.inner-t.inner/10)*T}),A=d3.min(L.map(function(t){return t.inner-t.inner/10}))):(O=L.map(function(t){return t.outer*T}),P=L.map(function(t){return t.inner*T}),A=d3.min(L.map(function(t){return t.inner})));t.utils.initSVG(s);var V=s.selectAll(".nv-wrap.nv-pie").data([M]),Y=V.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+a);V=V.merge(Y);var H=Y.append("g");V.select("g");var X=H.append("g").attr("class","nv-pie");X=s.selectAll(".nv-wrap.nv-pie").selectAll(".nv-pie");var G=H.append("g").attr("class","nv-pieLabels");G=s.selectAll(".nv-wrap.nv-pie").selectAll(".nv-pieLabels"),V.attr("transform","translate("+e.left+","+e.top+")"),X.attr("transform","translate("+D/2+","+I/2+")"),G.attr("transform","translate("+D/2+","+I/2+")"),s.on("click",function(t,e,n){S.call("chartClick",this,{data:e,index:e.index,pos:t,id:a})}),E=[],F=[];for(var z=0;z<M.length;z++){var R=d3.arc().outerRadius(O[z]),Z=d3.arc().outerRadius(O[z]+5);!1!==b&&(R.startAngle(b),Z.startAngle(b)),!1!==k&&(R.endAngle(k),Z.endAngle(k)),v&&(R.innerRadius(P[z]),Z.innerRadius(P[z])),R.cornerRadius&&w&&(R.cornerRadius(w),Z.cornerRadius(w)),E.push(R),F.push(Z)}var q=d3.pie().sort(null).value(function(t){return t.disabled?0:o(t)});q.padAngle&&_&&q.padAngle(_),v&&m&&(X.select(".nv-pie-title").empty()&&X.append("text").attr("class","nv-pie-title"),V.select(".nv-pie-title").style("text-anchor","middle").text(function(t){return m}).style("font-size",Math.min(D,I)*A*2/(m.length+2)+"px").attr("dy","0.35em").attr("transform",function(t,e){return"translate(0, "+x+")"}));var j=s.select(".nv-wrap.nv-pie").selectAll(".nv-pie").selectAll(".nv-slice").data(q(M)),K=s.select(".nv-wrap.nv-pie").selectAll(".nv-pieLabels").selectAll(".nv-label").data(q(M.filter(function(t){return!t.disabled}))),Q=j.enter().append("g");if(Q.attr("class","nv-slice"),j.exit().remove(),K.exit().remove(),Q.on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0),$&&d3.select(this).select("path").transition().duration(70).attr("d",F[e.index]),S.call("elementMouseover",this,{data:e.data,index:e.index,color:d3.select(this).style("fill"),percent:(e.endAngle-e.startAngle)/(2*Math.PI)})}),Q.on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),$&&d3.select(this).select("path").transition().duration(50).attr("d",E[e.index]),S.call("elementMouseout",this,{data:e.data,index:e.index})}),Q.on("mousemove",function(t,e,n){S.call("elementMousemove",this,{data:e.data,index:e.index})}),Q.on("click",function(t,e,n){S.call("elementClick",this,{data:e.data,index:e.index,color:d3.select(this).style("fill"),event:t,element:this})}),Q.on("dblclick",function(t,e,n){S.call("elementDblClick",this,{data:e.data,index:e.index,color:d3.select(this).style("fill")})}),(Q=j.merge(Q)).attr("fill",function(t,e){return l(t.data,e)}),Q.attr("stroke",function(t,e){return l(t.data,e)}),Q.append("path").each(function(t){this._current=t}),Q.select("path").transition().duration(C).attr("d",function(t,e){return E[e](t)}).attrTween("d",function t(e,n){e.endAngle=isNaN(e.endAngle)?0:e.endAngle,e.startAngle=isNaN(e.startAngle)?0:e.startAngle,v||(e.innerRadius=0);var r=d3.interpolate(this._current,e);return this._current=r(0),function(t){return E[n](r(t))}}),c){for(var U=[],z=0;z<M.length;z++)U.push(E[z]),f?v&&(U[z]=d3.arc().outerRadius(E[z].outerRadius()),!1!==b&&U[z].startAngle(b),!1!==k&&U[z].endAngle(k)):v||U[z].innerRadius(0);K.enter().append("g").classed("nv-label",!0);var J=s.select(".nv-wrap.nv-pie").selectAll(".nv-pieLabels").selectAll(".nv-label").each(function(t,e){var n=d3.select(this);n.attr("transform",function(t,e){if(!y)return t.outerRadius=T+10,t.innerRadius=T+15,"translate("+U[e].centroid(t)+")";t.outerRadius=O[e]+10,t.innerRadius=O[e]+15;var n=(t.startAngle+t.endAngle)/2*(180/Math.PI);return(t.startAngle+t.endAngle)/2<Math.PI?n-=90:n+=90,"translate("+U[e].centroid(t)+") rotate("+n+")"}),n.append("rect"),s.select(".nv-wrap.nv-pie").selectAll(".nv-pieLabels").select("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),n.append("text"),s.select(".nv-wrap.nv-pie").selectAll(".nv-pieLabels").select("text").style("text-anchor",y?(t.startAngle+t.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")}),tt={},te=function(t){return 140*Math.floor(t[0]/140)+","+14*Math.floor(t[1]/14)},tn=function(t){return(t.endAngle-t.startAngle)/(2*Math.PI)};J.watchTransition(W,"pie labels").attr("transform",function(t,e){if(y){t.outerRadius=O[e]+10,t.innerRadius=O[e]+15;var n=(t.startAngle+t.endAngle)/2*(180/Math.PI);return(t.startAngle+t.endAngle)/2<Math.PI?n-=90:n+=90,"translate("+U[e].centroid(t)+") rotate("+n+")"}t.outerRadius=T+10,t.innerRadius=T+15;var r=U[e].centroid(t),i=tn(t);return t.value&&i>=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)/2<Math.PI?"start":"end":"middle"}).text(function(t,e){var n=tn(t),r="";if(!t.value||n<h)return"";if("function"==typeof p)r=p(t,e,{key:String(i(t.data)).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2"),value:String(o(t.data)).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2"),percent:u(n)});else switch(p){case"key":r=i(t.data).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2");break;case"value":r=u(o(t.data)).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2");break;case"percent":r=d3.format(".0%")(n).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2")}return r}),g&&J.each(function(e,n){if(this.getBBox){var r=this.getBBox(),i=U[n].centroid(e),o={x:i[0]+r.x,y:i[1]+r.y},a={x:o.x+r.width,y:o.y},s={x:o.x,y:o.y+r.height},l={x:o.x+r.width,y:o.y+r.height};e.visible=t.utils.pointIsInArc(o,e,R)&&t.utils.pointIsInArc(a,e,R)&&t.utils.pointIsInArc(s,e,R)&&t.utils.pointIsInArc(l,e,R)}}).style("display",function(t){return t.visible?null:"none"}),J.merge(K)}function tr(t){var e=(t.startAngle+t.endAngle)*90/Math.PI-90;return e>90?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();$/2<A&&(A=$/2),n.height(y).key(e.x()),n.width(A),$-=n.width(),w.datum(r).call(n).attr("transform","translate("+$+",0)")}else"bottom"===c&&(n.width($).key(e.x()),w.datum(r).call(n),i.bottom=n.height(),y=t.utils.availableHeight(s,f,i),w.attr("transform","translate(0,"+y+")"))}else w.selectAll("*").remove();b.attr("transform","translate("+i.left+","+i.top+")"),e.width($).height(y);var C=f.select(".nv-pieChart").selectAll(".nv-pieWrap").data([r]);(C=C.merge(k)).transition().call(e),n.dispatch.on("stateChange",function(t){for(var e in t)p[e]=t[e];m.call("stateChange",this,t),x.update()}),m.on("changeState",function(t){void 0!==t.disabled&&(r.forEach(function(e,n){e.disabled=t.disabled[n]}),p.disabled=t.disabled),x.update()})}),$.renderEnd("pieChart immediate"),x}return e.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:x.x()(t.data),value:x.y()(t.data),color:t.color,percent:t.percent},l||(delete t.percent,delete t.series.percent),r.data(t).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){r.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(t){r()}),x.legend=n,x.dispatch=m,x.pie=e,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}},noData:{get:function(){return g},set:function(t){g=t}},showTooltipPercent:{get:function(){return l},set:function(t){l=t}},showLegend:{get:function(){return u},set:function(t){u=t}},legendPosition:{get:function(){return c},set:function(t){c=t}},defaultState:{get:function(){return h},set:function(t){h=t}},color:{get:function(){return f},set:function(t){f=t,n.color(f),e.color(f)}},duration:{get:function(){return v},set:function(t){v=t,$.reset(v),e.duration(v)}},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}}}),t.utils.inheritOptions(x,e),t.utils.initOptions(x),x},t.models.sankey=function(){"use strict";var e={},n=24,r=8,i=[1,1],o=[],a=[],s=!0,l=function(t){o.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),a.forEach(function(t){var e=t.source,n=t.target;"number"==typeof e&&(e=t.source=o[t.source]),"number"==typeof n&&(n=t.target=o[t.target]),e.sourceLinks.push(t),n.targetLinks.push(t)}),o.forEach(function(t){t.value=Math.max(d3.sum(t.sourceLinks,g),d3.sum(t.targetLinks,g))}),function t(){for(var e,r,a,l=o,u=0;l.length&&u<o.length;)a=[],l.forEach(function(t){t.x=u,t.dx=n,t.sourceLinks.forEach(function(t){0>a.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;o<s;++o)(n=a-(e=t[o]).y)>0&&(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.x<r/2}).attr("x",6+n.nodeWidth()).attr("text-anchor","start")}),$}return $.options=t.utils.optionsFunc.bind($),$._options=Object.create({},{units:{get:function(){return s},set:function(t){s=t}},width:{get:function(){return r},set:function(t){r=t}},height:{get:function(){return i},set:function(t){i=t}},format:{get:function(){return c},set:function(t){c=t}},linkTitle:{get:function(){return p},set:function(t){p=t}},nodeWidth:{get:function(){return o},set:function(t){o=t}},nodePadding:{get:function(){return a},set:function(t){a=t}},center:{get:function(){return l},set:function(t){l=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}},nodeStyle:{get:function(){return{}},set:function(t){h=void 0!==t.fillColor?t.fillColor:h,g=void 0!==t.strokeColor?t.strokeColor:g,v=void 0!==t.title?t.title:v}}}),t.utils.initOptions($),$},t.models.scatter=function(){"use strict";var e,n,r,i,o,a,s,l,u={top:0,right:0,bottom:0,left:0},c=null,f=null,p=t.utils.defaultColor(),h=null,g=Math.floor(1e5*Math.random()),v=null,m=d3.scaleLinear(),$=d3.scaleLinear(),x=d3.scaleLinear(),y=function(t){return t.x},b=function(t){return t.y},_=function(t){return t.size||1},k=function(t){return t.shape||"circle"},w=[],A=[],C=[],M=!0,L=function(t){return!t.notActive},S=!1,E=.1,F=!1,W=!0,D=!1,I=function(){return 25},T=null,O=null,P=null,B=null,N=null,z=null,V=!1,Y=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),H=!0,X=250,G=300,R=!1,Z=!1,q=t.utils.renderWatch(Y,X),j=[16,256],K={};function Q(t){var e;delete K[e=t[0].series+":"+t[1]]}function U(t){var e,n,r,i,o,a,s=r=K[n=(e=t)[0].series+":"+e[1]]=K[n]||{},l=!1;for(i=1;i<arguments.length;i+=2)o=arguments[i],a=arguments[i+1](t[0],t[1]),s[o]===a&&s.hasOwnProperty(o)||(s[o]=a,l=!0);return l}function J(X){return q.reset(),X.each(function(X){v=d3.select(this);var K=t.utils.availableWidth(c,v,u),tt=t.utils.availableHeight(f,v,u);t.utils.initSVG(v),X.forEach(function(t,e){t.values.forEach(function(t){t.series=e,t.seriesIndex=e})});var te="function"==typeof J.yScale().base,tn=T&&O&&N?[]:d3.merge(X.map(function(t){return t.values.map(function(t,e){return{x:y(t,e),y:b(t,e),size:_(t,e)}})}));if(m.domain(T||d3.extent(tn.map(function(t){return t.x}).concat(w))),S&&X[0]?m.range(P||[(K*E+K)/(2*X[0].values.length),K-K*(1+E)/(2*X[0].values.length)]):m.range(P||[0,K]),te){var tr=d3.min(tn.map(function(t){if(0!==t.y)return t.y}));$.clamp(!0).domain(O||d3.extent(tn.map(function(t){return 0!==t.y?t.y:.1*tr}).concat(A))).range(B||[tt,0])}else $.domain(O||d3.extent(tn.map(function(t){return t.y}).concat(A))).range(B||[tt,0]);x.domain(N||d3.extent(tn.map(function(t){return t.size}).concat(C))).range(z||j),V=m.domain()[0]===m.domain()[1]||$.domain()[0]===$.domain()[1],m.domain()[0]===m.domain()[1]&&(m.domain()[0]?m.domain([m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]):m.domain([-1,1])),$.domain()[0]===$.domain()[1]&&($.domain()[0]?$.domain([$.domain()[0]-.01*$.domain()[0],$.domain()[1]+.01*$.domain()[1]]):$.domain([-1,1])),isNaN(m.domain()[0])&&m.domain([-1,1]),isNaN($.domain()[0])&&$.domain([-1,1]),e=e||m,n=n||$,r=r||x;var ti=m(1)!==e(1)||$(1)!==n(1)||x(1)!==r(1);a=a||c,s=s||f;var to=a!==c||s!==f,ta=(i=i||[])[0]!==m.domain()[0]||i[1]!==m.domain()[1];i=m.domain(),o=o||[],ta=ta||o[0]!==$.domain()[0]||o[1]!==$.domain()[1],o=$.domain();var ts=v.selectAll("g.nv-wrap.nv-scatter").data([X]),tl=ts.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+g);tl.classed("nv-single-point",V);var tu=tl.append("defs"),tc=tl.append("g");tc.append("g").attr("class","nv-groups");var td=tc.append("g").attr("class","nv-point-paths"),tf=tl.append("g").attr("class","nv-point-clips");function tp(){if(Z=!1,!M)return!1;if(v.selectAll(".nv-point.hover").classed("hover",!1),td.selectAll("path").remove(),!0===H){var e=d3.merge(X.map(function(e,n){return e.values.map(function(e,r){var i=y(e,r),o=b(e,r);return[t.utils.NaNtoZero(m(i))+1e-4*Math.random(),t.utils.NaNtoZero($(o))+1e-4*Math.random(),n,r,e]}).filter(function(t,e){return L(t[4],e)})}));if(0==e.length)return!1;e.length<3&&(e.push([m.range()[0]-20,$.range()[0]-20,null,null]),e.push([m.range()[1]+20,$.range()[1]+20,null,null]),e.push([m.range()[0]-20,$.range()[0]+20,null,null]),e.push([m.range()[1]+20,$.range()[1]-20,null,null]));var n=[[-10,-10],[-10,f+10],[c+10,f+10],[c+10,-10]];e=e.sort(function(t,e){return t[0]-e[0]||t[1]-e[1]});for(var r=0;r<e.length-1;)1e-4>Math.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;a<e.length;a++)Math.abs(r.x()(e[a],a)-n)<i&&(i=Math.abs(r.x()(e[a],a)-n),o=a);return o}(g,Math.round(e.invert(o)))],E()}}).on("click",function(){l=!l}).on("mouseout",function(){s=[],E()});function E(){if(!l){var t=C.selectAll(".nv-hoverValue").data(s);t.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove();var n=t.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);if(t.attr("transform",function(t){return"translate("+e(r.x()(g[t],t))+",0)"}).transition().duration(250).style("stroke-opacity",s.length?1:0).style("fill-opacity",s.length?1:0),!s.length){t.merge(t);return}n.append("line").attr("x1",0).attr("y1",-i.top).attr("x2",0).attr("y2",x),n.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-i.top).attr("text-anchor","end").attr("dy",".9em"),C.select(".nv-hoverValue .nv-xValue").text(u(r.x()(g[s[0]],s[0]))),n.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-i.top).attr("text-anchor","start").attr("dy",".9em"),C.select(".nv-hoverValue .nv-yValue").text(c(r.y()(g[s[0]],s[0])))}}S.attr("transform",function(t){return"translate("+-i.left+","+-i.top+")"}).attr("width",m+i.left+i.right).attr("height",x+i.top),S.merge(C)}),m.renderEnd("sparklinePlus immediate"),$}return $.dispatch=v,$.sparkline=r,$.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}},xTickFormat:{get:function(){return u},set:function(t){u=t}},yTickFormat:{get:function(){return c},set:function(t){c=t}},showLastValue:{get:function(){return f},set:function(t){f=t}},alignValue:{get:function(){return p},set:function(t){p=t}},rightAlignValue:{get:function(){return h},set:function(t){h=t}},noData:{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}}}),t.utils.inheritOptions($,r),t.utils.initOptions($),$},t.models.stackedArea=function(){"use strict";var e,n,r={top:0,right:0,bottom:0,left:0},i=960,o=500,a=t.utils.defaultColor(),s=Math.floor(1e5*Math.random()),l=null,u=function(t){return t.x},c=function(t){return t.y},f=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},p="stack",h=d3.stackOffsetNone,g=d3.stackOrderNone,v=getInterpolationType(v),m=!1,$=t.models.scatter(),x=250,y=function(t,e,n){t.display={y:n,y0:e}},b=function(t){return n(t.display.y+t.display.y0)},_=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");$.pointSize(2.2).pointDomain([2.2,2.2]);var k=t.utils.renderWatch(_,x);function w(p){return k.reset(),k.models($),p.each(function(p){var x=i-r.left-r.right,y=o-r.top-r.bottom;l=d3.select(this),t.utils.initSVG(l),e=$.xScale(),n=$.yScale();var A=p;p.forEach(function(t,e){t.seriesIndex=e,t.values=t.values.map(function(t,n){return t.index=n,t.seriesIndex=e,t})});var C=p.filter(function(t){return!t.disabled}),M=[];C[0].values.forEach(function(t){M.push({x:t[0]})}),C.forEach(function(t,e,n){t.display={y:e,y0:n},t.values.forEach(function(e){M[e.index][t.key]=e[1]})});var L=C.map(t=>t.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<o;++n){for(e=0,r=0;e<A.length;e++)r+=c(A[e].values[n]);if(r)for(e=0;e<i;e++)t[e][n][1]/=r;else for(e=0;e<i;e++)t[e][n][1]=0}for(n=0;n<o;++n)a[n]=0;return a}}),k.renderEnd("stackedArea immediate"),w}return w.dispatch=_,w.scatter=$,$.dispatch.on("elementClick",function(){_.apply("elementClick",this,arguments)}),$.dispatch.on("elementMouseover",function(){_.apply("elementMouseover",this,arguments)}),$.dispatch.on("elementMouseout",function(){_.apply("elementMouseout",this,arguments)}),w.interpolate=function(t){return arguments.length?(v=t,w):v},w.duration=function(t){return arguments.length?(x=t,k.reset(x),$.duration(x),w):x},w.dispatch=_,w.scatter=$,w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return i},set:function(t){i=t}},height:{get:function(){return o},set:function(t){o=t}},defined:{get:function(){return f},set:function(t){f=t}},clipEdge:{get:function(){return m},set:function(t){m=t}},offset:{get:function(){return h},set:function(t){h=t}},order:{get:function(){return g},set:function(t){g=t}},interpolate:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return u},set:function(t){u="function"==typeof t?t:function(){return t}}},y:{get:function(){return c},set:function(t){c="function"==typeof t?t:function(){return t}}},areaY1:{get:function(){return b},set:function(t){b="function"==typeof t?t:function(){return t}}},transformData:{get:function(){return y},set:function(t){y="function"==typeof t?t:function(){return t}}},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}},color:{get:function(){return a},set:function(e){a=t.utils.getColor(e)}},style:{get:function(){return p},set:function(t){switch(p=t){case"stack":w.offset(d3.stackOffsetNone),w.order(d3.stackOrderNone);break;case"stream":w.offset(d3.stackOffsetWiggle),w.order(d3.stackOrderInsideOut);break;case"stream_center":w.offset(d3.stackOffsetSilhouette),w.order(d3.stackOrderNone);break;case"expand":w.offset(d3.stackOffsetExpand),w.order(d3.stackOrderNone);break;case"stack_percent":w.offset(w.d3_stackedOffset_stackPercent),w.order(d3.stackOrderNone)}}},duration:{get:function(){return x},set:function(t){x=t,k.reset(x),$.duration(x)}}}),t.utils.inheritOptions(w,$),t.utils.initOptions(w),w},t.models.stackedAreaChart=function(){"use strict";var e,n,r=t.models.stackedArea(),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=t.models.focus(t.models.stackedArea()),f={top:10,right:25,bottom:50,left:60},p=null,h=null,g=null,v=t.utils.defaultColor(),m=!0,$=!0,x="top",y=!0,b=!0,_=!1,k=!1,w=!1,A=!0,C="TOTAL",M=t.utils.state(),L=null,S=null,E=d3.dispatch("stateChange","changeState","renderEnd"),F=250,W=["Stacked","Stream","Expanded"],D={},I=250,T=d3.transition().duration(I).ease(d3.easeLinear);M.style=r.style(),i.tickPadding(7),u.headerFormatter(function(t,e){return i.tickFormat()(t,e)}).valueFormatter(function(t,e){return o.tickFormat()(t,e)}),l.tooltip.headerFormatter(function(t,e){return i.tickFormat()(t,e)}).valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)});var O=null,P=null;s.updateState(!1);var B=t.utils.renderWatch(E),N=r.style(),z=d3.format(".0%");function V(u){return B.reset(),B.models(r),y&&B.models(i),b&&B.models(o),u.each(function(u){var S,T,B=d3.select(this);t.utils.initSVG(B);var Y,H,X=t.utils.availableWidth(h,B,f),G=t.utils.availableHeight(g,B,f)-(k?c.height():0);if(V.update=function(){B.transition().duration(I).call(V)},V.container=this,M.setter((Y=u,function(t){void 0!==t.style&&(N=t.style),void 0!==t.active&&Y.forEach(function(e,n){e.disabled=!t.active[n]})}),V.update).getter((H=u,function(){return{active:H.map(function(t){return!t.disabled}),style:r.style()}})).update(),M.disabled=u.map(function(t){return!!t.disabled}),!L)for(S in L={},M)M[S]instanceof Array?L[S]=M[S].slice(0):L[S]=M[S];if(!u||!u.length||!u.filter(function(t){return t.values.length}).length)return t.utils.noData(V,B),V;B.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale();var R=B.selectAll("g.nv-wrap.nv-stackedAreaChart").data([u]).enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart"),Z=R.append("g");R.select("g");var q=Z.append("g").attr("class","nv-legendWrap");q=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-legendWrap");var j=Z.append("g").attr("class","nv-controlsWrap");j=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-controlsWrap");var K=Z.append("g").attr("class","nv-focus"),Q=K.append("g").attr("class","nv-background").append("rect"),U=K.append("g").attr("class","nv-x nv-axis");U=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-x");var J=K.append("g").attr("class","nv-y nv-axis");J=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-y");var tt=K.append("g").attr("class","nv-stackedWrap");tt=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-stackedWrap");var te=K.append("g").attr("class","nv-interactive");te=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-interactive");var tn=Z.append("g").attr("class","nv-focusWrap");if(tn=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-focusWrap"),$){var tr=m&&"top"===x?X-F:X;if(a.width(tr),q.datum(u).call(a),"bottom"===x){var ti=i.height();f.bottom=Math.max(a.height()+ti,f.bottom);var to=(G=t.utils.availableHeight(g,B,f)-(k?c.height():0))+ti;q.attr("transform","translate(0,"+to+")")}else"top"===x&&(p||f.top==a.height()||(f.top=a.height(),G=t.utils.availableHeight(g,B,f)-(k?c.height():0)),q.attr("transform","translate("+(X-tr)+","+-f.top+")"))}else q.selectAll("*").remove();if(R.attr("transform","translate("+f.left+","+f.top+")"),m){var ta=[{key:D.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=r.style(),style:"stack"},{key:D.stream||"Stream",metaKey:"Stream",disabled:"stream"!=r.style(),style:"stream"},{key:D.stream_center||"Stream Center",metaKey:"Stream_Center",disabled:"stream_center"!=r.style(),style:"stream_center"},{key:D.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=r.style(),style:"expand"},{key:D.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=r.style(),style:"stack_percent"}];F=W.length/3*260,ta=ta.filter(function(t){return -1!==W.indexOf(t.metaKey)}),s.width(F).color(["#444","#444","#444"]),j.datum(ta).call(s);var ts=Math.max(s.height(),$&&"top"===x?a.height():0);f.top!=ts&&(f.top=ts,G=t.utils.availableHeight(g,B,f)-(k?c.height():0)),j.attr("transform","translate(0,"+-f.top+")")}else j.selectAll("*").remove();function tl(){y&&U.attr("transform","translate(0,"+G+")").transition().duration(I).call(i)}function tu(){if(b){if("expand"===r.style()||"stack_percent"===r.style()){var t=o.tickFormat();O&&t===z||(O=t),o.tickFormat(z)}else O&&(o.tickFormat(O),O=null);J.transition().call(o)}}if(_&&J.attr("transform","translate("+X+",0)"),w&&(l.width(X).height(G).margin({left:f.left,top:f.top}).svgContainer(B).xScale(e),te.call(l)),Q.attr("width",X).attr("height",G),r.width(X).height(G).color(u.map(function(t,e){return t.color||v(t,e)}).filter(function(t,e){return!u[e].disabled})),tt.datum(u.filter(function(t){return!t.disabled})),y&&(i.scale(e)._ticks(t.utils.calcTicksX(X/100,u)),i.tickSizeInner(-G)),b&&(T=r.offset()===d3.stackOffsetWiggle?0:t.utils.calcTicksY(G/36,u),o.scale(n)._ticks(T),o.tickSizeInner(-X)),k){c.width(X),tn.attr("transform","translate(0,"+(G+f.bottom+c.margin().top)+")").datum(u.filter(function(t){return!t.disabled})).call(c);var tc=null==d3.event||null===d3.event.selection?c.xDomain():c.brush.selection();null!==tc&&td(tc)}else tt.transition().call(r),tl(),tu();function td(t){tt.datum(u.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}})),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.x+t.dx&&e.depth>=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.11"}();
|
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;o<n&&(i=t.render.queue[o]);o++)e=i.generate(),typeof i.callback==typeof Function&&i.callback(e);t.render.queue.splice(0,o),t.render.queue.length?setTimeout(r):(t.dispatch.call("end"),t.render.active=!1)};setTimeout(r)},t.render.active=!1,t.render.queue=[],t.addGraph=function(e){typeof arguments[0]==typeof Function&&(e={generate:arguments[0],callback:arguments[1]}),t.render.queue.push(e),t.render.active||t.render()},"undefined"!=typeof module&&"undefined"!=typeof exports&&(module.exports=t),"undefined"!=typeof window&&(window.nv=t),t.dom.write=function(t){return void 0!==window.fastdom?fastdom.mutate(t):t()},t.dom.read=function(t){return void 0!==window.fastdom?fastdom.measure(t):t()};var e={};"use strict";setCoordinates=function(t,n){e.mouseX=t,e.mouseY=n},getCoordinates=function(t,n){return e},getInterpolationType=function(t){if(!t)return d3.curveLinear;switch(t){case"linear":return d3.curveLinear;case"cardinal":return d3.curveCatmullRom;case"step":return d3.curveStep}},t.interactiveGuideline=function(){"use strict";var e={left:0,top:0},n=null,r=null,i=d3.scaleLinear(),o=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick","elementMouseDown","elementMouseUp"),a=!0,s=null,l=t.models.tooltip(),u=window.ActiveXObject;function c(f){f.each(function(f){var p=d3.select(this),h=n||960,g=r||400;function v(t){var n=t.pageX-this.getBoundingClientRect().left-window.pageXOffset,r=t.pageY-this.getBoundingClientRect().top-window.pageYOffset,a=!0,s=!1;if(u&&(n=t.offsetX,r=t.offsetY,"svg"!==t.target.tagName&&(a=!1),t.target.className.baseVal.match("nv-legend")&&(s=!0)),setCoordinates(t.pageX,t.pageY),a&&(n-=e.left,r-=e.top),"mouseout"===t.type||n<0||r<0||n>h||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<n&&(r=a,i=o)}),i},t.models.tooltip=function(){"use strict";var e="nvtooltip-"+Math.floor(1e5*Math.random()),n=null,r="w",i=25,o=0,a=null,s=!0,l=200,u=null,c={left:null,top:null},f=!0,p=100,h=d3.transition().delay(l).duration(0),g=!0,v="nv-pointer-events-none",m=function(t,e,n){return t},$=function(t){return t},x=function(t,e){return t},y=function(t,e){if(null===t)return"";var n=d3.select(document.createElement("table"));g&&n.selectAll("thead").data([t]).enter().append("thead").append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html($(t.value));var r=n.selectAll("tbody").data([t]).enter().append("tbody").selectAll("tr").data(function(t){return t.series}).enter().append("tr").classed("highlight",function(t){return t.highlight});r.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(t){return t.color}),r.append("td").classed("key",!0).classed("total",function(t){return!!t.total}).html(function(t,e){return x(t.key,e)}),r.append("td").classed("value",!0).html(function(t,e){return m(t.value,e,t)}),r.filter(function(t,e){return void 0!==t.percent}).append("td").classed("percent",!0).html(function(t,e){return"("+d3.format(".0%")(t.percent)+")"}),r.selectAll("td").each(function(t){if(t.highlight){var e=d3.scaleLinear().domain([0,1]).range(["#fff",t.color]);d3.select(this).style("border-bottom-color",e(.6)).style("border-top-color",e(.6))}});var i=n.node().outerHTML;return void 0!==t.footer&&(i+="<div class='footer'>"+t.footer+"</div>"),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;r<e.length-1;r++)n.push(r);n.push(e.length-1)}else{n.push(e.length-1);for(var r=e.length-2;r>0;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;i<n.length;i+=1){var o=n[i]&&n[i].values?n[i].values.length:0;r=o>r?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;o<n.length;o+=1)for(var a,s=n[o]&&n[o].values?n[o].values:[],l=0;l<s.length;l+=1)i=(a=s[l]&&r(s[l])?r(s[l]):0)>i?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;++i<o;)e[r=arguments[i]]=t.utils.d3_rebind(e,n,n[r]);return e},t.utils.d3_rebind=function(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}},t.utils.initSVG=function(t){t.classed("nvd3-svg",!0)},t.utils.sanitizeHeight=function(t,e){return t||parseInt(e.style("height"),10)||400},t.utils.sanitizeWidth=function(t,e){return t||parseInt(e.style("width"),10)||960},t.utils.availableHeight=function(e,n,r){return Math.max(0,t.utils.sanitizeHeight(e,n)-r.top-r.bottom)},t.utils.availableWidth=function(e,n,r){return Math.max(0,t.utils.sanitizeWidth(e,n)-r.left-r.right)},t.utils.noData=function(e,n){var r=e.options(),i=r.margin(),o=r.noData(),a=t.utils.availableHeight(null,n,i),s=t.utils.availableWidth(null,n,i),l=i.left+s/2,u=i.top+a/2;n.selectAll("g").remove();var c=n.selectAll(".nv-noData").data(null==o?["No Data Available."]:[o]);c.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),c.attr("x",l).attr("y",u).text(function(t){return t})},t.utils.wrapTicks=function(t,e){t.each(function(){for(var t,n=d3.select(this),r=n.text().split(/\s+/).reverse(),i=[],o=0,a=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");t=r.pop();)i.push(t),l.text(i.join(" ")),l.node().getComputedTextLength()>e&&(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;r<i;r++)if(e[r]instanceof Array&&n[r]instanceof Array){if(!t.arrayEquals(e[r],n[r]))return!1}else if(e[r]!=n[r])return!1;return!0},t.utils.pointIsInArc=function(t,e,n){var r=n.innerRadius()(e),i=n.outerRadius()(e),o=n.startAngle()(e),a=n.endAngle()(e),s=t.x*t.x+t.y*t.y,l=Math.atan2(t.x,-t.y);return l=l<0?l+2*Math.PI:l,r*r<=s&&s<=i*i&&o<=l&&l<=a},t.models.axis=function(e,n){"use strict";var r,i,o=d3.scaleOrdinal(),a={top:0,right:0,bottom:0,left:0},s=75,l=60,u=null,c=!0,f=0,p=!0,h=!1,g=!1,v=null,m=0,$=void 0,x=250,y=d3.dispatch("renderEnd");e.tickFormat(t=>t);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()[1]+10||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[0]||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;m<P;m++){var B="nv-range nv-range"+m;m<=2&&(B=B+" nv-range"+b[m]),T.append("rect").attr("class",B)}T.append("rect").attr("class","nv-measure"),I.attr("transform","translate("+e.left+","+e.top+")");for(var N=function(t){return Math.abs(D(t)-D(0))},z=function(t){return t<0?D(t):D(0)},m=0,P=A.length;m<P;m++){var V=A[m];O.select("rect.nv-range"+m).datum(V).attr("height",k).transition().duration(1e3).attr("width",N(V)).attr("x",z(V))}O.select("rect.nv-measure").style("fill",$).attr("height",k/3).attr("y",k/3).on("mouseover",function(){x.call("elementMouseover",this,{value:L[0],label:W[0]||"Current",color:d3.select(this).style("fill")})}).on("mousemove",function(){x.call("elementMousemove",this,{value:L[0],label:W[0]||"Current",color:d3.select(this).style("fill")})}).on("mouseout",function(){x.call("elementMouseout",this,{value:L[0],label:W[0]||"Current",color:d3.select(this).style("fill")})}).transition().duration(1e3).attr("width",L<0?D(0)-D(L[0]):D(L[0])-D(0)).attr("x",z(L));var Y=k/6,H=C.map(function(t,e){return{value:t,label:E[e]}});T.selectAll("path.nv-markerTriangle").data(H).enter().append("path").attr("class","nv-markerTriangle").attr("d","M0,"+Y+"L"+Y+","+-Y+" "+-Y+","+-Y+"Z").on("mouseover",function(t){x.call("elementMouseover",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[D(t.value),k/2]})}).on("mousemove",function(t){x.call("elementMousemove",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){x.call("elementMouseout",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}),O.selectAll("path.nv-markerTriangle").data(H).transition().duration(1e3).attr("transform",function(t){return"translate("+D(t.value)+","+k/2+")"});var X=M.map(function(t,e){return{value:t,label:F[e]}});T.selectAll("line.nv-markerLine").data(X).enter().append("line").attr("cursor","").attr("class","nv-markerLine").attr("x1",function(t){return D(t.value)}).attr("y1","2").attr("x2",function(t){return D(t.value)}).attr("y2",k-2).on("mouseover",function(t){x.call("elementMouseover",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[D(t.value),k/2]})}).on("mousemove",function(t){x.call("elementMousemove",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){x.call("elementMouseout",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}),O.selectAll("line.nv-markerLine").data(X).transition().duration(1e3).attr("x1",function(t){return D(t.value)}).attr("x2",function(t){return D(t.value)}),I.selectAll(".nv-range").on("mouseover",function(t,e){var n=S[e]||y[e];x.call("elementMouseover",this,{value:t,label:n,color:d3.select(this).style("fill")})}).on("mousemove",function(){x.call("elementMousemove",this,{value:L[0],label:W[0]||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){var n=S[e]||y[e];x.call("elementMouseout",this,{value:t,label:n,color:d3.select(this).style("fill")})})}),A}return A.dispatch=x,A.options=t.utils.optionsFunc.bind(A),A._options=Object.create({},{ranges:{get:function(){return i},set:function(t){i=t}},markers:{get:function(){return o},set:function(t){o=t}},measures:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return p},set:function(t){p=t}},width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return g},set:function(t){g=t}},tickFormat:{get:function(){return m},set:function(t){m=t}},duration:{get:function(){return _},set:function(t){_=t,k=d3.transition().duration(_).ease(d3.easeLinear)}},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}},orient:{get:function(){return n},set:function(t){r="right"==(n=t)||"bottom"==n}},color:{get:function(){return $},set:function(e){$=t.utils.getColor(e)}}}),t.utils.initOptions(A),A},t.models.bulletChart=function(){"use strict";var e=t.models.bullet(),n=t.models.tooltip(),r="left",i=!1,o={top:5,right:40,bottom:20,left:120},a=function(t){return t.ranges},s=function(t){return t.markers?t.markers:[]},l=function(t){return t.measures},u=null,c=55,f=null,p=null,h=null,g=d3.dispatch();function v(n){return n.each(function(r,h){var g=d3.select(this);t.utils.initSVG(g);var m=t.utils.availableWidth(u,g,o),$=c-o.top-o.bottom;if(v.update=function(){v(n)},v.container=this,!r||!a.call(this,r,h))return t.utils.noData(v,g),v;g.selectAll(".nv-noData").remove();var x=a.call(this,r,h).slice().sort(d3.descending),y=s.call(this,r,h).slice().sort(d3.descending),b=l.call(this,r,h).slice().sort(d3.descending),_=g.selectAll("g.nv-wrap.nv-bulletChart").data([r]);_.attr("transform","translate("+o.left+","+o.top+")");var k=_.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart").append("g"),w=_.select("g"),A=k.append("g").attr("class","nv-bulletWrap"),C=k.append("g").attr("class","nv-titles"),M=d3.scaleLinear().domain([0,Math.max(x[0],y[0]||0,b[0])]).range(i?[m,0]:[0,m]),L=this.__chart__||d3.scaleLinear().domain([0,1/0]).range(M.range());this.__chart__=M;var S=C.append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(c-o.top-o.bottom)/2+")");S.append("text").attr("class","nv-title").text(function(t){return t.title}),S.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(t){return t.subtitle}),e.width(m).height($),A.transition().call(e);var E=f||M.tickFormat(m/100),F=w.selectAll("g.nv-tick").data(M.ticks(p||m/50),function(t){return this.textContent||E(t)}),W=F.enter().append("g").attr("class","nv-tick").attr("transform",function(t){return"translate("+L(t)+",0)"}).style("opacity",1e-6);W.append("line").attr("y1",$).attr("y2",7*$/6),W.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*$/6).text(E);var D=F.transition().duration(e.duration()).attr("transform",function(t){return"translate("+M(t)+",0)"}).style("opacity",1);D.select("line").attr("y1",$).attr("y2",7*$/6),D.select("text").attr("y",7*$/6),W.transition().duration(e.duration()).attr("transform",function(t){return"translate("+M(t)+",0)"}).style("opacity",1e-6).remove()}),d3.timerFlush(),v}return n.duration(0).headerEnabled(!1),e.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:t.label,value:t.value,color:t.color},n.data(t).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){n.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(t){n()}),v.bullet=e,v.dispatch=g,v.tooltip=n,v.options=t.utils.optionsFunc.bind(v),v._options=Object.create({},{ranges:{get:function(){return a},set:function(t){a=t}},markers:{get:function(){return s},set:function(t){s=t}},measures:{get:function(){return l},set:function(t){l=t}},width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},tickFormat:{get:function(){return f},set:function(t){f=t}},ticks:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return h},set:function(t){h=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}},orient:{get:function(){return r},set:function(t){i="right"==(r=t)||"bottom"==r}}}),t.utils.inheritOptions(v,e),t.utils.initOptions(v),v},t.models.candlestickBar=function(){"use strict";var e,n,r,i,o,a={top:0,right:0,bottom:0,left:0},s=null,l=null,u=Math.floor(1e4*Math.random()),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(k){return k.each(function(k){e=d3.select(this);var w=t.utils.availableWidth(s,e,a),C=t.utils.availableHeight(l,e,a);t.utils.initSVG(e);var M=w/k[0].values.length*.45;c.domain(n||d3.extent(k[0].values.map(p).concat(x))),b?c.range(i||[.5*w/k[0].values.length,w*(k[0].values.length-.5)/k[0].values.length]):c.range(i||[5+M/2,w-M/2-5]),f.domain(r||[d3.min(k[0].values.map($).concat(y)),d3.max(k[0].values.map(m).concat(y))]).range(o||[C,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 L=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([k[0].values]),S=L.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar");S.attr("transform","translate("+a.left+","+a.top+")");var E=S.append("defs"),F=S.append("g");L.select("g");var W=F.append("g").attr("class","nv-ticks");e.on("click",function(t,e,n){A.call("chartClick",this,{data:e,index:e.index,pos:t,id:u})}),E.append("clipPath").attr("id","nv-chart-clip-path-"+u).append("rect").attr("width",w).attr("height",C),F.attr("clip-path",_?"url(#nv-chart-clip-path-"+u+")":"");var D=W.selectAll(".nv-tick").data(function(t){return t});D.exit().remove();var I=D.enter().append("g");I.attr("class",function(t,e,n){return(g(t,e)>v(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 t<c}))]),minmax:d3.max(a),stddev:d3.mean(a)+d3.deviation(a)},m=d3.median(a),$=d3.mean(a),x=[];void 0!==d3.beeswarm?(x=d3.beeswarm().data(t.map(function(t){return v(t)})).radius(N+1).orientation("vertical").side("symmetric").distributeOn(function(t){return h(t)}).arrange()).map(function(n,r){n.key=e,n.object_constancy=t[r].object_constancy,n.isOutlier=n.datum<p.iqr||n.datum>g.iqr,n.isOutlierStdDev=n.datum<p.stddev||n.datum>g.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:t<p.iqr||t>g.iqr,isOutlierStdDev:t<p.stddev||t>g.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[0].x&&r.unshift({x:n[0],y:r[0].y}),n[1]>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<i.length;a++)for(var s=0;s<K.length;s++)o.push(i[a]+"_"+K[s]);K=o,n=[],r.forEach(function(t){t.values.forEach(function(e){e.key=t.key+"_"+e.key}),n.push.apply(n,t.values)})}else n=d3.group().key(function(t){return g(t)}).rollup(function(t,n){return e(t)}).entries(t);return n}function Z(t){return F?j.find(function(e){return e.key==t}).values.map(function(t){return t.key}).sort(d3.ascending):t}function q(t){return"iqr"==L&&t.isOutlier||"stddev"==L&&t.isOutlierStdDev}var j,K=new Set,Q=[],U=[],J=t.utils.renderWatch(Y,H);function tt(f){return J.reset(),f.each(function(f){e=u-l.left-l.right,n=c-l.top-l.bottom,V=d3.select(this),t.utils.initSVG(V),h.domain(a||d3.extent(f.map(function(t){return v(t)}))).nice().range(s||[n,0]),void 0===j&&(j=R(f)),p.range(o||[0,e],.1).domain(i||F&&!T?K:j.map(function(t){return t.key}));var g=V.selectAll("g.nv-wrap").data([j]).enter().append("g").attr("class","nvd3 nv-wrap");g.watchTransition(J,"nv-wrap: wrap").attr("transform","translate("+l.left+","+l.top+")");var L,I=g.selectAll(".nv-distroplot-x-group").data(function(t){return t});I.each(function(t,e){d3.select(this).selectAll("line.nv-distroplot-middle").datum(t)}),L=I.enter().append("g").attr("class","nv-distroplot-x-group").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).style("fill",function(t,e){return m(t)||z(t,e)}).style("stroke",function(t,e){return m(t)||z(t,e)}),I.exit().remove();var O=function(){return p.bandwidth()},P=function(){return d3.min([X,.9*O()])},B=function(){return P()/2},H=function(){return B()-P()/2},G=function(){return B()+P()/2},Z=function(){return B()-P()/5},U=function(){return B()+P()/5};L.attr("transform",function(t){return"translate("+(p(t.key)+(O()-P())*.5)+", 0)"}),I.watchTransition(J,"nv-distroplot-x-group: distroplots").style("stroke-opacity",1).style("fill-opacity",.5).attr("transform",function(t){return"translate("+(p(t.key)+(O()-P())*.5)+", 0)"}),Q.map(function(t){t.range([P()/2,0])}),r||(D=!1,M||(M="random")),L.each(function(t,e){var n=d3.select(this);[_,k].forEach(function(t){var e=t===_?"low":"high";n.append("line").style("opacity",function(){return S?"1":"0"}).attr("class","nv-distroplot-whisker nv-distroplot-"+e),n.append("line").style("opacity",function(){return S?"0":"1"}).attr("class","nv-distroplot-tick nv-distroplot-"+e)})}),[_,k].forEach(function(t){var e=t===_?"low":"high",n=t===_?$:y;I.select("line.nv-distroplot-whisker.nv-distroplot-"+e).watchTransition(J,"nv-distroplot-x-group: distroplots").attr("x1",B()).attr("y1",function(e){return"violin"!=r?h(t(e)):h(x(e))}).attr("x2",B()).attr("y2",function(t){return"box"==r?h(n(t)):h(x(t))}).style("opacity",function(){return S?"0":"1"}),I.select("line.nv-distroplot-tick.nv-distroplot-"+e).watchTransition(J,"nv-distroplot-x-group: distroplots").attr("x1",function(t){return"violin"!=r?Z():B()}).attr("y1",function(e,n){return"violin"!=r?h(t(e)):h(x(e))}).attr("x2",function(t){return"violin"!=r?U():B()}).attr("y2",function(e,n){return"violin"!=r?h(t(e)):h(x(e))}).style("opacity",function(){return S?"0":"1"})}),[_,k].forEach(function(t){var e=t===_?"low":"high";L.selectAll(".nv-distroplot-"+e).on("mouseover",function(n,r,i,o){setCoordinates(n.pageX,n.pageY),d3.select(this.parentNode).selectAll("line.nv-distroplot-"+e).classed("hover",!0),Y.call("elementMouseover",this,{value:"low"==e?"Lower whisker":"Upper whisker",series:{key:t(r).toFixed(2),color:m(r)||z(r,o)},e:n})}).on("mouseout",function(n,r,i,o){d3.select(this.parentNode).selectAll("line.nv-distroplot-"+e).classed("hover",!1),Y.call("elementMouseout",this,{value:"low"==e?"Lower whisker":"Upper whisker",series:{key:t(r).toFixed(2),color:m(r)||z(r,o)},e:n})}).on("mousemove",function(t,e){Y.call("elementMousemove",this,{e:event})})}),L.each(function(t,e){var n=d3.select(this);["left","right"].forEach(function(t){["line","area"].forEach(function(e){n.append("path").attr("class","nv-distribution-"+e+" nv-distribution-"+t).attr("transform","rotate(90,0,0) translate(0,"+("left"==t?-P():0)+")"+("left"==t?"":" scale(1,-1)"))})}),L.selectAll(".nv-distribution-line").style("fill","none"),L.selectAll(".nv-distribution-area").style("stroke","none").style("opacity",.7)}),I.each(function(t,e){var n,i,o,a,s,l,u,c,f=d3.select(this),p="box"==r?(n=H(),i=Z(),o=B(),a=t,c="mean"==W?b(a):x(a),u=E?[{x:o,y:h($(a))},{x:n,y:h($(a))},{x:n,y:h((s=a,("mean"==W?b(s):x(s))-s.values.notch))},{x:i,y:h(c)},{x:n,y:h((l=a,("mean"==W?b(l):x(l))+l.values.notch))},{x:n,y:h(y(a))},{x:o,y:h(y(a))},]:[{x:o,y:h($(a))},{x:n,y:h($(a))},{x:n,y:h(c)},{x:n,y:h(c)},{x:n,y:h(c)},{x:n,y:h(y(a))},{x:o,y:h(y(a))},]):t.values.kde;f.selectAll("path").datum(p);var g=Q[e],v="box"==r?d3.curveLinear:d3.curveBasis;"box"==r||"violin"==r?["left","right"].forEach(function(t){I.selectAll(".nv-distribution-line.nv-distribution-"+t).attr("d",d3.line().x(function(t){return"box"==r?t.y:h(t.x)}).y(function(t){return"box"==r?t.x:g(t.y)}).curve(v)).attr("transform","rotate(90,0,0) translate(0,"+("left"==t?-P():0)+")"+("left"==t?"":" scale(1,-1)")).style("opacity",r?"1":"0"),I.selectAll(".nv-distribution-area.nv-distribution-"+t).attr("d",d3.area().x(function(t){return"box"==r?t.y:h(t.x)}).y(function(t){return"box"==r?t.x:g(t.y)}).y0(P()/2).curve(v)).attr("transform","rotate(90,0,0) translate(0,"+("left"==t?-P():0)+")"+("left"==t?"":" scale(1,-1)")).style("opacity",r?"1":"0")}):(I.selectAll(".nv-distribution-area").watchTransition(J,"nv-distribution-area: distroplots").style("opacity",r?"1":"0"),I.selectAll(".nv-distribution-line").watchTransition(J,"nv-distribution-line: distroplots").style("opacity",r?"1":"0"))}),I.selectAll("path").on("mouseover",function(t,e,n,r){setCoordinates(t.pageX,t.pageY),e=d3.select(this.parentNode).datum(),d3.select(this).classed("hover",!0),Y.call("elementMouseover",this,{key:e.key,value:"Group "+e.key+" stats",series:[{key:"max",value:A(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q3",value:y(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q2",value:x(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q1",value:$(e).toFixed(2),color:m(e)||z(e,r)},{key:"min",value:w(e).toFixed(2),color:m(e)||z(e,r)},{key:"mean",value:b(e).toFixed(2),color:m(e)||z(e,r)},{key:"std. dev.",value:C(e).toFixed(2),color:m(e)||z(e,r)},{key:"count",value:e.values.count,color:m(e)||z(e,r)},{key:"num. outliers",value:e.values.num_outlier,color:m(e)||z(e,r)},],data:e,index:e.index,e:t})}).on("mouseout",function(t,e,n,r){d3.select(this).classed("hover",!1),e=d3.select(this.parentNode).datum(),Y.call("elementMouseout",this,{key:e.key,value:"Group "+e.key+" stats",series:[{key:"max",value:A(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q3",value:y(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q2",value:x(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q1",value:$(e).toFixed(2),color:m(e)||z(e,r)},{key:"min",value:w(e).toFixed(2),color:m(e)||z(e,r)},{key:"mean",value:b(e).toFixed(2),color:m(e)||z(e,r)},{key:"std. dev.",value:C(e).toFixed(2),color:m(e)||z(e,r)},{key:"count",value:e.values.count,color:m(e)||z(e,r)},{key:"num. outliers",value:e.values.num_outlier,color:m(e)||z(e,r)},],data:e,index:e.index,e:t})}).on("mousemove",function(t,e,n){Y.call("elementMousemove",this,{e:t})}),L.append("line").attr("class",function(t){return"nv-distroplot-middle"}),I.selectAll("line.nv-distroplot-middle").watchTransition(J,"nv-distroplot-x-group: distroplots line").attr("x1",E?Z:"violin"!=r?H:Z()).attr("y1",function(t,e,n){return"mean"==W?h(b(t)):h(x(t))}).attr("x2",E?U:"violin"!=r?G:U()).attr("y2",function(t,e){return"mean"==W?h(b(t)):h(x(t))}).style("opacity",W?"1":"0"),I.selectAll(".nv-distroplot-middle").on("mouseover",function(t,e,n,r){if(setCoordinates(t.pageX,t.pageY),0!=d3.select(this).style("opacity")){var i=d3.select(this.parentNode).style("fill");d3.select(this).classed("hover",!0),Y.call("elementMouseover",this,{value:"mean"==W?"Mean":"Median",series:{key:"mean"==W?b(e).toFixed(2):x(e).toFixed(2),color:i},e:t})}}).on("mouseout",function(t,e,n,r){if(0!=d3.select(this).style("opacity")){d3.select(this).classed("hover",!1);var i=d3.select(this.parentNode).style("fill");Y.call("elementMouseout",this,{value:"mean"==W?"Mean":"Median",series:{key:"mean"==W?b(e).toFixed(2):x(e).toFixed(2),color:i},e:t})}}).on("mousemove",function(t,e,n){Y.call("elementMousemove",this,{e:t})});var tt=I.selectAll("g.nv-distroplot-observation").data(function(t){var e;return(e=t).values.observations},function(t){return t.object_constancy}),te=tt.enter().append("g").attr("class","nv-distroplot-observation");te.append("circle").style({opacity:0}),te.append("line").style("stroke-width",1).style({stroke:d3.rgb(85,85,85),opacity:0}),tt.exit().remove(),tt.attr("class",function(t){return"nv-distroplot-observation "+(q(t)&&"box"==r?"nv-distroplot-outlier":"nv-distroplot-non-outlier")}),"line"==M?I.selectAll("g.nv-distroplot-observation line").watchTransition(J,"nv-distrolot-x-group: nv-distoplot-observation").attr("x1",Z()+P()/4).attr("x2",U()-P()/4).attr("y1",function(t){return h(t.datum)}).attr("y2",function(t){return h(t.datum)}):(I.selectAll("g.nv-distroplot-observation circle").watchTransition(J,"nv-distroplot: nv-distroplot-observation").attr("cy",function(t){return h(t.datum)}).attr("r",N),I.selectAll("g.nv-distroplot-observation circle").watchTransition(J,"nv-distroplot: nv-distroplot-observation").attr("cx",function(t){return"swarm"==M?t.x+P()/2:"random"==M?P()/2+t.randX*P()/2:P()/2})),!1!==M&&(D?(I.selectAll(".nv-distroplot-outlier "+("line"==M?"line":"circle")).watchTransition(J,"nv-distroplot: nv-distroplot-observation").style("opacity",1),I.selectAll(".nv-distroplot-non-outlier "+("line"==M?"line":"circle")).watchTransition(J,"nv-distroplot: nv-distroplot-observation").style("opacity",0)):I.selectAll("line"==M?"line":"circle").watchTransition(J,"nv-distroplot: nv-distroplot-observation").style("opacity",1)),I.selectAll(".nv-distroplot-observation"+("line"==M?" circle":" line")).watchTransition(J,"nv-distroplot: nv-distoplot-observation").style("opacity",0),I.selectAll(".nv-distroplot-observation").on("mouseover",function(t,e,n,i){setCoordinates(t.pageX,t.pageY);var o=d3.select(this);if(!D||"box"!=r||q(e)){var a=d3.select(this.parentNode).style("fill");o.classed("hover",!0),Y.call("elementMouseover",this,{value:"box"==r&&q(e)?"Outlier":"Observation",series:{key:e.datum.toFixed(2),color:a},e:t})}}).on("mouseout",function(t,e,n,i){var o=d3.select(this),a=d3.select(this.parentNode).style("fill");o.classed("hover",!1),Y.call("elementMouseout",this,{value:"box"==r&&q(e)?"Outlier":"Observation",series:{key:e.datum.toFixed(2),color:a},e:t})}).on("mousemove",function(t,e,n){Y.call("elementMousemove",this,{e:t})})}),J.renderEnd("nv-distroplot-x-group immediate"),tt}return tt.dispatch=Y,tt.options=t.utils.optionsFunc.bind(tt),tt._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},maxBoxWidth:{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}},plotType:{get:function(){return r},set:function(t){r=t}},observationType:{get:function(){return M},set:function(t){M=t}},whiskerDef:{get:function(){return L},set:function(t){L=t}},notchBox:{get:function(){return E},set:function(t){E=t}},hideWhiskers:{get:function(){return S},set:function(t){S=t}},colorGroup:{get:function(){return F},set:function(t){F=t}},centralTendency:{get:function(){return W},set:function(t){W=t}},bandwidth:{get:function(){return O},set:function(t){O=t}},clampViolin:{get:function(){return P},set:function(t){P=t}},resolution:{get:function(){return B},set:function(t){B=t}},xScale:{get:function(){return p},set:function(t){p=t}},yScale:{get:function(){return h},set:function(t){h=t}},showOnlyOutliers:{get:function(){return D},set:function(t){D=t}},jitter:{get:function(){return I},set:function(t){I=t}},squash:{get:function(){return T},set:function(t){T=t}},pointSize:{get:function(){return N},set:function(t){N=t}},xDomain:{get:function(){return i},set:function(t){i=t}},yDomain:{get:function(){return a},set:function(t){a=t}},xRange:{get:function(){return o},set:function(t){o=t}},yRange:{get:function(){return s},set:function(t){s=t}},recalcData:{get:function(){j=R(V.datum())}},itemColor:{get:function(){return m},set:function(t){m=t}},id:{get:function(){return f},set:function(t){f=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 z},set:function(e){z=t.utils.getColor(e)}},duration:{get:function(){return H},set:function(t){H=t,J.reset(H)}}}),t.utils.initOptions(tt),tt},t.models.distroPlotChart=function(){"use strict";var e,n,r,i=t.models.distroPlot(),o=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),a=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),s={top:25,right:10,bottom:40,left:60},l=null,u=null,c=t.utils.getColor(),f=!0,p=!0,h=!1,g=!1,v=!1,m=!1,$=t.models.tooltip(),x="No Data Available.",y=d3.dispatch("stateChange","beforeUpdate","renderEnd"),b=500,_=d3.transition().duration(b).ease(d3.easeLinear);o.showMaxMin(!1).tickFormat(function(t){return t}),a.tickFormat(d3.format(",.1f")),$.duration(0);var k,w,A,C,M,L,S=t.utils.renderWatch(y,b);function E(t,e){var n=Object.getOwnPropertyNames(t),r=Object.getOwnPropertyNames(e);if(n.length!=r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i];if(t[o]!==e[o])return!1}return!0}function F(c){return S.reset(),S.models(i),f&&S.models(o),p&&S.models(a),c.each(function(c){var v=d3.select(this),m=this;t.utils.initSVG(v);var $=(l||parseInt(v.style("width"))||960)-s.left-s.right,_=(u||parseInt(v.style("height"))||400)-s.top-s.bottom;if(void 0===e&&(e=JSON.parse(JSON.stringify(c))),F.update=function(){y.call("beforeUpdate",m);var t,n=i.options();(k!==n.colorGroup()||w!==n.x()||A!==n.y()||M!==n.bandwidth()||C!==n.resolution()||L!==n.clampViolin()||!function t(e,n){if(e.length!==n.length)return!1;for(var r=e.length;r--;)if("object_constancy"in e[r]&&delete e[r].object_constancy,"object_constancy"in n[r]&&delete n[r].object_constancy,!E(e[r],n[r]))return!1;return!0}(t=c,e)&&(e=JSON.parse(JSON.stringify(t)),1))&&i.recalcData(),v.transition().duration(b).call(F)},F.container=this,"function"!=typeof d3.beeswarm&&"swarm"==F.options().observationType())return s.left,x='Please include the library https://github.com/Kcnarf/d3-beeswarm to use "swarm".',t.utils.noData(F,v),F;if(!c||!c.length)return t.utils.noData(F,v),F;v.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale().clamp(!0);var W=v.selectAll("g.nv-wrap.nv-distroPlot").data([c]),D=W.enter().append("g").attr("class","nvd3 nv-wrap nv-distroPlot").append("g"),I=D.append("defs"),T=W.select("g");if(D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),D.append("g").attr("class","nv-distroWrap"),D.attr("transform","translate("+s.left+","+s.top+")"),T.watchTransition(S,"nv-wrap: wrap").attr("transform","translate("+s.left+","+s.top+")"),h&&T.select(".nv-y.nv-axis").attr("transform","translate("+$+",0)"),i.width($).height(_),T.select(".nv-distroWrap").datum(c).transition().call(i),I.append("clipPath").attr("id","nv-x-label-clip-"+i.id()).append("rect").attr("width",n.range()*(g?2:1)).attr("height",16).attr("x",-n.range()/(g?1:2)),f){o.scale(n)._ticks(t.utils.calcTicksX($/100,c)),o.tickSizeInner(-_),T.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),T.select(".nv-x.nv-axis").call(o);var O=T.select(".nv-x.nv-axis").select("g.nvd3.nv-wrap.nv-axis").selectAll("g");g&&O.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})}p&&(a.scale(r)._ticks(Math.floor(_/36)),a.tickSizeInner(-$),T.select(".nv-y.nv-axis").call(a)),T.select(".nv-zeroLine line").attr("x1",0).attr("x2",$).attr("y1",r(0)).attr("y2",r(0)),k=i.options().colorGroup(),w=i.options().x(),A=i.options().y(),M=i.options().bandwidth(),C=i.options().resolution(),L=i.options().clampViolin()}),S.renderEnd("nv-distroplot chart immediate"),F}return s.top,i.dispatch.on("elementMouseover.tooltip",function(t){$.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){$.data(t).hidden(!0)}),i.dispatch.on("elementMousemove.tooltip",function(t){$()}),F.dispatch=y,F.distroplot=i,F.xAxis=o,F.yAxis=a,F.tooltip=$,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}},staggerLabels:{get:function(){return g},set:function(t){g=t}},showXAxis:{get:function(){return f},set:function(t){f=t}},showYAxis:{get:function(){return p},set:function(t){p=t}},tooltipContent:{get:function(){return $},set:function(t){$=t}},noData:{get:function(){return x},set:function(t){x=t}},defaultState:{get:function(){return defaultState},set:function(t){defaultState=t}},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}},duration:{get:function(){return b},set:function(t){b=t,S.reset(b),_=d3.transition().duration(b).ease(d3.easeLinear),i.duration(b),o.duration(b),a.duration(b)}},color:{get:function(){return c},set:function(e){c=t.utils.getColor(e),i.color(c)}},rightAlignYAxis:{get:function(){return h},set:function(t){h=t,a.orient(t?"right":"left")}},xLabel:{get:function(){return v},set:function(t){v=t,o.axisLabel(v)}},yLabel:{get:function(){return m},set:function(t){m=t,a.axisLabel(m)}}}),t.utils.inheritOptions(F,i),t.utils.initOptions(F),F},t.models.focus=function(e){"use strict";var n,r,e=e||t.models.line(),i=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),o=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),a=d3.brush(),s={top:10,right:0,bottom:30,left:0},l=t.utils.defaultColor(),u=null,c=70,f=!0,p=!1,h=!1,g=null,v=250,m=d3.transition().duration(v).ease(d3.easeLinear),$=d3.dispatch("brush","onBrush","renderEnd"),x=!0;e.interactive(!1),e.pointActive(function(t){return!1});var y=t.utils.renderWatch($,v);function b(m){return y.reset(),y.models(e),f&&y.models(i),p&&y.models(o),m.each(function(m){var y=d3.select(this);t.utils.initSVG(y);var _=t.utils.availableWidth(u,y,s),k=c-s.top-s.bottom;b.update=function(){0===v?y.call(b):y.transition().duration(v).call(b)},b.container=this,n=e.xScale(),r=e.yScale();var w=y.selectAll("g.nv-focus").data([m]).enter().append("g").attr("class","nvd3 nv-focus");w.attr("transform","translate("+s.left+","+s.top+")");var A=w.append("g"),C=A.append("g").attr("class","nv-background").append("rect"),M=A.append("g").attr("class","nv-x nv-axis");M=y.selectAll(".nv-focus").select(".nv-x.nv-axis");var L=A.append("g").attr("class","nv-y nv-axis");L=y.selectAll(".nv-focus").select(".nv-x.nv-axis");var S=A.append("g").attr("class","nv-contentWrap");S=y.selectAll(".nv-focus").select(".nv-contentWrap");var E=A.append("g").attr("class","nv-brushBackground");E=y.selectAll(".nv-focus").select(".nv-brushBackground");var F=A.append("g").attr("class","nv-x nv-brush");F=y.selectAll(".nv-focus").select(".nv-x.nv-brush"),h&&L.attr("transform","translate("+_+",0)"),C.attr("width",_).attr("height",k),e.width(_).height(k).color(m.map(function(t,e){return t.color||l(t,e)}).filter(function(t,e){return!m[e].disabled})),S.datum(m.filter(function(t){return!t.disabled})),S.transition().call(e),a.on("brush",function(){T(x)}),a.on("end",function(t){x||$.call("brush",this,null===t.selection?n.domain():a.extent())}),g&&a.extent(g);var W=E.selectAll("g").data([g||a.extent()]),D=W.enter().append("g");D.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",k),D.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",k).merge(A);var I=F.call(a);function T(t){g=a.extent().length?a.extent():null;var e=a.extent().length?a.extent():n.domain();$.call("brush",null,{extent:e,brush:a}),null!=g&&a.extent(g),W.data([null===g?n.domain():g]).each(function(t,e){var r=n(t[0])-n.range()[0],i=_-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)}),t&&$.call("brush",null,e)}I.selectAll("rect").attr("height",k),I.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)}).merge(A),T(!0),C.attr("width",_).attr("height",k).merge(A),f&&(i.scale(n)._ticks(t.utils.calcTicksX(_/100,m)),i.tickSizeInner(-k),M.attr("transform","translate(0,"+r.range()[0]+")"),M.transition().call(i)),p&&(o.scale(r)._ticks(t.utils.calcTicksY(k/36,m)),o.tickSizeInner(-_),L.call(o)),M.attr("transform","translate(0,"+r.range()[0]+")").merge(A)}),y.renderEnd("focus immediate"),b}return b.dispatch=$,b.content=e,b.brush=a,b.xAxis=i,b.yAxis=o,b.options=t.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},showXAxis:{get:function(){return f},set:function(t){f=t}},showYAxis:{get:function(){return p},set:function(t){p=t}},brushExtent:{get:function(){return g},set:function(t){g=t}},syncBrushing:{get:function(){return x},set:function(t){x=t}},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}},duration:{get:function(){return v},set:function(t){v=t,y.reset(v),m=d3.transition().duration(v).ease(d3.easeLinear),e.duration(v),i.duration(v),o.duration(v)}},color:{get:function(){return l},set:function(n){l=t.utils.getColor(n),e.color(l)}},interpolate:{get:function(){return e.interpolate()},set:function(t){e.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t)}},x:{get:function(){return e.x()},set:function(t){e.x(t)}},y:{get:function(){return e.y()},set:function(t){e.y(t)}},rightAlignYAxis:{get:function(){return h},set:function(t){h=t,o.orient(h?"right":"left")}}}),t.utils.inheritOptions(b,e),t.utils.initOptions(b),b},t.models.forceDirectedGraph=function(){"use strict";var e={top:2,right:0,bottom:2,left:0},n=400,r=32,i=null,o=d3.dispatch("renderEnd"),a=t.utils.getColor(["#000"]),s=t.models.tooltip(),l=null,u=.1,c=.5,f=30,p=-120,h=.1,g=.8,v=.3,m=5,$=function(t){},x=function(t){},y=function(){return 0},b=function(){return 0},_=t.utils.renderWatch(o);function k(o){return _.reset(),o.each(function(o){i=d3.select(this),t.utils.initSVG(i);var l=t.utils.availableWidth(n,i,e),h=t.utils.availableHeight(r,i,e);if(i.attr("width",l).attr("height",h),!o||!o.links||!o.nodes)return t.utils.noData(k,i),k;i.selectAll(".nv-noData").remove(),i.selectAll("*").remove();var g=new Set;o.nodes.forEach(function(t){Object.keys(t).forEach(function(t){g.add(t)})});var y=d3.forceSimulation().nodes(o.nodes).force("link",d3.forceLink(o.links).strength(u).distance(f)).force("center",d3.forceCenter(l/2,h/2)).force("charge",d3.forceManyBody().strength(p)).alphaTarget(v).velocityDecay(c),b=i.selectAll(".link").data(o.links).enter().append("line").attr("class","nv-force-link").style("stroke-width",function(t){return Math.sqrt(t.value)}),_=i.selectAll(".node").data(o.nodes).enter().append("g").attr("class","nv-force-node").call(d3.drag().on("start",function(t,e){t.sourceEvent.stopPropagation(),t.active||y.alphaTarget(v).restart(),e.fx=e.x,e.fy=e.y}).on("drag",function(t,e){e.fx=t.x,e.fy=t.y}).on("end",function(t,e){t.active||y.alphaTarget(v),e.fx=null,e.fy=null}));_.append("circle").attr("r",m).style("fill",function(t){return a(t)}).on("mouseover",function(t){i.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.py),i.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.px);var e=a(t);t.series=[],g.forEach(function(n){t.series.push({color:e,key:n,value:t[n]})}),s.data(t).hidden(!1)}).on("mouseout",function(t){s.hidden(!0)}),s.headerFormatter(function(t){return"Node"}),x(b),$(_),y.on("tick",function(){b.attr("x1",function(t){return t.source.x}).attr("y1",function(t){return t.source.y}).attr("x2",function(t){return t.target.x}).attr("y2",function(t){return t.target.y}),_.attr("transform",function(t){return"translate("+t.x+", "+t.y+")"})})}),k}return k.options=t.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},linkStrength:{get:function(){return u},set:function(t){u=t}},friction:{get:function(){return c},set:function(t){c=t}},linkDist:{get:function(){return f},set:function(t){f=t}},charge:{get:function(){return p},set:function(t){p=t}},gravity:{get:function(){return h},set:function(t){h=t}},theta:{get:function(){return g},set:function(t){g=t}},alpha:{get:function(){return v},set:function(t){v=t}},radius:{get:function(){return m},set:function(t){m=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}}},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)}},noData:{get:function(){return l},set:function(t){l=t}},nodeExtras:{get:function(){return $},set:function(t){$=t}},linkExtras:{get:function(){return x},set:function(t){x=t}}}),k.dispatch=o,k.tooltip=s,t.utils.initOptions(k),k},t.models.furiousLegend=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=28,c=!0,f=!0,p=!1,h=!1,g=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),v="classic";function m($){function x(t,e){return"furious"!=v?"#000":h?t.disengaged?a(t,e):"#fff":h?void 0:t.disabled?a(t,e):"#fff"}function y(t,e){return h&&"furious"==v?t.disengaged?"#fff":a(t,e):t.disabled?"#fff":a(t,e)}return $.each(function(m){var $=n-e.left-e.right,b=d3.select(this);t.utils.initSVG(b);var _=b.selectAll("g.nv-legend").data([m]).enter().append("g").attr("class","nvd3 nv-legend");_.attr("transform","translate("+e.left+","+e.top+")");var k=_.append("g").select("g"),w=b.selectAll("g.nv-legend").select("g").selectAll(".nv-series").data(function(t){return"furious"!=v?t:t.filter(function(t){return!!h||!t.disengaged})}),A=w.enter().append("g").attr("class","nv-series");if("classic"==v)O=A.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5).select("circle");else if("furious"==v){var C=A.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3);O=C.select("rect"),C.append("g").attr("class","nv-check-box").property("innerHTML",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)"),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<L.length;)F[S]=L[S],E+=L[S++];for(0===S&&(S=1);E>$&&S>1;){F=[],S--;for(var W=0;W<L.length;W++)L[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;I<S;I++)D[I]=T,T+=F[I];A.attr("transform",function(t,e){return"translate("+D[e%S]+","+(5+Math.floor(e/S)*P)+")"}),c?k.attr("transform","translate("+(n-e.right-E)+","+e.top+")"):k.attr("transform","translate(0,"+e.top+")"),r=e.top+e.bottom+Math.ceil(L.length/S)*P}else{var O,P,B,N=5,z=5,V=0;A.attr("transform",function(t,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return B=z,n<e.left+e.right+B+i&&(z=B=5,N+=P),(z+=i)>V&&(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'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+t.value+"</h3><table><tr><td>open:</td><td>"+e.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+e.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+e.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+e.yAxis.tickFormat()(n.low)+"</td></tr></table>"}),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'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+t.value+"</h3><table><tr><td>open:</td><td>"+e.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+e.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+e.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+e.yAxis.tickFormat()(n.low)+"</td></tr></table>"}),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",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)").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<S.length;)F[E]=S[E],L+=S[E++];for(0===E&&(E=1);L>$&&E>1;){F=[],E--;for(var W=0;W<S.length;W++)S[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;I<E;I++)D[I]=T,T+=F[I];C.attr("transform",function(t,e){return"translate("+D[e%E]+","+(5+Math.floor(e/E)*B)+")"}),c?w.attr("transform","translate("+(n-e.right-L)+","+e.top+")"):w.attr("transform","translate(0,"+e.top+")"),r=e.top+e.bottom+Math.ceil(S.length/E)*B}else{var O,P,B,N,z=5,V=5,Y=0;C.attr("transform",function(t,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return N=V,n<e.left+e.right+N+i&&(V=N=5,z+=B),(V+=i)>Y&&(Y=V),L<N+Y&&(L=N+Y),"translate("+N+","+z+")"}),w.attr("transform","translate("+(n-e.right-Y)+","+e.top+")"),r=e.top+e.bottom+z+15}"furious"==m&&(P.attr("width",function(t,e){return C.select("text.nv-legend-text").nodes()[e].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),w.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0),w.select(".nv-legend-bg").transition().duration(300).attr("x",-B).attr("width",L+B-12).attr("height",r+10).attr("y",-e.top-10).attr("opacity",g?1:0)),P.style("fill",b).style("fill-opacity",_).style("stroke",b)}),$}return $.dispatch=v,$.options=t.utils.optionsFunc.bind($),$._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}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return f},set:function(t){f=t}},enableDoubleClick:{get:function(){return p},set:function(t){p=t}},radioButtonMode:{get:function(){return h},set:function(t){h=t}},expanded:{get:function(){return g},set:function(t){g=t}},vers:{get:function(){return m},set:function(t){m=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($),$},t.models.line=function(){"use strict";var e,n,r=t.models.scatter(),i={top:0,right:0,bottom:0,left:0},o=960,a=500,s=null,l=1.5,u=t.utils.defaultColor(),c=function(t){return t.x},f=function(t){return t.y},p=function(t,e){return!isNaN(f(t,e))&&null!==f(t,e)},h=function(t){return t.area},g=!1,v=d3.curveLinear,m=(d3.curveBasis,250),$=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");r.pointSize(16).pointDomain([16,256]);var x,y,b=t.utils.renderWatch($,m);function _(m){return b.reset(),b.models(r),m.each(function(m){s=d3.select(this);var $=t.utils.availableWidth(o,s,i),_=t.utils.availableHeight(a,s,i);t.utils.initSVG(s),e=r.xScale(),n=r.yScale(),x=x||e,y=y||n;var k=s.selectAll("g.nv-wrap.nv-line").data([m]).enter().append("g").attr("class","nvd3 nv-wrap nv-line").attr("transform","translate("+i.left+","+i.top+")"),w=k.append("defs"),A=k.append("g");A.append("g").attr("class","nv-groups"),A.append("g").attr("class","nv-scatterWrap");var C=s.select(".nv-scatterWrap");r.width($).height(_),C.call(r),w.append("clipPath").attr("id","nv-edge-clip-"+r.id()).append("rect").attr("width",$).attr("height",_>0?_: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:t.data&&t.data.x?t.data.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<e;t++){var n=O[t];try{n.clearHighlights()}catch(r){}}}S.yDomain(b.domain()),G.length&&te.transition().call(L),R.length&&tn.transition().call(S),H.length&&tr.transition().call(C),X.length&&ti.transition().call(M),N.length&&ts.transition().call(_),z.length&&tl.transition().call(k),V.length&&to.transition().call(w),Y.length&&ta.transition().call(A),E._ticks(t.utils.calcTicksX($/100,u)),E.tickSizeInner(-B),U.attr("transform","translate(0,"+B+")"),U.transition().call(E),F._ticks(t.utils.calcTicksY(B/36,u)),F.tickSizeInner(-$),J.transition().call(F),W._ticks(t.utils.calcTicksY(B/36,u)),W.tickSizeInner(-$),tt.transition().call(W),J.classed("nv-disabled",!Z.length).attr("transform","translate("+x.range()[0]+",0)"),tt.classed("nv-disabled",!q.length).attr("transform","translate("+x.range()[1]+",0)"),D.dispatch.on("stateChange",function(t){T.call("stateChange",this,t),P.update()}),v&&(g.width($).height(B).margin({left:r.left,top:r.top}).svgContainer(h).xScale(x),tc.call(g)),v?(g.dispatch.on("elementMousemove",function(e){tk();var n,r,i,a=[];u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(s,l){var u=x.domain(),c=s.values.filter(function(t,e){return P.x()(t,e)>=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=r<o[0].extent[1]?o[0].extent[1]:r):o[0].hasNaN&&(r=r<o[0].extent[1]?o[0].extent[1]:r,W[t]=c[t].domain()[1],D=!0)),c[t]=d3.scaleLinear().domain([n,r]).range([(l-12)*.9,0]),b=[],c[t].brush=d3.brush().on("start",K).on("brush",Q).on("end",U)});var T=S.selectAll("g.nv-wrap.nv-parallelCoordinates").data([C]).enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates");T.attr("transform","translate("+i.left+","+i.top+")");var O=T.append("g"),P=T.select("g"),B=O.append("g").attr("class","nv-parallelCoordinates background"),N=O.append("g").attr("class","nv-parallelCoordinates foreground"),z=O.append("g").attr("class","nv-parallelCoordinates missingValuesline");k.curve(d3.curveCardinal.tension(_));var V=d3.drag().on("start",function t(e){y[e.key]=this.parentNode.__origin__=u(e.key),n.attr("visibility","hidden")}).on("drag",function t(n,i){y[i.key]=Math.min(s,Math.max(0,this.parentNode.__origin__+=n.x)),e.attr("d",q),h.sort(function(t,e){return tt(t.key)-tt(e.key)}),h.forEach(function(t,e){return t.currentPosition=e}),u.domain(h.map(function(t){return t.key})),r.attr("transform",function(t){return"translate("+tt(t.key)+")"})}).on("end",function t(r,i){delete this.parentNode.__origin__,delete y[r.key],d3.select(this.parentNode).attr("transform","translate("+u(r.key)+")"),e.attr("d",q),n.attr("d",q).attr("visibility",null),A.call("dimensionsOrder",this,h)}),Y=u.range()[1]-u.range()[0];if(Y=isNaN(Y)?u.range()[0]:Y,!isNaN(Y)){var H=[0+Y/2,l-12,s-Y/2,l-12];(M=z.selectAll("line").data([H])).enter().append("line"),M.exit().remove(),M.attr("x1",function(t){return t[0]}).attr("y1",function(t){return t[1]}).attr("x2",function(t){return t[2]}).attr("y2",function(t){return t[3]}),(L=z.selectAll("text").data([f])).append("text").data([f]),L.enter().append("text"),L.exit().remove(),L.attr("y",l).attr("x",s-92-Y/2).text(function(t){return t})}(n=B.selectAll("path").data(C)).enter().append("path"),n.exit().remove(),n.attr("d",q),(e=N.selectAll("path").data(C)).enter().append("path"),e.exit().remove(),e.attr("d",q).style("stroke-width",function(t,e){return isNaN(t.strokeWidth)&&(t.strokeWidth=1),t.strokeWidth}).attr("stroke",function(t,e){return t.color||m(t,e)}),e.on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0).style("stroke-width",e.strokeWidth+2+"px").style("stroke-opacity",1),A.call("elementMouseover",this,{label:e.name,color:e.color||m(e,n),values:e.values,dimensions:h})}),e.on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1).style("stroke-width",e.strokeWidth+"px").style("stroke-opacity",.7),A.call("elementMouseout",this,{label:e.name,index:e.index})}),e.on("mousemove",function(t,e){A.call("elementMousemove",this)}),e.on("click",function(t){A.call("elementClick",this,{id:t.id})});var X=(r=P.selectAll(".dimension").data(h)).enter().append("g").attr("class","nv-parallelCoordinates dimension");r.attr("transform",function(t){return"translate("+u(t.key)+",0)"}),X.append("g").attr("class","nv-axis"),X.append("text").attr("class","nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),A.call("elementMouseover",this,{label:e.tooltip||e.key,color:e.color})}).on("mouseout",function(t,e){A.call("elementMouseout",this,{label:t.tooltip})}).on("mousemove",function(t,e){A.call("elementMousemove",this)}).call(V),X.append("g").attr("class","nv-brushBackground"),r.exit().remove(),r.select(".nv-label").text(function(t){return t.key}),j(v);var G=g.filter(function(t){return null!==event.selection}),R=G.map(function(t){return c[t].brush.extent()}),Z=x.slice(0);function q(t){return k(h.map(function(e){if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key]))||D){var n=c[e.key].domain(),r=c[e.key].range(),i=n[0]-(n[1]-n[0])/9;if(0>b.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.dimension].domain()[0]&&(t.hasOnlyNaN=!0)}),A.call("end",x,t)}function J(){r.select(".nv-axis").each(function(t,e){var n=$.filter(function(e){return e.dimension==t.key});I[t.key]=c[t.key].domain(),0!=n.length&&v&&(I[t.key]=[],n[0].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='<table><thead><tr><td class="legend-color-guide"><div style="background-color:'+t.color+'"></div></td><td><strong>'+t.key+"</strong></td></tr></thead>";return 0!==t.series.length&&(e+='<tbody><tr><td height ="10px"></td></tr>',t.series.forEach(function(t){e=e+'<tr><td class="legend-color-guide"><div style="background-color:'+t.color+'"></div></td><td class="key">'+t.key+'</td><td class="value">'+t.value+"</td></tr>"}),e+="</tbody>"),e+="</table>"}),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<M.length;z++)O.push(B),P.push(N);else $?(O=L.map(function(t){return(t.outer-t.outer/10)*T}),P=L.map(function(t){return(t.inner-t.inner/10)*T}),A=d3.min(L.map(function(t){return t.inner-t.inner/10}))):(O=L.map(function(t){return t.outer*T}),P=L.map(function(t){return t.inner*T}),A=d3.min(L.map(function(t){return t.inner})));t.utils.initSVG(s);var V=s.selectAll(".nv-wrap.nv-pie").data([M]),Y=V.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+a);V=V.merge(Y);var H=Y.append("g");V.select("g");var X=H.append("g").attr("class","nv-pie");X=s.selectAll(".nv-wrap.nv-pie").selectAll(".nv-pie");var G=H.append("g").attr("class","nv-pieLabels");G=s.selectAll(".nv-wrap.nv-pie").selectAll(".nv-pieLabels"),V.attr("transform","translate("+e.left+","+e.top+")"),X.attr("transform","translate("+D/2+","+I/2+")"),G.attr("transform","translate("+D/2+","+I/2+")"),s.on("click",function(t,e,n){S.call("chartClick",this,{data:e,index:e.index,pos:t,id:a})}),E=[],F=[];for(var z=0;z<M.length;z++){var R=d3.arc().outerRadius(O[z]),Z=d3.arc().outerRadius(O[z]+5);!1!==b&&(R.startAngle(b),Z.startAngle(b)),!1!==k&&(R.endAngle(k),Z.endAngle(k)),v&&(R.innerRadius(P[z]),Z.innerRadius(P[z])),R.cornerRadius&&w&&(R.cornerRadius(w),Z.cornerRadius(w)),E.push(R),F.push(Z)}var q=d3.pie().sort(null).value(function(t){return t.disabled?0:o(t)});q.padAngle&&_&&q.padAngle(_),v&&m&&(X.select(".nv-pie-title").empty()&&X.append("text").attr("class","nv-pie-title"),V.select(".nv-pie-title").style("text-anchor","middle").text(function(t){return m}).style("font-size",Math.min(D,I)*A*2/(m.length+2)+"px").attr("dy","0.35em").attr("transform",function(t,e){return"translate(0, "+x+")"}));var j=s.select(".nv-wrap.nv-pie").selectAll(".nv-pie").selectAll(".nv-slice").data(q(M)),K=s.select(".nv-wrap.nv-pie").selectAll(".nv-pieLabels").selectAll(".nv-label").data(q(M.filter(function(t){return!t.disabled}))),Q=j.enter().append("g");if(Q.attr("class","nv-slice"),j.exit().remove(),K.exit().remove(),Q.on("mouseover",function(t,e,n){setCoordinates(t.pageX,t.pageY),d3.select(this).classed("hover",!0),$&&d3.select(this).select("path").transition().duration(70).attr("d",F[e.index]),S.call("elementMouseover",this,{data:e.data,index:e.index,color:d3.select(this).style("fill"),percent:(e.endAngle-e.startAngle)/(2*Math.PI)})}),Q.on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),$&&d3.select(this).select("path").transition().duration(50).attr("d",E[e.index]),S.call("elementMouseout",this,{data:e.data,index:e.index})}),Q.on("mousemove",function(t,e,n){S.call("elementMousemove",this,{data:e.data,index:e.index})}),Q.on("click",function(t,e,n){S.call("elementClick",this,{data:e.data,index:e.index,color:d3.select(this).style("fill"),event:t,element:this})}),Q.on("dblclick",function(t,e,n){S.call("elementDblClick",this,{data:e.data,index:e.index,color:d3.select(this).style("fill")})}),(Q=j.merge(Q)).attr("fill",function(t,e){return l(t.data,e)}),Q.attr("stroke",function(t,e){return l(t.data,e)}),Q.append("path").each(function(t){this._current=t}),Q.select("path").transition().duration(C).attr("d",function(t,e){return E[e](t)}).attrTween("d",function t(e,n){e.endAngle=isNaN(e.endAngle)?0:e.endAngle,e.startAngle=isNaN(e.startAngle)?0:e.startAngle,v||(e.innerRadius=0);var r=d3.interpolate(this._current,e);return this._current=r(0),function(t){return E[n](r(t))}}),c){for(var U=[],z=0;z<M.length;z++)U.push(E[z]),f?v&&(U[z]=d3.arc().outerRadius(E[z].outerRadius()),!1!==b&&U[z].startAngle(b),!1!==k&&U[z].endAngle(k)):v||U[z].innerRadius(0);K.enter().append("g").classed("nv-label",!0);var J=s.select(".nv-wrap.nv-pie").selectAll(".nv-pieLabels").selectAll(".nv-label").each(function(t,e){var n=d3.select(this);n.attr("transform",function(t,e){if(!y)return t.outerRadius=T+10,t.innerRadius=T+15,"translate("+U[e].centroid(t)+")";t.outerRadius=O[e]+10,t.innerRadius=O[e]+15;var n=(t.startAngle+t.endAngle)/2*(180/Math.PI);return(t.startAngle+t.endAngle)/2<Math.PI?n-=90:n+=90,"translate("+U[e].centroid(t)+") rotate("+n+")"}),n.append("rect"),s.select(".nv-wrap.nv-pie").selectAll(".nv-pieLabels").select("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),n.append("text"),s.select(".nv-wrap.nv-pie").selectAll(".nv-pieLabels").select("text").style("text-anchor",y?(t.startAngle+t.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")}),tt={},te=function(t){return 140*Math.floor(t[0]/140)+","+14*Math.floor(t[1]/14)},tn=function(t){return(t.endAngle-t.startAngle)/(2*Math.PI)};J.watchTransition(W,"pie labels").attr("transform",function(t,e){if(y){t.outerRadius=O[e]+10,t.innerRadius=O[e]+15;var n=(t.startAngle+t.endAngle)/2*(180/Math.PI);return(t.startAngle+t.endAngle)/2<Math.PI?n-=90:n+=90,"translate("+U[e].centroid(t)+") rotate("+n+")"}t.outerRadius=T+10,t.innerRadius=T+15;var r=U[e].centroid(t),i=tn(t);return t.value&&i>=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)/2<Math.PI?"start":"end":"middle"}).text(function(t,e){var n=tn(t),r="";if(!t.value||n<h)return"";if("function"==typeof p)r=p(t,e,{key:String(i(t.data)).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2"),value:String(o(t.data)).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2"),percent:u(n)});else switch(p){case"key":r=i(t.data).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2");break;case"value":r=u(o(t.data)).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2");break;case"percent":r=d3.format(".0%")(n).replace(/\.0+([A-Za-z]*)$/,"$1").replace(/\.([1-9]+)0+([A-Za-z]*)$/,".$1$2")}return r}),g&&J.each(function(e,n){if(this.getBBox){var r=this.getBBox(),i=U[n].centroid(e),o={x:i[0]+r.x,y:i[1]+r.y},a={x:o.x+r.width,y:o.y},s={x:o.x,y:o.y+r.height},l={x:o.x+r.width,y:o.y+r.height};e.visible=t.utils.pointIsInArc(o,e,R)&&t.utils.pointIsInArc(a,e,R)&&t.utils.pointIsInArc(s,e,R)&&t.utils.pointIsInArc(l,e,R)}}).style("display",function(t){return t.visible?null:"none"}),J.merge(K)}function tr(t){var e=(t.startAngle+t.endAngle)*90/Math.PI-90;return e>90?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();$/2<A&&(A=$/2),n.height(y).key(e.x()),n.width(A),$-=n.width(),w.datum(r).call(n).attr("transform","translate("+$+",0)")}else"bottom"===c&&(n.width($).key(e.x()),w.datum(r).call(n),i.bottom=n.height(),y=t.utils.availableHeight(s,f,i),w.attr("transform","translate(0,"+y+")"))}else w.selectAll("*").remove();b.attr("transform","translate("+i.left+","+i.top+")"),e.width($).height(y);var C=f.select(".nv-pieChart").selectAll(".nv-pieWrap").data([r]);(C=C.merge(k)).transition().call(e),n.dispatch.on("stateChange",function(t){for(var e in t)p[e]=t[e];m.call("stateChange",this,t),x.update()}),m.on("changeState",function(t){void 0!==t.disabled&&(r.forEach(function(e,n){e.disabled=t.disabled[n]}),p.disabled=t.disabled),x.update()})}),$.renderEnd("pieChart immediate"),x}return e.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:x.x()(t.data),value:x.y()(t.data),color:t.color,percent:t.percent},l||(delete t.percent,delete t.series.percent),r.data(t).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){r.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(t){r()}),x.legend=n,x.dispatch=m,x.pie=e,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}},noData:{get:function(){return g},set:function(t){g=t}},showTooltipPercent:{get:function(){return l},set:function(t){l=t}},showLegend:{get:function(){return u},set:function(t){u=t}},legendPosition:{get:function(){return c},set:function(t){c=t}},defaultState:{get:function(){return h},set:function(t){h=t}},color:{get:function(){return f},set:function(t){f=t,n.color(f),e.color(f)}},duration:{get:function(){return v},set:function(t){v=t,$.reset(v),e.duration(v)}},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}}}),t.utils.inheritOptions(x,e),t.utils.initOptions(x),x},t.models.sankey=function(){"use strict";var e={},n=24,r=8,i=[1,1],o=[],a=[],s=!0,l=function(t){o.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),a.forEach(function(t){var e=t.source,n=t.target;"number"==typeof e&&(e=t.source=o[t.source]),"number"==typeof n&&(n=t.target=o[t.target]),e.sourceLinks.push(t),n.targetLinks.push(t)}),o.forEach(function(t){t.value=Math.max(d3.sum(t.sourceLinks,g),d3.sum(t.targetLinks,g))}),function t(){for(var e,r,a,l=o,u=0;l.length&&u<o.length;)a=[],l.forEach(function(t){t.x=u,t.dx=n,t.sourceLinks.forEach(function(t){0>a.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;o<s;++o)(n=a-(e=t[o]).y)>0&&(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.x<r/2}).attr("x",6+n.nodeWidth()).attr("text-anchor","start")}),$}return $.options=t.utils.optionsFunc.bind($),$._options=Object.create({},{units:{get:function(){return s},set:function(t){s=t}},width:{get:function(){return r},set:function(t){r=t}},height:{get:function(){return i},set:function(t){i=t}},format:{get:function(){return c},set:function(t){c=t}},linkTitle:{get:function(){return p},set:function(t){p=t}},nodeWidth:{get:function(){return o},set:function(t){o=t}},nodePadding:{get:function(){return a},set:function(t){a=t}},center:{get:function(){return l},set:function(t){l=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}},nodeStyle:{get:function(){return{}},set:function(t){h=void 0!==t.fillColor?t.fillColor:h,g=void 0!==t.strokeColor?t.strokeColor:g,v=void 0!==t.title?t.title:v}}}),t.utils.initOptions($),$},t.models.scatter=function(){"use strict";var e,n,r,i,o,a,s,l,u={top:0,right:0,bottom:0,left:0},c=null,f=null,p=t.utils.defaultColor(),h=null,g=Math.floor(1e5*Math.random()),v=null,m=d3.scaleLinear(),$=d3.scaleLinear(),x=d3.scaleLinear(),y=function(t){return t.x},b=function(t){return t.y},_=function(t){return t.size||1},k=function(t){return t.shape||"circle"},w=[],A=[],C=[],M=!0,L=function(t){return!t.notActive},S=!1,E=.1,F=!1,W=!0,D=!1,I=function(){return 25},T=null,O=null,P=null,B=null,N=null,z=null,V=!1,Y=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),H=!0,X=250,G=300,R=!1,Z=!1,q=t.utils.renderWatch(Y,X),j=[16,256],K={};function Q(t){var e;delete K[e=t[0].series+":"+t[1]]}function U(t){var e,n,r,i,o,a,s=r=K[n=(e=t)[0].series+":"+e[1]]=K[n]||{},l=!1;for(i=1;i<arguments.length;i+=2)o=arguments[i],a=arguments[i+1](t[0],t[1]),s[o]===a&&s.hasOwnProperty(o)||(s[o]=a,l=!0);return l}function J(X){return q.reset(),X.each(function(X){v=d3.select(this);var K=t.utils.availableWidth(c,v,u),tt=t.utils.availableHeight(f,v,u);t.utils.initSVG(v),X.forEach(function(t,e){t.values.forEach(function(t){t.series=e,t.seriesIndex=e})});var te="function"==typeof J.yScale().base,tn=T&&O&&N?[]:d3.merge(X.map(function(t){return t.values.map(function(t,e){return{x:y(t,e),y:b(t,e),size:_(t,e)}})}));if(m.domain(T||d3.extent(tn.map(function(t){return t.x}).concat(w))),S&&X[0]?m.range(P||[(K*E+K)/(2*X[0].values.length),K-K*(1+E)/(2*X[0].values.length)]):m.range(P||[0,K]),te){var tr=d3.min(tn.map(function(t){if(0!==t.y)return t.y}));$.clamp(!0).domain(O||d3.extent(tn.map(function(t){return 0!==t.y?t.y:.1*tr}).concat(A))).range(B||[tt,0])}else $.domain(O||d3.extent(tn.map(function(t){return t.y}).concat(A))).range(B||[tt,0]);x.domain(N||d3.extent(tn.map(function(t){return t.size}).concat(C))).range(z||j),V=m.domain()[0]===m.domain()[1]||$.domain()[0]===$.domain()[1],m.domain()[0]===m.domain()[1]&&(m.domain()[0]?m.domain([m.domain()[0]-.01*m.domain()[0],m.domain()[1]+.01*m.domain()[1]]):m.domain([-1,1])),$.domain()[0]===$.domain()[1]&&($.domain()[0]?$.domain([$.domain()[0]-.01*$.domain()[0],$.domain()[1]+.01*$.domain()[1]]):$.domain([-1,1])),isNaN(m.domain()[0])&&m.domain([-1,1]),isNaN($.domain()[0])&&$.domain([-1,1]),e=e||m,n=n||$,r=r||x;var ti=m(1)!==e(1)||$(1)!==n(1)||x(1)!==r(1);a=a||c,s=s||f;var to=a!==c||s!==f,ta=(i=i||[])[0]!==m.domain()[0]||i[1]!==m.domain()[1];i=m.domain(),o=o||[],ta=ta||o[0]!==$.domain()[0]||o[1]!==$.domain()[1],o=$.domain();var ts=v.selectAll("g.nv-wrap.nv-scatter").data([X]),tl=ts.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+g);tl.classed("nv-single-point",V);var tu=tl.append("defs"),tc=tl.append("g");tc.append("g").attr("class","nv-groups");var td=tc.append("g").attr("class","nv-point-paths"),tf=tl.append("g").attr("class","nv-point-clips");function tp(){if(Z=!1,!M)return!1;if(v.selectAll(".nv-point.hover").classed("hover",!1),td.selectAll("path").remove(),!0===H){var e=d3.merge(X.map(function(e,n){return e.values.map(function(e,r){var i=y(e,r),o=b(e,r);return[t.utils.NaNtoZero(m(i))+1e-4*Math.random(),t.utils.NaNtoZero($(o))+1e-4*Math.random(),n,r,e]}).filter(function(t,e){return L(t[4],e)})}));if(0==e.length)return!1;e.length<3&&(e.push([m.range()[0]-20,$.range()[0]-20,null,null]),e.push([m.range()[1]+20,$.range()[1]+20,null,null]),e.push([m.range()[0]-20,$.range()[0]+20,null,null]),e.push([m.range()[1]+20,$.range()[1]-20,null,null]));var n=[[-10,-10],[-10,f+10],[c+10,f+10],[c+10,-10]];e=e.sort(function(t,e){return t[0]-e[0]||t[1]-e[1]});for(var r=0;r<e.length-1;)1e-4>Math.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;a<e.length;a++)Math.abs(r.x()(e[a],a)-n)<i&&(i=Math.abs(r.x()(e[a],a)-n),o=a);return o}(g,Math.round(e.invert(o)))],E()}}).on("click",function(){l=!l}).on("mouseout",function(){s=[],E()});function E(){if(!l){var t=C.selectAll(".nv-hoverValue").data(s);t.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove();var n=t.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);if(t.attr("transform",function(t){return"translate("+e(r.x()(g[t],t))+",0)"}).transition().duration(250).style("stroke-opacity",s.length?1:0).style("fill-opacity",s.length?1:0),!s.length){t.merge(t);return}n.append("line").attr("x1",0).attr("y1",-i.top).attr("x2",0).attr("y2",x),n.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-i.top).attr("text-anchor","end").attr("dy",".9em"),C.select(".nv-hoverValue .nv-xValue").text(u(r.x()(g[s[0]],s[0]))),n.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-i.top).attr("text-anchor","start").attr("dy",".9em"),C.select(".nv-hoverValue .nv-yValue").text(c(r.y()(g[s[0]],s[0])))}}S.attr("transform",function(t){return"translate("+-i.left+","+-i.top+")"}).attr("width",m+i.left+i.right).attr("height",x+i.top),S.merge(C)}),m.renderEnd("sparklinePlus immediate"),$}return $.dispatch=v,$.sparkline=r,$.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}},xTickFormat:{get:function(){return u},set:function(t){u=t}},yTickFormat:{get:function(){return c},set:function(t){c=t}},showLastValue:{get:function(){return f},set:function(t){f=t}},alignValue:{get:function(){return p},set:function(t){p=t}},rightAlignValue:{get:function(){return h},set:function(t){h=t}},noData:{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}}}),t.utils.inheritOptions($,r),t.utils.initOptions($),$},t.models.stackedArea=function(){"use strict";var e,n,r={top:0,right:0,bottom:0,left:0},i=960,o=500,a=t.utils.defaultColor(),s=Math.floor(1e5*Math.random()),l=null,u=function(t){return t.x},c=function(t){return t.y},f=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},p="stack",h=d3.stackOffsetNone,g=d3.stackOrderNone,v=getInterpolationType(v),m=!1,$=t.models.scatter(),x=250,y=function(t,e,n){t.display={y:n,y0:e}},b=function(t){return n(t.display.y+t.display.y0)},_=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");$.pointSize(2.2).pointDomain([2.2,2.2]);var k=t.utils.renderWatch(_,x);function w(p){return k.reset(),k.models($),p.each(function(p){var x=i-r.left-r.right,y=o-r.top-r.bottom;l=d3.select(this),t.utils.initSVG(l),e=$.xScale(),n=$.yScale();var A=p;p.forEach(function(t,e){t.seriesIndex=e,t.values=t.values.map(function(t,n){return t.index=n,t.seriesIndex=e,t})});var C=p.filter(function(t){return!t.disabled}),M=[];C[0].values.forEach(function(t){M.push({x:t[0]})}),C.forEach(function(t,e,n){t.display={y:e,y0:n},t.values.forEach(function(e){M[e.index][t.key]=e[1]})});var L=C.map(t=>t.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<o;++n){for(e=0,r=0;e<A.length;e++)r+=c(A[e].values[n]);if(r)for(e=0;e<i;e++)t[e][n][1]/=r;else for(e=0;e<i;e++)t[e][n][1]=0}for(n=0;n<o;++n)a[n]=0;return a}}),k.renderEnd("stackedArea immediate"),w}return w.dispatch=_,w.scatter=$,$.dispatch.on("elementClick",function(){_.apply("elementClick",this,arguments)}),$.dispatch.on("elementMouseover",function(){_.apply("elementMouseover",this,arguments)}),$.dispatch.on("elementMouseout",function(){_.apply("elementMouseout",this,arguments)}),w.interpolate=function(t){return arguments.length?(v=t,w):v},w.duration=function(t){return arguments.length?(x=t,k.reset(x),$.duration(x),w):x},w.dispatch=_,w.scatter=$,w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return i},set:function(t){i=t}},height:{get:function(){return o},set:function(t){o=t}},defined:{get:function(){return f},set:function(t){f=t}},clipEdge:{get:function(){return m},set:function(t){m=t}},offset:{get:function(){return h},set:function(t){h=t}},order:{get:function(){return g},set:function(t){g=t}},interpolate:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return u},set:function(t){u="function"==typeof t?t:function(){return t}}},y:{get:function(){return c},set:function(t){c="function"==typeof t?t:function(){return t}}},areaY1:{get:function(){return b},set:function(t){b="function"==typeof t?t:function(){return t}}},transformData:{get:function(){return y},set:function(t){y="function"==typeof t?t:function(){return t}}},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}},color:{get:function(){return a},set:function(e){a=t.utils.getColor(e)}},style:{get:function(){return p},set:function(t){switch(p=t){case"stack":w.offset(d3.stackOffsetNone),w.order(d3.stackOrderNone);break;case"stream":w.offset(d3.stackOffsetWiggle),w.order(d3.stackOrderInsideOut);break;case"stream_center":w.offset(d3.stackOffsetSilhouette),w.order(d3.stackOrderNone);break;case"expand":w.offset(d3.stackOffsetExpand),w.order(d3.stackOrderNone);break;case"stack_percent":w.offset(w.d3_stackedOffset_stackPercent),w.order(d3.stackOrderNone)}}},duration:{get:function(){return x},set:function(t){x=t,k.reset(x),$.duration(x)}}}),t.utils.inheritOptions(w,$),t.utils.initOptions(w),w},t.models.stackedAreaChart=function(){"use strict";var e,n,r=t.models.stackedArea(),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=t.models.focus(t.models.stackedArea()),f={top:10,right:25,bottom:50,left:60},p=null,h=null,g=null,v=t.utils.defaultColor(),m=!0,$=!0,x="top",y=!0,b=!0,_=!1,k=!1,w=!1,A=!0,C="TOTAL",M=t.utils.state(),L=null,S=null,E=d3.dispatch("stateChange","changeState","renderEnd"),F=250,W=["Stacked","Stream","Expanded"],D={},I=250,T=d3.transition().duration(I).ease(d3.easeLinear);M.style=r.style(),i.tickPadding(7),u.headerFormatter(function(t,e){return i.tickFormat()(t,e)}).valueFormatter(function(t,e){return o.tickFormat()(t,e)}),l.tooltip.headerFormatter(function(t,e){return i.tickFormat()(t,e)}).valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)});var O=null,P=null;s.updateState(!1);var B=t.utils.renderWatch(E),N=r.style(),z=d3.format(".0%");function V(u){return B.reset(),B.models(r),y&&B.models(i),b&&B.models(o),u.each(function(u){var S,T,B=d3.select(this);t.utils.initSVG(B);var Y,H,X=t.utils.availableWidth(h,B,f),G=t.utils.availableHeight(g,B,f)-(k?c.height():0);if(V.update=function(){B.transition().duration(I).call(V)},V.container=this,M.setter((Y=u,function(t){void 0!==t.style&&(N=t.style),void 0!==t.active&&Y.forEach(function(e,n){e.disabled=!t.active[n]})}),V.update).getter((H=u,function(){return{active:H.map(function(t){return!t.disabled}),style:r.style()}})).update(),M.disabled=u.map(function(t){return!!t.disabled}),!L)for(S in L={},M)M[S]instanceof Array?L[S]=M[S].slice(0):L[S]=M[S];if(!u||!u.length||!u.filter(function(t){return t.values.length}).length)return t.utils.noData(V,B),V;B.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale();var R=B.selectAll("g.nv-wrap.nv-stackedAreaChart").data([u]).enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart"),Z=R.append("g");R.select("g");var q=Z.append("g").attr("class","nv-legendWrap");q=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-legendWrap");var j=Z.append("g").attr("class","nv-controlsWrap");j=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-controlsWrap");var K=Z.append("g").attr("class","nv-focus"),Q=K.append("g").attr("class","nv-background").append("rect"),U=K.append("g").attr("class","nv-x nv-axis");U=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-x");var J=K.append("g").attr("class","nv-y nv-axis");J=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-y");var tt=K.append("g").attr("class","nv-stackedWrap");tt=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-stackedWrap");var te=K.append("g").attr("class","nv-interactive");te=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-interactive");var tn=Z.append("g").attr("class","nv-focusWrap");if(tn=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-focusWrap"),$){var tr=m&&"top"===x?X-F:X;if(a.width(tr),q.datum(u).call(a),"bottom"===x){var ti=i.height();f.bottom=Math.max(a.height()+ti,f.bottom);var to=(G=t.utils.availableHeight(g,B,f)-(k?c.height():0))+ti;q.attr("transform","translate(0,"+to+")")}else"top"===x&&(p||f.top==a.height()||(f.top=a.height(),G=t.utils.availableHeight(g,B,f)-(k?c.height():0)),q.attr("transform","translate("+(X-tr)+","+-f.top+")"))}else q.selectAll("*").remove();if(R.attr("transform","translate("+f.left+","+f.top+")"),m){var ta=[{key:D.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=r.style(),style:"stack"},{key:D.stream||"Stream",metaKey:"Stream",disabled:"stream"!=r.style(),style:"stream"},{key:D.stream_center||"Stream Center",metaKey:"Stream_Center",disabled:"stream_center"!=r.style(),style:"stream_center"},{key:D.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=r.style(),style:"expand"},{key:D.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=r.style(),style:"stack_percent"}];F=W.length/3*260,ta=ta.filter(function(t){return -1!==W.indexOf(t.metaKey)}),s.width(F).color(["#444","#444","#444"]),j.datum(ta).call(s);var ts=Math.max(s.height(),$&&"top"===x?a.height():0);f.top!=ts&&(f.top=ts,G=t.utils.availableHeight(g,B,f)-(k?c.height():0)),j.attr("transform","translate(0,"+-f.top+")")}else j.selectAll("*").remove();function tl(){y&&U.attr("transform","translate(0,"+G+")").transition().duration(I).call(i)}function tu(){if(b){if("expand"===r.style()||"stack_percent"===r.style()){var t=o.tickFormat();O&&t===z||(O=t),o.tickFormat(z)}else O&&(o.tickFormat(O),O=null);J.transition().call(o)}}if(_&&J.attr("transform","translate("+X+",0)"),w&&(l.width(X).height(G).margin({left:f.left,top:f.top}).svgContainer(B).xScale(e),te.call(l)),Q.attr("width",X).attr("height",G),r.width(X).height(G).color(u.map(function(t,e){return t.color||v(t,e)}).filter(function(t,e){return!u[e].disabled})),tt.datum(u.filter(function(t){return!t.disabled})),y&&(i.scale(e)._ticks(t.utils.calcTicksX(X/100,u)),i.tickSizeInner(-G)),b&&(T=r.offset()===d3.stackOffsetWiggle?0:t.utils.calcTicksY(G/36,u),o.scale(n)._ticks(T),o.tickSizeInner(-X)),k){c.width(X),tn.attr("transform","translate(0,"+(G+f.bottom+c.margin().top)+")").datum(u.filter(function(t){return!t.disabled})).call(c);var tc=null==d3.event||null===d3.event.selection?c.xDomain():c.brush.selection();null!==tc&&td(tc)}else tt.transition().call(r),tl(),tu();function td(t){tt.datum(u.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}})),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.x+t.dx&&e.depth>=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.12"}();
|