diff --git a/bower.json b/bower.json index 0ff5bcf2f2..e844f54665 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "plottable", "description": "A library for creating charts out of D3", - "version": "0.17.0", + "version": "0.18.0", "main": ["plottable.js", "plottable.css"], "license": "MIT", "ignore": [ diff --git a/package.json b/package.json index e87913ef93..343ab55313 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plottable.js", - "version": "0.17.0", + "version": "0.18.0", "description": "Build flexible, performant, interactive charts using D3", "repository": { "type": "git", diff --git a/plottable.js b/plottable.js index cae5d21343..35a8540e9f 100644 --- a/plottable.js +++ b/plottable.js @@ -1,5 +1,5 @@ /*! -Plottable 0.17.0 (https://github.com/palantir/plottable) +Plottable 0.18.0 (https://github.com/palantir/plottable) Copyright 2014 Palantir Technologies Licensed under MIT (https://github.com/palantir/plottable/blob/master/LICENSE) */ diff --git a/plottable.min.js b/plottable.min.js index dab2f46d67..b0ed615d96 100644 --- a/plottable.min.js +++ b/plottable.min.js @@ -1,4 +1,4 @@ -var Plottable;!function(a){!function(a){!function(a){function b(a,b,c){return Math.min(b,c)<=a&&a<=Math.max(b,c)}function c(a,b){if(a.length!==b.length)throw new Error("attempted to add arrays of unequal length");return a.map(function(c,d){return a[d]+b[d]})}function d(a,b){var c=d3.set();return a.forEach(function(a){b.has(a)&&c.add(a)}),c}function e(a){return"function"==typeof a?a:"string"==typeof a&&"#"!==a[0]?function(b){return b[a]}:function(){return a}}function f(a,b){var c=e(a);return function(a,d){return c(a,d,b.metadata())}}function g(a){var b={};return a.forEach(function(a){return b[a]=!0}),d3.keys(b)}function h(a,b){for(var c=[],d=0;b>d;d++)c[d]="function"==typeof a?a(d):a;return c}function i(a){return Array.prototype.concat.apply([],a)}a.inRange=b,a.addArrays=c,a.intersection=d,a.accessorize=e,a.applyAccessor=f,a.uniq=g,a.createFilledArray=h,a.flatten=i}(a.Methods||(a.Methods={}));a.Methods}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(a){function b(a,b,c){for(var d=0,e=b.length;e>d;){var f=d+e>>>1,g=null==c?b[f]:c(b[f]);a>g?d=f+1:e=f}return d}a.sortedIndex=b}(a.OpenSource||(a.OpenSource={}));a.OpenSource}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){this.counter={}}return a.prototype.setDefault=function(a){null==this.counter[a]&&(this.counter[a]=0)},a.prototype.increment=function(a){return this.setDefault(a),++this.counter[a]},a.prototype.decrement=function(a){return this.setDefault(a),--this.counter[a]},a.prototype.get=function(a){return this.setDefault(a),this.counter[a]},a}();a.IDCounter=b}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){this.keyValuePairs=[]}return a.prototype.set=function(a,b){if(a!==a)throw new Error("NaN may not be used as a key to the StrictEqualityAssociativeArray");for(var c=0;cb){var h=e("."),i=Math.floor(b/h);return"...".substr(0,i)}for(;f+g>b;)d=d.substr(0,d.length-1).trim(),f=e(d);if(e(d+"...")>b)throw new Error("addEllipsesToLine failed :(");return d+"..."}function h(b,c,d,e,f,g){"undefined"==typeof f&&(f="left"),"undefined"==typeof g&&(g="top");var h={left:0,center:.5,right:1},i={top:0,center:.5,bottom:1};if(void 0===h[f]||void 0===i[g])throw new Error("unrecognized alignment x:"+f+", y:"+g);var j=c.append("g"),k=j.append("text");k.text(b);var l=a.Util.DOM.getBBox(k),m=l.height,n=l.width;if(n>d||m>e)return console.log("Insufficient space to fit text"),[0,0];var o={left:"start",center:"middle",right:"end"},p=o[f],q=d*h[f],r=e*i[g]+m*(1-i[g]),s=-.4*(1-i[g]);return k.attr("text-anchor",p).attr("y",s+"em"),a.Util.DOM.translate(j,q,r),[n,m]}function i(a,b,c,d,e,f,g){if("undefined"==typeof e&&(e="left"),"undefined"==typeof f&&(f="top"),"undefined"==typeof g&&(g="right"),"right"!==g&&"left"!==g)throw new Error("unrecognized rotation: "+g);var i="right"===g,j={left:"bottom",right:"top",center:"center",top:"left",bottom:"right"},k={left:"top",right:"bottom",center:"center",top:"right",bottom:"left"},l=i?j:k,m=b.append("g"),n=h(a,m,d,c,l[f],l[e]),o=d3.transform("");return o.rotate="right"===g?90:-90,o.translate=[i?c:0,i?0:d],m.attr("transform",o.toString()),[n[1],n[0]]}function j(b,c,d,f,g,i){"undefined"==typeof g&&(g="left"),"undefined"==typeof i&&(i="top");var j=e(c),k=0,l=c.append("g");b.forEach(function(b,c){var e=l.append("g");a.Util.DOM.translate(e,0,c*j);var f=h(b,e,d,j,g,i);f[0]>k&&(k=f[0])});var m=j*b.length,n=f-m,o={center:.5,top:0,bottom:1};return a.Util.DOM.translate(l,0,n*o[i]),[k,m]}function k(b,c,d,f,g,h,j){"undefined"==typeof g&&(g="left"),"undefined"==typeof h&&(h="top"),"undefined"==typeof j&&(j="left");var k=e(c),l=0,m=c.append("g");b.forEach(function(b,c){var d=m.append("g");a.Util.DOM.translate(d,c*k,0);var e=i(b,d,k,f,g,h,j);e[1]>l&&(l=e[1])});var n=k*b.length,o=d-n,p={center:.5,left:0,right:1};return a.Util.DOM.translate(m,o*p[g],0),[n,l]}function l(b,d,e,f,g,h,i){var l=null!=i?i:1.1*e>f,m=d.append("g").classed("writeText-inner-g",!0),n=l?e:f,o=l?f:e,p=c(m),q=a.Util.WordWrap.breakTextToFitRect(b,n,o,p),r=l?j:k,s=r(q.lines,m,e,f,g,h);return{textFits:q.textFits,usedWidth:s[0],usedHeight:s[1]}}b.getTextMeasure=c,b.getTruncatedText=d,b.getTextHeight=e,b.getTextWidth=f,b.addEllipsesToLine=g,b.writeLineHorizontally=h,b.writeLineVertically=i,b.writeTextHorizontally=j,b.writeTextVertically=k,b.writeText=l}(b.Text||(b.Text={}));b.Text}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){function c(b,c,e,f){var g=function(a){return f(a)[0]},h=d(b,c,g),i=f("hello world")[1],j=Math.floor(e/i),k=j>=h.length;return k||(h=h.splice(0,j),j>0&&(h[j-1]=a.Util.Text.addEllipsesToLine(h[j-1],c,f))),{originalText:b,lines:h,textFits:k}}function d(a,b,c){for(var d=[],e=a.split("\n"),g=0,h=e.length;h>g;g++){var i=e[g];null!==i?d=d.concat(f(i,b,c)):d.push("")}return d}function e(a,b,c){var d=h(a),e=d.map(c),f=d3.max(e);return b>=f}function f(a,b,c){for(var d,e=[],f=h(a),i="",j=0;d||je;e++){var g=a[e];""===c||j(c[0],g,d)?c+=g:(b.push(c),c=g),d=g}return c&&b.push(c),b}function i(a){return null==a?!0:""===a.trim()}function j(a,b,c){return m.test(a)&&m.test(b)?!0:m.test(a)||m.test(b)?!1:l.test(c)||k.test(b)?!1:!0}var k=/[{\[]/,l=/[!"%),-.:;?\]}]/,m=/^\s+$/;b.breakTextToFitRect=c,b.breakTextToFitWidth=d,b.canWrapWithoutBreakingWords=e}(b.WordWrap||(b.WordWrap={}));b.WordWrap}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(a){function b(a){return a.node().getBBox()}function c(b){null!=window.requestAnimationFrame?window.requestAnimationFrame(b):setTimeout(b,a.POLYFILL_TIMEOUT_MSEC)}function d(a,b){var c=a.getPropertyValue(b);return null==c?0:parseFloat(c)}function e(a){for(var b=a.node();null!==b&&"svg"!==b.nodeName;)b=b.parentNode;return null==b}function f(a){var b=window.getComputedStyle(a);return d(b,"width")+d(b,"padding-left")+d(b,"padding-right")+d(b,"border-left-width")+d(b,"border-right-width")}function g(a){var b=window.getComputedStyle(a);return d(b,"height")+d(b,"padding-top")+d(b,"padding-bottom")+d(b,"border-top-width")+d(b,"border-bottom-width")}function h(a){var b=a.node().clientWidth;if(0===b){var c=a.attr("width");if(-1!==c.indexOf("%")){for(var d=a.node().parentNode;null!=d&&0===d.clientWidth;)d=d.parentNode;if(null==d)throw new Error("Could not compute width of element");b=d.clientWidth*parseFloat(c)/100}else b=parseFloat(c)}return b}function i(a,b,c){var d=d3.transform(a.attr("transform"));return null==b?d.translate:(c=null==c?0:c,d.translate[0]=b,d.translate[1]=c,a.attr("transform",d.toString()),a)}a.getBBox=b,a.POLYFILL_TIMEOUT_MSEC=1e3/60,a.requestAnimationFramePolyfill=c,a.isSelectionRemovedFromSVG=e,a.getElementWidth=f,a.getElementHeight=g,a.getSVGPixelWidth=h,a.translate=i}(a.DOM||(a.DOM={}));a.DOM}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(a){this._onlyShowUnchanged=!0,this._precision=a}return a.prototype.format=function(a){var b=this._formatFunction(a);return this._onlyShowUnchanged&&this._valueChanged(a,b)?"":b},a.prototype._valueChanged=function(a,b){return a!==parseFloat(b)},a.prototype.precision=function(a){return void 0===a?this._precision:(this._precision=a,this)},a.prototype.showOnlyUnchangedValues=function(a){return void 0===a?this._onlyShowUnchanged:(this._onlyShowUnchanged=a,this)},a}();a.Formatter=b}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.call(this,null),this.showOnlyUnchangedValues(!1),this._formatFunction=function(a){return String(a)}}return __extends(b,a),b}(a.Abstract.Formatter);b.Identity=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){"undefined"==typeof b&&(b=3),a.call(this,b),this._formatFunction=function(a){if("number"==typeof a){var b=Math.pow(10,this._precision);return String(Math.round(a*b)/b)}return String(a)}}return __extends(b,a),b.prototype._valueChanged=function(a,b){return"number"==typeof a?a!==parseFloat(b):!1},b}(a.Abstract.Formatter);b.General=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){"undefined"==typeof b&&(b=3),a.call(this,b),this._formatFunction=function(a){return a.toFixed(this._precision)}}return __extends(b,a),b}(a.Abstract.Formatter);b.Fixed=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c,d){"undefined"==typeof b&&(b=2),"undefined"==typeof c&&(c="$"),"undefined"==typeof d&&(d=!0),a.call(this,b),this.symbol=c,this.prefix=d}return __extends(b,a),b.prototype.format=function(b){var c=a.prototype.format.call(this,Math.abs(b));return""!==c&&(this.prefix?c=this.symbol+c:c+=this.symbol,0>b&&(c="-"+c)),c},b}(a.Formatter.Fixed);b.Currency=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){"undefined"==typeof b&&(b=0),a.call(this,b)}return __extends(b,a),b.prototype.format=function(b){var c=a.prototype.format.call(this,100*b);return""!==c&&(c+="%"),c},b}(a.Formatter.Fixed);b.Percentage=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c){a.call(this,b),this._onlyShowUnchanged=!1,this._formatFunction=function(a){return c(a,this)}}return __extends(b,a),b}(a.Abstract.Formatter);b.Custom=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){this._plottableID=a.nextID++}return a.nextID=0,a}();a.PlottableObject=b}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c){b.call(this),this.listener2Callback=new a.Util.StrictEqualityAssociativeArray,this.listenable=c}return __extends(c,b),c.prototype.registerListener=function(a,b){return this.listener2Callback.set(a,b),this},c.prototype.broadcast=function(){for(var a=this,b=[],c=0;c=0&&(this._components.splice(b,1),this._invalidateLayout()),this},b.prototype._addComponent=function(a,b){return"undefined"==typeof b&&(b=!1),null==a||this._components.indexOf(a)>=0?!1:(b?this._components.unshift(a):this._components.push(a),a._parent=this,this._isAnchored&&a._anchor(this.content),this._invalidateLayout(),!0)},b.prototype.components=function(){return this._components.slice()},b.prototype.empty=function(){return 0===this._components.length},b.prototype.removeAll=function(){return this._components.slice().forEach(function(a){return a.remove()}),this},b}(a.Abstract.Component);b.ComponentContainer=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){"undefined"==typeof b&&(b=[]);var c=this;a.call(this),this.classed("component-group",!0),b.forEach(function(a){return c._addComponent(a)})}return __extends(b,a),b.prototype._requestedSpace=function(a,b){var c=this._components.map(function(c){return c._requestedSpace(a,b)}),d=this.empty(),e=d?0:d3.max(c,function(a){return a.width}),f=d?0:d3.max(c,function(a){return a.height});return{width:Math.min(e,a),height:Math.min(f,b),wantsWidth:d?!1:c.map(function(a){return a.wantsWidth}).some(function(a){return a}),wantsHeight:d?!1:c.map(function(a){return a.wantsHeight}).some(function(a){return a})}},b.prototype.merge=function(a){return this._addComponent(a),this},b.prototype._computeLayout=function(b,c,d,e){var f=this;return a.prototype._computeLayout.call(this,b,c,d,e),this._components.forEach(function(a){a._computeLayout(0,0,f.availableWidth,f.availableHeight)}),this},b.prototype._isFixedWidth=function(){return this._components.every(function(a){return a._isFixedWidth()})},b.prototype._isFixedHeight=function(){return this._components.every(function(a){return a._isFixedHeight()})},b}(a.Abstract.ComponentContainer);b.Group=c}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a){"undefined"==typeof a&&(a=[]);var c=this;b.call(this),this.rowPadding=0,this.colPadding=0,this.rows=[],this.rowWeights=[],this.colWeights=[],this.nRows=0,this.nCols=0,this.classed("table",!0),a.forEach(function(a,b){a.forEach(function(a,d){c.addComponent(b,d,a)})})}return __extends(c,b),c.prototype.addComponent=function(a,b,c){if(this._addComponent(c)){this.nRows=Math.max(a+1,this.nRows),this.nCols=Math.max(b+1,this.nCols),this.padTableToSize(this.nRows,this.nCols);var d=this.rows[a][b];if(null!=d)throw new Error("Table.addComponent cannot be called on a cell where a component already exists (for the moment)");this.rows[a][b]=c}return this},c.prototype._removeComponent=function(a){b.prototype._removeComponent.call(this,a);var c,d;a:for(var e=0;e0&&v&&e!==x,C=f>0&&w&&f!==y;if(!B&&!C)break;if(r>5)break}return e=h-d3.sum(u.guaranteedWidths),f=i-d3.sum(u.guaranteedHeights),n=c.calcProportionalSpace(k,e),o=c.calcProportionalSpace(j,f),{colProportionalSpace:n,rowProportionalSpace:o,guaranteedWidths:u.guaranteedWidths,guaranteedHeights:u.guaranteedHeights,wantsWidth:v,wantsHeight:w}},c.prototype.determineGuarantees=function(b,c){var d=a.Util.Methods.createFilledArray(0,this.nCols),e=a.Util.Methods.createFilledArray(0,this.nRows),f=a.Util.Methods.createFilledArray(!1,this.nCols),g=a.Util.Methods.createFilledArray(!1,this.nRows);return this.rows.forEach(function(a,h){a.forEach(function(a,i){var j;if(j=null!=a?a._requestedSpace(b[i],c[h]):{width:0,height:0,wantsWidth:!1,wantsHeight:!1},j.width>b[i]||j.height>c[h])throw new Error("Invariant Violation: Abstract.Component cannot request more space than is offered");d[i]=Math.max(d[i],j.width),e[h]=Math.max(e[h],j.height),f[i]=f[i]||j.wantsWidth,g[h]=g[h]||j.wantsHeight})}),{guaranteedWidths:d,guaranteedHeights:e,wantsWidthArr:f,wantsHeightArr:g}},c.prototype._requestedSpace=function(a,b){var c=this.iterateLayout(a,b);return{width:d3.sum(c.guaranteedWidths),height:d3.sum(c.guaranteedHeights),wantsWidth:c.wantsWidth,wantsHeight:c.wantsHeight}},c.prototype._computeLayout=function(c,d,e,f){var g=this;b.prototype._computeLayout.call(this,c,d,e,f);var h=this.iterateLayout(this.availableWidth,this.availableHeight),i=a.Util.Methods.addArrays(h.rowProportionalSpace,h.guaranteedHeights),j=a.Util.Methods.addArrays(h.colProportionalSpace,h.guaranteedWidths),k=0;return this.rows.forEach(function(a,b){var c=0;a.forEach(function(a,d){null!=a&&a._computeLayout(c,k,j[d],i[b]),c+=j[d]+g.colPadding}),k+=i[b]+g.rowPadding}),this},c.prototype.padding=function(a,b){return this.rowPadding=a,this.colPadding=b,this._invalidateLayout(),this},c.prototype.rowWeight=function(a,b){return this.rowWeights[a]=b,this._invalidateLayout(),this},c.prototype.colWeight=function(a,b){return this.colWeights[a]=b,this._invalidateLayout(),this},c.prototype._isFixedWidth=function(){var a=d3.transpose(this.rows);return c.fixedSpace(a,function(a){return null==a||a._isFixedWidth()})},c.prototype._isFixedHeight=function(){return c.fixedSpace(this.rows,function(a){return null==a||a._isFixedHeight()})},c.prototype.padTableToSize=function(a,b){for(var c=0;a>c;c++){void 0===this.rows[c]&&(this.rows[c]=[],this.rowWeights[c]=null);for(var d=0;b>d;d++)void 0===this.rows[c][d]&&(this.rows[c][d]=null)}for(d=0;b>d;d++)void 0===this.colWeights[d]&&(this.colWeights[d]=null)},c.calcComponentWeights=function(a,b,c){return a.map(function(a,d){if(null!=a)return a;var e=b[d].map(c),f=e.reduce(function(a,b){return a&&b},!0);return f?0:1})},c.calcProportionalSpace=function(b,c){var d=d3.sum(b);return 0===d?a.Util.Methods.createFilledArray(0,b.length):b.map(function(a){return c*a/d})},c.fixedSpace=function(a,b){var c=function(a){return a.reduce(function(a,b){return a&&b},!0)},d=function(a){return c(a.map(b))};return c(a.map(d))},c}(a.Abstract.ComponentContainer);b.Table=c}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c){b.call(this),this._autoDomainAutomatically=!0,this.broadcaster=new a.Core.Broadcaster(this),this._rendererAttrID2Extent={},this._d3Scale=c}return __extends(c,b),c.prototype._getAllExtents=function(){return d3.values(this._rendererAttrID2Extent)},c.prototype._getExtent=function(){return[]},c.prototype.autoDomain=function(){return this._setDomain(this._getExtent()),this},c.prototype.scale=function(a){return this._d3Scale(a)},c.prototype.domain=function(a){return null==a?this._d3Scale.domain():(this._autoDomainAutomatically=!1,this._setDomain(a),this)},c.prototype._setDomain=function(a){if(1/0===a[0]||a[0]===-1/0||1/0===a[1]||a[1]===-1/0)throw new Error("data cannot contain Infinity or -Infinity");this._d3Scale.domain(a),this.broadcaster.broadcast()},c.prototype.range=function(a){return null==a?this._d3Scale.range():(this._d3Scale.range(a),this)},c.prototype.copy=function(){return new c(this._d3Scale.copy())},c.prototype.updateExtent=function(a,b,c){return this._rendererAttrID2Extent[a+b]=c,this._autoDomainAutomatically&&this.autoDomain(),this},c.prototype.removeExtent=function(a,b){return delete this._rendererAttrID2Extent[a+b],this._autoDomainAutomatically&&this.autoDomain(),this},c}(a.Abstract.PlottableObject);b.Scale=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c){b.call(this),this._dataChanged=!1,this._animate=!1,this._animators={},this._ANIMATION_DURATION=250,this._projectors={},this._rerenderUpdateSelection=!1,this._requireRerender=!1,this.clipPathEnabled=!0,this.classed("renderer",!0); -var d;d=null!=c?"function"==typeof c.data?c:d=new a.DataSource(c):new a.DataSource,this.dataSource(d)}return __extends(c,b),c.prototype._anchor=function(a){return b.prototype._anchor.call(this,a),this._dataChanged=!0,this},c.prototype.dataSource=function(a){var b=this;if(null==a)return this._dataSource;var c=this._dataSource;return null!=c&&(this._dataSource.broadcaster.deregisterListener(this),this._requireRerender=!0,this._rerenderUpdateSelection=!0),this._dataSource=a,this._dataSource.broadcaster.registerListener(this,function(){b.updateAllProjectors(),b._dataChanged=!0,b._render()}),this.updateAllProjectors(),this._dataChanged=!0,this._render(),this},c.prototype.project=function(a,b,c){var d=this;a=a.toLowerCase();var e=this._projectors[a],f=null!=e?e.scale:null;return null!=f&&(f.removeExtent(this._plottableID,a),f.broadcaster.deregisterListener(this)),null!=c&&c.broadcaster.registerListener(this,function(){return d._render()}),this._projectors[a]={accessor:b,scale:c},this._requireRerender=!0,this._rerenderUpdateSelection=!0,this.updateProjector(a),this},c.prototype._generateAttrToProjector=function(){var b=this,c={};return d3.keys(this._projectors).forEach(function(d){var e=b._projectors[d],f=a.Util.Methods.applyAccessor(e.accessor,b.dataSource()),g=e.scale,h=null==g?f:function(a,b){return g.scale(f(a,b))};c[d]=h}),c},c.prototype._doRender=function(){return null!=this.element&&(this._paint(),this._dataChanged=!1,this._requireRerender=!1,this._rerenderUpdateSelection=!1),this},c.prototype._paint=function(){},c.prototype._setup=function(){return b.prototype._setup.call(this),this.renderArea=this.content.append("g").classed("render-area",!0),this},c.prototype.animate=function(a){return this._animate=a,this},c.prototype.updateAllProjectors=function(){var a=this;return d3.keys(this._projectors).forEach(function(b){return a.updateProjector(b)}),this},c.prototype.updateProjector=function(a){var b=this._projectors[a];if(null!=b.scale){var c=this.dataSource()._getExtent(b.accessor);0===c.length?b.scale.removeExtent(this._plottableID,a):b.scale.updateExtent(this._plottableID,a,c)}return this},c.prototype._applyAnimatedAttributes=function(b,c,d){return this._animate&&null!=this._animators[c]&&!a.Core.ResizeBroadcaster.resizing()?this._animators[c].animate(b,d,this):b.attr(d)},c.prototype.animator=function(a,b){return void 0===b?this._animators[a]:(this._animators[a]=b,this)},c}(a.Abstract.Component);b.Plot=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){!function(b){var c=function(){function b(){}return b.prototype.render=function(){a.Core.RenderController.flush()},b}();b.Immediate=c;var d=function(){function b(){}return b.prototype.render=function(){a.Util.DOM.requestAnimationFramePolyfill(a.Core.RenderController.flush)},b}();b.AnimationFrame=d;var e=function(){function b(){this._timeoutMsec=a.Util.DOM.POLYFILL_TIMEOUT_MSEC}return b.prototype.render=function(){setTimeout(a.Core.RenderController.flush,this._timeoutMsec)},b}();b.Timeout=e}(b.RenderPolicy||(b.RenderPolicy={}));b.RenderPolicy}(b.RenderController||(b.RenderController={}));b.RenderController}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){function c(a){b._renderPolicy=a}function d(a){h[a._plottableID]=a,f()}function e(a){i[a._plottableID]=a,h[a._plottableID]=a,f()}function f(){j||(j=!0,b._renderPolicy.render())}function g(){if(j){var b=d3.values(i);b.forEach(function(a){return a._computeLayout()});var c=d3.values(h);c.forEach(function(a){return a._render()}),c=d3.values(h),c.forEach(function(a){return a._doRender()}),i={},h={},j=!1}a.Core.ResizeBroadcaster.clearResizing()}var h={},i={},j=!1;b._renderPolicy=new a.Core.RenderController.RenderPolicy.AnimationFrame,b.setRenderPolicy=c,b.registerToRender=d,b.registerToComputeLayout=e,b.flush=g}(b.RenderController||(b.RenderController={}));b.RenderController}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){function c(){void 0===i&&(i=new a.Core.Broadcaster(b),window.addEventListener("resize",d))}function d(){j=!0,i.broadcast()}function e(){return j}function f(){j=!1}function g(a){c(),i.registerListener(a._plottableID,function(){return a._invalidateLayout()})}function h(a){i&&i.deregisterListener(a._plottableID)}var i,j=!1;b.resizing=e,b.clearResizing=f,b.register=g,b.deregister=h}(b.ResizeBroadcaster||(b.ResizeBroadcaster={}));b.ResizeBroadcaster}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(){}(Plottable||(Plottable={}));var Plottable;!function(a){var b=function(){function a(b){"undefined"==typeof b&&(b=a.defaultCombineExtents),this.doNice=!1,this.padProportion=0,this.paddingExceptions=d3.set([]),this.combineExtents=b}return a.prototype.computeDomain=function(a,b){return this.niceDomain(b,this.padDomain(this.combineExtents(a)))},a.prototype.pad=function(a){return"undefined"==typeof a&&(a=.05),this.padProportion=a,this},a.prototype.paddingException=function(a,b){return"undefined"==typeof b&&(b=!0),b?this.paddingExceptions.add(a):this.paddingExceptions.remove(a),this},a.prototype.nice=function(a){return this.doNice=!0,this.niceCount=a,this},a.defaultCombineExtents=function(a){return 0===a.length?[0,1]:[d3.min(a,function(a){return a[0]}),d3.max(a,function(a){return a[1]})]},a.prototype.padDomain=function(b){if(b[0]===b[1]&&this.padProportion>0){var c=b[0].valueOf();return b[0]instanceof Date?[c-a.ONE_DAY,c+a.ONE_DAY]:[c-a.PADDING_FOR_IDENTICAL_DOMAIN,c+a.PADDING_FOR_IDENTICAL_DOMAIN]}var d=b[1]-b[0],e=[b[0].valueOf()-this.padProportion/2*d,b[1].valueOf()+this.padProportion/2*d];return this.paddingExceptions.has(b[0])&&(e[0]=b[0]),this.paddingExceptions.has(b[1])&&(e[1]=b[1]),e},a.prototype.niceDomain=function(a,b){return this.doNice?a._niceDomain(b,this.niceCount):b},a.PADDING_FOR_IDENTICAL_DOMAIN=1,a.ONE_DAY=864e5,a}();a.Domainer=b}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c){b.call(this,c),this.lastRequestedTickCount=10,this._PADDING_FOR_IDENTICAL_DOMAIN=1,this._userSetDomainer=!1,this._domainer=new a.Domainer}return __extends(c,b),c.prototype.autoDomain=function(){return this._setDomain(this._domainer.computeDomain(this._getAllExtents(),this)),this},c.prototype.invert=function(a){return this._d3Scale.invert(a)},c.prototype.copy=function(){return new c(this._d3Scale.copy())},c.prototype.domain=function(a){return b.prototype.domain.call(this,a)},c.prototype.interpolate=function(a){return null==a?this._d3Scale.interpolate():(this._d3Scale.interpolate(a),this)},c.prototype.rangeRound=function(a){return this._d3Scale.rangeRound(a),this},c.prototype.clamp=function(a){return null==a?this._d3Scale.clamp():(this._d3Scale.clamp(a),this)},c.prototype.ticks=function(a){return null!=a&&(this.lastRequestedTickCount=a),this._d3Scale.ticks(this.lastRequestedTickCount)},c.prototype.tickFormat=function(a,b){return this._d3Scale.tickFormat(a,b)},c.prototype._niceDomain=function(a,b){return this._d3Scale.copy().domain(a).nice(b).domain()},c.prototype.domainer=function(a){return null==a?this._domainer:(this._domainer=a,this._userSetDomainer=!0,this._autoDomainAutomatically&&this.autoDomain(),this)},c}(a.Abstract.Scale);b.QuantitiveScale=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){a.call(this,null==b?d3.scale.linear():b)}return __extends(b,a),b.prototype.copy=function(){return new b(this._d3Scale.copy())},b}(a.Abstract.QuantitiveScale);b.Linear=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){a.call(this,null==b?d3.scale.log():b)}return __extends(b,a),b.prototype.copy=function(){return new b(this._d3Scale.copy())},b}(a.Abstract.QuantitiveScale);b.Log=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a){if(b.call(this,null==a?d3.scale.ordinal():a),this._range=[0,1],this._rangeType="bands",this._innerPadding=.3,this._outerPadding=.5,this._innerPadding>this._outerPadding)throw new Error("outerPadding must be >= innerPadding so cat axis bands work out reasonably")}return __extends(c,b),c.prototype._getExtent=function(){var b=this._getAllExtents();return a.Util.Methods.uniq(a.Util.Methods.flatten(b))},c.prototype.domain=function(a){return b.prototype.domain.call(this,a)},c.prototype._setDomain=function(a){b.prototype._setDomain.call(this,a),this.range(this.range())},c.prototype.range=function(a){return null==a?this._range:(this._range=a,"points"===this._rangeType?this._d3Scale.rangePoints(a,2*this._outerPadding):"bands"===this._rangeType&&this._d3Scale.rangeBands(a,this._innerPadding,this._outerPadding),this)},c.prototype.rangeBand=function(){return this._d3Scale.rangeBand()},c.prototype.innerPadding=function(){var a=this.domain();if(a.length<2)return 0;var b=Math.abs(this.scale(a[1])-this.scale(a[0]));return b-this.rangeBand()},c.prototype.fullBandStartAndWidth=function(a){var b=this.scale(a)-this.innerPadding()/2,c=this.rangeBand()+this.innerPadding();return[b,c]},c.prototype.rangeType=function(a,b,c){if(null==a)return this._rangeType;if("points"!==a&&"bands"!==a)throw new Error("Unsupported range type: "+a);return this._rangeType=a,null!=b&&(this._outerPadding=b),null!=c&&(this._innerPadding=c),this.broadcaster.broadcast(),this},c}(a.Abstract.Scale);b.Ordinal=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a){var c;switch(a){case"Category10":case"category10":case"10":c=d3.scale.category10();break;case"Category20":case"category20":case"20":c=d3.scale.category20();break;case"Category20b":case"category20b":case"20b":c=d3.scale.category20b();break;case"Category20c":case"category20c":case"20c":c=d3.scale.category20c();break;case null:case void 0:c=d3.scale.ordinal();break;default:throw new Error("Unsupported ColorScale type")}b.call(this,c)}return __extends(c,b),c.prototype._getExtent=function(){var b=this._getAllExtents(),c=[];return b.forEach(function(a){c=c.concat(a)}),a.Util.Methods.uniq(c)},c}(a.Abstract.Scale);b.Color=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.call(this,d3.time.scale()),this._PADDING_FOR_IDENTICAL_DOMAIN=864e5}return __extends(b,a),b.prototype._setDomain=function(b){a.prototype._setDomain.call(this,b.map(function(a){return new Date(a)}))},b}(a.Abstract.QuantitiveScale);b.Time=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(c,d){"undefined"==typeof c&&(c="reds"),"undefined"==typeof d&&(d="linear"),this._colorRange=this._resolveColorValues(c),this._scaleType=d,a.call(this,b.getD3InterpolatedScale(this._colorRange,this._scaleType))}return __extends(b,a),b.getD3InterpolatedScale=function(a,c){var d;switch(c){case"linear":d=d3.scale.linear();break;case"log":d=d3.scale.log();break;case"sqrt":d=d3.scale.sqrt();break;case"pow":d=d3.scale.pow()}if(null==d)throw new Error("unknown quantitive scale type "+c);return d.range([0,1]).interpolate(b.interpolateColors(a))},b.interpolateColors=function(a){if(a.length<2)throw new Error("Color scale arrays must have at least two elements.");return function(){return function(b){b=Math.max(0,Math.min(1,b));var c=b*(a.length-1),d=Math.floor(c),e=Math.ceil(c),f=c-d;return d3.interpolateLab(a[d],a[e])(f)}}},b.prototype.colorRange=function(a){return null==a?this._colorRange:(this._colorRange=this._resolveColorValues(a),void this._resetScale())},b.prototype.scaleType=function(a){return null==a?this._scaleType:(this._scaleType=a,void this._resetScale())},b.prototype._resetScale=function(){this._d3Scale=b.getD3InterpolatedScale(this._colorRange,this._scaleType),this._autoDomainAutomatically&&this.autoDomain(),this.broadcaster.broadcast()},b.prototype._resolveColorValues=function(a){return a instanceof Array?a:null!=b.COLOR_SCALES[a]?b.COLOR_SCALES[a]:b.COLOR_SCALES.reds},b.COLOR_SCALES={reds:["#FFFFFF","#FFF6E1","#FEF4C0","#FED976","#FEB24C","#FD8D3C","#FC4E2A","#E31A1C","#B10026"],blues:["#FFFFFF","#CCFFFF","#A5FFFD","#85F7FB","#6ED3EF","#55A7E0","#417FD0","#2545D3","#0B02E1"],posneg:["#0B02E1","#2545D3","#417FD0","#55A7E0","#6ED3EF","#85F7FB","#A5FFFD","#CCFFFF","#FFFFFF","#FFF6E1","#FEF4C0","#FED976","#FEB24C","#FD8D3C","#FC4E2A","#E31A1C","#B10026"]},b}(a.Abstract.QuantitiveScale);b.InterpolatedColor=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(a){var b=this;this.rescaleInProgress=!1,this.scales=a,this.scales.forEach(function(a){return a.broadcaster.registerListener(b,function(a){return b.rescale(a)})})}return a.prototype.rescale=function(a){if(!this.rescaleInProgress){this.rescaleInProgress=!0;var b=a.domain();this.scales.forEach(function(a){return a.domain(b)}),this.rescaleInProgress=!1}},a}();a.ScaleDomainCoordinator=b}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){var f=this;b.call(this),this._showEndTickLabels=!1,this.tickPositioning="center",this.orientToAlign={left:"right",right:"left",top:"bottom",bottom:"top"},this._axisScale=c,d=d.toLowerCase(),this.d3Axis=d3.svg.axis().scale(c._d3Scale).orient(d),this.classed("axis",!0);var g=e;null==e&&(e=new a.Formatter.General),e instanceof a.Abstract.Formatter&&(g=function(a){return e.format(a)}),this.tickFormat(g),this._axisScale.broadcaster.registerListener(this,function(){return f._render()})}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this.axisElement=this.content.append("g").classed("axis",!0),this},c.prototype._doRender=function(){var a,b=this._axisScale.domain(),c=Math.abs(b[1]-b[0]),d=+d3.min(b),e=+d3.max(b),f=b[0]b.right?!1:a.bottomb.bottom?!1:!0}var b,c=this.axisElement.selectAll(".tick").select("text");c.each(function(){var c=this.getBoundingClientRect();null!=b&&a(c,b)?d3.select(this).style("visibility","hidden"):(b=c,d3.select(this).style("visibility","visible"))})},c.prototype.scale=function(a){return null==a?this._axisScale:(this._axisScale=a,this.d3Axis.scale(a._d3Scale),this)},c.prototype.tickLabelPosition=function(a){return null==a?this.tickPositioning:(this.tickPositioning=a,this)},c.prototype.orient=function(a){return null==a?this.d3Axis.orient():(this.d3Axis.orient(a),this)},c.prototype.ticks=function(){for(var a=[],b=0;b0)if("center"!==this.tickLabelPosition()&&(d.attr("y","0px"),"bottom"===this.orient()?d.attr("dy","1em"):d.attr("dy","-0.25em"),"right"===this.tickLabelPosition()?d.attr("dx","0.2em").style("text-anchor","start"):"left"===this.tickLabelPosition()&&d.attr("dx","-0.2em").style("text-anchor","end")),null!=this._axisScale.rangeType){var e=(this._axisScale.range(),this.availableWidth),f=Math.abs(parseFloat(d3.select(d[0][0]).attr("y"))),g=this.availableHeight-f;if(d[0].length>1){var h=d.data(),i=h.map(function(a){return c._axisScale.scale(a)});i.forEach(function(a,b){var c=Math.abs(i[b+1]-a);e=e>c?c:e})}e=.9*e,d.each(function(){var b=d3.select(this),c=b.text(),d=a.Util.Text.getTextMeasure(b),f=a.Util.WordWrap.breakTextToFitRect(c,e,g,d).lines;if(1===f.length)b.text(a.Util.Text.getTruncatedText(c,e,b));else{b.text("");var h=b.selectAll("tspan").data(f);h.enter().append("tspan"),h.text(function(a){return a}).attr("x","0").attr("dy",function(a,c){return 0===c?b.attr("dy"):"1em"}).style("text-anchor",b.style("text-anchor"))}})}else this._hideOverlappingTickLabels();return this.showEndTickLabels()||this._hideCutOffTickLabels(),this},c}(c);b.XAxis=d;var e=function(b){function c(a,c,d){if("undefined"==typeof c&&(c="left"),"undefined"==typeof d&&(d=null),b.call(this,a,c,d),this._width=50,c=c.toLowerCase(),"left"!==c&&"right"!==c)throw new Error(c+" is not a valid orientation for YAxis");this.tickLabelPosition("middle");var e=this.orientToAlign[c];this.xAlign(e)}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this.axisElement.classed("y-axis",!0),this},c.prototype.width=function(a){return this._width=a,this._invalidateLayout(),this},c.prototype._requestedSpace=function(a){return{width:Math.min(a,this._width),height:0,wantsWidth:a0)if("middle"!==this.tickLabelPosition()&&(d.attr("x","0px"),"left"===this.orient()?d.attr("dx","-0.25em"):d.attr("dx","0.25em"),"top"===this.tickLabelPosition()?d.attr("dy","-0.3em"):"bottom"===this.tickLabelPosition()&&d.attr("dy","1em")),null!=this._axisScale.rangeType){var e=(this._axisScale.range(),Math.abs(parseFloat(d3.select(d[0][0]).attr("x")))),f=this.availableWidth-e,g=this.availableHeight;if(d[0].length>1){var h=d.data(),i=h.map(function(a){return c._axisScale.scale(a)});i.forEach(function(a,b){var c=Math.abs(i[b+1]-a);g=g>c?c:g})}var j=this.tickLabelPosition();d.each(function(){var b=d3.select(this),c=b.text(),d=a.Util.Text.getTextMeasure(b),e=a.Util.WordWrap.breakTextToFitRect(c,f,g,d).lines;if(1===e.length)b.text(a.Util.Text.getTruncatedText(c,f,b));else{var h=0;"top"===j?h=-(e.length-1):"middle"===j&&(h=-(e.length-1)/2),b.text("");var i=b.selectAll("tspan").data(e);i.enter().append("tspan"),i.text(function(a){return a}).attr({dy:b.attr("dy"),x:b.attr("x"),y:function(a,b){return h+b+"em"}}).style("text-anchor",b.style("text-anchor"))}})}else this._hideOverlappingTickLabels();return this.showEndTickLabels()||this._hideCutOffTickLabels(),this},c}(c);b.YAxis=e}(a.Axis||(a.Axis={}));a.Axis}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){var f=this;b.call(this),this._width="auto",this._height="auto",this._showEndTickLabels=!1,this._tickLength=5,this._tickLabelPadding=3,this._scale=c,this.orient(d),this.classed("axis",!0),this._isHorizontal()?this.classed("x-axis",!0):this.classed("y-axis",!0),null==e&&(e=new a.Formatter.General,e.showOnlyUnchangedValues(!1)),this.formatter(e),this._scale.broadcaster.registerListener(this,function(){return f.rescale()})}return __extends(c,b),c.prototype._isHorizontal=function(){return"top"===this._orientation||"bottom"===this._orientation},c.prototype._computeWidth=function(){return this._computedWidth=this._tickLength,this._computedWidth},c.prototype._computeHeight=function(){return this._computedHeight=this._tickLength,this._computedHeight},c.prototype._requestedSpace=function(a,b){var c=this._width,d=this._height;return this._isHorizontal()?("auto"===this._height&&(null==this._computedHeight&&this._computeHeight(),d=this._computedHeight),c=0):("auto"===this._width&&(null==this._computedWidth&&this._computeWidth(),c=this._computedWidth),d=0),{width:Math.min(a,c),height:Math.min(b,d),wantsWidth:!this._isHorizontal()&&c>a,wantsHeight:this._isHorizontal()&&d>b}},c.prototype._setup=function(){return b.prototype._setup.call(this),this._tickMarkContainer=this.content.append("g").classed(c.TICK_MARK_CLASS+"-container",!0),this._tickLabelContainer=this.content.append("g").classed(c.TICK_LABEL_CLASS+"-container",!0),this._baseline=this.content.append("line").classed("baseline",!0),this},c.prototype._getTickValues=function(){return[]},c.prototype._doRender=function(){var a=this._getTickValues(),b=this._tickMarkContainer.selectAll("."+c.TICK_MARK_CLASS).data(a);return b.enter().append("line").classed(c.TICK_MARK_CLASS,!0),b.attr(this._generateTickMarkAttrHash()),b.exit().remove(),this._baseline.attr(this._generateBaselineAttrHash()),this},c.prototype._generateBaselineAttrHash=function(){var a={x1:0,y1:0,x2:0,y2:0};switch(this._orientation){case"bottom":a.x2=this.availableWidth;break;case"top":a.x2=this.availableWidth,a.y1=this.availableHeight,a.y2=this.availableHeight;break;case"left":a.x1=this.availableWidth,a.x2=this.availableWidth,a.y2=this.availableHeight;break;case"right":a.y2=this.availableHeight}return a},c.prototype._generateTickMarkAttrHash=function(){var a=this,b={x1:0,y1:0,x2:0,y2:0},c=function(b){return a._scale.scale(b)};switch(this._isHorizontal()?(b.x1=c,b.x2=c):(b.y1=c,b.y2=c),this._orientation){case"bottom":b.y2=this._tickLength;break;case"top":b.y1=this.availableHeight,b.y2=this.availableHeight-this._tickLength;break;case"left":b.x1=this.availableWidth,b.x2=this.availableWidth-this._tickLength;break;case"right":b.x2=this._tickLength}return b},c.prototype.rescale=function(){return null!=this.element?this._render():null},c.prototype._invalidateLayout=function(){b.prototype._invalidateLayout.call(this),this._computedWidth=null,this._computedHeight=null},c.prototype.width=function(a){if(null==a)return this.availableWidth;if(this._isHorizontal())throw new Error("width cannot be set on a horizontal Axis");if("auto"!==a&&0>a)throw new Error("invalid value for width");return this._width=a,this._invalidateLayout(),this},c.prototype.height=function(a){if(null==a)return this.availableHeight;if(!this._isHorizontal())throw new Error("height cannot be set on a vertical Axis");if("auto"!==a&&0>a)throw new Error("invalid value for height");return this._height=a,this._invalidateLayout(),this},c.prototype.formatter=function(a){return this._formatter=a,this._invalidateLayout(),this},c.prototype.tickLength=function(a){if(null==a)return this._tickLength;if(0>a)throw new Error("tick length must be positive");return this._tickLength=a,this._invalidateLayout(),this},c.prototype.tickLabelPadding=function(a){if(null==a)return this._tickLabelPadding;if(0>a)throw new Error("tick label padding must be positive");return this._tickLabelPadding=a,this._invalidateLayout(),this},c.prototype.orient=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._invalidateLayout(),this},c.prototype.showEndTickLabels=function(a){return null==a?this._showEndTickLabels:(this._showEndTickLabels=a,this._render(),this)},c.TICK_MARK_CLASS="tick-mark",c.TICK_LABEL_CLASS="tick-label",c}(a.Abstract.Component);b.Axis=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c,d){b.call(this,a,c,d),this.tickLabelPositioning="center"}return __extends(c,b),c.prototype._computeWidth=function(){var b=this._getTickValues(),c=function(a){var b=Math.floor(Math.log(Math.abs(a))/Math.LN10);return b>0?b:1},d=Math.max.apply(null,b.map(c)),e=this._formatter.precision(),f=-(Math.pow(10,d)+Math.pow(10,-e)),g=this._tickLabelContainer.append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),h=this._formatter.format(f),i=g.text(h).node().getComputedTextLength();return g.remove(),this._computedWidth="center"===this.tickLabelPositioning?this.tickLength()+this.tickLabelPadding()+i:Math.max(this.tickLength(),this.tickLabelPadding()+i),this._computedWidth},c.prototype._computeHeight=function(){var b=this._tickLabelContainer.append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),c=a.Util.DOM.getBBox(b.text("test")).height;return b.remove(),this._computedHeight="center"===this.tickLabelPositioning?this.tickLength()+this.tickLabelPadding()+c:Math.max(this.tickLength(),this.tickLabelPadding()+c),this._computedHeight},c.prototype._getTickValues=function(){return this._scale.ticks(10)},c.prototype._doRender=function(){var c=this;b.prototype._doRender.call(this);var d={x:0,y:0,dx:"0em",dy:"0.3em"},e=this.tickLength(),f=this.tickLabelPadding(),g="middle",h=0,i=0,j=0,k=0;if(this._isHorizontal())switch(this.tickLabelPositioning){case"left":g="end",h=-f,k=f;break;case"center":k=e+f;break;case"right":g="start",h=f,k=f}else switch(this.tickLabelPositioning){case"top":d.dy="-0.3em",j=f,i=-f;break;case"center":j=e+f;break;case"bottom":d.dy="1em",j=f,i=f}var l=this._generateTickMarkAttrHash();switch(this._orientation){case"bottom":d.x=l.x1,d.dy="0.95em",i=l.y1+k;break;case"top":d.x=l.x1,d.dy="-.25em",i=l.y1-k;break;case"left":g="end",h=l.x1-j,d.y=l.y1;break;case"right":g="start",h=l.x1+j,d.y=l.y1}var m=this._getTickValues(),n=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).data(m);n.enter().append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),n.exit().remove();var o=function(a){return c._formatter.format(a)};n.style("text-anchor",g).style("visibility","visible").attr(d).text(o);var p="translate("+h+", "+i+")";return this._tickLabelContainer.attr("transform",p),this.showEndTickLabels()||this.hideEndTickLabels(),this.hideOverlappingTickLabels(),this},c.prototype.tickLabelPosition=function(a){if(null==a)return this.tickLabelPositioning;var b=a.toLowerCase();if(this._isHorizontal()){if("left"!==b&&"center"!==b&&"right"!==b)throw new Error(b+" is not a valid tick label position for a horizontal NumericAxis")}else if("top"!==b&&"center"!==b&&"bottom"!==b)throw new Error(b+" is not a valid tick label position for a vertical NumericAxis");return this.tickLabelPositioning=b,this._invalidateLayout(),this},c.prototype.hideEndTickLabels=function(){var b=this,c=this.element.select(".bounding-box")[0][0].getBoundingClientRect(),d=function(a){return Math.floor(c.left)<=Math.ceil(a.left)&&Math.floor(c.top)<=Math.ceil(a.top)&&Math.floor(a.right)<=Math.ceil(c.left+b.availableWidth)&&Math.floor(a.bottom)<=Math.ceil(c.top+b.availableHeight)},e=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS),f=e[0][0];d(f.getBoundingClientRect())||d3.select(f).style("visibility","hidden");var g=e[0][e[0].length-1];d(g.getBoundingClientRect())||d3.select(g).style("visibility","hidden")},c.prototype.hideOverlappingTickLabels=function(){function b(a,b){return a.rightb.right?!1:a.bottomb.bottom?!1:!0}var c,d=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).filter(function(){return"visible"===d3.select(this).style("visibility")});d.each(function(){var a=this.getBoundingClientRect(),d=d3.select(this);null!=c&&b(a,c)?d.style("visibility","hidden"):(c=a,d.style("visibility","visible"))})},c}(a.Abstract.Axis);b.Numeric=c}(a.Axis||(a.Axis={}));a.Axis}(Plottable||(Plottable={})); -var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c){"undefined"==typeof c&&(c="bottom");var d=this;if(b.call(this,a,c),this.classed("category-axis",!0),"bands"!==a.rangeType())throw new Error("Only rangeBands category axes are implemented");this._scale.broadcaster.registerListener(this,function(){return d._invalidateLayout()})}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this._tickLabelsG=this.content.append("g").classed("tick-labels",!0),this},c.prototype._requestedSpace=function(a,b){var c=this._isHorizontal()?0:this.tickLength()+this.tickLabelPadding(),d=this._isHorizontal()?this.tickLength()+this.tickLabelPadding():0;if(0>a||0>b)return{width:a,height:b,wantsWidth:!this._isHorizontal(),wantsHeight:this._isHorizontal()};if(0===this._scale.domain().length)return{width:0,height:0,wantsWidth:!1,wantsHeight:!1};this._scale.range(this._isHorizontal()?[0,a]:[b,0]);var e=this._tickLabelsG.append("g"),f=e.selectAll(".tick").data(this._scale.domain());f.enter().append("g").classed("tick",!0);var g=this.writeTextToTicks(a,b,f);return e.remove(),{width:g.usedWidth+c,height:g.usedHeight+d,wantsWidth:!g.textFits,wantsHeight:!g.textFits}},c.prototype._getTickValues=function(){return this._scale.domain()},c.prototype.writeTextToTicks=function(b,c,d){var e=this,f=[];d.each(function(d){var g=d3.select(this),h=e._scale.fullBandStartAndWidth(d)[1],i=e._isHorizontal()?h:b-e.tickLength()-e.tickLabelPadding(),j=e._isHorizontal()?c-e.tickLength()-e.tickLabelPadding():h,k={left:"right",right:"left",top:"center",bottom:"center"},l={left:"center",right:"center",top:"bottom",bottom:"top"},m=a.Util.Text.writeText(d,g,i,j,k[e._orientation],l[e._orientation],!0);f.push(m)});var g=this._isHorizontal()?d3.sum:d3.max,h=this._isHorizontal()?d3.max:d3.sum;return{textFits:f.every(function(a){return a.textFits}),usedWidth:g(f,function(a){return a.usedWidth}),usedHeight:h(f,function(a){return a.usedHeight})}},c.prototype._doRender=function(){var c=this;b.prototype._doRender.call(this);{var d=this._tickLabelsG.selectAll(".tick-label").data(this._scale.domain(),function(a){return a}),e=function(a){var b=c._scale.fullBandStartAndWidth(a),d=b[0],e=c._isHorizontal()?d:0,f=c._isHorizontal()?0:d;return"translate("+e+","+f+")"};d.enter().append("g").classed("tick-label",!0)}d.exit().remove(),d.attr("transform",e),d.text(""),this.writeTextToTicks(this.availableWidth,this.availableHeight,d);var f=this._isHorizontal()?[this._scale.rangeBand()/2,0]:[0,this._scale.rangeBand()/2],g="right"===this._orientation?this.tickLength()+this.tickLabelPadding():0,h="bottom"===this._orientation?this.tickLength()+this.tickLabelPadding():0;return a.Util.DOM.translate(this._tickLabelsG,g,h),a.Util.DOM.translate(this._tickMarkContainer,f[0],f[1]),this},c}(a.Abstract.Axis);b.Category=c}(a.Axis||(a.Axis={}));a.Axis}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c){if("undefined"==typeof a&&(a=""),"undefined"==typeof c&&(c="horizontal"),b.call(this),this.classed("label",!0),this.setText(a),c=c.toLowerCase(),"horizontal"!==c&&"vertical-left"!==c&&"vertical-right"!==c)throw new Error(c+" is not a valid orientation for LabelComponent");this.orientation=c,this.xAlign("CENTER").yAlign("CENTER")}return __extends(c,b),c.prototype._requestedSpace=function(a,b){var c,d;return"horizontal"===this.orientation?(c=this.textLength,d=this.textHeight):(c=this.textHeight,d=this.textLength),{width:Math.min(c,a),height:Math.min(d,b),wantsWidth:c>a,wantsHeight:d>b}},c.prototype._setup=function(){return b.prototype._setup.call(this),this.textElement=this.content.append("text"),this.setText(this.text),this},c.prototype.setText=function(a){return this.text=a,null!=this.element&&(this.textElement.text(a),this.measureAndSetTextSize()),this._invalidateLayout(),this},c.prototype.measureAndSetTextSize=function(){var b=a.Util.DOM.getBBox(this.textElement);this.textHeight=b.height,this.textLength=""===this.text?0:b.width},c.prototype.truncateTextAndRemeasure=function(b){var c=a.Util.Text.getTruncatedText(this.text,b,this.textElement);this.textElement.text(c),this.measureAndSetTextSize()},c.prototype._computeLayout=function(c,d,e,f){b.prototype._computeLayout.call(this,c,d,e,f),this.textElement.attr("dy",0);var g=a.Util.DOM.getBBox(this.textElement);this.textElement.attr("dy",-g.y);var h=0,i=0;return"horizontal"===this.orientation?(this.truncateTextAndRemeasure(this.availableWidth),h=(this.availableWidth-this.textLength)*this._xAlignProportion):(this.truncateTextAndRemeasure(this.availableHeight),h=(this.availableHeight-this.textLength)*this._yAlignProportion,"vertical-right"===this.orientation?(this.textElement.attr("transform","rotate(90)"),i=-this.textHeight):(this.textElement.attr("transform","rotate(-90)"),h=-h-this.textLength)),this.textElement.attr("x",h),this.textElement.attr("y",i),this},c}(a.Abstract.Component);b.Label=c;var d=function(a){function b(b,c){a.call(this,b,c),this.classed("title-label",!0)}return __extends(b,a),b}(c);b.TitleLabel=d;var e=function(a){function b(b,c){a.call(this,b,c),this.classed("axis-label",!0)}return __extends(b,a),b}(c);b.AxisLabel=e}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a){b.call(this),this.classed("legend",!0),this.scale(a),this.xAlign("RIGHT").yAlign("TOP"),this.xOffset(5).yOffset(5)}return __extends(c,b),c.prototype.toggleCallback=function(a){return void 0!==a?(this._toggleCallback=a,this.isOff=d3.set(),this.updateListeners(),this.updateClasses(),this):this._toggleCallback},c.prototype.hoverCallback=function(a){return void 0!==a?(this._hoverCallback=a,this.datumCurrentlyFocusedOn=void 0,this.updateListeners(),this.updateClasses(),this):this._hoverCallback},c.prototype.scale=function(a){var b=this;return null!=a?(null!=this.colorScale&&this.colorScale.broadcaster.deregisterListener(this),this.colorScale=a,this.colorScale.broadcaster.registerListener(this,function(){return b.updateDomain()}),this.updateDomain(),this):this.colorScale},c.prototype.updateDomain=function(){null!=this._toggleCallback&&(this.isOff=a.Util.Methods.intersection(this.isOff,d3.set(this.scale().domain()))),null!=this._hoverCallback&&(this.datumCurrentlyFocusedOn=this.scale().domain().indexOf(this.datumCurrentlyFocusedOn)>=0?this.datumCurrentlyFocusedOn:void 0),this._invalidateLayout()},c.prototype._computeLayout=function(a,c,d,e){b.prototype._computeLayout.call(this,a,c,d,e);var f=this.measureTextHeight(),g=this.colorScale.domain().length;return this.nRowsDrawn=Math.min(g,Math.floor(this.availableHeight/f)),this},c.prototype._requestedSpace=function(b,d){var e=this.measureTextHeight(),f=this.colorScale.domain().length,g=Math.min(f,Math.floor(d/e)),h=this.content.append("g").classed(c.SUBELEMENT_CLASS,!0),i=h.append("text"),j=d3.max(this.colorScale.domain(),function(b){return a.Util.Text.getTextWidth(i,b)});h.remove(),j=void 0===j?0:j;var k=j+e+c.MARGIN;return{width:Math.min(k,b),height:g*e,wantsWidth:k>b,wantsHeight:f>g}},c.prototype.measureTextHeight=function(){var b=this.content.append("g").classed(c.SUBELEMENT_CLASS,!0),d=a.Util.Text.getTextHeight(b.append("text"));return b.remove(),d},c.prototype._doRender=function(){b.prototype._doRender.call(this);var d=this.colorScale.domain().slice(0,this.nRowsDrawn),e=this.measureTextHeight(),f=this.availableWidth-e-c.MARGIN,g=e-2*c.MARGIN-2,h=this.content.selectAll("."+c.SUBELEMENT_CLASS).data(d,function(a){return a}),i=h.enter().append("g").classed(c.SUBELEMENT_CLASS,!0);return i.append("circle").attr("cx",c.MARGIN+g/2).attr("cy",c.MARGIN+g/2).attr("r",g),i.append("text").attr("x",e).attr("y",c.MARGIN+e/2),h.exit().remove(),h.attr("transform",function(a){return"translate(0,"+d.indexOf(a)*e+")"}),h.selectAll("circle").attr("fill",this.colorScale._d3Scale),h.selectAll("text").text(function(b){return a.Util.Text.getTruncatedText(b,f,d3.select(this))}),this.updateClasses(),this.updateListeners(),this},c.prototype.updateListeners=function(){var a=this;if(this._isSetup){var b=this.content.selectAll("."+c.SUBELEMENT_CLASS);if(null!=this._hoverCallback){var d=function(b){return function(c){a.datumCurrentlyFocusedOn=b?c:void 0,a._hoverCallback(a.datumCurrentlyFocusedOn),a.updateClasses()}};b.on("mouseover",d(!0)),b.on("mouseout",d(!1))}else b.on("mouseover",null),b.on("mouseout",null);null!=this._toggleCallback?b.on("click",function(b){var c=a.isOff.has(b);c?a.isOff.remove(b):a.isOff.add(b),a._toggleCallback(b,c),a.updateClasses()}):b.on("click",null)}},c.prototype.updateClasses=function(){var a=this;if(this._isSetup){var b=this.content.selectAll("."+c.SUBELEMENT_CLASS);null!=this._hoverCallback?(b.classed("focus",function(b){return a.datumCurrentlyFocusedOn===b}),b.classed("hover",void 0!==this.datumCurrentlyFocusedOn)):(b.classed("hover",!1),b.classed("focus",!1)),null!=this._toggleCallback?(b.classed("toggled-on",function(b){return!a.isOff.has(b)}),b.classed("toggled-off",function(b){return a.isOff.has(b)})):(b.classed("toggled-on",!1),b.classed("toggled-off",!1))}},c.SUBELEMENT_CLASS="legend-row",c.MARGIN=5,c}(a.Abstract.Component);b.Legend=c}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c){var d=this;a.call(this),this.classed("gridlines",!0),this.xScale=b,this.yScale=c,null!=this.xScale&&this.xScale.broadcaster.registerListener(this,function(){return d._render()}),null!=this.yScale&&this.yScale.broadcaster.registerListener(this,function(){return d._render()})}return __extends(b,a),b.prototype._setup=function(){return a.prototype._setup.call(this),this.xLinesContainer=this.content.append("g").classed("x-gridlines",!0),this.yLinesContainer=this.content.append("g").classed("y-gridlines",!0),this},b.prototype._doRender=function(){return a.prototype._doRender.call(this),this.redrawXLines(),this.redrawYLines(),this},b.prototype.redrawXLines=function(){var a=this;if(null!=this.xScale){var b=this.xScale.ticks(),c=function(b){return a.xScale.scale(b)},d=this.xLinesContainer.selectAll("line").data(b);d.enter().append("line"),d.attr("x1",c).attr("y1",0).attr("x2",c).attr("y2",this.availableHeight),d.exit().remove()}},b.prototype.redrawYLines=function(){var a=this;if(null!=this.yScale){var b=this.yScale.ticks(),c=function(b){return a.yScale.scale(b)},d=this.yLinesContainer.selectAll("line").data(b);d.enter().append("line"),d.attr("x1",0).attr("y1",c).attr("x2",this.availableWidth).attr("y2",c),d.exit().remove()}},b}(a.Abstract.Component);b.Gridlines=c}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(a){function b(b,c,d){"undefined"==typeof c&&(c=a.ONE_DAY),"undefined"==typeof d&&(d="");var e=function(a){var e=Math.round((a.valueOf()-b)/c);return e.toString()+d};return e}a.ONE_DAY=864e5,a.generateRelativeDateFormatter=b}(a.Axis||(a.Axis={}));a.Axis}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c,d){b.call(this,a),this.classed("xy-renderer",!0),this.project("x","x",c),this.project("y","y",d)}return __extends(c,b),c.prototype.project=function(a,c,d){return"x"===a&&null!=d&&(this.xScale=d,this._updateXDomainer()),"y"===a&&null!=d&&(this.yScale=d,this._updateYDomainer()),b.prototype.project.call(this,a,c,d),this},c.prototype._computeLayout=function(a,c,d,e){return b.prototype._computeLayout.call(this,a,c,d,e),this.xScale.range([0,this.availableWidth]),this.yScale.range([this.availableHeight,0]),this},c.prototype.rescale=function(){null!=this.element&&this._render()},c.prototype._updateXDomainer=function(){if(this.xScale instanceof a.Abstract.QuantitiveScale){var b=this.xScale;b._userSetDomainer||b.domainer().pad().nice()}return this},c.prototype._updateYDomainer=function(){if(this.yScale instanceof a.Abstract.QuantitiveScale){var b=this.yScale;b._userSetDomainer||b.domainer().pad().nice()}return this},c}(a.Abstract.Plot);b.XYPlot=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){b.call(this,c,d,e),this._animators={"circles-reset":new a.Animator.Null,circles:(new a.Animator.IterativeDelay).duration(250).delay(5)},this.classed("circle-renderer",!0),this.project("r",3),this.project("fill",function(){return"steelblue"})}return __extends(c,b),c.prototype.project=function(a,c,d){return a="cx"===a?"x":a,a="cy"===a?"y":a,b.prototype.project.call(this,a,c,d),this},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this._generateAttrToProjector();a.cx=a.x,a.cy=a.y,delete a.x,delete a.y;var c=this.renderArea.selectAll("circle").data(this._dataSource.data());if(c.enter().append("circle"),this._dataChanged){var d=a.r;a.r=function(){return 0},this._applyAnimatedAttributes(c,"circles-reset",a),a.r=d}this._applyAnimatedAttributes(c,"circles",a),c.exit().remove()},c}(a.Abstract.XYPlot);b.Scatter=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e,f){b.call(this,c,d,e),this._animators={cells:new a.Animator.Null},this.classed("grid-renderer",!0),this.xScale.rangeType("bands",0,0),this.yScale.rangeType("bands",0,0),this.colorScale=f,this.project("fill","value",f)}return __extends(c,b),c.prototype.project=function(a,c,d){return b.prototype.project.call(this,a,c,d),"fill"===a&&(this.colorScale=this._projectors.fill.scale),this},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this.renderArea.selectAll("rect").data(this._dataSource.data());a.enter().append("rect");var c=this.xScale.rangeBand(),d=this.yScale.rangeBand(),e=this._generateAttrToProjector();e.width=function(){return c},e.height=function(){return d},this._applyAnimatedAttributes(a,"cells",e),a.exit().remove()},c}(a.Abstract.XYPlot);b.Grid=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){b.call(this,c,d,e),this._baselineValue=0,this._animators={"bars-reset":new a.Animator.Null,bars:new a.Animator.IterativeDelay,baseline:new a.Animator.Null},this.classed("bar-renderer",!0),this.project("width",10),this.project("fill",function(){return"steelblue"}),this.baseline(this._baselineValue)}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this._baseline=this.renderArea.append("line").classed("baseline",!0),this._bars=this.renderArea.selectAll("rect").data([]),this},c.prototype.baseline=function(a){return this._baselineValue=a,this._updateXDomainer(),this._updateYDomainer(),null!=this.element&&this._render(),this},c.prototype.barAlignment=function(){return this},c.prototype.parseExtent=function(a){if("number"==typeof a)return{min:a,max:a};if(a instanceof Object&&"min"in a&&"max"in a)return a;throw new Error("input '"+a+"' can't be parsed as an IExtent")},c.prototype.selectBar=function(a,b,c){if("undefined"==typeof c&&(c=!0),!this._isSetup)return null;var d=[],e=this.parseExtent(a),f=this.parseExtent(b),g=.5;if(this._bars.each(function(){var a=this.getBBox();a.x+a.width>=e.min-g&&a.x<=e.max+g&&a.y+a.height>=f.min-g&&a.y<=f.max+g&&d.push(this)}),d.length>0){var h=d3.selectAll(d);return h.classed("selected",c),h}return null},c.prototype.deselectAll=function(){return this._isSetup&&this._bars.classed("selected",!1),this},c}(a.Abstract.XYPlot);b.BarPlot=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c,d){b.call(this,a,c,d),this._barAlignment="left"}return __extends(c,b),c.prototype._paint=function(){b.prototype._paint.call(this);var a=this.yScale.scale(this._baselineValue);this._bars=this.renderArea.selectAll("rect").data(this._dataSource.data()),this._bars.enter().append("rect");var c=this._generateAttrToProjector(),d=c.x,e=c.width,f=this.xScale,g=null==f.rangeType?"points":f.rangeType();"points"===g?"center"===this._barAlignment?c.x=function(a,b){return d(a,b)-e(a,b)/2}:"right"===this._barAlignment&&(c.x=function(a,b){return d(a,b)-e(a,b)}):c.width=function(){return f.rangeBand()};var h=c.y;this._dataChanged&&(c.y=function(){return a},c.height=function(){return 0},this._applyAnimatedAttributes(this._bars,"bars-reset",c)),c.y=function(b,c){var d=h(b,c);return d>a?a:d};var i=function(b,c){return Math.abs(a-h(b,c))};c.height=i,null!=c.fill&&this._bars.attr("fill",c.fill),this._applyAnimatedAttributes(this._bars,"bars",c),this._bars.exit().remove();var j={x1:0,y1:a,x2:this.availableWidth,y2:a};this._applyAnimatedAttributes(this._baseline,"baseline",j)},c.prototype.barAlignment=function(a){var b=a.toLowerCase();if("left"!==b&&"center"!==b&&"right"!==b)throw new Error("unsupported bar alignment");return this._barAlignment=b,null!=this.element&&this._render(),this},c.prototype._updateYDomainer=function(){if(this.yScale instanceof a.Abstract.QuantitiveScale){var b=this.yScale;b._userSetDomainer||b.domainer().paddingException(this._baselineValue)}return this},c}(a.Abstract.BarPlot);b.VerticalBar=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c,d){b.call(this,a,c,d),this._barAlignment="top"}return __extends(c,b),c.prototype._paint=function(){b.prototype._paint.call(this),this._bars=this.renderArea.selectAll("rect").data(this._dataSource.data()),this._bars.enter().append("rect");var a=this._generateAttrToProjector(),c=a.y;a.height=a.width;var d=a.height,e=this.yScale,f=null==e.rangeType?"points":e.rangeType();"points"===f?"middle"===this._barAlignment?a.y=function(a,b){return c(a,b)-d(a,b)/2}:"bottom"===this._barAlignment&&(a.y=function(a,b){return c(a,b)-d(a,b)}):a.height=function(){return e.rangeBand()};var g=this.xScale.scale(this._baselineValue),h=a.x;this._animate&&this._dataChanged&&(a.x=function(){return g},a.width=function(){return 0},this._applyAnimatedAttributes(this._bars,"bars-reset",a)),a.x=function(a,b){var c=h(a,b);return c>g?g:c};var i=function(a,b){return Math.abs(g-h(a,b))};a.width=i,null!=a.fill&&this._bars.attr("fill",a.fill),this._applyAnimatedAttributes(this._bars,"bars",a),this._bars.exit().remove();var j={x1:g,y1:0,x2:g,y2:this.availableHeight};this._applyAnimatedAttributes(this._baseline,"baseline",j)},c.prototype.barAlignment=function(a){var b=a.toLowerCase();if("top"!==b&&"middle"!==b&&"bottom"!==b)throw new Error("unsupported bar alignment");return this._barAlignment=b,null!=this.element&&this._render(),this},c.prototype._updateXDomainer=function(){if(this.xScale instanceof a.Abstract.QuantitiveScale){var b=this.xScale;b._userSetDomainer||b.domainer().paddingException(this._baselineValue)}return this},c}(a.Abstract.BarPlot);b.HorizontalBar=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){b.call(this,c,d,e),this._animators={"area-reset":new a.Animator.Null,area:(new a.Animator.Default).duration(600).easing("exp-in-out")},this.classed("area-renderer",!0),this.project("y0",0,e),this.project("fill",function(){return"steelblue"}),this.project("stroke",function(){return"none"})}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this.areaPath=this.renderArea.append("path").classed("area",!0),this.linePath=this.renderArea.append("path").classed("line",!0),this},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this._generateAttrToProjector(),c=a.x,d=a.y0,e=a.y;delete a.x,delete a.y0,delete a.y,this.areaPath.datum(this._dataSource.data()),this.linePath.datum(this._dataSource.data()),this._dataChanged&&(a.d=d3.svg.area().x(c).y0(d).y1(d),this._applyAnimatedAttributes(this.areaPath,"area-reset",a),a.d=d3.svg.line().x(c).y(d),this._applyAnimatedAttributes(this.linePath,"area-reset",a)),a.d=d3.svg.area().x(c).y0(d).y1(e),this._applyAnimatedAttributes(this.areaPath,"area",a),a.d=d3.svg.line().x(c).y(e),this._applyAnimatedAttributes(this.linePath,"area",a)},c}(a.Abstract.XYPlot);b.Area=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c,d){a.call(this,b,c,d),this.classed("line-renderer",!0),this.project("stroke",function(){return"steelblue"}),this.project("fill",function(){return"none"})}return __extends(b,a),b}(a.Plot.Area);b.Line=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){}return a.prototype.animate=function(a,b){return a.attr(b)},a}();a.Null=b}(a.Animator||(a.Animator={}));a.Animator}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){this._durationMsec=300,this._delayMsec=0,this._easing="exp-out"}return a.prototype.animate=function(a,b){return a.transition().ease(this._easing).duration(this._durationMsec).delay(this._delayMsec).attr(b)},a.prototype.duration=function(a){return void 0===a?this._durationMsec:(this._durationMsec=a,this)},a.prototype.delay=function(a){return void 0===a?this._delayMsec:(this._delayMsec=a,this)},a.prototype.easing=function(a){return void 0===a?this._easing:(this._easing=a,this)},a}();a.Default=b}(a.Animator||(a.Animator={}));a.Animator}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments),this._delayMsec=15}return __extends(b,a),b.prototype.animate=function(a,b){var c=this;return a.transition().ease(this._easing).duration(this._durationMsec).delay(function(a,b){return b*c._delayMsec}).attr(b)},b}(a.Animator.Default);b.IterativeDelay=c}(a.Animator||(a.Animator={}));a.Animator}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(a){function b(){e||(d3.select(document).on("keydown",d),e=!0)}function c(a,c){e||b(),null==f[a]&&(f[a]=[]),f[a].push(c)}function d(){null!=f[d3.event.keyCode]&&f[d3.event.keyCode].forEach(function(a){a(d3.event)})}var e=!1,f=[];a.initialize=b,a.addCallback=c}(a.KeyEventListener||(a.KeyEventListener={}));a.KeyEventListener}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(a){this.componentToListenTo=a}return a.prototype._anchor=function(a){this.hitBox=a},a.prototype.registerWithComponent=function(){return this.componentToListenTo.registerInteraction(this),this},a}();a.Interaction=b}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){a.call(this,b)}return __extends(b,a),b.prototype._anchor=function(b){var c=this;a.prototype._anchor.call(this,b),b.on(this._listenTo(),function(){var a=d3.mouse(b.node()),d=a[0],e=a[1];c._callback(d,e)})},b.prototype._listenTo=function(){return"click"},b.prototype.callback=function(a){return this._callback=a,this},b}(a.Abstract.Interaction);b.Click=c;var d=function(a){function b(b){a.call(this,b)}return __extends(b,a),b.prototype._listenTo=function(){return"dblclick"},b}(c);b.DoubleClick=d}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){a.call(this,b)}return __extends(b,a),b.prototype._anchor=function(b){var c=this;a.prototype._anchor.call(this,b),b.on("mousemove",function(){var a=d3.mouse(b.node()),d=a[0],e=a[1];c.mousemove(d,e)})},b.prototype.mousemove=function(){},b}(a.Abstract.Interaction);b.Mousemove=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c){b.call(this,a),this.activated=!1,this.keyCode=c}return __extends(c,b),c.prototype._anchor=function(c){var d=this;b.prototype._anchor.call(this,c),c.on("mouseover",function(){d.activated=!0}),c.on("mouseout",function(){d.activated=!1}),a.Core.KeyEventListener.addCallback(this.keyCode,function(){d.activated&&null!=d._callback&&d._callback()})},c.prototype.callback=function(a){return this._callback=a,this},c}(a.Abstract.Interaction);b.Key=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c,d){var e=this;a.call(this,b),this.xScale=c,this.yScale=d,this.zoom=d3.behavior.zoom(),this.zoom.x(this.xScale._d3Scale),this.zoom.y(this.yScale._d3Scale),this.zoom.on("zoom",function(){return e.rerenderZoomed()})}return __extends(b,a),b.prototype.resetZoom=function(){var a=this;this.zoom=d3.behavior.zoom(),this.zoom.x(this.xScale._d3Scale),this.zoom.y(this.yScale._d3Scale),this.zoom.on("zoom",function(){return a.rerenderZoomed()}),this.zoom(this.hitBox)},b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this.zoom(b)},b.prototype.rerenderZoomed=function(){var a=this.xScale._d3Scale.domain(),b=this.yScale._d3Scale.domain();this.xScale.domain(a),this.yScale.domain(b)},b}(a.Abstract.Interaction);b.PanZoom=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){var c=this;a.call(this,b),this.dragInitialized=!1,this.origin=[0,0],this.location=[0,0],this.dragBehavior=d3.behavior.drag(),this.dragBehavior.on("dragstart",function(){return c._dragstart()}),this.dragBehavior.on("drag",function(){return c._drag()}),this.dragBehavior.on("dragend",function(){return c._dragend()})}return __extends(b,a),b.prototype.callback=function(a){return this.callbackToCall=a,this},b.prototype._dragstart=function(){var a=this.componentToListenTo.availableWidth,b=this.componentToListenTo.availableHeight,c=function(a,b){return function(c){return Math.min(Math.max(c,a),b)}};this.constrainX=c(0,a),this.constrainY=c(0,b)},b.prototype._drag=function(){this.dragInitialized||(this.origin=[d3.event.x,d3.event.y],this.dragInitialized=!0),this.location=[this.constrainX(d3.event.x),this.constrainY(d3.event.y)]},b.prototype._dragend=function(){this.dragInitialized&&(this.dragInitialized=!1,this._doDragend())},b.prototype._doDragend=function(){null!=this.callbackToCall&&this.callbackToCall([this.origin,this.location])},b.prototype._anchor=function(b){return a.prototype._anchor.call(this,b),b.call(this.dragBehavior),this},b.prototype.setupZoomCallback=function(a,b){function c(c){return null==c?(f&&(null!=a&&a.domain(d),null!=b&&b.domain(e)),void(f=!f)):(f=!1,null!=a&&a.domain([a.invert(c.xMin),a.invert(c.xMax)]),null!=b&&b.domain([b.invert(c.yMax),b.invert(c.yMin)]),void this.clearBox())}var d=null!=a?a.domain():null,e=null!=b?b.domain():null,f=!1;return this.callback(c),this},b}(a.Abstract.Interaction);b.Drag=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments),this.boxIsDrawn=!1}return __extends(b,a),b.prototype._dragstart=function(){a.prototype._dragstart.call(this),null!=this.callbackToCall&&this.callbackToCall(null),this.clearBox()},b.prototype.clearBox=function(){return this.dragBox.attr("height",0).attr("width",0),this.boxIsDrawn=!1,this},b.prototype.setBox=function(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d),g=Math.min(a,b),h=Math.min(c,d);return this.dragBox.attr({x:g,y:h,width:e,height:f}),this.boxIsDrawn=e>0&&f>0,this},b.prototype._anchor=function(c){a.prototype._anchor.call(this,c);var d=b.CLASS_DRAG_BOX,e=this.componentToListenTo.foregroundContainer;return this.dragBox=e.append("rect").classed(d,!0).attr("x",0).attr("y",0),this},b.CLASS_DRAG_BOX="drag-box",b}(a.Interaction.Drag);b.DragBox=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype._drag=function(){a.prototype._drag.call(this),this.setBox(this.origin[0],this.location[0])},b.prototype._doDragend=function(){if(null!=this.callbackToCall){var a=Math.min(this.origin[0],this.location[0]),b=Math.max(this.origin[0],this.location[0]),c={xMin:a,xMax:b};this.callbackToCall(c)}},b.prototype.setBox=function(b,c){return a.prototype.setBox.call(this,b,c,0,this.componentToListenTo.availableHeight),this},b}(a.Interaction.DragBox);b.XDragBox=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype._drag=function(){a.prototype._drag.call(this),this.setBox(this.origin[0],this.location[0],this.origin[1],this.location[1]) -},b.prototype._doDragend=function(){if(null!=this.callbackToCall){var a=Math.min(this.origin[0],this.location[0]),b=Math.max(this.origin[0],this.location[0]),c=Math.min(this.origin[1],this.location[1]),d=Math.max(this.origin[1],this.location[1]),e={xMin:a,xMax:b,yMin:c,yMax:d};this.callbackToCall(e)}},b}(a.Interaction.DragBox);b.XYDragBox=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype._drag=function(){a.prototype._drag.call(this),this.setBox(this.origin[1],this.location[1])},b.prototype._doDragend=function(){if(null!=this.callbackToCall){var a=Math.min(this.origin[1],this.location[1]),b=Math.max(this.origin[1],this.location[1]),c={yMin:a,yMax:b};this.callbackToCall(c)}},b.prototype.setBox=function(b,c){return a.prototype.setBox.call(this,0,this.componentToListenTo.availableWidth,b,c),this},b}(a.Interaction.DragBox);b.YDragBox=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(){b.call(this),this.xTable=new a.Component.Table,this.yTable=new a.Component.Table,this.centerComponent=new a.Component.Group,this.xyTable=(new a.Component.Table).addComponent(0,0,this.yTable).addComponent(1,1,this.xTable).addComponent(0,1,this.centerComponent),this.addComponent(1,0,this.xyTable)}return __extends(c,b),c.prototype.yAxis=function(a){if(null!=a){if(null!=this._yAxis)throw new Error("yAxis already assigned!");return this._yAxis=a,this.yTable.addComponent(0,1,this._yAxis),this}return this._yAxis},c.prototype.xAxis=function(a){if(null!=a){if(null!=this._xAxis)throw new Error("xAxis already assigned!");return this._xAxis=a,this.xTable.addComponent(0,0,this._xAxis),this}return this._xAxis},c.prototype.yLabel=function(b){if(null!=b){if(null!=this._yLabel){if("string"==typeof b)return this._yLabel.setText(b),this;throw new Error("yLabel already assigned!")}return"string"==typeof b&&(b=new a.Component.AxisLabel(b,"vertical-left")),this._yLabel=b,this.yTable.addComponent(0,0,this._yLabel),this}return this._yLabel},c.prototype.xLabel=function(b){if(null!=b){if(null!=this._xLabel){if("string"==typeof b)return this._xLabel.setText(b),this;throw new Error("xLabel already assigned!")}return"string"==typeof b&&(b=new a.Component.AxisLabel(b,"horizontal")),this._xLabel=b,this.xTable.addComponent(1,0,this._xLabel),this}return this._xLabel},c.prototype.titleLabel=function(b){if(null!=b){if(null!=this._titleLabel){if("string"==typeof b)return this._titleLabel.setText(b),this;throw new Error("titleLabel already assigned!")}return"string"==typeof b&&(b=new a.Component.TitleLabel(b,"horizontal")),this._titleLabel=b,this.addComponent(0,0,this._titleLabel),this}return this._titleLabel},c.prototype.center=function(a){return this.centerComponent.merge(a),this},c}(a.Component.Table);b.StandardChart=c}(a.Template||(a.Template={}));a.Template}(Plottable||(Plottable={})); \ No newline at end of file +var Plottable;!function(a){!function(a){!function(a){function b(a,b,c){return Math.min(b,c)<=a&&a<=Math.max(b,c)}function c(a,b){if(a.length!==b.length)throw new Error("attempted to add arrays of unequal length");return a.map(function(c,d){return a[d]+b[d]})}function d(a,b){var c=d3.set();return a.forEach(function(a){b.has(a)&&c.add(a)}),c}function e(a){return"function"==typeof a?a:"string"==typeof a&&"#"!==a[0]?function(b){return b[a]}:function(){return a}}function f(a,b){var c=e(a);return function(a,d){return c(a,d,b.metadata())}}function g(a){var b={};return a.forEach(function(a){return b[a]=!0}),d3.keys(b)}function h(a,b){for(var c=[],d=0;b>d;d++)c[d]="function"==typeof a?a(d):a;return c}function i(a){return Array.prototype.concat.apply([],a)}a.inRange=b,a.addArrays=c,a.intersection=d,a.accessorize=e,a.applyAccessor=f,a.uniq=g,a.createFilledArray=h,a.flatten=i}(a.Methods||(a.Methods={}));a.Methods}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(a){function b(a,b,c){for(var d=0,e=b.length;e>d;){var f=d+e>>>1,g=null==c?b[f]:c(b[f]);a>g?d=f+1:e=f}return d}a.sortedIndex=b}(a.OpenSource||(a.OpenSource={}));a.OpenSource}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){this.counter={}}return a.prototype.setDefault=function(a){null==this.counter[a]&&(this.counter[a]=0)},a.prototype.increment=function(a){return this.setDefault(a),++this.counter[a]},a.prototype.decrement=function(a){return this.setDefault(a),--this.counter[a]},a.prototype.get=function(a){return this.setDefault(a),this.counter[a]},a}();a.IDCounter=b}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){this.keyValuePairs=[]}return a.prototype.set=function(a,b){if(a!==a)throw new Error("NaN may not be used as a key to the StrictEqualityAssociativeArray");for(var c=0;cb){var h=e("."),i=Math.floor(b/h);return"...".substr(0,i)}for(;f+g>b;)d=d.substr(0,d.length-1).trim(),f=e(d);if(e(d+"...")>b)throw new Error("addEllipsesToLine failed :(");return d+"..."}function h(b,c,d,e,f,g){"undefined"==typeof f&&(f="left"),"undefined"==typeof g&&(g="top");var h={left:0,center:.5,right:1},i={top:0,center:.5,bottom:1};if(void 0===h[f]||void 0===i[g])throw new Error("unrecognized alignment x:"+f+", y:"+g);var j=c.append("g"),k=j.append("text");k.text(b);var l=a.Util.DOM.getBBox(k),m=l.height,n=l.width;if(n>d||m>e)return console.log("Insufficient space to fit text"),[0,0];var o={left:"start",center:"middle",right:"end"},p=o[f],q=d*h[f],r=e*i[g]+m*(1-i[g]),s=-.4*(1-i[g]);return k.attr("text-anchor",p).attr("y",s+"em"),a.Util.DOM.translate(j,q,r),[n,m]}function i(a,b,c,d,e,f,g){if("undefined"==typeof e&&(e="left"),"undefined"==typeof f&&(f="top"),"undefined"==typeof g&&(g="right"),"right"!==g&&"left"!==g)throw new Error("unrecognized rotation: "+g);var i="right"===g,j={left:"bottom",right:"top",center:"center",top:"left",bottom:"right"},k={left:"top",right:"bottom",center:"center",top:"right",bottom:"left"},l=i?j:k,m=b.append("g"),n=h(a,m,d,c,l[f],l[e]),o=d3.transform("");return o.rotate="right"===g?90:-90,o.translate=[i?c:0,i?0:d],m.attr("transform",o.toString()),[n[1],n[0]]}function j(b,c,d,f,g,i){"undefined"==typeof g&&(g="left"),"undefined"==typeof i&&(i="top");var j=e(c),k=0,l=c.append("g");b.forEach(function(b,c){var e=l.append("g");a.Util.DOM.translate(e,0,c*j);var f=h(b,e,d,j,g,i);f[0]>k&&(k=f[0])});var m=j*b.length,n=f-m,o={center:.5,top:0,bottom:1};return a.Util.DOM.translate(l,0,n*o[i]),[k,m]}function k(b,c,d,f,g,h,j){"undefined"==typeof g&&(g="left"),"undefined"==typeof h&&(h="top"),"undefined"==typeof j&&(j="left");var k=e(c),l=0,m=c.append("g");b.forEach(function(b,c){var d=m.append("g");a.Util.DOM.translate(d,c*k,0);var e=i(b,d,k,f,g,h,j);e[1]>l&&(l=e[1])});var n=k*b.length,o=d-n,p={center:.5,left:0,right:1};return a.Util.DOM.translate(m,o*p[g],0),[n,l]}function l(b,d,e,f,g,h,i){var l=null!=i?i:1.1*e>f,m=d.append("g").classed("writeText-inner-g",!0),n=l?e:f,o=l?f:e,p=c(m),q=a.Util.WordWrap.breakTextToFitRect(b,n,o,p),r=l?j:k,s=r(q.lines,m,e,f,g,h);return{textFits:q.textFits,usedWidth:s[0],usedHeight:s[1]}}b.getTextMeasure=c,b.getTruncatedText=d,b.getTextHeight=e,b.getTextWidth=f,b.addEllipsesToLine=g,b.writeLineHorizontally=h,b.writeLineVertically=i,b.writeTextHorizontally=j,b.writeTextVertically=k,b.writeText=l}(b.Text||(b.Text={}));b.Text}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){function c(b,c,e,f){var g=function(a){return f(a)[0]},h=d(b,c,g),i=f("hello world")[1],j=Math.floor(e/i),k=j>=h.length;return k||(h=h.splice(0,j),j>0&&(h[j-1]=a.Util.Text.addEllipsesToLine(h[j-1],c,f))),{originalText:b,lines:h,textFits:k}}function d(a,b,c){for(var d=[],e=a.split("\n"),g=0,h=e.length;h>g;g++){var i=e[g];null!==i?d=d.concat(f(i,b,c)):d.push("")}return d}function e(a,b,c){var d=h(a),e=d.map(c),f=d3.max(e);return b>=f}function f(a,b,c){for(var d,e=[],f=h(a),i="",j=0;d||je;e++){var g=a[e];""===c||j(c[0],g,d)?c+=g:(b.push(c),c=g),d=g}return c&&b.push(c),b}function i(a){return null==a?!0:""===a.trim()}function j(a,b,c){return m.test(a)&&m.test(b)?!0:m.test(a)||m.test(b)?!1:l.test(c)||k.test(b)?!1:!0}var k=/[{\[]/,l=/[!"%),-.:;?\]}]/,m=/^\s+$/;b.breakTextToFitRect=c,b.breakTextToFitWidth=d,b.canWrapWithoutBreakingWords=e}(b.WordWrap||(b.WordWrap={}));b.WordWrap}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(a){function b(a){return a.node().getBBox()}function c(b){null!=window.requestAnimationFrame?window.requestAnimationFrame(b):setTimeout(b,a.POLYFILL_TIMEOUT_MSEC)}function d(a,b){var c=a.getPropertyValue(b);return null==c?0:parseFloat(c)}function e(a){for(var b=a.node();null!==b&&"svg"!==b.nodeName;)b=b.parentNode;return null==b}function f(a){var b=window.getComputedStyle(a);return d(b,"width")+d(b,"padding-left")+d(b,"padding-right")+d(b,"border-left-width")+d(b,"border-right-width")}function g(a){var b=window.getComputedStyle(a);return d(b,"height")+d(b,"padding-top")+d(b,"padding-bottom")+d(b,"border-top-width")+d(b,"border-bottom-width")}function h(a){var b=a.node().clientWidth;if(0===b){var c=a.attr("width");if(-1!==c.indexOf("%")){for(var d=a.node().parentNode;null!=d&&0===d.clientWidth;)d=d.parentNode;if(null==d)throw new Error("Could not compute width of element");b=d.clientWidth*parseFloat(c)/100}else b=parseFloat(c)}return b}function i(a,b,c){var d=d3.transform(a.attr("transform"));return null==b?d.translate:(c=null==c?0:c,d.translate[0]=b,d.translate[1]=c,a.attr("transform",d.toString()),a)}a.getBBox=b,a.POLYFILL_TIMEOUT_MSEC=1e3/60,a.requestAnimationFramePolyfill=c,a.isSelectionRemovedFromSVG=e,a.getElementWidth=f,a.getElementHeight=g,a.getSVGPixelWidth=h,a.translate=i}(a.DOM||(a.DOM={}));a.DOM}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(a){if(this._onlyShowUnchanged=!0,0>a||a>20)throw new RangeError("Formatter precision must be between 0 and 20");this._precision=a}return a.prototype.format=function(a){var b=this._formatFunction(a);return this._onlyShowUnchanged&&this._valueChanged(a,b)?"":b},a.prototype._valueChanged=function(a,b){return a!==parseFloat(b)},a.prototype.precision=function(a){return void 0===a?this._precision:(this._precision=a,this)},a.prototype.showOnlyUnchangedValues=function(a){return void 0===a?this._onlyShowUnchanged:(this._onlyShowUnchanged=a,this)},a}();a.Formatter=b}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.call(this,null),this.showOnlyUnchangedValues(!1),this._formatFunction=function(a){return String(a)}}return __extends(b,a),b}(a.Abstract.Formatter);b.Identity=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){"undefined"==typeof b&&(b=3),a.call(this,b),this._formatFunction=function(a){if("number"==typeof a){var b=Math.pow(10,this._precision);return String(Math.round(a*b)/b)}return String(a)}}return __extends(b,a),b.prototype._valueChanged=function(a,b){return"number"==typeof a?a!==parseFloat(b):!1},b}(a.Abstract.Formatter);b.General=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){"undefined"==typeof b&&(b=3),a.call(this,b),this._formatFunction=function(a){return a.toFixed(this._precision)}}return __extends(b,a),b}(a.Abstract.Formatter);b.Fixed=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c,d){"undefined"==typeof b&&(b=2),"undefined"==typeof c&&(c="$"),"undefined"==typeof d&&(d=!0),a.call(this,b),this.symbol=c,this.prefix=d}return __extends(b,a),b.prototype.format=function(b){var c=a.prototype.format.call(this,Math.abs(b));return""!==c&&(this.prefix?c=this.symbol+c:c+=this.symbol,0>b&&(c="-"+c)),c},b}(a.Formatter.Fixed);b.Currency=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){"undefined"==typeof b&&(b=0),a.call(this,b)}return __extends(b,a),b.prototype.format=function(b){var c=a.prototype.format.call(this,100*b);return""!==c&&(c+="%"),c},b}(a.Formatter.Fixed);b.Percentage=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c){a.call(this,b),this._onlyShowUnchanged=!1,this._formatFunction=function(a){return c(a,this)}}return __extends(b,a),b}(a.Abstract.Formatter);b.Custom=c}(a.Formatter||(a.Formatter={}));a.Formatter}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){this._plottableID=a.nextID++}return a.nextID=0,a}();a.PlottableObject=b}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c){b.call(this),this.listener2Callback=new a.Util.StrictEqualityAssociativeArray,this.listenable=c}return __extends(c,b),c.prototype.registerListener=function(a,b){return this.listener2Callback.set(a,b),this},c.prototype.broadcast=function(){for(var a=this,b=[],c=0;c=0&&(this._components.splice(b,1),this._invalidateLayout()),this},b.prototype._addComponent=function(a,b){return"undefined"==typeof b&&(b=!1),null==a||this._components.indexOf(a)>=0?!1:(b?this._components.unshift(a):this._components.push(a),a._parent=this,this._isAnchored&&a._anchor(this.content),this._invalidateLayout(),!0)},b.prototype.components=function(){return this._components.slice()},b.prototype.empty=function(){return 0===this._components.length},b.prototype.removeAll=function(){return this._components.slice().forEach(function(a){return a.remove()}),this},b}(a.Abstract.Component);b.ComponentContainer=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){"undefined"==typeof b&&(b=[]);var c=this;a.call(this),this.classed("component-group",!0),b.forEach(function(a){return c._addComponent(a)})}return __extends(b,a),b.prototype._requestedSpace=function(a,b){var c=this._components.map(function(c){return c._requestedSpace(a,b)}),d=this.empty(),e=d?0:d3.max(c,function(a){return a.width}),f=d?0:d3.max(c,function(a){return a.height});return{width:Math.min(e,a),height:Math.min(f,b),wantsWidth:d?!1:c.map(function(a){return a.wantsWidth}).some(function(a){return a}),wantsHeight:d?!1:c.map(function(a){return a.wantsHeight}).some(function(a){return a})}},b.prototype.merge=function(a){return this._addComponent(a),this},b.prototype._computeLayout=function(b,c,d,e){var f=this;return a.prototype._computeLayout.call(this,b,c,d,e),this._components.forEach(function(a){a._computeLayout(0,0,f.availableWidth,f.availableHeight)}),this},b.prototype._isFixedWidth=function(){return this._components.every(function(a){return a._isFixedWidth()})},b.prototype._isFixedHeight=function(){return this._components.every(function(a){return a._isFixedHeight()})},b}(a.Abstract.ComponentContainer);b.Group=c}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a){"undefined"==typeof a&&(a=[]);var c=this;b.call(this),this.rowPadding=0,this.colPadding=0,this.rows=[],this.rowWeights=[],this.colWeights=[],this.nRows=0,this.nCols=0,this.classed("table",!0),a.forEach(function(a,b){a.forEach(function(a,d){c.addComponent(b,d,a)})})}return __extends(c,b),c.prototype.addComponent=function(a,b,c){if(this._addComponent(c)){this.nRows=Math.max(a+1,this.nRows),this.nCols=Math.max(b+1,this.nCols),this.padTableToSize(this.nRows,this.nCols);var d=this.rows[a][b];if(null!=d)throw new Error("Table.addComponent cannot be called on a cell where a component already exists (for the moment)");this.rows[a][b]=c}return this},c.prototype._removeComponent=function(a){b.prototype._removeComponent.call(this,a);var c,d;a:for(var e=0;e0&&v&&e!==x,C=f>0&&w&&f!==y;if(!B&&!C)break;if(r>5)break}return e=h-d3.sum(u.guaranteedWidths),f=i-d3.sum(u.guaranteedHeights),n=c.calcProportionalSpace(k,e),o=c.calcProportionalSpace(j,f),{colProportionalSpace:n,rowProportionalSpace:o,guaranteedWidths:u.guaranteedWidths,guaranteedHeights:u.guaranteedHeights,wantsWidth:v,wantsHeight:w}},c.prototype.determineGuarantees=function(b,c){var d=a.Util.Methods.createFilledArray(0,this.nCols),e=a.Util.Methods.createFilledArray(0,this.nRows),f=a.Util.Methods.createFilledArray(!1,this.nCols),g=a.Util.Methods.createFilledArray(!1,this.nRows);return this.rows.forEach(function(a,h){a.forEach(function(a,i){var j;if(j=null!=a?a._requestedSpace(b[i],c[h]):{width:0,height:0,wantsWidth:!1,wantsHeight:!1},j.width>b[i]||j.height>c[h])throw new Error("Invariant Violation: Abstract.Component cannot request more space than is offered");d[i]=Math.max(d[i],j.width),e[h]=Math.max(e[h],j.height),f[i]=f[i]||j.wantsWidth,g[h]=g[h]||j.wantsHeight})}),{guaranteedWidths:d,guaranteedHeights:e,wantsWidthArr:f,wantsHeightArr:g}},c.prototype._requestedSpace=function(a,b){var c=this.iterateLayout(a,b);return{width:d3.sum(c.guaranteedWidths),height:d3.sum(c.guaranteedHeights),wantsWidth:c.wantsWidth,wantsHeight:c.wantsHeight}},c.prototype._computeLayout=function(c,d,e,f){var g=this;b.prototype._computeLayout.call(this,c,d,e,f);var h=this.iterateLayout(this.availableWidth,this.availableHeight),i=a.Util.Methods.addArrays(h.rowProportionalSpace,h.guaranteedHeights),j=a.Util.Methods.addArrays(h.colProportionalSpace,h.guaranteedWidths),k=0;return this.rows.forEach(function(a,b){var c=0;a.forEach(function(a,d){null!=a&&a._computeLayout(c,k,j[d],i[b]),c+=j[d]+g.colPadding}),k+=i[b]+g.rowPadding}),this},c.prototype.padding=function(a,b){return this.rowPadding=a,this.colPadding=b,this._invalidateLayout(),this},c.prototype.rowWeight=function(a,b){return this.rowWeights[a]=b,this._invalidateLayout(),this},c.prototype.colWeight=function(a,b){return this.colWeights[a]=b,this._invalidateLayout(),this},c.prototype._isFixedWidth=function(){var a=d3.transpose(this.rows);return c.fixedSpace(a,function(a){return null==a||a._isFixedWidth()})},c.prototype._isFixedHeight=function(){return c.fixedSpace(this.rows,function(a){return null==a||a._isFixedHeight()})},c.prototype.padTableToSize=function(a,b){for(var c=0;a>c;c++){void 0===this.rows[c]&&(this.rows[c]=[],this.rowWeights[c]=null);for(var d=0;b>d;d++)void 0===this.rows[c][d]&&(this.rows[c][d]=null)}for(d=0;b>d;d++)void 0===this.colWeights[d]&&(this.colWeights[d]=null)},c.calcComponentWeights=function(a,b,c){return a.map(function(a,d){if(null!=a)return a;var e=b[d].map(c),f=e.reduce(function(a,b){return a&&b},!0);return f?0:1})},c.calcProportionalSpace=function(b,c){var d=d3.sum(b);return 0===d?a.Util.Methods.createFilledArray(0,b.length):b.map(function(a){return c*a/d})},c.fixedSpace=function(a,b){var c=function(a){return a.reduce(function(a,b){return a&&b},!0)},d=function(a){return c(a.map(b))};return c(a.map(d))},c}(a.Abstract.ComponentContainer);b.Table=c}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c){b.call(this),this._autoDomainAutomatically=!0,this.broadcaster=new a.Core.Broadcaster(this),this._rendererAttrID2Extent={},this._d3Scale=c}return __extends(c,b),c.prototype._getAllExtents=function(){return d3.values(this._rendererAttrID2Extent)},c.prototype._getExtent=function(){return[]},c.prototype.autoDomain=function(){return this._setDomain(this._getExtent()),this},c.prototype.scale=function(a){return this._d3Scale(a)},c.prototype.domain=function(a){return null==a?this._d3Scale.domain():(this._autoDomainAutomatically=!1,this._setDomain(a),this)},c.prototype._setDomain=function(a){if(1/0===a[0]||a[0]===-1/0||1/0===a[1]||a[1]===-1/0)throw new Error("data cannot contain Infinity or -Infinity");this._d3Scale.domain(a),this.broadcaster.broadcast()},c.prototype.range=function(a){return null==a?this._d3Scale.range():(this._d3Scale.range(a),this)},c.prototype.copy=function(){return new c(this._d3Scale.copy())},c.prototype.updateExtent=function(a,b,c){return this._rendererAttrID2Extent[a+b]=c,this._autoDomainAutomatically&&this.autoDomain(),this},c.prototype.removeExtent=function(a,b){return delete this._rendererAttrID2Extent[a+b],this._autoDomainAutomatically&&this.autoDomain(),this},c}(a.Abstract.PlottableObject);b.Scale=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c){b.call(this),this._dataChanged=!1,this._animate=!1,this._animators={},this._ANIMATION_DURATION=250,this._projectors={},this._rerenderUpdateSelection=!1,this._requireRerender=!1,this.clipPathEnabled=!0,this.classed("renderer",!0); +var d;d=null!=c?"function"==typeof c.data?c:d=new a.DataSource(c):new a.DataSource,this.dataSource(d)}return __extends(c,b),c.prototype._anchor=function(a){return b.prototype._anchor.call(this,a),this._dataChanged=!0,this},c.prototype.dataSource=function(a){var b=this;if(null==a)return this._dataSource;var c=this._dataSource;return null!=c&&(this._dataSource.broadcaster.deregisterListener(this),this._requireRerender=!0,this._rerenderUpdateSelection=!0),this._dataSource=a,this._dataSource.broadcaster.registerListener(this,function(){b.updateAllProjectors(),b._dataChanged=!0,b._render()}),this.updateAllProjectors(),this._dataChanged=!0,this._render(),this},c.prototype.project=function(a,b,c){var d=this;a=a.toLowerCase();var e=this._projectors[a],f=null!=e?e.scale:null;return null!=f&&(f.removeExtent(this._plottableID,a),f.broadcaster.deregisterListener(this)),null!=c&&c.broadcaster.registerListener(this,function(){return d._render()}),this._projectors[a]={accessor:b,scale:c},this._requireRerender=!0,this._rerenderUpdateSelection=!0,this.updateProjector(a),this},c.prototype._generateAttrToProjector=function(){var b=this,c={};return d3.keys(this._projectors).forEach(function(d){var e=b._projectors[d],f=a.Util.Methods.applyAccessor(e.accessor,b.dataSource()),g=e.scale,h=null==g?f:function(a,b){return g.scale(f(a,b))};c[d]=h}),c},c.prototype._doRender=function(){return null!=this.element&&(this._paint(),this._dataChanged=!1,this._requireRerender=!1,this._rerenderUpdateSelection=!1),this},c.prototype._paint=function(){},c.prototype._setup=function(){return b.prototype._setup.call(this),this.renderArea=this.content.append("g").classed("render-area",!0),this},c.prototype.animate=function(a){return this._animate=a,this},c.prototype.updateAllProjectors=function(){var a=this;return d3.keys(this._projectors).forEach(function(b){return a.updateProjector(b)}),this},c.prototype.updateProjector=function(a){var b=this._projectors[a];if(null!=b.scale){var c=this.dataSource()._getExtent(b.accessor);0===c.length?b.scale.removeExtent(this._plottableID,a):b.scale.updateExtent(this._plottableID,a,c)}return this},c.prototype._applyAnimatedAttributes=function(b,c,d){return this._animate&&null!=this._animators[c]&&!a.Core.ResizeBroadcaster.resizing()?this._animators[c].animate(b,d,this):b.attr(d)},c.prototype.animator=function(a,b){return void 0===b?this._animators[a]:(this._animators[a]=b,this)},c}(a.Abstract.Component);b.Plot=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){!function(b){var c=function(){function b(){}return b.prototype.render=function(){a.Core.RenderController.flush()},b}();b.Immediate=c;var d=function(){function b(){}return b.prototype.render=function(){a.Util.DOM.requestAnimationFramePolyfill(a.Core.RenderController.flush)},b}();b.AnimationFrame=d;var e=function(){function b(){this._timeoutMsec=a.Util.DOM.POLYFILL_TIMEOUT_MSEC}return b.prototype.render=function(){setTimeout(a.Core.RenderController.flush,this._timeoutMsec)},b}();b.Timeout=e}(b.RenderPolicy||(b.RenderPolicy={}));b.RenderPolicy}(b.RenderController||(b.RenderController={}));b.RenderController}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){function c(a){b._renderPolicy=a}function d(a){h[a._plottableID]=a,f()}function e(a){i[a._plottableID]=a,h[a._plottableID]=a,f()}function f(){j||(j=!0,b._renderPolicy.render())}function g(){if(j){var b=d3.values(i);b.forEach(function(a){return a._computeLayout()});var c=d3.values(h);c.forEach(function(a){return a._render()}),c=d3.values(h),c.forEach(function(a){return a._doRender()}),i={},h={},j=!1}a.Core.ResizeBroadcaster.clearResizing()}var h={},i={},j=!1;b._renderPolicy=new a.Core.RenderController.RenderPolicy.AnimationFrame,b.setRenderPolicy=c,b.registerToRender=d,b.registerToComputeLayout=e,b.flush=g}(b.RenderController||(b.RenderController={}));b.RenderController}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){function c(){void 0===i&&(i=new a.Core.Broadcaster(b),window.addEventListener("resize",d))}function d(){j=!0,i.broadcast()}function e(){return j}function f(){j=!1}function g(a){c(),i.registerListener(a._plottableID,function(){return a._invalidateLayout()})}function h(a){i&&i.deregisterListener(a._plottableID)}var i,j=!1;b.resizing=e,b.clearResizing=f,b.register=g,b.deregister=h}(b.ResizeBroadcaster||(b.ResizeBroadcaster={}));b.ResizeBroadcaster}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(){}(Plottable||(Plottable={}));var Plottable;!function(a){var b=function(){function a(b){"undefined"==typeof b&&(b=a.defaultCombineExtents),this.doNice=!1,this.padProportion=0,this.paddingExceptions=d3.set([]),this.includedValues=d3.map([]),this.combineExtents=b}return a.prototype.computeDomain=function(a,b){var c;return c=this.combineExtents(a),c=this.includeDomain(c),c=this.padDomain(c),c=this.niceDomain(b,c)},a.prototype.pad=function(a){return"undefined"==typeof a&&(a=.05),this.padProportion=a,this},a.prototype.paddingException=function(a,b){return"undefined"==typeof b&&(b=!0),b?this.paddingExceptions.add(a):this.paddingExceptions.remove(a),this},a.prototype.nice=function(a){return this.doNice=!0,this.niceCount=a,this},a.prototype.include=function(a,b){return"undefined"==typeof b&&(b=!0),b?this.includedValues.set(a,a):this.includedValues.remove(a),this},a.defaultCombineExtents=function(a){return 0===a.length?[0,1]:[d3.min(a,function(a){return a[0]}),d3.max(a,function(a){return a[1]})]},a.prototype.padDomain=function(b){if(b[0]===b[1]&&this.padProportion>0){var c=b[0].valueOf();return b[0]instanceof Date?[c-a.ONE_DAY,c+a.ONE_DAY]:[c-a.PADDING_FOR_IDENTICAL_DOMAIN,c+a.PADDING_FOR_IDENTICAL_DOMAIN]}var d=b[1]-b[0],e=[b[0].valueOf()-this.padProportion/2*d,b[1].valueOf()+this.padProportion/2*d];return this.paddingExceptions.has(b[0])&&(e[0]=b[0]),this.paddingExceptions.has(b[1])&&(e[1]=b[1]),e},a.prototype.niceDomain=function(a,b){return this.doNice?a._niceDomain(b,this.niceCount):b},a.prototype.includeDomain=function(a){return this.includedValues.values().reduce(function(a,b){return[Math.min(a[0],b),Math.max(a[1],b)]},a)},a.PADDING_FOR_IDENTICAL_DOMAIN=1,a.ONE_DAY=864e5,a}();a.Domainer=b}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c){b.call(this,c),this.lastRequestedTickCount=10,this._PADDING_FOR_IDENTICAL_DOMAIN=1,this._userSetDomainer=!1,this._domainer=new a.Domainer}return __extends(c,b),c.prototype.autoDomain=function(){return this._setDomain(this._domainer.computeDomain(this._getAllExtents(),this)),this},c.prototype.invert=function(a){return this._d3Scale.invert(a)},c.prototype.copy=function(){return new c(this._d3Scale.copy())},c.prototype.domain=function(a){return b.prototype.domain.call(this,a)},c.prototype.interpolate=function(a){return null==a?this._d3Scale.interpolate():(this._d3Scale.interpolate(a),this)},c.prototype.rangeRound=function(a){return this._d3Scale.rangeRound(a),this},c.prototype.clamp=function(a){return null==a?this._d3Scale.clamp():(this._d3Scale.clamp(a),this)},c.prototype.ticks=function(a){return null!=a&&(this.lastRequestedTickCount=a),this._d3Scale.ticks(this.lastRequestedTickCount)},c.prototype.tickFormat=function(a,b){return this._d3Scale.tickFormat(a,b)},c.prototype._niceDomain=function(a,b){return this._d3Scale.copy().domain(a).nice(b).domain()},c.prototype.domainer=function(a){return null==a?this._domainer:(this._domainer=a,this._userSetDomainer=!0,this._autoDomainAutomatically&&this.autoDomain(),this)},c}(a.Abstract.Scale);b.QuantitiveScale=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){a.call(this,null==b?d3.scale.linear():b)}return __extends(b,a),b.prototype.copy=function(){return new b(this._d3Scale.copy())},b}(a.Abstract.QuantitiveScale);b.Linear=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){a.call(this,null==b?d3.scale.log():b)}return __extends(b,a),b.prototype.copy=function(){return new b(this._d3Scale.copy())},b}(a.Abstract.QuantitiveScale);b.Log=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a){if(b.call(this,null==a?d3.scale.ordinal():a),this._range=[0,1],this._rangeType="bands",this._innerPadding=.3,this._outerPadding=.5,this._innerPadding>this._outerPadding)throw new Error("outerPadding must be >= innerPadding so cat axis bands work out reasonably")}return __extends(c,b),c.prototype._getExtent=function(){var b=this._getAllExtents();return a.Util.Methods.uniq(a.Util.Methods.flatten(b))},c.prototype.domain=function(a){return b.prototype.domain.call(this,a)},c.prototype._setDomain=function(a){b.prototype._setDomain.call(this,a),this.range(this.range())},c.prototype.range=function(a){return null==a?this._range:(this._range=a,"points"===this._rangeType?this._d3Scale.rangePoints(a,2*this._outerPadding):"bands"===this._rangeType&&this._d3Scale.rangeBands(a,this._innerPadding,this._outerPadding),this)},c.prototype.rangeBand=function(){return this._d3Scale.rangeBand()},c.prototype.innerPadding=function(){var a=this.domain();if(a.length<2)return 0;var b=Math.abs(this.scale(a[1])-this.scale(a[0]));return b-this.rangeBand()},c.prototype.fullBandStartAndWidth=function(a){var b=this.scale(a)-this.innerPadding()/2,c=this.rangeBand()+this.innerPadding();return[b,c]},c.prototype.rangeType=function(a,b,c){if(null==a)return this._rangeType;if("points"!==a&&"bands"!==a)throw new Error("Unsupported range type: "+a);return this._rangeType=a,null!=b&&(this._outerPadding=b),null!=c&&(this._innerPadding=c),this.broadcaster.broadcast(),this},c}(a.Abstract.Scale);b.Ordinal=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a){var c;switch(a){case"Category10":case"category10":case"10":c=d3.scale.category10();break;case"Category20":case"category20":case"20":c=d3.scale.category20();break;case"Category20b":case"category20b":case"20b":c=d3.scale.category20b();break;case"Category20c":case"category20c":case"20c":c=d3.scale.category20c();break;case null:case void 0:c=d3.scale.ordinal();break;default:throw new Error("Unsupported ColorScale type")}b.call(this,c)}return __extends(c,b),c.prototype._getExtent=function(){var b=this._getAllExtents(),c=[];return b.forEach(function(a){c=c.concat(a)}),a.Util.Methods.uniq(c)},c}(a.Abstract.Scale);b.Color=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.call(this,d3.time.scale()),this._PADDING_FOR_IDENTICAL_DOMAIN=864e5}return __extends(b,a),b.prototype._setDomain=function(b){a.prototype._setDomain.call(this,b.map(function(a){return new Date(a)}))},b}(a.Abstract.QuantitiveScale);b.Time=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(c,d){"undefined"==typeof c&&(c="reds"),"undefined"==typeof d&&(d="linear"),this._colorRange=this._resolveColorValues(c),this._scaleType=d,a.call(this,b.getD3InterpolatedScale(this._colorRange,this._scaleType))}return __extends(b,a),b.getD3InterpolatedScale=function(a,c){var d;switch(c){case"linear":d=d3.scale.linear();break;case"log":d=d3.scale.log();break;case"sqrt":d=d3.scale.sqrt();break;case"pow":d=d3.scale.pow()}if(null==d)throw new Error("unknown quantitive scale type "+c);return d.range([0,1]).interpolate(b.interpolateColors(a))},b.interpolateColors=function(a){if(a.length<2)throw new Error("Color scale arrays must have at least two elements.");return function(){return function(b){b=Math.max(0,Math.min(1,b));var c=b*(a.length-1),d=Math.floor(c),e=Math.ceil(c),f=c-d;return d3.interpolateLab(a[d],a[e])(f)}}},b.prototype.colorRange=function(a){return null==a?this._colorRange:(this._colorRange=this._resolveColorValues(a),void this._resetScale())},b.prototype.scaleType=function(a){return null==a?this._scaleType:(this._scaleType=a,void this._resetScale())},b.prototype._resetScale=function(){this._d3Scale=b.getD3InterpolatedScale(this._colorRange,this._scaleType),this._autoDomainAutomatically&&this.autoDomain(),this.broadcaster.broadcast()},b.prototype._resolveColorValues=function(a){return a instanceof Array?a:null!=b.COLOR_SCALES[a]?b.COLOR_SCALES[a]:b.COLOR_SCALES.reds},b.COLOR_SCALES={reds:["#FFFFFF","#FFF6E1","#FEF4C0","#FED976","#FEB24C","#FD8D3C","#FC4E2A","#E31A1C","#B10026"],blues:["#FFFFFF","#CCFFFF","#A5FFFD","#85F7FB","#6ED3EF","#55A7E0","#417FD0","#2545D3","#0B02E1"],posneg:["#0B02E1","#2545D3","#417FD0","#55A7E0","#6ED3EF","#85F7FB","#A5FFFD","#CCFFFF","#FFFFFF","#FFF6E1","#FEF4C0","#FED976","#FEB24C","#FD8D3C","#FC4E2A","#E31A1C","#B10026"]},b}(a.Abstract.QuantitiveScale);b.InterpolatedColor=c}(a.Scale||(a.Scale={}));a.Scale}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(a){var b=this;this.rescaleInProgress=!1,this.scales=a,this.scales.forEach(function(a){return a.broadcaster.registerListener(b,function(a){return b.rescale(a)})})}return a.prototype.rescale=function(a){if(!this.rescaleInProgress){this.rescaleInProgress=!0;var b=a.domain();this.scales.forEach(function(a){return a.domain(b)}),this.rescaleInProgress=!1}},a}();a.ScaleDomainCoordinator=b}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){var f=this;b.call(this),this._showEndTickLabels=!1,this.tickPositioning="center",this.orientToAlign={left:"right",right:"left",top:"bottom",bottom:"top"},this._axisScale=c,d=d.toLowerCase(),this.d3Axis=d3.svg.axis().scale(c._d3Scale).orient(d),this.classed("axis",!0);var g=e;null==e&&(e=new a.Formatter.General),e instanceof a.Abstract.Formatter&&(g=function(a){return e.format(a)}),this.tickFormat(g),this._axisScale.broadcaster.registerListener(this,function(){return f._render()})}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this.axisElement=this.content.append("g").classed("axis",!0),this},c.prototype._doRender=function(){var a,b=this._axisScale.domain(),c=Math.abs(b[1]-b[0]),d=+d3.min(b),e=+d3.max(b),f=b[0]b.right?!1:a.bottomb.bottom?!1:!0}var b,c=this.axisElement.selectAll(".tick").select("text");c.each(function(){var c=this.getBoundingClientRect();null!=b&&a(c,b)?d3.select(this).style("visibility","hidden"):(b=c,d3.select(this).style("visibility","visible"))})},c.prototype.scale=function(a){return null==a?this._axisScale:(this._axisScale=a,this.d3Axis.scale(a._d3Scale),this)},c.prototype.tickLabelPosition=function(a){return null==a?this.tickPositioning:(this.tickPositioning=a,this)},c.prototype.orient=function(a){return null==a?this.d3Axis.orient():(this.d3Axis.orient(a),this)},c.prototype.ticks=function(){for(var a=[],b=0;b0)if("center"!==this.tickLabelPosition()&&(d.attr("y","0px"),"bottom"===this.orient()?d.attr("dy","1em"):d.attr("dy","-0.25em"),"right"===this.tickLabelPosition()?d.attr("dx","0.2em").style("text-anchor","start"):"left"===this.tickLabelPosition()&&d.attr("dx","-0.2em").style("text-anchor","end")),null!=this._axisScale.rangeType){var e=(this._axisScale.range(),this.availableWidth),f=Math.abs(parseFloat(d3.select(d[0][0]).attr("y"))),g=this.availableHeight-f;if(d[0].length>1){var h=d.data(),i=h.map(function(a){return c._axisScale.scale(a)});i.forEach(function(a,b){var c=Math.abs(i[b+1]-a);e=e>c?c:e})}e=.9*e,d.each(function(){var b=d3.select(this),c=b.text(),d=a.Util.Text.getTextMeasure(b),f=a.Util.WordWrap.breakTextToFitRect(c,e,g,d).lines;if(1===f.length)b.text(a.Util.Text.getTruncatedText(c,e,b));else{b.text("");var h=b.selectAll("tspan").data(f);h.enter().append("tspan"),h.text(function(a){return a}).attr("x","0").attr("dy",function(a,c){return 0===c?b.attr("dy"):"1em"}).style("text-anchor",b.style("text-anchor"))}})}else this._hideOverlappingTickLabels();return this.showEndTickLabels()||this._hideCutOffTickLabels(),this},c}(c);b.XAxis=d;var e=function(b){function c(a,c,d){if("undefined"==typeof c&&(c="left"),"undefined"==typeof d&&(d=null),b.call(this,a,c,d),this._width=50,c=c.toLowerCase(),"left"!==c&&"right"!==c)throw new Error(c+" is not a valid orientation for YAxis");this.tickLabelPosition("middle");var e=this.orientToAlign[c];this.xAlign(e)}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this.axisElement.classed("y-axis",!0),this},c.prototype.width=function(a){return this._width=a,this._invalidateLayout(),this},c.prototype._requestedSpace=function(a){return{width:Math.min(a,this._width),height:0,wantsWidth:a0)if("middle"!==this.tickLabelPosition()&&(d.attr("x","0px"),"left"===this.orient()?d.attr("dx","-0.25em"):d.attr("dx","0.25em"),"top"===this.tickLabelPosition()?d.attr("dy","-0.3em"):"bottom"===this.tickLabelPosition()&&d.attr("dy","1em")),null!=this._axisScale.rangeType){var e=(this._axisScale.range(),Math.abs(parseFloat(d3.select(d[0][0]).attr("x")))),f=this.availableWidth-e,g=this.availableHeight;if(d[0].length>1){var h=d.data(),i=h.map(function(a){return c._axisScale.scale(a)});i.forEach(function(a,b){var c=Math.abs(i[b+1]-a);g=g>c?c:g})}var j=this.tickLabelPosition();d.each(function(){var b=d3.select(this),c=b.text(),d=a.Util.Text.getTextMeasure(b),e=a.Util.WordWrap.breakTextToFitRect(c,f,g,d).lines;if(1===e.length)b.text(a.Util.Text.getTruncatedText(c,f,b));else{var h=0;"top"===j?h=-(e.length-1):"middle"===j&&(h=-(e.length-1)/2),b.text("");var i=b.selectAll("tspan").data(e);i.enter().append("tspan"),i.text(function(a){return a}).attr({dy:b.attr("dy"),x:b.attr("x"),y:function(a,b){return h+b+"em"}}).style("text-anchor",b.style("text-anchor"))}})}else this._hideOverlappingTickLabels();return this.showEndTickLabels()||this._hideCutOffTickLabels(),this},c}(c);b.YAxis=e}(a.Axis||(a.Axis={}));a.Axis}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){var f=this;b.call(this),this._width="auto",this._height="auto",this._showEndTickLabels=!1,this._tickLength=5,this._tickLabelPadding=3,this._scale=c,this.orient(d),this.classed("axis",!0),this._isHorizontal()?this.classed("x-axis",!0):this.classed("y-axis",!0),null==e&&(e=new a.Formatter.General,e.showOnlyUnchangedValues(!1)),this.formatter(e),this._scale.broadcaster.registerListener(this,function(){return f.rescale()})}return __extends(c,b),c.prototype._isHorizontal=function(){return"top"===this._orientation||"bottom"===this._orientation},c.prototype._computeWidth=function(){return this._computedWidth=this._tickLength,this._computedWidth},c.prototype._computeHeight=function(){return this._computedHeight=this._tickLength,this._computedHeight},c.prototype._requestedSpace=function(a,b){var c=this._width,d=this._height;return this._isHorizontal()?("auto"===this._height&&(null==this._computedHeight&&this._computeHeight(),d=this._computedHeight),c=0):("auto"===this._width&&(null==this._computedWidth&&this._computeWidth(),c=this._computedWidth),d=0),{width:Math.min(a,c),height:Math.min(b,d),wantsWidth:!this._isHorizontal()&&c>a,wantsHeight:this._isHorizontal()&&d>b}},c.prototype._setup=function(){return b.prototype._setup.call(this),this._tickMarkContainer=this.content.append("g").classed(c.TICK_MARK_CLASS+"-container",!0),this._tickLabelContainer=this.content.append("g").classed(c.TICK_LABEL_CLASS+"-container",!0),this._baseline=this.content.append("line").classed("baseline",!0),this},c.prototype._getTickValues=function(){return[]},c.prototype._doRender=function(){var a=this._getTickValues(),b=this._tickMarkContainer.selectAll("."+c.TICK_MARK_CLASS).data(a);return b.enter().append("line").classed(c.TICK_MARK_CLASS,!0),b.attr(this._generateTickMarkAttrHash()),b.exit().remove(),this._baseline.attr(this._generateBaselineAttrHash()),this},c.prototype._generateBaselineAttrHash=function(){var a={x1:0,y1:0,x2:0,y2:0};switch(this._orientation){case"bottom":a.x2=this.availableWidth;break;case"top":a.x2=this.availableWidth,a.y1=this.availableHeight,a.y2=this.availableHeight;break;case"left":a.x1=this.availableWidth,a.x2=this.availableWidth,a.y2=this.availableHeight;break;case"right":a.y2=this.availableHeight}return a},c.prototype._generateTickMarkAttrHash=function(){var a=this,b={x1:0,y1:0,x2:0,y2:0},c=function(b){return a._scale.scale(b)};switch(this._isHorizontal()?(b.x1=c,b.x2=c):(b.y1=c,b.y2=c),this._orientation){case"bottom":b.y2=this._tickLength;break;case"top":b.y1=this.availableHeight,b.y2=this.availableHeight-this._tickLength;break;case"left":b.x1=this.availableWidth,b.x2=this.availableWidth-this._tickLength;break;case"right":b.x2=this._tickLength}return b},c.prototype.rescale=function(){return null!=this.element?this._render():null},c.prototype._invalidateLayout=function(){b.prototype._invalidateLayout.call(this),this._computedWidth=null,this._computedHeight=null},c.prototype.width=function(a){if(null==a)return this.availableWidth;if(this._isHorizontal())throw new Error("width cannot be set on a horizontal Axis");if("auto"!==a&&0>a)throw new Error("invalid value for width");return this._width=a,this._invalidateLayout(),this},c.prototype.height=function(a){if(null==a)return this.availableHeight;if(!this._isHorizontal())throw new Error("height cannot be set on a vertical Axis");if("auto"!==a&&0>a)throw new Error("invalid value for height");return this._height=a,this._invalidateLayout(),this},c.prototype.formatter=function(a){return this._formatter=a,this._invalidateLayout(),this},c.prototype.tickLength=function(a){if(null==a)return this._tickLength;if(0>a)throw new Error("tick length must be positive");return this._tickLength=a,this._invalidateLayout(),this},c.prototype.tickLabelPadding=function(a){if(null==a)return this._tickLabelPadding;if(0>a)throw new Error("tick label padding must be positive");return this._tickLabelPadding=a,this._invalidateLayout(),this},c.prototype.orient=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._invalidateLayout(),this},c.prototype.showEndTickLabels=function(a){return null==a?this._showEndTickLabels:(this._showEndTickLabels=a,this._render(),this)},c.TICK_MARK_CLASS="tick-mark",c.TICK_LABEL_CLASS="tick-label",c}(a.Abstract.Component);b.Axis=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c,d){b.call(this,a,c,d),this.tickLabelPositioning="center"}return __extends(c,b),c.prototype._computeWidth=function(){var b=this._getTickValues(),c=function(a){var b=Math.floor(Math.log(Math.abs(a))/Math.LN10);return b>0?b:1},d=Math.max.apply(null,b.map(c)),e=this._formatter.precision(),f=-(Math.pow(10,d)+Math.pow(10,-e)),g=this._tickLabelContainer.append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),h=this._formatter.format(f),i=g.text(h).node().getComputedTextLength();return g.remove(),this._computedWidth="center"===this.tickLabelPositioning?this.tickLength()+this.tickLabelPadding()+i:Math.max(this.tickLength(),this.tickLabelPadding()+i),this._computedWidth},c.prototype._computeHeight=function(){var b=this._tickLabelContainer.append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),c=a.Util.DOM.getBBox(b.text("test")).height;return b.remove(),this._computedHeight="center"===this.tickLabelPositioning?this.tickLength()+this.tickLabelPadding()+c:Math.max(this.tickLength(),this.tickLabelPadding()+c),this._computedHeight},c.prototype._getTickValues=function(){return this._scale.ticks(10)},c.prototype._doRender=function(){var c=this;b.prototype._doRender.call(this);var d={x:0,y:0,dx:"0em",dy:"0.3em"},e=this.tickLength(),f=this.tickLabelPadding(),g="middle",h=0,i=0,j=0,k=0;if(this._isHorizontal())switch(this.tickLabelPositioning){case"left":g="end",h=-f,k=f;break;case"center":k=e+f;break;case"right":g="start",h=f,k=f}else switch(this.tickLabelPositioning){case"top":d.dy="-0.3em",j=f,i=-f;break;case"center":j=e+f;break;case"bottom":d.dy="1em",j=f,i=f}var l=this._generateTickMarkAttrHash();switch(this._orientation){case"bottom":d.x=l.x1,d.dy="0.95em",i=l.y1+k;break;case"top":d.x=l.x1,d.dy="-.25em",i=l.y1-k;break;case"left":g="end",h=l.x1-j,d.y=l.y1;break;case"right":g="start",h=l.x1+j,d.y=l.y1}var m=this._getTickValues(),n=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).data(m);n.enter().append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),n.exit().remove();var o=function(a){return c._formatter.format(a)};n.style("text-anchor",g).style("visibility","visible").attr(d).text(o);var p="translate("+h+", "+i+")";return this._tickLabelContainer.attr("transform",p),this.showEndTickLabels()||this.hideEndTickLabels(),this.hideOverlappingTickLabels(),this},c.prototype.tickLabelPosition=function(a){if(null==a)return this.tickLabelPositioning;var b=a.toLowerCase();if(this._isHorizontal()){if("left"!==b&&"center"!==b&&"right"!==b)throw new Error(b+" is not a valid tick label position for a horizontal NumericAxis")}else if("top"!==b&&"center"!==b&&"bottom"!==b)throw new Error(b+" is not a valid tick label position for a vertical NumericAxis");return this.tickLabelPositioning=b,this._invalidateLayout(),this},c.prototype.hideEndTickLabels=function(){var b=this,c=this.element.select(".bounding-box")[0][0].getBoundingClientRect(),d=function(a){return Math.floor(c.left)<=Math.ceil(a.left)&&Math.floor(c.top)<=Math.ceil(a.top)&&Math.floor(a.right)<=Math.ceil(c.left+b.availableWidth)&&Math.floor(a.bottom)<=Math.ceil(c.top+b.availableHeight)},e=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS),f=e[0][0];d(f.getBoundingClientRect())||d3.select(f).style("visibility","hidden");var g=e[0][e[0].length-1];d(g.getBoundingClientRect())||d3.select(g).style("visibility","hidden")},c.prototype.hideOverlappingTickLabels=function(){function b(a,b){return a.rightb.right?!1:a.bottomb.bottom?!1:!0}var c,d=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).filter(function(){return"visible"===d3.select(this).style("visibility") +});d.each(function(){var a=this.getBoundingClientRect(),d=d3.select(this);null!=c&&b(a,c)?d.style("visibility","hidden"):(c=a,d.style("visibility","visible"))})},c}(a.Abstract.Axis);b.Numeric=c}(a.Axis||(a.Axis={}));a.Axis}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c){"undefined"==typeof c&&(c="bottom");var d=this;if(b.call(this,a,c),this.classed("category-axis",!0),"bands"!==a.rangeType())throw new Error("Only rangeBands category axes are implemented");this._scale.broadcaster.registerListener(this,function(){return d._invalidateLayout()})}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this._tickLabelsG=this.content.append("g").classed("tick-labels",!0),this},c.prototype._requestedSpace=function(a,b){var c=this._isHorizontal()?0:this.tickLength()+this.tickLabelPadding(),d=this._isHorizontal()?this.tickLength()+this.tickLabelPadding():0;if(0>a||0>b)return{width:a,height:b,wantsWidth:!this._isHorizontal(),wantsHeight:this._isHorizontal()};if(0===this._scale.domain().length)return{width:0,height:0,wantsWidth:!1,wantsHeight:!1};this._scale.range(this._isHorizontal()?[0,a]:[b,0]);var e=this._tickLabelsG.append("g"),f=e.selectAll(".tick").data(this._scale.domain());f.enter().append("g").classed("tick",!0);var g=this.writeTextToTicks(a,b,f);return e.remove(),{width:g.usedWidth+c,height:g.usedHeight+d,wantsWidth:!g.textFits,wantsHeight:!g.textFits}},c.prototype._getTickValues=function(){return this._scale.domain()},c.prototype.writeTextToTicks=function(b,c,d){var e=this,f=[];d.each(function(d){var g=d3.select(this),h=e._scale.fullBandStartAndWidth(d)[1],i=e._isHorizontal()?h:b-e.tickLength()-e.tickLabelPadding(),j=e._isHorizontal()?c-e.tickLength()-e.tickLabelPadding():h,k={left:"right",right:"left",top:"center",bottom:"center"},l={left:"center",right:"center",top:"bottom",bottom:"top"},m=a.Util.Text.writeText(d,g,i,j,k[e._orientation],l[e._orientation],!0);f.push(m)});var g=this._isHorizontal()?d3.sum:d3.max,h=this._isHorizontal()?d3.max:d3.sum;return{textFits:f.every(function(a){return a.textFits}),usedWidth:g(f,function(a){return a.usedWidth}),usedHeight:h(f,function(a){return a.usedHeight})}},c.prototype._doRender=function(){var c=this;b.prototype._doRender.call(this);{var d=this._tickLabelsG.selectAll(".tick-label").data(this._scale.domain(),function(a){return a}),e=function(a){var b=c._scale.fullBandStartAndWidth(a),d=b[0],e=c._isHorizontal()?d:0,f=c._isHorizontal()?0:d;return"translate("+e+","+f+")"};d.enter().append("g").classed("tick-label",!0)}d.exit().remove(),d.attr("transform",e),d.text(""),this.writeTextToTicks(this.availableWidth,this.availableHeight,d);var f=this._isHorizontal()?[this._scale.rangeBand()/2,0]:[0,this._scale.rangeBand()/2],g="right"===this._orientation?this.tickLength()+this.tickLabelPadding():0,h="bottom"===this._orientation?this.tickLength()+this.tickLabelPadding():0;return a.Util.DOM.translate(this._tickLabelsG,g,h),a.Util.DOM.translate(this._tickMarkContainer,f[0],f[1]),this},c}(a.Abstract.Axis);b.Category=c}(a.Axis||(a.Axis={}));a.Axis}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c){if("undefined"==typeof a&&(a=""),"undefined"==typeof c&&(c="horizontal"),b.call(this),this.classed("label",!0),this.setText(a),c=c.toLowerCase(),"horizontal"!==c&&"vertical-left"!==c&&"vertical-right"!==c)throw new Error(c+" is not a valid orientation for LabelComponent");this.orientation=c,this.xAlign("CENTER").yAlign("CENTER")}return __extends(c,b),c.prototype._requestedSpace=function(a,b){var c,d;return"horizontal"===this.orientation?(c=this.textLength,d=this.textHeight):(c=this.textHeight,d=this.textLength),{width:Math.min(c,a),height:Math.min(d,b),wantsWidth:c>a,wantsHeight:d>b}},c.prototype._setup=function(){return b.prototype._setup.call(this),this.textElement=this.content.append("text"),this.setText(this.text),this},c.prototype.setText=function(a){return this.text=a,null!=this.element&&(this.textElement.text(a),this.measureAndSetTextSize()),this._invalidateLayout(),this},c.prototype.measureAndSetTextSize=function(){var b=a.Util.DOM.getBBox(this.textElement);this.textHeight=b.height,this.textLength=""===this.text?0:b.width},c.prototype.truncateTextAndRemeasure=function(b){var c=a.Util.Text.getTruncatedText(this.text,b,this.textElement);this.textElement.text(c),this.measureAndSetTextSize()},c.prototype._computeLayout=function(c,d,e,f){b.prototype._computeLayout.call(this,c,d,e,f),this.textElement.attr("dy",0);var g=a.Util.DOM.getBBox(this.textElement);this.textElement.attr("dy",-g.y);var h=0,i=0;return"horizontal"===this.orientation?(this.truncateTextAndRemeasure(this.availableWidth),h=(this.availableWidth-this.textLength)*this._xAlignProportion):(this.truncateTextAndRemeasure(this.availableHeight),h=(this.availableHeight-this.textLength)*this._yAlignProportion,"vertical-right"===this.orientation?(this.textElement.attr("transform","rotate(90)"),i=-this.textHeight):(this.textElement.attr("transform","rotate(-90)"),h=-h-this.textLength)),this.textElement.attr("x",h),this.textElement.attr("y",i),this},c}(a.Abstract.Component);b.Label=c;var d=function(a){function b(b,c){a.call(this,b,c),this.classed("title-label",!0)}return __extends(b,a),b}(c);b.TitleLabel=d;var e=function(a){function b(b,c){a.call(this,b,c),this.classed("axis-label",!0)}return __extends(b,a),b}(c);b.AxisLabel=e}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a){b.call(this),this.classed("legend",!0),this.scale(a),this.xAlign("RIGHT").yAlign("TOP"),this.xOffset(5).yOffset(5)}return __extends(c,b),c.prototype.toggleCallback=function(a){return void 0!==a?(this._toggleCallback=a,this.isOff=d3.set(),this.updateListeners(),this.updateClasses(),this):this._toggleCallback},c.prototype.hoverCallback=function(a){return void 0!==a?(this._hoverCallback=a,this.datumCurrentlyFocusedOn=void 0,this.updateListeners(),this.updateClasses(),this):this._hoverCallback},c.prototype.scale=function(a){var b=this;return null!=a?(null!=this.colorScale&&this.colorScale.broadcaster.deregisterListener(this),this.colorScale=a,this.colorScale.broadcaster.registerListener(this,function(){return b.updateDomain()}),this.updateDomain(),this):this.colorScale},c.prototype.updateDomain=function(){null!=this._toggleCallback&&(this.isOff=a.Util.Methods.intersection(this.isOff,d3.set(this.scale().domain()))),null!=this._hoverCallback&&(this.datumCurrentlyFocusedOn=this.scale().domain().indexOf(this.datumCurrentlyFocusedOn)>=0?this.datumCurrentlyFocusedOn:void 0),this._invalidateLayout()},c.prototype._computeLayout=function(a,c,d,e){b.prototype._computeLayout.call(this,a,c,d,e);var f=this.measureTextHeight(),g=this.colorScale.domain().length;return this.nRowsDrawn=Math.min(g,Math.floor(this.availableHeight/f)),this},c.prototype._requestedSpace=function(b,d){var e=this.measureTextHeight(),f=this.colorScale.domain().length,g=Math.min(f,Math.floor(d/e)),h=this.content.append("g").classed(c.SUBELEMENT_CLASS,!0),i=h.append("text"),j=d3.max(this.colorScale.domain(),function(b){return a.Util.Text.getTextWidth(i,b)});h.remove(),j=void 0===j?0:j;var k=j+e+c.MARGIN;return{width:Math.min(k,b),height:g*e,wantsWidth:k>b,wantsHeight:f>g}},c.prototype.measureTextHeight=function(){var b=this.content.append("g").classed(c.SUBELEMENT_CLASS,!0),d=a.Util.Text.getTextHeight(b.append("text"));return b.remove(),d},c.prototype._doRender=function(){b.prototype._doRender.call(this);var d=this.colorScale.domain().slice(0,this.nRowsDrawn),e=this.measureTextHeight(),f=this.availableWidth-e-c.MARGIN,g=e-2*c.MARGIN-2,h=this.content.selectAll("."+c.SUBELEMENT_CLASS).data(d,function(a){return a}),i=h.enter().append("g").classed(c.SUBELEMENT_CLASS,!0);return i.append("circle").attr("cx",c.MARGIN+g/2).attr("cy",c.MARGIN+g/2).attr("r",g),i.append("text").attr("x",e).attr("y",c.MARGIN+e/2),h.exit().remove(),h.attr("transform",function(a){return"translate(0,"+d.indexOf(a)*e+")"}),h.selectAll("circle").attr("fill",this.colorScale._d3Scale),h.selectAll("text").text(function(b){return a.Util.Text.getTruncatedText(b,f,d3.select(this))}),this.updateClasses(),this.updateListeners(),this},c.prototype.updateListeners=function(){var a=this;if(this._isSetup){var b=this.content.selectAll("."+c.SUBELEMENT_CLASS);if(null!=this._hoverCallback){var d=function(b){return function(c){a.datumCurrentlyFocusedOn=b?c:void 0,a._hoverCallback(a.datumCurrentlyFocusedOn),a.updateClasses()}};b.on("mouseover",d(!0)),b.on("mouseout",d(!1))}else b.on("mouseover",null),b.on("mouseout",null);null!=this._toggleCallback?b.on("click",function(b){var c=a.isOff.has(b);c?a.isOff.remove(b):a.isOff.add(b),a._toggleCallback(b,c),a.updateClasses()}):b.on("click",null)}},c.prototype.updateClasses=function(){var a=this;if(this._isSetup){var b=this.content.selectAll("."+c.SUBELEMENT_CLASS);null!=this._hoverCallback?(b.classed("focus",function(b){return a.datumCurrentlyFocusedOn===b}),b.classed("hover",void 0!==this.datumCurrentlyFocusedOn)):(b.classed("hover",!1),b.classed("focus",!1)),null!=this._toggleCallback?(b.classed("toggled-on",function(b){return!a.isOff.has(b)}),b.classed("toggled-off",function(b){return a.isOff.has(b)})):(b.classed("toggled-on",!1),b.classed("toggled-off",!1))}},c.SUBELEMENT_CLASS="legend-row",c.MARGIN=5,c}(a.Abstract.Component);b.Legend=c}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c){var d=this;a.call(this),this.classed("gridlines",!0),this.xScale=b,this.yScale=c,null!=this.xScale&&this.xScale.broadcaster.registerListener(this,function(){return d._render()}),null!=this.yScale&&this.yScale.broadcaster.registerListener(this,function(){return d._render()})}return __extends(b,a),b.prototype._setup=function(){return a.prototype._setup.call(this),this.xLinesContainer=this.content.append("g").classed("x-gridlines",!0),this.yLinesContainer=this.content.append("g").classed("y-gridlines",!0),this},b.prototype._doRender=function(){return a.prototype._doRender.call(this),this.redrawXLines(),this.redrawYLines(),this},b.prototype.redrawXLines=function(){var a=this;if(null!=this.xScale){var b=this.xScale.ticks(),c=function(b){return a.xScale.scale(b)},d=this.xLinesContainer.selectAll("line").data(b);d.enter().append("line"),d.attr("x1",c).attr("y1",0).attr("x2",c).attr("y2",this.availableHeight),d.exit().remove()}},b.prototype.redrawYLines=function(){var a=this;if(null!=this.yScale){var b=this.yScale.ticks(),c=function(b){return a.yScale.scale(b)},d=this.yLinesContainer.selectAll("line").data(b);d.enter().append("line"),d.attr("x1",0).attr("y1",c).attr("x2",this.availableWidth).attr("y2",c),d.exit().remove()}},b}(a.Abstract.Component);b.Gridlines=c}(a.Component||(a.Component={}));a.Component}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(a){function b(b,c,d){"undefined"==typeof c&&(c=a.ONE_DAY),"undefined"==typeof d&&(d="");var e=function(a){var e=Math.round((a.valueOf()-b)/c);return e.toString()+d};return e}a.ONE_DAY=864e5,a.generateRelativeDateFormatter=b}(a.Axis||(a.Axis={}));a.Axis}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c,d){b.call(this,a),this.classed("xy-renderer",!0),this.project("x","x",c),this.project("y","y",d)}return __extends(c,b),c.prototype.project=function(a,c,d){return"x"===a&&null!=d&&(this.xScale=d,this._updateXDomainer()),"y"===a&&null!=d&&(this.yScale=d,this._updateYDomainer()),b.prototype.project.call(this,a,c,d),this},c.prototype._computeLayout=function(a,c,d,e){return b.prototype._computeLayout.call(this,a,c,d,e),this.xScale.range([0,this.availableWidth]),this.yScale.range([this.availableHeight,0]),this},c.prototype.rescale=function(){null!=this.element&&this._render()},c.prototype._updateXDomainer=function(){if(this.xScale instanceof a.Abstract.QuantitiveScale){var b=this.xScale;b._userSetDomainer||b.domainer().pad().nice()}return this},c.prototype._updateYDomainer=function(){if(this.yScale instanceof a.Abstract.QuantitiveScale){var b=this.yScale;b._userSetDomainer||b.domainer().pad().nice()}return this},c}(a.Abstract.Plot);b.XYPlot=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){b.call(this,c,d,e),this._animators={"circles-reset":new a.Animator.Null,circles:(new a.Animator.IterativeDelay).duration(250).delay(5)},this.classed("circle-renderer",!0),this.project("r",3),this.project("fill",function(){return"steelblue"})}return __extends(c,b),c.prototype.project=function(a,c,d){return a="cx"===a?"x":a,a="cy"===a?"y":a,b.prototype.project.call(this,a,c,d),this},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this._generateAttrToProjector();a.cx=a.x,a.cy=a.y,delete a.x,delete a.y;var c=this.renderArea.selectAll("circle").data(this._dataSource.data());if(c.enter().append("circle"),this._dataChanged){var d=a.r;a.r=function(){return 0},this._applyAnimatedAttributes(c,"circles-reset",a),a.r=d}this._applyAnimatedAttributes(c,"circles",a),c.exit().remove()},c}(a.Abstract.XYPlot);b.Scatter=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e,f){b.call(this,c,d,e),this._animators={cells:new a.Animator.Null},this.classed("grid-renderer",!0),this.xScale.rangeType("bands",0,0),this.yScale.rangeType("bands",0,0),this.colorScale=f,this.project("fill","value",f)}return __extends(c,b),c.prototype.project=function(a,c,d){return b.prototype.project.call(this,a,c,d),"fill"===a&&(this.colorScale=this._projectors.fill.scale),this},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this.renderArea.selectAll("rect").data(this._dataSource.data());a.enter().append("rect");var c=this.xScale.rangeBand(),d=this.yScale.rangeBand(),e=this._generateAttrToProjector();e.width=function(){return c},e.height=function(){return d},this._applyAnimatedAttributes(a,"cells",e),a.exit().remove()},c}(a.Abstract.XYPlot);b.Grid=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){b.call(this,c,d,e),this._baselineValue=0,this.previousBaselineValue=null,this._animators={"bars-reset":new a.Animator.Null,bars:new a.Animator.IterativeDelay,baseline:new a.Animator.Null},this.classed("bar-renderer",!0),this.project("width",10),this.project("fill",function(){return"steelblue"}),this.baseline(this._baselineValue)}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this._baseline=this.renderArea.append("line").classed("baseline",!0),this._bars=this.renderArea.selectAll("rect").data([]),this},c.prototype.baseline=function(a){return this.previousBaselineValue=this._baselineValue,this._baselineValue=a,this._updateXDomainer(),this._updateYDomainer(),null!=this.element&&this._render(),this},c.prototype.barAlignment=function(){return this},c.prototype.parseExtent=function(a){if("number"==typeof a)return{min:a,max:a};if(a instanceof Object&&"min"in a&&"max"in a)return a;throw new Error("input '"+a+"' can't be parsed as an IExtent")},c.prototype.selectBar=function(a,b,c){if("undefined"==typeof c&&(c=!0),!this._isSetup)return null;var d=[],e=this.parseExtent(a),f=this.parseExtent(b),g=.5;if(this._bars.each(function(){var a=this.getBBox();a.x+a.width>=e.min-g&&a.x<=e.max+g&&a.y+a.height>=f.min-g&&a.y<=f.max+g&&d.push(this)}),d.length>0){var h=d3.selectAll(d);return h.classed("selected",c),h}return null},c.prototype.deselectAll=function(){return this._isSetup&&this._bars.classed("selected",!1),this},c.prototype._updateDomainer=function(b){if(b instanceof a.Abstract.QuantitiveScale){var c=b;c._userSetDomainer||null==this._baselineValue||(c.domainer().paddingException(this.previousBaselineValue,!1).include(this.previousBaselineValue,!1).paddingException(this._baselineValue).include(this._baselineValue),c._autoDomainAutomatically&&c.autoDomain())}return this},c}(a.Abstract.XYPlot);b.BarPlot=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c,d){a.call(this,b,c,d),this._barAlignment="left"}return __extends(b,a),b.prototype._paint=function(){a.prototype._paint.call(this);var b=this.yScale.scale(this._baselineValue);this._bars=this.renderArea.selectAll("rect").data(this._dataSource.data()),this._bars.enter().append("rect");var c=this._generateAttrToProjector(),d=c.x,e=c.width,f=this.xScale,g=null==f.rangeType?"points":f.rangeType();"points"===g?"center"===this._barAlignment?c.x=function(a,b){return d(a,b)-e(a,b)/2}:"right"===this._barAlignment&&(c.x=function(a,b){return d(a,b)-e(a,b)}):c.width=function(){return f.rangeBand()};var h=c.y;this._dataChanged&&(c.y=function(){return b},c.height=function(){return 0},this._applyAnimatedAttributes(this._bars,"bars-reset",c)),c.y=function(a,c){var d=h(a,c);return d>b?b:d};var i=function(a,c){return Math.abs(b-h(a,c))};c.height=i,null!=c.fill&&this._bars.attr("fill",c.fill),this._applyAnimatedAttributes(this._bars,"bars",c),this._bars.exit().remove();var j={x1:0,y1:b,x2:this.availableWidth,y2:b};this._applyAnimatedAttributes(this._baseline,"baseline",j)},b.prototype.barAlignment=function(a){var b=a.toLowerCase();if("left"!==b&&"center"!==b&&"right"!==b)throw new Error("unsupported bar alignment");return this._barAlignment=b,null!=this.element&&this._render(),this},b.prototype._updateYDomainer=function(){return this._updateDomainer(this.yScale),this},b}(a.Abstract.BarPlot);b.VerticalBar=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c,d){a.call(this,b,c,d),this._barAlignment="top"}return __extends(b,a),b.prototype._paint=function(){a.prototype._paint.call(this),this._bars=this.renderArea.selectAll("rect").data(this._dataSource.data()),this._bars.enter().append("rect");var b=this._generateAttrToProjector(),c=b.y;b.height=b.width;var d=b.height,e=this.yScale,f=null==e.rangeType?"points":e.rangeType();"points"===f?"middle"===this._barAlignment?b.y=function(a,b){return c(a,b)-d(a,b)/2}:"bottom"===this._barAlignment&&(b.y=function(a,b){return c(a,b)-d(a,b)}):b.height=function(){return e.rangeBand()};var g=this.xScale.scale(this._baselineValue),h=b.x;this._animate&&this._dataChanged&&(b.x=function(){return g},b.width=function(){return 0},this._applyAnimatedAttributes(this._bars,"bars-reset",b)),b.x=function(a,b){var c=h(a,b);return c>g?g:c};var i=function(a,b){return Math.abs(g-h(a,b))};b.width=i,null!=b.fill&&this._bars.attr("fill",b.fill),this._applyAnimatedAttributes(this._bars,"bars",b),this._bars.exit().remove();var j={x1:g,y1:0,x2:g,y2:this.availableHeight};this._applyAnimatedAttributes(this._baseline,"baseline",j)},b.prototype.barAlignment=function(a){var b=a.toLowerCase();if("top"!==b&&"middle"!==b&&"bottom"!==b)throw new Error("unsupported bar alignment");return this._barAlignment=b,null!=this.element&&this._render(),this},b.prototype._updateXDomainer=function(){return this._updateDomainer(this.yScale),this},b}(a.Abstract.BarPlot);b.HorizontalBar=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(c,d,e){b.call(this,c,d,e),this._animators={"area-reset":new a.Animator.Null,area:(new a.Animator.Default).duration(600).easing("exp-in-out")},this.classed("area-renderer",!0),this.project("y0",0,e),this.project("fill",function(){return"steelblue"}),this.project("stroke",function(){return"none"})}return __extends(c,b),c.prototype._setup=function(){return b.prototype._setup.call(this),this.areaPath=this.renderArea.append("path").classed("area",!0),this.linePath=this.renderArea.append("path").classed("line",!0),this},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this._generateAttrToProjector(),c=a.x,d=a.y0,e=a.y;delete a.x,delete a.y0,delete a.y,this.areaPath.datum(this._dataSource.data()),this.linePath.datum(this._dataSource.data()),this._dataChanged&&(a.d=d3.svg.area().x(c).y0(d).y1(d),this._applyAnimatedAttributes(this.areaPath,"area-reset",a),a.d=d3.svg.line().x(c).y(d),this._applyAnimatedAttributes(this.linePath,"area-reset",a)),a.d=d3.svg.area().x(c).y0(d).y1(e),this._applyAnimatedAttributes(this.areaPath,"area",a),a.d=d3.svg.line().x(c).y(e),this._applyAnimatedAttributes(this.linePath,"area",a)},c}(a.Abstract.XYPlot);b.Area=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c,d){a.call(this,b,c,d),this.classed("line-renderer",!0),this.project("stroke",function(){return"steelblue"}),this.project("fill",function(){return"none"})}return __extends(b,a),b}(a.Plot.Area);b.Line=c}(a.Plot||(a.Plot={}));a.Plot}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){}return a.prototype.animate=function(a,b){return a.attr(b)},a}();a.Null=b}(a.Animator||(a.Animator={}));a.Animator}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){this._durationMsec=300,this._delayMsec=0,this._easing="exp-out"}return a.prototype.animate=function(a,b){return a.transition().ease(this._easing).duration(this._durationMsec).delay(this._delayMsec).attr(b)},a.prototype.duration=function(a){return void 0===a?this._durationMsec:(this._durationMsec=a,this)},a.prototype.delay=function(a){return void 0===a?this._delayMsec:(this._delayMsec=a,this)},a.prototype.easing=function(a){return void 0===a?this._easing:(this._easing=a,this)},a}();a.Default=b}(a.Animator||(a.Animator={}));a.Animator}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments),this._delayMsec=15}return __extends(b,a),b.prototype.animate=function(a,b){var c=this;return a.transition().ease(this._easing).duration(this._durationMsec).delay(function(a,b){return b*c._delayMsec}).attr(b)},b}(a.Animator.Default);b.IterativeDelay=c}(a.Animator||(a.Animator={}));a.Animator}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(a){function b(){e||(d3.select(document).on("keydown",d),e=!0)}function c(a,c){e||b(),null==f[a]&&(f[a]=[]),f[a].push(c)}function d(){null!=f[d3.event.keyCode]&&f[d3.event.keyCode].forEach(function(a){a(d3.event)})}var e=!1,f=[];a.initialize=b,a.addCallback=c}(a.KeyEventListener||(a.KeyEventListener={}));a.KeyEventListener}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(a){this.componentToListenTo=a}return a.prototype._anchor=function(a){this.hitBox=a},a.prototype.registerWithComponent=function(){return this.componentToListenTo.registerInteraction(this),this},a}();a.Interaction=b}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){a.call(this,b)}return __extends(b,a),b.prototype._anchor=function(b){var c=this;a.prototype._anchor.call(this,b),b.on(this._listenTo(),function(){var a=d3.mouse(b.node()),d=a[0],e=a[1];c._callback(d,e)})},b.prototype._listenTo=function(){return"click"},b.prototype.callback=function(a){return this._callback=a,this},b}(a.Abstract.Interaction);b.Click=c;var d=function(a){function b(b){a.call(this,b)}return __extends(b,a),b.prototype._listenTo=function(){return"dblclick"},b}(c);b.DoubleClick=d}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){a.call(this,b)}return __extends(b,a),b.prototype._anchor=function(b){var c=this;a.prototype._anchor.call(this,b),b.on("mousemove",function(){var a=d3.mouse(b.node()),d=a[0],e=a[1];c.mousemove(d,e)})},b.prototype.mousemove=function(){},b}(a.Abstract.Interaction);b.Mousemove=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(a,c){b.call(this,a),this.activated=!1,this.keyCode=c}return __extends(c,b),c.prototype._anchor=function(c){var d=this;b.prototype._anchor.call(this,c),c.on("mouseover",function(){d.activated=!0}),c.on("mouseout",function(){d.activated=!1}),a.Core.KeyEventListener.addCallback(this.keyCode,function(){d.activated&&null!=d._callback&&d._callback()})},c.prototype.callback=function(a){return this._callback=a,this},c}(a.Abstract.Interaction);b.Key=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b,c,d){var e=this;a.call(this,b),this.xScale=c,this.yScale=d,this.zoom=d3.behavior.zoom(),this.zoom.x(this.xScale._d3Scale),this.zoom.y(this.yScale._d3Scale),this.zoom.on("zoom",function(){return e.rerenderZoomed()})}return __extends(b,a),b.prototype.resetZoom=function(){var a=this;this.zoom=d3.behavior.zoom(),this.zoom.x(this.xScale._d3Scale),this.zoom.y(this.yScale._d3Scale),this.zoom.on("zoom",function(){return a.rerenderZoomed()}),this.zoom(this.hitBox)},b.prototype._anchor=function(b){a.prototype._anchor.call(this,b),this.zoom(b)},b.prototype.rerenderZoomed=function(){var a=this.xScale._d3Scale.domain(),b=this.yScale._d3Scale.domain();this.xScale.domain(a),this.yScale.domain(b)},b}(a.Abstract.Interaction);b.PanZoom=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(b){var c=this;a.call(this,b),this.dragInitialized=!1,this.origin=[0,0],this.location=[0,0],this.dragBehavior=d3.behavior.drag(),this.dragBehavior.on("dragstart",function(){return c._dragstart()}),this.dragBehavior.on("drag",function(){return c._drag()}),this.dragBehavior.on("dragend",function(){return c._dragend()})}return __extends(b,a),b.prototype.callback=function(a){return this.callbackToCall=a,this},b.prototype._dragstart=function(){var a=this.componentToListenTo.availableWidth,b=this.componentToListenTo.availableHeight,c=function(a,b){return function(c){return Math.min(Math.max(c,a),b)}};this.constrainX=c(0,a),this.constrainY=c(0,b)},b.prototype._drag=function(){this.dragInitialized||(this.origin=[d3.event.x,d3.event.y],this.dragInitialized=!0),this.location=[this.constrainX(d3.event.x),this.constrainY(d3.event.y)]},b.prototype._dragend=function(){this.dragInitialized&&(this.dragInitialized=!1,this._doDragend())},b.prototype._doDragend=function(){null!=this.callbackToCall&&this.callbackToCall([this.origin,this.location])},b.prototype._anchor=function(b){return a.prototype._anchor.call(this,b),b.call(this.dragBehavior),this},b.prototype.setupZoomCallback=function(a,b){function c(c){return null==c?(f&&(null!=a&&a.domain(d),null!=b&&b.domain(e)),void(f=!f)):(f=!1,null!=a&&a.domain([a.invert(c.xMin),a.invert(c.xMax)]),null!=b&&b.domain([b.invert(c.yMax),b.invert(c.yMin)]),void this.clearBox())}var d=null!=a?a.domain():null,e=null!=b?b.domain():null,f=!1;return this.callback(c),this},b}(a.Abstract.Interaction);b.Drag=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments),this.boxIsDrawn=!1}return __extends(b,a),b.prototype._dragstart=function(){a.prototype._dragstart.call(this),null!=this.callbackToCall&&this.callbackToCall(null),this.clearBox()},b.prototype.clearBox=function(){return this.dragBox.attr("height",0).attr("width",0),this.boxIsDrawn=!1,this},b.prototype.setBox=function(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d),g=Math.min(a,b),h=Math.min(c,d);return this.dragBox.attr({x:g,y:h,width:e,height:f}),this.boxIsDrawn=e>0&&f>0,this},b.prototype._anchor=function(c){a.prototype._anchor.call(this,c);var d=b.CLASS_DRAG_BOX,e=this.componentToListenTo.foregroundContainer;return this.dragBox=e.append("rect").classed(d,!0).attr("x",0).attr("y",0),this},b.CLASS_DRAG_BOX="drag-box",b}(a.Interaction.Drag);b.DragBox=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype._drag=function(){a.prototype._drag.call(this),this.setBox(this.origin[0],this.location[0])},b.prototype._doDragend=function(){if(null!=this.callbackToCall){var a=Math.min(this.origin[0],this.location[0]),b=Math.max(this.origin[0],this.location[0]),c={xMin:a,xMax:b};this.callbackToCall(c)}},b.prototype.setBox=function(b,c){return a.prototype.setBox.call(this,b,c,0,this.componentToListenTo.availableHeight),this +},b}(a.Interaction.DragBox);b.XDragBox=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype._drag=function(){a.prototype._drag.call(this),this.setBox(this.origin[0],this.location[0],this.origin[1],this.location[1])},b.prototype._doDragend=function(){if(null!=this.callbackToCall){var a=Math.min(this.origin[0],this.location[0]),b=Math.max(this.origin[0],this.location[0]),c=Math.min(this.origin[1],this.location[1]),d=Math.max(this.origin[1],this.location[1]),e={xMin:a,xMax:b,yMin:c,yMax:d};this.callbackToCall(e)}},b}(a.Interaction.DragBox);b.XYDragBox=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype._drag=function(){a.prototype._drag.call(this),this.setBox(this.origin[1],this.location[1])},b.prototype._doDragend=function(){if(null!=this.callbackToCall){var a=Math.min(this.origin[1],this.location[1]),b=Math.max(this.origin[1],this.location[1]),c={yMin:a,yMax:b};this.callbackToCall(c)}},b.prototype.setBox=function(b,c){return a.prototype.setBox.call(this,0,this.componentToListenTo.availableWidth,b,c),this},b}(a.Interaction.DragBox);b.YDragBox=c}(a.Interaction||(a.Interaction={}));a.Interaction}(Plottable||(Plottable={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},Plottable;!function(a){!function(b){var c=function(b){function c(){b.call(this),this.xTable=new a.Component.Table,this.yTable=new a.Component.Table,this.centerComponent=new a.Component.Group,this.xyTable=(new a.Component.Table).addComponent(0,0,this.yTable).addComponent(1,1,this.xTable).addComponent(0,1,this.centerComponent),this.addComponent(1,0,this.xyTable)}return __extends(c,b),c.prototype.yAxis=function(a){if(null!=a){if(null!=this._yAxis)throw new Error("yAxis already assigned!");return this._yAxis=a,this.yTable.addComponent(0,1,this._yAxis),this}return this._yAxis},c.prototype.xAxis=function(a){if(null!=a){if(null!=this._xAxis)throw new Error("xAxis already assigned!");return this._xAxis=a,this.xTable.addComponent(0,0,this._xAxis),this}return this._xAxis},c.prototype.yLabel=function(b){if(null!=b){if(null!=this._yLabel){if("string"==typeof b)return this._yLabel.setText(b),this;throw new Error("yLabel already assigned!")}return"string"==typeof b&&(b=new a.Component.AxisLabel(b,"vertical-left")),this._yLabel=b,this.yTable.addComponent(0,0,this._yLabel),this}return this._yLabel},c.prototype.xLabel=function(b){if(null!=b){if(null!=this._xLabel){if("string"==typeof b)return this._xLabel.setText(b),this;throw new Error("xLabel already assigned!")}return"string"==typeof b&&(b=new a.Component.AxisLabel(b,"horizontal")),this._xLabel=b,this.xTable.addComponent(1,0,this._xLabel),this}return this._xLabel},c.prototype.titleLabel=function(b){if(null!=b){if(null!=this._titleLabel){if("string"==typeof b)return this._titleLabel.setText(b),this;throw new Error("titleLabel already assigned!")}return"string"==typeof b&&(b=new a.Component.TitleLabel(b,"horizontal")),this._titleLabel=b,this.addComponent(0,0,this._titleLabel),this}return this._titleLabel},c.prototype.center=function(a){return this.centerComponent.merge(a),this},c}(a.Component.Table);b.StandardChart=c}(a.Template||(a.Template={}));a.Template}(Plottable||(Plottable={})); \ No newline at end of file diff --git a/plottable.zip b/plottable.zip index 06e5d61bd8..1d6bf227c2 100644 Binary files a/plottable.zip and b/plottable.zip differ