@wavemaker/app-ng-runtime 11.5.1-rc.5420 → 11.5.1-rc.5421
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-ng-runtime/components/base/bundles/index.umd.js +10 -39
- app-ng-runtime/components/base/esm2020/pipes/custom-pipes.mjs +11 -24
- app-ng-runtime/components/base/fesm2015/index.mjs +10 -39
- app-ng-runtime/components/base/fesm2015/index.mjs.map +1 -1
- app-ng-runtime/components/base/fesm2020/index.mjs +10 -39
- app-ng-runtime/components/base/fesm2020/index.mjs.map +1 -1
- app-ng-runtime/components/base/pipes/custom-pipes.d.ts +2 -5
- app-ng-runtime/components/chart/bundles/index.umd.js +31 -19
- app-ng-runtime/components/chart/esm2020/chart.component.mjs +4 -4
- app-ng-runtime/components/chart/esm2020/chart.utils.mjs +11 -19
- app-ng-runtime/components/chart/fesm2015/index.mjs +13 -21
- app-ng-runtime/components/chart/fesm2015/index.mjs.map +1 -1
- app-ng-runtime/components/chart/fesm2020/index.mjs +13 -21
- app-ng-runtime/components/chart/fesm2020/index.mjs.map +1 -1
- app-ng-runtime/components/containers/wizard/bundles/index.umd.js +3 -14
- app-ng-runtime/components/containers/wizard/esm2020/wizard.component.mjs +4 -13
- app-ng-runtime/components/containers/wizard/esm2020/wizard.props.mjs +1 -2
- app-ng-runtime/components/containers/wizard/fesm2015/index.mjs +3 -14
- app-ng-runtime/components/containers/wizard/fesm2015/index.mjs.map +1 -1
- app-ng-runtime/components/containers/wizard/fesm2020/index.mjs +3 -13
- app-ng-runtime/components/containers/wizard/fesm2020/index.mjs.map +1 -1
- app-ng-runtime/components/containers/wizard/wizard.component.d.ts +0 -2
- app-ng-runtime/components/input/default/bundles/index.umd.js +6 -18
- app-ng-runtime/components/input/default/esm2020/number/number.props.mjs +2 -4
- app-ng-runtime/components/input/default/esm2020/text/calendar/input-calendar.props.mjs +2 -4
- app-ng-runtime/components/input/default/esm2020/text/color/input-color.props.mjs +2 -4
- app-ng-runtime/components/input/default/esm2020/text/email/input-email.props.mjs +2 -4
- app-ng-runtime/components/input/default/esm2020/text/number/input-number.props.mjs +2 -4
- app-ng-runtime/components/input/default/esm2020/text/text/input-text.props.mjs +2 -4
- app-ng-runtime/components/input/default/fesm2015/index.mjs +6 -18
- app-ng-runtime/components/input/default/fesm2015/index.mjs.map +1 -1
- app-ng-runtime/components/input/default/fesm2020/index.mjs +6 -18
- app-ng-runtime/components/input/default/fesm2020/index.mjs.map +1 -1
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/runtime/base/bundles/index.umd.js +1 -26
- app-ng-runtime/runtime/base/components/base-page.component.d.ts +0 -1
- app-ng-runtime/runtime/base/esm2020/components/base-page.component.mjs +1 -26
- app-ng-runtime/runtime/base/esm2020/services/pipe-provider.service.mjs +2 -2
- app-ng-runtime/runtime/base/fesm2015/index.mjs +1 -26
- app-ng-runtime/runtime/base/fesm2015/index.mjs.map +1 -1
- app-ng-runtime/runtime/base/fesm2020/index.mjs +1 -26
- app-ng-runtime/runtime/base/fesm2020/index.mjs.map +1 -1
- app-ng-runtime/scripts/@wavemaker.com/nvd3/build/nv.d3.min.js +13 -1
- app-ng-runtime/scripts/d3/d3.min.js +5 -2
- app-ng-runtime/components/base/esm2020/pipes/wm-pipe.mjs +0 -17
- app-ng-runtime/components/base/pipes/wm-pipe.d.ts +0 -9
|
@@ -1 +1,13 @@
|
|
|
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},y=function(t,e){return t},x=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 y(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,c=document.documentElement.clientHeight;switch(r){case"e":e=-s-i,n=-(a/2),t.left+e<0&&(e=i),(o=t.top+n)<0&&(n-=o),(o=t.top+n+a)>c&&(n-=o-c);break;case"w":e=i,n=-(a/2),t.left+e+s>l&&(e=-s-i),(o=t.top+n)<0&&(n-=o),(o=t.top+n+a)>c&&(n-=o-c);break;case"n":e=-(s/2)-5,n=i,t.top+n+a>c&&(n=-a-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=x(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 x},set:function(t){x=t}},valueFormatter:{get:function(){return m},set:function(t){m=t}},headerFormatter:{get:function(){return $},set:function(t){$=t}},keyFormatter:{get:function(){return y},set:function(t){y=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.scaleBand(),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,y=250,x=d3.dispatch("renderEnd");e.tickFormat(t=>t);var b=t.utils.renderWatch(x,y);function _(l){return b.reset(),l.each(function(l){var y,x,_,k,w,A=d3.select(this);t.utils.initSVG(A);var C=A.selectAll("g.nv-wrap.nv-axis").data([l]),M=C.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),L=(M=M.merge(C)).append("g");L.select("g"),L=M.select("g"),null!==v?e.ticks(v):("top"===n||"bottom"===n)&&e.ticks(Math.abs(o.range()[1]-o.range()[0])/100),L.watchTransition(b,"axis").call(e),r=r||e.scale();var S=e.tickFormat();null==S&&(S=r.tickFormat()),L.attr("fill","");var E=L.selectAll("text.nv-axislabel").data([u||null]);switch(E.exit().remove(),void 0!==$&&L.selectAll("g").select("text").style("font-size",$),n){case"top":x=m+36;var y=E.enter().append("text").attr("class","nv-axislabel");y=A.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel"),w=0,1===o.range().length?w=g?2*o.range()[0]+o.bandwidth():0:2===o.range().length?w=g?o.range()[0]+o.range()[1]+o.bandwidth():o.range()[1]:o.range().length>2&&(w=o.range()[o.range().length-1]+(o.range()[1]-o.range()[0])),y.attr("text-anchor","middle").attr("y",-x).attr("x",w/2),c&&(_=L.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")).merge(L),(_=A.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(" "))).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||S)(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":x=m+36;var F=30,W=0,D=L.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));x=(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)");y=E.enter().append("text").attr("class","nv-axislabel"),y=A.selectAll("g.nv-wrap.nv-axis").selectAll("text.nv-axislabel"),w=0,1===o.range().length?w=g?2*o.range()[0]+o.bandwidth():0:2===o.range().length?w=g?o.range()[0]+o.range()[1]+o.bandwidth():o.range()[1]:o.range().length>2&&(w=o.range()[o.range().length-1]+(o.range()[1]-o.range()[0])),y.attr("text-anchor","middle").attr("y",x).attr("x",w/2),c&&(_=L.enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}),(_=(k=A.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data([o.domain()[0],o.domain()[o.domain().length-1]])).merge(_)).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||S)(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":y=E.enter().append("text").attr("class","nv-axislabel"),(y=A.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&&(L.selectAll("g.nv-axisMaxMin").data(o.domain()),_=L.enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}),(_=(k=A.selectAll("g.nv-wrap.nv-axis").selectAll("g.nv-axisMaxMin").data(o.domain())).merge(_)).append("text").style("opacity",1),_.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||S)(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":y=E.enter().append("text").attr("class","nv-axislabel"),(y=A.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&&(_=L.enter().append("g").attr("class",(t,e)=>["nv-axisMaxMin","nv-axisMaxMin-x",0===e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")).merge(L),(_=A.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(" "))).append("text").style("opacity",1),_.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||S)(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(y.text(function(t){return t}),c&&("left"===n||"right"===n)&&(L.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",1))}),o.domain()[0]==o.domain()[1]&&0==o.domain()[0]&&_.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)}}),L.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())})}L.selectAll(".tick").filter(function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t}).classed("zero",!0),r=o.copy()}),b.renderEnd("axis immediate"),_}return _.axis=e,_.dispatch=x,_.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 y},set:function(t){y=t,b.reset(y)}},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},y=function(t){return t.values.whisker_high},x=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=y(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);[$,y].forEach(function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===$?"low":"high";n.append("line").style("stroke",x(t)||A(t,e)).attr("class","nv-boxplot-whisker nv-boxplot-"+i),n.append("line").style("stroke",x(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};[$,y].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))})}),[$,y].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:x(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:x(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:x(e)||A(e,n)},{key:"Q2",value:v(e),color:x(e)||A(e,n)},{key:"Q1",value:g(e),color:x(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:x(e)||A(e,n)},{key:"Q2",value:v(e),color:x(e)||A(e,n)},{key:"Q1",value:g(e),color:x(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 x(t)||A(t,e)}).style("stroke",function(t,e){return x(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 y},set:function(t){y=t}},itemColor:{get:function(){return x},set:function(t){x=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,y=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 x=t.utils.renderWatch(m,$);function b(u){return x.reset(),x.models(r),c&&x.models(i),f&&x.models(o),u.each(function(u){var g=d3.select(this);t.utils.initSVG(g);var y=(s||parseInt(g.style("width"))||960)-a.left-a.right,x=(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+y/2).attr("y",a.top+x/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("+y+",0)"),r.width(y).height(x),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(y/100,u)),i.tickSizeInner(-x),C.attr("transform","translate(0,"+n.range()[0]+")"),C.call(i);var E=C.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(x/36)),o.tickSizeInner(-y),M.call(o)),L.attr("x1",0).attr("x2",y).attr("y1",n(0)).attr("y2",n(0))}),x.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,x.reset($),y=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"]),y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),x=["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(){y.call("elementMouseover",this,{value:L[0],label:W[0]||"Current",color:d3.select(this).style("fill")})}).on("mousemove",function(){y.call("elementMousemove",this,{value:L[0],label:W[0]||"Current",color:d3.select(this).style("fill")})}).on("mouseout",function(){y.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){y.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){y.call("elementMousemove",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){y.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){y.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){y.call("elementMousemove",this,{value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){y.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]||x[e];y.call("elementMouseover",this,{value:t,label:n,color:d3.select(this).style("fill")})}).on("mousemove",function(){y.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]||x[e];y.call("elementMouseout",this,{value:t,label:n,color:d3.select(this).style("fill")})})}),A}return A.dispatch=y,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 y=a.call(this,r,h).slice().sort(d3.descending),x=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(y[0],x[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},y=[],x=[],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(y))),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(x)),d3.max(k[0].values.map(m).concat(x))]).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 y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=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,y=!1,x=!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]),q=u.filter(function(t){return!t.disabled&&!t.tempDisabled}),Z=R.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").attr("transform","translate("+c.left+","+c.top+")"),j=Z.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([q]).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(),x){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();y&&U.attr("transform","translate("+Y+",0)");var to=u.filter(function(t){return t.tempDisabled});Z.select(".tempDisabled").remove(),to.length&&Z.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.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([q]).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 x},set:function(t){x=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 y},set:function(t){y=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(),y=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 x(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(x,e),x;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),x.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(y);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(y),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()}),x.update=function(){A.selectAll("*").remove(),A.transition().duration(300).call(x)},x})}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 x.options=t.utils.optionsFunc.bind(x),x._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 y},set:function t(e){y=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}}}),x.xAxis=n.xAxis,x.yAxis=n.yAxis1,x.multiChart=n,x.focus=r,x.processData=b,t.utils.inheritOptions(x,n),t.utils.initOptions(x),x},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(),y=0,x=!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))),x?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);x?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",y).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 x},set:function(t){x=t}},cornerRadius:{get:function(){return y},set:function(t){y=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,y=!1,x=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.selectAll("g");$&&T.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}),x&&T.selectAll(".tick text").attr("transform","rotate("+x+" 0,0)").style("text-anchor",x>0?"start":"end"),y&&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 x},set:function(t){x=t}},wrapLabels:{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}},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},y=function(t){return t.values.q2},x=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),y=[];void 0!==d3.beeswarm?(y=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){y.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 x=(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}(x(a),d3.extent(a)):x(a),_=d3.scaleLinear().domain([0,d3.max(b,function(t){return t.y})]).clamp(!0);Q.push(_);var k={count:a.length,num_outlier:y.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:y,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 q(t){return F?j.find(function(e){return e.key==t}).values.map(function(t){return t.key}).sort(d3.ascending):t}function Z(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},q=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===_?$:x;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(y(e))}).attr("x2",B()).attr("y2",function(t){return"box"==r?h(n(t)):h(y(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?q():B()}).attr("y1",function(e,n){return"violin"!=r?h(t(e)):h(y(e))}).attr("x2",function(t){return"violin"!=r?U():B()}).attr("y2",function(e,n){return"violin"!=r?h(t(e)):h(y(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=q(),o=B(),a=t,c="mean"==W?b(a):y(a),u=E?[{x:o,y:h($(a))},{x:n,y:h($(a))},{x:n,y:h((s=a,("mean"==W?b(s):y(s))-s.values.notch))},{x:i,y:h(c)},{x:n,y:h((l=a,("mean"==W?b(l):y(l))+l.values.notch))},{x:n,y:h(x(a))},{x:o,y:h(x(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(x(a))},{x:o,y:h(x(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:x(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q2",value:y(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:x(e).toFixed(2),color:m(e)||z(e,r)},{key:"Q2",value:y(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?q:"violin"!=r?H:q()).attr("y1",function(t,e,n){return"mean"==W?h(b(t)):h(y(t))}).attr("x2",E?U:"violin"!=r?G:U()).attr("y2",function(t,e){return"mean"==W?h(b(t)):h(y(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):y(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):y(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 "+(Z(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",q()+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||Z(e)){var a=d3.select(this.parentNode).style("fill");o.classed("hover",!0),Y.call("elementMouseover",this,{value:"box"==r&&Z(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&&Z(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(),y="No Data Available.",x=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(x,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(){x.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,y='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").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=x,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 y},set:function(t){y=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"),y=!0;e.interactive(!1),e.pointActive(function(t){return!1});var x=t.utils.renderWatch($,v);function b(m){return x.reset(),x.models(e),f&&x.models(i),p&&x.models(o),m.each(function(m){var x=d3.select(this);t.utils.initSVG(x);var _=t.utils.availableWidth(u,x,s),k=c-s.top-s.bottom;b.update=function(){0===v?x.call(b):x.transition().duration(v).call(b)},b.container=this,n=e.xScale(),r=e.yScale();var w=x.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");A.select("g");var C=A.append("g").attr("class","nv-background").append("rect"),M=A.append("g").attr("class","nv-x nv-axis");M=x.selectAll("g.nv-wrap.nv-focus").select(".nv-x");var L=A.append("g").attr("class","nv-y nv-axis"),S=A.append("g").attr("class","nv-contentWrap"),E=A.append("g").attr("class","nv-brushBackground"),F=A.append("g").attr("class","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(y)}),a.on("end",function(t){y||$.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,e){g=null===t.selection?null:a.extent();var r=null===t.selection?n.domain():a.extent();$.call("brush",this,{extent:r,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)}),e&&$.call("brush",this,r)}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]+")"),d3.transition(M).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)}),x.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 y},set:function(t){y=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,x.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){},y=function(t){},x=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 x=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||x.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||x.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"}),y(b),$(_),x.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 x},set:function(t){x="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 y},set:function(t){y=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 y(t,e){return"furious"!=v?"#000":h?t.disengaged?a(t,e):"#fff":h?void 0:t.disabled?a(t,e):"#fff"}function x(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",y(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",y(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",x).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(),y=d3.scaleBand(),x=!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?x(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 q(t,e){return Object.keys(t).filter(function(n){return t[n]===e})[0]}var Z={},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=(Z={},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 Z||(Z[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:Z[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(Z).forEach(function(e){var n=I[e][t];if(n)tu.push(n);else{var r={idx:tl,ix:Z[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(Z),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(Z).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(Z)).range(s||[0,tc-L/2]),y.domain(a||R(j)).range(l||[0,td-L/2]),(x=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(Z).concat([Object.values(Z).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 ty=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)});ty.append("rect"),ty.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 tx=Object.keys(j).length;tp.selectAll(".horizontalGrid").watchTransition(tt,"heatMap: gridLines").attr("x1",function(t){return 0==t||t==tx?-L:0}).attr("x2",function(t){return 0==t||t==tx?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:q(Z,r)+" & "+q(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 y},set:function(t){y=t}},colorScale:{get:function(){return x},set:function(t){x=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",y=0,x=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 x=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(x).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(x/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.selectAll("g").selectAll(".tick text").attr("transform",function(t,e,n){return"translate(0, "+(h?n%2==0?"5":"17":"0")+") rotate("+(0!=y?y:"0")+" 0,0)"}).style("text-anchor",y>0?"start":y<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(-x);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("+(x-B)+",0)"),!1!==r.yMeta()){var O=x+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(x).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 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}},staggerLabels:{get:function(){return h},set:function(t){h=t}},rotateLabels:{get:function(){return y},set:function(t){y=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,y=t.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),b=!0,_=t.utils.renderWatch(x,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){x.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),x.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),x.call("elementMouseout",this,{data:e,index:e.index,color:d3.select(this).style("fill")}))}).on("mousemove",function(t,e,n){b&&x.call("elementMousemove",this,{data:e,index:e.index,color:d3.select(this).style("fill")})}).on("click",function(t,e,n){b&&(x.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&&(x.call("elementDblClick",this,{data:e,index:e.index,color:d3.select(this).style("fill")}),t.stopPropagation())});W.attr("fill",function(t,e){return y(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=x,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 y},set:function(e){y=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,y=!1,x=!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");W.attr("transform","translate("+c.left+","+c.top+")");var 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(),y&&T.attr("transform","translate("+S+",0)"),x&&(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 y},set:function(t){y=t}},useInteractiveGuideline:{get:function(){return x},set:function(t){x=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 $(y){function x(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 y.each(function(a){var $=n-e.left-e.right,y=d3.select(this);t.utils.initSVG(y);var k=y.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=y.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",x(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",x).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 y,x,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(),y=y||e,x=x||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(y(c(e,n)))}).y0(function(e,n){return t.utils.NaNtoZero(x(f(e,n)))}).y1(function(t,e){return x(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(y(c(e,n)))}).y(function(e,n){return t.utils.NaNtoZero(x(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)))})),y=e.copy(),x=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,y=!0,x=!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),y&&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");T.attr("transform","translate("+c.left+","+c.top+")");var O=T.append("g"),P=O.select("g"),B=O.append("g").attr("class","nv-legendWrap");B=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-legendWrap");var N=O.append("g").attr("class","nv-focus"),z=N.append("g").attr("class","nv-background").append("rect"),V=N.append("g").attr("class","nv-x nv-axis");V=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-x");var Y=N.append("g").attr("class","nv-y nv-axis");Y=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-y");var H=N.append("g").attr("class","nv-linesWrap");H=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-linesWrap");var X=N.append("g").attr("class","nv-interactive");X=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-interactive");var G=O.append("g").attr("class","nv-focusWrap");G=L.selectAll("g.nv-wrap.nv-lineChart").select(".nv-focusWrap"),v?(a.width(W),B.datum(l).call(a),"bottom"===m?(c.bottom=i.height()+a.height(),D=t.utils.availableHeight(g,L,c),B.attr("transform","translate(0,"+(D+i.height())+")")):"top"===m&&(f||a.height()===c.top||(c.top=a.height(),D=t.utils.availableHeight(g,L,c)-(_?u.height():0)),B.attr("transform","translate(0,"+-c.top+")"))):B.selectAll("*").remove(),x&&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 q(){$&&V.transition().duration(M).call(i)}function Z(){y&&Y.transition().duration(M).call(o)}if(R=R.merge(H),$&&(i.scale(e)._ticks(t.utils.calcTicksX(W/100,l)),i.tickSizeInner(-D)),y&&(o.scale(n)._ticks(t.utils.calcTicksY(D/36,l)),o.tickSizeInner(-W)),V.attr("transform","translate(0,"+D+")"),_){u.width(W),G.style("display",_?"initial":"none").attr("transform","translate(0,"+(D+c.bottom+u.margin().top)+")").call(u);var j=null===u.brush.extent()?u.xDomain():u.brush.extent();null!==j&&Q(j)}else R.transition().call(r),q(),Z();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),q(),Z()}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 y},set:function(t){y=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 x},set:function(t){x=t,o.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return b},set:function(t){(b=t)&&(r.interactive(!1),r.useVoronoi(!1))}}}),t.utils.inheritOptions(E,r),t.utils.initOptions(E),E},t.models.lineWithFocusChart=function(){return t.models.lineChart().margin({bottom:30}).focusEnable(!0)},t.models.linePlusBarChart=function(){"use strict";var e,n,r,i,o,a,s,l=t.models.line(),u=t.models.line(),c=t.models.historicalBar(),f=t.models.historicalBar(),p=t.models.axis(d3.axisBottom(d3.scaleLinear()),"bottom"),h=t.models.axis(d3.axisTop(d3.scaleLinear()),"top"),g=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),v=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),m=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),$=t.models.axis(d3.axisLeft(d3.scaleLinear()),"left"),y=t.models.legend(),x=d3.brush(),b=t.models.tooltip(),_={top:30,right:30,bottom:30,left:60},k=null,w={top:0,right:30,bottom:20,left:60},A=null,C=null,M=function(t){return t.x},L=function(t){return t.y},S=t.utils.defaultColor(),E=!0,F=!0,W=!1,D=!0,I=50,T=null,O=null,P=d3.dispatch("brush","stateChange","changeState"),B=0,N=(d3.transition().duration(B).ease(d3.easeLinear),t.utils.state()),z=null,V=" (left axis)",Y=" (right axis)",H=!1;l.clipEdge(!0),u.interactive(!1),u.pointActive(function(t){return!1}),p.tickPadding(5),h.tickPadding(5),b.headerEnabled(!0).headerFormatter(function(t,e){return p.tickFormat()(t,e)});var X=function(t){return t.every(function(t){return t.disabled})};function G(b){return b.each(function(b){var O,R=d3.select(this);t.utils.initSVG(R);var q,Z,j=t.utils.availableWidth(A,R,_),K=t.utils.availableHeight(C,R,_)-(F?I:0),Q=I-w.top-w.bottom;if(G.update=function(){R.transition().duration(B).call(G)},G.container=this,N.setter((q=b,function(t){void 0!==t.active&&q.forEach(function(e,n){e.disabled=!t.active[n]})}),G.update).getter((Z=b,function(){return{active:Z.map(function(t){return!t.disabled})}})).update(),N.disabled=b.map(function(t){return!!t.disabled}),!z)for(O in z={},N)N[O]instanceof Array?z[O]=N[O].slice(0):z[O]=N[O];if(!b||!b.length||!b.filter(function(t){return t.values.length}).length)return t.utils.noData(G,R),G;R.selectAll(".nv-noData").remove();var U=b.filter(function(t){return!t.disabled&&t.bar}),J=b.filter(function(t){return!t.bar});n=U.length&&!H?c.xScale():l.xScale(),r=h.scale(),i=H?l.yScale():c.yScale(),o=H?c.yScale():l.yScale(),a=H?u.yScale():f.yScale(),s=H?f.yScale():u.yScale();var tt=b.filter(function(t){return!t.disabled&&(H?!t.bar:t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:M(t,e),y:L(t,e)}})}),te=b.filter(function(t){return!t.disabled&&(H?t.bar:!t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:M(t,e),y:L(t,e)}})});n.range([0,j]),r.domain(d3.extent(d3.merge(tt.concat(te)),function(t){return t.x})).range([0,j]);var tn=R.selectAll("g.nv-wrap.nv-linePlusBar").data([b]).enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar");tn.attr("transform","translate("+_.left+","+_.top+")");var tr=tn.append("g"),ti=tr.select("g"),to=tr.append("g").attr("class","nv-legendWrap");to=R.selectAll("g.nv-wrap.nv-linePlusBar").select(".nv-legendWrap");var ta=tr.append("g").attr("class","nv-focus"),ts=ta.append("g").attr("class","nv-x nv-axis");ts=R.selectAll("g.nv-wrap.nv-linePlusBar").select(".nv-x");var tl=ta.append("g").attr("class","nv-y1 nv-axis"),tu=ta.append("g").attr("class","nv-y2 nv-axis"),tc=ta.append("g").attr("class","nv-barsWrap"),td=ta.append("g").attr("class","nv-linesWrap"),tf=tr.append("g").attr("class","nv-context"),tp=tf.append("g").attr("class","nv-x nv-axis"),th=tf.append("g").attr("class","nv-y1 nv-axis"),tg=tf.append("g").attr("class","nv-y2 nv-axis"),tv=tf.append("g").attr("class","nv-barsWrap"),tm=tf.append("g").attr("class","nv-linesWrap"),t$=tf.append("g").attr("class","nv-brushBackground"),ty=tf.append("g").attr("class","nv-x nv-brush");if(E){var tx=y.align()?j/2:j,tb=y.align()?tx:0;y.width(tx),to.datum(b.map(function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,H?t.key=t.originalKey+(t.bar?Y:V):t.key=t.originalKey+(t.bar?V:Y),t})).call(y),k||y.height()===_.top||(_.top=y.height(),K=t.utils.availableHeight(C,R,_)-I),to.attr("transform","translate("+tb+","+-_.top+")")}else to.selectAll("*").remove();tf.style("display",F?"initial":"none"),f.width(j).height(Q).color(b.map(function(t,e){return t.color||S(t,e)}).filter(function(t,e){return!b[e].disabled&&b[e].bar})),u.width(j).height(Q).color(b.map(function(t,e){return t.color||S(t,e)}).filter(function(t,e){return!b[e].disabled&&!b[e].bar}));var t_=tv.datum(U.length?U:[{values:[]}]),tk=tm.datum(X(J)?[{values:[]}]:J.filter(function(t){return!t.disabled}));tf.attr("transform","translate(0,"+(K+_.bottom+w.top)+")"),t_.transition().call(f),tk.transition().call(u),D&&(h._ticks(t.utils.calcTicksX(j/100,b)),h.tickSizeInner(-Q),ts.attr("transform","translate(0,"+a.range()[0]+")"),ts.transition().call(h)),W&&(m.scale(a)._ticks(Q/36),m.tickSizeInner(-j),$.scale(s)._ticks(Q/36),$.tickSizeInner(U.length?0:-j),ti.select(".nv-context .nv-y3.nv-axis").style("opacity",U.length?1:0).attr("transform","translate(0,"+r.range()[0]+")"),tg.style("opacity",J.length?1:0).attr("transform","translate("+r.range()[1]+",0)"),th.transition().call(m),tg.transition().call($)),x.on("brush",tC),T&&x.extent(T);var tw=t$.selectAll("g").data([T||x.extent()]),tA=tw.enter().append("g");tA.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",Q),tA.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",Q);var t0=ty.call(x);function tC(a){T=null===a.selection?null:x.extent(),e=null===a.selection?r.domain():x.extent(),P.call("brush",this,{extent:e,brush:x}),null!==(s=a).selection&&x.extent(T),tw.data([null===s.selection?r.domain():T]).each(function(t,e){var n=r(t[0])-r.range()[0],i=r.range()[1]-r(t[1]);d3.select(this).select(".left").attr("width",n<0?0:n),d3.select(this).select(".right").attr("x",r(t[1])).attr("width",i<0?0:i)}),c.width(j).height(K).color(b.map(function(t,e){return t.color||S(t,e)}).filter(function(t,e){return!b[e].disabled&&b[e].bar})),l.width(j).height(K).color(b.map(function(t,e){return t.color||S(t,e)}).filter(function(t,e){return!b[e].disabled&&!b[e].bar}));var s,u=tc.datum(U.length?U.map(function(t,n){return{key:t.key,values:t.values.filter(function(t,n){return c.x()(t,n)>=e[0]&&c.x()(t,n)<=e[1]})}}):[{values:[]}]),f=td.datum(X(J)?[{values:[]}]:J.filter(function(t){return!t.disabled}).map(function(t,n){return{area:t.area,fillOpacity:t.fillOpacity,strokeWidth:t.strokeWidth,key:t.key,values:t.values.filter(function(t,n){return l.x()(t,n)>=e[0]&&l.x()(t,n)<=e[1]})}}));n=U.length&&!H?c.xScale():l.xScale(),p.scale(n)._ticks(t.utils.calcTicksX(j/100,b)),p.tickSizeInner(-K),p.domain([Math.ceil(e[0]),Math.floor(e[1])]),ts.transition().duration(B).call(p),u.transition().duration(B).call(c),f.transition().duration(B).call(l),tp.attr("transform","translate(0,"+i.range()[0]+")"),g.scale(i)._ticks(t.utils.calcTicksY(K/36,b)),g.tickSizeInner(-j),v.scale(o)._ticks(t.utils.calcTicksY(K/36,b)),H?v.tickSizeInner(J.length?0:-j,0):v.tickSizeInner(U.length?0:-j);var h=U.length?1:0,m=J.length&&!X(J)?1:0,$=H?m:h,y=H?h:m;tl.style("opacity",$),tu.style("opacity",y).attr("transform","translate("+n.range()[1]+",0)"),tl.transition().duration(B).call(g),tu.transition().duration(B).call(v)}t0.selectAll("rect").attr("height",Q),t0.selectAll(".resize").append("path").attr("d",function t(e){var n=+("e"==e),r=n?1:-1,i=Q/3;return"M"+.5*r+","+i+"A6,6 0 0 "+n+" "+6.5*r+","+(i+6)+"V"+(2*i-6)+"A6,6 0 0 "+n+" "+.5*r+","+2*i+"ZM"+2.5*r+","+(i+8)+"V"+(2*i-8)+"M"+4.5*r+","+(i+8)+"V"+(2*i-8)}),y.dispatch.on("stateChange",function(t){for(var e in t)N[e]=t[e];P.call("stateChange",this,t),G.update()}),P.on("changeState",function(t){void 0!==t.disabled&&(b.forEach(function(e,n){e.disabled=t.disabled[n]}),N.disabled=t.disabled),G.update()}),tC(event)}),G}return l.dispatch.on("elementMouseover.tooltip",function(t){b.duration(100).valueFormatter(function(t,e){return(H?{main:g,focus:m}:{main:v,focus:$}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),l.dispatch.on("elementMouseout.tooltip",function(t){b.hidden(!0)}),c.dispatch.on("elementMouseover.tooltip",function(t){t.value=G.x()(t.data),t.series={value:G.y()(t.data),color:t.color},b.duration(0).valueFormatter(function(t,e){return(H?{main:v,focus:$}:{main:g,focus:m}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(t){b.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(t){b()}),G.dispatch=P,G.legend=y,G.lines=l,G.lines2=u,G.bars=c,G.bars2=f,G.xAxis=p,G.x2Axis=h,G.y1Axis=g,G.y2Axis=v,G.y3Axis=m,G.y4Axis=$,G.tooltip=b,G.options=t.utils.optionsFunc.bind(G),G._options=Object.create({},{width:{get:function(){return A},set:function(t){A=t}},height:{get:function(){return C},set:function(t){C=t}},showLegend:{get:function(){return E},set:function(t){E=t}},brushExtent:{get:function(){return T},set:function(t){T=t}},noData:{get:function(){return O},set:function(t){O=t}},focusEnable:{get:function(){return F},set:function(t){F=t}},focusHeight:{get:function(){return I},set:function(t){I=t}},focusShowAxisX:{get:function(){return D},set:function(t){D=t}},focusShowAxisY:{get:function(){return W},set:function(t){W=t}},legendLeftAxisHint:{get:function(){return V},set:function(t){V=t}},legendRightAxisHint:{get:function(){return Y},set:function(t){Y=t}},margin:{get:function(){return _},set:function(t){void 0!==t.top&&(_.top=t.top,k=t.top),_.right=void 0!==t.right?t.right:_.right,_.bottom=void 0!==t.bottom?t.bottom:_.bottom,_.left=void 0!==t.left?t.left:_.left}},focusMargin:{get:function(){return w},set:function(t){w.top=void 0!==t.top?t.top:w.top,w.right=void 0!==t.right?t.right:w.right,w.bottom=void 0!==t.bottom?t.bottom:w.bottom,w.left=void 0!==t.left?t.left:w.left}},duration:{get:function(){return B},set:function(t){B=t}},color:{get:function(){return S},set:function(e){S=t.utils.getColor(e),y.color(S)}},x:{get:function(){return M},set:function(t){M=t,l.x(t),u.x(t),c.x(t),f.x(t)}},y:{get:function(){return L},set:function(t){L=t,l.y(t),u.y(t),c.y(t),f.y(t)}},switchYAxisOrder:{get:function(){return H},set:function(t){if(H!==t){var e=g;g=v,v=e;var n=m;m=$,$=n}H=t}}}),t.utils.inheritOptions(G,l),t.utils.initOptions(G),G},t.models.multiBar=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,f=d3.scaleBand(),p=d3.scaleLinear(),h=Math.floor(1e4*Math.random()),g=null,v=function(t){return t.x},m=function(t){return t.y},$=[0],y=!0,x=!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}})}]),x){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})}),x&&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 x&&!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",y?"url(#nv-edge-clip-"+h+")":"");var X=g.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t,e){return e}).enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),G=S.transition(X.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,A)).attr("y",function(t,e,n){var r=s(0)||0;return x&&F[t.seriesIndex]&&!F[t.seriesIndex].nonStackable&&(r=s(t.y0)),r}).attr("height",0).remove();G.delay&&G.delay(function(t,e){return e*(A/(E+1))-e}),X.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)}),X.style("stroke-opacity",1).style("fill-opacity",M);var R=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:[]});R.exit().remove();var q=R.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 x&&!F[t.seriesIndex].nonStackable?0:t.seriesIndex*f.bandwidth()/F.length}).attr("y",function(t,e,n){return s(x&&!F[t.seriesIndex].nonStackable?t.y0:0)||0}).attr("height",0).attr("width",function(t,e,n){return f.bandwidth()/(x&&!F[t.seriesIndex].nonStackable?1:F.length)}).attr("transform",function(t,e){return"translate("+f(v(t,e))+",0)"});(q=R.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 Z=q.watchTransition(S,"multibar",Math.min(250,A)).delay(function(t,e){return e*A/F[0].values.length});x?Z.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}):Z.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 x},set:function(t){x=t}},stackOffset:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return y},set:function(t){y=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,y=null,x=!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),x&&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");Y.attr("transform","translate("+c.left+","+c.top+")");var 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 q=H.append("g").attr("class","nv-legendWrap");q=P.selectAll("g.nv-wrap.nv-multiBarWithLegend").select(".nv-legendWrap");var Z=H.append("g").attr("class","nv-controlsWrap");Z=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"===y?(s.width(z-c.right),q.datum(S).call(s),c.bottom=i.height()+s.height(),V=t.utils.availableHeight(h,P,c),q.attr("transform","translate(0,"+(V+i.height())+")")):(s.width(z-F()),q.datum(S).call(s),f||s.height()===c.top||(c.top=s.height(),V=t.utils.availableHeight(h,P,c)),q.attr("transform","translate("+F()+","+-c.top+")")):q.selectAll("*").remove(),v){var K=[{key:m.grouped||"Grouped",disabled:r.stacked()},{key:m.stacked||"Stacked",disabled:!r.stacked()}];l.width(F()).color(["#444","#444","#444"]),Z.datum(K).attr("transform","translate(0,"+-c.top+")").call(l)}else Z.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),x){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.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.xAxis.bandwidth()),k&&U.filter(function(t,e){return e%Math.ceil(S[0].values.length/(z/100))!=0}).selectAll("text, line").style("opacity",1),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 y},set:function(t){y=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 x},set:function(t){x=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},y=[0],x=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(y))),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),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 x(t,e)}).style("stroke",function(t,e){return x(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").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)+")"});var X=H.append("text");k&&!_?(X.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)),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})):X.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 y},set:function(t){y=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 x},set:function(e){x=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,y="top",x=!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),x&&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");T.attr("transform","translate("+u.left+","+u.top+")");var 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=S.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").select(".nv-y")).append("g").attr("class","nv-zeroLine").append("line");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"===y?(u.bottom=i.height()+a.height(),I=t.utils.availableHeight(p,S,u),V.attr("transform","translate("+M()+","+(I+i.height())+")")):"top"===y&&(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(),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),x&&(i.scale(e)._ticks(t.utils.calcTicksY(I/24,l)),i.tickSizeInner(-D),P.call(i),P.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 y},set:function(t){y=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 x},set:function(t){x=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,y=d3.scaleLinear(),x=d3.scaleLinear(),b=d3.scaleLinear(),_=t.models.line().yScale(x).duration($),k=t.models.line().yScale(b).duration($),w=t.models.scatter().yScale(x).duration($),A=t.models.scatter().yScale(b).duration($),C=t.models.multiBar().stacked(!1).yScale(x).duration($),M=t.models.multiBar().stacked(!1).yScale(b).duration($),L=t.models.stackedArea().yScale(x).duration($),S=t.models.stackedArea().yScale(b).duration($),E=t.models.axis(d3.axisBottom(y),"bottom").tickPadding(5).duration($),F=t.models.axis(d3.axisLeft(x),"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 q=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)}})}),Z=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)}})});y.domain(d3.extent(d3.merge(q.concat(Z)),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");K.attr("transform","translate("+r.left+","+r.top+")");var 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();_.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}),x.domain(e||d3.extent(d3.merge(q).concat(th),function(t){return t.y})).range([0,B]),b.domain(n||d3.extent(d3.merge(Z).concat(tg),function(t){return t.y})).range([0,B]),_.yDomain(x.domain()),w.yDomain(x.domain()),C.stacked()){var tm=x.domain([0,d3.max(tv(q))]).range([0,B]);C.yDomain(tm.domain())}else C.yDomain(x.domain());if(L.yDomain(x.domain()),k.yDomain(b.domain()),A.yDomain(b.domain()),M.stacked()){var t$=b.domain([0,d3.max(tv(Z))]).range([0,B]);M.yDomain(t$.domain())}else M.yDomain(b.domain());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(0).headerFormatter(function(t,e){return E.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}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(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",!q.length).attr("transform","translate("+y.range()[0]+",0)"),tt.classed("nv-disabled",!Z.length).attr("transform","translate("+y.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(y),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=y.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=y(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",ty),k.dispatch.on("elementMouseover.tooltip",ty),_.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),k.dispatch.on("elementMouseout.tooltip",function(t){I.hidden(!0)}),w.dispatch.on("elementMouseover.tooltip",tx),A.dispatch.on("elementMouseover.tooltip",tx),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 y},set:function(t){y=t,E.scale(y)}},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},y=[],x=[],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(y))),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(x)),d3.max(w[0].values.map(m).concat(x))]).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 y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=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(),$=[],y=[],x=[],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===y.length&&(y=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){x[e.key]=this.parentNode.__origin__=u(e.key),n.attr("visibility","hidden")}).on("drag",function t(n,i){x[i.key]=Math.min(s,Math.max(0,this.parentNode.__origin__+=n.x)),e.attr("d",Z),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 x[r.key],d3.select(this.parentNode).attr("transform","translate("+u(r.key)+")"),e.attr("d",Z),n.attr("d",Z).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",Z),(e=N.selectAll("path").data(C)).enter().append("path"),e.exit().remove(),e.attr("d",Z).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()}),q=y.slice(0);function Z(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}}),y=[],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&&y.push(t),e?null:"none"}),J(),A.call("brush",this,{filters:$,active:y})}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",y,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=x[t];return null==e?u(t):e}y=[],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&&y.push(t),e?null:"none"}),($.length>0||!t.utils.arrayEquals(y,q))&&A.call("activeChanged",this,y)}),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 y},set:function(t){y=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 y(r){return $.reset(),$.models(e),r.each(function(r){var u,g=d3.select(this);t.utils.initSVG(g);var v,$,x=this,b=t.utils.availableWidth(a,g,i),_=t.utils.availableHeight(s,g,i);if(y.update=function(){g.call(y)},y.container=this,c.setter((v=f,function(t){void 0!==t.active&&v.forEach(function(e,n){e.disabled=!t.active[n]})}),y.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(y,g),y;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",x,t),y.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),y.update()})}),$.renderEnd("parraleleCoordinateChart immediate"),y}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()}),y.dispatch=m,y.parallelCoordinates=e,y.legend=n,y.tooltip=r,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}},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(y,e),t.utils.initOptions(y),y},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,y=0,x=!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).append("g");V.select("g");var H=Y.append("g").attr("class","nv-pie"),X=Y.append("g").attr("class","nv-pieLabels");V.attr("transform","translate("+e.left+","+e.top+")"),H.attr("transform","translate("+D/2+","+I/2+")"),X.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 G=d3.arc().outerRadius(O[z]),R=d3.arc().outerRadius(O[z]+5);!1!==b&&(G.startAngle(b),R.startAngle(b)),!1!==k&&(G.endAngle(k),R.endAngle(k)),v&&(G.innerRadius(P[z]),R.innerRadius(P[z])),G.cornerRadius&&w&&(G.cornerRadius(w),R.cornerRadius(w)),E.push(G),F.push(R)}var q=d3.pie().sort(null).value(function(t){return t.disabled?0:o(t)});q.padAngle&&_&&q.padAngle(_),v&&m&&(H.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, "+y+")"}));var Z=s.select(".nv-wrap.nv-pie").selectAll(".nv-pie").selectAll(".nv-slice").data(q(M)),j=s.select(".nv-wrap.nv-pie").selectAll(".nv-pieLabels").selectAll(".nv-label").data(q(M)),K=Z.enter().append("g");if(K.attr("class","nv-slice"),Z.exit().remove(),j.exit().remove(),K.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)})}),K.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})}),K.on("mousemove",function(t,e,n){S.call("elementMousemove",this,{data:e.data,index:e.index})}),K.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})}),K.on("dblclick",function(t,e,n){S.call("elementDblClick",this,{data:e.data,index:e.index,color:d3.select(this).style("fill")})}),(K=Z.merge(K)).attr("fill",function(t,e){return l(t.data,e)}),K.attr("stroke",function(t,e){return l(t.data,e)}),K.append("path").each(function(t){this._current=t}),K.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 Q=[],z=0;z<M.length;z++)Q.push(E[z]),f?v&&(Q[z]=d3.arc().outerRadius(E[z].outerRadius()),!1!==b&&Q[z].startAngle(b),!1!==k&&Q[z].endAngle(k)):v||Q[z].innerRadius(0);var U=j.enter().append("g").classed("nv-label",!0).each(function(t,e){var n=d3.select(this);n.attr("transform",function(t,e){if(!x)return t.outerRadius=T+10,t.innerRadius=T+15,"translate("+Q[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("+Q[e].centroid(t)+") rotate("+n+")"}),n.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),n.append("text").style("text-anchor",x?(t.startAngle+t.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")}),J={},tt=function(t){return 140*Math.floor(t[0]/140)+","+14*Math.floor(t[1]/14)},te=function(t){return(t.endAngle-t.startAngle)/(2*Math.PI)};U.watchTransition(W,"pie labels").attr("transform",function(t,e){if(x){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("+Q[e].centroid(t)+") rotate("+n+")"}t.outerRadius=T+10,t.innerRadius=T+15;var r=Q[e].centroid(t),i=te(t);return t.value&&i>=h&&(J[tt(r)]&&(r[1]-=14),J[tt(r)]=!0),"translate("+r+")"}),U.select(".nv-label text").style("text-anchor",function(t,e){return x?(t.startAngle+t.endAngle)/2<Math.PI?"start":"end":"middle"}).text(function(t,e){var n=te(t),r="";if(!t.value||n<h)return"";if("function"==typeof p)r=p(t,e,{key:i(t.data),value:o(t.data),percent:u(n)});else switch(p){case"key":r=i(t.data);break;case"value":r=u(o(t.data));break;case"percent":r=d3.format(".0%")(n)}return r}),g&&U.each(function(e,n){if(this.getBBox){var r=this.getBBox(),i=Q[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,G)&&t.utils.pointIsInArc(a,e,G)&&t.utils.pointIsInArc(s,e,G)&&t.utils.pointIsInArc(l,e,G)}}).style("display",function(t){return t.visible?null:"none"}),U.merge(j)}function tn(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 y},set:function(t){y=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 x},set:function(t){x=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 y(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),x=t.utils.availableHeight(s,f,i);if(y.update=function(){f.transition().call(y)},y.container=this,p.setter((g=r,function(t){void 0!==t.active&&g.forEach(function(e,n){e.disabled=!t.active[n]})}),y.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(y,f),y;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.attr("transform","translate("+i.left+","+i.top+")"),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(),x=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(x).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(),x=t.utils.availableHeight(s,f,i),w.attr("transform","translate(0,"+x+")"))}else w.selectAll("*").remove();e.width($).height(x);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),y.update()}),m.on("changeState",function(t){void 0!==t.disabled&&(r.forEach(function(e,n){e.disabled=t.disabled[n]}),p.disabled=t.disabled),y.update()})}),$.renderEnd("pieChart immediate"),y}return e.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:y.x()(t.data),value:y.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()}),y.legend=n,y.dispatch=m,y.pie=e,y.tooltip=r,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}},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(y,e),t.utils.initOptions(y),y},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 y=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});y.append("title").text(p);var x=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(),y.attr("d",$)}));x.append("rect").attr("height",function(t){return t.dy}).attr("width",n.nodeWidth()).style("fill",h).style("stroke",g).append("title").text(v),x.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(),y=d3.scaleLinear(),x=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,q=!1,Z=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 Z.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:x(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]);y.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||y;var ti=m(1)!==e(1)||$(1)!==n(1)||y(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]).enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+g).attr("transform","translate("+u.left+","+u.top+")");ts.classed("nv-single-point",V);var tl=ts.append("defs"),tu=ts.append("g");tu.append("g").attr("class","nv-groups");var tc=tu.append("g").attr("class","nv-point-paths"),td=ts.append("g").attr("class","nv-point-clips");function tf(){if(q=!1,!M)return!1;if(v.selectAll(".nv-point.hover").classed("hover",!1),tc.selectAll("path").remove(),!0===H){var e=d3.merge(X.map(function(e,n){return e.values.map(function(e,r){var i=x(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=tc.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&&(td.selectAll("*").remove(),td.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(q)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=x(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(x(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(x(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(q||!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(x(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(x(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(q||!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(x(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(x(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e})}).on("mouseover",function(t,e){if(q||!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(x(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(x(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(q||!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(x(r,e))+u.left,$(b(r,e))+u.top],relativePos:[m(x(r,e))+u.left,$(b(r,e))+u.top],seriesIndex:t[0].series,pointIndex:e,color:p(t[0],e)})})}tl.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&&tu.attr("clip-path",F?"url(#nv-edge-clip-"+g+")":""),q=!0;var tp=v.select("g.nv-groups").selectAll("g.nv-group").data(function(t){return t},function(t){return t.key}),th=tp.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});tp.exit().remove();var tg=tp.merge(th);tg.watchTransition(Z,"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 tv=tg.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)})}),tm=tv.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(x(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 y(_(t[0],t[1]))}));tv.exit().each(Q).remove();var t$=tv.merge(tm);if(tg.exit().selectAll("path.nv-point").watchTransition(Z,"scatter exit").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(m(x(e[0],e[1])))+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"}).remove(),t$.filter(function(t){return U(t,"x",x,"y",b)||ti||to||ta}).watchTransition(Z,"scatter points").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(m(x(e[0],e[1])))+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"}),t$.filter(function(t){return U(t,"shape",k,"size",_)||ti||to||ta}).watchTransition(Z,"scatter points").attr("d",t.utils.symbol().type(function(t){return k(t[0])}).size(function(t){return y(_(t[0],t[1]))})),R){var ty=tg.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)})}),tx=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(x(r[0],r[1])))+Math.sqrt(y(_(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 tb=ty.merge(tx);tg.exit().selectAll("path.nv-label").watchTransition(Z,"scatter exit").attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(m(x(e[0],e[1])))+Math.sqrt(y(_(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"}).remove(),tb.each(function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)}),tb.watchTransition(Z,"scatter labels").text(function(t,e){return t[0].label}).attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(m(x(e[0],e[1])))+Math.sqrt(y(_(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero($(b(e[0],e[1])))+")"})}G?(clearTimeout(l),l=setTimeout(tf,G)):tf(),e=m.copy(),n=$.copy(),r=y.copy(),a=c,s=f}),Z.renderEnd("scatter immediate"),J}return J.dispatch=Y,J.options=t.utils.optionsFunc.bind(J),J._calls=new function(){this.clearHighlights=function(){return t.dom.write(function(){v.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(e,n,r){t.dom.write(function(){v.select(".nv-groups").selectAll(".nv-series-"+e).selectAll(".nv-point-"+n).classed("hover",r)})}},Y.on("elementMouseover.point",function(t){M&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)}),Y.on("elementMouseout.point",function(t){M&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!1)}),J._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return f},set:function(t){f=t}},xScale:{get:function(){return m},set:function(t){m=t}},yScale:{get:function(){return $},set:function(t){$=t}},pointScale:{get:function(){return y},set:function(t){y=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 x},set:function(t){x="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,Z.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,y=!0,x=!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),x&&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());N.attr("transform","translate("+l.left+","+l.top+")");var 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"),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"),y?(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(),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}),x&&(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 y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=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"),y=t.utils.renderWatch($);function x(u){return y.reset(),u.each(function(u){var $=a-o.left-o.right,y=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||[y,0]);var x=l.selectAll("g.nv-wrap.nv-sparkline").data([u]),b=x.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");b.append("g"),x.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)}),y.renderEnd("sparkline immediate"),x}return 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}},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)}}}),x.dispatch=$,t.utils.initOptions(x),x},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),y=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 x=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(y),w.call(r).merge(w),f){var M=A.selectAll(".nv-currentValue").data([x]),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(x)),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",y),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",y+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(),y=250,x=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(_,y);function w(p){return k.reset(),k.models($),p.each(function(p){var y=i-r.left-r.right,x=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(y).height(x).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",y).attr("height",x),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?(y=t,k.reset(y),$.duration(y),w):y},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 x},set:function(t){x="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 y},set:function(t){y=t,k.reset(y),$.duration(y)}}}),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,y="top",x=!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),x&&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");R.attr("transform","translate("+f.left+","+f.top+")");var q=R.append("g");R.select("g");var Z=q.append("g").attr("class","nv-legendWrap");Z=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-legendWrap");var j=q.append("g").attr("class","nv-controlsWrap");j=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-controlsWrap");var K=q.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=q.append("g").attr("class","nv-focusWrap");if(tn=B.selectAll("g.nv-wrap.nv-stackedAreaChart").select(".nv-focusWrap"),$){var tr=m&&"top"===y?X-F:X;if(a.width(tr),Z.datum(u).call(a),"bottom"===y){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;Z.attr("transform","translate(0,"+to+")")}else"top"===y&&(p||f.top==a.height()||(f.top=a.height(),G=t.utils.availableHeight(g,B,f)-(k?c.height():0)),Z.attr("transform","translate("+(X-tr)+","+-f.top+")"))}else Z.selectAll("*").remove();if(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"===y?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(){x&&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})),x&&(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.extent();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 y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=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},y=!0,x=500,b=d3.transition().duration(x).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(x).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(x).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:y?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(x).attrTween("d",W)}),h&&(b.selectAll("text").remove(),b.append("text").text(function(t){return g(t)}).transition().duration(x).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(x).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 x},set:function(t){x=t,b=d3.transition().duration(x).ease(d3.easeLinear)}},groupColorByParent:{get:function(){return y},set:function(t){y=!!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.6"}();
|
|
1
|
+
/* nvd3 version 1.0.2 (https://github.com/wavemaker/nvd3) 2020-06-01 */
|
|
2
|
+
|
|
3
|
+
!function(){var a={};a.dev=!1,a.tooltip=a.tooltip||{},a.utils=a.utils||{},a.models=a.models||{},a.charts={},a.logs={},a.dom={},"undefined"!=typeof module&&"undefined"!=typeof exports&&"undefined"==typeof d3&&(d3=require("d3")),a.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),a.dev&&(a.dispatch.on("render_start",function(b){a.logs.startTime=+new Date}),a.dispatch.on("render_end",function(b){a.logs.endTime=+new Date,a.logs.totalTime=a.logs.endTime-a.logs.startTime,a.log("total",a.logs.totalTime)})),a.log=function(){if(a.dev&&window.console&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(a.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind){var b=Function.prototype.bind.call(console.log,console);b.apply(console,arguments)}return arguments[arguments.length-1]},a.deprecated=function(a,b){console&&console.warn&&console.warn("nvd3 warning: `"+a+"` has been deprecated. ",b||"")},a.render=function(b){b=b||1,a.render.active=!0,a.dispatch.render_start();var c=function(){for(var d,e,f=0;f<b&&(e=a.render.queue[f]);f++)d=e.generate(),typeof e.callback==typeof Function&&e.callback(d);a.render.queue.splice(0,f),a.render.queue.length?setTimeout(c):(a.dispatch.render_end(),a.render.active=!1)};setTimeout(c)},a.render.active=!1,a.render.queue=[],a.addGraph=function(b){typeof arguments[0]==typeof Function&&(b={generate:arguments[0],callback:arguments[1]}),a.render.queue.push(b),a.render.active||a.render()},"undefined"!=typeof module&&"undefined"!=typeof exports&&(module.exports=a),"undefined"!=typeof window&&(window.nv=a),a.dom.write=function(a){return void 0!==window.fastdom?fastdom.mutate(a):a()},a.dom.read=function(a){return void 0!==window.fastdom?fastdom.measure(a):a()},a.interactiveGuideline=function(){"use strict";function b(l){l.each(function(l){function m(){var a=d3.event.clientX-this.getBoundingClientRect().left,d=d3.event.clientY-this.getBoundingClientRect().top,e=!0,h=!1;if(k&&(a=d3.event.offsetX,d=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(e=!1),d3.event.target.className.baseVal.match("nv-legend")&&(h=!0)),e&&(a-=c.left,d-=c.top),"mouseout"===d3.event.type||a<0||d<0||a>o||d>p||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||h){if(k&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(j.nvPointerEventsClass)))return;return g.elementMouseout({mouseX:a,mouseY:d}),b.renderGuideLine(null),void j.hidden(!0)}j.hidden(!1);var i="function"==typeof f.rangeBands,l=void 0;if(i){var m=d3.bisect(f.range(),a)-1;if(!(f.range()[m]+f.rangeBand()>=a))return g.elementMouseout({mouseX:a,mouseY:d}),b.renderGuideLine(null),void j.hidden(!0);l=f.domain()[d3.bisect(f.range(),a)-1]}else l=f.invert(a);if(g.elementMousemove({mouseX:a,mouseY:d,pointXValue:l}),"dblclick"===d3.event.type&&g.elementDblclick({mouseX:a,mouseY:d,pointXValue:l}),"click"===d3.event.type&&g.elementClick({mouseX:a,mouseY:d,pointXValue:l}),"mousedown"===d3.event.type&&g.elementMouseDown({mouseX:a,mouseY:d,pointXValue:l}),"mouseup"===d3.event.type&&g.elementMouseUp({mouseX:a,mouseY:d,pointXValue:l}),"touchmove"===d3.event.type)return void j.hidden(!0)}var n=d3.select(this),o=d||960,p=e||400,q=n.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([l]);q.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer").append("g").attr("class","nv-interactiveGuideLine"),i&&(i.on("touchmove",m).on("mousemove",m,!0).on("mouseout",m,!0).on("mousedown",m,!0).on("mouseup",m,!0).on("dblclick",m).on("click",m),b.guideLine=null,b.renderGuideLine=function(c){h&&(b.guideLine&&b.guideLine.attr("x1")===c||a.dom.write(function(){var b=q.select(".nv-interactiveGuideLine").selectAll("line").data(null!=c?[a.utils.NaNtoZero(c)]:[],String);b.enter().append("line").attr("class","nv-guideline").attr("x1",function(a){return a}).attr("x2",function(a){return a}).attr("y1",p).attr("y2",0),b.exit().remove()}))})})}var c={left:0,top:0},d=null,e=null,f=d3.scale.linear(),g=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick","elementMouseDown","elementMouseUp"),h=!0,i=null,j=a.models.tooltip(),k=window.ActiveXObject;return j.duration(0).hideDelay(0).hidden(!1),b.dispatch=g,b.tooltip=j,b.margin=function(a){return arguments.length?(c.top=void 0!==a.top?a.top:c.top,c.left=void 0!==a.left?a.left:c.left,b):c},b.width=function(a){return arguments.length?(d=a,b):d},b.height=function(a){return arguments.length?(e=a,b):e},b.xScale=function(a){return arguments.length?(f=a,b):f},b.showGuideLine=function(a){return arguments.length?(h=a,b):h},b.svgContainer=function(a){return arguments.length?(i=a,b):i},b},a.interactiveBisect=function(a,b,c){"use strict";if(!(a instanceof Array))return null;var d;d="function"!=typeof c?function(a){return a.x}:c;var e=function(a,b){return d(a)-b},f=d3.bisector(e).left,g=d3.max([0,f(a,b)-1]),h=d(a[g]);if(void 0===h&&(h=g),h===b)return g;var i=d3.min([g+1,a.length-1]),j=d(a[i]);return void 0===j&&(j=i),Math.abs(j-b)>=Math.abs(h-b)?g:i},a.nearestValueIndex=function(a,b,c){"use strict";var d=1/0,e=null;return a.forEach(function(a,f){var g=Math.abs(b-a);null!=a&&g<=d&&g<c&&(d=g,e=f)}),e},a.models.tooltip=function(){"use strict";function b(){if(!l||!l.node()){var a=[1];l=d3.select(document.body).selectAll(".nvtooltip").data(a),l.enter().append("div").attr("class","nvtooltip "+(i||"xy-tooltip")).attr("id",d).style("top",0).style("left",0).style("opacity",0).style("position","fixed").selectAll("div, table, td, tr").classed(q,!0).classed(q,!0),l.exit().remove()}}function c(){if(n&&w(e))return a.dom.write(function(){b();var a=u(e,l.node());a&&(l.node().innerHTML=a),y()}),c}var d="nvtooltip-"+Math.floor(1e5*Math.random()),e=null,f="w",g=25,h=0,i=null,j=!0,k=200,l=null,m={left:null,top:null},n=!0,o=100,p=!0,q="nv-pointer-events-none",r=function(a,b,c){return a},s=function(a){return a},t=function(a,b){return a},u=function(a,b){if(null===a)return"";var c=d3.select(document.createElement("table"));if(p){c.selectAll("thead").data([a]).enter().append("thead").append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(s(a.value))}var d=c.selectAll("tbody").data([a]).enter().append("tbody"),e=d.selectAll("tr").data(function(a){return a.series}).enter().append("tr").classed("highlight",function(a){return a.highlight});e.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(a){return a.color}),e.append("td").classed("key",!0).classed("total",function(a){return!!a.total}).html(function(a,b){return t(a.key,b)}),e.append("td").classed("value",!0).html(function(a,b){return r(a.value,b,a)}),e.filter(function(a,b){return void 0!==a.percent}).append("td").classed("percent",!0).html(function(a,b){return"("+d3.format("%")(a.percent)+")"}),e.selectAll("td").each(function(a){if(a.highlight){var b=d3.scale.linear().domain([0,1]).range(["#fff",a.color]),c=.6;d3.select(this).style("border-bottom-color",b(c)).style("border-top-color",b(c))}});var f=c.node().outerHTML;return void 0!==a.footer&&(f+="<div class='footer'>"+a.footer+"</div>"),f},v=function(){var a={left:null!==d3.event?d3.event.clientX:0,top:null!==d3.event?d3.event.clientY:0};if("none"!=getComputedStyle(document.body).transform){var b=document.body.getBoundingClientRect();a.left-=b.left,a.top-=b.top}return a},w=function(b){if(b&&b.series){if(a.utils.isArray(b.series))return!0;if(a.utils.isObject(b.series))return b.series=[b.series],!0}return!1},x=function(a){var b,c,d,e=l.node().offsetHeight,h=l.node().offsetWidth,i=document.documentElement.clientWidth,j=document.documentElement.clientHeight;switch(f){case"e":b=-h-g,c=-e/2,a.left+b<0&&(b=g),(d=a.top+c)<0&&(c-=d),(d=a.top+c+e)>j&&(c-=d-j);break;case"w":b=g,c=-e/2,a.left+b+h>i&&(b=-h-g),(d=a.top+c)<0&&(c-=d),(d=a.top+c+e)>j&&(c-=d-j);break;case"n":b=-h/2-5,c=g,a.top+c+e>j&&(c=-e-g),(d=a.left+b)<0&&(b-=d),(d=a.left+b+h)>i&&(b-=d-i);break;case"s":b=-h/2,c=-e-g,a.top+c<0&&(c=g),(d=a.left+b)<0&&(b-=d),(d=a.left+b+h)>i&&(b-=d-i);break;case"center":b=-h/2,c=-e/2;break;default:b=0,c=0}return{left:b,top:c}},y=function(){a.dom.read(function(){var a=v(),b=x(a),c=a.left+b.left,d=a.top+b.top;if(j)l.interrupt().transition().delay(k).duration(0).style("opacity",0);else{var e="translate("+m.left+"px, "+m.top+"px)",f="translate("+Math.round(c)+"px, "+Math.round(d)+"px)",g=d3.interpolateString(e,f),h=l.style("opacity")<.1;l.interrupt().transition().duration(h?0:o).styleTween("transform",function(a){return g},"important").styleTween("-webkit-transform",function(a){return g}).style("-ms-transform",f).style("opacity",1)}m.left=c,m.top=d})};return c.nvPointerEventsClass=q,c.options=a.utils.optionsFunc.bind(c),c._options=Object.create({},{duration:{get:function(){return o},set:function(a){o=a}},gravity:{get:function(){return f},set:function(a){f=a}},distance:{get:function(){return g},set:function(a){g=a}},snapDistance:{get:function(){return h},set:function(a){h=a}},classes:{get:function(){return i},set:function(a){i=a}},enabled:{get:function(){return n},set:function(a){n=a}},hideDelay:{get:function(){return k},set:function(a){k=a}},contentGenerator:{get:function(){return u},set:function(a){u=a}},valueFormatter:{get:function(){return r},set:function(a){r=a}},headerFormatter:{get:function(){return s},set:function(a){s=a}},keyFormatter:{get:function(){return t},set:function(a){t=a}},headerEnabled:{get:function(){return p},set:function(a){p=a}},position:{get:function(){return v},set:function(a){v=a}},chartContainer:{get:function(){return document.body},set:function(b){a.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(b){a.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(b){a.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return j},set:function(a){j!=a&&(j=!!a,c())}},data:{get:function(){return e},set:function(a){a.point&&(a.value=a.point.x,a.series=a.series||{},a.series.value=a.point.y,a.series.color=a.point.color||a.series.color),e=a}},node:{get:function(){return l.node()},set:function(a){}},id:{get:function(){return d},set:function(a){}}}),a.utils.initOptions(c),c},a.utils.windowSize=function(){var a={width:640,height:480};return window.innerWidth&&window.innerHeight?(a.width=window.innerWidth,a.height=window.innerHeight,a):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(a.width=document.documentElement.offsetWidth,a.height=document.documentElement.offsetHeight,a):document.body&&document.body.offsetWidth?(a.width=document.body.offsetWidth,a.height=document.body.offsetHeight,a):a},a.utils.isArray=Array.isArray,a.utils.isObject=function(a){return null!==a&&"object"==typeof a},a.utils.isFunction=function(a){return"function"==typeof a},a.utils.isDate=function(a){return"[object Date]"===toString.call(a)},a.utils.isNumber=function(a){return!isNaN(a)&&"number"==typeof a},a.utils.windowResize=function(b){return window.addEventListener?window.addEventListener("resize",b):a.log("ERROR: Failed to bind to window.resize with: ",b),{callback:b,clear:function(){window.removeEventListener("resize",b)}}},a.utils.getColor=function(b){if(void 0===b)return a.utils.defaultColor();if(a.utils.isArray(b)){var c=d3.scale.ordinal().range(b);return function(a,b){var d=void 0===b?a:b;return a.color||c(d)}}return b},a.utils.defaultColor=function(){return a.utils.getColor(d3.scale.category20().range())},a.utils.customTheme=function(b,c,d){c=c||function(a){return a.key},d=d||d3.scale.category20().range();var e=d.length;return function(f,g){var h=c(f);return a.utils.isFunction(b[h])?b[h]():void 0!==b[h]?b[h]:(e||(e=d.length),e-=1,d[e])}},a.utils.pjax=function(b,c){var d=function(d){d3.html(d,function(d){var e=d3.select(c).node();e.parentNode.replaceChild(d3.select(d).select(c).node(),e),a.utils.pjax(b,c)})};d3.selectAll(b).on("click",function(){history.pushState(this.href,this.textContent,this.href),d(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&d(d3.event.state)})},a.utils.calcApproxTextWidth=function(b){if(a.utils.isFunction(b.style)&&a.utils.isFunction(b.text)){var c=parseInt(b.style("font-size").replace("px",""),10),d=b.text().length;return a.utils.NaNtoZero(d*c*.5)}return 0},a.utils.NaNtoZero=function(b){return!a.utils.isNumber(b)||isNaN(b)||null===b||b===1/0||b===-1/0?0:b},d3.selection.prototype.watchTransition=function(a){var b=[this].concat([].slice.call(arguments,1));return a.transition.apply(a,b)},a.utils.renderWatch=function(b,c){if(!(this instanceof a.utils.renderWatch))return new a.utils.renderWatch(b,c);var d=void 0!==c?c:250,e=[],f=this;this.models=function(a){return a=[].slice.call(arguments,0),a.forEach(function(a){a.__rendered=!1,function(a){a.dispatch.on("renderEnd",function(b){a.__rendered=!0,f.renderEnd("model")})}(a),e.indexOf(a)<0&&e.push(a)}),this},this.reset=function(a){void 0!==a&&(d=a),e=[]},this.transition=function(a,b,c){if(b=arguments.length>1?[].slice.call(arguments,1):[],c=b.length>1?b.pop():void 0!==d?d:250,a.__rendered=!1,e.indexOf(a)<0&&e.push(a),0===c)return a.__rendered=!0,a.delay=function(){return this},a.duration=function(){return this},a;0===a.length?a.__rendered=!0:a.every(function(a){return!a.length})?a.__rendered=!0:a.__rendered=!1;var g=0;return a.transition().duration(c).each(function(){++g}).each("end",function(c,d){0==--g&&(a.__rendered=!0,f.renderEnd.apply(this,b))})},this.renderEnd=function(){e.every(function(a){return a.__rendered})&&(e.forEach(function(a){a.__rendered=!1}),b.renderEnd.apply(this,arguments))}},a.utils.deepExtend=function(b){(arguments.length>1?[].slice.call(arguments,1):[]).forEach(function(c){for(var d in c){var e=a.utils.isArray(b[d]),f=a.utils.isObject(b[d]),g=a.utils.isObject(c[d]);f&&!e&&g?a.utils.deepExtend(b[d],c[d]):b[d]=c[d]}})},a.utils.state=function(){if(!(this instanceof a.utils.state))return new a.utils.state;var b={},c=function(){},d=function(){return{}},e=null,f=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(a){c(a,!0)}),this.getter=function(a){return d=a,this},this.setter=function(a,b){return b||(b=function(){}),c=function(c,d){a(c),d&&b()},this},this.init=function(b){e=e||{},a.utils.deepExtend(e,b)};var g=function(){var a=d();if(JSON.stringify(a)===JSON.stringify(b))return!1;for(var c in a)void 0===b[c]&&(b[c]={}),b[c]=a[c],f=!0;return!0};this.update=function(){e&&(c(e,!1),e=null),g.call(this)&&this.dispatch.change(b)}},a.utils.optionsFunc=function(b){return b&&d3.map(b).forEach(function(b,c){a.utils.isFunction(this[b])&&this[b](c)}.bind(this)),this},a.utils.calcTicksX=function(b,c){var d=1,e=0;for(e;e<c.length;e+=1){var f=c[e]&&c[e].values?c[e].values.length:0;d=f>d?f:d}return a.log("Requested number of ticks: ",b),a.log("Calculated max values to be: ",d),b=b>d?b=d-1:b,b=b<1?1:b,b=Math.floor(b),a.log("Calculating tick count as: ",b),b},a.utils.calcTicksY=function(b,c,d){if(d){for(var e=1,f=0;f<c.length;f+=1)for(var g,h=c[f]&&c[f].values?c[f].values:[],i=0;i<h.length;i+=1)g=h[i]&&d(h[i])?d(h[i]):0,e=g>e?g:e;return a.log("Requested number of ticks: ",b),a.log("Calculated max values to be: ",e),b=b>e?e-1:b,b=b<1?1:b,b=Math.floor(b),a.log("Calculating tick count as: ",b),b}return a.utils.calcTicksX(b,c)},a.utils.initOption=function(a,b){a._calls&&a._calls[b]?a[b]=a._calls[b]:(a[b]=function(c){return arguments.length?(a._overrides[b]=!0,a._options[b]=c,a):a._options[b]},a["_"+b]=function(c){return arguments.length?(a._overrides[b]||(a._options[b]=c),a):a._options[b]})},a.utils.initOptions=function(b){b._overrides=b._overrides||{};var c=Object.getOwnPropertyNames(b._options||{}),d=Object.getOwnPropertyNames(b._calls||{});c=c.concat(d);for(var e in c)a.utils.initOption(b,c[e])},a.utils.inheritOptionsD3=function(a,b,c){a._d3options=c.concat(a._d3options||[]),a._d3options=(a._d3options||[]).filter(function(a,b,c){return c.indexOf(a)===b}),c.unshift(b),c.unshift(a),d3.rebind.apply(this,c)},a.utils.arrayUnique=function(a){return a.sort().filter(function(b,c){return!c||b!=a[c-1]})},a.utils.symbolMap=d3.map(),a.utils.symbol=function(){function b(b,e){var f=c.call(this,b,e),g=d.call(this,b,e);return-1!==d3.svg.symbolTypes.indexOf(f)?d3.svg.symbol().type(f).size(g)():a.utils.symbolMap.get(f)(g)}var c,d=64;return b.type=function(a){return arguments.length?(c=d3.functor(a),b):c},b.size=function(a){return arguments.length?(d=d3.functor(a),b):d},b},a.utils.inheritOptions=function(b,c){var d=Object.getOwnPropertyNames(c._options||{}),e=Object.getOwnPropertyNames(c._calls||{}),f=c._inherited||[],g=c._d3options||[],h=d.concat(e).concat(f).concat(g);h.unshift(c),h.unshift(b),d3.rebind.apply(this,h),b._inherited=a.utils.arrayUnique(d.concat(e).concat(f).concat(d).concat(b._inherited||[])),b._d3options=a.utils.arrayUnique(g.concat(b._d3options||[]))},a.utils.initSVG=function(a){a.classed({"nvd3-svg":!0})},a.utils.sanitizeHeight=function(a,b){return a||parseInt(b.style("height"),10)||400},a.utils.sanitizeWidth=function(a,b){return a||parseInt(b.style("width"),10)||960},a.utils.availableHeight=function(b,c,d){return Math.max(0,a.utils.sanitizeHeight(b,c)-d.top-d.bottom)},a.utils.availableWidth=function(b,c,d){return Math.max(0,a.utils.sanitizeWidth(b,c)-d.left-d.right)},a.utils.noData=function(b,c){var d=b.options(),e=d.margin(),f=d.noData(),g=null==f?["No Data Available."]:[f],h=a.utils.availableHeight(null,c,e),i=a.utils.availableWidth(null,c,e),j=e.left+i/2,k=e.top+h/2;c.selectAll("g").remove();var l=c.selectAll(".nv-noData").data(g);l.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),l.attr("x",j).attr("y",k).text(function(a){return a})},a.utils.wrapTicks=function(a,b){a.each(function(){for(var a,c=d3.select(this),d=c.text().split(/\s+/).reverse(),e=[],f=0,g=1.1,h=c.attr("y"),i=parseFloat(c.attr("dy")),j=c.text(null).append("tspan").attr("x",0).attr("y",h).attr("dy",i+"em");a=d.pop();)e.push(a),j.text(e.join(" ")),j.node().getComputedTextLength()>b&&(e.pop(),j.text(e.join(" ")),e=[a],j=c.append("tspan").attr("x",0).attr("y",h).attr("dy",++f*g+i+"em").text(a))})},a.utils.arrayEquals=function(b,c){if(b===c)return!0;if(!b||!c)return!1;if(b.length!=c.length)return!1;for(var d=0,e=b.length;d<e;d++)if(b[d]instanceof Array&&c[d]instanceof Array){if(!a.arrayEquals(b[d],c[d]))return!1}else if(b[d]!=c[d])return!1;return!0},a.utils.pointIsInArc=function(a,b,c){var d=c.innerRadius()(b),e=c.outerRadius()(b),f=c.startAngle()(b),g=c.endAngle()(b),h=a.x*a.x+a.y*a.y,i=Math.atan2(a.x,-a.y);return i=i<0?i+2*Math.PI:i,d*d<=h&&h<=e*e&&f<=i&&i<=g},a.models.axis=function(){"use strict";function b(h){return u.reset(),h.each(function(b){var h=d3.select(this);a.utils.initSVG(h);var r=h.selectAll("g.nv-wrap.nv-axis").data([b]),s=r.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),v=(s.append("g"),r.select("g"));null!==o?d.ticks(o):"top"!=d.orient()&&"bottom"!=d.orient()||d.ticks(Math.abs(e.range()[1]-e.range()[0])/100),v.watchTransition(u,"axis").call(d),t=t||d.scale();var w=d.tickFormat();null==w&&(w=t.tickFormat());var x=v.selectAll("text.nv-axislabel").data([i||null]);x.exit().remove(),void 0!==q&&v.selectAll("g").select("text").style("font-size",q);var y,z,A;switch(d.orient()){case"top":y=p+36,x.enter().append("text").attr("class","nv-axislabel"),A=0,1===e.range().length?A=n?2*e.range()[0]+e.rangeBand():0:2===e.range().length?A=n?e.range()[0]+e.range()[1]+e.rangeBand():e.range()[1]:e.range().length>2&&(A=e.range()[e.range().length-1]+(e.range()[1]-e.range()[0])),x.attr("text-anchor","middle").attr("y",-y).attr("x",A/2),j&&(z=r.selectAll("g.nv-axisMaxMin").data(e.domain()),z.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-x",0==b?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),z.exit().remove(),z.attr("transform",function(b,c){return"translate("+a.utils.NaNtoZero(e(b))+",0)"}).select("text").attr("dy","-0.5em").attr("y",-d.tickPadding()).attr("text-anchor","middle").text(function(a,b){var d=c||w,e=d(a);return(""+e).match("NaN")?"":e}),z.watchTransition(u,"min-max top").attr("transform",function(b,c){return"translate("+a.utils.NaNtoZero(e.range()[c])+",0)"}));break;case"bottom":y=p+36;var B=30,C=0,D=v.selectAll("g").select("text"),E="";if(k%360){D.attr("transform",""),D.each(function(a,b){var c=this.getBoundingClientRect(),d=c.width;C=c.height,d>B&&(B=d)}),E="rotate("+k+" 0,"+(C/2+d.tickPadding())+")";var F=Math.abs(Math.sin(k*Math.PI/180));y=(F?F*B:B)+30,D.attr("transform",E).style("text-anchor",k%360>0?"start":"end")}else m?D.attr("transform",function(a,b){return"translate(0,"+(b%2==0?"0":"12")+")"}):D.attr("transform","translate(0,0)");x.enter().append("text").attr("class","nv-axislabel"),A=0,1===e.range().length?A=n?2*e.range()[0]+e.rangeBand():0:2===e.range().length?A=n?e.range()[0]+e.range()[1]+e.rangeBand():e.range()[1]:e.range().length>2&&(A=e.range()[e.range().length-1]+(e.range()[1]-e.range()[0])),x.attr("text-anchor","middle").attr("y",y).attr("x",A/2),j&&(z=r.selectAll("g.nv-axisMaxMin").data([e.domain()[0],e.domain()[e.domain().length-1]]),z.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-x",0==b?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),z.exit().remove(),z.attr("transform",function(b,c){return"translate("+a.utils.NaNtoZero(e(b)+(n?e.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",d.tickPadding()).attr("transform",E).style("text-anchor",k?k%360>0?"start":"end":"middle").text(function(a,b){var d=c||w,e=d(a);return(""+e).match("NaN")?"":e}),z.watchTransition(u,"min-max bottom").attr("transform",function(b,c){return"translate("+a.utils.NaNtoZero(e(b)+(n?e.rangeBand()/2:0))+",0)"}));break;case"right":x.enter().append("text").attr("class","nv-axislabel"),x.style("text-anchor",l?"middle":"begin").attr("transform",l?"rotate(90)":"").attr("y",l?12-Math.max(f.right,g)-(p||0):-10).attr("x",l?d3.max(e.range())/2:d.tickPadding()),j&&(z=r.selectAll("g.nv-axisMaxMin").data(e.domain()),z.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-y",0==b?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),z.exit().remove(),z.attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(e(b))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",d.tickPadding()).style("text-anchor","start").text(function(a,b){var d=c||w,e=d(a);return(""+e).match("NaN")?"":e}),z.watchTransition(u,"min-max right").attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(e.range()[c])+")"}).select("text").style("opacity",1));break;case"left":x.enter().append("text").attr("class","nv-axislabel"),x.style("text-anchor",l?"middle":"end").attr("transform",l?"rotate(-90)":"").attr("y",l?25-Math.max(f.left,g)-(p||0):-10).attr("x",l?-d3.max(e.range())/2:-d.tickPadding()),j&&(z=r.selectAll("g.nv-axisMaxMin").data(e.domain()),z.enter().append("g").attr("class",function(a,b){return["nv-axisMaxMin","nv-axisMaxMin-y",0==b?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),z.exit().remove(),z.attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(t(b))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-d.tickPadding()).attr("text-anchor","end").text(function(a,b){var d=c||w,e=d(a);return(""+e).match("NaN")?"":e}),z.watchTransition(u,"min-max right").attr("transform",function(b,c){return"translate(0,"+a.utils.NaNtoZero(e.range()[c])+")"}).select("text").style("opacity",1))}if(x.text(function(a){return a}),!j||"left"!==d.orient()&&"right"!==d.orient()||(v.selectAll("g").each(function(a,b){d3.select(this).select("text").attr("opacity",1),(e(a)<e.range()[1]+10||e(a)>e.range()[0]-10)&&((a>1e-10||a<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),e.domain()[0]==e.domain()[1]&&0==e.domain()[0]&&r.selectAll("g.nv-axisMaxMin").style("opacity",function(a,b){return b?0:1})),j&&("top"===d.orient()||"bottom"===d.orient())){var G=[];r.selectAll("g.nv-axisMaxMin").each(function(a,b){try{b?G.push(e(a)-this.getBoundingClientRect().width-4):G.push(e(a)+this.getBoundingClientRect().width+4)}catch(c){b?G.push(e(a)-4):G.push(e(a)+4)}}),v.selectAll("g").each(function(a,b){(e(a)<G[0]||e(a)>G[1])&&(a>1e-10||a<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())})}v.selectAll(".tick").filter(function(a){return!parseFloat(Math.round(1e5*a)/1e6)&&void 0!==a}).classed("zero",!0),t=e.copy()}),u.renderEnd("axis immediate"),b}var c,d=d3.svg.axis(),e=d3.scale.linear(),f={top:0,right:0,bottom:0,left:0},g=75,h=60,i=null,j=!0,k=0,l=!0,m=!1,n=!1,o=null,p=0,q=void 0,r=250,s=d3.dispatch("renderEnd");d.scale(e).orient("bottom").tickFormat(function(a){return a});var t,u=a.utils.renderWatch(s,r);return b.axis=d,b.dispatch=s,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return p},set:function(a){p=a}},staggerLabels:{get:function(){return m},set:function(a){m=a}},rotateLabels:{get:function(){return k},set:function(a){k=a}},rotateYLabel:{get:function(){return l},set:function(a){l=a}},showMaxMin:{get:function(){return j},set:function(a){j=a}},axisLabel:{get:function(){return i},set:function(a){i=a}},height:{get:function(){return h},set:function(a){h=a}},ticks:{get:function(){return o},set:function(a){o=a}},width:{get:function(){return g},set:function(a){g=a}},fontSize:{get:function(){return q},set:function(a){q=a}},tickFormatMaxMin:{get:function(){return c},set:function(a){c=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}},duration:{get:function(){return r},set:function(a){r=a,u.reset(r)}},scale:{get:function(){return e},set:function(c){e=c,d.scale(e),n="function"==typeof e.rangeBands,a.utils.inheritOptionsD3(b,e,["domain","range","rangeBand","rangeBands"])}}}),a.utils.initOptions(b),a.utils.inheritOptionsD3(b,d,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),a.utils.inheritOptionsD3(b,e,["domain","range","rangeBand","rangeBands"]),b},a.models.boxPlot=function(){"use strict";function b(l){return E.reset(),l.each(function(b){var l=j-i.left-i.right,F=k-i.top-i.bottom;A=d3.select(this),a.utils.initSVG(A),m.domain(c||b.map(function(a,b){return o(a,b)})).rangeBands(d||[0,l],.1);var G=[];if(!e){var H,I,J=[];b.forEach(function(a,b){var c=p(a),d=r(a),e=s(a),f=t(a),g=v(a);g&&g.forEach(function(a,b){J.push(w(a,b,void 0))}),e&&J.push(e),c&&J.push(c),d&&J.push(d),f&&J.push(f)}),H=d3.min(J),I=d3.max(J),G=[H,I]}n.domain(e||G),n.range(f||[F,0]),g=g||m,h=h||n.copy().range([n(0),n(0)]);var K=A.selectAll("g.nv-wrap").data([b]);K.enter().append("g").attr("class","nvd3 nv-wrap");K.attr("transform","translate("+i.left+","+i.top+")");var L=K.selectAll(".nv-boxplot").data(function(a){return a}),M=L.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);L.attr("class","nv-boxplot").attr("transform",function(a,b,c){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", 0)"}).classed("hover",function(a){return a.hover}),L.watchTransition(E,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay(function(a,c){return c*C/b.length}).attr("transform",function(a,b){return"translate("+(m(o(a,b))+.05*m.rangeBand())+", 0)"}),L.exit().remove(),M.each(function(a,b){var c=d3.select(this);[s,t].forEach(function(d){if(void 0!==d(a)&&null!==d(a)){var e=d===s?"low":"high";c.append("line").style("stroke",u(a)||z(a,b)).attr("class","nv-boxplot-whisker nv-boxplot-"+e),c.append("line").style("stroke",u(a)||z(a,b)).attr("class","nv-boxplot-tick nv-boxplot-"+e)}})});var N=function(){return null===D?.9*m.rangeBand():Math.min(75,.9*m.rangeBand())},O=function(){return.45*m.rangeBand()-N()/2},P=function(){return.45*m.rangeBand()+N()/2};[s,t].forEach(function(a){var b=a===s?"low":"high",c=a===s?p:r;L.select("line.nv-boxplot-whisker.nv-boxplot-"+b).watchTransition(E,"nv-boxplot: boxplots").attr("x1",.45*m.rangeBand()).attr("y1",function(b,c){return n(a(b))}).attr("x2",.45*m.rangeBand()).attr("y2",function(a,b){return n(c(a))}),L.select("line.nv-boxplot-tick.nv-boxplot-"+b).watchTransition(E,"nv-boxplot: boxplots").attr("x1",O).attr("y1",function(b,c){return n(a(b))}).attr("x2",P).attr("y2",function(b,c){return n(a(b))})}),[s,t].forEach(function(a){var b=a===s?"low":"high";M.selectAll(".nv-boxplot-"+b).on("mouseover",function(b,c,d){d3.select(this).classed("hover",!0),B.elementMouseover({series:{key:a(b),color:u(b)||z(b,d)},e:d3.event})}).on("mouseout",function(b,c,d){d3.select(this).classed("hover",!1),B.elementMouseout({series:{key:a(b),color:u(b)||z(b,d)},e:d3.event})}).on("mousemove",function(a,b){B.elementMousemove({e:d3.event})})}),M.append("rect").attr("class","nv-boxplot-box").on("mouseover",function(a,b){d3.select(this).classed("hover",!0),B.elementMouseover({key:o(a),value:o(a),series:[{key:"Q3",value:r(a),color:u(a)||z(a,b)},{key:"Q2",value:q(a),color:u(a)||z(a,b)},{key:"Q1",value:p(a),color:u(a)||z(a,b)}],data:a,index:b,e:d3.event})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),B.elementMouseout({key:o(a),value:o(a),series:[{key:"Q3",value:r(a),color:u(a)||z(a,b)},{key:"Q2",value:q(a),color:u(a)||z(a,b)},{key:"Q1",value:p(a),color:u(a)||z(a,b)}],data:a,index:b,e:d3.event})}).on("mousemove",function(a,b){B.elementMousemove({e:d3.event})}),L.select("rect.nv-boxplot-box").watchTransition(E,"nv-boxplot: boxes").attr("y",function(a,b){return n(r(a))}).attr("width",N).attr("x",O).attr("height",function(a,b){return Math.abs(n(r(a))-n(p(a)))||1}).style("fill",function(a,b){return u(a)||z(a,b)}).style("stroke",function(a,b){return u(a)||z(a,b)}),M.append("line").attr("class","nv-boxplot-median"),L.select("line.nv-boxplot-median").watchTransition(E,"nv-boxplot: boxplots line").attr("x1",O).attr("y1",function(a,b){return n(q(a))}).attr("x2",P).attr("y2",function(a,b){return n(q(a))});var Q=L.selectAll(".nv-boxplot-outlier").data(function(a){return v(a)||[]});Q.enter().append("circle").style("fill",function(a,b,c){return y(a,b,c)||z(a,c)}).style("stroke",function(a,b,c){return y(a,b,c)||z(a,c)}).style("z-index",9e3).on("mouseover",function(a,b,c){d3.select(this).classed("hover",!0),B.elementMouseover({series:{key:x(a,b,c),color:y(a,b,c)||z(a,c)},e:d3.event})}).on("mouseout",function(a,b,c){d3.select(this).classed("hover",!1),B.elementMouseout({series:{key:x(a,b,c),color:y(a,b,c)||z(a,c)},e:d3.event})}).on("mousemove",function(a,b){B.elementMousemove({e:d3.event})}),Q.attr("class","nv-boxplot-outlier"),Q.watchTransition(E,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*m.rangeBand()).attr("cy",function(a,b,c){return n(w(a,b,c))}).attr("r","3"),Q.exit().remove(),g=m.copy(),h=n.copy()}),E.renderEnd("nv-boxplot immediate"),b}var c,d,e,f,g,h,i={top:0,right:0,bottom:0,left:0},j=960,k=500,l=Math.floor(1e4*Math.random()),m=d3.scale.ordinal(),n=d3.scale.linear(),o=function(a){return a.label},p=function(a){return a.values.Q1},q=function(a){return a.values.Q2},r=function(a){return a.values.Q3},s=function(a){return a.values.whisker_low},t=function(a){return a.values.whisker_high},u=function(a){return a.color},v=function(a){return a.values.outliers},w=function(a,b,c){return a},x=function(a,b,c){return a
|
|
4
|
+
},y=function(a,b,c){},z=a.utils.defaultColor(),A=null,B=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),C=250,D=null,E=a.utils.renderWatch(B,C);return b.dispatch=B,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return j},set:function(a){j=a}},height:{get:function(){return k},set:function(a){k=a}},maxBoxWidth:{get:function(){return D},set:function(a){D=a}},x:{get:function(){return o},set:function(a){o=a}},q1:{get:function(){return p},set:function(a){p=a}},q2:{get:function(){return q},set:function(a){q=a}},q3:{get:function(){return r},set:function(a){r=a}},wl:{get:function(){return s},set:function(a){s=a}},wh:{get:function(){return t},set:function(a){t=a}},itemColor:{get:function(){return u},set:function(a){u=a}},outliers:{get:function(){return v},set:function(a){v=a}},outlierValue:{get:function(){return w},set:function(a){w=a}},outlierLabel:{get:function(){return x},set:function(a){x=a}},outlierColor:{get:function(){return y},set:function(a){y=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return d},set:function(a){d=a}},yRange:{get:function(){return f},set:function(a){f=a}},id:{get:function(){return l},set:function(a){l=a}},y:{get:function(){return console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead."),{}},set:function(a){console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead.")}},margin:{get:function(){return i},set:function(a){i.top=void 0!==a.top?a.top:i.top,i.right=void 0!==a.right?a.right:i.right,i.bottom=void 0!==a.bottom?a.bottom:i.bottom,i.left=void 0!==a.left?a.left:i.left}},color:{get:function(){return z},set:function(b){z=a.utils.getColor(b)}},duration:{get:function(){return C},set:function(a){C=a,E.reset(C)}}}),a.utils.initOptions(b),b},a.models.boxPlotChart=function(){"use strict";function b(k){return t.reset(),t.models(e),l&&t.models(f),m&&t.models(g),k.each(function(k){var p=d3.select(this);a.utils.initSVG(p);var t=(i||parseInt(p.style("width"))||960)-h.left-h.right,u=(j||parseInt(p.style("height"))||400)-h.top-h.bottom;if(b.update=function(){r.beforeUpdate(),p.transition().duration(s).call(b)},b.container=this,!k||!k.length){var v=p.selectAll(".nv-noData").data([q]);return v.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),v.attr("x",h.left+t/2).attr("y",h.top+u/2).text(function(a){return a}),b}p.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var w=p.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([k]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),y=x.append("defs"),z=w.select("g");if(x.append("g").attr("class","nv-x nv-axis"),x.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),x.append("g").attr("class","nv-barsWrap"),z.attr("transform","translate("+h.left+","+h.top+")"),n&&z.select(".nv-y.nv-axis").attr("transform","translate("+t+",0)"),e.width(t).height(u),z.select(".nv-barsWrap").datum(k.filter(function(a){return!a.disabled})).transition().call(e),y.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),z.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",c.rangeBand()*(o?2:1)).attr("height",16).attr("x",-c.rangeBand()/(o?1:2)),l){f.scale(c).ticks(a.utils.calcTicksX(t/100,k)).tickSize(-u,0),z.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),z.select(".nv-x.nv-axis").call(f);var A=z.select(".nv-x.nv-axis").selectAll("g");o&&A.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}m&&(g.scale(d).ticks(Math.floor(u/36)).tickSize(-t,0),z.select(".nv-y.nv-axis").call(g)),z.select(".nv-zeroLine line").attr("x1",0).attr("x2",t).attr("y1",d(0)).attr("y2",d(0))}),t.renderEnd("nv-boxplot chart immediate"),b}var c,d,e=a.models.boxPlot(),f=a.models.axis(),g=a.models.axis(),h={top:15,right:10,bottom:50,left:60},i=null,j=null,k=a.utils.getColor(),l=!0,m=!0,n=!1,o=!1,p=a.models.tooltip(),q="No Data Available.",r=d3.dispatch("beforeUpdate","renderEnd"),s=250;f.orient("bottom").showMaxMin(!1).tickFormat(function(a){return a}),g.orient(n?"right":"left").tickFormat(d3.format(",.1f")),p.duration(0);var t=a.utils.renderWatch(r,s);return e.dispatch.on("elementMouseover.tooltip",function(a){p.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(a){p.data(a).hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(a){p()}),b.dispatch=r,b.boxplot=e,b.xAxis=f,b.yAxis=g,b.tooltip=p,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return i},set:function(a){i=a}},height:{get:function(){return j},set:function(a){j=a}},staggerLabels:{get:function(){return o},set:function(a){o=a}},showXAxis:{get:function(){return l},set:function(a){l=a}},showYAxis:{get:function(){return m},set:function(a){m=a}},tooltipContent:{get:function(){return p},set:function(a){p=a}},noData:{get:function(){return q},set:function(a){q=a}},margin:{get:function(){return h},set:function(a){h.top=void 0!==a.top?a.top:h.top,h.right=void 0!==a.right?a.right:h.right,h.bottom=void 0!==a.bottom?a.bottom:h.bottom,h.left=void 0!==a.left?a.left:h.left}},duration:{get:function(){return s},set:function(a){s=a,t.reset(s),e.duration(s),f.duration(s),g.duration(s)}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),e.color(k)}},rightAlignYAxis:{get:function(){return n},set:function(a){n=a,g.orient(a?"right":"left")}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.bullet=function(){"use strict";function b(a,b){var c=a.slice();a.sort(function(a,d){var e=c.indexOf(a),f=c.indexOf(d);return d3.descending(b[e],b[f])})}function c(e){return e.each(function(c,e){var s=p-d.left-d.right,y=q-d.top-d.bottom;r=d3.select(this),a.utils.initSVG(r);var z=g.call(this,c,e).slice(),A=h.call(this,c,e).slice(),B=i.call(this,c,e).slice(),C=j.call(this,c,e).slice(),D=k.call(this,c,e).slice(),E=l.call(this,c,e).slice(),F=m.call(this,c,e).slice(),G=n.call(this,c,e).slice();b(D,z),b(E,A),b(F,B),b(G,C),z.sort(d3.descending),A.sort(d3.descending),B.sort(d3.descending),C.sort(d3.descending);var H=d3.scale.linear().domain(d3.extent(d3.merge([o,z]))).range(f?[s,0]:[0,s]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(H.range());this.__chart__=H;for(var I=(d3.min(z),d3.max(z),z[1],r.selectAll("g.nv-wrap.nv-bullet").data([c])),J=I.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),K=J.append("g"),L=I.select("g"),e=0,M=z.length;e<M;e++){var N="nv-range nv-range"+e;e<=2&&(N=N+" nv-range"+w[e]),K.append("rect").attr("class",N)}K.append("rect").attr("class","nv-measure"),I.attr("transform","translate("+d.left+","+d.top+")");for(var O=function(a){return Math.abs(H(a)-H(0))},P=function(a){return H(a<0?a:0)},e=0,M=z.length;e<M;e++){var Q=z[e];L.select("rect.nv-range"+e).datum(Q).attr("height",y).transition().duration(x).attr("width",O(Q)).attr("x",P(Q))}L.select("rect.nv-measure").style("fill",t).attr("height",y/3).attr("y",y/3).on("mouseover",function(){u.elementMouseover({value:C[0],label:G[0]||"Current",color:d3.select(this).style("fill")})}).on("mousemove",function(){u.elementMousemove({value:C[0],label:G[0]||"Current",color:d3.select(this).style("fill")})}).on("mouseout",function(){u.elementMouseout({value:C[0],label:G[0]||"Current",color:d3.select(this).style("fill")})}).transition().duration(x).attr("width",C<0?H(0)-H(C[0]):H(C[0])-H(0)).attr("x",P(C));var R=y/6,S=A.map(function(a,b){return{value:a,label:E[b]}});K.selectAll("path.nv-markerTriangle").data(S).enter().append("path").attr("class","nv-markerTriangle").attr("d","M0,"+R+"L"+R+","+-R+" "+-R+","+-R+"Z").on("mouseover",function(a){u.elementMouseover({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill"),pos:[H(a.value),y/2]})}).on("mousemove",function(a){u.elementMousemove({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){u.elementMouseout({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}),L.selectAll("path.nv-markerTriangle").data(S).transition().duration(x).attr("transform",function(a){return"translate("+H(a.value)+","+y/2+")"});var T=B.map(function(a,b){return{value:a,label:F[b]}});K.selectAll("line.nv-markerLine").data(T).enter().append("line").attr("cursor","").attr("class","nv-markerLine").attr("x1",function(a){return H(a.value)}).attr("y1","2").attr("x2",function(a){return H(a.value)}).attr("y2",y-2).on("mouseover",function(a){u.elementMouseover({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill"),pos:[H(a.value),y/2]})}).on("mousemove",function(a){u.elementMousemove({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){u.elementMouseout({value:a.value,label:a.label||"Previous",color:d3.select(this).style("fill")})}),L.selectAll("line.nv-markerLine").data(T).transition().duration(x).attr("x1",function(a){return H(a.value)}).attr("x2",function(a){return H(a.value)}),I.selectAll(".nv-range").on("mouseover",function(a,b){var c=D[b]||v[b];u.elementMouseover({value:a,label:c,color:d3.select(this).style("fill")})}).on("mousemove",function(){u.elementMousemove({value:C[0],label:G[0]||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){var c=D[b]||v[b];u.elementMouseout({value:a,label:c,color:d3.select(this).style("fill")})})}),c}var d={top:0,right:0,bottom:0,left:0},e="left",f=!1,g=function(a){return a.ranges},h=function(a){return a.markers?a.markers:[]},i=function(a){return a.markerLines?a.markerLines:[0]},j=function(a){return a.measures},k=function(a){return a.rangeLabels?a.rangeLabels:[]},l=function(a){return a.markerLabels?a.markerLabels:[]},m=function(a){return a.markerLineLabels?a.markerLineLabels:[]},n=function(a){return a.measureLabels?a.measureLabels:[]},o=[0],p=380,q=30,r=null,s=null,t=a.utils.getColor(["#1f77b4"]),u=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),v=["Maximum","Mean","Minimum"],w=["Max","Avg","Min"],x=1e3;return c.dispatch=u,c.options=a.utils.optionsFunc.bind(c),c._options=Object.create({},{ranges:{get:function(){return g},set:function(a){g=a}},markers:{get:function(){return h},set:function(a){h=a}},measures:{get:function(){return j},set:function(a){j=a}},forceX:{get:function(){return o},set:function(a){o=a}},width:{get:function(){return p},set:function(a){p=a}},height:{get:function(){return q},set:function(a){q=a}},tickFormat:{get:function(){return s},set:function(a){s=a}},duration:{get:function(){return x},set:function(a){x=a}},margin:{get:function(){return d},set:function(a){d.top=void 0!==a.top?a.top:d.top,d.right=void 0!==a.right?a.right:d.right,d.bottom=void 0!==a.bottom?a.bottom:d.bottom,d.left=void 0!==a.left?a.left:d.left}},orient:{get:function(){return e},set:function(a){e=a,f="right"==e||"bottom"==e}},color:{get:function(){return t},set:function(b){t=a.utils.getColor(b)}}}),a.utils.initOptions(c),c},a.models.bulletChart=function(){"use strict";function b(d){return d.each(function(e,o){var p=d3.select(this);a.utils.initSVG(p);var q=a.utils.availableWidth(k,p,g),r=l-g.top-g.bottom;if(b.update=function(){b(d)},b.container=this,!e||!h.call(this,e,o))return a.utils.noData(b,p),b;p.selectAll(".nv-noData").remove();var s=h.call(this,e,o).slice().sort(d3.descending),t=i.call(this,e,o).slice().sort(d3.descending),u=j.call(this,e,o).slice().sort(d3.descending),v=p.selectAll("g.nv-wrap.nv-bulletChart").data([e]),w=v.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),x=w.append("g"),y=v.select("g");x.append("g").attr("class","nv-bulletWrap"),x.append("g").attr("class","nv-titles"),v.attr("transform","translate("+g.left+","+g.top+")");var z=d3.scale.linear().domain([0,Math.max(s[0],t[0]||0,u[0])]).range(f?[q,0]:[0,q]),A=this.__chart__||d3.scale.linear().domain([0,1/0]).range(z.range());this.__chart__=z;var B=x.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(l-g.top-g.bottom)/2+")");B.append("text").attr("class","nv-title").text(function(a){return a.title}),B.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(a){return a.subtitle}),c.width(q).height(r);var C=y.select(".nv-bulletWrap");d3.transition(C).call(c);var D=m||z.tickFormat(q/100),E=y.selectAll("g.nv-tick").data(z.ticks(n||q/50),function(a){return this.textContent||D(a)}),F=E.enter().append("g").attr("class","nv-tick").attr("transform",function(a){return"translate("+A(a)+",0)"}).style("opacity",1e-6);F.append("line").attr("y1",r).attr("y2",7*r/6),F.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*r/6).text(D);var G=d3.transition(E).transition().duration(c.duration()).attr("transform",function(a){return"translate("+z(a)+",0)"}).style("opacity",1);G.select("line").attr("y1",r).attr("y2",7*r/6),G.select("text").attr("y",7*r/6),d3.transition(E.exit()).transition().duration(c.duration()).attr("transform",function(a){return"translate("+z(a)+",0)"}).style("opacity",1e-6).remove()}),d3.timer.flush(),b}var c=a.models.bullet(),d=a.models.tooltip(),e="left",f=!1,g={top:5,right:40,bottom:20,left:120},h=function(a){return a.ranges},i=function(a){return a.markers?a.markers:[]},j=function(a){return a.measures},k=null,l=55,m=null,n=null,o=null,p=d3.dispatch();return d.duration(0).headerEnabled(!1),c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:a.label,value:a.value,color:a.color},d.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(a){d.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(a){d()}),b.bullet=c,b.dispatch=p,b.tooltip=d,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{ranges:{get:function(){return h},set:function(a){h=a}},markers:{get:function(){return i},set:function(a){i=a}},measures:{get:function(){return j},set:function(a){j=a}},width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},tickFormat:{get:function(){return m},set:function(a){m=a}},ticks:{get:function(){return n},set:function(a){n=a}},noData:{get:function(){return o},set:function(a){o=a}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},orient:{get:function(){return e},set:function(a){e=a,f="right"==e||"bottom"==e}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.candlestickBar=function(){"use strict";function b(x){return x.each(function(b){c=d3.select(this);var x=a.utils.availableWidth(i,c,h),y=a.utils.availableHeight(j,c,h);a.utils.initSVG(c);var A=x/b[0].values.length*.45;l.domain(d||d3.extent(b[0].values.map(n).concat(t))),v?l.range(f||[.5*x/b[0].values.length,x*(b[0].values.length-.5)/b[0].values.length]):l.range(f||[5+A/2,x-A/2-5]),m.domain(e||[d3.min(b[0].values.map(s).concat(u)),d3.max(b[0].values.map(r).concat(u))]).range(g||[y,0]),l.domain()[0]===l.domain()[1]&&(l.domain()[0]?l.domain([l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]):l.domain([-1,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]));var B=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([b[0].values]),C=B.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar"),D=C.append("defs"),E=C.append("g"),F=B.select("g");E.append("g").attr("class","nv-ticks"),B.attr("transform","translate("+h.left+","+h.top+")"),c.on("click",function(a,b){z.chartClick({data:a,index:b,pos:d3.event,id:k})}),D.append("clipPath").attr("id","nv-chart-clip-path-"+k).append("rect"),B.select("#nv-chart-clip-path-"+k+" rect").attr("width",x).attr("height",y),F.attr("clip-path",w?"url(#nv-chart-clip-path-"+k+")":"");var G=B.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});G.exit().remove();var H=G.enter().append("g");G.attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b});H.append("line").attr("class","nv-candlestick-lines").attr("transform",function(a,b){return"translate("+l(n(a,b))+",0)"}).attr("x1",0).attr("y1",function(a,b){return m(r(a,b))}).attr("x2",0).attr("y2",function(a,b){return m(s(a,b))}),H.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",function(a,b){return"translate("+(l(n(a,b))-A/2)+","+(m(o(a,b))-(p(a,b)>q(a,b)?m(q(a,b))-m(p(a,b)):0))+")"}).attr("x",0).attr("y",0).attr("width",A).attr("height",function(a,b){var c=p(a,b),d=q(a,b);return c>d?m(d)-m(c):m(c)-m(d)});G.select(".nv-candlestick-lines").transition().attr("transform",function(a,b){return"translate("+l(n(a,b))+",0)"}).attr("x1",0).attr("y1",function(a,b){return m(r(a,b))}).attr("x2",0).attr("y2",function(a,b){return m(s(a,b))}),G.select(".nv-candlestick-rects").transition().attr("transform",function(a,b){return"translate("+(l(n(a,b))-A/2)+","+(m(o(a,b))-(p(a,b)>q(a,b)?m(q(a,b))-m(p(a,b)):0))+")"}).attr("x",0).attr("y",0).attr("width",A).attr("height",function(a,b){var c=p(a,b),d=q(a,b);return c>d?m(d)-m(c):m(c)-m(d)})}),b}var c,d,e,f,g,h={top:0,right:0,bottom:0,left:0},i=null,j=null,k=Math.floor(1e4*Math.random()),l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=function(a){return a.open},q=function(a){return a.close},r=function(a){return a.high},s=function(a){return a.low},t=[],u=[],v=!1,w=!0,x=a.utils.defaultColor(),y=!1,z=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");return b.highlightPoint=function(a,d){b.clearHighlights(),c.select(".nv-candlestickBar .nv-tick-0-"+a).classed("hover",d)},b.clearHighlights=function(){c.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return i},set:function(a){i=a}},height:{get:function(){return j},set:function(a){j=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},padData:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return w},set:function(a){w=a}},id:{get:function(){return k},set:function(a){k=a}},interactive:{get:function(){return y},set:function(a){y=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},open:{get:function(){return p()},set:function(a){p=a}},close:{get:function(){return q()},set:function(a){q=a}},high:{get:function(){return r},set:function(a){r=a}},low:{get:function(){return s},set:function(a){s=a}},margin:{get:function(){return h},set:function(a){h.top=void 0!=a.top?a.top:h.top,h.right=void 0!=a.right?a.right:h.right,h.bottom=void 0!=a.bottom?a.bottom:h.bottom,h.left=void 0!=a.left?a.left:h.left}},color:{get:function(){return x},set:function(b){x=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.cumulativeLineChart=function(){"use strict";function b(m){return K.reset(),K.models(g),t&&K.models(h),u&&K.models(i),m.each(function(m){function C(a,c){d3.select(b.container).style("cursor","ew-resize")}function G(a,b){J.x=d3.event.x,J.i=Math.round(I.invert(J.x)),N()}function K(a,c){d3.select(b.container).style("cursor","auto"),A.index=J.i,E.stateChange(A)}function N(){ba.data([J]);var a=b.duration();b.duration(0),b.update(),b.duration(a)}var O=d3.select(this);a.utils.initSVG(O),O.classed("nv-chart-"+z,!0);var P=a.utils.availableWidth(q,O,n),Q=a.utils.availableHeight(r,O,n);if(b.update=function(){0===F?O.call(b):O.transition().duration(F).call(b)},b.container=this,A.setter(M(m),b.update).getter(L(m)).update(),A.disabled=m.map(function(a){return!!a.disabled}),!B){var R;B={};for(R in A)A[R]instanceof Array?B[R]=A[R].slice(0):B[R]=A[R]}var S=d3.behavior.drag().on("dragstart",C).on("drag",G).on("dragend",K);if(!(m&&m.length&&m.filter(function(a){return a.values.length}).length))return a.utils.noData(b,O),b;O.selectAll(".nv-noData").remove(),e=g.xScale(),f=g.yScale(),I.domain([0,m[0].values.length-1]).range([0,P]).clamp(!0);var m=c(J.i,m);void 0===H&&(H=d(m)),y?g.yDomain(null):(g.yDomain(H),g.clipEdge(!0));var T=x?"none":"all",U=O.selectAll("g.nv-wrap.nv-cumulativeLine").data([m]),V=U.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),W=U.select("g");if(V.append("g").attr("class","nv-interactive"),V.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),V.append("g").attr("class","nv-y nv-axis"),V.append("g").attr("class","nv-background"),V.append("g").attr("class","nv-linesWrap").style("pointer-events",T),V.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),V.append("g").attr("class","nv-legendWrap"),V.append("g").attr("class","nv-controlsWrap"),s?(j.width(P),W.select(".nv-legendWrap").datum(m).call(j),o||j.height()===n.top||(n.top=j.height(),Q=a.utils.availableHeight(r,O,n)),W.select(".nv-legendWrap").attr("transform","translate(0,"+-n.top+")")):W.select(".nv-legendWrap").selectAll("*").remove(),w){var X=[{key:"Re-scale y-axis",disabled:!y}];k.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),W.select(".nv-controlsWrap").datum(X).attr("transform","translate(0,"+-n.top+")").call(k)}else W.select(".nv-controlsWrap").selectAll("*").remove();U.attr("transform","translate("+n.left+","+n.top+")"),v&&W.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)");var Y=m.filter(function(a){return a.tempDisabled});U.select(".tempDisabled").remove(),Y.length&&U.append("text").attr("class","tempDisabled").attr("x",P/2).attr("y","-.71em").style("text-anchor","end").text(Y.map(function(a){return a.key}).join(", ")+" values cannot be calculated for this time period."),x&&(l.width(P).height(Q).margin({left:n.left,top:n.top}).svgContainer(O).xScale(e),U.select(".nv-interactive").call(l)),V.select(".nv-background").append("rect"),W.select(".nv-background rect").attr("width",P).attr("height",Q),g.y(function(a){return a.display.y}).width(P).height(Q).color(m.map(function(a,b){return a.color||p(a,b)}).filter(function(a,b){return!m[b].disabled&&!m[b].tempDisabled}));var Z=W.select(".nv-linesWrap").datum(m.filter(function(a){return!a.disabled&&!a.tempDisabled}));Z.call(g),m.forEach(function(a,b){a.seriesIndex=b});var $=m.filter(function(a){return!a.disabled&&!!D(a)}),_=W.select(".nv-avgLinesWrap").selectAll("line").data($,function(a){return a.key}),aa=function(a){var b=f(D(a));return b<0?0:b>Q?Q:b};_.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(a,b){return g.color()(a,a.seriesIndex)}).attr("x1",0).attr("x2",P).attr("y1",aa).attr("y2",aa),_.style("stroke-opacity",function(a){var b=f(D(a));return b<0||b>Q?0:1}).attr("x1",0).attr("x2",P).attr("y1",aa).attr("y2",aa),_.exit().remove();var ba=Z.selectAll(".nv-indexLine").data([J]);ba.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(S),ba.attr("transform",function(a){return"translate("+I(a.i)+",0)"}).attr("height",Q),t&&(h.scale(e)._ticks(a.utils.calcTicksX(P/70,m)).tickSize(-Q,0),W.select(".nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),W.select(".nv-x.nv-axis").call(h)),u&&(i.scale(f)._ticks(a.utils.calcTicksY(Q/36,m)).tickSize(-P,0),W.select(".nv-y.nv-axis").call(i)),W.select(".nv-background rect").on("click",function(){J.x=d3.mouse(this)[0],J.i=Math.round(I.invert(J.x)),A.index=J.i,E.stateChange(A),N()}),g.dispatch.on("elementClick",function(a){J.i=a.pointIndex,J.x=I(J.i),A.index=J.i,E.stateChange(A),N()}),k.dispatch.on("legendClick",function(a,c){a.disabled=!a.disabled,y=!a.disabled,A.rescaleY=y,y||(H=d(m)),E.stateChange(A),b.update()}),j.dispatch.on("stateChange",function(a){for(var c in a)A[c]=a[c];E.stateChange(A),b.update()}),l.dispatch.on("elementMousemove",function(c){g.clearHighlights();var d,e,f,j=[];if(m.filter(function(a,b){return a.seriesIndex=b,!(a.disabled||a.tempDisabled)}).forEach(function(h,i){e=a.interactiveBisect(h.values,c.pointXValue,b.x()),g.highlightPoint(i,e,!0);var k=h.values[e];void 0!==k&&(void 0===d&&(d=k),void 0===f&&(f=b.xScale()(b.x()(k,e))),j.push({key:h.key,value:b.y()(k,e),color:p(h,h.seriesIndex)}))}),j.length>2){var k=b.yScale().invert(c.mouseY),n=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),o=.03*n,q=a.nearestValueIndex(j.map(function(a){return a.value}),k,o);null!==q&&(j[q].highlight=!0)}var r=h.tickFormat()(b.x()(d,e),e);l.tooltip.valueFormatter(function(a,b){return i.tickFormat()(a)}).data({value:r,series:j})(),l.renderGuideLine(f)}),l.dispatch.on("elementMouseout",function(a){g.clearHighlights()}),E.on("changeState",function(a){void 0!==a.disabled&&(m.forEach(function(b,c){b.disabled=a.disabled[c]}),A.disabled=a.disabled),void 0!==a.index&&(J.i=a.index,J.x=I(J.i),A.index=a.index,ba.data([J])),void 0!==a.rescaleY&&(y=a.rescaleY),b.update()})}),K.renderEnd("cumulativeLineChart immediate"),b}function c(a,b){return N||(N=g.y()),b.map(function(b,c){if(!b.values)return b;var d=b.values[a];if(null==d)return b;var e=N(d,a);return Math.abs(e)<1e-5&&!G?(b.tempDisabled=!0,b):(b.tempDisabled=!1,b.values=b.values.map(function(a,b){return a.display={y:(N(a,b)-e)/e},a}),b)})}function d(a){var b=a.filter(function(a){return!(a.disabled||a.tempDisabled)}).map(function(a,b){return d3.extent(a.values,function(a){return a.display.y})});return[d3.min(b,function(a){return a[0]}),d3.max(b,function(a){return a[1]})]}var e,f,g=a.models.line(),h=a.models.axis(),i=a.models.axis(),j=a.models.legend(),k=a.models.legend(),l=a.interactiveGuideline(),m=a.models.tooltip(),n={top:30,right:30,bottom:50,left:60},o=null,p=a.utils.defaultColor(),q=null,r=null,s=!0,t=!0,u=!0,v=!1,w=!0,x=!1,y=!0,z=g.id(),A=a.utils.state(),B=null,C=null,D=function(a){return a.average},E=d3.dispatch("stateChange","changeState","renderEnd"),F=250,G=!1;A.index=0,A.rescaleY=y,h.orient("bottom").tickPadding(7),i.orient(v?"right":"left"),m.valueFormatter(function(a,b){return i.tickFormat()(a,b)}).headerFormatter(function(a,b){return h.tickFormat()(a,b)}),k.updateState(!1);var H,I=d3.scale.linear(),J={i:0,x:0},K=a.utils.renderWatch(E,F),L=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),index:J.i,rescaleY:y}}},M=function(a){return function(b){void 0!==b.index&&(J.i=b.index),void 0!==b.rescaleY&&(y=b.rescaleY),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};g.dispatch.on("elementMouseover.tooltip",function(a){var c={x:b.x()(a.point),y:b.y()(a.point),color:a.point.color};a.point=c,m.data(a).hidden(!1)}),g.dispatch.on("elementMouseout.tooltip",function(a){m.hidden(!0)});var N=null;return b.dispatch=E,b.lines=g,b.legend=j,b.controls=k,b.xAxis=h,b.yAxis=i,b.interactiveLayer=l,b.state=A,b.tooltip=m,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return q},set:function(a){q=a}},height:{get:function(){return r},set:function(a){r=a}},showControls:{get:function(){return w},set:function(a){w=a}},showLegend:{get:function(){return s},set:function(a){s=a}},average:{get:function(){return D},set:function(a){D=a}},defaultState:{get:function(){return B},set:function(a){B=a}},noData:{get:function(){return C},set:function(a){C=a}},showXAxis:{get:function(){return t},set:function(a){t=a}},showYAxis:{get:function(){return u},set:function(a){u=a}},noErrorCheck:{get:function(){return G},set:function(a){G=a}},rescaleY:{get:function(){return y},set:function(a){y=a,b.state.rescaleY=a}},margin:{get:function(){return n},set:function(a){void 0!==a.top&&(n.top=a.top,o=a.top),n.right=void 0!==a.right?a.right:n.right,n.bottom=void 0!==a.bottom?a.bottom:n.bottom,n.left=void 0!==a.left?a.left:n.left}},color:{get:function(){return p},set:function(b){p=a.utils.getColor(b),j.color(p)}},useInteractiveGuideline:{get:function(){return x},set:function(a){x=a,!0===a&&(b.interactive(!1),b.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return v},set:function(a){v=a,i.orient(a?"right":"left")}},duration:{get:function(){return F},set:function(a){F=a,g.duration(F),h.duration(F),i.duration(F),K.reset(F)}}}),a.utils.inheritOptions(b,g),a.utils.initOptions(b),b},a.models.differenceChart=function(){"use strict";function b(d){d.each(function(d){e=d3.select(this);var j=(d||[]).filter(function(a){return!a.disabled});if(!d||!j.length)return a.utils.noData(b,e),b;var k=c(d),l=a.utils.availableHeight(p,e,r)-g.height(),t=a.utils.availableWidth(q,e,r);e.attr("class","nv-differenceChart"),a.utils.initSVG(e),b.container=this,f.margin(r).color(d3.scale.category10().range()).y(h).width(q).height(l).interpolate(u).useInteractiveGuideline(!0),f.interactiveLayer.tooltip.valueFormatter(function(a,b,c){if(c.key===o||c.key===n){var d=Math.abs(c.data.y0-c.data.y1);return 0===d?"-":d}return a}),f.stack1.areaY1(function(a){return f.stack1.scatter.yScale()(a.display.y)}),f.stack1.transformData(function(a){a.display={y:a.y1,y0:a.y0}}),f.xAxis.scale(w),f.xAxis.tickFormat(x);var v=k.filter(function(a){return!a.disabled}).map(function(a){return a.values}),y=d3.extent(d3.merge(v),function(a){return i(a)});f.xAxis.domain(y).range([0,t]);var z=d3.extent(d3.merge(v),function(a){return h(a)});return f.yDomain1(z),f.yAxis1.tickFormat(d3.format(",.1f")),f.yAxis2.tickFormat(d3.format(",.1f")),g.width(t),g.margin(s),g.xScale(w.copy()),g.xAxis.tickFormat(x),g.xAxis.rotateLabels(0),e.append("g").attr("class","nv-focusWrap").style("display","initial").attr("transform","translate("+r.left+", "+(l+g.margin().top)+")").datum(k.filter(function(a){return"line"===a.type})).call(g),e.datum(k).call(f),g.dispatch.on("onBrush",function(a){var b=k.map(function(b){var c=-1,d=-1;b.values.some(function(b,e){return-1===c&&b.x>=a[0]&&(c=e),-1===d&&b.x>=a[1]&&(d=e,!0)});for(var e=b.values.slice(c,d),f=0;e.length<2&&f<5;)c-=1,d+=1,e=b.values.slice(c,d),f++;return Object.assign({},b,{values:e})});e.datum(b),f.xAxis.domain(a),f.update()}),b.update=function(){e.selectAll("*").remove(),0===m?e.call(b):e.transition().duration(m).call(b)},b})}function c(a){var b=a.slice(0),c=b.every(function(a){return a.processed}),d=b.filter(function(a){return"actual"===a.type}),e=b.filter(function(a){return"expected"===a.type});if(c)return b;if(!d.length||!e.length)return[];var f=e[0].key+" minus "+d[0].key+" (Predicted > Actual)",g=e[0].key+" minus "+d[0].key+" (Predicted < Actual)",h=[{key:n||f,type:"area",values:[],yAxis:1,color:"rgba(44,160,44,.9)",processed:!0,noHighlightSeries:!0},{key:o||g,type:"area",values:[],yAxis:1,color:"rgba(234,39,40,.9)",processed:!0,noHighlightSeries:!0},{key:d[0].key,type:"line",values:[],yAxis:1,color:"#666666",processed:!0,strokeWidth:v}];t&&(h[3]={key:e[0].key,type:"line",values:[],yAxis:1,color:"#aec7e8",processed:!0,strokeWidth:v});var i=d[0].values.reduce(function(a,b,c){return a[j(b)]=l(b),a},{}),m=e[0].values.reduce(function(a,b,c){return a[j(b)]=l(b),a},{});return Object.keys(i).forEach(function(a,b){var c=i[a],d=m[a],e={};e[k]=a;var f=j(e),g=d-c;isNaN(g)?(h[1].values[b]={x:f,y0:c,y1:c},h[0].values[b]={x:f,y0:c,y1:c}):g<0?(h[1].values[b]={x:f,y0:c,y1:d},h[0].values[b]={x:f,y0:c,y1:c}):(h[0].values[b]={x:f,y0:c,y1:d},h[1].values[b]={x:f,y0:c,y1:c}),h[2].values[b]={x:f,y:c},t&&(h[3].values[b]={
|
|
5
|
+
x:f,y:d})}),h}function d(a){return void 0!==a}var e=void 0,f=a.models.multiChart(),g=a.models.focus(a.models.line()),h=function(a){return d(a.y0)?a.y0:a.y},i=function(a){return a.x},j=function(a){return a.x},k="x",l=function(a){return a.y},m=300,n=null,o=null,p=null,q=null,r={top:30,right:50,bottom:20,left:70},s={top:0,right:0,bottom:0,left:0},t=!0,u="linear",v=1,w=d3.time.scale(),x=d3.time.format.multi([["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%a %d",function(a){return a.getDay()&&1!=a.getDate()}],["%b %d",function(a){return 1!=a.getDate()}],["%B",function(a){return a.getMonth()}],["%Y",function(){return!0}]]);return b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return q},set:function(a){q=a}},height:{get:function(){return p},set:function(a){p=a}},strokeWidth:{get:function(){return v},set:function(a){v=a}},x:{get:function(){return j},set:function(a){j=a}},keyForXValue:{get:function(){return k},set:function(a){k=a}},y:{get:function(){return l},set:function(a){l=a}},xScale:{get:function(){return w},set:function(a){w=a}},keyForActualLessThanPredicted:{get:function(){return n},set:function(a){n=a}},keyForActualGreaterThanPredicted:{get:function(){return o},set:function(a){o=a}},showPredictedLine:{get:function(){return t},set:function(a){t=a}},tickFormat:{get:function(){return x},set:function(a){x=a}},interpolate:{get:function(){return u},set:function(a){u=a}},focusMargin:{get:function(){return s},set:function(a){s.top=void 0!==a.top?a.top:s.top,s.right=void 0!==a.right?a.right:s.right,s.bottom=void 0!==a.bottom?a.bottom:s.bottom,s.left=void 0!==a.left?a.left:s.left}},margin:{get:function(){return r},set:function(a){r.top=void 0!==a.top?a.top:r.top,r.right=void 0!==a.right?a.right:r.right,r.bottom=void 0!==a.bottom?a.bottom:r.bottom,r.left=void 0!==a.left?a.left:r.left}}}),b.xAxis=f.xAxis,b.yAxis=f.yAxis1,b.multiChart=f,b.focus=g,b.processData=c,a.utils.inheritOptions(b,f),a.utils.initOptions(b),b},a.models.discreteBar=function(){"use strict";function b(m){return z.reset(),m.each(function(b){var m=k-j.left-j.right,y=l-j.top-j.bottom;c=d3.select(this),a.utils.initSVG(c),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var A=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:p(a,b),y:q(a,b),y0:a.y0}})});n.domain(d||d3.merge(A).map(function(a){return a.x})).rangeBands(f||[0,m],.1),o.domain(e||d3.extent(d3.merge(A).map(function(a){return a.y}).concat(r))),u?o.range(g||[y-(o.domain()[0]<0?12:0),o.domain()[1]>0?12:0]):o.range(g||[y,0]),h=h||n,i=i||o.copy().range([o(0),o(0)]);var B=c.selectAll("g.nv-wrap.nv-discretebar").data([b]),C=B.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar"),D=C.append("g");B.select("g");D.append("g").attr("class","nv-groups"),B.attr("transform","translate("+j.left+","+j.top+")");var E=B.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});E.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),E.exit().watchTransition(z,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),E.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),E.watchTransition(z,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var F=E.selectAll("g.nv-bar").data(function(a){return a.values});F.exit().remove();var G=F.enter().append("g").attr("transform",function(a,b,c){return"translate("+(n(p(a,b))+.05*n.rangeBand())+", "+o(0)+")"}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0),w.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),w.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){w.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){var c=this;w.elementClick({data:a,index:b,color:d3.select(this).style("fill"),event:d3.event,element:c}),d3.event.stopPropagation()}).on("dblclick",function(a,b){w.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()});G.append("rect").attr("height",0).attr("width",.9*n.rangeBand()/b.length),u?(G.append("text").attr("text-anchor","middle"),F.select("text").text(function(a,b){return v(q(a,b))}).watchTransition(z,"discreteBar: bars text").attr("x",.9*n.rangeBand()/2).attr("y",function(a,b){return q(a,b)<0?o(q(a,b))-o(0)+12:-4})):F.selectAll("text").remove(),F.attr("class",function(a,b){return q(a,b)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(a,b){return a.color||s(a,b)}).style("stroke",function(a,b){return a.color||s(a,b)}).select("rect").attr("rx",t).attr("class",x).watchTransition(z,"discreteBar: bars rect").attr("width",.9*n.rangeBand()/b.length),F.watchTransition(z,"discreteBar: bars").attr("transform",function(a,b){return"translate("+(n(p(a,b))+.05*n.rangeBand())+", "+(q(a,b)<0?o(0):o(0)-o(q(a,b))<1?o(0)-1:o(q(a,b)))+")"}).select("rect").attr("height",function(a,b){return Math.max(Math.abs(o(q(a,b))-o(0)),1)}),h=n.copy(),i=o.copy()}),z.renderEnd("discreteBar immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=d3.scale.ordinal(),o=d3.scale.linear(),p=function(a){return a.x},q=function(a){return a.y},r=[0],s=a.utils.defaultColor(),t=0,u=!1,v=d3.format(",.2f"),w=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),x="discreteBar",y=250,z=a.utils.renderWatch(w,y);return b.dispatch=w,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},forceY:{get:function(){return r},set:function(a){r=a}},showValues:{get:function(){return u},set:function(a){u=a}},cornerRadius:{get:function(){return t},set:function(a){t=a}},x:{get:function(){return p},set:function(a){p=a}},y:{get:function(){return q},set:function(a){q=a}},xScale:{get:function(){return n},set:function(a){n=a}},yScale:{get:function(){return o},set:function(a){o=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},valueFormat:{get:function(){return v},set:function(a){v=a}},id:{get:function(){return m},set:function(a){m=a}},rectClass:{get:function(){return x},set:function(a){x=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},color:{get:function(){return s},set:function(b){s=a.utils.getColor(b)}},duration:{get:function(){return y},set:function(a){y=a,z.reset(y)}}}),a.utils.initOptions(b),b},a.models.discreteBarChart=function(){"use strict";function b(i){return y.reset(),y.models(e),p&&y.models(f),q&&y.models(g),i.each(function(i){var n=d3.select(this);a.utils.initSVG(n);var v=a.utils.availableWidth(l,n,j),y=a.utils.availableHeight(m,n,j);if(b.update=function(){w.beforeUpdate(),n.transition().duration(x).call(b)},b.container=this,!(i&&i.length&&i.filter(function(a){return a.values.length}).length))return a.utils.noData(b,n),b;n.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var z=n.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([i]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),B=A.append("defs"),C=z.select("g");if(A.append("g").attr("class","nv-x nv-axis"),A.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),A.append("g").attr("class","nv-barsWrap"),A.append("g").attr("class","nv-legendWrap"),C.attr("transform","translate("+j.left+","+j.top+")"),o?(h.width(v),C.select(".nv-legendWrap").datum(i).call(h),k||h.height()===j.top||(j.top=h.height(),y=a.utils.availableHeight(m,n,j)),z.select(".nv-legendWrap").attr("transform","translate(0,"+-j.top+")")):C.select(".nv-legendWrap").selectAll("*").remove(),r&&C.select(".nv-y.nv-axis").attr("transform","translate("+v+",0)"),e.width(v).height(y),C.select(".nv-barsWrap").datum(i.filter(function(a){return!a.disabled})).transition().call(e),B.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),C.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",c.rangeBand()*(s?2:1)).attr("height",16).attr("x",-c.rangeBand()/(s?1:2)),p){f.scale(c)._ticks(a.utils.calcTicksX(v/100,i)).tickSize(-y,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+(d.range()[0]+(e.showValues()&&d.domain()[0]<0?16:0))+")"),C.select(".nv-x.nv-axis").call(f);var D=C.select(".nv-x.nv-axis").selectAll("g");s&&D.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"}),u&&D.selectAll(".tick text").attr("transform","rotate("+u+" 0,0)").style("text-anchor",u>0?"start":"end"),t&&C.selectAll(".tick text").call(a.utils.wrapTicks,b.xAxis.rangeBand())}q&&(g.scale(d)._ticks(a.utils.calcTicksY(y/36,i,e.y())).tickSize(-v,0),C.select(".nv-y.nv-axis").call(g)),C.select(".nv-zeroLine line").attr("x1",0).attr("x2",r?-v:v).attr("y1",d(0)).attr("y2",d(0))}),y.renderEnd("discreteBar chart immediate"),b}var c,d,e=a.models.discreteBar(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.tooltip(),j={top:15,right:10,bottom:50,left:60},k=null,l=null,m=null,n=a.utils.getColor(),o=!1,p=!0,q=!0,r=!1,s=!1,t=!1,u=0,v=null,w=d3.dispatch("beforeUpdate","renderEnd"),x=250;f.orient("bottom").showMaxMin(!1).tickFormat(function(a){return a}),g.orient(r?"right":"left").tickFormat(d3.format(",.1f")),i.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).keyFormatter(function(a,b){return f.tickFormat()(a,b)});var y=a.utils.renderWatch(w,x);return e.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color},i.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(a){i.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(a){i()}),b.dispatch=w,b.discretebar=e,b.legend=h,b.xAxis=f,b.yAxis=g,b.tooltip=i,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return m},set:function(a){m=a}},showLegend:{get:function(){return o},set:function(a){o=a}},staggerLabels:{get:function(){return s},set:function(a){s=a}},rotateLabels:{get:function(){return u},set:function(a){u=a}},wrapLabels:{get:function(){return t},set:function(a){t=!!a}},showXAxis:{get:function(){return p},set:function(a){p=a}},showYAxis:{get:function(){return q},set:function(a){q=a}},noData:{get:function(){return v},set:function(a){v=a}},margin:{get:function(){return j},set:function(a){void 0!==a.top&&(j.top=a.top,k=a.top),j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},duration:{get:function(){return x},set:function(a){x=a,y.reset(x),e.duration(x),f.duration(x),g.duration(x)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),e.color(n),h.color(n)}},rightAlignYAxis:{get:function(){return r},set:function(a){r=a,g.orient(a?"right":"left")}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.distribution=function(){"use strict";function b(e){return m.reset(),e.each(function(b){var e=("x"===g?(d.left,d.right):(d.top,d.bottom),"x"==g?"y":"x"),k=d3.select(this);a.utils.initSVG(k),c=c||j;var l=k.selectAll("g.nv-distribution").data([b]),n=l.enter().append("g").attr("class","nvd3 nv-distribution"),o=(n.append("g"),l.select("g"));l.attr("transform","translate("+d.left+","+d.top+")");var p=o.selectAll("g.nv-dist").data(function(a){return a},function(a){return a.key});p.enter().append("g"),p.attr("class",function(a,b){return"nv-dist nv-series-"+b}).style("stroke",function(a,b){return i(a,b)});var q=p.selectAll("line.nv-dist"+g).data(function(a){return a.values});q.enter().append("line").attr(g+"1",function(a,b){return c(h(a,b))}).attr(g+"2",function(a,b){return c(h(a,b))}),m.transition(p.exit().selectAll("line.nv-dist"+g),"dist exit").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}).style("stroke-opacity",0).remove(),q.attr("class",function(a,b){return"nv-dist"+g+" nv-dist"+g+"-"+b}).attr(e+"1",0).attr(e+"2",f),m.transition(q,"dist").attr(g+"1",function(a,b){return j(h(a,b))}).attr(g+"2",function(a,b){return j(h(a,b))}),c=j.copy()}),m.renderEnd("distribution immediate"),b}var c,d={top:0,right:0,bottom:0,left:0},e=400,f=8,g="x",h=function(a){return a[g]},i=a.utils.defaultColor(),j=d3.scale.linear(),k=250,l=d3.dispatch("renderEnd"),m=a.utils.renderWatch(l,k);return b.options=a.utils.optionsFunc.bind(b),b.dispatch=l,b.margin=function(a){return arguments.length?(d.top=void 0!==a.top?a.top:d.top,d.right=void 0!==a.right?a.right:d.right,d.bottom=void 0!==a.bottom?a.bottom:d.bottom,d.left=void 0!==a.left?a.left:d.left,b):d},b.width=function(a){return arguments.length?(e=a,b):e},b.axis=function(a){return arguments.length?(g=a,b):g},b.size=function(a){return arguments.length?(f=a,b):f},b.getData=function(a){return arguments.length?(h=d3.functor(a),b):h},b.scale=function(a){return arguments.length?(j=a,b):j},b.color=function(c){return arguments.length?(i=a.utils.getColor(c),b):i},b.duration=function(a){return arguments.length?(k=a,m.reset(k),b):k},b},a.models.distroPlot=function(){"use strict";function b(a){var b=a.sort(d3.ascending),c=1.349,d=(d3.quantile(b,.75)-d3.quantile(b,.25))/c;return d3.min([d3.deviation(b),d])}function c(a,c){void 0===c&&(c="scott");var d=b(a),e=a.length;return"scott"===c?Math.pow(1.059*d*e,-.2):Math.pow(.9*d*e,-.2)}function d(a){function b(a,b){var d=a.map(function(a){return R&&da.add(R(a)),z(a)}).sort(d3.ascending),h=d3.quantile(d,.25),i=d3.quantile(d,.75),j=i-h,k=i+1.5*j,l=h-1.5*j,m={iqr:d3.max([d3.min(d),d3.min(d.filter(function(a){return a>l}))]),minmax:d3.min(d),stddev:d3.mean(d)-d3.deviation(d)},n={iqr:d3.min([d3.max(d),d3.max(d.filter(function(a){return a<k}))]),minmax:d3.max(d),stddev:d3.mean(d)+d3.deviation(d)},o=d3.median(d),p=d3.mean(d),q=[];if(void 0!==d3.beeswarm?(q=d3.beeswarm().data(a.map(function(a){return z(a)})).radius(Z+1).orientation("vertical").side("symmetric").distributeOn(function(a){return x(a)}).arrange(),q.map(function(c,d){c.key=b,c.object_constancy=a[d].object_constancy,c.isOutlier=c.datum<m.iqr||c.datum>n.iqr,c.isOutlierStdDev=c.datum<m.stddev||c.datum>n.stddev,c.randX=Math.random()*U*(1==Math.floor(2*Math.random())?1:-1)})):d.forEach(function(a,c){q.push({object_constancy:a.object_constancy,datum:a,key:b,isOutlier:a<m.iqr||a>n.iqr,isOutlierStdDev:a<m.stddev||a>n.stddev,randX:Math.random()*U*(1==Math.floor(2*Math.random())?1:-1)})}),isNaN(parseFloat(W))){var r;r=-1!=["scott","silverman"].indexOf(W)?c(d,W):c(d)}var s=e(g(r),x.ticks(Y)),t=X?f(s(d),d3.extent(d)):s(d),u=d3.scale.linear().domain([0,d3.max(t,function(a){return a.y})]).clamp(!0);ea.push(u);var v={count:d.length,num_outlier:q.filter(function(a){return a.isOutlier}).length,sum:d3.sum(d),mean:p,q1:h,q2:o,q3:i,wl:m,wu:n,iqr:j,min:d3.min(d),max:d3.max(d),dev:d3.deviation(d),observations:q,key:b,kde:t,notch:1.57*j/Math.sqrt(d.length)};return R&&fa.push({key:b,values:v}),v}a.forEach(function(a,b){a.object_constancy=b+"_"+z(a)+"_"+y(a)});var d;if(R){da=d3.set();var h=d3.nest().key(function(a){return y(a)}).key(function(a){return R(a)}).rollup(function(a){return b(a,y(a[0]))}).entries(a);da=da.values();for(var i=h.map(function(a){return a.key}),j=[],k=0;k<i.length;k++)for(var l=0;l<da.length;l++)j.push(i[k]+"_"+da[l]);da=j,d=[],h.forEach(function(a){a.values.forEach(function(b){b.key=a.key+"_"+b.key}),d.push.apply(d,a.values)})}else d=d3.nest().key(function(a){return y(a)}).rollup(function(a,c){return b(a)}).entries(a);return d}function e(a,b){return function(c){return b.map(function(b){var d=d3.mean(c,function(c){return a(b-c)});return{x:b,y:d}})}}function f(a,b){if(b[0]===b[1])return a;var c=a.reduce(function(a,c){return c.x>=b[0]&&c.x<=b[1]&&a.push(c),a},[]);return b[0]<c[0].x&&c.unshift({x:b[0],y:c[0].y}),b[1]>c[c.length-1].x&&c.push({x:b[1],y:c[c.length-1].y}),c}function g(a){return function(b){return Math.abs(b/=a)<=1?.75*(1-b*b)/a:0}}function h(a,b,c,d){var e="mean"==S?G(d):C(d);return Q?[{x:c,y:x(B(d))},{x:a,y:x(B(d))},{x:a,y:x(E(d))},{x:b,y:x(e)},{x:a,y:x(F(d))},{x:a,y:x(D(d))},{x:c,y:x(D(d))}]:[{x:c,y:x(B(d))},{x:a,y:x(B(d))},{x:a,y:x(e)},{x:a,y:x(e)},{x:a,y:x(e)},{x:a,y:x(D(d))},{x:c,y:x(D(d))}]}function i(a){return"iqr"==O&&a.isOutlier||"stddev"==O&&a.isOutlierStdDev}function j(b){return ga.reset(),b.each(function(b){q=t-s.left-s.right,r=u-s.top-s.bottom,_=d3.select(this),a.utils.initSVG(_),x.domain(n||d3.extent(b.map(function(a){return z(a)}))).nice().range(o||[r,0]),void 0===p&&(p=d(b)),w.rangeBands(m||[0,q],.1).domain(l||R&&!V?da:p.map(function(a){return a.key}));var c=_.selectAll("g.nv-wrap").data([p]);c.enter().append("g").attr("class","nvd3 nv-wrap");c.watchTransition(ga,"nv-wrap: wrap").attr("transform","translate("+s.left+","+s.top+")");var e,f=c.selectAll(".nv-distroplot-x-group").data(function(a){return a});f.each(function(a,b){d3.select(this).selectAll("line.nv-distroplot-middle").datum(a)}),e=f.enter().append("g").attr("class","nv-distroplot-x-group").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).style("fill",function(a,b){return A(a)||$(a,b)}).style("stroke",function(a,b){return A(a)||$(a,b)}),f.exit().remove();var g=function(){return w.rangeBand()},j=function(){return d3.min([ca,.9*g()])},v=function(){return j()/2},y=function(){return v()-j()/2},E=function(){return v()+j()/2},F=function(){return v()-j()/5},O=function(){return v()+j()/5};e.attr("transform",function(a){return"translate("+(w(a.key)+.5*(g()-j()))+", 0)"}),f.watchTransition(ga,"nv-distroplot-x-group: distroplots").style("stroke-opacity",1).style("fill-opacity",.5).attr("transform",function(a){return"translate("+(w(a.key)+.5*(g()-j()))+", 0)"}),ea.map(function(a){a.range([j()/2,0])}),k||(T=!1,N||(N="random")),e.each(function(a,b){var c=d3.select(this);[H,I].forEach(function(a){var b=a===H?"low":"high";c.append("line").style("opacity",function(){return P?"1":"0"}).attr("class","nv-distroplot-whisker nv-distroplot-"+b),c.append("line").style("opacity",function(){return P?"0":"1"}).attr("class","nv-distroplot-tick nv-distroplot-"+b)})}),[H,I].forEach(function(a){var b=a===H?"low":"high",c=a===H?B:D;f.select("line.nv-distroplot-whisker.nv-distroplot-"+b).watchTransition(ga,"nv-distroplot-x-group: distroplots").attr("x1",v()).attr("y1",function(b){return x("violin"!=k?a(b):C(b))}).attr("x2",v()).attr("y2",function(a){return x("box"==k?c(a):C(a))}).style("opacity",function(){return P?"0":"1"}),f.select("line.nv-distroplot-tick.nv-distroplot-"+b).watchTransition(ga,"nv-distroplot-x-group: distroplots").attr("x1",function(a){return"violin"!=k?F():v()}).attr("y1",function(b,c){return x("violin"!=k?a(b):C(b))}).attr("x2",function(a){return"violin"!=k?O():v()}).attr("y2",function(b,c){return x("violin"!=k?a(b):C(b))}).style("opacity",function(){return P?"0":"1"})}),[H,I].forEach(function(a){var b=a===H?"low":"high";e.selectAll(".nv-distroplot-"+b).on("mouseover",function(c,d,e){d3.select(this.parentNode).selectAll("line.nv-distroplot-"+b).classed("hover",!0),aa.elementMouseover({value:"low"==b?"Lower whisker":"Upper whisker",series:{key:a(c).toFixed(2),color:A(c)||$(c,e)},e:d3.event})}).on("mouseout",function(c,d,e){d3.select(this.parentNode).selectAll("line.nv-distroplot-"+b).classed("hover",!1),aa.elementMouseout({value:"low"==b?"Lower whisker":"Upper whisker",series:{key:a(c).toFixed(2),color:A(c)||$(c,e)},e:d3.event})}).on("mousemove",function(a,b){aa.elementMousemove({e:d3.event})})}),e.each(function(a,b){var c=d3.select(this);["left","right"].forEach(function(a){["line","area"].forEach(function(b){c.append("path").attr("class","nv-distribution-"+b+" nv-distribution-"+a).attr("transform","rotate(90,0,0) translate(0,"+("left"==a?-j():0)+")"+("left"==a?"":" scale(1,-1)"))})}),e.selectAll(".nv-distribution-line").style("fill","none"),e.selectAll(".nv-distribution-area").style("stroke","none").style("opacity",.7)}),f.each(function(a,b){var c=d3.select(this),d="box"==k?h(y(),F(),v(),a):a.values.kde;c.selectAll("path").datum(d);var e=ea[b],g="box"==k?"linear":"basis";"box"==k||"violin"==k?["left","right"].forEach(function(a){f.selectAll(".nv-distribution-line.nv-distribution-"+a).attr("d",d3.svg.line().x(function(a){return"box"==k?a.y:x(a.x)}).y(function(a){return"box"==k?a.x:e(a.y)}).interpolate(g)).attr("transform","rotate(90,0,0) translate(0,"+("left"==a?-j():0)+")"+("left"==a?"":" scale(1,-1)")).style("opacity",k?"1":"0"),f.selectAll(".nv-distribution-area.nv-distribution-"+a).attr("d",d3.svg.area().x(function(a){return"box"==k?a.y:x(a.x)}).y(function(a){return"box"==k?a.x:e(a.y)}).y0(j()/2).interpolate(g)).attr("transform","rotate(90,0,0) translate(0,"+("left"==a?-j():0)+")"+("left"==a?"":" scale(1,-1)")).style("opacity",k?"1":"0")}):(f.selectAll(".nv-distribution-area").watchTransition(ga,"nv-distribution-area: distroplots").style("opacity",k?"1":"0"),f.selectAll(".nv-distribution-line").watchTransition(ga,"nv-distribution-line: distroplots").style("opacity",k?"1":"0"))}),f.selectAll("path").on("mouseover",function(a,b,c){a=d3.select(this.parentNode).datum(),d3.select(this).classed("hover",!0),aa.elementMouseover({key:a.key,value:"Group "+a.key+" stats",series:[{key:"max",value:K(a).toFixed(2),color:A(a)||$(a,c)},{key:"Q3",value:D(a).toFixed(2),color:A(a)||$(a,c)},{key:"Q2",value:C(a).toFixed(2),color:A(a)||$(a,c)},{key:"Q1",value:B(a).toFixed(2),color:A(a)||$(a,c)},{key:"min",value:J(a).toFixed(2),color:A(a)||$(a,c)},{key:"mean",value:G(a).toFixed(2),color:A(a)||$(a,c)},{key:"std. dev.",value:L(a).toFixed(2),color:A(a)||$(a,c)},{key:"count",value:a.values.count,color:A(a)||$(a,c)},{key:"num. outliers",value:a.values.num_outlier,color:A(a)||$(a,c)}],data:a,index:b,e:d3.event})}).on("mouseout",function(a,b,c){d3.select(this).classed("hover",!1),a=d3.select(this.parentNode).datum(),aa.elementMouseout({key:a.key,value:"Group "+a.key+" stats",series:[{key:"max",value:K(a).toFixed(2),color:A(a)||$(a,c)},{key:"Q3",value:D(a).toFixed(2),color:A(a)||$(a,c)},{key:"Q2",value:C(a).toFixed(2),color:A(a)||$(a,c)},{key:"Q1",value:B(a).toFixed(2),color:A(a)||$(a,c)},{key:"min",value:J(a).toFixed(2),color:A(a)||$(a,c)},{key:"mean",value:G(a).toFixed(2),color:A(a)||$(a,c)},{key:"std. dev.",value:L(a).toFixed(2),color:A(a)||$(a,c)},{key:"count",value:a.values.count,color:A(a)||$(a,c)},{key:"num. outliers",value:a.values.num_outlier,color:A(a)||$(a,c)}],data:a,index:b,e:d3.event})}).on("mousemove",function(a,b){aa.elementMousemove({e:d3.event})}),e.append("line").attr("class",function(a){return"nv-distroplot-middle"}),f.selectAll("line.nv-distroplot-middle").watchTransition(ga,"nv-distroplot-x-group: distroplots line").attr("x1",Q?F:"violin"!=k?y:F()).attr("y1",function(a,b,c){return x("mean"==S?G(a):C(a))}).attr("x2",Q?O:"violin"!=k?E:O()).attr("y2",function(a,b){return x("mean"==S?G(a):C(a))}).style("opacity",S?"1":"0"),f.selectAll(".nv-distroplot-middle").on("mouseover",function(a,b,c){if(0!=d3.select(this).style("opacity")){var d=d3.select(this.parentNode).style("fill");d3.select(this).classed("hover",!0),aa.elementMouseover({value:"mean"==S?"Mean":"Median",series:{key:"mean"==S?G(a).toFixed(2):C(a).toFixed(2),color:d},e:d3.event})}}).on("mouseout",function(a,b,c){if(0!=d3.select(this).style("opacity")){d3.select(this).classed("hover",!1);var d=d3.select(this.parentNode).style("fill");aa.elementMouseout({value:"mean"==S?"Mean":"Median",series:{key:"mean"==S?G(a).toFixed(2):C(a).toFixed(2),color:d},e:d3.event})}}).on("mousemove",function(a,b){aa.elementMousemove({e:d3.event})});var U=f.selectAll("g.nv-distroplot-observation").data(function(a){return M(a)},function(a){return a.object_constancy}),W=U.enter().append("g").attr("class","nv-distroplot-observation");W.append("circle").style({opacity:0}),W.append("line").style("stroke-width",1).style({stroke:d3.rgb(85,85,85),opacity:0}),U.exit().remove(),U.attr("class",function(a){return"nv-distroplot-observation "+(i(a)&&"box"==k?"nv-distroplot-outlier":"nv-distroplot-non-outlier")}),"line"==N?f.selectAll("g.nv-distroplot-observation line").watchTransition(ga,"nv-distrolot-x-group: nv-distoplot-observation").attr("x1",F()+j()/4).attr("x2",O()-j()/4).attr("y1",function(a){return x(a.datum)}).attr("y2",function(a){return x(a.datum)}):(f.selectAll("g.nv-distroplot-observation circle").watchTransition(ga,"nv-distroplot: nv-distroplot-observation").attr("cy",function(a){return x(a.datum)}).attr("r",Z),f.selectAll("g.nv-distroplot-observation circle").watchTransition(ga,"nv-distroplot: nv-distroplot-observation").attr("cx",function(a){return"swarm"==N?a.x+j()/2:"random"==N?j()/2+a.randX*j()/2:j()/2})),!1!==N&&(T?(f.selectAll(".nv-distroplot-outlier "+("line"==N?"line":"circle")).watchTransition(ga,"nv-distroplot: nv-distroplot-observation").style("opacity",1),f.selectAll(".nv-distroplot-non-outlier "+("line"==N?"line":"circle")).watchTransition(ga,"nv-distroplot: nv-distroplot-observation").style("opacity",0)):f.selectAll("line"==N?"line":"circle").watchTransition(ga,"nv-distroplot: nv-distroplot-observation").style("opacity",1)),f.selectAll(".nv-distroplot-observation"+("line"==N?" circle":" line")).watchTransition(ga,"nv-distroplot: nv-distoplot-observation").style("opacity",0),f.selectAll(".nv-distroplot-observation").on("mouseover",function(a,b,c){var d=d3.select(this);if(!T||"box"!=k||i(a)){var e=d3.select(this.parentNode).style("fill");d.classed("hover",!0),aa.elementMouseover({value:"box"==k&&i(a)?"Outlier":"Observation",series:{key:a.datum.toFixed(2),color:e},e:d3.event})}}).on("mouseout",function(a,b,c){var d=d3.select(this),e=d3.select(this.parentNode).style("fill");d.classed("hover",!1),aa.elementMouseout({value:"box"==k&&i(a)?"Outlier":"Observation",series:{key:a.datum.toFixed(2),color:e},e:d3.event})}).on("mousemove",function(a,b){aa.elementMousemove({e:d3.event})})}),ga.renderEnd("nv-distroplot-x-group immediate"),j}var k,l,m,n,o,p,q,r,s={top:0,right:0,bottom:0,left:0},t=960,u=500,v=Math.floor(1e4*Math.random()),w=d3.scale.ordinal(),x=d3.scale.linear(),y=function(a){return a.label},z=function(a){return a.value},A=function(a){return a.color},B=function(a){return a.values.q1},C=function(a){return a.values.q2},D=function(a){return a.values.q3},E=function(a){return("mean"==S?G(a):C(a))-a.values.notch},F=function(a){return("mean"==S?G(a):C(a))+a.values.notch},G=function(a){return a.values.mean},H=function(a){return a.values.wl[O]},I=function(a){return a.values.wu[O]},J=function(a){return a.values.min},K=function(a){return a.values.max},L=function(a){return a.values.dev},M=function(a){return a.values.observations},N=!1,O="iqr",P=!1,Q=!1,R=!1,S=!1,T=!0,U=.7,V=!0,W="scott",X=!0,Y=50,Z=3,$=a.utils.defaultColor(),_=null,aa=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),ba=250,ca=null,da=d3.set(),ea=[],fa=[],ga=a.utils.renderWatch(aa,ba);return j.dispatch=aa,j.options=a.utils.optionsFunc.bind(j),j._options=Object.create({},{width:{get:function(){return t},set:function(a){t=a}},height:{get:function(){return u},set:function(a){u=a}},maxBoxWidth:{get:function(){return ca},set:function(a){ca=a}},x:{get:function(){return y},set:function(a){y=a}},y:{get:function(){return z},set:function(a){z=a}},plotType:{get:function(){return k},set:function(a){k=a}},observationType:{get:function(){return N},set:function(a){N=a}},whiskerDef:{get:function(){return O},set:function(a){O=a}},notchBox:{get:function(){return Q},set:function(a){Q=a}},hideWhiskers:{get:function(){return P},set:function(a){P=a}},colorGroup:{get:function(){return R},set:function(a){R=a}},centralTendency:{get:function(){return S},set:function(a){S=a}},bandwidth:{get:function(){return W},set:function(a){W=a}},clampViolin:{get:function(){return X},set:function(a){X=a}},resolution:{get:function(){return Y},set:function(a){Y=a}},xScale:{get:function(){return w},set:function(a){w=a}},yScale:{get:function(){return x},set:function(a){x=a}},showOnlyOutliers:{get:function(){return T},set:function(a){T=a}},jitter:{get:function(){return U},set:function(a){U=a}},squash:{get:function(){return V},set:function(a){V=a}},pointSize:{get:function(){return Z},set:function(a){Z=a}},xDomain:{get:function(){return l},set:function(a){l=a}},yDomain:{get:function(){return n},set:function(a){n=a}},xRange:{get:function(){return m},set:function(a){m=a}},yRange:{get:function(){return o},set:function(a){o=a}},recalcData:{get:function(){p=d(_.datum())}},itemColor:{get:function(){return A},set:function(a){A=a}},id:{get:function(){return v},set:function(a){v=a}},margin:{get:function(){return s},set:function(a){s.top=void 0!==a.top?a.top:s.top,s.right=void 0!==a.right?a.right:s.right,s.bottom=void 0!==a.bottom?a.bottom:s.bottom,s.left=void 0!==a.left?a.left:s.left}},color:{get:function(){return $},set:function(b){$=a.utils.getColor(b)}},duration:{get:function(){return ba},set:function(a){ba=a,ga.reset(ba)}}}),a.utils.initOptions(j),j},a.models.distroPlotChart=function(){"use strict";function b(a){return!c(a,E)&&(E=JSON.parse(JSON.stringify(a)),!0)}function c(a,b){if(a.length!==b.length)return!1;for(var c=a.length;c--;)if("object_constancy"in a[c]&&delete a[c].object_constancy,"object_constancy"in b[c]&&delete b[c].object_constancy,!d(a[c],b[c]))return!1;return!0}function d(a,b){var c=Object.getOwnPropertyNames(a),d=Object.getOwnPropertyNames(b);if(c.length!=d.length)return!1;for(var e=0;e<c.length;e++){var f=c[e];if(a[f]!==b[f])return!1}return!0}function e(c){return F.reset(),F.models(h),o&&F.models(i),p&&F.models(j),c.each(function(c){var d=d3.select(this);a.utils.initSVG(d);var n=(l||parseInt(d.style("width"))||960)-k.left-k.right,s=(m||parseInt(d.style("height"))||400)-k.top-k.bottom;if(void 0===E&&(E=JSON.parse(JSON.stringify(c))),e.update=function(){w.beforeUpdate();var a=h.options();(y!==a.colorGroup()||z!==a.x()||A!==a.y()||C!==a.bandwidth()||B!==a.resolution()||D!==a.clampViolin()||b(c))&&h.recalcData(),d.transition().duration(x).call(e)},e.container=this,"function"!=typeof d3.beeswarm&&"swarm"==e.options().observationType()){k.left;return v='Please include the library https://github.com/Kcnarf/d3-beeswarm to use "swarm".',a.utils.noData(e,d),e}if(!c||!c.length)return a.utils.noData(e,d),e;d.selectAll(".nv-noData").remove(),f=h.xScale(),g=h.yScale().clamp(!0);var t=d.selectAll("g.nv-wrap.nv-distroPlot").data([c]),u=t.enter().append("g").attr("class","nvd3 nv-wrap nv-distroPlot").append("g"),G=u.append("defs"),H=t.select("g");if(u.append("g").attr("class","nv-x nv-axis"),u.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),u.append("g").attr("class","nv-distroWrap"),u.attr("transform","translate("+k.left+","+k.top+")"),H.watchTransition(F,"nv-wrap: wrap").attr("transform","translate("+k.left+","+k.top+")"),q&&H.select(".nv-y.nv-axis").attr("transform","translate("+n+",0)"),h.width(n).height(s),H.select(".nv-distroWrap").datum(c).transition().call(h),G.append("clipPath").attr("id","nv-x-label-clip-"+h.id()).append("rect"),H.select("#nv-x-label-clip-"+h.id()+" rect").attr("width",f.rangeBand()*(r?2:1)).attr("height",16).attr("x",-f.rangeBand()/(r?1:2)),o){i.scale(f).ticks(a.utils.calcTicksX(n/100,c)).tickSize(-s,0),H.select(".nv-x.nv-axis").attr("transform","translate(0,"+g.range()[0]+")"),H.select(".nv-x.nv-axis").call(i);var I=H.select(".nv-x.nv-axis").selectAll("g");r&&I.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"})}
|
|
6
|
+
p&&(j.scale(g).ticks(Math.floor(s/36)).tickSize(-n,0),H.select(".nv-y.nv-axis").call(j)),H.select(".nv-zeroLine line").attr("x1",0).attr("x2",n).attr("y1",g(0)).attr("y2",g(0)),y=h.options().colorGroup(),z=h.options().x(),A=h.options().y(),C=h.options().bandwidth(),B=h.options().resolution(),D=h.options().clampViolin()}),F.renderEnd("nv-distroplot chart immediate"),e}var f,g,h=a.models.distroPlot(),i=a.models.axis(),j=a.models.axis(),k={top:25,right:10,bottom:40,left:60},l=null,m=null,n=a.utils.getColor(),o=!0,p=!0,q=!1,r=!1,s=!1,t=!1,u=a.models.tooltip(),v="No Data Available.",w=d3.dispatch("stateChange","beforeUpdate","renderEnd"),x=500;i.orient("bottom").showMaxMin(!1).tickFormat(function(a){return a}),j.orient(q?"right":"left").tickFormat(d3.format(",.1f")),u.duration(0);var y,z,A,B,C,D,E,F=a.utils.renderWatch(w,x);k.top;return h.dispatch.on("elementMouseover.tooltip",function(a){u.data(a).hidden(!1)}),h.dispatch.on("elementMouseout.tooltip",function(a){u.data(a).hidden(!0)}),h.dispatch.on("elementMousemove.tooltip",function(a){u()}),e.dispatch=w,e.distroplot=h,e.xAxis=i,e.yAxis=j,e.tooltip=u,e.options=a.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return m},set:function(a){m=a}},staggerLabels:{get:function(){return r},set:function(a){r=a}},showXAxis:{get:function(){return o},set:function(a){o=a}},showYAxis:{get:function(){return p},set:function(a){p=a}},tooltipContent:{get:function(){return u},set:function(a){u=a}},noData:{get:function(){return v},set:function(a){v=a}},defaultState:{get:function(){return defaultState},set:function(a){defaultState=a}},margin:{get:function(){return k},set:function(a){k.top=void 0!==a.top?a.top:k.top,k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return x},set:function(a){x=a,F.reset(x),h.duration(x),i.duration(x),j.duration(x)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),h.color(n)}},rightAlignYAxis:{get:function(){return q},set:function(a){q=a,j.orient(a?"right":"left")}},xLabel:{get:function(){return s},set:function(a){s=a,i.axisLabel(s)}},yLabel:{get:function(){return t},set:function(a){t=a,j.axisLabel(t)}}}),a.utils.inheritOptions(e,h),a.utils.initOptions(e),e},a.models.focus=function(b){"use strict";function c(u){return t.reset(),t.models(b),m&&t.models(f),n&&t.models(g),u.each(function(t){function u(a){var b=+("e"==a),c=b?1:-1,d=z/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function v(){h.empty()||h.extent(p),E.data([h.empty()?d.domain():p]).each(function(a,b){var c=d(a[0])-d.range()[0],e=y-d(a[1]);d3.select(this).select(".left").attr("width",c<0?0:c),d3.select(this).select(".right").attr("x",d(a[1])).attr("width",e<0?0:e)})}function w(a){p=h.empty()?null:h.extent();var b=h.empty()?d.domain():h.extent();r.brush({extent:b,brush:h}),v(),a&&r.onBrush(b)}var x=d3.select(this);a.utils.initSVG(x);var y=a.utils.availableWidth(k,x,i),z=l-i.top-i.bottom;c.update=function(){0===q?x.call(c):x.transition().duration(q).call(c)},c.container=this,d=b.xScale(),e=b.yScale();var A=x.selectAll("g.nv-focus").data([t]),B=A.enter().append("g").attr("class","nvd3 nv-focus").append("g"),C=A.select("g");A.attr("transform","translate("+i.left+","+i.top+")"),B.append("g").attr("class","nv-background").append("rect"),B.append("g").attr("class","nv-x nv-axis"),B.append("g").attr("class","nv-y nv-axis"),B.append("g").attr("class","nv-contentWrap"),B.append("g").attr("class","nv-brushBackground"),B.append("g").attr("class","nv-x nv-brush"),o&&C.select(".nv-y.nv-axis").attr("transform","translate("+y+",0)"),C.select(".nv-background rect").attr("width",y).attr("height",z),b.width(y).height(z).color(t.map(function(a,b){return a.color||j(a,b)}).filter(function(a,b){return!t[b].disabled}));var D=C.select(".nv-contentWrap").datum(t.filter(function(a){return!a.disabled}));d3.transition(D).call(b),h.x(d).on("brush",function(){w(s)}),h.on("brushend",function(){s||r.onBrush(h.empty()?d.domain():h.extent())}),p&&h.extent(p);var E=C.select(".nv-brushBackground").selectAll("g").data([p||h.extent()]),F=E.enter().append("g");F.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",z),F.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",z);var G=C.select(".nv-x.nv-brush").call(h);G.selectAll("rect").attr("height",z),G.selectAll(".resize").append("path").attr("d",u),w(!0),C.select(".nv-background rect").attr("width",y).attr("height",z),m&&(f.scale(d)._ticks(a.utils.calcTicksX(y/100,t)).tickSize(-z,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),d3.transition(C.select(".nv-x.nv-axis")).call(f)),n&&(g.scale(e)._ticks(a.utils.calcTicksY(z/36,t)).tickSize(-y,0),d3.transition(C.select(".nv-y.nv-axis")).call(g)),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")")}),t.renderEnd("focus immediate"),c}var d,e,b=b||a.models.line(),f=a.models.axis(),g=a.models.axis(),h=d3.svg.brush(),i={top:10,right:0,bottom:30,left:0},j=a.utils.defaultColor(),k=null,l=70,m=!0,n=!1,o=!1,p=null,q=250,r=d3.dispatch("brush","onBrush","renderEnd"),s=!0;b.interactive(!1),b.pointActive(function(a){return!1});var t=a.utils.renderWatch(r,q);return c.dispatch=r,c.content=b,c.brush=h,c.xAxis=f,c.yAxis=g,c.options=a.utils.optionsFunc.bind(c),c._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},showXAxis:{get:function(){return m},set:function(a){m=a}},showYAxis:{get:function(){return n},set:function(a){n=a}},brushExtent:{get:function(){return p},set:function(a){p=a}},syncBrushing:{get:function(){return s},set:function(a){s=a}},margin:{get:function(){return i},set:function(a){i.top=void 0!==a.top?a.top:i.top,i.right=void 0!==a.right?a.right:i.right,i.bottom=void 0!==a.bottom?a.bottom:i.bottom,i.left=void 0!==a.left?a.left:i.left}},duration:{get:function(){return q},set:function(a){q=a,t.reset(q),b.duration(q),f.duration(q),g.duration(q)}},color:{get:function(){return j},set:function(c){j=a.utils.getColor(c),b.color(j)}},interpolate:{get:function(){return b.interpolate()},set:function(a){b.interpolate(a)}},xTickFormat:{get:function(){return f.tickFormat()},set:function(a){f.tickFormat(a)}},yTickFormat:{get:function(){return g.tickFormat()},set:function(a){g.tickFormat(a)}},x:{get:function(){return b.x()},set:function(a){b.x(a)}},y:{get:function(){return b.y()},set:function(a){b.y(a)}},rightAlignYAxis:{get:function(){return o},set:function(a){o=a,g.orient(o?"right":"left")}}}),a.utils.inheritOptions(c,b),a.utils.initOptions(c),c},a.models.forceDirectedGraph=function(){"use strict";function b(g){return w.reset(),g.each(function(g){f=d3.select(this),a.utils.initSVG(f);var j=a.utils.availableWidth(d,f,c),u=a.utils.availableHeight(e,f,c);if(f.attr("width",j).attr("height",u),!(g&&g.links&&g.nodes))return a.utils.noData(b,f),b;f.selectAll(".nv-noData").remove(),f.selectAll("*").remove();var v=new Set;g.nodes.forEach(function(a){Object.keys(a).forEach(function(a){v.add(a)})});var w=d3.layout.force().nodes(g.nodes).links(g.links).size([j,u]).linkStrength(k).friction(l).linkDistance(m).charge(n).gravity(o).theta(p).alpha(q).start(),x=f.selectAll(".link").data(g.links).enter().append("line").attr("class","nv-force-link").style("stroke-width",function(a){return Math.sqrt(a.value)}),y=f.selectAll(".node").data(g.nodes).enter().append("g").attr("class","nv-force-node").call(w.drag);y.append("circle").attr("r",r).style("fill",function(a){return h(a)}).on("mouseover",function(a){f.select(".nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.py),f.select(".nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.px);var b=h(a);a.series=[],v.forEach(function(c){a.series.push({color:b,key:c,value:a[c]})}),i.data(a).hidden(!1)}).on("mouseout",function(a){i.hidden(!0)}),i.headerFormatter(function(a){return"Node"}),t(x),s(y),w.on("tick",function(){x.attr("x1",function(a){return a.source.x}).attr("y1",function(a){return a.source.y}).attr("x2",function(a){return a.target.x}).attr("y2",function(a){return a.target.y}),y.attr("transform",function(a){return"translate("+a.x+", "+a.y+")"})})}),b}var c={top:2,right:0,bottom:2,left:0},d=400,e=32,f=null,g=d3.dispatch("renderEnd"),h=a.utils.getColor(["#000"]),i=a.models.tooltip(),j=null,k=.1,l=.9,m=30,n=-120,o=.1,p=.8,q=.1,r=5,s=function(a){},t=function(a){},u=d3.functor(0),v=d3.functor(0),w=a.utils.renderWatch(g);return b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},linkStrength:{get:function(){return k},set:function(a){k=a}},friction:{get:function(){return l},set:function(a){l=a}},linkDist:{get:function(){return m},set:function(a){m=a}},charge:{get:function(){return n},set:function(a){n=a}},gravity:{get:function(){return o},set:function(a){o=a}},theta:{get:function(){return p},set:function(a){p=a}},alpha:{get:function(){return q},set:function(a){q=a}},radius:{get:function(){return r},set:function(a){r=a}},x:{get:function(){return u},set:function(a){u=d3.functor(a)}},y:{get:function(){return v},set:function(a){v=d3.functor(a)}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return h},set:function(b){h=a.utils.getColor(b)}},noData:{get:function(){return j},set:function(a){j=a}},nodeExtras:{get:function(){return s},set:function(a){s=a}},linkExtras:{get:function(){return t},set:function(a){t=a}}}),b.dispatch=g,b.tooltip=i,a.utils.initOptions(b),b},a.models.furiousLegend=function(){"use strict";function b(r){function s(a,b){return"furious"!=q?"#000":o?a.disengaged?h(a,b):"#fff":o?void 0:a.disabled?h(a,b):"#fff"}function t(a,b){return o&&"furious"==q?a.disengaged?"#fff":h(a,b):a.disabled?"#fff":h(a,b)}return r.each(function(b){var r=d-c.left-c.right,u=d3.select(this);a.utils.initSVG(u);var v=u.selectAll("g.nv-legend").data([b]),w=(v.enter().append("g").attr("class","nvd3 nv-legend").append("g"),v.select("g"));v.attr("transform","translate("+c.left+","+c.top+")");var x,y=w.selectAll(".nv-series").data(function(a){return"furious"!=q?a:a.filter(function(a){return!!o||!a.disengaged})}),z=y.enter().append("g").attr("class","nv-series");if("classic"==q)z.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),x=y.select("circle");else if("furious"==q){z.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),x=y.select("rect"),z.append("g").attr("class","nv-check-box").property("innerHTML",'<path d="M0.5,5 L22.5,5 L22.5,26.5 L0.5,26.5 L0.5,5 Z" class="nv-box"></path><path d="M5.5,12.8618467 L11.9185089,19.2803556 L31,0.198864511" class="nv-check"></path>').attr("transform","translate(-10,-8)scale(0.5)");var A=y.select(".nv-check-box");A.each(function(a,b){d3.select(this).selectAll("path").attr("stroke",s(a,b))})}z.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var B=y.select("text.nv-legend-text");y.on("mouseover",function(a,b){p.legendMouseover(a,b)}).on("mouseout",function(a,b){p.legendMouseout(a,b)}).on("click",function(a,b){p.legendClick(a,b);var c=y.data();if(m){if("classic"==q)n?(c.forEach(function(a){a.disabled=!0}),a.disabled=!1):(a.disabled=!a.disabled,c.every(function(a){return a.disabled})&&c.forEach(function(a){a.disabled=!1}));else if("furious"==q)if(o)a.disengaged=!a.disengaged,a.userDisabled=void 0==a.userDisabled?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled;else if(!o){a.disabled=!a.disabled,a.userDisabled=a.disabled;var d=c.filter(function(a){return!a.disengaged});d.every(function(a){return a.userDisabled})&&c.forEach(function(a){a.disabled=a.userDisabled=!1})}p.stateChange({disabled:c.map(function(a){return!!a.disabled}),disengaged:c.map(function(a){return!!a.disengaged})})}}).on("dblclick",function(a,b){if(("furious"!=q||!o)&&(p.legendDblclick(a,b),m)){var c=y.data();c.forEach(function(a){a.disabled=!0,"furious"==q&&(a.userDisabled=a.disabled)}),a.disabled=!1,"furious"==q&&(a.userDisabled=a.disabled),p.stateChange({disabled:c.map(function(a){return!!a.disabled})})}}),y.classed("nv-disabled",function(a){return a.userDisabled}),y.exit().remove(),B.attr("fill",s).text(function(a){return g(f(a))});var C;switch(q){case"furious":C=23;break;case"classic":C=20}if(j){var D=[];y.each(function(b,c){var d;if(g(f(b))&&g(f(b)).length>i){var e=g(f(b)).substring(0,i);d=d3.select(this).select("text").text(e+"..."),d3.select(this).append("svg:title").text(g(f(b)))}else d=d3.select(this).select("text");var h;try{if((h=d.node().getComputedTextLength())<=0)throw Error()}catch(j){h=a.utils.calcApproxTextWidth(d)}D.push(h+k)});for(var E=0,F=0,G=[];F<r&&E<D.length;)G[E]=D[E],F+=D[E++];for(0===E&&(E=1);F>r&&E>1;){G=[],E--;for(var H=0;H<D.length;H++)D[H]>(G[H%E]||0)&&(G[H%E]=D[H]);F=G.reduce(function(a,b,c,d){return a+b})}for(var I=[],J=0,K=0;J<E;J++)I[J]=K,K+=G[J];y.attr("transform",function(a,b){return"translate("+I[b%E]+","+(5+Math.floor(b/E)*C)+")"}),l?w.attr("transform","translate("+(d-c.right-F)+","+c.top+")"):w.attr("transform","translate(0,"+c.top+")"),e=c.top+c.bottom+Math.ceil(D.length/E)*C}else{var L,M=5,N=5,O=0;y.attr("transform",function(a,b){var e=d3.select(this).select("text").node().getComputedTextLength()+k;return L=N,d<c.left+c.right+L+e&&(N=L=5,M+=C),N+=e,N>O&&(O=N),"translate("+L+","+M+")"}),w.attr("transform","translate("+(d-c.right-O)+","+c.top+")"),e=c.top+c.bottom+M+15}"furious"==q&&x.attr("width",function(a,b){return B[0][b].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),x.style("fill",t).style("stroke",function(a,b){return a.color||h(a,b)})}),b}var c={top:5,right:0,bottom:5,left:0},d=400,e=20,f=function(a){return a.key},g=function(a){return a},h=a.utils.getColor(),i=20,j=!0,k=28,l=!0,m=!0,n=!1,o=!1,p=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),q="classic";return b.dispatch=p,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},key:{get:function(){return f},set:function(a){f=a}},keyFormatter:{get:function(){return g},set:function(a){g=a}},align:{get:function(){return j},set:function(a){j=a}},rightAlign:{get:function(){return l},set:function(a){l=a}},maxKeyLength:{get:function(){return i},set:function(a){i=a}},padding:{get:function(){return k},set:function(a){k=a}},updateState:{get:function(){return m},set:function(a){m=a}},radioButtonMode:{get:function(){return n},set:function(a){n=a}},expanded:{get:function(){return o},set:function(a){o=a}},vers:{get:function(){return q},set:function(a){q=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return h},set:function(b){h=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.heatMap=function(){"use strict";function b(a){if(Q){var b=d3.rgb(a);return(299*b.r+587*b.g+114*b.b)/1e3>=128?"#404040":"#EDEDED"}return"black"}function c(a,b){var c={};return a.forEach(function(a,d){"row"==b?(ka(a)in c||(c[ka(a)]=[]),c[ka(a)].push(J(a))):"col"==b?(ja(a)in c||(c[ja(a)]=[]),c[ja(a)].push(J(a))):null==b&&(0 in c||(c[0]=[]),c[0].push(J(a)))}),c}function d(a){var b=d3.median(a),c=a.map(function(a){return Math.abs(a-b)});return d3.median(c)}function e(a){var b=P?la(a):J(a);return g()&&!isNaN(b)||void 0!==b?G(b):T}function f(){return g()?P?d3.extent(x,function(a){return la(a)}):d3.extent(ca):g()?void 0:ca}function g(){return"number"==typeof ca[0]}function h(a){if(-1!=["centerRow","robustCenterRow","centerScaleRow","robustCenterScaleRow","centerColumn","robustCenterColumn","centerScaleColumn","robustCenterScaleColumn","centerAll","robustCenterAll","centerScaleAll","robustCenterScaleAll"].indexOf(P)){var b=(Object.keys(aa),Object.keys(ba),!!P.includes("Scale")),e=P.includes("robust")?"median":"mean",f=P.includes("Row")?"row":P.includes("Column")?"col":null,h=c(a,f),i={},j={};for(var k in h)i[k]="mean"==e?d3.mean(h[k]):d3.median(h[k]),b&&(j[k]="mean"==e?d3.deviation(h[k]):d(h[k]));a.forEach(function(a,c){if(g()){if("row"==f)var d=ka(a);else if("col"==f)var d=ja(a);else if(null==f)var d=0;var e=J(a)-i[d];a._cellPos.norm=b?e/j[d]:e}else a._cellPos.norm=J(a)})}else P=!1;return a}function i(a){aa={},ba={},ca=[],da=[],ea=[],fa=[];var b,c=[],d={},e=0,f=0,g=0;a.forEach(function(a){var h=H(a),i=I(a),k=J(a);h in aa||(aa[h]=e,e++,d[h]={},"function"==typeof t&&da.push(t(a))),i in ba||(ba[i]=f,f++,d[h][i]={},"function"==typeof u&&ea.push(u(a))),-1==ca.indexOf(k)&&ca.push(k),a._cellPos={idx:g,ix:aa[h],iy:ba[i]},g++,b=[h,i],j(fa,b)?-1==c.indexOf(h+i)&&(c.push(h+i),console.warn("The row/column position "+h+"/"+i+" has multiple values; ensure each cell has only a single value.")):(fa.push(b),d[h][i]=a)}),ca=ca.sort();var i=[];return Object.keys(ba).forEach(function(a){Object.keys(aa).forEach(function(b){var c=d[b][a];if(c)i.push(c);else{var e={idx:g,ix:aa[b],iy:ba[a]};g++,i.push({_cellPos:e})}})}),P?h(i):i}function j(a,b){var c=JSON.stringify(b);return a.some(function(a){return JSON.stringify(a)===c})}function k(){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)}function l(a){return Object.keys(a).sort(function(b,c){return a[b]-a[c]})}function m(a,b){return Object.keys(a).filter(function(c){return a[c]===b})[0]}function n(c){return ga.reset(),c.each(function(c){x=i(c);var d=B-A.left-A.right,h=C-A.top-A.bottom;z=d/Object.keys(aa).length,y=M?z/M:h/Object.keys(ba).length,M&&(h=y*Object.keys(ba).length-A.top-A.bottom),o=d3.select(this),a.utils.initSVG(o),E.domain(p||l(aa)).rangeBands(r||[0,d-O/2]),F.domain(q||l(ba)).rangeBands(s||[0,h-O/2]),G=g()?d3.scale.quantize():d3.scale.ordinal(),G.domain(w||f()).range(v||ha);var j=o.selectAll("g.nv-heatMapWrap").data([x]),n=j.enter().append("g").attr("class","nvd3 nv-heatMapWrap");n.append("g").attr("class","cellWrap"),j.watchTransition(ga,"nv-wrap: heatMapWrap").attr("transform","translate("+A.left+","+A.top+")");var D=(n.append("g").attr("class","cellGrid").style("opacity",1e-6),j.select(".cellGrid").selectAll(".gridLines.verticalGrid").data(Object.values(aa).concat([Object.values(aa).length])));D.enter().append("line").attr("class","gridLines verticalGrid"),D.exit().remove();var H=j.select(".cellGrid").selectAll(".gridLines.horizontalGrid").data(Object.values(ba).concat([Object.values(ba).length]));H.enter().append("line").attr("class","gridLines horizontalGrid"),H.exit().remove();var I=j.select(".cellWrap").selectAll(".nv-cell").data(function(a){return a},function(a){return ma(a)}),L=(n.append("g").attr("class","xMetaWrap").attr("transform",function(){return"translate(0,"+(-Y()-O-V)+")"}),j.select(".xMetaWrap").selectAll(".x-meta").data(da)),P=(L.enter().append("rect").attr("class","x-meta meta").attr("width",z-O).attr("height",Y()).attr("transform","translate(0,0)").attr("fill",function(a){return R(a)}),n.append("g").attr("class","yMetaWrap").attr("transform",function(a,b){return"translate("+(-Z()-O-V)+",0)"}),j.select(".yMetaWrap").selectAll(".y-meta").data(ea));P.enter().append("rect").attr("class","y-meta meta").attr("width",Z()).attr("height",y-O).attr("transform",function(a,b){return"translate(0,0)"}).attr("fill",function(a,b){return S(a)});L.exit().remove(),P.exit().remove();var Q=I.enter().append("g").style("opacity",1e-6).attr("transform",function(a){return"translate(0,"+ka(a)*y+")"}).attr("data-row",function(a){return ka(a)}).attr("data-column",function(a){return ja(a)});Q.append("rect"),Q.append("text").attr("text-anchor","middle").attr("dy",4).attr("class","cell-text"),I.selectAll("rect").watchTransition(ga,"heatMap: rect").attr("width",z-O).attr("height",y-O).attr("rx",N).attr("ry",N).style("stroke",function(a){return e(a)}),I.attr("class",function(a){return isNaN(J(a))?"nv-cell cell-missing":"nv-cell"}).watchTransition(ga,"heatMap: cells").style({opacity:1,fill:function(a){return e(a)}}).attr("transform",function(a){return"translate("+ja(a)*z+","+ka(a)*y+")"}).attr("class",function(a){return isNaN(J(a))?"nv-cell cell-missing":"nv-cell"}),I.exit().remove(),I.selectAll("text").watchTransition(ga,"heatMap: cells text").text(function(a){return _(a)}).attr("x",function(a){return(z-O)/2}).attr("y",function(a){return(y-O)/2}).style("fill",function(a){return b(e(a))}).style("opacity",function(){return K?1:0}),j.selectAll(".verticalGrid").watchTransition(ga,"heatMap: gridLines").attr("y1",0).attr("y2",h-O).attr("x1",function(a){return a*z-O/2}).attr("x2",function(a){return a*z-O/2});var T=Object.keys(ba).length;j.selectAll(".horizontalGrid").watchTransition(ga,"heatMap: gridLines").attr("x1",function(a){return 0==a||a==T?-O:0}).attr("x2",function(a){return 0==a||a==T?d:d-O}).attr("y1",function(a){return a*y-O/2}).attr("y2",function(a){return a*y-O/2}),j.select(".cellGrid").watchTransition(ga,"heatMap: gridLines").style({"stroke-width":O,opacity:function(){return $?1:1e-6}});var U=(j.selectAll(".x-meta"),j.selectAll(".y-meta"),j.selectAll(".meta"));L.watchTransition(ga,"heatMap: xMetaRect").attr("width",z-O).attr("height",Y()).attr("transform",function(a,b){return"translate("+b*z+",0)"}),P.watchTransition(ga,"heatMap: yMetaRect").attr("width",Z()).attr("height",y-O).attr("transform",function(a,b){return"translate(0,"+b*y+")"}),j.select(".xMetaWrap").watchTransition(ga,"heatMap: xMetaWrap").attr("transform",function(a,b){return"translate(0,"+(-Y()-O-V)+")"}).style("opacity",function(){return!1!==t?1:0}),j.select(".yMetaWrap").watchTransition(ga,"heatMap: yMetaWrap").attr("transform",function(a,b){return"translate("+(-Z()-O-V)+",0)"}).style("opacity",function(){return!1!==u?1:0}),I.on("mouseover",function(a,b){var c=ma(a),d=ja(a),e=ka(a);d3.selectAll(".nv-cell").each(function(a){c==ma(a)?(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)),d==ja(a)&&(d3.select(this).classed("no-hover",!1),d3.select(this).classed("column-hover",!0)),e==ka(a)&&(d3.select(this).classed("no-hover",!1),d3.select(this).classed("row-hover",!0))}),d3.selectAll(".x-meta").each(function(a,b){b==d?(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(a,b){b==e?(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))}),W.elementMouseover({value:m(aa,d)+" & "+m(ba,e),series:{value:_(a),color:d3.select(this).select("rect").style("fill")},e:d3.event})}).on("mouseout",function(a,b){var c=(d3.select(this).select("rect").node().getBBox(),d3.mouse(d3.select(".nv-heatMap").node())),e=c[0],f=c[1];(e+O>=d||f+O>=h||e<0||f<0)&&(k(),W.elementMouseout({e:d3.event}))}).on("mousemove",function(a,b){W.elementMousemove({e:d3.event})}),U.on("mouseover",function(a,b){var c=-1!=d3.select(this).attr("class").indexOf("x-meta");d3.selectAll(".nv-cell").each(function(a){c&&b==ja(a)?(d3.select(this).classed("column-hover",!0),d3.select(this).classed("no-hover",!1)):c||b-da.length!=ka(a)?(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),W.elementMouseover({value:c?"Column meta":"Row meta",series:{value:a,color:d3.select(this).style("fill")}})}).on("mouseout",function(a,b){var c=-1!=d3.select(this).attr("class").indexOf("x-meta"),e=(d3.select(this).node().getBBox(),d3.mouse(d3.select(c?".xMetaWrap":".yMetaWrap").node())),f=e[0],g=e[1];(g<0||f<0||c&&f+O>=d||!c&&g+O>=h)&&(k(),W.elementMouseout({e:d3.event}))}).on("mousemove",function(a,b){W.elementMousemove({e:d3.event})})}),ga.renderEnd("heatMap immediate"),n}var o,p,q,r,s,t,u,v,w,x,y,z,A={top:0,right:0,bottom:0,left:0},B=960,C=500,D=Math.floor(1e4*Math.random()),E=d3.scale.ordinal(),F=d3.scale.ordinal(),G=!1,H=function(a){return a.x},I=function(a){return a.y},J=function(a){return a.value},K=!0,L=function(a){return"number"==typeof a?a.toFixed(0):a},M=!1,N=2,O=4,P=!1,Q=!0,R=a.utils.defaultColor(),S=a.utils.defaultColor(),T="#bcbcbc",U="",V=5,W=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),X=250,Y=function(a){return y/3},Z=function(a){return z/3},$=!1,_=function(a){var b=L(P?la(a):J(a));return g()&&!isNaN(b)||void 0!==b?b:U},aa={},ba={},ca=[],da=[],ea=[],fa=[],ga=a.utils.renderWatch(W,X),ha=["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],ia=function(a){return a._cellPos},ja=function(a){return ia(a).ix},ka=function(a){return ia(a).iy},la=function(a){return ia(a).norm},ma=function(a){return ia(a).idx};return n.dispatch=W,n.options=a.utils.optionsFunc.bind(n),n._options=Object.create({},{width:{get:function(){return B},set:function(a){B=a}},height:{get:function(){return C},set:function(a){C=a}},showCellValues:{get:function(){return K},set:function(a){K=a}},x:{get:function(){return H},set:function(a){H=a}},y:{get:function(){return I},set:function(a){I=a}},cellValue:{get:function(){return J},set:function(a){J=a}},missingDataColor:{get:function(){return T},set:function(a){T=a}},missingDataLabel:{get:function(){return U},set:function(a){U=a}},xScale:{get:function(){return E},set:function(a){E=a}},yScale:{get:function(){return F},set:function(a){F=a}},colorScale:{get:function(){return G},set:function(a){G=a}},xDomain:{get:function(){return p},set:function(a){p=a}},yDomain:{get:function(){return q},set:function(a){q=a}},xRange:{get:function(){return r},set:function(a){r=a}},yRange:{get:function(){return s},set:function(a){s=a}},colorRange:{get:function(){return v},set:function(a){v=a}},colorDomain:{get:function(){return w},set:function(a){w=a}},xMeta:{get:function(){return t},set:function(a){t=a}},yMeta:{get:function(){return u},set:function(a){u=a}},xMetaColorScale:{get:function(){return color},set:function(b){color=a.utils.getColor(b)}},yMetaColorScale:{get:function(){return color},set:function(b){color=a.utils.getColor(b)}},cellAspectRatio:{get:function(){return M},set:function(a){M=a}},cellRadius:{get:function(){return N},set:function(a){N=a}},cellHeight:{get:function(){return y}},cellWidth:{get:function(){return z}},normalize:{get:function(){return P},set:function(a){P=a}},cellBorderWidth:{get:function(){return O},set:function(a){O=a}},highContrastText:{get:function(){return Q},set:function(a){Q=a}},cellValueFormat:{get:function(){return L},set:function(a){L=a}},id:{get:function(){return D},set:function(a){D=a}},metaOffset:{get:function(){return V},set:function(a){V=a}},xMetaHeight:{get:function(){return Y},set:function(a){Y=a}},yMetaWidth:{get:function(){return Z},set:function(a){Z=a}},showGrid:{get:function(){return $},set:function(a){$=a}},margin:{get:function(){return A},set:function(a){A.top=void 0!==a.top?a.top:A.top,A.right=void 0!==a.right?a.right:A.right,A.bottom=void 0!==a.bottom?a.bottom:A.bottom,A.left=void 0!==a.left?a.left:A.left}},duration:{get:function(){return X},set:function(a){X=a,ga.reset(X)}}}),a.utils.initOptions(n),n},a.models.heatMapChart=function(){"use strict";function b(){var a=h.colorScale();return"string"==typeof a.domain()[0]?a.domain():a.range().map(function(b){var c=a.invertExtent(b);return null===c[0]&&(c[0]=a.domain()[0]),null===c[1]&&(c[1]=a.domain()[1]),c})}function c(){return"function"==typeof h.yMeta()}function d(){return"function"==typeof h.xMeta()}function e(j){return A.reset(),A.models(h),A.models(k),A.models(l),j.each(function(j){var n=d3.select(this);a.utils.initSVG(n);var x=a.utils.availableWidth(o,n,m),B=a.utils.availableHeight(p,n,m);if(e.update=function(){y.beforeUpdate(),n.transition().duration(z).call(e)},e.container=this,!j||!j.length)return a.utils.noData(e,n),e;n.selectAll(".nv-noData").remove(),f=h.xScale(),g=h.yScale();var C=n.selectAll("g.nv-wrap").data([j]),D=C.enter().append("g").attr("class","nvd3 nv-wrap").append("g"),E=C.select("g");D.append("g").attr("class","nv-heatMap"),D.append("g").attr("class","nv-legendWrap"),D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis"),E.attr("transform","translate("+m.left+","+m.top+")"),h.width(x).height(B),E.select(".nv-heatMap").datum(j.filter(function(a){return!a.disabled})).transition().call(h),h.cellAspectRatio()&&(B=h.cellHeight()*g.domain().length,h.height(B)),k.scale(f)._ticks(a.utils.calcTicksX(x/100,j)).tickSize(-B,0);var F=E.select(".nv-x.nv-axis");F.call(k).watchTransition(A,"heatMap: axisX").selectAll(".tick").style("opacity",function(){return s?1:0}),F.selectAll("g").selectAll(".tick text").attr("transform",function(a,b,c){var d=0!=w?w:"0";return"translate(0, "+(r?c%2==0?"5":"17":"0")+") rotate("+d+" 0,0)"}).style("text-anchor",w>0?"start":w<0?"end":"middle");var G=-5;if(d()&&(F.selectAll("text").style("text-anchor","middle"),G=-h.xMetaHeight()()/2-h.metaOffset()+3),"bottom"==v){if(F.watchTransition(A,"heatMap: axisX").attr("transform","translate(0,"+(B-G)+")"),!1!==h.xMeta()){var H=B+h.metaOffset()+h.cellBorderWidth();E.select(".xMetaWrap").watchTransition(A,"heatMap: xMetaWrap").attr("transform",function(a,b){return"translate(0,"+H+")"})}}else F.watchTransition(A,"heatMap: axisX").attr("transform","translate(0,"+G+")");l.scale(g)._ticks(a.utils.calcTicksY(B/36,j)).tickSize(-x,0);var I=E.select(".nv-y.nv-axis");I.call(l).watchTransition(A,"heatMap: axisY").selectAll(".tick").style("opacity",function(){return t?1:0});var J=-5;if(c()&&(I.selectAll("text").style("text-anchor","middle"),J=-h.yMetaWidth()()/2-h.metaOffset()),"right"==u){if(I.attr("transform","translate("+(x-J)+",0)"),!1!==h.yMeta()){var H=x+h.metaOffset()+h.cellBorderWidth();E.select(".yMetaWrap").watchTransition(A,"heatMap: yMetaWrap").attr("transform",function(a,b){return"translate("+H+",0)"})}}else I.attr("transform","translate("+J+",0)");var K=E.select(".nv-legendWrap");i.width(x).color(h.colorScale().range());var L=b().map(function(a){return Array.isArray(a)?{key:a[0].toFixed(1)+" - "+a[1].toFixed(1)}:{key:a}});K.datum(L).call(i).attr("transform","translate(0,"+("top"==v?B:-30)+")"),K.watchTransition(A,"heatMap: nv-legendWrap").style("opacity",function(){return q?1:0})}),d3.selectAll(".nv-axis").selectAll("line").style("stroke-opacity",0),d3.select(".nv-y").select("path.domain").remove(),A.renderEnd("heatMap chart immediate"),e}var f,g,h=a.models.heatMap(),i=a.models.legend(),j=(a.models.legend(),a.models.legend(),a.models.tooltip()),k=a.models.axis(),l=a.models.axis(),m={top:20,right:10,bottom:50,left:60},n=null,o=null,p=null,q=(a.utils.getColor(),!0),r=!1,s=!0,t=!0,u="left",v="top",w=0,x=null,y=d3.dispatch("beforeUpdate","renderEnd"),z=250;k.orient(v).showMaxMin(!1).tickFormat(function(a){return a}),l.orient(u).showMaxMin(!1).tickFormat(function(a){return a}),j.duration(0).headerEnabled(!0).keyFormatter(function(a,b){return k.tickFormat()(a,b)});var A=a.utils.renderWatch(y,z)
|
|
7
|
+
;return h.dispatch.on("elementMouseover.tooltip",function(a){j.data(a).hidden(!1)}),h.dispatch.on("elementMouseout.tooltip",function(a){j.hidden(!0)}),h.dispatch.on("elementMousemove.tooltip",function(a){j()}),e.dispatch=y,e.heatMap=h,e.legend=i,e.xAxis=k,e.yAxis=l,e.tooltip=j,e.options=a.utils.optionsFunc.bind(e),e._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return p},set:function(a){p=a}},showLegend:{get:function(){return q},set:function(a){q=a}},noData:{get:function(){return x},set:function(a){x=a}},showXAxis:{get:function(){return s},set:function(a){s=a}},showYAxis:{get:function(){return t},set:function(a){t=a}},staggerLabels:{get:function(){return r},set:function(a){r=a}},rotateLabels:{get:function(){return w},set:function(a){w=a}},margin:{get:function(){return m},set:function(a){void 0!==a.top&&(m.top=a.top,n=a.top),m.right=void 0!==a.right?a.right:m.right,m.bottom=void 0!==a.bottom?a.bottom:m.bottom,m.left=void 0!==a.left?a.left:m.left}},duration:{get:function(){return z},set:function(a){z=a,A.reset(z),h.duration(z),k.duration(z),l.duration(z)}},alignYAxis:{get:function(){return u},set:function(a){u=a,l.orient(a)}},alignXAxis:{get:function(){return v},set:function(a){v=a,k.orient(a)}}}),a.utils.inheritOptions(e,h),a.utils.initOptions(e),e},a.models.historicalBar=function(){"use strict";function b(x){return x.each(function(b){w.reset(),k=d3.select(this);var x=a.utils.availableWidth(h,k,g),y=a.utils.availableHeight(i,k,g);a.utils.initSVG(k),l.domain(c||d3.extent(b[0].values.map(n).concat(p))),r?l.range(e||[.5*x/b[0].values.length,x*(b[0].values.length-.5)/b[0].values.length]):l.range(e||[0,x]),m.domain(d||d3.extent(b[0].values.map(o).concat(q))).range(f||[y,0]),l.domain()[0]===l.domain()[1]&&(l.domain()[0]?l.domain([l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]):l.domain([-1,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]));var z=k.selectAll("g.nv-wrap.nv-historicalBar-"+j).data([b[0].values]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+j),B=A.append("defs"),C=A.append("g"),D=z.select("g");C.append("g").attr("class","nv-bars"),z.attr("transform","translate("+g.left+","+g.top+")"),k.on("click",function(a,b){u.chartClick({data:a,index:b,pos:d3.event,id:j})}),B.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),z.select("#nv-chart-clip-path-"+j+" rect").attr("width",x).attr("height",y),D.attr("clip-path",s?"url(#nv-chart-clip-path-"+j+")":"");var E=z.select(".nv-bars").selectAll(".nv-bar").data(function(a){return a},function(a,b){return n(a,b)});E.exit().remove(),E.enter().append("rect").attr("x",0).attr("y",function(b,c){return a.utils.NaNtoZero(m(Math.max(0,o(b,c))))}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.abs(m(o(b,c))-m(0)))}).attr("transform",function(a,c){return"translate("+(l(n(a,c))-x/b[0].values.length*.45)+",0)"}).on("mouseover",function(a,b){v&&(d3.select(this).classed("hover",!0),u.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")}))}).on("mouseout",function(a,b){v&&(d3.select(this).classed("hover",!1),u.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")}))}).on("mousemove",function(a,b){v&&u.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){if(v){var c=this;u.elementClick({data:a,index:b,color:d3.select(this).style("fill"),event:d3.event,element:c}),d3.event.stopPropagation()}}).on("dblclick",function(a,b){v&&(u.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation())}),E.attr("fill",function(a,b){return t(a,b)}).attr("class",function(a,b,c){return(o(a,b)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+c+"-"+b}).watchTransition(w,"bars").attr("transform",function(a,c){return"translate("+(l(n(a,c))-x/b[0].values.length*.45)+",0)"}).attr("width",x/b[0].values.length*.9),E.watchTransition(w,"bars").attr("y",function(b,c){var d=o(b,c)<0?m(0):m(0)-m(o(b,c))<1?m(0)-1:m(o(b,c));return a.utils.NaNtoZero(d)}).attr("height",function(b,c){return a.utils.NaNtoZero(Math.max(Math.abs(m(o(b,c))-m(0)),1))})}),w.renderEnd("historicalBar immediate"),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=Math.floor(1e4*Math.random()),k=null,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=[],q=[0],r=!1,s=!0,t=a.utils.defaultColor(),u=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),v=!0,w=a.utils.renderWatch(u,0);return b.highlightPoint=function(a,b){k.select(".nv-bars .nv-bar-0-"+a).classed("hover",b)},b.clearHighlights=function(){k.select(".nv-bars .nv-bar.hover").classed("hover",!1)},b.dispatch=u,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},forceX:{get:function(){return p},set:function(a){p=a}},forceY:{get:function(){return q},set:function(a){q=a}},padData:{get:function(){return r},set:function(a){r=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},clipEdge:{get:function(){return s},set:function(a){s=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return v},set:function(a){v=a}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},color:{get:function(){return t},set:function(b){t=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.historicalBarChart=function(b){"use strict";function c(b){return b.each(function(k){A.reset(),A.models(f),r&&A.models(g),s&&A.models(h);var x=d3.select(this);a.utils.initSVG(x);var B=a.utils.availableWidth(o,x,l),C=a.utils.availableHeight(p,x,l);if(c.update=function(){x.transition().duration(z).call(c)},c.container=this,v.disabled=k.map(function(a){return!!a.disabled}),!w){var D;w={};for(D in v)v[D]instanceof Array?w[D]=v[D].slice(0):w[D]=v[D]}if(!(k&&k.length&&k.filter(function(a){return a.values.length}).length))return a.utils.noData(c,x),c;x.selectAll(".nv-noData").remove(),d=f.xScale(),e=f.yScale();var E=x.selectAll("g.nv-wrap.nv-historicalBarChart").data([k]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),G=E.select("g");F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-barsWrap"),F.append("g").attr("class","nv-legendWrap"),F.append("g").attr("class","nv-interactive"),q?(i.width(B),G.select(".nv-legendWrap").datum(k).call(i),m||i.height()===l.top||(l.top=i.height(),C=a.utils.availableHeight(p,x,l)),E.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")):G.select(".nv-legendWrap").selectAll("*").remove(),E.attr("transform","translate("+l.left+","+l.top+")"),t&&G.select(".nv-y.nv-axis").attr("transform","translate("+B+",0)"),u&&(j.width(B).height(C).margin({left:l.left,top:l.top}).svgContainer(x).xScale(d),E.select(".nv-interactive").call(j)),f.width(B).height(C).color(k.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!k[b].disabled})),G.select(".nv-barsWrap").datum(k.filter(function(a){return!a.disabled})).transition().call(f),r&&(g.scale(d)._ticks(a.utils.calcTicksX(B/100,k)).tickSize(-C,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),G.select(".nv-x.nv-axis").transition().call(g)),s&&(h.scale(e)._ticks(a.utils.calcTicksY(C/36,k)).tickSize(-B,0),G.select(".nv-y.nv-axis").transition().call(h)),j.dispatch.on("elementMousemove",function(b){f.clearHighlights();var d,e,i,l=[];k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(g,h){e=a.interactiveBisect(g.values,b.pointXValue,c.x()),f.highlightPoint(e,!0);var j=g.values[e];void 0!==j&&(void 0===d&&(d=j),void 0===i&&(i=c.xScale()(c.x()(j,e))),l.push({key:g.key,value:c.y()(j,e),color:n(g,g.seriesIndex),data:g.values[e]}))});var m=g.tickFormat()(c.x()(d,e));j.tooltip.valueFormatter(function(a,b){return h.tickFormat()(a)}).data({value:m,index:e,series:l})(),j.renderGuideLine(i)}),j.dispatch.on("elementMouseout",function(a){y.tooltipHide(),f.clearHighlights()}),i.dispatch.on("legendClick",function(a,d){a.disabled=!a.disabled,k.filter(function(a){return!a.disabled}).length||k.map(function(a){return a.disabled=!1,E.selectAll(".nv-series").classed("disabled",!1),a}),v.disabled=k.map(function(a){return!!a.disabled}),y.stateChange(v),b.transition().call(c)}),i.dispatch.on("legendDblclick",function(a){k.forEach(function(a){a.disabled=!0}),a.disabled=!1,v.disabled=k.map(function(a){return!!a.disabled}),y.stateChange(v),c.update()}),y.on("changeState",function(a){void 0!==a.disabled&&(k.forEach(function(b,c){b.disabled=a.disabled[c]}),v.disabled=a.disabled),c.update()})}),A.renderEnd("historicalBarChart immediate"),c}var d,e,f=b||a.models.historicalBar(),g=a.models.axis(),h=a.models.axis(),i=a.models.legend(),j=a.interactiveGuideline(),k=a.models.tooltip(),l={top:30,right:90,bottom:50,left:90},m=null,n=a.utils.defaultColor(),o=null,p=null,q=!1,r=!0,s=!0,t=!1,u=!1,v={},w=null,x=null,y=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),z=250;g.orient("bottom").tickPadding(7),h.orient(t?"right":"left"),k.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return h.tickFormat()(a,b)}).headerFormatter(function(a,b){return g.tickFormat()(a,b)});var A=a.utils.renderWatch(y,0);return f.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:c.x()(a.data),value:c.y()(a.data),color:a.color},k.data(a).hidden(!1)}),f.dispatch.on("elementMouseout.tooltip",function(a){k.hidden(!0)}),f.dispatch.on("elementMousemove.tooltip",function(a){k()}),c.dispatch=y,c.bars=f,c.legend=i,c.xAxis=g,c.yAxis=h,c.interactiveLayer=j,c.tooltip=k,c.options=a.utils.optionsFunc.bind(c),c._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return p},set:function(a){p=a}},showLegend:{get:function(){return q},set:function(a){q=a}},showXAxis:{get:function(){return r},set:function(a){r=a}},showYAxis:{get:function(){return s},set:function(a){s=a}},defaultState:{get:function(){return w},set:function(a){w=a}},noData:{get:function(){return x},set:function(a){x=a}},margin:{get:function(){return l},set:function(a){void 0!==a.top&&(l.top=a.top,m=a.top),l.right=void 0!==a.right?a.right:l.right,l.bottom=void 0!==a.bottom?a.bottom:l.bottom,l.left=void 0!==a.left?a.left:l.left}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),i.color(n),f.color(n)}},duration:{get:function(){return z},set:function(a){z=a,A.reset(z),h.duration(z),g.duration(z)}},rightAlignYAxis:{get:function(){return t},set:function(a){t=a,h.orient(a?"right":"left")}},useInteractiveGuideline:{get:function(){return u},set:function(a){u=a,!0===a&&c.interactive(!1)}}}),a.utils.inheritOptions(c,f),a.utils.initOptions(c),c},a.models.ohlcBarChart=function(){var b=a.models.historicalBarChart(a.models.ohlcBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(a){var c=a.series[0].data;return'<h3 style="color: #'+(c.open<c.close?"2ca02c":"d62728")+'">'+a.value+"</h3><table><tr><td>open:</td><td>"+b.yAxis.tickFormat()(c.open)+"</td></tr><tr><td>close:</td><td>"+b.yAxis.tickFormat()(c.close)+"</td></tr><tr><td>high</td><td>"+b.yAxis.tickFormat()(c.high)+"</td></tr><tr><td>low:</td><td>"+b.yAxis.tickFormat()(c.low)+"</td></tr></table>"}),b},a.models.candlestickBarChart=function(){var b=a.models.historicalBarChart(a.models.candlestickBar());return b.useInteractiveGuideline(!0),b.interactiveLayer.tooltip.contentGenerator(function(a){var c=a.series[0].data;return'<h3 style="color: #'+(c.open<c.close?"2ca02c":"d62728")+'">'+a.value+"</h3><table><tr><td>open:</td><td>"+b.yAxis.tickFormat()(c.open)+"</td></tr><tr><td>close:</td><td>"+b.yAxis.tickFormat()(c.close)+"</td></tr><tr><td>high</td><td>"+b.yAxis.tickFormat()(c.high)+"</td></tr><tr><td>low:</td><td>"+b.yAxis.tickFormat()(c.low)+"</td></tr></table>"}),b},a.models.legend=function(){"use strict";function b(s){function t(a,b){return"furious"!=r?"#000":p?a.disengaged?"#000":"#fff":p?void 0:(a.color||(a.color=h(a,b)),a.disabled?a.color:"#fff")}function u(a,b){return p&&"furious"==r&&a.disengaged?"#eee":a.color||h(a,b)}function v(a,b){return p&&"furious"==r?1:a.disabled?0:1}return s.each(function(b){var h=d-c.left-c.right,s=d3.select(this);a.utils.initSVG(s);var w=s.selectAll("g.nv-legend").data([b]),x=w.enter().append("g").attr("class","nvd3 nv-legend").append("g"),y=w.select("g");l?w.attr("transform","translate("+-c.right+","+c.top+")"):w.attr("transform","translate("+c.left+","+c.top+")");var z,A,B=y.selectAll(".nv-series").data(function(a){return"furious"!=r?a:a.filter(function(a){return!!p||!a.disengaged})}),C=B.enter().append("g").attr("class","nv-series");switch(r){case"furious":A=23;break;case"classic":A=20}if("classic"==r)C.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),z=B.select(".nv-legend-symbol");else if("furious"==r){C.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),z=B.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)");var D=B.select(".nv-check-box");D.each(function(a,b){d3.select(this).selectAll("path").attr("stroke",t(a,b))})}C.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var E=B.select("text.nv-legend-text");B.on("mouseover",function(a,b){q.legendMouseover(a,b)}).on("mouseout",function(a,b){q.legendMouseout(a,b)}).on("click",function(a,b){q.legendClick(a,b);var c=B.data();if(m){if("classic"==r)o?(c.forEach(function(a){a.disabled=!0}),a.disabled=!1):(a.disabled=!a.disabled,c.every(function(a){return a.disabled})&&c.forEach(function(a){a.disabled=!1}));else if("furious"==r)if(p)a.disengaged=!a.disengaged,a.userDisabled=void 0==a.userDisabled?!!a.disabled:a.userDisabled,a.disabled=a.disengaged||a.userDisabled;else if(!p){a.disabled=!a.disabled,a.userDisabled=a.disabled;var d=c.filter(function(a){return!a.disengaged});d.every(function(a){return a.userDisabled})&&c.forEach(function(a){a.disabled=a.userDisabled=!1})}q.stateChange({disabled:c.map(function(a){return!!a.disabled}),disengaged:c.map(function(a){return!!a.disengaged})})}}).on("dblclick",function(a,b){if(n){if("furious"==r&&p)return;if(q.legendDblclick(a,b),m){var c=B.data();c.forEach(function(a){a.disabled=!0,"furious"==r&&(a.userDisabled=a.disabled)}),a.disabled=!1,"furious"==r&&(a.userDisabled=a.disabled),q.stateChange({disabled:c.map(function(a){return!!a.disabled})})}}}),B.classed("nv-disabled",function(a){return a.userDisabled}),B.exit().remove(),E.attr("fill",t).text(function(a){return g(f(a))});var F=0;if(j){var G=[];B.each(function(b,c){var d;if(g(f(b))&&g(f(b)).length>i){var e=g(f(b)).substring(0,i);d=d3.select(this).select("text").text(e+"..."),d3.select(this).append("svg:title").text(g(f(b)))}else d=d3.select(this).select("text");var h;try{if((h=d.node().getComputedTextLength())<=0)throw Error()}catch(j){h=a.utils.calcApproxTextWidth(d)}G.push(h+k)});var H=0,I=[];for(F=0;F<h&&H<G.length;)I[H]=G[H],F+=G[H++];for(0===H&&(H=1);F>h&&H>1;){I=[],H--;for(var J=0;J<G.length;J++)G[J]>(I[J%H]||0)&&(I[J%H]=G[J]);F=I.reduce(function(a,b,c,d){return a+b})}for(var K=[],L=0,M=0;L<H;L++)K[L]=M,M+=I[L];B.attr("transform",function(a,b){return"translate("+K[b%H]+","+(5+Math.floor(b/H)*A)+")"}),l?y.attr("transform","translate("+(d-c.right-F)+","+c.top+")"):y.attr("transform","translate(0,"+c.top+")"),e=c.top+c.bottom+Math.ceil(G.length/H)*A}else{var N,O=5,P=5,Q=0;B.attr("transform",function(a,b){var e=d3.select(this).select("text").node().getComputedTextLength()+k;return N=P,d<c.left+c.right+N+e&&(P=N=5,O+=A),P+=e,P>Q&&(Q=P),F<N+Q&&(F=N+Q),"translate("+N+","+O+")"}),y.attr("transform","translate("+(d-c.right-Q)+","+c.top+")"),e=c.top+c.bottom+O+15}if("furious"==r){z.attr("width",function(a,b){return E[0][b].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),x.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0);y.select(".nv-legend-bg").transition().duration(300).attr("x",-A).attr("width",F+A-12).attr("height",e+10).attr("y",-c.top-10).attr("opacity",p?1:0)}z.style("fill",u).style("fill-opacity",v).style("stroke",u)}),b}var c={top:5,right:0,bottom:5,left:0},d=400,e=20,f=function(a){return a.key},g=function(a){return a},h=a.utils.getColor(),i=20,j=!0,k=32,l=!0,m=!0,n=!0,o=!1,p=!1,q=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),r="classic";return b.dispatch=q,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},key:{get:function(){return f},set:function(a){f=a}},keyFormatter:{get:function(){return g},set:function(a){g=a}},align:{get:function(){return j},set:function(a){j=a}},maxKeyLength:{get:function(){return i},set:function(a){i=a}},rightAlign:{get:function(){return l},set:function(a){l=a}},padding:{get:function(){return k},set:function(a){k=a}},updateState:{get:function(){return m},set:function(a){m=a}},enableDoubleClick:{get:function(){return n},set:function(a){n=a}},radioButtonMode:{get:function(){return o},set:function(a){o=a}},expanded:{get:function(){return p},set:function(a){p=a}},vers:{get:function(){return r},set:function(a){r=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},color:{get:function(){return h},set:function(b){h=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.line=function(){"use strict";function b(r){return v.reset(),v.models(e),r.each(function(b){i=d3.select(this);var r=a.utils.availableWidth(g,i,f),s=a.utils.availableHeight(h,i,f);a.utils.initSVG(i),c=e.xScale(),d=e.yScale(),t=t||c,u=u||d;var w=i.selectAll("g.nv-wrap.nv-line").data([b]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),y=x.append("defs"),z=x.append("g"),A=w.select("g");z.append("g").attr("class","nv-groups"),z.append("g").attr("class","nv-scatterWrap"),w.attr("transform","translate("+f.left+","+f.top+")"),e.width(r).height(s);var B=w.select(".nv-scatterWrap");B.call(e),y.append("clipPath").attr("id","nv-edge-clip-"+e.id()).append("rect"),w.select("#nv-edge-clip-"+e.id()+" rect").attr("width",r).attr("height",s>0?s:0),A.attr("clip-path",p?"url(#nv-edge-clip-"+e.id()+")":""),B.attr("clip-path",p?"url(#nv-edge-clip-"+e.id()+")":"");var C=w.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});C.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",function(a){return a.strokeWidth||j}).style("fill-opacity",1e-6),C.exit().remove(),C.attr("class",function(a,b){return(a.classed||"")+" nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return k(a,b)}).style("stroke",function(a,b){return k(a,b)}),C.watchTransition(v,"line: groups").style("stroke-opacity",1).style("fill-opacity",function(a){return a.fillOpacity||.5});var D=C.selectAll("path.nv-area").data(function(a){return o(a)?[a]:[]});D.enter().append("path").attr("class","nv-area").attr("d",function(b){return d3.svg.area().interpolate(q).defined(n).x(function(b,c){return a.utils.NaNtoZero(t(l(b,c)))}).y0(function(b,c){return a.utils.NaNtoZero(u(m(b,c)))}).y1(function(a,b){return u(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])}),C.exit().selectAll("path.nv-area").remove(),D.watchTransition(v,"line: areaPaths").attr("d",function(b){return d3.svg.area().interpolate(q).defined(n).x(function(b,d){return a.utils.NaNtoZero(c(l(b,d)))}).y0(function(b,c){return a.utils.NaNtoZero(d(m(b,c)))}).y1(function(a,b){return d(d.domain()[0]<=0?d.domain()[1]>=0?0:d.domain()[1]:d.domain()[0])}).apply(this,[b.values])});var E=C.selectAll("path.nv-line").data(function(a){return[a.values]});E.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(q).defined(n).x(function(b,c){return a.utils.NaNtoZero(t(l(b,c)))}).y(function(b,c){return a.utils.NaNtoZero(u(m(b,c)))})),E.watchTransition(v,"line: linePaths").attr("d",d3.svg.line().interpolate(q).defined(n).x(function(b,d){return a.utils.NaNtoZero(c(l(b,d)))}).y(function(b,c){return a.utils.NaNtoZero(d(m(b,c)))})),t=c.copy(),u=d.copy()}),v.renderEnd("line immediate"),b}var c,d,e=a.models.scatter(),f={top:0,right:0,bottom:0,left:0},g=960,h=500,i=null,j=1.5,k=a.utils.defaultColor(),l=function(a){return a.x},m=function(a){return a.y},n=function(a,b){return!isNaN(m(a,b))&&null!==m(a,b)},o=function(a){return a.area},p=!1,q="linear",r=250,s=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");e.pointSize(16).pointDomain([16,256]);var t,u,v=a.utils.renderWatch(s,r);return b.dispatch=s,b.scatter=e,e.dispatch.on("elementClick",function(){s.elementClick.apply(this,arguments)}),e.dispatch.on("elementMouseover",function(){s.elementMouseover.apply(this,arguments)}),e.dispatch.on("elementMouseout",function(){s.elementMouseout.apply(this,arguments)}),b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},defined:{get:function(){return n},set:function(a){n=a}},interpolate:{get:function(){return q},set:function(a){q=a}},clipEdge:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}},duration:{get:function(){return r},set:function(a){r=a,v.reset(r),e.duration(r)}},isArea:{get:function(){return o},set:function(a){o=d3.functor(a)}},x:{get:function(){return l},set:function(a){l=a,e.x(a)}},y:{get:function(){return m},set:function(a){m=a,e.y(a)}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),e.color(k)}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.lineChart=function(){"use strict";function b(j){return C.reset(),C.models(e),s&&C.models(f),t&&C.models(g),j.each(function(j){function z(){s&&M.select(".nv-focus .nv-x.nv-axis").transition().duration(B).call(f)}function C(){t&&M.select(".nv-focus .nv-y.nv-axis").transition().duration(B).call(g)}function F(a){M.select(".nv-focus .nv-linesWrap").datum(j.filter(function(a){return!a.disabled}).map(function(b,c){return{key:b.key,area:b.area,classed:b.classed,values:b.values.filter(function(b,c){return e.x()(b,c)>=a[0]&&e.x()(b,c)<=a[1]}),disableTooltip:b.disableTooltip}})).transition().duration(B).call(e),z(),C()}var G=d3.select(this);a.utils.initSVG(G);var H=a.utils.availableWidth(o,G,l),I=a.utils.availableHeight(p,G,l)-(w?k.height():0);if(b.update=function(){0===B?G.call(b):G.transition().duration(B).call(b)},b.container=this,x.setter(E(j),b.update).getter(D(j)).update(),x.disabled=j.map(function(a){return!!a.disabled}),!y){var J;y={};for(J in x)x[J]instanceof Array?y[J]=x[J].slice(0):y[J]=x[J]}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,G),b;G.selectAll(".nv-noData").remove(),k.dispatch.on("onBrush",function(a){F(a)}),c=e.xScale(),d=e.yScale();var K=G.selectAll("g.nv-wrap.nv-lineChart").data([j]),L=K.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),M=K.select("g");L.append("g").attr("class","nv-legendWrap");var N=L.append("g").attr("class","nv-focus");N.append("g").attr("class","nv-background").append("rect"),N.append("g").attr("class","nv-x nv-axis"),N.append("g").attr("class","nv-y nv-axis"),N.append("g").attr("class","nv-linesWrap"),N.append("g").attr("class","nv-interactive");L.append("g").attr("class","nv-focusWrap");q?(h.width(H),M.select(".nv-legendWrap").datum(j).call(h),"bottom"===r?(l.bottom=f.height()+h.height(),I=a.utils.availableHeight(p,G,l),M.select(".nv-legendWrap").attr("transform","translate(0,"+(I+f.height())+")")):"top"===r&&(m||h.height()===l.top||(l.top=h.height(),I=a.utils.availableHeight(p,G,l)-(w?k.height():0)),K.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")"))):M.select(".nv-legendWrap").selectAll("*").remove(),K.attr("transform","translate("+l.left+","+l.top+")"),u&&M.select(".nv-y.nv-axis").attr("transform","translate("+H+",0)"),v&&(i.width(H).height(I).margin({left:l.left,top:l.top}).svgContainer(G).xScale(c),K.select(".nv-interactive").call(i)),M.select(".nv-focus .nv-background rect").attr("width",H).attr("height",I),e.width(H).height(I).color(j.map(function(a,b){return a.color||n(a,b)}).filter(function(a,b){return!j[b].disabled}));var O=M.select(".nv-linesWrap").datum(j.filter(function(a){return!a.disabled}));if(s&&f.scale(c)._ticks(a.utils.calcTicksX(H/100,j)).tickSize(-I,0),t&&g.scale(d)._ticks(a.utils.calcTicksY(I/36,j)).tickSize(-H,0),M.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+I+")"),w||null!==k.brush.extent()){k.width(H),M.select(".nv-focusWrap").style("display",w?"initial":"none").attr("transform","translate(0,"+(I+l.bottom+k.margin().top)+")").call(k);var P=k.brush.empty()?k.xDomain():k.brush.extent();null!==P&&F(P)}else O.transition().call(e),z(),C();h.dispatch.on("stateChange",function(a){for(var c in a)x[c]=a[c];A.stateChange(x),b.update()}),i.dispatch.on("elementMousemove",function(d){e.clearHighlights();var f,h,l,m=[];if(j.filter(function(a,b){return a.seriesIndex=b,!a.disabled&&!a.disableTooltip}).forEach(function(g,i){var j=null!==k.brush.extent()?k.brush.empty()?k.xScale().domain():k.brush.extent():c.domain(),o=g.values.filter(function(a,b){return j[0]<=j[1]?e.x()(a,b)>=j[0]&&e.x()(a,b)<=j[1]:e.x()(a,b)>=j[1]&&e.x()(a,b)<=j[0]});if(o.length>0){h=a.interactiveBisect(o,d.pointXValue,e.x());var p=o[h],q=b.y()(p,h);if(null!==q&&e.highlightPoint(i,g.values.indexOf(p),!0),void 0===p)return;void 0===f&&(f=p),void 0===l&&(l=b.xScale()(b.x()(p,h))),m.push({key:g.key,value:q,color:n(g,g.seriesIndex),data:p})}}),m.length>2){var o=b.yScale().invert(d.mouseY),p=Math.abs(b.yScale().domain()[0]-b.yScale().domain()[1]),q=.03*p,r=a.nearestValueIndex(m.map(function(a){return a.value}),o,q);null!==r&&(m[r].highlight=!0)}var s=function(a,b){return null==a?"N/A":g.tickFormat()(a)};void 0!==h&&(i.tooltip.valueFormatter(i.tooltip.valueFormatter()||s).data({value:b.x()(f,h),index:h,series:m})(),i.renderGuideLine(l))}),i.dispatch.on("elementClick",function(c){var d,f=[];j.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(e){var g=a.interactiveBisect(e.values,c.pointXValue,b.x()),h=e.values[g];if(void 0!==h){void 0===d&&(d=b.xScale()(b.x()(h,g)));var i=b.yScale()(b.y()(h,g));f.push({point:h,pointIndex:g,pos:[d,i],seriesIndex:e.seriesIndex,series:e})}}),e.dispatch.elementClick(f)}),i.dispatch.on("elementMouseout",function(a){e.clearHighlights()}),A.on("changeState",function(a){void 0!==a.disabled&&j.length===a.disabled.length&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),x.disabled=a.disabled),b.update()})}),C.renderEnd("lineChart immediate"),b}var c,d,e=a.models.line(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.interactiveGuideline(),j=a.models.tooltip(),k=a.models.focus(a.models.line()),l={top:30,right:20,bottom:50,left:60},m=null,n=a.utils.defaultColor(),o=null,p=null,q=!0,r="top",s=!0,t=!0,u=!1,v=!1,w=!1,x=a.utils.state(),y=null,z=null,A=d3.dispatch("stateChange","changeState","renderEnd"),B=250;f.orient("bottom").tickPadding(7),g.orient(u?"right":"left"),e.clipEdge(!0).duration(0),j.valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),i.tooltip.valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)});var C=a.utils.renderWatch(A,B),D=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},E=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return e.dispatch.on("elementMouseover.tooltip",function(a){a.series.disableTooltip||j.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(a){j.hidden(!0)}),b.dispatch=A,b.lines=e,b.legend=h,b.focus=k,b.xAxis=f,b.x2Axis=k.xAxis,b.yAxis=g,b.y2Axis=k.yAxis,b.interactiveLayer=i,b.tooltip=j,b.state=x,b.dispatch=A,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return p},set:function(a){p=a}},showLegend:{get:function(){return q},set:function(a){q=a}},legendPosition:{get:function(){return r},set:function(a){r=a}},showXAxis:{get:function(){return s},set:function(a){s=a}},showYAxis:{get:function(){return t},set:function(a){t=a}},defaultState:{get:function(){return y},set:function(a){y=a}},noData:{get:function(){return z},set:function(a){z=a}},focusEnable:{get:function(){return w},set:function(a){w=a}},focusHeight:{get:function(){return k.height()},set:function(a){k.height(a)}},focusShowAxisX:{get:function(){return k.showXAxis()},set:function(a){k.showXAxis(a)}},focusShowAxisY:{get:function(){return k.showYAxis()},set:function(a){k.showYAxis(a)}},brushExtent:{get:function(){return k.brushExtent()},set:function(a){k.brushExtent(a)}},focusMargin:{get:function(){return k.margin},set:function(a){void 0!==a.top&&(l.top=a.top,m=a.top),k.margin.right=void 0!==a.right?a.right:k.margin.right,k.margin.bottom=void 0!==a.bottom?a.bottom:k.margin.bottom,k.margin.left=void 0!==a.left?a.left:k.margin.left}},margin:{get:function(){return l},set:function(a){l.top=void 0!==a.top?a.top:l.top,l.right=void 0!==a.right?a.right:l.right,l.bottom=void 0!==a.bottom?a.bottom:l.bottom,l.left=void 0!==a.left?a.left:l.left}},duration:{get:function(){return B},set:function(a){B=a,C.reset(B),e.duration(B),k.duration(B),f.duration(B),g.duration(B)}},color:{get:function(){return n},set:function(b){n=a.utils.getColor(b),h.color(n),e.color(n),k.color(n)}},interpolate:{get:function(){return e.interpolate()},set:function(a){e.interpolate(a),k.interpolate(a)}},xTickFormat:{get:function(){return f.tickFormat()},set:function(a){f.tickFormat(a),k.xTickFormat(a)}},yTickFormat:{get:function(){return g.tickFormat()},set:function(a){g.tickFormat(a),k.yTickFormat(a)}},x:{get:function(){return e.x()},set:function(a){e.x(a),k.x(a)}},y:{get:function(){return e.y()},set:function(a){e.y(a),k.y(a)}},rightAlignYAxis:{get:function(){return u},set:function(a){u=a,g.orient(u?"right":"left")}},useInteractiveGuideline:{get:function(){return v},set:function(a){(v=a)&&(e.interactive(!1),e.useVoronoi(!1))}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.lineWithFocusChart=function(){return a.models.lineChart().margin({bottom:30}).focusEnable(!0)},a.models.linePlusBarChart=function(){"use strict";function b(v){return v.each(function(v){function K(a){var b=+("e"==a),c=b?1:-1,d=$/3
|
|
8
|
+
;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"ZM"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}function S(){u.empty()||u.extent(J),na.data([u.empty()?e.domain():J]).each(function(a,b){var c=e(a[0])-e.range()[0],d=e.range()[1]-e(a[1]);d3.select(this).select(".left").attr("width",c<0?0:c),d3.select(this).select(".right").attr("x",e(a[1])).attr("width",d<0?0:d)})}function T(){J=u.empty()?null:u.extent(),c=u.empty()?e.domain():u.extent(),L.brush({extent:c,brush:u}),S(),l.width(Y).height(Z).color(v.map(function(a,b){return a.color||D(a,b)}).filter(function(a,b){return!v[b].disabled&&v[b].bar})),j.width(Y).height(Z).color(v.map(function(a,b){return a.color||D(a,b)}).filter(function(a,b){return!v[b].disabled&&!v[b].bar}));var b=ga.select(".nv-focus .nv-barsWrap").datum(aa.length?aa.map(function(a,b){return{key:a.key,values:a.values.filter(function(a,b){return l.x()(a,b)>=c[0]&&l.x()(a,b)<=c[1]})}}):[{values:[]}]),h=ga.select(".nv-focus .nv-linesWrap").datum(W(ba)?[{values:[]}]:ba.filter(function(a){return!a.disabled}).map(function(a,b){return{area:a.area,fillOpacity:a.fillOpacity,strokeWidth:a.strokeWidth,key:a.key,values:a.values.filter(function(a,b){return j.x()(a,b)>=c[0]&&j.x()(a,b)<=c[1]})}}));d=aa.length&&!R?l.xScale():j.xScale(),n.scale(d)._ticks(a.utils.calcTicksX(Y/100,v)).tickSize(-Z,0),n.domain([Math.ceil(c[0]),Math.floor(c[1])]),ga.select(".nv-x.nv-axis").transition().duration(M).call(n),b.transition().duration(M).call(l),h.transition().duration(M).call(j),ga.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")"),p.scale(f)._ticks(a.utils.calcTicksY(Z/36,v)).tickSize(-Y,0),q.scale(g)._ticks(a.utils.calcTicksY(Z/36,v)),R?q.tickSize(ba.length?0:-Y,0):q.tickSize(aa.length?0:-Y,0);var i=aa.length?1:0,k=ba.length&&!W(ba)?1:0,m=R?k:i,o=R?i:k;ga.select(".nv-focus .nv-y1.nv-axis").style("opacity",m),ga.select(".nv-focus .nv-y2.nv-axis").style("opacity",o).attr("transform","translate("+d.range()[1]+",0)"),ga.select(".nv-focus .nv-y1.nv-axis").transition().duration(M).call(p),ga.select(".nv-focus .nv-y2.nv-axis").transition().duration(M).call(q)}var X=d3.select(this);a.utils.initSVG(X);var Y=a.utils.availableWidth(z,X,w),Z=a.utils.availableHeight(A,X,w)-(F?I:0),$=I-y.top-y.bottom;if(b.update=function(){X.transition().duration(M).call(b)},b.container=this,N.setter(V(v),b.update).getter(U(v)).update(),N.disabled=v.map(function(a){return!!a.disabled}),!O){var _;O={};for(_ in N)N[_]instanceof Array?O[_]=N[_].slice(0):O[_]=N[_]}if(!(v&&v.length&&v.filter(function(a){return a.values.length}).length))return a.utils.noData(b,X),b;X.selectAll(".nv-noData").remove();var aa=v.filter(function(a){return!a.disabled&&a.bar}),ba=v.filter(function(a){return!a.bar});d=aa.length&&!R?l.xScale():j.xScale(),e=o.scale(),f=R?j.yScale():l.yScale(),g=R?l.yScale():j.yScale(),h=R?k.yScale():m.yScale(),i=R?m.yScale():k.yScale();var ca=v.filter(function(a){return!a.disabled&&(R?!a.bar:a.bar)}).map(function(a){return a.values.map(function(a,b){return{x:B(a,b),y:C(a,b)}})}),da=v.filter(function(a){return!a.disabled&&(R?a.bar:!a.bar)}).map(function(a){return a.values.map(function(a,b){return{x:B(a,b),y:C(a,b)}})});d.range([0,Y]),e.domain(d3.extent(d3.merge(ca.concat(da)),function(a){return a.x})).range([0,Y]);var ea=X.selectAll("g.nv-wrap.nv-linePlusBar").data([v]),fa=ea.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),ga=ea.select("g");fa.append("g").attr("class","nv-legendWrap");var ha=fa.append("g").attr("class","nv-focus");ha.append("g").attr("class","nv-x nv-axis"),ha.append("g").attr("class","nv-y1 nv-axis"),ha.append("g").attr("class","nv-y2 nv-axis"),ha.append("g").attr("class","nv-barsWrap"),ha.append("g").attr("class","nv-linesWrap");var ia=fa.append("g").attr("class","nv-context");if(ia.append("g").attr("class","nv-x nv-axis"),ia.append("g").attr("class","nv-y1 nv-axis"),ia.append("g").attr("class","nv-y2 nv-axis"),ia.append("g").attr("class","nv-barsWrap"),ia.append("g").attr("class","nv-linesWrap"),ia.append("g").attr("class","nv-brushBackground"),ia.append("g").attr("class","nv-x nv-brush"),E){var ja=t.align()?Y/2:Y,ka=t.align()?ja:0;t.width(ja),ga.select(".nv-legendWrap").datum(v.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=R?a.originalKey+(a.bar?Q:P):a.originalKey+(a.bar?P:Q),a})).call(t),x||t.height()===w.top||(w.top=t.height(),Z=a.utils.availableHeight(A,X,w)-I),ga.select(".nv-legendWrap").attr("transform","translate("+ka+","+-w.top+")")}else ga.select(".nv-legendWrap").selectAll("*").remove();ea.attr("transform","translate("+w.left+","+w.top+")"),ga.select(".nv-context").style("display",F?"initial":"none"),m.width(Y).height($).color(v.map(function(a,b){return a.color||D(a,b)}).filter(function(a,b){return!v[b].disabled&&v[b].bar})),k.width(Y).height($).color(v.map(function(a,b){return a.color||D(a,b)}).filter(function(a,b){return!v[b].disabled&&!v[b].bar}));var la=ga.select(".nv-context .nv-barsWrap").datum(aa.length?aa:[{values:[]}]),ma=ga.select(".nv-context .nv-linesWrap").datum(W(ba)?[{values:[]}]:ba.filter(function(a){return!a.disabled}));ga.select(".nv-context").attr("transform","translate(0,"+(Z+w.bottom+y.top)+")"),la.transition().call(m),ma.transition().call(k),H&&(o._ticks(a.utils.calcTicksX(Y/100,v)).tickSize(-$,0),ga.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+h.range()[0]+")"),ga.select(".nv-context .nv-x.nv-axis").transition().call(o)),G&&(r.scale(h)._ticks($/36).tickSize(-Y,0),s.scale(i)._ticks($/36).tickSize(aa.length?0:-Y,0),ga.select(".nv-context .nv-y3.nv-axis").style("opacity",aa.length?1:0).attr("transform","translate(0,"+e.range()[0]+")"),ga.select(".nv-context .nv-y2.nv-axis").style("opacity",ba.length?1:0).attr("transform","translate("+e.range()[1]+",0)"),ga.select(".nv-context .nv-y1.nv-axis").transition().call(r),ga.select(".nv-context .nv-y2.nv-axis").transition().call(s)),u.x(e).on("brush",T),J&&u.extent(J);var na=ga.select(".nv-brushBackground").selectAll("g").data([J||u.extent()]),oa=na.enter().append("g");oa.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",$),oa.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",$);var pa=ga.select(".nv-x.nv-brush").call(u);pa.selectAll("rect").attr("height",$),pa.selectAll(".resize").append("path").attr("d",K),t.dispatch.on("stateChange",function(a){for(var c in a)N[c]=a[c];L.stateChange(N),b.update()}),L.on("changeState",function(a){void 0!==a.disabled&&(v.forEach(function(b,c){b.disabled=a.disabled[c]}),N.disabled=a.disabled),b.update()}),T()}),b}var c,d,e,f,g,h,i,j=a.models.line(),k=a.models.line(),l=a.models.historicalBar(),m=a.models.historicalBar(),n=a.models.axis(),o=a.models.axis(),p=a.models.axis(),q=a.models.axis(),r=a.models.axis(),s=a.models.axis(),t=a.models.legend(),u=d3.svg.brush(),v=a.models.tooltip(),w={top:30,right:30,bottom:30,left:60},x=null,y={top:0,right:30,bottom:20,left:60},z=null,A=null,B=function(a){return a.x},C=function(a){return a.y},D=a.utils.defaultColor(),E=!0,F=!0,G=!1,H=!0,I=50,J=null,K=null,L=d3.dispatch("brush","stateChange","changeState"),M=0,N=a.utils.state(),O=null,P=" (left axis)",Q=" (right axis)",R=!1;j.clipEdge(!0),k.interactive(!1),k.pointActive(function(a){return!1}),n.orient("bottom").tickPadding(5),p.orient("left"),q.orient("right"),o.orient("bottom").tickPadding(5),r.orient("left"),s.orient("right"),v.headerEnabled(!0).headerFormatter(function(a,b){return n.tickFormat()(a,b)});var S=function(){return R?{main:q,focus:s}:{main:p,focus:r}},T=function(){return R?{main:p,focus:r}:{main:q,focus:s}},U=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},V=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},W=function(a){return a.every(function(a){return a.disabled})};return j.dispatch.on("elementMouseover.tooltip",function(a){v.duration(100).valueFormatter(function(a,b){return T().main.tickFormat()(a,b)}).data(a).hidden(!1)}),j.dispatch.on("elementMouseout.tooltip",function(a){v.hidden(!0)}),l.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={value:b.y()(a.data),color:a.color},v.duration(0).valueFormatter(function(a,b){return S().main.tickFormat()(a,b)}).data(a).hidden(!1)}),l.dispatch.on("elementMouseout.tooltip",function(a){v.hidden(!0)}),l.dispatch.on("elementMousemove.tooltip",function(a){v()}),b.dispatch=L,b.legend=t,b.lines=j,b.lines2=k,b.bars=l,b.bars2=m,b.xAxis=n,b.x2Axis=o,b.y1Axis=p,b.y2Axis=q,b.y3Axis=r,b.y4Axis=s,b.tooltip=v,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return z},set:function(a){z=a}},height:{get:function(){return A},set:function(a){A=a}},showLegend:{get:function(){return E},set:function(a){E=a}},brushExtent:{get:function(){return J},set:function(a){J=a}},noData:{get:function(){return K},set:function(a){K=a}},focusEnable:{get:function(){return F},set:function(a){F=a}},focusHeight:{get:function(){return I},set:function(a){I=a}},focusShowAxisX:{get:function(){return H},set:function(a){H=a}},focusShowAxisY:{get:function(){return G},set:function(a){G=a}},legendLeftAxisHint:{get:function(){return P},set:function(a){P=a}},legendRightAxisHint:{get:function(){return Q},set:function(a){Q=a}},margin:{get:function(){return w},set:function(a){void 0!==a.top&&(w.top=a.top,x=a.top),w.right=void 0!==a.right?a.right:w.right,w.bottom=void 0!==a.bottom?a.bottom:w.bottom,w.left=void 0!==a.left?a.left:w.left}},focusMargin:{get:function(){return y},set:function(a){y.top=void 0!==a.top?a.top:y.top,y.right=void 0!==a.right?a.right:y.right,y.bottom=void 0!==a.bottom?a.bottom:y.bottom,y.left=void 0!==a.left?a.left:y.left}},duration:{get:function(){return M},set:function(a){M=a}},color:{get:function(){return D},set:function(b){D=a.utils.getColor(b),t.color(D)}},x:{get:function(){return B},set:function(a){B=a,j.x(a),k.x(a),l.x(a),m.x(a)}},y:{get:function(){return C},set:function(a){C=a,j.y(a),k.y(a),l.y(a),m.y(a)}},switchYAxisOrder:{get:function(){return R},set:function(a){if(R!==a){var b=p;p=q,q=b;var c=r;r=s,s=c}R=a,p.orient("left"),q.orient("right"),r.orient("left"),s.orient("right")}}}),a.utils.inheritOptions(b,j),a.utils.initOptions(b),b},a.models.multiBar=function(){"use strict";function b(F){return D.reset(),F.each(function(b){var F=k-j.left-j.right,G=l-j.top-j.bottom;p=d3.select(this),a.utils.initSVG(p);var H=0;if(x&&b.length&&(x=[{values:b[0].values.map(function(a){return{x:a.x,y:0,series:a.series,size:.01}})}]),u){var I=d3.layout.stack().offset(v).values(function(a){return a.values}).y(r)(!b.length&&x?x:b);I.forEach(function(a,c){a.nonStackable?(b[c].nonStackableSeries=H++,I[c]=b[c]):c>0&&I[c-1].nonStackable&&I[c].values.map(function(a,b){a.y0-=I[c-1].values[b].y,a.y1=a.y0+a.y})}),b=I}b.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),u&&b.length>0&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a,f){if(!b[f].nonStackable){var g=a.values[c];g.size=Math.abs(g.y),g.y<0?(g.y1=e,e-=g.size):(g.y1=g.size+d,d+=g.size)}})});var J=d&&e?[]:b.map(function(a,b){return a.values.map(function(a,c){return{x:q(a,c),y:r(a,c),y0:a.y0,y1:a.y1,idx:b}})});m.domain(d||d3.merge(J).map(function(a){return a.x})).rangeBands(f||[0,F],A),n.domain(e||d3.extent(d3.merge(J).map(function(a){var c=a.y;return u&&!b[a.idx].nonStackable&&(c=a.y>0?a.y1:a.y1+a.y),c}).concat(s))).range(g||[G,0]),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])),n.domain()[0]===n.domain()[1]&&(n.domain()[0]?n.domain([n.domain()[0]+.01*n.domain()[0],n.domain()[1]-.01*n.domain()[1]]):n.domain([-1,1])),h=h||m,i=i||n;var K=p.selectAll("g.nv-wrap.nv-multibar").data([b]),L=K.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),M=L.append("defs"),N=L.append("g"),O=K.select("g");N.append("g").attr("class","nv-groups"),K.attr("transform","translate("+j.left+","+j.top+")"),M.append("clipPath").attr("id","nv-edge-clip-"+o).append("rect"),K.select("#nv-edge-clip-"+o+" rect").attr("width",F).attr("height",G),O.attr("clip-path",t?"url(#nv-edge-clip-"+o+")":"");var P=K.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});P.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var Q=D.transition(P.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,z)).attr("y",function(a,c,d){var e=i(0)||0;return u&&b[a.series]&&!b[a.series].nonStackable&&(e=i(a.y0)),e}).attr("height",0).remove();Q.delay&&Q.delay(function(a,b){return b*(z/(E+1))-b}),P.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return w(a,b)}).style("stroke",function(a,b){return w(a,b)}),P.style("stroke-opacity",1).style("fill-opacity",B);var R=P.selectAll("rect.nv-bar").data(function(a){return x&&!b.length?x.values:a.values});R.exit().remove();R.enter().append("rect").attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(a,c,d){return u&&!b[d].nonStackable?0:d*m.rangeBand()/b.length}).attr("y",function(a,c,d){return i(u&&!b[d].nonStackable?a.y0:0)||0}).attr("height",0).attr("width",function(a,c,d){return m.rangeBand()/(u&&!b[d].nonStackable?1:b.length)}).attr("transform",function(a,b){return"translate("+m(q(a,b))+",0)"});R.style("fill",function(a,b,c){return w(a,c,b)}).style("stroke",function(a,b,c){return w(a,c,b)}).on("mouseover",function(a,c,d){d3.select(this).classed("hover",!0),C.elementMouseover({data:a,index:c,series:b[d],color:d3.select(this).style("fill")})}).on("mouseout",function(a,c,d){d3.select(this).classed("hover",!1),C.elementMouseout({data:a,index:c,series:b[d],color:d3.select(this).style("fill")})}).on("mousemove",function(a,c,d){C.elementMousemove({data:a,index:c,series:b[d],color:d3.select(this).style("fill")})}).on("click",function(a,c,d){var e=this;C.elementClick({data:a,index:c,series:b[d],color:d3.select(this).style("fill"),event:d3.event,element:e}),d3.event.stopPropagation()}).on("dblclick",function(a,c,d){C.elementDblClick({data:a,index:c,series:b[d],color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),R.attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(a,b){return"translate("+m(q(a,b))+",0)"}),y&&(c||(c=b.map(function(){return!0})),R.style("fill",function(a,b,d){return d3.rgb(y(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(y(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}));var S=R.watchTransition(D,"multibar",Math.min(250,z)).delay(function(a,c){return c*z/b[0].values.length});u?S.attr("y",function(a,c,d){return b[d].nonStackable?r(a,c)<0?n(0):n(0)-n(r(a,c))<-1?n(0)-1:n(r(a,c))||0:n(a.y1)}).attr("height",function(a,c,d){return b[d].nonStackable?Math.max(Math.abs(n(r(a,c))-n(0)),0)||0:Math.max(Math.abs(n(a.y+a.y0)-n(a.y0)),0)}).attr("x",function(a,c,d){var e=0;return b[d].nonStackable&&(e=a.series*m.rangeBand()/b.length,b.length!==H&&(e=b[d].nonStackableSeries*m.rangeBand()/(2*H))),e}).attr("width",function(a,c,d){if(b[d].nonStackable){var e=m.rangeBand()/H;return b.length!==H&&(e=m.rangeBand()/(2*H)),e}return m.rangeBand()}):S.attr("x",function(a,c){return a.series*m.rangeBand()/b.length}).attr("width",m.rangeBand()/b.length).attr("y",function(a,b){return r(a,b)<0?n(0):n(0)-n(r(a,b))<1?n(0)-1:n(r(a,b))||0}).attr("height",function(a,b){return Math.max(Math.abs(n(r(a,b))-n(0)),1)||0}),h=m.copy(),i=n.copy(),b[0]&&b[0].values&&(E=b[0].values.length)}),D.renderEnd("multibar immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=d3.scale.ordinal(),n=d3.scale.linear(),o=Math.floor(1e4*Math.random()),p=null,q=function(a){return a.x},r=function(a){return a.y},s=[0],t=!0,u=!1,v="zero",w=a.utils.defaultColor(),x=!1,y=null,z=500,A=.1,B=.75,C=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),D=a.utils.renderWatch(C,z),E=0;return b.dispatch=C,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},x:{get:function(){return q},set:function(a){q=a}},y:{get:function(){return r},set:function(a){r=a}},xScale:{get:function(){return m},set:function(a){m=a}},yScale:{get:function(){return n},set:function(a){n=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceY:{get:function(){return s},set:function(a){s=a}},stacked:{get:function(){return u},set:function(a){u=a}},stackOffset:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return t},set:function(a){t=a}},disabled:{get:function(){return c},set:function(a){c=a}},id:{get:function(){return o},set:function(a){o=a}},hideable:{get:function(){return x},set:function(a){x=a}},groupSpacing:{get:function(){return A},set:function(a){A=a}},fillOpacity:{get:function(){return B},set:function(a){B=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},duration:{get:function(){return z},set:function(a){z=a,D.reset(z)}},color:{get:function(){return w},set:function(b){w=a.utils.getColor(b)}},barColor:{get:function(){return y},set:function(b){y=b?a.utils.getColor(b):null}}}),a.utils.initOptions(b),b},a.models.multiBarChart=function(){"use strict";function b(D){return I.reset(),I.models(e),u&&I.models(f),v&&I.models(g),D.each(function(D){var I=d3.select(this);a.utils.initSVG(I);var M=a.utils.availableWidth(n,I,l),N=a.utils.availableHeight(o,I,l);if(b.update=function(){0===G?I.call(b):I.transition().duration(G).call(b)},b.container=this,B.setter(L(D),b.update).getter(K(D)).update(),B.disabled=D.map(function(a){return!!a.disabled}),!C){var O;C={};for(O in B)B[O]instanceof Array?C[O]=B[O].slice(0):C[O]=B[O]}if(!(D&&D.length&&D.filter(function(a){return a.values.length}).length))return a.utils.noData(b,I),b;I.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var P=I.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([D]),Q=P.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),R=P.select("g");if(Q.append("g").attr("class","nv-x nv-axis"),Q.append("g").attr("class","nv-y nv-axis"),Q.append("g").attr("class","nv-barsWrap"),Q.append("g").attr("class","nv-legendWrap"),Q.append("g").attr("class","nv-controlsWrap"),Q.append("g").attr("class","nv-interactive"),s?"bottom"===t?(i.width(M-l.right),R.select(".nv-legendWrap").datum(D).call(i),l.bottom=f.height()+i.height(),N=a.utils.availableHeight(o,I,l),R.select(".nv-legendWrap").attr("transform","translate(0,"+(N+f.height())+")")):(i.width(M-F()),R.select(".nv-legendWrap").datum(D).call(i),m||i.height()===l.top||(l.top=i.height(),N=a.utils.availableHeight(o,I,l)),R.select(".nv-legendWrap").attr("transform","translate("+F()+","+-l.top+")")):R.select(".nv-legendWrap").selectAll("*").remove(),q){var S=[{key:r.grouped||"Grouped",disabled:e.stacked()},{key:r.stacked||"Stacked",disabled:!e.stacked()}];j.width(F()).color(["#444","#444","#444"]),R.select(".nv-controlsWrap").datum(S).attr("transform","translate(0,"+-l.top+")").call(j)}else R.select(".nv-controlsWrap").selectAll("*").remove();if(P.attr("transform","translate("+l.left+","+l.top+")"),w&&R.select(".nv-y.nv-axis").attr("transform","translate("+M+",0)"),e.disabled(D.map(function(a){return a.disabled})).width(M).height(N).color(D.map(function(a,b){return a.color||p(a,b)}).filter(function(a,b){return!D[b].disabled})),R.select(".nv-barsWrap").datum(D.filter(function(a){return!a.disabled})).call(e),u){f.scale(c)._ticks(a.utils.calcTicksX(M/100,D)).tickSize(-N,0),R.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")"),R.select(".nv-x.nv-axis").call(f);var T=R.select(".nv-x.nv-axis > g").selectAll("g");if(T.selectAll("line, text").style("opacity",1),y){var U=function(a,b){return"translate("+a+","+b+")"},V=5,W=17;T.selectAll("text").attr("transform",function(a,b,c){return U(0,c%2==0?V:W)});var X=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;R.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(a,b){return U(0,0===b||X%2!=0?W:V)})}z&&R.selectAll(".tick text").call(a.utils.wrapTicks,b.xAxis.rangeBand()),x&&T.filter(function(a,b){return b%Math.ceil(D[0].values.length/(M/100))!=0}).selectAll("text, line").style("opacity",0),A&&T.selectAll(".tick text").attr("transform","rotate("+A+" 0,0)").style("text-anchor",A>0?"start":"end"),R.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}v&&(g.scale(d)._ticks(a.utils.calcTicksY(N/36,D)).tickSize(-M,0),R.select(".nv-y.nv-axis").call(g)),H&&(h.width(M).height(N).margin({left:l.left,top:l.top}).svgContainer(I).xScale(c),P.select(".nv-interactive").call(h)),i.dispatch.on("stateChange",function(a){for(var c in a)B[c]=a[c];E.stateChange(B),b.update()}),j.dispatch.on("legendClick",function(a,c){if(a.disabled){switch(S=S.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":case r.grouped:e.stacked(!1);break;case"Stacked":case r.stacked:e.stacked(!0)}B.stacked=e.stacked(),E.stateChange(B),b.update()}}),E.on("changeState",function(a){void 0!==a.disabled&&(D.forEach(function(b,c){b.disabled=a.disabled[c]}),B.disabled=a.disabled),void 0!==a.stacked&&(e.stacked(a.stacked),B.stacked=a.stacked,J=a.stacked),b.update()}),H?(h.dispatch.on("elementMousemove",function(a){if(void 0!=a.pointXValue){var d,e,f,g,i=[];D.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(h,j){e=c.domain().indexOf(a.pointXValue);var k=h.values[e];void 0!==k&&(g=k.x,void 0===d&&(d=k),void 0===f&&(f=a.mouseX),i.push({key:h.key,value:b.y()(k,e),color:p(h,h.seriesIndex),data:h.values[e]}))}),h.tooltip.data({value:g,index:e,series:i})(),h.renderGuideLine(f)}}),h.dispatch.on("elementMouseout",function(a){h.tooltip.hidden(!0)})):(e.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},k.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(a){k.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(a){k()}))}),I.renderEnd("multibarchart immediate"),b}var c,d,e=a.models.multiBar(),f=a.models.axis(),g=a.models.axis(),h=a.interactiveGuideline(),i=a.models.legend(),j=a.models.legend(),k=a.models.tooltip(),l={top:30,right:20,bottom:50,left:60},m=null,n=null,o=null,p=a.utils.defaultColor(),q=!0,r={},s=!0,t=null,u=!0,v=!0,w=!1,x=!0,y=!1,z=!1,A=0,B=a.utils.state(),C=null,D=null,E=d3.dispatch("stateChange","changeState","renderEnd"),F=function(){return q?180:0},G=250,H=!1;B.stacked=!1,e.stacked(!1),f.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat(function(a){return a}),g.orient(w?"right":"left").tickFormat(d3.format(",.1f")),k.duration(0).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),h.tooltip.valueFormatter(function(a,b){return null==a?"N/A":g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),h.tooltip.valueFormatter(function(a,b){return null==a?"N/A":g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),h.tooltip.duration(0).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),j.updateState(!1);var I=a.utils.renderWatch(E),J=!1,K=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:J}}},L=function(a){return function(b){void 0!==b.stacked&&(J=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return b.dispatch=E,b.multibar=e,b.legend=i,b.controls=j,b.xAxis=f,b.yAxis=g,b.state=B,b.tooltip=k,b.interactiveLayer=h,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return n},set:function(a){n=a}},height:{get:function(){return o},set:function(a){o=a}},showLegend:{get:function(){return s},set:function(a){s=a}},legendPosition:{get:function(){return t},set:function(a){t=a}},showControls:{get:function(){return q},set:function(a){q=a}},controlLabels:{get:function(){return r},set:function(a){r=a}},showXAxis:{get:function(){return u},set:function(a){u=a}},showYAxis:{get:function(){return v},set:function(a){v=a}},defaultState:{get:function(){return C},set:function(a){C=a}},noData:{get:function(){return D},set:function(a){D=a}},reduceXTicks:{get:function(){return x},set:function(a){x=a}},rotateLabels:{get:function(){return A},set:function(a){A=a}},staggerLabels:{get:function(){return y},set:function(a){y=a}},wrapLabels:{get:function(){return z},set:function(a){z=!!a}},margin:{get:function(){return l},set:function(a){void 0!==a.top&&(l.top=a.top,m=a.top),l.right=void 0!==a.right?a.right:l.right,l.bottom=void 0!==a.bottom?a.bottom:l.bottom,l.left=void 0!==a.left?a.left:l.left}},duration:{get:function(){return G},set:function(a){G=a,e.duration(G),f.duration(G),g.duration(G),I.reset(G)}},color:{get:function(){return p},set:function(b){p=a.utils.getColor(b),i.color(p)}},rightAlignYAxis:{get:function(){return w},set:function(a){w=a,g.orient(w?"right":"left")}},useInteractiveGuideline:{get:function(){return H},set:function(a){H=a}},barColor:{get:function(){return e.barColor},set:function(a){e.barColor(a),i.color(function(a,b){return d3.rgb("#ccc").darker(1.5*b).toString()})}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.multiBarHorizontal=function(){"use strict";function b(m){return F.reset(),m.each(function(b){var m=k-j.left-j.right,D=l-j.top-j.bottom;n=d3.select(this),a.utils.initSVG(n),w&&(b=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(r)(b)),b.forEach(function(a,b){a.values.forEach(function(c){c.series=b,c.key=a.key})}),w&&b[0].values.map(function(a,c){var d=0,e=0;b.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e-b.size,e-=b.size):(b.y1=d,d+=b.size)})});var G=d&&e?[]:b.map(function(a){return a.values.map(function(a,b){return{x:q(a,b),y:r(a,b),y0:a.y0,y1:a.y1}})});o.domain(d||d3.merge(G).map(function(a){return a.x})).rangeBands(f||[0,D],A),p.domain(e||d3.extent(d3.merge(G).map(function(a){return w?a.y>0?a.y1+a.y:a.y1:a.y}).concat(t))),x&&!w?p.range(g||[p.domain()[0]<0?z:0,m-(p.domain()[1]>0?z:0)]):p.range(g||[0,m]),h=h||o,i=i||d3.scale.linear().domain(p.domain()).range([p(0),p(0)]);var H=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([b]),I=H.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),J=(I.append("defs"),I.append("g"));H.select("g");J.append("g").attr("class","nv-groups"),H.attr("transform","translate("+j.left+","+j.top+")");var K=H.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a,b){return b});K.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),K.exit().watchTransition(F,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),K.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return u(a,b)}).style("stroke",function(a,b){return u(a,b)}),K.watchTransition(F,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",B);var L=K.selectAll("g.nv-bar").data(function(a){return a.values});L.exit().remove();var M=L.enter().append("g").attr("transform",function(a,c,d){return"translate("+i(w?a.y0:0)+","+(w?0:d*o.rangeBand()/b.length+o(q(a,c)))+")"});M.append("rect").attr("width",0).attr("height",o.rangeBand()/(w?1:b.length)),L.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),E.elementMouseover({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),E.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mouseout",function(a,b){E.elementMouseout({data:a,index:b,color:d3.select(this).style("fill")})}).on("mousemove",function(a,b){E.elementMousemove({data:a,index:b,color:d3.select(this).style("fill")})}).on("click",function(a,b){var c=this;E.elementClick({data:a,index:b,color:d3.select(this).style("fill"),event:d3.event,element:c}),d3.event.stopPropagation()}).on("dblclick",function(a,b){E.elementDblClick({data:a,index:b,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),s(b[0],0)&&(M.append("polyline"),L.select("polyline").attr("fill","none").attr("points",function(a,c){var d=s(a,c),e=.8*o.rangeBand()/(2*(w?1:b.length));return d=d.length?d:[-Math.abs(d),Math.abs(d)],d=d.map(function(b){return p(b+(r(a,c)<0?0:r(a,c)))-p(0)}),[[d[0],-e],[d[0],e],[d[0],0],[d[1],0],[d[1],-e],[d[1],e]].map(function(a){return a.join(",")}).join(" ")}).attr("transform",function(a,c){return"translate(0, "+o.rangeBand()/(2*(w?1:b.length))+")"})),M.append("text"),x&&!w?(L.select("text").attr("text-anchor",function(a,b){return r(a,b)<0?"end":"start"}).attr("y",o.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){var c=C(r(a,b)),d=s(a,b);return void 0===d?c:d.length?c+"+"+C(Math.abs(d[1]))+"-"+C(Math.abs(d[0])):c+"±"+C(Math.abs(d))}),L.watchTransition(F,"multibarhorizontal: bars").select("text").attr("x",function(a,b){return r(a,b)<0?-4:p(r(a,b))-p(0)+4})):L.selectAll("text").text(""),y&&!w?(M.append("text").classed("nv-bar-label",!0),L.select("text.nv-bar-label").attr("text-anchor",function(a,b){return r(a,b)<0?"start":"end"}).attr("y",o.rangeBand()/(2*b.length)).attr("dy",".32em").text(function(a,b){return q(a,b)}),L.watchTransition(F,"multibarhorizontal: bars").select("text.nv-bar-label").attr("x",function(a,b){return r(a,b)<0?p(0)-p(r(a,b))+4:-4})):L.selectAll("text.nv-bar-label").text(""),L.attr("class",function(a,b){return r(a,b)<0?"nv-bar negative":"nv-bar positive"}),v&&(c||(c=b.map(function(){return!0})),L.style("fill",function(a,b,d){return d3.rgb(v(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()}).style("stroke",function(a,b,d){return d3.rgb(v(a,b)).darker(c.map(function(a,b){return b}).filter(function(a,b){return!c[b]})[d]).toString()})),w?L.watchTransition(F,"multibarhorizontal: bars").attr("transform",function(a,b){return"translate("+p(a.y1)+","+o(q(a,b))+")"}).select("rect").attr("width",function(a,b){return Math.abs(p(r(a,b)+a.y0)-p(a.y0))||0}).attr("height",o.rangeBand()):L.watchTransition(F,"multibarhorizontal: bars").attr("transform",function(a,c){return"translate("+p(r(a,c)<0?r(a,c):0)+","+(a.series*o.rangeBand()/b.length+o(q(a,c)))+")"}).select("rect").attr("height",o.rangeBand()/b.length).attr("width",function(a,b){return Math.max(Math.abs(p(r(a,b))-p(0)),1)||0}),h=o.copy(),i=p.copy()}),F.renderEnd("multibarHorizontal immediate"),b}var c,d,e,f,g,h,i,j={top:0,right:0,bottom:0,left:0},k=960,l=500,m=Math.floor(1e4*Math.random()),n=null,o=d3.scale.ordinal(),p=d3.scale.linear(),q=function(a){return a.x},r=function(a){return a.y},s=function(a){return a.yErr},t=[0],u=a.utils.defaultColor(),v=null,w=!1,x=!1,y=!1,z=60,A=.1,B=.75,C=d3.format(",.2f"),D=250,E=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),F=a.utils.renderWatch(E,D);return b.dispatch=E,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return k},set:function(a){k=a}},height:{get:function(){return l},set:function(a){l=a}},x:{get:function(){return q},set:function(a){q=a}},y:{get:function(){return r},set:function(a){r=a}},
|
|
9
|
+
yErr:{get:function(){return s},set:function(a){s=a}},xScale:{get:function(){return o},set:function(a){o=a}},yScale:{get:function(){return p},set:function(a){p=a}},xDomain:{get:function(){return d},set:function(a){d=a}},yDomain:{get:function(){return e},set:function(a){e=a}},xRange:{get:function(){return f},set:function(a){f=a}},yRange:{get:function(){return g},set:function(a){g=a}},forceY:{get:function(){return t},set:function(a){t=a}},stacked:{get:function(){return w},set:function(a){w=a}},showValues:{get:function(){return x},set:function(a){x=a}},disabled:{get:function(){return c},set:function(a){c=a}},id:{get:function(){return m},set:function(a){m=a}},valueFormat:{get:function(){return C},set:function(a){C=a}},valuePadding:{get:function(){return z},set:function(a){z=a}},groupSpacing:{get:function(){return A},set:function(a){A=a}},fillOpacity:{get:function(){return B},set:function(a){B=a}},margin:{get:function(){return j},set:function(a){j.top=void 0!==a.top?a.top:j.top,j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},duration:{get:function(){return D},set:function(a){D=a,F.reset(D)}},color:{get:function(){return u},set:function(b){u=a.utils.getColor(b)}},barColor:{get:function(){return v},set:function(b){v=b?a.utils.getColor(b):null}}}),a.utils.initOptions(b),b},a.models.multiBarHorizontalChart=function(){"use strict";function b(j){return F.reset(),F.models(e),u&&F.models(f),v&&F.models(g),j.each(function(j){var z=d3.select(this);a.utils.initSVG(z);var F=a.utils.availableWidth(m,z,k),G=a.utils.availableHeight(n,z,k);if(b.update=function(){z.transition().duration(C).call(b)},b.container=this,w=e.stacked(),x.setter(E(j),b.update).getter(D(j)).update(),x.disabled=j.map(function(a){return!!a.disabled}),!y){var H;y={};for(H in x)x[H]instanceof Array?y[H]=x[H].slice(0):y[H]=x[H]}if(!(j&&j.length&&j.filter(function(a){return a.values.length}).length))return a.utils.noData(b,z),b;z.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale().clamp(!0);var I=z.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([j]),J=I.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),K=I.select("g");if(J.append("g").attr("class","nv-x nv-axis"),J.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),J.append("g").attr("class","nv-barsWrap"),J.append("g").attr("class","nv-legendWrap"),J.append("g").attr("class","nv-controlsWrap"),s?(h.width(F-B()),K.select(".nv-legendWrap").datum(j).call(h),"bottom"===t?(k.bottom=f.height()+h.height(),G=a.utils.availableHeight(n,z,k),K.select(".nv-legendWrap").attr("transform","translate("+B()+","+(G+f.height())+")")):"top"===t&&(l||h.height()===k.top||(k.top=h.height(),G=a.utils.availableHeight(n,z,k)),K.select(".nv-legendWrap").attr("transform","translate("+B()+","+-k.top+")"))):K.select(".nv-legendWrap").selectAll("*").remove(),p){var L=[{key:r.grouped||"Grouped",disabled:e.stacked()},{key:r.stacked||"Stacked",disabled:!e.stacked()}];i.width(B()).color(["#444","#444","#444"]),"bottom"===q?(k.bottom=f.height()+h.height(),G=a.utils.availableHeight(n,z,k),K.select(".nv-controlsWrap").datum(L).attr("transform","translate(0,"+(G+f.height())+")").call(i)):"top"===q&&K.select(".nv-controlsWrap").datum(L).attr("transform","translate(0,"+-k.top+")").call(i)}else K.select(".nv-controlsWrap").selectAll("*").remove();(I.attr("transform","translate("+k.left+","+k.top+")"),e.disabled(j.map(function(a){return a.disabled})).width(F).height(G).color(j.map(function(a,b){return a.color||o(a,b)}).filter(function(a,b){return!j[b].disabled})),K.select(".nv-barsWrap").datum(j.filter(function(a){return!a.disabled})).transition().call(e),u)&&(f.scale(c)._ticks(a.utils.calcTicksY(G/24,j)).tickSize(-F,0),K.select(".nv-x.nv-axis").call(f),K.select(".nv-x.nv-axis").selectAll("g").selectAll("line, text"));v&&(g.scale(d)._ticks(a.utils.calcTicksX(F/100,j)).tickSize(-G,0),K.select(".nv-y.nv-axis").attr("transform","translate(0,"+G+")"),K.select(".nv-y.nv-axis").call(g)),K.select(".nv-zeroLine line").attr("x1",d(0)).attr("x2",d(0)).attr("y1",0).attr("y2",-G),h.dispatch.on("stateChange",function(a){for(var c in a)x[c]=a[c];A.stateChange(x),b.update()}),i.dispatch.on("legendClick",function(a,c){if(a.disabled){switch(L=L.map(function(a){return a.disabled=!0,a}),a.disabled=!1,a.key){case"Grouped":case r.grouped:e.stacked(!1);break;case"Stacked":case r.stacked:e.stacked(!0)}x.stacked=e.stacked(),A.stateChange(x),w=e.stacked(),b.update()}}),A.on("changeState",function(a){void 0!==a.disabled&&(j.forEach(function(b,c){b.disabled=a.disabled[c]}),x.disabled=a.disabled),void 0!==a.stacked&&(e.stacked(a.stacked),x.stacked=a.stacked,w=a.stacked),b.update()})}),F.renderEnd("multibar horizontal chart immediate"),b}var c,d,e=a.models.multiBarHorizontal(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend().height(30),i=a.models.legend().height(30),j=a.models.tooltip(),k={top:30,right:20,bottom:50,left:60},l=null,m=null,n=null,o=a.utils.defaultColor(),p=!0,q="top",r={},s=!0,t="top",u=!0,v=!0,w=!1,x=a.utils.state(),y=null,z=null,A=d3.dispatch("stateChange","changeState","renderEnd"),B=function(){return p?180:0},C=250;x.stacked=!1,e.stacked(w),f.orient("left").tickPadding(5).showMaxMin(!1).tickFormat(function(a){return a}),g.orient("bottom").tickFormat(d3.format(",.1f")),j.duration(0).valueFormatter(function(a,b){return g.tickFormat()(a,b)}).headerFormatter(function(a,b){return f.tickFormat()(a,b)}),i.updateState(!1);var D=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),stacked:w}}},E=function(a){return function(b){void 0!==b.stacked&&(w=b.stacked),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},F=a.utils.renderWatch(A,C);return e.dispatch.on("elementMouseover.tooltip",function(a){a.value=b.x()(a.data),a.series={key:a.data.key,value:b.y()(a.data),color:a.color},j.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(a){j.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(a){j()}),b.dispatch=A,b.multibar=e,b.legend=h,b.controls=i,b.xAxis=f,b.yAxis=g,b.state=x,b.tooltip=j,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return m},set:function(a){m=a}},height:{get:function(){return n},set:function(a){n=a}},showLegend:{get:function(){return s},set:function(a){s=a}},legendPosition:{get:function(){return t},set:function(a){t=a}},controlsPosition:{get:function(){return q},set:function(a){q=a}},showControls:{get:function(){return p},set:function(a){p=a}},controlLabels:{get:function(){return r},set:function(a){r=a}},showXAxis:{get:function(){return u},set:function(a){u=a}},showYAxis:{get:function(){return v},set:function(a){v=a}},defaultState:{get:function(){return y},set:function(a){y=a}},noData:{get:function(){return z},set:function(a){z=a}},margin:{get:function(){return k},set:function(a){void 0!==a.top&&(k.top=a.top,l=a.top),k.right=void 0!==a.right?a.right:k.right,k.bottom=void 0!==a.bottom?a.bottom:k.bottom,k.left=void 0!==a.left?a.left:k.left}},duration:{get:function(){return C},set:function(a){C=a,F.reset(C),e.duration(C),f.duration(C),g.duration(C)}},color:{get:function(){return o},set:function(b){o=a.utils.getColor(b),h.color(o)}},barColor:{get:function(){return e.barColor},set:function(a){e.barColor(a),h.color(function(a,b){return d3.rgb("#ccc").darker(1.5*b).toString()})}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.multiChart=function(){"use strict";function b(k){return k.each(function(k){function o(a){return d3.transpose(a).map(function(a){return a.map(function(a){return a.y})}).map(function(a){return d3.sum(a)})}function s(a){var b=2===a.series.yAxis?G:F;a.value=a.point.x,a.series={value:a.point.y,color:a.point.color,key:a.series.key},I.duration(0).headerFormatter(function(a,b){return E.tickFormat()(a,b)}).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).hidden(!1)}function J(a){var b=2===a.series.yAxis?G:F;a.value=a.point.x,a.series={value:a.point.y,color:a.point.color,key:a.series.key},I.duration(100).headerFormatter(function(a,b){return E.tickFormat()(a,b)}).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).hidden(!1)}function L(a){var b=2===a.series.yAxis?G:F;a.point.x=C.x()(a.point),a.point.y=C.y()(a.point),I.duration(0).headerFormatter(function(a,b){return E.tickFormat()(a,b)}).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).hidden(!1)}function M(a){var b=2===a.series.yAxis?G:F;a.value=A.x()(a.data),a.series={value:A.y()(a.data),color:a.color,key:a.data.key},I.duration(0).headerFormatter(function(a,b){return E.tickFormat()(a,b)}).valueFormatter(function(a,c){return b.tickFormat()(a,c)}).data(a).hidden(!1)}function N(){for(var a=0,b=K.length;a<b;a++){var c=K[a];try{c.clearHighlights()}catch(d){}}}function O(a,b,c,d){var e={line:{yAxis1:{chart:w,data:S},yAxis2:{chart:x,data:T}},scatter:{yAxis1:{chart:y,data:U},yAxis2:{chart:z,data:V}},bar:{yAxis1:{chart:A,data:W},yAxis2:{chart:B,data:X}},area:{yAxis1:{chart:C,data:Y},yAxis2:{chart:D,data:Z}}},f=e[a.type]["yAxis"+a.yAxis].chart,g=e[a.type]["yAxis"+a.yAxis].data,h=g.reduce(function(b,c,d){return c.key===a.key?d:b},0);try{f.highlightPoint(h,b,c,d)}catch(i){}}var P=d3.select(this);a.utils.initSVG(P),b.update=function(){P.transition().call(b)},b.container=this;var Q=a.utils.availableWidth(h,P,e),R=a.utils.availableHeight(i,P,e),S=k.filter(function(a){return"line"==a.type&&1==a.yAxis}),T=k.filter(function(a){return"line"==a.type&&2==a.yAxis}),U=k.filter(function(a){return"scatter"==a.type&&1==a.yAxis}),V=k.filter(function(a){return"scatter"==a.type&&2==a.yAxis}),W=k.filter(function(a){return"bar"==a.type&&1==a.yAxis}),X=k.filter(function(a){return"bar"==a.type&&2==a.yAxis}),Y=k.filter(function(a){return"area"==a.type&&1==a.yAxis}),Z=k.filter(function(a){return"area"==a.type&&2==a.yAxis});if(!(k&&k.length&&k.filter(function(a){return a.values.length}).length))return a.utils.noData(b,P),b;P.selectAll(".nv-noData").remove();var $=k.filter(function(a){return!a.disabled&&1==a.yAxis}).map(function(a){return a.values.map(function(a,b){return{x:l(a),y:m(a)}})}),_=k.filter(function(a){return!a.disabled&&2==a.yAxis}).map(function(a){return a.values.map(function(a,b){return{x:l(a),y:m(a)}})});t.domain(d3.extent(d3.merge($.concat(_)),function(a){return a.x})).range([0,Q]);var aa=P.selectAll("g.wrap.multiChart").data([k]),ba=aa.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");ba.append("g").attr("class","nv-x nv-axis"),ba.append("g").attr("class","nv-y1 nv-axis"),ba.append("g").attr("class","nv-y2 nv-axis"),ba.append("g").attr("class","stack1Wrap"),ba.append("g").attr("class","stack2Wrap"),ba.append("g").attr("class","bars1Wrap"),ba.append("g").attr("class","bars2Wrap"),ba.append("g").attr("class","scatters1Wrap"),ba.append("g").attr("class","scatters2Wrap"),ba.append("g").attr("class","lines1Wrap"),ba.append("g").attr("class","lines2Wrap"),ba.append("g").attr("class","legendWrap"),ba.append("g").attr("class","nv-interactive");var ca=aa.select("g"),da=k.map(function(a,b){return k[b].color||g(a,b)});if(j){var ea=H.align()?Q/2:Q,fa=H.align()?ea:0;H.width(ea),H.color(da),ca.select(".legendWrap").datum(k.map(function(a){return a.originalKey=void 0===a.originalKey?a.key:a.originalKey,a.key=a.originalKey+(1==a.yAxis?"":r),a})).call(H),f||H.height()===e.top||(e.top=H.height(),R=a.utils.availableHeight(i,P,e)),ca.select(".legendWrap").attr("transform","translate("+fa+","+-e.top+")")}else ca.select(".legendWrap").selectAll("*").remove();w.width(Q).height(R).interpolate(n).color(da.filter(function(a,b){return!k[b].disabled&&1==k[b].yAxis&&"line"==k[b].type})),x.width(Q).height(R).interpolate(n).color(da.filter(function(a,b){return!k[b].disabled&&2==k[b].yAxis&&"line"==k[b].type})),y.width(Q).height(R).color(da.filter(function(a,b){return!k[b].disabled&&1==k[b].yAxis&&"scatter"==k[b].type})),z.width(Q).height(R).color(da.filter(function(a,b){return!k[b].disabled&&2==k[b].yAxis&&"scatter"==k[b].type})),A.width(Q).height(R).color(da.filter(function(a,b){return!k[b].disabled&&1==k[b].yAxis&&"bar"==k[b].type})),B.width(Q).height(R).color(da.filter(function(a,b){return!k[b].disabled&&2==k[b].yAxis&&"bar"==k[b].type})),C.width(Q).height(R).interpolate(n).color(da.filter(function(a,b){return!k[b].disabled&&1==k[b].yAxis&&"area"==k[b].type})),D.width(Q).height(R).interpolate(n).color(da.filter(function(a,b){return!k[b].disabled&&2==k[b].yAxis&&"area"==k[b].type})),ca.attr("transform","translate("+e.left+","+e.top+")");var ga=ca.select(".lines1Wrap").datum(S.filter(function(a){return!a.disabled})),ha=ca.select(".scatters1Wrap").datum(U.filter(function(a){return!a.disabled})),ia=ca.select(".bars1Wrap").datum(W.filter(function(a){return!a.disabled})),ja=ca.select(".stack1Wrap").datum(Y.filter(function(a){return!a.disabled})),ka=ca.select(".lines2Wrap").datum(T.filter(function(a){return!a.disabled})),la=ca.select(".scatters2Wrap").datum(V.filter(function(a){return!a.disabled})),ma=ca.select(".bars2Wrap").datum(X.filter(function(a){return!a.disabled})),na=ca.select(".stack2Wrap").datum(Z.filter(function(a){return!a.disabled})),oa=[];if(A.stacked()&&W.length){var oa=W.filter(function(a){return!a.disabled}).map(function(a){return a.values});oa.length>0&&(oa=oa.reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}))}W.length&&oa.push({x:0,y:0});var pa=[];if(B.stacked()&&X.length){var pa=X.filter(function(a){return!a.disabled}).map(function(a){return a.values});pa.length>0&&(pa=pa.reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}))}if(X.length&&pa.push({x:0,y:0}),u.domain(c||d3.extent(d3.merge($).concat(oa),function(a){return a.y})).range([0,R]),v.domain(d||d3.extent(d3.merge(_).concat(pa),function(a){return a.y})).range([0,R]),w.yDomain(u.domain()),y.yDomain(u.domain()),A.stacked()){var qa=u.domain([0,d3.max(o($))]).range([0,R]);A.yDomain(qa.domain())}else A.yDomain(u.domain());if(C.yDomain(u.domain()),x.yDomain(v.domain()),z.yDomain(v.domain()),B.stacked()){var ra=v.domain([0,d3.max(o(_))]).range([0,R]);B.yDomain(ra.domain())}else B.yDomain(v.domain());D.yDomain(v.domain()),Y.length&&d3.transition(ja).call(C),Z.length&&d3.transition(na).call(D),W.length&&d3.transition(ia).call(A),X.length&&d3.transition(ma).call(B),S.length&&d3.transition(ga).call(w),T.length&&d3.transition(ka).call(x),U.length&&d3.transition(ha).call(y),V.length&&d3.transition(la).call(z),E._ticks(a.utils.calcTicksX(Q/100,k)).tickSize(-R,0),ca.select(".nv-x.nv-axis").attr("transform","translate(0,"+R+")"),d3.transition(ca.select(".nv-x.nv-axis")).call(E),F._ticks(a.utils.calcTicksY(R/36,k)).tickSize(-Q,0),d3.transition(ca.select(".nv-y1.nv-axis")).call(F),G._ticks(a.utils.calcTicksY(R/36,k)).tickSize(-Q,0),d3.transition(ca.select(".nv-y2.nv-axis")).call(G),ca.select(".nv-y1.nv-axis").classed("nv-disabled",!$.length).attr("transform","translate("+t.range()[0]+",0)"),ca.select(".nv-y2.nv-axis").classed("nv-disabled",!_.length).attr("transform","translate("+t.range()[1]+",0)"),H.dispatch.on("stateChange",function(a){b.update()}),q&&(p.width(Q).height(R).margin({left:e.left,top:e.top}).svgContainer(P).xScale(t),aa.select(".nv-interactive").call(p)),q?(p.dispatch.on("elementMousemove",function(c){N();var d,e,f,h=[];k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(i,j){var k=t.domain(),l=i.values.filter(function(a,c){return b.x()(a,c)>=k[0]&&b.x()(a,c)<=k[1]});e=a.interactiveBisect(l,c.pointXValue,b.x());var m=l[e],n=b.y()(m,e);null===n||isNaN(n)||i.noHighlightSeries||O(i,e,!0),void 0!==m&&(void 0===d&&(d=m),void 0===f&&(f=t(b.x()(m,e))),h.push({key:i.key,value:n,color:g(i,i.seriesIndex),data:m,yAxis:2==i.yAxis?G:F}))});var i=function(a,b){var c=h[b].yAxis;return null==a?"N/A":c.tickFormat()(a)};p.tooltip.headerFormatter(function(a,b){return E.tickFormat()(a,b)}).valueFormatter(p.tooltip.valueFormatter()||i).data({value:b.x()(d,e),index:e,series:h})(),p.renderGuideLine(f)}),p.dispatch.on("elementMouseout",function(a){N()})):(w.dispatch.on("elementMouseover.tooltip",s),x.dispatch.on("elementMouseover.tooltip",s),w.dispatch.on("elementMouseout.tooltip",function(a){I.hidden(!0)}),x.dispatch.on("elementMouseout.tooltip",function(a){I.hidden(!0)}),y.dispatch.on("elementMouseover.tooltip",J),z.dispatch.on("elementMouseover.tooltip",J),y.dispatch.on("elementMouseout.tooltip",function(a){I.hidden(!0)}),z.dispatch.on("elementMouseout.tooltip",function(a){I.hidden(!0)}),C.dispatch.on("elementMouseover.tooltip",L),D.dispatch.on("elementMouseover.tooltip",L),C.dispatch.on("elementMouseout.tooltip",function(a){I.hidden(!0)}),D.dispatch.on("elementMouseout.tooltip",function(a){I.hidden(!0)}),A.dispatch.on("elementMouseover.tooltip",M),B.dispatch.on("elementMouseover.tooltip",M),A.dispatch.on("elementMouseout.tooltip",function(a){I.hidden(!0)}),B.dispatch.on("elementMouseout.tooltip",function(a){I.hidden(!0)}),A.dispatch.on("elementMousemove.tooltip",function(a){I()}),B.dispatch.on("elementMousemove.tooltip",function(a){I()}))}),b}var c,d,e={top:30,right:20,bottom:50,left:60},f=null,g=a.utils.defaultColor(),h=null,i=null,j=!0,k=null,l=function(a){return a.x},m=function(a){return a.y},n="linear",o=!0,p=a.interactiveGuideline(),q=!1,r=" (right axis)",s=250,t=d3.scale.linear(),u=d3.scale.linear(),v=d3.scale.linear(),w=a.models.line().yScale(u).duration(s),x=a.models.line().yScale(v).duration(s),y=a.models.scatter().yScale(u).duration(s),z=a.models.scatter().yScale(v).duration(s),A=a.models.multiBar().stacked(!1).yScale(u).duration(s),B=a.models.multiBar().stacked(!1).yScale(v).duration(s),C=a.models.stackedArea().yScale(u).duration(s),D=a.models.stackedArea().yScale(v).duration(s),E=a.models.axis().scale(t).orient("bottom").tickPadding(5).duration(s),F=a.models.axis().scale(u).orient("left").duration(s),G=a.models.axis().scale(v).orient("right").duration(s),H=a.models.legend().height(30),I=a.models.tooltip(),J=d3.dispatch(),K=[w,x,y,z,A,B,C,D];return b.dispatch=J,b.legend=H,b.lines1=w,b.lines2=x,b.scatters1=y,b.scatters2=z,b.bars1=A,b.bars2=B,b.stack1=C,b.stack2=D,b.xAxis=E,b.yAxis1=F,b.yAxis2=G,b.tooltip=I,b.interactiveLayer=p,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},showLegend:{get:function(){return j},set:function(a){j=a}},xScale:{get:function(){return t},set:function(a){t=a,E.scale(t)}},yDomain1:{get:function(){return c},set:function(a){c=a}},yDomain2:{get:function(){return d},set:function(a){d=a}},noData:{get:function(){return k},set:function(a){k=a}},interpolate:{get:function(){return n},set:function(a){n=a}},legendRightAxisHint:{get:function(){return r},set:function(a){r=a}},margin:{get:function(){return e},set:function(a){void 0!==a.top&&(e.top=a.top,f=a.top),e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},color:{get:function(){return g},set:function(b){g=a.utils.getColor(b)}},x:{get:function(){return l},set:function(a){l=a,w.x(a),x.x(a),y.x(a),z.x(a),A.x(a),B.x(a),C.x(a),D.x(a)}},y:{get:function(){return m},set:function(a){m=a,w.y(a),x.y(a),y.y(a),z.y(a),C.y(a),D.y(a),A.y(a),B.y(a)}},useVoronoi:{get:function(){return o},set:function(a){o=a,w.useVoronoi(a),x.useVoronoi(a),C.useVoronoi(a),D.useVoronoi(a)}},useInteractiveGuideline:{get:function(){return q},set:function(a){(q=a)&&(w.interactive(!1),w.useVoronoi(!1),x.interactive(!1),x.useVoronoi(!1),C.interactive(!1),C.useVoronoi(!1),D.interactive(!1),D.useVoronoi(!1),y.interactive(!1),z.interactive(!1))}},duration:{get:function(){return s},set:function(a){s=a,[w,x,C,D,y,z,E,F,G].forEach(function(a){a.duration(s)})}}}),a.utils.initOptions(b),b},a.models.ohlcBar=function(){"use strict";function b(y){return y.each(function(b){k=d3.select(this);var y=a.utils.availableWidth(h,k,g),A=a.utils.availableHeight(i,k,g);a.utils.initSVG(k);var B=y/b[0].values.length*.9;l.domain(c||d3.extent(b[0].values.map(n).concat(t))),v?l.range(e||[.5*y/b[0].values.length,y*(b[0].values.length-.5)/b[0].values.length]):l.range(e||[5+B/2,y-B/2-5]),m.domain(d||[d3.min(b[0].values.map(s).concat(u)),d3.max(b[0].values.map(r).concat(u))]).range(f||[A,0]),l.domain()[0]===l.domain()[1]&&(l.domain()[0]?l.domain([l.domain()[0]-.01*l.domain()[0],l.domain()[1]+.01*l.domain()[1]]):l.domain([-1,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]));var C=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([b[0].values]),D=C.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),E=D.append("defs"),F=D.append("g"),G=C.select("g");F.append("g").attr("class","nv-ticks"),C.attr("transform","translate("+g.left+","+g.top+")"),k.on("click",function(a,b){z.chartClick({data:a,index:b,pos:d3.event,id:j})}),E.append("clipPath").attr("id","nv-chart-clip-path-"+j).append("rect"),C.select("#nv-chart-clip-path-"+j+" rect").attr("width",y).attr("height",A),G.attr("clip-path",w?"url(#nv-chart-clip-path-"+j+")":"");var H=C.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});H.exit().remove(),H.enter().append("path").attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}).attr("d",function(a,b){return"m0,0l0,"+(m(p(a,b))-m(r(a,b)))+"l"+-B/2+",0l"+B/2+",0l0,"+(m(s(a,b))-m(p(a,b)))+"l0,"+(m(q(a,b))-m(s(a,b)))+"l"+B/2+",0l"+-B/2+",0z"}).attr("transform",function(a,b){return"translate("+l(n(a,b))+","+m(r(a,b))+")"}).attr("fill",function(a,b){return x[0]}).attr("stroke",function(a,b){return x[0]}).attr("x",0).attr("y",function(a,b){return m(Math.max(0,o(a,b)))}).attr("height",function(a,b){return Math.abs(m(o(a,b))-m(0))}),H.attr("class",function(a,b,c){return(p(a,b)>q(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}),d3.transition(H).attr("transform",function(a,b){return"translate("+l(n(a,b))+","+m(r(a,b))+")"}).attr("d",function(a,c){var d=y/b[0].values.length*.9;return"m0,0l0,"+(m(p(a,c))-m(r(a,c)))+"l"+-d/2+",0l"+d/2+",0l0,"+(m(s(a,c))-m(p(a,c)))+"l0,"+(m(q(a,c))-m(s(a,c)))+"l"+d/2+",0l"+-d/2+",0z"})}),b}var c,d,e,f,g={top:0,right:0,bottom:0,left:0},h=null,i=null,j=Math.floor(1e4*Math.random()),k=null,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=function(a){return a.open},q=function(a){return a.close},r=function(a){return a.high},s=function(a){return a.low},t=[],u=[],v=!1,w=!0,x=a.utils.defaultColor(),y=!1,z=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");return b.highlightPoint=function(a,c){b.clearHighlights(),k.select(".nv-ohlcBar .nv-tick-0-"+a).classed("hover",c)},b.clearHighlights=function(){k.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},forceX:{get:function(){return t},set:function(a){t=a}},forceY:{get:function(){return u},set:function(a){u=a}},padData:{get:function(){return v},set:function(a){v=a}},clipEdge:{get:function(){return w},set:function(a){w=a}},id:{get:function(){return j},set:function(a){j=a}},interactive:{get:function(){return y},set:function(a){y=a}},x:{get:function(){return n},set:function(a){n=a}},y:{get:function(){return o},set:function(a){o=a}},open:{get:function(){return p()},set:function(a){p=a}},close:{get:function(){return q()},set:function(a){q=a}},high:{get:function(){return r},set:function(a){r=a}},low:{get:function(){return s},set:function(a){s=a}},margin:{get:function(){return g},set:function(a){g.top=void 0!=a.top?a.top:g.top,g.right=void 0!=a.right?a.right:g.right,g.bottom=void 0!=a.bottom?a.bottom:g.bottom,g.left=void 0!=a.left?a.left:g.left}},color:{get:function(){return x},set:function(b){x=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.parallelCoordinates=function(){"use strict";function b(B){return A.reset(),B.each(function(b){function A(a){return x(o.map(function(b){if(isNaN(a.values[b.key])||isNaN(parseFloat(a.values[b.key]))||O){var c=l[b.key].domain(),d=l[b.key].range(),e=c[0]-(c[1]-c[0])/9;if(v.indexOf(b.key)<0){var f=d3.scale.linear().domain([e,c[1]]).range([j-12,d[1]]);l[b.key].brush.y(f),v.push(b.key)}if(isNaN(a.values[b.key])||isNaN(parseFloat(a.values[b.key])))return[k(b.key),l[b.key](e)]}return void 0!==U&&(v.length>0||O?(U.style("display","inline"),V.style("display","inline")):(U.style("display","none"),V.style("display","none"))),[k(b.key),l[b.key](a.values[b.key])]}))}function B(a){s.forEach(function(b){var c=l[b.dimension].brush.y().domain();b.hasOnlyNaN&&(b.extent[1]=(l[b.dimension].domain()[1]-c[0])*(b.extent[1]-b.extent[0])/(N[b.dimension]-b.extent[0])+c[0]),b.hasNaN&&(b.extent[0]=c[0]),a&&l[b.dimension].brush.extent(b.extent)}),e.select(".nv-brushBackground").each(function(a){d3.select(this).call(l[a.key].brush)}).selectAll("rect").attr("x",-8).attr("width",16),F()}function C(){!1===q&&(q=!0,B(!0))}function D(){$=p.filter(function(a){return!l[a].brush.empty()}),_=$.map(function(a){return l[a].brush.extent()}),s=[],$.forEach(function(a,b){s[b]={dimension:a,extent:_[b],hasNaN:!1,hasOnlyNaN:!1}}),t=[],c.style("display",function(a){var b=$.every(function(b,c){return!(!isNaN(a.values[b])&&!isNaN(parseFloat(a.values[b]))||_[c][0]!=l[b].brush.y().domain()[0])||_[c][0]<=a.values[b]&&a.values[b]<=_[c][1]&&!isNaN(parseFloat(a.values[b]))});return b&&t.push(a),b?null:"none"}),F(),z.brush({filters:s,active:t})}function E(){var a=$.length>0;s.forEach(function(a){a.extent[0]===l[a.dimension].brush.y().domain()[0]&&v.indexOf(a.dimension)>=0&&(a.hasNaN=!0),a.extent[1]<l[a.dimension].domain()[0]&&(a.hasOnlyNaN=!0)}),z.brushEnd(t,a)}function F(){e.select(".nv-axis").each(function(a,b){var c=s.filter(function(b){return b.dimension==a.key});P[a.key]=l[a.key].domain(),0!=c.length&&q&&(P[a.key]=[],c[0].extent[1]>l[a.key].domain()[0]&&(P[a.key]=[c[0].extent[1]]),c[0].extent[0]>=l[a.key].domain()[0]&&P[a.key].push(c[0].extent[0])),d3.select(this).call(y.scale(l[a.key]).tickFormat(a.format).tickValues(P[a.key]))})}function G(a){u[a.key]=this.parentNode.__origin__=k(a.key),d.attr("visibility","hidden")}function H(a){u[a.key]=Math.min(i,Math.max(0,this.parentNode.__origin__+=d3.event.x)),c.attr("d",A),o.sort(function(a,b){return J(a.key)-J(b.key)}),o.forEach(function(a,b){return a.currentPosition=b}),k.domain(o.map(function(a){return a.key})),e.attr("transform",function(a){return"translate("+J(a.key)+")"})}function I(a,b){delete this.parentNode.__origin__,delete u[a.key],d3.select(this.parentNode).attr("transform","translate("+k(a.key)+")"),c.attr("d",A),d.attr("d",A).attr("visibility",null),z.dimensionsOrder(o)}function J(a){var b=u[a];return null==b?k(a):b}var K=d3.select(this);if(i=a.utils.availableWidth(g,K,f),j=a.utils.availableHeight(h,K,f),a.utils.initSVG(K),void 0===b[0].values){var L=[];b.forEach(function(a){var b={};Object.keys(a).forEach(function(c){"name"!==c&&(b[c]=a[c])}),L.push({key:a.name,values:b})}),b=L}var M=b.map(function(a){return a.values});0===t.length&&(t=b),p=n.sort(function(a,b){return a.currentPosition-b.currentPosition}).map(function(a){return a.key}),o=n.filter(function(a){return!a.disabled}),k.rangePoints([0,i],1).domain(o.map(function(a){return a.key}));var N={},O=!1,P=[];p.forEach(function(a){var b=d3.extent(M,function(b){return+b[a]}),c=b[0],d=b[1],e=!1;(isNaN(c)||isNaN(d))&&(e=!0,c=0,d=0),c===d&&(c-=1,d+=1);var f=s.filter(function(b){return b.dimension==a});0!==f.length&&(e?(c=l[a].domain()[0],d=l[a].domain()[1]):!f[0].hasOnlyNaN&&q?(c=c>f[0].extent[0]?f[0].extent[0]:c,d=d<f[0].extent[1]?f[0].extent[1]:d):f[0].hasNaN&&(d=d<f[0].extent[1]?f[0].extent[1]:d,N[a]=l[a].domain()[1],O=!0)),l[a]=d3.scale.linear().domain([c,d]).range([.9*(j-12),0]),v=[],l[a].brush=d3.svg.brush().y(l[a]).on("brushstart",C).on("brush",D).on("brushend",E)});var Q=K.selectAll("g.nv-wrap.nv-parallelCoordinates").data([b]),R=Q.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates"),S=R.append("g"),T=Q.select("g");S.append("g").attr("class","nv-parallelCoordinates background"),S.append("g").attr("class","nv-parallelCoordinates foreground"),S.append("g").attr("class","nv-parallelCoordinates missingValuesline"),Q.attr("transform","translate("+f.left+","+f.top+")"),x.interpolate("cardinal").tension(w),y.orient("left");var U,V,W=d3.behavior.drag().on("dragstart",G).on("drag",H).on("dragend",I),X=k.range()[1]-k.range()[0];if(X=isNaN(X)?k.range()[0]:X,!isNaN(X)){var Y=[0+X/2,j-12,i-X/2,j-12];U=Q.select(".missingValuesline").selectAll("line").data([Y]),U.enter().append("line"),U.exit().remove(),U.attr("x1",function(a){return a[0]}).attr("y1",function(a){return a[1]}).attr("x2",function(a){return a[2]}).attr("y2",function(a){return a[3]}),V=Q.select(".missingValuesline").selectAll("text").data([m]),V.append("text").data([m]),V.enter().append("text"),V.exit().remove(),V.attr("y",j).attr("x",i-92-X/2).text(function(a){return a})}d=Q.select(".background").selectAll("path").data(b),d.enter().append("path"),d.exit().remove(),d.attr("d",A),c=Q.select(".foreground").selectAll("path").data(b),c.enter().append("path"),c.exit().remove(),c.attr("d",A).style("stroke-width",function(a,b){return isNaN(a.strokeWidth)&&(a.strokeWidth=1),a.strokeWidth}).attr("stroke",function(a,b){return a.color||r(a,b)}),c.on("mouseover",function(a,b){d3.select(this).classed("hover",!0).style("stroke-width",a.strokeWidth+2+"px").style("stroke-opacity",1),z.elementMouseover({label:a.name,color:a.color||r(a,b),values:a.values,dimensions:o})}),c.on("mouseout",function(a,b){d3.select(this).classed("hover",!1).style("stroke-width",a.strokeWidth+"px").style("stroke-opacity",.7),z.elementMouseout({label:a.name,index:b})}),c.on("mousemove",function(a,b){z.elementMousemove()}),c.on("click",function(a){z.elementClick({id:a.id})}),e=T.selectAll(".dimension").data(o);var Z=e.enter().append("g").attr("class","nv-parallelCoordinates dimension");e.attr("transform",function(a){return"translate("+k(a.key)+",0)"}),Z.append("g").attr("class","nv-axis"),Z.append("text").attr("class","nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").on("mouseover",function(a,b){z.elementMouseover({label:a.tooltip||a.key,color:a.color})}).on("mouseout",function(a,b){z.elementMouseout({label:a.tooltip})}).on("mousemove",function(a,b){z.elementMousemove()}).call(W),Z.append("g").attr("class","nv-brushBackground"),e.exit().remove(),e.select(".nv-label").text(function(a){return a.key}),B(q);var $=p.filter(function(a){return!l[a].brush.empty()}),_=$.map(function(a){return l[a].brush.extent()}),aa=t.slice(0);t=[],c.style("display",function(a){var b=$.every(function(b,c){return!(!isNaN(a.values[b])&&!isNaN(parseFloat(a.values[b]))||_[c][0]!=l[b].brush.y().domain()[0])||_[c][0]<=a.values[b]&&a.values[b]<=_[c][1]&&!isNaN(parseFloat(a.values[b]))});return b&&t.push(a),b?null:"none"}),(s.length>0||!a.utils.arrayEquals(t,aa))&&z.activeChanged(t)}),b}var c,d,e,f={top:30,right:0,bottom:10,left:0
|
|
10
|
+
},g=null,h=null,i=null,j=null,k=d3.scale.ordinal(),l={},m="undefined values",n=[],o=[],p=[],q=!0,r=a.utils.defaultColor(),s=[],t=[],u=[],v=[],w=1,x=d3.svg.line(),y=d3.svg.axis(),z=d3.dispatch("brushstart","brush","brushEnd","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),A=a.utils.renderWatch(z);return b.dispatch=z,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},dimensionData:{get:function(){return n},set:function(a){n=a}},displayBrush:{get:function(){return q},set:function(a){q=a}},filters:{get:function(){return s},set:function(a){s=a}},active:{get:function(){return t},set:function(a){t=a}},lineTension:{get:function(){return w},set:function(a){w=a}},undefinedValuesLabel:{get:function(){return m},set:function(a){m=a}},dimensions:{get:function(){return n.map(function(a){return a.key})},set:function(b){a.deprecated("dimensions","use dimensionData instead"),0===n.length?b.forEach(function(a){n.push({key:a})}):b.forEach(function(a,b){n[b].key=a})}},dimensionNames:{get:function(){return n.map(function(a){return a.key})},set:function(b){a.deprecated("dimensionNames","use dimensionData instead"),p=[],0===n.length?b.forEach(function(a){n.push({key:a})}):b.forEach(function(a,b){n[b].key=a})}},dimensionFormats:{get:function(){return n.map(function(a){return a.format})},set:function(b){a.deprecated("dimensionFormats","use dimensionData instead"),0===n.length?b.forEach(function(a){n.push({format:a})}):b.forEach(function(a,b){n[b].format=a})}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}},color:{get:function(){return r},set:function(b){r=a.utils.getColor(b)}}}),a.utils.initOptions(b),b},a.models.parallelCoordinatesChart=function(){"use strict";function b(e){return s.reset(),s.models(c),e.each(function(e){var k=d3.select(this);a.utils.initSVG(k);var p=a.utils.availableWidth(h,k,f),q=a.utils.availableHeight(i,k,f);if(b.update=function(){k.call(b)},b.container=this,l.setter(u(m),b.update).getter(t(m)).update(),l.disabled=m.map(function(a){return!!a.disabled}),m=m.map(function(a){return a.disabled=!!a.disabled,a}),m.forEach(function(a,b){a.originalPosition=isNaN(a.originalPosition)?b:a.originalPosition,a.currentPosition=isNaN(a.currentPosition)?b:a.currentPosition}),!o){var s;o={};for(s in l)l[s]instanceof Array?o[s]=l[s].slice(0):o[s]=l[s]}if(!e||!e.length)return a.utils.noData(b,k),b;k.selectAll(".nv-noData").remove();var v=k.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([e]),w=v.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart").append("g"),x=v.select("g");w.append("g").attr("class","nv-parallelCoordinatesWrap"),w.append("g").attr("class","nv-legendWrap"),x.select("rect").attr("width",p).attr("height",q>0?q:0),j?(d.width(p).color(function(a){return"rgb(188,190,192)"}),x.select(".nv-legendWrap").datum(m.sort(function(a,b){return a.originalPosition-b.originalPosition})).call(d),g||d.height()===f.top||(f.top=d.height(),q=a.utils.availableHeight(i,k,f)),v.select(".nv-legendWrap").attr("transform","translate( 0 ,"+-f.top+")")):x.select(".nv-legendWrap").selectAll("*").remove(),v.attr("transform","translate("+f.left+","+f.top+")"),c.width(p).height(q).dimensionData(m).displayBrush(n),x.select(".nv-parallelCoordinatesWrap ").datum(e).transition().call(c),c.dispatch.on("brushEnd",function(a,b){b?(n=!0,r.brushEnd(a)):n=!1}),d.dispatch.on("stateChange",function(a){for(var c in a)l[c]=a[c];r.stateChange(l),b.update()}),c.dispatch.on("dimensionsOrder",function(a){m.sort(function(a,b){return a.currentPosition-b.currentPosition});var b=!1;m.forEach(function(a,c){a.currentPosition=c,a.currentPosition!==a.originalPosition&&(b=!0)}),r.dimensionsOrder(m,b)}),r.on("changeState",function(a){void 0!==a.disabled&&(m.forEach(function(b,c){b.disabled=a.disabled[c]}),l.disabled=a.disabled),b.update()})}),s.renderEnd("parraleleCoordinateChart immediate"),b}var c=a.models.parallelCoordinates(),d=a.models.legend(),e=a.models.tooltip(),f=(a.models.tooltip(),{top:0,right:0,bottom:0,left:0}),g=null,h=null,i=null,j=!0,k=a.utils.defaultColor(),l=a.utils.state(),m=[],n=!0,o=null,p=null,q="undefined",r=d3.dispatch("dimensionsOrder","brushEnd","stateChange","changeState","renderEnd"),s=a.utils.renderWatch(r),t=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},u=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return e.contentGenerator(function(a){var b='<table><thead><tr><td class="legend-color-guide"><div style="background-color:'+a.color+'"></div></td><td><strong>'+a.key+"</strong></td></tr></thead>";return 0!==a.series.length&&(b+='<tbody><tr><td height ="10px"></td></tr>',a.series.forEach(function(a){b=b+'<tr><td class="legend-color-guide"><div style="background-color:'+a.color+'"></div></td><td class="key">'+a.key+'</td><td class="value">'+a.value+"</td></tr>"}),b+="</tbody>"),b+="</table>"}),c.dispatch.on("elementMouseover.tooltip",function(a){var b={key:a.label,color:a.color,series:[]};a.values&&(Object.keys(a.values).forEach(function(c){var d=a.dimensions.filter(function(a){return a.key===c})[0];if(d){var e;e=isNaN(a.values[c])||isNaN(parseFloat(a.values[c]))?q:d.format(a.values[c]),b.series.push({idx:d.currentPosition,key:c,value:e,color:d.color})}}),b.series.sort(function(a,b){return a.idx-b.idx})),e.data(b).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(a){e.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(){e()}),b.dispatch=r,b.parallelCoordinates=c,b.legend=d,b.tooltip=e,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},showLegend:{get:function(){return j},set:function(a){j=a}},defaultState:{get:function(){return o},set:function(a){o=a}},dimensionData:{get:function(){return m},set:function(a){m=a}},displayBrush:{get:function(){return n},set:function(a){n=a}},noData:{get:function(){return p},set:function(a){p=a}},nanValue:{get:function(){return q},set:function(a){q=a}},margin:{get:function(){return f},set:function(a){void 0!==a.top&&(f.top=a.top,g=a.top),f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}},color:{get:function(){return k},set:function(b){k=a.utils.getColor(b),d.color(k),c.color(k)}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.pie=function(){"use strict";function b(G){return F.reset(),G.each(function(b){function G(a,b){a.endAngle=isNaN(a.endAngle)?0:a.endAngle,a.startAngle=isNaN(a.startAngle)?0:a.startAngle,q||(a.innerRadius=0);var c=d3.interpolate(this._current,a);return this._current=c(0),function(a){return D[b](c(a))}}var H=d-c.left-c.right,I=e-c.top-c.bottom,J=Math.min(H,I)/2,K=[],L=[];if(i=d3.select(this),0===B.length)for(var M=J-J/10,N=z*J,O=0;O<b[0].length;O++)K.push(M),L.push(N);else s?(K=B.map(function(a){return(a.outer-a.outer/10)*J}),L=B.map(function(a){return(a.inner-a.inner/10)*J}),z=d3.min(B.map(function(a){return a.inner-a.inner/10}))):(K=B.map(function(a){return a.outer*J}),L=B.map(function(a){return a.inner*J}),z=d3.min(B.map(function(a){return a.inner})));a.utils.initSVG(i);var P=i.selectAll(".nv-wrap.nv-pie").data(b),Q=P.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+h),R=Q.append("g"),S=P.select("g"),T=R.append("g").attr("class","nv-pie");R.append("g").attr("class","nv-pieLabels"),P.attr("transform","translate("+c.left+","+c.top+")"),S.select(".nv-pie").attr("transform","translate("+H/2+","+I/2+")"),S.select(".nv-pieLabels").attr("transform","translate("+H/2+","+I/2+")"),i.on("click",function(a,b){C.chartClick({data:a,index:b,pos:d3.event,id:h})}),D=[],E=[];for(var O=0;O<b[0].length;O++){var U=d3.svg.arc().outerRadius(K[O]),V=d3.svg.arc().outerRadius(K[O]+5);!1!==v&&(U.startAngle(v),V.startAngle(v)),!1!==x&&(U.endAngle(x),V.endAngle(x)),q&&(U.innerRadius(L[O]),V.innerRadius(L[O])),U.cornerRadius&&y&&(U.cornerRadius(y),V.cornerRadius(y)),D.push(U),E.push(V)}var W=d3.layout.pie().sort(null).value(function(a){return a.disabled?0:g(a)});W.padAngle&&w&&W.padAngle(w),q&&r&&(T.append("text").attr("class","nv-pie-title"),P.select(".nv-pie-title").style("text-anchor","middle").text(function(a){return r}).style("font-size",Math.min(H,I)*z*2/(r.length+2)+"px").attr("dy","0.35em").attr("transform",function(a,b){return"translate(0, "+t+")"}));var X=P.select(".nv-pie").selectAll(".nv-slice").data(W),Y=P.select(".nv-pieLabels").selectAll(".nv-label").data(W);X.exit().remove(),Y.exit().remove();var Z=X.enter().append("g");Z.attr("class","nv-slice"),Z.on("mouseover",function(a,b){d3.select(this).classed("hover",!0),s&&d3.select(this).select("path").transition().duration(70).attr("d",E[b]),C.elementMouseover({data:a.data,index:b,color:d3.select(this).style("fill"),percent:(a.endAngle-a.startAngle)/(2*Math.PI)})}),Z.on("mouseout",function(a,b){d3.select(this).classed("hover",!1),s&&d3.select(this).select("path").transition().duration(50).attr("d",D[b]),C.elementMouseout({data:a.data,index:b})}),Z.on("mousemove",function(a,b){C.elementMousemove({data:a.data,index:b})}),Z.on("click",function(a,b){var c=this;C.elementClick({data:a.data,index:b,color:d3.select(this).style("fill"),event:d3.event,element:c})}),Z.on("dblclick",function(a,b){C.elementDblClick({data:a.data,index:b,color:d3.select(this).style("fill")})}),X.attr("fill",function(a,b){return j(a.data,b)}),X.attr("stroke",function(a,b){return j(a.data,b)});Z.append("path").each(function(a){this._current=a});if(X.select("path").transition().duration(A).attr("d",function(a,b){return D[b](a)}).attrTween("d",G),l){for(var $=[],O=0;O<b[0].length;O++)$.push(D[O]),m?q&&($[O]=d3.svg.arc().outerRadius(D[O].outerRadius()),!1!==v&&$[O].startAngle(v),!1!==x&&$[O].endAngle(x)):q||$[O].innerRadius(0);Y.enter().append("g").classed("nv-label",!0).each(function(a,b){var c=d3.select(this);c.attr("transform",function(a,b){if(u){a.outerRadius=K[b]+10,a.innerRadius=K[b]+15;var c=(a.startAngle+a.endAngle)/2*(180/Math.PI);return(a.startAngle+a.endAngle)/2<Math.PI?c-=90:c+=90,"translate("+$[b].centroid(a)+") rotate("+c+")"}return a.outerRadius=J+10,a.innerRadius=J+15,"translate("+$[b].centroid(a)+")"}),c.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),c.append("text").style("text-anchor",u?(a.startAngle+a.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")});var _={},aa=14,ba=140,ca=function(a){return Math.floor(a[0]/ba)*ba+","+Math.floor(a[1]/aa)*aa},da=function(a){return(a.endAngle-a.startAngle)/(2*Math.PI)};Y.watchTransition(F,"pie labels").attr("transform",function(a,b){if(u){a.outerRadius=K[b]+10,a.innerRadius=K[b]+15;var c=(a.startAngle+a.endAngle)/2*(180/Math.PI);return(a.startAngle+a.endAngle)/2<Math.PI?c-=90:c+=90,"translate("+$[b].centroid(a)+") rotate("+c+")"}a.outerRadius=J+10,a.innerRadius=J+15;var d=$[b].centroid(a),e=da(a);if(a.value&&e>=o){var f=ca(d);_[f]&&(d[1]-=aa),_[ca(d)]=!0}return"translate("+d+")"}),Y.select(".nv-label text").style("text-anchor",function(a,b){return u?(a.startAngle+a.endAngle)/2<Math.PI?"start":"end":"middle"}).text(function(a,b){var c=da(a),d="";if(!a.value||c<o)return"";if("function"==typeof n)d=n(a,b,{key:f(a.data),value:g(a.data),percent:k(c)});else switch(n){case"key":d=f(a.data);break;case"value":d=k(g(a.data));break;case"percent":d=d3.format("%")(c)}return d}),p&&Y.each(function(b,c){if(this.getBBox){var d=this.getBBox(),e=$[c].centroid(b),f={x:e[0]+d.x,y:e[1]+d.y},g={x:f.x+d.width,y:f.y},h={x:f.x,y:f.y+d.height},i={x:f.x+d.width,y:f.y+d.height};b.visible=a.utils.pointIsInArc(f,b,U)&&a.utils.pointIsInArc(g,b,U)&&a.utils.pointIsInArc(h,b,U)&&a.utils.pointIsInArc(i,b,U)}}).style("display",function(a){return a.visible?null:"none"})}}),F.renderEnd("pie immediate"),b}var c={top:0,right:0,bottom:0,left:0},d=500,e=500,f=function(a){return a.x},g=function(a){return a.y},h=Math.floor(1e4*Math.random()),i=null,j=a.utils.defaultColor(),k=d3.format(",.2f"),l=!0,m=!1,n="key",o=.02,p=!1,q=!1,r=!1,s=!0,t=0,u=!1,v=!1,w=!1,x=!1,y=0,z=.5,A=250,B=[],C=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),D=[],E=[],F=a.utils.renderWatch(C);return b.dispatch=C,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{arcsRadius:{get:function(){return B},set:function(a){B=a}},width:{get:function(){return d},set:function(a){d=a}},height:{get:function(){return e},set:function(a){e=a}},showLabels:{get:function(){return l},set:function(a){l=a}},title:{get:function(){return r},set:function(a){r=a}},titleOffset:{get:function(){return t},set:function(a){t=a}},labelThreshold:{get:function(){return o},set:function(a){o=a}},hideOverlapLabels:{get:function(){return p},set:function(a){p=a}},valueFormat:{get:function(){return k},set:function(a){k=a}},x:{get:function(){return f},set:function(a){f=a}},id:{get:function(){return h},set:function(a){h=a}},endAngle:{get:function(){return x},set:function(a){x=a}},startAngle:{get:function(){return v},set:function(a){v=a}},padAngle:{get:function(){return w},set:function(a){w=a}},cornerRadius:{get:function(){return y},set:function(a){y=a}},donutRatio:{get:function(){return z},set:function(a){z=a}},labelsOutside:{get:function(){return m},set:function(a){m=a}},labelSunbeamLayout:{get:function(){return u},set:function(a){u=a}},donut:{get:function(){return q},set:function(a){q=a}},growOnHover:{get:function(){return s},set:function(a){s=a}},pieLabelsOutside:{get:function(){return m},set:function(b){m=b,a.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return m},set:function(b){m=b,a.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return k},set:function(b){k=b,a.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},duration:{get:function(){return A},set:function(a){A=a,F.reset(A)}},y:{get:function(){return g},set:function(a){g=d3.functor(a)}},color:{get:function(){return j},set:function(b){j=a.utils.getColor(b)}},labelType:{get:function(){return n},set:function(a){n=a||"key"}}}),a.utils.initOptions(b),b},a.models.pieChart=function(){"use strict";function b(e){return s.reset(),s.models(c),e.each(function(e){var j=d3.select(this);a.utils.initSVG(j);var m=a.utils.availableWidth(h,j,f),p=a.utils.availableHeight(i,j,f);if(b.update=function(){j.transition().call(b)},b.container=this,n.setter(u(e),b.update).getter(t(e)).update(),n.disabled=e.map(function(a){return!!a.disabled}),!o){var q;o={};for(q in n)n[q]instanceof Array?o[q]=n[q].slice(0):o[q]=n[q]}if(!e||!e.length)return a.utils.noData(b,j),b;j.selectAll(".nv-noData").remove();var s=j.selectAll("g.nv-wrap.nv-pieChart").data([e]),v=s.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),w=s.select("g");if(v.append("g").attr("class","nv-pieWrap"),v.append("g").attr("class","nv-legendWrap"),k)if("top"===l)d.width(m).key(c.x()),s.select(".nv-legendWrap").datum(e).call(d),g||d.height()===f.top||(f.top=d.height(),p=a.utils.availableHeight(i,j,f)),s.select(".nv-legendWrap").attr("transform","translate(0,"+-f.top+")");else if("right"===l){var x=a.models.legend().width();m/2<x&&(x=m/2),d.height(p).key(c.x()),d.width(x),m-=d.width(),s.select(".nv-legendWrap").datum(e).call(d).attr("transform","translate("+m+",0)")}else"bottom"===l&&(d.width(m).key(c.x()),s.select(".nv-legendWrap").datum(e).call(d),f.bottom=d.height(),p=a.utils.availableHeight(i,j,f),s.select(".nv-legendWrap").attr("transform","translate(0,"+p+")"));else w.select(".nv-legendWrap").selectAll("*").remove();s.attr("transform","translate("+f.left+","+f.top+")"),c.width(m).height(p);var y=w.select(".nv-pieWrap").datum([e]);d3.transition(y).call(c),d.dispatch.on("stateChange",function(a){for(var c in a)n[c]=a[c];r.stateChange(n),b.update()}),r.on("changeState",function(a){void 0!==a.disabled&&(e.forEach(function(b,c){b.disabled=a.disabled[c]}),n.disabled=a.disabled),b.update()})}),s.renderEnd("pieChart immediate"),b}var c=a.models.pie(),d=a.models.legend(),e=a.models.tooltip(),f={top:30,right:20,bottom:20,left:20},g=null,h=null,i=null,j=!1,k=!0,l="top",m=a.utils.defaultColor(),n=a.utils.state(),o=null,p=null,q=250,r=d3.dispatch("stateChange","changeState","renderEnd");e.duration(0).headerEnabled(!1).valueFormatter(function(a,b){return c.valueFormat()(a,b)});var s=a.utils.renderWatch(r),t=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},u=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:b.x()(a.data),value:b.y()(a.data),color:a.color,percent:a.percent},j||(delete a.percent,delete a.series.percent),e.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(a){e.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(a){e()}),b.legend=d,b.dispatch=r,b.pie=c,b.tooltip=e,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},noData:{get:function(){return p},set:function(a){p=a}},showTooltipPercent:{get:function(){return j},set:function(a){j=a}},showLegend:{get:function(){return k},set:function(a){k=a}},legendPosition:{get:function(){return l},set:function(a){l=a}},defaultState:{get:function(){return o},set:function(a){o=a}},color:{get:function(){return m},set:function(a){m=a,d.color(m),c.color(m)}},duration:{get:function(){return q},set:function(a){q=a,s.reset(q),c.duration(q)}},margin:{get:function(){return f},set:function(a){void 0!==a.top&&(f.top=a.top,g=a.top),f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.sankey=function(){"use strict";function b(){n.forEach(function(a){a.sourceLinks=[],a.targetLinks=[]}),o.forEach(function(a){var b=a.source,c=a.target;"number"==typeof b&&(b=a.source=n[a.source]),"number"==typeof c&&(c=a.target=n[a.target]),b.sourceLinks.push(a),c.targetLinks.push(a)})}function c(){n.forEach(function(a){a.value=Math.max(d3.sum(a.sourceLinks,i),d3.sum(a.targetLinks,i))})}function d(){for(var a,b=n,c=0;b.length&&c<n.length;)a=[],b.forEach(function(b){b.x=c,b.dx=k,b.sourceLinks.forEach(function(b){a.indexOf(b.target)<0&&a.push(b.target)})}),b=a,++c;p&&e(c),f((m[0]-k)/(c-1))}function e(a){n.forEach(function(b){b.sourceLinks.length||(b.x=a-1)})}function f(a){n.forEach(function(b){b.x*=a})}function g(a){function b(){var a=d3.min(g,function(a){return(m[1]-(a.length-1)*l)/d3.sum(a,i)});g.forEach(function(b){b.forEach(function(b,c){b.y=c,b.dy=b.value*a})}),o.forEach(function(b){b.dy=b.value*a})}function c(a){function b(a){return(a.source.y+a.sy+a.dy/2)*a.value}g.forEach(function(c,d){c.forEach(function(c){if(c.targetLinks.length){var d=d3.sum(c.targetLinks,b)/d3.sum(c.targetLinks,i);c.y+=(d-t(c))*a}})})}function d(a){function b(a){return(a.target.y+a.ty+a.dy/2)*a.value}g.slice().reverse().forEach(function(c){c.forEach(function(c){if(c.sourceLinks.length){var d=d3.sum(c.sourceLinks,b)/d3.sum(c.sourceLinks,i);c.y+=(d-t(c))*a}})})}function e(){g.forEach(function(a){var b,c,d,e=0,g=a.length;for(a.sort(f),d=0;d<g;++d)b=a[d],c=e-b.y,c>0&&(b.y+=c),e=b.y+b.dy+l;if((c=e-l-m[1])>0)for(e=b.y-=c,d=g-2;d>=0;--d)b=a[d],c=b.y+b.dy+l-e,c>0&&(b.y-=c),e=b.y})}function f(a,b){return a.y-b.y}var g=d3.nest().key(function(a){return a.x}).sortKeys(d3.ascending).entries(n).map(function(a){return a.values});b(),e(),h();for(var j=1;a>0;--a)d(j*=.99),e(),h(),c(j),e(),h()}function h(){function a(a,b){return a.source.y-b.source.y}function b(a,b){return a.target.y-b.target.y}n.forEach(function(c){c.sourceLinks.sort(b),c.targetLinks.sort(a)}),n.forEach(function(a){var b=0,c=0;a.sourceLinks.forEach(function(a){a.sy=b,b+=a.dy}),a.targetLinks.forEach(function(a){a.ty=c,c+=a.dy})})}function i(a){return a.value}var j={},k=24,l=8,m=[1,1],n=[],o=[],p=!0,q=function(a){b(),c(),d(),g(a)},r=function(){h()},s=function(){function a(a){var c=a.source.x+a.source.dx,d=a.target.x,e=d3.interpolateNumber(c,d),f=e(b),g=e(1-b),h=a.source.y+a.sy+a.dy/2,i=a.target.y+a.ty+a.dy/2;return"M"+c+","+h+"C"+f+","+h+" "+g+","+i+" "+d+","+i}var b=.5;return a.curvature=function(c){return arguments.length?(b=+c,a):b},a},t=function(a){return a.y+a.dy/2};return j.options=a.utils.optionsFunc.bind(j),j._options=Object.create({},{nodeWidth:{get:function(){return k},set:function(a){k=+a}},nodePadding:{get:function(){return l},set:function(a){l=a}},nodes:{get:function(){return n},set:function(a){n=a}},links:{get:function(){return o},set:function(a){o=a}},size:{get:function(){return m},set:function(a){m=a}},sinksRight:{get:function(){return p},set:function(a){p=a}},layout:{get:function(){q(32)},set:function(a){q(a)}},relayout:{get:function(){r()},set:function(a){}},center:{get:function(){return t()},set:function(a){"function"==typeof a&&(t=a)}},link:{get:function(){return s()},set:function(a){return"function"==typeof a&&(s=a),s()}}}),a.utils.initOptions(j),j},a.models.sankeyChart=function(){"use strict";function b(a){return a.each(function(b){function c(a){d3.select(this).attr("transform","translate("+a.x+","+(a.y=Math.max(0,Math.min(f-a.dy,d3.event.y)))+")"),d.relayout(),t.attr("d",s)}var i={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}]},k=!1,l=!1;if(("object"==typeof b.nodes&&b.nodes.length)>=0&&("object"==typeof b.links&&b.links.length)>=0&&(k=!0),b.nodes&&b.nodes.length>0&&b.links&&b.links.length>0&&(l=!0),!k)return console.error("NVD3 Sankey chart error:","invalid data format for",b),console.info("Valid data format is: ",i,JSON.stringify(i)),r(a,"Error loading chart, data is invalid"),!1;if(!l)return r(a,"No data available"),!1;var m=a.append("svg").attr("width",e).attr("height",f).append("g").attr("class","nvd3 nv-wrap nv-sankeyChart");d.nodeWidth(g).nodePadding(h).size([e,f]);var s=d.link();d.nodes(b.nodes).links(b.links).layout(32).center(j);var t=m.append("g").selectAll(".link").data(b.links).enter().append("path").attr("class","link").attr("d",s).style("stroke-width",function(a){return Math.max(1,a.dy)}).sort(function(a,b){return b.dy-a.dy});t.append("title").text(n);var u=m.append("g").selectAll(".node").data(b.nodes).enter().append("g").attr("class","node").attr("transform",function(a){return"translate("+a.x+","+a.y+")"}).call(d3.behavior.drag().origin(function(a){return a}).on("dragstart",function(){this.parentNode.appendChild(this)}).on("drag",c));u.append("rect").attr("height",function(a){return a.dy}).attr("width",d.nodeWidth()).style("fill",o).style("stroke",p).append("title").text(q),u.append("text").attr("x",-6).attr("y",function(a){return a.dy/2}).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).text(function(a){return a.name}).filter(function(a){return a.x<e/2}).attr("x",6+d.nodeWidth()).attr("text-anchor","start")}),b}var c={top:5,right:0,bottom:5,left:0},d=a.models.sankey(),e=600,f=400,g=36,h=40,i="units",j=void 0,k=d3.format(",.0f"),l=function(a){return k(a)+" "+i},m=d3.scale.category20(),n=function(a){return a.source.name+" → "+a.target.name+"\n"+l(a.value)},o=function(a){return a.color=m(a.name.replace(/ .*/,""))},p=function(a){return d3.rgb(a.color).darker(2)},q=function(a){return a.name+"\n"+l(a.value)},r=function(a,b){a.append("text").attr("x",0).attr("y",0).attr("class","nvd3-sankey-chart-error").attr("text-anchor","middle").text(b)};return b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{units:{get:function(){return i},set:function(a){i=a}},width:{get:function(){return e},set:function(a){e=a}},height:{get:function(){return f},set:function(a){f=a}},format:{get:function(){return l},set:function(a){l=a}},linkTitle:{get:function(){return n},set:function(a){n=a}},nodeWidth:{get:function(){return g},set:function(a){g=a}},nodePadding:{get:function(){return h},set:function(a){h=a}},center:{get:function(){return j},set:function(a){j=a}},margin:{get:function(){return c},set:function(a){c.top=void 0!==a.top?a.top:c.top,c.right=void 0!==a.right?a.right:c.right,c.bottom=void 0!==a.bottom?a.bottom:c.bottom,c.left=void 0!==a.left?a.left:c.left}},nodeStyle:{get:function(){return{}},set:function(a){o=void 0!==a.fillColor?a.fillColor:o,p=void 0!==a.strokeColor?a.strokeColor:p,q=void 0!==a.title?a.title:q}}}),a.utils.initOptions(b),b},a.models.scatter=function(){"use strict";function b(a){var b;return b=a[0].series+":"+a[1],_[b]=_[b]||{}}function c(a){var b;b=a[0].series+":"+a[1],delete _[b]}function d(a){var c,d,e,f=b(a),g=!1;for(c=1;c<arguments.length;c+=2)d=arguments[c],e=arguments[c+1](a[0],a[1]),f[d]===e&&f.hasOwnProperty(d)||(f[d]=e,g=!0);return g}function e(b){return Z.reset(),b.each(function(b){function V(){if(Y=!1,!E)return!1;if(t.selectAll(".nv-point.hover").classed("hover",!1),ha.select(".nv-point-paths").selectAll("path").remove(),!0===U){var c=d3.merge(b.map(function(b,c){return b.values.map(function(b,d){var e=x(b,d),f=y(b,d);return[a.utils.NaNtoZero(u(e))+1e-4*Math.random(),a.utils.NaNtoZero(v(f))+1e-4*Math.random(),c,d,b]}).filter(function(a,b){return F(a[4],b)})}));if(0==c.length)return!1;c.length<3&&(c.push([u.range()[0]-20,v.range()[0]-20,null,null]),c.push([u.range()[1]+20,v.range()[1]+20,null,null]),c.push([u.range()[0]-20,v.range()[0]+20,null,null]),c.push([u.range()[1]+20,v.range()[1]-20,null,null]));var d=d3.geom.polygon([[-10,-10],[-10,p+10],[o+10,p+10],[o+10,-10]]),e=1e-4;c=c.sort(function(a,b){return a[0]-b[0]||a[1]-b[1]});for(var f=0;f<c.length-1;)Math.abs(c[f][0]-c[f+1][0])<e&&Math.abs(c[f][1]-c[f+1][1])<e?c.splice(f+1,1):f++;var g=d3.geom.voronoi(c).map(function(a,b){return 0===a.length?null:{data:d.clip(a),series:c[b][2],point:c[b][3]}}),h=ha.select(".nv-point-paths").selectAll("path").data(g),i=h.enter().append("svg:path").attr("d",function(a){return a&&a.data&&0!==a.data.length?"M"+a.data.join(",")+"Z":"M 0 0"}).attr("id",function(a,b){return"nv-path-"+b}).attr("clip-path",function(a,b){return"url(#nv-clip-"+s+"-"+b+")"});if(K&&i.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),J){ha.select(".nv-point-clips").selectAll("*").remove();var j=ha.select(".nv-point-clips").selectAll("clipPath").data(c);j.enter().append("svg:clipPath").attr("id",function(a,b){return"nv-clip-"+s+"-"+b}).append("svg:circle").attr("cx",function(a){return a[0]}).attr("cy",function(a){return a[1]}).attr("r",L)}var k=function(a,c,d){if(Y)return 0;var e=b[c.series];if(void 0!==e){var f=e.values[c.point];f.color=q(e,c.series),f.x=x(f),f.y=y(f);var g=t.node().getBoundingClientRect(),h=window.pageYOffset||document.documentElement.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft;d({point:f,series:e,pos:{left:u(x(f,c.point))+g.left+i+n.left+10,top:v(y(f,c.point))+g.top+h+n.top+10},relativePos:[u(x(f,c.point))+n.left,v(y(f,c.point))+n.top],seriesIndex:c.series,pointIndex:c.point,event:d3.event,element:a})}};h.on("click",function(a){k(this,a,T.elementClick)}).on("dblclick",function(a){k(this,a,T.elementDblClick)}).on("mouseover",function(a){k(this,a,T.elementMouseover)}).on("mouseout",function(a,b){k(this,a,T.elementMouseout)})}else ha.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",function(a,c){if(Y||!b[a[0].series])return 0;var d=b[a[0].series],e=d.values[c],f=this;T.elementClick({point:e,series:d,pos:[u(x(e,c))+n.left,v(y(e,c))+n.top],relativePos:[u(x(e,c))+n.left,v(y(e,c))+n.top],seriesIndex:a[0].series,pointIndex:c,event:d3.event,element:f})}).on("dblclick",function(a,c){if(Y||!b[a[0].series])return 0;var d=b[a[0].series],e=d.values[c];T.elementDblClick({point:e,series:d,pos:[u(x(e,c))+n.left,v(y(e,c))+n.top],relativePos:[u(x(e,c))+n.left,v(y(e,c))+n.top],seriesIndex:a[0].series,pointIndex:c})}).on("mouseover",function(a,c){if(Y||!b[a[0].series])return 0;var d=b[a[0].series],e=d.values[c];T.elementMouseover({point:e,series:d,pos:[u(x(e,c))+n.left,v(y(e,c))+n.top],relativePos:[u(x(e,c))+n.left,v(y(e,c))+n.top],seriesIndex:a[0].series,pointIndex:c,color:q(a[0],c)})}).on("mouseout",function(a,c){if(Y||!b[a[0].series])return 0;var d=b[a[0].series],e=d.values[c];T.elementMouseout({point:e,series:d,pos:[u(x(e,c))+n.left,v(y(e,c))+n.top],relativePos:[u(x(e,c))+n.left,v(y(e,c))+n.top],seriesIndex:a[0].series,pointIndex:c,color:q(a[0],c)})})}t=d3.select(this);var _=a.utils.availableWidth(o,t,n),aa=a.utils.availableHeight(p,t,n);a.utils.initSVG(t),b.forEach(function(a,b){a.values.forEach(function(a){a.series=b})});var ba="function"==typeof e.yScale().base,ca=M&&N&&Q?[]:d3.merge(b.map(function(a){return a.values.map(function(a,b){return{x:x(a,b),y:y(a,b),size:z(a,b)}})}));if(u.domain(M||d3.extent(ca.map(function(a){return a.x}).concat(B))),G&&b[0]?u.range(O||[(_*H+_)/(2*b[0].values.length),_-_*(1+H)/(2*b[0].values.length)]):u.range(O||[0,_]),ba){var da=d3.min(ca.map(function(a){if(0!==a.y)return a.y}));v.clamp(!0).domain(N||d3.extent(ca.map(function(a){return 0!==a.y?a.y:.1*da}).concat(C))).range(P||[aa,0])}else v.domain(N||d3.extent(ca.map(function(a){return a.y}).concat(C))).range(P||[aa,0]);w.domain(Q||d3.extent(ca.map(function(a){return a.size}).concat(D))).range(R||$),S=u.domain()[0]===u.domain()[1]||v.domain()[0]===v.domain()[1],u.domain()[0]===u.domain()[1]&&(u.domain()[0]?u.domain([u.domain()[0]-.01*u.domain()[0],u.domain()[1]+.01*u.domain()[1]]):u.domain([-1,1])),v.domain()[0]===v.domain()[1]&&(v.domain()[0]?v.domain([v.domain()[0]-.01*v.domain()[0],v.domain()[1]+.01*v.domain()[1]]):v.domain([-1,1])),isNaN(u.domain()[0])&&u.domain([-1,1]),isNaN(v.domain()[0])&&v.domain([-1,1]),f=f||u,g=g||v,h=h||w;var ea=u(1)!==f(1)||v(1)!==g(1)||w(1)!==h(1);k=k||o,l=l||p;var fa=k!==o||l!==p;i=i||[];var ga=i[0]!==u.domain()[0]||i[1]!==u.domain()[1];i=u.domain(),j=j||[],ga=ga||j[0]!==v.domain()[0]||j[1]!==v.domain()[1],j=v.domain();var ha=t.selectAll("g.nv-wrap.nv-scatter").data([b]),ia=ha.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+s),ja=ia.append("defs"),ka=ia.append("g"),la=ha.select("g");ha.classed("nv-single-point",S),ka.append("g").attr("class","nv-groups"),ka.append("g").attr("class","nv-point-paths"),ia.append("g").attr("class","nv-point-clips"),ha.attr("transform","translate("+n.left+","+n.top+")"),ja.append("clipPath").attr("id","nv-edge-clip-"+s).append("rect").attr("transform","translate( -10, -10)"),ha.select("#nv-edge-clip-"+s+" rect").attr("width",_+20).attr("height",aa>0?aa+20:0),la.attr("clip-path",I?"url(#nv-edge-clip-"+s+")":""),Y=!0;var ma=ha.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});ma.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),ma.exit().remove(),ma.attr("class",function(a,b){return(a.classed||"")+" nv-group nv-series-"+b}).classed("nv-noninteractive",!E).classed("hover",function(a){return a.hover}),ma.watchTransition(Z,"scatter: groups").style("fill",function(a,b){return q(a,b)}).style("stroke",function(a,b){
|
|
11
|
+
return a.pointBorderColor||r||q(a,b)}).style("stroke-opacity",1).style("fill-opacity",.5);var na=ma.selectAll("path.nv-point").data(function(a){return a.values.map(function(a,b){return[a,b]}).filter(function(a,b){return F(a[0],b)})});if(na.enter().append("path").attr("class",function(a){return"nv-point nv-point-"+a[1]}).style("fill",function(a){return a.color}).style("stroke",function(a){return a.color}).attr("transform",function(b){return"translate("+a.utils.NaNtoZero(f(x(b[0],b[1])))+","+a.utils.NaNtoZero(g(y(b[0],b[1])))+")"}).attr("d",a.utils.symbol().type(function(a){return A(a[0])}).size(function(a){return w(z(a[0],a[1]))})),na.exit().each(c).remove(),ma.exit().selectAll("path.nv-point").watchTransition(Z,"scatter exit").attr("transform",function(b){return"translate("+a.utils.NaNtoZero(u(x(b[0],b[1])))+","+a.utils.NaNtoZero(v(y(b[0],b[1])))+")"}).remove(),na.filter(function(a){return d(a,"x",x,"y",y)||ea||fa||ga}).watchTransition(Z,"scatter points").attr("transform",function(b){return"translate("+a.utils.NaNtoZero(u(x(b[0],b[1])))+","+a.utils.NaNtoZero(v(y(b[0],b[1])))+")"}),na.filter(function(a){return d(a,"shape",A,"size",z)||ea||fa||ga}).watchTransition(Z,"scatter points").attr("d",a.utils.symbol().type(function(a){return A(a[0])}).size(function(a){return w(z(a[0],a[1]))})),X){var oa=ma.selectAll(".nv-label").data(function(a){return a.values.map(function(a,b){return[a,b]}).filter(function(a,b){return F(a[0],b)})});oa.enter().append("text").style("fill",function(a,b){return a.color}).style("stroke-opacity",0).style("fill-opacity",1).attr("transform",function(b){return"translate("+(a.utils.NaNtoZero(f(x(b[0],b[1])))+Math.sqrt(w(z(b[0],b[1]))/Math.PI)+2)+","+a.utils.NaNtoZero(g(y(b[0],b[1])))+")"}).text(function(a,b){return a[0].label}),oa.exit().remove(),ma.exit().selectAll("path.nv-label").watchTransition(Z,"scatter exit").attr("transform",function(b){return"translate("+(a.utils.NaNtoZero(u(x(b[0],b[1])))+Math.sqrt(w(z(b[0],b[1]))/Math.PI)+2)+","+a.utils.NaNtoZero(v(y(b[0],b[1])))+")"}).remove(),oa.each(function(a){d3.select(this).classed("nv-label",!0).classed("nv-label-"+a[1],!1).classed("hover",!1)}),oa.watchTransition(Z,"scatter labels").text(function(a,b){return a[0].label}).attr("transform",function(b){return"translate("+(a.utils.NaNtoZero(u(x(b[0],b[1])))+Math.sqrt(w(z(b[0],b[1]))/Math.PI)+2)+","+a.utils.NaNtoZero(v(y(b[0],b[1])))+")"})}W?(clearTimeout(m),m=setTimeout(V,W)):V(),f=u.copy(),g=v.copy(),h=w.copy(),k=o,l=p}),Z.renderEnd("scatter immediate"),e}var f,g,h,i,j,k,l,m,n={top:0,right:0,bottom:0,left:0},o=null,p=null,q=a.utils.defaultColor(),r=null,s=Math.floor(1e5*Math.random()),t=null,u=d3.scale.linear(),v=d3.scale.linear(),w=d3.scale.linear(),x=function(a){return a.x},y=function(a){return a.y},z=function(a){return a.size||1},A=function(a){return a.shape||"circle"},B=[],C=[],D=[],E=!0,F=function(a){return!a.notActive},G=!1,H=.1,I=!1,J=!0,K=!1,L=function(){return 25},M=null,N=null,O=null,P=null,Q=null,R=null,S=!1,T=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),U=!0,V=250,W=300,X=!1,Y=!1,Z=a.utils.renderWatch(T,V),$=[16,256],_={};return e.dispatch=T,e.options=a.utils.optionsFunc.bind(e),e._calls=new function(){this.clearHighlights=function(){return a.dom.write(function(){t.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(b,c,d){a.dom.write(function(){t.select(".nv-groups").selectAll(".nv-series-"+b).selectAll(".nv-point-"+c).classed("hover",d)})}},T.on("elementMouseover.point",function(a){E&&e._calls.highlightPoint(a.seriesIndex,a.pointIndex,!0)}),T.on("elementMouseout.point",function(a){E&&e._calls.highlightPoint(a.seriesIndex,a.pointIndex,!1)}),e._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return p},set:function(a){p=a}},xScale:{get:function(){return u},set:function(a){u=a}},yScale:{get:function(){return v},set:function(a){v=a}},pointScale:{get:function(){return w},set:function(a){w=a}},xDomain:{get:function(){return M},set:function(a){M=a}},yDomain:{get:function(){return N},set:function(a){N=a}},pointDomain:{get:function(){return Q},set:function(a){Q=a}},xRange:{get:function(){return O},set:function(a){O=a}},yRange:{get:function(){return P},set:function(a){P=a}},pointRange:{get:function(){return R},set:function(a){R=a}},forceX:{get:function(){return B},set:function(a){B=a}},forceY:{get:function(){return C},set:function(a){C=a}},forcePoint:{get:function(){return D},set:function(a){D=a}},interactive:{get:function(){return E},set:function(a){E=a}},pointActive:{get:function(){return F},set:function(a){F=a}},padDataOuter:{get:function(){return H},set:function(a){H=a}},padData:{get:function(){return G},set:function(a){G=a}},clipEdge:{get:function(){return I},set:function(a){I=a}},clipVoronoi:{get:function(){return J},set:function(a){J=a}},clipRadius:{get:function(){return L},set:function(a){L=a}},showVoronoi:{get:function(){return K},set:function(a){K=a}},id:{get:function(){return s},set:function(a){s=a}},interactiveUpdateDelay:{get:function(){return W},set:function(a){W=a}},showLabels:{get:function(){return X},set:function(a){X=a}},pointBorderColor:{get:function(){return r},set:function(a){r=a}},x:{get:function(){return x},set:function(a){x=d3.functor(a)}},y:{get:function(){return y},set:function(a){y=d3.functor(a)}},pointSize:{get:function(){return z},set:function(a){z=d3.functor(a)}},pointShape:{get:function(){return A},set:function(a){A=d3.functor(a)}},margin:{get:function(){return n},set:function(a){n.top=void 0!==a.top?a.top:n.top,n.right=void 0!==a.right?a.right:n.right,n.bottom=void 0!==a.bottom?a.bottom:n.bottom,n.left=void 0!==a.left?a.left:n.left}},duration:{get:function(){return V},set:function(a){V=a,Z.reset(V)}},color:{get:function(){return q},set:function(b){q=a.utils.getColor(b)}},useVoronoi:{get:function(){return U},set:function(a){!1===(U=a)&&(J=!1)}}}),a.utils.initOptions(e),e},a.models.scatterChart=function(){"use strict";function b(A){return F.reset(),F.models(c),u&&F.models(d),v&&F.models(e),r&&F.models(g),s&&F.models(h),A.each(function(A){n=d3.select(this),a.utils.initSVG(n);var I=a.utils.availableWidth(l,n,j),J=a.utils.availableHeight(m,n,j);if(b.update=function(){0===B?n.call(b):n.transition().duration(B).call(b)},b.container=this,x.setter(H(A),b.update).getter(G(A)).update(),x.disabled=A.map(function(a){return!!a.disabled}),!y){var K;y={};for(K in x)x[K]instanceof Array?y[K]=x[K].slice(0):y[K]=x[K]}if(!(A&&A.length&&A.filter(function(a){return a.values.length}).length))return a.utils.noData(b,n),F.renderEnd("scatter immediate"),b;n.selectAll(".nv-noData").remove(),p=c.xScale(),q=c.yScale();var L=n.selectAll("g.nv-wrap.nv-scatterChart").data([A]),M=L.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+c.id()),N=M.append("g"),O=L.select("g");if(N.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),N.append("g").attr("class","nv-x nv-axis"),N.append("g").attr("class","nv-y nv-axis"),N.append("g").attr("class","nv-scatterWrap"),N.append("g").attr("class","nv-regressionLinesWrap"),N.append("g").attr("class","nv-distWrap"),N.append("g").attr("class","nv-legendWrap"),w&&O.select(".nv-y.nv-axis").attr("transform","translate("+I+",0)"),t){var P=I;f.width(P),L.select(".nv-legendWrap").datum(A).call(f),k||f.height()===j.top||(j.top=f.height(),J=a.utils.availableHeight(m,n,j)),L.select(".nv-legendWrap").attr("transform","translate(0,"+-j.top+")")}else O.select(".nv-legendWrap").selectAll("*").remove();L.attr("transform","translate("+j.left+","+j.top+")"),c.width(I).height(J).color(A.map(function(a,b){return a.color=a.color||o(a,b),a.color}).filter(function(a,b){return!A[b].disabled})).showLabels(C),L.select(".nv-scatterWrap").datum(A.filter(function(a){return!a.disabled})).call(c),L.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+c.id()+")");var Q=L.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(a){return a});Q.enter().append("g").attr("class","nv-regLines");var R=Q.selectAll(".nv-regLine").data(function(a){return[a]});R.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),R.filter(function(a){return a.intercept&&a.slope}).watchTransition(F,"scatterPlusLineChart: regline").attr("x1",p.range()[0]).attr("x2",p.range()[1]).attr("y1",function(a,b){return q(p.domain()[0]*a.slope+a.intercept)}).attr("y2",function(a,b){return q(p.domain()[1]*a.slope+a.intercept)}).style("stroke",function(a,b,c){return o(a,c)}).style("stroke-opacity",function(a,b){return a.disabled||void 0===a.slope||void 0===a.intercept?0:1}),u&&(d.scale(p)._ticks(a.utils.calcTicksX(I/100,A)).tickSize(-J,0),O.select(".nv-x.nv-axis").attr("transform","translate(0,"+q.range()[0]+")").call(d)),v&&(e.scale(q)._ticks(a.utils.calcTicksY(J/36,A)).tickSize(-I,0),O.select(".nv-y.nv-axis").call(e)),g.getData(c.x()).scale(p).width(I).color(A.map(function(a,b){return a.color||o(a,b)}).filter(function(a,b){return!A[b].disabled})),N.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),O.select(".nv-distributionX").attr("transform","translate(0,"+q.range()[0]+")").datum(A.filter(function(a){return!a.disabled})).call(g).style("opacity",function(){return r?"1":"1e-6"}).watchTransition(F,"scatterPlusLineChart").style("opacity",function(){return r?"1":"1e-6"}),h.getData(c.y()).scale(q).width(J).color(A.map(function(a,b){return a.color||o(a,b)}).filter(function(a,b){return!A[b].disabled})),N.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),O.select(".nv-distributionY").attr("transform","translate("+(w?I:-h.size())+",0)").datum(A.filter(function(a){return!a.disabled})).call(h).style("opacity",function(){return s?"1":"1e-6"}).watchTransition(F,"scatterPlusLineChart").style("opacity",function(){return s?"1":"1e-6"}),f.dispatch.on("stateChange",function(a){for(var c in a)x[c]=a[c];z.stateChange(x),b.update()}),z.on("changeState",function(a){void 0!==a.disabled&&(A.forEach(function(b,c){b.disabled=a.disabled[c]}),x.disabled=a.disabled),b.update()}),c.dispatch.on("elementMouseout.tooltip",function(a){i.hidden(!0),n.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),n.select(".nv-chart-"+c.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",h.size())}),c.dispatch.on("elementMouseover.tooltip",function(a){n.select(".nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.relativePos[1]-J),n.select(".nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.relativePos[0]+g.size()),i.data(a).hidden(!1)}),D=p.copy(),E=q.copy()}),F.renderEnd("scatter with line immediate"),b}var c=a.models.scatter(),d=a.models.axis(),e=a.models.axis(),f=a.models.legend(),g=a.models.distribution(),h=a.models.distribution(),i=a.models.tooltip(),j={top:30,right:20,bottom:50,left:75},k=null,l=null,m=null,n=null,o=a.utils.defaultColor(),p=c.xScale(),q=c.yScale(),r=!1,s=!1,t=!0,u=!0,v=!0,w=!1,x=a.utils.state(),y=null,z=d3.dispatch("stateChange","changeState","renderEnd"),A=null,B=250,C=!1;c.xScale(p).yScale(q),d.orient("bottom").tickPadding(10),e.orient(w?"right":"left").tickPadding(10),g.axis("x"),h.axis("y"),i.headerFormatter(function(a,b){return d.tickFormat()(a,b)}).valueFormatter(function(a,b){return e.tickFormat()(a,b)});var D,E,F=a.utils.renderWatch(z,B),G=function(a){return function(){return{active:a.map(function(a){return!a.disabled})}}},H=function(a){return function(b){void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}};return b.dispatch=z,b.scatter=c,b.legend=f,b.xAxis=d,b.yAxis=e,b.distX=g,b.distY=h,b.tooltip=i,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return l},set:function(a){l=a}},height:{get:function(){return m},set:function(a){m=a}},container:{get:function(){return n},set:function(a){n=a}},showDistX:{get:function(){return r},set:function(a){r=a}},showDistY:{get:function(){return s},set:function(a){s=a}},showLegend:{get:function(){return t},set:function(a){t=a}},showXAxis:{get:function(){return u},set:function(a){u=a}},showYAxis:{get:function(){return v},set:function(a){v=a}},defaultState:{get:function(){return y},set:function(a){y=a}},noData:{get:function(){return A},set:function(a){A=a}},duration:{get:function(){return B},set:function(a){B=a}},showLabels:{get:function(){return C},set:function(a){C=a}},margin:{get:function(){return j},set:function(a){void 0!==a.top&&(j.top=a.top,k=a.top),j.right=void 0!==a.right?a.right:j.right,j.bottom=void 0!==a.bottom?a.bottom:j.bottom,j.left=void 0!==a.left?a.left:j.left}},rightAlignYAxis:{get:function(){return w},set:function(a){w=a,e.orient(a?"right":"left")}},color:{get:function(){return o},set:function(b){o=a.utils.getColor(b),f.color(o),g.color(o),h.color(o)}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.models.sparkline=function(){"use strict";function b(k){return t.reset(),k.each(function(b){var k=h-g.left-g.right,s=i-g.top-g.bottom;j=d3.select(this),a.utils.initSVG(j),l.domain(c||d3.extent(b,n)).range(e||[0,k]),m.domain(d||d3.extent(b,o)).range(f||[s,0]);var t=j.selectAll("g.nv-wrap.nv-sparkline").data([b]),u=t.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");u.append("g"),t.select("g");t.attr("transform","translate("+g.left+","+g.top+")");var v=t.selectAll("path").data(function(a){return[a]});v.enter().append("path"),v.exit().remove(),v.style("stroke",function(a,b){return a.color||p(a,b)}).attr("d",d3.svg.line().x(function(a,b){return l(n(a,b))}).y(function(a,b){return m(o(a,b))}));var w=t.selectAll("circle.nv-point").data(function(a){function b(b){if(-1!=b){var c=a[b];return c.pointIndex=b,c}return null}var c=a.map(function(a,b){return o(a,b)}),d=b(c.lastIndexOf(m.domain()[1])),e=b(c.indexOf(m.domain()[0])),f=b(c.length-1);return[q?e:null,q?d:null,r?f:null].filter(function(a){return null!=a})});w.enter().append("circle"),w.exit().remove(),w.attr("cx",function(a,b){return l(n(a,a.pointIndex))}).attr("cy",function(a,b){return m(o(a,a.pointIndex))}).attr("r",2).attr("class",function(a,b){return n(a,a.pointIndex)==l.domain()[1]?"nv-point nv-currentValue":o(a,a.pointIndex)==m.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),t.renderEnd("sparkline immediate"),b}var c,d,e,f,g={top:2,right:0,bottom:2,left:0},h=400,i=32,j=null,k=!0,l=d3.scale.linear(),m=d3.scale.linear(),n=function(a){return a.x},o=function(a){return a.y},p=a.utils.getColor(["#000"]),q=!0,r=!0,s=d3.dispatch("renderEnd"),t=a.utils.renderWatch(s);return b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return h},set:function(a){h=a}},height:{get:function(){return i},set:function(a){i=a}},xDomain:{get:function(){return c},set:function(a){c=a}},yDomain:{get:function(){return d},set:function(a){d=a}},xRange:{get:function(){return e},set:function(a){e=a}},yRange:{get:function(){return f},set:function(a){f=a}},xScale:{get:function(){return l},set:function(a){l=a}},yScale:{get:function(){return m},set:function(a){m=a}},animate:{get:function(){return k},set:function(a){k=a}},showMinMaxPoints:{get:function(){return q},set:function(a){q=a}},showCurrentPoint:{get:function(){return r},set:function(a){r=a}},x:{get:function(){return n},set:function(a){n=d3.functor(a)}},y:{get:function(){return o},set:function(a){o=d3.functor(a)}},margin:{get:function(){return g},set:function(a){g.top=void 0!==a.top?a.top:g.top,g.right=void 0!==a.right?a.right:g.right,g.bottom=void 0!==a.bottom?a.bottom:g.bottom,g.left=void 0!==a.left?a.left:g.left}},color:{get:function(){return p},set:function(b){p=a.utils.getColor(b)}}}),b.dispatch=s,a.utils.initOptions(b),b},a.models.sparklinePlus=function(){"use strict";function b(p){return r.reset(),r.models(e),p.each(function(p){function q(){if(!j){var a=z.selectAll(".nv-hoverValue").data(i),b=a.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);a.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),a.attr("transform",function(a){return"translate("+c(e.x()(p[a],a))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),i.length&&(b.append("line").attr("x1",0).attr("y1",-f.top).attr("x2",0).attr("y2",u),b.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-f.top).attr("text-anchor","end").attr("dy",".9em"),z.select(".nv-hoverValue .nv-xValue").text(k(e.x()(p[i[0]],i[0]))),b.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-f.top).attr("text-anchor","start").attr("dy",".9em"),z.select(".nv-hoverValue .nv-yValue").text(l(e.y()(p[i[0]],i[0]))))}}function r(){function a(a,b){for(var c=Math.abs(e.x()(a[0],0)-b),d=0,f=0;f<a.length;f++)Math.abs(e.x()(a[f],f)-b)<c&&(c=Math.abs(e.x()(a[f],f)-b),d=f);return d}if(!j){var b=d3.mouse(this)[0]-f.left;i=[a(p,Math.round(c.invert(b)))],q()}}var s=d3.select(this);a.utils.initSVG(s);var t=a.utils.availableWidth(g,s,f),u=a.utils.availableHeight(h,s,f);if(b.update=function(){s.call(b)},b.container=this,!p||!p.length)return a.utils.noData(b,s),b;s.selectAll(".nv-noData").remove();var v=e.y()(p[p.length-1],p.length-1);c=e.xScale(),d=e.yScale();var w=s.selectAll("g.nv-wrap.nv-sparklineplus").data([p]),x=w.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus"),y=x.append("g"),z=w.select("g");y.append("g").attr("class","nv-sparklineWrap"),y.append("g").attr("class","nv-valueWrap"),y.append("g").attr("class","nv-hoverArea"),w.attr("transform","translate("+f.left+","+f.top+")");var A=z.select(".nv-sparklineWrap");if(e.width(t).height(u),A.call(e),m){var B=z.select(".nv-valueWrap"),C=B.selectAll(".nv-currentValue").data([v]);C.enter().append("text").attr("class","nv-currentValue").attr("dx",o?-8:8).attr("dy",".9em").style("text-anchor",o?"end":"start"),C.attr("x",t+(o?f.right:0)).attr("y",n?function(a){return d(a)}:0).style("fill",e.color()(p[p.length-1],p.length-1)).text(l(v))}y.select(".nv-hoverArea").append("rect").on("mousemove",r).on("click",function(){j=!j}).on("mouseout",function(){i=[],q()}),z.select(".nv-hoverArea rect").attr("transform",function(a){return"translate("+-f.left+","+-f.top+")"}).attr("width",t+f.left+f.right).attr("height",u+f.top)}),r.renderEnd("sparklinePlus immediate"),b}var c,d,e=a.models.sparkline(),f={top:15,right:100,bottom:10,left:50},g=null,h=null,i=[],j=!1,k=d3.format(",r"),l=d3.format(",.2f"),m=!0,n=!0,o=!1,p=null,q=d3.dispatch("renderEnd"),r=a.utils.renderWatch(q);return b.dispatch=q,b.sparkline=e,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return g},set:function(a){g=a}},height:{get:function(){return h},set:function(a){h=a}},xTickFormat:{get:function(){return k},set:function(a){k=a}},yTickFormat:{get:function(){return l},set:function(a){l=a}},showLastValue:{get:function(){return m},set:function(a){m=a}},alignValue:{get:function(){return n},set:function(a){n=a}},rightAlignValue:{get:function(){return o},set:function(a){o=a}},noData:{get:function(){return p},set:function(a){p=a}},margin:{get:function(){return f},set:function(a){f.top=void 0!==a.top?a.top:f.top,f.right=void 0!==a.right?a.right:f.right,f.bottom=void 0!==a.bottom?a.bottom:f.bottom,f.left=void 0!==a.left?a.left:f.left}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.stackedArea=function(){"use strict";function b(n){return x.reset(),x.models(s),n.each(function(n){var t=f-e.left-e.right,y=g-e.top-e.bottom;j=d3.select(this),a.utils.initSVG(j),c=s.xScale(),d=s.yScale();var z=n;n.forEach(function(a,b){a.seriesIndex=b,a.values=a.values.map(function(a,c){return a.index=c,a.seriesIndex=b,a})});var A=n.filter(function(a){return!a.disabled});n=d3.layout.stack().order(p).offset(o).values(function(a){return a.values}).x(k).y(l).out(u)(A);var B=j.selectAll("g.nv-wrap.nv-stackedarea").data([n]),C=B.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),D=C.append("defs"),E=C.append("g"),F=B.select("g");E.append("g").attr("class","nv-areaWrap"),E.append("g").attr("class","nv-scatterWrap"),B.attr("transform","translate("+e.left+","+e.top+")"),0==s.forceY().length&&s.forceY().push(0),s.width(t).height(y).x(k).y(function(a){if(void 0!==a.display)return a.display.y+a.display.y0}).color(n.map(function(a,b){return a.color=a.color||h(a,a.seriesIndex),a.color})),F.select(".nv-scatterWrap").datum(n).call(s),D.append("clipPath").attr("id","nv-edge-clip-"+i).append("rect"),B.select("#nv-edge-clip-"+i+" rect").attr("width",t).attr("height",y),F.attr("clip-path",r?"url(#nv-edge-clip-"+i+")":"");var G=d3.svg.area().defined(m).x(function(a,b){return c(k(a,b))}).y0(function(a){return d(a.display.y0)}).y1(v).interpolate(q),H=d3.svg.area().defined(m).x(function(a,b){return c(k(a,b))}).y0(function(a){return d(a.display.y0)}).y1(function(a){return d(a.display.y0)}),I=F.select(".nv-areaWrap").selectAll("path.nv-area").data(function(a){return a});I.enter().append("path").attr("class",function(a,b){return"nv-area nv-area-"+b}).attr("d",function(a,b){return H(a.values,a.seriesIndex)}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0),w.areaMouseover({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),w.areaMouseout({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}).on("click",function(a,b){d3.select(this).classed("hover",!1),w.areaClick({point:a,series:a.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:a.seriesIndex})}),I.exit().remove(),I.style("fill",function(a,b){return a.color||h(a,a.seriesIndex)}).style("stroke",function(a,b){return a.color||h(a,a.seriesIndex)}),I.watchTransition(x,"stackedArea path").attr("d",function(a,b){return G(a.values,b)}),s.dispatch.on("elementMouseover.area",function(a){F.select(".nv-chart-"+i+" .nv-area-"+a.seriesIndex).classed("hover",!0)}),s.dispatch.on("elementMouseout.area",function(a){F.select(".nv-chart-"+i+" .nv-area-"+a.seriesIndex).classed("hover",!1)}),b.d3_stackedOffset_stackPercent=function(a){var b,c,d,e=a.length,f=a[0].length,g=[];for(c=0;c<f;++c){for(b=0,d=0;b<z.length;b++)d+=l(z[b].values[c]);if(d)for(b=0;b<e;b++)a[b][c][1]/=d;else for(b=0;b<e;b++)a[b][c][1]=0}for(c=0;c<f;++c)g[c]=0;return g}}),x.renderEnd("stackedArea immediate"),b}var c,d,e={top:0,right:0,bottom:0,left:0},f=960,g=500,h=a.utils.defaultColor(),i=Math.floor(1e5*Math.random()),j=null,k=function(a){return a.x},l=function(a){return a.y},m=function(a,b){return!isNaN(l(a,b))&&null!==l(a,b)},n="stack",o="zero",p="default",q="linear",r=!1,s=a.models.scatter(),t=250,u=function(a,b,c){a.display={y:c,y0:b}},v=function(a){return d(a.display.y+a.display.y0)},w=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");s.pointSize(2.2).pointDomain([2.2,2.2]);var x=a.utils.renderWatch(w,t);return b.dispatch=w,b.scatter=s,s.dispatch.on("elementClick",function(){w.elementClick.apply(this,arguments)}),s.dispatch.on("elementMouseover",function(){w.elementMouseover.apply(this,arguments)}),s.dispatch.on("elementMouseout",function(){w.elementMouseout.apply(this,arguments)}),b.interpolate=function(a){return arguments.length?(q=a,b):q},b.duration=function(a){return arguments.length?(t=a,x.reset(t),s.duration(t),b):t},b.dispatch=w,b.scatter=s,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return f},set:function(a){f=a}},height:{get:function(){return g},set:function(a){g=a}},defined:{get:function(){return m},set:function(a){m=a}},clipEdge:{get:function(){return r},set:function(a){r=a}},offset:{get:function(){return o},set:function(a){o=a}},order:{get:function(){return p},set:function(a){p=a}},interpolate:{get:function(){return q},set:function(a){q=a}},x:{get:function(){return k},set:function(a){k=d3.functor(a)}},y:{get:function(){return l},set:function(a){l=d3.functor(a)}},areaY1:{get:function(){return v},set:function(a){v=d3.functor(a)}},transformData:{get:function(){return u},set:function(a){u=d3.functor(a)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left}},color:{get:function(){return h},set:function(b){h=a.utils.getColor(b)}},style:{get:function(){return n},set:function(a){switch(n=a){case"stack":b.offset("zero"),b.order("default");break;case"stream":b.offset("wiggle"),b.order("inside-out");break;case"stream-center":b.offset("silhouette"),b.order("inside-out");break;case"expand":b.offset("expand"),b.order("default");break;case"stack_percent":b.offset(b.d3_stackedOffset_stackPercent),b.order("default")}}},duration:{get:function(){return t},set:function(a){t=a,x.reset(t),s.duration(t)}}}),a.utils.inheritOptions(b,s),a.utils.initOptions(b),b},a.models.stackedAreaChart=function(){"use strict";function b(k){return L.reset(),L.models(e),u&&L.models(f),v&&L.models(g),k.each(function(k){function D(){u&&X.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+T+")").transition().duration(I).call(f)}function L(){if(v){if("expand"===e.style()||"stack_percent"===e.style()){var a=g.tickFormat();J&&a===P||(J=a),g.tickFormat(P)}else J&&(g.tickFormat(J),J=null);X.select(".nv-focus .nv-y.nv-axis").transition().duration(0).call(g)}}function Q(a){X.select(".nv-focus .nv-stackedWrap").datum(k.filter(function(a){return!a.disabled}).map(function(b,c){return{key:b.key,area:b.area,classed:b.classed,values:b.values.filter(function(b,c){return e.x()(b,c)>=a[0]&&e.x()(b,c)<=a[1]}),disableTooltip:b.disableTooltip}})).transition().duration(I).call(e),D(),L()}var R=d3.select(this);a.utils.initSVG(R);var S=a.utils.availableWidth(o,R,m),T=a.utils.availableHeight(p,R,m)-(x?l.height():0);if(b.update=function(){R.transition().duration(I).call(b)},b.container=this,B.setter(O(k),b.update).getter(N(k)).update(),B.disabled=k.map(function(a){return!!a.disabled}),!C){var U;C={};for(U in B)B[U]instanceof Array?C[U]=B[U].slice(0):C[U]=B[U]}if(!(k&&k.length&&k.filter(function(a){return a.values.length}).length))return a.utils.noData(b,R),b;R.selectAll(".nv-noData").remove(),c=e.xScale(),d=e.yScale();var V=R.selectAll("g.nv-wrap.nv-stackedAreaChart").data([k]),W=V.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),X=V.select("g");W.append("g").attr("class","nv-legendWrap"),W.append("g").attr("class","nv-controlsWrap");var Y=W.append("g").attr("class","nv-focus");Y.append("g").attr("class","nv-background").append("rect"),Y.append("g").attr("class","nv-x nv-axis"),Y.append("g").attr("class","nv-y nv-axis"),Y.append("g").attr("class","nv-stackedWrap"),Y.append("g").attr("class","nv-interactive");W.append("g").attr("class","nv-focusWrap");if(s){var Z=r&&"top"===t?S-F:S;if(h.width(Z),X.select(".nv-legendWrap").datum(k).call(h),"bottom"===t){var $=f.height();m.bottom=Math.max(h.height()+$,m.bottom),T=a.utils.availableHeight(p,R,m)-(x?l.height():0);var _=T+$;X.select(".nv-legendWrap").attr("transform","translate(0,"+_+")")}else"top"===t&&(n||m.top==h.height()||(m.top=h.height(),T=a.utils.availableHeight(p,R,m)-(x?l.height():0)),X.select(".nv-legendWrap").attr("transform","translate("+(S-Z)+","+-m.top+")"))}else X.select(".nv-legendWrap").selectAll("*").remove();if(r){var aa=[{key:H.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=e.style(),style:"stack"},{key:H.stream||"Stream",metaKey:"Stream",disabled:"stream"!=e.style(),style:"stream"},{key:H.stream_center||"Stream Center",metaKey:"Stream_Center",disabled:"stream_center"!=e.style(),style:"stream-center"},{key:H.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=e.style(),style:"expand"},{key:H.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=e.style(),style:"stack_percent"}];F=G.length/3*260,aa=aa.filter(function(a){return-1!==G.indexOf(a.metaKey)}),i.width(F).color(["#444","#444","#444"]),X.select(".nv-controlsWrap").datum(aa).call(i);var ba=Math.max(i.height(),s&&"top"===t?h.height():0);m.top!=ba&&(m.top=ba,T=a.utils.availableHeight(p,R,m)-(x?l.height():0)),X.select(".nv-controlsWrap").attr("transform","translate(0,"+-m.top+")")}else X.select(".nv-controlsWrap").selectAll("*").remove();V.attr("transform","translate("+m.left+","+m.top+")"),w&&X.select(".nv-y.nv-axis").attr("transform","translate("+S+",0)"),y&&(j.width(S).height(T).margin({left:m.left,top:m.top}).svgContainer(R).xScale(c),V.select(".nv-interactive").call(j)),X.select(".nv-focus .nv-background rect").attr("width",S).attr("height",T),e.width(S).height(T).color(k.map(function(a,b){return a.color||q(a,b)}).filter(function(a,b){return!k[b].disabled}));var ca=X.select(".nv-focus .nv-stackedWrap").datum(k.filter(function(a){return!a.disabled}));if(u&&f.scale(c)._ticks(a.utils.calcTicksX(S/100,k)).tickSize(-T,0),v){var da;da="wiggle"===e.offset()?0:a.utils.calcTicksY(T/36,k),g.scale(d)._ticks(da).tickSize(-S,0)}if(x){l.width(S),X.select(".nv-focusWrap").attr("transform","translate(0,"+(T+m.bottom+l.margin().top)+")").datum(k.filter(function(a){return!a.disabled})).call(l);var ea=l.brush.empty()?l.xDomain():l.brush.extent();null!==ea&&Q(ea)}else ca.transition().call(e),D(),L();e.dispatch.on("areaClick.toggle",function(a){1===k.filter(function(a){return!a.disabled}).length?k.forEach(function(a){a.disabled=!1}):k.forEach(function(b,c){b.disabled=c!=a.seriesIndex}),B.disabled=k.map(function(a){return!!a.disabled}),E.stateChange(B),b.update()}),h.dispatch.on("stateChange",function(a){for(var c in a)B[c]=a[c];E.stateChange(B),b.update()}),i.dispatch.on("legendClick",function(a,c){a.disabled&&(aa=aa.map(function(a){return a.disabled=!0,a}),a.disabled=!1,e.style(a.style),B.style=e.style(),E.stateChange(B),b.update())}),j.dispatch.on("elementMousemove",function(c){e.clearHighlights();var d,f,g,h=[],i=0,l=!0,m=!1;if(k.filter(function(a,b){return a.seriesIndex=b,!a.disabled}).forEach(function(j,n){f=a.interactiveBisect(j.values,c.pointXValue,b.x());var o=j.values[f],p=b.y()(o,f);if(null!=p&&p>0&&(e.highlightPoint(n,f,!0),m=!0),n!==k.length-1||m||e.highlightPoint(n,f,!0),void 0!==o){void 0===d&&(d=o),void 0===g&&(g=b.xScale()(b.x()(o,f)));var r="expand"==e.style()?o.display.y:b.y()(o,f);h.push({key:j.key,value:r,color:q(j,j.seriesIndex),point:o}),z&&"expand"!=e.style()&&null!=r&&(i+=r,l=!1)}}),h.reverse(),h.length>2){var n=b.yScale().invert(c.mouseY),o=null;h.forEach(function(a,b){n=Math.abs(n);var c=Math.abs(a.point.display.y0),d=Math.abs(a.point.display.y);if(n>=c&&n<=d+c)return void(o=b)}),null!=o&&(h[o].highlight=!0)}z&&"expand"!=e.style()&&h.length>=2&&!l&&h.push({key:A,value:i,total:!0});var p=b.x()(d,f),r=j.tooltip.valueFormatter();"expand"===e.style()||"stack_percent"===e.style()?(K||(K=r),r=d3.format(".1%")):K&&(r=K,K=null),j.tooltip.valueFormatter(r).data({value:p,series:h})(),j.renderGuideLine(g)}),j.dispatch.on("elementMouseout",function(a){e.clearHighlights()}),l.dispatch.on("onBrush",function(a){Q(a)}),E.on("changeState",function(a){void 0!==a.disabled&&k.length===a.disabled.length&&(k.forEach(function(b,c){b.disabled=a.disabled[c]}),B.disabled=a.disabled),void 0!==a.style&&(e.style(a.style),M=a.style),b.update()})}),L.renderEnd("stacked Area chart immediate"),b}var c,d,e=a.models.stackedArea(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=a.models.legend(),j=a.interactiveGuideline(),k=a.models.tooltip(),l=a.models.focus(a.models.stackedArea()),m={top:10,right:25,bottom:50,left:60},n=null,o=null,p=null,q=a.utils.defaultColor(),r=!0,s=!0,t="top",u=!0,v=!0,w=!1,x=!1,y=!1,z=!0,A="TOTAL",B=a.utils.state(),C=null,D=null,E=d3.dispatch("stateChange","changeState","renderEnd"),F=250,G=["Stacked","Stream","Expanded"],H={},I=250;B.style=e.style(),f.orient("bottom").tickPadding(7),g.orient(w?"right":"left"),k.headerFormatter(function(a,b){return f.tickFormat()(a,b)}).valueFormatter(function(a,b){return g.tickFormat()(a,b)}),
|
|
12
|
+
j.tooltip.headerFormatter(function(a,b){return f.tickFormat()(a,b)}).valueFormatter(function(a,b){return null==a?"N/A":g.tickFormat()(a,b)});var J=null,K=null;i.updateState(!1);var L=a.utils.renderWatch(E),M=e.style(),N=function(a){return function(){return{active:a.map(function(a){return!a.disabled}),style:e.style()}}},O=function(a){return function(b){void 0!==b.style&&(M=b.style),void 0!==b.active&&a.forEach(function(a,c){a.disabled=!b.active[c]})}},P=d3.format("%");return e.dispatch.on("elementMouseover.tooltip",function(a){a.point.x=e.x()(a.point),a.point.y=e.y()(a.point),k.data(a).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(a){k.hidden(!0)}),b.dispatch=E,b.stacked=e,b.legend=h,b.controls=i,b.xAxis=f,b.x2Axis=l.xAxis,b.yAxis=g,b.y2Axis=l.yAxis,b.interactiveLayer=j,b.tooltip=k,b.focus=l,b.dispatch=E,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return o},set:function(a){o=a}},height:{get:function(){return p},set:function(a){p=a}},showLegend:{get:function(){return s},set:function(a){s=a}},legendPosition:{get:function(){return t},set:function(a){t=a}},showXAxis:{get:function(){return u},set:function(a){u=a}},showYAxis:{get:function(){return v},set:function(a){v=a}},defaultState:{get:function(){return C},set:function(a){C=a}},noData:{get:function(){return D},set:function(a){D=a}},showControls:{get:function(){return r},set:function(a){r=a}},controlLabels:{get:function(){return H},set:function(a){H=a}},controlOptions:{get:function(){return G},set:function(a){G=a}},showTotalInTooltip:{get:function(){return z},set:function(a){z=a}},totalLabel:{get:function(){return A},set:function(a){A=a}},focusEnable:{get:function(){return x},set:function(a){x=a}},focusHeight:{get:function(){return l.height()},set:function(a){l.height(a)}},brushExtent:{get:function(){return l.brushExtent()},set:function(a){l.brushExtent(a)}},margin:{get:function(){return m},set:function(a){void 0!==a.top&&(m.top=a.top,n=a.top),m.right=void 0!==a.right?a.right:m.right,m.bottom=void 0!==a.bottom?a.bottom:m.bottom,m.left=void 0!==a.left?a.left:m.left}},focusMargin:{get:function(){return l.margin},set:function(a){l.margin.top=void 0!==a.top?a.top:l.margin.top,l.margin.right=void 0!==a.right?a.right:l.margin.right,l.margin.bottom=void 0!==a.bottom?a.bottom:l.margin.bottom,l.margin.left=void 0!==a.left?a.left:l.margin.left}},duration:{get:function(){return I},set:function(a){I=a,L.reset(I),e.duration(I),f.duration(I),g.duration(I)}},color:{get:function(){return q},set:function(b){q=a.utils.getColor(b),h.color(q),e.color(q),l.color(q)}},x:{get:function(){return e.x()},set:function(a){e.x(a),l.x(a)}},y:{get:function(){return e.y()},set:function(a){e.y(a),l.y(a)}},rightAlignYAxis:{get:function(){return w},set:function(a){w=a,g.orient(w?"right":"left")}},useInteractiveGuideline:{get:function(){return y},set:function(a){y=!!a,b.interactive(!a),b.useVoronoi(!a),e.scatter.interactive(!a)}}}),a.utils.inheritOptions(b,e),a.utils.initOptions(b),b},a.models.stackedAreaWithFocusChart=function(){return a.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},a.models.sunburst=function(){"use strict";function b(a){return c(a)>90?180:0}function c(a){return(Math.max(0,Math.min(2*Math.PI,F(a.x)))+Math.max(0,Math.min(2*Math.PI,F(a.x+a.dx))))/2*(180/Math.PI)-90}function d(a){var b=Math.max(0,Math.min(2*Math.PI,F(a.x)));return(Math.max(0,Math.min(2*Math.PI,F(a.x+a.dx)))-b)/(2*Math.PI)}function e(a){var b=Math.max(0,Math.min(2*Math.PI,F(a.x)));return Math.max(0,Math.min(2*Math.PI,F(a.x+a.dx)))-b>z}function f(a,b){var c=d3.interpolate(F.domain(),[l.x,l.x+l.dx]),d=d3.interpolate(G.domain(),[l.y,1]),e=d3.interpolate(G.range(),[l.y?20:0,o]);return 0===b?function(){return J(a)}:function(b){return F.domain(c(b)),G.domain(d(b)).range(e(b)),J(a)}}function g(a){var b=d3.interpolate({x:a.x0,dx:a.dx0,y:a.y0,dy:a.dy0},a);return function(c){var d=b(c);return a.x0=d.x,a.dx0=d.dx,a.y0=d.y,a.dy0=d.dy,J(d)}}function h(a){var b=B(a);I[b]||(I[b]={});var c=I[b];c.dx=a.dx,c.x=a.x,c.dy=a.dy,c.y=a.y}function i(a){a.forEach(function(a){var b=B(a),c=I[b];c?(a.dx0=c.dx,a.x0=c.x,a.dy0=c.dy,a.y0=c.y):(a.dx0=a.dx,a.x0=a.x,a.dy0=a.dy,a.y0=a.y),h(a)})}function j(a){var d=v.selectAll("text"),g=v.selectAll("path");d.transition().attr("opacity",0),l=a,g.transition().duration(D).attrTween("d",f).each("end",function(d){if(d.x>=a.x&&d.x<a.x+a.dx&&d.depth>=a.depth){d3.select(this.parentNode).select("text").transition().duration(D).text(function(a){return y(a)}).attr("opacity",function(a){return e(a)?1:0}).attr("transform",function(){var e=this.getBBox().width;if(0===d.depth)return"translate("+e/2*-1+",0)";if(d.depth===a.depth)return"translate("+(G(d.y)+5)+",0)";var f=c(d),g=b(d);return 0===g?"rotate("+f+")translate("+(G(d.y)+5)+",0)":"rotate("+f+")translate("+(G(d.y)+e+5)+",0)rotate("+g+")"})}})}function k(f){return K.reset(),f.each(function(f){v=d3.select(this),m=a.utils.availableWidth(q,v,p),n=a.utils.availableHeight(r,v,p),o=Math.min(m,n)/2,G.range([0,o]);var h=v.select("g.nvd3.nv-wrap.nv-sunburst");h[0][0]?h.attr("transform","translate("+(m/2+p.left+p.right)+","+(n/2+p.top+p.bottom)+")"):h=v.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+u).attr("transform","translate("+(m/2+p.left+p.right)+","+(n/2+p.top+p.bottom)+")"),v.on("click",function(a,b){E.chartClick({data:a,index:b,pos:d3.event,id:u})}),H.value(t[s]||t.count);var k=H.nodes(f[0]).reverse();i(k);var l=h.selectAll(".arc-container").data(k,B);l.enter().append("g").attr("class","arc-container").append("path").attr("d",J).style("fill",function(a){return a.color?a.color:w(C?(a.children?a:a.parent).name:a.name)}).style("stroke","#FFF").on("click",function(a,b){j(a),E.elementClick({data:a,index:b})}).on("mouseover",function(a,b){d3.select(this).classed("hover",!0).style("opacity",.8),E.elementMouseover({data:a,color:d3.select(this).style("fill"),percent:d(a)})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1).style("opacity",1),E.elementMouseout({data:a})}).on("mousemove",function(a,b){E.elementMousemove({data:a})}),l.each(function(a){d3.select(this).select("path").transition().duration(D).attrTween("d",g)}),x&&(l.selectAll("text").remove(),l.append("text").text(function(a){return y(a)}).transition().duration(D).attr("opacity",function(a){return e(a)?1:0}).attr("transform",function(a){var d=this.getBBox().width;if(0===a.depth)return"rotate(0)translate("+d/2*-1+",0)";var e=c(a),f=b(a);return 0===f?"rotate("+e+")translate("+(G(a.y)+5)+",0)":"rotate("+e+")translate("+(G(a.y)+d+5)+",0)rotate("+f+")"})),j(k[k.length-1]),l.exit().transition().duration(D).attr("opacity",0).each("end",function(a){var b=B(a);I[b]=void 0}).remove()}),K.renderEnd("sunburst immediate"),k}var l,m,n,o,p={top:0,right:0,bottom:0,left:0},q=600,r=600,s="count",t={count:function(a){return 1},value:function(a){return a.value||a.size},size:function(a){return a.value||a.size}},u=Math.floor(1e4*Math.random()),v=null,w=a.utils.defaultColor(),x=!1,y=function(a){return"count"===s?a.name+" #"+a.value:a.name+" "+(a.value||a.size)},z=.02,A=function(a,b){return a.name>b.name},B=function(a,b){return void 0!==a.parent?a.name+"-"+a.parent.name+"-"+b:a.name},C=!0,D=500,E=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),F=d3.scale.linear().range([0,2*Math.PI]),G=d3.scale.sqrt(),H=d3.layout.partition().sort(A),I={},J=d3.svg.arc().startAngle(function(a){return Math.max(0,Math.min(2*Math.PI,F(a.x)))}).endAngle(function(a){return Math.max(0,Math.min(2*Math.PI,F(a.x+a.dx)))}).innerRadius(function(a){return Math.max(0,G(a.y))}).outerRadius(function(a){return Math.max(0,G(a.y+a.dy))}),K=a.utils.renderWatch(E);return k.dispatch=E,k.options=a.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return q},set:function(a){q=a}},height:{get:function(){return r},set:function(a){r=a}},mode:{get:function(){return s},set:function(a){s=a}},id:{get:function(){return u},set:function(a){u=a}},duration:{get:function(){return D},set:function(a){D=a}},groupColorByParent:{get:function(){return C},set:function(a){C=!!a}},showLabels:{get:function(){return x},set:function(a){x=!!a}},labelFormat:{get:function(){return y},set:function(a){y=a}},labelThreshold:{get:function(){return z},set:function(a){z=a}},sort:{get:function(){return A},set:function(a){A=a}},key:{get:function(){return B},set:function(a){B=a}},margin:{get:function(){return p},set:function(a){p.top=void 0!=a.top?a.top:p.top,p.right=void 0!=a.right?a.right:p.right,p.bottom=void 0!=a.bottom?a.bottom:p.bottom,p.left=void 0!=a.left?a.left:p.left}},color:{get:function(){return w},set:function(b){w=a.utils.getColor(b)}}}),a.utils.initOptions(k),k},a.models.sunburstChart=function(){"use strict";function b(d){return n.reset(),n.models(c),d.each(function(d){var h=d3.select(this);a.utils.initSVG(h);var i=a.utils.availableWidth(f,h,e),j=a.utils.availableHeight(g,h,e);if(b.update=function(){0===l?h.call(b):h.transition().duration(l).call(b)},b.container=h,!d||!d.length)return a.utils.noData(b,h),b;h.selectAll(".nv-noData").remove(),c.width(i).height(j).margin(e),h.call(c)}),n.renderEnd("sunburstChart immediate"),b}var c=a.models.sunburst(),d=a.models.tooltip(),e={top:30,right:20,bottom:20,left:20},f=null,g=null,h=a.utils.defaultColor(),i=!1,j=(Math.round(1e5*Math.random()),null),k=null,l=250,m=d3.dispatch("stateChange","changeState","renderEnd"),n=a.utils.renderWatch(m);return d.duration(0).headerEnabled(!1).valueFormatter(function(a){return a}),c.dispatch.on("elementMouseover.tooltip",function(a){a.series={key:a.data.name,value:a.data.value||a.data.size,color:a.color,percent:a.percent},i||(delete a.percent,delete a.series.percent),d.data(a).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(a){d.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(a){d()}),b.dispatch=m,b.sunburst=c,b.tooltip=d,b.options=a.utils.optionsFunc.bind(b),b._options=Object.create({},{noData:{get:function(){return k},set:function(a){k=a}},defaultState:{get:function(){return j},set:function(a){j=a}},showTooltipPercent:{get:function(){return i},set:function(a){i=a}},color:{get:function(){return h},set:function(a){h=a,c.color(h)}},duration:{get:function(){return l},set:function(a){l=a,n.reset(l),c.duration(l)}},margin:{get:function(){return e},set:function(a){e.top=void 0!==a.top?a.top:e.top,e.right=void 0!==a.right?a.right:e.right,e.bottom=void 0!==a.bottom?a.bottom:e.bottom,e.left=void 0!==a.left?a.left:e.left,c.margin(e)}}}),a.utils.inheritOptions(b,c),a.utils.initOptions(b),b},a.version="1.0.2"}();
|
|
13
|
+
//# sourceMappingURL=nv.d3.min.js.map
|