diff --git a/bower.json b/bower.json index 69d0bf2782..9da70df06f 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "plottable", "description": "A modular charting library built on D3", - "version": "3.0.0-beta.3", + "version": "3.0.0-beta.4", "main": [ "plottable.js", "plottable.css" diff --git a/package.json b/package.json index a4118754c2..583aa35caf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "plottable", "description": "A modular charting library built on D3", - "version": "3.0.0-beta.3", + "version": "3.0.0-beta.4", "license": "MIT", "repository": { "type": "git", diff --git a/plottable.js b/plottable.js index 1842c419bb..c038c84b52 100644 --- a/plottable.js +++ b/plottable.js @@ -7756,7 +7756,7 @@ exports.Dataset = Dataset; * real version number during the dist phase for for npm module publishing. Modifying this line should * be accompanied by modifying the "sed-version" task in package.json accordingly. */ -exports.version = "3.0.0-beta.3"; +exports.version = "3.0.0-beta.4"; /***/ }), diff --git a/plottable.min.js b/plottable.min.js index dbc542498f..43c830e1be 100644 --- a/plottable.min.js +++ b/plottable.min.js @@ -1,9 +1,9 @@ -!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("d3")):"function"==typeof define&&define.amd?define(["d3"],b):"object"==typeof exports?exports.Plottable=b(require("d3")):a.Plottable=b(a.d3)}(this,function(a){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.i=function(a){return a},b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=124)}([function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}var e=c(94);b.Array=e;var f=c(96);b.Color=f;var g=c(97);b.DOM=g;var h=c(28);b.Math=h;var i=c(100);b.Stacking=i;var j=c(102);b.Window=j,d(c(95)),d(c(11)),d(c(98)),d(c(99)),d(c(40)),d(c(101))},function(b,c){b.exports=a},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(6),g=c(5),h=c(7),i=c(0),j=c(37),k=c(11),l=function(a){function b(){var c=this;a.call(this),this._dataChanged=!1,this._animate=!1,this._animators={},this._overflowHidden=!0,this.addClass("plot"),this._datasetToDrawer=new i.Map,this._attrBindings=e.map(),this._attrExtents=e.map(),this._includedValuesProvider=function(a){return c._includedValuesForScale(a)},this._renderCallback=function(a){return c.render()},this._onDatasetUpdateCallback=function(){return c._onDatasetUpdate()},this._propertyBindings=e.map(),this._propertyExtents=e.map();var d=(new f.Easing).maxTotalDuration(b._ANIMATION_MAX_DURATION);this.animator(j.Animator.MAIN,d),this.animator(j.Animator.RESET,new f.Null)}return d(b,a),b.prototype.anchor=function(b){return b=k.coerceExternalD3(b),a.prototype.anchor.call(this,b),this._dataChanged=!0,this._cachedEntityStore=void 0,this._updateExtents(),this},b.prototype._setup=function(){var b=this;a.prototype._setup.call(this),null!=this._canvas&&this.element().node().appendChild(this._canvas.node()),this._renderArea=this.content().append("g").classed("render-area",!0),this.datasets().forEach(function(a){return b._createNodesForDataset(a)})},b.prototype.computeLayout=function(b,c,d){return a.prototype.computeLayout.call(this,b,c,d),null!=this._canvas&&(this._canvas.attr("width",this.width()),this._canvas.attr("height",this.height())),this},b.prototype.destroy=function(){var b=this;a.prototype.destroy.call(this),this._scales().forEach(function(a){return a.offUpdate(b._renderCallback)}),this.datasets([])},b.prototype._createNodesForDataset=function(a){var b=this._datasetToDrawer.get(a);return"svg"===this.renderer()?b.renderArea(this._renderArea.append("g")):b.canvas(this._canvas),b},b.prototype._createDrawer=function(a){return new h.Drawer(a)},b.prototype._getAnimator=function(a){return this._animateOnNextRender()?this._animators[a]||new f.Null:new f.Null},b.prototype._onDatasetUpdate=function(){this._updateExtents(),this._dataChanged=!0,this._cachedEntityStore=void 0,this.render()},b.prototype.attr=function(a,b,c){return null==b?this._attrBindings.get(a):(this._bindAttr(a,b,c),this.render(),this)},b.prototype._bindProperty=function(a,b,c){var d=this._propertyBindings.get(a),e=null!=d?d.scale:null,f="function"==typeof b?b:function(){return b};this._propertyBindings.set(a,{accessor:f,scale:c}),this._updateExtentsForProperty(a),null!=e&&this._uninstallScaleForKey(e,a),null!=c&&this._installScaleForKey(c,a)},b.prototype._bindAttr=function(a,b,c){var d=this._attrBindings.get(a),e=null!=d?d.scale:null,f="function"==typeof b?b:function(){return b};this._attrBindings.set(a,{accessor:f,scale:c}),this._updateExtentsForAttr(a),null!=e&&this._uninstallScaleForKey(e,a),null!=c&&this._installScaleForKey(c,a)},b.prototype._generateAttrToProjector=function(){var a={};this._attrBindings.each(function(b,c){var d=b.accessor,e=b.scale,f=e?function(a,b,c){return e.scale(d(a,b,c))}:d;a[c]=f});var b=this._propertyProjectors();return Object.keys(b).forEach(function(c){null==a[c]&&(a[c]=b[c])}),a},b.prototype.renderImmediately=function(){return a.prototype.renderImmediately.call(this),this._isAnchored&&(this._paint(),this._dataChanged=!1),this},b.prototype.animated=function(a){return null==a?this._animate:(this._animate=a,this)},b.prototype.detach=function(){return a.prototype.detach.call(this),this._updateExtents(),this},b.prototype._scales=function(){var a=[];return this._attrBindings.each(function(b,c){var d=b.scale;null!=d&&a.indexOf(d)===-1&&a.push(d)}),this._propertyBindings.each(function(b,c){var d=b.scale;null!=d&&a.indexOf(d)===-1&&a.push(d)}),a},b.prototype._updateExtents=function(){var a=this;this._attrBindings.each(function(b,c){return a._updateExtentsForAttr(c)}),this._propertyExtents.each(function(b,c){return a._updateExtentsForProperty(c)}),this._scales().forEach(function(b){return b.addIncludedValuesProvider(a._includedValuesProvider)})},b.prototype._updateExtentsForAttr=function(a){this._updateExtentsForKey(a,this._attrBindings,this._attrExtents,null)},b.prototype._updateExtentsForProperty=function(a){this._updateExtentsForKey(a,this._propertyBindings,this._propertyExtents,this._filterForProperty(a))},b.prototype._filterForProperty=function(a){return null},b.prototype._updateExtentsForKey=function(a,b,c,d){var e=this,f=b.get(a);null!=f&&null!=f.accessor&&c.set(a,this.datasets().map(function(a){return e._computeExtent(a,f,d)}))},b.prototype._computeExtent=function(a,b,c){var d=b.accessor,e=b.scale;if(null==e)return[];var f=a.data();null!=c&&(f=f.filter(function(b,d){return c(b,d,a)}));var g=function(b,c){return d(b,c,a)},h=f.map(g);return e.extentOfValues(h)},b.prototype._extentsForProperty=function(a){return this._propertyExtents.get(a)},b.prototype._includedValuesForScale=function(a){var b=this;if(!this._isAnchored)return[];var c=[];return this._attrBindings.each(function(d,f){if(d.scale===a){var g=b._attrExtents.get(f);null!=g&&(c=c.concat(e.merge(g)))}}),this._propertyBindings.each(function(d,f){if(d.scale===a){var g=b._extentsForProperty(f);null!=g&&(c=c.concat(e.merge(g)))}}),c},b.prototype.animator=function(a,b){return void 0===b?this._animators[a]:(this._animators[a]=b,this)},b.prototype.renderer=function(a){var b=this;return void 0===a?null==this._canvas?"svg":"canvas":(null==this._canvas&&"canvas"===a?(this._canvas=e.select(document.createElement("canvas")).classed("plot-canvas",!0),null!=this.element()&&this.element().node().appendChild(this._canvas.node()),this._datasetToDrawer.forEach(function(a){null!=a.renderArea()&&a.renderArea().remove(),a.canvas(b._canvas)}),this.render()):null!=this._canvas&&"svg"==a&&(this._canvas.remove(),this._canvas=null,this._datasetToDrawer.forEach(function(a){a.renderArea(b._renderArea.append("g"))}),this.render()),this)},b.prototype.addDataset=function(a){return this._addDataset(a),this._onDatasetUpdate(),this},b.prototype._addDataset=function(a){this._removeDataset(a);var b=this._createDrawer(a);return this._datasetToDrawer.set(a,b),this._isSetup&&this._createNodesForDataset(a),a.onUpdate(this._onDatasetUpdateCallback),this},b.prototype.removeDataset=function(a){return this._removeDataset(a),this._onDatasetUpdate(),this},b.prototype._removeDataset=function(a){return this.datasets().indexOf(a)===-1?this:(this._removeDatasetNodes(a),a.offUpdate(this._onDatasetUpdateCallback),this._datasetToDrawer["delete"](a),this)},b.prototype._removeDatasetNodes=function(a){var b=this._datasetToDrawer.get(a);b.remove()},b.prototype.datasets=function(a){var b=this,c=[];return this._datasetToDrawer.forEach(function(a,b){return c.push(b)}),null==a?c:(c.forEach(function(a){return b._removeDataset(a)}),a.forEach(function(a){return b._addDataset(a)}),this._onDatasetUpdate(),this)},b.prototype._generateDrawSteps=function(){return[{attrToProjector:this._generateAttrToProjector(),animator:new f.Null}]},b.prototype._additionalPaint=function(a){},b.prototype._buildLightweightPlotEntities=function(a){var b=this,c=[];return a.forEach(function(a,d){var e=b._datasetToDrawer.get(a),f=0;a.data().forEach(function(g,h){var j=b._pixelPoint(g,h,a);if(!i.Math.isNaN(j.x)&&!i.Math.isNaN(j.y)){var k=b;c.push({datum:g,get position(){return k._pixelPoint.call(k,g,h,a)},index:h,dataset:a,datasetIndex:d,component:b,drawer:e,validDatumIndex:f}),f++}})}),c},b.prototype._getDataToDraw=function(){var a=new i.Map;return this.datasets().forEach(function(b){return a.set(b,b.data())}),a},b.prototype._paint=function(){var a=this,b=this._generateDrawSteps(),c=this._getDataToDraw(),d=this.datasets().map(function(b){return a._datasetToDrawer.get(b)});this.datasets().forEach(function(a,e){return d[e].draw(c.get(a),b)});var e=this.datasets().map(function(a,e){return d[e].totalDrawTime(c.get(a),b)}),f=i.Math.max(e,0);this._additionalPaint(f)},b.prototype.selections=function(a){var b=this;void 0===a&&(a=this.datasets());var c=[];return a.forEach(function(a){var d=b._datasetToDrawer.get(a);null!=d&&d.renderArea().selectAll(d.selector()).each(function(){c.push(this)})}),e.selectAll(c)},b.prototype.entities=function(a){var b=this;return this._getEntityStore(a).map(function(a){return b._lightweightPlotEntityToPlotEntity(a)})},b.prototype._getEntityStore=function(a){var b=this;if(void 0!==a){var c=new i.EntityArray;return this._buildLightweightPlotEntities(a).forEach(function(a){c.add(a)}),c}return void 0===this._cachedEntityStore&&(this._cachedEntityStore=new i.EntityArray,this._buildLightweightPlotEntities(this.datasets()).forEach(function(a){b._cachedEntityStore.add(a)})),this._cachedEntityStore},b.prototype._lightweightPlotEntityToPlotEntity=function(a){var b={datum:a.datum,position:a.position,dataset:a.dataset,datasetIndex:a.datasetIndex,index:a.index,component:a.component,selection:a.drawer.selectionForIndex(a.validDatumIndex)};return b},b.prototype.entitiesAt=function(a){throw new Error("plots must implement entitiesAt")},b.prototype.entityNearest=function(a,b){var c=this;void 0===b&&(b=this.bounds());var d=this._getEntityStore().entityNearest(a,function(a){return c._entityVisibleOnPlot(a,b)});return void 0===d?void 0:this._lightweightPlotEntityToPlotEntity(d)},b.prototype._entityVisibleOnPlot=function(a,b){return!(a.position.xb.bottomRight.x||a.position.y>b.bottomRight.y)},b.prototype._uninstallScaleForKey=function(a,b){a.offUpdate(this._renderCallback),a.removeIncludedValuesProvider(this._includedValuesProvider)},b.prototype._installScaleForKey=function(a,b){a.onUpdate(this._renderCallback),a.addIncludedValuesProvider(this._includedValuesProvider)},b.prototype._propertyProjectors=function(){return{}},b._scaledAccessor=function(a){return null==a.scale?a.accessor:function(b,c,d){return a.scale.scale(a.accessor(b,c,d))}},b.prototype._pixelPoint=function(a,b,c){return{x:0,y:0}},b.prototype._animateOnNextRender=function(){return this._animate&&this._dataChanged},b._ANIMATION_MAX_DURATION=600,b}(g.Component);b.Plot=l},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}function e(a){return a instanceof h.QuantitativeScale||a instanceof g.Category}var f=c(92);b.TickGenerators=f,d(c(39)),d(c(88)),d(c(89)),d(c(90)),d(c(91)),d(c(93));var g=c(39),h=c(10);b.isTransformable=e},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(41)),d(c(44)),d(c(117)),d(c(18)),d(c(46)),d(c(48))},function(a,b,c){"use strict";var d=c(1),e=c(25),f=c(0),g=c(11),h=function(){function a(){this._overflowHidden=!1,this._origin={x:0,y:0},this._xAlignment="left",this._yAlignment="top",this._isSetup=!1,this._isAnchored=!1,this._boxes=[],this._cssClasses=new f.Set,this._destroyed=!1,this._onAnchorCallbacks=new f.CallbackSet,this._onDetachCallbacks=new f.CallbackSet,this._cssClasses.add("component")}return a.prototype.anchor=function(a){if(a=g.coerceExternalD3(a),this._destroyed)throw new Error("Can't reuse destroy()-ed Components!");return this.isRoot()&&(this._rootElement=a,this._rootElement.classed("plottable",!0)),null!=this._element?a.node().appendChild(this._element.node()):(this._element=a.append("div"),this._setup()),this._isAnchored=!0,this._onAnchorCallbacks.callCallbacks(this),this},a.prototype.onAnchor=function(a){return this._isAnchored&&a(this),this._onAnchorCallbacks.add(a),this},a.prototype.offAnchor=function(a){return this._onAnchorCallbacks["delete"](a),this},a.prototype._setup=function(){var a=this;this._isSetup||(this._cssClasses.forEach(function(b){a._element.classed(b,!0)}),this._cssClasses=new f.Set,this._backgroundContainer=this._element.append("svg").classed("background-container",!0),this._addBox("background-fill",this._backgroundContainer),this._content=this._element.append("svg").classed("content",!0),this._foregroundContainer=this._element.append("svg").classed("foreground-container",!0),this._boxContainer=this._element.append("svg").classed("box-container",!0),this._overflowHidden?this._content.classed("component-overflow-hidden",!0):this._content.classed("component-overflow-visible",!0),this._boundingBox=this._addBox("bounding-box"),this._isSetup=!0)},a.prototype.requestedSpace=function(a,b){return{minWidth:0,minHeight:0}},a.prototype.computeLayout=function(b,c,d){var e=this;if(null==b||null==c||null==d){if(null==this._element)throw new Error("anchor() must be called before computeLayout()");if(null==this._rootElement)throw new Error("null arguments cannot be passed to computeLayout() on a non-root, unanchored node");b={x:0,y:0};var g=this._rootElement.node();c=f.DOM.elementWidth(g),d=f.DOM.elementHeight(g)}var h=this._sizeFromOffer(c,d);this._width=h.width,this._height=h.height;var i=a._xAlignToProportion[this._xAlignment],j=a._yAlignToProportion[this._yAlignment];return this._origin={x:b.x+(c-this.width())*i,y:b.y+(d-this.height())*j},this._element.styles({left:this._origin.x+"px",height:this.height()+"px",top:this._origin.y+"px",width:this.width()+"px"}),this._boxes.forEach(function(a){return a.attr("width",e.width()).attr("height",e.height())}),null!=this._resizeHandler&&this._resizeHandler(h),this},a.prototype._sizeFromOffer=function(a,b){var c=this.requestedSpace(a,b);return{width:this.fixedWidth()?Math.min(a,c.minWidth):a,height:this.fixedHeight()?Math.min(b,c.minHeight):b}},a.prototype.render=function(){return this._isAnchored&&this._isSetup&&this.width()>=0&&this.height()>=0&&e.registerToRender(this),this},a.prototype._scheduleComputeLayout=function(){this._isAnchored&&this._isSetup&&e.registerToComputeLayoutAndRender(this)},a.prototype.onResize=function(a){return this._resizeHandler=a,this},a.prototype.renderImmediately=function(){return this},a.prototype.redraw=function(){return this._isAnchored&&this._isSetup&&(this.isRoot()?this._scheduleComputeLayout():this.parent().redraw()),this},a.prototype.invalidateCache=function(){},a.prototype.renderTo=function(a){if(this.detach(),null!=a){var b=void 0;if(b="string"==typeof a?d.select(a):a instanceof Element?d.select(a):g.coerceExternalD3(a),!b.node()||null==b.node().nodeName)throw new Error("Plottable requires a valid Element to renderTo");if("svg"===b.node().nodeName)throw new Error("Plottable 3.x and later can only renderTo an HTML component; pass a div instead!");this.anchor(b)}if(null==this._element)throw new Error("If a Component has never been rendered before, then renderTo must be given a node to render to, or a d3.Selection, or a selector string");return e.registerToComputeLayoutAndRender(this),e.flush(),this},a.prototype.xAlignment=function(b){if(null==b)return this._xAlignment;if(b=b.toLowerCase(),null==a._xAlignToProportion[b])throw new Error("Unsupported alignment: "+b);return this._xAlignment=b,this.redraw(),this},a.prototype.yAlignment=function(b){if(null==b)return this._yAlignment;if(b=b.toLowerCase(),null==a._yAlignToProportion[b])throw new Error("Unsupported alignment: "+b);return this._yAlignment=b,this.redraw(),this},a.prototype._addBox=function(a,b){if(null==this._element)throw new Error("Adding boxes before anchoring is currently disallowed");b=null==b?this._boxContainer:b;var c=b.append("rect");return null!=a&&c.classed(a,!0),c.attr("stroke-width","0"),this._boxes.push(c),null!=this.width()&&null!=this.height()&&c.attr("width",this.width()).attr("height",this.height()),c},a.prototype.hasClass=function(a){return null!=a&&(null==this._element?this._cssClasses.has(a):this._element.classed(a))},a.prototype.addClass=function(a){return null==a?this:(null==this._element?this._cssClasses.add(a):this._element.classed(a,!0),this)},a.prototype.removeClass=function(a){return null==a?this:(null==this._element?this._cssClasses["delete"](a):this._element.classed(a,!1),this)},a.prototype.fixedWidth=function(){return!1},a.prototype.fixedHeight=function(){return!1},a.prototype.detach=function(){return this.parent(null),this._isAnchored&&this._element.remove(),this._isAnchored=!1,this._onDetachCallbacks.callCallbacks(this),this},a.prototype.onDetach=function(a){return this._onDetachCallbacks.add(a),this},a.prototype.offDetach=function(a){return this._onDetachCallbacks["delete"](a),this},a.prototype.parent=function(a){if(void 0===a)return this._parent;if(null!==a&&!a.has(this))throw new Error("Passed invalid parent");return this._parent=a,this},a.prototype.bounds=function(){var a=this.origin();return{topLeft:a,bottomRight:{x:a.x+this.width(),y:a.y+this.height()}}},a.prototype.destroy=function(){this._destroyed=!0,this.detach()},a.prototype.width=function(){return this._width},a.prototype.height=function(){return this._height},a.prototype.origin=function(){return{x:this._origin.x,y:this._origin.y}},a.prototype.originToRoot=function(){for(var a=this.origin(),b=this.parent();null!=b;){var c=b.origin();a.x+=c.x,a.y+=c.y,b=b.parent()}return a},a.prototype.root=function(){for(var a=this;!a.isRoot();)a=a.parent();return a},a.prototype.isRoot=function(){return null==this.parent()},a.prototype.foreground=function(){return this._foregroundContainer},a.prototype.content=function(){return this._content},a.prototype.element=function(){return this._element},a.prototype.rootElement=function(){return this.root()._rootElement},a.prototype.background=function(){return this._backgroundContainer},a._xAlignToProportion={left:0,center:.5,right:1},a._yAlignToProportion={top:0,center:.5,bottom:1},a}();b.Component=h},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(53)),d(c(54))},function(a,b,c){"use strict";var d=c(1),e=c(0),f=c(11),g=function(){function a(a){this._cachedSelectionValid=!1,this._dataset=a,this._svgElementName="path"}return a.prototype.canvas=function(a){return void 0===a?this._canvas:(a=f.coerceExternalD3(a),this._canvas=a,this._renderArea=null,this._cachedSelectionValid=!1,this)},a.prototype.renderArea=function(a){return void 0===a?this._renderArea:(a=f.coerceExternalD3(a),this._renderArea=a,this._canvas=null,this._cachedSelectionValid=!1,this)},a.prototype.remove=function(){null!=this.renderArea()&&this.renderArea().remove()},a.prototype._bindSelectionData=function(a){var b=this.selection().data(a),c=b.enter().append(this._svgElementName).merge(b);b.exit().remove(),this._applyDefaultAttributes(c)},a.prototype._applyDefaultAttributes=function(a){null!=this._className&&a.classed(this._className,!0)},a.prototype._drawStep=function(a){var b=this.selection(),c=["fill","stroke"];c.forEach(function(c){null!=a.attrToAppliedProjector[c]&&b.attr(c,a.attrToAppliedProjector[c])}),a.animator.animate(b,a.attrToAppliedProjector),null!=this._className&&this.selection().classed(this._className,!0)},a.prototype._drawStepCanvas=function(a,b){e.Window.warn("canvas rendering not yet implemented on "+this.constructor.name)},a.prototype._appliedProjectors=function(a){var b=this,c={};return Object.keys(a).forEach(function(d){c[d]=function(c,e){return a[d](c,e,b._dataset)}}),c},a.prototype.totalDrawTime=function(a,b){var c=0;return b.forEach(function(b,d){c+=b.animator.totalTime(a.length)}),c},a.prototype.draw=function(a,b){var c=this,d=b.map(function(a){var b=c._appliedProjectors(a.attrToProjector);return{attrToAppliedProjector:b,animator:a.animator}});if(null!=this._renderArea){this._bindSelectionData(a),this._cachedSelectionValid=!1;var f=0;d.forEach(function(b,d){e.Window.setTimeout(function(){return c._drawStep(b)},f),f+=b.animator.totalTime(a.length)})}else{if(null==this._canvas)throw new Error("Drawer's canvas and renderArea are both null!");var g=this.canvas().node(),h=g.getContext("2d");h.clearRect(0,0,g.width,g.height);var i=d[d.length-1];e.Window.setTimeout(function(){return c._drawStepCanvas(a,i)},0)}return this},a.prototype.selection=function(){return this.maybeRefreshCache(),this._cachedSelection},a.prototype.selector=function(){return this._svgElementName},a.prototype.selectionForIndex=function(a){return this.maybeRefreshCache(),null!=this._cachedSelectionNodes?d.select(this._cachedSelectionNodes[a]):null},a.prototype.maybeRefreshCache=function(){this._cachedSelectionValid||(null!=this._renderArea?(this._cachedSelection=this.renderArea().selectAll(this.selector()),this._cachedSelectionNodes=this._cachedSelection.nodes()):(this._cachedSelection=null,this._cachedSelectionNodes=null),this._cachedSelectionValid=!0)},a}();b.Drawer=g},function(a,b,c){"use strict";function d(a,b,c){void 0===a&&(a=2),void 0===b&&(b="$"),void 0===c&&(c=!0);var d=e(a);return function(a){var e=d(Math.abs(a));return""!==e&&(c?e=b+e:e+=b,a<0&&(e="-"+e)),e}}function e(a){return void 0===a&&(a=3),m(a),function(b){return b.toFixed(a)}}function f(a){return void 0===a&&(a=3),m(a),function(b){if("number"==typeof b){var c=Math.pow(10,a);return String(Math.round(b*c)/c)}return String(b)}}function g(){return function(a){return String(a)}}function h(a){void 0===a&&(a=0);var b=e(a);return function(a){var c=100*a,d=a.toString(),e=Math.pow(10,d.length-(d.indexOf(".")+1));return c=parseInt((c*e).toString(),10)/e,b(c)+"%"}}function i(a){return void 0===a&&(a=3),m(a),function(b){return n.format("."+a+"s")(b)}}function j(a){void 0===a&&(a=3),m(a);var b="KMBTQ",c=n.format("."+a+"e"),d=n.format("."+a+"f"),e=Math.pow(10,3*(b.length+1)),f=Math.pow(10,-a);return function(a){var g=Math.abs(a);if((g=e)&&0!==g)return c(a);for(var h=-1;g>=Math.pow(1e3,h+2)&&h0&&"1000"===i.substr(0,4)||a<0&&"-1000"===i.substr(0,5))&&(h0?c[0].specifier:"%Y";return n.timeFormat(d)(b)}}function l(a){return n.timeFormat(a)}function m(a){if(a<0||a>20)throw new RangeError("Formatter precision must be between 0 and 20");if(a!==Math.floor(a))throw new RangeError("Formatter precision must be an integer")}var n=c(1);b.currency=d,b.fixed=e,b.general=f,b.identity=g,b.percentage=h,b.siSuffix=i,b.shortScale=j,b.multiTime=k,b.time=l},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(69)),d(c(70)),d(c(71)),d(c(72)),d(c(73)),d(c(74)),d(c(75))},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(13),g=c(0),h=c(17),i=function(a){function b(){a.call(this),this._tickGenerator=function(a){return a.defaultTicks()},this._padProportion=.05,this._snappingDomainEnabled=!0,this._paddingExceptionsProviders=new g.Set}return d(b,a),b.prototype.autoDomain=function(){return this._domainMin=null,this._domainMax=null,a.prototype.autoDomain.call(this),this},b.prototype._autoDomainIfAutomaticMode=function(){if(null!=this._domainMin&&null!=this._domainMax)return void this._setDomain([this._domainMin,this._domainMax]);var b=this._getExtent();if(null!=this._domainMin){var c=b[1];return this._domainMin>=c&&(c=this._expandSingleValueDomain([this._domainMin,this._domainMin])[1]),void this._setDomain([this._domainMin,c])}if(null!=this._domainMax){var d=b[0];return this._domainMax<=d&&(d=this._expandSingleValueDomain([this._domainMax,this._domainMax])[0]),void this._setDomain([d,this._domainMax])}a.prototype._autoDomainIfAutomaticMode.call(this)},b.prototype._getExtent=function(){var a=this._getAllIncludedValues(),b=this._defaultExtent();if(0!==a.length){var c=[g.Math.min(a,b[0]),g.Math.max(a,b[1])];b=this._padDomain(c)}return null!=this._domainMin&&(b[0]=this._domainMin),null!=this._domainMax&&(b[1]=this._domainMax),b},b.prototype.addPaddingExceptionsProvider=function(a){return this._paddingExceptionsProviders.add(a),this._autoDomainIfAutomaticMode(),this},b.prototype.removePaddingExceptionsProvider=function(a){return this._paddingExceptionsProviders["delete"](a),this._autoDomainIfAutomaticMode(),this},b.prototype.padProportion=function(a){if(null==a)return this._padProportion;if(a<0)throw new Error("padProportion must be non-negative");return this._padProportion=a,this._autoDomainIfAutomaticMode(),this},b.prototype._padDomain=function(a){var b=this;if(a[0].valueOf()===a[1].valueOf())return this._expandSingleValueDomain(a);if(0===this._padProportion)return a;var c=this._padProportion/2,d=a[0],e=a[1],f=!1,g=!1;this._paddingExceptionsProviders.forEach(function(a){var c=a(b);c.forEach(function(a){a.valueOf()===d.valueOf()&&(f=!0),a.valueOf()===e.valueOf()&&(g=!0)})});var h=this._backingScaleDomain();this._backingScaleDomain(a);var i=f?d:this.invert(this.scale(d)-(this.scale(e)-this.scale(d))*c),j=g?e:this.invert(this.scale(e)+(this.scale(e)-this.scale(d))*c);return this._backingScaleDomain(h),this._snappingDomainEnabled?this._niceDomain([i,j]):[i,j]},b.prototype.snappingDomainEnabled=function(a){return null==a?this._snappingDomainEnabled:(this._snappingDomainEnabled=a,this._autoDomainIfAutomaticMode(),this)},b.prototype._expandSingleValueDomain=function(a){return a},b.prototype.invert=function(a){throw new Error("Subclasses should override invert")},b.prototype.domain=function(b){return null!=b&&(this._domainMin=b[0],this._domainMax=b[1]),a.prototype.domain.call(this,b)},b.prototype.domainMin=function(a){return null==a?this.domain()[0]:(this._domainMin=a,this._autoDomainIfAutomaticMode(),this)},b.prototype.domainMax=function(a){return null==a?this.domain()[1]:(this._domainMax=a,this._autoDomainIfAutomaticMode(),this)},b.prototype.extentOfValues=function(a){var b=e.extent(a.filter(function(a){return g.Math.isValidNumber(+a)}));return null==b[0]||null==b[1]?[]:b},b.prototype.zoom=function(a,b){var c=this,d=function(d){return c.invert(f.zoomAt(d,a,b))};this.domain(this.range().map(d))},b.prototype.pan=function(a){var b=this,c=function(c){return b.invert(c+a)};this.domain(this.range().map(c))},b.prototype.scaleTransformation=function(a){throw new Error("Subclasses should override scaleTransformation")},b.prototype.invertedTransformation=function(a){throw new Error("Subclasses should override invertedTransformation")},b.prototype.getTransformationDomain=function(){throw new Error("Subclasses should override getTransformationDomain")},b.prototype._setDomain=function(b){var c=function(a){return g.Math.isNaN(a)||a===1/0||a===-(1/0)};return c(b[0])||c(b[1])?void g.Window.warn("Warning: QuantitativeScales cannot take NaN or Infinity as a domain value. Ignoring."):void a.prototype._setDomain.call(this,b)},b.prototype.defaultTicks=function(){throw new Error("Subclasses should override _getDefaultTicks")},b.prototype.ticks=function(){return this._tickGenerator(this)},b.prototype._niceDomain=function(a,b){throw new Error("Subclasses should override _niceDomain")},b.prototype._defaultExtent=function(){throw new Error("Subclasses should override _defaultExtent")},b.prototype.tickGenerator=function(a){return null==a?this._tickGenerator:(this._tickGenerator=a,this)},b._DEFAULT_NUM_TICKS=10,b}(h.Scale);b.QuantitativeScale=i},function(a,b,c){"use strict";function d(a){if(null==a.attrs){if(null==a.nodes){var b=[];return a.each(function(){b.push(this)}),e.selectAll(b)}return e.selectAll(a.nodes())}return a}var e=c(1);b.coerceExternalD3=d},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(66)),d(c(67)),d(c(68))},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(76)),d(c(77)),d(c(32)),d(c(78)),d(c(79))},function(a,b,c){"use strict";var d=function(){function a(){var a=this;this._anchorCallback=function(b){return a._anchor(b)},this._enabled=!0}return a.prototype._anchor=function(a){this._isAnchored=!0},a.prototype._unanchor=function(){this._isAnchored=!1},a.prototype.attachTo=function(a){return this._disconnect(),this._componentAttachedTo=a,this._connect(),this},a.prototype._connect=function(){this.enabled()&&null!=this._componentAttachedTo&&!this._isAnchored&&this._componentAttachedTo.onAnchor(this._anchorCallback)},a.prototype.detachFrom=function(a){return this._disconnect(),this._componentAttachedTo=null,this},a.prototype._disconnect=function(){this._isAnchored&&this._unanchor(),null!=this._componentAttachedTo&&this._componentAttachedTo.offAnchor(this._anchorCallback)},a.prototype.enabled=function(a){return null==a?this._enabled:(this._enabled=a,this._enabled?this._connect():this._disconnect(),this)},a.prototype._translateToComponentSpace=function(a){var b=this._componentAttachedTo.originToRoot();return{x:a.x-b.x,y:a.y-b.y}},a.prototype._isInsideComponent=function(a){return 0<=a.x&&0<=a.y&&a.x<=this._componentAttachedTo.width()&&a.y<=this._componentAttachedTo.height()},a}();b.Interaction=d},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(3),f=c(0),g=c(2),h=function(a){function b(){var b=this;a.call(this),this._autoAdjustXScaleDomain=!1,this._autoAdjustYScaleDomain=!1,this._deferredRendering=!1,this._cachedDomainX=[null,null],this._cachedDomainY=[null,null],this.addClass("xy-plot"),this._adjustYDomainOnChangeFromXCallback=function(a){return b._adjustYDomainOnChangeFromX()},this._adjustXDomainOnChangeFromYCallback=function(a){return b._adjustXDomainOnChangeFromY()};var c=0,d=0,e=1,f=1,g=[null,null],h=[null,null],i=0,j=500,k=function(){null!=b._renderArea&&(b._renderArea.attr("transform","translate("+c+", "+d+")scale("+e+", "+f+")"),clearTimeout(i),i=setTimeout(function(){b._cachedDomainX=g,b._cachedDomainY=h,c=0,d=0,e=1,f=1,b.render(),b._renderArea.attr("transform","translate(0, 0) scale(1, 1)")},j))},l=function(a){b._isAnchored&&(g=a.domain(),e=(a.scale(b._cachedDomainX[1])-a.scale(b._cachedDomainX[0]))/(a.scale(g[1])-a.scale(g[0]))||1,c=a.scale(b._cachedDomainX[0])-a.scale(g[0])||0,k())},m=function(a){b._isAnchored&&(h=a.domain(),f=(a.scale(b._cachedDomainY[1])-a.scale(b._cachedDomainY[0]))/(a.scale(h[1])-a.scale(h[0]))||1,d=a.scale(b._cachedDomainY[0])-a.scale(h[0])*f||0,k())};this._renderCallback=function(a){b.deferredRendering()&&b.x()&&b.x().scale===a?l(a):b.deferredRendering()&&b.y()&&b.y().scale===a?m(a):b.render()}}return d(b,a),b.prototype.deferredRendering=function(a){return null==a?this._deferredRendering:(a&&this._isAnchored&&(this.x()&&this.x().scale&&(this._cachedDomainX=this.x().scale.domain()), -this.y()&&this.y().scale&&(this._cachedDomainY=this.y().scale.domain())),this._deferredRendering=a,this)},b.prototype.x=function(a,c){if(null==a)return this._propertyBindings.get(b._X_KEY);this._bindProperty(b._X_KEY,a,c);var d=this.width();return null!=c&&null!=d&&c.range([0,d]),this._autoAdjustYScaleDomain&&this._updateYExtentsAndAutodomain(),this.render(),this},b.prototype.y=function(a,c){if(null==a)return this._propertyBindings.get(b._Y_KEY);this._bindProperty(b._Y_KEY,a,c);var d=this.height();return null!=c&&null!=d&&(c instanceof e.Category?c.range([0,d]):c.range([d,0])),this._autoAdjustXScaleDomain&&this._updateXExtentsAndAutodomain(),this.render(),this},b.prototype._filterForProperty=function(a){return"x"===a&&this._autoAdjustXScaleDomain?this._makeFilterByProperty("y"):"y"===a&&this._autoAdjustYScaleDomain?this._makeFilterByProperty("x"):null},b.prototype._makeFilterByProperty=function(a){var b=this._propertyBindings.get(a);if(null!=b){var c=b.accessor,d=b.scale;if(null!=d)return function(a,b,e){var g=d.range();return f.Math.inRange(d.scale(c(a,b,e)),g[0],g[1])}}return null},b.prototype._uninstallScaleForKey=function(c,d){a.prototype._uninstallScaleForKey.call(this,c,d);var e=d===b._X_KEY?this._adjustYDomainOnChangeFromXCallback:this._adjustXDomainOnChangeFromYCallback;c.offUpdate(e)},b.prototype._installScaleForKey=function(c,d){a.prototype._installScaleForKey.call(this,c,d);var e=d===b._X_KEY?this._adjustYDomainOnChangeFromXCallback:this._adjustXDomainOnChangeFromYCallback;c.onUpdate(e)},b.prototype.destroy=function(){return a.prototype.destroy.call(this),this.x().scale&&this.x().scale.offUpdate(this._adjustYDomainOnChangeFromXCallback),this.y().scale&&this.y().scale.offUpdate(this._adjustXDomainOnChangeFromYCallback),this},b.prototype.autorangeMode=function(a){if(null==a)return this._autoAdjustXScaleDomain?"x":this._autoAdjustYScaleDomain?"y":"none";switch(a){case"x":this._autoAdjustXScaleDomain=!0,this._autoAdjustYScaleDomain=!1,this._adjustXDomainOnChangeFromY();break;case"y":this._autoAdjustXScaleDomain=!1,this._autoAdjustYScaleDomain=!0,this._adjustYDomainOnChangeFromX();break;case"none":this._autoAdjustXScaleDomain=!1,this._autoAdjustYScaleDomain=!1;break;default:throw new Error("Invalid scale name '"+a+"', must be 'x', 'y' or 'none'")}return this},b.prototype.computeLayout=function(b,c,d){a.prototype.computeLayout.call(this,b,c,d);var f=this.x(),g=f&&f.scale;null!=g&&g.range([0,this.width()]);var h=this.y(),i=h&&h.scale;return null!=i&&(i instanceof e.Category?i.range([0,this.height()]):i.range([this.height(),0])),this},b.prototype._updateXExtentsAndAutodomain=function(){this._updateExtentsForProperty("x");var a=this.x().scale;null!=a&&a.autoDomain()},b.prototype._updateYExtentsAndAutodomain=function(){this._updateExtentsForProperty("y");var a=this.y().scale;null!=a&&a.autoDomain()},b.prototype.showAllData=function(){return this._updateXExtentsAndAutodomain(),this._updateYExtentsAndAutodomain(),this},b.prototype._adjustYDomainOnChangeFromX=function(){this._projectorsReady()&&this._autoAdjustYScaleDomain&&this._updateYExtentsAndAutodomain()},b.prototype._adjustXDomainOnChangeFromY=function(){this._projectorsReady()&&this._autoAdjustXScaleDomain&&this._updateXExtentsAndAutodomain()},b.prototype._projectorsReady=function(){var a=this.x(),b=this.y();return null!=a&&null!=a.accessor&&null!=b&&null!=b.accessor},b.prototype._pixelPoint=function(a,b,c){var d=g.Plot._scaledAccessor(this.x()),e=g.Plot._scaledAccessor(this.y());return{x:d(a,b,c),y:e(a,b,c)}},b.prototype._getDataToDraw=function(){var b=this,c=a.prototype._getDataToDraw.call(this),d=function(a,c,d){var e=g.Plot._scaledAccessor(b.x())(a,c,d),h=g.Plot._scaledAccessor(b.y())(a,c,d);return f.Math.isValidNumber(e)&&f.Math.isValidNumber(h)};return this.datasets().forEach(function(a){c.set(a,c.get(a).filter(function(b,c){return d(b,c,a)}))}),c},b._X_KEY="x",b._Y_KEY="y",b}(g.Plot);b.XYPlot=h},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(36)),d(c(22)),d(c(37)),d(c(80)),d(c(38)),d(c(81)),d(c(82)),d(c(83)),d(c(84)),d(c(85)),d(c(86)),d(c(87))},function(a,b,c){"use strict";var d=c(0),e=function(){function a(){this._autoDomainAutomatically=!0,this._domainModificationInProgress=!1,this._callbacks=new d.CallbackSet,this._includedValuesProviders=new d.Set}return a.prototype.extentOfValues=function(a){return[]},a.prototype._getAllIncludedValues=function(){var a=this,b=[];return this._includedValuesProviders.forEach(function(c){var d=c(a);b=b.concat(d)}),b},a.prototype._getExtent=function(){return[]},a.prototype.onUpdate=function(a){return this._callbacks.add(a),this},a.prototype.offUpdate=function(a){return this._callbacks["delete"](a),this},a.prototype._dispatchUpdate=function(){this._callbacks.callCallbacks(this)},a.prototype.autoDomain=function(){return this._autoDomainAutomatically=!0,this._setDomain(this._getExtent()),this},a.prototype._autoDomainIfAutomaticMode=function(){this._autoDomainAutomatically&&this.autoDomain()},a.prototype.scale=function(a){throw new Error("Subclasses should override scale")},a.prototype.domain=function(a){return null==a?this._getDomain():(this._autoDomainAutomatically=!1,this._setDomain(a),this)},a.prototype._getDomain=function(){throw new Error("Subclasses should override _getDomain")},a.prototype._setDomain=function(a){this._domainModificationInProgress||(this._domainModificationInProgress=!0,this._backingScaleDomain(a),this._dispatchUpdate(),this._domainModificationInProgress=!1)},a.prototype._backingScaleDomain=function(a){throw new Error("Subclasses should override _backingDomain")},a.prototype.range=function(a){return null==a?this._getRange():(this._setRange(a),this)},a.prototype._getRange=function(){throw new Error("Subclasses should override _getRange")},a.prototype._setRange=function(a){throw new Error("Subclasses should override _setRange")},a.prototype.addIncludedValuesProvider=function(a){return this._includedValuesProviders.add(a),this._autoDomainIfAutomaticMode(),this},a.prototype.removeIncludedValuesProvider=function(a){return this._includedValuesProviders["delete"](a),this._autoDomainIfAutomaticMode(),this},a}();b.Scale=e},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(118)),d(c(119)),d(c(120)),d(c(121))},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(4),g=c(5),h=c(8),i=c(0),j=function(a){function b(b,c){var d=this;if(a.call(this),this._endTickLength=5,this._innerTickLength=5,this._tickLabelPadding=10,this._margin=15,this._showEndTickLabels=!1,this._annotationsEnabled=!1,this._annotationTierCount=1,null==b||null==c)throw new Error("Axis requires a scale and orientation");this._scale=b,this.orientation(c),this._setDefaultAlignment(),this.addClass("axis"),this.isHorizontal()?this.addClass("x-axis"):this.addClass("y-axis"),this.formatter(h.identity()),this._rescaleCallback=function(a){return d._rescale()},this._scale.onUpdate(this._rescaleCallback),this._annotatedTicks=[],this._annotationFormatter=h.identity()}return d(b,a),b.prototype.destroy=function(){a.prototype.destroy.call(this),this._scale.offUpdate(this._rescaleCallback)},b.prototype._computeWidth=function(){return this._maxLabelTickLength()},b.prototype._computeHeight=function(){return this._maxLabelTickLength()},b.prototype.requestedSpace=function(a,c){var d=0,e=0;if(this.isHorizontal()){if(e=this._computeHeight()+this._margin,this.annotationsEnabled()){var f=this._annotationMeasurer.measure().height+2*b._ANNOTATION_LABEL_PADDING;e+=f*this.annotationTierCount()}}else if(d=this._computeWidth()+this._margin,this.annotationsEnabled()){var f=this._annotationMeasurer.measure().height+2*b._ANNOTATION_LABEL_PADDING;d+=f*this.annotationTierCount()}return{minWidth:d,minHeight:e}},b.prototype.fixedHeight=function(){return this.isHorizontal()},b.prototype.fixedWidth=function(){return!this.isHorizontal()},b.prototype._rescale=function(){this.render()},b.prototype.computeLayout=function(b,c,d){return a.prototype.computeLayout.call(this,b,c,d),this.isHorizontal()?this._scale.range([0,this.width()]):this._scale.range([this.height(),0]),this},b.prototype._setup=function(){a.prototype._setup.call(this),this._tickMarkContainer=this.content().append("g").classed(b.TICK_MARK_CLASS+"-container",!0),this._tickLabelContainer=this.content().append("g").classed(b.TICK_LABEL_CLASS+"-container",!0),this._baseline=this.content().append("line").classed("baseline",!0),this._annotationContainer=this.content().append("g").classed("annotation-container",!0),this._annotationContainer.append("g").classed("annotation-line-container",!0),this._annotationContainer.append("g").classed("annotation-circle-container",!0),this._annotationContainer.append("g").classed("annotation-rect-container",!0);var c=this._annotationContainer.append("g").classed("annotation-label-container",!0),d=new f.SvgContext(c.node());this._annotationMeasurer=new f.CacheMeasurer(d),this._annotationWriter=new f.Writer(this._annotationMeasurer,d)},b.prototype._getTickValues=function(){return[]},b.prototype.renderImmediately=function(){var a=this._getTickValues(),c=this._tickMarkContainer.selectAll("."+b.TICK_MARK_CLASS).data(a),d=c.enter().append("line").classed(b.TICK_MARK_CLASS,!0).merge(c);return d.attrs(this._generateTickMarkAttrHash()),e.select(d.nodes()[0]).classed(b.END_TICK_MARK_CLASS,!0).attrs(this._generateTickMarkAttrHash(!0)),e.select(d.nodes()[a.length-1]).classed(b.END_TICK_MARK_CLASS,!0).attrs(this._generateTickMarkAttrHash(!0)),c.exit().remove(),this._baseline.attrs(this._generateBaselineAttrHash()),this.annotationsEnabled()?this._drawAnnotations():this._removeAnnotations(),this},b.prototype.annotatedTicks=function(a){return null==a?this._annotatedTicks:(this._annotatedTicks=a,this.render(),this)},b.prototype.annotationFormatter=function(a){return null==a?this._annotationFormatter:(this._annotationFormatter=a,this.render(),this)},b.prototype.annotationsEnabled=function(a){return null==a?this._annotationsEnabled:(this._annotationsEnabled=a,this.redraw(),this)},b.prototype.annotationTierCount=function(a){if(null==a)return this._annotationTierCount;if(a<0)throw new Error("annotationTierCount cannot be negative");return this._annotationTierCount=a,this.redraw(),this},b.prototype._drawAnnotations=function(){var a=this,c=b._ANNOTATION_LABEL_PADDING,d=new i.Map,f=this._annotatedTicksToRender();f.forEach(function(b){var e=a._annotationMeasurer.measure(a.annotationFormatter()(b)),f={width:e.width+2*c,height:e.height+2*c};d.set(b,f)});var g=this._annotationMeasurer.measure().height+2*c,h=this._annotationToTier(d),j=new i.Set,k=this.isHorizontal()?this.height():this.width(),l=this._coreSize(),m=Math.min(this.annotationTierCount(),Math.floor((k-l)/g));h.forEach(function(a,b){(a===-1||a>=m)&&j.add(b)});var n,o=function(a,b,c){var d=a.selectAll("."+c).data(f),e=d.enter().append(b).classed(c,!0).merge(d);return d.exit().remove(),e},p=function(b){switch(a.orientation()){case"bottom":case"right":return h.get(b)*g+l;case"top":case"left":return k-l-h.get(b)*g}},q=function(b){return a._scale.scale(b)},r=function(a){return j.has(a)?"hidden":"visible"};switch(this.orientation()){case"bottom":case"right":n=0;break;case"top":n=this.height();break;case"left":n=this.width()}var s=this.isHorizontal();o(this._annotationContainer.select(".annotation-line-container"),"line",b.ANNOTATION_LINE_CLASS).attrs({x1:s?q:n,x2:s?q:p,y1:s?n:q,y2:s?p:q,visibility:r}),o(this._annotationContainer.select(".annotation-circle-container"),"circle",b.ANNOTATION_CIRCLE_CLASS).attrs({cx:s?q:n,cy:s?n:q,r:3});var t=function(b){switch(a.orientation()){case"bottom":case"right":return p(b);case"top":case"left":return p(b)-d.get(b).height}};o(this._annotationContainer.select(".annotation-rect-container"),"rect",b.ANNOTATION_RECT_CLASS).attrs({x:s?q:t,y:s?t:q,width:s?function(a){return d.get(a).width}:function(a){return d.get(a).height},height:s?function(a){return d.get(a).height}:function(a){return d.get(a).width},visibility:r});var u=this._annotationWriter,v=this.annotationFormatter(),w=o(this._annotationContainer.select(".annotation-label-container"),"g",b.ANNOTATION_LABEL_CLASS);w.selectAll(".text-container").remove(),w.attrs({transform:function(a){var b=s?q(a):t(a),c=s?t(a):q(a);return"translate("+b+","+c+")"},visibility:r}).each(function(a){u.write(v(a),s?d.get(a).width:d.get(a).height,s?d.get(a).height:d.get(a).width,{xAlign:"center",yAlign:"center",textRotation:s?0:90},e.select(this).node())})},b.prototype._annotatedTicksToRender=function(){var a=this,b=this._scale.range();return i.Array.uniq(this.annotatedTicks().filter(function(c){return null!=c&&i.Math.inRange(a._scale.scale(c),b[0],b[1])}))},b.prototype._coreSize=function(){var a=this.isHorizontal()?this.height():this.width(),b=this.isHorizontal()?this._computeHeight():this._computeWidth();return Math.min(b,a)},b.prototype._annotationTierHeight=function(){return this._annotationMeasurer.measure().height+2*b._ANNOTATION_LABEL_PADDING},b.prototype._annotationToTier=function(a){var b=this,c=[[]],d=new i.Map,e=this.isHorizontal()?this.width():this.height();return this._annotatedTicksToRender().forEach(function(f){var g=b._scale.scale(f),h=a.get(f).width;if(g<0||g+h>e)return void d.set(f,-1);for(var i=function(d){return c[d].some(function(c){var d=b._scale.scale(c),e=a.get(c).width;return g+h>=d&&g<=d+e})},j=0;i(j);)j++,c.length===j&&c.push([]);c[j].push(f),d.set(f,j)}),d},b.prototype._removeAnnotations=function(){this._annotationContainer.selectAll(".annotation-line").remove(),this._annotationContainer.selectAll(".annotation-circle").remove(),this._annotationContainer.selectAll(".annotation-rect").remove(),this._annotationContainer.selectAll(".annotation-label").remove()},b.prototype._generateBaselineAttrHash=function(){var a={x1:0,y1:0,x2:0,y2:0};switch(this._orientation){case"bottom":a.x2=this.width();break;case"top":a.x2=this.width(),a.y1=this.height(),a.y2=this.height();break;case"left":a.x1=this.width(),a.x2=this.width(),a.y2=this.height();break;case"right":a.y2=this.height()}return a},b.prototype._generateTickMarkAttrHash=function(a){var b=this;void 0===a&&(a=!1);var c={x1:0,y1:0,x2:0,y2:0},d=function(a){return b._scale.scale(a)};this.isHorizontal()?(c.x1=d,c.x2=d):(c.y1=d,c.y2=d);var e=a?this._endTickLength:this._innerTickLength;switch(this._orientation){case"bottom":c.y2=e;break;case"top":c.y1=this.height(),c.y2=this.height()-e;break;case"left":c.x1=this.width(),c.x2=this.width()-e;break;case"right":c.x2=e}return c},b.prototype._setDefaultAlignment=function(){switch(this._orientation){case"bottom":this.yAlignment("top");break;case"top":this.yAlignment("bottom");break;case"left":this.xAlignment("right");break;case"right":this.xAlignment("left")}},b.prototype.isHorizontal=function(){return"top"===this._orientation||"bottom"===this._orientation},b.prototype.getScale=function(){return this._scale},b.prototype.formatter=function(a){return null==a?this._formatter:(this._formatter=a,this.redraw(),this)},b.prototype.innerTickLength=function(a){if(null==a)return this._innerTickLength;if(a<0)throw new Error("inner tick length must be positive");return this._innerTickLength=a,this.redraw(),this},b.prototype.endTickLength=function(a){if(null==a)return this._endTickLength;if(a<0)throw new Error("end tick length must be positive");return this._endTickLength=a,this.redraw(),this},b.prototype._maxLabelTickLength=function(){return this.showEndTickLabels()?Math.max(this.innerTickLength(),this.endTickLength()):this.innerTickLength()},b.prototype.tickLabelPadding=function(a){if(null==a)return this._tickLabelPadding;if(a<0)throw new Error("tick label padding must be positive");return this._tickLabelPadding=a,this.redraw(),this},b.prototype.margin=function(a){if(null==a)return this._margin;if(a<0)throw new Error("margin size must be positive");return this._margin=a,this.redraw(),this},b.prototype.orientation=function(a){if(null==a)return this._orientation;var b=a.toLowerCase();if("top"!==b&&"bottom"!==b&&"left"!==b&&"right"!==b)throw new Error("unsupported orientation");return this._orientation=b,this.redraw(),this},b.prototype.showEndTickLabels=function(a){return null==a?this._showEndTickLabels:(this._showEndTickLabels=a,this.render(),this)},b.prototype._showAllTickMarks=function(){this._tickMarkContainer.selectAll("."+b.TICK_MARK_CLASS).each(function(){e.select(this).style("visibility","inherit")})},b.prototype._showAllTickLabels=function(){this._tickLabelContainer.selectAll("."+b.TICK_LABEL_CLASS).each(function(){e.select(this).style("visibility","inherit")})},b.prototype._hideOverflowingTickLabels=function(){var a=this._boundingBox.node().getBoundingClientRect(),c=this._tickLabelContainer.selectAll("."+b.TICK_LABEL_CLASS);c.empty()||c.each(function(b,c){i.DOM.clientRectInside(this.getBoundingClientRect(),a)||e.select(this).style("visibility","hidden")})},b.prototype._hideTickMarksWithoutLabel=function(){var a=this._tickMarkContainer.selectAll("."+b.TICK_MARK_CLASS),c=this._tickLabelContainer.selectAll("."+b.TICK_LABEL_CLASS).filter(function(a,b){var c=e.select(this).style("visibility");return"inherit"===c||"visible"===c}),d=c.data();a.each(function(a,b){d.indexOf(a)===-1&&e.select(this).style("visibility","hidden")})},b.prototype.invalidateCache=function(){a.prototype.invalidateCache.call(this),this._annotationMeasurer.reset()},b.END_TICK_MARK_CLASS="end-tick-mark",b.TICK_MARK_CLASS="tick-mark",b.TICK_LABEL_CLASS="tick-label",b.ANNOTATION_LINE_CLASS="annotation-line",b.ANNOTATION_RECT_CLASS="annotation-rect",b.ANNOTATION_CIRCLE_CLASS="annotation-circle",b.ANNOTATION_LABEL_CLASS="annotation-label",b._ANNOTATION_LABEL_PADDING=4,b}(g.Component);b.Axis=j},function(a,b,c){"use strict";b.SHOW_WARNINGS=!0,b.ADD_TITLE_ELEMENTS=!0},function(a,b,c){"use strict";var d=c(0),e=function(){function a(){this._eventToProcessingFunction={},this._eventNameToCallbackSet={},this._connected=!1}return a.prototype._hasNoCallbacks=function(){for(var a=Object.keys(this._eventNameToCallbackSet),b=0;b=q-h&&g<=r+h)m=0;else{var s=c._isVertical?n.y:n.x;m=Math.abs(g-s)}}(kd.height()?B=d.height()-A:A<0&&(B=A+r);var C=b._LABEL_PADDING;j=t.height+2*C<=B,j?od.width()?E=d.width()-D:D<0&&(E=D+q);var C=b._LABEL_PADDING;j=t.width+2*C<=E,j?od.width()||z.y+t.height>d.height();F.style("visibility",I?"hidden":"inherit");var J={xAlign:u,yAlign:v};i.write(s,x,y,J,F.node());var K=d._isVertical?qf?f:d},b},b.prototype._getBarPixelWidth=function(){if(!this._projectorsReady())return 0;var a,c=this._isVertical?this.x().scale:this.y().scale;if(c instanceof j.Category)a=c.rangeBand();else{var d=this._isVertical?this.x().accessor:this.y().accessor,f=e.set(l.Array.flatten(this.datasets().map(function(a){return a.data().map(function(b,c){return d(b,c,a)}).filter(function(a){return null!=a}).map(function(a){return a.valueOf()})}))).values().map(function(a){return+a});f.sort(function(a,b){return a-b});var g=f.map(function(a){return c.scale(a)}),h=e.pairs(g),i=this._isVertical?this.width():this.height();a=l.Math.min(h,function(a,b){return Math.abs(a[1]-a[0])},i*b._SINGLE_BAR_DIMENSION_RATIO),a*=b._BAR_WIDTH_RATIO}return a},b.prototype._updateBarPixelWidth=function(){this._barPixelWidth=this._getBarPixelWidth()},b.prototype.entities=function(b){if(void 0===b&&(b=this.datasets()),!this._projectorsReady())return[];var c=a.prototype.entities.call(this,b);return c},b.prototype._pixelPoint=function(a,b,c){var d,e,f=this._generateAttrToProjector(),g=f.x(a,b,c),h=f.y(a,b,c),i=f.width(a,b,c),j=f.height(a,b,c),k=(this._isVertical?n.Plot._scaledAccessor(this.y()):n.Plot._scaledAccessor(this.x()))(a,b,c),l=(this._isVertical?this.y().scale:this.x().scale).scale(this.baselineValue());return this._isVertical?(d=g+i/2,e=k<=l?h:h+j):(d=k>=l?g+i:g,e=h+j/2),{x:d,y:e}},b.prototype._uninstallScaleForKey=function(b,c){b.offUpdate(this._updateBarPixelWidthCallback),a.prototype._uninstallScaleForKey.call(this,b,c)},b.prototype._getDataToDraw=function(){var a=new l.Map,b=this._generateAttrToProjector();return this.datasets().forEach(function(c){var d=c.data().filter(function(a,d){return l.Math.isValidNumber(b.x(a,d,c))&&l.Math.isValidNumber(b.y(a,d,c))&&l.Math.isValidNumber(b.width(a,d,c))&&l.Math.isValidNumber(b.height(a,d,c))});a.set(c,d)}),a},b.ORIENTATION_VERTICAL="vertical",b.ORIENTATION_HORIZONTAL="horizontal",b._BAR_WIDTH_RATIO=.95,b._SINGLE_BAR_DIMENSION_RATIO=.4,b._BAR_AREA_CLASS="bar-area",b._LABEL_AREA_CLASS="bar-label-text-area",b._LABEL_PADDING=10,b}(o.XYPlot);b.Bar=p},function(a,b,c){"use strict";var d,e=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},f=c(1),g=c(4),h=c(8),i=c(3),j=c(0),k=c(19);!function(a){a.second="second",a.minute="minute",a.hour="hour",a.day="day",a.week="week",a.month="month",a.year="year"}(d=b.TimeInterval||(b.TimeInterval={}));var l=function(a){function b(c,d){a.call(this,c,d),this._maxTimeIntervalPrecision=null,this._tierLabelPositions=[],this.addClass("time-axis"),this.tickLabelPadding(5),this.axisConfigurations(b._DEFAULT_TIME_AXIS_CONFIGURATIONS),this.annotationFormatter(h.time("%a %b %d, %Y"))}return e(b,a),b.prototype.tierLabelPositions=function(a){if(null==a)return this._tierLabelPositions;if(!a.every(function(a){return"between"===a.toLowerCase()||"center"===a.toLowerCase()}))throw new Error("Unsupported position for tier labels");return this._tierLabelPositions=a,this.redraw(),this},b.prototype.maxTimeIntervalPrecision=function(a){return null==a?this._maxTimeIntervalPrecision:(this._maxTimeIntervalPrecision=a, -this.redraw(),this)},b.prototype.currentAxisConfiguration=function(){return this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex]},b.prototype.axisConfigurations=function(a){if(null==a)return this._possibleTimeAxisConfigurations;this._possibleTimeAxisConfigurations=a,this._numTiers=j.Math.max(this._possibleTimeAxisConfigurations.map(function(a){return a.length}),0),this._isAnchored&&this._setupDomElements();for(var b=this.tierLabelPositions(),c=[],d=0;dthis._scale.domain()[1])return this.width();var e=Math.abs(this._scale.scale(d)-this._scale.scale(b));return e},b.prototype._maxWidthForInterval=function(a){return this._measurer.measure(a.formatter(b._LONG_DATE)).width},b.prototype._checkTimeAxisTierConfiguration=function(a){if(null!=this._maxTimeIntervalPrecision){var c=b._SORTED_TIME_INTERVAL_INDEX[this._maxTimeIntervalPrecision],d=b._SORTED_TIME_INTERVAL_INDEX[a.interval];if(null!=c&&null!=d&&d=e},b.prototype._sizeFromOffer=function(b,c){var d=a.prototype._sizeFromOffer.call(this,b,c),e=this._tierHeights.reduce(function(a,b,c,e){return a+b>d.height?a:a+b}),f=this.margin()+(this.annotationsEnabled()?this.annotationTierCount()*this._annotationTierHeight():0);return d.height=Math.min(d.height,e+f),d},b.prototype._setup=function(){a.prototype._setup.call(this),this._setupDomElements()},b.prototype._setupDomElements=function(){this.content().selectAll("."+b.TIME_AXIS_TIER_CLASS).remove(),this._tierLabelContainers=[],this._tierMarkContainers=[],this._tierBaselines=[],this._tickLabelContainer.remove(),this._baseline.remove();for(var a=0;a=e.length||g.push(new Date((e[b+1].valueOf()-e[b].valueOf())/2+e[b].valueOf()))}):g=e;var h=a.selectAll("."+k.Axis.TICK_LABEL_CLASS).data(g,function(a){return String(a.valueOf())}),i=h.enter().append("g").classed(k.Axis.TICK_LABEL_CLASS,!0);i.append("text");var j,l="center"===this._tierLabelPositions[c]||1===b.step?0:this.tickLabelPadding();j="bottom"===this.orientation()?f.sum(this._tierHeights.slice(0,c+1))-this.tickLabelPadding():"center"===this._tierLabelPositions[c]?this.height()-f.sum(this._tierHeights.slice(0,c))-this.tickLabelPadding()-this._maxLabelTickLength():this.height()-f.sum(this._tierHeights.slice(0,c))-this.tickLabelPadding();var m=h.merge(i),n=m.selectAll("text");n.size()>0&&n.attr("transform","translate("+l+","+j+")"),h.exit().remove(),m.attr("transform",function(a){return"translate("+d._scale.scale(a)+",0)"});var o="center"===this._tierLabelPositions[c]||1===b.step?"middle":"start";m.selectAll("text").text(b.formatter).style("text-anchor",o)},b.prototype._renderTickMarks=function(a,b){var c=this._tierMarkContainers[b].selectAll("."+k.Axis.TICK_MARK_CLASS).data(a),d=c.enter().append("line").classed(k.Axis.TICK_MARK_CLASS,!0).merge(c),e=this._generateTickMarkAttrHash(),g=this._tierHeights.slice(0,b).reduce(function(a,b){return a+b},0);"bottom"===this.orientation()?(e.y1=g,e.y2=g+("center"===this._tierLabelPositions[b]?this.innerTickLength():this._tierHeights[b])):(e.y1=this.height()-g,e.y2=this.height()-(g+("center"===this._tierLabelPositions[b]?this.innerTickLength():this._tierHeights[b]))),d.attrs(e),"bottom"===this.orientation()?(e.y1=g,e.y2=g+("center"===this._tierLabelPositions[b]?this.endTickLength():this._tierHeights[b])):(e.y1=this.height()-g,e.y2=this.height()-(g+("center"===this._tierLabelPositions[b]?this.endTickLength():this._tierHeights[b]))),f.select(d.nodes()[0]).attrs(e),f.select(d.nodes()[d.size()-1]).attrs(e),f.select(d.nodes()[0]).classed(k.Axis.END_TICK_MARK_CLASS,!0),f.select(d.nodes()[d.size()-1]).classed(k.Axis.END_TICK_MARK_CLASS,!0),c.exit().remove()},b.prototype._renderLabellessTickMarks=function(a){var b=this._tickMarkContainer.selectAll("."+k.Axis.TICK_MARK_CLASS).data(a),c=b.enter().append("line").classed(k.Axis.TICK_MARK_CLASS,!0).merge(b),d=this._generateTickMarkAttrHash();d.y2="bottom"===this.orientation()?this.tickLabelPadding():this.height()-this.tickLabelPadding(),c.attrs(d),b.exit().remove()},b.prototype._generateLabellessTicks=function(){return this._mostPreciseConfigIndex<1?[]:this._getTickIntervalValues(this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex-1][0])},b.prototype.renderImmediately=function(){var a=this;this._mostPreciseConfigIndex=this._getMostPreciseConfigurationIndex();var b=this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex];this._cleanTiers(),b.forEach(function(b,c){return a._renderTierLabels(a._tierLabelContainers[c],b,c)});for(var c=b.map(function(b,c){return a._getTickValuesForConfiguration(b)}),d=0,e=0;e=i&&(g=this._generateLabellessTicks()),this._renderLabellessTickMarks(g),this._hideOverflowingTiers();for(var e=0;e=a.x&&b.topLeft.y<=a.y&&b.bottomRight.y>=a.y}var n=c(1),o=window.Math;b.inRange=d,b.clamp=e,b.max=f,b.min=g,b.isNaN=h,b.isValidNumber=i,b.range=j,b.distanceSquared=k,b.degreesToRadians=l,b.within=m},function(a,b,c){"use strict";var d=function(){function a(a){null!=a.createRuler?this.ruler=a.createRuler():this.ruler=a}return a.prototype.measure=function(b){return void 0===b&&(b=a.HEIGHT_TEXT),this.ruler(b)},a}();d.HEIGHT_TEXT="bdpql",b.AbstractMeasurer=d},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(27)),d(c(57)),d(c(58)),d(c(33)),d(c(34)),d(c(59)),d(c(60)),d(c(61)),d(c(62)),d(c(35)),d(c(63)),d(c(64)),d(c(65));var e=function(){function a(){}return a.TOP="top",a.BOTTOM="bottom",a.LEFT="left",a.RIGHT="right",a.CENTER="center",a}();b.Alignment=e},function(a,b,c){"use strict";var d=c(0),e=c(25),f=function(){function a(){}return a.prototype.render=function(){e.flush()},a}();b.Immediate=f;var g=function(){function a(){}return a.prototype.render=function(){d.DOM.requestAnimationFramePolyfill(e.flush)},a}();b.AnimationFrame=g;var h=function(){function a(){this._timeoutMsec=d.DOM.SCREEN_REFRESH_RATE_MILLISECONDS}return a.prototype.render=function(){setTimeout(e.flush,this._timeoutMsec)},a}();b.Timeout=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(12),f=c(0),g=c(14),h=function(a){function b(){var b=this;a.apply(this,arguments),this._keyPressCallbacks={},this._keyReleaseCallbacks={},this._mouseMoveCallback=function(a){return!1},this._downedKeys=new f.Set,this._keyDownCallback=function(a,c){return b._handleKeyDownEvent(a,c)},this._keyUpCallback=function(a){return b._handleKeyUpEvent(a)}}return d(b,a),b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this._positionDispatcher=e.Mouse.getDispatcher(this._componentAttachedTo),this._positionDispatcher.onMouseMove(this._mouseMoveCallback),this._keyDispatcher=e.Key.getDispatcher(),this._keyDispatcher.onKeyDown(this._keyDownCallback),this._keyDispatcher.onKeyUp(this._keyUpCallback)},b.prototype._unanchor=function(){a.prototype._unanchor.call(this),this._positionDispatcher.offMouseMove(this._mouseMoveCallback),this._positionDispatcher=null,this._keyDispatcher.offKeyDown(this._keyDownCallback),this._keyDispatcher.offKeyUp(this._keyUpCallback),this._keyDispatcher=null},b.prototype._handleKeyDownEvent=function(a,b){var c=this._translateToComponentSpace(this._positionDispatcher.lastMousePosition());this._isInsideComponent(c)&&!b.repeat&&(this._keyPressCallbacks[a]&&this._keyPressCallbacks[a].callCallbacks(a),this._downedKeys.add(a))},b.prototype._handleKeyUpEvent=function(a){this._downedKeys.has(a)&&this._keyReleaseCallbacks[a]&&this._keyReleaseCallbacks[a].callCallbacks(a),this._downedKeys["delete"](a)},b.prototype.onKeyPress=function(a,b){return this._keyPressCallbacks[a]||(this._keyPressCallbacks[a]=new f.CallbackSet),this._keyPressCallbacks[a].add(b),this},b.prototype.offKeyPress=function(a,b){return this._keyPressCallbacks[a]["delete"](b),0===this._keyPressCallbacks[a].size&&delete this._keyPressCallbacks[a],this},b.prototype.onKeyRelease=function(a,b){return this._keyReleaseCallbacks[a]||(this._keyReleaseCallbacks[a]=new f.CallbackSet),this._keyReleaseCallbacks[a].add(b),this},b.prototype.offKeyRelease=function(a,b){return this._keyReleaseCallbacks[a]["delete"](b),0===this._keyReleaseCallbacks[a].size&&delete this._keyReleaseCallbacks[a],this},b}(g.Interaction);b.Key=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(0),f=c(24),g=function(a){function b(b){var c=this;void 0===b&&(b=[]),a.call(this),this._components=[],this.addClass("component-group"),b.forEach(function(a){return c.append(a)})}return d(b,a),b.prototype._forEach=function(a){this.components().forEach(a)},b.prototype.has=function(a){return this._components.indexOf(a)>=0},b.prototype.requestedSpace=function(a,b){var c=this._components.map(function(c){return c.requestedSpace(a,b)});return{minWidth:e.Math.max(c,function(a){return a.minWidth},0),minHeight:e.Math.max(c,function(a){return a.minHeight},0)}},b.prototype.computeLayout=function(b,c,d){var e=this;return a.prototype.computeLayout.call(this,b,c,d),this._forEach(function(a){a.computeLayout({x:0,y:0},e.width(),e.height())}),this},b.prototype._sizeFromOffer=function(a,b){return{width:a,height:b}},b.prototype.fixedWidth=function(){return this._components.every(function(a){return a.fixedWidth()})},b.prototype.fixedHeight=function(){return this._components.every(function(a){return a.fixedHeight()})},b.prototype.components=function(){return this._components.slice()},b.prototype.append=function(a){return null==a||this.has(a)||(a.detach(),this._components.push(a),this._adoptAndAnchor(a),this.redraw()),this},b.prototype._remove=function(a){var b=this._components.indexOf(a);return b>=0&&(this._components.splice(b,1),!0)},b}(f.ComponentContainer);b.Group=g},function(a,b,c){"use strict";var d,e=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},f=c(0),g=c(5);!function(a){a[a.VALUE=0]="VALUE",a[a.PIXEL=1]="PIXEL"}(d||(d={}));var h=function(a){function b(c){var e=this;if(a.call(this),this._mode=d.VALUE,c!==b.ORIENTATION_VERTICAL&&c!==b.ORIENTATION_HORIZONTAL)throw new Error(c+" is not a valid orientation for GuideLineLayer");this._orientation=c,this._overflowHidden=!0,this.addClass("guide-line-layer"),this._isVertical()?this.addClass("vertical"):this.addClass("horizontal"),this._scaleUpdateCallback=function(){e._syncPixelPositionAndValue(),e.render()}}return e(b,a),b.prototype._setup=function(){a.prototype._setup.call(this),this._guideLine=this.content().append("line").classed("guide-line",!0)},b.prototype._sizeFromOffer=function(a,b){return{width:a,height:b}},b.prototype._isVertical=function(){return this._orientation===b.ORIENTATION_VERTICAL},b.prototype.fixedWidth=function(){return!0},b.prototype.fixedHeight=function(){return!0},b.prototype.computeLayout=function(b,c,d){return a.prototype.computeLayout.call(this,b,c,d),null!=this.scale()&&(this._isVertical()?this.scale().range([0,this.width()]):this.scale().range([this.height(),0])),this},b.prototype.renderImmediately=function(){return a.prototype.renderImmediately.call(this),this._syncPixelPositionAndValue(),this._guideLine.attrs({x1:this._isVertical()?this.pixelPosition():0,y1:this._isVertical()?0:this.pixelPosition(),x2:this._isVertical()?this.pixelPosition():this.width(),y2:this._isVertical()?this.height():this.pixelPosition()}),this},b.prototype._syncPixelPositionAndValue=function(){null!=this.scale()&&(this._mode===d.VALUE&&null!=this.value()?this._pixelPosition=this.scale().scale(this.value()):this._mode===d.PIXEL&&null!=this.pixelPosition()&&(this._value=this.scale().invert(this.pixelPosition())))},b.prototype._setPixelPositionWithoutChangingMode=function(a){this._pixelPosition=a,null!=this.scale()&&(this._value=this.scale().invert(this.pixelPosition())),this.render()},b.prototype.scale=function(a){if(null==a)return this._scale;var b=this._scale;return null!=b&&b.offUpdate(this._scaleUpdateCallback),this._scale=a,this._scale.onUpdate(this._scaleUpdateCallback),this._syncPixelPositionAndValue(),this.redraw(),this},b.prototype.value=function(a){return null==a?this._value:(this._value=a,this._mode=d.VALUE,this._syncPixelPositionAndValue(),this.render(),this)},b.prototype.pixelPosition=function(a){if(null==a)return this._pixelPosition;if(!f.Math.isValidNumber(a))throw new Error("pixelPosition must be a finite number");return this._pixelPosition=a,this._mode=d.PIXEL,this._syncPixelPositionAndValue(),this.render(),this},b.prototype.destroy=function(){a.prototype.destroy.call(this),null!=this.scale()&&this.scale().offUpdate(this._scaleUpdateCallback)},b.ORIENTATION_VERTICAL="vertical",b.ORIENTATION_HORIZONTAL="horizontal",b}(g.Component);b.GuideLineLayer=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(0),f=c(5);!function(a){a[a.VALUE=0]="VALUE",a[a.PIXEL=1]="PIXEL"}(b.PropertyMode||(b.PropertyMode={}));var g=b.PropertyMode,h=function(a){function b(){var b=this;a.call(this),this._boxVisible=!1,this._boxBounds={topLeft:{x:0,y:0},bottomRight:{x:0,y:0}},this._xBoundsMode=g.PIXEL,this._yBoundsMode=g.PIXEL,this.addClass("selection-box-layer"),this._adjustBoundsCallback=function(){b.render()},this._overflowHidden=!0,this._xExtent=[void 0,void 0],this._yExtent=[void 0,void 0]}return d(b,a),b.prototype._setup=function(){a.prototype._setup.call(this),this._box=this.content().append("g").classed("selection-box",!0).remove(),this._boxArea=this._box.append("rect").classed("selection-area",!0); -},b.prototype._sizeFromOffer=function(a,b){return{width:a,height:b}},b.prototype.bounds=function(a){return null==a?this._getBounds():(this._setBounds(a),this._xBoundsMode=g.PIXEL,this._yBoundsMode=g.PIXEL,this.render(),this)},b.prototype._setBounds=function(a){var b={x:Math.min(a.topLeft.x,a.bottomRight.x),y:Math.min(a.topLeft.y,a.bottomRight.y)},c={x:Math.max(a.topLeft.x,a.bottomRight.x),y:Math.max(a.topLeft.y,a.bottomRight.y)};this._boxBounds={topLeft:b,bottomRight:c}},b.prototype._getBounds=function(){return{topLeft:{x:this._xBoundsMode===g.PIXEL?this._boxBounds.topLeft.x:null==this._xScale?0:Math.min(this.xScale().scale(this.xExtent()[0]),this.xScale().scale(this.xExtent()[1])),y:this._yBoundsMode===g.PIXEL?this._boxBounds.topLeft.y:null==this._yScale?0:Math.min(this.yScale().scale(this.yExtent()[0]),this.yScale().scale(this.yExtent()[1]))},bottomRight:{x:this._xBoundsMode===g.PIXEL?this._boxBounds.bottomRight.x:null==this._xScale?0:Math.max(this.xScale().scale(this.xExtent()[0]),this.xScale().scale(this.xExtent()[1])),y:this._yBoundsMode===g.PIXEL?this._boxBounds.bottomRight.y:null==this._yScale?0:Math.max(this.yScale().scale(this.yExtent()[0]),this.yScale().scale(this.yExtent()[1]))}}},b.prototype.renderImmediately=function(){if(a.prototype.renderImmediately.call(this),this._boxVisible){var b=this.bounds(),c=b.topLeft.y,d=b.bottomRight.y,f=b.topLeft.x,g=b.bottomRight.x;if(!(e.Math.isValidNumber(c)&&e.Math.isValidNumber(d)&&e.Math.isValidNumber(f)&&e.Math.isValidNumber(g)))throw new Error("bounds have not been properly set");this._boxArea.attrs({x:f,y:c,width:g-f,height:d-c}),this.content().node().appendChild(this._box.node())}else this._box.remove();return this},b.prototype.boxVisible=function(a){return null==a?this._boxVisible:(this._boxVisible=a,this.render(),this)},b.prototype.fixedWidth=function(){return!0},b.prototype.fixedHeight=function(){return!0},b.prototype.xScale=function(a){return null==a?this._xScale:(null!=this._xScale&&this._xScale.offUpdate(this._adjustBoundsCallback),this._xScale=a,this._xBoundsMode=g.VALUE,this._xScale.onUpdate(this._adjustBoundsCallback),this.render(),this)},b.prototype.yScale=function(a){return null==a?this._yScale:(null!=this._yScale&&this._yScale.offUpdate(this._adjustBoundsCallback),this._yScale=a,this._yBoundsMode=g.VALUE,this._yScale.onUpdate(this._adjustBoundsCallback),this.render(),this)},b.prototype.xExtent=function(a){return null==a?this._getXExtent():(this._setXExtent(a),this._xBoundsMode=g.VALUE,this.render(),this)},b.prototype._getXExtent=function(){return this._xBoundsMode===g.VALUE?this._xExtent:null==this._xScale?[void 0,void 0]:[this._xScale.invert(this._boxBounds.topLeft.x),this._xScale.invert(this._boxBounds.bottomRight.x)]},b.prototype._setXExtent=function(a){this._xExtent=a},b.prototype.yExtent=function(a){return null==a?this._getYExtent():(this._setYExtent(a),this._yBoundsMode=g.VALUE,this.render(),this)},b.prototype._getYExtent=function(){return this._yBoundsMode===g.VALUE?this._yExtent:null==this._yScale?[void 0,void 0]:[this._yScale.invert(this._boxBounds.topLeft.y),this._yScale.invert(this._boxBounds.bottomRight.y)]},b.prototype._setYExtent=function(a){this._yExtent=a},b.prototype.destroy=function(){a.prototype.destroy.call(this),null!=this._xScale&&this.xScale().offUpdate(this._adjustBoundsCallback),null!=this._yScale&&this.yScale().offUpdate(this._adjustBoundsCallback)},b}(f.Component);b.SelectionBoxLayer=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(9),g=c(3),h=c(0),i=c(16),j=c(38),k=c(2),l=function(a){function b(){a.call(this),this.addClass("area-plot"),this.y0(0),this.attr("fill-opacity",.25),this.attr("fill",(new g.Color).range()[0]),this._lineDrawers=new h.Map}return d(b,a),b.prototype._setup=function(){var b=this;a.prototype._setup.call(this),this._lineDrawers.forEach(function(a){return a.renderArea(b._renderArea.append("g"))})},b.prototype.y=function(c,d){if(null==c)return a.prototype.y.call(this);if(null==d?a.prototype.y.call(this,c):a.prototype.y.call(this,c,d),null!=d){var e=this.y0().accessor;null!=e&&this._bindProperty(b._Y0_KEY,e,d),this._updateYScale()}return this},b.prototype.y0=function(a){if(null==a)return this._propertyBindings.get(b._Y0_KEY);var c=this.y(),d=c&&c.scale;return this._bindProperty(b._Y0_KEY,a,d),this._updateYScale(),this.render(),this},b.prototype._onDatasetUpdate=function(){a.prototype._onDatasetUpdate.call(this),this._updateYScale()},b.prototype.addDataset=function(b){return a.prototype.addDataset.call(this,b),this},b.prototype._addDataset=function(b){var c=new f.Line(b);return this._isSetup&&c.renderArea(this._renderArea.append("g")),this._lineDrawers.set(b,c),a.prototype._addDataset.call(this,b),this},b.prototype._removeDatasetNodes=function(b){a.prototype._removeDatasetNodes.call(this,b),this._lineDrawers.get(b).remove()},b.prototype._additionalPaint=function(){var a=this,b=this._generateLineDrawSteps(),c=this._getDataToDraw();this.datasets().forEach(function(d){return a._lineDrawers.get(d).draw(c.get(d),b)})},b.prototype._generateLineDrawSteps=function(){var a=[];if(this._animateOnNextRender()){var b=this._generateLineAttrToProjector();b.d=this._constructLineProjector(k.Plot._scaledAccessor(this.x()),this._getResetYFunction()),a.push({attrToProjector:b,animator:this._getAnimator(i.Animator.RESET)})}return a.push({attrToProjector:this._generateLineAttrToProjector(),animator:this._getAnimator(i.Animator.MAIN)}),a},b.prototype._generateLineAttrToProjector=function(){var a=this._generateAttrToProjector();return a.d=this._constructLineProjector(k.Plot._scaledAccessor(this.x()),k.Plot._scaledAccessor(this.y())),a},b.prototype._createDrawer=function(a){return new f.Area(a)},b.prototype._generateDrawSteps=function(){var a=[];if(this._animateOnNextRender()){var b=this._generateAttrToProjector();b.d=this._constructAreaProjector(k.Plot._scaledAccessor(this.x()),this._getResetYFunction(),k.Plot._scaledAccessor(this.y0())),a.push({attrToProjector:b,animator:this._getAnimator(i.Animator.RESET)})}return a.push({attrToProjector:this._generateAttrToProjector(),animator:this._getAnimator(i.Animator.MAIN)}),a},b.prototype._updateYScale=function(){var a=this._propertyExtents.get("y0"),b=h.Array.flatten(a),c=h.Array.uniq(b),d=1===c.length?c[0]:null,e=this.y(),f=e&&e.scale;null!=f&&(null!=this._constantBaselineValueProvider&&(f.removePaddingExceptionsProvider(this._constantBaselineValueProvider),this._constantBaselineValueProvider=null),null!=d&&(this._constantBaselineValueProvider=function(){return[d]},f.addPaddingExceptionsProvider(this._constantBaselineValueProvider)))},b.prototype._getResetYFunction=function(){return k.Plot._scaledAccessor(this.y0())},b.prototype._propertyProjectors=function(){var b=a.prototype._propertyProjectors.call(this);return b.d=this._constructAreaProjector(k.Plot._scaledAccessor(this.x()),k.Plot._scaledAccessor(this.y()),k.Plot._scaledAccessor(this.y0())),b},b.prototype.selections=function(b){var c=this;void 0===b&&(b=this.datasets());var d=a.prototype.selections.call(this,b).nodes(),f=b.map(function(a){return c._lineDrawers.get(a)}).filter(function(a){return null!=a});return f.forEach(function(a,b){return d.push(a.selectionForIndex(b).node())}),e.selectAll(d)},b.prototype._constructAreaProjector=function(a,b,c){var d=this,f=function(a,b,c){var e=k.Plot._scaledAccessor(d.x())(a,b,c),f=k.Plot._scaledAccessor(d.y())(a,b,c);return h.Math.isValidNumber(e)&&h.Math.isValidNumber(f)};return function(g,h,i){var j=d._getCurveFactory(),k=e.area().x(function(b,c){return a(b,c,i)}).y1(function(a,c){return b(a,c,i)}).y0(function(a,b){return c(a,b,i)}).curve(j).defined(function(a,b){return f(a,b,i)});return k(g)}},b._Y0_KEY="y0",b}(j.Line);b.Area=l},function(a,b,c){"use strict";var d;!function(a){a.MAIN="main",a.RESET="reset"}(d=b.Animator||(b.Animator={}))},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(6),g=c(9),h=c(3),i=c(10),j=c(0),k=c(16),l=c(2),m=c(15),n={linear:e.curveLinear,linearClosed:e.curveLinearClosed,step:e.curveStep,stepBefore:e.curveStepBefore,stepAfter:e.curveStepAfter,basis:e.curveBasis,basisOpen:e.curveBasisOpen,basisClosed:e.curveBasisClosed,bundle:e.curveBundle,cardinal:e.curveCardinal,cardinalOpen:e.curveCardinalOpen,cardinalClosed:e.curveCardinalClosed,monotone:e.curveMonotoneX},o=function(a){function b(){a.call(this),this._curve="linear",this._autorangeSmooth=!1,this._croppedRenderingEnabled=!0,this._downsamplingEnabled=!1,this.addClass("line-plot");var b=new f.Easing;b.stepDuration(l.Plot._ANIMATION_MAX_DURATION),b.easingMode("expInOut"),b.maxTotalDuration(l.Plot._ANIMATION_MAX_DURATION),this.animator(k.Animator.MAIN,b),this.attr("stroke",(new h.Color).range()[0]),this.attr("stroke-width","2px")}return d(b,a),b.prototype.x=function(b,c){return null==b?a.prototype.x.call(this):(null==c?a.prototype.x.call(this,b):a.prototype.x.call(this,b,c),this._setScaleSnapping(),this)},b.prototype.y=function(b,c){return null==b?a.prototype.y.call(this):(a.prototype.y.call(this,b,c),this._setScaleSnapping(),this)},b.prototype.autorangeMode=function(b){return null==b?a.prototype.autorangeMode.call(this):(a.prototype.autorangeMode.call(this,b),this._setScaleSnapping(),this)},b.prototype.autorangeSmooth=function(a){return null==a?this._autorangeSmooth:(this._autorangeSmooth=a,this._setScaleSnapping(),this)},b.prototype._setScaleSnapping=function(){"x"===this.autorangeMode()&&this.x()&&this.x().scale&&this.x().scale instanceof i.QuantitativeScale&&this.x().scale.snappingDomainEnabled(!this.autorangeSmooth()),"y"===this.autorangeMode()&&this.y()&&this.y().scale&&this.y().scale instanceof i.QuantitativeScale&&this.y().scale.snappingDomainEnabled(!this.autorangeSmooth())},b.prototype.curve=function(a){return null==a?this._curve:(this._curve=a,this.render(),this)},b.prototype.downsamplingEnabled=function(a){return null==a?this._downsamplingEnabled:(this._downsamplingEnabled=a,this)},b.prototype.croppedRenderingEnabled=function(a){return null==a?this._croppedRenderingEnabled:(this._croppedRenderingEnabled=a,this.render(),this)},b.prototype._createDrawer=function(a){return new g.Line(a)},b.prototype._extentsForProperty=function(b){var c=a.prototype._extentsForProperty.call(this,b);if(!this._autorangeSmooth)return c;if(this.autorangeMode()!==b)return c;if("x"!==this.autorangeMode()&&"y"!==this.autorangeMode())return c;var d,f=this._getEdgeIntersectionPoints();return d="y"===this.autorangeMode()?f.left.concat(f.right).map(function(a){return a.y}):f.top.concat(f.bottom).map(function(a){return a.x}),c.map(function(a){return e.extent(e.merge([a,d]))})},b.prototype._getEdgeIntersectionPoints=function(){var a=this;if(!(this.y().scale instanceof i.QuantitativeScale&&this.x().scale instanceof i.QuantitativeScale))return{left:[],right:[],top:[],bottom:[]};var b=this.y().scale,c=this.x().scale,d={left:[],right:[],top:[],bottom:[]},e=c.scale(c.domain()[0]),f=c.scale(c.domain()[1]),g=b.scale(b.domain()[0]),h=b.scale(b.domain()[1]);return this.datasets().forEach(function(i){for(var j,k,l,m,n,o,p,q,r=i.data(),s=1;s0&&c||0,e=this.y().scale.scale(d);return function(a,b,c){return e}},b.prototype._generateDrawSteps=function(){var a=[];if(this._animateOnNextRender()){var b=this._generateAttrToProjector();b.d=this._constructLineProjector(l.Plot._scaledAccessor(this.x()),this._getResetYFunction()),a.push({attrToProjector:b,animator:this._getAnimator(k.Animator.RESET)})}return a.push({attrToProjector:this._generateAttrToProjector(),animator:this._getAnimator(k.Animator.MAIN)}),a},b.prototype._generateAttrToProjector=function(){var b=a.prototype._generateAttrToProjector.call(this);return Object.keys(b).forEach(function(a){if("d"!==a){var c=b[a];b[a]=function(a,b,d){return a.length>0?c(a[0],b,d):null}}}),b},b.prototype.entitiesAt=function(a){var b=this.entityNearestByXThenY(a);return null!=b?[b]:[]},b.prototype.entitiesIn=function(a,b){var c,d;if(null==b){var e=a;c={min:e.topLeft.x,max:e.bottomRight.x},d={min:e.topLeft.y,max:e.bottomRight.y}}else c=a,d=b;var f=l.Plot._scaledAccessor(this.x()),g=l.Plot._scaledAccessor(this.y());return this.entities().filter(function(a){var b=a.datum,e=a.index,h=a.dataset,i=f(b,e,h),j=g(b,e,h);return c.min<=i&&i<=c.max&&d.min<=j&&j<=d.max})},b.prototype.entityNearestByXThenY=function(a){var b,c=this,d=1/0,e=1/0,f=this.bounds();return this.entities().forEach(function(g){if(c._entityVisibleOnPlot(g,f)){var h=Math.abs(a.x-g.position.x),i=Math.abs(a.y-g.position.y);(hs&&(s=u,r=b[h]),u0&&"\n"===a[0]?"\n":"";if(b<=g){var i=g/3,j=Math.floor(b/i);return{remainingToken:a,wrappedToken:h+"...".substr(0,j)}}for(;f+g>b;)e=d.StringMethods.trimEnd(e.substr(0,e.length-1)),f=c.measure(e).width;return{remainingToken:d.StringMethods.trimEnd(a.substring(e.length),"-").trim(),wrappedToken:h+e+"..."}},a.prototype.wrapNextToken=function(a,b,c){if(!b.canFitText||b.availableLines===b.wrapping.noLines||!this.canFitToken(a,b.availableWidth,c))return this.finishWrapping(a,b,c);for(var e=a;e;){var f=this.breakTokenToFitInWidth(e,b.currentLine,b.availableWidth,c);if(b.currentLine=f.line,e=f.remainingToken,null!=e){if(b.wrapping.noBrokeWords+=+f.breakWord,++b.wrapping.noLines,b.availableLines===b.wrapping.noLines){var g=this.addEllipsis(b.currentLine,b.availableWidth,c);return b.wrapping.wrappedText+=g.wrappedToken,b.wrapping.truncatedText+=g.remainingToken+e,b.currentLine="\n",b}b.wrapping.wrappedText+=d.StringMethods.trimEnd(b.currentLine),b.currentLine="\n"}}return b},a.prototype.finishWrapping=function(a,b,c){if(b.canFitText&&b.availableLines!==b.wrapping.noLines&&this._allowBreakingWords&&"none"!==this._textTrimming){var d=this.addEllipsis(b.currentLine+a,b.availableWidth,c);b.wrapping.wrappedText+=d.wrappedToken,b.wrapping.truncatedText+=d.remainingToken,b.wrapping.noBrokeWords+=+(d.remainingToken.length0),b.currentLine=""}else b.wrapping.truncatedText+=a;return b.canFitText=!1,b},a.prototype.breakTokenToFitInWidth=function(a,b,c,d,e){if(void 0===e&&(e=this._breakingCharacter),d.measure(b+a).width<=c)return{breakWord:!1,line:b+a,remainingToken:null};if(""===a.trim())return{breakWord:!1,line:b,remainingToken:""};if(!this._allowBreakingWords)return{breakWord:!1,line:b,remainingToken:a};for(var f=0;f0&&(g=e),{breakWord:f>0,line:b+a.substring(0,f)+g,remainingToken:a.substring(f)}},a}();b.Wrapper=e},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(123))},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(55)),d(c(56)),d(c(23))},function(a,b,c){"use strict";var d=c(0),e=function(){function a(a,b){void 0===a&&(a=[]),void 0===b&&(b={}),this._data=a,this._metadata=b,this._callbacks=new d.CallbackSet}return a.prototype.onUpdate=function(a){return this._callbacks.add(a),this},a.prototype.offUpdate=function(a){return this._callbacks["delete"](a),this},a.prototype.data=function(a){return null==a?this._data:(this._data=a,this._callbacks.callCallbacks(this),this)},a.prototype.metadata=function(a){return null==a?this._metadata:(this._metadata=a,this._callbacks.callCallbacks(this),this)},a}();b.Dataset=e},function(a,b,c){"use strict";b.version="3.0.0-beta.3"},function(a,b,c){"use strict";function d(a,b){return a.each(function(){var a=b.apply(this,arguments),c=t.select(this);for(var d in a)c.attr(d,a[d])})}function e(a,b){for(var c in b)a.attr(c,b[c]);return a}function f(a){return("function"==typeof a?d:e)(this,a)}function g(a,b,c){return a.each(function(){var a=b.apply(this,arguments),d=t.select(this);for(var e in a)d.style(e,a[e],c)})}function h(a,b,c){for(var d in b)a.style(d,b[d],c);return a}function i(a,b){return("function"==typeof a?g:h)(this,a,null==b?"":b)}function j(a,b){return a.each(function(){var a=b.apply(this,arguments),c=t.select(this);for(var d in a)c.property(d,a[d])})}function k(a,b){for(var c in b)a.property(c,b[c]);return a}function l(a){return("function"==typeof a?j:k)(this,a)}function m(a,b){return a.each(function(){var c=b.apply(this,arguments),d=t.select(this).transition(a);for(var e in c)d.attr(e,c[e])})}function n(a,b){for(var c in b)a.attr(c,b[c]);return a}function o(a){return("function"==typeof a?m:n)(this,a)}function p(a,b,c){return a.each(function(){var d=b.apply(this,arguments),e=t.select(this).transition(a);for(var f in d)e.style(f,d[f],c)})}function q(a,b,c){for(var d in b)a.style(d,b[d],c);return a}function r(a,b){return("function"==typeof a?p:q)(this,a,null==b?"":b)}var s=c(1),t=s,u=s;t.selection.prototype.attrs=f,t.selection.prototype.styles=i,t.selection.prototype.properties=l,u.transition.prototype.attrs=o,u.transition.prototype.styles=r},function(a,b,c){"use strict";var d=c(103),e=c(11),f={linear:d.easeLinear,quad:d.easeQuad,quadIn:d.easeQuadIn,quadOut:d.easeQuadOut,quadInOut:d.easeQuadInOut,cubic:d.easeCubic,cubicIn:d.easeCubicIn,cubicOut:d.easeCubicOut,cubicInOut:d.easeCubicInOut,poly:d.easePoly,polyIn:d.easePolyIn,polyOut:d.easePolyOut,polyInOut:d.easePolyInOut,sin:d.easeSin,sinIn:d.easeSinIn,sinOut:d.easeSinOut,sinInOut:d.easeSinInOut,exp:d.easeExp,expIn:d.easeExpIn,expOut:d.easeExpOut,expInOut:d.easeExpInOut,circle:d.easeCircle,circleIn:d.easeCircleIn,circleOut:d.easeCircleOut,circleInOut:d.easeCircleInOut,bounce:d.easeBounce,bounceIn:d.easeBounceIn,bounceOut:d.easeBounceOut,bounceInOut:d.easeBounceInOut,back:d.easeBack,backIn:d.easeBackIn,backOut:d.easeBackOut,backInOut:d.easeBackInOut,elastic:d.easeElastic,elasticIn:d.easeElasticIn,elasticOut:d.easeElasticOut,elasticInOut:d.easeElasticInOut},g=function(){function a(){this._startDelay=a._DEFAULT_START_DELAY_MILLISECONDS,this._stepDuration=a._DEFAULT_STEP_DURATION_MILLISECONDS,this._stepDelay=a._DEFAULT_ITERATIVE_DELAY_MILLISECONDS,this._maxTotalDuration=a._DEFAULT_MAX_TOTAL_DURATION_MILLISECONDS,this._easingMode=a._DEFAULT_EASING_MODE}return a.prototype.totalTime=function(a){var b=this._getAdjustedIterativeDelay(a);return this.startDelay()+b*Math.max(a-1,0)+this.stepDuration()},a.prototype.animate=function(a,b){var c=this;a=e.coerceExternalD3(a);var d=a.size(),f=this._getAdjustedIterativeDelay(d);return a.transition().ease(this._getEaseFactory()).duration(this.stepDuration()).delay(function(a,b){return c.startDelay()+f*b}).attrs(b)},a.prototype.startDelay=function(a){return null==a?this._startDelay:(this._startDelay=a,this)},a.prototype.stepDuration=function(a){return null==a?Math.min(this._stepDuration,this._maxTotalDuration):(this._stepDuration=a,this)},a.prototype.stepDelay=function(a){return null==a?this._stepDelay:(this._stepDelay=a,this)},a.prototype.maxTotalDuration=function(a){return null==a?this._maxTotalDuration:(this._maxTotalDuration=a,this)},a.prototype.easingMode=function(a){return null==a?this._easingMode:(this._easingMode=a,this)},a.prototype._getEaseFactory=function(){var a=this.easingMode();if("string"==typeof a){var b=f[a];return null==b?f.linear:b}return a},a.prototype._getAdjustedIterativeDelay=function(a){var b=this.maxTotalDuration()-this.stepDuration();b=Math.max(b,0);var c=b/Math.max(a-1,1);return Math.min(this.stepDelay(),c)},a._DEFAULT_START_DELAY_MILLISECONDS=0,a._DEFAULT_STEP_DURATION_MILLISECONDS=300,a._DEFAULT_ITERATIVE_DELAY_MILLISECONDS=15,a._DEFAULT_MAX_TOTAL_DURATION_MILLISECONDS=1/0,a._DEFAULT_EASING_MODE="expOut",a}();b.Easing=g},function(a,b,c){"use strict"; -var d=c(11),e=function(){function a(){}return a.prototype.totalTime=function(a){return 0},a.prototype.animate=function(a,b){return a=d.coerceExternalD3(a),a.attrs(b)},a}();b.Null=e},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(4),g=c(19),h=c(0),i=function(a){function b(b,c){void 0===c&&(c="bottom"),a.call(this,b,c),this._tickLabelAngle=0,this._tickLabelShearAngle=0,this.addClass("category-axis")}return d(b,a),Object.defineProperty(b.prototype,"_wrapper",{get:function(){var a=new f.Wrapper;return null!=this._tickLabelMaxLines&&a.maxLines(this._tickLabelMaxLines),a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"_writer",{get:function(){return new f.Writer(this._measurer,this._typesetterContext,this._wrapper)},enumerable:!0,configurable:!0}),b.prototype._setup=function(){a.prototype._setup.call(this),this._typesetterContext=new f.SvgContext(this._tickLabelContainer.node()),this._measurer=new f.CacheMeasurer(this._typesetterContext)},b.prototype._rescale=function(){return this.redraw()},b.prototype.requestedSpace=function(a,b){var c=this.isHorizontal()?0:this._tickSpaceRequired()+this.margin(),d=this.isHorizontal()?this._tickSpaceRequired()+this.margin():0;if(0===this._scale.domain().length)return{minWidth:0,minHeight:0};if(this.annotationsEnabled()){var e=this._annotationTierHeight()*this.annotationTierCount();this.isHorizontal()?d+=e:c+=e}var f=this._measureTickLabels(a,b);return{minWidth:f.usedWidth+c,minHeight:f.usedHeight+d}},b.prototype._coreSize=function(){var a=this.isHorizontal()?this.height():this.width(),b=this.isHorizontal()?this.requestedSpace(this.width(),this.height()).minHeight:this.requestedSpace(this.width(),this.height()).minWidth,c=this.margin()+this._annotationTierHeight(),d=b-c;return Math.min(d,a)},b.prototype._getTickValues=function(){return this.getDownsampleInfo().domain},b.prototype.getDownsampleInfo=function(a,c){void 0===a&&(a=this._scale),void 0===c&&(c=a.invertRange());var d=0===this._tickLabelAngle?1:1/Math.cos(this._tickLabelShearAngle/180*Math.PI),e=b._MINIMUM_WIDTH_PER_LABEL_PX*d,f=Math.ceil(e/a.stepWidth());return{domain:c.filter(function(a,b){return b%f===0}),stepWidth:f*a.stepWidth()}},b.prototype.tickLabelAngle=function(a){if(null==a)return this._tickLabelAngle;if(0!==a&&90!==a&&a!==-90)throw new Error("Angle "+a+" not supported; only 0, 90, and -90 are valid values");return this._tickLabelAngle=a,this.redraw(),this},b.prototype.tickLabelShearAngle=function(a){if(null==a)return this._tickLabelShearAngle;if(a<-80||a>80)throw new Error("Angle "+a+" not supported; Must be between [-80, 80]");return this._tickLabelShearAngle=a,this.redraw(),this},b.prototype.tickLabelMaxWidth=function(a){return 0===arguments.length?this._tickLabelMaxWidth:(this._tickLabelMaxWidth=a,this.redraw(),this)},b.prototype.tickLabelMaxLines=function(a){return 0===arguments.length?this._tickLabelMaxLines:(this._tickLabelMaxLines=a,this.redraw(),this)},b.prototype._tickSpaceRequired=function(){return this._maxLabelTickLength()+this.tickLabelPadding()},b.prototype._drawTicks=function(a,b){var c,d,f=this;switch(this.tickLabelAngle()){case 0:c={left:"right",right:"left",top:"center",bottom:"center"},d={left:"center",right:"center",top:"bottom",bottom:"top"};break;case 90:c={left:"center",right:"center",top:"right",bottom:"left"},d={left:"top",right:"bottom",top:"center",bottom:"center"};break;case-90:c={left:"center",right:"center",top:"left",bottom:"right"},d={left:"bottom",right:"top",top:"center",bottom:"center"}}b.each(function(b){var g=e.select(this),h=f.isHorizontal()?a:f.width()-f._tickSpaceRequired(),i=f.isHorizontal()?f.height()-f._tickSpaceRequired():a,j={xAlign:c[f.orientation()],yAlign:d[f.orientation()],textRotation:f.tickLabelAngle(),textShear:f.tickLabelShearAngle()};if(null!=f._tickLabelMaxWidth){if("left"===f.orientation()&&h>f._tickLabelMaxWidth){var k=h-f._tickLabelMaxWidth,l=g.attr("transform")+" translate("+k+", 0)";g.attr("transform",l)}h=Math.min(h,f._tickLabelMaxWidth)}f._writer.write(f.formatter()(b),h,i,j,g.node())})},b.prototype._measureTickLabels=function(a,b){var c=this,d=this._scale,f=d.cloneWithoutProviders().range([0,this.isHorizontal()?a:b]),g=this.getDownsampleInfo(f),i=g.domain,j=g.stepWidth,k=a-this._tickSpaceRequired();this.isHorizontal()&&(k=j,0!==this._tickLabelAngle&&(k=b-this._tickSpaceRequired()),k=Math.max(k,0));var l=j;this.isHorizontal()&&(l=b-this._tickSpaceRequired(),0!==this._tickLabelAngle&&(l=a-this._tickSpaceRequired()),l=Math.max(l,0)),null!=this._tickLabelMaxWidth&&(k=Math.min(k,this._tickLabelMaxWidth));var m=i.map(function(a){return c._wrapper.wrap(c.formatter()(a),c._measurer,k,l)}),n=this.isHorizontal()&&0===this._tickLabelAngle?e.sum:h.Math.max,o=this.isHorizontal()&&0===this._tickLabelAngle?h.Math.max:e.sum,p=n(m,function(a){return c._measurer.measure(a.wrappedText).width},0),q=o(m,function(a){return c._measurer.measure(a.wrappedText).height},0);return 0!==this._tickLabelAngle&&(r=[q,p],p=r[0],q=r[1]),{usedWidth:p,usedHeight:q};var r},b.prototype.renderImmediately=function(){var b=this;a.prototype.renderImmediately.call(this);var c=this._scale,d=this.getDownsampleInfo(c),e=d.domain,f=d.stepWidth,h=f;this.isHorizontal()&&null!=this._tickLabelMaxWidth&&(h=Math.min(h,this._tickLabelMaxWidth));var i=function(a,d){var e=c.scale(a)-h/2,f=b.isHorizontal()?e:0,g=b.isHorizontal()?0:e;return"translate("+f+","+g+")"},j=this._tickLabelContainer.selectAll("."+g.Axis.TICK_LABEL_CLASS).data(e),k=j.enter().append("g").classed(g.Axis.TICK_LABEL_CLASS,!0).merge(j);j.exit().remove(),k.attr("transform",i),k.text(""),this._drawTicks(f,k);var l="right"===this.orientation()?this._tickSpaceRequired():0,m="bottom"===this.orientation()?this._tickSpaceRequired():0;return this._tickLabelContainer.attr("transform","translate("+l+","+m+")"),this._showAllTickMarks(),this._showAllTickLabels(),this._hideTickMarksWithoutLabel(),this},b.prototype.computeLayout=function(b,c,d){return a.prototype.computeLayout.call(this,b,c,d),this.isHorizontal()||this._scale.range([0,this.height()]),this},b.prototype.invalidateCache=function(){a.prototype.invalidateCache.call(this),this._measurer.reset()},b._MINIMUM_WIDTH_PER_LABEL_PX=15,b}(g.Axis);b.Category=i},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(4),g=c(19),h=c(8),i=c(0),j=function(a){function b(b,c){a.call(this,b,c),this._tickLabelPositioning="center",this._usesTextWidthApproximation=!1,this.formatter(h.general())}return d(b,a),b.prototype._setup=function(){a.prototype._setup.call(this);var b=new f.SvgContext(this._tickLabelContainer.node(),g.Axis.TICK_LABEL_CLASS);this._measurer=new f.CacheMeasurer(b),this._wrapper=(new f.Wrapper).maxLines(1)},b.prototype._computeWidth=function(){var a=this._usesTextWidthApproximation?this._computeApproximateTextWidth():this._computeExactTextWidth();return"center"===this._tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+a:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+a)},b.prototype._computeExactTextWidth=function(){var a=this,b=this._getTickValues(),c=b.map(function(b){var c=a.formatter()(b);return a._measurer.measure(c).width});return i.Math.max(c,0)},b.prototype._computeApproximateTextWidth=function(){var a=this,b=this._getTickValues(),c=this._measurer.measure("M").width,d=b.map(function(b){var d=a.formatter()(b);return d.length*c});return i.Math.max(d,0)},b.prototype._computeHeight=function(){var a=this._measurer.measure().height;return"center"===this._tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+a:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+a)},b.prototype._getTickValues=function(){var a=this._scale,b=a.domain(),c=b[0]<=b[1]?b[0]:b[1],d=b[0]>=b[1]?b[0]:b[1];return a.ticks().filter(function(a){return a>=c&&a<=d})},b.prototype._rescale=function(){if(this._isSetup){if(!this.isHorizontal()){var a=this._computeWidth();if(a>this.width()||a180?a-=360:a<-180&&(a+=360),a!==-90&&0!==a&&90!==a)throw new Error(a+" is not a valid angle for Label");return this._angle=a,this.redraw(),this},b.prototype.padding=function(a){if(null==a)return this._padding;if(a=+a,a<0)throw new Error(a+" is not a valid padding value. Cannot be less than 0.");return this._padding=a,this.redraw(),this},b.prototype.fixedWidth=function(){return!0},b.prototype.fixedHeight=function(){return!0},b.prototype.renderImmediately=function(){a.prototype.renderImmediately.call(this),this._textContainer.selectAll("g").remove();var b=this._measurer.measure(this._text),c=Math.max(Math.min((this.height()-b.height)/2,this.padding()),0),d=Math.max(Math.min((this.width()-b.width)/2,this.padding()),0);this._textContainer.attr("transform","translate("+d+","+c+")");var e=this.width()-2*d,f=this.height()-2*c,g={xAlign:this.xAlignment(),yAlign:this.yAlignment(),textRotation:this.angle()};return this._writer.write(this._text,e,f,g),this},b.prototype.invalidateCache=function(){a.prototype.invalidateCache.call(this),this._measurer.reset()},b}(f.Component);b.Label=g;var h=function(a){function b(c,d){a.call(this,c,d),this.addClass(b.TITLE_LABEL_CLASS)}return d(b,a),b.TITLE_LABEL_CLASS="title-label",b}(g);b.TitleLabel=h;var i=function(a){function b(c,d){a.call(this,c,d),this.addClass(b.AXIS_LABEL_CLASS)}return d(b,a),b.AXIS_LABEL_CLASS="axis-label",b}(g);b.AxisLabel=i},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(4),g=c(20),h=c(8),i=c(26),j=c(0),k=c(5),l=function(){function a(a,b,c){void 0===a&&(a=[]),void 0===b&&(b=0),void 0===c&&(c=1/0),this.columns=a,this.bottomPadding=b,this.maxWidth=c}return a.prototype.addColumn=function(a){var b=a.width,c=this.getWidthAvailable();a.width=Math.min(c,b),this.columns.push(a)},a.prototype.getBounds=function(a){for(var b=this.columns[a],c=0,d=0;d1&&(g=new l,g.bottomPadding=c._rowBottomPadding,e.addRow(g));var k={width:d,height:d,data:{name:a,type:"symbol"}};g.addColumn(k),f=g.getWidthAvailable();var m=Math.min(f,i);c._wrapper.maxLines(c.maxLinesPerEntry());var n=c._wrapper.wrap(h,c._measurer,m).noLines,o=n*d,p={width:m,height:o,data:{name:a,type:"text"}};g.addColumn(p)}),e},b.prototype.requestedSpace=function(a,b){var c=this._buildLegendTable(j.Math.min([this.maxWidth(),a],a),b);return{minHeight:c.getHeight(),minWidth:c.getWidth()}},b.prototype.entitiesAt=function(a){var c=this;if(!this._isSetup)return[];var d=this._buildLegendTable(this.width(),this.height());return d.rows.reduce(function(f,g,h){if(0!==f.length)return f;var i=d.getRowBounds(h),k=j.Math.within(a,i);return k?g.columns.reduce(function(f,g,i){var k=d.getColumnBounds(h,i),l=j.Math.within(a,k);if(l){var m=c.content().selectAll("."+b.LEGEND_ROW_CLASS).nodes()[h],n=e.select(m).selectAll("."+b.LEGEND_ENTRY_CLASS).nodes()[Math.floor(i/2)],o=e.select(n).select("."+b.LEGEND_SYMBOL_CLASS),p=j.DOM.getTranslateValues(e.select(m)),q=j.DOM.getTranslateValues(o);return[{datum:g.data.name,position:{x:p[0]+q[0],y:p[1]+q[1]},selection:e.select(n),component:c}]}return f},f):f},[])},b.prototype.renderImmediately=function(){var c=this;a.prototype.renderImmediately.call(this);var d=this._buildLegendTable(this.width(),this.height());this._colorScale.domain().slice().sort(function(a,b){return c._comparator(c._formatter(a),c._formatter(b))});this.content().selectAll("*").remove();var f=this.content().selectAll("g."+b.LEGEND_ROW_CLASS).data(d.rows),g=f.enter().append("g").classed(b.LEGEND_ROW_CLASS,!0).merge(f);f.exit().remove(),g.attr("transform",function(a,b){var c=d.getRowBounds(b);return"translate("+c.topLeft.x+", "+c.topLeft.y+")"});var h=this;return g.each(function(a,c){for(var f=[],g=0;g=this._nRows||b<0||b>=this._nCols?null:this._rows[a][b]},b.prototype.add=function(a,b,c){if(null==a)throw Error("Cannot add null to a table cell");if(!this.has(a)){var d=this._rows[b]&&this._rows[b][c];if(null!=d)throw new Error("cell is occupied");a.detach(),this._nRows=Math.max(b+1,this._nRows),this._nCols=Math.max(c+1,this._nCols),this._padTableToSize(this._nRows,this._nCols),this._rows[b][c]=a,this._adoptAndAnchor(a),this.redraw()}return this},b.prototype._remove=function(a){for(var b=0;b0&&g!==A,F=h>0&&h!==B;if(!E&&!F)break;if(x>5)break}return g=n-e.sum(i.guaranteedWidths),h=o-e.sum(i.guaranteedHeights),t=b._calcProportionalSpace(q,g),u=b._calcProportionalSpace(p,h),{colProportionalSpace:t,rowProportionalSpace:u,guaranteedWidths:i.guaranteedWidths,guaranteedHeights:i.guaranteedHeights,wantsWidth:j,wantsHeight:k}},b.prototype._determineGuarantees=function(a,b,c){void 0===c&&(c=!1);var d=f.Array.createFilledArray(0,this._nCols),e=f.Array.createFilledArray(0,this._nRows),g=f.Array.createFilledArray(!1,this._nCols),h=f.Array.createFilledArray(!1,this._nRows);return this._rows.forEach(function(f,i){f.forEach(function(f,j){var k;k=null!=f?f.requestedSpace(a[j],b[i]):{minWidth:0,minHeight:0};var l=c?Math.min(k.minWidth,a[j]):k.minWidth;d[j]=Math.max(d[j],l);var m=c?Math.min(k.minHeight,b[i]):k.minHeight;e[i]=Math.max(e[i],m);var n=k.minWidth>a[j];g[j]=g[j]||n;var o=k.minHeight>b[i];h[i]=h[i]||o})}),{guaranteedWidths:d,guaranteedHeights:e,wantsWidthArr:g,wantsHeightArr:h}},b.prototype.requestedSpace=function(a,b){return this._calculatedLayout=this._iterateLayout(a,b),{minWidth:e.sum(this._calculatedLayout.guaranteedWidths),minHeight:e.sum(this._calculatedLayout.guaranteedHeights)}},b.prototype.computeLayout=function(b,c,d){var g=this;a.prototype.computeLayout.call(this,b,c,d);var h=e.sum(this._calculatedLayout.guaranteedWidths),i=e.sum(this._calculatedLayout.guaranteedHeights),j=this._calculatedLayout;(h>this.width()||i>this.height())&&(j=this._iterateLayout(this.width(),this.height(),!0));var k=0,l=f.Array.add(j.rowProportionalSpace,j.guaranteedHeights),m=f.Array.add(j.colProportionalSpace,j.guaranteedWidths);return this._rows.forEach(function(a,b){var c=0;a.forEach(function(a,d){null!=a&&a.computeLayout({x:c,y:k},m[d],l[b]),c+=m[d]+g._columnPadding}),k+=l[b]+g._rowPadding}),this},b.prototype.rowPadding=function(a){if(null==a)return this._rowPadding;if(!f.Math.isValidNumber(a)||a<0)throw Error("rowPadding must be a non-negative finite value");return this._rowPadding=a,this.redraw(),this},b.prototype.columnPadding=function(a){if(null==a)return this._columnPadding;if(!f.Math.isValidNumber(a)||a<0)throw Error("columnPadding must be a non-negative finite value");return this._columnPadding=a,this.redraw(),this},b.prototype.rowWeight=function(a,b){if(null==b)return this._rowWeights[a];if(!f.Math.isValidNumber(b)||b<0)throw Error("rowWeight must be a non-negative finite value");return this._rowWeights[a]=b,this.redraw(),this},b.prototype.columnWeight=function(a,b){if(null==b)return this._columnWeights[a];if(!f.Math.isValidNumber(b)||b<0)throw Error("columnWeight must be a non-negative finite value");return this._columnWeights[a]=b,this.redraw(),this},b.prototype.fixedWidth=function(){var a=e.transpose(this._rows);return b._fixedSpace(a,function(a){return null==a||a.fixedWidth()})},b.prototype.fixedHeight=function(){return b._fixedSpace(this._rows,function(a){return null==a||a.fixedHeight()})},b.prototype._padTableToSize=function(a,b){for(var c=0;c0&&this._callCallbacksForEvent(c,g,f,b)}},b.prototype.eventInside=function(a,b){return this._translator.isInside(a,b)},b._DISPATCHER_KEY="__Plottable_Dispatcher_Touch",b._TOUCHSTART_EVENT_NAME="touchstart",b._TOUCHMOVE_EVENT_NAME="touchmove",b._TOUCHEND_EVENT_NAME="touchend",b._TOUCHCANCEL_EVENT_NAME="touchcancel",b}(f.Dispatcher);b.Touch=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(7),f=function(a){function b(b){a.call(this,b),this._className="arc fill",this._svgElementName="path"}return d(b,a),b.prototype._applyDefaultAttributes=function(b){a.prototype._applyDefaultAttributes.call(this,b),b.style("stroke","none")},b}(e.Drawer);b.Arc=f},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(7),f=function(a){function b(b){a.call(this,b),this._className="arc outline",this._svgElementName="path"}return d(b,a),b.prototype._applyDefaultAttributes=function(b){a.prototype._applyDefaultAttributes.call(this,b),b.style("fill","none")},b}(e.Drawer);b.ArcOutline=f},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(7),g=function(a){function b(b){a.call(this,b),this._className="area",this._svgElementName="path"}return d(b,a),b.prototype._applyDefaultAttributes=function(b){a.prototype._applyDefaultAttributes.call(this,b),b.style("stroke","none")},b.prototype.selectionForIndex=function(a){return e.select(this.selection().node())},b}(f.Drawer);b.Area=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(7),g=function(a){function b(b){a.call(this,b),this._className="line",this._svgElementName="path"}return d(b,a),b.prototype._applyDefaultAttributes=function(b){a.prototype._applyDefaultAttributes.call(this,b),b.style("fill","none")},b.prototype.selectionForIndex=function(a){return e.select(this.selection().node())},b}(f.Drawer);b.Line=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(7),g=function(a){function b(b){a.call(this,b),this._svgElementName="rect"}return d(b,a),b.prototype._drawStepCanvas=function(a,b){var c=this.canvas().node().getContext("2d"),d=b.attrToAppliedProjector;c.save(),a.forEach(function(a,b){var f=Object.keys(d).reduce(function(c,e){return c[e]=d[e](a,b),c},{});if(c.beginPath(),c.rect(f.x,f.y,f.width,f.height),f["stroke-width"]&&(c.lineWidth=f["stroke-width"]),f.stroke){var g=e.color(f.stroke);f.opacity&&(g.opacity=f.opacity),c.strokeStyle=g.rgb().toString(),c.stroke()}if(f.fill){var h=e.color(f.fill);f.opacity&&(h.opacity=f.opacity),c.fillStyle=h.rgb().toString(),c.fill()}}),c.restore()},b}(f.Drawer);b.Rectangle=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(7),f=function(a){function b(b){a.call(this,b),this._svgElementName="line"}return d(b,a),b}(e.Drawer);b.Segment=f},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(7),f=function(a){function b(b){a.call(this,b),this._svgElementName="path",this._className="symbol"}return d(b,a),b}(e.Drawer);b.Symbol=f},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(12),f=c(0),g=c(14),h=function(a){function b(){var b=this;a.apply(this,arguments),this._clickedDown=!1,this._doubleClicking=!1,this._onClickCallbacks=new f.CallbackSet,this._onDoubleClickCallbacks=new f.CallbackSet,this._mouseDownCallback=function(a,c){return b._handleClickDown(a,c)},this._mouseUpCallback=function(a,c){return b._handleClickUp(a,c)},this._dblClickCallback=function(a,c){return b._handleDblClick(a,c)},this._touchStartCallback=function(a,c,d){return b._handleClickDown(c[a[0]],d)},this._touchEndCallback=function(a,c,d){return b._handleClickUp(c[a[0]],d)},this._touchCancelCallback=function(a,c){return b._clickedDown=!1}}return d(b,a),b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this._mouseDispatcher=e.Mouse.getDispatcher(b),this._mouseDispatcher.onMouseDown(this._mouseDownCallback),this._mouseDispatcher.onMouseUp(this._mouseUpCallback),this._mouseDispatcher.onDblClick(this._dblClickCallback),this._touchDispatcher=e.Touch.getDispatcher(b),this._touchDispatcher.onTouchStart(this._touchStartCallback),this._touchDispatcher.onTouchEnd(this._touchEndCallback),this._touchDispatcher.onTouchCancel(this._touchCancelCallback)},b.prototype._unanchor=function(){a.prototype._unanchor.call(this),this._mouseDispatcher.offMouseDown(this._mouseDownCallback),this._mouseDispatcher.offMouseUp(this._mouseUpCallback),this._mouseDispatcher.offDblClick(this._dblClickCallback),this._mouseDispatcher=null,this._touchDispatcher.offTouchStart(this._touchStartCallback),this._touchDispatcher.offTouchEnd(this._touchEndCallback),this._touchDispatcher.offTouchCancel(this._touchCancelCallback),this._touchDispatcher=null},b.prototype._handleClickDown=function(a,b){var c=this._translateToComponentSpace(a);this._isInsideComponent(c)&&(this._clickedDown=!0,this._clickedPoint=c)},b.prototype._handleClickUp=function(a,c){var d=this,e=this._translateToComponentSpace(a);this._clickedDown&&b._pointsEqual(e,this._clickedPoint)&&setTimeout(function(){d._doubleClicking||d._onClickCallbacks.callCallbacks(e,c)},0),this._clickedDown=!1},b.prototype._handleDblClick=function(a,b){var c=this,d=this._translateToComponentSpace(a);this._doubleClicking=!0,this._onDoubleClickCallbacks.callCallbacks(d,b),setTimeout(function(){return c._doubleClicking=!1},0)},b._pointsEqual=function(a,b){return a.x===b.x&&a.y===b.y},b.prototype.onClick=function(a){return this._onClickCallbacks.add(a),this},b.prototype.offClick=function(a){return this._onClickCallbacks["delete"](a),this},b.prototype.onDoubleClick=function(a){return this._onDoubleClickCallbacks.add(a),this},b.prototype.offDoubleClick=function(a){return this._onDoubleClickCallbacks["delete"](a),this},b}(g.Interaction);b.Click=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(12),f=c(0),g=c(14),h=function(a){function b(){var b=this;a.apply(this,arguments),this._dragging=!1,this._constrainedToComponent=!0,this._dragStartCallbacks=new f.CallbackSet,this._dragCallbacks=new f.CallbackSet,this._dragEndCallbacks=new f.CallbackSet,this._mouseDownCallback=function(a,c){return b._startDrag(a,c)},this._mouseMoveCallback=function(a,c){return b._doDrag(a,c)},this._mouseUpCallback=function(a,c){return b._endDrag(a,c)},this._touchStartCallback=function(a,c,d){return b._startDrag(c[a[0]],d)},this._touchMoveCallback=function(a,c,d){return b._doDrag(c[a[0]],d)},this._touchEndCallback=function(a,c,d){return b._endDrag(c[a[0]],d)}}return d(b,a),b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this._mouseDispatcher=e.Mouse.getDispatcher(this._componentAttachedTo),this._mouseDispatcher.onMouseDown(this._mouseDownCallback),this._mouseDispatcher.onMouseMove(this._mouseMoveCallback),this._mouseDispatcher.onMouseUp(this._mouseUpCallback),this._touchDispatcher=e.Touch.getDispatcher(this._componentAttachedTo),this._touchDispatcher.onTouchStart(this._touchStartCallback),this._touchDispatcher.onTouchMove(this._touchMoveCallback),this._touchDispatcher.onTouchEnd(this._touchEndCallback)},b.prototype._unanchor=function(){a.prototype._unanchor.call(this),this._mouseDispatcher.offMouseDown(this._mouseDownCallback),this._mouseDispatcher.offMouseMove(this._mouseMoveCallback),this._mouseDispatcher.offMouseUp(this._mouseUpCallback),this._mouseDispatcher=null,this._touchDispatcher.offTouchStart(this._touchStartCallback),this._touchDispatcher.offTouchMove(this._touchMoveCallback),this._touchDispatcher.offTouchEnd(this._touchEndCallback),this._touchDispatcher=null},b.prototype._translateAndConstrain=function(a){var b=this._translateToComponentSpace(a);return this._constrainedToComponent?{x:f.Math.clamp(b.x,0,this._componentAttachedTo.width()),y:f.Math.clamp(b.y,0,this._componentAttachedTo.height())}:b},b.prototype._startDrag=function(a,b){if(!(b instanceof MouseEvent&&0!==b.button)){var c=this._translateToComponentSpace(a);this._isInsideComponent(c)&&(b.preventDefault(),this._dragging=!0,this._dragOrigin=c,this._dragStartCallbacks.callCallbacks(this._dragOrigin))}},b.prototype._doDrag=function(a,b){this._dragging&&this._dragCallbacks.callCallbacks(this._dragOrigin,this._translateAndConstrain(a))},b.prototype._endDrag=function(a,b){b instanceof MouseEvent&&0!==b.button||this._dragging&&(this._dragging=!1,this._dragEndCallbacks.callCallbacks(this._dragOrigin,this._translateAndConstrain(a)))},b.prototype.constrainedToComponent=function(a){return null==a?this._constrainedToComponent:(this._constrainedToComponent=a,this)},b.prototype.onDragStart=function(a){return this._dragStartCallbacks.add(a),this},b.prototype.offDragStart=function(a){return this._dragStartCallbacks["delete"](a),this},b.prototype.onDrag=function(a){return this._dragCallbacks.add(a),this},b.prototype.offDrag=function(a){return this._dragCallbacks["delete"](a),this},b.prototype.onDragEnd=function(a){return this._dragEndCallbacks.add(a),this},b.prototype.offDragEnd=function(a){return this._dragEndCallbacks["delete"](a),this},b}(g.Interaction);b.Drag=h},function(a,b,c){"use strict";function d(a,b,c){return c-(c-a)*b}var e=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},f=c(1),g=c(12),h=c(3),i=c(0),j=c(14),k=c(13);b.zoomAt=d;var l=function(a){function b(b,c){var d=this;a.call(this),this._wheelCallback=function(a,b){return d._handleWheelEvent(a,b)},this._touchStartCallback=function(a,b,c){return d._handleTouchStart(a,b,c)},this._touchMoveCallback=function(a,b,c){return d._handlePinch(a,b,c)},this._touchEndCallback=function(a,b,c){return d._handleTouchEnd(a,b,c)},this._touchCancelCallback=function(a,b,c){return d._handleTouchEnd(a,b,c)},this._panEndCallbacks=new i.CallbackSet,this._zoomEndCallbacks=new i.CallbackSet,this._xScales=new i.Set,this._yScales=new i.Set,this._dragInteraction=new k.Drag,this._setupDragInteraction(),this._touchIds=f.map(),this._minDomainExtents=new i.Map,this._maxDomainExtents=new i.Map,this._minDomainValues=new i.Map,this._maxDomainValues=new i.Map,null!=b&&this.addXScale(b),null!=c&&this.addYScale(c)}return e(b,a),b.prototype.pan=function(a){var b=this;this.xScales().forEach(function(c){c.pan(b._constrainedTranslation(c,a.x))}),this.yScales().forEach(function(c){c.pan(b._constrainedTranslation(c,a.y))})},b.prototype.zoom=function(a,b){this.xScales().forEach(function(c){var d=c.range(),e=void 0===b?(d[1]-d[0])/2:b.x;c.zoom(a,e)}),this.yScales().forEach(function(c){var d=c.range(),e=void 0===b?(d[1]-d[0])/2:b.y;c.zoom(a,e)})},b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this._dragInteraction.attachTo(b),this._mouseDispatcher=g.Mouse.getDispatcher(this._componentAttachedTo),this._mouseDispatcher.onWheel(this._wheelCallback),this._touchDispatcher=g.Touch.getDispatcher(this._componentAttachedTo),this._touchDispatcher.onTouchStart(this._touchStartCallback),this._touchDispatcher.onTouchMove(this._touchMoveCallback),this._touchDispatcher.onTouchEnd(this._touchEndCallback),this._touchDispatcher.onTouchCancel(this._touchCancelCallback)},b.prototype._unanchor=function(){a.prototype._unanchor.call(this),this._mouseDispatcher.offWheel(this._wheelCallback),this._mouseDispatcher=null,this._touchDispatcher.offTouchStart(this._touchStartCallback),this._touchDispatcher.offTouchMove(this._touchMoveCallback),this._touchDispatcher.offTouchEnd(this._touchEndCallback),this._touchDispatcher.offTouchCancel(this._touchCancelCallback),this._touchDispatcher=null,this._dragInteraction.detachFrom(this._componentAttachedTo)},b.prototype._handleTouchStart=function(a,b,c){for(var d=0;d0&&this._zoomEndCallbacks.callCallbacks()},b.prototype._handleWheelEvent=function(a,c){var d=this,e=this._translateToComponentSpace(a);if(this._isInsideComponent(e)){c.preventDefault();var f=c.deltaY*(c.deltaMode?b._PIXELS_PER_LINE:1),g=Math.pow(2,.002*f),h=e.x,i=e.y;this.xScales().forEach(function(a){var b=d._constrainedZoom(a,g,h);h=b.centerPoint,g=b.zoomAmount}),this.yScales().forEach(function(a){var b=d._constrainedZoom(a,g,i);i=b.centerPoint,g=b.zoomAmount}),this.zoom(g,{x:h,y:i}),this._zoomEndCallbacks.callCallbacks()}},b.prototype._isRangeReversed=function(a){var b=a.range();return b[1]1,d=c?this.maxDomainExtent(a):this.minDomainExtent(a);if(null==d)return b;var e=a.getTransformationDomain(),f=e[0],g=e[1],h=Math.abs(g-f),i=c?Math.min:Math.max;return i(b,d/h)},b.prototype._constrainZoomValues=function(a,b,c){if(b<=1)return{centerPoint:c,zoomAmount:b};var e=this._isRangeReversed(a),f=this.minDomainValue(a),g=this.maxDomainValue(a);if(null==f&&null==g)return{centerPoint:c,zoomAmount:b};var h=a.getTransformationDomain(),i=h[0],j=h[1];if(null!=g){var k=a.scaleTransformation(g),l=a.scaleTransformation(j),m=d(l,b,c); -m>k!=e&&(c=this._getZoomCenterForTarget(l,b,k))}if(null!=f){var n=a.scaleTransformation(f),o=a.scaleTransformation(i),p=d(o,b,c);pk!=e||p=2)){var e={x:(null==b?c.x:b.x)-d.x,y:(null==b?c.y:b.y)-d.y};a.pan(e),b=d}}),this._dragInteraction.onDragEnd(function(){return a._panEndCallbacks.callCallbacks()})},b.prototype._constrainedTranslation=function(a,b){var c=a.getTransformationDomain(),d=c[0],e=c[1],f=this._isRangeReversed(a);if(b>0!==f){var g=this.maxDomainValue(a);if(null!=g){var h=a.scaleTransformation(e),i=a.scaleTransformation(g);b=(f?Math.max:Math.min)(h+b,i)-h}}else{var g=this.minDomainValue(a);if(null!=g){var j=a.scaleTransformation(d),k=a.scaleTransformation(g);b=(f?Math.min:Math.max)(j+b,k)-j}}return b},b.prototype._nonLinearScaleWithExtents=function(a){return!(null==this.minDomainExtent(a)||null==this.maxDomainExtent(a)||a instanceof h.Linear||a instanceof h.Time)},b.prototype.xScales=function(a){var b=this;if(null==a){var c=[];return this._xScales.forEach(function(a){c.push(a)}),c}return this._xScales=new i.Set,a.forEach(function(a){b.addXScale(a)}),this},b.prototype.yScales=function(a){var b=this;if(null==a){var c=[];return this._yScales.forEach(function(a){c.push(a)}),c}return this._yScales=new i.Set,a.forEach(function(a){b.addYScale(a)}),this},b.prototype.addXScale=function(a){return this._xScales.add(a),this},b.prototype.removeXScale=function(a){return this._xScales["delete"](a),this._minDomainExtents["delete"](a),this._maxDomainExtents["delete"](a),this._minDomainValues["delete"](a),this._maxDomainValues["delete"](a),this},b.prototype.addYScale=function(a){return this._yScales.add(a),this},b.prototype.removeYScale=function(a){return this._yScales["delete"](a),this._minDomainExtents["delete"](a),this._maxDomainExtents["delete"](a),this._minDomainValues["delete"](a),this._maxDomainValues["delete"](a),this},b.prototype.minDomainExtent=function(a,b){if(null==b)return this._minDomainExtents.get(a);if(b.valueOf()<0)throw new Error("extent must be non-negative");var c=this.maxDomainExtent(a);if(null!=c&&c.valueOf()=0&&i>=0?h>=0&&j>=0?(a=h,b=0,d=0,c=i):h<0&&j<0?(a=0,b=-j,d=0,c=g):h>=0&&j<0?(a=h,b=-j,d=0,c=g):h<0&&j>=0&&(a=1,b=1,d=1,c=Math.max(g,i)):g>=0&&i<0?h>=0&&j>=0?(a=Math.max(h,j),b=1,d=1,c=1):h<0&&j<0?(a=0,b=1,d=-i,c=g):h>=0&&j<0?(a=h,b=1,d=-i,c=1):h<0&&j>=0&&(a=j,b=1,d=1,c=g):g<0&&i>=0?h>=0&&j>=0?(a=1,b=0,d=-g,c=i):h<0&&j<0?(a=1,b=Math.max(-h,-j),d=1,c=1):h>=0&&j<0?(a=1,b=-j,d=-g,c=1):h<0&&j>=0&&(a=1,b=-h,d=1,c=i):g<0&&i<0&&(h>=0&&j>=0?(a=j,b=0,d=-g,c=0):h<0&&j<0?(a=0,b=-h,d=-i,c=0):h>=0&&j<0?(a=1,b=1,d=Math.max(h,-j),c=1):h<0&&j>=0&&(a=j,b=-h,d=1,c=0)),{x:d+c==0?0:d/(d+c)*this.width(),y:a+b==0?0:a/(a+b)*this.height()}},b.prototype._getDataToDraw=function(){var c=a.prototype._getDataToDraw.call(this);if(0===this.datasets().length)return c;var d=l.Plot._scaledAccessor(this.sectorValue()),e=this.datasets()[0],f=c.get(e),g=f.filter(function(a,c){return b._isValidData(d(a,c,e))});return c.set(e,g),c},b._isValidData=function(a){return k.Math.isValidNumber(a)&&a>=0},b.prototype._pixelPoint=function(a,c,d){var f=l.Plot._scaledAccessor(this.sectorValue());if(!b._isValidData(f(a,c,d)))return{x:NaN,y:NaN};var g=l.Plot._scaledAccessor(this.innerRadius())(a,c,d),h=l.Plot._scaledAccessor(this.outerRadius())(a,c,d),i=(g+h)/2,j=e.pie().sort(null).value(function(a,c){var e=f(a,c,d);return b._isValidData(e)?e:0}).startAngle(this._startAngle).endAngle(this._endAngle)(d.data()),k=j[c].startAngle,m=j[c].endAngle,n=(k+m)/2;return{x:i*Math.sin(n),y:-i*Math.cos(n)}},b.prototype._additionalPaint=function(a){var b=this;this._renderArea.select(".label-area").remove(),this._labelsEnabled&&k.Window.setTimeout(function(){return b._drawLabels()},a);var c=this._generateStrokeDrawSteps(),d=this._getDataToDraw();this.datasets().forEach(function(a){return b._strokeDrawers.get(a).draw(d.get(a),c)})},b.prototype._generateStrokeDrawSteps=function(){var a=this._generateAttrToProjector();return[{attrToProjector:a,animator:new g.Null}]},b.prototype._sliceIndexForPoint=function(a){var b=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2)),c=Math.acos(-a.y/b);a.x<0&&(c=2*Math.PI-c);for(var d,e=0;ec){d=e;break}if(void 0!==d){var f=this.datasets()[0],g=f.data()[d],h=this.innerRadius().accessor(g,d,f),i=this.outerRadius().accessor(g,d,f);if(b>h&&bo||y.minq)return;if(d._overlayLabel(x,y,h,c,a))return;var z=e.fill(f,h,b),A=1.6*j.Color.contrast("white",z)0},b.prototype._lineIntersectsSegment=function(a,b,c,d){var e=function(a,b,c){return(b.x-a.x)*(c.y-b.y)-(b.y-a.y)*(c.x-b.x)};return e(a,b,c)*e(a,b,d)<0},b._X2_KEY="x2",b._Y2_KEY="y2",b}(i.XYPlot);b.Segment=j},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(6),g=c(0),h=c(36),i=c(2),j=function(a){function b(){var b=this;a.call(this),this._baselineValue=0,this._stackingOrder="bottomup",this.addClass("stacked-area-plot"),this.attr("fill-opacity",1),this._stackingResult=new g.Map,this._stackedExtent=[],this._baselineValueProvider=function(){return[b._baselineValue]},this.croppedRenderingEnabled(!1)}return d(b,a),b.prototype.croppedRenderingEnabled=function(b){return null==b?a.prototype.croppedRenderingEnabled.call(this):b===!0?(g.Window.warn("Warning: Stacked Area Plot does not support cropped rendering."),this):a.prototype.croppedRenderingEnabled.call(this,b)},b.prototype._getAnimator=function(a){return new f.Null},b.prototype._setup=function(){a.prototype._setup.call(this),this._baseline=this._renderArea.append("line").classed("baseline",!0)},b.prototype.x=function(b,c){return null==b?a.prototype.x.call(this):(null==c?a.prototype.x.call(this,b):a.prototype.x.call(this,b,c),this._updateStackExtentsAndOffsets(),this)},b.prototype.y=function(b,c){return null==b?a.prototype.y.call(this):(null==c?a.prototype.y.call(this,b):a.prototype.y.call(this,b,c),this._updateStackExtentsAndOffsets(),this)},b.prototype.stackingOrder=function(a){return null==a?this._stackingOrder:(this._stackingOrder=a,this._onDatasetUpdate(),this)},b.prototype.downsamplingEnabled=function(b){return null==b?a.prototype.downsamplingEnabled.call(this):(g.Window.warn("Warning: Stacked Area Plot does not support downsampling"),this)},b.prototype._additionalPaint=function(){var a=this.y().scale.scale(this._baselineValue),b={x1:0,y1:a,x2:this.width(),y2:a};this._getAnimator("baseline").animate(this._baseline,b)},b.prototype._updateYScale=function(){var a=this.y(),b=a&&a.scale;null!=b&&(b.addPaddingExceptionsProvider(this._baselineValueProvider),b.addIncludedValuesProvider(this._baselineValueProvider))},b.prototype._onDatasetUpdate=function(){return this._updateStackExtentsAndOffsets(), -a.prototype._onDatasetUpdate.call(this),this},b.prototype._updateExtentsForProperty=function(b){a.prototype._updateExtentsForProperty.call(this,b),"x"!==b&&"y"!==b||!this._projectorsReady()||this._updateStackExtentsAndOffsets()},b.prototype._extentsForProperty=function(b){var c="y";return b===c?[this._stackedExtent]:a.prototype._extentsForProperty.call(this,b)},b.prototype._updateStackExtentsAndOffsets=function(){if(this._projectorsReady()){var a=this.datasets(),b=this.x().accessor,c=this.y().accessor,d=this._filterForProperty("y");this._checkSameDomain(a,b),this._stackingResult=g.Stacking.stack(a,b,c,this._stackingOrder),this._stackedExtent=g.Stacking.stackedExtent(this._stackingResult,b,d)}},b.prototype._checkSameDomain=function(a,c){var d=a.map(function(a){return e.set(a.data().map(function(b,d){return c(b,d,a).toString()})).values()}),f=b._domainKeys(a,c);d.some(function(a){return a.length!==f.length})&&g.Window.warn("the domains across the datasets are not the same. Plot may produce unintended behavior.")},b._domainKeys=function(a,b){var c=e.set();return a.forEach(function(a){a.data().forEach(function(d,e){c.add(b(d,e,a))})}),c.values()},b.prototype._propertyProjectors=function(){var b=this,c=a.prototype._propertyProjectors.call(this),d=this.y().accessor,e=this.x().accessor,f=function(a,b,c){return g.Stacking.normalizeKey(e(a,b,c))},h=function(a,c,e){return b.y().scale.scale(+d(a,c,e)+b._stackingResult.get(e).get(f(a,c,e)).offset)},j=function(a,c,d){return b.y().scale.scale(b._stackingResult.get(d).get(f(a,c,d)).offset)};return c.d=this._constructAreaProjector(i.Plot._scaledAccessor(this.x()),h,j),c},b.prototype._pixelPoint=function(b,c,d){var e=a.prototype._pixelPoint.call(this,b,c,d),f=this.x().accessor(b,c,d),h=this.y().accessor(b,c,d),i=this.y().scale.scale(+h+this._stackingResult.get(d).get(g.Stacking.normalizeKey(f)).offset);return{x:e.x,y:i}},b}(h.Area);b.StackedArea=j},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(4),f=c(0),g=c(22),h=function(a){function b(b){void 0===b&&(b=g.Bar.ORIENTATION_VERTICAL),a.call(this,b),this.addClass("stacked-bar-plot"),this._stackingOrder="bottomup",this._stackingResult=new f.Map,this._stackedExtent=[]}return d(b,a),b.prototype.x=function(b,c){return null==b?a.prototype.x.call(this):(null==c?a.prototype.x.call(this,b):a.prototype.x.call(this,b,c),this._updateStackExtentsAndOffsets(),this)},b.prototype.y=function(b,c){return null==b?a.prototype.y.call(this):(null==c?a.prototype.y.call(this,b):a.prototype.y.call(this,b,c),this._updateStackExtentsAndOffsets(),this)},b.prototype.stackingOrder=function(a){return null==a?this._stackingOrder:(this._stackingOrder=a,this._onDatasetUpdate(),this)},b.prototype._setup=function(){a.prototype._setup.call(this),this._labelArea=this._renderArea.append("g").classed(g.Bar._LABEL_AREA_CLASS,!0);var b=new e.SvgContext(this._labelArea.node());this._measurer=new e.CacheMeasurer(b),this._writer=new e.Writer(this._measurer,b)},b.prototype._drawLabels=function(){var c=this;a.prototype._drawLabels.call(this),this._labelArea.selectAll("g").remove();var d=+this.baselineValue(),e=this._isVertical?this.x().scale:this.y().scale,g=this._isVertical?this.y().scale:this.x().scale,h=f.Stacking.stackedExtents(this._stackingResult),i=h.maximumExtents,j=h.minimumExtents,k=this._getBarPixelWidth(),l=[],m=function(a,d,e){var f=e.x,g=e.y,h=d.height,i=d.width,j=c._isVertical?i>k-2*b._LABEL_PADDING:h>k-2*b._LABEL_PADDING,l=f<0||g<0||f+i>c.width()||g+h>c.height()||j;if(!l){var m=c._labelArea.append("g").attr("transform","translate("+f+", "+g+")");m.classed("stacked-bar-label",!0);var n={xAlign:"center",yAlign:"center"};c._writer.write(a,d.width,d.height,n,m.node())}return j};i.forEach(function(a){if(a.extent!==d){var f=c.labelFormatter()(a.extent),h=c._measurer.measure(f),i=c._isVertical?h.width:h.height,j=c._isVertical?h.height:h.width,k=c._isVertical?e.scale(a.axisValue)-i/2:g.scale(a.extent)+b._STACKED_BAR_LABEL_PADDING,n=c._isVertical?g.scale(a.extent)-j-b._STACKED_BAR_LABEL_PADDING:e.scale(a.axisValue)-i/2;l.push(m(f,h,{x:k,y:n}))}}),j.forEach(function(a){if(a.extent!==d){var f=c.labelFormatter()(a.extent),h=c._measurer.measure(f),i=c._isVertical?h.width:h.height,j=c._isVertical?h.height:h.width,k=c._isVertical?e.scale(a.axisValue)-i/2:g.scale(a.extent)-j-b._STACKED_BAR_LABEL_PADDING,n=c._isVertical?g.scale(a.extent)+b._STACKED_BAR_LABEL_PADDING:e.scale(a.axisValue)-i/2;l.push(m(f,h,{x:k,y:n}))}}),l.some(function(a){return a})&&this._labelArea.selectAll("g").remove()},b.prototype._generateAttrToProjector=function(){var b=this,c=a.prototype._generateAttrToProjector.call(this),d=this._isVertical?"y":"x",e=this._isVertical?"x":"y",g=this._isVertical?this.y().scale:this.x().scale,h=this._propertyBindings.get(d).accessor,i=this._propertyBindings.get(e).accessor,j=function(a,b,c){return f.Stacking.normalizeKey(i(a,b,c))},k=function(a,c,d){return g.scale(b._stackingResult.get(d).get(j(a,c,d)).offset)},l=function(a,c,d){return g.scale(+h(a,c,d)+b._stackingResult.get(d).get(j(a,c,d)).offset)},m=function(a,b,c){return Math.abs(l(a,b,c)-k(a,b,c))};c[this._isVertical?"height":"width"]=m;var n=function(a,b,c){return+h(a,b,c)<0?k(a,b,c):l(a,b,c)};return c[d]=function(a,c,d){return b._isVertical?n(a,c,d):n(a,c,d)-m(a,c,d)},c},b.prototype._onDatasetUpdate=function(){return this._updateStackExtentsAndOffsets(),a.prototype._onDatasetUpdate.call(this),this},b.prototype._updateExtentsForProperty=function(b){a.prototype._updateExtentsForProperty.call(this,b),"x"!==b&&"y"!==b||!this._projectorsReady()||this._updateStackExtentsAndOffsets()},b.prototype._extentsForProperty=function(b){var c=this._isVertical?"y":"x";return b===c?[this._stackedExtent]:a.prototype._extentsForProperty.call(this,b)},b.prototype._updateStackExtentsAndOffsets=function(){if(this._projectorsReady()){var a=this.datasets(),b=this._isVertical?this.x().accessor:this.y().accessor,c=this._isVertical?this.y().accessor:this.x().accessor,d=this._filterForProperty(this._isVertical?"y":"x");this._stackingResult=f.Stacking.stack(a,b,c,this._stackingOrder),this._stackedExtent=f.Stacking.stackedExtent(this._stackingResult,b,d)}},b.prototype.invalidateCache=function(){a.prototype.invalidateCache.call(this),this._measurer.reset()},b._STACKED_BAR_LABEL_PADDING=5,b}(g.Bar);b.StackedBar=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(0),f=c(22),g=c(2),h=function(a){function b(){a.call(this),this._connectorsEnabled=!1,this.addClass("waterfall-plot")}return d(b,a),b.prototype.connectorsEnabled=function(a){return null==a?this._connectorsEnabled:(this._connectorsEnabled=a,this)},b.prototype.total=function(a){return null==a?this._propertyBindings.get(b._TOTAL_KEY):(this._bindProperty(b._TOTAL_KEY,a,null),this)},b.prototype._additionalPaint=function(a){var b=this;this._connectorArea.selectAll("line").remove(),this._connectorsEnabled&&e.Window.setTimeout(function(){return b._drawConnectors()},a)},b.prototype._createNodesForDataset=function(c){var d=a.prototype._createNodesForDataset.call(this,c);return this._connectorArea=this._renderArea.append("g").classed(b._CONNECTOR_AREA_CLASS,!0),d},b.prototype._extentsForProperty=function(b){var c="y";return b===c?[this._extent]:a.prototype._extentsForProperty.call(this,b)},b.prototype._generateAttrToProjector=function(){var c=this,d=a.prototype._generateAttrToProjector.call(this),e=this.y().scale,f=g.Plot._scaledAccessor(this.total()),h=this.attr("y");null==h&&(d.y=function(a,b,d){var g=c.y().accessor(a,b,d),h=f(a,b,d);if(h)return Math.min(e.scale(g),e.scale(0));var i=c._subtotals[b];if(0===b)return g<0?e.scale(i-g):e.scale(i);var j=c._subtotals[b-1];return i>j?e.scale(i):e.scale(j)});var i=this.attr("height");return null==i&&(d.height=function(a,b,d){var g=f(a,b,d),h=c.y().accessor(a,b,d);if(g)return Math.abs(e.scale(h)-e.scale(0));var i=c._subtotals[b];if(0===b)return Math.abs(e.scale(i)-e.scale(i-h));var j=c._subtotals[b-1];return Math.abs(e.scale(i)-e.scale(j))}),d["class"]=function(a,d,e){var g="";null!=c.attr("class")&&(g=c.attr("class").accessor(a,d,e)+" ");var h=f(a,d,e);if(h)return g+b._BAR_TOTAL_CLASS;var i=c.y().accessor(a,d,e);return g+(i>0?b._BAR_GROWTH_CLASS:b._BAR_DECLINE_CLASS)},d},b.prototype._onDatasetUpdate=function(){return this._updateSubtotals(),a.prototype._onDatasetUpdate.call(this),this},b.prototype._calculateSubtotalsAndExtent=function(a){var b=this,c=Number.MAX_VALUE,d=Number.MIN_VALUE,e=0,f=!1;a.data().forEach(function(g,h){var i=b.y().accessor(g,h,a),j=b.total().accessor(g,h,a);if(j&&0!==h||(e+=i),b._subtotals.push(e),ed&&(d=e),j&&(id&&(d=i)),!f&&j){for(var k=i-e,l=0;l0&&this._subtotals[d]>this._subtotals[e]||this._subtotals[d]<0&&this._subtotals[d]>=this._subtotals[e])&&(j=a.y(f,d,c)+a.height(f,d,c)),this._connectorArea.append("line").classed(b._CONNECTOR_CLASS,!0).attr("x1",h).attr("x2",i).attr("y1",j).attr("y2",j)}},b.prototype._updateSubtotals=function(){var a=this.datasets();if(a.length>0){var b=a[a.length-1];this._subtotals=new Array,this._calculateSubtotalsAndExtent(b)}},b._BAR_DECLINE_CLASS="waterfall-decline",b._BAR_GROWTH_CLASS="waterfall-growth",b._BAR_TOTAL_CLASS="waterfall-total",b._CONNECTOR_CLASS="connector",b._CONNECTOR_AREA_CLASS="connector-area",b._TOTAL_KEY="total",b}(f.Bar);b.Waterfall=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(0),g=c(17),h=function(a){function b(c){a.call(this);var d;switch(c){case null:case void 0:null==b._plottableColorCache&&(b._plottableColorCache=b._getPlottableColors()),d=e.scaleOrdinal().range(b._plottableColorCache);break;case"Category10":case"category10":case"10":d=e.scaleOrdinal(e.schemeCategory10);break;case"Category20":case"category20":case"20":d=e.scaleOrdinal(e.schemeCategory20);break;case"Category20b":case"category20b":case"20b":d=e.scaleOrdinal(e.schemeCategory20b);break;case"Category20c":case"category20c":case"20c":d=e.scaleOrdinal(e.schemeCategory20c);break;default:throw new Error("Unsupported ColorScale type")}this._d3Scale=d}return d(b,a),b.prototype.extentOfValues=function(a){return f.Array.uniq(a)},b.prototype._getExtent=function(){return f.Array.uniq(this._getAllIncludedValues())},b.invalidateColorCache=function(){b._plottableColorCache=null},b._getPlottableColors=function(){for(var a=[],b=e.select("body").append("plottable-color-tester"),c=f.Color.colorTest(b,""),d=0,g=f.Color.colorTest(b,"plottable-colors-0");null!=g&&d0&&this._setDomain([f.Math.min(a,0),f.Math.max(a,0)]),this},b.prototype.scale=function(a){return this._d3Scale(a)},b.prototype._getDomain=function(){return this._backingScaleDomain()},b.prototype._backingScaleDomain=function(a){return null==a?this._d3Scale.domain():(this._d3Scale.domain(a),this)},b.prototype._getRange=function(){return this._colorRange},b.prototype._setRange=function(a){this._colorRange=a,this._resetScale()},b.REDS=["#FFFFFF","#FFF6E1","#FEF4C0","#FED976","#FEB24C","#FD8D3C","#FC4E2A","#E31A1C","#B10026"],b.BLUES=["#FFFFFF","#CCFFFF","#A5FFFD","#85F7FB","#6ED3EF","#55A7E0","#417FD0","#2545D3","#0B02E1"],b.POSNEG=["#0B02E1","#2545D3","#417FD0","#55A7E0","#6ED3EF","#85F7FB","#A5FFFD","#CCFFFF","#FFFFFF","#FFF6E1","#FEF4C0","#FED976","#FEB24C","#FD8D3C","#FC4E2A","#E31A1C","#B10026"],b}(g.Scale);b.InterpolatedColor=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(10),g=function(a){function b(){a.call(this),this._d3Scale=e.scaleLinear()}return d(b,a),b.prototype._defaultExtent=function(){return[0,1]},b.prototype._expandSingleValueDomain=function(a){return a[0]===a[1]?[a[0]-1,a[1]+1]:a},b.prototype.scale=function(a){return this._d3Scale(a)},b.prototype.scaleTransformation=function(a){return this.scale(a)},b.prototype.invertedTransformation=function(a){return this.invert(a)},b.prototype.getTransformationDomain=function(){return this.domain()},b.prototype._getDomain=function(){return this._backingScaleDomain()},b.prototype._backingScaleDomain=function(a){return null==a?this._d3Scale.domain():(this._d3Scale.domain(a),this)},b.prototype._getRange=function(){return this._d3Scale.range()},b.prototype._setRange=function(a){this._d3Scale.range(a)},b.prototype.invert=function(a){return this._d3Scale.invert(a)},b.prototype.defaultTicks=function(){return this._d3Scale.ticks(b._DEFAULT_NUM_TICKS)},b.prototype._niceDomain=function(a,b){return this._d3Scale.copy().domain(a).nice(b).domain()},b}(f.QuantitativeScale);b.Linear=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(0),g=c(3),h=c(10),i=function(a){function b(b){if(void 0===b&&(b=10),a.call(this),this._d3Scale=e.scaleLinear(),this._base=b,this._pivot=this._base,this._setDomain(this._defaultExtent()),b<=1)throw new Error("ModifiedLogScale: The base must be > 1")}return d(b,a),b.prototype._adjustedLog=function(a){var b=a<0?-1:1;return a*=b,a0?[b/this._base,b*this._base]:0===b?[-this._base,this._base]:[b*this._base,b/this._base]}return a},b.prototype._getRange=function(){return this._d3Scale.range()},b.prototype._setRange=function(a){this._d3Scale.range(a)},b.prototype.defaultTicks=function(){return this._d3Scale.ticks(g.ModifiedLog._DEFAULT_NUM_TICKS)},b}(h.QuantitativeScale);b.ModifiedLog=i},function(a,b,c){"use strict";function d(a){if(a<=0)throw new Error("interval must be positive number");return function(b){var c=b.domain(),d=Math.min(c[0],c[1]),e=Math.max(c[0],c[1]),g=Math.ceil(d/a)*a,h=Math.floor((e-g)/a)+1,i=d%a===0?[]:[d],j=f.Math.range(0,h).map(function(b){return g+b*a}),k=e%a===0?[]:[e];return i.concat(j).concat(k)}}function e(){return function(a){var b=a.defaultTicks();return b.filter(function(a,c){return a%1===0||0===c||c===b.length-1})}}var f=c(0);b.intervalTickGenerator=d,b.integerTickGenerator=e},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(23),g=c(10),h=function(a){function b(){a.call(this),this._d3Scale=e.scaleTime(),this.autoDomain()}return d(b,a),b.prototype.tickInterval=function(a,c){void 0===c&&(c=1);var d=e.scaleTime(),f=b.timeIntervalToD3Time(a).every(c);return d.domain(this.domain()),d.range(this.range()),d.ticks(f)},b.prototype._setDomain=function(b){if(b[1]d?c/d:d/c}function e(a,b){var c=h.color(a).brighter(b);return c.rgb().toString()}function f(a,b){a.classed(b,!0);var c=a.style("background-color");if("transparent"===c)return null;var d=/\((.+)\)/.exec(c)[1].split(",").map(function(a){var b=+a,c=b.toString(16);return b<16?"0"+c:c});if(4===d.length&&"00"===d[3])return null;var e="#"+d.join("");return a.classed(b,!1),e}function g(a){var b=h.rgb(a),c=function(a){return a/=255,a<=.03928?a/12.92:i.pow((a+.055)/1.055,2.4)},d=c(b.r),e=c(b.g),f=c(b.b);return.2126*d+.7152*e+.0722*f}var h=c(1),i=window.Math;b.contrast=d,b.lightenColor=e,b.colorTest=f},function(a,b,c){"use strict";function d(a,b){for(var c=b;null!=c&&c!==a;)c=c.parentNode;return c===a}function e(a){var b;try{b=a.node().getBBox()}catch(c){b={x:0,y:0,width:0,height:0}}return b}function f(a){null!=window.requestAnimationFrame?window.requestAnimationFrame(a):setTimeout(a,b.SCREEN_REFRESH_RATE_MILLISECONDS)}function g(a){var b=a instanceof r.selection?a.node():a,c=window.getComputedStyle(b);return q(c,"width")+q(c,"padding-left")+q(c,"padding-right")+q(c,"border-left-width")+q(c,"border-right-width")}function h(a){var b=a instanceof r.selection?a.node():a,c=window.getComputedStyle(b);return q(c,"height")+q(c,"padding-top")+q(c,"padding-bottom")+q(c,"border-top-width")+q(c,"border-bottom-width")}function i(a){var b=w.exec(a.attr("transform"));if(null!=b){var c=b[1],d=b[2],e=void 0===d?0:d;return[+c,+e]}return[0,0]}function j(a){var b=x.exec(a.attr("transform"));if(null!=b){var c=b[1];return+c}return 0}function k(a){var b=y.exec(a.attr("transform"));if(null!=b){var c=b[1],d=b[2];return[+c,null==d?+c:+d]}return[0,0]}function l(a,b){return!(s.floor(a.right)<=s.ceil(b.left))&&(!(s.ceil(a.left)>=s.floor(b.right))&&(!(s.floor(a.bottom)<=s.ceil(b.top))&&!(s.ceil(a.top)>=s.floor(b.bottom))))}function m(a,b){return{left:a.left-b,top:a.top-b,right:a.right+b,bottom:a.bottom+b,width:a.width+2*b,height:a.height+2*b}}function n(a,b){return s.floor(b.left)<=s.ceil(a.left)&&s.floor(b.top)<=s.ceil(a.top)&&s.floor(a.right)<=s.ceil(b.right)&&s.floor(a.bottom)<=s.ceil(b.bottom)}function o(a,b,c,d){void 0===d&&(d=.5);var e=p(a),f=p(b);return c.x+c.width>=e.min-d&&c.x<=e.max+d&&c.y+c.height>=f.min-d&&c.y<=f.max+d}function p(a){if("number"==typeof a){var b=a;return{min:b,max:b}}var c=a;if(c instanceof Object&&"min"in c&&"max"in c)return c;throw new Error("input '"+a+"' can't be parsed as an Range")}function q(a,b){var c=a.getPropertyValue(b),d=parseFloat(c);return d||0}var r=c(1),s=window.Math;b.contains=d,b.elementBBox=e,b.SCREEN_REFRESH_RATE_MILLISECONDS=1e3/60,b.requestAnimationFramePolyfill=f,b.elementWidth=g,b.elementHeight=h;var t="\\s",u="(?:[-+]?[0-9]*\\.?[0-9]+)",v="(?:(?:"+t+"+,?"+t+"*)|(?:,"+t+"*))",w=new RegExp("translate"+t+"*\\("+t+"*("+u+")(?:"+v+"("+u+"))?"+t+"*\\)"),x=new RegExp("rotate"+t+"*\\("+t+"*("+u+")"+t+"*\\)"),y=new RegExp("scale"+t+"*\\("+t+"*("+u+")(?:"+v+"("+u+"))?"+t+"*\\)");b.getTranslateValues=i,b.getRotate=j,b.getScaleValues=k,b.clientRectsOverlap=l,b.expandRect=m,b.clientRectInside=n,b.intersectsBBox=o},function(a,b,c){"use strict";var d=c(28),e=function(){function a(){this._entities=[]}return a.prototype.add=function(a){this._entities.push(a)},a.prototype.entityNearest=function(a,b){var c,e=1/0;if(this._entities.forEach(function(f){if(void 0===b||b(f)!==!1){var g=d.distanceSquared(f.position,a);g=0?e:f;m.has(k)?(j=m.get(k),m.set(k,j+l)):(j=0,m.set(k,l)),d.set(k,{offset:j,value:l,axisValue:b(h,i,a)})}),j.set(a,d)}),j}function e(a){var b=new i.Map,c=new i.Map;return a.forEach(function(a){a.forEach(function(a,d){var e=i.Math.max([a.offset+a.value,a.offset],a.offset),f=i.Math.min([a.offset+a.value,a.offset],a.offset);b.has(d)?b.get(d).extentf&&c.set(d,{extent:f,axisValue:a.axisValue}):c.set(d,{extent:f,axisValue:a.axisValue})})}),{maximumExtents:b,minimumExtents:c}}function f(a,b,c){var d=[];a.forEach(function(a,e){e.data().forEach(function(f,h){if(null==c||c(f,h,e)){var i=a.get(g(b(f,h,e)));d.push(i.value+i.offset)}})});var e=i.Math.max(d,0),f=i.Math.min(d,0);return[j.min(f,0),j.max(0,e)]}function g(a){return String(a)}var h=c(1),i=c(0),j=window.Math;b.stack=d,b.stackedExtents=e,b.stackedExtent=f,b.normalizeKey=g},function(a,b,c){"use strict";function d(a){var b=a.root().rootElement().node(),c=b[h];if(null==c){var d=document.createElementNS(b.namespaceURI,"svg");d.setAttribute("class","measurer"),d.setAttribute("style","opacity: 0; visibility: hidden; position: absolute; width: 1px; height: 1px;"),b.appendChild(d),c=new i(f.select(d)),b[h]=c}return c}function e(a,b,c){a.styles({left:b+"px",top:c+"px"}),a.attrs({x:""+b,y:""+c})}var f=c(1),g=c(0),h="__Plottable_ClientTranslator";b.getTranslator=d;var i=function(){function a(a){this._measurementElement=a}return a.prototype.computePosition=function(b,c){e(this._measurementElement,0,0);var d=this._measurementElement.node().getBoundingClientRect(),f={x:d.left,y:d.top};e(this._measurementElement,a.SAMPLE_DISTANCE,a.SAMPLE_DISTANCE),d=this._measurementElement.node().getBoundingClientRect();var g={x:d.left,y:d.top};if(f.x===g.x||f.y===g.y)return null;var h=(g.x-f.x)/a.SAMPLE_DISTANCE,i=(g.y-f.y)/a.SAMPLE_DISTANCE;e(this._measurementElement,(b-f.x)/h,(c-f.y)/i),d=this._measurementElement.node().getBoundingClientRect();var j={x:d.left,y:d.top},k={x:(j.x-f.x)/h,y:(j.y-f.y)/i};return k},a.prototype.isInside=function(a,b){return g.DOM.contains(a.root().rootElement().node(),b.target)},a.SAMPLE_DISTANCE=100,a}();b.Translator=i},function(a,b,c){"use strict";function d(a){g.SHOW_WARNINGS&&null!=window.console&&(null!=window.console.warn?console.warn(a):null!=window.console.log&&console.log(a))}function e(a,b){for(var c=[],d=2;d1)throw new Error("SingleLineWrapper is designed to work only on single line");var i=function(b){return a.prototype.wrap.call(g,c,d,b,f)},j=i(e);if(j.noLines<2)return j;for(var k=0,l=e,m=0;mk;++m){var n=(l+k)/2,o=i(n);this.areSameResults(j,o)?(l=n,j=o):k=n}return j},b.prototype.areSameResults=function(a,b){return a.noLines===b.noLines&&a.truncatedText===b.truncatedText},b}(e.Wrapper);f.NO_WRAP_ITERATIONS=5,b.SingleLineWrapper=f},function(a,b,c){"use strict";var d=c(18),e={textRotation:0,textShear:0,xAlign:"left",yAlign:"top"},f=function(){function a(a,b,c){this._measurer=a,this._penFactory=b,this._wrapper=c}return a.prototype.measurer=function(a){return this._measurer=a,this},a.prototype.wrapper=function(a){return this._wrapper=a,this},a.prototype.penFactory=function(a){return this._penFactory=a,this},a.prototype.write=function(b,c,f,g,h){if(void 0===g&&(g={}),g=d.Methods.defaults({},e,g),a.SupportedRotation.indexOf(g.textRotation)===-1)throw new Error("unsupported rotation - "+g.textRotation+". Supported rotations are "+a.SupportedRotation.join(", "));if(null!=g.textShear&&g.textShear<-80||g.textShear>80)throw new Error("unsupported shear angle - "+g.textShear+". Must be between -80 and 80");var i=Math.abs(Math.abs(g.textRotation)-90)>45,j=i?c:f,k=i?f:c,l=g.textShear,m=l*Math.PI/180,n=this._measurer.measure().height,o=n*Math.tan(m),p=j/Math.cos(m)-Math.abs(o),q=k*Math.cos(m),r=d.StringMethods.combineWhitespace(b),s=this._wrapper?this._wrapper.wrap(r,this._measurer,p,q).wrappedText:r,t=s.split("\n"),u=a.XOffsetFactor[g.xAlign]*p*Math.sin(m),v=a.YOffsetFactor[g.yAlign]*(q-t.length*n),w=u-v,x=[0,0],y=g.textRotation+l;switch(g.textRotation){case 90:x=[c+w,0];break;case-90:x=[-w,f];break;case 180:x=[c,f+w];break;default:x=[0,-w]}var z=this._penFactory.createPen(b,{translate:x,rotate:y},h);this.writeLines(t,z,p,n,o,g.xAlign),null!=z.destroy&&z.destroy()},a.prototype.writeLines=function(b,c,d,e,f,g){b.forEach(function(b,h){var i=f>0?(h+1)*f:h*f,j=i+d*a.XOffsetFactor[g],k=a.AnchorConverter[g];c.write(b,k,j,(h+1)*e)})},a}();f.SupportedRotation=[-90,0,180,90],f.AnchorConverter={center:"middle",left:"start",right:"end"},f.XOffsetFactor={center:.5,left:0,right:1},f.YOffsetFactor={bottom:1,center:.5,top:0},b.Writer=f},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}c(52);var e=c(6);b.Animators=e;var f=c(49);b.Axes=f;var g=c(30);b.Components=g;var h=c(20);b.Configs=h;var i=c(8);b.Formatters=i;var j=c(25);b.RenderController=j;var k=c(31);b.RenderPolicies=k;var l=c(26);b.SymbolFactories=l;var m=c(12);b.Dispatchers=m;var n=c(9);b.Drawers=n;var o=c(13);b.Interactions=o;var p=c(16);b.Plots=p;var q=c(3);b.Scales=q;var r=c(0);b.Utils=r,d(c(19));var s=c(23);b.TimeInterval=s.TimeInterval,d(c(5)),d(c(24)),d(c(50));var t=c(51);b.version=t.version,d(c(21)),d(c(7)),d(c(14)),d(c(32)),d(c(15)),d(c(2)),d(c(10)),d(c(17))}])}); \ No newline at end of file +!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("d3")):"function"==typeof define&&define.amd?define(["d3"],b):"object"==typeof exports?exports.Plottable=b(require("d3")):a.Plottable=b(a.d3)}(this,function(a){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.i=function(a){return a},b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=125)}([function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}var e=c(95);b.Array=e;var f=c(97);b.Color=f;var g=c(98);b.DOM=g;var h=c(29);b.Math=h;var i=c(101);b.Stacking=i;var j=c(103);b.Window=j,d(c(96)),d(c(12)),d(c(99)),d(c(100)),d(c(41)),d(c(102))},function(b,c){b.exports=a},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(6),g=c(5),h=c(7),i=c(0),j=c(12),k=c(8),l=c(38);b.Renderer=k.makeEnum(["svg","canvas"]);var m=function(a){function b(){var c=a.call(this)||this;c._dataChanged=!1,c._animate=!1,c._animators={},c._overflowHidden=!0,c.addClass("plot"),c._datasetToDrawer=new i.Map,c._attrBindings=e.map(),c._attrExtents=e.map(),c._includedValuesProvider=function(a){return c._includedValuesForScale(a)},c._renderCallback=function(a){return c.render()},c._onDatasetUpdateCallback=function(){return c._onDatasetUpdate()},c._propertyBindings=e.map(),c._propertyExtents=e.map();var d=(new f.Easing).maxTotalDuration(b._ANIMATION_MAX_DURATION);return c.animator(l.Animator.MAIN,d),c.animator(l.Animator.RESET,new f.Null),c}return d(b,a),b.prototype.anchor=function(b){return b=j.coerceExternalD3(b),a.prototype.anchor.call(this,b),this._dataChanged=!0,this._cachedEntityStore=void 0,this._updateExtents(),this},b.prototype._setup=function(){var b=this;a.prototype._setup.call(this),null!=this._canvas&&this.element().node().appendChild(this._canvas.node()),this._renderArea=this.content().append("g").classed("render-area",!0),this.datasets().forEach(function(a){return b._createNodesForDataset(a)})},b.prototype.computeLayout=function(b,c,d){return a.prototype.computeLayout.call(this,b,c,d),null!=this._canvas&&(this._canvas.attr("width",this.width()),this._canvas.attr("height",this.height())),this},b.prototype.destroy=function(){var b=this;a.prototype.destroy.call(this),this._scales().forEach(function(a){return a.offUpdate(b._renderCallback)}),this.datasets([])},b.prototype._createNodesForDataset=function(a){var b=this._datasetToDrawer.get(a);return"svg"===this.renderer()?b.renderArea(this._renderArea.append("g")):b.canvas(this._canvas),b},b.prototype._createDrawer=function(a){return new h.Drawer(a)},b.prototype._getAnimator=function(a){return this._animateOnNextRender()?this._animators[a]||new f.Null:new f.Null},b.prototype._onDatasetUpdate=function(){this._updateExtents(),this._dataChanged=!0,this._cachedEntityStore=void 0,this.render()},b.prototype.attr=function(a,b,c){return null==b?this._attrBindings.get(a):(this._bindAttr(a,b,c),this.render(),this)},b.prototype._bindProperty=function(a,b,c){var d=this._propertyBindings.get(a),e=null!=d?d.scale:null,f="function"==typeof b?b:function(){return b};this._propertyBindings.set(a,{accessor:f,scale:c}),this._updateExtentsForProperty(a),null!=e&&this._uninstallScaleForKey(e,a),null!=c&&this._installScaleForKey(c,a)},b.prototype._bindAttr=function(a,b,c){var d=this._attrBindings.get(a),e=null!=d?d.scale:null,f="function"==typeof b?b:function(){return b};this._attrBindings.set(a,{accessor:f,scale:c}),this._updateExtentsForAttr(a),null!=e&&this._uninstallScaleForKey(e,a),null!=c&&this._installScaleForKey(c,a)},b.prototype._generateAttrToProjector=function(){var a={};this._attrBindings.each(function(b,c){var d=b.accessor,e=b.scale,f=e?function(a,b,c){return e.scale(d(a,b,c))}:d;a[c]=f});var b=this._propertyProjectors();return Object.keys(b).forEach(function(c){null==a[c]&&(a[c]=b[c])}),a},b.prototype.renderImmediately=function(){return a.prototype.renderImmediately.call(this),this._isAnchored&&(this._paint(),this._dataChanged=!1),this},b.prototype.animated=function(a){return null==a?this._animate:(this._animate=a,this)},b.prototype.detach=function(){return a.prototype.detach.call(this),this._updateExtents(),this},b.prototype._scales=function(){var a=[];return this._attrBindings.each(function(b,c){var d=b.scale;null!=d&&a.indexOf(d)===-1&&a.push(d)}),this._propertyBindings.each(function(b,c){var d=b.scale;null!=d&&a.indexOf(d)===-1&&a.push(d)}),a},b.prototype._updateExtents=function(){var a=this;this._attrBindings.each(function(b,c){return a._updateExtentsForAttr(c)}),this._propertyExtents.each(function(b,c){return a._updateExtentsForProperty(c)}),this._scales().forEach(function(b){return b.addIncludedValuesProvider(a._includedValuesProvider)})},b.prototype._updateExtentsForAttr=function(a){this._updateExtentsForKey(a,this._attrBindings,this._attrExtents,null)},b.prototype._updateExtentsForProperty=function(a){this._updateExtentsForKey(a,this._propertyBindings,this._propertyExtents,this._filterForProperty(a))},b.prototype._filterForProperty=function(a){return null},b.prototype._updateExtentsForKey=function(a,b,c,d){var e=this,f=b.get(a);null!=f&&null!=f.accessor&&c.set(a,this.datasets().map(function(a){return e._computeExtent(a,f,d)}))},b.prototype._computeExtent=function(a,b,c){var d=b.accessor,e=b.scale;if(null==e)return[];var f=a.data();null!=c&&(f=f.filter(function(b,d){return c(b,d,a)}));var g=function(b,c){return d(b,c,a)},h=f.map(g);return e.extentOfValues(h)},b.prototype._extentsForProperty=function(a){return this._propertyExtents.get(a)},b.prototype._includedValuesForScale=function(a){var b=this;if(!this._isAnchored)return[];var c=[];return this._attrBindings.each(function(d,f){if(d.scale===a){var g=b._attrExtents.get(f);null!=g&&(c=c.concat(e.merge(g)))}}),this._propertyBindings.each(function(d,f){if(d.scale===a){var g=b._extentsForProperty(f);null!=g&&(c=c.concat(e.merge(g)))}}),c},b.prototype.animator=function(a,b){return void 0===b?this._animators[a]:(this._animators[a]=b,this)},b.prototype.renderer=function(a){var b=this;return void 0===a?null==this._canvas?"svg":"canvas":(null==this._canvas&&"canvas"===a?(this._canvas=e.select(document.createElement("canvas")).classed("plot-canvas",!0),null!=this.element()&&this.element().node().appendChild(this._canvas.node()),this._datasetToDrawer.forEach(function(a){null!=a.renderArea()&&a.renderArea().remove(),a.canvas(b._canvas)}),this.render()):null!=this._canvas&&"svg"==a&&(this._canvas.remove(),this._canvas=null,this._datasetToDrawer.forEach(function(a){a.renderArea(b._renderArea.append("g"))}),this.render()),this)},b.prototype.addDataset=function(a){return this._addDataset(a),this._onDatasetUpdate(),this},b.prototype._addDataset=function(a){this._removeDataset(a);var b=this._createDrawer(a);return this._datasetToDrawer.set(a,b),this._isSetup&&this._createNodesForDataset(a),a.onUpdate(this._onDatasetUpdateCallback),this},b.prototype.removeDataset=function(a){return this._removeDataset(a),this._onDatasetUpdate(),this},b.prototype._removeDataset=function(a){return this.datasets().indexOf(a)===-1?this:(this._removeDatasetNodes(a),a.offUpdate(this._onDatasetUpdateCallback),this._datasetToDrawer["delete"](a),this)},b.prototype._removeDatasetNodes=function(a){var b=this._datasetToDrawer.get(a);b.remove()},b.prototype.datasets=function(a){var b=this,c=[];return this._datasetToDrawer.forEach(function(a,b){return c.push(b)}),null==a?c:(c.forEach(function(a){return b._removeDataset(a)}),a.forEach(function(a){return b._addDataset(a)}),this._onDatasetUpdate(),this)},b.prototype._generateDrawSteps=function(){return[{attrToProjector:this._generateAttrToProjector(),animator:new f.Null}]},b.prototype._additionalPaint=function(a){},b.prototype._buildLightweightPlotEntities=function(a){var b=this,c=[];return a.forEach(function(a,d){var e=b._datasetToDrawer.get(a),f=0;a.data().forEach(function(g,h){var j=b._pixelPoint(g,h,a);if(!i.Math.isNaN(j.x)&&!i.Math.isNaN(j.y)){var k=b;c.push({datum:g,get position(){return k._pixelPoint.call(k,g,h,a)},index:h,dataset:a,datasetIndex:d,component:b,drawer:e,validDatumIndex:f}),f++}})}),c},b.prototype._getDataToDraw=function(){var a=new i.Map;return this.datasets().forEach(function(b){return a.set(b,b.data())}),a},b.prototype._paint=function(){var a=this,b=this._generateDrawSteps(),c=this._getDataToDraw(),d=this.datasets().map(function(b){return a._datasetToDrawer.get(b)});if("canvas"===this.renderer()){var e=this._canvas.node(),f=e.getContext("2d");f.clearRect(0,0,e.width,e.height)}this.datasets().forEach(function(a,e){return d[e].draw(c.get(a),b)});var g=this.datasets().map(function(a,e){return d[e].totalDrawTime(c.get(a),b)}),h=i.Math.max(g,0);this._additionalPaint(h)},b.prototype.selections=function(a){var b=this;if(void 0===a&&(a=this.datasets()),"canvas"===this.renderer())return null;var c=[];return a.forEach(function(a){var d=b._datasetToDrawer.get(a);null!=d&&d.renderArea().selectAll(d.selector()).each(function(){c.push(this)})}),e.selectAll(c)},b.prototype.entities=function(a){var b=this;return this._getEntityStore(a).map(function(a){return b._lightweightPlotEntityToPlotEntity(a)})},b.prototype._getEntityStore=function(a){var b=this;if(void 0!==a){var c=new i.EntityArray;return this._buildLightweightPlotEntities(a).forEach(function(a){c.add(a)}),c}return void 0===this._cachedEntityStore&&(this._cachedEntityStore=new i.EntityArray,this._buildLightweightPlotEntities(this.datasets()).forEach(function(a){b._cachedEntityStore.add(a)})),this._cachedEntityStore},b.prototype._lightweightPlotEntityToPlotEntity=function(a){var b={datum:a.datum,position:a.position,dataset:a.dataset,datasetIndex:a.datasetIndex,index:a.index,component:a.component,selection:a.drawer.selectionForIndex(a.validDatumIndex)};return b},b.prototype.entitiesAt=function(a){throw new Error("plots must implement entitiesAt")},b.prototype.entityNearest=function(a,b){var c=this;void 0===b&&(b=this.bounds());var d=this._getEntityStore().entityNearest(a,function(a){return c._entityVisibleOnPlot(a,b)});return void 0===d?void 0:this._lightweightPlotEntityToPlotEntity(d)},b.prototype._entityVisibleOnPlot=function(a,b){return!(a.position.xb.bottomRight.x||a.position.y>b.bottomRight.y)},b.prototype._uninstallScaleForKey=function(a,b){a.offUpdate(this._renderCallback),a.removeIncludedValuesProvider(this._includedValuesProvider)},b.prototype._installScaleForKey=function(a,b){a.onUpdate(this._renderCallback),a.addIncludedValuesProvider(this._includedValuesProvider)},b.prototype._propertyProjectors=function(){return{}},b._scaledAccessor=function(a){return null==a.scale?a.accessor:function(b,c,d){return a.scale.scale(a.accessor(b,c,d))}},b.prototype._pixelPoint=function(a,b,c){return{x:0,y:0}},b.prototype._animateOnNextRender=function(){return this._animate&&this._dataChanged},b}(g.Component);m._ANIMATION_MAX_DURATION=600,b.Plot=m},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}function e(a){return a instanceof h.QuantitativeScale||a instanceof g.Category}var f=c(93);b.TickGenerators=f,d(c(40)),d(c(89)),d(c(90)),d(c(91)),d(c(92)),d(c(94));var g=c(40),h=c(11);b.isTransformable=e},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(42)),d(c(45)),d(c(118)),d(c(19)),d(c(47)),d(c(49))},function(a,b,c){"use strict";var d=c(1),e=c(26),f=c(0),g=c(12),h=c(8);b.XAlignment=h.makeEnum(["left","center","right"]),b.YAlignment=h.makeEnum(["top","center","bottom"]);var i=function(){function a(){this._overflowHidden=!1,this._origin={x:0,y:0},this._xAlignment="left",this._yAlignment="top",this._isSetup=!1,this._isAnchored=!1,this._cssClasses=new f.Set,this._destroyed=!1,this._onAnchorCallbacks=new f.CallbackSet,this._onDetachCallbacks=new f.CallbackSet,this._cssClasses.add("component")}return a.prototype.anchor=function(a){if(a=g.coerceExternalD3(a),this._destroyed)throw new Error("Can't reuse destroy()-ed Components!");return this.isRoot()&&(this._rootElement=a,this._rootElement.classed("plottable",!0)),null!=this._element?a.node().appendChild(this._element.node()):(this._element=a.append("div"),this._setup()),this._isAnchored=!0,this._onAnchorCallbacks.callCallbacks(this),this},a.prototype.onAnchor=function(a){return this._isAnchored&&a(this),this._onAnchorCallbacks.add(a),this},a.prototype.offAnchor=function(a){return this._onAnchorCallbacks["delete"](a),this},a.prototype._setup=function(){var a=this;this._isSetup||(this._cssClasses.forEach(function(b){a._element.classed(b,!0)}),this._cssClasses=new f.Set,this._backgroundContainer=this._element.append("svg").classed("background-container",!0),this._content=this._element.append("svg").classed("content",!0),this._foregroundContainer=this._element.append("svg").classed("foreground-container",!0),this._overflowHidden?this._content.classed("component-overflow-hidden",!0):this._content.classed("component-overflow-visible",!0),this._isSetup=!0)},a.prototype.requestedSpace=function(a,b){return{minWidth:0,minHeight:0}},a.prototype.computeLayout=function(b,c,d){if(null==b||null==c||null==d){if(null==this._element)throw new Error("anchor() must be called before computeLayout()");if(null==this._rootElement)throw new Error("null arguments cannot be passed to computeLayout() on a non-root, unanchored node");b={x:0,y:0};var e=this._rootElement.node();c=f.DOM.elementWidth(e),d=f.DOM.elementHeight(e)}var g=this._sizeFromOffer(c,d);this._width=g.width,this._height=g.height;var h=a._xAlignToProportion[this._xAlignment],i=a._yAlignToProportion[this._yAlignment];return this._origin={x:b.x+(c-this.width())*h,y:b.y+(d-this.height())*i},this._element.styles({left:this._origin.x+"px",height:this.height()+"px",top:this._origin.y+"px",width:this.width()+"px"}),null!=this._resizeHandler&&this._resizeHandler(g),this},a.prototype._sizeFromOffer=function(a,b){var c=this.requestedSpace(a,b);return{width:this.fixedWidth()?Math.min(a,c.minWidth):a,height:this.fixedHeight()?Math.min(b,c.minHeight):b}},a.prototype.render=function(){return this._isAnchored&&this._isSetup&&this.width()>=0&&this.height()>=0&&e.registerToRender(this),this},a.prototype._scheduleComputeLayout=function(){this._isAnchored&&this._isSetup&&e.registerToComputeLayoutAndRender(this)},a.prototype.onResize=function(a){return this._resizeHandler=a,this},a.prototype.renderImmediately=function(){return this},a.prototype.redraw=function(){return this._isAnchored&&this._isSetup&&(this.isRoot()?this._scheduleComputeLayout():this.parent().redraw()),this},a.prototype.invalidateCache=function(){},a.prototype.renderTo=function(a){if(this.detach(),null!=a){var b=void 0;if(b="string"==typeof a?d.select(a):a instanceof Element?d.select(a):g.coerceExternalD3(a),!b.node()||null==b.node().nodeName)throw new Error("Plottable requires a valid Element to renderTo");if("svg"===b.node().nodeName)throw new Error("Plottable 3.x and later can only renderTo an HTML component; pass a div instead!");this.anchor(b)}if(null==this._element)throw new Error("If a Component has never been rendered before, then renderTo must be given a node to render to, or a d3.Selection, or a selector string");return e.registerToComputeLayoutAndRender(this),e.flush(),this},a.prototype.xAlignment=function(b){if(null==b)return this._xAlignment;if(b=b.toLowerCase(),null==a._xAlignToProportion[b])throw new Error("Unsupported alignment: "+b);return this._xAlignment=b,this.redraw(),this},a.prototype.yAlignment=function(b){if(null==b)return this._yAlignment;if(b=b.toLowerCase(),null==a._yAlignToProportion[b])throw new Error("Unsupported alignment: "+b);return this._yAlignment=b,this.redraw(),this},a.prototype.hasClass=function(a){return null!=a&&(null==this._element?this._cssClasses.has(a):this._element.classed(a))},a.prototype.addClass=function(a){return null==a?this:(null==this._element?this._cssClasses.add(a):this._element.classed(a,!0),this)},a.prototype.removeClass=function(a){return null==a?this:(null==this._element?this._cssClasses["delete"](a):this._element.classed(a,!1),this)},a.prototype.fixedWidth=function(){return!1},a.prototype.fixedHeight=function(){return!1},a.prototype.detach=function(){return this.parent(null),this._isAnchored&&this._element.remove(),this._isAnchored=!1,this._onDetachCallbacks.callCallbacks(this),this},a.prototype.onDetach=function(a){return this._onDetachCallbacks.add(a),this},a.prototype.offDetach=function(a){return this._onDetachCallbacks["delete"](a),this},a.prototype.parent=function(a){if(void 0===a)return this._parent;if(null!==a&&!a.has(this))throw new Error("Passed invalid parent");return this._parent=a,this},a.prototype.bounds=function(){var a=this.origin();return{topLeft:a,bottomRight:{x:a.x+this.width(),y:a.y+this.height()}}},a.prototype.destroy=function(){this._destroyed=!0,this.detach()},a.prototype.width=function(){return this._width},a.prototype.height=function(){return this._height},a.prototype.origin=function(){return{x:this._origin.x,y:this._origin.y}},a.prototype.originToRoot=function(){for(var a=this.origin(),b=this.parent();null!=b;){var c=b.origin();a.x+=c.x,a.y+=c.y,b=b.parent()}return a},a.prototype.root=function(){for(var a=this;!a.isRoot();)a=a.parent();return a},a.prototype.isRoot=function(){return null==this.parent()},a.prototype.foreground=function(){return this._foregroundContainer},a.prototype.content=function(){return this._content},a.prototype.element=function(){return this._element},a.prototype.rootElement=function(){return this.root()._rootElement},a.prototype.background=function(){return this._backgroundContainer},a}();i._xAlignToProportion={left:0,center:.5,right:1},i._yAlignToProportion={top:0,center:.5,bottom:1},b.Component=i},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(54)),d(c(55))},function(a,b,c){"use strict";var d=c(1),e=c(0),f=c(12),g=function(){function a(a){this._cachedSelectionValid=!1,this._dataset=a,this._svgElementName="path"}return a.prototype.canvas=function(a){return void 0===a?this._canvas:(a=f.coerceExternalD3(a),this._canvas=a,this._renderArea=null,this._cachedSelectionValid=!1,this)},a.prototype.renderArea=function(a){return void 0===a?this._renderArea:(a=f.coerceExternalD3(a),this._renderArea=a,this._canvas=null,this._cachedSelectionValid=!1,this)},a.prototype.remove=function(){null!=this.renderArea()&&this.renderArea().remove()},a.prototype._bindSelectionData=function(a){var b=this.selection().data(a),c=b.enter().append(this._svgElementName).merge(b);b.exit().remove(),this._applyDefaultAttributes(c)},a.prototype._applyDefaultAttributes=function(a){null!=this._className&&a.classed(this._className,!0)},a.prototype._drawStep=function(a){var b=this.selection(),c=["fill","stroke"];c.forEach(function(c){null!=a.attrToAppliedProjector[c]&&b.attr(c,a.attrToAppliedProjector[c])}),a.animator.animate(b,a.attrToAppliedProjector),null!=this._className&&this.selection().classed(this._className,!0)},a.prototype._drawStepCanvas=function(a,b){e.Window.warn("canvas rendering not yet implemented on "+this.constructor.name)},a.prototype._appliedProjectors=function(a){var b=this,c={};return Object.keys(a).forEach(function(d){c[d]=function(c,e){return a[d](c,e,b._dataset)}}),c},a.prototype.totalDrawTime=function(a,b){var c=0;return b.forEach(function(b,d){c+=b.animator.totalTime(a.length)}),c},a.prototype.draw=function(a,b){var c=this,d=b.map(function(a){var b=c._appliedProjectors(a.attrToProjector);return{attrToAppliedProjector:b,animator:a.animator}});if(null!=this._renderArea){this._bindSelectionData(a),this._cachedSelectionValid=!1;var f=0;d.forEach(function(b,d){e.Window.setTimeout(function(){return c._drawStep(b)},f),f+=b.animator.totalTime(a.length)})}else{if(null==this._canvas)throw new Error("Drawer's canvas and renderArea are both null!");var g=d[d.length-1];e.Window.setTimeout(function(){return c._drawStepCanvas(a,g)},0)}return this},a.prototype.selection=function(){return this.maybeRefreshCache(),this._cachedSelection},a.prototype.selector=function(){return this._svgElementName},a.prototype.selectionForIndex=function(a){return this.maybeRefreshCache(),null!=this._cachedSelectionNodes?d.select(this._cachedSelectionNodes[a]):null},a.prototype.maybeRefreshCache=function(){this._cachedSelectionValid||(null!=this._renderArea?(this._cachedSelection=this.renderArea().selectAll(this.selector()),this._cachedSelectionNodes=this._cachedSelection.nodes()):(this._cachedSelection=null,this._cachedSelectionNodes=null),this._cachedSelectionValid=!0)},a}();b.Drawer=g},function(a,b,c){"use strict";function d(a){return a.reduce(function(a,b){return a[b]=b,a},{})}b.makeEnum=d},function(a,b,c){"use strict";function d(a,b,c){void 0===a&&(a=2),void 0===b&&(b="$"),void 0===c&&(c=!0);var d=e(a);return function(a){var e=d(Math.abs(a));return""!==e&&(c?e=b+e:e+=b,a<0&&(e="-"+e)),e}}function e(a){return void 0===a&&(a=3),m(a),function(b){return b.toFixed(a)}}function f(a){return void 0===a&&(a=3),m(a),function(b){if("number"==typeof b){var c=Math.pow(10,a);return String(Math.round(b*c)/c)}return String(b)}}function g(){return function(a){return String(a)}}function h(a){void 0===a&&(a=0);var b=e(a);return function(a){var c=100*a,d=a.toString(),e=Math.pow(10,d.length-(d.indexOf(".")+1));return c=parseInt((c*e).toString(),10)/e,b(c)+"%"}}function i(a){return void 0===a&&(a=3),m(a),function(b){return n.format("."+a+"s")(b)}}function j(a){void 0===a&&(a=3),m(a);var b="KMBTQ",c=n.format("."+a+"e"),d=n.format("."+a+"f"),e=Math.pow(10,3*(b.length+1)),f=Math.pow(10,-a);return function(a){var g=Math.abs(a);if((g=e)&&0!==g)return c(a);for(var h=-1;g>=Math.pow(1e3,h+2)&&h0&&"1000"===i.substr(0,4)||a<0&&"-1000"===i.substr(0,5))&&(h0?c[0].specifier:"%Y";return n.timeFormat(d)(b)}}function l(a){return n.timeFormat(a)}function m(a){if(a<0||a>20)throw new RangeError("Formatter precision must be between 0 and 20");if(a!==Math.floor(a))throw new RangeError("Formatter precision must be an integer")}var n=c(1);b.currency=d,b.fixed=e,b.general=f,b.identity=g,b.percentage=h,b.siSuffix=i,b.shortScale=j,b.multiTime=k,b.time=l},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(70)),d(c(71)),d(c(72)),d(c(73)),d(c(74)),d(c(75)),d(c(76))},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(14),g=c(0),h=c(18),i=function(a){function b(){var b=a.call(this)||this;return b._tickGenerator=function(a){return a.defaultTicks()},b._padProportion=.05,b._snappingDomainEnabled=!0,b._paddingExceptionsProviders=new g.Set,b}return d(b,a),b.prototype.autoDomain=function(){return this._domainMin=null,this._domainMax=null,a.prototype.autoDomain.call(this),this},b.prototype._autoDomainIfAutomaticMode=function(){if(null!=this._domainMin&&null!=this._domainMax)return void this._setDomain([this._domainMin,this._domainMax]);var b=this._getExtent();if(null!=this._domainMin){var c=b[1];return this._domainMin>=c&&(c=this._expandSingleValueDomain([this._domainMin,this._domainMin])[1]),void this._setDomain([this._domainMin,c])}if(null!=this._domainMax){var d=b[0];return this._domainMax<=d&&(d=this._expandSingleValueDomain([this._domainMax,this._domainMax])[0]),void this._setDomain([d,this._domainMax])}a.prototype._autoDomainIfAutomaticMode.call(this)},b.prototype._getExtent=function(){var a=this._getAllIncludedValues(),b=this._defaultExtent();if(0!==a.length){var c=[g.Math.min(a,b[0]),g.Math.max(a,b[1])];b=this._padDomain(c)}return null!=this._domainMin&&(b[0]=this._domainMin),null!=this._domainMax&&(b[1]=this._domainMax),b},b.prototype.addPaddingExceptionsProvider=function(a){return this._paddingExceptionsProviders.add(a),this._autoDomainIfAutomaticMode(),this},b.prototype.removePaddingExceptionsProvider=function(a){return this._paddingExceptionsProviders["delete"](a),this._autoDomainIfAutomaticMode(),this},b.prototype.padProportion=function(a){if(null==a)return this._padProportion;if(a<0)throw new Error("padProportion must be non-negative");return this._padProportion=a,this._autoDomainIfAutomaticMode(),this},b.prototype._padDomain=function(a){var b=this;if(a[0].valueOf()===a[1].valueOf())return this._expandSingleValueDomain(a);if(0===this._padProportion)return a;var c=this._padProportion/2,d=a[0],e=a[1],f=!1,g=!1;this._paddingExceptionsProviders.forEach(function(a){var c=a(b);c.forEach(function(a){a.valueOf()===d.valueOf()&&(f=!0),a.valueOf()===e.valueOf()&&(g=!0)})});var h=this._backingScaleDomain();this._backingScaleDomain(a);var i=f?d:this.invert(this.scale(d)-(this.scale(e)-this.scale(d))*c),j=g?e:this.invert(this.scale(e)+(this.scale(e)-this.scale(d))*c);return this._backingScaleDomain(h),this._snappingDomainEnabled?this._niceDomain([i,j]):[i,j]},b.prototype.snappingDomainEnabled=function(a){return null==a?this._snappingDomainEnabled:(this._snappingDomainEnabled=a,this._autoDomainIfAutomaticMode(),this)},b.prototype._expandSingleValueDomain=function(a){return a},b.prototype.invert=function(a){throw new Error("Subclasses should override invert")},b.prototype.domain=function(b){return null!=b&&(this._domainMin=b[0],this._domainMax=b[1]),a.prototype.domain.call(this,b)},b.prototype.domainMin=function(a){return null==a?this.domain()[0]:(this._domainMin=a,this._autoDomainIfAutomaticMode(),this)},b.prototype.domainMax=function(a){return null==a?this.domain()[1]:(this._domainMax=a,this._autoDomainIfAutomaticMode(),this)},b.prototype.extentOfValues=function(a){var b=e.extent(a.filter(function(a){return g.Math.isValidNumber(+a)}));return null==b[0]||null==b[1]?[]:b},b.prototype.zoom=function(a,b){var c=this,d=function(d){return c.invert(f.zoomAt(d,a,b))};this.domain(this.range().map(d))},b.prototype.pan=function(a){var b=this,c=function(c){return b.invert(c+a)};this.domain(this.range().map(c))},b.prototype.scaleTransformation=function(a){throw new Error("Subclasses should override scaleTransformation")},b.prototype.invertedTransformation=function(a){throw new Error("Subclasses should override invertedTransformation")},b.prototype.getTransformationDomain=function(){throw new Error("Subclasses should override getTransformationDomain")},b.prototype._setDomain=function(b){var c=function(a){return g.Math.isNaN(a)||a===1/0||a===-(1/0)};return c(b[0])||c(b[1])?void g.Window.warn("Warning: QuantitativeScales cannot take NaN or Infinity as a domain value. Ignoring."):void a.prototype._setDomain.call(this,b)},b.prototype.defaultTicks=function(){throw new Error("Subclasses should override _getDefaultTicks")},b.prototype.ticks=function(){return this._tickGenerator(this)},b.prototype._niceDomain=function(a,b){throw new Error("Subclasses should override _niceDomain")},b.prototype._defaultExtent=function(){throw new Error("Subclasses should override _defaultExtent")},b.prototype.tickGenerator=function(a){return null==a?this._tickGenerator:(this._tickGenerator=a,this)},b}(h.Scale);i._DEFAULT_NUM_TICKS=10,b.QuantitativeScale=i},function(a,b,c){"use strict";function d(a){if(null==a.attrs){if(null==a.nodes){var b=[];return a.each(function(){b.push(this)}),e.selectAll(b)}return e.selectAll(a.nodes())}return a}var e=c(1);b.coerceExternalD3=d},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(67)),d(c(68)),d(c(69))},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(77)),d(c(78)),d(c(33)),d(c(79)),d(c(80))},function(a,b,c){"use strict";var d=function(){function a(){var a=this;this._anchorCallback=function(b){return a._anchor(b)},this._enabled=!0}return a.prototype._anchor=function(a){this._isAnchored=!0},a.prototype._unanchor=function(){this._isAnchored=!1},a.prototype.attachTo=function(a){return this._disconnect(),this._componentAttachedTo=a,this._connect(),this},a.prototype._connect=function(){this.enabled()&&null!=this._componentAttachedTo&&!this._isAnchored&&this._componentAttachedTo.onAnchor(this._anchorCallback)},a.prototype.detachFrom=function(a){return this._disconnect(),this._componentAttachedTo=null,this},a.prototype._disconnect=function(){this._isAnchored&&this._unanchor(),null!=this._componentAttachedTo&&this._componentAttachedTo.offAnchor(this._anchorCallback)},a.prototype.enabled=function(a){return null==a?this._enabled:(this._enabled=a,this._enabled?this._connect():this._disconnect(),this)},a.prototype._translateToComponentSpace=function(a){var b=this._componentAttachedTo.originToRoot();return{x:a.x-b.x,y:a.y-b.y}},a.prototype._isInsideComponent=function(a){return 0<=a.x&&0<=a.y&&a.x<=this._componentAttachedTo.width()&&a.y<=this._componentAttachedTo.height()},a}();b.Interaction=d},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(3),f=c(0),g=c(2),h=function(a){function b(){var b=a.call(this)||this;b._autoAdjustXScaleDomain=!1,b._autoAdjustYScaleDomain=!1,b._deferredRendering=!1,b._cachedDomainX=[null,null],b._cachedDomainY=[null,null],b.addClass("xy-plot"),b._adjustYDomainOnChangeFromXCallback=function(a){return b._adjustYDomainOnChangeFromX()},b._adjustXDomainOnChangeFromYCallback=function(a){return b._adjustXDomainOnChangeFromY()};var c=0,d=0,e=1,f=1,g=[null,null],h=[null,null],i=0,j=500,k=function(){null!=b._renderArea&&(b._renderArea.attr("transform","translate("+c+", "+d+")scale("+e+", "+f+")"),clearTimeout(i),i=setTimeout(function(){b._cachedDomainX=g,b._cachedDomainY=h,c=0,d=0,e=1,f=1,b.render(),b._renderArea.attr("transform","translate(0, 0) scale(1, 1)")},j))},l=function(a){b._isAnchored&&(g=a.domain(),e=(a.scale(b._cachedDomainX[1])-a.scale(b._cachedDomainX[0]))/(a.scale(g[1])-a.scale(g[0]))||1,c=a.scale(b._cachedDomainX[0])-a.scale(g[0])||0,k())},m=function(a){b._isAnchored&&(h=a.domain(),f=(a.scale(b._cachedDomainY[1])-a.scale(b._cachedDomainY[0]))/(a.scale(h[1])-a.scale(h[0]))||1,d=a.scale(b._cachedDomainY[0])-a.scale(h[0])*f||0,k())};return b._renderCallback=function(a){b.deferredRendering()&&b.x()&&b.x().scale===a?l(a):b.deferredRendering()&&b.y()&&b.y().scale===a?m(a):b.render()},b}return d(b,a),b.prototype.deferredRendering=function(a){return null==a?this._deferredRendering:(a&&this._isAnchored&&(this.x()&&this.x().scale&&(this._cachedDomainX=this.x().scale.domain()),this.y()&&this.y().scale&&(this._cachedDomainY=this.y().scale.domain())),this._deferredRendering=a,this)},b.prototype.x=function(a,c){if(null==a)return this._propertyBindings.get(b._X_KEY);this._bindProperty(b._X_KEY,a,c);var d=this.width();return null!=c&&null!=d&&c.range([0,d]),this._autoAdjustYScaleDomain&&this._updateYExtentsAndAutodomain(), +this.render(),this},b.prototype.y=function(a,c){if(null==a)return this._propertyBindings.get(b._Y_KEY);this._bindProperty(b._Y_KEY,a,c);var d=this.height();return null!=c&&null!=d&&(c instanceof e.Category?c.range([0,d]):c.range([d,0])),this._autoAdjustXScaleDomain&&this._updateXExtentsAndAutodomain(),this.render(),this},b.prototype._filterForProperty=function(a){return"x"===a&&this._autoAdjustXScaleDomain?this._makeFilterByProperty("y"):"y"===a&&this._autoAdjustYScaleDomain?this._makeFilterByProperty("x"):null},b.prototype._makeFilterByProperty=function(a){var b=this._propertyBindings.get(a);if(null!=b){var c=b.accessor,d=b.scale;if(null!=d)return function(a,b,e){var g=d.range();return f.Math.inRange(d.scale(c(a,b,e)),g[0],g[1])}}return null},b.prototype._uninstallScaleForKey=function(c,d){a.prototype._uninstallScaleForKey.call(this,c,d);var e=d===b._X_KEY?this._adjustYDomainOnChangeFromXCallback:this._adjustXDomainOnChangeFromYCallback;c.offUpdate(e)},b.prototype._installScaleForKey=function(c,d){a.prototype._installScaleForKey.call(this,c,d);var e=d===b._X_KEY?this._adjustYDomainOnChangeFromXCallback:this._adjustXDomainOnChangeFromYCallback;c.onUpdate(e)},b.prototype.destroy=function(){return a.prototype.destroy.call(this),this.x().scale&&this.x().scale.offUpdate(this._adjustYDomainOnChangeFromXCallback),this.y().scale&&this.y().scale.offUpdate(this._adjustXDomainOnChangeFromYCallback),this},b.prototype.autorangeMode=function(a){if(null==a)return this._autoAdjustXScaleDomain?"x":this._autoAdjustYScaleDomain?"y":"none";switch(a){case"x":this._autoAdjustXScaleDomain=!0,this._autoAdjustYScaleDomain=!1,this._adjustXDomainOnChangeFromY();break;case"y":this._autoAdjustXScaleDomain=!1,this._autoAdjustYScaleDomain=!0,this._adjustYDomainOnChangeFromX();break;case"none":this._autoAdjustXScaleDomain=!1,this._autoAdjustYScaleDomain=!1;break;default:throw new Error("Invalid scale name '"+a+"', must be 'x', 'y' or 'none'")}return this},b.prototype.computeLayout=function(b,c,d){a.prototype.computeLayout.call(this,b,c,d);var f=this.x(),g=f&&f.scale;null!=g&&g.range([0,this.width()]);var h=this.y(),i=h&&h.scale;return null!=i&&(i instanceof e.Category?i.range([0,this.height()]):i.range([this.height(),0])),this},b.prototype._updateXExtentsAndAutodomain=function(){this._updateExtentsForProperty("x");var a=this.x().scale;null!=a&&a.autoDomain()},b.prototype._updateYExtentsAndAutodomain=function(){this._updateExtentsForProperty("y");var a=this.y().scale;null!=a&&a.autoDomain()},b.prototype.showAllData=function(){return this._updateXExtentsAndAutodomain(),this._updateYExtentsAndAutodomain(),this},b.prototype._adjustYDomainOnChangeFromX=function(){this._projectorsReady()&&this._autoAdjustYScaleDomain&&this._updateYExtentsAndAutodomain()},b.prototype._adjustXDomainOnChangeFromY=function(){this._projectorsReady()&&this._autoAdjustXScaleDomain&&this._updateXExtentsAndAutodomain()},b.prototype._projectorsReady=function(){var a=this.x(),b=this.y();return null!=a&&null!=a.accessor&&null!=b&&null!=b.accessor},b.prototype._pixelPoint=function(a,b,c){var d=g.Plot._scaledAccessor(this.x()),e=g.Plot._scaledAccessor(this.y());return{x:d(a,b,c),y:e(a,b,c)}},b.prototype._getDataToDraw=function(){var b=this,c=a.prototype._getDataToDraw.call(this),d=function(a,c,d){var e=g.Plot._scaledAccessor(b.x())(a,c,d),h=g.Plot._scaledAccessor(b.y())(a,c,d);return f.Math.isValidNumber(e)&&f.Math.isValidNumber(h)};return this.datasets().forEach(function(a){c.set(a,c.get(a).filter(function(b,c){return d(b,c,a)}))}),c},b}(g.Plot);h._X_KEY="x",h._Y_KEY="y",b.XYPlot=h},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(37)),d(c(23)),d(c(38)),d(c(81)),d(c(39)),d(c(82)),d(c(83)),d(c(84)),d(c(85)),d(c(86)),d(c(87)),d(c(88))},function(a,b,c){"use strict";var d=c(0),e=function(){function a(){this._autoDomainAutomatically=!0,this._domainModificationInProgress=!1,this._callbacks=new d.CallbackSet,this._includedValuesProviders=new d.Set}return a.prototype.extentOfValues=function(a){return[]},a.prototype._getAllIncludedValues=function(){var a=this,b=[];return this._includedValuesProviders.forEach(function(c){var d=c(a);b=b.concat(d)}),b},a.prototype._getExtent=function(){return[]},a.prototype.onUpdate=function(a){return this._callbacks.add(a),this},a.prototype.offUpdate=function(a){return this._callbacks["delete"](a),this},a.prototype._dispatchUpdate=function(){this._callbacks.callCallbacks(this)},a.prototype.autoDomain=function(){return this._autoDomainAutomatically=!0,this._setDomain(this._getExtent()),this},a.prototype._autoDomainIfAutomaticMode=function(){this._autoDomainAutomatically&&this.autoDomain()},a.prototype.scale=function(a){throw new Error("Subclasses should override scale")},a.prototype.domain=function(a){return null==a?this._getDomain():(this._autoDomainAutomatically=!1,this._setDomain(a),this)},a.prototype._getDomain=function(){throw new Error("Subclasses should override _getDomain")},a.prototype._setDomain=function(a){this._domainModificationInProgress||(this._domainModificationInProgress=!0,this._backingScaleDomain(a),this._dispatchUpdate(),this._domainModificationInProgress=!1)},a.prototype._backingScaleDomain=function(a){throw new Error("Subclasses should override _backingDomain")},a.prototype.range=function(a){return null==a?this._getRange():(this._setRange(a),this)},a.prototype._getRange=function(){throw new Error("Subclasses should override _getRange")},a.prototype._setRange=function(a){throw new Error("Subclasses should override _setRange")},a.prototype.addIncludedValuesProvider=function(a){return this._includedValuesProviders.add(a),this._autoDomainIfAutomaticMode(),this},a.prototype.removeIncludedValuesProvider=function(a){return this._includedValuesProviders["delete"](a),this._autoDomainIfAutomaticMode(),this},a}();b.Scale=e},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(119)),d(c(120)),d(c(121)),d(c(122))},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(4),g=c(5),h=c(9),i=c(0),j=c(8);b.AxisOrientation=j.makeEnum(["bottom","left","right","top"]);var k=function(a){function b(b,c){var d=a.call(this)||this;if(d._endTickLength=5,d._innerTickLength=5,d._tickLabelPadding=10,d._margin=15,d._showEndTickLabels=!1,d._annotationsEnabled=!1,d._annotationTierCount=1,null==b||null==c)throw new Error("Axis requires a scale and orientation");return d._scale=b,d.orientation(c),d._setDefaultAlignment(),d.addClass("axis"),d.isHorizontal()?d.addClass("x-axis"):d.addClass("y-axis"),d.formatter(h.identity()),d._rescaleCallback=function(a){return d._rescale()},d._scale.onUpdate(d._rescaleCallback),d._annotatedTicks=[],d._annotationFormatter=h.identity(),d}return d(b,a),b.prototype.destroy=function(){a.prototype.destroy.call(this),this._scale.offUpdate(this._rescaleCallback)},b.prototype._computeWidth=function(){return this._maxLabelTickLength()},b.prototype._computeHeight=function(){return this._maxLabelTickLength()},b.prototype.requestedSpace=function(a,c){var d=0,e=0;if(this.isHorizontal()){if(e=this._computeHeight()+this._margin,this.annotationsEnabled()){var f=this._annotationMeasurer.measure().height+2*b._ANNOTATION_LABEL_PADDING;e+=f*this.annotationTierCount()}}else if(d=this._computeWidth()+this._margin,this.annotationsEnabled()){var f=this._annotationMeasurer.measure().height+2*b._ANNOTATION_LABEL_PADDING;d+=f*this.annotationTierCount()}return{minWidth:d,minHeight:e}},b.prototype.fixedHeight=function(){return this.isHorizontal()},b.prototype.fixedWidth=function(){return!this.isHorizontal()},b.prototype._rescale=function(){this.render()},b.prototype.computeLayout=function(b,c,d){return a.prototype.computeLayout.call(this,b,c,d),this.isHorizontal()?this._scale.range([0,this.width()]):this._scale.range([this.height(),0]),this},b.prototype._setup=function(){a.prototype._setup.call(this),this._tickMarkContainer=this.content().append("g").classed(b.TICK_MARK_CLASS+"-container",!0),this._tickLabelContainer=this.content().append("g").classed(b.TICK_LABEL_CLASS+"-container",!0),this._baseline=this.content().append("line").classed("baseline",!0),this._annotationContainer=this.content().append("g").classed("annotation-container",!0),this._annotationContainer.append("g").classed("annotation-line-container",!0),this._annotationContainer.append("g").classed("annotation-circle-container",!0),this._annotationContainer.append("g").classed("annotation-rect-container",!0);var c=this._annotationContainer.append("g").classed("annotation-label-container",!0),d=new f.SvgContext(c.node());this._annotationMeasurer=new f.CacheMeasurer(d),this._annotationWriter=new f.Writer(this._annotationMeasurer,d)},b.prototype._getTickValues=function(){return[]},b.prototype.renderImmediately=function(){var a=this._getTickValues(),c=this._tickMarkContainer.selectAll("."+b.TICK_MARK_CLASS).data(a),d=c.enter().append("line").classed(b.TICK_MARK_CLASS,!0).merge(c);return d.attrs(this._generateTickMarkAttrHash()),e.select(d.nodes()[0]).classed(b.END_TICK_MARK_CLASS,!0).attrs(this._generateTickMarkAttrHash(!0)),e.select(d.nodes()[a.length-1]).classed(b.END_TICK_MARK_CLASS,!0).attrs(this._generateTickMarkAttrHash(!0)),c.exit().remove(),this._baseline.attrs(this._generateBaselineAttrHash()),this.annotationsEnabled()?this._drawAnnotations():this._removeAnnotations(),this},b.prototype.annotatedTicks=function(a){return null==a?this._annotatedTicks:(this._annotatedTicks=a,this.render(),this)},b.prototype.annotationFormatter=function(a){return null==a?this._annotationFormatter:(this._annotationFormatter=a,this.render(),this)},b.prototype.annotationsEnabled=function(a){return null==a?this._annotationsEnabled:(this._annotationsEnabled=a,this.redraw(),this)},b.prototype.annotationTierCount=function(a){if(null==a)return this._annotationTierCount;if(a<0)throw new Error("annotationTierCount cannot be negative");return this._annotationTierCount=a,this.redraw(),this},b.prototype._drawAnnotations=function(){var a=this,c=b._ANNOTATION_LABEL_PADDING,d=new i.Map,f=this._annotatedTicksToRender();f.forEach(function(b){var e=a._annotationMeasurer.measure(a.annotationFormatter()(b)),f={width:e.width+2*c,height:e.height+2*c};d.set(b,f)});var g=this._annotationMeasurer.measure().height+2*c,h=this._annotationToTier(d),j=new i.Set,k=this.isHorizontal()?this.height():this.width(),l=this._coreSize(),m=Math.min(this.annotationTierCount(),Math.floor((k-l)/g));h.forEach(function(a,b){(a===-1||a>=m)&&j.add(b)});var n,o=function(a,b,c){var d=a.selectAll("."+c).data(f),e=d.enter().append(b).classed(c,!0).merge(d);return d.exit().remove(),e},p=function(b){switch(a.orientation()){case"bottom":case"right":return h.get(b)*g+l;case"top":case"left":return k-l-h.get(b)*g}},q=function(b){return a._scale.scale(b)},r=function(a){return j.has(a)?"hidden":"visible"};switch(this.orientation()){case"bottom":case"right":n=0;break;case"top":n=this.height();break;case"left":n=this.width()}var s=this.isHorizontal();o(this._annotationContainer.select(".annotation-line-container"),"line",b.ANNOTATION_LINE_CLASS).attrs({x1:s?q:n,x2:s?q:p,y1:s?n:q,y2:s?p:q,visibility:r}),o(this._annotationContainer.select(".annotation-circle-container"),"circle",b.ANNOTATION_CIRCLE_CLASS).attrs({cx:s?q:n,cy:s?n:q,r:3});var t=function(b){switch(a.orientation()){case"bottom":case"right":return p(b);case"top":case"left":return p(b)-d.get(b).height}};o(this._annotationContainer.select(".annotation-rect-container"),"rect",b.ANNOTATION_RECT_CLASS).attrs({x:s?q:t,y:s?t:q,width:s?function(a){return d.get(a).width}:function(a){return d.get(a).height},height:s?function(a){return d.get(a).height}:function(a){return d.get(a).width},visibility:r});var u=this._annotationWriter,v=this.annotationFormatter(),w=o(this._annotationContainer.select(".annotation-label-container"),"g",b.ANNOTATION_LABEL_CLASS);w.selectAll(".text-container").remove(),w.attrs({transform:function(a){var b=s?q(a):t(a),c=s?t(a):q(a);return"translate("+b+","+c+")"},visibility:r}).each(function(a){u.write(v(a),s?d.get(a).width:d.get(a).height,s?d.get(a).height:d.get(a).width,{xAlign:"center",yAlign:"center",textRotation:s?0:90},e.select(this).node())})},b.prototype._annotatedTicksToRender=function(){var a=this,b=this._scale.range();return i.Array.uniq(this.annotatedTicks().filter(function(c){return null!=c&&i.Math.inRange(a._scale.scale(c),b[0],b[1])}))},b.prototype._coreSize=function(){var a=this.isHorizontal()?this.height():this.width(),b=this.isHorizontal()?this._computeHeight():this._computeWidth();return Math.min(b,a)},b.prototype._annotationTierHeight=function(){return this._annotationMeasurer.measure().height+2*b._ANNOTATION_LABEL_PADDING},b.prototype._annotationToTier=function(a){var b=this,c=[[]],d=new i.Map,e=this.isHorizontal()?this.width():this.height();return this._annotatedTicksToRender().forEach(function(f){var g=b._scale.scale(f),h=a.get(f).width;if(g<0||g+h>e)return void d.set(f,-1);for(var i=function(d){return c[d].some(function(c){var d=b._scale.scale(c),e=a.get(c).width;return g+h>=d&&g<=d+e})},j=0;i(j);)j++,c.length===j&&c.push([]);c[j].push(f),d.set(f,j)}),d},b.prototype._removeAnnotations=function(){this._annotationContainer.selectAll(".annotation-line").remove(),this._annotationContainer.selectAll(".annotation-circle").remove(),this._annotationContainer.selectAll(".annotation-rect").remove(),this._annotationContainer.selectAll(".annotation-label").remove()},b.prototype._generateBaselineAttrHash=function(){var a={x1:0,y1:0,x2:0,y2:0};switch(this._orientation){case"bottom":a.x2=this.width();break;case"top":a.x2=this.width(),a.y1=this.height(),a.y2=this.height();break;case"left":a.x1=this.width(),a.x2=this.width(),a.y2=this.height();break;case"right":a.y2=this.height()}return a},b.prototype._generateTickMarkAttrHash=function(a){var b=this;void 0===a&&(a=!1);var c={x1:0,y1:0,x2:0,y2:0},d=function(a){return b._scale.scale(a)};this.isHorizontal()?(c.x1=d,c.x2=d):(c.y1=d,c.y2=d);var e=a?this._endTickLength:this._innerTickLength;switch(this._orientation){case"bottom":c.y2=e;break;case"top":c.y1=this.height(),c.y2=this.height()-e;break;case"left":c.x1=this.width(),c.x2=this.width()-e;break;case"right":c.x2=e}return c},b.prototype._setDefaultAlignment=function(){switch(this._orientation){case"bottom":this.yAlignment("top");break;case"top":this.yAlignment("bottom");break;case"left":this.xAlignment("right");break;case"right":this.xAlignment("left")}},b.prototype.isHorizontal=function(){return"top"===this._orientation||"bottom"===this._orientation},b.prototype.getScale=function(){return this._scale},b.prototype.formatter=function(a){return null==a?this._formatter:(this._formatter=a,this.redraw(),this)},b.prototype.innerTickLength=function(a){if(null==a)return this._innerTickLength;if(a<0)throw new Error("inner tick length must be positive");return this._innerTickLength=a,this.redraw(),this},b.prototype.endTickLength=function(a){if(null==a)return this._endTickLength;if(a<0)throw new Error("end tick length must be positive");return this._endTickLength=a,this.redraw(),this},b.prototype._maxLabelTickLength=function(){return this.showEndTickLabels()?Math.max(this.innerTickLength(),this.endTickLength()):this.innerTickLength()},b.prototype.tickLabelPadding=function(a){if(null==a)return this._tickLabelPadding;if(a<0)throw new Error("tick label padding must be positive");return this._tickLabelPadding=a,this.redraw(),this},b.prototype.margin=function(a){if(null==a)return this._margin;if(a<0)throw new Error("margin size must be positive");return this._margin=a,this.redraw(),this},b.prototype.orientation=function(a){if(null==a)return this._orientation;var b=a.toLowerCase();if("top"!==b&&"bottom"!==b&&"left"!==b&&"right"!==b)throw new Error("unsupported orientation");return this._orientation=b,this.redraw(),this},b.prototype.showEndTickLabels=function(a){return null==a?this._showEndTickLabels:(this._showEndTickLabels=a,this.render(),this)},b.prototype._showAllTickMarks=function(){this._tickMarkContainer.selectAll("."+b.TICK_MARK_CLASS).each(function(){e.select(this).style("visibility","inherit")})},b.prototype._showAllTickLabels=function(){this._tickLabelContainer.selectAll("."+b.TICK_LABEL_CLASS).each(function(){e.select(this).style("visibility","inherit")})},b.prototype._hideOverflowingTickLabels=function(){var a=this.element().node().getBoundingClientRect(),c=this._tickLabelContainer.selectAll("."+b.TICK_LABEL_CLASS);c.empty()||c.each(function(b,c){i.DOM.clientRectInside(this.getBoundingClientRect(),a)||e.select(this).style("visibility","hidden")})},b.prototype._hideTickMarksWithoutLabel=function(){var a=this._tickMarkContainer.selectAll("."+b.TICK_MARK_CLASS),c=this._tickLabelContainer.selectAll("."+b.TICK_LABEL_CLASS).filter(function(a,b){var c=e.select(this).style("visibility");return"inherit"===c||"visible"===c}),d=c.data();a.each(function(a,b){d.indexOf(a)===-1&&e.select(this).style("visibility","hidden")})},b.prototype.invalidateCache=function(){a.prototype.invalidateCache.call(this),this._annotationMeasurer.reset()},b}(g.Component);k.END_TICK_MARK_CLASS="end-tick-mark",k.TICK_MARK_CLASS="tick-mark",k.TICK_LABEL_CLASS="tick-label",k.ANNOTATION_LINE_CLASS="annotation-line",k.ANNOTATION_RECT_CLASS="annotation-rect",k.ANNOTATION_CIRCLE_CLASS="annotation-circle",k.ANNOTATION_LABEL_CLASS="annotation-label",k._ANNOTATION_LABEL_PADDING=4,b.Axis=k},function(a,b,c){"use strict";b.SHOW_WARNINGS=!0,b.ADD_TITLE_ELEMENTS=!0},function(a,b,c){"use strict";var d=c(0),e=function(){function a(){this._eventToProcessingFunction={},this._eventNameToCallbackSet={},this._connected=!1}return a.prototype._hasNoCallbacks=function(){for(var a=Object.keys(this._eventNameToCallbackSet),b=0;b=q-h&&g<=r+h)m=0;else{var s=c._isVertical?n.y:n.x;m=Math.abs(g-s)}}(kd.height()?B=d.height()-A:A<0&&(B=A+r);var C=b._LABEL_PADDING;j=t.height+2*C<=B,j?od.width()?E=d.width()-D:D<0&&(E=D+q);var C=b._LABEL_PADDING;j=t.width+2*C<=E,j?od.width()||z.y+t.height>d.height();F.style("visibility",I?"hidden":"inherit");var J={xAlign:u,yAlign:v};i.write(s,x,y,J,F.node());var K=d._isVertical?qf?f:d},b},b.prototype._getBarPixelWidth=function(){if(!this._projectorsReady())return 0;var a,c=this._isVertical?this.x().scale:this.y().scale;if(c instanceof j.Category)a=c.rangeBand();else{var d=this._isVertical?this.x().accessor:this.y().accessor,f=e.set(l.Array.flatten(this.datasets().map(function(a){return a.data().map(function(b,c){return d(b,c,a)}).filter(function(a){return null!=a}).map(function(a){return a.valueOf()})}))).values().map(function(a){return+a});f.sort(function(a,b){return a-b});var g=f.map(function(a){return c.scale(a)}),h=e.pairs(g),i=this._isVertical?this.width():this.height();a=l.Math.min(h,function(a,b){return Math.abs(a[1]-a[0])},i*b._SINGLE_BAR_DIMENSION_RATIO),a*=b._BAR_WIDTH_RATIO}return a},b.prototype._updateBarPixelWidth=function(){this._barPixelWidth=this._getBarPixelWidth()},b.prototype.entities=function(b){if(void 0===b&&(b=this.datasets()),!this._projectorsReady())return[];var c=a.prototype.entities.call(this,b);return c},b.prototype._pixelPoint=function(a,b,c){var d,e,f=this._generateAttrToProjector(),g=f.x(a,b,c),h=f.y(a,b,c),i=f.width(a,b,c),j=f.height(a,b,c),k=(this._isVertical?o.Plot._scaledAccessor(this.y()):o.Plot._scaledAccessor(this.x()))(a,b,c),l=(this._isVertical?this.y().scale:this.x().scale).scale(this.baselineValue());return this._isVertical?(d=g+i/2,e=k<=l?h:h+j):(d=k>=l?g+i:g,e=h+j/2),{x:d,y:e}},b.prototype._uninstallScaleForKey=function(b,c){b.offUpdate(this._updateBarPixelWidthCallback),a.prototype._uninstallScaleForKey.call(this,b,c)},b.prototype._getDataToDraw=function(){var a=new l.Map,b=this._generateAttrToProjector();return this.datasets().forEach(function(c){var d=c.data().filter(function(a,d){return l.Math.isValidNumber(b.x(a,d,c))&&l.Math.isValidNumber(b.y(a,d,c))&&l.Math.isValidNumber(b.width(a,d,c))&&l.Math.isValidNumber(b.height(a,d,c))});a.set(c,d)}),a},b}(p.XYPlot);q._BAR_WIDTH_RATIO=.95,q._SINGLE_BAR_DIMENSION_RATIO=.4,q._BAR_AREA_CLASS="bar-area",q._LABEL_AREA_CLASS="bar-label-text-area",q._LABEL_PADDING=10,b.Bar=q},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(4),g=c(9),h=c(3),i=c(0),j=c(8),k=c(20);b.TimeInterval=j.makeEnum(["second","minute","hour","day","week","month","year"]),b.TimeAxisOrientation=j.makeEnum(["top","bottom"]),b.TierLabelPosition=j.makeEnum(["between","center"]);var l=function(a){function b(c,d){var e=a.call(this,c,d)||this;return e._maxTimeIntervalPrecision=null,e._tierLabelPositions=[],e.addClass("time-axis"),e.tickLabelPadding(5),e.axisConfigurations(b._DEFAULT_TIME_AXIS_CONFIGURATIONS),e.annotationFormatter(g.time("%a %b %d, %Y")),e}return d(b,a),b.prototype.tierLabelPositions=function(a){if(null==a)return this._tierLabelPositions;if(!a.every(function(a){return"between"===a.toLowerCase()||"center"===a.toLowerCase()}))throw new Error("Unsupported position for tier labels");return this._tierLabelPositions=a,this.redraw(),this},b.prototype.maxTimeIntervalPrecision=function(a){return null==a?this._maxTimeIntervalPrecision:(this._maxTimeIntervalPrecision=a,this.redraw(),this)},b.prototype.currentAxisConfiguration=function(){return this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex]},b.prototype.axisConfigurations=function(a){if(null==a)return this._possibleTimeAxisConfigurations;this._possibleTimeAxisConfigurations=a,this._numTiers=i.Math.max(this._possibleTimeAxisConfigurations.map(function(a){ +return a.length}),0),this._isAnchored&&this._setupDomElements();for(var b=this.tierLabelPositions(),c=[],d=0;dthis._scale.domain()[1])return this.width();var e=Math.abs(this._scale.scale(d)-this._scale.scale(b));return e},b.prototype._maxWidthForInterval=function(a){return this._measurer.measure(a.formatter(b._LONG_DATE)).width},b.prototype._checkTimeAxisTierConfiguration=function(a){if(null!=this._maxTimeIntervalPrecision){var c=b._SORTED_TIME_INTERVAL_INDEX[this._maxTimeIntervalPrecision],d=b._SORTED_TIME_INTERVAL_INDEX[a.interval];if(null!=c&&null!=d&&d=e},b.prototype._sizeFromOffer=function(b,c){var d=a.prototype._sizeFromOffer.call(this,b,c),e=this._tierHeights.reduce(function(a,b,c,e){return a+b>d.height?a:a+b}),f=this.margin()+(this.annotationsEnabled()?this.annotationTierCount()*this._annotationTierHeight():0);return d.height=Math.min(d.height,e+f),d},b.prototype._setup=function(){a.prototype._setup.call(this),this._setupDomElements()},b.prototype._setupDomElements=function(){this.content().selectAll("."+b.TIME_AXIS_TIER_CLASS).remove(),this._tierLabelContainers=[],this._tierMarkContainers=[],this._tierBaselines=[],this._tickLabelContainer.remove(),this._baseline.remove();for(var a=0;a=f.length||g.push(new Date((f[b+1].valueOf()-f[b].valueOf())/2+f[b].valueOf()))}):g=f;var h=a.selectAll("."+k.Axis.TICK_LABEL_CLASS).data(g,function(a){return String(a.valueOf())}),i=h.enter().append("g").classed(k.Axis.TICK_LABEL_CLASS,!0);i.append("text");var j,l="center"===this._tierLabelPositions[c]||1===b.step?0:this.tickLabelPadding();j="bottom"===this.orientation()?e.sum(this._tierHeights.slice(0,c+1))-this.tickLabelPadding():"center"===this._tierLabelPositions[c]?this.height()-e.sum(this._tierHeights.slice(0,c))-this.tickLabelPadding()-this._maxLabelTickLength():this.height()-e.sum(this._tierHeights.slice(0,c))-this.tickLabelPadding();var m=h.merge(i),n=m.selectAll("text");n.size()>0&&n.attr("transform","translate("+l+","+j+")"),h.exit().remove(),m.attr("transform",function(a){return"translate("+d._scale.scale(a)+",0)"});var o="center"===this._tierLabelPositions[c]||1===b.step?"middle":"start";m.selectAll("text").text(b.formatter).style("text-anchor",o)},b.prototype._renderTickMarks=function(a,b){var c=this._tierMarkContainers[b].selectAll("."+k.Axis.TICK_MARK_CLASS).data(a),d=c.enter().append("line").classed(k.Axis.TICK_MARK_CLASS,!0).merge(c),f=this._generateTickMarkAttrHash(),g=this._tierHeights.slice(0,b).reduce(function(a,b){return a+b},0);"bottom"===this.orientation()?(f.y1=g,f.y2=g+("center"===this._tierLabelPositions[b]?this.innerTickLength():this._tierHeights[b])):(f.y1=this.height()-g,f.y2=this.height()-(g+("center"===this._tierLabelPositions[b]?this.innerTickLength():this._tierHeights[b]))),d.attrs(f),"bottom"===this.orientation()?(f.y1=g,f.y2=g+("center"===this._tierLabelPositions[b]?this.endTickLength():this._tierHeights[b])):(f.y1=this.height()-g,f.y2=this.height()-(g+("center"===this._tierLabelPositions[b]?this.endTickLength():this._tierHeights[b]))),e.select(d.nodes()[0]).attrs(f),e.select(d.nodes()[d.size()-1]).attrs(f),e.select(d.nodes()[0]).classed(k.Axis.END_TICK_MARK_CLASS,!0),e.select(d.nodes()[d.size()-1]).classed(k.Axis.END_TICK_MARK_CLASS,!0),c.exit().remove()},b.prototype._renderLabellessTickMarks=function(a){var b=this._tickMarkContainer.selectAll("."+k.Axis.TICK_MARK_CLASS).data(a),c=b.enter().append("line").classed(k.Axis.TICK_MARK_CLASS,!0).merge(b),d=this._generateTickMarkAttrHash();d.y2="bottom"===this.orientation()?this.tickLabelPadding():this.height()-this.tickLabelPadding(),c.attrs(d),b.exit().remove()},b.prototype._generateLabellessTicks=function(){return this._mostPreciseConfigIndex<1?[]:this._getTickIntervalValues(this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex-1][0])},b.prototype.renderImmediately=function(){var a=this;this._mostPreciseConfigIndex=this._getMostPreciseConfigurationIndex();var b=this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex];this._cleanTiers(),b.forEach(function(b,c){return a._renderTierLabels(a._tierLabelContainers[c],b,c)});for(var c=b.map(function(b,c){return a._getTickValuesForConfiguration(b)}),d=0,e=0;e=i&&(g=this._generateLabellessTicks()),this._renderLabellessTickMarks(g),this._hideOverflowingTiers();for(var e=0;e=a.x&&b.topLeft.y<=a.y&&b.bottomRight.y>=a.y}var n=c(1),o=window.Math;b.inRange=d,b.clamp=e,b.max=f,b.min=g,b.isNaN=h,b.isValidNumber=i,b.range=j,b.distanceSquared=k,b.degreesToRadians=l,b.within=m},function(a,b,c){"use strict";var d=function(){function a(a){null!=a.createRuler?this.ruler=a.createRuler():this.ruler=a}return a.prototype.measure=function(b){return void 0===b&&(b=a.HEIGHT_TEXT),this.ruler(b)},a}();d.HEIGHT_TEXT="bdpql",b.AbstractMeasurer=d},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(28)),d(c(58)),d(c(59)),d(c(34)),d(c(35)),d(c(60)),d(c(61)),d(c(62)),d(c(63)),d(c(36)),d(c(64)),d(c(65)),d(c(66))},function(a,b,c){"use strict";var d=c(0),e=c(26),f=function(){function a(){}return a.prototype.render=function(){e.flush()},a}();b.Immediate=f;var g=function(){function a(){}return a.prototype.render=function(){d.DOM.requestAnimationFramePolyfill(e.flush)},a}();b.AnimationFrame=g;var h=function(){function a(){this._timeoutMsec=d.DOM.SCREEN_REFRESH_RATE_MILLISECONDS}return a.prototype.render=function(){setTimeout(e.flush,this._timeoutMsec)},a}();b.Timeout=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(13),f=c(0),g=c(15),h=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b._keyPressCallbacks={},b._keyReleaseCallbacks={},b._mouseMoveCallback=function(a){return!1},b._downedKeys=new f.Set,b._keyDownCallback=function(a,c){return b._handleKeyDownEvent(a,c)},b._keyUpCallback=function(a){return b._handleKeyUpEvent(a)},b}return d(b,a),b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this._positionDispatcher=e.Mouse.getDispatcher(this._componentAttachedTo),this._positionDispatcher.onMouseMove(this._mouseMoveCallback),this._keyDispatcher=e.Key.getDispatcher(),this._keyDispatcher.onKeyDown(this._keyDownCallback),this._keyDispatcher.onKeyUp(this._keyUpCallback)},b.prototype._unanchor=function(){a.prototype._unanchor.call(this),this._positionDispatcher.offMouseMove(this._mouseMoveCallback),this._positionDispatcher=null,this._keyDispatcher.offKeyDown(this._keyDownCallback),this._keyDispatcher.offKeyUp(this._keyUpCallback),this._keyDispatcher=null},b.prototype._handleKeyDownEvent=function(a,b){var c=this._translateToComponentSpace(this._positionDispatcher.lastMousePosition());this._isInsideComponent(c)&&!b.repeat&&(this._keyPressCallbacks[a]&&this._keyPressCallbacks[a].callCallbacks(a),this._downedKeys.add(a))},b.prototype._handleKeyUpEvent=function(a){this._downedKeys.has(a)&&this._keyReleaseCallbacks[a]&&this._keyReleaseCallbacks[a].callCallbacks(a),this._downedKeys["delete"](a)},b.prototype.onKeyPress=function(a,b){return this._keyPressCallbacks[a]||(this._keyPressCallbacks[a]=new f.CallbackSet),this._keyPressCallbacks[a].add(b),this},b.prototype.offKeyPress=function(a,b){return this._keyPressCallbacks[a]["delete"](b),0===this._keyPressCallbacks[a].size&&delete this._keyPressCallbacks[a],this},b.prototype.onKeyRelease=function(a,b){return this._keyReleaseCallbacks[a]||(this._keyReleaseCallbacks[a]=new f.CallbackSet),this._keyReleaseCallbacks[a].add(b),this},b.prototype.offKeyRelease=function(a,b){return this._keyReleaseCallbacks[a]["delete"](b),0===this._keyReleaseCallbacks[a].size&&delete this._keyReleaseCallbacks[a],this},b}(g.Interaction);b.Key=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(0),f=c(25),g=function(a){function b(b){void 0===b&&(b=[]);var c=a.call(this)||this;return c._components=[],c.addClass("component-group"),b.forEach(function(a){return c.append(a)}),c}return d(b,a),b.prototype._forEach=function(a){this.components().forEach(a)},b.prototype.has=function(a){return this._components.indexOf(a)>=0},b.prototype.requestedSpace=function(a,b){var c=this._components.map(function(c){return c.requestedSpace(a,b)});return{minWidth:e.Math.max(c,function(a){return a.minWidth},0),minHeight:e.Math.max(c,function(a){return a.minHeight},0)}},b.prototype.computeLayout=function(b,c,d){var e=this;return a.prototype.computeLayout.call(this,b,c,d),this._forEach(function(a){a.computeLayout({x:0,y:0},e.width(),e.height())}),this},b.prototype._sizeFromOffer=function(a,b){return{width:a,height:b}},b.prototype.fixedWidth=function(){return this._components.every(function(a){return a.fixedWidth()})},b.prototype.fixedHeight=function(){return this._components.every(function(a){return a.fixedHeight()})},b.prototype.components=function(){return this._components.slice()},b.prototype.append=function(a){return null==a||this.has(a)||(a.detach(),this._components.push(a),this._adoptAndAnchor(a),this.redraw()),this},b.prototype._remove=function(a){var b=this._components.indexOf(a);return b>=0&&(this._components.splice(b,1),!0)},b}(f.ComponentContainer);b.Group=g},function(a,b,c){"use strict";var d,e=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},f=c(0),g=c(5);!function(a){a[a.VALUE=0]="VALUE",a[a.PIXEL=1]="PIXEL"}(d||(d={}));var h=function(a){function b(c){var e=a.call(this)||this;if(e._mode=d.VALUE,c!==b.ORIENTATION_VERTICAL&&c!==b.ORIENTATION_HORIZONTAL)throw new Error(c+" is not a valid orientation for GuideLineLayer");return e._orientation=c,e._overflowHidden=!0,e.addClass("guide-line-layer"),e._isVertical()?e.addClass("vertical"):e.addClass("horizontal"),e._scaleUpdateCallback=function(){e._syncPixelPositionAndValue(),e.render()},e}return e(b,a),b.prototype._setup=function(){a.prototype._setup.call(this),this._guideLine=this.content().append("line").classed("guide-line",!0)},b.prototype._sizeFromOffer=function(a,b){return{width:a,height:b}},b.prototype._isVertical=function(){return this._orientation===b.ORIENTATION_VERTICAL},b.prototype.fixedWidth=function(){return!0},b.prototype.fixedHeight=function(){return!0},b.prototype.computeLayout=function(b,c,d){return a.prototype.computeLayout.call(this,b,c,d),null!=this.scale()&&(this._isVertical()?this.scale().range([0,this.width()]):this.scale().range([this.height(),0])),this},b.prototype.renderImmediately=function(){return a.prototype.renderImmediately.call(this),this._syncPixelPositionAndValue(),this._guideLine.attrs({x1:this._isVertical()?this.pixelPosition():0,y1:this._isVertical()?0:this.pixelPosition(),x2:this._isVertical()?this.pixelPosition():this.width(),y2:this._isVertical()?this.height():this.pixelPosition()}),this},b.prototype._syncPixelPositionAndValue=function(){null!=this.scale()&&(this._mode===d.VALUE&&null!=this.value()?this._pixelPosition=this.scale().scale(this.value()):this._mode===d.PIXEL&&null!=this.pixelPosition()&&(this._value=this.scale().invert(this.pixelPosition())))},b.prototype._setPixelPositionWithoutChangingMode=function(a){this._pixelPosition=a,null!=this.scale()&&(this._value=this.scale().invert(this.pixelPosition())),this.render()},b.prototype.scale=function(a){if(null==a)return this._scale;var b=this._scale;return null!=b&&b.offUpdate(this._scaleUpdateCallback),this._scale=a,this._scale.onUpdate(this._scaleUpdateCallback),this._syncPixelPositionAndValue(),this.redraw(),this},b.prototype.value=function(a){return null==a?this._value:(this._value=a,this._mode=d.VALUE,this._syncPixelPositionAndValue(),this.render(),this)},b.prototype.pixelPosition=function(a){if(null==a)return this._pixelPosition;if(!f.Math.isValidNumber(a))throw new Error("pixelPosition must be a finite number");return this._pixelPosition=a,this._mode=d.PIXEL,this._syncPixelPositionAndValue(),this.render(),this},b.prototype.destroy=function(){a.prototype.destroy.call(this),null!=this.scale()&&this.scale().offUpdate(this._scaleUpdateCallback)},b}(g.Component);h.ORIENTATION_VERTICAL="vertical",h.ORIENTATION_HORIZONTAL="horizontal",b.GuideLineLayer=h},function(a,b,c){"use strict";var d,e=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},f=c(0),g=c(5);!function(a){a[a.VALUE=0]="VALUE",a[a.PIXEL=1]="PIXEL"}(d=b.PropertyMode||(b.PropertyMode={}));var h=function(a){function b(){var b=a.call(this)||this;return b._boxVisible=!1,b._boxBounds={topLeft:{x:0,y:0},bottomRight:{x:0,y:0}},b._xBoundsMode=d.PIXEL,b._yBoundsMode=d.PIXEL,b.addClass("selection-box-layer"),b._adjustBoundsCallback=function(){b.render()},b._overflowHidden=!0,b._xExtent=[void 0,void 0],b._yExtent=[void 0,void 0],b}return e(b,a),b.prototype._setup=function(){a.prototype._setup.call(this), +this._box=this.content().append("g").classed("selection-box",!0).remove(),this._boxArea=this._box.append("rect").classed("selection-area",!0)},b.prototype._sizeFromOffer=function(a,b){return{width:a,height:b}},b.prototype.bounds=function(a){return null==a?this._getBounds():(this._setBounds(a),this._xBoundsMode=d.PIXEL,this._yBoundsMode=d.PIXEL,this.render(),this)},b.prototype._setBounds=function(a){var b={x:Math.min(a.topLeft.x,a.bottomRight.x),y:Math.min(a.topLeft.y,a.bottomRight.y)},c={x:Math.max(a.topLeft.x,a.bottomRight.x),y:Math.max(a.topLeft.y,a.bottomRight.y)};this._boxBounds={topLeft:b,bottomRight:c}},b.prototype._getBounds=function(){return{topLeft:{x:this._xBoundsMode===d.PIXEL?this._boxBounds.topLeft.x:null==this._xScale?0:Math.min(this.xScale().scale(this.xExtent()[0]),this.xScale().scale(this.xExtent()[1])),y:this._yBoundsMode===d.PIXEL?this._boxBounds.topLeft.y:null==this._yScale?0:Math.min(this.yScale().scale(this.yExtent()[0]),this.yScale().scale(this.yExtent()[1]))},bottomRight:{x:this._xBoundsMode===d.PIXEL?this._boxBounds.bottomRight.x:null==this._xScale?0:Math.max(this.xScale().scale(this.xExtent()[0]),this.xScale().scale(this.xExtent()[1])),y:this._yBoundsMode===d.PIXEL?this._boxBounds.bottomRight.y:null==this._yScale?0:Math.max(this.yScale().scale(this.yExtent()[0]),this.yScale().scale(this.yExtent()[1]))}}},b.prototype.renderImmediately=function(){if(a.prototype.renderImmediately.call(this),this._boxVisible){var b=this.bounds(),c=b.topLeft.y,d=b.bottomRight.y,e=b.topLeft.x,g=b.bottomRight.x;if(!(f.Math.isValidNumber(c)&&f.Math.isValidNumber(d)&&f.Math.isValidNumber(e)&&f.Math.isValidNumber(g)))throw new Error("bounds have not been properly set");this._boxArea.attrs({x:e,y:c,width:g-e,height:d-c}),this.content().node().appendChild(this._box.node())}else this._box.remove();return this},b.prototype.boxVisible=function(a){return null==a?this._boxVisible:(this._boxVisible=a,this.render(),this)},b.prototype.fixedWidth=function(){return!0},b.prototype.fixedHeight=function(){return!0},b.prototype.xScale=function(a){return null==a?this._xScale:(null!=this._xScale&&this._xScale.offUpdate(this._adjustBoundsCallback),this._xScale=a,this._xBoundsMode=d.VALUE,this._xScale.onUpdate(this._adjustBoundsCallback),this.render(),this)},b.prototype.yScale=function(a){return null==a?this._yScale:(null!=this._yScale&&this._yScale.offUpdate(this._adjustBoundsCallback),this._yScale=a,this._yBoundsMode=d.VALUE,this._yScale.onUpdate(this._adjustBoundsCallback),this.render(),this)},b.prototype.xExtent=function(a){return null==a?this._getXExtent():(this._setXExtent(a),this._xBoundsMode=d.VALUE,this.render(),this)},b.prototype._getXExtent=function(){return this._xBoundsMode===d.VALUE?this._xExtent:null==this._xScale?[void 0,void 0]:[this._xScale.invert(this._boxBounds.topLeft.x),this._xScale.invert(this._boxBounds.bottomRight.x)]},b.prototype._setXExtent=function(a){this._xExtent=a},b.prototype.yExtent=function(a){return null==a?this._getYExtent():(this._setYExtent(a),this._yBoundsMode=d.VALUE,this.render(),this)},b.prototype._getYExtent=function(){return this._yBoundsMode===d.VALUE?this._yExtent:null==this._yScale?[void 0,void 0]:[this._yScale.invert(this._boxBounds.topLeft.y),this._yScale.invert(this._boxBounds.bottomRight.y)]},b.prototype._setYExtent=function(a){this._yExtent=a},b.prototype.destroy=function(){a.prototype.destroy.call(this),null!=this._xScale&&this.xScale().offUpdate(this._adjustBoundsCallback),null!=this._yScale&&this.yScale().offUpdate(this._adjustBoundsCallback)},b}(g.Component);b.SelectionBoxLayer=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(10),g=c(3),h=c(0),i=c(17),j=c(39),k=c(2),l=function(a){function b(){var b=a.call(this)||this;return b.addClass("area-plot"),b.y0(0),b.attr("fill-opacity",.25),b.attr("fill",(new g.Color).range()[0]),b._lineDrawers=new h.Map,b}return d(b,a),b.prototype._setup=function(){var b=this;a.prototype._setup.call(this),this._lineDrawers.forEach(function(a){return a.renderArea(b._renderArea.append("g"))})},b.prototype.y=function(c,d){if(null==c)return a.prototype.y.call(this);if(null==d?a.prototype.y.call(this,c):a.prototype.y.call(this,c,d),null!=d){var e=this.y0().accessor;null!=e&&this._bindProperty(b._Y0_KEY,e,d),this._updateYScale()}return this},b.prototype.y0=function(a){if(null==a)return this._propertyBindings.get(b._Y0_KEY);var c=this.y(),d=c&&c.scale;return this._bindProperty(b._Y0_KEY,a,d),this._updateYScale(),this.render(),this},b.prototype._onDatasetUpdate=function(){a.prototype._onDatasetUpdate.call(this),this._updateYScale()},b.prototype.addDataset=function(b){return a.prototype.addDataset.call(this,b),this},b.prototype._addDataset=function(b){var c=this,d=new f.Line(b,function(){return c._d3LineFactory(b)});return this._isSetup&&d.renderArea(this._renderArea.append("g")),this._lineDrawers.set(b,d),a.prototype._addDataset.call(this,b),this},b.prototype._removeDatasetNodes=function(b){a.prototype._removeDatasetNodes.call(this,b),this._lineDrawers.get(b).remove()},b.prototype._additionalPaint=function(){var a=this,b=this._generateLineDrawSteps(),c=this._getDataToDraw();this.datasets().forEach(function(d){return a._lineDrawers.get(d).draw(c.get(d),b)})},b.prototype._generateLineDrawSteps=function(){var a=[];if(this._animateOnNextRender()){var b=this._generateLineAttrToProjector();b.d=this._constructLineProjector(k.Plot._scaledAccessor(this.x()),this._getResetYFunction()),a.push({attrToProjector:b,animator:this._getAnimator(i.Animator.RESET)})}return a.push({attrToProjector:this._generateLineAttrToProjector(),animator:this._getAnimator(i.Animator.MAIN)}),a},b.prototype._generateLineAttrToProjector=function(){var a=this._generateAttrToProjector();return a.d=this._constructLineProjector(k.Plot._scaledAccessor(this.x()),k.Plot._scaledAccessor(this.y())),a},b.prototype._createDrawer=function(a){return new f.Area(a)},b.prototype._generateDrawSteps=function(){var a=[];if(this._animateOnNextRender()){var b=this._generateAttrToProjector();b.d=this._constructAreaProjector(k.Plot._scaledAccessor(this.x()),this._getResetYFunction(),k.Plot._scaledAccessor(this.y0())),a.push({attrToProjector:b,animator:this._getAnimator(i.Animator.RESET)})}return a.push({attrToProjector:this._generateAttrToProjector(),animator:this._getAnimator(i.Animator.MAIN)}),a},b.prototype._updateYScale=function(){var a=this._propertyExtents.get("y0"),b=h.Array.flatten(a),c=h.Array.uniq(b),d=1===c.length?c[0]:null,e=this.y(),f=e&&e.scale;null!=f&&(null!=this._constantBaselineValueProvider&&(f.removePaddingExceptionsProvider(this._constantBaselineValueProvider),this._constantBaselineValueProvider=null),null!=d&&(this._constantBaselineValueProvider=function(){return[d]},f.addPaddingExceptionsProvider(this._constantBaselineValueProvider)))},b.prototype._getResetYFunction=function(){return k.Plot._scaledAccessor(this.y0())},b.prototype._propertyProjectors=function(){var b=a.prototype._propertyProjectors.call(this);return b.d=this._constructAreaProjector(k.Plot._scaledAccessor(this.x()),k.Plot._scaledAccessor(this.y()),k.Plot._scaledAccessor(this.y0())),b},b.prototype.selections=function(b){var c=this;void 0===b&&(b=this.datasets());var d=a.prototype.selections.call(this,b).nodes(),f=b.map(function(a){return c._lineDrawers.get(a)}).filter(function(a){return null!=a});return f.forEach(function(a,b){return d.push(a.selectionForIndex(b).node())}),e.selectAll(d)},b.prototype._constructAreaProjector=function(a,b,c){var d=this,f=function(a,b,c){var e=k.Plot._scaledAccessor(d.x())(a,b,c),f=k.Plot._scaledAccessor(d.y())(a,b,c);return h.Math.isValidNumber(e)&&h.Math.isValidNumber(f)};return function(g,h,i){var j=d._getCurveFactory(),k=e.area().x(function(b,c){return a(b,c,i)}).y1(function(a,c){return b(a,c,i)}).y0(function(a,b){return c(a,b,i)}).curve(j).defined(function(a,b){return f(a,b,i)});return k(g)}},b}(j.Line);l._Y0_KEY="y0",b.Area=l},function(a,b,c){"use strict";var d;!function(a){a.MAIN="main",a.RESET="reset"}(d=b.Animator||(b.Animator={}))},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(6),g=c(10),h=c(3),i=c(11),j=c(0),k=c(8),l=c(17),m=c(2),n=c(16),o={linear:e.curveLinear,linearClosed:e.curveLinearClosed,step:e.curveStep,stepBefore:e.curveStepBefore,stepAfter:e.curveStepAfter,basis:e.curveBasis,basisOpen:e.curveBasisOpen,basisClosed:e.curveBasisClosed,bundle:e.curveBundle,cardinal:e.curveCardinal,cardinalOpen:e.curveCardinalOpen,cardinalClosed:e.curveCardinalClosed,monotone:e.curveMonotoneX};b.CurveName=k.makeEnum(["linear","linearClosed","step","stepBefore","stepAfter","basis","basisOpen","basisClosed","bundle","cardinal","cardinalOpen","cardinalClosed","monotone"]);var p=function(a){function b(){var b=a.call(this)||this;b._curve="linear",b._autorangeSmooth=!1,b._croppedRenderingEnabled=!0,b._downsamplingEnabled=!1,b.addClass("line-plot");var c=new f.Easing;return c.stepDuration(m.Plot._ANIMATION_MAX_DURATION),c.easingMode("expInOut"),c.maxTotalDuration(m.Plot._ANIMATION_MAX_DURATION),b.animator(l.Animator.MAIN,c),b.attr("stroke",(new h.Color).range()[0]),b.attr("stroke-width","2px"),b}return d(b,a),b.prototype.x=function(b,c){return null==b?a.prototype.x.call(this):(null==c?a.prototype.x.call(this,b):a.prototype.x.call(this,b,c),this._setScaleSnapping(),this)},b.prototype.y=function(b,c){return null==b?a.prototype.y.call(this):(a.prototype.y.call(this,b,c),this._setScaleSnapping(),this)},b.prototype.autorangeMode=function(b){return null==b?a.prototype.autorangeMode.call(this):(a.prototype.autorangeMode.call(this,b),this._setScaleSnapping(),this)},b.prototype.autorangeSmooth=function(a){return null==a?this._autorangeSmooth:(this._autorangeSmooth=a,this._setScaleSnapping(),this)},b.prototype._setScaleSnapping=function(){"x"===this.autorangeMode()&&this.x()&&this.x().scale&&this.x().scale instanceof i.QuantitativeScale&&this.x().scale.snappingDomainEnabled(!this.autorangeSmooth()),"y"===this.autorangeMode()&&this.y()&&this.y().scale&&this.y().scale instanceof i.QuantitativeScale&&this.y().scale.snappingDomainEnabled(!this.autorangeSmooth())},b.prototype.curve=function(a){return null==a?this._curve:(this._curve=a,this.render(),this)},b.prototype.downsamplingEnabled=function(a){return null==a?this._downsamplingEnabled:(this._downsamplingEnabled=a,this)},b.prototype.croppedRenderingEnabled=function(a){return null==a?this._croppedRenderingEnabled:(this._croppedRenderingEnabled=a,this.render(),this)},b.prototype._createDrawer=function(a){var b=this;return new g.Line(a,function(){return b._d3LineFactory(a)})},b.prototype._extentsForProperty=function(b){var c=a.prototype._extentsForProperty.call(this,b);if(!this._autorangeSmooth)return c;if(this.autorangeMode()!==b)return c;if("x"!==this.autorangeMode()&&"y"!==this.autorangeMode())return c;var d,f=this._getEdgeIntersectionPoints();return d="y"===this.autorangeMode()?f.left.concat(f.right).map(function(a){return a.y}):f.top.concat(f.bottom).map(function(a){return a.x}),c.map(function(a){return e.extent(e.merge([a,d]))})},b.prototype._getEdgeIntersectionPoints=function(){var a=this;if(!(this.y().scale instanceof i.QuantitativeScale&&this.x().scale instanceof i.QuantitativeScale))return{left:[],right:[],top:[],bottom:[]};var b=this.y().scale,c=this.x().scale,d={left:[],right:[],top:[],bottom:[]},e=c.scale(c.domain()[0]),f=c.scale(c.domain()[1]),g=b.scale(b.domain()[0]),h=b.scale(b.domain()[1]);return this.datasets().forEach(function(i){for(var j,k,l,m,n,o,p,q,r=i.data(),s=1;s0&&c||0,e=this.y().scale.scale(d);return function(a,b,c){return e}},b.prototype._generateDrawSteps=function(){var a=[];if(this._animateOnNextRender()){var b=this._generateAttrToProjector();b.d=this._constructLineProjector(m.Plot._scaledAccessor(this.x()),this._getResetYFunction()),a.push({attrToProjector:b,animator:this._getAnimator(l.Animator.RESET)})}return a.push({attrToProjector:this._generateAttrToProjector(),animator:this._getAnimator(l.Animator.MAIN)}),a},b.prototype._generateAttrToProjector=function(){var b=a.prototype._generateAttrToProjector.call(this);return Object.keys(b).forEach(function(a){if("d"!==a){var c=b[a];b[a]=function(a,b,d){return a.length>0?c(a[0],b,d):null}}}),b},b.prototype.entitiesAt=function(a){var b=this.entityNearestByXThenY(a);return null!=b?[b]:[]},b.prototype.entitiesIn=function(a,b){var c,d;if(null==b){var e=a;c={min:e.topLeft.x,max:e.bottomRight.x},d={min:e.topLeft.y,max:e.bottomRight.y}}else c=a,d=b;var f=m.Plot._scaledAccessor(this.x()),g=m.Plot._scaledAccessor(this.y());return this.entities().filter(function(a){var b=a.datum,e=a.index,h=a.dataset,i=f(b,e,h),j=g(b,e,h);return c.min<=i&&i<=c.max&&d.min<=j&&j<=d.max})},b.prototype.entityNearestByXThenY=function(a){var b,c=this,d=1/0,e=1/0,f=this.bounds();return this.entities().forEach(function(g){if(c._entityVisibleOnPlot(g,f)){var h=Math.abs(a.x-g.position.x),i=Math.abs(a.y-g.position.y);(hs&&(s=u,r=b[h]),u0&&"\n"===a[0]?"\n":"";if(b<=g){var i=g/3,j=Math.floor(b/i);return{remainingToken:a,wrappedToken:h+"...".substr(0,j)}}for(;f+g>b;)e=d.StringMethods.trimEnd(e.substr(0,e.length-1)),f=c.measure(e).width;return{remainingToken:d.StringMethods.trimEnd(a.substring(e.length),"-").trim(),wrappedToken:h+e+"..."}},a.prototype.wrapNextToken=function(a,b,c){if(!b.canFitText||b.availableLines===b.wrapping.noLines||!this.canFitToken(a,b.availableWidth,c))return this.finishWrapping(a,b,c);for(var e=a;e;){var f=this.breakTokenToFitInWidth(e,b.currentLine,b.availableWidth,c);if(b.currentLine=f.line,e=f.remainingToken,null!=e){if(b.wrapping.noBrokeWords+=+f.breakWord,++b.wrapping.noLines,b.availableLines===b.wrapping.noLines){var g=this.addEllipsis(b.currentLine,b.availableWidth,c);return b.wrapping.wrappedText+=g.wrappedToken,b.wrapping.truncatedText+=g.remainingToken+e,b.currentLine="\n",b}b.wrapping.wrappedText+=d.StringMethods.trimEnd(b.currentLine),b.currentLine="\n"}}return b},a.prototype.finishWrapping=function(a,b,c){if(b.canFitText&&b.availableLines!==b.wrapping.noLines&&this._allowBreakingWords&&"none"!==this._textTrimming){var d=this.addEllipsis(b.currentLine+a,b.availableWidth,c);b.wrapping.wrappedText+=d.wrappedToken,b.wrapping.truncatedText+=d.remainingToken,b.wrapping.noBrokeWords+=+(d.remainingToken.length0),b.currentLine=""}else b.wrapping.truncatedText+=a;return b.canFitText=!1,b},a.prototype.breakTokenToFitInWidth=function(a,b,c,d,e){if(void 0===e&&(e=this._breakingCharacter),d.measure(b+a).width<=c)return{breakWord:!1,line:b+a,remainingToken:null};if(""===a.trim())return{breakWord:!1,line:b,remainingToken:""};if(!this._allowBreakingWords)return{breakWord:!1,line:b,remainingToken:a};for(var f=0;f0&&(g=e),{breakWord:f>0,line:b+a.substring(0,f)+g,remainingToken:a.substring(f)}},a}();b.Wrapper=e},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(124))},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}d(c(56)),d(c(57)),d(c(24))},function(a,b,c){"use strict";var d=c(0),e=function(){function a(a,b){void 0===a&&(a=[]),void 0===b&&(b={}),this._data=a,this._metadata=b,this._callbacks=new d.CallbackSet}return a.prototype.onUpdate=function(a){return this._callbacks.add(a),this},a.prototype.offUpdate=function(a){return this._callbacks["delete"](a),this},a.prototype.data=function(a){return null==a?this._data:(this._data=a,this._callbacks.callCallbacks(this),this)},a.prototype.metadata=function(a){return null==a?this._metadata:(this._metadata=a,this._callbacks.callCallbacks(this),this)},a}();b.Dataset=e},function(a,b,c){"use strict";b.version="3.0.0-beta.4"},function(a,b,c){"use strict";function d(a,b){return a.each(function(){var a=b.apply(this,arguments),c=t.select(this);for(var d in a)c.attr(d,a[d])})}function e(a,b){for(var c in b)a.attr(c,b[c]);return a}function f(a){return("function"==typeof a?d:e)(this,a)}function g(a,b,c){return a.each(function(){var a=b.apply(this,arguments),d=t.select(this);for(var e in a)d.style(e,a[e],c)})}function h(a,b,c){for(var d in b)a.style(d,b[d],c);return a}function i(a,b){return("function"==typeof a?g:h)(this,a,null==b?"":b)}function j(a,b){return a.each(function(){var a=b.apply(this,arguments),c=t.select(this);for(var d in a)c.property(d,a[d])})}function k(a,b){for(var c in b)a.property(c,b[c]);return a}function l(a){return("function"==typeof a?j:k)(this,a)}function m(a,b){return a.each(function(){var c=b.apply(this,arguments),d=t.select(this).transition(a);for(var e in c)d.attr(e,c[e])})}function n(a,b){for(var c in b)a.attr(c,b[c]);return a}function o(a){return("function"==typeof a?m:n)(this,a)}function p(a,b,c){return a.each(function(){var d=b.apply(this,arguments),e=t.select(this).transition(a);for(var f in d)e.style(f,d[f],c)})}function q(a,b,c){for(var d in b)a.style(d,b[d],c);return a}function r(a,b){return("function"==typeof a?p:q)(this,a,null==b?"":b)}var s=c(1),t=s,u=s;t.selection.prototype.attrs=f,t.selection.prototype.styles=i,t.selection.prototype.properties=l,u.transition.prototype.attrs=o,u.transition.prototype.styles=r},function(a,b,c){"use strict";var d=c(104),e=c(12),f=c(8),g={linear:d.easeLinear,quad:d.easeQuad,quadIn:d.easeQuadIn,quadOut:d.easeQuadOut,quadInOut:d.easeQuadInOut,cubic:d.easeCubic,cubicIn:d.easeCubicIn,cubicOut:d.easeCubicOut,cubicInOut:d.easeCubicInOut,poly:d.easePoly,polyIn:d.easePolyIn,polyOut:d.easePolyOut,polyInOut:d.easePolyInOut,sin:d.easeSin,sinIn:d.easeSinIn,sinOut:d.easeSinOut,sinInOut:d.easeSinInOut,exp:d.easeExp,expIn:d.easeExpIn,expOut:d.easeExpOut,expInOut:d.easeExpInOut,circle:d.easeCircle,circleIn:d.easeCircleIn,circleOut:d.easeCircleOut,circleInOut:d.easeCircleInOut,bounce:d.easeBounce,bounceIn:d.easeBounceIn,bounceOut:d.easeBounceOut,bounceInOut:d.easeBounceInOut,back:d.easeBack,backIn:d.easeBackIn,backOut:d.easeBackOut,backInOut:d.easeBackInOut,elastic:d.easeElastic,elasticIn:d.easeElasticIn,elasticOut:d.easeElasticOut,elasticInOut:d.easeElasticInOut};b.EaseName=f.makeEnum(["linear","quad","quadIn","quadOut","quadInOut","cubic","cubicIn","cubicOut","cubicInOut","poly","polyIn","polyOut","polyInOut","sin","sinIn","sinOut","sinInOut","exp","expIn","expOut","expInOut","circle","circleIn","circleOut","circleInOut","bounce","bounceIn","bounceOut","bounceInOut","back","backIn","backOut","backInOut","elastic","elasticIn","elasticOut","elasticInOut"]);var h=function(){function a(){this._startDelay=a._DEFAULT_START_DELAY_MILLISECONDS,this._stepDuration=a._DEFAULT_STEP_DURATION_MILLISECONDS,this._stepDelay=a._DEFAULT_ITERATIVE_DELAY_MILLISECONDS,this._maxTotalDuration=a._DEFAULT_MAX_TOTAL_DURATION_MILLISECONDS,this._easingMode=a._DEFAULT_EASING_MODE}return a.prototype.totalTime=function(a){var b=this._getAdjustedIterativeDelay(a);return this.startDelay()+b*Math.max(a-1,0)+this.stepDuration()},a.prototype.animate=function(a,b){var c=this;a=e.coerceExternalD3(a);var d=a.size(),f=this._getAdjustedIterativeDelay(d);return a.transition().ease(this._getEaseFactory()).duration(this.stepDuration()).delay(function(a,b){return c.startDelay()+f*b}).attrs(b)},a.prototype.startDelay=function(a){return null==a?this._startDelay:(this._startDelay=a, +this)},a.prototype.stepDuration=function(a){return null==a?Math.min(this._stepDuration,this._maxTotalDuration):(this._stepDuration=a,this)},a.prototype.stepDelay=function(a){return null==a?this._stepDelay:(this._stepDelay=a,this)},a.prototype.maxTotalDuration=function(a){return null==a?this._maxTotalDuration:(this._maxTotalDuration=a,this)},a.prototype.easingMode=function(a){return null==a?this._easingMode:(this._easingMode=a,this)},a.prototype._getEaseFactory=function(){var a=this.easingMode();if("string"==typeof a){var b=g[a];return null==b?g.linear:b}return a},a.prototype._getAdjustedIterativeDelay=function(a){var b=this.maxTotalDuration()-this.stepDuration();b=Math.max(b,0);var c=b/Math.max(a-1,1);return Math.min(this.stepDelay(),c)},a}();h._DEFAULT_START_DELAY_MILLISECONDS=0,h._DEFAULT_STEP_DURATION_MILLISECONDS=300,h._DEFAULT_ITERATIVE_DELAY_MILLISECONDS=15,h._DEFAULT_MAX_TOTAL_DURATION_MILLISECONDS=1/0,h._DEFAULT_EASING_MODE="expOut",b.Easing=h},function(a,b,c){"use strict";var d=c(12),e=function(){function a(){}return a.prototype.totalTime=function(a){return 0},a.prototype.animate=function(a,b){return a=d.coerceExternalD3(a),a.attrs(b)},a}();b.Null=e},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(4),g=c(0),h=c(20),i=function(a){function b(b,c){void 0===c&&(c="bottom");var d=a.call(this,b,c)||this;return d._tickLabelAngle=0,d._tickLabelShearAngle=0,d.addClass("category-axis"),d}return d(b,a),Object.defineProperty(b.prototype,"_wrapper",{get:function(){var a=new f.Wrapper;return null!=this._tickLabelMaxLines&&a.maxLines(this._tickLabelMaxLines),a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"_writer",{get:function(){return new f.Writer(this._measurer,this._typesetterContext,this._wrapper)},enumerable:!0,configurable:!0}),b.prototype._setup=function(){a.prototype._setup.call(this),this._typesetterContext=new f.SvgContext(this._tickLabelContainer.node()),this._measurer=new f.CacheMeasurer(this._typesetterContext)},b.prototype._rescale=function(){return this.redraw()},b.prototype.requestedSpace=function(a,b){var c=this.isHorizontal()?0:this._tickSpaceRequired()+this.margin(),d=this.isHorizontal()?this._tickSpaceRequired()+this.margin():0;if(0===this._scale.domain().length)return{minWidth:0,minHeight:0};if(this.annotationsEnabled()){var e=this._annotationTierHeight()*this.annotationTierCount();this.isHorizontal()?d+=e:c+=e}var f=this._measureTickLabels(a,b);return{minWidth:f.usedWidth+c,minHeight:f.usedHeight+d}},b.prototype._coreSize=function(){var a=this.isHorizontal()?this.height():this.width(),b=this.isHorizontal()?this.requestedSpace(this.width(),this.height()).minHeight:this.requestedSpace(this.width(),this.height()).minWidth,c=this.margin()+this._annotationTierHeight(),d=b-c;return Math.min(d,a)},b.prototype._getTickValues=function(){return this.getDownsampleInfo().domain},b.prototype.getDownsampleInfo=function(a,c){void 0===a&&(a=this._scale),void 0===c&&(c=a.invertRange());var d=0===this._tickLabelAngle?1:1/Math.cos(this._tickLabelShearAngle/180*Math.PI),e=b._MINIMUM_WIDTH_PER_LABEL_PX*d,f=Math.ceil(e/a.stepWidth());return{domain:c.filter(function(a,b){return b%f===0}),stepWidth:f*a.stepWidth()}},b.prototype.tickLabelAngle=function(a){if(null==a)return this._tickLabelAngle;if(0!==a&&90!==a&&a!==-90)throw new Error("Angle "+a+" not supported; only 0, 90, and -90 are valid values");return this._tickLabelAngle=a,this.redraw(),this},b.prototype.tickLabelShearAngle=function(a){if(null==a)return this._tickLabelShearAngle;if(a<-80||a>80)throw new Error("Angle "+a+" not supported; Must be between [-80, 80]");return this._tickLabelShearAngle=a,this.redraw(),this},b.prototype.tickLabelMaxWidth=function(a){return 0===arguments.length?this._tickLabelMaxWidth:(this._tickLabelMaxWidth=a,this.redraw(),this)},b.prototype.tickLabelMaxLines=function(a){return 0===arguments.length?this._tickLabelMaxLines:(this._tickLabelMaxLines=a,this.redraw(),this)},b.prototype._tickSpaceRequired=function(){return this._maxLabelTickLength()+this.tickLabelPadding()},b.prototype._drawTicks=function(a,b){var c,d,f=this;switch(this.tickLabelAngle()){case 0:c={left:"right",right:"left",top:"center",bottom:"center"},d={left:"center",right:"center",top:"bottom",bottom:"top"};break;case 90:c={left:"center",right:"center",top:"right",bottom:"left"},d={left:"top",right:"bottom",top:"center",bottom:"center"};break;case-90:c={left:"center",right:"center",top:"left",bottom:"right"},d={left:"bottom",right:"top",top:"center",bottom:"center"}}b.each(function(b){var g=e.select(this),h=f.isHorizontal()?a:f.width()-f._tickSpaceRequired(),i=f.isHorizontal()?f.height()-f._tickSpaceRequired():a,j={xAlign:c[f.orientation()],yAlign:d[f.orientation()],textRotation:f.tickLabelAngle(),textShear:f.tickLabelShearAngle()};if(null!=f._tickLabelMaxWidth){if("left"===f.orientation()&&h>f._tickLabelMaxWidth){var k=h-f._tickLabelMaxWidth,l=g.attr("transform")+" translate("+k+", 0)";g.attr("transform",l)}h=Math.min(h,f._tickLabelMaxWidth)}f._writer.write(f.formatter()(b),h,i,j,g.node())})},b.prototype._measureTickLabels=function(a,b){var c=this,d=this._scale,f=d.cloneWithoutProviders().range([0,this.isHorizontal()?a:b]),h=this.getDownsampleInfo(f),i=h.domain,j=h.stepWidth,k=a-this._tickSpaceRequired();this.isHorizontal()&&(k=j,0!==this._tickLabelAngle&&(k=b-this._tickSpaceRequired()),k=Math.max(k,0));var l=j;this.isHorizontal()&&(l=b-this._tickSpaceRequired(),0!==this._tickLabelAngle&&(l=a-this._tickSpaceRequired()),l=Math.max(l,0)),null!=this._tickLabelMaxWidth&&(k=Math.min(k,this._tickLabelMaxWidth));var m=i.map(function(a){return c._wrapper.wrap(c.formatter()(a),c._measurer,k,l)}),n=this.isHorizontal()&&0===this._tickLabelAngle?e.sum:g.Math.max,o=this.isHorizontal()&&0===this._tickLabelAngle?g.Math.max:e.sum,p=n(m,function(a){return c._measurer.measure(a.wrappedText).width},0),q=o(m,function(a){return c._measurer.measure(a.wrappedText).height},0);return 0!==this._tickLabelAngle&&(r=[q,p],p=r[0],q=r[1]),{usedWidth:p,usedHeight:q};var r},b.prototype.renderImmediately=function(){var b=this;a.prototype.renderImmediately.call(this);var c=this._scale,d=this.getDownsampleInfo(c),e=d.domain,f=d.stepWidth,g=f;this.isHorizontal()&&null!=this._tickLabelMaxWidth&&(g=Math.min(g,this._tickLabelMaxWidth));var i=function(a,d){var e=c.scale(a)-g/2,f=b.isHorizontal()?e:0,h=b.isHorizontal()?0:e;return"translate("+f+","+h+")"},j=this._tickLabelContainer.selectAll("."+h.Axis.TICK_LABEL_CLASS).data(e),k=j.enter().append("g").classed(h.Axis.TICK_LABEL_CLASS,!0).merge(j);j.exit().remove(),k.attr("transform",i),k.text(""),this._drawTicks(f,k);var l="right"===this.orientation()?this._tickSpaceRequired():0,m="bottom"===this.orientation()?this._tickSpaceRequired():0;return this._tickLabelContainer.attr("transform","translate("+l+","+m+")"),this._showAllTickMarks(),this._showAllTickLabels(),this._hideTickMarksWithoutLabel(),this},b.prototype.computeLayout=function(b,c,d){return a.prototype.computeLayout.call(this,b,c,d),this.isHorizontal()||this._scale.range([0,this.height()]),this},b.prototype.invalidateCache=function(){a.prototype.invalidateCache.call(this),this._measurer.reset()},b}(h.Axis);i._MINIMUM_WIDTH_PER_LABEL_PX=15,b.Category=i},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(4),g=c(9),h=c(0),i=c(20),j=function(a){function b(b,c){var d=a.call(this,b,c)||this;return d._tickLabelPositioning="center",d._usesTextWidthApproximation=!1,d.formatter(g.general()),d}return d(b,a),b.prototype._setup=function(){a.prototype._setup.call(this);var b=new f.SvgContext(this._tickLabelContainer.node(),i.Axis.TICK_LABEL_CLASS);this._measurer=new f.CacheMeasurer(b),this._wrapper=(new f.Wrapper).maxLines(1)},b.prototype._computeWidth=function(){var a=this._usesTextWidthApproximation?this._computeApproximateTextWidth():this._computeExactTextWidth();return"center"===this._tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+a:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+a)},b.prototype._computeExactTextWidth=function(){var a=this,b=this._getTickValues(),c=b.map(function(b){var c=a.formatter()(b);return a._measurer.measure(c).width});return h.Math.max(c,0)},b.prototype._computeApproximateTextWidth=function(){var a=this,b=this._getTickValues(),c=this._measurer.measure("M").width,d=b.map(function(b){var d=a.formatter()(b);return d.length*c});return h.Math.max(d,0)},b.prototype._computeHeight=function(){var a=this._measurer.measure().height;return"center"===this._tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+a:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+a)},b.prototype._getTickValues=function(){var a=this._scale,b=a.domain(),c=b[0]<=b[1]?b[0]:b[1],d=b[0]>=b[1]?b[0]:b[1];return a.ticks().filter(function(a){return a>=c&&a<=d})},b.prototype._rescale=function(){if(this._isSetup){if(!this.isHorizontal()){var a=this._computeWidth();if(a>this.width()||a180?a-=360:a<-180&&(a+=360),a!==-90&&0!==a&&90!==a)throw new Error(a+" is not a valid angle for Label");return this._angle=a,this.redraw(),this},b.prototype.padding=function(a){if(null==a)return this._padding;if(a=+a,a<0)throw new Error(a+" is not a valid padding value. Cannot be less than 0.");return this._padding=a,this.redraw(),this},b.prototype.fixedWidth=function(){return!0},b.prototype.fixedHeight=function(){return!0},b.prototype.renderImmediately=function(){a.prototype.renderImmediately.call(this),this._textContainer.selectAll("g").remove();var b=this._measurer.measure(this._text),c=Math.max(Math.min((this.height()-b.height)/2,this.padding()),0),d=Math.max(Math.min((this.width()-b.width)/2,this.padding()),0);this._textContainer.attr("transform","translate("+d+","+c+")");var e=this.width()-2*d,f=this.height()-2*c,g={xAlign:this.xAlignment(),yAlign:this.yAlignment(),textRotation:this.angle()};return this._writer.write(this._text,e,f,g),this},b.prototype.invalidateCache=function(){a.prototype.invalidateCache.call(this),this._measurer.reset()},b}(f.Component);b.Label=g;var h=function(a){function b(c,d){var e=a.call(this,c,d)||this;return e.addClass(b.TITLE_LABEL_CLASS),e}return d(b,a),b}(g);h.TITLE_LABEL_CLASS="title-label",b.TitleLabel=h;var i=function(a){function b(c,d){var e=a.call(this,c,d)||this;return e.addClass(b.AXIS_LABEL_CLASS),e}return d(b,a),b}(g);i.AXIS_LABEL_CLASS="axis-label",b.AxisLabel=i},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(4),g=c(21),h=c(9),i=c(27),j=c(0),k=c(5),l=function(){function a(a,b,c){void 0===a&&(a=[]),void 0===b&&(b=0),void 0===c&&(c=1/0),this.columns=a,this.bottomPadding=b,this.maxWidth=c}return a.prototype.addColumn=function(a){var b=a.width,c=this.getWidthAvailable();a.width=Math.min(c,b),this.columns.push(a)},a.prototype.getBounds=function(a){for(var b=this.columns[a],c=0,d=0;d1&&(g=new l,g.bottomPadding=c._rowBottomPadding,e.addRow(g));var k={width:d,height:d,data:{name:a,type:"symbol"}};g.addColumn(k),f=g.getWidthAvailable();var m=Math.min(f,i);c._wrapper.maxLines(c.maxLinesPerEntry());var n=c._wrapper.wrap(h,c._measurer,m).noLines,o=n*d,p={width:m,height:o,data:{name:a,type:"text"}};g.addColumn(p)}),e},b.prototype.requestedSpace=function(a,b){var c=this._buildLegendTable(j.Math.min([this.maxWidth(),a],a),b);return{minHeight:c.getHeight(),minWidth:c.getWidth()}},b.prototype.entitiesAt=function(a){var c=this;if(!this._isSetup)return[];var d=this._buildLegendTable(this.width(),this.height());return d.rows.reduce(function(f,g,h){if(0!==f.length)return f;var i=d.getRowBounds(h),k=j.Math.within(a,i);return k?g.columns.reduce(function(f,g,i){var k=d.getColumnBounds(h,i),l=j.Math.within(a,k);if(l){var m=c.content().selectAll("."+b.LEGEND_ROW_CLASS).nodes()[h],n=e.select(m).selectAll("."+b.LEGEND_ENTRY_CLASS).nodes()[Math.floor(i/2)],o=e.select(n).select("."+b.LEGEND_SYMBOL_CLASS),p=j.DOM.getTranslateValues(e.select(m)),q=j.DOM.getTranslateValues(o);return[{datum:g.data.name,position:{x:p[0]+q[0],y:p[1]+q[1]},selection:e.select(n),component:c}]}return f},f):f},[])},b.prototype.renderImmediately=function(){a.prototype.renderImmediately.call(this);var c=this._buildLegendTable(this.width(),this.height());this.content().selectAll("*").remove();var d=this.content().selectAll("g."+b.LEGEND_ROW_CLASS).data(c.rows),f=d.enter().append("g").classed(b.LEGEND_ROW_CLASS,!0).merge(d);d.exit().remove(),f.attr("transform",function(a,b){var d=c.getRowBounds(b);return"translate("+d.topLeft.x+", "+d.topLeft.y+")"});var g=this;return f.each(function(a,d){for(var f=[],h=0;h=this._nRows||b<0||b>=this._nCols?null:this._rows[a][b]},b.prototype.add=function(a,b,c){if(null==a)throw Error("Cannot add null to a table cell");if(!this.has(a)){var d=this._rows[b]&&this._rows[b][c];if(null!=d)throw new Error("cell is occupied");a.detach(),this._nRows=Math.max(b+1,this._nRows),this._nCols=Math.max(c+1,this._nCols),this._padTableToSize(this._nRows,this._nCols),this._rows[b][c]=a,this._adoptAndAnchor(a),this.redraw()}return this},b.prototype._remove=function(a){for(var b=0;b0&&g!==A,F=h>0&&h!==B;if(!E&&!F)break;if(x>5)break}return g=n-e.sum(i.guaranteedWidths),h=o-e.sum(i.guaranteedHeights),t=b._calcProportionalSpace(q,g),u=b._calcProportionalSpace(p,h),{colProportionalSpace:t,rowProportionalSpace:u,guaranteedWidths:i.guaranteedWidths,guaranteedHeights:i.guaranteedHeights,wantsWidth:j,wantsHeight:k}},b.prototype._determineGuarantees=function(a,b,c){void 0===c&&(c=!1);var d=f.Array.createFilledArray(0,this._nCols),e=f.Array.createFilledArray(0,this._nRows),g=f.Array.createFilledArray(!1,this._nCols),h=f.Array.createFilledArray(!1,this._nRows);return this._rows.forEach(function(f,i){f.forEach(function(f,j){var k;k=null!=f?f.requestedSpace(a[j],b[i]):{minWidth:0,minHeight:0};var l=c?Math.min(k.minWidth,a[j]):k.minWidth;d[j]=Math.max(d[j],l);var m=c?Math.min(k.minHeight,b[i]):k.minHeight;e[i]=Math.max(e[i],m);var n=k.minWidth>a[j];g[j]=g[j]||n;var o=k.minHeight>b[i];h[i]=h[i]||o})}),{guaranteedWidths:d,guaranteedHeights:e,wantsWidthArr:g,wantsHeightArr:h}},b.prototype.requestedSpace=function(a,b){return this._calculatedLayout=this._iterateLayout(a,b),{minWidth:e.sum(this._calculatedLayout.guaranteedWidths),minHeight:e.sum(this._calculatedLayout.guaranteedHeights)}},b.prototype.computeLayout=function(b,c,d){var g=this;a.prototype.computeLayout.call(this,b,c,d);var h=e.sum(this._calculatedLayout.guaranteedWidths),i=e.sum(this._calculatedLayout.guaranteedHeights),j=this._calculatedLayout;(h>this.width()||i>this.height())&&(j=this._iterateLayout(this.width(),this.height(),!0));var k=0,l=f.Array.add(j.rowProportionalSpace,j.guaranteedHeights),m=f.Array.add(j.colProportionalSpace,j.guaranteedWidths);return this._rows.forEach(function(a,b){var c=0;a.forEach(function(a,d){null!=a&&a.computeLayout({x:c,y:k},m[d],l[b]),c+=m[d]+g._columnPadding}),k+=l[b]+g._rowPadding}),this},b.prototype.rowPadding=function(a){if(null==a)return this._rowPadding;if(!f.Math.isValidNumber(a)||a<0)throw Error("rowPadding must be a non-negative finite value");return this._rowPadding=a,this.redraw(),this},b.prototype.columnPadding=function(a){if(null==a)return this._columnPadding;if(!f.Math.isValidNumber(a)||a<0)throw Error("columnPadding must be a non-negative finite value");return this._columnPadding=a,this.redraw(),this},b.prototype.rowWeight=function(a,b){if(null==b)return this._rowWeights[a];if(!f.Math.isValidNumber(b)||b<0)throw Error("rowWeight must be a non-negative finite value");return this._rowWeights[a]=b,this.redraw(),this},b.prototype.columnWeight=function(a,b){if(null==b)return this._columnWeights[a];if(!f.Math.isValidNumber(b)||b<0)throw Error("columnWeight must be a non-negative finite value");return this._columnWeights[a]=b,this.redraw(),this},b.prototype.fixedWidth=function(){var a=e.transpose(this._rows);return b._fixedSpace(a,function(a){return null==a||a.fixedWidth()})},b.prototype.fixedHeight=function(){return b._fixedSpace(this._rows,function(a){return null==a||a.fixedHeight()})},b.prototype._padTableToSize=function(a,b){for(var c=0;c0&&this._callCallbacksForEvent(c,g,f,b)}},b.prototype.eventInside=function(a,b){return this._translator.isInside(a,b)},b}(f.Dispatcher);g._DISPATCHER_KEY="__Plottable_Dispatcher_Touch",g._TOUCHSTART_EVENT_NAME="touchstart",g._TOUCHMOVE_EVENT_NAME="touchmove",g._TOUCHEND_EVENT_NAME="touchend",g._TOUCHCANCEL_EVENT_NAME="touchcancel",b.Touch=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(7),f=function(a){function b(b){var c=a.call(this,b)||this;return c._className="arc fill",c._svgElementName="path",c}return d(b,a),b.prototype._applyDefaultAttributes=function(b){a.prototype._applyDefaultAttributes.call(this,b),b.style("stroke","none")},b}(e.Drawer);b.Arc=f},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(7),f=function(a){function b(b){var c=a.call(this,b)||this;return c._className="arc outline",c._svgElementName="path",c}return d(b,a),b.prototype._applyDefaultAttributes=function(b){a.prototype._applyDefaultAttributes.call(this,b),b.style("fill","none")},b}(e.Drawer);b.ArcOutline=f},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(7),g=function(a){function b(b){var c=a.call(this,b)||this;return c._className="area",c._svgElementName="path",c}return d(b,a),b.prototype._applyDefaultAttributes=function(b){a.prototype._applyDefaultAttributes.call(this,b),b.style("stroke","none")},b.prototype.selectionForIndex=function(a){return e.select(this.selection().node())},b}(f.Drawer);b.Area=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(7),g=function(a){function b(b,c){var d=a.call(this,b)||this;return d._d3LineFactory=c,d._className="line",d._svgElementName="path",d}return d(b,a),b.prototype._applyDefaultAttributes=function(b){a.prototype._applyDefaultAttributes.call(this,b),b.style("fill","none")},b.prototype.selectionForIndex=function(a){return e.select(this.selection().node())},b.prototype._drawStepCanvas=function(a,b){var c=this.canvas().node().getContext("2d"),d=this._d3LineFactory(),f=b.attrToAppliedProjector,g=Object.keys(f).reduce(function(b,c){return b[c]=f[c](a,0),b},{});if(c.save(),c.beginPath(),d.context(c),d(a[0]),g["stroke-width"]&&(c.lineWidth=parseFloat(g["stroke-width"])),g.stroke){var h=e.color(g.stroke);g.opacity&&(h.opacity=g.opacity),c.strokeStyle=h.rgb().toString(),c.stroke()}c.restore()},b}(f.Drawer);b.Line=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(7),g=function(a){function b(b){var c=a.call(this,b)||this;return c._svgElementName="rect",c}return d(b,a),b.prototype._drawStepCanvas=function(a,b){var c=this.canvas().node().getContext("2d"),d=b.attrToAppliedProjector;c.save(),a.forEach(function(a,b){var f=Object.keys(d).reduce(function(c,e){return c[e]=d[e](a,b),c},{});if(c.beginPath(),c.rect(f.x,f.y,f.width,f.height),f["stroke-width"]&&(c.lineWidth=f["stroke-width"]),f.stroke){var g=e.color(f.stroke);f.opacity&&(g.opacity=f.opacity),c.strokeStyle=g.rgb().toString(),c.stroke()}if(f.fill){var h=e.color(f.fill);f.opacity&&(h.opacity=f.opacity),c.fillStyle=h.rgb().toString(),c.fill()}}),c.restore()},b}(f.Drawer);b.Rectangle=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(7),f=function(a){function b(b){var c=a.call(this,b)||this;return c._svgElementName="line",c}return d(b,a),b}(e.Drawer);b.Segment=f},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(7),f=function(a){function b(b){var c=a.call(this,b)||this;return c._svgElementName="path",c._className="symbol",c}return d(b,a),b}(e.Drawer);b.Symbol=f},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(13),f=c(0),g=c(15),h=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b._clickedDown=!1,b._doubleClicking=!1,b._onClickCallbacks=new f.CallbackSet,b._onDoubleClickCallbacks=new f.CallbackSet,b._mouseDownCallback=function(a,c){return b._handleClickDown(a,c)},b._mouseUpCallback=function(a,c){return b._handleClickUp(a,c)},b._dblClickCallback=function(a,c){return b._handleDblClick(a,c)},b._touchStartCallback=function(a,c,d){return b._handleClickDown(c[a[0]],d)},b._touchEndCallback=function(a,c,d){return b._handleClickUp(c[a[0]],d)},b._touchCancelCallback=function(a,c){return b._clickedDown=!1},b}return d(b,a),b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this._mouseDispatcher=e.Mouse.getDispatcher(b),this._mouseDispatcher.onMouseDown(this._mouseDownCallback),this._mouseDispatcher.onMouseUp(this._mouseUpCallback),this._mouseDispatcher.onDblClick(this._dblClickCallback),this._touchDispatcher=e.Touch.getDispatcher(b),this._touchDispatcher.onTouchStart(this._touchStartCallback),this._touchDispatcher.onTouchEnd(this._touchEndCallback),this._touchDispatcher.onTouchCancel(this._touchCancelCallback)},b.prototype._unanchor=function(){a.prototype._unanchor.call(this),this._mouseDispatcher.offMouseDown(this._mouseDownCallback),this._mouseDispatcher.offMouseUp(this._mouseUpCallback),this._mouseDispatcher.offDblClick(this._dblClickCallback),this._mouseDispatcher=null,this._touchDispatcher.offTouchStart(this._touchStartCallback),this._touchDispatcher.offTouchEnd(this._touchEndCallback),this._touchDispatcher.offTouchCancel(this._touchCancelCallback),this._touchDispatcher=null},b.prototype._handleClickDown=function(a,b){var c=this._translateToComponentSpace(a);this._isInsideComponent(c)&&(this._clickedDown=!0,this._clickedPoint=c)},b.prototype._handleClickUp=function(a,c){var d=this,e=this._translateToComponentSpace(a);this._clickedDown&&b._pointsEqual(e,this._clickedPoint)&&setTimeout(function(){d._doubleClicking||d._onClickCallbacks.callCallbacks(e,c)},0),this._clickedDown=!1},b.prototype._handleDblClick=function(a,b){var c=this,d=this._translateToComponentSpace(a);this._doubleClicking=!0,this._onDoubleClickCallbacks.callCallbacks(d,b),setTimeout(function(){return c._doubleClicking=!1},0)},b._pointsEqual=function(a,b){return a.x===b.x&&a.y===b.y},b.prototype.onClick=function(a){return this._onClickCallbacks.add(a),this},b.prototype.offClick=function(a){return this._onClickCallbacks["delete"](a),this},b.prototype.onDoubleClick=function(a){return this._onDoubleClickCallbacks.add(a),this},b.prototype.offDoubleClick=function(a){return this._onDoubleClickCallbacks["delete"](a),this},b}(g.Interaction);b.Click=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(13),f=c(0),g=c(15),h=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b._dragging=!1,b._constrainedToComponent=!0,b._dragStartCallbacks=new f.CallbackSet,b._dragCallbacks=new f.CallbackSet,b._dragEndCallbacks=new f.CallbackSet,b._mouseDownCallback=function(a,c){return b._startDrag(a,c)},b._mouseMoveCallback=function(a,c){return b._doDrag(a,c)},b._mouseUpCallback=function(a,c){return b._endDrag(a,c)},b._touchStartCallback=function(a,c,d){return b._startDrag(c[a[0]],d)},b._touchMoveCallback=function(a,c,d){return b._doDrag(c[a[0]],d)},b._touchEndCallback=function(a,c,d){return b._endDrag(c[a[0]],d)},b}return d(b,a),b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this._mouseDispatcher=e.Mouse.getDispatcher(this._componentAttachedTo),this._mouseDispatcher.onMouseDown(this._mouseDownCallback),this._mouseDispatcher.onMouseMove(this._mouseMoveCallback),this._mouseDispatcher.onMouseUp(this._mouseUpCallback),this._touchDispatcher=e.Touch.getDispatcher(this._componentAttachedTo),this._touchDispatcher.onTouchStart(this._touchStartCallback),this._touchDispatcher.onTouchMove(this._touchMoveCallback),this._touchDispatcher.onTouchEnd(this._touchEndCallback)},b.prototype._unanchor=function(){a.prototype._unanchor.call(this),this._mouseDispatcher.offMouseDown(this._mouseDownCallback),this._mouseDispatcher.offMouseMove(this._mouseMoveCallback),this._mouseDispatcher.offMouseUp(this._mouseUpCallback),this._mouseDispatcher=null,this._touchDispatcher.offTouchStart(this._touchStartCallback),this._touchDispatcher.offTouchMove(this._touchMoveCallback),this._touchDispatcher.offTouchEnd(this._touchEndCallback),this._touchDispatcher=null},b.prototype._translateAndConstrain=function(a){var b=this._translateToComponentSpace(a);return this._constrainedToComponent?{x:f.Math.clamp(b.x,0,this._componentAttachedTo.width()),y:f.Math.clamp(b.y,0,this._componentAttachedTo.height())}:b},b.prototype._startDrag=function(a,b){if(!(b instanceof MouseEvent&&0!==b.button)){var c=this._translateToComponentSpace(a);this._isInsideComponent(c)&&(b.preventDefault(),this._dragging=!0,this._dragOrigin=c,this._dragStartCallbacks.callCallbacks(this._dragOrigin))}},b.prototype._doDrag=function(a,b){this._dragging&&this._dragCallbacks.callCallbacks(this._dragOrigin,this._translateAndConstrain(a))},b.prototype._endDrag=function(a,b){b instanceof MouseEvent&&0!==b.button||this._dragging&&(this._dragging=!1,this._dragEndCallbacks.callCallbacks(this._dragOrigin,this._translateAndConstrain(a)))},b.prototype.constrainedToComponent=function(a){return null==a?this._constrainedToComponent:(this._constrainedToComponent=a,this)},b.prototype.onDragStart=function(a){return this._dragStartCallbacks.add(a),this},b.prototype.offDragStart=function(a){return this._dragStartCallbacks["delete"](a),this},b.prototype.onDrag=function(a){return this._dragCallbacks.add(a),this},b.prototype.offDrag=function(a){return this._dragCallbacks["delete"](a),this},b.prototype.onDragEnd=function(a){return this._dragEndCallbacks.add(a),this},b.prototype.offDragEnd=function(a){return this._dragEndCallbacks["delete"](a),this},b}(g.Interaction);b.Drag=h},function(a,b,c){"use strict";function d(a,b,c){return c-(c-a)*b}var e=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},f=c(1),g=c(13),h=c(3),i=c(0),j=c(14),k=c(15);b.zoomAt=d;var l=function(a){function b(b,c){var d=a.call(this)||this;return d._wheelCallback=function(a,b){return d._handleWheelEvent(a,b)},d._touchStartCallback=function(a,b,c){return d._handleTouchStart(a,b,c)},d._touchMoveCallback=function(a,b,c){return d._handlePinch(a,b,c)},d._touchEndCallback=function(a,b,c){return d._handleTouchEnd(a,b,c)},d._touchCancelCallback=function(a,b,c){return d._handleTouchEnd(a,b,c)},d._panEndCallbacks=new i.CallbackSet,d._zoomEndCallbacks=new i.CallbackSet,d._xScales=new i.Set,d._yScales=new i.Set,d._dragInteraction=new j.Drag,d._setupDragInteraction(),d._touchIds=f.map(),d._minDomainExtents=new i.Map,d._maxDomainExtents=new i.Map,d._minDomainValues=new i.Map,d._maxDomainValues=new i.Map,null!=b&&d.addXScale(b),null!=c&&d.addYScale(c),d}return e(b,a),b.prototype.pan=function(a){var b=this;this.xScales().forEach(function(c){c.pan(b._constrainedTranslation(c,a.x))}),this.yScales().forEach(function(c){c.pan(b._constrainedTranslation(c,a.y))})},b.prototype.zoom=function(a,b){this.xScales().forEach(function(c){var d=c.range(),e=void 0===b?(d[1]-d[0])/2:b.x;c.zoom(a,e)}),this.yScales().forEach(function(c){var d=c.range(),e=void 0===b?(d[1]-d[0])/2:b.y;c.zoom(a,e)})},b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this._dragInteraction.attachTo(b),this._mouseDispatcher=g.Mouse.getDispatcher(this._componentAttachedTo),this._mouseDispatcher.onWheel(this._wheelCallback),this._touchDispatcher=g.Touch.getDispatcher(this._componentAttachedTo),this._touchDispatcher.onTouchStart(this._touchStartCallback),this._touchDispatcher.onTouchMove(this._touchMoveCallback),this._touchDispatcher.onTouchEnd(this._touchEndCallback),this._touchDispatcher.onTouchCancel(this._touchCancelCallback)},b.prototype._unanchor=function(){a.prototype._unanchor.call(this),this._mouseDispatcher.offWheel(this._wheelCallback),this._mouseDispatcher=null,this._touchDispatcher.offTouchStart(this._touchStartCallback),this._touchDispatcher.offTouchMove(this._touchMoveCallback),this._touchDispatcher.offTouchEnd(this._touchEndCallback),this._touchDispatcher.offTouchCancel(this._touchCancelCallback),this._touchDispatcher=null,this._dragInteraction.detachFrom(this._componentAttachedTo)},b.prototype._handleTouchStart=function(a,b,c){for(var d=0;d0&&this._zoomEndCallbacks.callCallbacks()},b.prototype._handleWheelEvent=function(a,c){var d=this,e=this._translateToComponentSpace(a);if(this._isInsideComponent(e)){c.preventDefault();var f=c.deltaY*(c.deltaMode?b._PIXELS_PER_LINE:1),g=Math.pow(2,.002*f),h=e.x,i=e.y;this.xScales().forEach(function(a){var b=d._constrainedZoom(a,g,h);h=b.centerPoint,g=b.zoomAmount}),this.yScales().forEach(function(a){var b=d._constrainedZoom(a,g,i);i=b.centerPoint,g=b.zoomAmount}),this.zoom(g,{x:h,y:i}),this._zoomEndCallbacks.callCallbacks()}},b.prototype._isRangeReversed=function(a){var b=a.range();return b[1]1,d=c?this.maxDomainExtent(a):this.minDomainExtent(a);if(null==d)return b;var e=a.getTransformationDomain(),f=e[0],g=e[1],h=Math.abs(g-f),i=c?Math.min:Math.max;return i(b,d/h)},b.prototype._constrainZoomValues=function(a,b,c){if(b<=1)return{centerPoint:c,zoomAmount:b};var e=this._isRangeReversed(a),f=this.minDomainValue(a),g=this.maxDomainValue(a);if(null==f&&null==g)return{centerPoint:c,zoomAmount:b};var h=a.getTransformationDomain(),i=h[0],j=h[1];if(null!=g){var k=a.scaleTransformation(g),l=a.scaleTransformation(j),m=d(l,b,c);m>k!=e&&(c=this._getZoomCenterForTarget(l,b,k))}if(null!=f){var n=a.scaleTransformation(f),o=a.scaleTransformation(i),p=d(o,b,c);pk!=e||p=2)){var e={x:(null==b?c.x:b.x)-d.x,y:(null==b?c.y:b.y)-d.y};a.pan(e),b=d}}),this._dragInteraction.onDragEnd(function(){return a._panEndCallbacks.callCallbacks()})},b.prototype._constrainedTranslation=function(a,b){var c=a.getTransformationDomain(),d=c[0],e=c[1],f=this._isRangeReversed(a);if(b>0!==f){var g=this.maxDomainValue(a);if(null!=g){var h=a.scaleTransformation(e),i=a.scaleTransformation(g);b=(f?Math.max:Math.min)(h+b,i)-h}}else{var g=this.minDomainValue(a);if(null!=g){var j=a.scaleTransformation(d),k=a.scaleTransformation(g);b=(f?Math.min:Math.max)(j+b,k)-j}}return b},b.prototype._nonLinearScaleWithExtents=function(a){return!(null==this.minDomainExtent(a)||null==this.maxDomainExtent(a)||a instanceof h.Linear||a instanceof h.Time)},b.prototype.xScales=function(a){var b=this;if(null==a){var c=[];return this._xScales.forEach(function(a){c.push(a)}),c}return this._xScales=new i.Set,a.forEach(function(a){b.addXScale(a)}),this},b.prototype.yScales=function(a){var b=this;if(null==a){var c=[];return this._yScales.forEach(function(a){c.push(a)}),c}return this._yScales=new i.Set,a.forEach(function(a){b.addYScale(a)}),this},b.prototype.addXScale=function(a){return this._xScales.add(a),this},b.prototype.removeXScale=function(a){return this._xScales["delete"](a),this._minDomainExtents["delete"](a),this._maxDomainExtents["delete"](a),this._minDomainValues["delete"](a),this._maxDomainValues["delete"](a),this},b.prototype.addYScale=function(a){return this._yScales.add(a),this},b.prototype.removeYScale=function(a){return this._yScales["delete"](a),this._minDomainExtents["delete"](a),this._maxDomainExtents["delete"](a),this._minDomainValues["delete"](a),this._maxDomainValues["delete"](a),this},b.prototype.minDomainExtent=function(a,b){if(null==b)return this._minDomainExtents.get(a);if(b.valueOf()<0)throw new Error("extent must be non-negative");var c=this.maxDomainExtent(a);if(null!=c&&c.valueOf()=0&&i>=0?h>=0&&j>=0?(a=h,b=0,d=0,c=i):h<0&&j<0?(a=0,b=-j,d=0,c=g):h>=0&&j<0?(a=h,b=-j,d=0,c=g):h<0&&j>=0&&(a=1,b=1,d=1,c=Math.max(g,i)):g>=0&&i<0?h>=0&&j>=0?(a=Math.max(h,j),b=1,d=1,c=1):h<0&&j<0?(a=0,b=1,d=-i,c=g):h>=0&&j<0?(a=h,b=1,d=-i,c=1):h<0&&j>=0&&(a=j,b=1,d=1,c=g):g<0&&i>=0?h>=0&&j>=0?(a=1,b=0,d=-g,c=i):h<0&&j<0?(a=1,b=Math.max(-h,-j),d=1,c=1):h>=0&&j<0?(a=1,b=-j,d=-g,c=1):h<0&&j>=0&&(a=1,b=-h,d=1,c=i):g<0&&i<0&&(h>=0&&j>=0?(a=j,b=0,d=-g,c=0):h<0&&j<0?(a=0,b=-h,d=-i,c=0):h>=0&&j<0?(a=1,b=1,d=Math.max(h,-j),c=1):h<0&&j>=0&&(a=j,b=-h,d=1,c=0)),{x:d+c==0?0:d/(d+c)*this.width(),y:a+b==0?0:a/(a+b)*this.height()}},b.prototype._getDataToDraw=function(){var c=a.prototype._getDataToDraw.call(this);if(0===this.datasets().length)return c;var d=l.Plot._scaledAccessor(this.sectorValue()),e=this.datasets()[0],f=c.get(e),g=f.filter(function(a,c){return b._isValidData(d(a,c,e))});return c.set(e,g),c},b._isValidData=function(a){return k.Math.isValidNumber(a)&&a>=0},b.prototype._pixelPoint=function(a,c,d){var f=l.Plot._scaledAccessor(this.sectorValue());if(!b._isValidData(f(a,c,d)))return{x:NaN,y:NaN};var g=l.Plot._scaledAccessor(this.innerRadius())(a,c,d),h=l.Plot._scaledAccessor(this.outerRadius())(a,c,d),i=(g+h)/2,j=e.pie().sort(null).value(function(a,c){var e=f(a,c,d);return b._isValidData(e)?e:0}).startAngle(this._startAngle).endAngle(this._endAngle)(d.data()),k=j[c].startAngle,m=j[c].endAngle,n=(k+m)/2;return{x:i*Math.sin(n),y:-i*Math.cos(n)}},b.prototype._additionalPaint=function(a){var b=this;this._renderArea.select(".label-area").remove(),this._labelsEnabled&&k.Window.setTimeout(function(){return b._drawLabels()},a);var c=this._generateStrokeDrawSteps(),d=this._getDataToDraw();this.datasets().forEach(function(a){return b._strokeDrawers.get(a).draw(d.get(a),c)})},b.prototype._generateStrokeDrawSteps=function(){var a=this._generateAttrToProjector();return[{attrToProjector:a,animator:new g.Null}]},b.prototype._sliceIndexForPoint=function(a){var b=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2)),c=Math.acos(-a.y/b);a.x<0&&(c=2*Math.PI-c);for(var d,e=0;ec){d=e;break}if(void 0!==d){var f=this.datasets()[0],g=f.data()[d],h=this.innerRadius().accessor(g,d,f),i=this.outerRadius().accessor(g,d,f);if(b>h&&bo||y.minq)return;if(d._overlayLabel(x,y,h,c,a))return;var z=e.fill(f,h,b),A=1.6*j.Color.contrast("white",z)0},b.prototype._lineIntersectsSegment=function(a,b,c,d){var e=function(a,b,c){return(b.x-a.x)*(c.y-b.y)-(b.y-a.y)*(c.x-b.x)};return e(a,b,c)*e(a,b,d)<0},b}(i.XYPlot);j._X2_KEY="x2",j._Y2_KEY="y2",b.Segment=j},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(6),g=c(0),h=c(37),i=c(2),j=function(a){function b(){var b=a.call(this)||this;return b._baselineValue=0,b._stackingOrder="bottomup",b.addClass("stacked-area-plot"),b.attr("fill-opacity",1),b._stackingResult=new g.Map,b._stackedExtent=[],b._baselineValueProvider=function(){return[b._baselineValue]},b.croppedRenderingEnabled(!1),b}return d(b,a),b.prototype.croppedRenderingEnabled=function(b){return null==b?a.prototype.croppedRenderingEnabled.call(this):b?(g.Window.warn("Warning: Stacked Area Plot does not support cropped rendering."),this):a.prototype.croppedRenderingEnabled.call(this,b); +},b.prototype._getAnimator=function(a){return new f.Null},b.prototype._setup=function(){a.prototype._setup.call(this),this._baseline=this._renderArea.append("line").classed("baseline",!0)},b.prototype.x=function(b,c){return null==b?a.prototype.x.call(this):(null==c?a.prototype.x.call(this,b):a.prototype.x.call(this,b,c),this._updateStackExtentsAndOffsets(),this)},b.prototype.y=function(b,c){return null==b?a.prototype.y.call(this):(null==c?a.prototype.y.call(this,b):a.prototype.y.call(this,b,c),this._updateStackExtentsAndOffsets(),this)},b.prototype.stackingOrder=function(a){return null==a?this._stackingOrder:(this._stackingOrder=a,this._onDatasetUpdate(),this)},b.prototype.downsamplingEnabled=function(b){return null==b?a.prototype.downsamplingEnabled.call(this):(g.Window.warn("Warning: Stacked Area Plot does not support downsampling"),this)},b.prototype._additionalPaint=function(){var a=this.y().scale.scale(this._baselineValue),b={x1:0,y1:a,x2:this.width(),y2:a};this._getAnimator("baseline").animate(this._baseline,b)},b.prototype._updateYScale=function(){var a=this.y(),b=a&&a.scale;null!=b&&(b.addPaddingExceptionsProvider(this._baselineValueProvider),b.addIncludedValuesProvider(this._baselineValueProvider))},b.prototype._onDatasetUpdate=function(){return this._updateStackExtentsAndOffsets(),a.prototype._onDatasetUpdate.call(this),this},b.prototype._updateExtentsForProperty=function(b){a.prototype._updateExtentsForProperty.call(this,b),"x"!==b&&"y"!==b||!this._projectorsReady()||this._updateStackExtentsAndOffsets()},b.prototype._extentsForProperty=function(b){var c="y";return b===c?[this._stackedExtent]:a.prototype._extentsForProperty.call(this,b)},b.prototype._updateStackExtentsAndOffsets=function(){if(this._projectorsReady()){var a=this.datasets(),b=this.x().accessor,c=this.y().accessor,d=this._filterForProperty("y");this._checkSameDomain(a,b),this._stackingResult=g.Stacking.stack(a,b,c,this._stackingOrder),this._stackedExtent=g.Stacking.stackedExtent(this._stackingResult,b,d)}},b.prototype._checkSameDomain=function(a,c){var d=a.map(function(a){return e.set(a.data().map(function(b,d){return c(b,d,a).toString()})).values()}),f=b._domainKeys(a,c);d.some(function(a){return a.length!==f.length})&&g.Window.warn("the domains across the datasets are not the same. Plot may produce unintended behavior.")},b._domainKeys=function(a,b){var c=e.set();return a.forEach(function(a){a.data().forEach(function(d,e){c.add(b(d,e,a))})}),c.values()},b.prototype._propertyProjectors=function(){var b=this,c=a.prototype._propertyProjectors.call(this),d=this.y().accessor,e=this.x().accessor,f=function(a,b,c){return g.Stacking.normalizeKey(e(a,b,c))},h=function(a,c,e){return b.y().scale.scale(+d(a,c,e)+b._stackingResult.get(e).get(f(a,c,e)).offset)},j=function(a,c,d){return b.y().scale.scale(b._stackingResult.get(d).get(f(a,c,d)).offset)};return c.d=this._constructAreaProjector(i.Plot._scaledAccessor(this.x()),h,j),c},b.prototype._pixelPoint=function(b,c,d){var e=a.prototype._pixelPoint.call(this,b,c,d),f=this.x().accessor(b,c,d),h=this.y().accessor(b,c,d),i=this.y().scale.scale(+h+this._stackingResult.get(d).get(g.Stacking.normalizeKey(f)).offset);return{x:e.x,y:i}},b}(h.Area);b.StackedArea=j},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(4),f=c(0),g=c(23),h=function(a){function b(b){void 0===b&&(b="vertical");var c=a.call(this,b)||this;return c.addClass("stacked-bar-plot"),c._stackingOrder="bottomup",c._stackingResult=new f.Map,c._stackedExtent=[],c}return d(b,a),b.prototype.x=function(b,c){return null==b?a.prototype.x.call(this):(null==c?a.prototype.x.call(this,b):a.prototype.x.call(this,b,c),this._updateStackExtentsAndOffsets(),this)},b.prototype.y=function(b,c){return null==b?a.prototype.y.call(this):(null==c?a.prototype.y.call(this,b):a.prototype.y.call(this,b,c),this._updateStackExtentsAndOffsets(),this)},b.prototype.stackingOrder=function(a){return null==a?this._stackingOrder:(this._stackingOrder=a,this._onDatasetUpdate(),this)},b.prototype._setup=function(){a.prototype._setup.call(this),this._labelArea=this._renderArea.append("g").classed(g.Bar._LABEL_AREA_CLASS,!0);var b=new e.SvgContext(this._labelArea.node());this._measurer=new e.CacheMeasurer(b),this._writer=new e.Writer(this._measurer,b)},b.prototype._drawLabels=function(){var c=this;a.prototype._drawLabels.call(this),this._labelArea.selectAll("g").remove();var d=+this.baselineValue(),e=this._isVertical?this.x().scale:this.y().scale,g=this._isVertical?this.y().scale:this.x().scale,h=f.Stacking.stackedExtents(this._stackingResult),i=h.maximumExtents,j=h.minimumExtents,k=this._getBarPixelWidth(),l=[],m=function(a,d,e){var f=e.x,g=e.y,h=d.height,i=d.width,j=c._isVertical?i>k-2*b._LABEL_PADDING:h>k-2*b._LABEL_PADDING,l=f<0||g<0||f+i>c.width()||g+h>c.height()||j;if(!l){var m=c._labelArea.append("g").attr("transform","translate("+f+", "+g+")");m.classed("stacked-bar-label",!0);var n={xAlign:"center",yAlign:"center"};c._writer.write(a,d.width,d.height,n,m.node())}return j};i.forEach(function(a){if(a.extent!==d){var f=c.labelFormatter()(a.extent),h=c._measurer.measure(f),i=c._isVertical?h.width:h.height,j=c._isVertical?h.height:h.width,k=c._isVertical?e.scale(a.axisValue)-i/2:g.scale(a.extent)+b._STACKED_BAR_LABEL_PADDING,n=c._isVertical?g.scale(a.extent)-j-b._STACKED_BAR_LABEL_PADDING:e.scale(a.axisValue)-i/2;l.push(m(f,h,{x:k,y:n}))}}),j.forEach(function(a){if(a.extent!==d){var f=c.labelFormatter()(a.extent),h=c._measurer.measure(f),i=c._isVertical?h.width:h.height,j=c._isVertical?h.height:h.width,k=c._isVertical?e.scale(a.axisValue)-i/2:g.scale(a.extent)-j-b._STACKED_BAR_LABEL_PADDING,n=c._isVertical?g.scale(a.extent)+b._STACKED_BAR_LABEL_PADDING:e.scale(a.axisValue)-i/2;l.push(m(f,h,{x:k,y:n}))}}),l.some(function(a){return a})&&this._labelArea.selectAll("g").remove()},b.prototype._generateAttrToProjector=function(){var b=this,c=a.prototype._generateAttrToProjector.call(this),d=this._isVertical?"y":"x",e=this._isVertical?"x":"y",g=this._isVertical?this.y().scale:this.x().scale,h=this._propertyBindings.get(d).accessor,i=this._propertyBindings.get(e).accessor,j=function(a,b,c){return f.Stacking.normalizeKey(i(a,b,c))},k=function(a,c,d){return g.scale(b._stackingResult.get(d).get(j(a,c,d)).offset)},l=function(a,c,d){return g.scale(+h(a,c,d)+b._stackingResult.get(d).get(j(a,c,d)).offset)},m=function(a,b,c){return Math.abs(l(a,b,c)-k(a,b,c))};c[this._isVertical?"height":"width"]=m;var n=function(a,b,c){return+h(a,b,c)<0?k(a,b,c):l(a,b,c)};return c[d]=function(a,c,d){return b._isVertical?n(a,c,d):n(a,c,d)-m(a,c,d)},c},b.prototype._onDatasetUpdate=function(){return this._updateStackExtentsAndOffsets(),a.prototype._onDatasetUpdate.call(this),this},b.prototype._updateExtentsForProperty=function(b){a.prototype._updateExtentsForProperty.call(this,b),"x"!==b&&"y"!==b||!this._projectorsReady()||this._updateStackExtentsAndOffsets()},b.prototype._extentsForProperty=function(b){var c=this._isVertical?"y":"x";return b===c?[this._stackedExtent]:a.prototype._extentsForProperty.call(this,b)},b.prototype._updateStackExtentsAndOffsets=function(){if(this._projectorsReady()){var a=this.datasets(),b=this._isVertical?this.x().accessor:this.y().accessor,c=this._isVertical?this.y().accessor:this.x().accessor,d=this._filterForProperty(this._isVertical?"y":"x");this._stackingResult=f.Stacking.stack(a,b,c,this._stackingOrder),this._stackedExtent=f.Stacking.stackedExtent(this._stackingResult,b,d)}},b.prototype.invalidateCache=function(){a.prototype.invalidateCache.call(this),this._measurer.reset()},b}(g.Bar);h._STACKED_BAR_LABEL_PADDING=5,b.StackedBar=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(0),f=c(23),g=c(2),h=function(a){function b(){var b=a.call(this)||this;return b._connectorsEnabled=!1,b.addClass("waterfall-plot"),b}return d(b,a),b.prototype.connectorsEnabled=function(a){return null==a?this._connectorsEnabled:(this._connectorsEnabled=a,this)},b.prototype.total=function(a){return null==a?this._propertyBindings.get(b._TOTAL_KEY):(this._bindProperty(b._TOTAL_KEY,a,null),this)},b.prototype._additionalPaint=function(a){var b=this;this._connectorArea.selectAll("line").remove(),this._connectorsEnabled&&e.Window.setTimeout(function(){return b._drawConnectors()},a)},b.prototype._createNodesForDataset=function(c){var d=a.prototype._createNodesForDataset.call(this,c);return this._connectorArea=this._renderArea.append("g").classed(b._CONNECTOR_AREA_CLASS,!0),d},b.prototype._extentsForProperty=function(b){var c="y";return b===c?[this._extent]:a.prototype._extentsForProperty.call(this,b)},b.prototype._generateAttrToProjector=function(){var c=this,d=a.prototype._generateAttrToProjector.call(this),e=this.y().scale,f=g.Plot._scaledAccessor(this.total()),h=this.attr("y");null==h&&(d.y=function(a,b,d){var g=c.y().accessor(a,b,d),h=f(a,b,d);if(h)return Math.min(e.scale(g),e.scale(0));var i=c._subtotals[b];if(0===b)return g<0?e.scale(i-g):e.scale(i);var j=c._subtotals[b-1];return i>j?e.scale(i):e.scale(j)});var i=this.attr("height");return null==i&&(d.height=function(a,b,d){var g=f(a,b,d),h=c.y().accessor(a,b,d);if(g)return Math.abs(e.scale(h)-e.scale(0));var i=c._subtotals[b];if(0===b)return Math.abs(e.scale(i)-e.scale(i-h));var j=c._subtotals[b-1];return Math.abs(e.scale(i)-e.scale(j))}),d["class"]=function(a,d,e){var g="";null!=c.attr("class")&&(g=c.attr("class").accessor(a,d,e)+" ");var h=f(a,d,e);if(h)return g+b._BAR_TOTAL_CLASS;var i=c.y().accessor(a,d,e);return g+(i>0?b._BAR_GROWTH_CLASS:b._BAR_DECLINE_CLASS)},d},b.prototype._onDatasetUpdate=function(){return this._updateSubtotals(),a.prototype._onDatasetUpdate.call(this),this},b.prototype._calculateSubtotalsAndExtent=function(a){var b=this,c=Number.MAX_VALUE,d=Number.MIN_VALUE,e=0,f=!1;a.data().forEach(function(g,h){var i=b.y().accessor(g,h,a),j=b.total().accessor(g,h,a);if(j&&0!==h||(e+=i),b._subtotals.push(e),ed&&(d=e),j&&(id&&(d=i)),!f&&j){for(var k=i-e,l=0;l0&&this._subtotals[d]>this._subtotals[e]||this._subtotals[d]<0&&this._subtotals[d]>=this._subtotals[e])&&(j=a.y(f,d,c)+a.height(f,d,c)),this._connectorArea.append("line").classed(b._CONNECTOR_CLASS,!0).attr("x1",h).attr("x2",i).attr("y1",j).attr("y2",j)}},b.prototype._updateSubtotals=function(){var a=this.datasets();if(a.length>0){var b=a[a.length-1];this._subtotals=new Array,this._calculateSubtotalsAndExtent(b)}},b}(f.Bar);h._BAR_DECLINE_CLASS="waterfall-decline",h._BAR_GROWTH_CLASS="waterfall-growth",h._BAR_TOTAL_CLASS="waterfall-total",h._CONNECTOR_CLASS="connector",h._CONNECTOR_AREA_CLASS="connector-area",h._TOTAL_KEY="total",b.Waterfall=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(0),g=c(18),h=function(a){function b(c){var d,f=a.call(this)||this;switch(c){case null:case void 0:null==b._plottableColorCache&&(b._plottableColorCache=b._getPlottableColors()),d=e.scaleOrdinal().range(b._plottableColorCache);break;case"Category10":case"category10":case"10":d=e.scaleOrdinal(e.schemeCategory10);break;case"Category20":case"category20":case"20":d=e.scaleOrdinal(e.schemeCategory20);break;case"Category20b":case"category20b":case"20b":d=e.scaleOrdinal(e.schemeCategory20b);break;case"Category20c":case"category20c":case"20c":d=e.scaleOrdinal(e.schemeCategory20c);break;default:throw new Error("Unsupported ColorScale type")}return f._d3Scale=d,f}return d(b,a),b.prototype.extentOfValues=function(a){return f.Array.uniq(a)},b.prototype._getExtent=function(){return f.Array.uniq(this._getAllIncludedValues())},b.invalidateColorCache=function(){b._plottableColorCache=null},b._getPlottableColors=function(){for(var a=[],b=e.select("body").append("plottable-color-tester"),c=f.Color.colorTest(b,""),d=0,g=f.Color.colorTest(b,"plottable-colors-0");null!=g&&d0&&this._setDomain([f.Math.min(a,0),f.Math.max(a,0)]),this},b.prototype.scale=function(a){return this._d3Scale(a)},b.prototype._getDomain=function(){return this._backingScaleDomain()},b.prototype._backingScaleDomain=function(a){return null==a?this._d3Scale.domain():(this._d3Scale.domain(a),this)},b.prototype._getRange=function(){return this._colorRange},b.prototype._setRange=function(a){this._colorRange=a,this._resetScale()},b}(g.Scale);h.REDS=["#FFFFFF","#FFF6E1","#FEF4C0","#FED976","#FEB24C","#FD8D3C","#FC4E2A","#E31A1C","#B10026"],h.BLUES=["#FFFFFF","#CCFFFF","#A5FFFD","#85F7FB","#6ED3EF","#55A7E0","#417FD0","#2545D3","#0B02E1"],h.POSNEG=["#0B02E1","#2545D3","#417FD0","#55A7E0","#6ED3EF","#85F7FB","#A5FFFD","#CCFFFF","#FFFFFF","#FFF6E1","#FEF4C0","#FED976","#FEB24C","#FD8D3C","#FC4E2A","#E31A1C","#B10026"],b.InterpolatedColor=h},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(11),g=function(a){function b(){var b=a.call(this)||this;return b._d3Scale=e.scaleLinear(),b}return d(b,a),b.prototype._defaultExtent=function(){return[0,1]},b.prototype._expandSingleValueDomain=function(a){return a[0]===a[1]?[a[0]-1,a[1]+1]:a},b.prototype.scale=function(a){return this._d3Scale(a)},b.prototype.scaleTransformation=function(a){return this.scale(a)},b.prototype.invertedTransformation=function(a){return this.invert(a)},b.prototype.getTransformationDomain=function(){return this.domain()},b.prototype._getDomain=function(){return this._backingScaleDomain()},b.prototype._backingScaleDomain=function(a){return null==a?this._d3Scale.domain():(this._d3Scale.domain(a),this)},b.prototype._getRange=function(){return this._d3Scale.range()},b.prototype._setRange=function(a){this._d3Scale.range(a)},b.prototype.invert=function(a){return this._d3Scale.invert(a)},b.prototype.defaultTicks=function(){return this._d3Scale.ticks(b._DEFAULT_NUM_TICKS)},b.prototype._niceDomain=function(a,b){return this._d3Scale.copy().domain(a).nice(b).domain()},b}(f.QuantitativeScale);b.Linear=g},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(0),g=c(3),h=c(11),i=function(a){function b(b){void 0===b&&(b=10);var c=a.call(this)||this;if(c._d3Scale=e.scaleLinear(),c._base=b,c._pivot=c._base,c._setDomain(c._defaultExtent()),b<=1)throw new Error("ModifiedLogScale: The base must be > 1");return c}return d(b,a),b.prototype._adjustedLog=function(a){var b=a<0?-1:1;return a*=b,a0?[b/this._base,b*this._base]:0===b?[-this._base,this._base]:[b*this._base,b/this._base]}return a},b.prototype._getRange=function(){return this._d3Scale.range()},b.prototype._setRange=function(a){this._d3Scale.range(a)},b.prototype.defaultTicks=function(){return this._d3Scale.ticks(g.ModifiedLog._DEFAULT_NUM_TICKS)},b}(h.QuantitativeScale);b.ModifiedLog=i},function(a,b,c){"use strict";function d(a){if(a<=0)throw new Error("interval must be positive number");return function(b){var c=b.domain(),d=Math.min(c[0],c[1]),e=Math.max(c[0],c[1]),g=Math.ceil(d/a)*a,h=Math.floor((e-g)/a)+1,i=d%a===0?[]:[d],j=f.Math.range(0,h).map(function(b){return g+b*a}),k=e%a===0?[]:[e];return i.concat(j).concat(k)}}function e(){return function(a){var b=a.defaultTicks();return b.filter(function(a,c){return a%1===0||0===c||c===b.length-1})}}var f=c(0);b.intervalTickGenerator=d,b.integerTickGenerator=e},function(a,b,c){"use strict";var d=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},e=c(1),f=c(24),g=c(11),h=function(a){function b(){var b=a.call(this)||this;return b._d3Scale=e.scaleTime(),b.autoDomain(),b}return d(b,a),b.prototype.tickInterval=function(a,c){void 0===c&&(c=1);var d=e.scaleTime(),f=b.timeIntervalToD3Time(a).every(c);return d.domain(this.domain()),d.range(this.range()),d.ticks(f)},b.prototype._setDomain=function(b){if(b[1]d?c/d:d/c}function e(a,b){var c=h.color(a).brighter(b);return c.rgb().toString()}function f(a,b){a.classed(b,!0);var c=a.style("background-color");if("transparent"===c)return null;var d=/\((.+)\)/.exec(c)[1].split(",").map(function(a){var b=+a,c=b.toString(16);return b<16?"0"+c:c});if(4===d.length&&"00"===d[3])return null;var e="#"+d.join("");return a.classed(b,!1),e}function g(a){var b=h.rgb(a),c=function(a){return a/=255,a<=.03928?a/12.92:i.pow((a+.055)/1.055,2.4)},d=c(b.r),e=c(b.g),f=c(b.b);return.2126*d+.7152*e+.0722*f}var h=c(1),i=window.Math;b.contrast=d,b.lightenColor=e,b.colorTest=f},function(a,b,c){"use strict";function d(a,b){for(var c=b;null!=c&&c!==a;)c=c.parentNode;return c===a}function e(a){var b;try{b=a.node().getBBox()}catch(c){b={x:0,y:0,width:0,height:0}}return b}function f(a){null!=window.requestAnimationFrame?window.requestAnimationFrame(a):setTimeout(a,b.SCREEN_REFRESH_RATE_MILLISECONDS)}function g(a){var b=a instanceof r.selection?a.node():a,c=window.getComputedStyle(b);return q(c,"width")+q(c,"padding-left")+q(c,"padding-right")+q(c,"border-left-width")+q(c,"border-right-width")}function h(a){var b=a instanceof r.selection?a.node():a,c=window.getComputedStyle(b);return q(c,"height")+q(c,"padding-top")+q(c,"padding-bottom")+q(c,"border-top-width")+q(c,"border-bottom-width")}function i(a){var b=w.exec(a.attr("transform"));if(null!=b){var c=b[1],d=b[2],e=void 0===d?0:d;return[+c,+e]}return[0,0]}function j(a){var b=x.exec(a.attr("transform"));if(null!=b){var c=b[1];return+c}return 0}function k(a){var b=y.exec(a.attr("transform"));if(null!=b){var c=b[1],d=b[2];return[+c,null==d?+c:+d]}return[0,0]}function l(a,b){return!(s.floor(a.right)<=s.ceil(b.left))&&(!(s.ceil(a.left)>=s.floor(b.right))&&(!(s.floor(a.bottom)<=s.ceil(b.top))&&!(s.ceil(a.top)>=s.floor(b.bottom))))}function m(a,b){return{left:a.left-b,top:a.top-b,right:a.right+b,bottom:a.bottom+b,width:a.width+2*b,height:a.height+2*b}}function n(a,b){return s.floor(b.left)<=s.ceil(a.left)&&s.floor(b.top)<=s.ceil(a.top)&&s.floor(a.right)<=s.ceil(b.right)&&s.floor(a.bottom)<=s.ceil(b.bottom)}function o(a,b,c,d){void 0===d&&(d=.5);var e=p(a),f=p(b);return c.x+c.width>=e.min-d&&c.x<=e.max+d&&c.y+c.height>=f.min-d&&c.y<=f.max+d}function p(a){if("number"==typeof a){var b=a;return{min:b,max:b}}var c=a;if(c instanceof Object&&"min"in c&&"max"in c)return c;throw new Error("input '"+a+"' can't be parsed as an Range")}function q(a,b){var c=a.getPropertyValue(b),d=parseFloat(c);return d||0}var r=c(1),s=window.Math;b.contains=d,b.elementBBox=e,b.SCREEN_REFRESH_RATE_MILLISECONDS=1e3/60,b.requestAnimationFramePolyfill=f,b.elementWidth=g,b.elementHeight=h;var t="\\s",u="(?:[-+]?[0-9]*\\.?[0-9]+)",v="(?:(?:"+t+"+,?"+t+"*)|(?:,"+t+"*))",w=new RegExp("translate"+t+"*\\("+t+"*("+u+")(?:"+v+"("+u+"))?"+t+"*\\)"),x=new RegExp("rotate"+t+"*\\("+t+"*("+u+")"+t+"*\\)"),y=new RegExp("scale"+t+"*\\("+t+"*("+u+")(?:"+v+"("+u+"))?"+t+"*\\)");b.getTranslateValues=i,b.getRotate=j,b.getScaleValues=k,b.clientRectsOverlap=l,b.expandRect=m,b.clientRectInside=n,b.intersectsBBox=o},function(a,b,c){"use strict";var d=c(29),e=function(){function a(){this._entities=[]}return a.prototype.add=function(a){this._entities.push(a)},a.prototype.entityNearest=function(a,b){var c,e=1/0;if(this._entities.forEach(function(f){if(void 0===b||b(f)){var g=d.distanceSquared(f.position,a);g=0?e:f;m.has(k)?(j=m.get(k),m.set(k,j+l)):(j=0,m.set(k,l)),d.set(k,{offset:j,value:l,axisValue:b(h,i,a)})}),j.set(a,d)}),j}function e(a){var b=new i.Map,c=new i.Map;return a.forEach(function(a){a.forEach(function(a,d){var e=i.Math.max([a.offset+a.value,a.offset],a.offset),f=i.Math.min([a.offset+a.value,a.offset],a.offset);b.has(d)?b.get(d).extentf&&c.set(d,{extent:f,axisValue:a.axisValue}):c.set(d,{extent:f,axisValue:a.axisValue})})}),{maximumExtents:b,minimumExtents:c}}function f(a,b,c){var d=[];a.forEach(function(a,e){e.data().forEach(function(f,h){if(null==c||c(f,h,e)){var i=a.get(g(b(f,h,e)));d.push(i.value+i.offset)}})});var e=i.Math.max(d,0),f=i.Math.min(d,0);return[k.min(f,0),k.max(0,e)]}function g(a){return String(a)}var h=c(1),i=c(0),j=c(8);b.IStackingOrder=j.makeEnum(["topdown","bottomup"]);var k=window.Math;b.stack=d,b.stackedExtents=e,b.stackedExtent=f,b.normalizeKey=g},function(a,b,c){"use strict";function d(a){var b=a.root().rootElement().node(),c=b[h];if(null==c){var d=document.createElementNS(b.namespaceURI,"svg");d.setAttribute("class","measurer"),d.setAttribute("style","opacity: 0; visibility: hidden; position: absolute; width: 1px; height: 1px;"),b.appendChild(d),c=new i(f.select(d)),b[h]=c}return c}function e(a,b,c){a.styles({left:b+"px",top:c+"px"}),a.attrs({x:""+b,y:""+c})}var f=c(1),g=c(0),h="__Plottable_ClientTranslator";b.getTranslator=d;var i=function(){function a(a){this._measurementElement=a}return a.prototype.computePosition=function(b,c){e(this._measurementElement,0,0);var d=this._measurementElement.node().getBoundingClientRect(),f={x:d.left,y:d.top};e(this._measurementElement,a.SAMPLE_DISTANCE,a.SAMPLE_DISTANCE),d=this._measurementElement.node().getBoundingClientRect();var g={x:d.left,y:d.top};if(f.x===g.x||f.y===g.y)return null;var h=(g.x-f.x)/a.SAMPLE_DISTANCE,i=(g.y-f.y)/a.SAMPLE_DISTANCE;e(this._measurementElement,(b-f.x)/h,(c-f.y)/i),d=this._measurementElement.node().getBoundingClientRect();var j={x:d.left,y:d.top},k={x:(j.x-f.x)/h,y:(j.y-f.y)/i};return k},a.prototype.isInside=function(a,b){return g.DOM.contains(a.root().rootElement().node(),b.target)},a}();i.SAMPLE_DISTANCE=100,b.Translator=i},function(a,b,c){"use strict";function d(a){g.SHOW_WARNINGS&&null!=window.console&&(null!=window.console.warn?console.warn(a):null!=window.console.log&&console.log(a))}function e(a,b){for(var c=[],d=2;d1)throw new Error("SingleLineWrapper is designed to work only on single line");var i=function(b){return a.prototype.wrap.call(g,c,d,b,f)},j=i(e);if(j.noLines<2)return j;for(var k=0,l=e,m=0;mk;++m){var n=(l+k)/2,o=i(n);this.areSameResults(j,o)?(l=n,j=o):k=n}return j},b.prototype.areSameResults=function(a,b){return a.noLines===b.noLines&&a.truncatedText===b.truncatedText},b}(e.Wrapper);f.NO_WRAP_ITERATIONS=5,b.SingleLineWrapper=f},function(a,b,c){"use strict";var d=c(19),e={textRotation:0,textShear:0,xAlign:"left",yAlign:"top"},f=function(){function a(a,b,c){this._measurer=a,this._penFactory=b,this._wrapper=c}return a.prototype.measurer=function(a){return this._measurer=a,this},a.prototype.wrapper=function(a){return this._wrapper=a,this},a.prototype.penFactory=function(a){return this._penFactory=a,this},a.prototype.write=function(b,c,f,g,h){if(void 0===g&&(g={}),g=d.Methods.defaults({},e,g),a.SupportedRotation.indexOf(g.textRotation)===-1)throw new Error("unsupported rotation - "+g.textRotation+". Supported rotations are "+a.SupportedRotation.join(", "));if(null!=g.textShear&&g.textShear<-80||g.textShear>80)throw new Error("unsupported shear angle - "+g.textShear+". Must be between -80 and 80");var i=Math.abs(Math.abs(g.textRotation)-90)>45,j=i?c:f,k=i?f:c,l=g.textShear,m=l*Math.PI/180,n=this._measurer.measure().height,o=n*Math.tan(m),p=j/Math.cos(m)-Math.abs(o),q=k*Math.cos(m),r=d.StringMethods.combineWhitespace(b),s=this._wrapper?this._wrapper.wrap(r,this._measurer,p,q).wrappedText:r,t=s.split("\n"),u=a.XOffsetFactor[g.xAlign]*p*Math.sin(m),v=a.YOffsetFactor[g.yAlign]*(q-t.length*n),w=u-v,x=[0,0],y=g.textRotation+l;switch(g.textRotation){case 90:x=[c+w,0];break;case-90:x=[-w,f];break;case 180:x=[c,f+w];break;default:x=[0,-w]}var z=this._penFactory.createPen(b,{translate:x,rotate:y},h);this.writeLines(t,z,p,n,o,g.xAlign),null!=z.destroy&&z.destroy()},a.prototype.writeLines=function(b,c,d,e,f,g){b.forEach(function(b,h){var i=f>0?(h+1)*f:h*f,j=i+d*a.XOffsetFactor[g],k=a.AnchorConverter[g];c.write(b,k,j,(h+1)*e)})},a}();f.SupportedRotation=[-90,0,180,90],f.AnchorConverter={center:"middle",left:"start",right:"end"},f.XOffsetFactor={center:.5,left:0,right:1},f.YOffsetFactor={bottom:1,center:.5,top:0},b.Writer=f},function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}c(53);var e=c(6);b.Animators=e;var f=c(50);b.Axes=f;var g=c(31);b.Components=g;var h=c(21);b.Configs=h;var i=c(9);b.Formatters=i;var j=c(26);b.RenderController=j;var k=c(32);b.RenderPolicies=k;var l=c(27);b.SymbolFactories=l;var m=c(13);b.Dispatchers=m;var n=c(10);b.Drawers=n;var o=c(14);b.Interactions=o;var p=c(17);b.Plots=p;var q=c(3);b.Scales=q;var r=c(0);b.Utils=r,d(c(20));var s=c(24);b.TimeInterval=s.TimeInterval,d(c(5)),d(c(25)),d(c(51));var t=c(52);b.version=t.version,d(c(22)),d(c(7)),d(c(15)),d(c(33)),d(c(16)),d(c(2)),d(c(11)),d(c(18))}])}); \ No newline at end of file diff --git a/plottable.zip b/plottable.zip index 6b534f03e2..6b69fee7dd 100644 Binary files a/plottable.zip and b/plottable.zip differ