graphdb-workbench 2.4.1-TR4 → 2.4.2-RC1
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.
- package/dist/{0.7daec4382561aa8681d5.bundle.js → 0.c6e0a1afafc7ffdfaccc.bundle.js} +1 -1
- package/dist/{10.25c3009270232c3ad844.bundle.js → 10.2fd5d150b0f308c19b16.bundle.js} +1 -1
- package/dist/108.99fadee1ed0c7110af9a.bundle.js +1 -0
- package/dist/{11.08c502782a3bd04cb48b.bundle.js → 11.d13b4e6a939fc0b5a125.bundle.js} +1 -1
- package/dist/{114.3a6135cc10951d23cb56.bundle.js → 114.2f1bbfe1abb21122d2e1.bundle.js} +1 -1
- package/dist/{117.45f91d2cf367836dadae.bundle.js → 117.23e75248d8a499cef320.bundle.js} +1 -1
- package/dist/{12.0ca290ed18d2524f66e7.bundle.js → 12.dd3a24172cf3cdec30f0.bundle.js} +2 -2
- package/dist/{124.7ce2385e2ce2ac41a255.bundle.js → 124.8e3d5ba12c298ea9a439.bundle.js} +1 -1
- package/dist/{128.4eb95500c74ddcbc0ec1.bundle.js → 128.280921c83837d6b5ed1e.bundle.js} +1 -1
- package/dist/13.ac00d726d1145cb0e057.bundle.js +1 -0
- package/dist/{130.8d0c570a8363e55b4892.bundle.js → 130.9aea5c200bad449041e5.bundle.js} +1 -1
- package/dist/{133.c9432441d39dbdf45a46.bundle.js → 133.7ff3260122aed5f9da82.bundle.js} +1 -1
- package/dist/{134.64ab677e16aa2b0c78b1.bundle.js → 134.937aed94c3cba12e70de.bundle.js} +1 -1
- package/dist/{136.22f6c4a19299925123a0.bundle.js → 136.50ad256ff91ae8bd138c.bundle.js} +1 -1
- package/dist/{137.802084605202b8b7aef1.bundle.js → 137.19836eabf5f16be529c0.bundle.js} +1 -1
- package/dist/{138.1eae7a838df0b1e52ff4.bundle.js → 138.3d79db7fc7908d986c2d.bundle.js} +1 -1
- package/dist/14.82b9ba9a0a77131aa582.bundle.js +1 -0
- package/dist/{144.d2120bcd066b96e7ee58.bundle.js → 144.24d2001adcd0546ce679.bundle.js} +1 -1
- package/dist/{146.a2f5b077f3eec4961a4b.bundle.js → 146.0bf605fa5b7cc102937f.bundle.js} +1 -1
- package/dist/{15.54781c280e23072b66c5.bundle.js → 15.b27c1c98f320b78e704c.bundle.js} +1 -1
- package/dist/{150.f3a633da2c7c2b9cd7c4.bundle.js → 150.7224dc087612aa0ff0c1.bundle.js} +1 -1
- package/dist/{153.f710bf5c73f7d736a4b1.bundle.js → 153.8fbeed8e7e94213c6df1.bundle.js} +1 -1
- package/dist/{155.46f2a94df187ed492591.bundle.js → 155.68e389692623c7b68878.bundle.js} +1 -1
- package/dist/{16.24206eca9306f6f153d6.bundle.js → 16.9f43f2a2cb3de6b50964.bundle.js} +1 -1
- package/dist/168.34a1790ea589d9926a97.bundle.js +1 -1
- package/dist/{17.f3d91ad6fab1a190a416.bundle.js → 17.7a20974aaea2122ed42f.bundle.js} +1 -1
- package/dist/170.e24cfa80d3f51df2b1b5.bundle.js +1 -0
- package/dist/171.49aabfdb3574cef3d14b.bundle.js +1 -0
- package/dist/173.5e3fea538a2a2d5b5c0c.bundle.js +1 -1
- package/dist/{18.119e4e696a9b2da67a3f.bundle.js → 18.db18b987a6ea55fddc4a.bundle.js} +2 -2
- package/dist/{19.f461a770949b2e409d05.bundle.js → 19.9a73670b7772d8bf1969.bundle.js} +1 -1
- package/dist/{2.308618aec7201e8045bd.bundle.js → 2.888ee146d785447620e1.bundle.js} +2 -2
- package/dist/{20.635488a03f910fa4518b.bundle.js → 20.918905a6efc81c27dcf6.bundle.js} +1 -1
- package/dist/200.76fd30afe28687f92b15.bundle.js +1 -1
- package/dist/{21.9bbe46c05fe4a34a9cf8.bundle.js → 21.fa61daf65c6bc29e06a2.bundle.js} +1 -1
- package/dist/{22.0ae31e473d0af170b177.bundle.js → 22.197477933275583c65cb.bundle.js} +2 -2
- package/dist/23.dc3e430b47f766cc2366.bundle.js +1 -1
- package/dist/{24.8d3f4b05a5101a6a685b.bundle.js → 24.4c9b73b3909403e82055.bundle.js} +1 -1
- package/dist/{31.9a07cc30c05a1a698b98.bundle.js → 25.71b2ceec450a85158ba8.bundle.js} +2 -2
- package/dist/{25.2a489b131bab984243fa.bundle.js → 26.60c61d8ca245bad6597d.bundle.js} +1 -1
- package/dist/{26.377d1bc26079a8159e3c.bundle.js → 27.56996601ec3795c65c3d.bundle.js} +1 -1
- package/dist/{27.60396d05fddda4894ce3.bundle.js → 28.79f65106f49c5036504b.bundle.js} +1 -1
- package/dist/{28.aebd82e778f3fcd55219.bundle.js → 29.3f41e0d8e9f58188a02b.bundle.js} +1 -1
- package/dist/{29.9a6f92841eb0a4870045.bundle.js → 30.4712f3e92b6469d3d8dd.bundle.js} +1 -1
- package/dist/{30.acdf84b0bcd3f178c2fd.bundle.js → 31.a05a0072057c061cd0dc.bundle.js} +1 -1
- package/dist/{32.f88a50038df0d43ccfc4.bundle.js → 32.27c9ee63125cca89f908.bundle.js} +1 -1
- package/dist/33.0433fbc733c2359c389c.bundle.js +1 -0
- package/dist/{33.d4463e934ae20163667d.bundle.js → 34.e5150a1b66426d5f5af7.bundle.js} +1 -1
- package/dist/{34.3046d2d28129a67d4483.bundle.js → 35.0766d50ada31ef79b4b0.bundle.js} +1 -1
- package/dist/{35.69758da395b815346a2f.bundle.js → 36.25471fd55c32f7f02568.bundle.js} +1 -1
- package/dist/{36.8f7908db8f70bbd3318c.bundle.js → 37.356f6302c079cea446b6.bundle.js} +1 -1
- package/dist/{37.ac5b9eaa607c43ec69df.bundle.js → 38.94b303a3b944480a495a.bundle.js} +1 -1
- package/dist/{38.b776c45fe26516ca8160.bundle.js → 39.a5409bc3fec719768f37.bundle.js} +1 -1
- package/dist/{4.870de73e2e763f35280a.bundle.js → 4.83e133ed3a567a27c699.bundle.js} +1 -1
- package/dist/{39.c74b936329bf2477fbdb.bundle.js → 40.61f5dedc12beb42c1f44.bundle.js} +1 -1
- package/dist/{40.2c1f1cc8c521b8209885.bundle.js → 41.62789a75dd9dddbc1297.bundle.js} +1 -1
- package/dist/42.2226eabae24538761847.bundle.js +1 -0
- package/dist/{42.b6c558e4b660bdb0be4d.bundle.js → 43.3876fb2ec9b5b6b646df.bundle.js} +1 -1
- package/dist/{43.42c27c3277a302252fc5.bundle.js → 44.e63112a4f3ee65c29a0a.bundle.js} +1 -1
- package/dist/{44.96d4cf9f701897a90fce.bundle.js → 45.2b1cf89f777bb5fda383.bundle.js} +1 -1
- package/dist/{45.2c4bc26cf5fbe9b84cb6.bundle.js → 46.f07b159fc6cc07492e2b.bundle.js} +1 -1
- package/dist/{46.d63a366dbcb649ed1fbb.bundle.js → 47.1bacc6e38fde37677380.bundle.js} +1 -1
- package/dist/{47.0ecc5620f91346c3e7d4.bundle.js → 48.345db2f50dae9ec7d11a.bundle.js} +1 -1
- package/dist/49.b0d0df9a0bd2458a38f7.bundle.js +1 -0
- package/dist/{5.adea5d522be945b9d8d3.bundle.js → 5.93d75276b7a283deddc8.bundle.js} +1 -1
- package/dist/50.3e3c5da47d3b02a13948.bundle.js +1 -0
- package/dist/{50.6695e410303c03ad694c.bundle.js → 51.9a911ea64d2bbe27a6b8.bundle.js} +1 -1
- package/dist/{51.95f30e28e67312c9df42.bundle.js → 52.0673b651acdd40122168.bundle.js} +1 -1
- package/dist/{52.b0f496f823a213178075.bundle.js → 53.9b5d43c58aa368765457.bundle.js} +1 -1
- package/dist/{53.716d3c94c3d0959a26a8.bundle.js → 54.028884d762d361c54c23.bundle.js} +1 -1
- package/dist/{54.44b8cf059fe5ba4bf144.bundle.js → 55.4966f01604a6c84d301e.bundle.js} +1 -1
- package/dist/{55.891486b3fa68d44f3a52.bundle.js → 56.da176c234be30906ed18.bundle.js} +1 -1
- package/dist/{56.3548e08f4add9390e771.bundle.js → 57.413a1beccae08b5eb787.bundle.js} +1 -1
- package/dist/{57.9f0dbb2e3b44c19c8dcd.bundle.js → 58.8ba78ec049c5c97e4391.bundle.js} +1 -1
- package/dist/{58.a76e6e35994e2cb1a7f6.bundle.js → 59.25436d0038d7be337d24.bundle.js} +1 -1
- package/dist/{59.6dfdee0f9651ff9aa2f6.bundle.js → 60.571f2c6fcdec505acb5a.bundle.js} +1 -1
- package/dist/{60.2b410d552e467b555529.bundle.js → 61.8dca89c50677ace894ee.bundle.js} +1 -1
- package/dist/{61.03a75a3d8faf4c165a0c.bundle.js → 62.3a5f8d2165a2f6058360.bundle.js} +1 -1
- package/dist/{62.86ba4d7804758d2e3f48.bundle.js → 63.2ea3fe6eb8be5ab57564.bundle.js} +1 -1
- package/dist/{63.5e2ca7ce2ea95b397fe7.bundle.js → 64.4e84a027a9f1d66a69db.bundle.js} +1 -1
- package/dist/{64.6a8854031771d4d4ef74.bundle.js → 65.da0571f9102cc340a6b9.bundle.js} +1 -1
- package/dist/{65.9e598abd11534c42a0c1.bundle.js → 66.104f9f5e48af12f94fbe.bundle.js} +1 -1
- package/dist/{7.0af6bb74bf88aa8f14ca.bundle.js → 7.39ff1f0ec65d7d7b73f5.bundle.js} +2 -2
- package/dist/{72.c82f209992278009e1a3.bundle.js → 72.25f264649b4e7f9dd670.bundle.js} +1 -1
- package/dist/{75.13e0f311c6c98067c4f8.bundle.js → 75.89f4b3371fc1c8679763.bundle.js} +1 -1
- package/dist/76.7d3ef13875f7533cc029.bundle.js +1 -0
- package/dist/{77.0373cd7f1c2851df3908.bundle.js → 77.122517ab9f81c08963fd.bundle.js} +1 -1
- package/dist/81.824c9bdd22dd196eb3d9.bundle.js +1 -0
- package/dist/{83.a6c2ad332de0ee224136.bundle.js → 83.0837870d0e1682a6487c.bundle.js} +1 -1
- package/dist/9.0e4d38f2390c619f5b26.bundle.js +1 -0
- package/dist/{bundle.c7f3e729665657fc72ff.bundle.js → bundle.5124691819d99ff5da1d.bundle.js} +12 -12
- package/dist/css/bootstrap-graphdb-theme.css +0 -4
- package/dist/css/new-sparql.css +31 -1
- package/dist/index.html +4 -4
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +14 -13
- package/dist/js/angular/core/directives/queryeditor/templates/query-editor.html +4 -23
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/security/templates/user.html +1 -1
- package/dist/license-checker.json +2 -2
- package/dist/{main.a81aea585f94a768d336.css → main.3ac2b4b19f56209c6467.css} +1 -1
- package/dist/pages/aclmanagement.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +4 -4
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +11 -11
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +1 -1
- package/dist/pages/jdbc-create.html +5 -5
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +2 -2
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +2 -2
- package/dist/pages/repository.html +2 -2
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-template-create.html +5 -5
- package/dist/pages/sparql.html +3 -3
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger/index.html +27 -27
- package/package.json +1 -1
- package/dist/108.83bb7ce803f462882200.bundle.js +0 -1
- package/dist/13.6a3e4e38a9efa1adf29e.bundle.js +0 -1
- package/dist/14.8343a1e9afdb39f1c2dc.bundle.js +0 -1
- package/dist/170.d5527024ac9107b542c3.bundle.js +0 -1
- package/dist/171.c0e7ce3fd59ef1bfc4f5.bundle.js +0 -1
- package/dist/41.ca5e37c70938b397f260.bundle.js +0 -1
- package/dist/48.f8b0ea5f9306e24ac2d0.bundle.js +0 -1
- package/dist/49.3da99bdb2271cf2adc7b.bundle.js +0 -1
- package/dist/66.7b18071c05eb5efb213b.bundle.js +0 -1
- package/dist/76.44bdcc2130c6a744bc55.bundle.js +0 -1
- package/dist/81.c14757a485d616ca95ba.bundle.js +0 -1
- package/dist/9.1e2a1467755135bb1717.bundle.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[15,16,37,52,53,54,55,56,57,58,59,60,131,133],{190:function(t,e,n){"use strict";n.r(e);n(6),n(23),n(81),n(22),n(297),n(319);angular.module("graphdb.framework.jmx.resources",["toastr","ui.bootstrap","nvd3","graphdb.framework.jmx.resources.controllers","graphdb.framework.core.services.repositories","graphdb.framework.core.directives"])},305:function(t,e,n){var r,i;r=[n(304)],void 0===(i=function(){var e;return(e={dev:!1}).tooltip=e.tooltip||{},e.utils=e.utils||{},e.models=e.models||{},e.charts={},e.logs={},e.dom={},"undefined"==typeof d3&&(d3=n(297)),e.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new 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}),e.dev&&(e.dispatch.on("render_start",(function(t){e.logs.startTime=+new Date})),e.dispatch.on("render_end",(function(t){e.logs.endTime=+new Date,e.logs.totalTime=e.logs.endTime-e.logs.startTime,e.log("total",e.logs.totalTime)}))),e.log=function(){if(e.dev&&window.console&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(e.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind){var t=Function.prototype.bind.call(console.log,console);t.apply(console,arguments)}return arguments[arguments.length-1]},e.deprecated=function(t,e){console&&console.warn&&console.warn("nvd3 warning: `"+t+"` has been deprecated. ",e||"")},e.render=function(t){t=t||1,e.render.active=!0,e.dispatch.render_start();var n=function(){for(var r,i,a=0;a<t&&(i=e.render.queue[a]);a++)r=i.generate(),typeof i.callback==typeof Function&&i.callback(r);e.render.queue.splice(0,a),e.render.queue.length?setTimeout(n):(e.dispatch.render_end(),e.render.active=!1)};setTimeout(n)},e.render.active=!1,e.render.queue=[],e.addGraph=function(t){typeof arguments[0]==typeof Function&&(t={generate:arguments[0],callback:arguments[1]}),e.render.queue.push(t),e.render.active||e.render()},t.exports=e,"undefined"!=typeof window&&(window.nv=e),e.dom.write=function(t){return void 0!==window.fastdom?fastdom.mutate(t):t()},e.dom.read=function(t){return void 0!==window.fastdom?fastdom.measure(t):t()},e.interactiveGuideline=function(){"use strict";var t={left:0,top:0},n=null,r=null,i=d3.scale.linear(),a=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick","elementMouseDown","elementMouseUp"),o=!0,s=null,l=e.models.tooltip(),u=window.ActiveXObject;function c(d){d.each((function(d){var f=d3.select(this),p=n||960,h=r||400,g=f.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([d]);function v(){var e=d3.event.clientX-this.getBoundingClientRect().left,n=d3.event.clientY-this.getBoundingClientRect().top,r=!0,o=!1;if(u&&(e=d3.event.offsetX,n=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(r=!1),d3.event.target.className.baseVal.match("nv-legend")&&(o=!0)),r&&(e-=t.left,n-=t.top),"mouseout"===d3.event.type||e<0||n<0||e>p||n>h||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||o){if(u&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(l.nvPointerEventsClass)))return;return a.elementMouseout({mouseX:e,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0)}l.hidden(!1);var s=void 0;if("function"==typeof i.rangeBands){var d=d3.bisect(i.range(),e)-1;if(!(i.range()[d]+i.rangeBand()>=e))return a.elementMouseout({mouseX:e,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0);s=i.domain()[d3.bisect(i.range(),e)-1]}else s=i.invert(e);a.elementMousemove({mouseX:e,mouseY:n,pointXValue:s}),"dblclick"===d3.event.type&&a.elementDblclick({mouseX:e,mouseY:n,pointXValue:s}),"click"===d3.event.type&&a.elementClick({mouseX:e,mouseY:n,pointXValue:s}),"mousedown"===d3.event.type&&a.elementMouseDown({mouseX:e,mouseY:n,pointXValue:s}),"mouseup"===d3.event.type&&a.elementMouseUp({mouseX:e,mouseY:n,pointXValue:s})}g.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(t){o&&(c.guideLine&&c.guideLine.attr("x1")===t||e.dom.write((function(){var n=g.select(".nv-interactiveGuideLine").selectAll("line").data(null!=t?[e.utils.NaNtoZero(t)]:[],String);n.enter().append("line").attr("class","nv-guideline").attr("x1",(function(t){return t})).attr("x2",(function(t){return t})).attr("y1",h).attr("y2",0),n.exit().remove()})))})}))}return l.duration(0).hideDelay(0).hidden(!1),c.dispatch=a,c.tooltip=l,c.margin=function(e){return arguments.length?(t.top=void 0!==e.top?e.top:t.top,t.left=void 0!==e.left?e.left:t.left,c):t},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?(o=t,c):o},c.svgContainer=function(t){return arguments.length?(s=t,c):s},c},e.interactiveBisect=function(t,e,n){"use strict";if(!(t instanceof Array))return null;var r;r="function"!=typeof n?function(t){return t.x}:n;var i=d3.bisector((function(t,e){return r(t)-e})).left,a=d3.max([0,i(t,e)-1]),o=r(t[a]);if(void 0===o&&(o=a),o===e)return a;var s=d3.min([a+1,t.length-1]),l=r(t[s]);return void 0===l&&(l=s),Math.abs(l-e)>=Math.abs(o-e)?a:s},e.nearestValueIndex=function(t,e,n){"use strict";var r=1/0,i=null;return t.forEach((function(t,a){var o=Math.abs(e-t);null!=t&&o<=r&&o<n&&(r=o,i=a)})),i},e.models.tooltip=function(){"use strict";var t="nvtooltip-"+Math.floor(1e5*Math.random()),n=null,r="w",i=25,a=0,o=null,s=!0,l=200,u=null,c={left:null,top:null},d=!0,f=100,p=!0,h=function(t,e,n){return t},g=function(t){return t},v=function(t,e){return t},m=function(t,e){if(null===t)return"";var n=d3.select(document.createElement("table"));p&&n.selectAll("thead").data([t]).enter().append("thead").append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(g(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 v(t.key,e)})),r.append("td").classed("value",!0).html((function(t,e){return h(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("%")(t.percent)+")"})),r.selectAll("td").each((function(t){if(t.highlight){var e=d3.scale.linear().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},y=function(){var t={left:null!==d3.event?d3.event.clientX:0,top:null!==d3.event?d3.event.clientY:0};if("none"!=getComputedStyle(document.body).transform){var e=document.body.getBoundingClientRect();t.left-=e.left,t.top-=e.top}return t},x=function(){e.dom.read((function(){var t=y(),e=function(t){var e,n,a,o=u.node().offsetHeight,s=u.node().offsetWidth,l=document.documentElement.clientWidth,c=document.documentElement.clientHeight;switch(r){case"e":e=-s-i,n=-o/2,t.left+e<0&&(e=i),(a=t.top+n)<0&&(n-=a),(a=t.top+n+o)>c&&(n-=a-c);break;case"w":e=i,n=-o/2,t.left+e+s>l&&(e=-s-i),(a=t.top+n)<0&&(n-=a),(a=t.top+n+o)>c&&(n-=a-c);break;case"n":e=-s/2-5,n=i,t.top+n+o>c&&(n=-o-i),(a=t.left+e)<0&&(e-=a),(a=t.left+e+s)>l&&(e-=a-l);break;case"s":e=-s/2,n=-o-i,t.top+n<0&&(n=i),(a=t.left+e)<0&&(e-=a),(a=t.left+e+s)>l&&(e-=a-l);break;case"center":e=-s/2,n=-o/2;break;default:e=0,n=0}return{left:e,top:n}}(t),n=t.left+e.left,a=t.top+e.top;if(s)u.interrupt().transition().delay(l).duration(0).style("opacity",0);else{var o="translate("+c.left+"px, "+c.top+"px)",d="translate("+Math.round(n)+"px, "+Math.round(a)+"px)",p=d3.interpolateString(o,d),h=u.style("opacity")<.1;u.interrupt().transition().duration(h?0:f).styleTween("transform",(function(t){return p}),"important").styleTween("-webkit-transform",(function(t){return p})).style("-ms-transform",d).style("opacity",1)}c.left=n,c.top=a}))};function b(){if(d&&function(t){if(t&&t.series){if(e.utils.isArray(t.series))return!0;if(e.utils.isObject(t.series))return t.series=[t.series],!0}return!1}(n))return e.dom.write((function(){u&&u.node()||((u=d3.select(document.body).select("#"+t).data([1])).enter().append("div").attr("class","nvtooltip "+(o||"xy-tooltip")).attr("id",t).style("top",0).style("left",0).style("opacity",0).style("position","fixed").selectAll("div, table, td, tr").classed("nv-pointer-events-none",!0).classed("nv-pointer-events-none",!0),u.exit().remove());var e=m(n,u.node());e&&(u.node().innerHTML=e),x()})),b}return b.nvPointerEventsClass="nv-pointer-events-none",b.options=e.utils.optionsFunc.bind(b),b._options=Object.create({},{duration:{get:function(){return f},set:function(t){f=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 a},set:function(t){a=t}},classes:{get:function(){return o},set:function(t){o=t}},enabled:{get:function(){return d},set:function(t){d=t}},hideDelay:{get:function(){return l},set:function(t){l=t}},contentGenerator:{get:function(){return m},set:function(t){m=t}},valueFormatter:{get:function(){return h},set:function(t){h=t}},headerFormatter:{get:function(){return g},set:function(t){g=t}},keyFormatter:{get:function(){return v},set:function(t){v=t}},headerEnabled:{get:function(){return p},set:function(t){p=t}},position:{get:function(){return y},set:function(t){y=t}},chartContainer:{get:function(){return document.body},set:function(t){e.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(t){e.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(t){e.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return s},set:function(t){s!=t&&(s=!!t,b())}},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 t},set:function(t){}}}),e.utils.initOptions(b),b},e.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},e.utils.isArray=Array.isArray,e.utils.isObject=function(t){return null!==t&&"object"==typeof t},e.utils.isFunction=function(t){return"function"==typeof t},e.utils.isDate=function(t){return"[object Date]"===toString.call(t)},e.utils.isNumber=function(t){return!isNaN(t)&&"number"==typeof t},e.utils.windowResize=function(t){return window.addEventListener?window.addEventListener("resize",t):e.log("ERROR: Failed to bind to window.resize with: ",t),{callback:t,clear:function(){window.removeEventListener("resize",t)}}},e.utils.getColor=function(t){if(void 0===t)return e.utils.defaultColor();if(e.utils.isArray(t)){var n=d3.scale.ordinal().range(t);return function(t,e){var r=void 0===e?t:e;return t.color||n(r)}}return t},e.utils.defaultColor=function(){return e.utils.getColor(d3.scale.category20().range())},e.utils.customTheme=function(t,n,r){n=n||function(t){return t.key};var i=(r=r||d3.scale.category20().range()).length;return function(a,o){var s=n(a);return e.utils.isFunction(t[s])?t[s]():void 0!==t[s]?t[s]:(i||(i=r.length),r[i-=1])}},e.utils.pjax=function(t,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),e.utils.pjax(t,n)}))};d3.selectAll(t).on("click",(function(){history.pushState(this.href,this.textContent,this.href),r(this.href),d3.event.preventDefault()})),d3.select(window).on("popstate",(function(){d3.event.state&&r(d3.event.state)}))},e.utils.calcApproxTextWidth=function(t){if(e.utils.isFunction(t.style)&&e.utils.isFunction(t.text)){var n=parseInt(t.style("font-size").replace("px",""),10),r=t.text().length;return e.utils.NaNtoZero(r*n*.5)}return 0},e.utils.NaNtoZero=function(t){return!e.utils.isNumber(t)||isNaN(t)||null===t||t===1/0||t===-1/0?0:t},d3.selection.prototype.watchTransition=function(t){var e=[this].concat([].slice.call(arguments,1));return t.transition.apply(t,e)},e.utils.renderWatch=function(t,n){if(!(this instanceof e.utils.renderWatch))return new e.utils.renderWatch(t,n);var r=void 0!==n?n:250,i=[],a=this;this.models=function(t){return(t=[].slice.call(arguments,0)).forEach((function(t){var e;t.__rendered=!1,(e=t).dispatch.on("renderEnd",(function(t){e.__rendered=!0,a.renderEnd("model")})),i.indexOf(t)<0&&i.push(t)})),this},this.reset=function(t){void 0!==t&&(r=t),i=[]},this.transition=function(t,e,n){if(n=(e=arguments.length>1?[].slice.call(arguments,1):[]).length>1?e.pop():void 0!==r?r:250,t.__rendered=!1,i.indexOf(t)<0&&i.push(t),0===n)return t.__rendered=!0,t.delay=function(){return this},t.duration=function(){return this},t;0===t.length||t.every((function(t){return!t.length}))?t.__rendered=!0:t.__rendered=!1;var o=0;return t.transition().duration(n).each((function(){++o})).each("end",(function(n,r){0==--o&&(t.__rendered=!0,a.renderEnd.apply(this,e))}))},this.renderEnd=function(){i.every((function(t){return t.__rendered}))&&(i.forEach((function(t){t.__rendered=!1})),t.renderEnd.apply(this,arguments))}},e.utils.deepExtend=function(t){var n=arguments.length>1?[].slice.call(arguments,1):[];n.forEach((function(n){for(var r in n){var i=e.utils.isArray(t[r]),a=e.utils.isObject(t[r]),o=e.utils.isObject(n[r]);a&&!i&&o?e.utils.deepExtend(t[r],n[r]):t[r]=n[r]}}))},e.utils.state=function(){if(!(this instanceof e.utils.state))return new e.utils.state;var t={},n=function(){},r=function(){return{}},i=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(t){i=i||{},e.utils.deepExtend(i,t)};var a=function(){var e=r();if(JSON.stringify(e)===JSON.stringify(t))return!1;for(var n in e)void 0===t[n]&&(t[n]={}),t[n]=e[n];return!0};this.update=function(){i&&(n(i,!1),i=null),a.call(this)&&this.dispatch.change(t)}},e.utils.optionsFunc=function(t){return t&&d3.map(t).forEach(function(t,n){e.utils.isFunction(this[t])&&this[t](n)}.bind(this)),this},e.utils.calcTicksX=function(t,n){for(var r=1,i=0;i<n.length;i+=1){var a=n[i]&&n[i].values?n[i].values.length:0;r=a>r?a:r}return e.log("Requested number of ticks: ",t),e.log("Calculated max values to be: ",r),t=(t=t>r?t=r-1:t)<1?1:t,t=Math.floor(t),e.log("Calculating tick count as: ",t),t},e.utils.calcTicksY=function(t,n){return e.utils.calcTicksX(t,n)},e.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]})},e.utils.initOptions=function(t){t._overrides=t._overrides||{};var n=Object.getOwnPropertyNames(t._options||{}),r=Object.getOwnPropertyNames(t._calls||{});for(var i in n=n.concat(r))e.utils.initOption(t,n[i])},e.utils.inheritOptionsD3=function(t,e,n){t._d3options=n.concat(t._d3options||[]),t._d3options=(t._d3options||[]).filter((function(t,e,n){return n.indexOf(t)===e})),n.unshift(e),n.unshift(t),d3.rebind.apply(this,n)},e.utils.arrayUnique=function(t){return t.sort().filter((function(e,n){return!n||e!=t[n-1]}))},e.utils.symbolMap=d3.map(),e.utils.symbol=function(){var t,n=64;function r(r,i){var a=t.call(this,r,i),o=n.call(this,r,i);return-1!==d3.svg.symbolTypes.indexOf(a)?d3.svg.symbol().type(a).size(o)():e.utils.symbolMap.get(a)(o)}return r.type=function(e){return arguments.length?(t=d3.functor(e),r):t},r.size=function(t){return arguments.length?(n=d3.functor(t),r):n},r},e.utils.inheritOptions=function(t,n){var r=Object.getOwnPropertyNames(n._options||{}),i=Object.getOwnPropertyNames(n._calls||{}),a=n._inherited||[],o=n._d3options||[],s=r.concat(i).concat(a).concat(o);s.unshift(n),s.unshift(t),d3.rebind.apply(this,s),t._inherited=e.utils.arrayUnique(r.concat(i).concat(a).concat(r).concat(t._inherited||[])),t._d3options=e.utils.arrayUnique(o.concat(t._d3options||[]))},e.utils.initSVG=function(t){t.classed({"nvd3-svg":!0})},e.utils.sanitizeHeight=function(t,e){return t||parseInt(e.style("height"),10)||400},e.utils.sanitizeWidth=function(t,e){return t||parseInt(e.style("width"),10)||960},e.utils.availableHeight=function(t,n,r){return Math.max(0,e.utils.sanitizeHeight(t,n)-r.top-r.bottom)},e.utils.availableWidth=function(t,n,r){return Math.max(0,e.utils.sanitizeWidth(t,n)-r.left-r.right)},e.utils.noData=function(t,n){var r=t.options(),i=r.margin(),a=r.noData(),o=null==a?["No Data Available."]:[a],s=e.utils.availableHeight(null,n,i),l=e.utils.availableWidth(null,n,i),u=i.left+l/2,c=i.top+s/2;n.selectAll("g").remove();var d=n.selectAll(".nv-noData").data(o);d.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),d.attr("x",u).attr("y",c).text((function(t){return t}))},e.utils.wrapTicks=function(t,e){t.each((function(){for(var t,n=d3.select(this),r=n.text().split(/\s+/).reverse(),i=[],a=0,o=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",o).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",o).attr("dy",1.1*++a+s+"em").text(t))}))},e.utils.arrayEquals=function(t,n){if(t===n)return!0;if(!t||!n)return!1;if(t.length!=n.length)return!1;for(var r=0,i=t.length;r<i;r++)if(t[r]instanceof Array&&n[r]instanceof Array){if(!e.arrayEquals(t[r],n[r]))return!1}else if(t[r]!=n[r])return!1;return!0},e.utils.pointIsInArc=function(t,e,n){var r=n.innerRadius()(e),i=n.outerRadius()(e),a=n.startAngle()(e),o=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&&a<=l&&l<=o},e.models.axis=function(){"use strict";var t,n,r=d3.svg.axis(),i=d3.scale.linear(),a={top:0,right:0,bottom:0,left:0},o=75,s=60,l=null,u=!0,c=0,d=!0,f=!1,p=!1,h=null,g=0,v=void 0,m=250,y=d3.dispatch("renderEnd");r.scale(i).orient("bottom").tickFormat((function(t){return t}));var x=e.utils.renderWatch(y,m);function b(s){return x.reset(),s.each((function(s){var m=d3.select(this);e.utils.initSVG(m);var y=m.selectAll("g.nv-wrap.nv-axis").data([s]),b=(y.enter().append("g").attr("class","nvd3 nv-wrap nv-axis").append("g"),y.select("g"));null!==h?r.ticks(h):"top"!=r.orient()&&"bottom"!=r.orient()||r.ticks(Math.abs(i.range()[1]-i.range()[0])/100),b.watchTransition(x,"axis").call(r),n=n||r.scale();var k=r.tickFormat();null==k&&(k=n.tickFormat());var w,M,A,C=b.selectAll("text.nv-axislabel").data([l||null]);switch(C.exit().remove(),void 0!==v&&b.selectAll("g").select("text").style("font-size",v),r.orient()){case"top":C.enter().append("text").attr("class","nv-axislabel"),A=0,1===i.range().length?A=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?A=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(A=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",0).attr("x",A/2),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")})).append("text"),M.exit().remove(),M.attr("transform",(function(t,n){return"translate("+e.utils.NaNtoZero(i(t))+",0)"})).select("text").attr("dy","-0.5em").attr("y",-r.tickPadding()).attr("text-anchor","middle").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),M.watchTransition(x,"min-max top").attr("transform",(function(t,n){return"translate("+e.utils.NaNtoZero(i.range()[n])+",0)"})));break;case"bottom":w=g+36;var S=30,D=0,E=b.selectAll("g").select("text"),F="";if(c%360){E.attr("transform",""),E.each((function(t,e){var n=this.getBoundingClientRect(),r=n.width;D=n.height,r>S&&(S=r)})),F="rotate("+c+" 0,"+(D/2+r.tickPadding())+")";var W=Math.abs(Math.sin(c*Math.PI/180));w=(W?W*S:S)+30,E.attr("transform",F).style("text-anchor",c%360>0?"start":"end")}else f?E.attr("transform",(function(t,e){return"translate(0,"+(e%2==0?"0":"12")+")"})):E.attr("transform","translate(0,0)");C.enter().append("text").attr("class","nv-axislabel"),A=0,1===i.range().length?A=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?A=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(A=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",w).attr("x",A/2),u&&((M=y.selectAll("g.nv-axisMaxMin").data([i.domain()[0],i.domain()[i.domain().length-1]])).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")})).append("text"),M.exit().remove(),M.attr("transform",(function(t,n){return"translate("+e.utils.NaNtoZero(i(t)+(p?i.rangeBand()/2:0))+",0)"})).select("text").attr("dy",".71em").attr("y",r.tickPadding()).attr("transform",F).style("text-anchor",c?c%360>0?"start":"end":"middle").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),M.watchTransition(x,"min-max bottom").attr("transform",(function(t,n){return"translate("+e.utils.NaNtoZero(i(t)+(p?i.rangeBand()/2:0))+",0)"})));break;case"right":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"begin").attr("transform",d?"rotate(90)":"").attr("y",d?12-Math.max(a.right,o)-(g||0):-10).attr("x",d?d3.max(i.range())/2:r.tickPadding()),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")})).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",(function(t,n){return"translate(0,"+e.utils.NaNtoZero(i(t))+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",r.tickPadding()).style("text-anchor","start").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),M.watchTransition(x,"min-max right").attr("transform",(function(t,n){return"translate(0,"+e.utils.NaNtoZero(i.range()[n])+")"})).select("text").style("opacity",1));break;case"left":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"end").attr("transform",d?"rotate(-90)":"").attr("y",d?25-Math.max(a.left,o)-(g||0):-10).attr("x",d?-d3.max(i.range())/2:-r.tickPadding()),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")})).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",(function(t,r){return"translate(0,"+e.utils.NaNtoZero(n(t))+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",-r.tickPadding()).attr("text-anchor","end").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),M.watchTransition(x,"min-max right").attr("transform",(function(t,n){return"translate(0,"+e.utils.NaNtoZero(i.range()[n])+")"})).select("text").style("opacity",1))}if(C.text((function(t){return t})),!u||"left"!==r.orient()&&"right"!==r.orient()||(b.selectAll("g").each((function(t,e){d3.select(this).select("text").attr("opacity",1),(i(t)<i.range()[1]+10||i(t)>i.range()[0]-10)&&((t>1e-10||t<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))})),i.domain()[0]==i.domain()[1]&&0==i.domain()[0]&&y.selectAll("g.nv-axisMaxMin").style("opacity",(function(t,e){return e?0:1}))),u&&("top"===r.orient()||"bottom"===r.orient())){var O=[];y.selectAll("g.nv-axisMaxMin").each((function(t,e){try{e?O.push(i(t)-this.getBoundingClientRect().width-4):O.push(i(t)+this.getBoundingClientRect().width+4)}catch(n){e?O.push(i(t)-4):O.push(i(t)+4)}})),b.selectAll("g").each((function(t,e){(i(t)<O[0]||i(t)>O[1])&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())}))}b.selectAll(".tick").filter((function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t})).classed("zero",!0),n=i.copy()})),x.renderEnd("axis immediate"),b}return b.axis=r,b.dispatch=y,b.options=e.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return g},set:function(t){g=t}},staggerLabels:{get:function(){return f},set:function(t){f=t}},rotateLabels:{get:function(){return c},set:function(t){c=t}},rotateYLabel:{get:function(){return d},set:function(t){d=t}},showMaxMin:{get:function(){return u},set:function(t){u=t}},axisLabel:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return s},set:function(t){s=t}},ticks:{get:function(){return h},set:function(t){h=t}},width:{get:function(){return o},set:function(t){o=t}},fontSize:{get:function(){return v},set:function(t){v=t}},tickFormatMaxMin:{get:function(){return t},set:function(e){t=e}},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 m},set:function(t){m=t,x.reset(m)}},scale:{get:function(){return i},set:function(t){i=t,r.scale(i),p="function"==typeof i.rangeBands,e.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"])}}}),e.utils.initOptions(b),e.utils.inheritOptionsD3(b,r,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),e.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"]),b},e.models.boxPlot=function(){"use strict";var t,n,r,i,a,o,s={top:0,right:0,bottom:0,left:0},l=960,u=500,c=Math.floor(1e4*Math.random()),d=d3.scale.ordinal(),f=d3.scale.linear(),p=function(t){return t.label},h=function(t){return t.values.Q1},g=function(t){return t.values.Q2},v=function(t){return t.values.Q3},m=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},k=function(t,e,n){return t},w=function(t,e,n){return t},M=function(t,e,n){},A=e.utils.defaultColor(),C=null,S=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),D=250,E=null,F=e.utils.renderWatch(S,D);function W(c){return F.reset(),c.each((function(c){var W=l-s.left-s.right,O=u-s.top-s.bottom;C=d3.select(this),e.utils.initSVG(C),d.domain(t||c.map((function(t,e){return p(t,e)}))).rangeBands(n||[0,W],.1);var N=[];if(!r){var L=[];c.forEach((function(t,e){var n=h(t),r=v(t),i=m(t),a=y(t),o=b(t);o&&o.forEach((function(t,e){L.push(k(t,e,void 0))})),i&&L.push(i),n&&L.push(n),r&&L.push(r),a&&L.push(a)})),N=[d3.min(L),d3.max(L)]}f.domain(r||N),f.range(i||[O,0]),a=a||d,o=o||f.copy().range([f(0),f(0)]);var _=C.selectAll("g.nv-wrap").data([c]);_.enter().append("g").attr("class","nvd3 nv-wrap"),_.attr("transform","translate("+s.left+","+s.top+")");var B=_.selectAll(".nv-boxplot").data((function(t){return t})),T=B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);B.attr("class","nv-boxplot").attr("transform",(function(t,e,n){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"})).classed("hover",(function(t){return t.hover})),B.watchTransition(F,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay((function(t,e){return e*D/c.length})).attr("transform",(function(t,e){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"})),B.exit().remove(),T.each((function(t,e){var n=d3.select(this);[m,y].forEach((function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===m?"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 P=function(){return null===E?.9*d.rangeBand():Math.min(75,.9*d.rangeBand())},I=function(){return.45*d.rangeBand()-P()/2},H=function(){return.45*d.rangeBand()+P()/2};[m,y].forEach((function(t){var e=t===m?"low":"high",n=t===m?h:v;B.select("line.nv-boxplot-whisker.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",.45*d.rangeBand()).attr("y1",(function(e,n){return f(t(e))})).attr("x2",.45*d.rangeBand()).attr("y2",(function(t,e){return f(n(t))})),B.select("line.nv-boxplot-tick.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",I).attr("y1",(function(e,n){return f(t(e))})).attr("x2",H).attr("y2",(function(e,n){return f(t(e))}))})),[m,y].forEach((function(t){var e=t===m?"low":"high";T.selectAll(".nv-boxplot-"+e).on("mouseover",(function(e,n,r){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:t(e),color:x(e)||A(e,r)},e:d3.event})})).on("mouseout",(function(e,n,r){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:t(e),color:x(e)||A(e,r)},e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})}))})),T.append("rect").attr("class","nv-boxplot-box").on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),S.elementMouseover({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,e)},{key:"Q2",value:g(t),color:x(t)||A(t,e)},{key:"Q1",value:h(t),color:x(t)||A(t,e)}],data:t,index:e,e:d3.event})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),S.elementMouseout({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,e)},{key:"Q2",value:g(t),color:x(t)||A(t,e)},{key:"Q1",value:h(t),color:x(t)||A(t,e)}],data:t,index:e,e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})})),B.select("rect.nv-boxplot-box").watchTransition(F,"nv-boxplot: boxes").attr("y",(function(t,e){return f(v(t))})).attr("width",P).attr("x",I).attr("height",(function(t,e){return Math.abs(f(v(t))-f(h(t)))||1})).style("fill",(function(t,e){return x(t)||A(t,e)})).style("stroke",(function(t,e){return x(t)||A(t,e)})),T.append("line").attr("class","nv-boxplot-median"),B.select("line.nv-boxplot-median").watchTransition(F,"nv-boxplot: boxplots line").attr("x1",I).attr("y1",(function(t,e){return f(g(t))})).attr("x2",H).attr("y2",(function(t,e){return f(g(t))}));var V=B.selectAll(".nv-boxplot-outlier").data((function(t){return b(t)||[]}));V.enter().append("circle").style("fill",(function(t,e,n){return M(t,e,n)||A(t,n)})).style("stroke",(function(t,e,n){return M(t,e,n)||A(t,n)})).style("z-index",9e3).on("mouseover",(function(t,e,n){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:w(t,e,n),color:M(t,e,n)||A(t,n)},e:d3.event})})).on("mouseout",(function(t,e,n){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:w(t,e,n),color:M(t,e,n)||A(t,n)},e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})})),V.attr("class","nv-boxplot-outlier"),V.watchTransition(F,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*d.rangeBand()).attr("cy",(function(t,e,n){return f(k(t,e,n))})).attr("r","3"),V.exit().remove(),a=d.copy(),o=f.copy()})),F.renderEnd("nv-boxplot immediate"),W}return W.dispatch=S,W.options=e.utils.optionsFunc.bind(W),W._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 E},set:function(t){E=t}},x:{get:function(){return p},set:function(t){p=t}},q1:{get:function(){return h},set:function(t){h=t}},q2:{get:function(){return g},set:function(t){g=t}},q3:{get:function(){return v},set:function(t){v=t}},wl:{get:function(){return m},set:function(t){m=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 k},set:function(t){k=t}},outlierLabel:{get:function(){return w},set:function(t){w=t}},outlierColor:{get:function(){return M},set:function(t){M=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=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(t){A=e.utils.getColor(t)}},duration:{get:function(){return D},set:function(t){D=t,F.reset(D)}}}),e.utils.initOptions(W),W},e.models.boxPlotChart=function(){"use strict";var t,n,r=e.models.boxPlot(),i=e.models.axis(),a=e.models.axis(),o={top:15,right:10,bottom:50,left:60},s=null,l=null,u=e.utils.getColor(),c=!0,d=!0,f=!1,p=!1,h=e.models.tooltip(),g="No Data Available.",v=d3.dispatch("beforeUpdate","renderEnd"),m=250;i.orient("bottom").showMaxMin(!1).tickFormat((function(t){return t})),a.orient(f?"right":"left").tickFormat(d3.format(",.1f")),h.duration(0);var y=e.utils.renderWatch(v,m);function x(u){return y.reset(),y.models(r),c&&y.models(i),d&&y.models(a),u.each((function(u){var h=d3.select(this);e.utils.initSVG(h);var y=(s||parseInt(h.style("width"))||960)-o.left-o.right,b=(l||parseInt(h.style("height"))||400)-o.top-o.bottom;if(x.update=function(){v.beforeUpdate(),h.transition().duration(m).call(x)},x.container=this,!u||!u.length){var k=h.selectAll(".nv-noData").data([g]);return k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",o.left+y/2).attr("y",o.top+b/2).text((function(t){return t})),x}h.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale().clamp(!0);var w=h.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]),M=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),A=M.append("defs"),C=w.select("g");if(M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),M.append("g").attr("class","nv-barsWrap"),C.attr("transform","translate("+o.left+","+o.top+")"),f&&C.select(".nv-y.nv-axis").attr("transform","translate("+y+",0)"),r.width(y).height(b),C.select(".nv-barsWrap").datum(u.filter((function(t){return!t.disabled}))).transition().call(r),A.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect"),C.select("#nv-x-label-clip-"+r.id()+" rect").attr("width",t.rangeBand()*(p?2:1)).attr("height",16).attr("x",-t.rangeBand()/(p?1:2)),c){i.scale(t).ticks(e.utils.calcTicksX(y/100,u)).tickSize(-b,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),C.select(".nv-x.nv-axis").call(i);var S=C.select(".nv-x.nv-axis").selectAll("g");p&&S.selectAll("text").attr("transform",(function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}))}d&&(a.scale(n).ticks(Math.floor(b/36)).tickSize(-y,0),C.select(".nv-y.nv-axis").call(a)),C.select(".nv-zeroLine line").attr("x1",0).attr("x2",y).attr("y1",n(0)).attr("y2",n(0))})),y.renderEnd("nv-boxplot chart immediate"),x}return r.dispatch.on("elementMouseover.tooltip",(function(t){h.data(t).hidden(!1)})),r.dispatch.on("elementMouseout.tooltip",(function(t){h.data(t).hidden(!0)})),r.dispatch.on("elementMousemove.tooltip",(function(t){h()})),x.dispatch=v,x.boxplot=r,x.xAxis=i,x.yAxis=a,x.tooltip=h,x.options=e.utils.optionsFunc.bind(x),x._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 p},set:function(t){p=t}},showXAxis:{get:function(){return c},set:function(t){c=t}},showYAxis:{get:function(){return d},set:function(t){d=t}},tooltipContent:{get:function(){return h},set:function(t){h=t}},noData:{get:function(){return g},set:function(t){g=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}},duration:{get:function(){return m},set:function(t){m=t,y.reset(m),r.duration(m),i.duration(m),a.duration(m)}},color:{get:function(){return u},set:function(t){u=e.utils.getColor(t),r.color(u)}},rightAlignYAxis:{get:function(){return f},set:function(t){f=t,a.orient(t?"right":"left")}}}),e.utils.inheritOptions(x,r),e.utils.initOptions(x),x},e.models.bullet=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},n="left",r=!1,i=function(t){return t.ranges},a=function(t){return t.markers?t.markers:[]},o=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:[]},d=function(t){return t.measureLabels?t.measureLabels:[]},f=[0],p=380,h=30,g=null,v=null,m=e.utils.getColor(["#1f77b4"]),y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),x=["Maximum","Mean","Minimum"],b=["Max","Avg","Min"],k=1e3;function w(t,e){var n=t.slice();t.sort((function(t,r){var i=n.indexOf(t),a=n.indexOf(r);return d3.descending(e[i],e[a])}))}function M(n){return n.each((function(n,v){var M=p-t.left-t.right,A=h-t.top-t.bottom;g=d3.select(this),e.utils.initSVG(g);var C=i.call(this,n,v).slice(),S=a.call(this,n,v).slice(),D=o.call(this,n,v).slice(),E=s.call(this,n,v).slice(),F=l.call(this,n,v).slice(),W=u.call(this,n,v).slice(),O=c.call(this,n,v).slice(),N=d.call(this,n,v).slice();w(F,C),w(W,S),w(O,D),w(N,E),C.sort(d3.descending),S.sort(d3.descending),D.sort(d3.descending),E.sort(d3.descending);var L=d3.scale.linear().domain(d3.extent(d3.merge([f,C]))).range(r?[M,0]:[0,M]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(L.range()),this.__chart__=L,d3.min(C),d3.max(C),C[1];for(var _=g.selectAll("g.nv-wrap.nv-bullet").data([n]),B=_.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),T=_.select("g"),P=(v=0,C.length);v<P;v++){var I="nv-range nv-range"+v;v<=2&&(I=I+" nv-range"+b[v]),B.append("rect").attr("class",I)}B.append("rect").attr("class","nv-measure"),_.attr("transform","translate("+t.left+","+t.top+")");var H=function(t){return Math.abs(L(t)-L(0))},V=function(t){return L(t<0?t:0)};for(v=0,P=C.length;v<P;v++){var z=C[v];T.select("rect.nv-range"+v).datum(z).attr("height",A).transition().duration(k).attr("width",H(z)).attr("x",V(z))}T.select("rect.nv-measure").style("fill",m).attr("height",A/3).attr("y",A/3).on("mouseover",(function(){y.elementMouseover({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).on("mousemove",(function(){y.elementMousemove({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).on("mouseout",(function(){y.elementMouseout({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).transition().duration(k).attr("width",E<0?L(0)-L(E[0]):L(E[0])-L(0)).attr("x",V(E));var R=A/6,Y=S.map((function(t,e){return{value:t,label:W[e]}}));B.selectAll("path.nv-markerTriangle").data(Y).enter().append("path").attr("class","nv-markerTriangle").attr("d","M0,"+R+"L"+R+","+-R+" "+-R+","+-R+"Z").on("mouseover",(function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[L(t.value),A/2]})})).on("mousemove",(function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})),T.selectAll("path.nv-markerTriangle").data(Y).transition().duration(k).attr("transform",(function(t){return"translate("+L(t.value)+","+A/2+")"}));var j=D.map((function(t,e){return{value:t,label:O[e]}}));B.selectAll("line.nv-markerLine").data(j).enter().append("line").attr("cursor","").attr("class","nv-markerLine").attr("x1",(function(t){return L(t.value)})).attr("y1","2").attr("x2",(function(t){return L(t.value)})).attr("y2",A-2).on("mouseover",(function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[L(t.value),A/2]})})).on("mousemove",(function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})),T.selectAll("line.nv-markerLine").data(j).transition().duration(k).attr("x1",(function(t){return L(t.value)})).attr("x2",(function(t){return L(t.value)})),_.selectAll(".nv-range").on("mouseover",(function(t,e){var n=F[e]||x[e];y.elementMouseover({value:t,label:n,color:d3.select(this).style("fill")})})).on("mousemove",(function(){y.elementMousemove({value:E[0],label:N[0]||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){var n=F[e]||x[e];y.elementMouseout({value:t,label:n,color:d3.select(this).style("fill")})}))})),M}return M.dispatch=y,M.options=e.utils.optionsFunc.bind(M),M._options=Object.create({},{ranges:{get:function(){return i},set:function(t){i=t}},markers:{get:function(){return a},set:function(t){a=t}},measures:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return f},set:function(t){f=t}},width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},tickFormat:{get:function(){return v},set:function(t){v=t}},duration:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},orient:{get:function(){return n},set:function(t){r="right"==(n=t)||"bottom"==n}},color:{get:function(){return m},set:function(t){m=e.utils.getColor(t)}}}),e.utils.initOptions(M),M},e.models.bulletChart=function(){"use strict";var t=e.models.bullet(),n=e.models.tooltip(),r="left",i=!1,a={top:5,right:40,bottom:20,left:120},o=function(t){return t.ranges},s=function(t){return t.markers?t.markers:[]},l=function(t){return t.measures},u=null,c=55,d=null,f=null,p=null,h=d3.dispatch();function g(n){return n.each((function(r,p){var h=d3.select(this);e.utils.initSVG(h);var v=e.utils.availableWidth(u,h,a),m=c-a.top-a.bottom;if(g.update=function(){g(n)},g.container=this,!r||!o.call(this,r,p))return e.utils.noData(g,h),g;h.selectAll(".nv-noData").remove();var y=o.call(this,r,p).slice().sort(d3.descending),x=s.call(this,r,p).slice().sort(d3.descending),b=l.call(this,r,p).slice().sort(d3.descending),k=h.selectAll("g.nv-wrap.nv-bulletChart").data([r]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart").append("g"),M=k.select("g");w.append("g").attr("class","nv-bulletWrap"),w.append("g").attr("class","nv-titles"),k.attr("transform","translate("+a.left+","+a.top+")");var A=d3.scale.linear().domain([0,Math.max(y[0],x[0]||0,b[0])]).range(i?[v,0]:[0,v]),C=this.__chart__||d3.scale.linear().domain([0,1/0]).range(A.range());this.__chart__=A;var S=w.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(c-a.top-a.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})),t.width(v).height(m);var D=M.select(".nv-bulletWrap");d3.transition(D).call(t);var E=d||A.tickFormat(v/100),F=M.selectAll("g.nv-tick").data(A.ticks(f||v/50),(function(t){return this.textContent||E(t)})),W=F.enter().append("g").attr("class","nv-tick").attr("transform",(function(t){return"translate("+C(t)+",0)"})).style("opacity",1e-6);W.append("line").attr("y1",m).attr("y2",7*m/6),W.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*m/6).text(E);var O=d3.transition(F).transition().duration(t.duration()).attr("transform",(function(t){return"translate("+A(t)+",0)"})).style("opacity",1);O.select("line").attr("y1",m).attr("y2",7*m/6),O.select("text").attr("y",7*m/6),d3.transition(F.exit()).transition().duration(t.duration()).attr("transform",(function(t){return"translate("+A(t)+",0)"})).style("opacity",1e-6).remove()})),d3.timer.flush(),g}return n.duration(0).headerEnabled(!1),t.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:t.label,value:t.value,color:t.color},n.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){n.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){n()})),g.bullet=t,g.dispatch=h,g.tooltip=n,g.options=e.utils.optionsFunc.bind(g),g._options=Object.create({},{ranges:{get:function(){return o},set:function(t){o=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 d},set:function(t){d=t}},ticks:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return p},set:function(t){p=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}},orient:{get:function(){return r},set:function(t){i="right"==(r=t)||"bottom"==r}}}),e.utils.inheritOptions(g,t),e.utils.initOptions(g),g},e.models.candlestickBar=function(){"use strict";var t,n,r,i,a,o={top:0,right:0,bottom:0,left:0},s=null,l=null,u=Math.floor(1e4*Math.random()),c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=function(t){return t.open},g=function(t){return t.close},v=function(t){return t.high},m=function(t){return t.low},y=[],x=[],b=!1,k=!0,w=e.utils.defaultColor(),M=!1,A=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(w){return w.each((function(w){t=d3.select(this);var M=e.utils.availableWidth(s,t,o),C=e.utils.availableHeight(l,t,o);e.utils.initSVG(t);var S=M/w[0].values.length*.45;c.domain(n||d3.extent(w[0].values.map(f).concat(y))),b?c.range(i||[.5*M/w[0].values.length,M*(w[0].values.length-.5)/w[0].values.length]):c.range(i||[5+S/2,M-S/2-5]),d.domain(r||[d3.min(w[0].values.map(m).concat(x)),d3.max(w[0].values.map(v).concat(x))]).range(a||[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])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var D=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([w[0].values]),E=D.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar"),F=E.append("defs"),W=E.append("g"),O=D.select("g");W.append("g").attr("class","nv-ticks"),D.attr("transform","translate("+o.left+","+o.top+")"),t.on("click",(function(t,e){A.chartClick({data:t,index:e,pos:d3.event,id:u})})),F.append("clipPath").attr("id","nv-chart-clip-path-"+u).append("rect"),D.select("#nv-chart-clip-path-"+u+" rect").attr("width",M).attr("height",C),O.attr("clip-path",k?"url(#nv-chart-clip-path-"+u+")":"");var N=D.select(".nv-ticks").selectAll(".nv-tick").data((function(t){return t}));N.exit().remove();var L=N.enter().append("g");N.attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})),L.append("line").attr("class","nv-candlestick-lines").attr("transform",(function(t,e){return"translate("+c(f(t,e))+",0)"})).attr("x1",0).attr("y1",(function(t,e){return d(v(t,e))})).attr("x2",0).attr("y2",(function(t,e){return d(m(t,e))})),L.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",(function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"})).attr("x",0).attr("y",0).attr("width",S).attr("height",(function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)})),N.select(".nv-candlestick-lines").transition().attr("transform",(function(t,e){return"translate("+c(f(t,e))+",0)"})).attr("x1",0).attr("y1",(function(t,e){return d(v(t,e))})).attr("x2",0).attr("y2",(function(t,e){return d(m(t,e))})),N.select(".nv-candlestick-rects").transition().attr("transform",(function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"})).attr("x",0).attr("y",0).attr("width",S).attr("height",(function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)}))})),C}return C.highlightPoint=function(e,n){C.clearHighlights(),t.select(".nv-candlestickBar .nv-tick-0-"+e).classed("hover",n)},C.clearHighlights=function(){t.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=e.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 d},set:function(t){d=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 a},set:function(t){a=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 k},set:function(t){k=t}},id:{get:function(){return u},set:function(t){u=t}},interactive:{get:function(){return M},set:function(t){M=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=null!=t.top?t.top:o.top,o.right=null!=t.right?t.right:o.right,o.bottom=null!=t.bottom?t.bottom:o.bottom,o.left=null!=t.left?t.left:o.left}},color:{get:function(){return w},set:function(t){w=e.utils.getColor(t)}}}),e.utils.initOptions(C),C},e.models.cumulativeLineChart=function(){"use strict";var t,n,r=e.models.line(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend(),s=e.models.legend(),l=e.interactiveGuideline(),u=e.models.tooltip(),c={top:30,right:30,bottom:50,left:60},d=null,f=e.utils.defaultColor(),p=null,h=null,g=!0,v=!0,m=!0,y=!1,x=!0,b=!1,k=!0,w=r.id(),M=e.utils.state(),A=null,C=null,S=function(t){return t.average},D=d3.dispatch("stateChange","changeState","renderEnd"),E=250,F=!1;M.index=0,M.rescaleY=k,i.orient("bottom").tickPadding(7),a.orient(y?"right":"left"),u.valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.updateState(!1);var W,O=d3.scale.linear(),N={i:0,x:0},L=e.utils.renderWatch(D,E);function _(u){return L.reset(),L.models(r),v&&L.models(i),m&&L.models(a),u.each((function(u){var C=d3.select(this);e.utils.initSVG(C),C.classed("nv-chart-"+w,!0);var L,P=e.utils.availableWidth(p,C,c),I=e.utils.availableHeight(h,C,c);if(_.update=function(){0===E?C.call(_):C.transition().duration(E).call(_)},_.container=this,M.setter(function(t){return function(e){void 0!==e.index&&(N.i=e.index),void 0!==e.rescaleY&&(k=e.rescaleY),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(u),_.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),index:N.i,rescaleY:k}}}(u)).update(),M.disabled=u.map((function(t){return!!t.disabled})),!A)for(L in A={},M)M[L]instanceof Array?A[L]=M[L].slice(0):A[L]=M[L];var H=d3.behavior.drag().on("dragstart",(function(t,e){d3.select(_.container).style("cursor","ew-resize")})).on("drag",(function(t,e){N.x=d3.event.x,N.i=Math.round(O.invert(N.x)),$()})).on("dragend",(function(t,e){d3.select(_.container).style("cursor","auto"),M.index=N.i,D.stateChange(M)}));if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return e.utils.noData(_,C),_;C.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale(),O.domain([0,u[0].values.length-1]).range([0,P]).clamp(!0),u=function(t,e){return B||(B=r.y()),e.map((function(e,n){if(!e.values)return e;var r=e.values[t];if(null==r)return e;var i=B(r,t);return Math.abs(i)<1e-5&&!F?(e.tempDisabled=!0,e):(e.tempDisabled=!1,e.values=e.values.map((function(t,e){return t.display={y:(B(t,e)-i)/i},t})),e)}))}(N.i,u),void 0===W&&(W=T(u)),k?r.yDomain(null):(r.yDomain(W),r.clipEdge(!0));var V=b?"none":"all",z=C.selectAll("g.nv-wrap.nv-cumulativeLine").data([u]),R=z.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),Y=z.select("g");if(R.append("g").attr("class","nv-interactive"),R.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),R.append("g").attr("class","nv-y nv-axis"),R.append("g").attr("class","nv-background"),R.append("g").attr("class","nv-linesWrap").style("pointer-events",V),R.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),R.append("g").attr("class","nv-legendWrap"),R.append("g").attr("class","nv-controlsWrap"),g?(o.width(P),Y.select(".nv-legendWrap").datum(u).call(o),d||o.height()===c.top||(c.top=o.height(),I=e.utils.availableHeight(h,C,c)),Y.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):Y.select(".nv-legendWrap").selectAll("*").remove(),x){var j=[{key:"Re-scale y-axis",disabled:!k}];s.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),Y.select(".nv-controlsWrap").datum(j).attr("transform","translate(0,"+-c.top+")").call(s)}else Y.select(".nv-controlsWrap").selectAll("*").remove();z.attr("transform","translate("+c.left+","+c.top+")"),y&&Y.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)");var G=u.filter((function(t){return t.tempDisabled}));z.select(".tempDisabled").remove(),G.length&&z.append("text").attr("class","tempDisabled").attr("x",P/2).attr("y","-.71em").style("text-anchor","end").text(G.map((function(t){return t.key})).join(", ")+" values cannot be calculated for this time period."),b&&(l.width(P).height(I).margin({left:c.left,top:c.top}).svgContainer(C).xScale(t),z.select(".nv-interactive").call(l)),R.select(".nv-background").append("rect"),Y.select(".nv-background rect").attr("width",P).attr("height",I),r.y((function(t){return t.display.y})).width(P).height(I).color(u.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!u[e].disabled&&!u[e].tempDisabled})));var X=Y.select(".nv-linesWrap").datum(u.filter((function(t){return!t.disabled&&!t.tempDisabled})));X.call(r),u.forEach((function(t,e){t.seriesIndex=e}));var Z=u.filter((function(t){return!t.disabled&&!!S(t)})),U=Y.select(".nv-avgLinesWrap").selectAll("line").data(Z,(function(t){return t.key})),q=function(t){var e=n(S(t));return e<0?0:e>I?I:e};U.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",P).attr("y1",q).attr("y2",q),U.style("stroke-opacity",(function(t){var e=n(S(t));return e<0||e>I?0:1})).attr("x1",0).attr("x2",P).attr("y1",q).attr("y2",q),U.exit().remove();var K=X.selectAll(".nv-indexLine").data([N]);function $(){K.data([N]);var t=_.duration();_.duration(0),_.update(),_.duration(t)}K.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(H),K.attr("transform",(function(t){return"translate("+O(t.i)+",0)"})).attr("height",I),v&&(i.scale(t)._ticks(e.utils.calcTicksX(P/70,u)).tickSize(-I,0),Y.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),Y.select(".nv-x.nv-axis").call(i)),m&&(a.scale(n)._ticks(e.utils.calcTicksY(I/36,u)).tickSize(-P,0),Y.select(".nv-y.nv-axis").call(a)),Y.select(".nv-background rect").on("click",(function(){N.x=d3.mouse(this)[0],N.i=Math.round(O.invert(N.x)),M.index=N.i,D.stateChange(M),$()})),r.dispatch.on("elementClick",(function(t){N.i=t.pointIndex,N.x=O(N.i),M.index=N.i,D.stateChange(M),$()})),s.dispatch.on("legendClick",(function(t,e){t.disabled=!t.disabled,k=!t.disabled,M.rescaleY=k,k||(W=T(u)),D.stateChange(M),_.update()})),o.dispatch.on("stateChange",(function(t){for(var e in t)M[e]=t[e];D.stateChange(M),_.update()})),l.dispatch.on("elementMousemove",(function(t){r.clearHighlights();var n,o,s,c=[];if(u.filter((function(t,e){return t.seriesIndex=e,!(t.disabled||t.tempDisabled)})).forEach((function(i,a){o=e.interactiveBisect(i.values,t.pointXValue,_.x()),r.highlightPoint(a,o,!0);var l=i.values[o];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=_.xScale()(_.x()(l,o))),c.push({key:i.key,value:_.y()(l,o),color:f(i,i.seriesIndex)}))})),c.length>2){var d=_.yScale().invert(t.mouseY),p=.03*Math.abs(_.yScale().domain()[0]-_.yScale().domain()[1]),h=e.nearestValueIndex(c.map((function(t){return t.value})),d,p);null!==h&&(c[h].highlight=!0)}var g=i.tickFormat()(_.x()(n,o),o);l.tooltip.valueFormatter((function(t,e){return a.tickFormat()(t)})).data({value:g,series:c})(),l.renderGuideLine(s)})),l.dispatch.on("elementMouseout",(function(t){r.clearHighlights()})),D.on("changeState",(function(t){void 0!==t.disabled&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),M.disabled=t.disabled),void 0!==t.index&&(N.i=t.index,N.x=O(N.i),M.index=t.index,K.data([N])),void 0!==t.rescaleY&&(k=t.rescaleY),_.update()}))})),L.renderEnd("cumulativeLineChart immediate"),_}r.dispatch.on("elementMouseover.tooltip",(function(t){var e={x:_.x()(t.point),y:_.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 T(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 _.dispatch=D,_.lines=r,_.legend=o,_.controls=s,_.xAxis=i,_.yAxis=a,_.interactiveLayer=l,_.state=M,_.tooltip=u,_.options=e.utils.optionsFunc.bind(_),_._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showControls:{get:function(){return x},set:function(t){x=t}},showLegend:{get:function(){return g},set:function(t){g=t}},average:{get:function(){return S},set:function(t){S=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return C},set:function(t){C=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},noErrorCheck:{get:function(){return F},set:function(t){F=t}},rescaleY:{get:function(){return k},set:function(t){k=t,_.state.rescaleY=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=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 f},set:function(t){f=e.utils.getColor(t),o.color(f)}},useInteractiveGuideline:{get:function(){return b},set:function(t){b=t,!0===t&&(_.interactive(!1),_.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,a.orient(t?"right":"left")}},duration:{get:function(){return E},set:function(t){E=t,r.duration(E),i.duration(E),a.duration(E),L.reset(E)}}}),e.utils.inheritOptions(_,r),e.utils.initOptions(_),_},e.models.discreteBar=function(){"use strict";var t,n,r,i,a,o,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=d3.scale.ordinal(),p=d3.scale.linear(),h=function(t){return t.x},g=function(t){return t.y},v=[0],m=e.utils.defaultColor(),y=!1,x=d3.format(",.2f"),b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),k="discreteBar",w=250,M=e.utils.renderWatch(b,w);function A(d){return M.reset(),d.each((function(d){var w=u-l.left-l.right,A=c-l.top-l.bottom;t=d3.select(this),e.utils.initSVG(t),d.forEach((function(t,e){t.values.forEach((function(t){t.series=e}))}));var C=n&&r?[]:d.map((function(t){return t.values.map((function(t,e){return{x:h(t,e),y:g(t,e),y0:t.y0}}))}));f.domain(n||d3.merge(C).map((function(t){return t.x}))).rangeBands(i||[0,w],.1),p.domain(r||d3.extent(d3.merge(C).map((function(t){return t.y})).concat(v))),y?p.range(a||[A-(p.domain()[0]<0?12:0),p.domain()[1]>0?12:0]):p.range(a||[A,0]),o=o||f,s=s||p.copy().range([p(0),p(0)]);var S=t.selectAll("g.nv-wrap.nv-discretebar").data([d]),D=S.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar").append("g");S.select("g"),D.append("g").attr("class","nv-groups"),S.attr("transform","translate("+l.left+","+l.top+")");var E=S.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));E.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),E.exit().watchTransition(M,"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(M,"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("+(f(h(t,e))+.05*f.rangeBand())+", "+p(0)+")"})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),b.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),b.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e){b.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){b.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e){b.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}));W.append("rect").attr("height",0).attr("width",.9*f.rangeBand()/d.length),y?(W.append("text").attr("text-anchor","middle"),F.select("text").text((function(t,e){return x(g(t,e))})).watchTransition(M,"discreteBar: bars text").attr("x",.9*f.rangeBand()/2).attr("y",(function(t,e){return g(t,e)<0?p(g(t,e))-p(0)+12:-4}))):F.selectAll("text").remove(),F.attr("class",(function(t,e){return g(t,e)<0?"nv-bar negative":"nv-bar positive"})).style("fill",(function(t,e){return t.color||m(t,e)})).style("stroke",(function(t,e){return t.color||m(t,e)})).select("rect").attr("class",k).watchTransition(M,"discreteBar: bars rect").attr("width",.9*f.rangeBand()/d.length),F.watchTransition(M,"discreteBar: bars").attr("transform",(function(t,e){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+(g(t,e)<0?p(0):p(0)-p(g(t,e))<1?p(0)-1:p(g(t,e)))+")"})).select("rect").attr("height",(function(t,e){return Math.max(Math.abs(p(g(t,e))-p(0)),1)})),o=f.copy(),s=p.copy()})),M.renderEnd("discreteBar immediate"),A}return A.dispatch=b,A.options=e.utils.optionsFunc.bind(A),A._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 v},set:function(t){v=t}},showValues:{get:function(){return y},set:function(t){y=t}},x:{get:function(){return h},set:function(t){h=t}},y:{get:function(){return g},set:function(t){g=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 a},set:function(t){a=t}},valueFormat:{get:function(){return x},set:function(t){x=t}},id:{get:function(){return d},set:function(t){d=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 m},set:function(t){m=e.utils.getColor(t)}},duration:{get:function(){return w},set:function(t){w=t,M.reset(w)}}}),e.utils.initOptions(A),A},e.models.discreteBarChart=function(){"use strict";var t,n,r=e.models.discreteBar(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend(),s=e.models.tooltip(),l={top:15,right:10,bottom:50,left:60},u=null,c=null,d=null,f=e.utils.getColor(),p=!1,h=!0,g=!0,v=!1,m=!1,y=!1,x=0,b=null,k=d3.dispatch("beforeUpdate","renderEnd"),w=250;i.orient("bottom").showMaxMin(!1).tickFormat((function(t){return t})),a.orient(v?"right":"left").tickFormat(d3.format(",.1f")),s.duration(0).headerEnabled(!1).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).keyFormatter((function(t,e){return i.tickFormat()(t,e)}));var M=e.utils.renderWatch(k,w);function A(s){return M.reset(),M.models(r),h&&M.models(i),g&&M.models(a),s.each((function(s){var f=d3.select(this);e.utils.initSVG(f);var b=e.utils.availableWidth(c,f,l),M=e.utils.availableHeight(d,f,l);if(A.update=function(){k.beforeUpdate(),f.transition().duration(w).call(A)},A.container=this,!(s&&s.length&&s.filter((function(t){return t.values.length})).length))return e.utils.noData(A,f),A;f.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale().clamp(!0);var C=f.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),D=S.append("defs"),E=C.select("g");if(S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),S.append("g").attr("class","nv-barsWrap"),S.append("g").attr("class","nv-legendWrap"),E.attr("transform","translate("+l.left+","+l.top+")"),p?(o.width(b),E.select(".nv-legendWrap").datum(s).call(o),u||o.height()===l.top||(l.top=o.height(),M=e.utils.availableHeight(d,f,l)),C.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")):E.select(".nv-legendWrap").selectAll("*").remove(),v&&E.select(".nv-y.nv-axis").attr("transform","translate("+b+",0)"),r.width(b).height(M),E.select(".nv-barsWrap").datum(s.filter((function(t){return!t.disabled}))).transition().call(r),D.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect"),E.select("#nv-x-label-clip-"+r.id()+" rect").attr("width",t.rangeBand()*(m?2:1)).attr("height",16).attr("x",-t.rangeBand()/(m?1:2)),h){i.scale(t)._ticks(e.utils.calcTicksX(b/100,s)).tickSize(-M,0),E.select(".nv-x.nv-axis").attr("transform","translate(0,"+(n.range()[0]+(r.showValues()&&n.domain()[0]<0?16:0))+")"),E.select(".nv-x.nv-axis").call(i);var F=E.select(".nv-x.nv-axis").selectAll("g");m&&F.selectAll("text").attr("transform",(function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})),x&&F.selectAll(".tick text").attr("transform","rotate("+x+" 0,0)").style("text-anchor",x>0?"start":"end"),y&&E.selectAll(".tick text").call(e.utils.wrapTicks,A.xAxis.rangeBand())}g&&(a.scale(n)._ticks(e.utils.calcTicksY(M/36,s)).tickSize(-b,0),E.select(".nv-y.nv-axis").call(a)),E.select(".nv-zeroLine line").attr("x1",0).attr("x2",v?-b:b).attr("y1",n(0)).attr("y2",n(0))})),M.renderEnd("discreteBar chart immediate"),A}return r.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:A.x()(t.data),value:A.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()})),A.dispatch=k,A.discretebar=r,A.legend=o,A.xAxis=i,A.yAxis=a,A.tooltip=s,A.options=e.utils.optionsFunc.bind(A),A._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},showLegend:{get:function(){return p},set:function(t){p=t}},staggerLabels:{get:function(){return m},set:function(t){m=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 h},set:function(t){h=t}},showYAxis:{get:function(){return g},set:function(t){g=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 w},set:function(t){w=t,M.reset(w),r.duration(w),i.duration(w),a.duration(w)}},color:{get:function(){return f},set:function(t){f=e.utils.getColor(t),r.color(f),o.color(f)}},rightAlignYAxis:{get:function(){return v},set:function(t){v=t,a.orient(t?"right":"left")}}}),e.utils.inheritOptions(A,r),e.utils.initOptions(A),A},e.models.distribution=function(){"use strict";var t,n={top:0,right:0,bottom:0,left:0},r=400,i=8,a="x",o=function(t){return t[a]},s=e.utils.defaultColor(),l=d3.scale.linear(),u=250,c=d3.dispatch("renderEnd"),d=e.utils.renderWatch(c,u);function f(r){return d.reset(),r.each((function(r){"x"===a?(n.left,n.right):(n.top,n.bottom);var u="x"==a?"y":"x",c=d3.select(this);e.utils.initSVG(c),t=t||l;var f=c.selectAll("g.nv-distribution").data([r]),p=(f.enter().append("g").attr("class","nvd3 nv-distribution").append("g"),f.select("g"));f.attr("transform","translate("+n.left+","+n.top+")");var h=p.selectAll("g.nv-dist").data((function(t){return t}),(function(t){return t.key}));h.enter().append("g"),h.attr("class",(function(t,e){return"nv-dist nv-series-"+e})).style("stroke",(function(t,e){return s(t,e)}));var g=h.selectAll("line.nv-dist"+a).data((function(t){return t.values}));g.enter().append("line").attr(a+"1",(function(e,n){return t(o(e,n))})).attr(a+"2",(function(e,n){return t(o(e,n))})),d.transition(h.exit().selectAll("line.nv-dist"+a),"dist exit").attr(a+"1",(function(t,e){return l(o(t,e))})).attr(a+"2",(function(t,e){return l(o(t,e))})).style("stroke-opacity",0).remove(),g.attr("class",(function(t,e){return"nv-dist"+a+" nv-dist"+a+"-"+e})).attr(u+"1",0).attr(u+"2",i),d.transition(g,"dist").attr(a+"1",(function(t,e){return l(o(t,e))})).attr(a+"2",(function(t,e){return l(o(t,e))})),t=l.copy()})),d.renderEnd("distribution immediate"),f}return f.options=e.utils.optionsFunc.bind(f),f.dispatch=c,f.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,f):n},f.width=function(t){return arguments.length?(r=t,f):r},f.axis=function(t){return arguments.length?(a=t,f):a},f.size=function(t){return arguments.length?(i=t,f):i},f.getData=function(t){return arguments.length?(o=d3.functor(t),f):o},f.scale=function(t){return arguments.length?(l=t,f):l},f.color=function(t){return arguments.length?(s=e.utils.getColor(t),f):s},f.duration=function(t){return arguments.length?(u=t,d.reset(u),f):u},f},e.models.focus=function(t){"use strict";t=t||e.models.line();var n,r,i=e.models.axis(),a=e.models.axis(),o=d3.svg.brush(),s={top:10,right:0,bottom:30,left:0},l=e.utils.defaultColor(),u=null,c=70,d=!0,f=!1,p=!1,h=null,g=250,v=d3.dispatch("brush","onBrush","renderEnd"),m=!0;t.interactive(!1),t.pointActive((function(t){return!1}));var y=e.utils.renderWatch(v,g);function x(b){return y.reset(),y.models(t),d&&y.models(i),f&&y.models(a),b.each((function(y){var b=d3.select(this);e.utils.initSVG(b);var k=e.utils.availableWidth(u,b,s),w=c-s.top-s.bottom;x.update=function(){0===g?b.call(x):b.transition().duration(g).call(x)},x.container=this,n=t.xScale(),r=t.yScale();var M=b.selectAll("g.nv-focus").data([y]),A=M.enter().append("g").attr("class","nvd3 nv-focus").append("g"),C=M.select("g");M.attr("transform","translate("+s.left+","+s.top+")"),A.append("g").attr("class","nv-background").append("rect"),A.append("g").attr("class","nv-x nv-axis"),A.append("g").attr("class","nv-y nv-axis"),A.append("g").attr("class","nv-contentWrap"),A.append("g").attr("class","nv-brushBackground"),A.append("g").attr("class","nv-x nv-brush"),p&&C.select(".nv-y.nv-axis").attr("transform","translate("+k+",0)"),C.select(".nv-background rect").attr("width",k).attr("height",w),t.width(k).height(w).color(y.map((function(t,e){return t.color||l(t,e)})).filter((function(t,e){return!y[e].disabled})));var S=C.select(".nv-contentWrap").datum(y.filter((function(t){return!t.disabled})));d3.transition(S).call(t),o.x(n).on("brush",(function(){W(m)})),o.on("brushend",(function(){m||v.onBrush(o.empty()?n.domain():o.extent())})),h&&o.extent(h);var D=C.select(".nv-brushBackground").selectAll("g").data([h||o.extent()]),E=D.enter().append("g");E.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",w),E.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",w);var F=C.select(".nv-x.nv-brush").call(o);function W(t){h=o.empty()?null:o.extent();var e=o.empty()?n.domain():o.extent();v.brush({extent:e,brush:o}),o.empty()||o.extent(h),D.data([o.empty()?n.domain():h]).each((function(t,e){var r=n(t[0])-n.range()[0],i=k-n(t[1]);d3.select(this).select(".left").attr("width",r<0?0:r),d3.select(this).select(".right").attr("x",n(t[1])).attr("width",i<0?0:i)})),t&&v.onBrush(e)}F.selectAll("rect").attr("height",w),F.selectAll(".resize").append("path").attr("d",(function(t){var e=+("e"==t),n=e?1:-1,r=w/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)})),W(!0),C.select(".nv-background rect").attr("width",k).attr("height",w),d&&(i.scale(n)._ticks(e.utils.calcTicksX(k/100,y)).tickSize(-w,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),d3.transition(C.select(".nv-x.nv-axis")).call(i)),f&&(a.scale(r)._ticks(e.utils.calcTicksY(w/36,y)).tickSize(-k,0),d3.transition(C.select(".nv-y.nv-axis")).call(a)),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")")})),y.renderEnd("focus immediate"),x}return x.dispatch=v,x.content=t,x.brush=o,x.xAxis=i,x.yAxis=a,x.options=e.utils.optionsFunc.bind(x),x._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 d},set:function(t){d=t}},showYAxis:{get:function(){return f},set:function(t){f=t}},brushExtent:{get:function(){return h},set:function(t){h=t}},syncBrushing:{get:function(){return m},set:function(t){m=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 g},set:function(e){g=e,y.reset(g),t.duration(g),i.duration(g),a.duration(g)}},color:{get:function(){return l},set:function(n){l=e.utils.getColor(n),t.color(l)}},interpolate:{get:function(){return t.interpolate()},set:function(e){t.interpolate(e)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t)}},yTickFormat:{get:function(){return a.tickFormat()},set:function(t){a.tickFormat(t)}},x:{get:function(){return t.x()},set:function(e){t.x(e)}},y:{get:function(){return t.y()},set:function(e){t.y(e)}},rightAlignYAxis:{get:function(){return p},set:function(t){p=t,a.orient(p?"right":"left")}}}),e.utils.inheritOptions(x,t),e.utils.initOptions(x),x},e.models.forceDirectedGraph=function(){"use strict";var t={top:2,right:0,bottom:2,left:0},n=400,r=32,i=null,a=d3.dispatch("renderEnd"),o=e.utils.getColor(["#000"]),s=e.models.tooltip(),l=null,u=.1,c=.9,d=30,f=-120,p=.1,h=.8,g=.1,v=5,m=function(t){},y=function(t){},x=d3.functor(0),b=d3.functor(0),k=e.utils.renderWatch(a);function w(a){return k.reset(),a.each((function(a){i=d3.select(this),e.utils.initSVG(i);var l=e.utils.availableWidth(n,i,t),x=e.utils.availableHeight(r,i,t);if(i.attr("width",l).attr("height",x),!(a&&a.links&&a.nodes))return e.utils.noData(w,i),w;i.selectAll(".nv-noData").remove(),i.selectAll("*").remove();var b=new Set;a.nodes.forEach((function(t){Object.keys(t).forEach((function(t){b.add(t)}))}));var k=d3.layout.force().nodes(a.nodes).links(a.links).size([l,x]).linkStrength(u).friction(c).linkDistance(d).charge(f).gravity(p).theta(h).alpha(g).start(),M=i.selectAll(".link").data(a.links).enter().append("line").attr("class","nv-force-link").style("stroke-width",(function(t){return Math.sqrt(t.value)})),A=i.selectAll(".node").data(a.nodes).enter().append("g").attr("class","nv-force-node").call(k.drag);A.append("circle").attr("r",v).style("fill",(function(t){return o(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=o(t);t.series=[],b.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(M),m(A),k.on("tick",(function(){M.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})),A.attr("transform",(function(t){return"translate("+t.x+", "+t.y+")"}))}))})),w}return w.options=e.utils.optionsFunc.bind(w),w._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 d},set:function(t){d=t}},charge:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return p},set:function(t){p=t}},theta:{get:function(){return h},set:function(t){h=t}},alpha:{get:function(){return g},set:function(t){g=t}},radius:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return o},set:function(t){o=e.utils.getColor(t)}},noData:{get:function(){return l},set:function(t){l=t}},nodeExtras:{get:function(){return m},set:function(t){m=t}},linkExtras:{get:function(){return y},set:function(t){y=t}}}),w.dispatch=a,w.tooltip=s,e.utils.initOptions(w),w},e.models.furiousLegend=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},a=function(t){return t},o=e.utils.getColor(),s=20,l=!0,u=28,c=!0,d=!0,f=!1,p=!1,h=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),g="classic";function v(m){function y(t,e){return"furious"!=g?"#000":p?t.disengaged?o(t,e):"#fff":p?void 0:t.disabled?o(t,e):"#fff"}function x(t,e){return p&&"furious"==g?t.disengaged?"#fff":o(t,e):t.disabled?"#fff":o(t,e)}return m.each((function(v){var m=n-t.left-t.right,b=d3.select(this);e.utils.initSVG(b);var k=b.selectAll("g.nv-legend").data([v]),w=(k.enter().append("g").attr("class","nvd3 nv-legend").append("g"),k.select("g"));k.attr("transform","translate("+t.left+","+t.top+")");var M,A=w.selectAll(".nv-series").data((function(t){return"furious"!=g?t:t.filter((function(t){return!!p||!t.disengaged}))})),C=A.enter().append("g").attr("class","nv-series");"classic"==g?(C.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),M=A.select("circle")):"furious"==g&&(C.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),M=A.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)"),A.select(".nv-check-box").each((function(t,e){d3.select(this).selectAll("path").attr("stroke",y(t,e))}))),C.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var S,D=A.select("text.nv-legend-text");switch(A.on("mouseover",(function(t,e){h.legendMouseover(t,e)})).on("mouseout",(function(t,e){h.legendMouseout(t,e)})).on("click",(function(t,e){h.legendClick(t,e);var n=A.data();d&&("classic"==g?f?(n.forEach((function(t){t.disabled=!0})),t.disabled=!1):(t.disabled=!t.disabled,n.every((function(t){return t.disabled}))&&n.forEach((function(t){t.disabled=!1}))):"furious"==g&&(p?(t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled):p||(t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter((function(t){return!t.disengaged})).every((function(t){return t.userDisabled}))&&n.forEach((function(t){t.disabled=t.userDisabled=!1})))),h.stateChange({disabled:n.map((function(t){return!!t.disabled})),disengaged:n.map((function(t){return!!t.disengaged}))}))})).on("dblclick",(function(t,e){if(("furious"!=g||!p)&&(h.legendDblclick(t,e),d)){var n=A.data();n.forEach((function(t){t.disabled=!0,"furious"==g&&(t.userDisabled=t.disabled)})),t.disabled=!1,"furious"==g&&(t.userDisabled=t.disabled),h.stateChange({disabled:n.map((function(t){return!!t.disabled}))})}})),A.classed("nv-disabled",(function(t){return t.userDisabled})),A.exit().remove(),D.attr("fill",y).text((function(t){return a(i(t))})),g){case"furious":S=23;break;case"classic":S=20}if(l){var E=[];A.each((function(t,n){var r,o;if(a(i(t))&&a(i(t)).length>s){var l=a(i(t)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(a(i(t)))}else r=d3.select(this).select("text");try{if((o=r.node().getComputedTextLength())<=0)throw Error()}catch(t){o=e.utils.calcApproxTextWidth(r)}E.push(o+u)}));for(var F=0,W=0,O=[];W<m&&F<E.length;)O[F]=E[F],W+=E[F++];for(0===F&&(F=1);W>m&&F>1;){O=[],F--;for(var N=0;N<E.length;N++)E[N]>(O[N%F]||0)&&(O[N%F]=E[N]);W=O.reduce((function(t,e,n,r){return t+e}))}for(var L=[],_=0,B=0;_<F;_++)L[_]=B,B+=O[_];A.attr("transform",(function(t,e){return"translate("+L[e%F]+","+(5+Math.floor(e/F)*S)+")"})),c?w.attr("transform","translate("+(n-t.right-W)+","+t.top+")"):w.attr("transform","translate(0,"+t.top+")"),r=t.top+t.bottom+Math.ceil(E.length/F)*S}else{var T,P=5,I=5,H=0;A.attr("transform",(function(e,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return T=I,n<t.left+t.right+T+i&&(I=T=5,P+=S),(I+=i)>H&&(H=I),"translate("+T+","+P+")"})),w.attr("transform","translate("+(n-t.right-H)+","+t.top+")"),r=t.top+t.bottom+P+15}"furious"==g&&M.attr("width",(function(t,e){return D[0][e].getComputedTextLength()+27})).attr("height",18).attr("y",-9).attr("x",-15),M.style("fill",x).style("stroke",(function(t,e){return t.color||o(t,e)}))})),v}return v.dispatch=h,v.options=e.utils.optionsFunc.bind(v),v._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 a},set:function(t){a=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 d},set:function(t){d=t}},radioButtonMode:{get:function(){return f},set:function(t){f=t}},expanded:{get:function(){return p},set:function(t){p=t}},vers:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return o},set:function(t){o=e.utils.getColor(t)}}}),e.utils.initOptions(v),v},e.models.historicalBar=function(){"use strict";var t,n,r,i,a={top:0,right:0,bottom:0,left:0},o=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=[],g=[0],v=!1,m=!0,y=e.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),b=!0,k=e.utils.renderWatch(x,0);function w(M){return M.each((function(w){k.reset(),u=d3.select(this);var M=e.utils.availableWidth(o,u,a),A=e.utils.availableHeight(s,u,a);e.utils.initSVG(u),c.domain(t||d3.extent(w[0].values.map(f).concat(h))),v?c.range(r||[.5*M/w[0].values.length,M*(w[0].values.length-.5)/w[0].values.length]):c.range(r||[0,M]),d.domain(n||d3.extent(w[0].values.map(p).concat(g))).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])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var C=u.selectAll("g.nv-wrap.nv-historicalBar-"+l).data([w[0].values]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+l),D=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-bars"),C.attr("transform","translate("+a.left+","+a.top+")"),u.on("click",(function(t,e){x.chartClick({data:t,index:e,pos:d3.event,id:l})})),D.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),C.select("#nv-chart-clip-path-"+l+" rect").attr("width",M).attr("height",A),F.attr("clip-path",m?"url(#nv-chart-clip-path-"+l+")":"");var W=C.select(".nv-bars").selectAll(".nv-bar").data((function(t){return t}),(function(t,e){return f(t,e)}));W.exit().remove(),W.enter().append("rect").attr("x",0).attr("y",(function(t,n){return e.utils.NaNtoZero(d(Math.max(0,p(t,n))))})).attr("height",(function(t,n){return e.utils.NaNtoZero(Math.abs(d(p(t,n))-d(0)))})).attr("transform",(function(t,e){return"translate("+(c(f(t,e))-M/w[0].values.length*.45)+",0)"})).on("mouseover",(function(t,e){b&&(d3.select(this).classed("hover",!0),x.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")}))})).on("mouseout",(function(t,e){b&&(d3.select(this).classed("hover",!1),x.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")}))})).on("mousemove",(function(t,e){b&&x.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){b&&(x.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation())})).on("dblclick",(function(t,e){b&&(x.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation())})),W.attr("fill",(function(t,e){return y(t,e)})).attr("class",(function(t,e,n){return(p(t,e)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+n+"-"+e})).watchTransition(k,"bars").attr("transform",(function(t,e){return"translate("+(c(f(t,e))-M/w[0].values.length*.45)+",0)"})).attr("width",M/w[0].values.length*.9),W.watchTransition(k,"bars").attr("y",(function(t,n){var r=p(t,n)<0?d(0):d(0)-d(p(t,n))<1?d(0)-1:d(p(t,n));return e.utils.NaNtoZero(r)})).attr("height",(function(t,n){return e.utils.NaNtoZero(Math.max(Math.abs(d(p(t,n))-d(0)),1))}))})),k.renderEnd("historicalBar immediate"),w}return w.highlightPoint=function(t,e){u.select(".nv-bars .nv-bar-0-"+t).classed("hover",e)},w.clearHighlights=function(){u.select(".nv-bars .nv-bar.hover").classed("hover",!1)},w.dispatch=x,w.options=e.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return h},set:function(t){h=t}},forceY:{get:function(){return g},set:function(t){g=t}},padData:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return t},set:function(e){t=e}},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 m},set:function(t){m=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 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 y},set:function(t){y=e.utils.getColor(t)}}}),e.utils.initOptions(w),w},e.models.historicalBarChart=function(t){"use strict";var n,r,i=t||e.models.historicalBar(),a=e.models.axis(),o=e.models.axis(),s=e.models.legend(),l=e.interactiveGuideline(),u=e.models.tooltip(),c={top:30,right:90,bottom:50,left:90},d=null,f=e.utils.defaultColor(),p=null,h=null,g=!1,v=!0,m=!0,y=!1,x=!1,b={},k=null,w=null,M=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),A=250;a.orient("bottom").tickPadding(7),o.orient(y?"right":"left"),u.duration(0).headerEnabled(!1).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return a.tickFormat()(t,e)}));var C=e.utils.renderWatch(M,0);function S(t){return t.each((function(u){C.reset(),C.models(i),v&&C.models(a),m&&C.models(o);var w=d3.select(this);e.utils.initSVG(w);var D,E=e.utils.availableWidth(p,w,c),F=e.utils.availableHeight(h,w,c);if(S.update=function(){w.transition().duration(A).call(S)},S.container=this,b.disabled=u.map((function(t){return!!t.disabled})),!k)for(D in k={},b)b[D]instanceof Array?k[D]=b[D].slice(0):k[D]=b[D];if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return e.utils.noData(S,w),S;w.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale();var W=w.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]),O=W.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),N=W.select("g");O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y nv-axis"),O.append("g").attr("class","nv-barsWrap"),O.append("g").attr("class","nv-legendWrap"),O.append("g").attr("class","nv-interactive"),g?(s.width(E),N.select(".nv-legendWrap").datum(u).call(s),d||s.height()===c.top||(c.top=s.height(),F=e.utils.availableHeight(h,w,c)),W.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):N.select(".nv-legendWrap").selectAll("*").remove(),W.attr("transform","translate("+c.left+","+c.top+")"),y&&N.select(".nv-y.nv-axis").attr("transform","translate("+E+",0)"),x&&(l.width(E).height(F).margin({left:c.left,top:c.top}).svgContainer(w).xScale(n),W.select(".nv-interactive").call(l)),i.width(E).height(F).color(u.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!u[e].disabled}))),N.select(".nv-barsWrap").datum(u.filter((function(t){return!t.disabled}))).transition().call(i),v&&(a.scale(n)._ticks(e.utils.calcTicksX(E/100,u)).tickSize(-F,0),N.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),N.select(".nv-x.nv-axis").transition().call(a)),m&&(o.scale(r)._ticks(e.utils.calcTicksY(F/36,u)).tickSize(-E,0),N.select(".nv-y.nv-axis").transition().call(o)),l.dispatch.on("elementMousemove",(function(t){i.clearHighlights();var n,r,s,c=[];u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(a,o){r=e.interactiveBisect(a.values,t.pointXValue,S.x()),i.highlightPoint(r,!0);var l=a.values[r];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=S.xScale()(S.x()(l,r))),c.push({key:a.key,value:S.y()(l,r),color:f(a,a.seriesIndex),data:a.values[r]}))}));var d=a.tickFormat()(S.x()(n,r));l.tooltip.valueFormatter((function(t,e){return o.tickFormat()(t)})).data({value:d,index:r,series:c})(),l.renderGuideLine(s)})),l.dispatch.on("elementMouseout",(function(t){M.tooltipHide(),i.clearHighlights()})),s.dispatch.on("legendClick",(function(e,n){e.disabled=!e.disabled,u.filter((function(t){return!t.disabled})).length||u.map((function(t){return t.disabled=!1,W.selectAll(".nv-series").classed("disabled",!1),t})),b.disabled=u.map((function(t){return!!t.disabled})),M.stateChange(b),t.transition().call(S)})),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})),M.stateChange(b),S.update()})),M.on("changeState",(function(t){void 0!==t.disabled&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),b.disabled=t.disabled),S.update()}))})),C.renderEnd("historicalBarChart immediate"),S}return i.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:S.x()(t.data),value:S.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()})),S.dispatch=M,S.bars=i,S.legend=s,S.xAxis=a,S.yAxis=o,S.interactiveLayer=l,S.tooltip=u,S.options=e.utils.optionsFunc.bind(S),S._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 g},set:function(t){g=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},defaultState:{get:function(){return k},set:function(t){k=t}},noData:{get:function(){return w},set:function(t){w=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=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 f},set:function(t){f=e.utils.getColor(t),s.color(f),i.color(f)}},duration:{get:function(){return A},set:function(t){A=t,C.reset(A),o.duration(A),a.duration(A)}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,o.orient(t?"right":"left")}},useInteractiveGuideline:{get:function(){return x},set:function(t){x=t,!0===t&&S.interactive(!1)}}}),e.utils.inheritOptions(S,i),e.utils.initOptions(S),S},e.models.ohlcBarChart=function(){var t=e.models.historicalBarChart(e.models.ohlcBar());return t.useInteractiveGuideline(!0),t.interactiveLayer.tooltip.contentGenerator((function(e){var n=e.series[0].data;return'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+e.value+"</h3><table><tr><td>open:</td><td>"+t.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+t.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+t.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+t.yAxis.tickFormat()(n.low)+"</td></tr></table>"})),t},e.models.candlestickBarChart=function(){var t=e.models.historicalBarChart(e.models.candlestickBar());return t.useInteractiveGuideline(!0),t.interactiveLayer.tooltip.contentGenerator((function(e){var n=e.series[0].data;return'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+e.value+"</h3><table><tr><td>open:</td><td>"+t.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+t.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+t.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+t.yAxis.tickFormat()(n.low)+"</td></tr></table>"})),t},e.models.legend=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},a=function(t){return t},o=e.utils.getColor(),s=20,l=!0,u=32,c=!0,d=!0,f=!0,p=!1,h=!1,g=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),v="classic";function m(y){function x(t,e){return"furious"!=v?"#000":h?t.disengaged?"#000":"#fff":h?void 0:(t.color||(t.color=o(t,e)),t.disabled?t.color:"#fff")}function b(t,e){return h&&"furious"==v&&t.disengaged?"#eee":t.color||o(t,e)}function k(t,e){return h&&"furious"==v?1:t.disabled?0:1}return y.each((function(o){var m=n-t.left-t.right,y=d3.select(this);e.utils.initSVG(y);var w=y.selectAll("g.nv-legend").data([o]),M=w.enter().append("g").attr("class","nvd3 nv-legend").append("g"),A=w.select("g");c?w.attr("transform","translate("+-t.right+","+t.top+")"):w.attr("transform","translate("+t.left+","+t.top+")");var C,S,D=A.selectAll(".nv-series").data((function(t){return"furious"!=v?t:t.filter((function(t){return!!h||!t.disengaged}))})),E=D.enter().append("g").attr("class","nv-series");switch(v){case"furious":S=23;break;case"classic":S=20}"classic"==v?(E.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),C=D.select(".nv-legend-symbol")):"furious"==v&&(E.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),C=D.select(".nv-legend-symbol"),E.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)"),D.select(".nv-check-box").each((function(t,e){d3.select(this).selectAll("path").attr("stroke",x(t,e))}))),E.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var F=D.select("text.nv-legend-text");D.on("mouseover",(function(t,e){g.legendMouseover(t,e)})).on("mouseout",(function(t,e){g.legendMouseout(t,e)})).on("click",(function(t,e){g.legendClick(t,e);var n=D.data();d&&("classic"==v?p?(n.forEach((function(t){t.disabled=!0})),t.disabled=!1):(t.disabled=!t.disabled,n.every((function(t){return t.disabled}))&&n.forEach((function(t){t.disabled=!1}))):"furious"==v&&(h?(t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled):h||(t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter((function(t){return!t.disengaged})).every((function(t){return t.userDisabled}))&&n.forEach((function(t){t.disabled=t.userDisabled=!1})))),g.stateChange({disabled:n.map((function(t){return!!t.disabled})),disengaged:n.map((function(t){return!!t.disengaged}))}))})).on("dblclick",(function(t,e){if(f){if("furious"==v&&h)return;if(g.legendDblclick(t,e),d){var n=D.data();n.forEach((function(t){t.disabled=!0,"furious"==v&&(t.userDisabled=t.disabled)})),t.disabled=!1,"furious"==v&&(t.userDisabled=t.disabled),g.stateChange({disabled:n.map((function(t){return!!t.disabled}))})}}})),D.classed("nv-disabled",(function(t){return t.userDisabled})),D.exit().remove(),F.attr("fill",x).text((function(t){return a(i(t))}));var W=0;if(l){var O=[];D.each((function(t,n){var r,o;if(a(i(t))&&a(i(t)).length>s){var l=a(i(t)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(a(i(t)))}else r=d3.select(this).select("text");try{if((o=r.node().getComputedTextLength())<=0)throw Error()}catch(t){o=e.utils.calcApproxTextWidth(r)}O.push(o+u)}));var N=0,L=[];for(W=0;W<m&&N<O.length;)L[N]=O[N],W+=O[N++];for(0===N&&(N=1);W>m&&N>1;){L=[],N--;for(var _=0;_<O.length;_++)O[_]>(L[_%N]||0)&&(L[_%N]=O[_]);W=L.reduce((function(t,e,n,r){return t+e}))}for(var B=[],T=0,P=0;T<N;T++)B[T]=P,P+=L[T];D.attr("transform",(function(t,e){return"translate("+B[e%N]+","+(5+Math.floor(e/N)*S)+")"})),c?A.attr("transform","translate("+(n-t.right-W)+","+t.top+")"):A.attr("transform","translate(0,"+t.top+")"),r=t.top+t.bottom+Math.ceil(O.length/N)*S}else{var I,H=5,V=5,z=0;D.attr("transform",(function(e,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return I=V,n<t.left+t.right+I+i&&(V=I=5,H+=S),(V+=i)>z&&(z=V),W<I+z&&(W=I+z),"translate("+I+","+H+")"})),A.attr("transform","translate("+(n-t.right-z)+","+t.top+")"),r=t.top+t.bottom+H+15}"furious"==v&&(C.attr("width",(function(t,e){return F[0][e].getComputedTextLength()+27})).attr("height",18).attr("y",-9).attr("x",-15),M.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0),A.select(".nv-legend-bg").transition().duration(300).attr("x",-S).attr("width",W+S-12).attr("height",r+10).attr("y",-t.top-10).attr("opacity",h?1:0)),C.style("fill",b).style("fill-opacity",k).style("stroke",b)})),m}return m.dispatch=g,m.options=e.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 a},set:function(t){a=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 d},set:function(t){d=t}},enableDoubleClick:{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 t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return o},set:function(t){o=e.utils.getColor(t)}}}),e.utils.initOptions(m),m},e.models.line=function(){"use strict";var t,n,r=e.models.scatter(),i={top:0,right:0,bottom:0,left:0},a=960,o=500,s=null,l=e.utils.defaultColor(),u=function(t){return t.x},c=function(t){return t.y},d=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},f=function(t){return t.area},p=!1,h="linear",g=250,v=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");r.pointSize(16).pointDomain([16,256]);var m,y,x=e.utils.renderWatch(v,g);function b(g){return x.reset(),x.models(r),g.each((function(g){s=d3.select(this);var v=e.utils.availableWidth(a,s,i),b=e.utils.availableHeight(o,s,i);e.utils.initSVG(s),t=r.xScale(),n=r.yScale(),m=m||t,y=y||n;var k=s.selectAll("g.nv-wrap.nv-line").data([g]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),M=w.append("defs"),A=w.append("g"),C=k.select("g");A.append("g").attr("class","nv-groups"),A.append("g").attr("class","nv-scatterWrap"),k.attr("transform","translate("+i.left+","+i.top+")"),r.width(v).height(b);var S=k.select(".nv-scatterWrap");S.call(r),M.append("clipPath").attr("id","nv-edge-clip-"+r.id()).append("rect"),k.select("#nv-edge-clip-"+r.id()+" rect").attr("width",v).attr("height",b>0?b:0),C.attr("clip-path",p?"url(#nv-edge-clip-"+r.id()+")":""),S.attr("clip-path",p?"url(#nv-edge-clip-"+r.id()+")":"");var D=k.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));D.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",(function(t){return t.strokeWidth||1.5})).style("fill-opacity",1e-6),D.exit().remove(),D.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 l(t,e)})).style("stroke",(function(t,e){return l(t,e)})),D.watchTransition(x,"line: groups").style("stroke-opacity",1).style("fill-opacity",(function(t){return t.fillOpacity||.5}));var E=D.selectAll("path.nv-area").data((function(t){return f(t)?[t]:[]}));E.enter().append("path").attr("class","nv-area").attr("d",(function(t){return d3.svg.area().interpolate(h).defined(d).x((function(t,n){return e.utils.NaNtoZero(m(u(t,n)))})).y0((function(t,n){return e.utils.NaNtoZero(y(c(t,n)))})).y1((function(t,e){return y(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])})).apply(this,[t.values])})),D.exit().selectAll("path.nv-area").remove(),E.watchTransition(x,"line: areaPaths").attr("d",(function(r){return d3.svg.area().interpolate(h).defined(d).x((function(n,r){return e.utils.NaNtoZero(t(u(n,r)))})).y0((function(t,r){return e.utils.NaNtoZero(n(c(t,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=D.selectAll("path.nv-line").data((function(t){return[t.values]}));F.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(h).defined(d).x((function(t,n){return e.utils.NaNtoZero(m(u(t,n)))})).y((function(t,n){return e.utils.NaNtoZero(y(c(t,n)))}))),F.watchTransition(x,"line: linePaths").attr("d",d3.svg.line().interpolate(h).defined(d).x((function(n,r){return e.utils.NaNtoZero(t(u(n,r)))})).y((function(t,r){return e.utils.NaNtoZero(n(c(t,r)))}))),m=t.copy(),y=n.copy()})),x.renderEnd("line immediate"),b}return b.dispatch=v,b.scatter=r,r.dispatch.on("elementClick",(function(){v.elementClick.apply(this,arguments)})),r.dispatch.on("elementMouseover",(function(){v.elementMouseover.apply(this,arguments)})),r.dispatch.on("elementMouseout",(function(){v.elementMouseout.apply(this,arguments)})),b.options=e.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return o},set:function(t){o=t}},defined:{get:function(){return d},set:function(t){d=t}},interpolate:{get:function(){return h},set:function(t){h=t}},clipEdge:{get:function(){return p},set:function(t){p=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 g},set:function(t){g=t,x.reset(g),r.duration(g)}},isArea:{get:function(){return f},set:function(t){f=d3.functor(t)}},x:{get:function(){return u},set:function(t){u=t,r.x(t)}},y:{get:function(){return c},set:function(t){c=t,r.y(t)}},color:{get:function(){return l},set:function(t){l=e.utils.getColor(t),r.color(l)}}}),e.utils.inheritOptions(b,r),e.utils.initOptions(b),b},e.models.lineChart=function(){"use strict";var t,n,r=e.models.line(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend(),s=e.interactiveGuideline(),l=e.models.tooltip(),u=e.models.focus(e.models.line()),c={top:30,right:20,bottom:50,left:60},d=null,f=e.utils.defaultColor(),p=null,h=null,g=!0,v="top",m=!0,y=!0,x=!1,b=!1,k=!1,w=e.utils.state(),M=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=250;i.orient("bottom").tickPadding(7),a.orient(x?"right":"left"),r.clipEdge(!0).duration(0),l.valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.tooltip.valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)}));var D=e.utils.renderWatch(C,S);function E(l){return D.reset(),D.models(r),m&&D.models(i),y&&D.models(a),l.each((function(l){var A=d3.select(this);e.utils.initSVG(A);var D,F=e.utils.availableWidth(p,A,c),W=e.utils.availableHeight(h,A,c)-(k?u.height():0);if(E.update=function(){0===S?A.call(E):A.transition().duration(S).call(E)},E.container=this,w.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(l),E.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(l)).update(),w.disabled=l.map((function(t){return!!t.disabled})),!M)for(D in M={},w)w[D]instanceof Array?M[D]=w[D].slice(0):M[D]=w[D];if(!(l&&l.length&&l.filter((function(t){return t.values.length})).length))return e.utils.noData(E,A),E;A.selectAll(".nv-noData").remove(),u.dispatch.on("onBrush",(function(t){H(t)})),t=r.xScale(),n=r.yScale();var O=A.selectAll("g.nv-wrap.nv-lineChart").data([l]),N=O.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),L=O.select("g");N.append("g").attr("class","nv-legendWrap");var _=N.append("g").attr("class","nv-focus");_.append("g").attr("class","nv-background").append("rect"),_.append("g").attr("class","nv-x nv-axis"),_.append("g").attr("class","nv-y nv-axis"),_.append("g").attr("class","nv-linesWrap"),_.append("g").attr("class","nv-interactive"),N.append("g").attr("class","nv-focusWrap"),g?(o.width(F),L.select(".nv-legendWrap").datum(l).call(o),"bottom"===v?(c.bottom=i.height()+o.height(),W=e.utils.availableHeight(h,A,c),L.select(".nv-legendWrap").attr("transform","translate(0,"+(W+i.height())+")")):"top"===v&&(d||o.height()===c.top||(c.top=o.height(),W=e.utils.availableHeight(h,A,c)-(k?u.height():0)),O.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")"))):L.select(".nv-legendWrap").selectAll("*").remove(),O.attr("transform","translate("+c.left+","+c.top+")"),x&&L.select(".nv-y.nv-axis").attr("transform","translate("+F+",0)"),b&&(s.width(F).height(W).margin({left:c.left,top:c.top}).svgContainer(A).xScale(t),O.select(".nv-interactive").call(s)),L.select(".nv-focus .nv-background rect").attr("width",F).attr("height",W),r.width(F).height(W).color(l.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!l[e].disabled})));var B=L.select(".nv-linesWrap").datum(l.filter((function(t){return!t.disabled})));function T(){m&&L.select(".nv-focus .nv-x.nv-axis").transition().duration(S).call(i)}function P(){y&&L.select(".nv-focus .nv-y.nv-axis").transition().duration(S).call(a)}if(m&&i.scale(t)._ticks(e.utils.calcTicksX(F/100,l)).tickSize(-W,0),y&&a.scale(n)._ticks(e.utils.calcTicksY(W/36,l)).tickSize(-F,0),L.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+W+")"),k||null!==u.brush.extent()){u.width(F),L.select(".nv-focusWrap").style("display",k?"initial":"none").attr("transform","translate(0,"+(W+c.bottom+u.margin().top)+")").call(u);var I=u.brush.empty()?u.xDomain():u.brush.extent();null!==I&&H(I)}else B.call(r),T(),P();function H(t){L.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(S).call(r),T(),P()}o.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];C.stateChange(w),E.update()})),s.dispatch.on("elementMousemove",(function(n){r.clearHighlights();var i,o,c,d=[];if(l.filter((function(t,e){return t.seriesIndex=e,!t.disabled&&!t.disableTooltip})).forEach((function(a,s){var l=null!==u.brush.extent()?u.brush.empty()?u.xScale().domain():u.brush.extent():t.domain(),p=a.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]})),h=p[o=e.interactiveBisect(p,n.pointXValue,r.x())],g=E.y()(h,o);null!==g&&r.highlightPoint(s,o,!0),void 0!==h&&(void 0===i&&(i=h),void 0===c&&(c=E.xScale()(E.x()(h,o))),d.push({key:a.key,value:g,color:f(a,a.seriesIndex),data:h}))})),d.length>2){var p=E.yScale().invert(n.mouseY),h=.03*Math.abs(E.yScale().domain()[0]-E.yScale().domain()[1]),g=e.nearestValueIndex(d.map((function(t){return t.value})),p,h);null!==g&&(d[g].highlight=!0)}s.tooltip.valueFormatter(s.tooltip.valueFormatter()||function(t,e){return null==t?"N/A":a.tickFormat()(t)}).data({value:E.x()(i,o),index:o,series:d})(),s.renderGuideLine(c)})),s.dispatch.on("elementClick",(function(t){var n,i=[];l.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(r){var a=e.interactiveBisect(r.values,t.pointXValue,E.x()),o=r.values[a];if(void 0!==o){void 0===n&&(n=E.xScale()(E.x()(o,a)));var s=E.yScale()(E.y()(o,a));i.push({point:o,pointIndex:a,pos:[n,s],seriesIndex:r.seriesIndex,series:r})}})),r.dispatch.elementClick(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]})),w.disabled=t.disabled),E.update()}))})),D.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=o,E.focus=u,E.xAxis=i,E.x2Axis=u.xAxis,E.yAxis=a,E.y2Axis=u.yAxis,E.interactiveLayer=s,E.tooltip=l,E.state=w,E.dispatch=C,E.options=e.utils.optionsFunc.bind(E),E._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 g},set:function(t){g=t}},legendPosition:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return y},set:function(t){y=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return A},set:function(t){A=t}},focusEnable:{get:function(){return k},set:function(t){k=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,d=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 S},set:function(t){S=t,D.reset(S),r.duration(S),u.duration(S),i.duration(S),a.duration(S)}},color:{get:function(){return f},set:function(t){f=e.utils.getColor(t),o.color(f),r.color(f),u.color(f)}},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 a.tickFormat()},set:function(t){a.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,a.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return b},set:function(t){(b=t)&&(r.interactive(!1),r.useVoronoi(!1))}}}),e.utils.inheritOptions(E,r),e.utils.initOptions(E),E},e.models.lineWithFocusChart=function(){return e.models.lineChart().margin({bottom:30}).focusEnable(!0)},e.models.linePlusBarChart=function(){"use strict";var t,n,r,i,a,o,s,l=e.models.line(),u=e.models.line(),c=e.models.historicalBar(),d=e.models.historicalBar(),f=e.models.axis(),p=e.models.axis(),h=e.models.axis(),g=e.models.axis(),v=e.models.axis(),m=e.models.axis(),y=e.models.legend(),x=d3.svg.brush(),b=e.models.tooltip(),k={top:30,right:30,bottom:30,left:60},w=null,M={top:0,right:30,bottom:20,left:60},A=null,C=null,S=function(t){return t.x},D=function(t){return t.y},E=e.utils.defaultColor(),F=!0,W=!0,O=!1,N=!0,L=50,_=null,B=null,T=d3.dispatch("brush","stateChange","changeState"),P=0,I=e.utils.state(),H=null,V=" (left axis)",z=" (right axis)",R=!1;l.clipEdge(!0),u.interactive(!1),u.pointActive((function(t){return!1})),f.orient("bottom").tickPadding(5),h.orient("left"),g.orient("right"),p.orient("bottom").tickPadding(5),v.orient("left"),m.orient("right"),b.headerEnabled(!0).headerFormatter((function(t,e){return f.tickFormat()(t,e)}));var Y=function(t){return t.every((function(t){return t.disabled}))};function j(b){return b.each((function(b){var B=d3.select(this);e.utils.initSVG(B);var G,X=e.utils.availableWidth(A,B,k),Z=e.utils.availableHeight(C,B,k)-(W?L:0),U=L-M.top-M.bottom;if(j.update=function(){B.transition().duration(P).call(j)},j.container=this,I.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(b),j.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(b)).update(),I.disabled=b.map((function(t){return!!t.disabled})),!H)for(G in H={},I)I[G]instanceof Array?H[G]=I[G].slice(0):H[G]=I[G];if(!(b&&b.length&&b.filter((function(t){return t.values.length})).length))return e.utils.noData(j,B),j;B.selectAll(".nv-noData").remove();var q=b.filter((function(t){return!t.disabled&&t.bar})),K=b.filter((function(t){return!t.bar}));n=q.length&&!R?c.xScale():l.xScale(),r=p.scale(),i=R?l.yScale():c.yScale(),a=R?c.yScale():l.yScale(),o=R?u.yScale():d.yScale(),s=R?d.yScale():u.yScale();var $=b.filter((function(t){return!t.disabled&&(R?!t.bar:t.bar)})).map((function(t){return t.values.map((function(t,e){return{x:S(t,e),y:D(t,e)}}))})),Q=b.filter((function(t){return!t.disabled&&(R?t.bar:!t.bar)})).map((function(t){return t.values.map((function(t,e){return{x:S(t,e),y:D(t,e)}}))}));n.range([0,X]),r.domain(d3.extent(d3.merge($.concat(Q)),(function(t){return t.x}))).range([0,X]);var J=B.selectAll("g.nv-wrap.nv-linePlusBar").data([b]),tt=J.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),et=J.select("g");tt.append("g").attr("class","nv-legendWrap");var nt=tt.append("g").attr("class","nv-focus");nt.append("g").attr("class","nv-x nv-axis"),nt.append("g").attr("class","nv-y1 nv-axis"),nt.append("g").attr("class","nv-y2 nv-axis"),nt.append("g").attr("class","nv-barsWrap"),nt.append("g").attr("class","nv-linesWrap");var rt=tt.append("g").attr("class","nv-context");if(rt.append("g").attr("class","nv-x nv-axis"),rt.append("g").attr("class","nv-y1 nv-axis"),rt.append("g").attr("class","nv-y2 nv-axis"),rt.append("g").attr("class","nv-barsWrap"),rt.append("g").attr("class","nv-linesWrap"),rt.append("g").attr("class","nv-brushBackground"),rt.append("g").attr("class","nv-x nv-brush"),F){var it=y.align()?X/2:X,at=y.align()?it:0;y.width(it),et.select(".nv-legendWrap").datum(b.map((function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=R?t.originalKey+(t.bar?z:V):t.originalKey+(t.bar?V:z),t}))).call(y),w||y.height()===k.top||(k.top=y.height(),Z=e.utils.availableHeight(C,B,k)-L),et.select(".nv-legendWrap").attr("transform","translate("+at+","+-k.top+")")}else et.select(".nv-legendWrap").selectAll("*").remove();J.attr("transform","translate("+k.left+","+k.top+")"),et.select(".nv-context").style("display",W?"initial":"none"),d.width(X).height(U).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&b[e].bar}))),u.width(X).height(U).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&!b[e].bar})));var ot=et.select(".nv-context .nv-barsWrap").datum(q.length?q:[{values:[]}]),st=et.select(".nv-context .nv-linesWrap").datum(Y(K)?[{values:[]}]:K.filter((function(t){return!t.disabled})));et.select(".nv-context").attr("transform","translate(0,"+(Z+k.bottom+M.top)+")"),ot.transition().call(d),st.transition().call(u),N&&(p._ticks(e.utils.calcTicksX(X/100,b)).tickSize(-U,0),et.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+o.range()[0]+")"),et.select(".nv-context .nv-x.nv-axis").transition().call(p)),O&&(v.scale(o)._ticks(U/36).tickSize(-X,0),m.scale(s)._ticks(U/36).tickSize(q.length?0:-X,0),et.select(".nv-context .nv-y3.nv-axis").style("opacity",q.length?1:0).attr("transform","translate(0,"+r.range()[0]+")"),et.select(".nv-context .nv-y2.nv-axis").style("opacity",K.length?1:0).attr("transform","translate("+r.range()[1]+",0)"),et.select(".nv-context .nv-y1.nv-axis").transition().call(v),et.select(".nv-context .nv-y2.nv-axis").transition().call(m)),x.x(r).on("brush",dt),_&&x.extent(_);var lt=et.select(".nv-brushBackground").selectAll("g").data([_||x.extent()]),ut=lt.enter().append("g");ut.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",U),ut.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",U);var ct=et.select(".nv-x.nv-brush").call(x);function dt(){_=x.empty()?null:x.extent(),t=x.empty()?r.domain():x.extent(),T.brush({extent:t,brush:x}),x.empty()||x.extent(_),lt.data([x.empty()?r.domain():_]).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(X).height(Z).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&b[e].bar}))),l.width(X).height(Z).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&!b[e].bar})));var o=et.select(".nv-focus .nv-barsWrap").datum(q.length?q.map((function(e,n){return{key:e.key,values:e.values.filter((function(e,n){return c.x()(e,n)>=t[0]&&c.x()(e,n)<=t[1]}))}})):[{values:[]}]),s=et.select(".nv-focus .nv-linesWrap").datum(Y(K)?[{values:[]}]:K.filter((function(t){return!t.disabled})).map((function(e,n){return{area:e.area,fillOpacity:e.fillOpacity,strokeWidth:e.strokeWidth,key:e.key,values:e.values.filter((function(e,n){return l.x()(e,n)>=t[0]&&l.x()(e,n)<=t[1]}))}})));n=q.length&&!R?c.xScale():l.xScale(),f.scale(n)._ticks(e.utils.calcTicksX(X/100,b)).tickSize(-Z,0),f.domain([Math.ceil(t[0]),Math.floor(t[1])]),et.select(".nv-x.nv-axis").transition().duration(P).call(f),o.transition().duration(P).call(c),s.transition().duration(P).call(l),et.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+i.range()[0]+")"),h.scale(i)._ticks(e.utils.calcTicksY(Z/36,b)).tickSize(-X,0),g.scale(a)._ticks(e.utils.calcTicksY(Z/36,b)),R?g.tickSize(K.length?0:-X,0):g.tickSize(q.length?0:-X,0);var u=q.length?1:0,d=K.length&&!Y(K)?1:0,p=R?d:u,v=R?u:d;et.select(".nv-focus .nv-y1.nv-axis").style("opacity",p),et.select(".nv-focus .nv-y2.nv-axis").style("opacity",v).attr("transform","translate("+n.range()[1]+",0)"),et.select(".nv-focus .nv-y1.nv-axis").transition().duration(P).call(h),et.select(".nv-focus .nv-y2.nv-axis").transition().duration(P).call(g)}ct.selectAll("rect").attr("height",U),ct.selectAll(".resize").append("path").attr("d",(function(t){var e=+("e"==t),n=e?1:-1,r=U/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)})),y.dispatch.on("stateChange",(function(t){for(var e in t)I[e]=t[e];T.stateChange(I),j.update()})),T.on("changeState",(function(t){void 0!==t.disabled&&(b.forEach((function(e,n){e.disabled=t.disabled[n]})),I.disabled=t.disabled),j.update()})),dt()})),j}return l.dispatch.on("elementMouseover.tooltip",(function(t){b.duration(100).valueFormatter((function(t,e){return(R?{main:h,focus:v}:{main:g,focus:m}).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=j.x()(t.data),t.series={value:j.y()(t.data),color:t.color},b.duration(0).valueFormatter((function(t,e){return(R?{main:g,focus:m}:{main:h,focus:v}).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()})),j.dispatch=T,j.legend=y,j.lines=l,j.lines2=u,j.bars=c,j.bars2=d,j.xAxis=f,j.x2Axis=p,j.y1Axis=h,j.y2Axis=g,j.y3Axis=v,j.y4Axis=m,j.tooltip=b,j.options=e.utils.optionsFunc.bind(j),j._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 F},set:function(t){F=t}},brushExtent:{get:function(){return _},set:function(t){_=t}},noData:{get:function(){return B},set:function(t){B=t}},focusEnable:{get:function(){return W},set:function(t){W=t}},focusHeight:{get:function(){return L},set:function(t){L=t}},focusShowAxisX:{get:function(){return N},set:function(t){N=t}},focusShowAxisY:{get:function(){return O},set:function(t){O=t}},legendLeftAxisHint:{get:function(){return V},set:function(t){V=t}},legendRightAxisHint:{get:function(){return z},set:function(t){z=t}},margin:{get:function(){return k},set:function(t){void 0!==t.top&&(k.top=t.top,w=t.top),k.right=void 0!==t.right?t.right:k.right,k.bottom=void 0!==t.bottom?t.bottom:k.bottom,k.left=void 0!==t.left?t.left:k.left}},focusMargin:{get:function(){return M},set:function(t){M.top=void 0!==t.top?t.top:M.top,M.right=void 0!==t.right?t.right:M.right,M.bottom=void 0!==t.bottom?t.bottom:M.bottom,M.left=void 0!==t.left?t.left:M.left}},duration:{get:function(){return P},set:function(t){P=t}},color:{get:function(){return E},set:function(t){E=e.utils.getColor(t),y.color(E)}},x:{get:function(){return S},set:function(t){S=t,l.x(t),u.x(t),c.x(t),d.x(t)}},y:{get:function(){return D},set:function(t){D=t,l.y(t),u.y(t),c.y(t),d.y(t)}},switchYAxisOrder:{get:function(){return R},set:function(t){if(R!==t){var e=h;h=g,g=e;var n=v;v=m,m=n}R=t,h.orient("left"),g.orient("right"),v.orient("left"),m.orient("right")}}}),e.utils.inheritOptions(j,l),e.utils.initOptions(j),j},e.models.multiBar=function(){"use strict";var t,n,r,i,a,o,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=d3.scale.ordinal(),f=d3.scale.linear(),p=Math.floor(1e4*Math.random()),h=null,g=function(t){return t.x},v=function(t){return t.y},m=[0],y=!0,x=!1,b="zero",k=e.utils.defaultColor(),w=!1,M=null,A=500,C=.1,S=.75,D=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=e.utils.renderWatch(D,A),F=0;function W(O){return E.reset(),O.each((function(W){var O=u-l.left-l.right,N=c-l.top-l.bottom;h=d3.select(this),e.utils.initSVG(h);var L=0;if(w&&W.length&&(w=[{values:W[0].values.map((function(t){return{x:t.x,y:0,series:t.series,size:.01}}))}]),x){var _=d3.layout.stack().offset(b).values((function(t){return t.values})).y(v)(!W.length&&w?w:W);_.forEach((function(t,e){t.nonStackable?(W[e].nonStackableSeries=L++,_[e]=W[e]):e>0&&_[e-1].nonStackable&&_[e].values.map((function(t,n){t.y0-=_[e-1].values[n].y,t.y1=t.y0+t.y}))})),W=_}W.forEach((function(t,e){t.values.forEach((function(n){n.series=e,n.key=t.key}))})),x&&W.length>0&&W[0].values.map((function(t,e){var n=0,r=0;W.map((function(t,i){if(!W[i].nonStackable){var a=t.values[e];a.size=Math.abs(a.y),a.y<0?(a.y1=r,r-=a.size):(a.y1=a.size+n,n+=a.size)}}))}));var B=n&&r?[]:W.map((function(t,e){return t.values.map((function(t,n){return{x:g(t,n),y:v(t,n),y0:t.y0,y1:t.y1,idx:e}}))}));d.domain(n||d3.merge(B).map((function(t){return t.x}))).rangeBands(i||[0,O],C),f.domain(r||d3.extent(d3.merge(B).map((function(t){var e=t.y;return x&&!W[t.idx].nonStackable&&(e=t.y>0?t.y1:t.y1+t.y),e})).concat(m))).range(a||[N,0]),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]-.01*d.domain()[0],d.domain()[1]+.01*d.domain()[1]]):d.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])),o=o||d,s=s||f;var T=h.selectAll("g.nv-wrap.nv-multibar").data([W]),P=T.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),I=P.append("defs"),H=P.append("g"),V=T.select("g");H.append("g").attr("class","nv-groups"),T.attr("transform","translate("+l.left+","+l.top+")"),I.append("clipPath").attr("id","nv-edge-clip-"+p).append("rect"),T.select("#nv-edge-clip-"+p+" rect").attr("width",O).attr("height",N),V.attr("clip-path",y?"url(#nv-edge-clip-"+p+")":"");var z=T.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t,e){return e}));z.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var R=E.transition(z.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,A)).attr("y",(function(t,e,n){var r=s(0)||0;return x&&W[t.series]&&!W[t.series].nonStackable&&(r=s(t.y0)),r})).attr("height",0).remove();R.delay&&R.delay((function(t,e){return e*(A/(F+1))-e})),z.attr("class",(function(t,e){return"nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})).style("fill",(function(t,e){return k(t,e)})).style("stroke",(function(t,e){return k(t,e)})),z.style("stroke-opacity",1).style("fill-opacity",S);var Y=z.selectAll("rect.nv-bar").data((function(t){return w&&!W.length?w.values:t.values}));Y.exit().remove(),Y.enter().append("rect").attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})).attr("x",(function(t,e,n){return x&&!W[n].nonStackable?0:n*d.rangeBand()/W.length})).attr("y",(function(t,e,n){return s(x&&!W[n].nonStackable?t.y0:0)||0})).attr("height",0).attr("width",(function(t,e,n){return d.rangeBand()/(x&&!W[n].nonStackable?1:W.length)})).attr("transform",(function(t,e){return"translate("+d(g(t,e))+",0)"})),Y.style("fill",(function(t,e,n){return k(t,n,e)})).style("stroke",(function(t,e,n){return k(t,n,e)})).on("mouseover",(function(t,e,n){d3.select(this).classed("hover",!0),D.elementMouseover({data:t,index:e,series:W[n],color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e,n){d3.select(this).classed("hover",!1),D.elementMouseout({data:t,index:e,series:W[n],color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e,n){D.elementMousemove({data:t,index:e,series:W[n],color:d3.select(this).style("fill")})})).on("click",(function(t,e,n){D.elementClick({data:t,index:e,series:W[n],color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e,n){D.elementDblClick({data:t,index:e,series:W[n],color:d3.select(this).style("fill")}),d3.event.stopPropagation()})),Y.attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})).attr("transform",(function(t,e){return"translate("+d(g(t,e))+",0)"})),M&&(t||(t=W.map((function(){return!0}))),Y.style("fill",(function(e,n,r){return d3.rgb(M(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})).style("stroke",(function(e,n,r){return d3.rgb(M(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})));var j=Y.watchTransition(E,"multibar",Math.min(250,A)).delay((function(t,e){return e*A/W[0].values.length}));x?j.attr("y",(function(t,e,n){return W[n].nonStackable?v(t,e)<0?f(0):f(0)-f(v(t,e))<-1?f(0)-1:f(v(t,e))||0:f(t.y1)})).attr("height",(function(t,e,n){return W[n].nonStackable?Math.max(Math.abs(f(v(t,e))-f(0)),0)||0:Math.max(Math.abs(f(t.y+t.y0)-f(t.y0)),0)})).attr("x",(function(t,e,n){var r=0;return W[n].nonStackable&&(r=t.series*d.rangeBand()/W.length,W.length!==L&&(r=W[n].nonStackableSeries*d.rangeBand()/(2*L))),r})).attr("width",(function(t,e,n){if(W[n].nonStackable){var r=d.rangeBand()/L;return W.length!==L&&(r=d.rangeBand()/(2*L)),r}return d.rangeBand()})):j.attr("x",(function(t,e){return t.series*d.rangeBand()/W.length})).attr("width",d.rangeBand()/W.length).attr("y",(function(t,e){return v(t,e)<0?f(0):f(0)-f(v(t,e))<1?f(0)-1:f(v(t,e))||0})).attr("height",(function(t,e){return Math.max(Math.abs(f(v(t,e))-f(0)),1)||0})),o=d.copy(),s=f.copy(),W[0]&&W[0].values&&(F=W[0].values.length)})),E.renderEnd("multibar immediate"),W}return W.dispatch=D,W.options=e.utils.optionsFunc.bind(W),W._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 g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},xScale:{get:function(){return d},set:function(t){d=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 a},set:function(t){a=t}},forceY:{get:function(){return m},set:function(t){m=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 t},set:function(e){t=e}},id:{get:function(){return p},set:function(t){p=t}},hideable:{get:function(){return w},set:function(t){w=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=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,E.reset(A)}},color:{get:function(){return k},set:function(t){k=e.utils.getColor(t)}},barColor:{get:function(){return M},set:function(t){M=t?e.utils.getColor(t):null}}}),e.utils.initOptions(W),W},e.models.multiBarChart=function(){"use strict";var t,n,r=e.models.multiBar(),i=e.models.axis(),a=e.models.axis(),o=e.interactiveGuideline(),s=e.models.legend(),l=e.models.legend(),u=e.models.tooltip(),c={top:30,right:20,bottom:50,left:60},d=null,f=null,p=null,h=e.utils.defaultColor(),g=!0,v={},m=!0,y=null,x=!0,b=!0,k=!1,w=!0,M=!1,A=!1,C=0,S=e.utils.state(),D=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),W=function(){return g?180:0},O=250,N=!1;S.stacked=!1,r.stacked(!1),i.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat((function(t){return t})),a.orient(k?"right":"left").tickFormat(d3.format(",.1f")),u.duration(0).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),o.tooltip.valueFormatter((function(t,e){return null==t?"N/A":a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),o.tooltip.valueFormatter((function(t,e){return null==t?"N/A":a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),o.tooltip.duration(0).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),l.updateState(!1);var L=e.utils.renderWatch(F),_=!1;function B(E){return L.reset(),L.models(r),x&&L.models(i),b&&L.models(a),E.each((function(E){var L=d3.select(this);e.utils.initSVG(L);var T,P=e.utils.availableWidth(f,L,c),I=e.utils.availableHeight(p,L,c);if(B.update=function(){0===O?L.call(B):L.transition().duration(O).call(B)},B.container=this,S.setter(function(t){return function(e){void 0!==e.stacked&&(_=e.stacked),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(E),B.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),stacked:_}}}(E)).update(),S.disabled=E.map((function(t){return!!t.disabled})),!D)for(T in D={},S)S[T]instanceof Array?D[T]=S[T].slice(0):D[T]=S[T];if(!(E&&E.length&&E.filter((function(t){return t.values.length})).length))return e.utils.noData(B,L),B;L.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale();var H=L.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([E]),V=H.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),z=H.select("g");if(V.append("g").attr("class","nv-x nv-axis"),V.append("g").attr("class","nv-y nv-axis"),V.append("g").attr("class","nv-barsWrap"),V.append("g").attr("class","nv-legendWrap"),V.append("g").attr("class","nv-controlsWrap"),V.append("g").attr("class","nv-interactive"),m?"bottom"===y?(s.width(P-c.right),z.select(".nv-legendWrap").datum(E).call(s),c.bottom=i.height()+s.height(),I=e.utils.availableHeight(p,L,c),z.select(".nv-legendWrap").attr("transform","translate(0,"+(I+i.height())+")")):(s.width(P-W()),z.select(".nv-legendWrap").datum(E).call(s),d||s.height()===c.top||(c.top=s.height(),I=e.utils.availableHeight(p,L,c)),z.select(".nv-legendWrap").attr("transform","translate("+W()+","+-c.top+")")):z.select(".nv-legendWrap").selectAll("*").remove(),g){var R=[{key:v.grouped||"Grouped",disabled:r.stacked()},{key:v.stacked||"Stacked",disabled:!r.stacked()}];l.width(W()).color(["#444","#444","#444"]),z.select(".nv-controlsWrap").datum(R).attr("transform","translate(0,"+-c.top+")").call(l)}else z.select(".nv-controlsWrap").selectAll("*").remove();if(H.attr("transform","translate("+c.left+","+c.top+")"),k&&z.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)"),r.disabled(E.map((function(t){return t.disabled}))).width(P).height(I).color(E.map((function(t,e){return t.color||h(t,e)})).filter((function(t,e){return!E[e].disabled}))),z.select(".nv-barsWrap").datum(E.filter((function(t){return!t.disabled}))).call(r),x){i.scale(t)._ticks(e.utils.calcTicksX(P/100,E)).tickSize(-I,0),z.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),z.select(".nv-x.nv-axis").call(i);var Y=z.select(".nv-x.nv-axis > g").selectAll("g");if(Y.selectAll("line, text").style("opacity",1),M){var j=function(t,e){return"translate("+t+","+e+")"};Y.selectAll("text").attr("transform",(function(t,e,n){return j(0,n%2==0?5:17)}));var G=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;z.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",(function(t,e){return j(0,0===e||G%2!=0?17:5)}))}A&&z.selectAll(".tick text").call(e.utils.wrapTicks,B.xAxis.rangeBand()),w&&Y.filter((function(t,e){return e%Math.ceil(E[0].values.length/(P/100))!=0})).selectAll("text, line").style("opacity",0),C&&Y.selectAll(".tick text").attr("transform","rotate("+C+" 0,0)").style("text-anchor",C>0?"start":"end"),z.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}b&&(a.scale(n)._ticks(e.utils.calcTicksY(I/36,E)).tickSize(-P,0),z.select(".nv-y.nv-axis").call(a)),N&&(o.width(P).height(I).margin({left:c.left,top:c.top}).svgContainer(L).xScale(t),H.select(".nv-interactive").call(o)),s.dispatch.on("stateChange",(function(t){for(var e in t)S[e]=t[e];F.stateChange(S),B.update()})),l.dispatch.on("legendClick",(function(t,e){if(t.disabled){switch(R=R.map((function(t){return t.disabled=!0,t})),t.disabled=!1,t.key){case"Grouped":case v.grouped:r.stacked(!1);break;case"Stacked":case v.stacked:r.stacked(!0)}S.stacked=r.stacked(),F.stateChange(S),B.update()}})),F.on("changeState",(function(t){void 0!==t.disabled&&(E.forEach((function(e,n){e.disabled=t.disabled[n]})),S.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),S.stacked=t.stacked,_=t.stacked),B.update()})),N?(o.dispatch.on("elementMousemove",(function(e){if(null!=e.pointXValue){var n,r,i,a,s=[];E.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(o,l){r=t.domain().indexOf(e.pointXValue);var u=o.values[r];void 0!==u&&(a=u.x,void 0===n&&(n=u),void 0===i&&(i=e.mouseX),s.push({key:o.key,value:B.y()(u,r),color:h(o,o.seriesIndex),data:o.values[r]}))})),o.tooltip.data({value:a,index:r,series:s})(),o.renderGuideLine(i)}})),o.dispatch.on("elementMouseout",(function(t){o.tooltip.hidden(!0)}))):(r.dispatch.on("elementMouseover.tooltip",(function(t){t.value=B.x()(t.data),t.series={key:t.data.key,value:B.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()})))})),L.renderEnd("multibarchart immediate"),B}return B.dispatch=F,B.multibar=r,B.legend=s,B.controls=l,B.xAxis=i,B.yAxis=a,B.state=S,B.tooltip=u,B.interactiveLayer=o,B.options=e.utils.optionsFunc.bind(B),B._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 m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showControls:{get:function(){return g},set:function(t){g=t}},controlLabels:{get:function(){return v},set:function(t){v=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 D},set:function(t){D=t}},noData:{get:function(){return E},set:function(t){E=t}},reduceXTicks:{get:function(){return w},set:function(t){w=t}},rotateLabels:{get:function(){return C},set:function(t){C=t}},staggerLabels:{get:function(){return M},set:function(t){M=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,d=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 O},set:function(t){O=t,r.duration(O),i.duration(O),a.duration(O),L.reset(O)}},color:{get:function(){return h},set:function(t){h=e.utils.getColor(t),s.color(h)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,a.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return N},set:function(t){N=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()}))}}}),e.utils.inheritOptions(B,r),e.utils.initOptions(B),B},e.models.multiBarHorizontal=function(){"use strict";var t,n,r,i,a,o,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=null,p=d3.scale.ordinal(),h=d3.scale.linear(),g=function(t){return t.x},v=function(t){return t.y},m=function(t){return t.yErr},y=[0],x=e.utils.defaultColor(),b=null,k=!1,w=!1,M=60,A=.1,C=.75,S=d3.format(",.2f"),D=250,E=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),F=e.utils.renderWatch(E,D);function W(d){return F.reset(),d.each((function(d){var D=u-l.left-l.right,W=c-l.top-l.bottom;f=d3.select(this),e.utils.initSVG(f),k&&(d=d3.layout.stack().offset("zero").values((function(t){return t.values})).y(v)(d)),d.forEach((function(t,e){t.values.forEach((function(n){n.series=e,n.key=t.key}))})),k&&d[0].values.map((function(t,e){var n=0,r=0;d.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=n&&r?[]:d.map((function(t){return t.values.map((function(t,e){return{x:g(t,e),y:v(t,e),y0:t.y0,y1:t.y1}}))}));p.domain(n||d3.merge(O).map((function(t){return t.x}))).rangeBands(i||[0,W],A),h.domain(r||d3.extent(d3.merge(O).map((function(t){return k?t.y>0?t.y1+t.y:t.y1:t.y})).concat(y))),w&&!k?h.range(a||[h.domain()[0]<0?M:0,D-(h.domain()[1]>0?M:0)]):h.range(a||[0,D]),o=o||p,s=s||d3.scale.linear().domain(h.domain()).range([h(0),h(0)]);var N=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([d]),L=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),_=(L.append("defs"),L.append("g"));N.select("g"),_.append("g").attr("class","nv-groups"),N.attr("transform","translate("+l.left+","+l.top+")");var B=N.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t,e){return e}));B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),B.exit().watchTransition(F,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),B.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)})),B.watchTransition(F,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",C);var T=B.selectAll("g.nv-bar").data((function(t){return t.values}));T.exit().remove();var P=T.enter().append("g").attr("transform",(function(t,e,n){return"translate("+s(k?t.y0:0)+","+(k?0:n*p.rangeBand()/d.length+p(g(t,e)))+")"}));P.append("rect").attr("width",0).attr("height",p.rangeBand()/(k?1:d.length)),T.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),E.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),E.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){E.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e){E.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){E.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e){E.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()})),m(d[0],0)&&(P.append("polyline"),T.select("polyline").attr("fill","none").attr("points",(function(t,e){var n=m(t,e),r=.8*p.rangeBand()/(2*(k?1:d.length));return[[(n=(n=n.length?n:[-Math.abs(n),Math.abs(n)]).map((function(n){return h(n+(v(t,e)<0?0:v(t,e)))-h(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, "+p.rangeBand()/(2*(k?1:d.length))+")"}))),P.append("text"),w&&!k?(T.select("text").attr("text-anchor",(function(t,e){return v(t,e)<0?"end":"start"})).attr("y",p.rangeBand()/(2*d.length)).attr("dy",".32em").text((function(t,e){var n=S(v(t,e)),r=m(t,e);return void 0===r?n:r.length?n+"+"+S(Math.abs(r[1]))+"-"+S(Math.abs(r[0])):n+"±"+S(Math.abs(r))})),T.watchTransition(F,"multibarhorizontal: bars").select("text").attr("x",(function(t,e){return v(t,e)<0?-4:h(v(t,e))-h(0)+4}))):T.selectAll("text").text(""),T.selectAll("text.nv-bar-label").text(""),T.attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})),b&&(t||(t=d.map((function(){return!0}))),T.style("fill",(function(e,n,r){return d3.rgb(b(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})).style("stroke",(function(e,n,r){return d3.rgb(b(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()}))),k?T.watchTransition(F,"multibarhorizontal: bars").attr("transform",(function(t,e){return"translate("+h(t.y1)+","+p(g(t,e))+")"})).select("rect").attr("width",(function(t,e){return Math.abs(h(v(t,e)+t.y0)-h(t.y0))||0})).attr("height",p.rangeBand()):T.watchTransition(F,"multibarhorizontal: bars").attr("transform",(function(t,e){return"translate("+(v(t,e)<0?h(v(t,e)):h(0))+","+(t.series*p.rangeBand()/d.length+p(g(t,e)))+")"})).select("rect").attr("height",p.rangeBand()/d.length).attr("width",(function(t,e){return Math.max(Math.abs(h(v(t,e))-h(0)),1)||0})),o=p.copy(),s=h.copy()})),F.renderEnd("multibarHorizontal immediate"),W}return W.dispatch=E,W.options=e.utils.optionsFunc.bind(W),W._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 g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},yErr:{get:function(){return m},set:function(t){m=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 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 a},set:function(t){a=t}},forceY:{get:function(){return y},set:function(t){y=t}},stacked:{get:function(){return k},set:function(t){k=t}},showValues:{get:function(){return w},set:function(t){w=t}},disabled:{get:function(){return t},set:function(e){t=e}},id:{get:function(){return d},set:function(t){d=t}},valueFormat:{get:function(){return S},set:function(t){S=t}},valuePadding:{get:function(){return M},set:function(t){M=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 D},set:function(t){D=t,F.reset(D)}},color:{get:function(){return x},set:function(t){x=e.utils.getColor(t)}},barColor:{get:function(){return b},set:function(t){b=t?e.utils.getColor(t):null}}}),e.utils.initOptions(W),W},e.models.multiBarHorizontalChart=function(){"use strict";var t,n,r=e.models.multiBarHorizontal(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend().height(30),s=e.models.legend().height(30),l=e.models.tooltip(),u={top:30,right:20,bottom:50,left:60},c=null,d=null,f=null,p=e.utils.defaultColor(),h=!0,g="top",v={},m=!0,y="top",x=!0,b=!0,k=!1,w=e.utils.state(),M=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=function(){return h?180:0},D=250;w.stacked=!1,r.stacked(k),i.orient("left").tickPadding(5).showMaxMin(!1).tickFormat((function(t){return t})),a.orient("bottom").tickFormat(d3.format(",.1f")),l.duration(0).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.updateState(!1);var E=e.utils.renderWatch(C,D);function F(l){return E.reset(),E.models(r),x&&E.models(i),b&&E.models(a),l.each((function(l){var A=d3.select(this);e.utils.initSVG(A);var E,W=e.utils.availableWidth(d,A,u),O=e.utils.availableHeight(f,A,u);if(F.update=function(){A.transition().duration(D).call(F)},F.container=this,k=r.stacked(),w.setter(function(t){return function(e){void 0!==e.stacked&&(k=e.stacked),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(l),F.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),stacked:k}}}(l)).update(),w.disabled=l.map((function(t){return!!t.disabled})),!M)for(E in M={},w)w[E]instanceof Array?M[E]=w[E].slice(0):M[E]=w[E];if(!(l&&l.length&&l.filter((function(t){return t.values.length})).length))return e.utils.noData(F,A),F;A.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale().clamp(!0);var N=A.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([l]),L=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),_=N.select("g");if(L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),L.append("g").attr("class","nv-barsWrap"),L.append("g").attr("class","nv-legendWrap"),L.append("g").attr("class","nv-controlsWrap"),m?(o.width(W-S()),_.select(".nv-legendWrap").datum(l).call(o),"bottom"===y?(u.bottom=i.height()+o.height(),O=e.utils.availableHeight(f,A,u),_.select(".nv-legendWrap").attr("transform","translate("+S()+","+(O+i.height())+")")):"top"===y&&(c||o.height()===u.top||(u.top=o.height(),O=e.utils.availableHeight(f,A,u)),_.select(".nv-legendWrap").attr("transform","translate("+S()+","+-u.top+")"))):_.select(".nv-legendWrap").selectAll("*").remove(),h){var B=[{key:v.grouped||"Grouped",disabled:r.stacked()},{key:v.stacked||"Stacked",disabled:!r.stacked()}];s.width(S()).color(["#444","#444","#444"]),"bottom"===g?(u.bottom=i.height()+o.height(),O=e.utils.availableHeight(f,A,u),_.select(".nv-controlsWrap").datum(B).attr("transform","translate(0,"+(O+i.height())+")").call(s)):"top"===g&&_.select(".nv-controlsWrap").datum(B).attr("transform","translate(0,"+-u.top+")").call(s)}else _.select(".nv-controlsWrap").selectAll("*").remove();N.attr("transform","translate("+u.left+","+u.top+")"),r.disabled(l.map((function(t){return t.disabled}))).width(W).height(O).color(l.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!l[e].disabled}))),_.select(".nv-barsWrap").datum(l.filter((function(t){return!t.disabled}))).transition().call(r),x&&(i.scale(t)._ticks(e.utils.calcTicksY(O/24,l)).tickSize(-W,0),_.select(".nv-x.nv-axis").call(i),_.select(".nv-x.nv-axis").selectAll("g").selectAll("line, text")),b&&(a.scale(n)._ticks(e.utils.calcTicksX(W/100,l)).tickSize(-O,0),_.select(".nv-y.nv-axis").attr("transform","translate(0,"+O+")"),_.select(".nv-y.nv-axis").call(a)),_.select(".nv-zeroLine line").attr("x1",n(0)).attr("x2",n(0)).attr("y1",0).attr("y2",-O),o.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];C.stateChange(w),F.update()})),s.dispatch.on("legendClick",(function(t,e){if(t.disabled){switch(B=B.map((function(t){return t.disabled=!0,t})),t.disabled=!1,t.key){case"Grouped":case v.grouped:r.stacked(!1);break;case"Stacked":case v.stacked:r.stacked(!0)}w.stacked=r.stacked(),C.stateChange(w),k=r.stacked(),F.update()}})),C.on("changeState",(function(t){void 0!==t.disabled&&(l.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),w.stacked=t.stacked,k=t.stacked),F.update()}))})),E.renderEnd("multibar horizontal chart immediate"),F}return r.dispatch.on("elementMouseover.tooltip",(function(t){t.value=F.x()(t.data),t.series={key:t.data.key,value:F.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()})),F.dispatch=C,F.multibar=r,F.legend=o,F.controls=s,F.xAxis=i,F.yAxis=a,F.state=w,F.tooltip=l,F.options=e.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return d},set:function(t){d=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},controlsPosition:{get:function(){return g},set:function(t){g=t}},showControls:{get:function(){return h},set:function(t){h=t}},controlLabels:{get:function(){return v},set:function(t){v=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 M},set:function(t){M=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 D},set:function(t){D=t,E.reset(D),r.duration(D),i.duration(D),a.duration(D)}},color:{get:function(){return p},set:function(t){p=e.utils.getColor(t),o.color(p)}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),o.color((function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()}))}}}),e.utils.inheritOptions(F,r),e.utils.initOptions(F),F},e.models.multiChart=function(){"use strict";var t,n,r={top:30,right:20,bottom:50,left:60},i=null,a=e.utils.defaultColor(),o=null,s=null,l=!0,u=null,c=function(t){return t.x},d=function(t){return t.y},f="linear",p=!0,h=e.interactiveGuideline(),g=!1,v=" (right axis)",m=250,y=d3.scale.linear(),x=d3.scale.linear(),b=d3.scale.linear(),k=e.models.line().yScale(x).duration(m),w=e.models.line().yScale(b).duration(m),M=e.models.scatter().yScale(x).duration(m),A=e.models.scatter().yScale(b).duration(m),C=e.models.multiBar().stacked(!1).yScale(x).duration(m),S=e.models.multiBar().stacked(!1).yScale(b).duration(m),D=e.models.stackedArea().yScale(x).duration(m),E=e.models.stackedArea().yScale(b).duration(m),F=e.models.axis().scale(y).orient("bottom").tickPadding(5).duration(m),W=e.models.axis().scale(x).orient("left").duration(m),O=e.models.axis().scale(b).orient("right").duration(m),N=e.models.legend().height(30),L=e.models.tooltip(),_=d3.dispatch(),B=[k,w,M,A,C,S,D,E];function T(u){return u.each((function(u){var p=d3.select(this);e.utils.initSVG(p),T.update=function(){p.transition().call(T)},T.container=this;var m=e.utils.availableWidth(o,p,r),_=e.utils.availableHeight(s,p,r),P=u.filter((function(t){return"line"==t.type&&1==t.yAxis})),I=u.filter((function(t){return"line"==t.type&&2==t.yAxis})),H=u.filter((function(t){return"scatter"==t.type&&1==t.yAxis})),V=u.filter((function(t){return"scatter"==t.type&&2==t.yAxis})),z=u.filter((function(t){return"bar"==t.type&&1==t.yAxis})),R=u.filter((function(t){return"bar"==t.type&&2==t.yAxis})),Y=u.filter((function(t){return"area"==t.type&&1==t.yAxis})),j=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 e.utils.noData(T,p),T;p.selectAll(".nv-noData").remove();var G=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:d(t)}}))})),X=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:d(t)}}))}));y.domain(d3.extent(d3.merge(G.concat(X)),(function(t){return t.x}))).range([0,m]);var Z=p.selectAll("g.wrap.multiChart").data([u]),U=Z.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");U.append("g").attr("class","nv-x nv-axis"),U.append("g").attr("class","nv-y1 nv-axis"),U.append("g").attr("class","nv-y2 nv-axis"),U.append("g").attr("class","stack1Wrap"),U.append("g").attr("class","stack2Wrap"),U.append("g").attr("class","bars1Wrap"),U.append("g").attr("class","bars2Wrap"),U.append("g").attr("class","scatters1Wrap"),U.append("g").attr("class","scatters2Wrap"),U.append("g").attr("class","lines1Wrap"),U.append("g").attr("class","lines2Wrap"),U.append("g").attr("class","legendWrap"),U.append("g").attr("class","nv-interactive");var q=Z.select("g"),K=u.map((function(t,e){return u[e].color||a(t,e)}));if(l){var $=N.align()?m/2:m,Q=N.align()?$:0;N.width($),N.color(K),q.select(".legendWrap").datum(u.map((function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=t.originalKey+(1==t.yAxis?"":v),t}))).call(N),i||N.height()===r.top||(r.top=N.height(),_=e.utils.availableHeight(s,p,r)),q.select(".legendWrap").attr("transform","translate("+Q+","+-r.top+")")}else q.select(".legendWrap").selectAll("*").remove();k.width(m).height(_).interpolate(f).color(K.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"line"==u[e].type}))),w.width(m).height(_).interpolate(f).color(K.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"line"==u[e].type}))),M.width(m).height(_).color(K.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"scatter"==u[e].type}))),A.width(m).height(_).color(K.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"scatter"==u[e].type}))),C.width(m).height(_).color(K.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"bar"==u[e].type}))),S.width(m).height(_).color(K.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"bar"==u[e].type}))),D.width(m).height(_).interpolate(f).color(K.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"area"==u[e].type}))),E.width(m).height(_).interpolate(f).color(K.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"area"==u[e].type}))),q.attr("transform","translate("+r.left+","+r.top+")");var J=q.select(".lines1Wrap").datum(P.filter((function(t){return!t.disabled}))),tt=q.select(".scatters1Wrap").datum(H.filter((function(t){return!t.disabled}))),et=q.select(".bars1Wrap").datum(z.filter((function(t){return!t.disabled}))),nt=q.select(".stack1Wrap").datum(Y.filter((function(t){return!t.disabled}))),rt=q.select(".lines2Wrap").datum(I.filter((function(t){return!t.disabled}))),it=q.select(".scatters2Wrap").datum(V.filter((function(t){return!t.disabled}))),at=q.select(".bars2Wrap").datum(R.filter((function(t){return!t.disabled}))),ot=q.select(".stack2Wrap").datum(j.filter((function(t){return!t.disabled}))),st=[];C.stacked()&&z.length&&(st=z.filter((function(t){return!t.disabled})).map((function(t){return t.values}))).length>0&&(st=st.reduce((function(t,e){return t.map((function(t,n){return{x:t.x,y:t.y+e[n].y}}))}))),z.length&&st.push({x:0,y:0});var lt=[];function ut(t){var e=2===t.series.yAxis?O:W;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},L.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function ct(t){var e=2===t.series.yAxis?O:W;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},L.duration(100).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function dt(t){var e=2===t.series.yAxis?O:W;t.point.x=D.x()(t.point),t.point.y=D.y()(t.point),L.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function ft(t){var e=2===t.series.yAxis?O:W;t.value=C.x()(t.data),t.series={value:C.y()(t.data),color:t.color,key:t.data.key},L.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function pt(){for(var t=0,e=B.length;t<e;t++){var n=B[t];try{n.clearHighlights()}catch(t){}}}S.stacked()&&R.length&&(lt=R.filter((function(t){return!t.disabled})).map((function(t){return t.values}))).length>0&&(lt=lt.reduce((function(t,e){return t.map((function(t,n){return{x:t.x,y:t.y+e[n].y}}))}))),R.length&<.push({x:0,y:0}),x.domain(t||d3.extent(d3.merge(G).concat(st),(function(t){return t.y}))).range([0,_]),b.domain(n||d3.extent(d3.merge(X).concat(lt),(function(t){return t.y}))).range([0,_]),k.yDomain(x.domain()),M.yDomain(x.domain()),C.yDomain(x.domain()),D.yDomain(x.domain()),w.yDomain(b.domain()),A.yDomain(b.domain()),S.yDomain(b.domain()),E.yDomain(b.domain()),Y.length&&d3.transition(nt).call(D),j.length&&d3.transition(ot).call(E),z.length&&d3.transition(et).call(C),R.length&&d3.transition(at).call(S),P.length&&d3.transition(J).call(k),I.length&&d3.transition(rt).call(w),H.length&&d3.transition(tt).call(M),V.length&&d3.transition(it).call(A),F._ticks(e.utils.calcTicksX(m/100,u)).tickSize(-_,0),q.select(".nv-x.nv-axis").attr("transform","translate(0,"+_+")"),d3.transition(q.select(".nv-x.nv-axis")).call(F),W._ticks(e.utils.calcTicksY(_/36,u)).tickSize(-m,0),d3.transition(q.select(".nv-y1.nv-axis")).call(W),O._ticks(e.utils.calcTicksY(_/36,u)).tickSize(-m,0),d3.transition(q.select(".nv-y2.nv-axis")).call(O),q.select(".nv-y1.nv-axis").classed("nv-disabled",!G.length).attr("transform","translate("+y.range()[0]+",0)"),q.select(".nv-y2.nv-axis").classed("nv-disabled",!X.length).attr("transform","translate("+y.range()[1]+",0)"),N.dispatch.on("stateChange",(function(t){T.update()})),g&&(h.width(m).height(_).margin({left:r.left,top:r.top}).svgContainer(p).xScale(y),Z.select(".nv-interactive").call(h)),g?(h.dispatch.on("elementMousemove",(function(t){pt();var n,r,i,o=[];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 T.x()(t,e)>=u[0]&&T.x()(t,e)<=u[1]})),d=c[r=e.interactiveBisect(c,t.pointXValue,T.x())],f=T.y()(d,r);null!==f&&function(t,e,n){for(var r=0,i=B.length;r<i;r++){var a=B[r];try{a.highlightPoint(t,e,n)}catch(t){}}}(l,r,!0),void 0!==d&&(void 0===n&&(n=d),void 0===i&&(i=y(T.x()(d,r))),o.push({key:s.key,value:f,color:a(s,s.seriesIndex),data:d,yAxis:2==s.yAxis?O:W}))})),h.tooltip.headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter(h.tooltip.valueFormatter()||function(t,e){var n=o[e].yAxis;return null==t?"N/A":n.tickFormat()(t)}).data({value:T.x()(n,r),index:r,series:o})(),h.renderGuideLine(i)})),h.dispatch.on("elementMouseout",(function(t){pt()}))):(k.dispatch.on("elementMouseover.tooltip",ut),w.dispatch.on("elementMouseover.tooltip",ut),k.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),w.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),M.dispatch.on("elementMouseover.tooltip",ct),A.dispatch.on("elementMouseover.tooltip",ct),M.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),A.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),D.dispatch.on("elementMouseover.tooltip",dt),E.dispatch.on("elementMouseover.tooltip",dt),D.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),E.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),C.dispatch.on("elementMouseover.tooltip",ft),S.dispatch.on("elementMouseover.tooltip",ft),C.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),S.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),C.dispatch.on("elementMousemove.tooltip",(function(t){L()})),S.dispatch.on("elementMousemove.tooltip",(function(t){L()})))})),T}return T.dispatch=_,T.legend=N,T.lines1=k,T.lines2=w,T.scatters1=M,T.scatters2=A,T.bars1=C,T.bars2=S,T.stack1=D,T.stack2=E,T.xAxis=F,T.yAxis1=W,T.yAxis2=O,T.tooltip=L,T.interactiveLayer=h,T.options=e.utils.optionsFunc.bind(T),T._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},yDomain1:{get:function(){return t},set:function(e){t=e}},yDomain2:{get:function(){return n},set:function(t){n=t}},noData:{get:function(){return u},set:function(t){u=t}},interpolate:{get:function(){return f},set:function(t){f=t}},legendRightAxisHint:{get:function(){return v},set:function(t){v=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 a},set:function(t){a=e.utils.getColor(t)}},x:{get:function(){return c},set:function(t){c=t,k.x(t),w.x(t),M.x(t),A.x(t),C.x(t),S.x(t),D.x(t),E.x(t)}},y:{get:function(){return d},set:function(t){d=t,k.y(t),w.y(t),M.y(t),A.y(t),D.y(t),E.y(t),C.y(t),S.y(t)}},useVoronoi:{get:function(){return p},set:function(t){p=t,k.useVoronoi(t),w.useVoronoi(t),D.useVoronoi(t),E.useVoronoi(t)}},useInteractiveGuideline:{get:function(){return g},set:function(t){(g=t)&&(k.interactive(!1),k.useVoronoi(!1),w.interactive(!1),w.useVoronoi(!1),D.interactive(!1),D.useVoronoi(!1),E.interactive(!1),E.useVoronoi(!1),M.interactive(!1),A.interactive(!1))}},duration:{get:function(){return m},set:function(t){m=t,[k,w,D,E,M,A,F,W,O].forEach((function(t){t.duration(m)}))}}}),e.utils.initOptions(T),T},e.models.ohlcBar=function(){"use strict";var t,n,r,i,a={top:0,right:0,bottom:0,left:0},o=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=function(t){return t.open},g=function(t){return t.close},v=function(t){return t.high},m=function(t){return t.low},y=[],x=[],b=!1,k=!0,w=e.utils.defaultColor(),M=!1,A=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(M){return M.each((function(M){u=d3.select(this);var C=e.utils.availableWidth(o,u,a),S=e.utils.availableHeight(s,u,a);e.utils.initSVG(u);var D=C/M[0].values.length*.9;c.domain(t||d3.extent(M[0].values.map(f).concat(y))),b?c.range(r||[.5*C/M[0].values.length,C*(M[0].values.length-.5)/M[0].values.length]):c.range(r||[5+D/2,C-D/2-5]),d.domain(n||[d3.min(M[0].values.map(m).concat(x)),d3.max(M[0].values.map(v).concat(x))]).range(i||[S,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])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var E=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([M[0].values]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),W=F.append("defs"),O=F.append("g"),N=E.select("g");O.append("g").attr("class","nv-ticks"),E.attr("transform","translate("+a.left+","+a.top+")"),u.on("click",(function(t,e){A.chartClick({data:t,index:e,pos:d3.event,id:l})})),W.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),E.select("#nv-chart-clip-path-"+l+" rect").attr("width",C).attr("height",S),N.attr("clip-path",k?"url(#nv-chart-clip-path-"+l+")":"");var L=E.select(".nv-ticks").selectAll(".nv-tick").data((function(t){return t}));L.exit().remove(),L.enter().append("path").attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})).attr("d",(function(t,e){return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-D/2+",0l"+D/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+D/2+",0l"+-D/2+",0z"})).attr("transform",(function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"})).attr("fill",(function(t,e){return w[0]})).attr("stroke",(function(t,e){return w[0]})).attr("x",0).attr("y",(function(t,e){return d(Math.max(0,p(t,e)))})).attr("height",(function(t,e){return Math.abs(d(p(t,e))-d(0))})),L.attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})),d3.transition(L).attr("transform",(function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"})).attr("d",(function(t,e){var n=C/M[0].values.length*.9;return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-n/2+",0l"+n/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(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=e.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return o},set:function(t){o=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 d},set:function(t){d=t}},xDomain:{get:function(){return t},set:function(e){t=e}},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 k},set:function(t){k=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return M},set:function(t){M=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return a},set:function(t){a.top=null!=t.top?t.top:a.top,a.right=null!=t.right?t.right:a.right,a.bottom=null!=t.bottom?t.bottom:a.bottom,a.left=null!=t.left?t.left:a.left}},color:{get:function(){return w},set:function(t){w=e.utils.getColor(t)}}}),e.utils.initOptions(C),C},e.models.parallelCoordinates=function(){"use strict";var t,n,r,i={top:30,right:0,bottom:10,left:0},a=null,o=null,s=null,l=null,u=d3.scale.ordinal(),c={},d="undefined values",f=[],p=[],h=[],g=!0,v=e.utils.defaultColor(),m=[],y=[],x=[],b=[],k=1,w=d3.svg.line(),M=d3.svg.axis(),A=d3.dispatch("brushstart","brush","brushEnd","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),C=e.utils.renderWatch(A);function S(D){return C.reset(),D.each((function(C){var S=d3.select(this);if(s=e.utils.availableWidth(a,S,i),l=e.utils.availableHeight(o,S,i),e.utils.initSVG(S),void 0===C[0].values){var D=[];C.forEach((function(t){var e={};Object.keys(t).forEach((function(n){"name"!==n&&(e[n]=t[n])})),D.push({key:t.name,values:e})})),C=D}var E=C.map((function(t){return t.values}));0===y.length&&(y=C),h=f.sort((function(t,e){return t.currentPosition-e.currentPosition})).map((function(t){return t.key})),p=f.filter((function(t){return!t.disabled})),u.rangePoints([0,s],1).domain(p.map((function(t){return t.key})));var F={},W=!1,O=[];h.forEach((function(t){var e=d3.extent(E,(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 a=m.filter((function(e){return e.dimension==t}));0!==a.length&&(i?(n=c[t].domain()[0],r=c[t].domain()[1]):!a[0].hasOnlyNaN&&g?(n=n>a[0].extent[0]?a[0].extent[0]:n,r=r<a[0].extent[1]?a[0].extent[1]:r):a[0].hasNaN&&(r=r<a[0].extent[1]?a[0].extent[1]:r,F[t]=c[t].domain()[1],W=!0)),c[t]=d3.scale.linear().domain([n,r]).range([.9*(l-12),0]),b=[],c[t].brush=d3.svg.brush().y(c[t]).on("brushstart",X).on("brush",Z).on("brushend",U)}));var N=S.selectAll("g.nv-wrap.nv-parallelCoordinates").data([C]),L=N.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates").append("g"),_=N.select("g");L.append("g").attr("class","nv-parallelCoordinates background"),L.append("g").attr("class","nv-parallelCoordinates foreground"),L.append("g").attr("class","nv-parallelCoordinates missingValuesline"),N.attr("transform","translate("+i.left+","+i.top+")"),w.interpolate("cardinal").tension(k),M.orient("left");var B,T,P=d3.behavior.drag().on("dragstart",(function(t){x[t.key]=this.parentNode.__origin__=u(t.key),n.attr("visibility","hidden")})).on("drag",(function(e){x[e.key]=Math.min(s,Math.max(0,this.parentNode.__origin__+=d3.event.x)),t.attr("d",j),p.sort((function(t,e){return K(t.key)-K(e.key)})),p.forEach((function(t,e){return t.currentPosition=e})),u.domain(p.map((function(t){return t.key}))),r.attr("transform",(function(t){return"translate("+K(t.key)+")"}))})).on("dragend",(function(e,r){delete this.parentNode.__origin__,delete x[e.key],d3.select(this.parentNode).attr("transform","translate("+u(e.key)+")"),t.attr("d",j),n.attr("d",j).attr("visibility",null),A.dimensionsOrder(p)})),I=u.range()[1]-u.range()[0];if(I=isNaN(I)?u.range()[0]:I,!isNaN(I)){var H=[0+I/2,l-12,s-I/2,l-12];(B=N.select(".missingValuesline").selectAll("line").data([H])).enter().append("line"),B.exit().remove(),B.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]})),(T=N.select(".missingValuesline").selectAll("text").data([d])).append("text").data([d]),T.enter().append("text"),T.exit().remove(),T.attr("y",l).attr("x",s-92-I/2).text((function(t){return t}))}(n=N.select(".background").selectAll("path").data(C)).enter().append("path"),n.exit().remove(),n.attr("d",j),(t=N.select(".foreground").selectAll("path").data(C)).enter().append("path"),t.exit().remove(),t.attr("d",j).style("stroke-width",(function(t,e){return isNaN(t.strokeWidth)&&(t.strokeWidth=1),t.strokeWidth})).attr("stroke",(function(t,e){return t.color||v(t,e)})),t.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0).style("stroke-width",t.strokeWidth+2+"px").style("stroke-opacity",1),A.elementMouseover({label:t.name,color:t.color||v(t,e),values:t.values,dimensions:p})})),t.on("mouseout",(function(t,e){d3.select(this).classed("hover",!1).style("stroke-width",t.strokeWidth+"px").style("stroke-opacity",.7),A.elementMouseout({label:t.name,index:e})})),t.on("mousemove",(function(t,e){A.elementMousemove()})),t.on("click",(function(t){A.elementClick({id:t.id})}));var V=(r=_.selectAll(".dimension").data(p)).enter().append("g").attr("class","nv-parallelCoordinates dimension");r.attr("transform",(function(t){return"translate("+u(t.key)+",0)"})),V.append("g").attr("class","nv-axis"),V.append("text").attr("class","nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").on("mouseover",(function(t,e){A.elementMouseover({label:t.tooltip||t.key,color:t.color})})).on("mouseout",(function(t,e){A.elementMouseout({label:t.tooltip})})).on("mousemove",(function(t,e){A.elementMousemove()})).call(P),V.append("g").attr("class","nv-brushBackground"),r.exit().remove(),r.select(".nv-label").text((function(t){return t.key})),G(g);var z=h.filter((function(t){return!c[t].brush.empty()})),R=z.map((function(t){return c[t].brush.extent()})),Y=y.slice(0);function j(t){return w(p.map((function(e){if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key]))||W){var n=c[e.key].domain(),r=c[e.key].range(),i=n[0]-(n[1]-n[0])/9;if(b.indexOf(e.key)<0){var a=d3.scale.linear().domain([i,n[1]]).range([l-12,r[1]]);c[e.key].brush.y(a),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!==B&&(b.length>0||W?(B.style("display","inline"),T.style("display","inline")):(B.style("display","none"),T.style("display","none"))),[u(e.key),c[e.key](t.values[e.key])]})))}function G(t){m.forEach((function(e){var n=c[e.dimension].brush.y().domain();e.hasOnlyNaN&&(e.extent[1]=(c[e.dimension].domain()[1]-n[0])*(e.extent[1]-e.extent[0])/(F[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),q()}function X(){!1===g&&(g=!0,G(!0))}function Z(){z=h.filter((function(t){return!c[t].brush.empty()})),R=z.map((function(t){return c[t].brush.extent()})),m=[],z.forEach((function(t,e){m[e]={dimension:t,extent:R[e],hasNaN:!1,hasOnlyNaN:!1}})),y=[],t.style("display",(function(t){var e=z.every((function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||R[n][0]!=c[e].brush.y().domain()[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"})),q(),A.brush({filters:m,active:y})}function U(){var t=z.length>0;m.forEach((function(t){t.extent[0]===c[t.dimension].brush.y().domain()[0]&&b.indexOf(t.dimension)>=0&&(t.hasNaN=!0),t.extent[1]<c[t.dimension].domain()[0]&&(t.hasOnlyNaN=!0)})),A.brushEnd(y,t)}function q(){r.select(".nv-axis").each((function(t,e){var n=m.filter((function(e){return e.dimension==t.key}));O[t.key]=c[t.key].domain(),0!=n.length&&g&&(O[t.key]=[],n[0].extent[1]>c[t.key].domain()[0]&&(O[t.key]=[n[0].extent[1]]),n[0].extent[0]>=c[t.key].domain()[0]&&O[t.key].push(n[0].extent[0])),d3.select(this).call(M.scale(c[t.key]).tickFormat(t.format).tickValues(O[t.key]))}))}function K(t){var e=x[t];return null==e?u(t):e}y=[],t.style("display",(function(t){var e=z.every((function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||R[n][0]!=c[e].brush.y().domain()[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"})),(m.length>0||!e.utils.arrayEquals(y,Y))&&A.activeChanged(y)})),S}return S.dispatch=A,S.options=e.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return o},set:function(t){o=t}},dimensionData:{get:function(){return f},set:function(t){f=t}},displayBrush:{get:function(){return g},set:function(t){g=t}},filters:{get:function(){return m},set:function(t){m=t}},active:{get:function(){return y},set:function(t){y=t}},lineTension:{get:function(){return k},set:function(t){k=t}},undefinedValuesLabel:{get:function(){return d},set:function(t){d=t}},dimensions:{get:function(){return f.map((function(t){return t.key}))},set:function(t){e.deprecated("dimensions","use dimensionData instead"),0===f.length?t.forEach((function(t){f.push({key:t})})):t.forEach((function(t,e){f[e].key=t}))}},dimensionNames:{get:function(){return f.map((function(t){return t.key}))},set:function(t){e.deprecated("dimensionNames","use dimensionData instead"),h=[],0===f.length?t.forEach((function(t){f.push({key:t})})):t.forEach((function(t,e){f[e].key=t}))}},dimensionFormats:{get:function(){return f.map((function(t){return t.format}))},set:function(t){e.deprecated("dimensionFormats","use dimensionData instead"),0===f.length?t.forEach((function(t){f.push({format:t})})):t.forEach((function(t,e){f[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 v},set:function(t){v=e.utils.getColor(t)}}}),e.utils.initOptions(S),S},e.models.parallelCoordinatesChart=function(){"use strict";var t=e.models.parallelCoordinates(),n=e.models.legend(),r=e.models.tooltip(),i=(e.models.tooltip(),{top:0,right:0,bottom:0,left:0}),a=null,o=null,s=null,l=!0,u=e.utils.defaultColor(),c=e.utils.state(),d=[],f=!0,p=null,h=null,g="undefined",v=d3.dispatch("dimensionsOrder","brushEnd","stateChange","changeState","renderEnd"),m=e.utils.renderWatch(v);function y(r){return m.reset(),m.models(t),r.each((function(r){var u=d3.select(this);e.utils.initSVG(u);var h,g=e.utils.availableWidth(o,u,i),m=e.utils.availableHeight(s,u,i);if(y.update=function(){u.call(y)},y.container=this,c.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(d),y.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(d)).update(),c.disabled=d.map((function(t){return!!t.disabled})),(d=d.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})),!p)for(h in p={},c)c[h]instanceof Array?p[h]=c[h].slice(0):p[h]=c[h];if(!r||!r.length)return e.utils.noData(y,u),y;u.selectAll(".nv-noData").remove();var x=u.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([r]),b=x.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart").append("g"),k=x.select("g");b.append("g").attr("class","nv-parallelCoordinatesWrap"),b.append("g").attr("class","nv-legendWrap"),k.select("rect").attr("width",g).attr("height",m>0?m:0),l?(n.width(g).color((function(t){return"rgb(188,190,192)"})),k.select(".nv-legendWrap").datum(d.sort((function(t,e){return t.originalPosition-e.originalPosition}))).call(n),a||n.height()===i.top||(i.top=n.height(),m=e.utils.availableHeight(s,u,i)),x.select(".nv-legendWrap").attr("transform","translate( 0 ,"+-i.top+")")):k.select(".nv-legendWrap").selectAll("*").remove(),x.attr("transform","translate("+i.left+","+i.top+")"),t.width(g).height(m).dimensionData(d).displayBrush(f),k.select(".nv-parallelCoordinatesWrap ").datum(r).transition().call(t),t.dispatch.on("brushEnd",(function(t,e){e?(f=!0,v.brushEnd(t)):f=!1})),n.dispatch.on("stateChange",(function(t){for(var e in t)c[e]=t[e];v.stateChange(c),y.update()})),t.dispatch.on("dimensionsOrder",(function(t){d.sort((function(t,e){return t.currentPosition-e.currentPosition}));var e=!1;d.forEach((function(t,n){t.currentPosition=n,t.currentPosition!==t.originalPosition&&(e=!0)})),v.dimensionsOrder(d,e)})),v.on("changeState",(function(t){void 0!==t.disabled&&(d.forEach((function(e,n){e.disabled=t.disabled[n]})),c.disabled=t.disabled),y.update()}))})),m.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>"})),t.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]))?g: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)})),t.dispatch.on("elementMouseout.tooltip",(function(t){r.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(){r()})),y.dispatch=v,y.parallelCoordinates=t,y.legend=n,y.tooltip=r,y.options=e.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return o},set:function(t){o=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 p},set:function(t){p=t}},dimensionData:{get:function(){return d},set:function(t){d=t}},displayBrush:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return h},set:function(t){h=t}},nanValue:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,a=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=e.utils.getColor(r),n.color(u),t.color(u)}}}),e.utils.inheritOptions(y,t),e.utils.initOptions(y),y},e.models.pie=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},n=500,r=500,i=function(t){return t.x},a=function(t){return t.y},o=Math.floor(1e4*Math.random()),s=null,l=e.utils.defaultColor(),u=d3.format(",.2f"),c=!0,d=!1,f="key",p=.02,h=!1,g=!1,v=!1,m=!0,y=0,x=!1,b=!1,k=!1,w=!1,M=0,A=.5,C=250,S=[],D=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=[],F=[],W=e.utils.renderWatch(D);function O(N){return W.reset(),N.each((function(O){var N=n-t.left-t.right,L=r-t.top-t.bottom,_=Math.min(N,L)/2,B=[],T=[];if(s=d3.select(this),0===S.length)for(var P=_-_/10,I=A*_,H=0;H<O[0].length;H++)B.push(P),T.push(I);else m?(B=S.map((function(t){return(t.outer-t.outer/10)*_})),T=S.map((function(t){return(t.inner-t.inner/10)*_})),A=d3.min(S.map((function(t){return t.inner-t.inner/10})))):(B=S.map((function(t){return t.outer*_})),T=S.map((function(t){return t.inner*_})),A=d3.min(S.map((function(t){return t.inner}))));e.utils.initSVG(s);var V=s.selectAll(".nv-wrap.nv-pie").data(O),z=V.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+o).append("g"),R=V.select("g"),Y=z.append("g").attr("class","nv-pie");for(z.append("g").attr("class","nv-pieLabels"),V.attr("transform","translate("+t.left+","+t.top+")"),R.select(".nv-pie").attr("transform","translate("+N/2+","+L/2+")"),R.select(".nv-pieLabels").attr("transform","translate("+N/2+","+L/2+")"),s.on("click",(function(t,e){D.chartClick({data:t,index:e,pos:d3.event,id:o})})),E=[],F=[],H=0;H<O[0].length;H++){var j=d3.svg.arc().outerRadius(B[H]),G=d3.svg.arc().outerRadius(B[H]+5);!1!==b&&(j.startAngle(b),G.startAngle(b)),!1!==w&&(j.endAngle(w),G.endAngle(w)),g&&(j.innerRadius(T[H]),G.innerRadius(T[H])),j.cornerRadius&&M&&(j.cornerRadius(M),G.cornerRadius(M)),E.push(j),F.push(G)}var X=d3.layout.pie().sort(null).value((function(t){return t.disabled?0:a(t)}));X.padAngle&&k&&X.padAngle(k),g&&v&&(Y.append("text").attr("class","nv-pie-title"),V.select(".nv-pie-title").style("text-anchor","middle").text((function(t){return v})).style("font-size",Math.min(N,L)*A*2/(v.length+2)+"px").attr("dy","0.35em").attr("transform",(function(t,e){return"translate(0, "+y+")"})));var Z=V.select(".nv-pie").selectAll(".nv-slice").data(X),U=V.select(".nv-pieLabels").selectAll(".nv-label").data(X);Z.exit().remove(),U.exit().remove();var q=Z.enter().append("g");if(q.attr("class","nv-slice"),q.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),m&&d3.select(this).select("path").transition().duration(70).attr("d",F[e]),D.elementMouseover({data:t.data,index:e,color:d3.select(this).style("fill"),percent:(t.endAngle-t.startAngle)/(2*Math.PI)})})),q.on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),m&&d3.select(this).select("path").transition().duration(50).attr("d",E[e]),D.elementMouseout({data:t.data,index:e})})),q.on("mousemove",(function(t,e){D.elementMousemove({data:t.data,index:e})})),q.on("click",(function(t,e){D.elementClick({data:t.data,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this})})),q.on("dblclick",(function(t,e){D.elementDblClick({data:t.data,index:e,color:d3.select(this).style("fill")})})),Z.attr("fill",(function(t,e){return l(t.data,e)})),Z.attr("stroke",(function(t,e){return l(t.data,e)})),q.append("path").each((function(t){this._current=t})),Z.select("path").transition().duration(C).attr("d",(function(t,e){return E[e](t)})).attrTween("d",(function(t,e){t.endAngle=isNaN(t.endAngle)?0:t.endAngle,t.startAngle=isNaN(t.startAngle)?0:t.startAngle,g||(t.innerRadius=0);var n=d3.interpolate(this._current,t);return this._current=n(0),function(t){return E[e](n(t))}})),c){var K=[];for(H=0;H<O[0].length;H++)K.push(E[H]),d?g&&(K[H]=d3.svg.arc().outerRadius(E[H].outerRadius()),!1!==b&&K[H].startAngle(b),!1!==w&&K[H].endAngle(w)):g||K[H].innerRadius(0);U.enter().append("g").classed("nv-label",!0).each((function(t,e){var n=d3.select(this);n.attr("transform",(function(t,e){if(x){t.outerRadius=B[e]+10,t.innerRadius=B[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("+K[e].centroid(t)+") rotate("+n+")"}return t.outerRadius=_+10,t.innerRadius=_+15,"translate("+K[e].centroid(t)+")"})),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")}));var $={},Q=function(t){return 140*Math.floor(t[0]/140)+","+14*Math.floor(t[1]/14)},J=function(t){return(t.endAngle-t.startAngle)/(2*Math.PI)};U.watchTransition(W,"pie labels").attr("transform",(function(t,e){if(x){t.outerRadius=B[e]+10,t.innerRadius=B[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("+K[e].centroid(t)+") rotate("+n+")"}t.outerRadius=_+10,t.innerRadius=_+15;var r=K[e].centroid(t),i=J(t);if(t.value&&i>=p){var a=Q(r);$[a]&&(r[1]-=14),$[Q(r)]=!0}return"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=J(t),r="";if(!t.value||n<p)return"";if("function"==typeof f)r=f(t,e,{key:i(t.data),value:a(t.data),percent:u(n)});else switch(f){case"key":r=i(t.data);break;case"value":r=u(a(t.data));break;case"percent":r=d3.format("%")(n)}return r})),h&&U.each((function(t,n){if(this.getBBox){var r=this.getBBox(),i=K[n].centroid(t),a={x:i[0]+r.x,y:i[1]+r.y},o={x:a.x+r.width,y:a.y},s={x:a.x,y:a.y+r.height},l={x:a.x+r.width,y:a.y+r.height};t.visible=e.utils.pointIsInArc(a,t,j)&&e.utils.pointIsInArc(o,t,j)&&e.utils.pointIsInArc(s,t,j)&&e.utils.pointIsInArc(l,t,j)}})).style("display",(function(t){return t.visible?null:"none"}))}})),W.renderEnd("pie immediate"),O}return O.dispatch=D,O.options=e.utils.optionsFunc.bind(O),O._options=Object.create({},{arcsRadius:{get:function(){return S},set:function(t){S=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 v},set:function(t){v=t}},titleOffset:{get:function(){return y},set:function(t){y=t}},labelThreshold:{get:function(){return p},set:function(t){p=t}},hideOverlapLabels:{get:function(){return h},set:function(t){h=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 o},set:function(t){o=t}},endAngle:{get:function(){return w},set:function(t){w=t}},startAngle:{get:function(){return b},set:function(t){b=t}},padAngle:{get:function(){return k},set:function(t){k=t}},cornerRadius:{get:function(){return M},set:function(t){M=t}},donutRatio:{get:function(){return A},set:function(t){A=t}},labelsOutside:{get:function(){return d},set:function(t){d=t}},labelSunbeamLayout:{get:function(){return x},set:function(t){x=t}},donut:{get:function(){return g},set:function(t){g=t}},growOnHover:{get:function(){return m},set:function(t){m=t}},pieLabelsOutside:{get:function(){return d},set:function(t){d=t,e.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return d},set:function(t){d=t,e.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return u},set:function(t){u=t,e.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},duration:{get:function(){return C},set:function(t){C=t,W.reset(C)}},y:{get:function(){return a},set:function(t){a=d3.functor(t)}},color:{get:function(){return l},set:function(t){l=e.utils.getColor(t)}},labelType:{get:function(){return f},set:function(t){f=t||"key"}}}),e.utils.initOptions(O),O},e.models.pieChart=function(){"use strict";var t=e.models.pie(),n=e.models.legend(),r=e.models.tooltip(),i={top:30,right:20,bottom:20,left:20},a=null,o=null,s=null,l=!1,u=!0,c="top",d=e.utils.defaultColor(),f=e.utils.state(),p=null,h=null,g=250,v=d3.dispatch("stateChange","changeState","renderEnd");r.duration(0).headerEnabled(!1).valueFormatter((function(e,n){return t.valueFormat()(e,n)}));var m=e.utils.renderWatch(v);function y(r){return m.reset(),m.models(t),r.each((function(r){var l=d3.select(this);e.utils.initSVG(l);var d,h=e.utils.availableWidth(o,l,i),g=e.utils.availableHeight(s,l,i);if(y.update=function(){l.transition().call(y)},y.container=this,f.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(r),y.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(r)).update(),f.disabled=r.map((function(t){return!!t.disabled})),!p)for(d in p={},f)f[d]instanceof Array?p[d]=f[d].slice(0):p[d]=f[d];if(!r||!r.length)return e.utils.noData(y,l),y;l.selectAll(".nv-noData").remove();var m=l.selectAll("g.nv-wrap.nv-pieChart").data([r]),x=m.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),b=m.select("g");if(x.append("g").attr("class","nv-pieWrap"),x.append("g").attr("class","nv-legendWrap"),u)if("top"===c)n.width(h).key(t.x()),m.select(".nv-legendWrap").datum(r).call(n),a||n.height()===i.top||(i.top=n.height(),g=e.utils.availableHeight(s,l,i)),m.select(".nv-legendWrap").attr("transform","translate(0,"+-i.top+")");else if("right"===c){var k=e.models.legend().width();h/2<k&&(k=h/2),n.height(g).key(t.x()),n.width(k),h-=n.width(),m.select(".nv-legendWrap").datum(r).call(n).attr("transform","translate("+h+",0)")}else"bottom"===c&&(n.width(h).key(t.x()),m.select(".nv-legendWrap").datum(r).call(n),i.bottom=n.height(),g=e.utils.availableHeight(s,l,i),m.select(".nv-legendWrap").attr("transform","translate(0,"+g+")"));else b.select(".nv-legendWrap").selectAll("*").remove();m.attr("transform","translate("+i.left+","+i.top+")"),t.width(h).height(g);var w=b.select(".nv-pieWrap").datum([r]);d3.transition(w).call(t),n.dispatch.on("stateChange",(function(t){for(var e in t)f[e]=t[e];v.stateChange(f),y.update()})),v.on("changeState",(function(t){void 0!==t.disabled&&(r.forEach((function(e,n){e.disabled=t.disabled[n]})),f.disabled=t.disabled),y.update()}))})),m.renderEnd("pieChart immediate"),y}return t.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)})),t.dispatch.on("elementMouseout.tooltip",(function(t){r.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){r()})),y.legend=n,y.dispatch=v,y.pie=t,y.tooltip=r,y.options=e.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return s},set:function(t){s=t}},noData:{get:function(){return h},set:function(t){h=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 p},set:function(t){p=t}},color:{get:function(){return d},set:function(e){d=e,n.color(d),t.color(d)}},duration:{get:function(){return g},set:function(e){g=e,m.reset(g),t.duration(g)}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,a=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}}}),e.utils.inheritOptions(y,t),e.utils.initOptions(y),y},e.models.sankey=function(){"use strict";var t={},n=24,r=8,i=[1,1],a=[],o=[],s=!0,l=function(t){a.forEach((function(t){t.sourceLinks=[],t.targetLinks=[]})),o.forEach((function(t){var e=t.source,n=t.target;"number"==typeof e&&(e=t.source=a[t.source]),"number"==typeof n&&(n=t.target=a[t.target]),e.sourceLinks.push(t),n.targetLinks.push(t)})),a.forEach((function(t){t.value=Math.max(d3.sum(t.sourceLinks,f),d3.sum(t.targetLinks,f))})),function(){for(var t,e,r=a,o=0;r.length&&o<a.length;)t=[],r.forEach((function(e){e.x=o,e.dx=n,e.sourceLinks.forEach((function(e){t.indexOf(e.target)<0&&t.push(e.target)}))})),r=t,++o;s&&function(t){a.forEach((function(e){e.sourceLinks.length||(e.x=t-1)}))}(o),e=(i[0]-n)/(o-1),a.forEach((function(t){t.x*=e}))}(),function(t){var e,n=d3.nest().key((function(t){return t.x})).sortKeys(d3.ascending).entries(a).map((function(t){return t.values}));e=d3.min(n,(function(t){return(i[1]-(t.length-1)*r)/d3.sum(t,f)})),n.forEach((function(t){t.forEach((function(t,n){t.y=n,t.dy=t.value*e}))})),o.forEach((function(t){t.dy=t.value*e})),p(),d();for(var s=1;t>0;--t)u(s*=.99),p(),d(),l(s),p(),d();function l(t){function e(t){return(t.source.y+t.sy+t.dy/2)*t.value}n.forEach((function(n,r){n.forEach((function(n){if(n.targetLinks.length){var r=d3.sum(n.targetLinks,e)/d3.sum(n.targetLinks,f);n.y+=(r-c(n))*t}}))}))}function u(t){function e(t){return(t.target.y+t.ty+t.dy/2)*t.value}n.slice().reverse().forEach((function(n){n.forEach((function(n){if(n.sourceLinks.length){var r=d3.sum(n.sourceLinks,e)/d3.sum(n.sourceLinks,f);n.y+=(r-c(n))*t}}))}))}function p(){n.forEach((function(t){var e,n,a,o=0,s=t.length;for(t.sort(h),a=0;a<s;++a)(n=o-(e=t[a]).y)>0&&(e.y+=n),o=e.y+e.dy+r;if((n=o-r-i[1])>0)for(o=e.y-=n,a=s-2;a>=0;--a)(n=(e=t[a]).y+e.dy+r-o)>0&&(e.y-=n),o=e.y}))}function h(t,e){return t.y-e.y}}(t)},u=function(){var t=.5;function e(e){var n=e.source.x+e.source.dx,r=e.target.x,i=d3.interpolateNumber(n,r),a=i(t),o=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"+a+","+s+" "+o+","+l+" "+r+","+l}return e.curvature=function(n){return arguments.length?(t=+n,e):t},e},c=function(t){return t.y+t.dy/2};function d(){function t(t,e){return t.source.y-e.source.y}function e(t,e){return t.target.y-e.target.y}a.forEach((function(n){n.sourceLinks.sort(e),n.targetLinks.sort(t)})),a.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 f(t){return t.value}return t.options=e.utils.optionsFunc.bind(t),t._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 a},set:function(t){a=t}},links:{get:function(){return o},set:function(t){o=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(){d()},set:function(t){}},center:{get:function(){return c()},set:function(t){"function"==typeof t&&(c=t)}},link:{get:function(){return u()},set:function(t){return"function"==typeof t&&(u=t),u()}}}),e.utils.initOptions(t),t},e.models.sankeyChart=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},n=e.models.sankey(),r=600,i=400,a=36,o=40,s="units",l=void 0,u=d3.format(",.0f"),c=function(t){return u(t)+" "+s},d=d3.scale.category20(),f=function(t){return t.source.name+" → "+t.target.name+"\n"+c(t.value)},p=function(t){return t.color=d(t.name.replace(/ .*/,""))},h=function(t){return d3.rgb(t.color).darker(2)},g=function(t){return t.name+"\n"+c(t.value)},v=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 m(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)),v(t,"Error loading chart, data is invalid"),!1;if(!c)return v(t,"No data available"),!1;var d=t.append("svg").attr("width",r).attr("height",i).append("g").attr("class","nvd3 nv-wrap nv-sankeyChart");n.nodeWidth(a).nodePadding(o).size([r,i]);var m=n.link();n.nodes(e.nodes).links(e.links).layout(32).center(l);var y=d.append("g").selectAll(".link").data(e.links).enter().append("path").attr("class","link").attr("d",m).style("stroke-width",(function(t){return Math.max(1,t.dy)})).sort((function(t,e){return e.dy-t.dy}));y.append("title").text(f);var x=d.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.behavior.drag().origin((function(t){return t})).on("dragstart",(function(){this.parentNode.appendChild(this)})).on("drag",(function(t){d3.select(this).attr("transform","translate("+t.x+","+(t.y=Math.max(0,Math.min(i-t.dy,d3.event.y)))+")"),n.relayout(),y.attr("d",m)})));x.append("rect").attr("height",(function(t){return t.dy})).attr("width",n.nodeWidth()).style("fill",p).style("stroke",h).append("title").text(g),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")})),m}return m.options=e.utils.optionsFunc.bind(m),m._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 f},set:function(t){f=t}},nodeWidth:{get:function(){return a},set:function(t){a=t}},nodePadding:{get:function(){return o},set:function(t){o=t}},center:{get:function(){return l},set:function(t){l=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},nodeStyle:{get:function(){return{}},set:function(t){p=void 0!==t.fillColor?t.fillColor:p,h=void 0!==t.strokeColor?t.strokeColor:h,g=void 0!==t.title?t.title:g}}}),e.utils.initOptions(m),m},e.models.scatter=function(){"use strict";var t,n,r,i,a,o,s,l,u={top:0,right:0,bottom:0,left:0},c=null,d=null,f=e.utils.defaultColor(),p=null,h=Math.floor(1e5*Math.random()),g=null,v=d3.scale.linear(),m=d3.scale.linear(),y=d3.scale.linear(),x=function(t){return t.x},b=function(t){return t.y},k=function(t){return t.size||1},w=function(t){return t.shape||"circle"},M=[],A=[],C=[],S=!0,D=function(t){return!t.notActive},E=!1,F=.1,W=!1,O=!0,N=!1,L=function(){return 25},_=null,B=null,T=null,P=null,I=null,H=null,V=!1,z=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),R=!0,Y=250,j=300,G=!1,X=!1,Z=e.utils.renderWatch(z,Y),U=[16,256],q={};function K(t){var e;return e=t[0].series+":"+t[1],q[e]=q[e]||{}}function $(t){var e;e=t[0].series+":"+t[1],delete q[e]}function Q(t){var e,n,r,i=K(t),a=!1;for(e=1;e<arguments.length;e+=2)n=arguments[e],r=arguments[e+1](t[0],t[1]),i[n]===r&&i.hasOwnProperty(n)||(i[n]=r,a=!0);return a}function J(Y){return Z.reset(),Y.each((function(Y){g=d3.select(this);var q=e.utils.availableWidth(c,g,u),K=e.utils.availableHeight(d,g,u);e.utils.initSVG(g),Y.forEach((function(t,e){t.values.forEach((function(t){t.series=e}))}));var tt="function"==typeof J.yScale().base,et=_&&B&&I?[]:d3.merge(Y.map((function(t){return t.values.map((function(t,e){return{x:x(t,e),y:b(t,e),size:k(t,e)}}))})));if(v.domain(_||d3.extent(et.map((function(t){return t.x})).concat(M))),E&&Y[0]?v.range(T||[(q*F+q)/(2*Y[0].values.length),q-q*(1+F)/(2*Y[0].values.length)]):v.range(T||[0,q]),tt){var nt=d3.min(et.map((function(t){if(0!==t.y)return t.y})));m.clamp(!0).domain(B||d3.extent(et.map((function(t){return 0!==t.y?t.y:.1*nt})).concat(A))).range(P||[K,0])}else m.domain(B||d3.extent(et.map((function(t){return t.y})).concat(A))).range(P||[K,0]);y.domain(I||d3.extent(et.map((function(t){return t.size})).concat(C))).range(H||U),V=v.domain()[0]===v.domain()[1]||m.domain()[0]===m.domain()[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])),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])),isNaN(v.domain()[0])&&v.domain([-1,1]),isNaN(m.domain()[0])&&m.domain([-1,1]),t=t||v,n=n||m,r=r||y;var rt=v(1)!==t(1)||m(1)!==n(1)||y(1)!==r(1);s=s||d;var it=(o=o||c)!==c||s!==d,at=(i=i||[])[0]!==v.domain()[0]||i[1]!==v.domain()[1];i=v.domain(),a=a||[],at=at||a[0]!==m.domain()[0]||a[1]!==m.domain()[1],a=m.domain();var ot=g.selectAll("g.nv-wrap.nv-scatter").data([Y]),st=ot.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+h),lt=st.append("defs"),ut=st.append("g"),ct=ot.select("g");function dt(){if(X=!1,!S)return!1;if(!0===R){ot.select(".nv-point-paths").selectAll("path").remove();var t=d3.merge(Y.map((function(t,n){return t.values.map((function(t,r){var i=x(t,r),a=b(t,r);return[e.utils.NaNtoZero(v(i))+1e-4*Math.random(),e.utils.NaNtoZero(m(a))+1e-4*Math.random(),n,r,t]})).filter((function(t,e){return D(t[4],e)}))})));if(0==t.length)return!1;t.length<3&&(t.push([v.range()[0]-20,m.range()[0]-20,null,null]),t.push([v.range()[1]+20,m.range()[1]+20,null,null]),t.push([v.range()[0]-20,m.range()[0]+20,null,null]),t.push([v.range()[1]+20,m.range()[1]-20,null,null]));var n=d3.geom.polygon([[-10,-10],[-10,d+10],[c+10,d+10],[c+10,-10]]);t=t.sort((function(t,e){return t[0]-e[0]||t[1]-e[1]}));for(var r=0;r<t.length-1;)Math.abs(t[r][0]-t[r+1][0])<1e-4&&Math.abs(t[r][1]-t[r+1][1])<1e-4?t.splice(r+1,1):r++;var i=d3.geom.voronoi(t).map((function(e,r){return{data:n.clip(e),series:t[r][2],point:t[r][3]}})),a=ot.select(".nv-point-paths").selectAll("path").data(i),o=a.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-"+h+"-"+e+")"}));N&&o.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),O&&(ot.select(".nv-point-clips").selectAll("*").remove(),ot.select(".nv-point-clips").selectAll("clipPath").data(t).enter().append("svg:clipPath").attr("id",(function(t,e){return"nv-clip-"+h+"-"+e})).append("svg:circle").attr("cx",(function(t){return t[0]})).attr("cy",(function(t){return t[1]})).attr("r",L));var s=function(t,e,n){if(X)return 0;var r=Y[e.series];if(void 0!==r){var i=r.values[e.point];i.color=f(r,e.series),i.x=x(i),i.y=b(i);var a=g.node().getBoundingClientRect(),o=window.pageYOffset||document.documentElement.scrollTop,s=window.pageXOffset||document.documentElement.scrollLeft;n({point:i,series:r,pos:{left:v(x(i,e.point))+a.left+s+u.left+10,top:m(b(i,e.point))+a.top+o+u.top+10},relativePos:[v(x(i,e.point))+u.left,m(b(i,e.point))+u.top],seriesIndex:e.series,pointIndex:e.point,event:d3.event,element:t})}};a.on("click",(function(t){s(this,t,z.elementClick)})).on("dblclick",(function(t){s(this,t,z.elementDblClick)})).on("mouseover",(function(t){s(this,t,z.elementMouseover)})).on("mouseout",(function(t,e){s(this,t,z.elementMouseout)}))}else ot.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",(function(t,e){if(X||!Y[t.series])return 0;var n=Y[t.series],r=n.values[e];z.elementClick({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,event:d3.event,element:this})})).on("dblclick",(function(t,e){if(X||!Y[t.series])return 0;var n=Y[t.series],r=n.values[e];z.elementDblClick({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e})})).on("mouseover",(function(t,e){if(X||!Y[t.series])return 0;var n=Y[t.series],r=n.values[e];z.elementMouseover({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,color:f(t,e)})})).on("mouseout",(function(t,e){if(X||!Y[t.series])return 0;var n=Y[t.series],r=n.values[e];z.elementMouseout({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,color:f(t,e)})}))}ot.classed("nv-single-point",V),ut.append("g").attr("class","nv-groups"),ut.append("g").attr("class","nv-point-paths"),st.append("g").attr("class","nv-point-clips"),ot.attr("transform","translate("+u.left+","+u.top+")"),lt.append("clipPath").attr("id","nv-edge-clip-"+h).append("rect").attr("transform","translate( -10, -10)"),ot.select("#nv-edge-clip-"+h+" rect").attr("width",q+20).attr("height",K>0?K+20:0),ct.attr("clip-path",W?"url(#nv-edge-clip-"+h+")":""),X=!0;var ft=ot.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));ft.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),ft.exit().remove(),ft.attr("class",(function(t,e){return(t.classed||"")+" nv-group nv-series-"+e})).classed("nv-noninteractive",!S).classed("hover",(function(t){return t.hover})),ft.watchTransition(Z,"scatter: groups").style("fill",(function(t,e){return f(t,e)})).style("stroke",(function(t,e){return t.pointBorderColor||p||f(t,e)})).style("stroke-opacity",1).style("fill-opacity",.5);var pt=ft.selectAll("path.nv-point").data((function(t){return t.values.map((function(t,e){return[t,e]})).filter((function(t,e){return D(t[0],e)}))}));if(pt.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("+e.utils.NaNtoZero(t(x(r[0],r[1])))+","+e.utils.NaNtoZero(n(b(r[0],r[1])))+")"})).attr("d",e.utils.symbol().type((function(t){return w(t[0])})).size((function(t){return y(k(t[0],t[1]))}))),pt.exit().each($).remove(),ft.exit().selectAll("path.nv-point").watchTransition(Z,"scatter exit").attr("transform",(function(t){return"translate("+e.utils.NaNtoZero(v(x(t[0],t[1])))+","+e.utils.NaNtoZero(m(b(t[0],t[1])))+")"})).remove(),pt.filter((function(t){return Q(t,"x",x,"y",b)||rt||it||at})).watchTransition(Z,"scatter points").attr("transform",(function(t){return"translate("+e.utils.NaNtoZero(v(x(t[0],t[1])))+","+e.utils.NaNtoZero(m(b(t[0],t[1])))+")"})),pt.filter((function(t){return Q(t,"shape",w,"size",k)||rt||it||at})).watchTransition(Z,"scatter points").attr("d",e.utils.symbol().type((function(t){return w(t[0])})).size((function(t){return y(k(t[0],t[1]))}))),G){var ht=ft.selectAll(".nv-label").data((function(t){return t.values.map((function(t,e){return[t,e]})).filter((function(t,e){return D(t[0],e)}))}));ht.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("+(e.utils.NaNtoZero(t(x(r[0],r[1])))+Math.sqrt(y(k(r[0],r[1]))/Math.PI)+2)+","+e.utils.NaNtoZero(n(b(r[0],r[1])))+")"})).text((function(t,e){return t[0].label})),ht.exit().remove(),ft.exit().selectAll("path.nv-label").watchTransition(Z,"scatter exit").attr("transform",(function(t){return"translate("+(e.utils.NaNtoZero(v(x(t[0],t[1])))+Math.sqrt(y(k(t[0],t[1]))/Math.PI)+2)+","+e.utils.NaNtoZero(m(b(t[0],t[1])))+")"})).remove(),ht.each((function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)})),ht.watchTransition(Z,"scatter labels").attr("transform",(function(t){return"translate("+(e.utils.NaNtoZero(v(x(t[0],t[1])))+Math.sqrt(y(k(t[0],t[1]))/Math.PI)+2)+","+e.utils.NaNtoZero(m(b(t[0],t[1])))+")"}))}j?(clearTimeout(l),l=setTimeout(dt,j)):dt(),t=v.copy(),n=m.copy(),r=y.copy(),o=c,s=d})),Z.renderEnd("scatter immediate"),J}return J.dispatch=z,J.options=e.utils.optionsFunc.bind(J),J._calls=new function(){this.clearHighlights=function(){return e.dom.write((function(){g.selectAll(".nv-point.hover").classed("hover",!1)})),null},this.highlightPoint=function(t,n,r){e.dom.write((function(){g.select(".nv-groups").selectAll(".nv-series-"+t).selectAll(".nv-point-"+n).classed("hover",r)}))}},z.on("elementMouseover.point",(function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)})),z.on("elementMouseout.point",(function(t){S&&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 d},set:function(t){d=t}},xScale:{get:function(){return v},set:function(t){v=t}},yScale:{get:function(){return m},set:function(t){m=t}},pointScale:{get:function(){return y},set:function(t){y=t}},xDomain:{get:function(){return _},set:function(t){_=t}},yDomain:{get:function(){return B},set:function(t){B=t}},pointDomain:{get:function(){return I},set:function(t){I=t}},xRange:{get:function(){return T},set:function(t){T=t}},yRange:{get:function(){return P},set:function(t){P=t}},pointRange:{get:function(){return H},set:function(t){H=t}},forceX:{get:function(){return M},set:function(t){M=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 S},set:function(t){S=t}},pointActive:{get:function(){return D},set:function(t){D=t}},padDataOuter:{get:function(){return F},set:function(t){F=t}},padData:{get:function(){return E},set:function(t){E=t}},clipEdge:{get:function(){return W},set:function(t){W=t}},clipVoronoi:{get:function(){return O},set:function(t){O=t}},clipRadius:{get:function(){return L},set:function(t){L=t}},showVoronoi:{get:function(){return N},set:function(t){N=t}},id:{get:function(){return h},set:function(t){h=t}},interactiveUpdateDelay:{get:function(){return j},set:function(t){j=t}},showLabels:{get:function(){return G},set:function(t){G=t}},pointBorderColor:{get:function(){return p},set:function(t){p=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},pointSize:{get:function(){return k},set:function(t){k=d3.functor(t)}},pointShape:{get:function(){return w},set:function(t){w=d3.functor(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 Y},set:function(t){Y=t,Z.reset(Y)}},color:{get:function(){return f},set:function(t){f=e.utils.getColor(t)}},useVoronoi:{get:function(){return R},set:function(t){!1===(R=t)&&(O=!1)}}}),e.utils.initOptions(J),J},e.models.scatterChart=function(){"use strict";var t=e.models.scatter(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),a=e.models.distribution(),o=e.models.distribution(),s=e.models.tooltip(),l={top:30,right:20,bottom:50,left:75},u=null,c=null,d=null,f=null,p=e.utils.defaultColor(),h=t.xScale(),g=t.yScale(),v=!1,m=!1,y=!0,x=!0,b=!0,k=!1,w=e.utils.state(),M=null,A=d3.dispatch("stateChange","changeState","renderEnd"),C=null,S=250,D=!1;t.xScale(h).yScale(g),n.orient("bottom").tickPadding(10),r.orient(k?"right":"left").tickPadding(10),a.axis("x"),o.axis("y"),s.headerFormatter((function(t,e){return n.tickFormat()(t,e)})).valueFormatter((function(t,e){return r.tickFormat()(t,e)}));var E=e.utils.renderWatch(A,S);function F(C){return E.reset(),E.models(t),x&&E.models(n),b&&E.models(r),v&&E.models(a),m&&E.models(o),C.each((function(C){f=d3.select(this),e.utils.initSVG(f);var W,O=e.utils.availableWidth(c,f,l),N=e.utils.availableHeight(d,f,l);if(F.update=function(){0===S?f.call(F):f.transition().duration(S).call(F)},F.container=this,w.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(C),F.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(C)).update(),w.disabled=C.map((function(t){return!!t.disabled})),!M)for(W in M={},w)w[W]instanceof Array?M[W]=w[W].slice(0):M[W]=w[W];if(!(C&&C.length&&C.filter((function(t){return t.values.length})).length))return e.utils.noData(F,f),E.renderEnd("scatter immediate"),F;f.selectAll(".nv-noData").remove(),h=t.xScale(),g=t.yScale();var L=f.selectAll("g.nv-wrap.nv-scatterChart").data([C]),_=L.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+t.id()).append("g"),B=L.select("g");if(_.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),_.append("g").attr("class","nv-x nv-axis"),_.append("g").attr("class","nv-y nv-axis"),_.append("g").attr("class","nv-scatterWrap"),_.append("g").attr("class","nv-regressionLinesWrap"),_.append("g").attr("class","nv-distWrap"),_.append("g").attr("class","nv-legendWrap"),k&&B.select(".nv-y.nv-axis").attr("transform","translate("+O+",0)"),y){var T=O;i.width(T),L.select(".nv-legendWrap").datum(C).call(i),u||i.height()===l.top||(l.top=i.height(),N=e.utils.availableHeight(d,f,l)),L.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")}else B.select(".nv-legendWrap").selectAll("*").remove();L.attr("transform","translate("+l.left+","+l.top+")"),t.width(O).height(N).color(C.map((function(t,e){return t.color=t.color||p(t,e),t.color})).filter((function(t,e){return!C[e].disabled}))).showLabels(D),L.select(".nv-scatterWrap").datum(C.filter((function(t){return!t.disabled}))).call(t),L.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+t.id()+")");var P=L.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data((function(t){return t}));P.enter().append("g").attr("class","nv-regLines");var I=P.selectAll(".nv-regLine").data((function(t){return[t]}));I.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),I.filter((function(t){return t.intercept&&t.slope})).watchTransition(E,"scatterPlusLineChart: regline").attr("x1",h.range()[0]).attr("x2",h.range()[1]).attr("y1",(function(t,e){return g(h.domain()[0]*t.slope+t.intercept)})).attr("y2",(function(t,e){return g(h.domain()[1]*t.slope+t.intercept)})).style("stroke",(function(t,e,n){return p(t,n)})).style("stroke-opacity",(function(t,e){return t.disabled||void 0===t.slope||void 0===t.intercept?0:1})),x&&(n.scale(h)._ticks(e.utils.calcTicksX(O/100,C)).tickSize(-N,0),B.select(".nv-x.nv-axis").attr("transform","translate(0,"+g.range()[0]+")").call(n)),b&&(r.scale(g)._ticks(e.utils.calcTicksY(N/36,C)).tickSize(-O,0),B.select(".nv-y.nv-axis").call(r)),v&&(a.getData(t.x()).scale(h).width(O).color(C.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!C[e].disabled}))),_.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),B.select(".nv-distributionX").attr("transform","translate(0,"+g.range()[0]+")").datum(C.filter((function(t){return!t.disabled}))).call(a)),m&&(o.getData(t.y()).scale(g).width(N).color(C.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!C[e].disabled}))),_.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),B.select(".nv-distributionY").attr("transform","translate("+(k?O:-o.size())+",0)").datum(C.filter((function(t){return!t.disabled}))).call(o)),i.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];A.stateChange(w),F.update()})),A.on("changeState",(function(t){void 0!==t.disabled&&(C.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),F.update()})),t.dispatch.on("elementMouseout.tooltip",(function(e){s.hidden(!0),f.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",0),f.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",o.size())})),t.dispatch.on("elementMouseover.tooltip",(function(t){f.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.relativePos[1]-N),f.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.relativePos[0]+a.size()),s.data(t).hidden(!1)})),h.copy(),g.copy()})),E.renderEnd("scatter with line immediate"),F}return F.dispatch=A,F.scatter=t,F.legend=i,F.xAxis=n,F.yAxis=r,F.distX=a,F.distY=o,F.tooltip=s,F.options=e.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},container:{get:function(){return f},set:function(t){f=t}},showDistX:{get:function(){return v},set:function(t){v=t}},showDistY:{get:function(){return m},set:function(t){m=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 M},set:function(t){M=t}},noData:{get:function(){return C},set:function(t){C=t}},duration:{get:function(){return S},set:function(t){S=t}},showLabels:{get:function(){return D},set:function(t){D=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,r.orient(t?"right":"left")}},color:{get:function(){return p},set:function(t){p=e.utils.getColor(t),i.color(p),a.color(p),o.color(p)}}}),e.utils.inheritOptions(F,t),e.utils.initOptions(F),F},e.models.sparkline=function(){"use strict";var t,n,r,i,a={top:2,right:0,bottom:2,left:0},o=400,s=32,l=null,u=!0,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=e.utils.getColor(["#000"]),g=!0,v=!0,m=d3.dispatch("renderEnd"),y=e.utils.renderWatch(m);function x(u){return y.reset(),u.each((function(u){var m=o-a.left-a.right,y=s-a.top-a.bottom;l=d3.select(this),e.utils.initSVG(l),c.domain(t||d3.extent(u,f)).range(r||[0,m]),d.domain(n||d3.extent(u,p)).range(i||[y,0]);var x=l.selectAll("g.nv-wrap.nv-sparkline").data([u]);x.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline").append("g"),x.select("g"),x.attr("transform","translate("+a.left+","+a.top+")");var b=x.selectAll("path").data((function(t){return[t]}));b.enter().append("path"),b.exit().remove(),b.style("stroke",(function(t,e){return t.color||h(t,e)})).attr("d",d3.svg.line().x((function(t,e){return c(f(t,e))})).y((function(t,e){return d(p(t,e))})));var k=x.selectAll("circle.nv-point").data((function(t){var e=t.map((function(t,e){return p(t,e)}));function n(e){if(-1!=e){var n=t[e];return n.pointIndex=e,n}return null}var r=n(e.lastIndexOf(d.domain()[1])),i=n(e.indexOf(d.domain()[0])),a=n(e.length-1);return[g?i:null,g?r:null,v?a:null].filter((function(t){return null!=t}))}));k.enter().append("circle"),k.exit().remove(),k.attr("cx",(function(t,e){return c(f(t,t.pointIndex))})).attr("cy",(function(t,e){return d(p(t,t.pointIndex))})).attr("r",2).attr("class",(function(t,e){return f(t,t.pointIndex)==c.domain()[1]?"nv-point nv-currentValue":p(t,t.pointIndex)==d.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"}))})),y.renderEnd("sparkline immediate"),x}return x.options=e.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return s},set:function(t){s=t}},xDomain:{get:function(){return t},set:function(e){t=e}},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 d},set:function(t){d=t}},animate:{get:function(){return u},set:function(t){u=t}},showMinMaxPoints:{get:function(){return g},set:function(t){g=t}},showCurrentPoint:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=d3.functor(t)}},y:{get:function(){return p},set:function(t){p=d3.functor(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 h},set:function(t){h=e.utils.getColor(t)}}}),x.dispatch=m,e.utils.initOptions(x),x},e.models.sparklinePlus=function(){"use strict";var t,n,r=e.models.sparkline(),i={top:15,right:100,bottom:10,left:50},a=null,o=null,s=[],l=!1,u=d3.format(",r"),c=d3.format(",.2f"),d=!0,f=!0,p=!1,h=null,g=d3.dispatch("renderEnd"),v=e.utils.renderWatch(g);function m(h){return v.reset(),v.models(r),h.each((function(h){var g=d3.select(this);e.utils.initSVG(g);var v=e.utils.availableWidth(a,g,i),y=e.utils.availableHeight(o,g,i);if(m.update=function(){g.call(m)},m.container=this,!h||!h.length)return e.utils.noData(m,g),m;g.selectAll(".nv-noData").remove();var x=r.y()(h[h.length-1],h.length-1);t=r.xScale(),n=r.yScale();var b=g.selectAll("g.nv-wrap.nv-sparklineplus").data([h]),k=b.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus").append("g"),w=b.select("g");k.append("g").attr("class","nv-sparklineWrap"),k.append("g").attr("class","nv-valueWrap"),k.append("g").attr("class","nv-hoverArea"),b.attr("transform","translate("+i.left+","+i.top+")");var M=w.select(".nv-sparklineWrap");if(r.width(v).height(y),M.call(r),d){var A=w.select(".nv-valueWrap").selectAll(".nv-currentValue").data([x]);A.enter().append("text").attr("class","nv-currentValue").attr("dx",p?-8:8).attr("dy",".9em").style("text-anchor",p?"end":"start"),A.attr("x",v+(p?i.right:0)).attr("y",f?function(t){return n(t)}:0).style("fill",r.color()(h[h.length-1],h.length-1)).text(c(x))}function C(){if(!l){var e=w.selectAll(".nv-hoverValue").data(s),n=e.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);e.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),e.attr("transform",(function(e){return"translate("+t(r.x()(h[e],e))+",0)"})).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),s.length&&(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"),w.select(".nv-hoverValue .nv-xValue").text(u(r.x()(h[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"),w.select(".nv-hoverValue .nv-yValue").text(c(r.y()(h[s[0]],s[0]))))}}k.select(".nv-hoverArea").append("rect").on("mousemove",(function(){if(!l){var e=d3.mouse(this)[0]-i.left;s=[function(t,e){for(var n=Math.abs(r.x()(t[0],0)-e),i=0,a=0;a<t.length;a++)Math.abs(r.x()(t[a],a)-e)<n&&(n=Math.abs(r.x()(t[a],a)-e),i=a);return i}(h,Math.round(t.invert(e)))],C()}})).on("click",(function(){l=!l})).on("mouseout",(function(){s=[],C()})),w.select(".nv-hoverArea rect").attr("transform",(function(t){return"translate("+-i.left+","+-i.top+")"})).attr("width",v+i.left+i.right).attr("height",y+i.top)})),v.renderEnd("sparklinePlus immediate"),m}return m.dispatch=g,m.sparkline=r,m.options=e.utils.optionsFunc.bind(m),m._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return o},set:function(t){o=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 d},set:function(t){d=t}},alignValue:{get:function(){return f},set:function(t){f=t}},rightAlignValue:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return h},set:function(t){h=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}}}),e.utils.inheritOptions(m,r),e.utils.initOptions(m),m},e.models.stackedArea=function(){"use strict";var t,n,r={top:0,right:0,bottom:0,left:0},i=960,a=500,o=e.utils.defaultColor(),s=Math.floor(1e5*Math.random()),l=null,u=function(t){return t.x},c=function(t){return t.y},d=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},f="stack",p="zero",h="default",g="linear",v=!1,m=e.models.scatter(),y=250,x=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");m.pointSize(2.2).pointDomain([2.2,2.2]);var b=e.utils.renderWatch(x,y);function k(f){return b.reset(),b.models(m),f.each((function(f){var y=i-r.left-r.right,w=a-r.top-r.bottom;l=d3.select(this),e.utils.initSVG(l),t=m.xScale(),n=m.yScale();var M=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 A=f.filter((function(t){return!t.disabled}));f=d3.layout.stack().order(h).offset(p).values((function(t){return t.values})).x(u).y(c).out((function(t,e,n){t.display={y:n,y0:e}}))(A);var C=l.selectAll("g.nv-wrap.nv-stackedarea").data([f]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),D=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-areaWrap"),E.append("g").attr("class","nv-scatterWrap"),C.attr("transform","translate("+r.left+","+r.top+")"),0==m.forceY().length&&m.forceY().push(0),m.width(y).height(w).x(u).y((function(t){if(void 0!==t.display)return t.display.y+t.display.y0})).color(f.map((function(t,e){return t.color=t.color||o(t,t.seriesIndex),t.color}))),F.select(".nv-scatterWrap").datum(f).call(m),D.append("clipPath").attr("id","nv-edge-clip-"+s).append("rect"),C.select("#nv-edge-clip-"+s+" rect").attr("width",y).attr("height",w),F.attr("clip-path",v?"url(#nv-edge-clip-"+s+")":"");var W=d3.svg.area().defined(d).x((function(e,n){return t(u(e,n))})).y0((function(t){return n(t.display.y0)})).y1((function(t){return n(t.display.y+t.display.y0)})).interpolate(g),O=d3.svg.area().defined(d).x((function(e,n){return t(u(e,n))})).y0((function(t){return n(t.display.y0)})).y1((function(t){return n(t.display.y0)})),N=F.select(".nv-areaWrap").selectAll("path.nv-area").data((function(t){return t}));N.enter().append("path").attr("class",(function(t,e){return"nv-area nv-area-"+e})).attr("d",(function(t,e){return O(t.values,t.seriesIndex)})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),x.areaMouseover({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),x.areaMouseout({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})).on("click",(function(t,e){d3.select(this).classed("hover",!1),x.areaClick({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})),N.exit().remove(),N.style("fill",(function(t,e){return t.color||o(t,t.seriesIndex)})).style("stroke",(function(t,e){return t.color||o(t,t.seriesIndex)})),N.watchTransition(b,"stackedArea path").attr("d",(function(t,e){return W(t.values,e)})),m.dispatch.on("elementMouseover.area",(function(t){F.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!0)})),m.dispatch.on("elementMouseout.area",(function(t){F.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!1)})),k.d3_stackedOffset_stackPercent=function(t){var e,n,r,i=t.length,a=t[0].length,o=[];for(n=0;n<a;++n){for(e=0,r=0;e<M.length;e++)r+=c(M[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<a;++n)o[n]=0;return o}})),b.renderEnd("stackedArea immediate"),k}return k.dispatch=x,k.scatter=m,m.dispatch.on("elementClick",(function(){x.elementClick.apply(this,arguments)})),m.dispatch.on("elementMouseover",(function(){x.elementMouseover.apply(this,arguments)})),m.dispatch.on("elementMouseout",(function(){x.elementMouseout.apply(this,arguments)})),k.interpolate=function(t){return arguments.length?(g=t,k):g},k.duration=function(t){return arguments.length?(y=t,b.reset(y),m.duration(y),k):y},k.dispatch=x,k.scatter=m,k.options=e.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return i},set:function(t){i=t}},height:{get:function(){return a},set:function(t){a=t}},defined:{get:function(){return d},set:function(t){d=t}},clipEdge:{get:function(){return v},set:function(t){v=t}},offset:{get:function(){return p},set:function(t){p=t}},order:{get:function(){return h},set:function(t){h=t}},interpolate:{get:function(){return g},set:function(t){g=t}},x:{get:function(){return u},set:function(t){u=d3.functor(t)}},y:{get:function(){return c},set:function(t){c=d3.functor(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 o},set:function(t){o=e.utils.getColor(t)}},style:{get:function(){return f},set:function(t){switch(f=t){case"stack":k.offset("zero"),k.order("default");break;case"stream":k.offset("wiggle"),k.order("inside-out");break;case"stream-center":k.offset("silhouette"),k.order("inside-out");break;case"expand":k.offset("expand"),k.order("default");break;case"stack_percent":k.offset(k.d3_stackedOffset_stackPercent),k.order("default")}}},duration:{get:function(){return y},set:function(t){y=t,b.reset(y),m.duration(y)}}}),e.utils.inheritOptions(k,m),e.utils.initOptions(k),k},e.models.stackedAreaChart=function(){"use strict";var t,n,r=e.models.stackedArea(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend(),s=e.models.legend(),l=e.interactiveGuideline(),u=e.models.tooltip(),c=e.models.focus(e.models.stackedArea()),d={top:10,right:25,bottom:50,left:60},f=null,p=null,h=null,g=e.utils.defaultColor(),v=!0,m=!0,y="top",x=!0,b=!0,k=!1,w=!1,M=!1,A=!0,C="TOTAL",S=e.utils.state(),D=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),W=250,O=["Stacked","Stream","Expanded"],N={},L=250;S.style=r.style(),i.orient("bottom").tickPadding(7),a.orient(k?"right":"left"),u.headerFormatter((function(t,e){return i.tickFormat()(t,e)})).valueFormatter((function(t,e){return a.tickFormat()(t,e)})),l.tooltip.headerFormatter((function(t,e){return i.tickFormat()(t,e)})).valueFormatter((function(t,e){return null==t?"N/A":a.tickFormat()(t,e)}));var _=null,B=null;s.updateState(!1);var T=e.utils.renderWatch(F),P=(r.style(),d3.format("%"));function I(u){return T.reset(),T.models(r),x&&T.models(i),b&&T.models(a),u.each((function(u){var E=d3.select(this);e.utils.initSVG(E);var T,H=e.utils.availableWidth(p,E,d),V=e.utils.availableHeight(h,E,d)-(w?c.height():0);if(I.update=function(){E.transition().duration(L).call(I)},I.container=this,S.setter(function(t){return function(e){void 0!==e.style&&e.style,void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(u),I.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),style:r.style()}}}(u)).update(),S.disabled=u.map((function(t){return!!t.disabled})),!D)for(T in D={},S)S[T]instanceof Array?D[T]=S[T].slice(0):D[T]=S[T];if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return e.utils.noData(I,E),I;E.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale();var z=E.selectAll("g.nv-wrap.nv-stackedAreaChart").data([u]),R=z.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),Y=z.select("g");R.append("g").attr("class","nv-legendWrap"),R.append("g").attr("class","nv-controlsWrap");var j=R.append("g").attr("class","nv-focus");if(j.append("g").attr("class","nv-background").append("rect"),j.append("g").attr("class","nv-x nv-axis"),j.append("g").attr("class","nv-y nv-axis"),j.append("g").attr("class","nv-stackedWrap"),j.append("g").attr("class","nv-interactive"),R.append("g").attr("class","nv-focusWrap"),m){var G=v&&"top"===y?H-W:H;if(o.width(G),Y.select(".nv-legendWrap").datum(u).call(o),"bottom"===y){var X=10+(x?12:0);d.bottom=Math.max(o.height()+X,d.bottom);var Z=(V=e.utils.availableHeight(h,E,d)-(w?c.height():0))+X;Y.select(".nv-legendWrap").attr("transform","translate(0,"+Z+")")}else"top"===y&&(f||d.top==o.height()||(d.top=o.height(),V=e.utils.availableHeight(h,E,d)-(w?c.height():0)),Y.select(".nv-legendWrap").attr("transform","translate("+(H-G)+","+-d.top+")"))}else Y.select(".nv-legendWrap").selectAll("*").remove();if(v){var U=[{key:N.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=r.style(),style:"stack"},{key:N.stream||"Stream",metaKey:"Stream",disabled:"stream"!=r.style(),style:"stream"},{key:N.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=r.style(),style:"expand"},{key:N.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=r.style(),style:"stack_percent"}];W=O.length/3*260,U=U.filter((function(t){return-1!==O.indexOf(t.metaKey)})),s.width(W).color(["#444","#444","#444"]),Y.select(".nv-controlsWrap").datum(U).call(s);var q=Math.max(s.height(),m&&"top"===y?o.height():0);d.top!=q&&(d.top=q,V=e.utils.availableHeight(h,E,d)-(w?c.height():0)),Y.select(".nv-controlsWrap").attr("transform","translate(0,"+-d.top+")")}else Y.select(".nv-controlsWrap").selectAll("*").remove();z.attr("transform","translate("+d.left+","+d.top+")"),k&&Y.select(".nv-y.nv-axis").attr("transform","translate("+H+",0)"),M&&(l.width(H).height(V).margin({left:d.left,top:d.top}).svgContainer(E).xScale(t),z.select(".nv-interactive").call(l)),Y.select(".nv-focus .nv-background rect").attr("width",H).attr("height",V),r.width(H).height(V).color(u.map((function(t,e){return t.color||g(t,e)})).filter((function(t,e){return!u[e].disabled})));var K,$=Y.select(".nv-focus .nv-stackedWrap").datum(u.filter((function(t){return!t.disabled})));function Q(){x&&Y.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+V+")").transition().duration(L).call(i)}function J(){if(b){if("expand"===r.style()||"stack_percent"===r.style()){var t=a.tickFormat();_&&t===P||(_=t),a.tickFormat(P)}else _&&(a.tickFormat(_),_=null);Y.select(".nv-focus .nv-y.nv-axis").transition().duration(0).call(a)}}if(x&&i.scale(t)._ticks(e.utils.calcTicksX(H/100,u)).tickSize(-V,0),b&&(K="wiggle"===r.offset()?0:e.utils.calcTicksY(V/36,u),a.scale(n)._ticks(K).tickSize(-H,0)),w){c.width(H),Y.select(".nv-focusWrap").attr("transform","translate(0,"+(V+d.bottom+c.margin().top)+")").datum(u.filter((function(t){return!t.disabled}))).call(c);var tt=c.brush.empty()?c.xDomain():c.brush.extent();null!==tt&&et(tt)}else $.transition().call(r),Q(),J();function et(t){Y.select(".nv-focus .nv-stackedWrap").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}}))).transition().duration(L).call(r),Q(),J()}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})),S.disabled=u.map((function(t){return!!t.disabled})),F.stateChange(S),I.update()})),o.dispatch.on("stateChange",(function(t){for(var e in t)S[e]=t[e];F.stateChange(S),I.update()})),s.dispatch.on("legendClick",(function(t,e){t.disabled&&(U=U.map((function(t){return t.disabled=!0,t})),t.disabled=!1,r.style(t.style),S.style=r.style(),F.stateChange(S),I.update())})),l.dispatch.on("elementMousemove",(function(t){r.clearHighlights();var n,i,a,o=[],s=0,c=!0,d=!1;if(u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(l,f){i=e.interactiveBisect(l.values,t.pointXValue,I.x());var p=l.values[i],h=I.y()(p,i);if(null!=h&&h>0&&(r.highlightPoint(f,i,!0),d=!0),f!==u.length-1||d||r.highlightPoint(f,i,!0),void 0!==p){void 0===n&&(n=p),void 0===a&&(a=I.xScale()(I.x()(p,i)));var v="expand"==r.style()?p.display.y:I.y()(p,i);o.push({key:l.key,value:v,color:g(l,l.seriesIndex),point:p}),A&&"expand"!=r.style()&&null!=v&&(s+=v,c=!1)}})),o.reverse(),o.length>2){var f=I.yScale().invert(t.mouseY),p=null;o.forEach((function(t,e){f=Math.abs(f);var n=Math.abs(t.point.display.y0),r=Math.abs(t.point.display.y);f>=n&&f<=r+n&&(p=e)})),null!=p&&(o[p].highlight=!0)}A&&"expand"!=r.style()&&o.length>=2&&!c&&o.push({key:C,value:s,total:!0});var h=I.x()(n,i),v=l.tooltip.valueFormatter();"expand"===r.style()||"stack_percent"===r.style()?(B||(B=v),v=d3.format(".1%")):B&&(v=B,B=null),l.tooltip.valueFormatter(v).data({value:h,series:o})(),l.renderGuideLine(a)})),l.dispatch.on("elementMouseout",(function(t){r.clearHighlights()})),c.dispatch.on("onBrush",(function(t){et(t)})),F.on("changeState",(function(t){void 0!==t.disabled&&u.length===t.disabled.length&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),S.disabled=t.disabled),void 0!==t.style&&(r.style(t.style),t.style),I.update()}))})),T.renderEnd("stacked Area chart immediate"),I}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)})),I.dispatch=F,I.stacked=r,I.legend=o,I.controls=s,I.xAxis=i,I.x2Axis=c.xAxis,I.yAxis=a,I.y2Axis=c.yAxis,I.interactiveLayer=l,I.tooltip=u,I.focus=c,I.dispatch=F,I.options=e.utils.optionsFunc.bind(I),I._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 m},set:function(t){m=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 D},set:function(t){D=t}},noData:{get:function(){return E},set:function(t){E=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return N},set:function(t){N=t}},controlOptions:{get:function(){return O},set:function(t){O=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 w},set:function(t){w=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 d},set:function(t){void 0!==t.top&&(d.top=t.top,f=t.top),d.right=void 0!==t.right?t.right:d.right,d.bottom=void 0!==t.bottom?t.bottom:d.bottom,d.left=void 0!==t.left?t.left:d.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 L},set:function(t){L=t,T.reset(L),r.duration(L),i.duration(L),a.duration(L)}},color:{get:function(){return g},set:function(t){g=e.utils.getColor(t),o.color(g),r.color(g),c.color(g)}},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 k},set:function(t){k=t,a.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return M},set:function(t){M=!!t,I.interactive(!t),I.useVoronoi(!t),r.scatter.interactive(!t)}}}),e.utils.inheritOptions(I,r),e.utils.initOptions(I),I},e.models.stackedAreaWithFocusChart=function(){return e.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},e.models.sunburst=function(){"use strict";var t,n,r,i,a={top:0,right:0,bottom:0,left:0},o=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()),d=null,f=e.utils.defaultColor(),p=!1,h=function(t){return"count"===l?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},g=.02,v=function(t,e){return t.name>e.name},m=function(t,e){return void 0!==t.parent?t.name+"-"+t.parent.name+"-"+e:t.name},y=!0,x=500,b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),k=d3.scale.linear().range([0,2*Math.PI]),w=d3.scale.sqrt(),M=d3.layout.partition().sort(v),A={},C=d3.svg.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 S(t){return D(t)>90?180:0}function D(t){return(Math.max(0,Math.min(2*Math.PI,k(t.x)))+Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx))))/2*(180/Math.PI)-90}function E(t){var e=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)))-e)/(2*Math.PI)}function F(t){var e=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)))-e>g}function W(e,n){var r=d3.interpolate(k.domain(),[t.x,t.x+t.dx]),a=d3.interpolate(w.domain(),[t.y,1]),o=d3.interpolate(w.range(),[t.y?20:0,i]);return 0===n?function(){return C(e)}:function(t){return k.domain(r(t)),w.domain(a(t)).range(o(t)),C(e)}}function O(t){var e=d3.interpolate({x:t.x0,dx:t.dx0,y:t.y0,dy:t.dy0},t);return function(n){var r=e(n);return t.x0=r.x,t.dx0=r.dx,t.y0=r.y,t.dy0=r.dy,C(r)}}function N(t){t.forEach((function(t){var e=m(t),n=A[e];n?(t.dx0=n.dx,t.x0=n.x,t.dy0=n.dy,t.y0=n.y):(t.dx0=t.dx,t.x0=t.x,t.dy0=t.dy,t.y0=t.y),function(t){var e=m(t);A[e]||(A[e]={});var n=A[e];n.dx=t.dx,n.x=t.x,n.dy=t.dy,n.y=t.y}(t)}))}function L(e){var n=d.selectAll("text"),r=d.selectAll("path");n.transition().attr("opacity",0),t=e,r.transition().duration(x).attrTween("d",W).each("end",(function(t){t.x>=e.x&&t.x<e.x+e.dx&&t.depth>=e.depth&&d3.select(this.parentNode).select("text").transition().duration(x).text((function(t){return h(t)})).attr("opacity",(function(t){return F(t)?1:0})).attr("transform",(function(){var n=this.getBBox().width;if(0===t.depth)return"translate("+n/2*-1+",0)";if(t.depth===e.depth)return"translate("+(w(t.y)+5)+",0)";var r=D(t),i=S(t);return 0===i?"rotate("+r+")translate("+(w(t.y)+5)+",0)":"rotate("+r+")translate("+(w(t.y)+n+5)+",0)rotate("+i+")"}))}))}var _=e.utils.renderWatch(b);function B(t){return _.reset(),t.each((function(t){d=d3.select(this),n=e.utils.availableWidth(o,d,a),r=e.utils.availableHeight(s,d,a),i=Math.min(n,r)/2,w.range([0,i]);var g=d.select("g.nvd3.nv-wrap.nv-sunburst");g[0][0]?g.attr("transform","translate("+(n/2+a.left+a.right)+","+(r/2+a.top+a.bottom)+")"):g=d.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+c).attr("transform","translate("+(n/2+a.left+a.right)+","+(r/2+a.top+a.bottom)+")"),d.on("click",(function(t,e){b.chartClick({data:t,index:e,pos:d3.event,id:c})})),M.value(u[l]||u.count);var v=M.nodes(t[0]).reverse();N(v);var k=g.selectAll(".arc-container").data(v,m);k.enter().append("g").attr("class","arc-container").append("path").attr("d",C).style("fill",(function(t){return t.color?t.color:f(y?(t.children?t:t.parent).name:t.name)})).style("stroke","#FFF").on("click",(function(t,e){L(t),b.elementClick({data:t,index:e})})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0).style("opacity",.8),b.elementMouseover({data:t,color:d3.select(this).style("fill"),percent:E(t)})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1).style("opacity",1),b.elementMouseout({data:t})})).on("mousemove",(function(t,e){b.elementMousemove({data:t})})),k.each((function(t){d3.select(this).select("path").transition().duration(x).attrTween("d",O)})),p&&(k.selectAll("text").remove(),k.append("text").text((function(t){return h(t)})).transition().duration(x).attr("opacity",(function(t){return F(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=D(t),r=S(t);return 0===r?"rotate("+n+")translate("+(w(t.y)+5)+",0)":"rotate("+n+")translate("+(w(t.y)+e+5)+",0)rotate("+r+")"}))),L(v[v.length-1]),k.exit().transition().duration(x).attr("opacity",0).each("end",(function(t){var e=m(t);A[e]=void 0})).remove()})),_.renderEnd("sunburst immediate"),B}return B.dispatch=b,B.options=e.utils.optionsFunc.bind(B),B._options=Object.create({},{width:{get:function(){return o},set:function(t){o=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}},groupColorByParent:{get:function(){return y},set:function(t){y=!!t}},showLabels:{get:function(){return p},set:function(t){p=!!t}},labelFormat:{get:function(){return h},set:function(t){h=t}},labelThreshold:{get:function(){return g},set:function(t){g=t}},sort:{get:function(){return v},set:function(t){v=t}},key:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return a},set:function(t){a.top=null!=t.top?t.top:a.top,a.right=null!=t.right?t.right:a.right,a.bottom=null!=t.bottom?t.bottom:a.bottom,a.left=null!=t.left?t.left:a.left}},color:{get:function(){return f},set:function(t){f=e.utils.getColor(t)}}}),e.utils.initOptions(B),B},e.models.sunburstChart=function(){"use strict";var t=e.models.sunburst(),n=e.models.tooltip(),r={top:30,right:20,bottom:20,left:20},i=e.utils.defaultColor(),a=!1,o=(Math.round(1e5*Math.random()),null),s=null,l=250,u=d3.dispatch("stateChange","changeState","renderEnd"),c=e.utils.renderWatch(u);function d(n){return c.reset(),c.models(t),n.each((function(n){var i=d3.select(this);e.utils.initSVG(i);var a=e.utils.availableWidth(null,i,r),o=e.utils.availableHeight(null,i,r);if(d.update=function(){0===l?i.call(d):i.transition().duration(l).call(d)},d.container=i,!n||!n.length)return e.utils.noData(d,i),d;i.selectAll(".nv-noData").remove(),t.width(a).height(o).margin(r),i.call(t)})),c.renderEnd("sunburstChart immediate"),d}return n.duration(0).headerEnabled(!1).valueFormatter((function(t){return t})),t.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},a||(delete t.percent,delete t.series.percent),n.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){n.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){n()})),d.dispatch=u,d.sunburst=t,d.tooltip=n,d.options=e.utils.optionsFunc.bind(d),d._options=Object.create({},{noData:{get:function(){return s},set:function(t){s=t}},defaultState:{get:function(){return o},set:function(t){o=t}},showTooltipPercent:{get:function(){return a},set:function(t){a=t}},color:{get:function(){return i},set:function(e){i=e,t.color(i)}},duration:{get:function(){return l},set:function(e){l=e,c.reset(l),t.duration(l)}},margin:{get:function(){return r},set:function(e){r.top=void 0!==e.top?e.top:r.top,r.right=void 0!==e.right?e.right:r.right,r.bottom=void 0!==e.bottom?e.bottom:r.bottom,r.left=void 0!==e.left?e.left:r.left,t.margin(r)}}}),e.utils.inheritOptions(d,t),e.utils.initOptions(d),d},e.version="1.8.6",d3}.apply(e,r))||(t.exports=i)},57:function(t,e,n){"use strict";n.r(e),n.d(e,"ChartData",(function(){return r}));class r{static get DEFAULT_MULTIPLIER(){return 1.2}static get MAXIMUM_DIVISIONS(){return 10}static get COLORS(){return["#003663","#E84E0F","#02A99A","#999999"]}constructor(t,e,n,r){this.filter=r,this.initialChartSetup(t,e,n)}initialChartSetup(t,e,n,r=!0){this.disableRangeUpdate=e,this.disableOldDataRemoval=n,this.translateService=t,this.range=150,this.chartOptions=this.getDefaultChartOptions(t),this.chartSetup(this.chartOptions),r&&(this.dataHolder=this.createDataHolder(),this.firstLoad=!0)}refresh(){this.initialChartSetup(this.translateService,this.disableRangeUpdate,this.disableOldDataRemoval,!1),this.translateLabels(this.dataHolder),this.updateRange(this.dataHolder)}translateLabels(t){this.createDataHolder().forEach((e,n)=>{t[n].originalKey?t[n].originalKey=e.key:t[n].key=e.key})}setSubTitle(t){this.chartOptions.title.enable=!0;const e=t.map(t=>{if(Array.isArray(t.value)&&!t.value.length)return;const e=Array.isArray(t.value)?t.value.join("/"):t.value;return t.label+(void 0!==e?`<span class="data-value">${e}</span>`:"")});this.chartOptions.title.html=e.map(t=>`<span class="info-element">${t}</span>`)}chartSetup(t){}createDataHolder(){throw new Error("Must implement data holder creation")}addData(t,e){this.removeOldData(this.dataHolder,this.range),this.addNewData(this.dataHolder,t,e,this.isFirstLoad()),this.updateRange(this.dataHolder),this.firstLoad&&(this.firstLoad=!1)}removeOldData(t,e){this.disableOldDataRemoval||t[0].values.length>e&&t.forEach(t=>t.values.shift())}addNewData(t,e,n,r){}updateRange(t,e){if(this.disableRangeUpdate)return;const[n]=r.calculateMaxChartValueAndDivisions(t,e);this.chartOptions.chart.yDomain=[0,n]}isFirstLoad(){return this.firstLoad}getDefaultChartOptions(t){return{chart:{interpolate:"monotone",type:"lineChart",height:500,margin:{left:80,right:80},x:function(t){return t[0]},y:function(t){return t[1]},clipEdge:!0,noData:t.instant("resource.no_data"),showControls:!1,duration:0,rightAlignYAxis:!1,useInteractiveGuideline:!0,xAxis:{showMaxMin:!1,tickFormat:function(t){return d3.time.format("%X")(new Date(t))}},yAxis:{showMaxMin:!1,tickFormat:function(t){return t}},legend:{maxKeyLength:100},color:r.COLORS},title:{enable:!0,className:"chart-additional-info",html:" "}}}static getMaxValueFromDataHolder(t){return Math.max(...t.filter(t=>!t.disabled).flatMap(t=>r.getMaxValueForDataSeries(t)))}static getMaxValueForDataSeries(t){return Math.max(...t.values.map(t=>t[1]))}static calculateMaxChartValueAndDivisions(t,e){let n;n=Array.isArray(t)?r.getMaxValueFromDataHolder(t):r.getMaxValueForDataSeries(t);const i=Math.round(n*(e||r.DEFAULT_MULTIPLIER))||1;return[i,Math.ceil(i/r.MAXIMUM_DIVISIONS)]}static getIntegerRangeForValues(t,e){const[n,i]=r.calculateMaxChartValueAndDivisions(t,e);return d3.range(0,n+1,i)}static formatBytesValue(t,e){let n=t;e&&(n=Math.max(...e.filter(t=>!t.disabled).flatMap(t=>t.values).flatMap(t=>t[1])));const r=Math.floor(Math.log(n)/Math.log(1024));return`${(parseFloat(t)/Math.pow(1024,r)).toFixed(2)} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`}formatNumber(t){if(t&&this.filter)return this.filter("currency")(t,"",0)}}},59:function(t,e,n){"use strict";n.r(e),n.d(e,"HeapMemoryChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}createDataHolder(){return[{key:this.translateService.instant("resource.memory.committed"),values:[]},{key:this.translateService.instant("resource.memory.used"),area:"true",values:[]}]}addNewData(t,e,n){const[r,i]=t,a=this.parseData(n);r.values.push([e,a.committed]),i.values.push([e,a.used]),this.setMaxHeapSize(a.max)}parseData(t){return t.heapMemoryUsage}setMaxHeapSize(t){if(t>0){const e=[{label:this.translateService.instant("resource.memory.heap.max"),value:i.formatBytesValue(t)}];this.setSubTitle(e)}}updateRange(t){this.setScale(t),super.updateRange(t)}setScale(t){this.chartOptions.chart.yAxis.tickFormat=e=>i.formatBytesValue(e,t)}}},60:function(t,e){angular.module("graphdb.framework.rest.cluster.service",[]).factory("ClusterRestService",n),n.$inject=["$http"];function n(t){return{getClusterConfig:function(){return t.get("rest/cluster/config")},createCluster:function(e){return t.post("rest/cluster/config",e)},updateCluster:function(e){e.nodes&&delete e.nodes;return t.patch("rest/cluster/config",e)},deleteCluster:function(e){const n=$.param({force:e});return t.delete("rest/cluster/config?"+n)},addNodesToCluster:function(e){return t.post("rest/cluster/config/node",{nodes:e})},removeNodesFromCluster:function(e){return t.delete("rest/cluster/config/node",{data:{nodes:e},headers:{"Content-Type":"application/json"}})},getClusterStatus:function(){return t.get("rest/cluster/group/status")},getNodeStatus:function(){return t.get("rest/cluster/node/status")}}}},67:function(t,e,n){"use strict";n.r(e),n.d(e,"FileDescriptorsChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t,e){super(t,!1,!1,e)}chartSetup(t){t.chart.yAxis.tickFormat=t=>this.formatNumber(t),t.chart.color=[t.chart.color[1]]}createDataHolder(){return[{key:this.translateService.instant("resource.system.file_descriptors.open"),area:"true",values:[]}]}addNewData(t,e,n){if(!n.openFileDescriptors){const t=[{label:this.translateService.instant("resource.system.file_descriptors.only_unix")}];return void this.setSubTitle(t)}t[0].values.push([e,n.openFileDescriptors]);const r=[{label:this.translateService.instant("resource.system.file_descriptors.max"),value:this.formatNumber(n.maxFileDescriptors)}];this.setSubTitle(r)}updateRange(t){super.updateRange(t,2)}}},68:function(t,e,n){"use strict";n.r(e),n.d(e,"NonHeapMemoryChart",(function(){return i}));var r=n(59);class i extends r.HeapMemoryChart{constructor(t){super(t,!1,!1)}parseData(t){return t.nonHeapMemoryUsage}}},69:function(t,e,n){"use strict";n.r(e),n.d(e,"CpuLoadChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}chartSetup(t){t.chart.yAxis.tickFormat=function(t){return t+"%"}}createDataHolder(){return[{key:this.translateService.instant("resource.system.cpu_load.label"),values:[]}]}addNewData(t,e,n){t[0].values.push([e,this.formatValue(n.cpuLoad)])}formatValue(t){return parseFloat(t).toFixed(4)}updateRange(t){const e=Math.max(...t[0].values.flatMap(t=>t[1])),n=e>50?100:2*e;this.chartOptions.chart.yDomain=[0,n]}}},70:function(t,e,n){"use strict";n.r(e),n.d(e,"DiskStorageChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!0,!0)}chartSetup(t){Object.assign(t.chart,{type:"multiBarHorizontalChart",height:250,stacked:!0,showControls:!1,xAxis:{showMaxMin:!1,tickFormat:function(t){return t}},yAxis:{showMaxMin:!1,tickFormat:function(t){return(100*t).toFixed(2)+"%"}},yDomain:[0,1]})}translateLabels(t){if(!t)return;super.translateLabels(t);const[e,n]=t;e.values.length&&n.values.length&&(e.values[0][0]=this.translateService.instant("resource.storage.data"),e.values[1][0]=this.translateService.instant("resource.storage.work"),e.values[2][0]=this.translateService.instant("resource.storage.logs"),n.values[0][0]=this.translateService.instant("resource.storage.data"),n.values[1][0]=this.translateService.instant("resource.storage.work"),n.values[2][0]=this.translateService.instant("resource.storage.logs"))}createDataHolder(){return[{key:this.translateService.instant("resource.storage.used"),color:this.chartOptions.chart.color[1],values:[]},{key:this.translateService.instant("resource.storage.free"),color:this.chartOptions.chart.color[0],values:[]}]}addNewData(t,e,n,r){const a=n.storageMemory,[o,s]=t;r&&(o.values.push([this.translateService.instant("resource.storage.data"),0]),o.values.push([this.translateService.instant("resource.storage.work"),0]),o.values.push([this.translateService.instant("resource.storage.logs"),0]),s.values.push([this.translateService.instant("resource.storage.data"),1]),s.values.push([this.translateService.instant("resource.storage.work"),1]),s.values.push([this.translateService.instant("resource.storage.logs"),1]));const l=[{label:this.translateService.instant("resource.storage.subtitle.data"),value:[i.formatBytesValue(a.dataDirUsed),i.formatBytesValue(a.dataDirFree)]},{label:this.translateService.instant("resource.storage.subtitle.work"),value:[i.formatBytesValue(a.workDirUsed),i.formatBytesValue(a.workDirFree)]},{label:this.translateService.instant("resource.storage.subtitle.logs"),value:[i.formatBytesValue(a.logsDirUsed),i.formatBytesValue(a.logsDirFree)]}];this.setSubTitle(l);const u=a.dataDirUsed+a.dataDirFree,c=a.workDirUsed+a.workDirFree,d=a.logsDirUsed+a.logsDirFree;o.values[0][1]=a.dataDirUsed/u,o.values[1][1]=a.workDirUsed/c,o.values[2][1]=a.logsDirUsed/d,s.values[0][1]=a.dataDirFree/u,s.values[1][1]=a.workDirFree/c,s.values[2][1]=a.logsDirFree/d}}},71:function(t,e,n){"use strict";n.r(e),n.d(e,"QueriesChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}chartSetup(t){t.chart.yAxis.tickValues=()=>i.getIntegerRangeForValues(this.dataHolder)}createDataHolder(){return[{key:this.translateService.instant("resource.queries.running"),values:[]}]}addNewData(t,e,n){const{activeQueryData:r,performanceData:i}=n;t[0].values.push([e,r.length]);const a=i.queries.slow,o=i.queries.suboptimal,s=[{label:this.translateService.instant("resource.queries.slow"),value:a},{label:this.translateService.instant("resource.queries.suboptimal"),value:o}];this.setSubTitle(s)}}},72:function(t,e,n){"use strict";n.r(e),n.d(e,"GlobalCacheChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t,e){super(t,!1,!1,e)}chartSetup(t){t.chart.yAxis.tickFormat=t=>this.formatNumber(t)}getTitle(){return this.translateService.instant("resources.global_cache.label")}createDataHolder(){return[{key:this.translateService.instant("resources.global_cache.hits"),values:[]},{key:this.translateService.instant("resources.global_cache.miss"),values:[]}]}addNewData(t,e,n){const[r,i]=t;r.values.push([e,n.cacheHit]),i.values.push([e,n.cacheMiss])}}},73:function(t,e,n){"use strict";n.r(e),n.d(e,"ConnectionsChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}chartSetup(t){t.chart.yAxis.tickValues=()=>i.getIntegerRangeForValues(this.dataHolder)}createDataHolder(){return[{key:this.translateService.instant("resource.connections.active"),values:[]},{key:this.translateService.instant("resource.connections.open"),values:[]}]}addNewData(t,e,n){const r=n.performanceData;t[0].values.push([e,r.activeTransactions]),t[1].values.push([e,r.openConnections])}}},74:function(t,e,n){"use strict";n.r(e),n.d(e,"ClusterHealthChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!0,!1),this.nodesCount=0}chartSetup(t){const e={type:"stackedAreaChart",interpolate:"step-after",stacked:!0,yAxis:{showMaxMin:!1,tickFormat:function(t){return t},tickValues:()=>d3.range(0,this.nodesCount+1,1)}};Object.assign(t.chart,e)}getTitle(){return this.translateService.instant("resources.cluster_health.label")}createDataHolder(){const[t,e,n,r]=i.COLORS;return[{key:this.translateService.instant("resources.cluster_health.in_sync"),color:t,values:[]},{key:this.translateService.instant("resources.cluster_health.syncing"),color:n,values:[]},{key:this.translateService.instant("resources.cluster_health.out_sync"),color:e,values:[]},{key:this.translateService.instant("resources.cluster_health.disconnected"),color:r,values:[]}]}addNewData(t,e,n){const r=n.nodesStats;this.nodesCount=r.nodesInCluster;const[i,a,o,s]=t;i.values.push([e,r.nodesInSync]),o.values.push([e,r.nodesOutOfSync]),s.values.push([e,r.nodesDisconnected]),a.values.push([e,r.nodesSyncing]);const l=[{label:this.translateService.instant("resource.cluster_health.leader_elections"),value:n.term},{label:this.translateService.instant("resource.cluster_health.recoveries"),value:n.failureRecoveriesCount},{label:this.translateService.instant("resource.cluster_health.failed_transactions"),value:n.failedTransactionsCount}];this.setSubTitle(l)}}},75:function(t,e,n){"use strict";n.r(e),n.d(e,"EpoolChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}chartSetup(t){const e={type:"multiChart",yAxis1:{showMaxMin:!1,axisLabel:this.translateService.instant("resource.epool.reads"),axisLabelDistance:-10,rotateYLabel:!0,tickFormat:function(t){return t},tickValues:()=>i.getIntegerRangeForValues(this.dataHolder[0])},yAxis2:{showMaxMin:!1,axisLabel:this.translateService.instant("resource.epool.writes"),axisLabelDistance:-10,rotateYLabel:!0,tickFormat:function(t){return t},tickValues:()=>i.getIntegerRangeForValues(this.dataHolder[1])},y1Domain:[0,1],y2Domain:[0,1]};Object.assign(t.chart,e)}getTitle(){return this.translateService.instant("resource.epool.label")}createDataHolder(){return[{key:this.translateService.instant("resource.epool.reads"),type:"line",yAxis:1,values:[]},{key:this.translateService.instant("resource.epool.writes"),type:"line",yAxis:2,values:[]}]}addNewData(t,e,n,r){const i=n.performanceData,[a,o]=t;let s=0,l=0;const u=i.entityPool.epoolReads,c=i.entityPool.epoolWrites;if(!r){s=u-a.values[a.values.length-1][2],l=c-o.values[a.values.length-1][2]}a.values.push([e,s,u]),o.values.push([e,l,c])}updateRange(t){this.chartOptions.chart.yDomain1=this.getAxisDomain(t[0]),this.chartOptions.chart.yDomain2=this.getAxisDomain(t[1])}getAxisDomain(t){const[e]=i.calculateMaxChartValueAndDivisions(t);return[0,e]}}},81:function(t,e,n){"use strict";n.r(e);n(6),n(22),n(25),n(305),n(60);var r=n(67),i=n(59),a=n(68),o=n(69),s=n(70),l=n(71),u=n(72),c=n(73),d=n(74),f=n(75);angular.module("graphdb.framework.jmx.resources.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","graphdb.framework.rest.cluster.service"]).controller("ResourcesCtrl",["$scope","$rootScope","$timeout","MonitoringRestService","$translate","$repositories","$q","ClusterRestService","$filter",function(t,e,n,p,h,g,v,m,y){t.AVAILABLE_TABS=Object.freeze({RESOURCE_MONITOR:"resource",PERFORMANCE_MONITOR:"performance",CLUSTER_HEALTH:"cluster"});const x=window.location.hash.slice(1),b=Object.keys(t.AVAILABLE_TABS).find(e=>t.AVAILABLE_TABS[e]===x);t.activeTab=t.AVAILABLE_TABS[b]||t.AVAILABLE_TABS.RESOURCE_MONITOR,e.$on("$translateChangeSuccess",(function(e,n){[t.resourceMonitorData,t.performanceMonitorData,t.structuresMonitorData,t.clusterHealthData].forEach(t=>{Object.values(t.charts).forEach(t=>t.refresh())})})),t.resourceMonitorData={error:{hasError:!1,message:"",retries:0},charts:{cpuLoad:new o.CpuLoadChart(h),fileDescriptors:new r.FileDescriptorsChart(h,y),heapMemory:new i.HeapMemoryChart(h),offHeapMemory:new a.NonHeapMemoryChart(h),diskStorage:new s.DiskStorageChart(h)}},t.performanceMonitorData={error:{hasError:!1,message:"",retries:0},charts:{connectionsChart:new c.ConnectionsChart(h),epoolChart:new f.EpoolChart(h),queriesChart:new l.QueriesChart(h)}},t.structuresMonitorData={error:{hasError:!1,message:"",retries:0},charts:{globalCacheChart:new u.GlobalCacheChart(h,y)}},t.clusterHealthData={error:{hasError:!1,message:"",retries:0},charts:{clusterHealthChart:new d.ClusterHealthChart(h)}},t.hasCluster=!1;t.loader=!0,t.switchTab=e=>{t.activeTab=e,window.location.hash=e},t.getActiveRepository=function(){return g.getActiveRepository()};const k=function(t){return p.monitorQueryTransactionStatistics(t).then((function(t){return t.data}))},w=function(t){return p.monitorQuery(t).then((function(t){return t.data}))},M=function(){return p.monitorCluster()},A=t=>{if(t.chartsHolder.error.hasError){if(3===t.chartsHolder.error.retries)return t.poll&&n.cancel(t.poll),Promise.resolve();t.chartsHolder.error.retries++}return t.fetchFn().then((function(e){C(e,t)})).then(()=>{E(t)}).catch(e=>{D(t,e)}).finally(()=>{t.poll&&n.cancel(t.poll),t.poll=n(()=>A(t),2e3)})},C=(t,e,n)=>{const r=t.data;r&&S(r,e,n)},S=(t,e,n)=>{const r=new Date;n?n(r,t):Object.values(e.chartsHolder.charts).forEach(e=>{e.addData(r,t)})},D=(t,e)=>{t.chartsHolder.error.hasError=!!e,t.chartsHolder.error.hasError&&(t.chartsHolder.error.message=getError(e))},E=t=>{t.chartsHolder.error.hasError=!1,t.chartsHolder.error.message=""};t.monitors=[],t.monitors.push({chartsHolder:t.resourceMonitorData,error:{hasError:!1,message:"",retries:0},fetchFn:function(){return p.monitorResources()},poll:null}),t.monitors.push({chartsHolder:t.structuresMonitorData,error:{hasError:!1,message:"",retries:0},fetchFn:function(){const e=t.getActiveRepository();return e?p.monitorStructures(e):Promise.resolve()},poll:null}),t.monitors.push({chartsHolder:t.performanceMonitorData,error:{hasError:!1,message:"",retries:0},fetchFn:function(){const e=t.getActiveRepository();return e?v.all([k(e),w(e)]).then(t=>{const[e,n]=t;return{data:{performanceData:e,activeQueryData:n}}}):Promise.resolve()},poll:null}),m.getNodeStatus().then(()=>{t.hasCluster=!0;const e={chartsHolder:t.clusterHealthData,fetchFn:M,poll:null};t.monitors.push(e),A(e)}).catch(()=>{t.hasCluster=!1});let F=null;v.all(t.monitors.map(t=>A(t))).finally(()=>{t.loader&&(F&&n.cancel(F),F=n((function(){t.loader=!1}),500))}),t.$on("$destroy",(function(){F&&n.cancel(F);for(const e of t.monitors)e.poll&&n.cancel(e.poll)}))}])}}]);
|
|
1
|
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[15,16,38,53,54,55,56,57,58,59,60,61,131,133],{190:function(t,e,n){"use strict";n.r(e);n(7),n(23),n(82),n(22),n(297),n(319);angular.module("graphdb.framework.jmx.resources",["toastr","ui.bootstrap","nvd3","graphdb.framework.jmx.resources.controllers","graphdb.framework.core.services.repositories","graphdb.framework.core.directives"])},305:function(t,e,n){var r,i;r=[n(304)],void 0===(i=function(){var e;return(e={dev:!1}).tooltip=e.tooltip||{},e.utils=e.utils||{},e.models=e.models||{},e.charts={},e.logs={},e.dom={},"undefined"==typeof d3&&(d3=n(297)),e.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new 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}),e.dev&&(e.dispatch.on("render_start",(function(t){e.logs.startTime=+new Date})),e.dispatch.on("render_end",(function(t){e.logs.endTime=+new Date,e.logs.totalTime=e.logs.endTime-e.logs.startTime,e.log("total",e.logs.totalTime)}))),e.log=function(){if(e.dev&&window.console&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(e.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind){var t=Function.prototype.bind.call(console.log,console);t.apply(console,arguments)}return arguments[arguments.length-1]},e.deprecated=function(t,e){console&&console.warn&&console.warn("nvd3 warning: `"+t+"` has been deprecated. ",e||"")},e.render=function(t){t=t||1,e.render.active=!0,e.dispatch.render_start();var n=function(){for(var r,i,a=0;a<t&&(i=e.render.queue[a]);a++)r=i.generate(),typeof i.callback==typeof Function&&i.callback(r);e.render.queue.splice(0,a),e.render.queue.length?setTimeout(n):(e.dispatch.render_end(),e.render.active=!1)};setTimeout(n)},e.render.active=!1,e.render.queue=[],e.addGraph=function(t){typeof arguments[0]==typeof Function&&(t={generate:arguments[0],callback:arguments[1]}),e.render.queue.push(t),e.render.active||e.render()},t.exports=e,"undefined"!=typeof window&&(window.nv=e),e.dom.write=function(t){return void 0!==window.fastdom?fastdom.mutate(t):t()},e.dom.read=function(t){return void 0!==window.fastdom?fastdom.measure(t):t()},e.interactiveGuideline=function(){"use strict";var t={left:0,top:0},n=null,r=null,i=d3.scale.linear(),a=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick","elementMouseDown","elementMouseUp"),o=!0,s=null,l=e.models.tooltip(),u=window.ActiveXObject;function c(d){d.each((function(d){var f=d3.select(this),p=n||960,h=r||400,g=f.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([d]);function v(){var e=d3.event.clientX-this.getBoundingClientRect().left,n=d3.event.clientY-this.getBoundingClientRect().top,r=!0,o=!1;if(u&&(e=d3.event.offsetX,n=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(r=!1),d3.event.target.className.baseVal.match("nv-legend")&&(o=!0)),r&&(e-=t.left,n-=t.top),"mouseout"===d3.event.type||e<0||n<0||e>p||n>h||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||o){if(u&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(l.nvPointerEventsClass)))return;return a.elementMouseout({mouseX:e,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0)}l.hidden(!1);var s=void 0;if("function"==typeof i.rangeBands){var d=d3.bisect(i.range(),e)-1;if(!(i.range()[d]+i.rangeBand()>=e))return a.elementMouseout({mouseX:e,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0);s=i.domain()[d3.bisect(i.range(),e)-1]}else s=i.invert(e);a.elementMousemove({mouseX:e,mouseY:n,pointXValue:s}),"dblclick"===d3.event.type&&a.elementDblclick({mouseX:e,mouseY:n,pointXValue:s}),"click"===d3.event.type&&a.elementClick({mouseX:e,mouseY:n,pointXValue:s}),"mousedown"===d3.event.type&&a.elementMouseDown({mouseX:e,mouseY:n,pointXValue:s}),"mouseup"===d3.event.type&&a.elementMouseUp({mouseX:e,mouseY:n,pointXValue:s})}g.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(t){o&&(c.guideLine&&c.guideLine.attr("x1")===t||e.dom.write((function(){var n=g.select(".nv-interactiveGuideLine").selectAll("line").data(null!=t?[e.utils.NaNtoZero(t)]:[],String);n.enter().append("line").attr("class","nv-guideline").attr("x1",(function(t){return t})).attr("x2",(function(t){return t})).attr("y1",h).attr("y2",0),n.exit().remove()})))})}))}return l.duration(0).hideDelay(0).hidden(!1),c.dispatch=a,c.tooltip=l,c.margin=function(e){return arguments.length?(t.top=void 0!==e.top?e.top:t.top,t.left=void 0!==e.left?e.left:t.left,c):t},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?(o=t,c):o},c.svgContainer=function(t){return arguments.length?(s=t,c):s},c},e.interactiveBisect=function(t,e,n){"use strict";if(!(t instanceof Array))return null;var r;r="function"!=typeof n?function(t){return t.x}:n;var i=d3.bisector((function(t,e){return r(t)-e})).left,a=d3.max([0,i(t,e)-1]),o=r(t[a]);if(void 0===o&&(o=a),o===e)return a;var s=d3.min([a+1,t.length-1]),l=r(t[s]);return void 0===l&&(l=s),Math.abs(l-e)>=Math.abs(o-e)?a:s},e.nearestValueIndex=function(t,e,n){"use strict";var r=1/0,i=null;return t.forEach((function(t,a){var o=Math.abs(e-t);null!=t&&o<=r&&o<n&&(r=o,i=a)})),i},e.models.tooltip=function(){"use strict";var t="nvtooltip-"+Math.floor(1e5*Math.random()),n=null,r="w",i=25,a=0,o=null,s=!0,l=200,u=null,c={left:null,top:null},d=!0,f=100,p=!0,h=function(t,e,n){return t},g=function(t){return t},v=function(t,e){return t},m=function(t,e){if(null===t)return"";var n=d3.select(document.createElement("table"));p&&n.selectAll("thead").data([t]).enter().append("thead").append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(g(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 v(t.key,e)})),r.append("td").classed("value",!0).html((function(t,e){return h(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("%")(t.percent)+")"})),r.selectAll("td").each((function(t){if(t.highlight){var e=d3.scale.linear().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},y=function(){var t={left:null!==d3.event?d3.event.clientX:0,top:null!==d3.event?d3.event.clientY:0};if("none"!=getComputedStyle(document.body).transform){var e=document.body.getBoundingClientRect();t.left-=e.left,t.top-=e.top}return t},x=function(){e.dom.read((function(){var t=y(),e=function(t){var e,n,a,o=u.node().offsetHeight,s=u.node().offsetWidth,l=document.documentElement.clientWidth,c=document.documentElement.clientHeight;switch(r){case"e":e=-s-i,n=-o/2,t.left+e<0&&(e=i),(a=t.top+n)<0&&(n-=a),(a=t.top+n+o)>c&&(n-=a-c);break;case"w":e=i,n=-o/2,t.left+e+s>l&&(e=-s-i),(a=t.top+n)<0&&(n-=a),(a=t.top+n+o)>c&&(n-=a-c);break;case"n":e=-s/2-5,n=i,t.top+n+o>c&&(n=-o-i),(a=t.left+e)<0&&(e-=a),(a=t.left+e+s)>l&&(e-=a-l);break;case"s":e=-s/2,n=-o-i,t.top+n<0&&(n=i),(a=t.left+e)<0&&(e-=a),(a=t.left+e+s)>l&&(e-=a-l);break;case"center":e=-s/2,n=-o/2;break;default:e=0,n=0}return{left:e,top:n}}(t),n=t.left+e.left,a=t.top+e.top;if(s)u.interrupt().transition().delay(l).duration(0).style("opacity",0);else{var o="translate("+c.left+"px, "+c.top+"px)",d="translate("+Math.round(n)+"px, "+Math.round(a)+"px)",p=d3.interpolateString(o,d),h=u.style("opacity")<.1;u.interrupt().transition().duration(h?0:f).styleTween("transform",(function(t){return p}),"important").styleTween("-webkit-transform",(function(t){return p})).style("-ms-transform",d).style("opacity",1)}c.left=n,c.top=a}))};function b(){if(d&&function(t){if(t&&t.series){if(e.utils.isArray(t.series))return!0;if(e.utils.isObject(t.series))return t.series=[t.series],!0}return!1}(n))return e.dom.write((function(){u&&u.node()||((u=d3.select(document.body).select("#"+t).data([1])).enter().append("div").attr("class","nvtooltip "+(o||"xy-tooltip")).attr("id",t).style("top",0).style("left",0).style("opacity",0).style("position","fixed").selectAll("div, table, td, tr").classed("nv-pointer-events-none",!0).classed("nv-pointer-events-none",!0),u.exit().remove());var e=m(n,u.node());e&&(u.node().innerHTML=e),x()})),b}return b.nvPointerEventsClass="nv-pointer-events-none",b.options=e.utils.optionsFunc.bind(b),b._options=Object.create({},{duration:{get:function(){return f},set:function(t){f=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 a},set:function(t){a=t}},classes:{get:function(){return o},set:function(t){o=t}},enabled:{get:function(){return d},set:function(t){d=t}},hideDelay:{get:function(){return l},set:function(t){l=t}},contentGenerator:{get:function(){return m},set:function(t){m=t}},valueFormatter:{get:function(){return h},set:function(t){h=t}},headerFormatter:{get:function(){return g},set:function(t){g=t}},keyFormatter:{get:function(){return v},set:function(t){v=t}},headerEnabled:{get:function(){return p},set:function(t){p=t}},position:{get:function(){return y},set:function(t){y=t}},chartContainer:{get:function(){return document.body},set:function(t){e.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(t){e.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(t){e.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return s},set:function(t){s!=t&&(s=!!t,b())}},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 t},set:function(t){}}}),e.utils.initOptions(b),b},e.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},e.utils.isArray=Array.isArray,e.utils.isObject=function(t){return null!==t&&"object"==typeof t},e.utils.isFunction=function(t){return"function"==typeof t},e.utils.isDate=function(t){return"[object Date]"===toString.call(t)},e.utils.isNumber=function(t){return!isNaN(t)&&"number"==typeof t},e.utils.windowResize=function(t){return window.addEventListener?window.addEventListener("resize",t):e.log("ERROR: Failed to bind to window.resize with: ",t),{callback:t,clear:function(){window.removeEventListener("resize",t)}}},e.utils.getColor=function(t){if(void 0===t)return e.utils.defaultColor();if(e.utils.isArray(t)){var n=d3.scale.ordinal().range(t);return function(t,e){var r=void 0===e?t:e;return t.color||n(r)}}return t},e.utils.defaultColor=function(){return e.utils.getColor(d3.scale.category20().range())},e.utils.customTheme=function(t,n,r){n=n||function(t){return t.key};var i=(r=r||d3.scale.category20().range()).length;return function(a,o){var s=n(a);return e.utils.isFunction(t[s])?t[s]():void 0!==t[s]?t[s]:(i||(i=r.length),r[i-=1])}},e.utils.pjax=function(t,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),e.utils.pjax(t,n)}))};d3.selectAll(t).on("click",(function(){history.pushState(this.href,this.textContent,this.href),r(this.href),d3.event.preventDefault()})),d3.select(window).on("popstate",(function(){d3.event.state&&r(d3.event.state)}))},e.utils.calcApproxTextWidth=function(t){if(e.utils.isFunction(t.style)&&e.utils.isFunction(t.text)){var n=parseInt(t.style("font-size").replace("px",""),10),r=t.text().length;return e.utils.NaNtoZero(r*n*.5)}return 0},e.utils.NaNtoZero=function(t){return!e.utils.isNumber(t)||isNaN(t)||null===t||t===1/0||t===-1/0?0:t},d3.selection.prototype.watchTransition=function(t){var e=[this].concat([].slice.call(arguments,1));return t.transition.apply(t,e)},e.utils.renderWatch=function(t,n){if(!(this instanceof e.utils.renderWatch))return new e.utils.renderWatch(t,n);var r=void 0!==n?n:250,i=[],a=this;this.models=function(t){return(t=[].slice.call(arguments,0)).forEach((function(t){var e;t.__rendered=!1,(e=t).dispatch.on("renderEnd",(function(t){e.__rendered=!0,a.renderEnd("model")})),i.indexOf(t)<0&&i.push(t)})),this},this.reset=function(t){void 0!==t&&(r=t),i=[]},this.transition=function(t,e,n){if(n=(e=arguments.length>1?[].slice.call(arguments,1):[]).length>1?e.pop():void 0!==r?r:250,t.__rendered=!1,i.indexOf(t)<0&&i.push(t),0===n)return t.__rendered=!0,t.delay=function(){return this},t.duration=function(){return this},t;0===t.length||t.every((function(t){return!t.length}))?t.__rendered=!0:t.__rendered=!1;var o=0;return t.transition().duration(n).each((function(){++o})).each("end",(function(n,r){0==--o&&(t.__rendered=!0,a.renderEnd.apply(this,e))}))},this.renderEnd=function(){i.every((function(t){return t.__rendered}))&&(i.forEach((function(t){t.__rendered=!1})),t.renderEnd.apply(this,arguments))}},e.utils.deepExtend=function(t){var n=arguments.length>1?[].slice.call(arguments,1):[];n.forEach((function(n){for(var r in n){var i=e.utils.isArray(t[r]),a=e.utils.isObject(t[r]),o=e.utils.isObject(n[r]);a&&!i&&o?e.utils.deepExtend(t[r],n[r]):t[r]=n[r]}}))},e.utils.state=function(){if(!(this instanceof e.utils.state))return new e.utils.state;var t={},n=function(){},r=function(){return{}},i=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(t){i=i||{},e.utils.deepExtend(i,t)};var a=function(){var e=r();if(JSON.stringify(e)===JSON.stringify(t))return!1;for(var n in e)void 0===t[n]&&(t[n]={}),t[n]=e[n];return!0};this.update=function(){i&&(n(i,!1),i=null),a.call(this)&&this.dispatch.change(t)}},e.utils.optionsFunc=function(t){return t&&d3.map(t).forEach(function(t,n){e.utils.isFunction(this[t])&&this[t](n)}.bind(this)),this},e.utils.calcTicksX=function(t,n){for(var r=1,i=0;i<n.length;i+=1){var a=n[i]&&n[i].values?n[i].values.length:0;r=a>r?a:r}return e.log("Requested number of ticks: ",t),e.log("Calculated max values to be: ",r),t=(t=t>r?t=r-1:t)<1?1:t,t=Math.floor(t),e.log("Calculating tick count as: ",t),t},e.utils.calcTicksY=function(t,n){return e.utils.calcTicksX(t,n)},e.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]})},e.utils.initOptions=function(t){t._overrides=t._overrides||{};var n=Object.getOwnPropertyNames(t._options||{}),r=Object.getOwnPropertyNames(t._calls||{});for(var i in n=n.concat(r))e.utils.initOption(t,n[i])},e.utils.inheritOptionsD3=function(t,e,n){t._d3options=n.concat(t._d3options||[]),t._d3options=(t._d3options||[]).filter((function(t,e,n){return n.indexOf(t)===e})),n.unshift(e),n.unshift(t),d3.rebind.apply(this,n)},e.utils.arrayUnique=function(t){return t.sort().filter((function(e,n){return!n||e!=t[n-1]}))},e.utils.symbolMap=d3.map(),e.utils.symbol=function(){var t,n=64;function r(r,i){var a=t.call(this,r,i),o=n.call(this,r,i);return-1!==d3.svg.symbolTypes.indexOf(a)?d3.svg.symbol().type(a).size(o)():e.utils.symbolMap.get(a)(o)}return r.type=function(e){return arguments.length?(t=d3.functor(e),r):t},r.size=function(t){return arguments.length?(n=d3.functor(t),r):n},r},e.utils.inheritOptions=function(t,n){var r=Object.getOwnPropertyNames(n._options||{}),i=Object.getOwnPropertyNames(n._calls||{}),a=n._inherited||[],o=n._d3options||[],s=r.concat(i).concat(a).concat(o);s.unshift(n),s.unshift(t),d3.rebind.apply(this,s),t._inherited=e.utils.arrayUnique(r.concat(i).concat(a).concat(r).concat(t._inherited||[])),t._d3options=e.utils.arrayUnique(o.concat(t._d3options||[]))},e.utils.initSVG=function(t){t.classed({"nvd3-svg":!0})},e.utils.sanitizeHeight=function(t,e){return t||parseInt(e.style("height"),10)||400},e.utils.sanitizeWidth=function(t,e){return t||parseInt(e.style("width"),10)||960},e.utils.availableHeight=function(t,n,r){return Math.max(0,e.utils.sanitizeHeight(t,n)-r.top-r.bottom)},e.utils.availableWidth=function(t,n,r){return Math.max(0,e.utils.sanitizeWidth(t,n)-r.left-r.right)},e.utils.noData=function(t,n){var r=t.options(),i=r.margin(),a=r.noData(),o=null==a?["No Data Available."]:[a],s=e.utils.availableHeight(null,n,i),l=e.utils.availableWidth(null,n,i),u=i.left+l/2,c=i.top+s/2;n.selectAll("g").remove();var d=n.selectAll(".nv-noData").data(o);d.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),d.attr("x",u).attr("y",c).text((function(t){return t}))},e.utils.wrapTicks=function(t,e){t.each((function(){for(var t,n=d3.select(this),r=n.text().split(/\s+/).reverse(),i=[],a=0,o=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",o).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",o).attr("dy",1.1*++a+s+"em").text(t))}))},e.utils.arrayEquals=function(t,n){if(t===n)return!0;if(!t||!n)return!1;if(t.length!=n.length)return!1;for(var r=0,i=t.length;r<i;r++)if(t[r]instanceof Array&&n[r]instanceof Array){if(!e.arrayEquals(t[r],n[r]))return!1}else if(t[r]!=n[r])return!1;return!0},e.utils.pointIsInArc=function(t,e,n){var r=n.innerRadius()(e),i=n.outerRadius()(e),a=n.startAngle()(e),o=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&&a<=l&&l<=o},e.models.axis=function(){"use strict";var t,n,r=d3.svg.axis(),i=d3.scale.linear(),a={top:0,right:0,bottom:0,left:0},o=75,s=60,l=null,u=!0,c=0,d=!0,f=!1,p=!1,h=null,g=0,v=void 0,m=250,y=d3.dispatch("renderEnd");r.scale(i).orient("bottom").tickFormat((function(t){return t}));var x=e.utils.renderWatch(y,m);function b(s){return x.reset(),s.each((function(s){var m=d3.select(this);e.utils.initSVG(m);var y=m.selectAll("g.nv-wrap.nv-axis").data([s]),b=(y.enter().append("g").attr("class","nvd3 nv-wrap nv-axis").append("g"),y.select("g"));null!==h?r.ticks(h):"top"!=r.orient()&&"bottom"!=r.orient()||r.ticks(Math.abs(i.range()[1]-i.range()[0])/100),b.watchTransition(x,"axis").call(r),n=n||r.scale();var k=r.tickFormat();null==k&&(k=n.tickFormat());var w,M,A,C=b.selectAll("text.nv-axislabel").data([l||null]);switch(C.exit().remove(),void 0!==v&&b.selectAll("g").select("text").style("font-size",v),r.orient()){case"top":C.enter().append("text").attr("class","nv-axislabel"),A=0,1===i.range().length?A=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?A=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(A=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",0).attr("x",A/2),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")})).append("text"),M.exit().remove(),M.attr("transform",(function(t,n){return"translate("+e.utils.NaNtoZero(i(t))+",0)"})).select("text").attr("dy","-0.5em").attr("y",-r.tickPadding()).attr("text-anchor","middle").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),M.watchTransition(x,"min-max top").attr("transform",(function(t,n){return"translate("+e.utils.NaNtoZero(i.range()[n])+",0)"})));break;case"bottom":w=g+36;var S=30,D=0,E=b.selectAll("g").select("text"),F="";if(c%360){E.attr("transform",""),E.each((function(t,e){var n=this.getBoundingClientRect(),r=n.width;D=n.height,r>S&&(S=r)})),F="rotate("+c+" 0,"+(D/2+r.tickPadding())+")";var W=Math.abs(Math.sin(c*Math.PI/180));w=(W?W*S:S)+30,E.attr("transform",F).style("text-anchor",c%360>0?"start":"end")}else f?E.attr("transform",(function(t,e){return"translate(0,"+(e%2==0?"0":"12")+")"})):E.attr("transform","translate(0,0)");C.enter().append("text").attr("class","nv-axislabel"),A=0,1===i.range().length?A=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?A=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(A=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",w).attr("x",A/2),u&&((M=y.selectAll("g.nv-axisMaxMin").data([i.domain()[0],i.domain()[i.domain().length-1]])).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")})).append("text"),M.exit().remove(),M.attr("transform",(function(t,n){return"translate("+e.utils.NaNtoZero(i(t)+(p?i.rangeBand()/2:0))+",0)"})).select("text").attr("dy",".71em").attr("y",r.tickPadding()).attr("transform",F).style("text-anchor",c?c%360>0?"start":"end":"middle").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),M.watchTransition(x,"min-max bottom").attr("transform",(function(t,n){return"translate("+e.utils.NaNtoZero(i(t)+(p?i.rangeBand()/2:0))+",0)"})));break;case"right":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"begin").attr("transform",d?"rotate(90)":"").attr("y",d?12-Math.max(a.right,o)-(g||0):-10).attr("x",d?d3.max(i.range())/2:r.tickPadding()),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")})).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",(function(t,n){return"translate(0,"+e.utils.NaNtoZero(i(t))+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",r.tickPadding()).style("text-anchor","start").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),M.watchTransition(x,"min-max right").attr("transform",(function(t,n){return"translate(0,"+e.utils.NaNtoZero(i.range()[n])+")"})).select("text").style("opacity",1));break;case"left":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"end").attr("transform",d?"rotate(-90)":"").attr("y",d?25-Math.max(a.left,o)-(g||0):-10).attr("x",d?-d3.max(i.range())/2:-r.tickPadding()),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",(function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")})).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",(function(t,r){return"translate(0,"+e.utils.NaNtoZero(n(t))+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",-r.tickPadding()).attr("text-anchor","end").text((function(e,n){var r=(t||k)(e);return(""+r).match("NaN")?"":r})),M.watchTransition(x,"min-max right").attr("transform",(function(t,n){return"translate(0,"+e.utils.NaNtoZero(i.range()[n])+")"})).select("text").style("opacity",1))}if(C.text((function(t){return t})),!u||"left"!==r.orient()&&"right"!==r.orient()||(b.selectAll("g").each((function(t,e){d3.select(this).select("text").attr("opacity",1),(i(t)<i.range()[1]+10||i(t)>i.range()[0]-10)&&((t>1e-10||t<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))})),i.domain()[0]==i.domain()[1]&&0==i.domain()[0]&&y.selectAll("g.nv-axisMaxMin").style("opacity",(function(t,e){return e?0:1}))),u&&("top"===r.orient()||"bottom"===r.orient())){var O=[];y.selectAll("g.nv-axisMaxMin").each((function(t,e){try{e?O.push(i(t)-this.getBoundingClientRect().width-4):O.push(i(t)+this.getBoundingClientRect().width+4)}catch(n){e?O.push(i(t)-4):O.push(i(t)+4)}})),b.selectAll("g").each((function(t,e){(i(t)<O[0]||i(t)>O[1])&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())}))}b.selectAll(".tick").filter((function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t})).classed("zero",!0),n=i.copy()})),x.renderEnd("axis immediate"),b}return b.axis=r,b.dispatch=y,b.options=e.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return g},set:function(t){g=t}},staggerLabels:{get:function(){return f},set:function(t){f=t}},rotateLabels:{get:function(){return c},set:function(t){c=t}},rotateYLabel:{get:function(){return d},set:function(t){d=t}},showMaxMin:{get:function(){return u},set:function(t){u=t}},axisLabel:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return s},set:function(t){s=t}},ticks:{get:function(){return h},set:function(t){h=t}},width:{get:function(){return o},set:function(t){o=t}},fontSize:{get:function(){return v},set:function(t){v=t}},tickFormatMaxMin:{get:function(){return t},set:function(e){t=e}},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 m},set:function(t){m=t,x.reset(m)}},scale:{get:function(){return i},set:function(t){i=t,r.scale(i),p="function"==typeof i.rangeBands,e.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"])}}}),e.utils.initOptions(b),e.utils.inheritOptionsD3(b,r,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),e.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"]),b},e.models.boxPlot=function(){"use strict";var t,n,r,i,a,o,s={top:0,right:0,bottom:0,left:0},l=960,u=500,c=Math.floor(1e4*Math.random()),d=d3.scale.ordinal(),f=d3.scale.linear(),p=function(t){return t.label},h=function(t){return t.values.Q1},g=function(t){return t.values.Q2},v=function(t){return t.values.Q3},m=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},k=function(t,e,n){return t},w=function(t,e,n){return t},M=function(t,e,n){},A=e.utils.defaultColor(),C=null,S=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),D=250,E=null,F=e.utils.renderWatch(S,D);function W(c){return F.reset(),c.each((function(c){var W=l-s.left-s.right,O=u-s.top-s.bottom;C=d3.select(this),e.utils.initSVG(C),d.domain(t||c.map((function(t,e){return p(t,e)}))).rangeBands(n||[0,W],.1);var N=[];if(!r){var L=[];c.forEach((function(t,e){var n=h(t),r=v(t),i=m(t),a=y(t),o=b(t);o&&o.forEach((function(t,e){L.push(k(t,e,void 0))})),i&&L.push(i),n&&L.push(n),r&&L.push(r),a&&L.push(a)})),N=[d3.min(L),d3.max(L)]}f.domain(r||N),f.range(i||[O,0]),a=a||d,o=o||f.copy().range([f(0),f(0)]);var _=C.selectAll("g.nv-wrap").data([c]);_.enter().append("g").attr("class","nvd3 nv-wrap"),_.attr("transform","translate("+s.left+","+s.top+")");var B=_.selectAll(".nv-boxplot").data((function(t){return t})),T=B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);B.attr("class","nv-boxplot").attr("transform",(function(t,e,n){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"})).classed("hover",(function(t){return t.hover})),B.watchTransition(F,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay((function(t,e){return e*D/c.length})).attr("transform",(function(t,e){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"})),B.exit().remove(),T.each((function(t,e){var n=d3.select(this);[m,y].forEach((function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===m?"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 P=function(){return null===E?.9*d.rangeBand():Math.min(75,.9*d.rangeBand())},I=function(){return.45*d.rangeBand()-P()/2},H=function(){return.45*d.rangeBand()+P()/2};[m,y].forEach((function(t){var e=t===m?"low":"high",n=t===m?h:v;B.select("line.nv-boxplot-whisker.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",.45*d.rangeBand()).attr("y1",(function(e,n){return f(t(e))})).attr("x2",.45*d.rangeBand()).attr("y2",(function(t,e){return f(n(t))})),B.select("line.nv-boxplot-tick.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",I).attr("y1",(function(e,n){return f(t(e))})).attr("x2",H).attr("y2",(function(e,n){return f(t(e))}))})),[m,y].forEach((function(t){var e=t===m?"low":"high";T.selectAll(".nv-boxplot-"+e).on("mouseover",(function(e,n,r){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:t(e),color:x(e)||A(e,r)},e:d3.event})})).on("mouseout",(function(e,n,r){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:t(e),color:x(e)||A(e,r)},e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})}))})),T.append("rect").attr("class","nv-boxplot-box").on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),S.elementMouseover({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,e)},{key:"Q2",value:g(t),color:x(t)||A(t,e)},{key:"Q1",value:h(t),color:x(t)||A(t,e)}],data:t,index:e,e:d3.event})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),S.elementMouseout({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,e)},{key:"Q2",value:g(t),color:x(t)||A(t,e)},{key:"Q1",value:h(t),color:x(t)||A(t,e)}],data:t,index:e,e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})})),B.select("rect.nv-boxplot-box").watchTransition(F,"nv-boxplot: boxes").attr("y",(function(t,e){return f(v(t))})).attr("width",P).attr("x",I).attr("height",(function(t,e){return Math.abs(f(v(t))-f(h(t)))||1})).style("fill",(function(t,e){return x(t)||A(t,e)})).style("stroke",(function(t,e){return x(t)||A(t,e)})),T.append("line").attr("class","nv-boxplot-median"),B.select("line.nv-boxplot-median").watchTransition(F,"nv-boxplot: boxplots line").attr("x1",I).attr("y1",(function(t,e){return f(g(t))})).attr("x2",H).attr("y2",(function(t,e){return f(g(t))}));var V=B.selectAll(".nv-boxplot-outlier").data((function(t){return b(t)||[]}));V.enter().append("circle").style("fill",(function(t,e,n){return M(t,e,n)||A(t,n)})).style("stroke",(function(t,e,n){return M(t,e,n)||A(t,n)})).style("z-index",9e3).on("mouseover",(function(t,e,n){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:w(t,e,n),color:M(t,e,n)||A(t,n)},e:d3.event})})).on("mouseout",(function(t,e,n){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:w(t,e,n),color:M(t,e,n)||A(t,n)},e:d3.event})})).on("mousemove",(function(t,e){S.elementMousemove({e:d3.event})})),V.attr("class","nv-boxplot-outlier"),V.watchTransition(F,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*d.rangeBand()).attr("cy",(function(t,e,n){return f(k(t,e,n))})).attr("r","3"),V.exit().remove(),a=d.copy(),o=f.copy()})),F.renderEnd("nv-boxplot immediate"),W}return W.dispatch=S,W.options=e.utils.optionsFunc.bind(W),W._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 E},set:function(t){E=t}},x:{get:function(){return p},set:function(t){p=t}},q1:{get:function(){return h},set:function(t){h=t}},q2:{get:function(){return g},set:function(t){g=t}},q3:{get:function(){return v},set:function(t){v=t}},wl:{get:function(){return m},set:function(t){m=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 k},set:function(t){k=t}},outlierLabel:{get:function(){return w},set:function(t){w=t}},outlierColor:{get:function(){return M},set:function(t){M=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return t},set:function(e){t=e}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=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(t){A=e.utils.getColor(t)}},duration:{get:function(){return D},set:function(t){D=t,F.reset(D)}}}),e.utils.initOptions(W),W},e.models.boxPlotChart=function(){"use strict";var t,n,r=e.models.boxPlot(),i=e.models.axis(),a=e.models.axis(),o={top:15,right:10,bottom:50,left:60},s=null,l=null,u=e.utils.getColor(),c=!0,d=!0,f=!1,p=!1,h=e.models.tooltip(),g="No Data Available.",v=d3.dispatch("beforeUpdate","renderEnd"),m=250;i.orient("bottom").showMaxMin(!1).tickFormat((function(t){return t})),a.orient(f?"right":"left").tickFormat(d3.format(",.1f")),h.duration(0);var y=e.utils.renderWatch(v,m);function x(u){return y.reset(),y.models(r),c&&y.models(i),d&&y.models(a),u.each((function(u){var h=d3.select(this);e.utils.initSVG(h);var y=(s||parseInt(h.style("width"))||960)-o.left-o.right,b=(l||parseInt(h.style("height"))||400)-o.top-o.bottom;if(x.update=function(){v.beforeUpdate(),h.transition().duration(m).call(x)},x.container=this,!u||!u.length){var k=h.selectAll(".nv-noData").data([g]);return k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",o.left+y/2).attr("y",o.top+b/2).text((function(t){return t})),x}h.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale().clamp(!0);var w=h.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]),M=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),A=M.append("defs"),C=w.select("g");if(M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),M.append("g").attr("class","nv-barsWrap"),C.attr("transform","translate("+o.left+","+o.top+")"),f&&C.select(".nv-y.nv-axis").attr("transform","translate("+y+",0)"),r.width(y).height(b),C.select(".nv-barsWrap").datum(u.filter((function(t){return!t.disabled}))).transition().call(r),A.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect"),C.select("#nv-x-label-clip-"+r.id()+" rect").attr("width",t.rangeBand()*(p?2:1)).attr("height",16).attr("x",-t.rangeBand()/(p?1:2)),c){i.scale(t).ticks(e.utils.calcTicksX(y/100,u)).tickSize(-b,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),C.select(".nv-x.nv-axis").call(i);var S=C.select(".nv-x.nv-axis").selectAll("g");p&&S.selectAll("text").attr("transform",(function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}))}d&&(a.scale(n).ticks(Math.floor(b/36)).tickSize(-y,0),C.select(".nv-y.nv-axis").call(a)),C.select(".nv-zeroLine line").attr("x1",0).attr("x2",y).attr("y1",n(0)).attr("y2",n(0))})),y.renderEnd("nv-boxplot chart immediate"),x}return r.dispatch.on("elementMouseover.tooltip",(function(t){h.data(t).hidden(!1)})),r.dispatch.on("elementMouseout.tooltip",(function(t){h.data(t).hidden(!0)})),r.dispatch.on("elementMousemove.tooltip",(function(t){h()})),x.dispatch=v,x.boxplot=r,x.xAxis=i,x.yAxis=a,x.tooltip=h,x.options=e.utils.optionsFunc.bind(x),x._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 p},set:function(t){p=t}},showXAxis:{get:function(){return c},set:function(t){c=t}},showYAxis:{get:function(){return d},set:function(t){d=t}},tooltipContent:{get:function(){return h},set:function(t){h=t}},noData:{get:function(){return g},set:function(t){g=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}},duration:{get:function(){return m},set:function(t){m=t,y.reset(m),r.duration(m),i.duration(m),a.duration(m)}},color:{get:function(){return u},set:function(t){u=e.utils.getColor(t),r.color(u)}},rightAlignYAxis:{get:function(){return f},set:function(t){f=t,a.orient(t?"right":"left")}}}),e.utils.inheritOptions(x,r),e.utils.initOptions(x),x},e.models.bullet=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},n="left",r=!1,i=function(t){return t.ranges},a=function(t){return t.markers?t.markers:[]},o=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:[]},d=function(t){return t.measureLabels?t.measureLabels:[]},f=[0],p=380,h=30,g=null,v=null,m=e.utils.getColor(["#1f77b4"]),y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),x=["Maximum","Mean","Minimum"],b=["Max","Avg","Min"],k=1e3;function w(t,e){var n=t.slice();t.sort((function(t,r){var i=n.indexOf(t),a=n.indexOf(r);return d3.descending(e[i],e[a])}))}function M(n){return n.each((function(n,v){var M=p-t.left-t.right,A=h-t.top-t.bottom;g=d3.select(this),e.utils.initSVG(g);var C=i.call(this,n,v).slice(),S=a.call(this,n,v).slice(),D=o.call(this,n,v).slice(),E=s.call(this,n,v).slice(),F=l.call(this,n,v).slice(),W=u.call(this,n,v).slice(),O=c.call(this,n,v).slice(),N=d.call(this,n,v).slice();w(F,C),w(W,S),w(O,D),w(N,E),C.sort(d3.descending),S.sort(d3.descending),D.sort(d3.descending),E.sort(d3.descending);var L=d3.scale.linear().domain(d3.extent(d3.merge([f,C]))).range(r?[M,0]:[0,M]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(L.range()),this.__chart__=L,d3.min(C),d3.max(C),C[1];for(var _=g.selectAll("g.nv-wrap.nv-bullet").data([n]),B=_.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),T=_.select("g"),P=(v=0,C.length);v<P;v++){var I="nv-range nv-range"+v;v<=2&&(I=I+" nv-range"+b[v]),B.append("rect").attr("class",I)}B.append("rect").attr("class","nv-measure"),_.attr("transform","translate("+t.left+","+t.top+")");var H=function(t){return Math.abs(L(t)-L(0))},V=function(t){return L(t<0?t:0)};for(v=0,P=C.length;v<P;v++){var z=C[v];T.select("rect.nv-range"+v).datum(z).attr("height",A).transition().duration(k).attr("width",H(z)).attr("x",V(z))}T.select("rect.nv-measure").style("fill",m).attr("height",A/3).attr("y",A/3).on("mouseover",(function(){y.elementMouseover({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).on("mousemove",(function(){y.elementMousemove({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).on("mouseout",(function(){y.elementMouseout({value:E[0],label:N[0]||"Current",color:d3.select(this).style("fill")})})).transition().duration(k).attr("width",E<0?L(0)-L(E[0]):L(E[0])-L(0)).attr("x",V(E));var R=A/6,Y=S.map((function(t,e){return{value:t,label:W[e]}}));B.selectAll("path.nv-markerTriangle").data(Y).enter().append("path").attr("class","nv-markerTriangle").attr("d","M0,"+R+"L"+R+","+-R+" "+-R+","+-R+"Z").on("mouseover",(function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[L(t.value),A/2]})})).on("mousemove",(function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})),T.selectAll("path.nv-markerTriangle").data(Y).transition().duration(k).attr("transform",(function(t){return"translate("+L(t.value)+","+A/2+")"}));var j=D.map((function(t,e){return{value:t,label:O[e]}}));B.selectAll("line.nv-markerLine").data(j).enter().append("line").attr("cursor","").attr("class","nv-markerLine").attr("x1",(function(t){return L(t.value)})).attr("y1","2").attr("x2",(function(t){return L(t.value)})).attr("y2",A-2).on("mouseover",(function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[L(t.value),A/2]})})).on("mousemove",(function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})})),T.selectAll("line.nv-markerLine").data(j).transition().duration(k).attr("x1",(function(t){return L(t.value)})).attr("x2",(function(t){return L(t.value)})),_.selectAll(".nv-range").on("mouseover",(function(t,e){var n=F[e]||x[e];y.elementMouseover({value:t,label:n,color:d3.select(this).style("fill")})})).on("mousemove",(function(){y.elementMousemove({value:E[0],label:N[0]||"Previous",color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){var n=F[e]||x[e];y.elementMouseout({value:t,label:n,color:d3.select(this).style("fill")})}))})),M}return M.dispatch=y,M.options=e.utils.optionsFunc.bind(M),M._options=Object.create({},{ranges:{get:function(){return i},set:function(t){i=t}},markers:{get:function(){return a},set:function(t){a=t}},measures:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return f},set:function(t){f=t}},width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},tickFormat:{get:function(){return v},set:function(t){v=t}},duration:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},orient:{get:function(){return n},set:function(t){r="right"==(n=t)||"bottom"==n}},color:{get:function(){return m},set:function(t){m=e.utils.getColor(t)}}}),e.utils.initOptions(M),M},e.models.bulletChart=function(){"use strict";var t=e.models.bullet(),n=e.models.tooltip(),r="left",i=!1,a={top:5,right:40,bottom:20,left:120},o=function(t){return t.ranges},s=function(t){return t.markers?t.markers:[]},l=function(t){return t.measures},u=null,c=55,d=null,f=null,p=null,h=d3.dispatch();function g(n){return n.each((function(r,p){var h=d3.select(this);e.utils.initSVG(h);var v=e.utils.availableWidth(u,h,a),m=c-a.top-a.bottom;if(g.update=function(){g(n)},g.container=this,!r||!o.call(this,r,p))return e.utils.noData(g,h),g;h.selectAll(".nv-noData").remove();var y=o.call(this,r,p).slice().sort(d3.descending),x=s.call(this,r,p).slice().sort(d3.descending),b=l.call(this,r,p).slice().sort(d3.descending),k=h.selectAll("g.nv-wrap.nv-bulletChart").data([r]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart").append("g"),M=k.select("g");w.append("g").attr("class","nv-bulletWrap"),w.append("g").attr("class","nv-titles"),k.attr("transform","translate("+a.left+","+a.top+")");var A=d3.scale.linear().domain([0,Math.max(y[0],x[0]||0,b[0])]).range(i?[v,0]:[0,v]),C=this.__chart__||d3.scale.linear().domain([0,1/0]).range(A.range());this.__chart__=A;var S=w.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(c-a.top-a.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})),t.width(v).height(m);var D=M.select(".nv-bulletWrap");d3.transition(D).call(t);var E=d||A.tickFormat(v/100),F=M.selectAll("g.nv-tick").data(A.ticks(f||v/50),(function(t){return this.textContent||E(t)})),W=F.enter().append("g").attr("class","nv-tick").attr("transform",(function(t){return"translate("+C(t)+",0)"})).style("opacity",1e-6);W.append("line").attr("y1",m).attr("y2",7*m/6),W.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*m/6).text(E);var O=d3.transition(F).transition().duration(t.duration()).attr("transform",(function(t){return"translate("+A(t)+",0)"})).style("opacity",1);O.select("line").attr("y1",m).attr("y2",7*m/6),O.select("text").attr("y",7*m/6),d3.transition(F.exit()).transition().duration(t.duration()).attr("transform",(function(t){return"translate("+A(t)+",0)"})).style("opacity",1e-6).remove()})),d3.timer.flush(),g}return n.duration(0).headerEnabled(!1),t.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:t.label,value:t.value,color:t.color},n.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){n.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){n()})),g.bullet=t,g.dispatch=h,g.tooltip=n,g.options=e.utils.optionsFunc.bind(g),g._options=Object.create({},{ranges:{get:function(){return o},set:function(t){o=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 d},set:function(t){d=t}},ticks:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return p},set:function(t){p=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}},orient:{get:function(){return r},set:function(t){i="right"==(r=t)||"bottom"==r}}}),e.utils.inheritOptions(g,t),e.utils.initOptions(g),g},e.models.candlestickBar=function(){"use strict";var t,n,r,i,a,o={top:0,right:0,bottom:0,left:0},s=null,l=null,u=Math.floor(1e4*Math.random()),c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=function(t){return t.open},g=function(t){return t.close},v=function(t){return t.high},m=function(t){return t.low},y=[],x=[],b=!1,k=!0,w=e.utils.defaultColor(),M=!1,A=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(w){return w.each((function(w){t=d3.select(this);var M=e.utils.availableWidth(s,t,o),C=e.utils.availableHeight(l,t,o);e.utils.initSVG(t);var S=M/w[0].values.length*.45;c.domain(n||d3.extent(w[0].values.map(f).concat(y))),b?c.range(i||[.5*M/w[0].values.length,M*(w[0].values.length-.5)/w[0].values.length]):c.range(i||[5+S/2,M-S/2-5]),d.domain(r||[d3.min(w[0].values.map(m).concat(x)),d3.max(w[0].values.map(v).concat(x))]).range(a||[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])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var D=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([w[0].values]),E=D.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar"),F=E.append("defs"),W=E.append("g"),O=D.select("g");W.append("g").attr("class","nv-ticks"),D.attr("transform","translate("+o.left+","+o.top+")"),t.on("click",(function(t,e){A.chartClick({data:t,index:e,pos:d3.event,id:u})})),F.append("clipPath").attr("id","nv-chart-clip-path-"+u).append("rect"),D.select("#nv-chart-clip-path-"+u+" rect").attr("width",M).attr("height",C),O.attr("clip-path",k?"url(#nv-chart-clip-path-"+u+")":"");var N=D.select(".nv-ticks").selectAll(".nv-tick").data((function(t){return t}));N.exit().remove();var L=N.enter().append("g");N.attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})),L.append("line").attr("class","nv-candlestick-lines").attr("transform",(function(t,e){return"translate("+c(f(t,e))+",0)"})).attr("x1",0).attr("y1",(function(t,e){return d(v(t,e))})).attr("x2",0).attr("y2",(function(t,e){return d(m(t,e))})),L.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",(function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"})).attr("x",0).attr("y",0).attr("width",S).attr("height",(function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)})),N.select(".nv-candlestick-lines").transition().attr("transform",(function(t,e){return"translate("+c(f(t,e))+",0)"})).attr("x1",0).attr("y1",(function(t,e){return d(v(t,e))})).attr("x2",0).attr("y2",(function(t,e){return d(m(t,e))})),N.select(".nv-candlestick-rects").transition().attr("transform",(function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"})).attr("x",0).attr("y",0).attr("width",S).attr("height",(function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)}))})),C}return C.highlightPoint=function(e,n){C.clearHighlights(),t.select(".nv-candlestickBar .nv-tick-0-"+e).classed("hover",n)},C.clearHighlights=function(){t.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=e.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 d},set:function(t){d=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 a},set:function(t){a=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 k},set:function(t){k=t}},id:{get:function(){return u},set:function(t){u=t}},interactive:{get:function(){return M},set:function(t){M=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=null!=t.top?t.top:o.top,o.right=null!=t.right?t.right:o.right,o.bottom=null!=t.bottom?t.bottom:o.bottom,o.left=null!=t.left?t.left:o.left}},color:{get:function(){return w},set:function(t){w=e.utils.getColor(t)}}}),e.utils.initOptions(C),C},e.models.cumulativeLineChart=function(){"use strict";var t,n,r=e.models.line(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend(),s=e.models.legend(),l=e.interactiveGuideline(),u=e.models.tooltip(),c={top:30,right:30,bottom:50,left:60},d=null,f=e.utils.defaultColor(),p=null,h=null,g=!0,v=!0,m=!0,y=!1,x=!0,b=!1,k=!0,w=r.id(),M=e.utils.state(),A=null,C=null,S=function(t){return t.average},D=d3.dispatch("stateChange","changeState","renderEnd"),E=250,F=!1;M.index=0,M.rescaleY=k,i.orient("bottom").tickPadding(7),a.orient(y?"right":"left"),u.valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.updateState(!1);var W,O=d3.scale.linear(),N={i:0,x:0},L=e.utils.renderWatch(D,E);function _(u){return L.reset(),L.models(r),v&&L.models(i),m&&L.models(a),u.each((function(u){var C=d3.select(this);e.utils.initSVG(C),C.classed("nv-chart-"+w,!0);var L,P=e.utils.availableWidth(p,C,c),I=e.utils.availableHeight(h,C,c);if(_.update=function(){0===E?C.call(_):C.transition().duration(E).call(_)},_.container=this,M.setter(function(t){return function(e){void 0!==e.index&&(N.i=e.index),void 0!==e.rescaleY&&(k=e.rescaleY),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(u),_.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),index:N.i,rescaleY:k}}}(u)).update(),M.disabled=u.map((function(t){return!!t.disabled})),!A)for(L in A={},M)M[L]instanceof Array?A[L]=M[L].slice(0):A[L]=M[L];var H=d3.behavior.drag().on("dragstart",(function(t,e){d3.select(_.container).style("cursor","ew-resize")})).on("drag",(function(t,e){N.x=d3.event.x,N.i=Math.round(O.invert(N.x)),$()})).on("dragend",(function(t,e){d3.select(_.container).style("cursor","auto"),M.index=N.i,D.stateChange(M)}));if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return e.utils.noData(_,C),_;C.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale(),O.domain([0,u[0].values.length-1]).range([0,P]).clamp(!0),u=function(t,e){return B||(B=r.y()),e.map((function(e,n){if(!e.values)return e;var r=e.values[t];if(null==r)return e;var i=B(r,t);return Math.abs(i)<1e-5&&!F?(e.tempDisabled=!0,e):(e.tempDisabled=!1,e.values=e.values.map((function(t,e){return t.display={y:(B(t,e)-i)/i},t})),e)}))}(N.i,u),void 0===W&&(W=T(u)),k?r.yDomain(null):(r.yDomain(W),r.clipEdge(!0));var V=b?"none":"all",z=C.selectAll("g.nv-wrap.nv-cumulativeLine").data([u]),R=z.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),Y=z.select("g");if(R.append("g").attr("class","nv-interactive"),R.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),R.append("g").attr("class","nv-y nv-axis"),R.append("g").attr("class","nv-background"),R.append("g").attr("class","nv-linesWrap").style("pointer-events",V),R.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),R.append("g").attr("class","nv-legendWrap"),R.append("g").attr("class","nv-controlsWrap"),g?(o.width(P),Y.select(".nv-legendWrap").datum(u).call(o),d||o.height()===c.top||(c.top=o.height(),I=e.utils.availableHeight(h,C,c)),Y.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):Y.select(".nv-legendWrap").selectAll("*").remove(),x){var j=[{key:"Re-scale y-axis",disabled:!k}];s.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),Y.select(".nv-controlsWrap").datum(j).attr("transform","translate(0,"+-c.top+")").call(s)}else Y.select(".nv-controlsWrap").selectAll("*").remove();z.attr("transform","translate("+c.left+","+c.top+")"),y&&Y.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)");var G=u.filter((function(t){return t.tempDisabled}));z.select(".tempDisabled").remove(),G.length&&z.append("text").attr("class","tempDisabled").attr("x",P/2).attr("y","-.71em").style("text-anchor","end").text(G.map((function(t){return t.key})).join(", ")+" values cannot be calculated for this time period."),b&&(l.width(P).height(I).margin({left:c.left,top:c.top}).svgContainer(C).xScale(t),z.select(".nv-interactive").call(l)),R.select(".nv-background").append("rect"),Y.select(".nv-background rect").attr("width",P).attr("height",I),r.y((function(t){return t.display.y})).width(P).height(I).color(u.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!u[e].disabled&&!u[e].tempDisabled})));var X=Y.select(".nv-linesWrap").datum(u.filter((function(t){return!t.disabled&&!t.tempDisabled})));X.call(r),u.forEach((function(t,e){t.seriesIndex=e}));var Z=u.filter((function(t){return!t.disabled&&!!S(t)})),U=Y.select(".nv-avgLinesWrap").selectAll("line").data(Z,(function(t){return t.key})),q=function(t){var e=n(S(t));return e<0?0:e>I?I:e};U.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",P).attr("y1",q).attr("y2",q),U.style("stroke-opacity",(function(t){var e=n(S(t));return e<0||e>I?0:1})).attr("x1",0).attr("x2",P).attr("y1",q).attr("y2",q),U.exit().remove();var K=X.selectAll(".nv-indexLine").data([N]);function $(){K.data([N]);var t=_.duration();_.duration(0),_.update(),_.duration(t)}K.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(H),K.attr("transform",(function(t){return"translate("+O(t.i)+",0)"})).attr("height",I),v&&(i.scale(t)._ticks(e.utils.calcTicksX(P/70,u)).tickSize(-I,0),Y.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),Y.select(".nv-x.nv-axis").call(i)),m&&(a.scale(n)._ticks(e.utils.calcTicksY(I/36,u)).tickSize(-P,0),Y.select(".nv-y.nv-axis").call(a)),Y.select(".nv-background rect").on("click",(function(){N.x=d3.mouse(this)[0],N.i=Math.round(O.invert(N.x)),M.index=N.i,D.stateChange(M),$()})),r.dispatch.on("elementClick",(function(t){N.i=t.pointIndex,N.x=O(N.i),M.index=N.i,D.stateChange(M),$()})),s.dispatch.on("legendClick",(function(t,e){t.disabled=!t.disabled,k=!t.disabled,M.rescaleY=k,k||(W=T(u)),D.stateChange(M),_.update()})),o.dispatch.on("stateChange",(function(t){for(var e in t)M[e]=t[e];D.stateChange(M),_.update()})),l.dispatch.on("elementMousemove",(function(t){r.clearHighlights();var n,o,s,c=[];if(u.filter((function(t,e){return t.seriesIndex=e,!(t.disabled||t.tempDisabled)})).forEach((function(i,a){o=e.interactiveBisect(i.values,t.pointXValue,_.x()),r.highlightPoint(a,o,!0);var l=i.values[o];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=_.xScale()(_.x()(l,o))),c.push({key:i.key,value:_.y()(l,o),color:f(i,i.seriesIndex)}))})),c.length>2){var d=_.yScale().invert(t.mouseY),p=.03*Math.abs(_.yScale().domain()[0]-_.yScale().domain()[1]),h=e.nearestValueIndex(c.map((function(t){return t.value})),d,p);null!==h&&(c[h].highlight=!0)}var g=i.tickFormat()(_.x()(n,o),o);l.tooltip.valueFormatter((function(t,e){return a.tickFormat()(t)})).data({value:g,series:c})(),l.renderGuideLine(s)})),l.dispatch.on("elementMouseout",(function(t){r.clearHighlights()})),D.on("changeState",(function(t){void 0!==t.disabled&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),M.disabled=t.disabled),void 0!==t.index&&(N.i=t.index,N.x=O(N.i),M.index=t.index,K.data([N])),void 0!==t.rescaleY&&(k=t.rescaleY),_.update()}))})),L.renderEnd("cumulativeLineChart immediate"),_}r.dispatch.on("elementMouseover.tooltip",(function(t){var e={x:_.x()(t.point),y:_.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 T(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 _.dispatch=D,_.lines=r,_.legend=o,_.controls=s,_.xAxis=i,_.yAxis=a,_.interactiveLayer=l,_.state=M,_.tooltip=u,_.options=e.utils.optionsFunc.bind(_),_._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showControls:{get:function(){return x},set:function(t){x=t}},showLegend:{get:function(){return g},set:function(t){g=t}},average:{get:function(){return S},set:function(t){S=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return C},set:function(t){C=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},noErrorCheck:{get:function(){return F},set:function(t){F=t}},rescaleY:{get:function(){return k},set:function(t){k=t,_.state.rescaleY=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=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 f},set:function(t){f=e.utils.getColor(t),o.color(f)}},useInteractiveGuideline:{get:function(){return b},set:function(t){b=t,!0===t&&(_.interactive(!1),_.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,a.orient(t?"right":"left")}},duration:{get:function(){return E},set:function(t){E=t,r.duration(E),i.duration(E),a.duration(E),L.reset(E)}}}),e.utils.inheritOptions(_,r),e.utils.initOptions(_),_},e.models.discreteBar=function(){"use strict";var t,n,r,i,a,o,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=d3.scale.ordinal(),p=d3.scale.linear(),h=function(t){return t.x},g=function(t){return t.y},v=[0],m=e.utils.defaultColor(),y=!1,x=d3.format(",.2f"),b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),k="discreteBar",w=250,M=e.utils.renderWatch(b,w);function A(d){return M.reset(),d.each((function(d){var w=u-l.left-l.right,A=c-l.top-l.bottom;t=d3.select(this),e.utils.initSVG(t),d.forEach((function(t,e){t.values.forEach((function(t){t.series=e}))}));var C=n&&r?[]:d.map((function(t){return t.values.map((function(t,e){return{x:h(t,e),y:g(t,e),y0:t.y0}}))}));f.domain(n||d3.merge(C).map((function(t){return t.x}))).rangeBands(i||[0,w],.1),p.domain(r||d3.extent(d3.merge(C).map((function(t){return t.y})).concat(v))),y?p.range(a||[A-(p.domain()[0]<0?12:0),p.domain()[1]>0?12:0]):p.range(a||[A,0]),o=o||f,s=s||p.copy().range([p(0),p(0)]);var S=t.selectAll("g.nv-wrap.nv-discretebar").data([d]),D=S.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar").append("g");S.select("g"),D.append("g").attr("class","nv-groups"),S.attr("transform","translate("+l.left+","+l.top+")");var E=S.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));E.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),E.exit().watchTransition(M,"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(M,"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("+(f(h(t,e))+.05*f.rangeBand())+", "+p(0)+")"})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),b.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),b.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e){b.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){b.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e){b.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}));W.append("rect").attr("height",0).attr("width",.9*f.rangeBand()/d.length),y?(W.append("text").attr("text-anchor","middle"),F.select("text").text((function(t,e){return x(g(t,e))})).watchTransition(M,"discreteBar: bars text").attr("x",.9*f.rangeBand()/2).attr("y",(function(t,e){return g(t,e)<0?p(g(t,e))-p(0)+12:-4}))):F.selectAll("text").remove(),F.attr("class",(function(t,e){return g(t,e)<0?"nv-bar negative":"nv-bar positive"})).style("fill",(function(t,e){return t.color||m(t,e)})).style("stroke",(function(t,e){return t.color||m(t,e)})).select("rect").attr("class",k).watchTransition(M,"discreteBar: bars rect").attr("width",.9*f.rangeBand()/d.length),F.watchTransition(M,"discreteBar: bars").attr("transform",(function(t,e){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+(g(t,e)<0?p(0):p(0)-p(g(t,e))<1?p(0)-1:p(g(t,e)))+")"})).select("rect").attr("height",(function(t,e){return Math.max(Math.abs(p(g(t,e))-p(0)),1)})),o=f.copy(),s=p.copy()})),M.renderEnd("discreteBar immediate"),A}return A.dispatch=b,A.options=e.utils.optionsFunc.bind(A),A._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 v},set:function(t){v=t}},showValues:{get:function(){return y},set:function(t){y=t}},x:{get:function(){return h},set:function(t){h=t}},y:{get:function(){return g},set:function(t){g=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 a},set:function(t){a=t}},valueFormat:{get:function(){return x},set:function(t){x=t}},id:{get:function(){return d},set:function(t){d=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 m},set:function(t){m=e.utils.getColor(t)}},duration:{get:function(){return w},set:function(t){w=t,M.reset(w)}}}),e.utils.initOptions(A),A},e.models.discreteBarChart=function(){"use strict";var t,n,r=e.models.discreteBar(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend(),s=e.models.tooltip(),l={top:15,right:10,bottom:50,left:60},u=null,c=null,d=null,f=e.utils.getColor(),p=!1,h=!0,g=!0,v=!1,m=!1,y=!1,x=0,b=null,k=d3.dispatch("beforeUpdate","renderEnd"),w=250;i.orient("bottom").showMaxMin(!1).tickFormat((function(t){return t})),a.orient(v?"right":"left").tickFormat(d3.format(",.1f")),s.duration(0).headerEnabled(!1).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).keyFormatter((function(t,e){return i.tickFormat()(t,e)}));var M=e.utils.renderWatch(k,w);function A(s){return M.reset(),M.models(r),h&&M.models(i),g&&M.models(a),s.each((function(s){var f=d3.select(this);e.utils.initSVG(f);var b=e.utils.availableWidth(c,f,l),M=e.utils.availableHeight(d,f,l);if(A.update=function(){k.beforeUpdate(),f.transition().duration(w).call(A)},A.container=this,!(s&&s.length&&s.filter((function(t){return t.values.length})).length))return e.utils.noData(A,f),A;f.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale().clamp(!0);var C=f.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),D=S.append("defs"),E=C.select("g");if(S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),S.append("g").attr("class","nv-barsWrap"),S.append("g").attr("class","nv-legendWrap"),E.attr("transform","translate("+l.left+","+l.top+")"),p?(o.width(b),E.select(".nv-legendWrap").datum(s).call(o),u||o.height()===l.top||(l.top=o.height(),M=e.utils.availableHeight(d,f,l)),C.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")):E.select(".nv-legendWrap").selectAll("*").remove(),v&&E.select(".nv-y.nv-axis").attr("transform","translate("+b+",0)"),r.width(b).height(M),E.select(".nv-barsWrap").datum(s.filter((function(t){return!t.disabled}))).transition().call(r),D.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect"),E.select("#nv-x-label-clip-"+r.id()+" rect").attr("width",t.rangeBand()*(m?2:1)).attr("height",16).attr("x",-t.rangeBand()/(m?1:2)),h){i.scale(t)._ticks(e.utils.calcTicksX(b/100,s)).tickSize(-M,0),E.select(".nv-x.nv-axis").attr("transform","translate(0,"+(n.range()[0]+(r.showValues()&&n.domain()[0]<0?16:0))+")"),E.select(".nv-x.nv-axis").call(i);var F=E.select(".nv-x.nv-axis").selectAll("g");m&&F.selectAll("text").attr("transform",(function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})),x&&F.selectAll(".tick text").attr("transform","rotate("+x+" 0,0)").style("text-anchor",x>0?"start":"end"),y&&E.selectAll(".tick text").call(e.utils.wrapTicks,A.xAxis.rangeBand())}g&&(a.scale(n)._ticks(e.utils.calcTicksY(M/36,s)).tickSize(-b,0),E.select(".nv-y.nv-axis").call(a)),E.select(".nv-zeroLine line").attr("x1",0).attr("x2",v?-b:b).attr("y1",n(0)).attr("y2",n(0))})),M.renderEnd("discreteBar chart immediate"),A}return r.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:A.x()(t.data),value:A.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()})),A.dispatch=k,A.discretebar=r,A.legend=o,A.xAxis=i,A.yAxis=a,A.tooltip=s,A.options=e.utils.optionsFunc.bind(A),A._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},showLegend:{get:function(){return p},set:function(t){p=t}},staggerLabels:{get:function(){return m},set:function(t){m=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 h},set:function(t){h=t}},showYAxis:{get:function(){return g},set:function(t){g=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 w},set:function(t){w=t,M.reset(w),r.duration(w),i.duration(w),a.duration(w)}},color:{get:function(){return f},set:function(t){f=e.utils.getColor(t),r.color(f),o.color(f)}},rightAlignYAxis:{get:function(){return v},set:function(t){v=t,a.orient(t?"right":"left")}}}),e.utils.inheritOptions(A,r),e.utils.initOptions(A),A},e.models.distribution=function(){"use strict";var t,n={top:0,right:0,bottom:0,left:0},r=400,i=8,a="x",o=function(t){return t[a]},s=e.utils.defaultColor(),l=d3.scale.linear(),u=250,c=d3.dispatch("renderEnd"),d=e.utils.renderWatch(c,u);function f(r){return d.reset(),r.each((function(r){"x"===a?(n.left,n.right):(n.top,n.bottom);var u="x"==a?"y":"x",c=d3.select(this);e.utils.initSVG(c),t=t||l;var f=c.selectAll("g.nv-distribution").data([r]),p=(f.enter().append("g").attr("class","nvd3 nv-distribution").append("g"),f.select("g"));f.attr("transform","translate("+n.left+","+n.top+")");var h=p.selectAll("g.nv-dist").data((function(t){return t}),(function(t){return t.key}));h.enter().append("g"),h.attr("class",(function(t,e){return"nv-dist nv-series-"+e})).style("stroke",(function(t,e){return s(t,e)}));var g=h.selectAll("line.nv-dist"+a).data((function(t){return t.values}));g.enter().append("line").attr(a+"1",(function(e,n){return t(o(e,n))})).attr(a+"2",(function(e,n){return t(o(e,n))})),d.transition(h.exit().selectAll("line.nv-dist"+a),"dist exit").attr(a+"1",(function(t,e){return l(o(t,e))})).attr(a+"2",(function(t,e){return l(o(t,e))})).style("stroke-opacity",0).remove(),g.attr("class",(function(t,e){return"nv-dist"+a+" nv-dist"+a+"-"+e})).attr(u+"1",0).attr(u+"2",i),d.transition(g,"dist").attr(a+"1",(function(t,e){return l(o(t,e))})).attr(a+"2",(function(t,e){return l(o(t,e))})),t=l.copy()})),d.renderEnd("distribution immediate"),f}return f.options=e.utils.optionsFunc.bind(f),f.dispatch=c,f.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,f):n},f.width=function(t){return arguments.length?(r=t,f):r},f.axis=function(t){return arguments.length?(a=t,f):a},f.size=function(t){return arguments.length?(i=t,f):i},f.getData=function(t){return arguments.length?(o=d3.functor(t),f):o},f.scale=function(t){return arguments.length?(l=t,f):l},f.color=function(t){return arguments.length?(s=e.utils.getColor(t),f):s},f.duration=function(t){return arguments.length?(u=t,d.reset(u),f):u},f},e.models.focus=function(t){"use strict";t=t||e.models.line();var n,r,i=e.models.axis(),a=e.models.axis(),o=d3.svg.brush(),s={top:10,right:0,bottom:30,left:0},l=e.utils.defaultColor(),u=null,c=70,d=!0,f=!1,p=!1,h=null,g=250,v=d3.dispatch("brush","onBrush","renderEnd"),m=!0;t.interactive(!1),t.pointActive((function(t){return!1}));var y=e.utils.renderWatch(v,g);function x(b){return y.reset(),y.models(t),d&&y.models(i),f&&y.models(a),b.each((function(y){var b=d3.select(this);e.utils.initSVG(b);var k=e.utils.availableWidth(u,b,s),w=c-s.top-s.bottom;x.update=function(){0===g?b.call(x):b.transition().duration(g).call(x)},x.container=this,n=t.xScale(),r=t.yScale();var M=b.selectAll("g.nv-focus").data([y]),A=M.enter().append("g").attr("class","nvd3 nv-focus").append("g"),C=M.select("g");M.attr("transform","translate("+s.left+","+s.top+")"),A.append("g").attr("class","nv-background").append("rect"),A.append("g").attr("class","nv-x nv-axis"),A.append("g").attr("class","nv-y nv-axis"),A.append("g").attr("class","nv-contentWrap"),A.append("g").attr("class","nv-brushBackground"),A.append("g").attr("class","nv-x nv-brush"),p&&C.select(".nv-y.nv-axis").attr("transform","translate("+k+",0)"),C.select(".nv-background rect").attr("width",k).attr("height",w),t.width(k).height(w).color(y.map((function(t,e){return t.color||l(t,e)})).filter((function(t,e){return!y[e].disabled})));var S=C.select(".nv-contentWrap").datum(y.filter((function(t){return!t.disabled})));d3.transition(S).call(t),o.x(n).on("brush",(function(){W(m)})),o.on("brushend",(function(){m||v.onBrush(o.empty()?n.domain():o.extent())})),h&&o.extent(h);var D=C.select(".nv-brushBackground").selectAll("g").data([h||o.extent()]),E=D.enter().append("g");E.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",w),E.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",w);var F=C.select(".nv-x.nv-brush").call(o);function W(t){h=o.empty()?null:o.extent();var e=o.empty()?n.domain():o.extent();v.brush({extent:e,brush:o}),o.empty()||o.extent(h),D.data([o.empty()?n.domain():h]).each((function(t,e){var r=n(t[0])-n.range()[0],i=k-n(t[1]);d3.select(this).select(".left").attr("width",r<0?0:r),d3.select(this).select(".right").attr("x",n(t[1])).attr("width",i<0?0:i)})),t&&v.onBrush(e)}F.selectAll("rect").attr("height",w),F.selectAll(".resize").append("path").attr("d",(function(t){var e=+("e"==t),n=e?1:-1,r=w/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)})),W(!0),C.select(".nv-background rect").attr("width",k).attr("height",w),d&&(i.scale(n)._ticks(e.utils.calcTicksX(k/100,y)).tickSize(-w,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),d3.transition(C.select(".nv-x.nv-axis")).call(i)),f&&(a.scale(r)._ticks(e.utils.calcTicksY(w/36,y)).tickSize(-k,0),d3.transition(C.select(".nv-y.nv-axis")).call(a)),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")")})),y.renderEnd("focus immediate"),x}return x.dispatch=v,x.content=t,x.brush=o,x.xAxis=i,x.yAxis=a,x.options=e.utils.optionsFunc.bind(x),x._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 d},set:function(t){d=t}},showYAxis:{get:function(){return f},set:function(t){f=t}},brushExtent:{get:function(){return h},set:function(t){h=t}},syncBrushing:{get:function(){return m},set:function(t){m=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 g},set:function(e){g=e,y.reset(g),t.duration(g),i.duration(g),a.duration(g)}},color:{get:function(){return l},set:function(n){l=e.utils.getColor(n),t.color(l)}},interpolate:{get:function(){return t.interpolate()},set:function(e){t.interpolate(e)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t)}},yTickFormat:{get:function(){return a.tickFormat()},set:function(t){a.tickFormat(t)}},x:{get:function(){return t.x()},set:function(e){t.x(e)}},y:{get:function(){return t.y()},set:function(e){t.y(e)}},rightAlignYAxis:{get:function(){return p},set:function(t){p=t,a.orient(p?"right":"left")}}}),e.utils.inheritOptions(x,t),e.utils.initOptions(x),x},e.models.forceDirectedGraph=function(){"use strict";var t={top:2,right:0,bottom:2,left:0},n=400,r=32,i=null,a=d3.dispatch("renderEnd"),o=e.utils.getColor(["#000"]),s=e.models.tooltip(),l=null,u=.1,c=.9,d=30,f=-120,p=.1,h=.8,g=.1,v=5,m=function(t){},y=function(t){},x=d3.functor(0),b=d3.functor(0),k=e.utils.renderWatch(a);function w(a){return k.reset(),a.each((function(a){i=d3.select(this),e.utils.initSVG(i);var l=e.utils.availableWidth(n,i,t),x=e.utils.availableHeight(r,i,t);if(i.attr("width",l).attr("height",x),!(a&&a.links&&a.nodes))return e.utils.noData(w,i),w;i.selectAll(".nv-noData").remove(),i.selectAll("*").remove();var b=new Set;a.nodes.forEach((function(t){Object.keys(t).forEach((function(t){b.add(t)}))}));var k=d3.layout.force().nodes(a.nodes).links(a.links).size([l,x]).linkStrength(u).friction(c).linkDistance(d).charge(f).gravity(p).theta(h).alpha(g).start(),M=i.selectAll(".link").data(a.links).enter().append("line").attr("class","nv-force-link").style("stroke-width",(function(t){return Math.sqrt(t.value)})),A=i.selectAll(".node").data(a.nodes).enter().append("g").attr("class","nv-force-node").call(k.drag);A.append("circle").attr("r",v).style("fill",(function(t){return o(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=o(t);t.series=[],b.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(M),m(A),k.on("tick",(function(){M.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})),A.attr("transform",(function(t){return"translate("+t.x+", "+t.y+")"}))}))})),w}return w.options=e.utils.optionsFunc.bind(w),w._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 d},set:function(t){d=t}},charge:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return p},set:function(t){p=t}},theta:{get:function(){return h},set:function(t){h=t}},alpha:{get:function(){return g},set:function(t){g=t}},radius:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return o},set:function(t){o=e.utils.getColor(t)}},noData:{get:function(){return l},set:function(t){l=t}},nodeExtras:{get:function(){return m},set:function(t){m=t}},linkExtras:{get:function(){return y},set:function(t){y=t}}}),w.dispatch=a,w.tooltip=s,e.utils.initOptions(w),w},e.models.furiousLegend=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},a=function(t){return t},o=e.utils.getColor(),s=20,l=!0,u=28,c=!0,d=!0,f=!1,p=!1,h=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),g="classic";function v(m){function y(t,e){return"furious"!=g?"#000":p?t.disengaged?o(t,e):"#fff":p?void 0:t.disabled?o(t,e):"#fff"}function x(t,e){return p&&"furious"==g?t.disengaged?"#fff":o(t,e):t.disabled?"#fff":o(t,e)}return m.each((function(v){var m=n-t.left-t.right,b=d3.select(this);e.utils.initSVG(b);var k=b.selectAll("g.nv-legend").data([v]),w=(k.enter().append("g").attr("class","nvd3 nv-legend").append("g"),k.select("g"));k.attr("transform","translate("+t.left+","+t.top+")");var M,A=w.selectAll(".nv-series").data((function(t){return"furious"!=g?t:t.filter((function(t){return!!p||!t.disengaged}))})),C=A.enter().append("g").attr("class","nv-series");"classic"==g?(C.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),M=A.select("circle")):"furious"==g&&(C.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),M=A.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)"),A.select(".nv-check-box").each((function(t,e){d3.select(this).selectAll("path").attr("stroke",y(t,e))}))),C.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var S,D=A.select("text.nv-legend-text");switch(A.on("mouseover",(function(t,e){h.legendMouseover(t,e)})).on("mouseout",(function(t,e){h.legendMouseout(t,e)})).on("click",(function(t,e){h.legendClick(t,e);var n=A.data();d&&("classic"==g?f?(n.forEach((function(t){t.disabled=!0})),t.disabled=!1):(t.disabled=!t.disabled,n.every((function(t){return t.disabled}))&&n.forEach((function(t){t.disabled=!1}))):"furious"==g&&(p?(t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled):p||(t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter((function(t){return!t.disengaged})).every((function(t){return t.userDisabled}))&&n.forEach((function(t){t.disabled=t.userDisabled=!1})))),h.stateChange({disabled:n.map((function(t){return!!t.disabled})),disengaged:n.map((function(t){return!!t.disengaged}))}))})).on("dblclick",(function(t,e){if(("furious"!=g||!p)&&(h.legendDblclick(t,e),d)){var n=A.data();n.forEach((function(t){t.disabled=!0,"furious"==g&&(t.userDisabled=t.disabled)})),t.disabled=!1,"furious"==g&&(t.userDisabled=t.disabled),h.stateChange({disabled:n.map((function(t){return!!t.disabled}))})}})),A.classed("nv-disabled",(function(t){return t.userDisabled})),A.exit().remove(),D.attr("fill",y).text((function(t){return a(i(t))})),g){case"furious":S=23;break;case"classic":S=20}if(l){var E=[];A.each((function(t,n){var r,o;if(a(i(t))&&a(i(t)).length>s){var l=a(i(t)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(a(i(t)))}else r=d3.select(this).select("text");try{if((o=r.node().getComputedTextLength())<=0)throw Error()}catch(t){o=e.utils.calcApproxTextWidth(r)}E.push(o+u)}));for(var F=0,W=0,O=[];W<m&&F<E.length;)O[F]=E[F],W+=E[F++];for(0===F&&(F=1);W>m&&F>1;){O=[],F--;for(var N=0;N<E.length;N++)E[N]>(O[N%F]||0)&&(O[N%F]=E[N]);W=O.reduce((function(t,e,n,r){return t+e}))}for(var L=[],_=0,B=0;_<F;_++)L[_]=B,B+=O[_];A.attr("transform",(function(t,e){return"translate("+L[e%F]+","+(5+Math.floor(e/F)*S)+")"})),c?w.attr("transform","translate("+(n-t.right-W)+","+t.top+")"):w.attr("transform","translate(0,"+t.top+")"),r=t.top+t.bottom+Math.ceil(E.length/F)*S}else{var T,P=5,I=5,H=0;A.attr("transform",(function(e,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return T=I,n<t.left+t.right+T+i&&(I=T=5,P+=S),(I+=i)>H&&(H=I),"translate("+T+","+P+")"})),w.attr("transform","translate("+(n-t.right-H)+","+t.top+")"),r=t.top+t.bottom+P+15}"furious"==g&&M.attr("width",(function(t,e){return D[0][e].getComputedTextLength()+27})).attr("height",18).attr("y",-9).attr("x",-15),M.style("fill",x).style("stroke",(function(t,e){return t.color||o(t,e)}))})),v}return v.dispatch=h,v.options=e.utils.optionsFunc.bind(v),v._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 a},set:function(t){a=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 d},set:function(t){d=t}},radioButtonMode:{get:function(){return f},set:function(t){f=t}},expanded:{get:function(){return p},set:function(t){p=t}},vers:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return o},set:function(t){o=e.utils.getColor(t)}}}),e.utils.initOptions(v),v},e.models.historicalBar=function(){"use strict";var t,n,r,i,a={top:0,right:0,bottom:0,left:0},o=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=[],g=[0],v=!1,m=!0,y=e.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),b=!0,k=e.utils.renderWatch(x,0);function w(M){return M.each((function(w){k.reset(),u=d3.select(this);var M=e.utils.availableWidth(o,u,a),A=e.utils.availableHeight(s,u,a);e.utils.initSVG(u),c.domain(t||d3.extent(w[0].values.map(f).concat(h))),v?c.range(r||[.5*M/w[0].values.length,M*(w[0].values.length-.5)/w[0].values.length]):c.range(r||[0,M]),d.domain(n||d3.extent(w[0].values.map(p).concat(g))).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])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var C=u.selectAll("g.nv-wrap.nv-historicalBar-"+l).data([w[0].values]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+l),D=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-bars"),C.attr("transform","translate("+a.left+","+a.top+")"),u.on("click",(function(t,e){x.chartClick({data:t,index:e,pos:d3.event,id:l})})),D.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),C.select("#nv-chart-clip-path-"+l+" rect").attr("width",M).attr("height",A),F.attr("clip-path",m?"url(#nv-chart-clip-path-"+l+")":"");var W=C.select(".nv-bars").selectAll(".nv-bar").data((function(t){return t}),(function(t,e){return f(t,e)}));W.exit().remove(),W.enter().append("rect").attr("x",0).attr("y",(function(t,n){return e.utils.NaNtoZero(d(Math.max(0,p(t,n))))})).attr("height",(function(t,n){return e.utils.NaNtoZero(Math.abs(d(p(t,n))-d(0)))})).attr("transform",(function(t,e){return"translate("+(c(f(t,e))-M/w[0].values.length*.45)+",0)"})).on("mouseover",(function(t,e){b&&(d3.select(this).classed("hover",!0),x.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")}))})).on("mouseout",(function(t,e){b&&(d3.select(this).classed("hover",!1),x.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")}))})).on("mousemove",(function(t,e){b&&x.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){b&&(x.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation())})).on("dblclick",(function(t,e){b&&(x.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation())})),W.attr("fill",(function(t,e){return y(t,e)})).attr("class",(function(t,e,n){return(p(t,e)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+n+"-"+e})).watchTransition(k,"bars").attr("transform",(function(t,e){return"translate("+(c(f(t,e))-M/w[0].values.length*.45)+",0)"})).attr("width",M/w[0].values.length*.9),W.watchTransition(k,"bars").attr("y",(function(t,n){var r=p(t,n)<0?d(0):d(0)-d(p(t,n))<1?d(0)-1:d(p(t,n));return e.utils.NaNtoZero(r)})).attr("height",(function(t,n){return e.utils.NaNtoZero(Math.max(Math.abs(d(p(t,n))-d(0)),1))}))})),k.renderEnd("historicalBar immediate"),w}return w.highlightPoint=function(t,e){u.select(".nv-bars .nv-bar-0-"+t).classed("hover",e)},w.clearHighlights=function(){u.select(".nv-bars .nv-bar.hover").classed("hover",!1)},w.dispatch=x,w.options=e.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return h},set:function(t){h=t}},forceY:{get:function(){return g},set:function(t){g=t}},padData:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return t},set:function(e){t=e}},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 m},set:function(t){m=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 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 y},set:function(t){y=e.utils.getColor(t)}}}),e.utils.initOptions(w),w},e.models.historicalBarChart=function(t){"use strict";var n,r,i=t||e.models.historicalBar(),a=e.models.axis(),o=e.models.axis(),s=e.models.legend(),l=e.interactiveGuideline(),u=e.models.tooltip(),c={top:30,right:90,bottom:50,left:90},d=null,f=e.utils.defaultColor(),p=null,h=null,g=!1,v=!0,m=!0,y=!1,x=!1,b={},k=null,w=null,M=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),A=250;a.orient("bottom").tickPadding(7),o.orient(y?"right":"left"),u.duration(0).headerEnabled(!1).valueFormatter((function(t,e){return o.tickFormat()(t,e)})).headerFormatter((function(t,e){return a.tickFormat()(t,e)}));var C=e.utils.renderWatch(M,0);function S(t){return t.each((function(u){C.reset(),C.models(i),v&&C.models(a),m&&C.models(o);var w=d3.select(this);e.utils.initSVG(w);var D,E=e.utils.availableWidth(p,w,c),F=e.utils.availableHeight(h,w,c);if(S.update=function(){w.transition().duration(A).call(S)},S.container=this,b.disabled=u.map((function(t){return!!t.disabled})),!k)for(D in k={},b)b[D]instanceof Array?k[D]=b[D].slice(0):k[D]=b[D];if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return e.utils.noData(S,w),S;w.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale();var W=w.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]),O=W.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),N=W.select("g");O.append("g").attr("class","nv-x nv-axis"),O.append("g").attr("class","nv-y nv-axis"),O.append("g").attr("class","nv-barsWrap"),O.append("g").attr("class","nv-legendWrap"),O.append("g").attr("class","nv-interactive"),g?(s.width(E),N.select(".nv-legendWrap").datum(u).call(s),d||s.height()===c.top||(c.top=s.height(),F=e.utils.availableHeight(h,w,c)),W.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):N.select(".nv-legendWrap").selectAll("*").remove(),W.attr("transform","translate("+c.left+","+c.top+")"),y&&N.select(".nv-y.nv-axis").attr("transform","translate("+E+",0)"),x&&(l.width(E).height(F).margin({left:c.left,top:c.top}).svgContainer(w).xScale(n),W.select(".nv-interactive").call(l)),i.width(E).height(F).color(u.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!u[e].disabled}))),N.select(".nv-barsWrap").datum(u.filter((function(t){return!t.disabled}))).transition().call(i),v&&(a.scale(n)._ticks(e.utils.calcTicksX(E/100,u)).tickSize(-F,0),N.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),N.select(".nv-x.nv-axis").transition().call(a)),m&&(o.scale(r)._ticks(e.utils.calcTicksY(F/36,u)).tickSize(-E,0),N.select(".nv-y.nv-axis").transition().call(o)),l.dispatch.on("elementMousemove",(function(t){i.clearHighlights();var n,r,s,c=[];u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(a,o){r=e.interactiveBisect(a.values,t.pointXValue,S.x()),i.highlightPoint(r,!0);var l=a.values[r];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=S.xScale()(S.x()(l,r))),c.push({key:a.key,value:S.y()(l,r),color:f(a,a.seriesIndex),data:a.values[r]}))}));var d=a.tickFormat()(S.x()(n,r));l.tooltip.valueFormatter((function(t,e){return o.tickFormat()(t)})).data({value:d,index:r,series:c})(),l.renderGuideLine(s)})),l.dispatch.on("elementMouseout",(function(t){M.tooltipHide(),i.clearHighlights()})),s.dispatch.on("legendClick",(function(e,n){e.disabled=!e.disabled,u.filter((function(t){return!t.disabled})).length||u.map((function(t){return t.disabled=!1,W.selectAll(".nv-series").classed("disabled",!1),t})),b.disabled=u.map((function(t){return!!t.disabled})),M.stateChange(b),t.transition().call(S)})),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})),M.stateChange(b),S.update()})),M.on("changeState",(function(t){void 0!==t.disabled&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),b.disabled=t.disabled),S.update()}))})),C.renderEnd("historicalBarChart immediate"),S}return i.dispatch.on("elementMouseover.tooltip",(function(t){t.series={key:S.x()(t.data),value:S.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()})),S.dispatch=M,S.bars=i,S.legend=s,S.xAxis=a,S.yAxis=o,S.interactiveLayer=l,S.tooltip=u,S.options=e.utils.optionsFunc.bind(S),S._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 g},set:function(t){g=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},defaultState:{get:function(){return k},set:function(t){k=t}},noData:{get:function(){return w},set:function(t){w=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=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 f},set:function(t){f=e.utils.getColor(t),s.color(f),i.color(f)}},duration:{get:function(){return A},set:function(t){A=t,C.reset(A),o.duration(A),a.duration(A)}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,o.orient(t?"right":"left")}},useInteractiveGuideline:{get:function(){return x},set:function(t){x=t,!0===t&&S.interactive(!1)}}}),e.utils.inheritOptions(S,i),e.utils.initOptions(S),S},e.models.ohlcBarChart=function(){var t=e.models.historicalBarChart(e.models.ohlcBar());return t.useInteractiveGuideline(!0),t.interactiveLayer.tooltip.contentGenerator((function(e){var n=e.series[0].data;return'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+e.value+"</h3><table><tr><td>open:</td><td>"+t.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+t.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+t.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+t.yAxis.tickFormat()(n.low)+"</td></tr></table>"})),t},e.models.candlestickBarChart=function(){var t=e.models.historicalBarChart(e.models.candlestickBar());return t.useInteractiveGuideline(!0),t.interactiveLayer.tooltip.contentGenerator((function(e){var n=e.series[0].data;return'<h3 style="color: #'+(n.open<n.close?"2ca02c":"d62728")+'">'+e.value+"</h3><table><tr><td>open:</td><td>"+t.yAxis.tickFormat()(n.open)+"</td></tr><tr><td>close:</td><td>"+t.yAxis.tickFormat()(n.close)+"</td></tr><tr><td>high</td><td>"+t.yAxis.tickFormat()(n.high)+"</td></tr><tr><td>low:</td><td>"+t.yAxis.tickFormat()(n.low)+"</td></tr></table>"})),t},e.models.legend=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},a=function(t){return t},o=e.utils.getColor(),s=20,l=!0,u=32,c=!0,d=!0,f=!0,p=!1,h=!1,g=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),v="classic";function m(y){function x(t,e){return"furious"!=v?"#000":h?t.disengaged?"#000":"#fff":h?void 0:(t.color||(t.color=o(t,e)),t.disabled?t.color:"#fff")}function b(t,e){return h&&"furious"==v&&t.disengaged?"#eee":t.color||o(t,e)}function k(t,e){return h&&"furious"==v?1:t.disabled?0:1}return y.each((function(o){var m=n-t.left-t.right,y=d3.select(this);e.utils.initSVG(y);var w=y.selectAll("g.nv-legend").data([o]),M=w.enter().append("g").attr("class","nvd3 nv-legend").append("g"),A=w.select("g");c?w.attr("transform","translate("+-t.right+","+t.top+")"):w.attr("transform","translate("+t.left+","+t.top+")");var C,S,D=A.selectAll(".nv-series").data((function(t){return"furious"!=v?t:t.filter((function(t){return!!h||!t.disengaged}))})),E=D.enter().append("g").attr("class","nv-series");switch(v){case"furious":S=23;break;case"classic":S=20}"classic"==v?(E.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),C=D.select(".nv-legend-symbol")):"furious"==v&&(E.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),C=D.select(".nv-legend-symbol"),E.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)"),D.select(".nv-check-box").each((function(t,e){d3.select(this).selectAll("path").attr("stroke",x(t,e))}))),E.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var F=D.select("text.nv-legend-text");D.on("mouseover",(function(t,e){g.legendMouseover(t,e)})).on("mouseout",(function(t,e){g.legendMouseout(t,e)})).on("click",(function(t,e){g.legendClick(t,e);var n=D.data();d&&("classic"==v?p?(n.forEach((function(t){t.disabled=!0})),t.disabled=!1):(t.disabled=!t.disabled,n.every((function(t){return t.disabled}))&&n.forEach((function(t){t.disabled=!1}))):"furious"==v&&(h?(t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled):h||(t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter((function(t){return!t.disengaged})).every((function(t){return t.userDisabled}))&&n.forEach((function(t){t.disabled=t.userDisabled=!1})))),g.stateChange({disabled:n.map((function(t){return!!t.disabled})),disengaged:n.map((function(t){return!!t.disengaged}))}))})).on("dblclick",(function(t,e){if(f){if("furious"==v&&h)return;if(g.legendDblclick(t,e),d){var n=D.data();n.forEach((function(t){t.disabled=!0,"furious"==v&&(t.userDisabled=t.disabled)})),t.disabled=!1,"furious"==v&&(t.userDisabled=t.disabled),g.stateChange({disabled:n.map((function(t){return!!t.disabled}))})}}})),D.classed("nv-disabled",(function(t){return t.userDisabled})),D.exit().remove(),F.attr("fill",x).text((function(t){return a(i(t))}));var W=0;if(l){var O=[];D.each((function(t,n){var r,o;if(a(i(t))&&a(i(t)).length>s){var l=a(i(t)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(a(i(t)))}else r=d3.select(this).select("text");try{if((o=r.node().getComputedTextLength())<=0)throw Error()}catch(t){o=e.utils.calcApproxTextWidth(r)}O.push(o+u)}));var N=0,L=[];for(W=0;W<m&&N<O.length;)L[N]=O[N],W+=O[N++];for(0===N&&(N=1);W>m&&N>1;){L=[],N--;for(var _=0;_<O.length;_++)O[_]>(L[_%N]||0)&&(L[_%N]=O[_]);W=L.reduce((function(t,e,n,r){return t+e}))}for(var B=[],T=0,P=0;T<N;T++)B[T]=P,P+=L[T];D.attr("transform",(function(t,e){return"translate("+B[e%N]+","+(5+Math.floor(e/N)*S)+")"})),c?A.attr("transform","translate("+(n-t.right-W)+","+t.top+")"):A.attr("transform","translate(0,"+t.top+")"),r=t.top+t.bottom+Math.ceil(O.length/N)*S}else{var I,H=5,V=5,z=0;D.attr("transform",(function(e,r){var i=d3.select(this).select("text").node().getComputedTextLength()+u;return I=V,n<t.left+t.right+I+i&&(V=I=5,H+=S),(V+=i)>z&&(z=V),W<I+z&&(W=I+z),"translate("+I+","+H+")"})),A.attr("transform","translate("+(n-t.right-z)+","+t.top+")"),r=t.top+t.bottom+H+15}"furious"==v&&(C.attr("width",(function(t,e){return F[0][e].getComputedTextLength()+27})).attr("height",18).attr("y",-9).attr("x",-15),M.insert("rect",":first-child").attr("class","nv-legend-bg").attr("fill","#eee").attr("opacity",0),A.select(".nv-legend-bg").transition().duration(300).attr("x",-S).attr("width",W+S-12).attr("height",r+10).attr("y",-t.top-10).attr("opacity",h?1:0)),C.style("fill",b).style("fill-opacity",k).style("stroke",b)})),m}return m.dispatch=g,m.options=e.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 a},set:function(t){a=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 d},set:function(t){d=t}},enableDoubleClick:{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 t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},color:{get:function(){return o},set:function(t){o=e.utils.getColor(t)}}}),e.utils.initOptions(m),m},e.models.line=function(){"use strict";var t,n,r=e.models.scatter(),i={top:0,right:0,bottom:0,left:0},a=960,o=500,s=null,l=e.utils.defaultColor(),u=function(t){return t.x},c=function(t){return t.y},d=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},f=function(t){return t.area},p=!1,h="linear",g=250,v=d3.dispatch("elementClick","elementMouseover","elementMouseout","renderEnd");r.pointSize(16).pointDomain([16,256]);var m,y,x=e.utils.renderWatch(v,g);function b(g){return x.reset(),x.models(r),g.each((function(g){s=d3.select(this);var v=e.utils.availableWidth(a,s,i),b=e.utils.availableHeight(o,s,i);e.utils.initSVG(s),t=r.xScale(),n=r.yScale(),m=m||t,y=y||n;var k=s.selectAll("g.nv-wrap.nv-line").data([g]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),M=w.append("defs"),A=w.append("g"),C=k.select("g");A.append("g").attr("class","nv-groups"),A.append("g").attr("class","nv-scatterWrap"),k.attr("transform","translate("+i.left+","+i.top+")"),r.width(v).height(b);var S=k.select(".nv-scatterWrap");S.call(r),M.append("clipPath").attr("id","nv-edge-clip-"+r.id()).append("rect"),k.select("#nv-edge-clip-"+r.id()+" rect").attr("width",v).attr("height",b>0?b:0),C.attr("clip-path",p?"url(#nv-edge-clip-"+r.id()+")":""),S.attr("clip-path",p?"url(#nv-edge-clip-"+r.id()+")":"");var D=k.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));D.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",(function(t){return t.strokeWidth||1.5})).style("fill-opacity",1e-6),D.exit().remove(),D.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 l(t,e)})).style("stroke",(function(t,e){return l(t,e)})),D.watchTransition(x,"line: groups").style("stroke-opacity",1).style("fill-opacity",(function(t){return t.fillOpacity||.5}));var E=D.selectAll("path.nv-area").data((function(t){return f(t)?[t]:[]}));E.enter().append("path").attr("class","nv-area").attr("d",(function(t){return d3.svg.area().interpolate(h).defined(d).x((function(t,n){return e.utils.NaNtoZero(m(u(t,n)))})).y0((function(t,n){return e.utils.NaNtoZero(y(c(t,n)))})).y1((function(t,e){return y(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])})).apply(this,[t.values])})),D.exit().selectAll("path.nv-area").remove(),E.watchTransition(x,"line: areaPaths").attr("d",(function(r){return d3.svg.area().interpolate(h).defined(d).x((function(n,r){return e.utils.NaNtoZero(t(u(n,r)))})).y0((function(t,r){return e.utils.NaNtoZero(n(c(t,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=D.selectAll("path.nv-line").data((function(t){return[t.values]}));F.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(h).defined(d).x((function(t,n){return e.utils.NaNtoZero(m(u(t,n)))})).y((function(t,n){return e.utils.NaNtoZero(y(c(t,n)))}))),F.watchTransition(x,"line: linePaths").attr("d",d3.svg.line().interpolate(h).defined(d).x((function(n,r){return e.utils.NaNtoZero(t(u(n,r)))})).y((function(t,r){return e.utils.NaNtoZero(n(c(t,r)))}))),m=t.copy(),y=n.copy()})),x.renderEnd("line immediate"),b}return b.dispatch=v,b.scatter=r,r.dispatch.on("elementClick",(function(){v.elementClick.apply(this,arguments)})),r.dispatch.on("elementMouseover",(function(){v.elementMouseover.apply(this,arguments)})),r.dispatch.on("elementMouseout",(function(){v.elementMouseout.apply(this,arguments)})),b.options=e.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return o},set:function(t){o=t}},defined:{get:function(){return d},set:function(t){d=t}},interpolate:{get:function(){return h},set:function(t){h=t}},clipEdge:{get:function(){return p},set:function(t){p=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 g},set:function(t){g=t,x.reset(g),r.duration(g)}},isArea:{get:function(){return f},set:function(t){f=d3.functor(t)}},x:{get:function(){return u},set:function(t){u=t,r.x(t)}},y:{get:function(){return c},set:function(t){c=t,r.y(t)}},color:{get:function(){return l},set:function(t){l=e.utils.getColor(t),r.color(l)}}}),e.utils.inheritOptions(b,r),e.utils.initOptions(b),b},e.models.lineChart=function(){"use strict";var t,n,r=e.models.line(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend(),s=e.interactiveGuideline(),l=e.models.tooltip(),u=e.models.focus(e.models.line()),c={top:30,right:20,bottom:50,left:60},d=null,f=e.utils.defaultColor(),p=null,h=null,g=!0,v="top",m=!0,y=!0,x=!1,b=!1,k=!1,w=e.utils.state(),M=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=250;i.orient("bottom").tickPadding(7),a.orient(x?"right":"left"),r.clipEdge(!0).duration(0),l.valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.tooltip.valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)}));var D=e.utils.renderWatch(C,S);function E(l){return D.reset(),D.models(r),m&&D.models(i),y&&D.models(a),l.each((function(l){var A=d3.select(this);e.utils.initSVG(A);var D,F=e.utils.availableWidth(p,A,c),W=e.utils.availableHeight(h,A,c)-(k?u.height():0);if(E.update=function(){0===S?A.call(E):A.transition().duration(S).call(E)},E.container=this,w.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(l),E.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(l)).update(),w.disabled=l.map((function(t){return!!t.disabled})),!M)for(D in M={},w)w[D]instanceof Array?M[D]=w[D].slice(0):M[D]=w[D];if(!(l&&l.length&&l.filter((function(t){return t.values.length})).length))return e.utils.noData(E,A),E;A.selectAll(".nv-noData").remove(),u.dispatch.on("onBrush",(function(t){H(t)})),t=r.xScale(),n=r.yScale();var O=A.selectAll("g.nv-wrap.nv-lineChart").data([l]),N=O.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),L=O.select("g");N.append("g").attr("class","nv-legendWrap");var _=N.append("g").attr("class","nv-focus");_.append("g").attr("class","nv-background").append("rect"),_.append("g").attr("class","nv-x nv-axis"),_.append("g").attr("class","nv-y nv-axis"),_.append("g").attr("class","nv-linesWrap"),_.append("g").attr("class","nv-interactive"),N.append("g").attr("class","nv-focusWrap"),g?(o.width(F),L.select(".nv-legendWrap").datum(l).call(o),"bottom"===v?(c.bottom=i.height()+o.height(),W=e.utils.availableHeight(h,A,c),L.select(".nv-legendWrap").attr("transform","translate(0,"+(W+i.height())+")")):"top"===v&&(d||o.height()===c.top||(c.top=o.height(),W=e.utils.availableHeight(h,A,c)-(k?u.height():0)),O.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")"))):L.select(".nv-legendWrap").selectAll("*").remove(),O.attr("transform","translate("+c.left+","+c.top+")"),x&&L.select(".nv-y.nv-axis").attr("transform","translate("+F+",0)"),b&&(s.width(F).height(W).margin({left:c.left,top:c.top}).svgContainer(A).xScale(t),O.select(".nv-interactive").call(s)),L.select(".nv-focus .nv-background rect").attr("width",F).attr("height",W),r.width(F).height(W).color(l.map((function(t,e){return t.color||f(t,e)})).filter((function(t,e){return!l[e].disabled})));var B=L.select(".nv-linesWrap").datum(l.filter((function(t){return!t.disabled})));function T(){m&&L.select(".nv-focus .nv-x.nv-axis").transition().duration(S).call(i)}function P(){y&&L.select(".nv-focus .nv-y.nv-axis").transition().duration(S).call(a)}if(m&&i.scale(t)._ticks(e.utils.calcTicksX(F/100,l)).tickSize(-W,0),y&&a.scale(n)._ticks(e.utils.calcTicksY(W/36,l)).tickSize(-F,0),L.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+W+")"),k||null!==u.brush.extent()){u.width(F),L.select(".nv-focusWrap").style("display",k?"initial":"none").attr("transform","translate(0,"+(W+c.bottom+u.margin().top)+")").call(u);var I=u.brush.empty()?u.xDomain():u.brush.extent();null!==I&&H(I)}else B.call(r),T(),P();function H(t){L.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(S).call(r),T(),P()}o.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];C.stateChange(w),E.update()})),s.dispatch.on("elementMousemove",(function(n){r.clearHighlights();var i,o,c,d=[];if(l.filter((function(t,e){return t.seriesIndex=e,!t.disabled&&!t.disableTooltip})).forEach((function(a,s){var l=null!==u.brush.extent()?u.brush.empty()?u.xScale().domain():u.brush.extent():t.domain(),p=a.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]})),h=p[o=e.interactiveBisect(p,n.pointXValue,r.x())],g=E.y()(h,o);null!==g&&r.highlightPoint(s,o,!0),void 0!==h&&(void 0===i&&(i=h),void 0===c&&(c=E.xScale()(E.x()(h,o))),d.push({key:a.key,value:g,color:f(a,a.seriesIndex),data:h}))})),d.length>2){var p=E.yScale().invert(n.mouseY),h=.03*Math.abs(E.yScale().domain()[0]-E.yScale().domain()[1]),g=e.nearestValueIndex(d.map((function(t){return t.value})),p,h);null!==g&&(d[g].highlight=!0)}s.tooltip.valueFormatter(s.tooltip.valueFormatter()||function(t,e){return null==t?"N/A":a.tickFormat()(t)}).data({value:E.x()(i,o),index:o,series:d})(),s.renderGuideLine(c)})),s.dispatch.on("elementClick",(function(t){var n,i=[];l.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(r){var a=e.interactiveBisect(r.values,t.pointXValue,E.x()),o=r.values[a];if(void 0!==o){void 0===n&&(n=E.xScale()(E.x()(o,a)));var s=E.yScale()(E.y()(o,a));i.push({point:o,pointIndex:a,pos:[n,s],seriesIndex:r.seriesIndex,series:r})}})),r.dispatch.elementClick(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]})),w.disabled=t.disabled),E.update()}))})),D.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=o,E.focus=u,E.xAxis=i,E.x2Axis=u.xAxis,E.yAxis=a,E.y2Axis=u.yAxis,E.interactiveLayer=s,E.tooltip=l,E.state=w,E.dispatch=C,E.options=e.utils.optionsFunc.bind(E),E._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 g},set:function(t){g=t}},legendPosition:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return y},set:function(t){y=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return A},set:function(t){A=t}},focusEnable:{get:function(){return k},set:function(t){k=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,d=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 S},set:function(t){S=t,D.reset(S),r.duration(S),u.duration(S),i.duration(S),a.duration(S)}},color:{get:function(){return f},set:function(t){f=e.utils.getColor(t),o.color(f),r.color(f),u.color(f)}},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 a.tickFormat()},set:function(t){a.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,a.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return b},set:function(t){(b=t)&&(r.interactive(!1),r.useVoronoi(!1))}}}),e.utils.inheritOptions(E,r),e.utils.initOptions(E),E},e.models.lineWithFocusChart=function(){return e.models.lineChart().margin({bottom:30}).focusEnable(!0)},e.models.linePlusBarChart=function(){"use strict";var t,n,r,i,a,o,s,l=e.models.line(),u=e.models.line(),c=e.models.historicalBar(),d=e.models.historicalBar(),f=e.models.axis(),p=e.models.axis(),h=e.models.axis(),g=e.models.axis(),v=e.models.axis(),m=e.models.axis(),y=e.models.legend(),x=d3.svg.brush(),b=e.models.tooltip(),k={top:30,right:30,bottom:30,left:60},w=null,M={top:0,right:30,bottom:20,left:60},A=null,C=null,S=function(t){return t.x},D=function(t){return t.y},E=e.utils.defaultColor(),F=!0,W=!0,O=!1,N=!0,L=50,_=null,B=null,T=d3.dispatch("brush","stateChange","changeState"),P=0,I=e.utils.state(),H=null,V=" (left axis)",z=" (right axis)",R=!1;l.clipEdge(!0),u.interactive(!1),u.pointActive((function(t){return!1})),f.orient("bottom").tickPadding(5),h.orient("left"),g.orient("right"),p.orient("bottom").tickPadding(5),v.orient("left"),m.orient("right"),b.headerEnabled(!0).headerFormatter((function(t,e){return f.tickFormat()(t,e)}));var Y=function(t){return t.every((function(t){return t.disabled}))};function j(b){return b.each((function(b){var B=d3.select(this);e.utils.initSVG(B);var G,X=e.utils.availableWidth(A,B,k),Z=e.utils.availableHeight(C,B,k)-(W?L:0),U=L-M.top-M.bottom;if(j.update=function(){B.transition().duration(P).call(j)},j.container=this,I.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(b),j.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(b)).update(),I.disabled=b.map((function(t){return!!t.disabled})),!H)for(G in H={},I)I[G]instanceof Array?H[G]=I[G].slice(0):H[G]=I[G];if(!(b&&b.length&&b.filter((function(t){return t.values.length})).length))return e.utils.noData(j,B),j;B.selectAll(".nv-noData").remove();var q=b.filter((function(t){return!t.disabled&&t.bar})),K=b.filter((function(t){return!t.bar}));n=q.length&&!R?c.xScale():l.xScale(),r=p.scale(),i=R?l.yScale():c.yScale(),a=R?c.yScale():l.yScale(),o=R?u.yScale():d.yScale(),s=R?d.yScale():u.yScale();var $=b.filter((function(t){return!t.disabled&&(R?!t.bar:t.bar)})).map((function(t){return t.values.map((function(t,e){return{x:S(t,e),y:D(t,e)}}))})),Q=b.filter((function(t){return!t.disabled&&(R?t.bar:!t.bar)})).map((function(t){return t.values.map((function(t,e){return{x:S(t,e),y:D(t,e)}}))}));n.range([0,X]),r.domain(d3.extent(d3.merge($.concat(Q)),(function(t){return t.x}))).range([0,X]);var J=B.selectAll("g.nv-wrap.nv-linePlusBar").data([b]),tt=J.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),et=J.select("g");tt.append("g").attr("class","nv-legendWrap");var nt=tt.append("g").attr("class","nv-focus");nt.append("g").attr("class","nv-x nv-axis"),nt.append("g").attr("class","nv-y1 nv-axis"),nt.append("g").attr("class","nv-y2 nv-axis"),nt.append("g").attr("class","nv-barsWrap"),nt.append("g").attr("class","nv-linesWrap");var rt=tt.append("g").attr("class","nv-context");if(rt.append("g").attr("class","nv-x nv-axis"),rt.append("g").attr("class","nv-y1 nv-axis"),rt.append("g").attr("class","nv-y2 nv-axis"),rt.append("g").attr("class","nv-barsWrap"),rt.append("g").attr("class","nv-linesWrap"),rt.append("g").attr("class","nv-brushBackground"),rt.append("g").attr("class","nv-x nv-brush"),F){var it=y.align()?X/2:X,at=y.align()?it:0;y.width(it),et.select(".nv-legendWrap").datum(b.map((function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=R?t.originalKey+(t.bar?z:V):t.originalKey+(t.bar?V:z),t}))).call(y),w||y.height()===k.top||(k.top=y.height(),Z=e.utils.availableHeight(C,B,k)-L),et.select(".nv-legendWrap").attr("transform","translate("+at+","+-k.top+")")}else et.select(".nv-legendWrap").selectAll("*").remove();J.attr("transform","translate("+k.left+","+k.top+")"),et.select(".nv-context").style("display",W?"initial":"none"),d.width(X).height(U).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&b[e].bar}))),u.width(X).height(U).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&!b[e].bar})));var ot=et.select(".nv-context .nv-barsWrap").datum(q.length?q:[{values:[]}]),st=et.select(".nv-context .nv-linesWrap").datum(Y(K)?[{values:[]}]:K.filter((function(t){return!t.disabled})));et.select(".nv-context").attr("transform","translate(0,"+(Z+k.bottom+M.top)+")"),ot.transition().call(d),st.transition().call(u),N&&(p._ticks(e.utils.calcTicksX(X/100,b)).tickSize(-U,0),et.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+o.range()[0]+")"),et.select(".nv-context .nv-x.nv-axis").transition().call(p)),O&&(v.scale(o)._ticks(U/36).tickSize(-X,0),m.scale(s)._ticks(U/36).tickSize(q.length?0:-X,0),et.select(".nv-context .nv-y3.nv-axis").style("opacity",q.length?1:0).attr("transform","translate(0,"+r.range()[0]+")"),et.select(".nv-context .nv-y2.nv-axis").style("opacity",K.length?1:0).attr("transform","translate("+r.range()[1]+",0)"),et.select(".nv-context .nv-y1.nv-axis").transition().call(v),et.select(".nv-context .nv-y2.nv-axis").transition().call(m)),x.x(r).on("brush",dt),_&&x.extent(_);var lt=et.select(".nv-brushBackground").selectAll("g").data([_||x.extent()]),ut=lt.enter().append("g");ut.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",U),ut.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",U);var ct=et.select(".nv-x.nv-brush").call(x);function dt(){_=x.empty()?null:x.extent(),t=x.empty()?r.domain():x.extent(),T.brush({extent:t,brush:x}),x.empty()||x.extent(_),lt.data([x.empty()?r.domain():_]).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(X).height(Z).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&b[e].bar}))),l.width(X).height(Z).color(b.map((function(t,e){return t.color||E(t,e)})).filter((function(t,e){return!b[e].disabled&&!b[e].bar})));var o=et.select(".nv-focus .nv-barsWrap").datum(q.length?q.map((function(e,n){return{key:e.key,values:e.values.filter((function(e,n){return c.x()(e,n)>=t[0]&&c.x()(e,n)<=t[1]}))}})):[{values:[]}]),s=et.select(".nv-focus .nv-linesWrap").datum(Y(K)?[{values:[]}]:K.filter((function(t){return!t.disabled})).map((function(e,n){return{area:e.area,fillOpacity:e.fillOpacity,strokeWidth:e.strokeWidth,key:e.key,values:e.values.filter((function(e,n){return l.x()(e,n)>=t[0]&&l.x()(e,n)<=t[1]}))}})));n=q.length&&!R?c.xScale():l.xScale(),f.scale(n)._ticks(e.utils.calcTicksX(X/100,b)).tickSize(-Z,0),f.domain([Math.ceil(t[0]),Math.floor(t[1])]),et.select(".nv-x.nv-axis").transition().duration(P).call(f),o.transition().duration(P).call(c),s.transition().duration(P).call(l),et.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+i.range()[0]+")"),h.scale(i)._ticks(e.utils.calcTicksY(Z/36,b)).tickSize(-X,0),g.scale(a)._ticks(e.utils.calcTicksY(Z/36,b)),R?g.tickSize(K.length?0:-X,0):g.tickSize(q.length?0:-X,0);var u=q.length?1:0,d=K.length&&!Y(K)?1:0,p=R?d:u,v=R?u:d;et.select(".nv-focus .nv-y1.nv-axis").style("opacity",p),et.select(".nv-focus .nv-y2.nv-axis").style("opacity",v).attr("transform","translate("+n.range()[1]+",0)"),et.select(".nv-focus .nv-y1.nv-axis").transition().duration(P).call(h),et.select(".nv-focus .nv-y2.nv-axis").transition().duration(P).call(g)}ct.selectAll("rect").attr("height",U),ct.selectAll(".resize").append("path").attr("d",(function(t){var e=+("e"==t),n=e?1:-1,r=U/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)})),y.dispatch.on("stateChange",(function(t){for(var e in t)I[e]=t[e];T.stateChange(I),j.update()})),T.on("changeState",(function(t){void 0!==t.disabled&&(b.forEach((function(e,n){e.disabled=t.disabled[n]})),I.disabled=t.disabled),j.update()})),dt()})),j}return l.dispatch.on("elementMouseover.tooltip",(function(t){b.duration(100).valueFormatter((function(t,e){return(R?{main:h,focus:v}:{main:g,focus:m}).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=j.x()(t.data),t.series={value:j.y()(t.data),color:t.color},b.duration(0).valueFormatter((function(t,e){return(R?{main:g,focus:m}:{main:h,focus:v}).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()})),j.dispatch=T,j.legend=y,j.lines=l,j.lines2=u,j.bars=c,j.bars2=d,j.xAxis=f,j.x2Axis=p,j.y1Axis=h,j.y2Axis=g,j.y3Axis=v,j.y4Axis=m,j.tooltip=b,j.options=e.utils.optionsFunc.bind(j),j._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 F},set:function(t){F=t}},brushExtent:{get:function(){return _},set:function(t){_=t}},noData:{get:function(){return B},set:function(t){B=t}},focusEnable:{get:function(){return W},set:function(t){W=t}},focusHeight:{get:function(){return L},set:function(t){L=t}},focusShowAxisX:{get:function(){return N},set:function(t){N=t}},focusShowAxisY:{get:function(){return O},set:function(t){O=t}},legendLeftAxisHint:{get:function(){return V},set:function(t){V=t}},legendRightAxisHint:{get:function(){return z},set:function(t){z=t}},margin:{get:function(){return k},set:function(t){void 0!==t.top&&(k.top=t.top,w=t.top),k.right=void 0!==t.right?t.right:k.right,k.bottom=void 0!==t.bottom?t.bottom:k.bottom,k.left=void 0!==t.left?t.left:k.left}},focusMargin:{get:function(){return M},set:function(t){M.top=void 0!==t.top?t.top:M.top,M.right=void 0!==t.right?t.right:M.right,M.bottom=void 0!==t.bottom?t.bottom:M.bottom,M.left=void 0!==t.left?t.left:M.left}},duration:{get:function(){return P},set:function(t){P=t}},color:{get:function(){return E},set:function(t){E=e.utils.getColor(t),y.color(E)}},x:{get:function(){return S},set:function(t){S=t,l.x(t),u.x(t),c.x(t),d.x(t)}},y:{get:function(){return D},set:function(t){D=t,l.y(t),u.y(t),c.y(t),d.y(t)}},switchYAxisOrder:{get:function(){return R},set:function(t){if(R!==t){var e=h;h=g,g=e;var n=v;v=m,m=n}R=t,h.orient("left"),g.orient("right"),v.orient("left"),m.orient("right")}}}),e.utils.inheritOptions(j,l),e.utils.initOptions(j),j},e.models.multiBar=function(){"use strict";var t,n,r,i,a,o,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=d3.scale.ordinal(),f=d3.scale.linear(),p=Math.floor(1e4*Math.random()),h=null,g=function(t){return t.x},v=function(t){return t.y},m=[0],y=!0,x=!1,b="zero",k=e.utils.defaultColor(),w=!1,M=null,A=500,C=.1,S=.75,D=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=e.utils.renderWatch(D,A),F=0;function W(O){return E.reset(),O.each((function(W){var O=u-l.left-l.right,N=c-l.top-l.bottom;h=d3.select(this),e.utils.initSVG(h);var L=0;if(w&&W.length&&(w=[{values:W[0].values.map((function(t){return{x:t.x,y:0,series:t.series,size:.01}}))}]),x){var _=d3.layout.stack().offset(b).values((function(t){return t.values})).y(v)(!W.length&&w?w:W);_.forEach((function(t,e){t.nonStackable?(W[e].nonStackableSeries=L++,_[e]=W[e]):e>0&&_[e-1].nonStackable&&_[e].values.map((function(t,n){t.y0-=_[e-1].values[n].y,t.y1=t.y0+t.y}))})),W=_}W.forEach((function(t,e){t.values.forEach((function(n){n.series=e,n.key=t.key}))})),x&&W.length>0&&W[0].values.map((function(t,e){var n=0,r=0;W.map((function(t,i){if(!W[i].nonStackable){var a=t.values[e];a.size=Math.abs(a.y),a.y<0?(a.y1=r,r-=a.size):(a.y1=a.size+n,n+=a.size)}}))}));var B=n&&r?[]:W.map((function(t,e){return t.values.map((function(t,n){return{x:g(t,n),y:v(t,n),y0:t.y0,y1:t.y1,idx:e}}))}));d.domain(n||d3.merge(B).map((function(t){return t.x}))).rangeBands(i||[0,O],C),f.domain(r||d3.extent(d3.merge(B).map((function(t){var e=t.y;return x&&!W[t.idx].nonStackable&&(e=t.y>0?t.y1:t.y1+t.y),e})).concat(m))).range(a||[N,0]),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]-.01*d.domain()[0],d.domain()[1]+.01*d.domain()[1]]):d.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])),o=o||d,s=s||f;var T=h.selectAll("g.nv-wrap.nv-multibar").data([W]),P=T.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),I=P.append("defs"),H=P.append("g"),V=T.select("g");H.append("g").attr("class","nv-groups"),T.attr("transform","translate("+l.left+","+l.top+")"),I.append("clipPath").attr("id","nv-edge-clip-"+p).append("rect"),T.select("#nv-edge-clip-"+p+" rect").attr("width",O).attr("height",N),V.attr("clip-path",y?"url(#nv-edge-clip-"+p+")":"");var z=T.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t,e){return e}));z.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var R=E.transition(z.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,A)).attr("y",(function(t,e,n){var r=s(0)||0;return x&&W[t.series]&&!W[t.series].nonStackable&&(r=s(t.y0)),r})).attr("height",0).remove();R.delay&&R.delay((function(t,e){return e*(A/(F+1))-e})),z.attr("class",(function(t,e){return"nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})).style("fill",(function(t,e){return k(t,e)})).style("stroke",(function(t,e){return k(t,e)})),z.style("stroke-opacity",1).style("fill-opacity",S);var Y=z.selectAll("rect.nv-bar").data((function(t){return w&&!W.length?w.values:t.values}));Y.exit().remove(),Y.enter().append("rect").attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})).attr("x",(function(t,e,n){return x&&!W[n].nonStackable?0:n*d.rangeBand()/W.length})).attr("y",(function(t,e,n){return s(x&&!W[n].nonStackable?t.y0:0)||0})).attr("height",0).attr("width",(function(t,e,n){return d.rangeBand()/(x&&!W[n].nonStackable?1:W.length)})).attr("transform",(function(t,e){return"translate("+d(g(t,e))+",0)"})),Y.style("fill",(function(t,e,n){return k(t,n,e)})).style("stroke",(function(t,e,n){return k(t,n,e)})).on("mouseover",(function(t,e,n){d3.select(this).classed("hover",!0),D.elementMouseover({data:t,index:e,series:W[n],color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e,n){d3.select(this).classed("hover",!1),D.elementMouseout({data:t,index:e,series:W[n],color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e,n){D.elementMousemove({data:t,index:e,series:W[n],color:d3.select(this).style("fill")})})).on("click",(function(t,e,n){D.elementClick({data:t,index:e,series:W[n],color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e,n){D.elementDblClick({data:t,index:e,series:W[n],color:d3.select(this).style("fill")}),d3.event.stopPropagation()})),Y.attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})).attr("transform",(function(t,e){return"translate("+d(g(t,e))+",0)"})),M&&(t||(t=W.map((function(){return!0}))),Y.style("fill",(function(e,n,r){return d3.rgb(M(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})).style("stroke",(function(e,n,r){return d3.rgb(M(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})));var j=Y.watchTransition(E,"multibar",Math.min(250,A)).delay((function(t,e){return e*A/W[0].values.length}));x?j.attr("y",(function(t,e,n){return W[n].nonStackable?v(t,e)<0?f(0):f(0)-f(v(t,e))<-1?f(0)-1:f(v(t,e))||0:f(t.y1)})).attr("height",(function(t,e,n){return W[n].nonStackable?Math.max(Math.abs(f(v(t,e))-f(0)),0)||0:Math.max(Math.abs(f(t.y+t.y0)-f(t.y0)),0)})).attr("x",(function(t,e,n){var r=0;return W[n].nonStackable&&(r=t.series*d.rangeBand()/W.length,W.length!==L&&(r=W[n].nonStackableSeries*d.rangeBand()/(2*L))),r})).attr("width",(function(t,e,n){if(W[n].nonStackable){var r=d.rangeBand()/L;return W.length!==L&&(r=d.rangeBand()/(2*L)),r}return d.rangeBand()})):j.attr("x",(function(t,e){return t.series*d.rangeBand()/W.length})).attr("width",d.rangeBand()/W.length).attr("y",(function(t,e){return v(t,e)<0?f(0):f(0)-f(v(t,e))<1?f(0)-1:f(v(t,e))||0})).attr("height",(function(t,e){return Math.max(Math.abs(f(v(t,e))-f(0)),1)||0})),o=d.copy(),s=f.copy(),W[0]&&W[0].values&&(F=W[0].values.length)})),E.renderEnd("multibar immediate"),W}return W.dispatch=D,W.options=e.utils.optionsFunc.bind(W),W._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 g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},xScale:{get:function(){return d},set:function(t){d=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 a},set:function(t){a=t}},forceY:{get:function(){return m},set:function(t){m=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 t},set:function(e){t=e}},id:{get:function(){return p},set:function(t){p=t}},hideable:{get:function(){return w},set:function(t){w=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=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,E.reset(A)}},color:{get:function(){return k},set:function(t){k=e.utils.getColor(t)}},barColor:{get:function(){return M},set:function(t){M=t?e.utils.getColor(t):null}}}),e.utils.initOptions(W),W},e.models.multiBarChart=function(){"use strict";var t,n,r=e.models.multiBar(),i=e.models.axis(),a=e.models.axis(),o=e.interactiveGuideline(),s=e.models.legend(),l=e.models.legend(),u=e.models.tooltip(),c={top:30,right:20,bottom:50,left:60},d=null,f=null,p=null,h=e.utils.defaultColor(),g=!0,v={},m=!0,y=null,x=!0,b=!0,k=!1,w=!0,M=!1,A=!1,C=0,S=e.utils.state(),D=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),W=function(){return g?180:0},O=250,N=!1;S.stacked=!1,r.stacked(!1),i.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat((function(t){return t})),a.orient(k?"right":"left").tickFormat(d3.format(",.1f")),u.duration(0).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),o.tooltip.valueFormatter((function(t,e){return null==t?"N/A":a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),o.tooltip.valueFormatter((function(t,e){return null==t?"N/A":a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),o.tooltip.duration(0).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),l.updateState(!1);var L=e.utils.renderWatch(F),_=!1;function B(E){return L.reset(),L.models(r),x&&L.models(i),b&&L.models(a),E.each((function(E){var L=d3.select(this);e.utils.initSVG(L);var T,P=e.utils.availableWidth(f,L,c),I=e.utils.availableHeight(p,L,c);if(B.update=function(){0===O?L.call(B):L.transition().duration(O).call(B)},B.container=this,S.setter(function(t){return function(e){void 0!==e.stacked&&(_=e.stacked),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(E),B.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),stacked:_}}}(E)).update(),S.disabled=E.map((function(t){return!!t.disabled})),!D)for(T in D={},S)S[T]instanceof Array?D[T]=S[T].slice(0):D[T]=S[T];if(!(E&&E.length&&E.filter((function(t){return t.values.length})).length))return e.utils.noData(B,L),B;L.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale();var H=L.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([E]),V=H.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),z=H.select("g");if(V.append("g").attr("class","nv-x nv-axis"),V.append("g").attr("class","nv-y nv-axis"),V.append("g").attr("class","nv-barsWrap"),V.append("g").attr("class","nv-legendWrap"),V.append("g").attr("class","nv-controlsWrap"),V.append("g").attr("class","nv-interactive"),m?"bottom"===y?(s.width(P-c.right),z.select(".nv-legendWrap").datum(E).call(s),c.bottom=i.height()+s.height(),I=e.utils.availableHeight(p,L,c),z.select(".nv-legendWrap").attr("transform","translate(0,"+(I+i.height())+")")):(s.width(P-W()),z.select(".nv-legendWrap").datum(E).call(s),d||s.height()===c.top||(c.top=s.height(),I=e.utils.availableHeight(p,L,c)),z.select(".nv-legendWrap").attr("transform","translate("+W()+","+-c.top+")")):z.select(".nv-legendWrap").selectAll("*").remove(),g){var R=[{key:v.grouped||"Grouped",disabled:r.stacked()},{key:v.stacked||"Stacked",disabled:!r.stacked()}];l.width(W()).color(["#444","#444","#444"]),z.select(".nv-controlsWrap").datum(R).attr("transform","translate(0,"+-c.top+")").call(l)}else z.select(".nv-controlsWrap").selectAll("*").remove();if(H.attr("transform","translate("+c.left+","+c.top+")"),k&&z.select(".nv-y.nv-axis").attr("transform","translate("+P+",0)"),r.disabled(E.map((function(t){return t.disabled}))).width(P).height(I).color(E.map((function(t,e){return t.color||h(t,e)})).filter((function(t,e){return!E[e].disabled}))),z.select(".nv-barsWrap").datum(E.filter((function(t){return!t.disabled}))).call(r),x){i.scale(t)._ticks(e.utils.calcTicksX(P/100,E)).tickSize(-I,0),z.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),z.select(".nv-x.nv-axis").call(i);var Y=z.select(".nv-x.nv-axis > g").selectAll("g");if(Y.selectAll("line, text").style("opacity",1),M){var j=function(t,e){return"translate("+t+","+e+")"};Y.selectAll("text").attr("transform",(function(t,e,n){return j(0,n%2==0?5:17)}));var G=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;z.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",(function(t,e){return j(0,0===e||G%2!=0?17:5)}))}A&&z.selectAll(".tick text").call(e.utils.wrapTicks,B.xAxis.rangeBand()),w&&Y.filter((function(t,e){return e%Math.ceil(E[0].values.length/(P/100))!=0})).selectAll("text, line").style("opacity",0),C&&Y.selectAll(".tick text").attr("transform","rotate("+C+" 0,0)").style("text-anchor",C>0?"start":"end"),z.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}b&&(a.scale(n)._ticks(e.utils.calcTicksY(I/36,E)).tickSize(-P,0),z.select(".nv-y.nv-axis").call(a)),N&&(o.width(P).height(I).margin({left:c.left,top:c.top}).svgContainer(L).xScale(t),H.select(".nv-interactive").call(o)),s.dispatch.on("stateChange",(function(t){for(var e in t)S[e]=t[e];F.stateChange(S),B.update()})),l.dispatch.on("legendClick",(function(t,e){if(t.disabled){switch(R=R.map((function(t){return t.disabled=!0,t})),t.disabled=!1,t.key){case"Grouped":case v.grouped:r.stacked(!1);break;case"Stacked":case v.stacked:r.stacked(!0)}S.stacked=r.stacked(),F.stateChange(S),B.update()}})),F.on("changeState",(function(t){void 0!==t.disabled&&(E.forEach((function(e,n){e.disabled=t.disabled[n]})),S.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),S.stacked=t.stacked,_=t.stacked),B.update()})),N?(o.dispatch.on("elementMousemove",(function(e){if(null!=e.pointXValue){var n,r,i,a,s=[];E.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(o,l){r=t.domain().indexOf(e.pointXValue);var u=o.values[r];void 0!==u&&(a=u.x,void 0===n&&(n=u),void 0===i&&(i=e.mouseX),s.push({key:o.key,value:B.y()(u,r),color:h(o,o.seriesIndex),data:o.values[r]}))})),o.tooltip.data({value:a,index:r,series:s})(),o.renderGuideLine(i)}})),o.dispatch.on("elementMouseout",(function(t){o.tooltip.hidden(!0)}))):(r.dispatch.on("elementMouseover.tooltip",(function(t){t.value=B.x()(t.data),t.series={key:t.data.key,value:B.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()})))})),L.renderEnd("multibarchart immediate"),B}return B.dispatch=F,B.multibar=r,B.legend=s,B.controls=l,B.xAxis=i,B.yAxis=a,B.state=S,B.tooltip=u,B.interactiveLayer=o,B.options=e.utils.optionsFunc.bind(B),B._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 m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showControls:{get:function(){return g},set:function(t){g=t}},controlLabels:{get:function(){return v},set:function(t){v=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 D},set:function(t){D=t}},noData:{get:function(){return E},set:function(t){E=t}},reduceXTicks:{get:function(){return w},set:function(t){w=t}},rotateLabels:{get:function(){return C},set:function(t){C=t}},staggerLabels:{get:function(){return M},set:function(t){M=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,d=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 O},set:function(t){O=t,r.duration(O),i.duration(O),a.duration(O),L.reset(O)}},color:{get:function(){return h},set:function(t){h=e.utils.getColor(t),s.color(h)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,a.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return N},set:function(t){N=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()}))}}}),e.utils.inheritOptions(B,r),e.utils.initOptions(B),B},e.models.multiBarHorizontal=function(){"use strict";var t,n,r,i,a,o,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=null,p=d3.scale.ordinal(),h=d3.scale.linear(),g=function(t){return t.x},v=function(t){return t.y},m=function(t){return t.yErr},y=[0],x=e.utils.defaultColor(),b=null,k=!1,w=!1,M=60,A=.1,C=.75,S=d3.format(",.2f"),D=250,E=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),F=e.utils.renderWatch(E,D);function W(d){return F.reset(),d.each((function(d){var D=u-l.left-l.right,W=c-l.top-l.bottom;f=d3.select(this),e.utils.initSVG(f),k&&(d=d3.layout.stack().offset("zero").values((function(t){return t.values})).y(v)(d)),d.forEach((function(t,e){t.values.forEach((function(n){n.series=e,n.key=t.key}))})),k&&d[0].values.map((function(t,e){var n=0,r=0;d.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=n&&r?[]:d.map((function(t){return t.values.map((function(t,e){return{x:g(t,e),y:v(t,e),y0:t.y0,y1:t.y1}}))}));p.domain(n||d3.merge(O).map((function(t){return t.x}))).rangeBands(i||[0,W],A),h.domain(r||d3.extent(d3.merge(O).map((function(t){return k?t.y>0?t.y1+t.y:t.y1:t.y})).concat(y))),w&&!k?h.range(a||[h.domain()[0]<0?M:0,D-(h.domain()[1]>0?M:0)]):h.range(a||[0,D]),o=o||p,s=s||d3.scale.linear().domain(h.domain()).range([h(0),h(0)]);var N=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([d]),L=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),_=(L.append("defs"),L.append("g"));N.select("g"),_.append("g").attr("class","nv-groups"),N.attr("transform","translate("+l.left+","+l.top+")");var B=N.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t,e){return e}));B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),B.exit().watchTransition(F,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),B.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)})),B.watchTransition(F,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",C);var T=B.selectAll("g.nv-bar").data((function(t){return t.values}));T.exit().remove();var P=T.enter().append("g").attr("transform",(function(t,e,n){return"translate("+s(k?t.y0:0)+","+(k?0:n*p.rangeBand()/d.length+p(g(t,e)))+")"}));P.append("rect").attr("width",0).attr("height",p.rangeBand()/(k?1:d.length)),T.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),E.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),E.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mouseout",(function(t,e){E.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})})).on("mousemove",(function(t,e){E.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})})).on("click",(function(t,e){E.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()})).on("dblclick",(function(t,e){E.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()})),m(d[0],0)&&(P.append("polyline"),T.select("polyline").attr("fill","none").attr("points",(function(t,e){var n=m(t,e),r=.8*p.rangeBand()/(2*(k?1:d.length));return[[(n=(n=n.length?n:[-Math.abs(n),Math.abs(n)]).map((function(n){return h(n+(v(t,e)<0?0:v(t,e)))-h(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, "+p.rangeBand()/(2*(k?1:d.length))+")"}))),P.append("text"),w&&!k?(T.select("text").attr("text-anchor",(function(t,e){return v(t,e)<0?"end":"start"})).attr("y",p.rangeBand()/(2*d.length)).attr("dy",".32em").text((function(t,e){var n=S(v(t,e)),r=m(t,e);return void 0===r?n:r.length?n+"+"+S(Math.abs(r[1]))+"-"+S(Math.abs(r[0])):n+"±"+S(Math.abs(r))})),T.watchTransition(F,"multibarhorizontal: bars").select("text").attr("x",(function(t,e){return v(t,e)<0?-4:h(v(t,e))-h(0)+4}))):T.selectAll("text").text(""),T.selectAll("text.nv-bar-label").text(""),T.attr("class",(function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"})),b&&(t||(t=d.map((function(){return!0}))),T.style("fill",(function(e,n,r){return d3.rgb(b(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()})).style("stroke",(function(e,n,r){return d3.rgb(b(e,n)).darker(t.map((function(t,e){return e})).filter((function(e,n){return!t[n]}))[r]).toString()}))),k?T.watchTransition(F,"multibarhorizontal: bars").attr("transform",(function(t,e){return"translate("+h(t.y1)+","+p(g(t,e))+")"})).select("rect").attr("width",(function(t,e){return Math.abs(h(v(t,e)+t.y0)-h(t.y0))||0})).attr("height",p.rangeBand()):T.watchTransition(F,"multibarhorizontal: bars").attr("transform",(function(t,e){return"translate("+(v(t,e)<0?h(v(t,e)):h(0))+","+(t.series*p.rangeBand()/d.length+p(g(t,e)))+")"})).select("rect").attr("height",p.rangeBand()/d.length).attr("width",(function(t,e){return Math.max(Math.abs(h(v(t,e))-h(0)),1)||0})),o=p.copy(),s=h.copy()})),F.renderEnd("multibarHorizontal immediate"),W}return W.dispatch=E,W.options=e.utils.optionsFunc.bind(W),W._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 g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},yErr:{get:function(){return m},set:function(t){m=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 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 a},set:function(t){a=t}},forceY:{get:function(){return y},set:function(t){y=t}},stacked:{get:function(){return k},set:function(t){k=t}},showValues:{get:function(){return w},set:function(t){w=t}},disabled:{get:function(){return t},set:function(e){t=e}},id:{get:function(){return d},set:function(t){d=t}},valueFormat:{get:function(){return S},set:function(t){S=t}},valuePadding:{get:function(){return M},set:function(t){M=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 D},set:function(t){D=t,F.reset(D)}},color:{get:function(){return x},set:function(t){x=e.utils.getColor(t)}},barColor:{get:function(){return b},set:function(t){b=t?e.utils.getColor(t):null}}}),e.utils.initOptions(W),W},e.models.multiBarHorizontalChart=function(){"use strict";var t,n,r=e.models.multiBarHorizontal(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend().height(30),s=e.models.legend().height(30),l=e.models.tooltip(),u={top:30,right:20,bottom:50,left:60},c=null,d=null,f=null,p=e.utils.defaultColor(),h=!0,g="top",v={},m=!0,y="top",x=!0,b=!0,k=!1,w=e.utils.state(),M=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=function(){return h?180:0},D=250;w.stacked=!1,r.stacked(k),i.orient("left").tickPadding(5).showMaxMin(!1).tickFormat((function(t){return t})),a.orient("bottom").tickFormat(d3.format(",.1f")),l.duration(0).valueFormatter((function(t,e){return a.tickFormat()(t,e)})).headerFormatter((function(t,e){return i.tickFormat()(t,e)})),s.updateState(!1);var E=e.utils.renderWatch(C,D);function F(l){return E.reset(),E.models(r),x&&E.models(i),b&&E.models(a),l.each((function(l){var A=d3.select(this);e.utils.initSVG(A);var E,W=e.utils.availableWidth(d,A,u),O=e.utils.availableHeight(f,A,u);if(F.update=function(){A.transition().duration(D).call(F)},F.container=this,k=r.stacked(),w.setter(function(t){return function(e){void 0!==e.stacked&&(k=e.stacked),void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(l),F.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),stacked:k}}}(l)).update(),w.disabled=l.map((function(t){return!!t.disabled})),!M)for(E in M={},w)w[E]instanceof Array?M[E]=w[E].slice(0):M[E]=w[E];if(!(l&&l.length&&l.filter((function(t){return t.values.length})).length))return e.utils.noData(F,A),F;A.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale().clamp(!0);var N=A.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([l]),L=N.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),_=N.select("g");if(L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),L.append("g").attr("class","nv-barsWrap"),L.append("g").attr("class","nv-legendWrap"),L.append("g").attr("class","nv-controlsWrap"),m?(o.width(W-S()),_.select(".nv-legendWrap").datum(l).call(o),"bottom"===y?(u.bottom=i.height()+o.height(),O=e.utils.availableHeight(f,A,u),_.select(".nv-legendWrap").attr("transform","translate("+S()+","+(O+i.height())+")")):"top"===y&&(c||o.height()===u.top||(u.top=o.height(),O=e.utils.availableHeight(f,A,u)),_.select(".nv-legendWrap").attr("transform","translate("+S()+","+-u.top+")"))):_.select(".nv-legendWrap").selectAll("*").remove(),h){var B=[{key:v.grouped||"Grouped",disabled:r.stacked()},{key:v.stacked||"Stacked",disabled:!r.stacked()}];s.width(S()).color(["#444","#444","#444"]),"bottom"===g?(u.bottom=i.height()+o.height(),O=e.utils.availableHeight(f,A,u),_.select(".nv-controlsWrap").datum(B).attr("transform","translate(0,"+(O+i.height())+")").call(s)):"top"===g&&_.select(".nv-controlsWrap").datum(B).attr("transform","translate(0,"+-u.top+")").call(s)}else _.select(".nv-controlsWrap").selectAll("*").remove();N.attr("transform","translate("+u.left+","+u.top+")"),r.disabled(l.map((function(t){return t.disabled}))).width(W).height(O).color(l.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!l[e].disabled}))),_.select(".nv-barsWrap").datum(l.filter((function(t){return!t.disabled}))).transition().call(r),x&&(i.scale(t)._ticks(e.utils.calcTicksY(O/24,l)).tickSize(-W,0),_.select(".nv-x.nv-axis").call(i),_.select(".nv-x.nv-axis").selectAll("g").selectAll("line, text")),b&&(a.scale(n)._ticks(e.utils.calcTicksX(W/100,l)).tickSize(-O,0),_.select(".nv-y.nv-axis").attr("transform","translate(0,"+O+")"),_.select(".nv-y.nv-axis").call(a)),_.select(".nv-zeroLine line").attr("x1",n(0)).attr("x2",n(0)).attr("y1",0).attr("y2",-O),o.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];C.stateChange(w),F.update()})),s.dispatch.on("legendClick",(function(t,e){if(t.disabled){switch(B=B.map((function(t){return t.disabled=!0,t})),t.disabled=!1,t.key){case"Grouped":case v.grouped:r.stacked(!1);break;case"Stacked":case v.stacked:r.stacked(!0)}w.stacked=r.stacked(),C.stateChange(w),k=r.stacked(),F.update()}})),C.on("changeState",(function(t){void 0!==t.disabled&&(l.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),w.stacked=t.stacked,k=t.stacked),F.update()}))})),E.renderEnd("multibar horizontal chart immediate"),F}return r.dispatch.on("elementMouseover.tooltip",(function(t){t.value=F.x()(t.data),t.series={key:t.data.key,value:F.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()})),F.dispatch=C,F.multibar=r,F.legend=o,F.controls=s,F.xAxis=i,F.yAxis=a,F.state=w,F.tooltip=l,F.options=e.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return d},set:function(t){d=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},controlsPosition:{get:function(){return g},set:function(t){g=t}},showControls:{get:function(){return h},set:function(t){h=t}},controlLabels:{get:function(){return v},set:function(t){v=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 M},set:function(t){M=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 D},set:function(t){D=t,E.reset(D),r.duration(D),i.duration(D),a.duration(D)}},color:{get:function(){return p},set:function(t){p=e.utils.getColor(t),o.color(p)}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),o.color((function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()}))}}}),e.utils.inheritOptions(F,r),e.utils.initOptions(F),F},e.models.multiChart=function(){"use strict";var t,n,r={top:30,right:20,bottom:50,left:60},i=null,a=e.utils.defaultColor(),o=null,s=null,l=!0,u=null,c=function(t){return t.x},d=function(t){return t.y},f="linear",p=!0,h=e.interactiveGuideline(),g=!1,v=" (right axis)",m=250,y=d3.scale.linear(),x=d3.scale.linear(),b=d3.scale.linear(),k=e.models.line().yScale(x).duration(m),w=e.models.line().yScale(b).duration(m),M=e.models.scatter().yScale(x).duration(m),A=e.models.scatter().yScale(b).duration(m),C=e.models.multiBar().stacked(!1).yScale(x).duration(m),S=e.models.multiBar().stacked(!1).yScale(b).duration(m),D=e.models.stackedArea().yScale(x).duration(m),E=e.models.stackedArea().yScale(b).duration(m),F=e.models.axis().scale(y).orient("bottom").tickPadding(5).duration(m),W=e.models.axis().scale(x).orient("left").duration(m),O=e.models.axis().scale(b).orient("right").duration(m),N=e.models.legend().height(30),L=e.models.tooltip(),_=d3.dispatch(),B=[k,w,M,A,C,S,D,E];function T(u){return u.each((function(u){var p=d3.select(this);e.utils.initSVG(p),T.update=function(){p.transition().call(T)},T.container=this;var m=e.utils.availableWidth(o,p,r),_=e.utils.availableHeight(s,p,r),P=u.filter((function(t){return"line"==t.type&&1==t.yAxis})),I=u.filter((function(t){return"line"==t.type&&2==t.yAxis})),H=u.filter((function(t){return"scatter"==t.type&&1==t.yAxis})),V=u.filter((function(t){return"scatter"==t.type&&2==t.yAxis})),z=u.filter((function(t){return"bar"==t.type&&1==t.yAxis})),R=u.filter((function(t){return"bar"==t.type&&2==t.yAxis})),Y=u.filter((function(t){return"area"==t.type&&1==t.yAxis})),j=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 e.utils.noData(T,p),T;p.selectAll(".nv-noData").remove();var G=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:d(t)}}))})),X=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:d(t)}}))}));y.domain(d3.extent(d3.merge(G.concat(X)),(function(t){return t.x}))).range([0,m]);var Z=p.selectAll("g.wrap.multiChart").data([u]),U=Z.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");U.append("g").attr("class","nv-x nv-axis"),U.append("g").attr("class","nv-y1 nv-axis"),U.append("g").attr("class","nv-y2 nv-axis"),U.append("g").attr("class","stack1Wrap"),U.append("g").attr("class","stack2Wrap"),U.append("g").attr("class","bars1Wrap"),U.append("g").attr("class","bars2Wrap"),U.append("g").attr("class","scatters1Wrap"),U.append("g").attr("class","scatters2Wrap"),U.append("g").attr("class","lines1Wrap"),U.append("g").attr("class","lines2Wrap"),U.append("g").attr("class","legendWrap"),U.append("g").attr("class","nv-interactive");var q=Z.select("g"),K=u.map((function(t,e){return u[e].color||a(t,e)}));if(l){var $=N.align()?m/2:m,Q=N.align()?$:0;N.width($),N.color(K),q.select(".legendWrap").datum(u.map((function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=t.originalKey+(1==t.yAxis?"":v),t}))).call(N),i||N.height()===r.top||(r.top=N.height(),_=e.utils.availableHeight(s,p,r)),q.select(".legendWrap").attr("transform","translate("+Q+","+-r.top+")")}else q.select(".legendWrap").selectAll("*").remove();k.width(m).height(_).interpolate(f).color(K.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"line"==u[e].type}))),w.width(m).height(_).interpolate(f).color(K.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"line"==u[e].type}))),M.width(m).height(_).color(K.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"scatter"==u[e].type}))),A.width(m).height(_).color(K.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"scatter"==u[e].type}))),C.width(m).height(_).color(K.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"bar"==u[e].type}))),S.width(m).height(_).color(K.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"bar"==u[e].type}))),D.width(m).height(_).interpolate(f).color(K.filter((function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"area"==u[e].type}))),E.width(m).height(_).interpolate(f).color(K.filter((function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"area"==u[e].type}))),q.attr("transform","translate("+r.left+","+r.top+")");var J=q.select(".lines1Wrap").datum(P.filter((function(t){return!t.disabled}))),tt=q.select(".scatters1Wrap").datum(H.filter((function(t){return!t.disabled}))),et=q.select(".bars1Wrap").datum(z.filter((function(t){return!t.disabled}))),nt=q.select(".stack1Wrap").datum(Y.filter((function(t){return!t.disabled}))),rt=q.select(".lines2Wrap").datum(I.filter((function(t){return!t.disabled}))),it=q.select(".scatters2Wrap").datum(V.filter((function(t){return!t.disabled}))),at=q.select(".bars2Wrap").datum(R.filter((function(t){return!t.disabled}))),ot=q.select(".stack2Wrap").datum(j.filter((function(t){return!t.disabled}))),st=[];C.stacked()&&z.length&&(st=z.filter((function(t){return!t.disabled})).map((function(t){return t.values}))).length>0&&(st=st.reduce((function(t,e){return t.map((function(t,n){return{x:t.x,y:t.y+e[n].y}}))}))),z.length&&st.push({x:0,y:0});var lt=[];function ut(t){var e=2===t.series.yAxis?O:W;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},L.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function ct(t){var e=2===t.series.yAxis?O:W;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},L.duration(100).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function dt(t){var e=2===t.series.yAxis?O:W;t.point.x=D.x()(t.point),t.point.y=D.y()(t.point),L.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function ft(t){var e=2===t.series.yAxis?O:W;t.value=C.x()(t.data),t.series={value:C.y()(t.data),color:t.color,key:t.data.key},L.duration(0).headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter((function(t,n){return e.tickFormat()(t,n)})).data(t).hidden(!1)}function pt(){for(var t=0,e=B.length;t<e;t++){var n=B[t];try{n.clearHighlights()}catch(t){}}}S.stacked()&&R.length&&(lt=R.filter((function(t){return!t.disabled})).map((function(t){return t.values}))).length>0&&(lt=lt.reduce((function(t,e){return t.map((function(t,n){return{x:t.x,y:t.y+e[n].y}}))}))),R.length&<.push({x:0,y:0}),x.domain(t||d3.extent(d3.merge(G).concat(st),(function(t){return t.y}))).range([0,_]),b.domain(n||d3.extent(d3.merge(X).concat(lt),(function(t){return t.y}))).range([0,_]),k.yDomain(x.domain()),M.yDomain(x.domain()),C.yDomain(x.domain()),D.yDomain(x.domain()),w.yDomain(b.domain()),A.yDomain(b.domain()),S.yDomain(b.domain()),E.yDomain(b.domain()),Y.length&&d3.transition(nt).call(D),j.length&&d3.transition(ot).call(E),z.length&&d3.transition(et).call(C),R.length&&d3.transition(at).call(S),P.length&&d3.transition(J).call(k),I.length&&d3.transition(rt).call(w),H.length&&d3.transition(tt).call(M),V.length&&d3.transition(it).call(A),F._ticks(e.utils.calcTicksX(m/100,u)).tickSize(-_,0),q.select(".nv-x.nv-axis").attr("transform","translate(0,"+_+")"),d3.transition(q.select(".nv-x.nv-axis")).call(F),W._ticks(e.utils.calcTicksY(_/36,u)).tickSize(-m,0),d3.transition(q.select(".nv-y1.nv-axis")).call(W),O._ticks(e.utils.calcTicksY(_/36,u)).tickSize(-m,0),d3.transition(q.select(".nv-y2.nv-axis")).call(O),q.select(".nv-y1.nv-axis").classed("nv-disabled",!G.length).attr("transform","translate("+y.range()[0]+",0)"),q.select(".nv-y2.nv-axis").classed("nv-disabled",!X.length).attr("transform","translate("+y.range()[1]+",0)"),N.dispatch.on("stateChange",(function(t){T.update()})),g&&(h.width(m).height(_).margin({left:r.left,top:r.top}).svgContainer(p).xScale(y),Z.select(".nv-interactive").call(h)),g?(h.dispatch.on("elementMousemove",(function(t){pt();var n,r,i,o=[];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 T.x()(t,e)>=u[0]&&T.x()(t,e)<=u[1]})),d=c[r=e.interactiveBisect(c,t.pointXValue,T.x())],f=T.y()(d,r);null!==f&&function(t,e,n){for(var r=0,i=B.length;r<i;r++){var a=B[r];try{a.highlightPoint(t,e,n)}catch(t){}}}(l,r,!0),void 0!==d&&(void 0===n&&(n=d),void 0===i&&(i=y(T.x()(d,r))),o.push({key:s.key,value:f,color:a(s,s.seriesIndex),data:d,yAxis:2==s.yAxis?O:W}))})),h.tooltip.headerFormatter((function(t,e){return F.tickFormat()(t,e)})).valueFormatter(h.tooltip.valueFormatter()||function(t,e){var n=o[e].yAxis;return null==t?"N/A":n.tickFormat()(t)}).data({value:T.x()(n,r),index:r,series:o})(),h.renderGuideLine(i)})),h.dispatch.on("elementMouseout",(function(t){pt()}))):(k.dispatch.on("elementMouseover.tooltip",ut),w.dispatch.on("elementMouseover.tooltip",ut),k.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),w.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),M.dispatch.on("elementMouseover.tooltip",ct),A.dispatch.on("elementMouseover.tooltip",ct),M.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),A.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),D.dispatch.on("elementMouseover.tooltip",dt),E.dispatch.on("elementMouseover.tooltip",dt),D.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),E.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),C.dispatch.on("elementMouseover.tooltip",ft),S.dispatch.on("elementMouseover.tooltip",ft),C.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),S.dispatch.on("elementMouseout.tooltip",(function(t){L.hidden(!0)})),C.dispatch.on("elementMousemove.tooltip",(function(t){L()})),S.dispatch.on("elementMousemove.tooltip",(function(t){L()})))})),T}return T.dispatch=_,T.legend=N,T.lines1=k,T.lines2=w,T.scatters1=M,T.scatters2=A,T.bars1=C,T.bars2=S,T.stack1=D,T.stack2=E,T.xAxis=F,T.yAxis1=W,T.yAxis2=O,T.tooltip=L,T.interactiveLayer=h,T.options=e.utils.optionsFunc.bind(T),T._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},yDomain1:{get:function(){return t},set:function(e){t=e}},yDomain2:{get:function(){return n},set:function(t){n=t}},noData:{get:function(){return u},set:function(t){u=t}},interpolate:{get:function(){return f},set:function(t){f=t}},legendRightAxisHint:{get:function(){return v},set:function(t){v=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 a},set:function(t){a=e.utils.getColor(t)}},x:{get:function(){return c},set:function(t){c=t,k.x(t),w.x(t),M.x(t),A.x(t),C.x(t),S.x(t),D.x(t),E.x(t)}},y:{get:function(){return d},set:function(t){d=t,k.y(t),w.y(t),M.y(t),A.y(t),D.y(t),E.y(t),C.y(t),S.y(t)}},useVoronoi:{get:function(){return p},set:function(t){p=t,k.useVoronoi(t),w.useVoronoi(t),D.useVoronoi(t),E.useVoronoi(t)}},useInteractiveGuideline:{get:function(){return g},set:function(t){(g=t)&&(k.interactive(!1),k.useVoronoi(!1),w.interactive(!1),w.useVoronoi(!1),D.interactive(!1),D.useVoronoi(!1),E.interactive(!1),E.useVoronoi(!1),M.interactive(!1),A.interactive(!1))}},duration:{get:function(){return m},set:function(t){m=t,[k,w,D,E,M,A,F,W,O].forEach((function(t){t.duration(m)}))}}}),e.utils.initOptions(T),T},e.models.ohlcBar=function(){"use strict";var t,n,r,i,a={top:0,right:0,bottom:0,left:0},o=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=function(t){return t.open},g=function(t){return t.close},v=function(t){return t.high},m=function(t){return t.low},y=[],x=[],b=!1,k=!0,w=e.utils.defaultColor(),M=!1,A=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function C(M){return M.each((function(M){u=d3.select(this);var C=e.utils.availableWidth(o,u,a),S=e.utils.availableHeight(s,u,a);e.utils.initSVG(u);var D=C/M[0].values.length*.9;c.domain(t||d3.extent(M[0].values.map(f).concat(y))),b?c.range(r||[.5*C/M[0].values.length,C*(M[0].values.length-.5)/M[0].values.length]):c.range(r||[5+D/2,C-D/2-5]),d.domain(n||[d3.min(M[0].values.map(m).concat(x)),d3.max(M[0].values.map(v).concat(x))]).range(i||[S,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])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var E=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([M[0].values]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),W=F.append("defs"),O=F.append("g"),N=E.select("g");O.append("g").attr("class","nv-ticks"),E.attr("transform","translate("+a.left+","+a.top+")"),u.on("click",(function(t,e){A.chartClick({data:t,index:e,pos:d3.event,id:l})})),W.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),E.select("#nv-chart-clip-path-"+l+" rect").attr("width",C).attr("height",S),N.attr("clip-path",k?"url(#nv-chart-clip-path-"+l+")":"");var L=E.select(".nv-ticks").selectAll(".nv-tick").data((function(t){return t}));L.exit().remove(),L.enter().append("path").attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})).attr("d",(function(t,e){return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-D/2+",0l"+D/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+D/2+",0l"+-D/2+",0z"})).attr("transform",(function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"})).attr("fill",(function(t,e){return w[0]})).attr("stroke",(function(t,e){return w[0]})).attr("x",0).attr("y",(function(t,e){return d(Math.max(0,p(t,e)))})).attr("height",(function(t,e){return Math.abs(d(p(t,e))-d(0))})),L.attr("class",(function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e})),d3.transition(L).attr("transform",(function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"})).attr("d",(function(t,e){var n=C/M[0].values.length*.9;return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-n/2+",0l"+n/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(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=e.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return o},set:function(t){o=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 d},set:function(t){d=t}},xDomain:{get:function(){return t},set:function(e){t=e}},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 k},set:function(t){k=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return M},set:function(t){M=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return a},set:function(t){a.top=null!=t.top?t.top:a.top,a.right=null!=t.right?t.right:a.right,a.bottom=null!=t.bottom?t.bottom:a.bottom,a.left=null!=t.left?t.left:a.left}},color:{get:function(){return w},set:function(t){w=e.utils.getColor(t)}}}),e.utils.initOptions(C),C},e.models.parallelCoordinates=function(){"use strict";var t,n,r,i={top:30,right:0,bottom:10,left:0},a=null,o=null,s=null,l=null,u=d3.scale.ordinal(),c={},d="undefined values",f=[],p=[],h=[],g=!0,v=e.utils.defaultColor(),m=[],y=[],x=[],b=[],k=1,w=d3.svg.line(),M=d3.svg.axis(),A=d3.dispatch("brushstart","brush","brushEnd","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),C=e.utils.renderWatch(A);function S(D){return C.reset(),D.each((function(C){var S=d3.select(this);if(s=e.utils.availableWidth(a,S,i),l=e.utils.availableHeight(o,S,i),e.utils.initSVG(S),void 0===C[0].values){var D=[];C.forEach((function(t){var e={};Object.keys(t).forEach((function(n){"name"!==n&&(e[n]=t[n])})),D.push({key:t.name,values:e})})),C=D}var E=C.map((function(t){return t.values}));0===y.length&&(y=C),h=f.sort((function(t,e){return t.currentPosition-e.currentPosition})).map((function(t){return t.key})),p=f.filter((function(t){return!t.disabled})),u.rangePoints([0,s],1).domain(p.map((function(t){return t.key})));var F={},W=!1,O=[];h.forEach((function(t){var e=d3.extent(E,(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 a=m.filter((function(e){return e.dimension==t}));0!==a.length&&(i?(n=c[t].domain()[0],r=c[t].domain()[1]):!a[0].hasOnlyNaN&&g?(n=n>a[0].extent[0]?a[0].extent[0]:n,r=r<a[0].extent[1]?a[0].extent[1]:r):a[0].hasNaN&&(r=r<a[0].extent[1]?a[0].extent[1]:r,F[t]=c[t].domain()[1],W=!0)),c[t]=d3.scale.linear().domain([n,r]).range([.9*(l-12),0]),b=[],c[t].brush=d3.svg.brush().y(c[t]).on("brushstart",X).on("brush",Z).on("brushend",U)}));var N=S.selectAll("g.nv-wrap.nv-parallelCoordinates").data([C]),L=N.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinates").append("g"),_=N.select("g");L.append("g").attr("class","nv-parallelCoordinates background"),L.append("g").attr("class","nv-parallelCoordinates foreground"),L.append("g").attr("class","nv-parallelCoordinates missingValuesline"),N.attr("transform","translate("+i.left+","+i.top+")"),w.interpolate("cardinal").tension(k),M.orient("left");var B,T,P=d3.behavior.drag().on("dragstart",(function(t){x[t.key]=this.parentNode.__origin__=u(t.key),n.attr("visibility","hidden")})).on("drag",(function(e){x[e.key]=Math.min(s,Math.max(0,this.parentNode.__origin__+=d3.event.x)),t.attr("d",j),p.sort((function(t,e){return K(t.key)-K(e.key)})),p.forEach((function(t,e){return t.currentPosition=e})),u.domain(p.map((function(t){return t.key}))),r.attr("transform",(function(t){return"translate("+K(t.key)+")"}))})).on("dragend",(function(e,r){delete this.parentNode.__origin__,delete x[e.key],d3.select(this.parentNode).attr("transform","translate("+u(e.key)+")"),t.attr("d",j),n.attr("d",j).attr("visibility",null),A.dimensionsOrder(p)})),I=u.range()[1]-u.range()[0];if(I=isNaN(I)?u.range()[0]:I,!isNaN(I)){var H=[0+I/2,l-12,s-I/2,l-12];(B=N.select(".missingValuesline").selectAll("line").data([H])).enter().append("line"),B.exit().remove(),B.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]})),(T=N.select(".missingValuesline").selectAll("text").data([d])).append("text").data([d]),T.enter().append("text"),T.exit().remove(),T.attr("y",l).attr("x",s-92-I/2).text((function(t){return t}))}(n=N.select(".background").selectAll("path").data(C)).enter().append("path"),n.exit().remove(),n.attr("d",j),(t=N.select(".foreground").selectAll("path").data(C)).enter().append("path"),t.exit().remove(),t.attr("d",j).style("stroke-width",(function(t,e){return isNaN(t.strokeWidth)&&(t.strokeWidth=1),t.strokeWidth})).attr("stroke",(function(t,e){return t.color||v(t,e)})),t.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0).style("stroke-width",t.strokeWidth+2+"px").style("stroke-opacity",1),A.elementMouseover({label:t.name,color:t.color||v(t,e),values:t.values,dimensions:p})})),t.on("mouseout",(function(t,e){d3.select(this).classed("hover",!1).style("stroke-width",t.strokeWidth+"px").style("stroke-opacity",.7),A.elementMouseout({label:t.name,index:e})})),t.on("mousemove",(function(t,e){A.elementMousemove()})),t.on("click",(function(t){A.elementClick({id:t.id})}));var V=(r=_.selectAll(".dimension").data(p)).enter().append("g").attr("class","nv-parallelCoordinates dimension");r.attr("transform",(function(t){return"translate("+u(t.key)+",0)"})),V.append("g").attr("class","nv-axis"),V.append("text").attr("class","nv-label").style("cursor","move").attr("dy","-1em").attr("text-anchor","middle").on("mouseover",(function(t,e){A.elementMouseover({label:t.tooltip||t.key,color:t.color})})).on("mouseout",(function(t,e){A.elementMouseout({label:t.tooltip})})).on("mousemove",(function(t,e){A.elementMousemove()})).call(P),V.append("g").attr("class","nv-brushBackground"),r.exit().remove(),r.select(".nv-label").text((function(t){return t.key})),G(g);var z=h.filter((function(t){return!c[t].brush.empty()})),R=z.map((function(t){return c[t].brush.extent()})),Y=y.slice(0);function j(t){return w(p.map((function(e){if(isNaN(t.values[e.key])||isNaN(parseFloat(t.values[e.key]))||W){var n=c[e.key].domain(),r=c[e.key].range(),i=n[0]-(n[1]-n[0])/9;if(b.indexOf(e.key)<0){var a=d3.scale.linear().domain([i,n[1]]).range([l-12,r[1]]);c[e.key].brush.y(a),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!==B&&(b.length>0||W?(B.style("display","inline"),T.style("display","inline")):(B.style("display","none"),T.style("display","none"))),[u(e.key),c[e.key](t.values[e.key])]})))}function G(t){m.forEach((function(e){var n=c[e.dimension].brush.y().domain();e.hasOnlyNaN&&(e.extent[1]=(c[e.dimension].domain()[1]-n[0])*(e.extent[1]-e.extent[0])/(F[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),q()}function X(){!1===g&&(g=!0,G(!0))}function Z(){z=h.filter((function(t){return!c[t].brush.empty()})),R=z.map((function(t){return c[t].brush.extent()})),m=[],z.forEach((function(t,e){m[e]={dimension:t,extent:R[e],hasNaN:!1,hasOnlyNaN:!1}})),y=[],t.style("display",(function(t){var e=z.every((function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||R[n][0]!=c[e].brush.y().domain()[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"})),q(),A.brush({filters:m,active:y})}function U(){var t=z.length>0;m.forEach((function(t){t.extent[0]===c[t.dimension].brush.y().domain()[0]&&b.indexOf(t.dimension)>=0&&(t.hasNaN=!0),t.extent[1]<c[t.dimension].domain()[0]&&(t.hasOnlyNaN=!0)})),A.brushEnd(y,t)}function q(){r.select(".nv-axis").each((function(t,e){var n=m.filter((function(e){return e.dimension==t.key}));O[t.key]=c[t.key].domain(),0!=n.length&&g&&(O[t.key]=[],n[0].extent[1]>c[t.key].domain()[0]&&(O[t.key]=[n[0].extent[1]]),n[0].extent[0]>=c[t.key].domain()[0]&&O[t.key].push(n[0].extent[0])),d3.select(this).call(M.scale(c[t.key]).tickFormat(t.format).tickValues(O[t.key]))}))}function K(t){var e=x[t];return null==e?u(t):e}y=[],t.style("display",(function(t){var e=z.every((function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||R[n][0]!=c[e].brush.y().domain()[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"})),(m.length>0||!e.utils.arrayEquals(y,Y))&&A.activeChanged(y)})),S}return S.dispatch=A,S.options=e.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return o},set:function(t){o=t}},dimensionData:{get:function(){return f},set:function(t){f=t}},displayBrush:{get:function(){return g},set:function(t){g=t}},filters:{get:function(){return m},set:function(t){m=t}},active:{get:function(){return y},set:function(t){y=t}},lineTension:{get:function(){return k},set:function(t){k=t}},undefinedValuesLabel:{get:function(){return d},set:function(t){d=t}},dimensions:{get:function(){return f.map((function(t){return t.key}))},set:function(t){e.deprecated("dimensions","use dimensionData instead"),0===f.length?t.forEach((function(t){f.push({key:t})})):t.forEach((function(t,e){f[e].key=t}))}},dimensionNames:{get:function(){return f.map((function(t){return t.key}))},set:function(t){e.deprecated("dimensionNames","use dimensionData instead"),h=[],0===f.length?t.forEach((function(t){f.push({key:t})})):t.forEach((function(t,e){f[e].key=t}))}},dimensionFormats:{get:function(){return f.map((function(t){return t.format}))},set:function(t){e.deprecated("dimensionFormats","use dimensionData instead"),0===f.length?t.forEach((function(t){f.push({format:t})})):t.forEach((function(t,e){f[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 v},set:function(t){v=e.utils.getColor(t)}}}),e.utils.initOptions(S),S},e.models.parallelCoordinatesChart=function(){"use strict";var t=e.models.parallelCoordinates(),n=e.models.legend(),r=e.models.tooltip(),i=(e.models.tooltip(),{top:0,right:0,bottom:0,left:0}),a=null,o=null,s=null,l=!0,u=e.utils.defaultColor(),c=e.utils.state(),d=[],f=!0,p=null,h=null,g="undefined",v=d3.dispatch("dimensionsOrder","brushEnd","stateChange","changeState","renderEnd"),m=e.utils.renderWatch(v);function y(r){return m.reset(),m.models(t),r.each((function(r){var u=d3.select(this);e.utils.initSVG(u);var h,g=e.utils.availableWidth(o,u,i),m=e.utils.availableHeight(s,u,i);if(y.update=function(){u.call(y)},y.container=this,c.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(d),y.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(d)).update(),c.disabled=d.map((function(t){return!!t.disabled})),(d=d.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})),!p)for(h in p={},c)c[h]instanceof Array?p[h]=c[h].slice(0):p[h]=c[h];if(!r||!r.length)return e.utils.noData(y,u),y;u.selectAll(".nv-noData").remove();var x=u.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([r]),b=x.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart").append("g"),k=x.select("g");b.append("g").attr("class","nv-parallelCoordinatesWrap"),b.append("g").attr("class","nv-legendWrap"),k.select("rect").attr("width",g).attr("height",m>0?m:0),l?(n.width(g).color((function(t){return"rgb(188,190,192)"})),k.select(".nv-legendWrap").datum(d.sort((function(t,e){return t.originalPosition-e.originalPosition}))).call(n),a||n.height()===i.top||(i.top=n.height(),m=e.utils.availableHeight(s,u,i)),x.select(".nv-legendWrap").attr("transform","translate( 0 ,"+-i.top+")")):k.select(".nv-legendWrap").selectAll("*").remove(),x.attr("transform","translate("+i.left+","+i.top+")"),t.width(g).height(m).dimensionData(d).displayBrush(f),k.select(".nv-parallelCoordinatesWrap ").datum(r).transition().call(t),t.dispatch.on("brushEnd",(function(t,e){e?(f=!0,v.brushEnd(t)):f=!1})),n.dispatch.on("stateChange",(function(t){for(var e in t)c[e]=t[e];v.stateChange(c),y.update()})),t.dispatch.on("dimensionsOrder",(function(t){d.sort((function(t,e){return t.currentPosition-e.currentPosition}));var e=!1;d.forEach((function(t,n){t.currentPosition=n,t.currentPosition!==t.originalPosition&&(e=!0)})),v.dimensionsOrder(d,e)})),v.on("changeState",(function(t){void 0!==t.disabled&&(d.forEach((function(e,n){e.disabled=t.disabled[n]})),c.disabled=t.disabled),y.update()}))})),m.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>"})),t.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]))?g: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)})),t.dispatch.on("elementMouseout.tooltip",(function(t){r.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(){r()})),y.dispatch=v,y.parallelCoordinates=t,y.legend=n,y.tooltip=r,y.options=e.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return o},set:function(t){o=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 p},set:function(t){p=t}},dimensionData:{get:function(){return d},set:function(t){d=t}},displayBrush:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return h},set:function(t){h=t}},nanValue:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,a=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=e.utils.getColor(r),n.color(u),t.color(u)}}}),e.utils.inheritOptions(y,t),e.utils.initOptions(y),y},e.models.pie=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},n=500,r=500,i=function(t){return t.x},a=function(t){return t.y},o=Math.floor(1e4*Math.random()),s=null,l=e.utils.defaultColor(),u=d3.format(",.2f"),c=!0,d=!1,f="key",p=.02,h=!1,g=!1,v=!1,m=!0,y=0,x=!1,b=!1,k=!1,w=!1,M=0,A=.5,C=250,S=[],D=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=[],F=[],W=e.utils.renderWatch(D);function O(N){return W.reset(),N.each((function(O){var N=n-t.left-t.right,L=r-t.top-t.bottom,_=Math.min(N,L)/2,B=[],T=[];if(s=d3.select(this),0===S.length)for(var P=_-_/10,I=A*_,H=0;H<O[0].length;H++)B.push(P),T.push(I);else m?(B=S.map((function(t){return(t.outer-t.outer/10)*_})),T=S.map((function(t){return(t.inner-t.inner/10)*_})),A=d3.min(S.map((function(t){return t.inner-t.inner/10})))):(B=S.map((function(t){return t.outer*_})),T=S.map((function(t){return t.inner*_})),A=d3.min(S.map((function(t){return t.inner}))));e.utils.initSVG(s);var V=s.selectAll(".nv-wrap.nv-pie").data(O),z=V.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+o).append("g"),R=V.select("g"),Y=z.append("g").attr("class","nv-pie");for(z.append("g").attr("class","nv-pieLabels"),V.attr("transform","translate("+t.left+","+t.top+")"),R.select(".nv-pie").attr("transform","translate("+N/2+","+L/2+")"),R.select(".nv-pieLabels").attr("transform","translate("+N/2+","+L/2+")"),s.on("click",(function(t,e){D.chartClick({data:t,index:e,pos:d3.event,id:o})})),E=[],F=[],H=0;H<O[0].length;H++){var j=d3.svg.arc().outerRadius(B[H]),G=d3.svg.arc().outerRadius(B[H]+5);!1!==b&&(j.startAngle(b),G.startAngle(b)),!1!==w&&(j.endAngle(w),G.endAngle(w)),g&&(j.innerRadius(T[H]),G.innerRadius(T[H])),j.cornerRadius&&M&&(j.cornerRadius(M),G.cornerRadius(M)),E.push(j),F.push(G)}var X=d3.layout.pie().sort(null).value((function(t){return t.disabled?0:a(t)}));X.padAngle&&k&&X.padAngle(k),g&&v&&(Y.append("text").attr("class","nv-pie-title"),V.select(".nv-pie-title").style("text-anchor","middle").text((function(t){return v})).style("font-size",Math.min(N,L)*A*2/(v.length+2)+"px").attr("dy","0.35em").attr("transform",(function(t,e){return"translate(0, "+y+")"})));var Z=V.select(".nv-pie").selectAll(".nv-slice").data(X),U=V.select(".nv-pieLabels").selectAll(".nv-label").data(X);Z.exit().remove(),U.exit().remove();var q=Z.enter().append("g");if(q.attr("class","nv-slice"),q.on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),m&&d3.select(this).select("path").transition().duration(70).attr("d",F[e]),D.elementMouseover({data:t.data,index:e,color:d3.select(this).style("fill"),percent:(t.endAngle-t.startAngle)/(2*Math.PI)})})),q.on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),m&&d3.select(this).select("path").transition().duration(50).attr("d",E[e]),D.elementMouseout({data:t.data,index:e})})),q.on("mousemove",(function(t,e){D.elementMousemove({data:t.data,index:e})})),q.on("click",(function(t,e){D.elementClick({data:t.data,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this})})),q.on("dblclick",(function(t,e){D.elementDblClick({data:t.data,index:e,color:d3.select(this).style("fill")})})),Z.attr("fill",(function(t,e){return l(t.data,e)})),Z.attr("stroke",(function(t,e){return l(t.data,e)})),q.append("path").each((function(t){this._current=t})),Z.select("path").transition().duration(C).attr("d",(function(t,e){return E[e](t)})).attrTween("d",(function(t,e){t.endAngle=isNaN(t.endAngle)?0:t.endAngle,t.startAngle=isNaN(t.startAngle)?0:t.startAngle,g||(t.innerRadius=0);var n=d3.interpolate(this._current,t);return this._current=n(0),function(t){return E[e](n(t))}})),c){var K=[];for(H=0;H<O[0].length;H++)K.push(E[H]),d?g&&(K[H]=d3.svg.arc().outerRadius(E[H].outerRadius()),!1!==b&&K[H].startAngle(b),!1!==w&&K[H].endAngle(w)):g||K[H].innerRadius(0);U.enter().append("g").classed("nv-label",!0).each((function(t,e){var n=d3.select(this);n.attr("transform",(function(t,e){if(x){t.outerRadius=B[e]+10,t.innerRadius=B[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("+K[e].centroid(t)+") rotate("+n+")"}return t.outerRadius=_+10,t.innerRadius=_+15,"translate("+K[e].centroid(t)+")"})),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")}));var $={},Q=function(t){return 140*Math.floor(t[0]/140)+","+14*Math.floor(t[1]/14)},J=function(t){return(t.endAngle-t.startAngle)/(2*Math.PI)};U.watchTransition(W,"pie labels").attr("transform",(function(t,e){if(x){t.outerRadius=B[e]+10,t.innerRadius=B[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("+K[e].centroid(t)+") rotate("+n+")"}t.outerRadius=_+10,t.innerRadius=_+15;var r=K[e].centroid(t),i=J(t);if(t.value&&i>=p){var a=Q(r);$[a]&&(r[1]-=14),$[Q(r)]=!0}return"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=J(t),r="";if(!t.value||n<p)return"";if("function"==typeof f)r=f(t,e,{key:i(t.data),value:a(t.data),percent:u(n)});else switch(f){case"key":r=i(t.data);break;case"value":r=u(a(t.data));break;case"percent":r=d3.format("%")(n)}return r})),h&&U.each((function(t,n){if(this.getBBox){var r=this.getBBox(),i=K[n].centroid(t),a={x:i[0]+r.x,y:i[1]+r.y},o={x:a.x+r.width,y:a.y},s={x:a.x,y:a.y+r.height},l={x:a.x+r.width,y:a.y+r.height};t.visible=e.utils.pointIsInArc(a,t,j)&&e.utils.pointIsInArc(o,t,j)&&e.utils.pointIsInArc(s,t,j)&&e.utils.pointIsInArc(l,t,j)}})).style("display",(function(t){return t.visible?null:"none"}))}})),W.renderEnd("pie immediate"),O}return O.dispatch=D,O.options=e.utils.optionsFunc.bind(O),O._options=Object.create({},{arcsRadius:{get:function(){return S},set:function(t){S=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 v},set:function(t){v=t}},titleOffset:{get:function(){return y},set:function(t){y=t}},labelThreshold:{get:function(){return p},set:function(t){p=t}},hideOverlapLabels:{get:function(){return h},set:function(t){h=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 o},set:function(t){o=t}},endAngle:{get:function(){return w},set:function(t){w=t}},startAngle:{get:function(){return b},set:function(t){b=t}},padAngle:{get:function(){return k},set:function(t){k=t}},cornerRadius:{get:function(){return M},set:function(t){M=t}},donutRatio:{get:function(){return A},set:function(t){A=t}},labelsOutside:{get:function(){return d},set:function(t){d=t}},labelSunbeamLayout:{get:function(){return x},set:function(t){x=t}},donut:{get:function(){return g},set:function(t){g=t}},growOnHover:{get:function(){return m},set:function(t){m=t}},pieLabelsOutside:{get:function(){return d},set:function(t){d=t,e.deprecated("pieLabelsOutside","use labelsOutside instead")}},donutLabelsOutside:{get:function(){return d},set:function(t){d=t,e.deprecated("donutLabelsOutside","use labelsOutside instead")}},labelFormat:{get:function(){return u},set:function(t){u=t,e.deprecated("labelFormat","use valueFormat instead")}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},duration:{get:function(){return C},set:function(t){C=t,W.reset(C)}},y:{get:function(){return a},set:function(t){a=d3.functor(t)}},color:{get:function(){return l},set:function(t){l=e.utils.getColor(t)}},labelType:{get:function(){return f},set:function(t){f=t||"key"}}}),e.utils.initOptions(O),O},e.models.pieChart=function(){"use strict";var t=e.models.pie(),n=e.models.legend(),r=e.models.tooltip(),i={top:30,right:20,bottom:20,left:20},a=null,o=null,s=null,l=!1,u=!0,c="top",d=e.utils.defaultColor(),f=e.utils.state(),p=null,h=null,g=250,v=d3.dispatch("stateChange","changeState","renderEnd");r.duration(0).headerEnabled(!1).valueFormatter((function(e,n){return t.valueFormat()(e,n)}));var m=e.utils.renderWatch(v);function y(r){return m.reset(),m.models(t),r.each((function(r){var l=d3.select(this);e.utils.initSVG(l);var d,h=e.utils.availableWidth(o,l,i),g=e.utils.availableHeight(s,l,i);if(y.update=function(){l.transition().call(y)},y.container=this,f.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(r),y.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(r)).update(),f.disabled=r.map((function(t){return!!t.disabled})),!p)for(d in p={},f)f[d]instanceof Array?p[d]=f[d].slice(0):p[d]=f[d];if(!r||!r.length)return e.utils.noData(y,l),y;l.selectAll(".nv-noData").remove();var m=l.selectAll("g.nv-wrap.nv-pieChart").data([r]),x=m.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),b=m.select("g");if(x.append("g").attr("class","nv-pieWrap"),x.append("g").attr("class","nv-legendWrap"),u)if("top"===c)n.width(h).key(t.x()),m.select(".nv-legendWrap").datum(r).call(n),a||n.height()===i.top||(i.top=n.height(),g=e.utils.availableHeight(s,l,i)),m.select(".nv-legendWrap").attr("transform","translate(0,"+-i.top+")");else if("right"===c){var k=e.models.legend().width();h/2<k&&(k=h/2),n.height(g).key(t.x()),n.width(k),h-=n.width(),m.select(".nv-legendWrap").datum(r).call(n).attr("transform","translate("+h+",0)")}else"bottom"===c&&(n.width(h).key(t.x()),m.select(".nv-legendWrap").datum(r).call(n),i.bottom=n.height(),g=e.utils.availableHeight(s,l,i),m.select(".nv-legendWrap").attr("transform","translate(0,"+g+")"));else b.select(".nv-legendWrap").selectAll("*").remove();m.attr("transform","translate("+i.left+","+i.top+")"),t.width(h).height(g);var w=b.select(".nv-pieWrap").datum([r]);d3.transition(w).call(t),n.dispatch.on("stateChange",(function(t){for(var e in t)f[e]=t[e];v.stateChange(f),y.update()})),v.on("changeState",(function(t){void 0!==t.disabled&&(r.forEach((function(e,n){e.disabled=t.disabled[n]})),f.disabled=t.disabled),y.update()}))})),m.renderEnd("pieChart immediate"),y}return t.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)})),t.dispatch.on("elementMouseout.tooltip",(function(t){r.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){r()})),y.legend=n,y.dispatch=v,y.pie=t,y.tooltip=r,y.options=e.utils.optionsFunc.bind(y),y._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return s},set:function(t){s=t}},noData:{get:function(){return h},set:function(t){h=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 p},set:function(t){p=t}},color:{get:function(){return d},set:function(e){d=e,n.color(d),t.color(d)}},duration:{get:function(){return g},set:function(e){g=e,m.reset(g),t.duration(g)}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,a=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}}}),e.utils.inheritOptions(y,t),e.utils.initOptions(y),y},e.models.sankey=function(){"use strict";var t={},n=24,r=8,i=[1,1],a=[],o=[],s=!0,l=function(t){a.forEach((function(t){t.sourceLinks=[],t.targetLinks=[]})),o.forEach((function(t){var e=t.source,n=t.target;"number"==typeof e&&(e=t.source=a[t.source]),"number"==typeof n&&(n=t.target=a[t.target]),e.sourceLinks.push(t),n.targetLinks.push(t)})),a.forEach((function(t){t.value=Math.max(d3.sum(t.sourceLinks,f),d3.sum(t.targetLinks,f))})),function(){for(var t,e,r=a,o=0;r.length&&o<a.length;)t=[],r.forEach((function(e){e.x=o,e.dx=n,e.sourceLinks.forEach((function(e){t.indexOf(e.target)<0&&t.push(e.target)}))})),r=t,++o;s&&function(t){a.forEach((function(e){e.sourceLinks.length||(e.x=t-1)}))}(o),e=(i[0]-n)/(o-1),a.forEach((function(t){t.x*=e}))}(),function(t){var e,n=d3.nest().key((function(t){return t.x})).sortKeys(d3.ascending).entries(a).map((function(t){return t.values}));e=d3.min(n,(function(t){return(i[1]-(t.length-1)*r)/d3.sum(t,f)})),n.forEach((function(t){t.forEach((function(t,n){t.y=n,t.dy=t.value*e}))})),o.forEach((function(t){t.dy=t.value*e})),p(),d();for(var s=1;t>0;--t)u(s*=.99),p(),d(),l(s),p(),d();function l(t){function e(t){return(t.source.y+t.sy+t.dy/2)*t.value}n.forEach((function(n,r){n.forEach((function(n){if(n.targetLinks.length){var r=d3.sum(n.targetLinks,e)/d3.sum(n.targetLinks,f);n.y+=(r-c(n))*t}}))}))}function u(t){function e(t){return(t.target.y+t.ty+t.dy/2)*t.value}n.slice().reverse().forEach((function(n){n.forEach((function(n){if(n.sourceLinks.length){var r=d3.sum(n.sourceLinks,e)/d3.sum(n.sourceLinks,f);n.y+=(r-c(n))*t}}))}))}function p(){n.forEach((function(t){var e,n,a,o=0,s=t.length;for(t.sort(h),a=0;a<s;++a)(n=o-(e=t[a]).y)>0&&(e.y+=n),o=e.y+e.dy+r;if((n=o-r-i[1])>0)for(o=e.y-=n,a=s-2;a>=0;--a)(n=(e=t[a]).y+e.dy+r-o)>0&&(e.y-=n),o=e.y}))}function h(t,e){return t.y-e.y}}(t)},u=function(){var t=.5;function e(e){var n=e.source.x+e.source.dx,r=e.target.x,i=d3.interpolateNumber(n,r),a=i(t),o=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"+a+","+s+" "+o+","+l+" "+r+","+l}return e.curvature=function(n){return arguments.length?(t=+n,e):t},e},c=function(t){return t.y+t.dy/2};function d(){function t(t,e){return t.source.y-e.source.y}function e(t,e){return t.target.y-e.target.y}a.forEach((function(n){n.sourceLinks.sort(e),n.targetLinks.sort(t)})),a.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 f(t){return t.value}return t.options=e.utils.optionsFunc.bind(t),t._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 a},set:function(t){a=t}},links:{get:function(){return o},set:function(t){o=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(){d()},set:function(t){}},center:{get:function(){return c()},set:function(t){"function"==typeof t&&(c=t)}},link:{get:function(){return u()},set:function(t){return"function"==typeof t&&(u=t),u()}}}),e.utils.initOptions(t),t},e.models.sankeyChart=function(){"use strict";var t={top:5,right:0,bottom:5,left:0},n=e.models.sankey(),r=600,i=400,a=36,o=40,s="units",l=void 0,u=d3.format(",.0f"),c=function(t){return u(t)+" "+s},d=d3.scale.category20(),f=function(t){return t.source.name+" → "+t.target.name+"\n"+c(t.value)},p=function(t){return t.color=d(t.name.replace(/ .*/,""))},h=function(t){return d3.rgb(t.color).darker(2)},g=function(t){return t.name+"\n"+c(t.value)},v=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 m(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)),v(t,"Error loading chart, data is invalid"),!1;if(!c)return v(t,"No data available"),!1;var d=t.append("svg").attr("width",r).attr("height",i).append("g").attr("class","nvd3 nv-wrap nv-sankeyChart");n.nodeWidth(a).nodePadding(o).size([r,i]);var m=n.link();n.nodes(e.nodes).links(e.links).layout(32).center(l);var y=d.append("g").selectAll(".link").data(e.links).enter().append("path").attr("class","link").attr("d",m).style("stroke-width",(function(t){return Math.max(1,t.dy)})).sort((function(t,e){return e.dy-t.dy}));y.append("title").text(f);var x=d.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.behavior.drag().origin((function(t){return t})).on("dragstart",(function(){this.parentNode.appendChild(this)})).on("drag",(function(t){d3.select(this).attr("transform","translate("+t.x+","+(t.y=Math.max(0,Math.min(i-t.dy,d3.event.y)))+")"),n.relayout(),y.attr("d",m)})));x.append("rect").attr("height",(function(t){return t.dy})).attr("width",n.nodeWidth()).style("fill",p).style("stroke",h).append("title").text(g),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")})),m}return m.options=e.utils.optionsFunc.bind(m),m._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 f},set:function(t){f=t}},nodeWidth:{get:function(){return a},set:function(t){a=t}},nodePadding:{get:function(){return o},set:function(t){o=t}},center:{get:function(){return l},set:function(t){l=t}},margin:{get:function(){return t},set:function(e){t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left}},nodeStyle:{get:function(){return{}},set:function(t){p=void 0!==t.fillColor?t.fillColor:p,h=void 0!==t.strokeColor?t.strokeColor:h,g=void 0!==t.title?t.title:g}}}),e.utils.initOptions(m),m},e.models.scatter=function(){"use strict";var t,n,r,i,a,o,s,l,u={top:0,right:0,bottom:0,left:0},c=null,d=null,f=e.utils.defaultColor(),p=null,h=Math.floor(1e5*Math.random()),g=null,v=d3.scale.linear(),m=d3.scale.linear(),y=d3.scale.linear(),x=function(t){return t.x},b=function(t){return t.y},k=function(t){return t.size||1},w=function(t){return t.shape||"circle"},M=[],A=[],C=[],S=!0,D=function(t){return!t.notActive},E=!1,F=.1,W=!1,O=!0,N=!1,L=function(){return 25},_=null,B=null,T=null,P=null,I=null,H=null,V=!1,z=d3.dispatch("elementClick","elementDblClick","elementMouseover","elementMouseout","renderEnd"),R=!0,Y=250,j=300,G=!1,X=!1,Z=e.utils.renderWatch(z,Y),U=[16,256],q={};function K(t){var e;return e=t[0].series+":"+t[1],q[e]=q[e]||{}}function $(t){var e;e=t[0].series+":"+t[1],delete q[e]}function Q(t){var e,n,r,i=K(t),a=!1;for(e=1;e<arguments.length;e+=2)n=arguments[e],r=arguments[e+1](t[0],t[1]),i[n]===r&&i.hasOwnProperty(n)||(i[n]=r,a=!0);return a}function J(Y){return Z.reset(),Y.each((function(Y){g=d3.select(this);var q=e.utils.availableWidth(c,g,u),K=e.utils.availableHeight(d,g,u);e.utils.initSVG(g),Y.forEach((function(t,e){t.values.forEach((function(t){t.series=e}))}));var tt="function"==typeof J.yScale().base,et=_&&B&&I?[]:d3.merge(Y.map((function(t){return t.values.map((function(t,e){return{x:x(t,e),y:b(t,e),size:k(t,e)}}))})));if(v.domain(_||d3.extent(et.map((function(t){return t.x})).concat(M))),E&&Y[0]?v.range(T||[(q*F+q)/(2*Y[0].values.length),q-q*(1+F)/(2*Y[0].values.length)]):v.range(T||[0,q]),tt){var nt=d3.min(et.map((function(t){if(0!==t.y)return t.y})));m.clamp(!0).domain(B||d3.extent(et.map((function(t){return 0!==t.y?t.y:.1*nt})).concat(A))).range(P||[K,0])}else m.domain(B||d3.extent(et.map((function(t){return t.y})).concat(A))).range(P||[K,0]);y.domain(I||d3.extent(et.map((function(t){return t.size})).concat(C))).range(H||U),V=v.domain()[0]===v.domain()[1]||m.domain()[0]===m.domain()[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])),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])),isNaN(v.domain()[0])&&v.domain([-1,1]),isNaN(m.domain()[0])&&m.domain([-1,1]),t=t||v,n=n||m,r=r||y;var rt=v(1)!==t(1)||m(1)!==n(1)||y(1)!==r(1);s=s||d;var it=(o=o||c)!==c||s!==d,at=(i=i||[])[0]!==v.domain()[0]||i[1]!==v.domain()[1];i=v.domain(),a=a||[],at=at||a[0]!==m.domain()[0]||a[1]!==m.domain()[1],a=m.domain();var ot=g.selectAll("g.nv-wrap.nv-scatter").data([Y]),st=ot.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+h),lt=st.append("defs"),ut=st.append("g"),ct=ot.select("g");function dt(){if(X=!1,!S)return!1;if(!0===R){ot.select(".nv-point-paths").selectAll("path").remove();var t=d3.merge(Y.map((function(t,n){return t.values.map((function(t,r){var i=x(t,r),a=b(t,r);return[e.utils.NaNtoZero(v(i))+1e-4*Math.random(),e.utils.NaNtoZero(m(a))+1e-4*Math.random(),n,r,t]})).filter((function(t,e){return D(t[4],e)}))})));if(0==t.length)return!1;t.length<3&&(t.push([v.range()[0]-20,m.range()[0]-20,null,null]),t.push([v.range()[1]+20,m.range()[1]+20,null,null]),t.push([v.range()[0]-20,m.range()[0]+20,null,null]),t.push([v.range()[1]+20,m.range()[1]-20,null,null]));var n=d3.geom.polygon([[-10,-10],[-10,d+10],[c+10,d+10],[c+10,-10]]);t=t.sort((function(t,e){return t[0]-e[0]||t[1]-e[1]}));for(var r=0;r<t.length-1;)Math.abs(t[r][0]-t[r+1][0])<1e-4&&Math.abs(t[r][1]-t[r+1][1])<1e-4?t.splice(r+1,1):r++;var i=d3.geom.voronoi(t).map((function(e,r){return{data:n.clip(e),series:t[r][2],point:t[r][3]}})),a=ot.select(".nv-point-paths").selectAll("path").data(i),o=a.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-"+h+"-"+e+")"}));N&&o.style("fill",d3.rgb(230,230,230)).style("fill-opacity",.4).style("stroke-opacity",1).style("stroke",d3.rgb(200,200,200)),O&&(ot.select(".nv-point-clips").selectAll("*").remove(),ot.select(".nv-point-clips").selectAll("clipPath").data(t).enter().append("svg:clipPath").attr("id",(function(t,e){return"nv-clip-"+h+"-"+e})).append("svg:circle").attr("cx",(function(t){return t[0]})).attr("cy",(function(t){return t[1]})).attr("r",L));var s=function(t,e,n){if(X)return 0;var r=Y[e.series];if(void 0!==r){var i=r.values[e.point];i.color=f(r,e.series),i.x=x(i),i.y=b(i);var a=g.node().getBoundingClientRect(),o=window.pageYOffset||document.documentElement.scrollTop,s=window.pageXOffset||document.documentElement.scrollLeft;n({point:i,series:r,pos:{left:v(x(i,e.point))+a.left+s+u.left+10,top:m(b(i,e.point))+a.top+o+u.top+10},relativePos:[v(x(i,e.point))+u.left,m(b(i,e.point))+u.top],seriesIndex:e.series,pointIndex:e.point,event:d3.event,element:t})}};a.on("click",(function(t){s(this,t,z.elementClick)})).on("dblclick",(function(t){s(this,t,z.elementDblClick)})).on("mouseover",(function(t){s(this,t,z.elementMouseover)})).on("mouseout",(function(t,e){s(this,t,z.elementMouseout)}))}else ot.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",(function(t,e){if(X||!Y[t.series])return 0;var n=Y[t.series],r=n.values[e];z.elementClick({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,event:d3.event,element:this})})).on("dblclick",(function(t,e){if(X||!Y[t.series])return 0;var n=Y[t.series],r=n.values[e];z.elementDblClick({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e})})).on("mouseover",(function(t,e){if(X||!Y[t.series])return 0;var n=Y[t.series],r=n.values[e];z.elementMouseover({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,color:f(t,e)})})).on("mouseout",(function(t,e){if(X||!Y[t.series])return 0;var n=Y[t.series],r=n.values[e];z.elementMouseout({point:r,series:n,pos:[v(x(r,e))+u.left,m(b(r,e))+u.top],relativePos:[v(x(r,e))+u.left,m(b(r,e))+u.top],seriesIndex:t.series,pointIndex:e,color:f(t,e)})}))}ot.classed("nv-single-point",V),ut.append("g").attr("class","nv-groups"),ut.append("g").attr("class","nv-point-paths"),st.append("g").attr("class","nv-point-clips"),ot.attr("transform","translate("+u.left+","+u.top+")"),lt.append("clipPath").attr("id","nv-edge-clip-"+h).append("rect").attr("transform","translate( -10, -10)"),ot.select("#nv-edge-clip-"+h+" rect").attr("width",q+20).attr("height",K>0?K+20:0),ct.attr("clip-path",W?"url(#nv-edge-clip-"+h+")":""),X=!0;var ft=ot.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));ft.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),ft.exit().remove(),ft.attr("class",(function(t,e){return(t.classed||"")+" nv-group nv-series-"+e})).classed("nv-noninteractive",!S).classed("hover",(function(t){return t.hover})),ft.watchTransition(Z,"scatter: groups").style("fill",(function(t,e){return f(t,e)})).style("stroke",(function(t,e){return t.pointBorderColor||p||f(t,e)})).style("stroke-opacity",1).style("fill-opacity",.5);var pt=ft.selectAll("path.nv-point").data((function(t){return t.values.map((function(t,e){return[t,e]})).filter((function(t,e){return D(t[0],e)}))}));if(pt.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("+e.utils.NaNtoZero(t(x(r[0],r[1])))+","+e.utils.NaNtoZero(n(b(r[0],r[1])))+")"})).attr("d",e.utils.symbol().type((function(t){return w(t[0])})).size((function(t){return y(k(t[0],t[1]))}))),pt.exit().each($).remove(),ft.exit().selectAll("path.nv-point").watchTransition(Z,"scatter exit").attr("transform",(function(t){return"translate("+e.utils.NaNtoZero(v(x(t[0],t[1])))+","+e.utils.NaNtoZero(m(b(t[0],t[1])))+")"})).remove(),pt.filter((function(t){return Q(t,"x",x,"y",b)||rt||it||at})).watchTransition(Z,"scatter points").attr("transform",(function(t){return"translate("+e.utils.NaNtoZero(v(x(t[0],t[1])))+","+e.utils.NaNtoZero(m(b(t[0],t[1])))+")"})),pt.filter((function(t){return Q(t,"shape",w,"size",k)||rt||it||at})).watchTransition(Z,"scatter points").attr("d",e.utils.symbol().type((function(t){return w(t[0])})).size((function(t){return y(k(t[0],t[1]))}))),G){var ht=ft.selectAll(".nv-label").data((function(t){return t.values.map((function(t,e){return[t,e]})).filter((function(t,e){return D(t[0],e)}))}));ht.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("+(e.utils.NaNtoZero(t(x(r[0],r[1])))+Math.sqrt(y(k(r[0],r[1]))/Math.PI)+2)+","+e.utils.NaNtoZero(n(b(r[0],r[1])))+")"})).text((function(t,e){return t[0].label})),ht.exit().remove(),ft.exit().selectAll("path.nv-label").watchTransition(Z,"scatter exit").attr("transform",(function(t){return"translate("+(e.utils.NaNtoZero(v(x(t[0],t[1])))+Math.sqrt(y(k(t[0],t[1]))/Math.PI)+2)+","+e.utils.NaNtoZero(m(b(t[0],t[1])))+")"})).remove(),ht.each((function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)})),ht.watchTransition(Z,"scatter labels").attr("transform",(function(t){return"translate("+(e.utils.NaNtoZero(v(x(t[0],t[1])))+Math.sqrt(y(k(t[0],t[1]))/Math.PI)+2)+","+e.utils.NaNtoZero(m(b(t[0],t[1])))+")"}))}j?(clearTimeout(l),l=setTimeout(dt,j)):dt(),t=v.copy(),n=m.copy(),r=y.copy(),o=c,s=d})),Z.renderEnd("scatter immediate"),J}return J.dispatch=z,J.options=e.utils.optionsFunc.bind(J),J._calls=new function(){this.clearHighlights=function(){return e.dom.write((function(){g.selectAll(".nv-point.hover").classed("hover",!1)})),null},this.highlightPoint=function(t,n,r){e.dom.write((function(){g.select(".nv-groups").selectAll(".nv-series-"+t).selectAll(".nv-point-"+n).classed("hover",r)}))}},z.on("elementMouseover.point",(function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)})),z.on("elementMouseout.point",(function(t){S&&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 d},set:function(t){d=t}},xScale:{get:function(){return v},set:function(t){v=t}},yScale:{get:function(){return m},set:function(t){m=t}},pointScale:{get:function(){return y},set:function(t){y=t}},xDomain:{get:function(){return _},set:function(t){_=t}},yDomain:{get:function(){return B},set:function(t){B=t}},pointDomain:{get:function(){return I},set:function(t){I=t}},xRange:{get:function(){return T},set:function(t){T=t}},yRange:{get:function(){return P},set:function(t){P=t}},pointRange:{get:function(){return H},set:function(t){H=t}},forceX:{get:function(){return M},set:function(t){M=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 S},set:function(t){S=t}},pointActive:{get:function(){return D},set:function(t){D=t}},padDataOuter:{get:function(){return F},set:function(t){F=t}},padData:{get:function(){return E},set:function(t){E=t}},clipEdge:{get:function(){return W},set:function(t){W=t}},clipVoronoi:{get:function(){return O},set:function(t){O=t}},clipRadius:{get:function(){return L},set:function(t){L=t}},showVoronoi:{get:function(){return N},set:function(t){N=t}},id:{get:function(){return h},set:function(t){h=t}},interactiveUpdateDelay:{get:function(){return j},set:function(t){j=t}},showLabels:{get:function(){return G},set:function(t){G=t}},pointBorderColor:{get:function(){return p},set:function(t){p=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},pointSize:{get:function(){return k},set:function(t){k=d3.functor(t)}},pointShape:{get:function(){return w},set:function(t){w=d3.functor(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 Y},set:function(t){Y=t,Z.reset(Y)}},color:{get:function(){return f},set:function(t){f=e.utils.getColor(t)}},useVoronoi:{get:function(){return R},set:function(t){!1===(R=t)&&(O=!1)}}}),e.utils.initOptions(J),J},e.models.scatterChart=function(){"use strict";var t=e.models.scatter(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),a=e.models.distribution(),o=e.models.distribution(),s=e.models.tooltip(),l={top:30,right:20,bottom:50,left:75},u=null,c=null,d=null,f=null,p=e.utils.defaultColor(),h=t.xScale(),g=t.yScale(),v=!1,m=!1,y=!0,x=!0,b=!0,k=!1,w=e.utils.state(),M=null,A=d3.dispatch("stateChange","changeState","renderEnd"),C=null,S=250,D=!1;t.xScale(h).yScale(g),n.orient("bottom").tickPadding(10),r.orient(k?"right":"left").tickPadding(10),a.axis("x"),o.axis("y"),s.headerFormatter((function(t,e){return n.tickFormat()(t,e)})).valueFormatter((function(t,e){return r.tickFormat()(t,e)}));var E=e.utils.renderWatch(A,S);function F(C){return E.reset(),E.models(t),x&&E.models(n),b&&E.models(r),v&&E.models(a),m&&E.models(o),C.each((function(C){f=d3.select(this),e.utils.initSVG(f);var W,O=e.utils.availableWidth(c,f,l),N=e.utils.availableHeight(d,f,l);if(F.update=function(){0===S?f.call(F):f.transition().duration(S).call(F)},F.container=this,w.setter(function(t){return function(e){void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(C),F.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled}))}}}(C)).update(),w.disabled=C.map((function(t){return!!t.disabled})),!M)for(W in M={},w)w[W]instanceof Array?M[W]=w[W].slice(0):M[W]=w[W];if(!(C&&C.length&&C.filter((function(t){return t.values.length})).length))return e.utils.noData(F,f),E.renderEnd("scatter immediate"),F;f.selectAll(".nv-noData").remove(),h=t.xScale(),g=t.yScale();var L=f.selectAll("g.nv-wrap.nv-scatterChart").data([C]),_=L.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+t.id()).append("g"),B=L.select("g");if(_.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),_.append("g").attr("class","nv-x nv-axis"),_.append("g").attr("class","nv-y nv-axis"),_.append("g").attr("class","nv-scatterWrap"),_.append("g").attr("class","nv-regressionLinesWrap"),_.append("g").attr("class","nv-distWrap"),_.append("g").attr("class","nv-legendWrap"),k&&B.select(".nv-y.nv-axis").attr("transform","translate("+O+",0)"),y){var T=O;i.width(T),L.select(".nv-legendWrap").datum(C).call(i),u||i.height()===l.top||(l.top=i.height(),N=e.utils.availableHeight(d,f,l)),L.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")}else B.select(".nv-legendWrap").selectAll("*").remove();L.attr("transform","translate("+l.left+","+l.top+")"),t.width(O).height(N).color(C.map((function(t,e){return t.color=t.color||p(t,e),t.color})).filter((function(t,e){return!C[e].disabled}))).showLabels(D),L.select(".nv-scatterWrap").datum(C.filter((function(t){return!t.disabled}))).call(t),L.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+t.id()+")");var P=L.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data((function(t){return t}));P.enter().append("g").attr("class","nv-regLines");var I=P.selectAll(".nv-regLine").data((function(t){return[t]}));I.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),I.filter((function(t){return t.intercept&&t.slope})).watchTransition(E,"scatterPlusLineChart: regline").attr("x1",h.range()[0]).attr("x2",h.range()[1]).attr("y1",(function(t,e){return g(h.domain()[0]*t.slope+t.intercept)})).attr("y2",(function(t,e){return g(h.domain()[1]*t.slope+t.intercept)})).style("stroke",(function(t,e,n){return p(t,n)})).style("stroke-opacity",(function(t,e){return t.disabled||void 0===t.slope||void 0===t.intercept?0:1})),x&&(n.scale(h)._ticks(e.utils.calcTicksX(O/100,C)).tickSize(-N,0),B.select(".nv-x.nv-axis").attr("transform","translate(0,"+g.range()[0]+")").call(n)),b&&(r.scale(g)._ticks(e.utils.calcTicksY(N/36,C)).tickSize(-O,0),B.select(".nv-y.nv-axis").call(r)),v&&(a.getData(t.x()).scale(h).width(O).color(C.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!C[e].disabled}))),_.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),B.select(".nv-distributionX").attr("transform","translate(0,"+g.range()[0]+")").datum(C.filter((function(t){return!t.disabled}))).call(a)),m&&(o.getData(t.y()).scale(g).width(N).color(C.map((function(t,e){return t.color||p(t,e)})).filter((function(t,e){return!C[e].disabled}))),_.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),B.select(".nv-distributionY").attr("transform","translate("+(k?O:-o.size())+",0)").datum(C.filter((function(t){return!t.disabled}))).call(o)),i.dispatch.on("stateChange",(function(t){for(var e in t)w[e]=t[e];A.stateChange(w),F.update()})),A.on("changeState",(function(t){void 0!==t.disabled&&(C.forEach((function(e,n){e.disabled=t.disabled[n]})),w.disabled=t.disabled),F.update()})),t.dispatch.on("elementMouseout.tooltip",(function(e){s.hidden(!0),f.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",0),f.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",o.size())})),t.dispatch.on("elementMouseover.tooltip",(function(t){f.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.relativePos[1]-N),f.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.relativePos[0]+a.size()),s.data(t).hidden(!1)})),h.copy(),g.copy()})),E.renderEnd("scatter with line immediate"),F}return F.dispatch=A,F.scatter=t,F.legend=i,F.xAxis=n,F.yAxis=r,F.distX=a,F.distY=o,F.tooltip=s,F.options=e.utils.optionsFunc.bind(F),F._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},container:{get:function(){return f},set:function(t){f=t}},showDistX:{get:function(){return v},set:function(t){v=t}},showDistY:{get:function(){return m},set:function(t){m=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 M},set:function(t){M=t}},noData:{get:function(){return C},set:function(t){C=t}},duration:{get:function(){return S},set:function(t){S=t}},showLabels:{get:function(){return D},set:function(t){D=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,r.orient(t?"right":"left")}},color:{get:function(){return p},set:function(t){p=e.utils.getColor(t),i.color(p),a.color(p),o.color(p)}}}),e.utils.inheritOptions(F,t),e.utils.initOptions(F),F},e.models.sparkline=function(){"use strict";var t,n,r,i,a={top:2,right:0,bottom:2,left:0},o=400,s=32,l=null,u=!0,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=e.utils.getColor(["#000"]),g=!0,v=!0,m=d3.dispatch("renderEnd"),y=e.utils.renderWatch(m);function x(u){return y.reset(),u.each((function(u){var m=o-a.left-a.right,y=s-a.top-a.bottom;l=d3.select(this),e.utils.initSVG(l),c.domain(t||d3.extent(u,f)).range(r||[0,m]),d.domain(n||d3.extent(u,p)).range(i||[y,0]);var x=l.selectAll("g.nv-wrap.nv-sparkline").data([u]);x.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline").append("g"),x.select("g"),x.attr("transform","translate("+a.left+","+a.top+")");var b=x.selectAll("path").data((function(t){return[t]}));b.enter().append("path"),b.exit().remove(),b.style("stroke",(function(t,e){return t.color||h(t,e)})).attr("d",d3.svg.line().x((function(t,e){return c(f(t,e))})).y((function(t,e){return d(p(t,e))})));var k=x.selectAll("circle.nv-point").data((function(t){var e=t.map((function(t,e){return p(t,e)}));function n(e){if(-1!=e){var n=t[e];return n.pointIndex=e,n}return null}var r=n(e.lastIndexOf(d.domain()[1])),i=n(e.indexOf(d.domain()[0])),a=n(e.length-1);return[g?i:null,g?r:null,v?a:null].filter((function(t){return null!=t}))}));k.enter().append("circle"),k.exit().remove(),k.attr("cx",(function(t,e){return c(f(t,t.pointIndex))})).attr("cy",(function(t,e){return d(p(t,t.pointIndex))})).attr("r",2).attr("class",(function(t,e){return f(t,t.pointIndex)==c.domain()[1]?"nv-point nv-currentValue":p(t,t.pointIndex)==d.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"}))})),y.renderEnd("sparkline immediate"),x}return x.options=e.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return s},set:function(t){s=t}},xDomain:{get:function(){return t},set:function(e){t=e}},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 d},set:function(t){d=t}},animate:{get:function(){return u},set:function(t){u=t}},showMinMaxPoints:{get:function(){return g},set:function(t){g=t}},showCurrentPoint:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=d3.functor(t)}},y:{get:function(){return p},set:function(t){p=d3.functor(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 h},set:function(t){h=e.utils.getColor(t)}}}),x.dispatch=m,e.utils.initOptions(x),x},e.models.sparklinePlus=function(){"use strict";var t,n,r=e.models.sparkline(),i={top:15,right:100,bottom:10,left:50},a=null,o=null,s=[],l=!1,u=d3.format(",r"),c=d3.format(",.2f"),d=!0,f=!0,p=!1,h=null,g=d3.dispatch("renderEnd"),v=e.utils.renderWatch(g);function m(h){return v.reset(),v.models(r),h.each((function(h){var g=d3.select(this);e.utils.initSVG(g);var v=e.utils.availableWidth(a,g,i),y=e.utils.availableHeight(o,g,i);if(m.update=function(){g.call(m)},m.container=this,!h||!h.length)return e.utils.noData(m,g),m;g.selectAll(".nv-noData").remove();var x=r.y()(h[h.length-1],h.length-1);t=r.xScale(),n=r.yScale();var b=g.selectAll("g.nv-wrap.nv-sparklineplus").data([h]),k=b.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus").append("g"),w=b.select("g");k.append("g").attr("class","nv-sparklineWrap"),k.append("g").attr("class","nv-valueWrap"),k.append("g").attr("class","nv-hoverArea"),b.attr("transform","translate("+i.left+","+i.top+")");var M=w.select(".nv-sparklineWrap");if(r.width(v).height(y),M.call(r),d){var A=w.select(".nv-valueWrap").selectAll(".nv-currentValue").data([x]);A.enter().append("text").attr("class","nv-currentValue").attr("dx",p?-8:8).attr("dy",".9em").style("text-anchor",p?"end":"start"),A.attr("x",v+(p?i.right:0)).attr("y",f?function(t){return n(t)}:0).style("fill",r.color()(h[h.length-1],h.length-1)).text(c(x))}function C(){if(!l){var e=w.selectAll(".nv-hoverValue").data(s),n=e.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);e.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),e.attr("transform",(function(e){return"translate("+t(r.x()(h[e],e))+",0)"})).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),s.length&&(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"),w.select(".nv-hoverValue .nv-xValue").text(u(r.x()(h[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"),w.select(".nv-hoverValue .nv-yValue").text(c(r.y()(h[s[0]],s[0]))))}}k.select(".nv-hoverArea").append("rect").on("mousemove",(function(){if(!l){var e=d3.mouse(this)[0]-i.left;s=[function(t,e){for(var n=Math.abs(r.x()(t[0],0)-e),i=0,a=0;a<t.length;a++)Math.abs(r.x()(t[a],a)-e)<n&&(n=Math.abs(r.x()(t[a],a)-e),i=a);return i}(h,Math.round(t.invert(e)))],C()}})).on("click",(function(){l=!l})).on("mouseout",(function(){s=[],C()})),w.select(".nv-hoverArea rect").attr("transform",(function(t){return"translate("+-i.left+","+-i.top+")"})).attr("width",v+i.left+i.right).attr("height",y+i.top)})),v.renderEnd("sparklinePlus immediate"),m}return m.dispatch=g,m.sparkline=r,m.options=e.utils.optionsFunc.bind(m),m._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return o},set:function(t){o=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 d},set:function(t){d=t}},alignValue:{get:function(){return f},set:function(t){f=t}},rightAlignValue:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return h},set:function(t){h=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}}}),e.utils.inheritOptions(m,r),e.utils.initOptions(m),m},e.models.stackedArea=function(){"use strict";var t,n,r={top:0,right:0,bottom:0,left:0},i=960,a=500,o=e.utils.defaultColor(),s=Math.floor(1e5*Math.random()),l=null,u=function(t){return t.x},c=function(t){return t.y},d=function(t,e){return!isNaN(c(t,e))&&null!==c(t,e)},f="stack",p="zero",h="default",g="linear",v=!1,m=e.models.scatter(),y=250,x=d3.dispatch("areaClick","areaMouseover","areaMouseout","renderEnd","elementClick","elementMouseover","elementMouseout");m.pointSize(2.2).pointDomain([2.2,2.2]);var b=e.utils.renderWatch(x,y);function k(f){return b.reset(),b.models(m),f.each((function(f){var y=i-r.left-r.right,w=a-r.top-r.bottom;l=d3.select(this),e.utils.initSVG(l),t=m.xScale(),n=m.yScale();var M=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 A=f.filter((function(t){return!t.disabled}));f=d3.layout.stack().order(h).offset(p).values((function(t){return t.values})).x(u).y(c).out((function(t,e,n){t.display={y:n,y0:e}}))(A);var C=l.selectAll("g.nv-wrap.nv-stackedarea").data([f]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),D=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-areaWrap"),E.append("g").attr("class","nv-scatterWrap"),C.attr("transform","translate("+r.left+","+r.top+")"),0==m.forceY().length&&m.forceY().push(0),m.width(y).height(w).x(u).y((function(t){if(void 0!==t.display)return t.display.y+t.display.y0})).color(f.map((function(t,e){return t.color=t.color||o(t,t.seriesIndex),t.color}))),F.select(".nv-scatterWrap").datum(f).call(m),D.append("clipPath").attr("id","nv-edge-clip-"+s).append("rect"),C.select("#nv-edge-clip-"+s+" rect").attr("width",y).attr("height",w),F.attr("clip-path",v?"url(#nv-edge-clip-"+s+")":"");var W=d3.svg.area().defined(d).x((function(e,n){return t(u(e,n))})).y0((function(t){return n(t.display.y0)})).y1((function(t){return n(t.display.y+t.display.y0)})).interpolate(g),O=d3.svg.area().defined(d).x((function(e,n){return t(u(e,n))})).y0((function(t){return n(t.display.y0)})).y1((function(t){return n(t.display.y0)})),N=F.select(".nv-areaWrap").selectAll("path.nv-area").data((function(t){return t}));N.enter().append("path").attr("class",(function(t,e){return"nv-area nv-area-"+e})).attr("d",(function(t,e){return O(t.values,t.seriesIndex)})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),x.areaMouseover({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),x.areaMouseout({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})).on("click",(function(t,e){d3.select(this).classed("hover",!1),x.areaClick({point:t,series:t.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t.seriesIndex})})),N.exit().remove(),N.style("fill",(function(t,e){return t.color||o(t,t.seriesIndex)})).style("stroke",(function(t,e){return t.color||o(t,t.seriesIndex)})),N.watchTransition(b,"stackedArea path").attr("d",(function(t,e){return W(t.values,e)})),m.dispatch.on("elementMouseover.area",(function(t){F.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!0)})),m.dispatch.on("elementMouseout.area",(function(t){F.select(".nv-chart-"+s+" .nv-area-"+t.seriesIndex).classed("hover",!1)})),k.d3_stackedOffset_stackPercent=function(t){var e,n,r,i=t.length,a=t[0].length,o=[];for(n=0;n<a;++n){for(e=0,r=0;e<M.length;e++)r+=c(M[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<a;++n)o[n]=0;return o}})),b.renderEnd("stackedArea immediate"),k}return k.dispatch=x,k.scatter=m,m.dispatch.on("elementClick",(function(){x.elementClick.apply(this,arguments)})),m.dispatch.on("elementMouseover",(function(){x.elementMouseover.apply(this,arguments)})),m.dispatch.on("elementMouseout",(function(){x.elementMouseout.apply(this,arguments)})),k.interpolate=function(t){return arguments.length?(g=t,k):g},k.duration=function(t){return arguments.length?(y=t,b.reset(y),m.duration(y),k):y},k.dispatch=x,k.scatter=m,k.options=e.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return i},set:function(t){i=t}},height:{get:function(){return a},set:function(t){a=t}},defined:{get:function(){return d},set:function(t){d=t}},clipEdge:{get:function(){return v},set:function(t){v=t}},offset:{get:function(){return p},set:function(t){p=t}},order:{get:function(){return h},set:function(t){h=t}},interpolate:{get:function(){return g},set:function(t){g=t}},x:{get:function(){return u},set:function(t){u=d3.functor(t)}},y:{get:function(){return c},set:function(t){c=d3.functor(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 o},set:function(t){o=e.utils.getColor(t)}},style:{get:function(){return f},set:function(t){switch(f=t){case"stack":k.offset("zero"),k.order("default");break;case"stream":k.offset("wiggle"),k.order("inside-out");break;case"stream-center":k.offset("silhouette"),k.order("inside-out");break;case"expand":k.offset("expand"),k.order("default");break;case"stack_percent":k.offset(k.d3_stackedOffset_stackPercent),k.order("default")}}},duration:{get:function(){return y},set:function(t){y=t,b.reset(y),m.duration(y)}}}),e.utils.inheritOptions(k,m),e.utils.initOptions(k),k},e.models.stackedAreaChart=function(){"use strict";var t,n,r=e.models.stackedArea(),i=e.models.axis(),a=e.models.axis(),o=e.models.legend(),s=e.models.legend(),l=e.interactiveGuideline(),u=e.models.tooltip(),c=e.models.focus(e.models.stackedArea()),d={top:10,right:25,bottom:50,left:60},f=null,p=null,h=null,g=e.utils.defaultColor(),v=!0,m=!0,y="top",x=!0,b=!0,k=!1,w=!1,M=!1,A=!0,C="TOTAL",S=e.utils.state(),D=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),W=250,O=["Stacked","Stream","Expanded"],N={},L=250;S.style=r.style(),i.orient("bottom").tickPadding(7),a.orient(k?"right":"left"),u.headerFormatter((function(t,e){return i.tickFormat()(t,e)})).valueFormatter((function(t,e){return a.tickFormat()(t,e)})),l.tooltip.headerFormatter((function(t,e){return i.tickFormat()(t,e)})).valueFormatter((function(t,e){return null==t?"N/A":a.tickFormat()(t,e)}));var _=null,B=null;s.updateState(!1);var T=e.utils.renderWatch(F),P=(r.style(),d3.format("%"));function I(u){return T.reset(),T.models(r),x&&T.models(i),b&&T.models(a),u.each((function(u){var E=d3.select(this);e.utils.initSVG(E);var T,H=e.utils.availableWidth(p,E,d),V=e.utils.availableHeight(h,E,d)-(w?c.height():0);if(I.update=function(){E.transition().duration(L).call(I)},I.container=this,S.setter(function(t){return function(e){void 0!==e.style&&e.style,void 0!==e.active&&t.forEach((function(t,n){t.disabled=!e.active[n]}))}}(u),I.update).getter(function(t){return function(){return{active:t.map((function(t){return!t.disabled})),style:r.style()}}}(u)).update(),S.disabled=u.map((function(t){return!!t.disabled})),!D)for(T in D={},S)S[T]instanceof Array?D[T]=S[T].slice(0):D[T]=S[T];if(!(u&&u.length&&u.filter((function(t){return t.values.length})).length))return e.utils.noData(I,E),I;E.selectAll(".nv-noData").remove(),t=r.xScale(),n=r.yScale();var z=E.selectAll("g.nv-wrap.nv-stackedAreaChart").data([u]),R=z.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),Y=z.select("g");R.append("g").attr("class","nv-legendWrap"),R.append("g").attr("class","nv-controlsWrap");var j=R.append("g").attr("class","nv-focus");if(j.append("g").attr("class","nv-background").append("rect"),j.append("g").attr("class","nv-x nv-axis"),j.append("g").attr("class","nv-y nv-axis"),j.append("g").attr("class","nv-stackedWrap"),j.append("g").attr("class","nv-interactive"),R.append("g").attr("class","nv-focusWrap"),m){var G=v&&"top"===y?H-W:H;if(o.width(G),Y.select(".nv-legendWrap").datum(u).call(o),"bottom"===y){var X=10+(x?12:0);d.bottom=Math.max(o.height()+X,d.bottom);var Z=(V=e.utils.availableHeight(h,E,d)-(w?c.height():0))+X;Y.select(".nv-legendWrap").attr("transform","translate(0,"+Z+")")}else"top"===y&&(f||d.top==o.height()||(d.top=o.height(),V=e.utils.availableHeight(h,E,d)-(w?c.height():0)),Y.select(".nv-legendWrap").attr("transform","translate("+(H-G)+","+-d.top+")"))}else Y.select(".nv-legendWrap").selectAll("*").remove();if(v){var U=[{key:N.stacked||"Stacked",metaKey:"Stacked",disabled:"stack"!=r.style(),style:"stack"},{key:N.stream||"Stream",metaKey:"Stream",disabled:"stream"!=r.style(),style:"stream"},{key:N.expanded||"Expanded",metaKey:"Expanded",disabled:"expand"!=r.style(),style:"expand"},{key:N.stack_percent||"Stack %",metaKey:"Stack_Percent",disabled:"stack_percent"!=r.style(),style:"stack_percent"}];W=O.length/3*260,U=U.filter((function(t){return-1!==O.indexOf(t.metaKey)})),s.width(W).color(["#444","#444","#444"]),Y.select(".nv-controlsWrap").datum(U).call(s);var q=Math.max(s.height(),m&&"top"===y?o.height():0);d.top!=q&&(d.top=q,V=e.utils.availableHeight(h,E,d)-(w?c.height():0)),Y.select(".nv-controlsWrap").attr("transform","translate(0,"+-d.top+")")}else Y.select(".nv-controlsWrap").selectAll("*").remove();z.attr("transform","translate("+d.left+","+d.top+")"),k&&Y.select(".nv-y.nv-axis").attr("transform","translate("+H+",0)"),M&&(l.width(H).height(V).margin({left:d.left,top:d.top}).svgContainer(E).xScale(t),z.select(".nv-interactive").call(l)),Y.select(".nv-focus .nv-background rect").attr("width",H).attr("height",V),r.width(H).height(V).color(u.map((function(t,e){return t.color||g(t,e)})).filter((function(t,e){return!u[e].disabled})));var K,$=Y.select(".nv-focus .nv-stackedWrap").datum(u.filter((function(t){return!t.disabled})));function Q(){x&&Y.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+V+")").transition().duration(L).call(i)}function J(){if(b){if("expand"===r.style()||"stack_percent"===r.style()){var t=a.tickFormat();_&&t===P||(_=t),a.tickFormat(P)}else _&&(a.tickFormat(_),_=null);Y.select(".nv-focus .nv-y.nv-axis").transition().duration(0).call(a)}}if(x&&i.scale(t)._ticks(e.utils.calcTicksX(H/100,u)).tickSize(-V,0),b&&(K="wiggle"===r.offset()?0:e.utils.calcTicksY(V/36,u),a.scale(n)._ticks(K).tickSize(-H,0)),w){c.width(H),Y.select(".nv-focusWrap").attr("transform","translate(0,"+(V+d.bottom+c.margin().top)+")").datum(u.filter((function(t){return!t.disabled}))).call(c);var tt=c.brush.empty()?c.xDomain():c.brush.extent();null!==tt&&et(tt)}else $.transition().call(r),Q(),J();function et(t){Y.select(".nv-focus .nv-stackedWrap").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}}))).transition().duration(L).call(r),Q(),J()}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})),S.disabled=u.map((function(t){return!!t.disabled})),F.stateChange(S),I.update()})),o.dispatch.on("stateChange",(function(t){for(var e in t)S[e]=t[e];F.stateChange(S),I.update()})),s.dispatch.on("legendClick",(function(t,e){t.disabled&&(U=U.map((function(t){return t.disabled=!0,t})),t.disabled=!1,r.style(t.style),S.style=r.style(),F.stateChange(S),I.update())})),l.dispatch.on("elementMousemove",(function(t){r.clearHighlights();var n,i,a,o=[],s=0,c=!0,d=!1;if(u.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(l,f){i=e.interactiveBisect(l.values,t.pointXValue,I.x());var p=l.values[i],h=I.y()(p,i);if(null!=h&&h>0&&(r.highlightPoint(f,i,!0),d=!0),f!==u.length-1||d||r.highlightPoint(f,i,!0),void 0!==p){void 0===n&&(n=p),void 0===a&&(a=I.xScale()(I.x()(p,i)));var v="expand"==r.style()?p.display.y:I.y()(p,i);o.push({key:l.key,value:v,color:g(l,l.seriesIndex),point:p}),A&&"expand"!=r.style()&&null!=v&&(s+=v,c=!1)}})),o.reverse(),o.length>2){var f=I.yScale().invert(t.mouseY),p=null;o.forEach((function(t,e){f=Math.abs(f);var n=Math.abs(t.point.display.y0),r=Math.abs(t.point.display.y);f>=n&&f<=r+n&&(p=e)})),null!=p&&(o[p].highlight=!0)}A&&"expand"!=r.style()&&o.length>=2&&!c&&o.push({key:C,value:s,total:!0});var h=I.x()(n,i),v=l.tooltip.valueFormatter();"expand"===r.style()||"stack_percent"===r.style()?(B||(B=v),v=d3.format(".1%")):B&&(v=B,B=null),l.tooltip.valueFormatter(v).data({value:h,series:o})(),l.renderGuideLine(a)})),l.dispatch.on("elementMouseout",(function(t){r.clearHighlights()})),c.dispatch.on("onBrush",(function(t){et(t)})),F.on("changeState",(function(t){void 0!==t.disabled&&u.length===t.disabled.length&&(u.forEach((function(e,n){e.disabled=t.disabled[n]})),S.disabled=t.disabled),void 0!==t.style&&(r.style(t.style),t.style),I.update()}))})),T.renderEnd("stacked Area chart immediate"),I}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)})),I.dispatch=F,I.stacked=r,I.legend=o,I.controls=s,I.xAxis=i,I.x2Axis=c.xAxis,I.yAxis=a,I.y2Axis=c.yAxis,I.interactiveLayer=l,I.tooltip=u,I.focus=c,I.dispatch=F,I.options=e.utils.optionsFunc.bind(I),I._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 m},set:function(t){m=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 D},set:function(t){D=t}},noData:{get:function(){return E},set:function(t){E=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return N},set:function(t){N=t}},controlOptions:{get:function(){return O},set:function(t){O=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 w},set:function(t){w=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 d},set:function(t){void 0!==t.top&&(d.top=t.top,f=t.top),d.right=void 0!==t.right?t.right:d.right,d.bottom=void 0!==t.bottom?t.bottom:d.bottom,d.left=void 0!==t.left?t.left:d.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 L},set:function(t){L=t,T.reset(L),r.duration(L),i.duration(L),a.duration(L)}},color:{get:function(){return g},set:function(t){g=e.utils.getColor(t),o.color(g),r.color(g),c.color(g)}},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 k},set:function(t){k=t,a.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return M},set:function(t){M=!!t,I.interactive(!t),I.useVoronoi(!t),r.scatter.interactive(!t)}}}),e.utils.inheritOptions(I,r),e.utils.initOptions(I),I},e.models.stackedAreaWithFocusChart=function(){return e.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},e.models.sunburst=function(){"use strict";var t,n,r,i,a={top:0,right:0,bottom:0,left:0},o=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()),d=null,f=e.utils.defaultColor(),p=!1,h=function(t){return"count"===l?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},g=.02,v=function(t,e){return t.name>e.name},m=function(t,e){return void 0!==t.parent?t.name+"-"+t.parent.name+"-"+e:t.name},y=!0,x=500,b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),k=d3.scale.linear().range([0,2*Math.PI]),w=d3.scale.sqrt(),M=d3.layout.partition().sort(v),A={},C=d3.svg.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 S(t){return D(t)>90?180:0}function D(t){return(Math.max(0,Math.min(2*Math.PI,k(t.x)))+Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx))))/2*(180/Math.PI)-90}function E(t){var e=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)))-e)/(2*Math.PI)}function F(t){var e=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)))-e>g}function W(e,n){var r=d3.interpolate(k.domain(),[t.x,t.x+t.dx]),a=d3.interpolate(w.domain(),[t.y,1]),o=d3.interpolate(w.range(),[t.y?20:0,i]);return 0===n?function(){return C(e)}:function(t){return k.domain(r(t)),w.domain(a(t)).range(o(t)),C(e)}}function O(t){var e=d3.interpolate({x:t.x0,dx:t.dx0,y:t.y0,dy:t.dy0},t);return function(n){var r=e(n);return t.x0=r.x,t.dx0=r.dx,t.y0=r.y,t.dy0=r.dy,C(r)}}function N(t){t.forEach((function(t){var e=m(t),n=A[e];n?(t.dx0=n.dx,t.x0=n.x,t.dy0=n.dy,t.y0=n.y):(t.dx0=t.dx,t.x0=t.x,t.dy0=t.dy,t.y0=t.y),function(t){var e=m(t);A[e]||(A[e]={});var n=A[e];n.dx=t.dx,n.x=t.x,n.dy=t.dy,n.y=t.y}(t)}))}function L(e){var n=d.selectAll("text"),r=d.selectAll("path");n.transition().attr("opacity",0),t=e,r.transition().duration(x).attrTween("d",W).each("end",(function(t){t.x>=e.x&&t.x<e.x+e.dx&&t.depth>=e.depth&&d3.select(this.parentNode).select("text").transition().duration(x).text((function(t){return h(t)})).attr("opacity",(function(t){return F(t)?1:0})).attr("transform",(function(){var n=this.getBBox().width;if(0===t.depth)return"translate("+n/2*-1+",0)";if(t.depth===e.depth)return"translate("+(w(t.y)+5)+",0)";var r=D(t),i=S(t);return 0===i?"rotate("+r+")translate("+(w(t.y)+5)+",0)":"rotate("+r+")translate("+(w(t.y)+n+5)+",0)rotate("+i+")"}))}))}var _=e.utils.renderWatch(b);function B(t){return _.reset(),t.each((function(t){d=d3.select(this),n=e.utils.availableWidth(o,d,a),r=e.utils.availableHeight(s,d,a),i=Math.min(n,r)/2,w.range([0,i]);var g=d.select("g.nvd3.nv-wrap.nv-sunburst");g[0][0]?g.attr("transform","translate("+(n/2+a.left+a.right)+","+(r/2+a.top+a.bottom)+")"):g=d.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+c).attr("transform","translate("+(n/2+a.left+a.right)+","+(r/2+a.top+a.bottom)+")"),d.on("click",(function(t,e){b.chartClick({data:t,index:e,pos:d3.event,id:c})})),M.value(u[l]||u.count);var v=M.nodes(t[0]).reverse();N(v);var k=g.selectAll(".arc-container").data(v,m);k.enter().append("g").attr("class","arc-container").append("path").attr("d",C).style("fill",(function(t){return t.color?t.color:f(y?(t.children?t:t.parent).name:t.name)})).style("stroke","#FFF").on("click",(function(t,e){L(t),b.elementClick({data:t,index:e})})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0).style("opacity",.8),b.elementMouseover({data:t,color:d3.select(this).style("fill"),percent:E(t)})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1).style("opacity",1),b.elementMouseout({data:t})})).on("mousemove",(function(t,e){b.elementMousemove({data:t})})),k.each((function(t){d3.select(this).select("path").transition().duration(x).attrTween("d",O)})),p&&(k.selectAll("text").remove(),k.append("text").text((function(t){return h(t)})).transition().duration(x).attr("opacity",(function(t){return F(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=D(t),r=S(t);return 0===r?"rotate("+n+")translate("+(w(t.y)+5)+",0)":"rotate("+n+")translate("+(w(t.y)+e+5)+",0)rotate("+r+")"}))),L(v[v.length-1]),k.exit().transition().duration(x).attr("opacity",0).each("end",(function(t){var e=m(t);A[e]=void 0})).remove()})),_.renderEnd("sunburst immediate"),B}return B.dispatch=b,B.options=e.utils.optionsFunc.bind(B),B._options=Object.create({},{width:{get:function(){return o},set:function(t){o=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}},groupColorByParent:{get:function(){return y},set:function(t){y=!!t}},showLabels:{get:function(){return p},set:function(t){p=!!t}},labelFormat:{get:function(){return h},set:function(t){h=t}},labelThreshold:{get:function(){return g},set:function(t){g=t}},sort:{get:function(){return v},set:function(t){v=t}},key:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return a},set:function(t){a.top=null!=t.top?t.top:a.top,a.right=null!=t.right?t.right:a.right,a.bottom=null!=t.bottom?t.bottom:a.bottom,a.left=null!=t.left?t.left:a.left}},color:{get:function(){return f},set:function(t){f=e.utils.getColor(t)}}}),e.utils.initOptions(B),B},e.models.sunburstChart=function(){"use strict";var t=e.models.sunburst(),n=e.models.tooltip(),r={top:30,right:20,bottom:20,left:20},i=e.utils.defaultColor(),a=!1,o=(Math.round(1e5*Math.random()),null),s=null,l=250,u=d3.dispatch("stateChange","changeState","renderEnd"),c=e.utils.renderWatch(u);function d(n){return c.reset(),c.models(t),n.each((function(n){var i=d3.select(this);e.utils.initSVG(i);var a=e.utils.availableWidth(null,i,r),o=e.utils.availableHeight(null,i,r);if(d.update=function(){0===l?i.call(d):i.transition().duration(l).call(d)},d.container=i,!n||!n.length)return e.utils.noData(d,i),d;i.selectAll(".nv-noData").remove(),t.width(a).height(o).margin(r),i.call(t)})),c.renderEnd("sunburstChart immediate"),d}return n.duration(0).headerEnabled(!1).valueFormatter((function(t){return t})),t.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},a||(delete t.percent,delete t.series.percent),n.data(t).hidden(!1)})),t.dispatch.on("elementMouseout.tooltip",(function(t){n.hidden(!0)})),t.dispatch.on("elementMousemove.tooltip",(function(t){n()})),d.dispatch=u,d.sunburst=t,d.tooltip=n,d.options=e.utils.optionsFunc.bind(d),d._options=Object.create({},{noData:{get:function(){return s},set:function(t){s=t}},defaultState:{get:function(){return o},set:function(t){o=t}},showTooltipPercent:{get:function(){return a},set:function(t){a=t}},color:{get:function(){return i},set:function(e){i=e,t.color(i)}},duration:{get:function(){return l},set:function(e){l=e,c.reset(l),t.duration(l)}},margin:{get:function(){return r},set:function(e){r.top=void 0!==e.top?e.top:r.top,r.right=void 0!==e.right?e.right:r.right,r.bottom=void 0!==e.bottom?e.bottom:r.bottom,r.left=void 0!==e.left?e.left:r.left,t.margin(r)}}}),e.utils.inheritOptions(d,t),e.utils.initOptions(d),d},e.version="1.8.6",d3}.apply(e,r))||(t.exports=i)},57:function(t,e,n){"use strict";n.r(e),n.d(e,"ChartData",(function(){return r}));class r{static get DEFAULT_MULTIPLIER(){return 1.2}static get MAXIMUM_DIVISIONS(){return 10}static get COLORS(){return["#003663","#E84E0F","#02A99A","#999999"]}constructor(t,e,n,r){this.filter=r,this.initialChartSetup(t,e,n)}initialChartSetup(t,e,n,r=!0){this.disableRangeUpdate=e,this.disableOldDataRemoval=n,this.translateService=t,this.range=150,this.chartOptions=this.getDefaultChartOptions(t),this.chartSetup(this.chartOptions),r&&(this.dataHolder=this.createDataHolder(),this.firstLoad=!0)}refresh(){this.initialChartSetup(this.translateService,this.disableRangeUpdate,this.disableOldDataRemoval,!1),this.translateLabels(this.dataHolder),this.updateRange(this.dataHolder)}translateLabels(t){this.createDataHolder().forEach((e,n)=>{t[n].originalKey?t[n].originalKey=e.key:t[n].key=e.key})}setSubTitle(t){this.chartOptions.title.enable=!0;const e=t.map(t=>{if(Array.isArray(t.value)&&!t.value.length)return;const e=Array.isArray(t.value)?t.value.join("/"):t.value;return t.label+(void 0!==e?`<span class="data-value">${e}</span>`:"")});this.chartOptions.title.html=e.map(t=>`<span class="info-element">${t}</span>`)}chartSetup(t){}createDataHolder(){throw new Error("Must implement data holder creation")}addData(t,e){this.removeOldData(this.dataHolder,this.range),this.addNewData(this.dataHolder,t,e,this.isFirstLoad()),this.updateRange(this.dataHolder),this.firstLoad&&(this.firstLoad=!1)}removeOldData(t,e){this.disableOldDataRemoval||t[0].values.length>e&&t.forEach(t=>t.values.shift())}addNewData(t,e,n,r){}updateRange(t,e){if(this.disableRangeUpdate)return;const[n]=r.calculateMaxChartValueAndDivisions(t,e);this.chartOptions.chart.yDomain=[0,n]}isFirstLoad(){return this.firstLoad}getDefaultChartOptions(t){return{chart:{interpolate:"monotone",type:"lineChart",height:500,margin:{left:80,right:80},x:function(t){return t[0]},y:function(t){return t[1]},clipEdge:!0,noData:t.instant("resource.no_data"),showControls:!1,duration:0,rightAlignYAxis:!1,useInteractiveGuideline:!0,xAxis:{showMaxMin:!1,tickFormat:function(t){return d3.time.format("%X")(new Date(t))}},yAxis:{showMaxMin:!1,tickFormat:function(t){return t}},legend:{maxKeyLength:100},color:r.COLORS},title:{enable:!0,className:"chart-additional-info",html:" "}}}static getMaxValueFromDataHolder(t){return Math.max(...t.filter(t=>!t.disabled).flatMap(t=>r.getMaxValueForDataSeries(t)))}static getMaxValueForDataSeries(t){return Math.max(...t.values.map(t=>t[1]))}static calculateMaxChartValueAndDivisions(t,e){let n;n=Array.isArray(t)?r.getMaxValueFromDataHolder(t):r.getMaxValueForDataSeries(t);const i=Math.round(n*(e||r.DEFAULT_MULTIPLIER))||1;return[i,Math.ceil(i/r.MAXIMUM_DIVISIONS)]}static getIntegerRangeForValues(t,e){const[n,i]=r.calculateMaxChartValueAndDivisions(t,e);return d3.range(0,n+1,i)}static formatBytesValue(t,e){let n=t;e&&(n=Math.max(...e.filter(t=>!t.disabled).flatMap(t=>t.values).flatMap(t=>t[1])));const r=Math.floor(Math.log(n)/Math.log(1024));return`${(parseFloat(t)/Math.pow(1024,r)).toFixed(2)} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`}formatNumber(t){if(t&&this.filter)return this.filter("currency")(t,"",0)}}},59:function(t,e,n){"use strict";n.r(e),n.d(e,"HeapMemoryChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}createDataHolder(){return[{key:this.translateService.instant("resource.memory.committed"),values:[]},{key:this.translateService.instant("resource.memory.used"),area:"true",values:[]}]}addNewData(t,e,n){const[r,i]=t,a=this.parseData(n);r.values.push([e,a.committed]),i.values.push([e,a.used]),this.setMaxHeapSize(a.max)}parseData(t){return t.heapMemoryUsage}setMaxHeapSize(t){if(t>0){const e=[{label:this.translateService.instant("resource.memory.heap.max"),value:i.formatBytesValue(t)}];this.setSubTitle(e)}}updateRange(t){this.setScale(t),super.updateRange(t)}setScale(t){this.chartOptions.chart.yAxis.tickFormat=e=>i.formatBytesValue(e,t)}}},61:function(t,e){angular.module("graphdb.framework.rest.cluster.service",[]).factory("ClusterRestService",n),n.$inject=["$http"];function n(t){return{getClusterConfig:function(){return t.get("rest/cluster/config")},createCluster:function(e){return t.post("rest/cluster/config",e)},updateCluster:function(e){e.nodes&&delete e.nodes;return t.patch("rest/cluster/config",e)},deleteCluster:function(e){const n=$.param({force:e});return t.delete("rest/cluster/config?"+n)},addNodesToCluster:function(e){return t.post("rest/cluster/config/node",{nodes:e})},removeNodesFromCluster:function(e){return t.delete("rest/cluster/config/node",{data:{nodes:e},headers:{"Content-Type":"application/json"}})},getClusterStatus:function(){return t.get("rest/cluster/group/status")},getNodeStatus:function(){return t.get("rest/cluster/node/status")}}}},68:function(t,e,n){"use strict";n.r(e),n.d(e,"FileDescriptorsChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t,e){super(t,!1,!1,e)}chartSetup(t){t.chart.yAxis.tickFormat=t=>this.formatNumber(t),t.chart.color=[t.chart.color[1]]}createDataHolder(){return[{key:this.translateService.instant("resource.system.file_descriptors.open"),area:"true",values:[]}]}addNewData(t,e,n){if(!n.openFileDescriptors){const t=[{label:this.translateService.instant("resource.system.file_descriptors.only_unix")}];return void this.setSubTitle(t)}t[0].values.push([e,n.openFileDescriptors]);const r=[{label:this.translateService.instant("resource.system.file_descriptors.max"),value:this.formatNumber(n.maxFileDescriptors)}];this.setSubTitle(r)}updateRange(t){super.updateRange(t,2)}}},69:function(t,e,n){"use strict";n.r(e),n.d(e,"NonHeapMemoryChart",(function(){return i}));var r=n(59);class i extends r.HeapMemoryChart{constructor(t){super(t,!1,!1)}parseData(t){return t.nonHeapMemoryUsage}}},70:function(t,e,n){"use strict";n.r(e),n.d(e,"CpuLoadChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}chartSetup(t){t.chart.yAxis.tickFormat=function(t){return t+"%"}}createDataHolder(){return[{key:this.translateService.instant("resource.system.cpu_load.label"),values:[]}]}addNewData(t,e,n){t[0].values.push([e,this.formatValue(n.cpuLoad)])}formatValue(t){return parseFloat(t).toFixed(4)}updateRange(t){const e=Math.max(...t[0].values.flatMap(t=>t[1])),n=e>50?100:2*e;this.chartOptions.chart.yDomain=[0,n]}}},71:function(t,e,n){"use strict";n.r(e),n.d(e,"DiskStorageChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!0,!0)}chartSetup(t){Object.assign(t.chart,{type:"multiBarHorizontalChart",height:250,stacked:!0,showControls:!1,xAxis:{showMaxMin:!1,tickFormat:function(t){return t}},yAxis:{showMaxMin:!1,tickFormat:function(t){return(100*t).toFixed(2)+"%"}},yDomain:[0,1]})}translateLabels(t){if(!t)return;super.translateLabels(t);const[e,n]=t;e.values.length&&n.values.length&&(e.values[0][0]=this.translateService.instant("resource.storage.data"),e.values[1][0]=this.translateService.instant("resource.storage.work"),e.values[2][0]=this.translateService.instant("resource.storage.logs"),n.values[0][0]=this.translateService.instant("resource.storage.data"),n.values[1][0]=this.translateService.instant("resource.storage.work"),n.values[2][0]=this.translateService.instant("resource.storage.logs"))}createDataHolder(){return[{key:this.translateService.instant("resource.storage.used"),color:this.chartOptions.chart.color[1],values:[]},{key:this.translateService.instant("resource.storage.free"),color:this.chartOptions.chart.color[0],values:[]}]}addNewData(t,e,n,r){const a=n.storageMemory,[o,s]=t;r&&(o.values.push([this.translateService.instant("resource.storage.data"),0]),o.values.push([this.translateService.instant("resource.storage.work"),0]),o.values.push([this.translateService.instant("resource.storage.logs"),0]),s.values.push([this.translateService.instant("resource.storage.data"),1]),s.values.push([this.translateService.instant("resource.storage.work"),1]),s.values.push([this.translateService.instant("resource.storage.logs"),1]));const l=[{label:this.translateService.instant("resource.storage.subtitle.data"),value:[i.formatBytesValue(a.dataDirUsed),i.formatBytesValue(a.dataDirFree)]},{label:this.translateService.instant("resource.storage.subtitle.work"),value:[i.formatBytesValue(a.workDirUsed),i.formatBytesValue(a.workDirFree)]},{label:this.translateService.instant("resource.storage.subtitle.logs"),value:[i.formatBytesValue(a.logsDirUsed),i.formatBytesValue(a.logsDirFree)]}];this.setSubTitle(l);const u=a.dataDirUsed+a.dataDirFree,c=a.workDirUsed+a.workDirFree,d=a.logsDirUsed+a.logsDirFree;o.values[0][1]=a.dataDirUsed/u,o.values[1][1]=a.workDirUsed/c,o.values[2][1]=a.logsDirUsed/d,s.values[0][1]=a.dataDirFree/u,s.values[1][1]=a.workDirFree/c,s.values[2][1]=a.logsDirFree/d}}},72:function(t,e,n){"use strict";n.r(e),n.d(e,"QueriesChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}chartSetup(t){t.chart.yAxis.tickValues=()=>i.getIntegerRangeForValues(this.dataHolder)}createDataHolder(){return[{key:this.translateService.instant("resource.queries.running"),values:[]}]}addNewData(t,e,n){const{activeQueryData:r,performanceData:i}=n;t[0].values.push([e,r.length]);const a=i.queries.slow,o=i.queries.suboptimal,s=[{label:this.translateService.instant("resource.queries.slow"),value:a},{label:this.translateService.instant("resource.queries.suboptimal"),value:o}];this.setSubTitle(s)}}},73:function(t,e,n){"use strict";n.r(e),n.d(e,"GlobalCacheChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t,e){super(t,!1,!1,e)}chartSetup(t){t.chart.yAxis.tickFormat=t=>this.formatNumber(t)}getTitle(){return this.translateService.instant("resources.global_cache.label")}createDataHolder(){return[{key:this.translateService.instant("resources.global_cache.hits"),values:[]},{key:this.translateService.instant("resources.global_cache.miss"),values:[]}]}addNewData(t,e,n){const[r,i]=t;r.values.push([e,n.cacheHit]),i.values.push([e,n.cacheMiss])}}},74:function(t,e,n){"use strict";n.r(e),n.d(e,"ConnectionsChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}chartSetup(t){t.chart.yAxis.tickValues=()=>i.getIntegerRangeForValues(this.dataHolder)}createDataHolder(){return[{key:this.translateService.instant("resource.connections.active"),values:[]},{key:this.translateService.instant("resource.connections.open"),values:[]}]}addNewData(t,e,n){const r=n.performanceData;t[0].values.push([e,r.activeTransactions]),t[1].values.push([e,r.openConnections])}}},75:function(t,e,n){"use strict";n.r(e),n.d(e,"ClusterHealthChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!0,!1),this.nodesCount=0}chartSetup(t){const e={type:"stackedAreaChart",interpolate:"step-after",stacked:!0,yAxis:{showMaxMin:!1,tickFormat:function(t){return t},tickValues:()=>d3.range(0,this.nodesCount+1,1)}};Object.assign(t.chart,e)}getTitle(){return this.translateService.instant("resources.cluster_health.label")}createDataHolder(){const[t,e,n,r]=i.COLORS;return[{key:this.translateService.instant("resources.cluster_health.in_sync"),color:t,values:[]},{key:this.translateService.instant("resources.cluster_health.syncing"),color:n,values:[]},{key:this.translateService.instant("resources.cluster_health.out_sync"),color:e,values:[]},{key:this.translateService.instant("resources.cluster_health.disconnected"),color:r,values:[]}]}addNewData(t,e,n){const r=n.nodesStats;this.nodesCount=r.nodesInCluster;const[i,a,o,s]=t;i.values.push([e,r.nodesInSync]),o.values.push([e,r.nodesOutOfSync]),s.values.push([e,r.nodesDisconnected]),a.values.push([e,r.nodesSyncing]);const l=[{label:this.translateService.instant("resource.cluster_health.leader_elections"),value:n.term},{label:this.translateService.instant("resource.cluster_health.recoveries"),value:n.failureRecoveriesCount},{label:this.translateService.instant("resource.cluster_health.failed_transactions"),value:n.failedTransactionsCount}];this.setSubTitle(l)}}},76:function(t,e,n){"use strict";n.r(e),n.d(e,"EpoolChart",(function(){return i}));var r=n(57);class i extends r.ChartData{constructor(t){super(t,!1,!1)}chartSetup(t){const e={type:"multiChart",yAxis1:{showMaxMin:!1,axisLabel:this.translateService.instant("resource.epool.reads"),axisLabelDistance:-10,rotateYLabel:!0,tickFormat:function(t){return t},tickValues:()=>i.getIntegerRangeForValues(this.dataHolder[0])},yAxis2:{showMaxMin:!1,axisLabel:this.translateService.instant("resource.epool.writes"),axisLabelDistance:-10,rotateYLabel:!0,tickFormat:function(t){return t},tickValues:()=>i.getIntegerRangeForValues(this.dataHolder[1])},y1Domain:[0,1],y2Domain:[0,1]};Object.assign(t.chart,e)}getTitle(){return this.translateService.instant("resource.epool.label")}createDataHolder(){return[{key:this.translateService.instant("resource.epool.reads"),type:"line",yAxis:1,values:[]},{key:this.translateService.instant("resource.epool.writes"),type:"line",yAxis:2,values:[]}]}addNewData(t,e,n,r){const i=n.performanceData,[a,o]=t;let s=0,l=0;const u=i.entityPool.epoolReads,c=i.entityPool.epoolWrites;if(!r){s=u-a.values[a.values.length-1][2],l=c-o.values[a.values.length-1][2]}a.values.push([e,s,u]),o.values.push([e,l,c])}updateRange(t){this.chartOptions.chart.yDomain1=this.getAxisDomain(t[0]),this.chartOptions.chart.yDomain2=this.getAxisDomain(t[1])}getAxisDomain(t){const[e]=i.calculateMaxChartValueAndDivisions(t);return[0,e]}}},82:function(t,e,n){"use strict";n.r(e);n(7),n(22),n(25),n(305),n(61);var r=n(68),i=n(59),a=n(69),o=n(70),s=n(71),l=n(72),u=n(73),c=n(74),d=n(75),f=n(76);angular.module("graphdb.framework.jmx.resources.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","graphdb.framework.rest.cluster.service"]).controller("ResourcesCtrl",["$scope","$rootScope","$timeout","MonitoringRestService","$translate","$repositories","$q","ClusterRestService","$filter",function(t,e,n,p,h,g,v,m,y){t.AVAILABLE_TABS=Object.freeze({RESOURCE_MONITOR:"resource",PERFORMANCE_MONITOR:"performance",CLUSTER_HEALTH:"cluster"});const x=window.location.hash.slice(1),b=Object.keys(t.AVAILABLE_TABS).find(e=>t.AVAILABLE_TABS[e]===x);t.activeTab=t.AVAILABLE_TABS[b]||t.AVAILABLE_TABS.RESOURCE_MONITOR,e.$on("$translateChangeSuccess",(function(e,n){[t.resourceMonitorData,t.performanceMonitorData,t.structuresMonitorData,t.clusterHealthData].forEach(t=>{Object.values(t.charts).forEach(t=>t.refresh())})})),t.resourceMonitorData={error:{hasError:!1,message:"",retries:0},charts:{cpuLoad:new o.CpuLoadChart(h),fileDescriptors:new r.FileDescriptorsChart(h,y),heapMemory:new i.HeapMemoryChart(h),offHeapMemory:new a.NonHeapMemoryChart(h),diskStorage:new s.DiskStorageChart(h)}},t.performanceMonitorData={error:{hasError:!1,message:"",retries:0},charts:{connectionsChart:new c.ConnectionsChart(h),epoolChart:new f.EpoolChart(h),queriesChart:new l.QueriesChart(h)}},t.structuresMonitorData={error:{hasError:!1,message:"",retries:0},charts:{globalCacheChart:new u.GlobalCacheChart(h,y)}},t.clusterHealthData={error:{hasError:!1,message:"",retries:0},charts:{clusterHealthChart:new d.ClusterHealthChart(h)}},t.hasCluster=!1;t.loader=!0,t.switchTab=e=>{t.activeTab=e,window.location.hash=e},t.getActiveRepository=function(){return g.getActiveRepository()};const k=function(t){return p.monitorQueryTransactionStatistics(t).then((function(t){return t.data}))},w=function(t){return p.monitorQuery(t).then((function(t){return t.data}))},M=function(){return p.monitorCluster()},A=t=>{if(t.chartsHolder.error.hasError){if(3===t.chartsHolder.error.retries)return t.poll&&n.cancel(t.poll),Promise.resolve();t.chartsHolder.error.retries++}return t.fetchFn().then((function(e){C(e,t)})).then(()=>{E(t)}).catch(e=>{D(t,e)}).finally(()=>{t.poll&&n.cancel(t.poll),t.poll=n(()=>A(t),2e3)})},C=(t,e,n)=>{const r=t.data;r&&S(r,e,n)},S=(t,e,n)=>{const r=new Date;n?n(r,t):Object.values(e.chartsHolder.charts).forEach(e=>{e.addData(r,t)})},D=(t,e)=>{t.chartsHolder.error.hasError=!!e,t.chartsHolder.error.hasError&&(t.chartsHolder.error.message=getError(e))},E=t=>{t.chartsHolder.error.hasError=!1,t.chartsHolder.error.message=""};t.monitors=[],t.monitors.push({chartsHolder:t.resourceMonitorData,error:{hasError:!1,message:"",retries:0},fetchFn:function(){return p.monitorResources()},poll:null}),t.monitors.push({chartsHolder:t.structuresMonitorData,error:{hasError:!1,message:"",retries:0},fetchFn:function(){const e=t.getActiveRepository();return e?p.monitorStructures(e):Promise.resolve()},poll:null}),t.monitors.push({chartsHolder:t.performanceMonitorData,error:{hasError:!1,message:"",retries:0},fetchFn:function(){const e=t.getActiveRepository();return e?v.all([k(e),w(e)]).then(t=>{const[e,n]=t;return{data:{performanceData:e,activeQueryData:n}}}):Promise.resolve()},poll:null}),m.getNodeStatus().then(()=>{t.hasCluster=!0;const e={chartsHolder:t.clusterHealthData,fetchFn:M,poll:null};t.monitors.push(e),A(e)}).catch(()=>{t.hasCluster=!1});let F=null;v.all(t.monitors.map(t=>A(t))).finally(()=>{t.loader&&(F&&n.cancel(F),F=n((function(){t.loader=!1}),500))}),t.$on("$destroy",(function(){F&&n.cancel(F);for(const e of t.monitors)e.poll&&n.cancel(e.poll)}))}])}}]);
|