diff --git a/Gruntfile.js b/Gruntfile.js
index daec325425..890b33d132 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -157,8 +157,8 @@ module.exports = function(grunt) {
version: "35"
}, {
browserName: "internet explorer",
- version: "10",
- platform: "WIN8"
+ version: "9",
+ platform: "WIN7"
}];
var configJSON = {
diff --git a/bower.json b/bower.json
index 236ac8b910..88a370c200 100644
--- a/bower.json
+++ b/bower.json
@@ -1,7 +1,7 @@
{
"name": "plottable",
"description": "A library for creating charts out of D3",
- "version": "0.25.0",
+ "version": "0.25.1",
"main": ["plottable.js", "plottable.css"],
"license": "MIT",
"ignore": [
diff --git a/package.json b/package.json
index 58f889a659..14fccbfd21 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "plottable.js",
- "version": "0.25.0",
+ "version": "0.25.1",
"description": "Build flexible, performant, interactive charts using D3",
"repository": {
"type": "git",
diff --git a/plottable.js b/plottable.js
index 12b3e0d431..4c9fe3b8cb 100644
--- a/plottable.js
+++ b/plottable.js
@@ -1,5 +1,5 @@
/*!
-Plottable 0.25.0 (https://github.com/palantir/plottable)
+Plottable 0.25.1 (https://github.com/palantir/plottable)
Copyright 2014 Palantir Technologies
Licensed under MIT (https://github.com/palantir/plottable/blob/master/LICENSE)
*/
@@ -1364,7 +1364,7 @@ var Plottable;
///
var Plottable;
(function (Plottable) {
- Plottable.version = "0.25.0";
+ Plottable.version = "0.25.1";
})(Plottable || (Plottable = {}));
///
@@ -1926,7 +1926,10 @@ var Plottable;
Component.prototype.generateClipPath = function () {
// The clip path will prevent content from overflowing its component space.
- this.element.attr("clip-path", "url(#clipPath" + this._plottableID + ")");
+ // HACKHACK: IE <=9 does not respect the HTML base element in SVG.
+ // They don't need the current URL in the clip path reference.
+ var prefix = /MSIE [5-9]/.test(navigator.userAgent) ? "" : document.location.href;
+ this.element.attr("clip-path", "url(" + prefix + "#clipPath" + this._plottableID + ")");
var clipPathParent = this.boxContainer.append("clipPath").attr("id", "clipPath" + this._plottableID);
this.addBox("clip-rect", clipPathParent);
};
diff --git a/plottable.min.js b/plottable.min.js
index 51a173e545..5d8468163b 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){null!=window.console&&(null!=window.console.warn?console.warn(a):null!=window.console.log&&console.log(a))}function d(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 e(a,b){var c=d3.set();return a.forEach(function(a){b.has(a)&&c.add(a)}),c}function f(a){return"function"==typeof a?a:"string"==typeof a&&"#"!==a[0]?function(b){return b[a]}:function(){return a}}function g(a,b){var c=d3.set();return a.forEach(function(a){return c.add(a)}),b.forEach(function(a){return c.add(a)}),c}function h(a,b){var c=f(a);return function(a,d){return c(a,d,b.dataSource().metadata())}}function i(a){var b={};return a.forEach(function(a){return b[a]=!0}),d3.keys(b)}function j(a){var b=d3.set(),c=[];return a.forEach(function(a){b.has(a)||(b.add(a),c.push(a))}),c}function k(a,b){for(var c=[],d=0;b>d;d++)c[d]="function"==typeof a?a(d):a;return c}function l(a){return Array.prototype.concat.apply([],a)}function m(a,b){if(null==a||null==b)return a===b;if(a.length!==b.length)return!1;for(var c=0;cd;){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 i(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.DOM.getBBox(k),m=l.height,n=l.width;if(n>d||m>e)return a.Methods.warn("Insufficient space to fit text: "+b),k.text(""),{width:0,height:0};var o={left:"start",center:"middle",right:"end"},p=o[f],q=d*h[f],r=e*i[g],s=.85-i[g];return k.attr("text-anchor",p).attr("y",s+"em"),a.DOM.translate(j,q,r),{width:n,height:m}}function j(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 h="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=h?j:k,m=b.append("g"),n=i(a,m,d,c,l[f],l[e]),o=d3.transform("");return o.rotate="right"===g?90:-90,o.translate=[h?c:0,h?0:d],m.attr("transform",o.toString()),n}function k(d,e,f,g,h,j){"undefined"==typeof h&&(h="left"),"undefined"==typeof j&&(j="top");var k=c(e.append("text"))(b.HEIGHT_TEXT).height,l=0,m=e.append("g");d.forEach(function(b,c){var d=m.append("g");a.DOM.translate(d,0,c*k);var e=i(b,d,f,k,h,j);e.width>l&&(l=e.width)});var n=k*d.length,o=g-n,p={center:.5,top:0,bottom:1};return a.DOM.translate(m,0,o*p[j]),{width:l,height:n}}function l(d,e,f,g,h,i,k){"undefined"==typeof h&&(h="left"),"undefined"==typeof i&&(i="top"),"undefined"==typeof k&&(k="left");var l=c(e.append("text"))(b.HEIGHT_TEXT).height,m=0,n=e.append("g");d.forEach(function(b,c){var d=n.append("g");a.DOM.translate(d,c*l,0);var e=j(b,d,l,g,h,i,k);e.height>m&&(m=e.height)});var o=l*d.length,p=f-o,q={center:.5,left:0,right:1};return a.DOM.translate(n,p*q[h],0),{width:o,height:m}}function m(b,c,d,e,f,g){var h=null!=f?f:1.1*c>d,i=h?c:d,j=h?d:c,m=a.WordWrap.breakTextToFitRect(b,i,j,e);if(0===m.lines.length)return{textFits:m.textFits,usedWidth:0,usedHeight:0};var n,o;if(null==g){var p=h?d3.max:d3.sum,q=h?d3.sum:d3.max;n=p(m.lines,function(a){return e(a).width}),o=q(m.lines,function(a){return e(a).height})}else{var r=g.g.append("g").classed("writeText-inner-g",!0),s=h?k:l,t=s(m.lines,r,c,d,g.xAlign,g.yAlign);n=t.width,o=t.height}return{textFits:m.textFits,usedWidth:n,usedHeight:o}}b.HEIGHT_TEXT="bqpdl",b.getTextMeasurer=c;var n="a",o=function(){function b(b){var g=this;this.cache=new a.Cache(c(b),n,a.Methods.objEq),this.measure=d(e(f(function(a){return g.cache.get(a)})))}return b.prototype.clear=function(){return this.cache.clear(),this},b}();b.CachingCharacterMeasurer=o,b.getTruncatedText=g,b._addEllipsesToLine=h,b.writeLineHorizontally=i,b.writeLineVertically=j,b.writeText=m}(a.Text||(a.Text={}));a.Text}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(b){function c(b,c,e,f){var g=function(a){return f(a).width},h=d(b,c,g),i=f("hello world").height,j=Math.floor(e/i),k=j>=h.length;return k||(h=h.splice(0,j),j>0&&(h[j-1]=a.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.canWrapWithoutBreakingWords=e}(a.WordWrap||(a.WordWrap={}));a.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),d=parseFloat(c);return d!==d?0:d}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)}function j(a,b){return a.rightb.right?!1:a.bottomb.bottom?!1:!0}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.boxesOverlap=j}(a.DOM||(a.DOM={}));a.DOM}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){a.MILLISECONDS_IN_ONE_DAY=864e5;var b=function(){function b(){}return b.currency=function(a,c,d,e){"undefined"==typeof a&&(a=2),"undefined"==typeof c&&(c="$"),"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=!0);var f=b.fixed(a);return function(a){var g=f(Math.abs(a));return e&&b._valueChanged(Math.abs(a),g)?"":(""!==g&&(d?g=c+g:g+=c,0>a&&(g="-"+g)),g)}},b.fixed=function(a,c){return"undefined"==typeof a&&(a=3),"undefined"==typeof c&&(c=!0),b.verifyPrecision(a),function(d){var e=d.toFixed(a);return c&&b._valueChanged(d,e)?"":e}},b.general=function(a,c){return"undefined"==typeof a&&(a=3),"undefined"==typeof c&&(c=!0),b.verifyPrecision(a),function(d){if("number"==typeof d){var e=Math.pow(10,a),f=String(Math.round(d*e)/e);return c&&b._valueChanged(d,f)?"":f}return String(d)}},b.identity=function(){return function(a){return String(a)}},b.percentage=function(a,c){"undefined"==typeof a&&(a=0),"undefined"==typeof c&&(c=!0);var d=b.fixed(a);return function(a){var e=100*a,f=a.toString(),g=Math.pow(10,f.length-(f.indexOf(".")+1));e=parseInt((e*g).toString(),10)/g;var h=d(e);return c&&b._valueChanged(e,h)?"":(""!==h&&(h+="%"),h)}},b.siSuffix=function(a){return"undefined"==typeof a&&(a=3),b.verifyPrecision(a),function(b){return d3.format("."+a+"s")(b)}},b.time=function(){var a=8,b={};return b[0]={format:".%L",filter:function(a){return 0!==a.getMilliseconds()}},b[1]={format:":%S",filter:function(a){return 0!==a.getSeconds()}},b[2]={format:"%I:%M",filter:function(a){return 0!==a.getMinutes()}},b[3]={format:"%I %p",filter:function(a){return 0!==a.getHours()}},b[4]={format:"%a %d",filter:function(a){return 0!==a.getDay()&&1!==a.getDate()}},b[5]={format:"%b %d",filter:function(a){return 1!==a.getDate()}},b[6]={format:"%b",filter:function(a){return 0!==a.getMonth()}},b[7]={format:"%Y",filter:function(){return!0}},function(c){for(var d=0;a>d;d++)if(b[d].filter(c))return d3.time.format(b[d].format)(c)}},b.relativeDate=function(b,c,d){return"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=a.MILLISECONDS_IN_ONE_DAY),"undefined"==typeof d&&(d=""),function(a){var e=Math.round((a.valueOf()-b)/c);return e.toString()+d}},b.verifyPrecision=function(a){if(0>a||a>20)throw new RangeError("Formatter precision must be between 0 and 20")},b._valueChanged=function(a,b){return a!==parseFloat(b)},b}();a.Formatters=b}(Plottable||(Plottable={}));var Plottable;!function(a){a.version="0.25.0"}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){}return a.CORAL_RED="#fd373e",a.INDIGO="#5177c4",a.ROBINS_EGG_BLUE="#06bdbd",a.FERN="#62bb60",a.BURNING_ORANGE="#ff7939",a.ROYAL_HEATH="#962565",a.CONIFER="#99ce50",a.CERISE_RED="#db2e65",a.BRIGHT_SUN="#ffe43d",a.JACARTA="#2c2b6f",a.PLOTTABLE_COLORS=[a.CORAL_RED,a.INDIGO,a.ROBINS_EGG_BLUE,a.FERN,a.BURNING_ORANGE,a.ROYAL_HEATH,a.CONIFER,a.CERISE_RED,a.BRIGHT_SUN,a.JACARTA],a}();a.Colors=b}(a.Core||(a.Core={}));a.Core}(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.key2callback=new a.Util.StrictEqualityAssociativeArray,this.listenable=c}return __extends(c,b),c.prototype.registerListener=function(a,b){return this.key2callback.set(a,b),this},c.prototype.broadcast=function(){for(var a=this,b=[],c=0;c=0&&(this._components.splice(b,1),this._invalidateLayout())},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.detachAll=function(){return this._components.slice().forEach(function(a){return a.detach()}),this},b.prototype.remove=function(){a.prototype.remove.call(this),this._components.slice().forEach(function(a){return a.remove()})},b}(a.Component);a.ComponentContainer=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){"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();return{width:d?0:d3.max(c,function(a){return a.width}),height:d?0:d3.max(c,function(a){return a.height}),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;j=null!=a?a._requestedSpace(b[i],c[h]):{width:0,height:0,wantsWidth:!1,wantsHeight:!1};var k=Math.min(j.width,b[i]),l=Math.min(j.height,c[h]);d[i]=Math.max(d[i],k),e[h]=Math.max(e[h],l),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;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})},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.autoDomainAutomatically=!0,this._setDomain(this._getExtent()),this},c.prototype._autoDomainIfAutomaticMode=function(){this.autoDomainAutomatically&&this.autoDomain()},c.prototype.scale=function(a){return this._d3Scale(a)
-},c.prototype.domain=function(a){return null==a?this._getDomain():(this.autoDomainAutomatically=!1,this._setDomain(a),this)},c.prototype._getDomain=function(){return this._d3Scale.domain()},c.prototype._setDomain=function(a){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._autoDomainIfAutomaticMode(),this},c.prototype.removeExtent=function(a,b){return delete this._rendererAttrID2Extent[a+b],this._autoDomainIfAutomaticMode(),this},c}(b.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.animateOnNextRender=!0,this.clipPathEnabled=!0,this.classed("plot",!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){b.prototype._anchor.call(this,a),this.animateOnNextRender=!0,this._dataChanged=!0,this._updateAllProjectors()},c.prototype.remove=function(){var a=this;b.prototype.remove.call(this),this._dataSource.broadcaster.deregisterListener(this);var c=Object.keys(this._projectors);c.forEach(function(b){var c=a._projectors[b];null!=c.scale&&c.scale.broadcaster.deregisterListener(a)})},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._dataSource=a,this._dataSource.broadcaster.registerListener(this,function(){return b._onDataSourceUpdate()}),this._onDataSourceUpdate(),this},c.prototype._onDataSourceUpdate=function(){this._updateAllProjectors(),this.animateOnNextRender=!0,this._dataChanged=!0,this._render()},c.prototype.project=function(b,c,d){var e=this;b=b.toLowerCase();var f=this._projectors[b],g=null!=f?f.scale:null;null!=g&&(g.removeExtent(this._plottableID.toString(),b),g.broadcaster.deregisterListener(this)),null!=d&&d.broadcaster.registerListener(this,function(){return e._render()});var h=a.Util.Methods._applyAccessor(c,this);return this._projectors[b]={accessor:h,scale:d,attribute:b},this._updateProjector(b),this._render(),this},c.prototype._generateAttrToProjector=function(){var a=this,b={};return d3.keys(this._projectors).forEach(function(c){var d=a._projectors[c],e=d.accessor,f=d.scale,g=null==f?e:function(a,b){return f.scale(e(a,b))};b[c]=g}),b},c.prototype._doRender=function(){this._isAnchored&&(this._paint(),this._dataChanged=!1,this.animateOnNextRender=!1)},c.prototype._paint=function(){},c.prototype._setup=function(){b.prototype._setup.call(this),this.renderArea=this.content.append("g").classed("render-area",!0)},c.prototype.animate=function(a){return this._animate=a,this},c.prototype.detach=function(){return b.prototype.detach.call(this),this._updateAllProjectors(),this},c.prototype._updateAllProjectors=function(){var a=this;d3.keys(this._projectors).forEach(function(b){return a._updateProjector(b)})},c.prototype._updateProjector=function(a){var b=this._projectors[a];if(null!=b.scale){var c=this.dataSource()._getExtent(b.accessor);0!==c.length&&this._isAnchored?b.scale.updateExtent(this._plottableID.toString(),a,c):b.scale.removeExtent(this._plottableID.toString(),a)}},c.prototype._applyAnimatedAttributes=function(a,b,c){return this._animate&&this.animateOnNextRender&&null!=this._animators[b]?this._animators[b].animate(a,c,this):a.attr(c)},c.prototype.animator=function(a,b){return void 0===b?this._animators[a]:(this._animators[a]=b,this)},c}(b.Component);b.Plot=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(a){var b=function(b){function c(a,c,d){if(b.call(this,a),null==c||null==d)throw new Error("XYPlots require an xScale and yScale");this.classed("xy-plot",!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){b.prototype._computeLayout.call(this,a,c,d,e),this.xScale.range([0,this.availableWidth]),this.yScale.range([this.availableHeight,0])},c.prototype._updateXDomainer=function(){if(this.xScale instanceof a.QuantitativeScale){var b=this.xScale;b._userSetDomainer||b.domainer().pad().nice()}},c.prototype._updateYDomainer=function(){if(this.yScale instanceof a.QuantitativeScale){var b=this.yScale;b._userSetDomainer||b.domainer().pad().nice()}},c}(a.Plot);a.XYPlot=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,d){b.call(this,new a.DataSource,c,d),this.nextSeriesIndex=0,this._key2DatasetDrawerKey={},this._datasetKeysInOrder=[]}return __extends(c,b),c.prototype._setup=function(){var a=this;b.prototype._setup.call(this),this._getDrawersInOrder().forEach(function(b){return b.renderArea=a.renderArea.append("g")})},c.prototype.remove=function(){var a=this;b.prototype.remove.call(this),this._datasetKeysInOrder.forEach(function(b){return a.removeDataset(b)})},c.prototype.addDataset=function(b,c){if("string"!=typeof b&&void 0!==c)throw new Error("invalid input to addDataset");"string"==typeof b&&"_"===b[0]&&a.Util.Methods.warn("Warning: Using _named series keys may produce collisions with unlabeled data sources");var d="string"==typeof b?b:"_"+this.nextSeriesIndex++,e="string"!=typeof b?b:c,c=e instanceof a.DataSource?e:new a.DataSource(e);return this._addDataset(d,c),this},c.prototype._addDataset=function(a,b){var c=this;null!=this._key2DatasetDrawerKey[a]&&this.removeDataset(a);var d=this._getDrawer(a),e={drawer:d,dataset:b,key:a};this._datasetKeysInOrder.push(a),this._key2DatasetDrawerKey[a]=e,this._isSetup&&(d.renderArea=this.renderArea.append("g")),b.broadcaster.registerListener(this,function(){return c._onDataSourceUpdate()}),this._onDataSourceUpdate()},c.prototype._getDrawer=function(){throw new Error("Abstract Method Not Implemented")},c.prototype._updateProjector=function(a){var b=this,c=this._projectors[a];null!=c.scale&&d3.values(this._key2DatasetDrawerKey).forEach(function(d){var e=d.dataset._getExtent(c.accessor),f=b._plottableID.toString()+"_"+d.key;0!==e.length&&b._isAnchored?c.scale.updateExtent(f,a,e):c.scale.removeExtent(f,a)})},c.prototype.datasetOrder=function(b){function c(b,c){var d=a.Util.Methods.intersection(d3.set(b),d3.set(c)),e=d.size();return e===b.length&&e===c.length}return void 0===b?this._datasetKeysInOrder:(c(b,this._datasetKeysInOrder)?(this._datasetKeysInOrder=b,this._onDataSourceUpdate()):a.Util.Methods.warn("Attempted to change datasetOrder, but new order is not permutation of old. Ignoring."),this)},c.prototype.removeDataset=function(a){if(null!=this._key2DatasetDrawerKey[a]){var b=this._key2DatasetDrawerKey[a];b.drawer.remove();var c=d3.values(this._projectors),d=this._plottableID.toString()+"_"+a;c.forEach(function(a){null!=a.scale&&a.scale.removeExtent(d,a.attribute)}),b.dataset.broadcaster.deregisterListener(this),this._datasetKeysInOrder.splice(this._datasetKeysInOrder.indexOf(a),1),delete this._key2DatasetDrawerKey[a],this._onDataSourceUpdate()}return this},c.prototype._getDatasetsInOrder=function(){var a=this;return this._datasetKeysInOrder.map(function(b){return a._key2DatasetDrawerKey[b].dataset})},c.prototype._getDrawersInOrder=function(){var a=this;return this._datasetKeysInOrder.map(function(b){return a._key2DatasetDrawerKey[b].drawer})},c}(b.XYPlot);b.NewStylePlot=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){!function(c){var d=function(){function a(){}return a.prototype.render=function(){b.flush()},a}();c.Immediate=d;var e=function(){function c(){}return c.prototype.render=function(){a.Util.DOM.requestAnimationFramePolyfill(b.flush)},c}();c.AnimationFrame=e;var f=function(){function c(){this._timeoutMsec=a.Util.DOM.POLYFILL_TIMEOUT_MSEC}return c.prototype.render=function(){setTimeout(b.flush,this._timeoutMsec)},c}();c.Timeout=f}(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(c){function d(a){c._renderPolicy=a}function e(b){l&&a.Util.Methods.warn("Registered to render while other components are flushing: request may be ignored"),i[b._plottableID]=b,g()}function f(a){j[a._plottableID]=a,i[a._plottableID]=a,g()}function g(){k||(k=!0,c._renderPolicy.render())}function h(){if(k){var a=d3.values(j);a.forEach(function(a){return a._computeLayout()});var c=d3.values(i);c.forEach(function(a){return a._render()}),l=!0;var d={};Object.keys(i).forEach(function(a){try{i[a]._doRender()}catch(b){setTimeout(function(){throw b},0),d[a]=i[a]}}),j={},i=d,k=!1,l=!1}b.ResizeBroadcaster.clearResizing()}var i={},j={},k=!1,l=!1;c._renderPolicy=new c.RenderPolicy.AnimationFrame,c.setRenderPolicy=d,c.registerToRender=e,c.registerToComputeLayout=f,c.flush=h}(b.RenderController||(b.RenderController={}));b.RenderController}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(b){function c(){void 0===i&&(i=new a.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}(a.ResizeBroadcaster||(a.ResizeBroadcaster={}));a.ResizeBroadcaster}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(){}(Plottable||(Plottable={}));var Plottable;!function(a){var b=function(){function a(a){this.doNice=!1,this.padProportion=0,this.paddingExceptions=d3.map(),this.unregisteredPaddingExceptions=d3.set(),this.includedValues=d3.map(),this.unregisteredIncludedValues=d3.map(),this.combineExtents=a}return a.prototype.computeDomain=function(a,b){var c;return c=null!=this.combineExtents?this.combineExtents(a):0===a.length?b._defaultExtent():[d3.min(a,function(a){return a[0]}),d3.max(a,function(a){return a[1]})],c=this.includeDomain(c),c=this.padDomain(b,c),c=this.niceDomain(b,c)},a.prototype.pad=function(a){return"undefined"==typeof a&&(a=.05),this.padProportion=a,this},a.prototype.addPaddingException=function(a,b){return null!=b?this.paddingExceptions.set(b,a):this.unregisteredPaddingExceptions.add(a),this},a.prototype.removePaddingException=function(a){return"string"==typeof a?this.paddingExceptions.remove(a):this.unregisteredPaddingExceptions.remove(a),this},a.prototype.addIncludedValue=function(a,b){return null!=b?this.includedValues.set(b,a):this.unregisteredIncludedValues.set(a,a),this},a.prototype.removeIncludedValue=function(a){return"string"==typeof a?this.includedValues.remove(a):this.unregisteredIncludedValues.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,c){var d=c[0],e=c[1];if(d===e&&this.padProportion>0){var f=d.valueOf();return d instanceof Date?[f-a.ONE_DAY,f+a.ONE_DAY]:[f-a.PADDING_FOR_IDENTICAL_DOMAIN,f+a.PADDING_FOR_IDENTICAL_DOMAIN]}if(b.domain()[0]===b.domain()[1])return c;var g=this.padProportion/2,h=b.invert(b.scale(d)-(b.scale(e)-b.scale(d))*g),i=b.invert(b.scale(e)+(b.scale(e)-b.scale(d))*g),j=this.paddingExceptions.values().concat(this.unregisteredPaddingExceptions.values()),k=d3.set(j);return k.has(d)&&(h=d),k.has(e)&&(i=e),[h,i]},a.prototype.niceDomain=function(a,b){return this.doNice?a._niceDomain(b,this.niceCount):b},a.prototype.includeDomain=function(a){var b=this.includedValues.values().concat(this.unregisteredIncludedValues.values());return b.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._getExtent=function(){return this._domainer.computeDomain(this._getAllExtents(),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._setDomain=function(c){var d=function(a){return a!==a||1/0===a||a===-1/0};return d(c[0])||d(c[1])?void a.Util.Methods.warn("Warning: QuantitativeScales cannot take NaN or Infinity as a domain value. Ignoring."):void b.prototype._setDomain.call(this,c)},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._autoDomainIfAutomaticMode(),this)},c.prototype._defaultExtent=function(){return[0,1]},c}(b.Scale);b.QuantitativeScale=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.QuantitativeScale);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(b){function c(d){b.call(this,null==d?d3.scale.log():d),c.warned||(c.warned=!0,a.Util.Methods.warn("Plottable.Scale.Log is deprecated. If possible, use Plottable.Scale.ModifiedLog instead."))}return __extends(c,b),c.prototype.copy=function(){return new c(this._d3Scale.copy())},c.prototype._defaultExtent=function(){return[1,10]},c.warned=!1,c}(a.Abstract.QuantitativeScale);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("undefined"==typeof a&&(a=10),b.call(this,d3.scale.linear()),this._showIntermediateTicks=!1,this.base=a,this.pivot=this.base,this.untransformedDomain=this._defaultExtent(),this._lastRequestedTickCount=10,1>=a)throw new Error("ModifiedLogScale: The base must be > 1")}return __extends(c,b),c.prototype.adjustedLog=function(a){var b=0>a?-1:1;return a*=b,aa?-1:1;return a*=b,a=Math.pow(this.base,a),a=d&&e>=a}),m=j.concat(l).concat(k);return m.length<=1&&(m=d3.scale.linear().domain([d,e]).ticks(this._lastRequestedTickCount)),m},c.prototype.logTicks=function(b,c){var d=this,e=this.howManyTicks(b,c);if(0===e)return[];var f=Math.floor(Math.log(b)/Math.log(this.base)),g=Math.ceil(Math.log(c)/Math.log(this.base)),h=d3.range(g,f,-Math.ceil((g-f)/e)),i=this._showIntermediateTicks?Math.floor(e/h.length):1,j=d3.range(this.base,1,-(this.base-1)/i).map(Math.floor),k=a.Util.Methods.uniqNumbers(j),l=h.map(function(a){return k.map(function(b){return Math.pow(d.base,a-1)*b})}),m=a.Util.Methods.flatten(l),n=m.filter(function(a){return a>=b&&c>=a}),o=n.sort(function(a,b){return a-b});return o},c.prototype.howManyTicks=function(a,b){var c=this.adjustedLog(d3.min(this.untransformedDomain)),d=this.adjustedLog(d3.max(this.untransformedDomain)),e=this.adjustedLog(a),f=this.adjustedLog(b),g=(f-e)/(d-c),h=Math.ceil(g*this._lastRequestedTickCount);return h},c.prototype.copy=function(){return new c(this.base)},c.prototype._niceDomain=function(a){return a},c.prototype.showIntermediateTicks=function(a){return null==a?this._showIntermediateTicks:void(this._showIntermediateTicks=a)},c}(a.Abstract.QuantitativeScale);b.ModifiedLog=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.prototype.copy=function(){return new c(this._d3Scale.copy())},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(c){var d;switch(c){case null:case void 0:d=d3.scale.ordinal().range(a.Core.Colors.PLOTTABLE_COLORS);break;case"Category10":case"category10":case"10":d=d3.scale.category10();break;case"Category20":case"category20":case"20":d=d3.scale.category20();break;case"Category20b":case"category20b":case"20b":d=d3.scale.category20b();break;case"Category20c":case"category20c":case"20c":d=d3.scale.category20c();break;default:throw new Error("Unsupported ColorScale type")}b.call(this,d)}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(b){function c(a){b.call(this,null==a?d3.time.scale():a)}return __extends(c,b),c.prototype.tickInterval=function(a,b){var c=d3.time.scale();return c.domain(this.domain()),c.range(this.range()),c.ticks(a.range,b)},c.prototype.domain=function(a){return null==a?b.prototype.domain.call(this):("string"==typeof a[0]&&(a=a.map(function(a){return new Date(a)})),b.prototype.domain.call(this,a))},c.prototype.copy=function(){return new c(this._d3Scale.copy())},c.prototype._defaultExtent=function(){var b=(new Date).valueOf(),c=b-a.MILLISECONDS_IN_ONE_DAY;return[c,b]},c}(a.Abstract.QuantitativeScale);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 Quantitative 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),this._resetScale(),this)},b.prototype.scaleType=function(a){return null==a?this._scaleType:(this._scaleType=a,this._resetScale(),this)},b.prototype._resetScale=function(){this._d3Scale=b.getD3InterpolatedScale(this._colorRange,this._scaleType),this._autoDomainIfAutomaticMode(),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.prototype.autoDomain=function(){var a=this._getAllExtents();return a.length>0&&this._setDomain([d3.min(a,function(a){return a[0]}),d3.max(a,function(a){return a[1]})]),this},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.QuantitativeScale);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;if(this.rescaleInProgress=!1,null==a)throw new Error("ScaleDomainCoordinator requires scales to coordinate");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 Plottable;!function(a){!function(a){var b=function(){function a(a){this.key=a}return a.prototype.remove=function(){null!=this.renderArea&&this.renderArea.remove()},a.prototype.draw=function(){throw new Error("Abstract Method Not Implemented")},a}();a._Drawer=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.apply(this,arguments)}return __extends(b,a),b.prototype.draw=function(a,b){var c="rect",d=this.renderArea.selectAll(c).data(a);d.enter().append(c),d.attr(b),d.exit().remove()},b}(a.Abstract._Drawer);b.Rect=c}(a._Drawer||(a._Drawer={}));a._Drawer}(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(c){function d(b,d,e){"undefined"==typeof e&&(e=a.Formatters.identity());var f=this;if(c.call(this),this._width="auto",this._height="auto",this._endTickLength=5,this._tickLength=5,this._tickLabelPadding=10,this._gutter=15,this._showEndTickLabels=!1,null==b||null==d)throw new Error("Axis requires a scale and orientation");this._scale=b,this.orient(d),this.classed("axis",!0),this._isHorizontal()?this.classed("x-axis",!0):this.classed("y-axis",!0),this.formatter(e),this._scale.broadcaster.registerListener(this,function(){return f._render()})}return __extends(d,c),d.prototype.remove=function(){c.prototype.remove.call(this),this._scale.broadcaster.deregisterListener(this)},d.prototype._isHorizontal=function(){return"top"===this._orientation||"bottom"===this._orientation},d.prototype._computeWidth=function(){return this._computedWidth=this._maxLabelTickLength(),this._computedWidth},d.prototype._computeHeight=function(){return this._computedHeight=this._maxLabelTickLength(),this._computedHeight},d.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+this._gutter),c=0):("auto"===this._width&&(null==this._computedWidth&&this._computeWidth(),c=this._computedWidth+this._gutter),d=0),{width:c,height:d,wantsWidth:!this._isHorizontal()&&c>a,wantsHeight:this._isHorizontal()&&d>b}},d.prototype._isFixedHeight=function(){return this._isHorizontal()},d.prototype._isFixedWidth=function(){return!this._isHorizontal()},d.prototype._computeLayout=function(a,b,d,e){c.prototype._computeLayout.call(this,a,b,d,e),this._scale.range(this._isHorizontal()?[0,this.availableWidth]:[this.availableHeight,0])},d.prototype._setup=function(){c.prototype._setup.call(this),this._tickMarkContainer=this.content.append("g").classed(d.TICK_MARK_CLASS+"-container",!0),this._tickLabelContainer=this.content.append("g").classed(d.TICK_LABEL_CLASS+"-container",!0),this._baseline=this.content.append("line").classed("baseline",!0)},d.prototype._getTickValues=function(){return[]},d.prototype._doRender=function(){var a=this._getTickValues(),b=this._tickMarkContainer.selectAll("."+d.TICK_MARK_CLASS).data(a);b.enter().append("line").classed(d.TICK_MARK_CLASS,!0),b.attr(this._generateTickMarkAttrHash()),d3.select(b[0][0]).classed(d.END_TICK_MARK_CLASS,!0).attr(this._generateTickMarkAttrHash(!0)),d3.select(b[0][a.length-1]).classed(d.END_TICK_MARK_CLASS,!0).attr(this._generateTickMarkAttrHash(!0)),b.exit().remove(),this._baseline.attr(this._generateBaselineAttrHash())},d.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},d.prototype._generateTickMarkAttrHash=function(a){var b=this;"undefined"==typeof a&&(a=!1);var c={x1:0,y1:0,x2:0,y2:0},d=function(a){return b._scale.scale(a)};this._isHorizontal()?(c.x1=d,c.x2=d):(c.y1=d,c.y2=d);var e=a?this._endTickLength:this._tickLength;switch(this._orientation){case"bottom":c.y2=e;break;case"top":c.y1=this.availableHeight,c.y2=this.availableHeight-e;break;case"left":c.x1=this.availableWidth,c.x2=this.availableWidth-e;break;case"right":c.x2=e}return c},d.prototype._invalidateLayout=function(){this._computedWidth=null,this._computedHeight=null,c.prototype._invalidateLayout.call(this)},d.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},d.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},d.prototype.formatter=function(a){return void 0===a?this._formatter:(this._formatter=a,this._invalidateLayout(),this)},d.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},d.prototype.endTickLength=function(a){if(null==a)return this._endTickLength;if(0>a)throw new Error("end tick length must be positive");return this._endTickLength=a,this._invalidateLayout(),this},d.prototype._maxLabelTickLength=function(){return this.showEndTickLabels()?Math.max(this.tickLength(),this.endTickLength()):this.tickLength()},d.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},d.prototype.gutter=function(a){if(null==a)return this._gutter;if(0>a)throw new Error("gutter size must be positive");return this._gutter=a,this._invalidateLayout(),this},d.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},d.prototype.showEndTickLabels=function(a){return null==a?this._showEndTickLabels:(this._showEndTickLabels=a,this._render(),this)
-},d.prototype._hideEndTickLabels=function(){var a=this,c=this.element.select(".bounding-box")[0][0].getBoundingClientRect(),d=function(b){return Math.floor(c.left)<=Math.ceil(b.left)&&Math.floor(c.top)<=Math.ceil(b.top)&&Math.floor(b.right)<=Math.ceil(c.left+a.availableWidth)&&Math.floor(b.bottom)<=Math.ceil(c.top+a.availableHeight)},e=this._tickLabelContainer.selectAll("."+b.Axis.TICK_LABEL_CLASS);if(0!==e[0].length){var 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")}},d.prototype._hideOverlappingTickLabels=function(){var c,d=this._tickLabelContainer.selectAll("."+b.Axis.TICK_LABEL_CLASS).filter(function(){return"visible"===d3.select(this).style("visibility")});d.each(function(){var b=this.getBoundingClientRect(),d=d3.select(this);null!=c&&a.Util.DOM.boxesOverlap(b,c)?d.style("visibility","hidden"):(c=b,d.style("visibility","visible"))})},d.END_TICK_MARK_CLASS="end-tick-mark",d.TICK_MARK_CLASS="tick-mark",d.TICK_LABEL_CLASS="tick-label",d}(b.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){if(c=c.toLowerCase(),"top"!==c&&"bottom"!==c)throw new Error("unsupported orientation: "+c);b.call(this,a,c),this.classed("time-axis",!0),this.tickLabelPadding(5)}return __extends(c,b),c.prototype._computeHeight=function(){if(null!==this._computedHeight)return this._computedHeight;var a=this._measureTextHeight(this._majorTickLabels)+this._measureTextHeight(this._minorTickLabels);return this.tickLength(a),this.endTickLength(a),this._computedHeight=this._maxLabelTickLength()+2*this.tickLabelPadding(),this._computedHeight},c.prototype.calculateWorstWidth=function(a,b){var c=new Date(9999,8,29,12,59,9999);return this.measurer(d3.time.format(b)(c)).width},c.prototype.getIntervalLength=function(a){var b=this._scale.domain()[0],c=a.timeUnit.offset(b,a.step);if(c>this._scale.domain()[1])return this.availableWidth;var d=Math.abs(this._scale.scale(c)-this._scale.scale(b));return d},c.prototype.isEnoughSpace=function(a,b){var c=this.calculateWorstWidth(a,b.formatString)+2*this.tickLabelPadding(),d=Math.min(this.getIntervalLength(b),this.availableWidth);return d>c},c.prototype._setup=function(){b.prototype._setup.call(this),this._majorTickLabels=this.content.append("g").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),this._minorTickLabels=this.content.append("g").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),this.measurer=a.Util.Text.getTextMeasurer(this._majorTickLabels.append("text"))},c.prototype.getTickLevel=function(){for(var b=0;b=c.minorIntervals.length&&(a.Util.Methods.warn("zoomed out too far: could not find suitable interval to display labels"),b=c.minorIntervals.length-1),b},c.prototype._getTickIntervalValues=function(a){return this._scale.tickInterval(a.timeUnit,a.step)},c.prototype._getTickValues=function(){var a=this.getTickLevel(),b=this._getTickIntervalValues(c.minorIntervals[a]),d=this._getTickIntervalValues(c.majorIntervals[a]);return b.concat(d)},c.prototype._measureTextHeight=function(b){var c=b.append("g").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),d=this.measurer(a.Util.Text.HEIGHT_TEXT).height;return c.remove(),d},c.prototype.renderTickLabels=function(b,c,d){var e=this;b.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).remove();var f=this._scale.tickInterval(c.timeUnit,c.step);f.splice(0,0,this._scale.domain()[0]),f.push(this._scale.domain()[1]);var g=1===c.step,h=[];g?f.map(function(a,b){b+1>=f.length||h.push(new Date((f[b+1].valueOf()-f[b].valueOf())/2+f[b].valueOf()))}):h=f,h=h.filter(function(a){return e.canFitLabelFilter(b,a,d3.time.format(c.formatString)(a),g)});var i=b.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).data(h,function(a){return a.valueOf()}),j=i.enter().append("g").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0);j.append("text");var k=g?0:this.tickLabelPadding(),l="bottom"===this._orientation?this._maxLabelTickLength()/2*d:this.availableHeight-this._maxLabelTickLength()/2*d+2*this.tickLabelPadding(),m=i.selectAll("text");m.size()>0&&a.Util.DOM.translate(m,k,l),i.exit().remove(),i.attr("transform",function(a){return"translate("+e._scale.scale(a)+",0)"});var n=g?"middle":"start";i.selectAll("text").text(function(a){return d3.time.format(c.formatString)(a)}).style("text-anchor",n)},c.prototype.canFitLabelFilter=function(a,b,c,d){var e,f,g=this.measurer(c).width+this.tickLabelPadding();return d?(e=this._scale.scale(b)+g/2,f=this._scale.scale(b)-g/2):(e=this._scale.scale(b)+g,f=this._scale.scale(b)),e0},c.prototype.adjustTickLength=function(b,c){var d=this._getTickIntervalValues(c),e=this._tickMarkContainer.selectAll("."+a.Abstract.Axis.TICK_MARK_CLASS).filter(function(a){return d.map(function(a){return a.valueOf()}).indexOf(a.valueOf())>=0});"top"===this._orientation&&(b=this.availableHeight-b),e.attr("y2",b)},c.prototype.generateLabellessTicks=function(b){if(!(0>b)){var d=this._getTickIntervalValues(c.minorIntervals[b]),e=this._getTickValues().concat(d),f=this._tickMarkContainer.selectAll("."+a.Abstract.Axis.TICK_MARK_CLASS).data(e);f.enter().append("line").classed(a.Abstract.Axis.TICK_MARK_CLASS,!0),f.attr(this._generateTickMarkAttrHash()),f.exit().remove(),this.adjustTickLength(this.tickLabelPadding(),c.minorIntervals[b])}},c.prototype._doRender=function(){b.prototype._doRender.call(this);var a=this.getTickLevel();this.renderTickLabels(this._minorTickLabels,c.minorIntervals[a],1),this.renderTickLabels(this._majorTickLabels,c.majorIntervals[a],2);var d=this._scale.domain(),e=this._scale.scale(d[1])-this._scale.scale(d[0]);1.5*this.getIntervalLength(c.minorIntervals[a])>=e&&this.generateLabellessTicks(a-1),this.adjustTickLength(this._maxLabelTickLength()/2,c.minorIntervals[a]),this.adjustTickLength(this._maxLabelTickLength(),c.majorIntervals[a])},c.minorIntervals=[{timeUnit:d3.time.second,step:1,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.second,step:5,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.second,step:10,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.second,step:15,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.second,step:30,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.minute,step:1,formatString:"%I:%M %p"},{timeUnit:d3.time.minute,step:5,formatString:"%I:%M %p"},{timeUnit:d3.time.minute,step:10,formatString:"%I:%M %p"},{timeUnit:d3.time.minute,step:15,formatString:"%I:%M %p"},{timeUnit:d3.time.minute,step:30,formatString:"%I:%M %p"},{timeUnit:d3.time.hour,step:1,formatString:"%I %p"},{timeUnit:d3.time.hour,step:3,formatString:"%I %p"},{timeUnit:d3.time.hour,step:6,formatString:"%I %p"},{timeUnit:d3.time.hour,step:12,formatString:"%I %p"},{timeUnit:d3.time.day,step:1,formatString:"%a %e"},{timeUnit:d3.time.day,step:1,formatString:"%e"},{timeUnit:d3.time.month,step:1,formatString:"%B"},{timeUnit:d3.time.month,step:1,formatString:"%b"},{timeUnit:d3.time.month,step:3,formatString:"%B"},{timeUnit:d3.time.month,step:6,formatString:"%B"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1,formatString:"%y"},{timeUnit:d3.time.year,step:5,formatString:"%Y"},{timeUnit:d3.time.year,step:25,formatString:"%Y"},{timeUnit:d3.time.year,step:50,formatString:"%Y"},{timeUnit:d3.time.year,step:100,formatString:"%Y"},{timeUnit:d3.time.year,step:200,formatString:"%Y"},{timeUnit:d3.time.year,step:500,formatString:"%Y"},{timeUnit:d3.time.year,step:1e3,formatString:"%Y"}],c.majorIntervals=[{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.month,step:1,formatString:"%B %Y"},{timeUnit:d3.time.month,step:1,formatString:"%B %Y"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""}],c}(a.Abstract.Axis);b.Time=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(c,d,e){"undefined"==typeof e&&(e=a.Formatters.general(3,!1)),b.call(this,c,d,e),this.tickLabelPositioning="center",this.showFirstTickLabel=!1,this.showLastTickLabel=!1}return __extends(c,b),c.prototype._setup=function(){b.prototype._setup.call(this),this.measurer=a.Util.Text.getTextMeasurer(this._tickLabelContainer.append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0))},c.prototype._computeWidth=function(){var a=this,b=this._getTickValues(),c=b.map(function(b){var c=a._formatter(b);return a.measurer(c).width}),d=d3.max(c);return this._computedWidth="center"===this.tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+d:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+d),this._computedWidth},c.prototype._computeHeight=function(){var b=this.measurer(a.Util.Text.HEIGHT_TEXT).height;return this._computedHeight="center"===this.tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+b:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+b),this._computedHeight},c.prototype._getTickValues=function(){return this._scale.ticks()},c.prototype._doRender=function(){b.prototype._doRender.call(this);var c={x:0,y:0,dx:"0em",dy:"0.3em"},d=this._maxLabelTickLength(),e=this.tickLabelPadding(),f="middle",g=0,h=0,i=0,j=0;if(this._isHorizontal())switch(this.tickLabelPositioning){case"left":f="end",g=-e,j=e;break;case"center":j=d+e;break;case"right":f="start",g=e,j=e}else switch(this.tickLabelPositioning){case"top":c.dy="-0.3em",i=e,h=-e;break;case"center":i=d+e;break;case"bottom":c.dy="1em",i=e,h=e}var k=this._generateTickMarkAttrHash();switch(this._orientation){case"bottom":c.x=k.x1,c.dy="0.95em",h=k.y1+j;break;case"top":c.x=k.x1,c.dy="-.25em",h=k.y1-j;break;case"left":f="end",g=k.x1-i,c.y=k.y1;break;case"right":f="start",g=k.x1+i,c.y=k.y1}var l=this._getTickValues(),m=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).data(l);m.enter().append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),m.exit().remove(),m.style("text-anchor",f).style("visibility","visible").attr(c).text(this._formatter);var n="translate("+g+", "+h+")";this._tickLabelContainer.attr("transform",n),this.showEndTickLabels()||this._hideEndTickLabels(),this._hideOverlappingTickLabels()},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.showEndTickLabel=function(a,b){if(this._isHorizontal()&&"left"===a||!this._isHorizontal()&&"bottom"===a)return void 0===b?this.showFirstTickLabel:(this.showFirstTickLabel=b,this._render(),this);if(this._isHorizontal()&&"right"===a||!this._isHorizontal()&&"top"===a)return void 0===b?this.showLastTickLabel:(this.showLastTickLabel=b,this._render(),this);throw new Error("Attempt to show "+a+" tick label on a "+(this._isHorizontal()?"horizontal":"vertical")+" axis")},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(c,d,e){"undefined"==typeof d&&(d="bottom"),"undefined"==typeof e&&(e=a.Formatters.identity());var f=this;if(b.call(this,c,d,e),this.classed("category-axis",!0),"bands"!==c.rangeType())throw new Error("Only rangeBands category axes are implemented");this._scale.broadcaster.registerListener(this,function(){return f._invalidateLayout()})}return __extends(c,b),c.prototype._setup=function(){b.prototype._setup.call(this),this.measurer=new a.Util.Text.CachingCharacterMeasurer(this._tickLabelContainer.append("text"))},c.prototype._requestedSpace=function(a,b){var c=this._isHorizontal()?0:this._maxLabelTickLength()+this.tickLabelPadding()+this.gutter(),d=this._isHorizontal()?this._maxLabelTickLength()+this.tickLabelPadding()+this.gutter():0;if(0===this._scale.domain().length)return{width:0,height:0,wantsWidth:!1,wantsHeight:!1};var e=this._scale.copy();e.range(this._isHorizontal()?[0,a]:[b,0]);var f=this.measureTicks(a,b,e,this._scale.domain());return{width:f.usedWidth+c,height:f.usedHeight+d,wantsWidth:!f.textFits,wantsHeight:!f.textFits}},c.prototype._getTickValues=function(){return this._scale.domain()},c.prototype.measureTicks=function(b,c,d,e){var f="string"!=typeof e[0],g=this,h=[],i=function(a){return g.measurer.measure(a)},j=f?function(a){return e.each(a)}:function(a){return e.forEach(a)};j(function(e){var j,k=d.fullBandStartAndWidth(e)[1],l=g._isHorizontal()?k:b-g._maxLabelTickLength()-g.tickLabelPadding(),m=g._isHorizontal()?c-g._maxLabelTickLength()-g.tickLabelPadding():k,n=g._formatter;if(f){var o=d3.select(this),p={left:"right",right:"left",top:"center",bottom:"center"},q={left:"center",right:"center",top:"bottom",bottom:"top"};j=a.Util.Text.writeText(n(e),l,m,i,!0,{g:o,xAlign:p[g._orientation],yAlign:q[g._orientation]})}else j=a.Util.Text.writeText(n(e),l,m,i,!0);h.push(j)});var k=this._isHorizontal()?d3.sum:d3.max,l=this._isHorizontal()?d3.max:d3.sum;return{textFits:h.every(function(a){return a.textFits}),usedWidth:k(h,function(a){return a.usedWidth}),usedHeight:l(h,function(a){return a.usedHeight})}},c.prototype._doRender=function(){var c=this;b.prototype._doRender.call(this);var d=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).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(a.Abstract.Axis.TICK_LABEL_CLASS,!0),d.exit().remove(),d.attr("transform",e),d.text(""),this.measureTicks(this.availableWidth,this.availableHeight,this._scale,d);var f=this._isHorizontal()?[this._scale.rangeBand()/2,0]:[0,this._scale.rangeBand()/2],g="right"===this._orientation?this._maxLabelTickLength()+this.tickLabelPadding():0,h="bottom"===this._orientation?this._maxLabelTickLength()+this.tickLabelPadding():0;a.Util.DOM.translate(this._tickLabelContainer,g,h),a.Util.DOM.translate(this._tickMarkContainer,f[0],f[1])},c.prototype._computeLayout=function(a,c,d,e){return this.measurer.clear(),b.prototype._computeLayout.call(this,a,c,d,e)},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.text(a),c=c.toLowerCase(),"vertical-left"===c&&(c="left"),"vertical-right"===c&&(c="right"),"horizontal"!==c&&"left"!==c&&"right"!==c)throw new Error(c+" is not a valid orientation for LabelComponent");this.orientation=c,this.xAlign("center").yAlign("center"),this._fixedHeightFlag=!0,this._fixedWidthFlag=!0}return __extends(c,b),c.prototype.xAlign=function(a){var c=a.toLowerCase();return b.prototype.xAlign.call(this,c),this.xAlignment=c,this},c.prototype.yAlign=function(a){var c=a.toLowerCase();return b.prototype.yAlign.call(this,c),this.yAlignment=c,this},c.prototype._requestedSpace=function(a,b){var c=this.measurer(this._text),d="horizontal"===this.orientation?c.width:c.height,e="horizontal"===this.orientation?c.height:c.width;return{width:d,height:e,wantsWidth:d>a,wantsHeight:e>b}},c.prototype._setup=function(){b.prototype._setup.call(this),this.textContainer=this.content.append("g"),this.measurer=a.Util.Text.getTextMeasurer(this.textContainer.append("text")),this.text(this._text)},c.prototype.text=function(a){return void 0===a?this._text:(this._text=a,this._invalidateLayout(),this)},c.prototype._doRender=function(){b.prototype._doRender.call(this),this.textContainer.text("");var c="horizontal"===this.orientation?this.availableWidth:this.availableHeight,d=a.Util.Text.getTruncatedText(this._text,c,this.measurer);"horizontal"===this.orientation?a.Util.Text.writeLineHorizontally(d,this.textContainer,this.availableWidth,this.availableHeight,this.xAlignment,this.yAlignment):a.Util.Text.writeLineVertically(d,this.textContainer,this.availableWidth,this.availableHeight,this.xAlignment,this.yAlignment,this.orientation)},c.prototype._computeLayout=function(c,d,e,f){return this.measurer=a.Util.Text.getTextMeasurer(this.textContainer.append("text")),b.prototype._computeLayout.call(this,c,d,e,f),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),this._fixedWidthFlag=!0,this._fixedHeightFlag=!0}return __extends(c,b),c.prototype.remove=function(){b.prototype.remove.call(this),null!=this.colorScale&&this.colorScale.broadcaster.deregisterListener(this)},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;this.nRowsDrawn=Math.min(g,Math.floor(this.availableHeight/f))},c.prototype._requestedSpace=function(b,d){var e=this.measureTextHeight(),f=this.colorScale.domain().length,g=Math.min(f,Math.floor((d-2*c.MARGIN)/e)),h=this.content.append("g").classed(c.SUBELEMENT_CLASS,!0),i=a.Util.Text.getTextMeasurer(h.append("text")),j=d3.max(this.colorScale.domain(),function(a){return i(a).width});h.remove(),j=void 0===j?0:j;var k=0===g?0:j+e+2*c.MARGIN,l=0===g?0:f*e+2*c.MARGIN;return{width:k,height:l,wantsWidth:k>b,wantsHeight:l>d}},c.prototype.measureTextHeight=function(){var b=this.content.append("g").classed(c.SUBELEMENT_CLASS,!0),d=a.Util.Text.getTextMeasurer(b.append("text"))(a.Util.Text.HEIGHT_TEXT).height;return 0===d&&(d=1),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=.3*e,h=this.content.selectAll("."+c.SUBELEMENT_CLASS).data(d,function(a){return a}),i=h.enter().append("g").classed(c.SUBELEMENT_CLASS,!0);i.append("circle"),i.append("g").classed("text-container",!0),h.exit().remove(),h.selectAll("circle").attr("cx",e/2).attr("cy",e/2).attr("r",g).attr("fill",this.colorScale._d3Scale),h.selectAll("g.text-container").text("").attr("transform","translate("+e+", 0)").each(function(b){var c=d3.select(this),d=a.Util.Text.getTextMeasurer(c.append("text")),e=a.Util.Text.getTruncatedText(b,f,d),g=d(e);a.Util.Text.writeLineHorizontally(e,c,g.width,g.height)}),h.attr("transform",function(a){return"translate("+c.MARGIN+","+(d.indexOf(a)*e+c.MARGIN)+")"}),this.updateClasses(),this.updateListeners()},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;if(a.call(this),null==b&&null==c)throw new Error("Gridlines must have at least one scale");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.remove=function(){return a.prototype.remove.call(this),null!=this.xScale&&this.xScale.broadcaster.deregisterListener(this),null!=this.yScale&&this.yScale.broadcaster.deregisterListener(this),this},b.prototype._setup=function(){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)},b.prototype._doRender=function(){a.prototype._doRender.call(this),this.redrawXLines(),this.redrawYLines()},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).classed("zeroline",function(a){return 0===a}),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).classed("zeroline",function(a){return 0===a}),d.exit().remove()}},b}(a.Abstract.Component);b.Gridlines=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,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("scatter-plot",!0),this.project("r",3),this.project("opacity",.6),this.project("fill",function(){return a.Core.Colors.INDIGO})}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-plot",!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(c){function d(b,d,e){c.call(this,b,d,e),this._baselineValue=0,this._barAlignmentFactor=0,this._animators={"bars-reset":new a.Animator.Null,bars:new a.Animator.IterativeDelay,baseline:new a.Animator.Null},this.classed("bar-plot",!0),this.project("fill",function(){return a.Core.Colors.INDIGO}),this.baseline(this._baselineValue)}return __extends(d,c),d.prototype._setup=function(){c.prototype._setup.call(this),this._baseline=this.renderArea.append("line").classed("baseline",!0),this._bars=this.renderArea.selectAll("rect").data([])},d.prototype._paint=function(){c.prototype._paint.call(this),this._bars=this.renderArea.selectAll("rect").data(this._dataSource.data()),this._bars.enter().append("rect");var a=this._isVertical?this.yScale:this.xScale,b=a.scale(this._baselineValue),d=this._isVertical?"y":"x",e=this._isVertical?"height":"width";if(this._dataChanged&&this._animate){var f=this._generateAttrToProjector();f[d]=function(){return b},f[e]=function(){return 0},this._applyAnimatedAttributes(this._bars,"bars-reset",f)}var g=this._generateAttrToProjector();null!=g.fill&&this._bars.attr("fill",g.fill),this._applyAnimatedAttributes(this._bars,"bars",g),this._bars.exit().remove();var h={x1:this._isVertical?0:b,y1:this._isVertical?b:0,x2:this._isVertical?this.availableWidth:b,y2:this._isVertical?b:this.availableHeight};this._applyAnimatedAttributes(this._baseline,"baseline",h)},d.prototype.baseline=function(a){return this._baselineValue=a,this._updateXDomainer(),this._updateYDomainer(),this._render(),this},d.prototype.barAlignment=function(a){var b=a.toLowerCase(),c=this.constructor._BarAlignmentToFactor;if(void 0===c[b])throw new Error("unsupported bar alignment");return this._barAlignmentFactor=c[b],this._render(),this},d.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")},d.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},d.prototype.deselectAll=function(){return this._isSetup&&this._bars.classed("selected",!1),this},d.prototype._updateDomainer=function(a){if(a instanceof b.QuantitativeScale){var c=a;c._userSetDomainer||(null!=this._baselineValue?c.domainer().addPaddingException(this._baselineValue,"BAR_PLOT+"+this._plottableID).addIncludedValue(this._baselineValue,"BAR_PLOT+"+this._plottableID):c.domainer().removePaddingException("BAR_PLOT+"+this._plottableID).removeIncludedValue("BAR_PLOT+"+this._plottableID),c.domainer().pad()),c._autoDomainIfAutomaticMode()}},d.prototype._updateYDomainer=function(){this._isVertical?this._updateDomainer(this.yScale):c.prototype._updateYDomainer.call(this)},d.prototype._updateXDomainer=function(){this._isVertical?c.prototype._updateXDomainer.call(this):this._updateDomainer(this.xScale)},d.prototype._generateAttrToProjector=function(){var b=this,e=c.prototype._generateAttrToProjector.call(this),f=this._isVertical?this.yScale:this.xScale,g=this._isVertical?this.xScale:this.yScale,h=this._isVertical?"y":"x",i=this._isVertical?"x":"y",j=g instanceof a.Scale.Ordinal&&"bands"===g.rangeType(),k=f.scale(this._baselineValue);if(null==e.width){var l=j?g.rangeBand():d.DEFAULT_WIDTH;e.width=function(){return l}}var m=e[i],n=e.width;if(j){var o=g.rangeBand();e[i]=function(a,b){return m(a,b)-n(a,b)/2+o/2}}else e[i]=function(a,c){return m(a,c)-n(a,c)*b._barAlignmentFactor};var p=e[h];return e[h]=function(a,b){var c=p(a,b);return c>k?k:c},e.height=function(a,b){return Math.abs(k-p(a,b))},e},d.DEFAULT_WIDTH=10,d._BarAlignmentToFactor={},d}(b.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._isVertical=!0
-}return __extends(b,a),b.prototype._updateYDomainer=function(){this._updateDomainer(this.yScale)},b._BarAlignmentToFactor={left:0,center:.5,right:1},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.isVertical=!1}return __extends(b,a),b.prototype._updateXDomainer=function(){this._updateDomainer(this.xScale)},b.prototype._generateAttrToProjector=function(){var b=a.prototype._generateAttrToProjector.call(this),c=b.width;return b.width=b.height,b.height=c,b},b._BarAlignmentToFactor={top:0,center:.5,bottom:1},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={"line-reset":new a.Animator.Null,line:(new a.Animator.Default).duration(600).easing("exp-in-out")},this.classed("line-plot",!0),this.project("stroke",function(){return a.Core.Colors.INDIGO}),this.project("stroke-width",function(){return"2px"})}return __extends(c,b),c.prototype._setup=function(){b.prototype._setup.call(this),this.linePath=this.renderArea.append("path").classed("line",!0)},c.prototype._getResetYFunction=function(){var a=this.yScale.domain(),b=Math.max(a[0],a[1]),c=Math.min(a[0],a[1]),d=0;0>b?d=b:c>0&&(d=c);var e=this.yScale.scale(d);return function(){return e}},c.prototype._generateAttrToProjector=function(){function a(a){return-1===d.indexOf(a)}var c=b.prototype._generateAttrToProjector.call(this),d=this._wholeDatumAttributes(),e=d3.keys(c).filter(a);return e.forEach(function(a){var b=c[a];c[a]=function(a,c){return a.length>0?b(a[0],c):null}}),c},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this._generateAttrToProjector(),c=a.x,d=a.y;delete a.x,delete a.y,this.linePath.datum(this._dataSource.data()),this._dataChanged&&(a.d=d3.svg.line().x(c).y(this._getResetYFunction()),this._applyAnimatedAttributes(this.linePath,"line-reset",a)),a.d=d3.svg.line().x(c).y(d),this._applyAnimatedAttributes(this.linePath,"line",a)},c.prototype._wholeDatumAttributes=function(){return["x","y"]},c}(a.Abstract.XYPlot);b.Line=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.classed("area-plot",!0),this.project("y0",0,e),this.project("fill",function(){return a.Core.Colors.INDIGO}),this.project("fill-opacity",function(){return.25}),this.project("stroke",function(){return a.Core.Colors.INDIGO}),this._animators["area-reset"]=new a.Animator.Null,this._animators.area=(new a.Animator.Default).duration(600).easing("exp-in-out")}return __extends(c,b),c.prototype._setup=function(){b.prototype._setup.call(this),this.areaPath=this.renderArea.append("path").classed("area",!0)},c.prototype._onDataSourceUpdate=function(){b.prototype._onDataSourceUpdate.call(this),null!=this.yScale&&this._updateYDomainer()},c.prototype._updateYDomainer=function(){b.prototype._updateYDomainer.call(this);var a=this.yScale,c=this._projectors.y0,d=null!=c?c.accessor:null,e=null!=d?this.dataSource()._getExtent(d):[],f=2===e.length&&e[0]===e[1]?e[0]:null;a._userSetDomainer||(null!=f?a.domainer().addPaddingException(f,"AREA_PLOT+"+this._plottableID):a.domainer().removePaddingException("AREA_PLOT+"+this._plottableID),a._autoDomainIfAutomaticMode())},c.prototype.project=function(a,c,d){return b.prototype.project.call(this,a,c,d),"y0"===a&&this._updateYDomainer(),this},c.prototype._getResetYFunction=function(){return this._generateAttrToProjector().y0},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._dataChanged&&(a.d=d3.svg.area().x(c).y0(d).y1(this._getResetYFunction()),this._applyAnimatedAttributes(this.areaPath,"area-reset",a)),a.d=d3.svg.area().x(c).y0(d).y1(e),this._applyAnimatedAttributes(this.areaPath,"area",a)},c.prototype._wholeDatumAttributes=function(){var a=b.prototype._wholeDatumAttributes.call(this);return a.push("y0"),a},c}(b.Line);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(c){function d(b,d){c.call(this,b,d),this._baselineValue=0,this._barAlignmentFactor=0,this._animators={"bars-reset":new a.Animator.Null,bars:new a.Animator.IterativeDelay,baseline:new a.Animator.Null},this.classed("bar-plot",!0),this.project("fill",function(){return a.Core.Colors.INDIGO}),this.baseline(this._baselineValue)}return __extends(d,c),d.prototype._getDrawer=function(b){return new a._Drawer.Rect(b)},d.prototype._setup=function(){c.prototype._setup.call(this),this._baseline=this.renderArea.append("line").classed("baseline",!0)},d.prototype._paint=function(){c.prototype._paint.call(this);var a=this._isVertical?this.yScale:this.xScale,b=a.scale(this._baselineValue),d={x1:this._isVertical?0:b,y1:this._isVertical?b:0,x2:this._isVertical?this.availableWidth:b,y2:this._isVertical?b:this.availableHeight};this._applyAnimatedAttributes(this._baseline,"baseline",d)},d.prototype.baseline=function(a){return b.BarPlot.prototype.baseline.apply(this,[a])},d.prototype._updateDomainer=function(a){return b.BarPlot.prototype._updateDomainer.apply(this,[a])},d.prototype._generateAttrToProjector=function(){return b.BarPlot.prototype._generateAttrToProjector.apply(this)},d.prototype._updateXDomainer=function(){return b.BarPlot.prototype._updateXDomainer.apply(this)},d.prototype._updateYDomainer=function(){return b.BarPlot.prototype._updateYDomainer.apply(this)},d._barAlignmentToFactor={},d.DEFAULT_WIDTH=10,d}(b.NewStylePlot);b.NewStyleBarPlot=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){b.call(this,c,d),this._isVertical=!0,this.innerScale=new a.Scale.Ordinal}return __extends(c,b),c.prototype._generateAttrToProjector=function(){var a=this,c=b.prototype._generateAttrToProjector.call(this),d=c.width;return this.innerScale.range([0,d(null,0)]),c.width=function(){return a.innerScale.rangeBand()},c.x=function(a){return a._PLOTTABLE_PROTECTED_FIELD_X},c},c.prototype.cluster=function(b){var c=this;this.innerScale.domain(this._datasetKeysInOrder);var d=this._getDatasetsInOrder().map(function(a){return a.data().length});a.Util.Methods.uniqNumbers(d).length>1&&a.Util.Methods.warn("Warning: Attempting to cluster data when datasets are of unequal length");var e={};return this._datasetKeysInOrder.forEach(function(a){var d=c._key2DatasetDrawerKey[a].dataset.data(),f=d.map(function(a){return b(a)});e[a]=d.map(function(b,d){return b._PLOTTABLE_PROTECTED_FIELD_X=c.xScale.scale(f[d])+c.innerScale.scale(a),b})}),e},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this._projectors.x.accessor,c=this._generateAttrToProjector(),d=this.cluster(a);this._getDrawersInOrder().forEach(function(a){return a.draw(d[a.key],c)})},c.DEFAULT_WIDTH=10,c}(a.Abstract.NewStyleBarPlot);b.ClusteredBar=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){b.call(this,a,c),this.stackedData=[],this._isVertical=!0,this._baselineValue=0,this.stackedExtent=[]}return __extends(c,b),c.prototype._addDataset=function(a,c){b.prototype._addDataset.call(this,a,c),this.stackedData=this.stack(this._projectors.y.accessor)},c.prototype._updateAllProjectors=function(){b.prototype._updateAllProjectors.call(this),null!=this.yScale&&(this._isAnchored&&this.stackedExtent.length>0?this.yScale.updateExtent(this._plottableID.toString(),"_PLOTTABLE_PROTECTED_FIELD_STACK_EXTENT",this.stackedExtent):this.yScale.removeExtent(this._plottableID.toString(),"_PLOTTABLE_PROTECTED_FIELD_STACK_EXTENT"))},c.prototype._generateAttrToProjector=function(){var a=b.prototype._generateAttrToProjector.call(this),c=this._isVertical?this.yScale:this.xScale,d=function(a){return c.scale(a._PLOTTABLE_PROTECTED_FIELD_Y0)},e=function(a){return c.scale(a._PLOTTABLE_PROTECTED_FIELD_Y)};return a.height=function(a){return Math.abs(e(a)-d(a))},a.y=function(a){return e(a)},a},c.prototype.stack=function(b){var c=d3.values(this._key2DatasetDrawerKey),d=c.map(function(a){return a.dataset.data().length});a.Util.Methods.uniqNumbers(d).length>1&&a.Util.Methods.warn("Warning: Attempting to stack data when datasets are of unequal length");var e=a.Util.Methods.createFilledArray(0,d[0]),f=this._getDatasetsInOrder().map(function(c){var d=c.data(),f=e.slice(),g=d.map(b);return g.some(function(a){return 0>a})&&a.Util.Methods.warn("Warning: Behavior for stacked bars undefined when data includes negative values"),e=a.Util.Methods.addArrays(f,g),d.map(function(a,b){return a._PLOTTABLE_PROTECTED_FIELD_Y0=f[b],a._PLOTTABLE_PROTECTED_FIELD_Y=e[b],a})});return this.stackedExtent=[0,d3.max(e)],this._onDataSourceUpdate(),f},c.prototype._paint=function(){var a=this,b=this._generateAttrToProjector();this._getDrawersInOrder().forEach(function(c,d){return c.draw(a.stackedData[d],b)})},c}(a.Abstract.NewStyleBarPlot);b.StackedBar=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(a){var b=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.Default);a.IterativeDelay=b}(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){if(null==a)throw new Error("Interactions require a component to listen to");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(b){function c(c,d,e){var f=this;b.call(this,c),null==d&&(d=new a.Scale.Linear),null==e&&(e=new a.Scale.Linear),this.xScale=d,this.yScale=e,this.zoom=d3.behavior.zoom(),this.zoom.x(this.xScale._d3Scale),this.zoom.y(this.yScale._d3Scale),this.zoom.on("zoom",function(){return f.rerenderZoomed()})}return __extends(c,b),c.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)},c.prototype._anchor=function(a){b.prototype._anchor.call(this,a),this.zoom(a)},c.prototype.rerenderZoomed=function(){var a=this.xScale._d3Scale.domain(),b=this.yScale._d3Scale.domain();this.xScale.domain(a),this.yScale.domain(b)},c}(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(b){function c(c){b.call(this,c),this.plotIsVertical=!0,this.currentBar=null,this._hoverMode="point",this.plotIsVertical=a.Plot.VerticalBar.prototype.isPrototypeOf(this.componentToListenTo)}return __extends(c,b),c.prototype._anchor=function(b){var c=this;this.dispatcher=new a.Dispatcher.Mouse(b),this.dispatcher.mousemove(function(a){var b=c.getHoveredBar(a);if(null==b)c._hoverOut();else{if(null!=c.currentBar){if(c.currentBar.node()===b.node())return;c._hoverOut()}c.componentToListenTo._bars.classed("not-hovered",!0).classed("hovered",!1),b.classed("not-hovered",!1).classed("hovered",!0),null!=c.hoverCallback&&c.hoverCallback(b.data()[0],b)}c.currentBar=b}),this.dispatcher.mouseout(function(){return c._hoverOut()}),this.dispatcher.connect()},c.prototype._hoverOut=function(){this.componentToListenTo._bars.classed("not-hovered hovered",!1),null!=this.unhoverCallback&&null!=this.currentBar&&this.unhoverCallback(this.currentBar.data()[0],this.currentBar),this.currentBar=null},c.prototype.getHoveredBar=function(a){if("point"===this._hoverMode)return this.componentToListenTo.selectBar(a.x,a.y,!1);var b={min:-1/0,max:1/0};return this.plotIsVertical?this.componentToListenTo.selectBar(a.x,b,!1):this.componentToListenTo.selectBar(b,a.y,!1)},c.prototype.hoverMode=function(a){if(null==a)return this._hoverMode;var b=a.toLowerCase();if("point"!==b&&"line"!==b)throw new Error(a+" is not a valid hover mode for Interaction.BarHover");return this._hoverMode=b,this},c.prototype.onHover=function(a){return this.hoverCallback=a,this},c.prototype.onUnhover=function(a){return this.unhoverCallback=a,this},c}(a.Abstract.Interaction);b.BarHover=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.dragstart=function(a){return void 0===a?this.ondragstart:(this.ondragstart=a,this)},b.prototype.drag=function(a){return void 0===a?this.ondrag:(this.ondrag=a,this)},b.prototype.dragend=function(a){return void 0===a?this.ondragend:(this.ondragend=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._doDragstart=function(){null!=this.ondragstart&&this.ondragstart({x:this.origin[0],y:this.origin[1]})},b.prototype._drag=function(){this.dragInitialized||(this.origin=[d3.event.x,d3.event.y],this.dragInitialized=!0,this._doDragstart()),this.location=[this.constrainX(d3.event.x),this.constrainY(d3.event.y)],this._doDrag()},b.prototype._doDrag=function(){if(null!=this.ondrag){var a={x:this.origin[0],y:this.origin[1]},b={x:this.location[0],y:this.location[1]};this.ondrag(a,b)}},b.prototype._dragend=function(){this.dragInitialized&&(this.dragInitialized=!1,this._doDragend())},b.prototype._doDragend=function(){if(null!=this.ondragend){var a={x:this.origin[0],y:this.origin[1]},b={x:this.location[0],y:this.location[1]};this.ondragend(a,b)}},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,g){return null==c||null==g?(f&&(null!=a&&a.domain(d),null!=b&&b.domain(e)),void(f=!f)):(f=!1,null!=a&&a.domain([a.invert(c.x),a.invert(g.x)]),null!=b&&b.domain([b.invert(g.y),b.invert(c.y)]),void this.clearBox())}var d=null!=a?a.domain():null,e=null!=b?b.domain():null,f=!1;return this.drag(c),this.dragend(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(a){var b=function(a){function b(){a.apply(this,arguments),this.boxIsDrawn=!1}return __extends(b,a),b.prototype._dragstart=function(){a.prototype._dragstart.call(this),this.clearBox()},b.prototype.clearBox=function(){return null!=this.dragBox?(this.dragBox.attr("height",0).attr("width",0),this.boxIsDrawn=!1,this):void 0},b.prototype.setBox=function(a,b,c,d){if(null!=this.dragBox){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.backgroundContainer;return this.dragBox=e.append("rect").classed(d,!0).attr("x",0).attr("y",0),this},b.CLASS_DRAG_BOX="drag-box",b}(a.Drag);a.DragBox=b}(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(a){var b=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.setBox=function(b,c){return a.prototype.setBox.call(this,b,c,0,this.componentToListenTo.availableHeight),this},b}(a.DragBox);a.XDragBox=b}(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(a){var b=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}(a.DragBox);a.XYDragBox=b}(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(a){var b=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.setBox=function(b,c){return a.prototype.setBox.call(this,0,this.componentToListenTo.availableWidth,b,c),this},b}(a.DragBox);a.YDragBox=b}(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(a){var b=function(a){function b(b){a.call(this),this._event2Callback={},this.connected=!1,this._target=b}return __extends(b,a),b.prototype.target=function(a){if(null==a)return this._target;var b=this.connected;return this.disconnect(),this._target=a,b&&this.connect(),this},b.prototype.getEventString=function(a){return a+".dispatcher"+this._plottableID},b.prototype.connect=function(){var a=this;if(this.connected)throw new Error("Can't connect dispatcher twice!");return this.connected=!0,Object.keys(this._event2Callback).forEach(function(b){var c=a._event2Callback[b];a._target.on(a.getEventString(b),c)}),this},b.prototype.disconnect=function(){var a=this;return this.connected=!1,Object.keys(this._event2Callback).forEach(function(b){a._target.on(a.getEventString(b),null)}),this},b}(a.PlottableObject);a.Dispatcher=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){var c=this;a.call(this,b),this._event2Callback.mouseover=function(){null!=c._mouseover&&c._mouseover(c.getMousePosition())},this._event2Callback.mousemove=function(){null!=c._mousemove&&c._mousemove(c.getMousePosition())},this._event2Callback.mouseout=function(){null!=c._mouseout&&c._mouseout(c.getMousePosition())}}return __extends(b,a),b.prototype.getMousePosition=function(){var a=d3.mouse(this._target.node());return{x:a[0],y:a[1]}},b.prototype.mouseover=function(a){return void 0===a?this._mouseover:(this._mouseover=a,this)},b.prototype.mousemove=function(a){return void 0===a?this._mousemove:(this._mousemove=a,this)},b.prototype.mouseout=function(a){return void 0===a?this._mouseout:(this._mouseout=a,this)},b}(a.Abstract.Dispatcher);b.Mouse=c}(a.Dispatcher||(a.Dispatcher={}));a.Dispatcher}(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.text(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.text(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.text(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){null!=window.console&&(null!=window.console.warn?console.warn(a):null!=window.console.log&&console.log(a))}function d(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 e(a,b){var c=d3.set();return a.forEach(function(a){b.has(a)&&c.add(a)}),c}function f(a){return"function"==typeof a?a:"string"==typeof a&&"#"!==a[0]?function(b){return b[a]}:function(){return a}}function g(a,b){var c=d3.set();return a.forEach(function(a){return c.add(a)}),b.forEach(function(a){return c.add(a)}),c}function h(a,b){var c=f(a);return function(a,d){return c(a,d,b.dataSource().metadata())}}function i(a){var b={};return a.forEach(function(a){return b[a]=!0}),d3.keys(b)}function j(a){var b=d3.set(),c=[];return a.forEach(function(a){b.has(a)||(b.add(a),c.push(a))}),c}function k(a,b){for(var c=[],d=0;b>d;d++)c[d]="function"==typeof a?a(d):a;return c}function l(a){return Array.prototype.concat.apply([],a)}function m(a,b){if(null==a||null==b)return a===b;if(a.length!==b.length)return!1;for(var c=0;cd;){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 i(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.DOM.getBBox(k),m=l.height,n=l.width;if(n>d||m>e)return a.Methods.warn("Insufficient space to fit text: "+b),k.text(""),{width:0,height:0};var o={left:"start",center:"middle",right:"end"},p=o[f],q=d*h[f],r=e*i[g],s=.85-i[g];return k.attr("text-anchor",p).attr("y",s+"em"),a.DOM.translate(j,q,r),{width:n,height:m}}function j(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 h="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=h?j:k,m=b.append("g"),n=i(a,m,d,c,l[f],l[e]),o=d3.transform("");return o.rotate="right"===g?90:-90,o.translate=[h?c:0,h?0:d],m.attr("transform",o.toString()),n}function k(d,e,f,g,h,j){"undefined"==typeof h&&(h="left"),"undefined"==typeof j&&(j="top");var k=c(e.append("text"))(b.HEIGHT_TEXT).height,l=0,m=e.append("g");d.forEach(function(b,c){var d=m.append("g");a.DOM.translate(d,0,c*k);var e=i(b,d,f,k,h,j);e.width>l&&(l=e.width)});var n=k*d.length,o=g-n,p={center:.5,top:0,bottom:1};return a.DOM.translate(m,0,o*p[j]),{width:l,height:n}}function l(d,e,f,g,h,i,k){"undefined"==typeof h&&(h="left"),"undefined"==typeof i&&(i="top"),"undefined"==typeof k&&(k="left");var l=c(e.append("text"))(b.HEIGHT_TEXT).height,m=0,n=e.append("g");d.forEach(function(b,c){var d=n.append("g");a.DOM.translate(d,c*l,0);var e=j(b,d,l,g,h,i,k);e.height>m&&(m=e.height)});var o=l*d.length,p=f-o,q={center:.5,left:0,right:1};return a.DOM.translate(n,p*q[h],0),{width:o,height:m}}function m(b,c,d,e,f,g){var h=null!=f?f:1.1*c>d,i=h?c:d,j=h?d:c,m=a.WordWrap.breakTextToFitRect(b,i,j,e);if(0===m.lines.length)return{textFits:m.textFits,usedWidth:0,usedHeight:0};var n,o;if(null==g){var p=h?d3.max:d3.sum,q=h?d3.sum:d3.max;n=p(m.lines,function(a){return e(a).width}),o=q(m.lines,function(a){return e(a).height})}else{var r=g.g.append("g").classed("writeText-inner-g",!0),s=h?k:l,t=s(m.lines,r,c,d,g.xAlign,g.yAlign);n=t.width,o=t.height}return{textFits:m.textFits,usedWidth:n,usedHeight:o}}b.HEIGHT_TEXT="bqpdl",b.getTextMeasurer=c;var n="a",o=function(){function b(b){var g=this;this.cache=new a.Cache(c(b),n,a.Methods.objEq),this.measure=d(e(f(function(a){return g.cache.get(a)})))}return b.prototype.clear=function(){return this.cache.clear(),this},b}();b.CachingCharacterMeasurer=o,b.getTruncatedText=g,b._addEllipsesToLine=h,b.writeLineHorizontally=i,b.writeLineVertically=j,b.writeText=m}(a.Text||(a.Text={}));a.Text}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(b){function c(b,c,e,f){var g=function(a){return f(a).width},h=d(b,c,g),i=f("hello world").height,j=Math.floor(e/i),k=j>=h.length;return k||(h=h.splice(0,j),j>0&&(h[j-1]=a.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.canWrapWithoutBreakingWords=e}(a.WordWrap||(a.WordWrap={}));a.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),d=parseFloat(c);return d!==d?0:d}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)}function j(a,b){return a.rightb.right?!1:a.bottomb.bottom?!1:!0}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.boxesOverlap=j}(a.DOM||(a.DOM={}));a.DOM}(a.Util||(a.Util={}));a.Util}(Plottable||(Plottable={}));var Plottable;!function(a){a.MILLISECONDS_IN_ONE_DAY=864e5;var b=function(){function b(){}return b.currency=function(a,c,d,e){"undefined"==typeof a&&(a=2),"undefined"==typeof c&&(c="$"),"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=!0);var f=b.fixed(a);return function(a){var g=f(Math.abs(a));return e&&b._valueChanged(Math.abs(a),g)?"":(""!==g&&(d?g=c+g:g+=c,0>a&&(g="-"+g)),g)}},b.fixed=function(a,c){return"undefined"==typeof a&&(a=3),"undefined"==typeof c&&(c=!0),b.verifyPrecision(a),function(d){var e=d.toFixed(a);return c&&b._valueChanged(d,e)?"":e}},b.general=function(a,c){return"undefined"==typeof a&&(a=3),"undefined"==typeof c&&(c=!0),b.verifyPrecision(a),function(d){if("number"==typeof d){var e=Math.pow(10,a),f=String(Math.round(d*e)/e);return c&&b._valueChanged(d,f)?"":f}return String(d)}},b.identity=function(){return function(a){return String(a)}},b.percentage=function(a,c){"undefined"==typeof a&&(a=0),"undefined"==typeof c&&(c=!0);var d=b.fixed(a);return function(a){var e=100*a,f=a.toString(),g=Math.pow(10,f.length-(f.indexOf(".")+1));e=parseInt((e*g).toString(),10)/g;var h=d(e);return c&&b._valueChanged(e,h)?"":(""!==h&&(h+="%"),h)}},b.siSuffix=function(a){return"undefined"==typeof a&&(a=3),b.verifyPrecision(a),function(b){return d3.format("."+a+"s")(b)}},b.time=function(){var a=8,b={};return b[0]={format:".%L",filter:function(a){return 0!==a.getMilliseconds()}},b[1]={format:":%S",filter:function(a){return 0!==a.getSeconds()}},b[2]={format:"%I:%M",filter:function(a){return 0!==a.getMinutes()}},b[3]={format:"%I %p",filter:function(a){return 0!==a.getHours()}},b[4]={format:"%a %d",filter:function(a){return 0!==a.getDay()&&1!==a.getDate()}},b[5]={format:"%b %d",filter:function(a){return 1!==a.getDate()}},b[6]={format:"%b",filter:function(a){return 0!==a.getMonth()}},b[7]={format:"%Y",filter:function(){return!0}},function(c){for(var d=0;a>d;d++)if(b[d].filter(c))return d3.time.format(b[d].format)(c)}},b.relativeDate=function(b,c,d){return"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=a.MILLISECONDS_IN_ONE_DAY),"undefined"==typeof d&&(d=""),function(a){var e=Math.round((a.valueOf()-b)/c);return e.toString()+d}},b.verifyPrecision=function(a){if(0>a||a>20)throw new RangeError("Formatter precision must be between 0 and 20")},b._valueChanged=function(a,b){return a!==parseFloat(b)},b}();a.Formatters=b}(Plottable||(Plottable={}));var Plottable;!function(a){a.version="0.25.1"}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){var b=function(){function a(){}return a.CORAL_RED="#fd373e",a.INDIGO="#5177c4",a.ROBINS_EGG_BLUE="#06bdbd",a.FERN="#62bb60",a.BURNING_ORANGE="#ff7939",a.ROYAL_HEATH="#962565",a.CONIFER="#99ce50",a.CERISE_RED="#db2e65",a.BRIGHT_SUN="#ffe43d",a.JACARTA="#2c2b6f",a.PLOTTABLE_COLORS=[a.CORAL_RED,a.INDIGO,a.ROBINS_EGG_BLUE,a.FERN,a.BURNING_ORANGE,a.ROYAL_HEATH,a.CONIFER,a.CERISE_RED,a.BRIGHT_SUN,a.JACARTA],a}();a.Colors=b}(a.Core||(a.Core={}));a.Core}(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.key2callback=new a.Util.StrictEqualityAssociativeArray,this.listenable=c}return __extends(c,b),c.prototype.registerListener=function(a,b){return this.key2callback.set(a,b),this},c.prototype.broadcast=function(){for(var a=this,b=[],c=0;c=0&&(this._components.splice(b,1),this._invalidateLayout())},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.detachAll=function(){return this._components.slice().forEach(function(a){return a.detach()}),this},b.prototype.remove=function(){a.prototype.remove.call(this),this._components.slice().forEach(function(a){return a.remove()})},b}(a.Component);a.ComponentContainer=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){"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();return{width:d?0:d3.max(c,function(a){return a.width}),height:d?0:d3.max(c,function(a){return a.height}),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;j=null!=a?a._requestedSpace(b[i],c[h]):{width:0,height:0,wantsWidth:!1,wantsHeight:!1};var k=Math.min(j.width,b[i]),l=Math.min(j.height,c[h]);d[i]=Math.max(d[i],k),e[h]=Math.max(e[h],l),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;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})},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.autoDomainAutomatically=!0,this._setDomain(this._getExtent()),this},c.prototype._autoDomainIfAutomaticMode=function(){this.autoDomainAutomatically&&this.autoDomain()
+},c.prototype.scale=function(a){return this._d3Scale(a)},c.prototype.domain=function(a){return null==a?this._getDomain():(this.autoDomainAutomatically=!1,this._setDomain(a),this)},c.prototype._getDomain=function(){return this._d3Scale.domain()},c.prototype._setDomain=function(a){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._autoDomainIfAutomaticMode(),this},c.prototype.removeExtent=function(a,b){return delete this._rendererAttrID2Extent[a+b],this._autoDomainIfAutomaticMode(),this},c}(b.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.animateOnNextRender=!0,this.clipPathEnabled=!0,this.classed("plot",!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){b.prototype._anchor.call(this,a),this.animateOnNextRender=!0,this._dataChanged=!0,this._updateAllProjectors()},c.prototype.remove=function(){var a=this;b.prototype.remove.call(this),this._dataSource.broadcaster.deregisterListener(this);var c=Object.keys(this._projectors);c.forEach(function(b){var c=a._projectors[b];null!=c.scale&&c.scale.broadcaster.deregisterListener(a)})},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._dataSource=a,this._dataSource.broadcaster.registerListener(this,function(){return b._onDataSourceUpdate()}),this._onDataSourceUpdate(),this},c.prototype._onDataSourceUpdate=function(){this._updateAllProjectors(),this.animateOnNextRender=!0,this._dataChanged=!0,this._render()},c.prototype.project=function(b,c,d){var e=this;b=b.toLowerCase();var f=this._projectors[b],g=null!=f?f.scale:null;null!=g&&(g.removeExtent(this._plottableID.toString(),b),g.broadcaster.deregisterListener(this)),null!=d&&d.broadcaster.registerListener(this,function(){return e._render()});var h=a.Util.Methods._applyAccessor(c,this);return this._projectors[b]={accessor:h,scale:d,attribute:b},this._updateProjector(b),this._render(),this},c.prototype._generateAttrToProjector=function(){var a=this,b={};return d3.keys(this._projectors).forEach(function(c){var d=a._projectors[c],e=d.accessor,f=d.scale,g=null==f?e:function(a,b){return f.scale(e(a,b))};b[c]=g}),b},c.prototype._doRender=function(){this._isAnchored&&(this._paint(),this._dataChanged=!1,this.animateOnNextRender=!1)},c.prototype._paint=function(){},c.prototype._setup=function(){b.prototype._setup.call(this),this.renderArea=this.content.append("g").classed("render-area",!0)},c.prototype.animate=function(a){return this._animate=a,this},c.prototype.detach=function(){return b.prototype.detach.call(this),this._updateAllProjectors(),this},c.prototype._updateAllProjectors=function(){var a=this;d3.keys(this._projectors).forEach(function(b){return a._updateProjector(b)})},c.prototype._updateProjector=function(a){var b=this._projectors[a];if(null!=b.scale){var c=this.dataSource()._getExtent(b.accessor);0!==c.length&&this._isAnchored?b.scale.updateExtent(this._plottableID.toString(),a,c):b.scale.removeExtent(this._plottableID.toString(),a)}},c.prototype._applyAnimatedAttributes=function(a,b,c){return this._animate&&this.animateOnNextRender&&null!=this._animators[b]?this._animators[b].animate(a,c,this):a.attr(c)},c.prototype.animator=function(a,b){return void 0===b?this._animators[a]:(this._animators[a]=b,this)},c}(b.Component);b.Plot=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(a){var b=function(b){function c(a,c,d){if(b.call(this,a),null==c||null==d)throw new Error("XYPlots require an xScale and yScale");this.classed("xy-plot",!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){b.prototype._computeLayout.call(this,a,c,d,e),this.xScale.range([0,this.availableWidth]),this.yScale.range([this.availableHeight,0])},c.prototype._updateXDomainer=function(){if(this.xScale instanceof a.QuantitativeScale){var b=this.xScale;b._userSetDomainer||b.domainer().pad().nice()}},c.prototype._updateYDomainer=function(){if(this.yScale instanceof a.QuantitativeScale){var b=this.yScale;b._userSetDomainer||b.domainer().pad().nice()}},c}(a.Plot);a.XYPlot=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,d){b.call(this,new a.DataSource,c,d),this.nextSeriesIndex=0,this._key2DatasetDrawerKey={},this._datasetKeysInOrder=[]}return __extends(c,b),c.prototype._setup=function(){var a=this;b.prototype._setup.call(this),this._getDrawersInOrder().forEach(function(b){return b.renderArea=a.renderArea.append("g")})},c.prototype.remove=function(){var a=this;b.prototype.remove.call(this),this._datasetKeysInOrder.forEach(function(b){return a.removeDataset(b)})},c.prototype.addDataset=function(b,c){if("string"!=typeof b&&void 0!==c)throw new Error("invalid input to addDataset");"string"==typeof b&&"_"===b[0]&&a.Util.Methods.warn("Warning: Using _named series keys may produce collisions with unlabeled data sources");var d="string"==typeof b?b:"_"+this.nextSeriesIndex++,e="string"!=typeof b?b:c,c=e instanceof a.DataSource?e:new a.DataSource(e);return this._addDataset(d,c),this},c.prototype._addDataset=function(a,b){var c=this;null!=this._key2DatasetDrawerKey[a]&&this.removeDataset(a);var d=this._getDrawer(a),e={drawer:d,dataset:b,key:a};this._datasetKeysInOrder.push(a),this._key2DatasetDrawerKey[a]=e,this._isSetup&&(d.renderArea=this.renderArea.append("g")),b.broadcaster.registerListener(this,function(){return c._onDataSourceUpdate()}),this._onDataSourceUpdate()},c.prototype._getDrawer=function(){throw new Error("Abstract Method Not Implemented")},c.prototype._updateProjector=function(a){var b=this,c=this._projectors[a];null!=c.scale&&d3.values(this._key2DatasetDrawerKey).forEach(function(d){var e=d.dataset._getExtent(c.accessor),f=b._plottableID.toString()+"_"+d.key;0!==e.length&&b._isAnchored?c.scale.updateExtent(f,a,e):c.scale.removeExtent(f,a)})},c.prototype.datasetOrder=function(b){function c(b,c){var d=a.Util.Methods.intersection(d3.set(b),d3.set(c)),e=d.size();return e===b.length&&e===c.length}return void 0===b?this._datasetKeysInOrder:(c(b,this._datasetKeysInOrder)?(this._datasetKeysInOrder=b,this._onDataSourceUpdate()):a.Util.Methods.warn("Attempted to change datasetOrder, but new order is not permutation of old. Ignoring."),this)},c.prototype.removeDataset=function(a){if(null!=this._key2DatasetDrawerKey[a]){var b=this._key2DatasetDrawerKey[a];b.drawer.remove();var c=d3.values(this._projectors),d=this._plottableID.toString()+"_"+a;c.forEach(function(a){null!=a.scale&&a.scale.removeExtent(d,a.attribute)}),b.dataset.broadcaster.deregisterListener(this),this._datasetKeysInOrder.splice(this._datasetKeysInOrder.indexOf(a),1),delete this._key2DatasetDrawerKey[a],this._onDataSourceUpdate()}return this},c.prototype._getDatasetsInOrder=function(){var a=this;return this._datasetKeysInOrder.map(function(b){return a._key2DatasetDrawerKey[b].dataset})},c.prototype._getDrawersInOrder=function(){var a=this;return this._datasetKeysInOrder.map(function(b){return a._key2DatasetDrawerKey[b].drawer})},c}(b.XYPlot);b.NewStylePlot=c}(a.Abstract||(a.Abstract={}));a.Abstract}(Plottable||(Plottable={}));var Plottable;!function(a){!function(b){!function(b){!function(c){var d=function(){function a(){}return a.prototype.render=function(){b.flush()},a}();c.Immediate=d;var e=function(){function c(){}return c.prototype.render=function(){a.Util.DOM.requestAnimationFramePolyfill(b.flush)},c}();c.AnimationFrame=e;var f=function(){function c(){this._timeoutMsec=a.Util.DOM.POLYFILL_TIMEOUT_MSEC}return c.prototype.render=function(){setTimeout(b.flush,this._timeoutMsec)},c}();c.Timeout=f}(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(c){function d(a){c._renderPolicy=a}function e(b){l&&a.Util.Methods.warn("Registered to render while other components are flushing: request may be ignored"),i[b._plottableID]=b,g()}function f(a){j[a._plottableID]=a,i[a._plottableID]=a,g()}function g(){k||(k=!0,c._renderPolicy.render())}function h(){if(k){var a=d3.values(j);a.forEach(function(a){return a._computeLayout()});var c=d3.values(i);c.forEach(function(a){return a._render()}),l=!0;var d={};Object.keys(i).forEach(function(a){try{i[a]._doRender()}catch(b){setTimeout(function(){throw b},0),d[a]=i[a]}}),j={},i=d,k=!1,l=!1}b.ResizeBroadcaster.clearResizing()}var i={},j={},k=!1,l=!1;c._renderPolicy=new c.RenderPolicy.AnimationFrame,c.setRenderPolicy=d,c.registerToRender=e,c.registerToComputeLayout=f,c.flush=h}(b.RenderController||(b.RenderController={}));b.RenderController}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(a){!function(a){!function(b){function c(){void 0===i&&(i=new a.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}(a.ResizeBroadcaster||(a.ResizeBroadcaster={}));a.ResizeBroadcaster}(a.Core||(a.Core={}));a.Core}(Plottable||(Plottable={}));var Plottable;!function(){}(Plottable||(Plottable={}));var Plottable;!function(a){var b=function(){function a(a){this.doNice=!1,this.padProportion=0,this.paddingExceptions=d3.map(),this.unregisteredPaddingExceptions=d3.set(),this.includedValues=d3.map(),this.unregisteredIncludedValues=d3.map(),this.combineExtents=a}return a.prototype.computeDomain=function(a,b){var c;return c=null!=this.combineExtents?this.combineExtents(a):0===a.length?b._defaultExtent():[d3.min(a,function(a){return a[0]}),d3.max(a,function(a){return a[1]})],c=this.includeDomain(c),c=this.padDomain(b,c),c=this.niceDomain(b,c)},a.prototype.pad=function(a){return"undefined"==typeof a&&(a=.05),this.padProportion=a,this},a.prototype.addPaddingException=function(a,b){return null!=b?this.paddingExceptions.set(b,a):this.unregisteredPaddingExceptions.add(a),this},a.prototype.removePaddingException=function(a){return"string"==typeof a?this.paddingExceptions.remove(a):this.unregisteredPaddingExceptions.remove(a),this},a.prototype.addIncludedValue=function(a,b){return null!=b?this.includedValues.set(b,a):this.unregisteredIncludedValues.set(a,a),this},a.prototype.removeIncludedValue=function(a){return"string"==typeof a?this.includedValues.remove(a):this.unregisteredIncludedValues.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,c){var d=c[0],e=c[1];if(d===e&&this.padProportion>0){var f=d.valueOf();return d instanceof Date?[f-a.ONE_DAY,f+a.ONE_DAY]:[f-a.PADDING_FOR_IDENTICAL_DOMAIN,f+a.PADDING_FOR_IDENTICAL_DOMAIN]}if(b.domain()[0]===b.domain()[1])return c;var g=this.padProportion/2,h=b.invert(b.scale(d)-(b.scale(e)-b.scale(d))*g),i=b.invert(b.scale(e)+(b.scale(e)-b.scale(d))*g),j=this.paddingExceptions.values().concat(this.unregisteredPaddingExceptions.values()),k=d3.set(j);return k.has(d)&&(h=d),k.has(e)&&(i=e),[h,i]},a.prototype.niceDomain=function(a,b){return this.doNice?a._niceDomain(b,this.niceCount):b},a.prototype.includeDomain=function(a){var b=this.includedValues.values().concat(this.unregisteredIncludedValues.values());return b.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._getExtent=function(){return this._domainer.computeDomain(this._getAllExtents(),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._setDomain=function(c){var d=function(a){return a!==a||1/0===a||a===-1/0};return d(c[0])||d(c[1])?void a.Util.Methods.warn("Warning: QuantitativeScales cannot take NaN or Infinity as a domain value. Ignoring."):void b.prototype._setDomain.call(this,c)},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._autoDomainIfAutomaticMode(),this)},c.prototype._defaultExtent=function(){return[0,1]},c}(b.Scale);b.QuantitativeScale=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.QuantitativeScale);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(b){function c(d){b.call(this,null==d?d3.scale.log():d),c.warned||(c.warned=!0,a.Util.Methods.warn("Plottable.Scale.Log is deprecated. If possible, use Plottable.Scale.ModifiedLog instead."))}return __extends(c,b),c.prototype.copy=function(){return new c(this._d3Scale.copy())},c.prototype._defaultExtent=function(){return[1,10]},c.warned=!1,c}(a.Abstract.QuantitativeScale);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("undefined"==typeof a&&(a=10),b.call(this,d3.scale.linear()),this._showIntermediateTicks=!1,this.base=a,this.pivot=this.base,this.untransformedDomain=this._defaultExtent(),this._lastRequestedTickCount=10,1>=a)throw new Error("ModifiedLogScale: The base must be > 1")}return __extends(c,b),c.prototype.adjustedLog=function(a){var b=0>a?-1:1;return a*=b,aa?-1:1;return a*=b,a=Math.pow(this.base,a),a=d&&e>=a}),m=j.concat(l).concat(k);return m.length<=1&&(m=d3.scale.linear().domain([d,e]).ticks(this._lastRequestedTickCount)),m},c.prototype.logTicks=function(b,c){var d=this,e=this.howManyTicks(b,c);if(0===e)return[];var f=Math.floor(Math.log(b)/Math.log(this.base)),g=Math.ceil(Math.log(c)/Math.log(this.base)),h=d3.range(g,f,-Math.ceil((g-f)/e)),i=this._showIntermediateTicks?Math.floor(e/h.length):1,j=d3.range(this.base,1,-(this.base-1)/i).map(Math.floor),k=a.Util.Methods.uniqNumbers(j),l=h.map(function(a){return k.map(function(b){return Math.pow(d.base,a-1)*b})}),m=a.Util.Methods.flatten(l),n=m.filter(function(a){return a>=b&&c>=a}),o=n.sort(function(a,b){return a-b});return o},c.prototype.howManyTicks=function(a,b){var c=this.adjustedLog(d3.min(this.untransformedDomain)),d=this.adjustedLog(d3.max(this.untransformedDomain)),e=this.adjustedLog(a),f=this.adjustedLog(b),g=(f-e)/(d-c),h=Math.ceil(g*this._lastRequestedTickCount);return h},c.prototype.copy=function(){return new c(this.base)},c.prototype._niceDomain=function(a){return a},c.prototype.showIntermediateTicks=function(a){return null==a?this._showIntermediateTicks:void(this._showIntermediateTicks=a)},c}(a.Abstract.QuantitativeScale);b.ModifiedLog=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.prototype.copy=function(){return new c(this._d3Scale.copy())},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(c){var d;switch(c){case null:case void 0:d=d3.scale.ordinal().range(a.Core.Colors.PLOTTABLE_COLORS);break;case"Category10":case"category10":case"10":d=d3.scale.category10();break;case"Category20":case"category20":case"20":d=d3.scale.category20();break;case"Category20b":case"category20b":case"20b":d=d3.scale.category20b();break;case"Category20c":case"category20c":case"20c":d=d3.scale.category20c();break;default:throw new Error("Unsupported ColorScale type")}b.call(this,d)}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(b){function c(a){b.call(this,null==a?d3.time.scale():a)}return __extends(c,b),c.prototype.tickInterval=function(a,b){var c=d3.time.scale();return c.domain(this.domain()),c.range(this.range()),c.ticks(a.range,b)},c.prototype.domain=function(a){return null==a?b.prototype.domain.call(this):("string"==typeof a[0]&&(a=a.map(function(a){return new Date(a)})),b.prototype.domain.call(this,a))},c.prototype.copy=function(){return new c(this._d3Scale.copy())},c.prototype._defaultExtent=function(){var b=(new Date).valueOf(),c=b-a.MILLISECONDS_IN_ONE_DAY;return[c,b]},c}(a.Abstract.QuantitativeScale);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 Quantitative 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),this._resetScale(),this)},b.prototype.scaleType=function(a){return null==a?this._scaleType:(this._scaleType=a,this._resetScale(),this)},b.prototype._resetScale=function(){this._d3Scale=b.getD3InterpolatedScale(this._colorRange,this._scaleType),this._autoDomainIfAutomaticMode(),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.prototype.autoDomain=function(){var a=this._getAllExtents();return a.length>0&&this._setDomain([d3.min(a,function(a){return a[0]}),d3.max(a,function(a){return a[1]})]),this},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.QuantitativeScale);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;if(this.rescaleInProgress=!1,null==a)throw new Error("ScaleDomainCoordinator requires scales to coordinate");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 Plottable;!function(a){!function(a){var b=function(){function a(a){this.key=a}return a.prototype.remove=function(){null!=this.renderArea&&this.renderArea.remove()},a.prototype.draw=function(){throw new Error("Abstract Method Not Implemented")},a}();a._Drawer=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.apply(this,arguments)}return __extends(b,a),b.prototype.draw=function(a,b){var c="rect",d=this.renderArea.selectAll(c).data(a);d.enter().append(c),d.attr(b),d.exit().remove()},b}(a.Abstract._Drawer);b.Rect=c}(a._Drawer||(a._Drawer={}));a._Drawer}(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(c){function d(b,d,e){"undefined"==typeof e&&(e=a.Formatters.identity());var f=this;if(c.call(this),this._width="auto",this._height="auto",this._endTickLength=5,this._tickLength=5,this._tickLabelPadding=10,this._gutter=15,this._showEndTickLabels=!1,null==b||null==d)throw new Error("Axis requires a scale and orientation");this._scale=b,this.orient(d),this.classed("axis",!0),this._isHorizontal()?this.classed("x-axis",!0):this.classed("y-axis",!0),this.formatter(e),this._scale.broadcaster.registerListener(this,function(){return f._render()})}return __extends(d,c),d.prototype.remove=function(){c.prototype.remove.call(this),this._scale.broadcaster.deregisterListener(this)},d.prototype._isHorizontal=function(){return"top"===this._orientation||"bottom"===this._orientation},d.prototype._computeWidth=function(){return this._computedWidth=this._maxLabelTickLength(),this._computedWidth},d.prototype._computeHeight=function(){return this._computedHeight=this._maxLabelTickLength(),this._computedHeight},d.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+this._gutter),c=0):("auto"===this._width&&(null==this._computedWidth&&this._computeWidth(),c=this._computedWidth+this._gutter),d=0),{width:c,height:d,wantsWidth:!this._isHorizontal()&&c>a,wantsHeight:this._isHorizontal()&&d>b}},d.prototype._isFixedHeight=function(){return this._isHorizontal()},d.prototype._isFixedWidth=function(){return!this._isHorizontal()},d.prototype._computeLayout=function(a,b,d,e){c.prototype._computeLayout.call(this,a,b,d,e),this._scale.range(this._isHorizontal()?[0,this.availableWidth]:[this.availableHeight,0])},d.prototype._setup=function(){c.prototype._setup.call(this),this._tickMarkContainer=this.content.append("g").classed(d.TICK_MARK_CLASS+"-container",!0),this._tickLabelContainer=this.content.append("g").classed(d.TICK_LABEL_CLASS+"-container",!0),this._baseline=this.content.append("line").classed("baseline",!0)},d.prototype._getTickValues=function(){return[]},d.prototype._doRender=function(){var a=this._getTickValues(),b=this._tickMarkContainer.selectAll("."+d.TICK_MARK_CLASS).data(a);b.enter().append("line").classed(d.TICK_MARK_CLASS,!0),b.attr(this._generateTickMarkAttrHash()),d3.select(b[0][0]).classed(d.END_TICK_MARK_CLASS,!0).attr(this._generateTickMarkAttrHash(!0)),d3.select(b[0][a.length-1]).classed(d.END_TICK_MARK_CLASS,!0).attr(this._generateTickMarkAttrHash(!0)),b.exit().remove(),this._baseline.attr(this._generateBaselineAttrHash())},d.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},d.prototype._generateTickMarkAttrHash=function(a){var b=this;"undefined"==typeof a&&(a=!1);var c={x1:0,y1:0,x2:0,y2:0},d=function(a){return b._scale.scale(a)};this._isHorizontal()?(c.x1=d,c.x2=d):(c.y1=d,c.y2=d);var e=a?this._endTickLength:this._tickLength;switch(this._orientation){case"bottom":c.y2=e;break;case"top":c.y1=this.availableHeight,c.y2=this.availableHeight-e;break;case"left":c.x1=this.availableWidth,c.x2=this.availableWidth-e;break;case"right":c.x2=e}return c},d.prototype._invalidateLayout=function(){this._computedWidth=null,this._computedHeight=null,c.prototype._invalidateLayout.call(this)},d.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},d.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},d.prototype.formatter=function(a){return void 0===a?this._formatter:(this._formatter=a,this._invalidateLayout(),this)},d.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},d.prototype.endTickLength=function(a){if(null==a)return this._endTickLength;if(0>a)throw new Error("end tick length must be positive");return this._endTickLength=a,this._invalidateLayout(),this},d.prototype._maxLabelTickLength=function(){return this.showEndTickLabels()?Math.max(this.tickLength(),this.endTickLength()):this.tickLength()},d.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},d.prototype.gutter=function(a){if(null==a)return this._gutter;if(0>a)throw new Error("gutter size must be positive");return this._gutter=a,this._invalidateLayout(),this},d.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
+},d.prototype.showEndTickLabels=function(a){return null==a?this._showEndTickLabels:(this._showEndTickLabels=a,this._render(),this)},d.prototype._hideEndTickLabels=function(){var a=this,c=this.element.select(".bounding-box")[0][0].getBoundingClientRect(),d=function(b){return Math.floor(c.left)<=Math.ceil(b.left)&&Math.floor(c.top)<=Math.ceil(b.top)&&Math.floor(b.right)<=Math.ceil(c.left+a.availableWidth)&&Math.floor(b.bottom)<=Math.ceil(c.top+a.availableHeight)},e=this._tickLabelContainer.selectAll("."+b.Axis.TICK_LABEL_CLASS);if(0!==e[0].length){var 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")}},d.prototype._hideOverlappingTickLabels=function(){var c,d=this._tickLabelContainer.selectAll("."+b.Axis.TICK_LABEL_CLASS).filter(function(){return"visible"===d3.select(this).style("visibility")});d.each(function(){var b=this.getBoundingClientRect(),d=d3.select(this);null!=c&&a.Util.DOM.boxesOverlap(b,c)?d.style("visibility","hidden"):(c=b,d.style("visibility","visible"))})},d.END_TICK_MARK_CLASS="end-tick-mark",d.TICK_MARK_CLASS="tick-mark",d.TICK_LABEL_CLASS="tick-label",d}(b.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){if(c=c.toLowerCase(),"top"!==c&&"bottom"!==c)throw new Error("unsupported orientation: "+c);b.call(this,a,c),this.classed("time-axis",!0),this.tickLabelPadding(5)}return __extends(c,b),c.prototype._computeHeight=function(){if(null!==this._computedHeight)return this._computedHeight;var a=this._measureTextHeight(this._majorTickLabels)+this._measureTextHeight(this._minorTickLabels);return this.tickLength(a),this.endTickLength(a),this._computedHeight=this._maxLabelTickLength()+2*this.tickLabelPadding(),this._computedHeight},c.prototype.calculateWorstWidth=function(a,b){var c=new Date(9999,8,29,12,59,9999);return this.measurer(d3.time.format(b)(c)).width},c.prototype.getIntervalLength=function(a){var b=this._scale.domain()[0],c=a.timeUnit.offset(b,a.step);if(c>this._scale.domain()[1])return this.availableWidth;var d=Math.abs(this._scale.scale(c)-this._scale.scale(b));return d},c.prototype.isEnoughSpace=function(a,b){var c=this.calculateWorstWidth(a,b.formatString)+2*this.tickLabelPadding(),d=Math.min(this.getIntervalLength(b),this.availableWidth);return d>c},c.prototype._setup=function(){b.prototype._setup.call(this),this._majorTickLabels=this.content.append("g").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),this._minorTickLabels=this.content.append("g").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),this.measurer=a.Util.Text.getTextMeasurer(this._majorTickLabels.append("text"))},c.prototype.getTickLevel=function(){for(var b=0;b=c.minorIntervals.length&&(a.Util.Methods.warn("zoomed out too far: could not find suitable interval to display labels"),b=c.minorIntervals.length-1),b},c.prototype._getTickIntervalValues=function(a){return this._scale.tickInterval(a.timeUnit,a.step)},c.prototype._getTickValues=function(){var a=this.getTickLevel(),b=this._getTickIntervalValues(c.minorIntervals[a]),d=this._getTickIntervalValues(c.majorIntervals[a]);return b.concat(d)},c.prototype._measureTextHeight=function(b){var c=b.append("g").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),d=this.measurer(a.Util.Text.HEIGHT_TEXT).height;return c.remove(),d},c.prototype.renderTickLabels=function(b,c,d){var e=this;b.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).remove();var f=this._scale.tickInterval(c.timeUnit,c.step);f.splice(0,0,this._scale.domain()[0]),f.push(this._scale.domain()[1]);var g=1===c.step,h=[];g?f.map(function(a,b){b+1>=f.length||h.push(new Date((f[b+1].valueOf()-f[b].valueOf())/2+f[b].valueOf()))}):h=f,h=h.filter(function(a){return e.canFitLabelFilter(b,a,d3.time.format(c.formatString)(a),g)});var i=b.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).data(h,function(a){return a.valueOf()}),j=i.enter().append("g").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0);j.append("text");var k=g?0:this.tickLabelPadding(),l="bottom"===this._orientation?this._maxLabelTickLength()/2*d:this.availableHeight-this._maxLabelTickLength()/2*d+2*this.tickLabelPadding(),m=i.selectAll("text");m.size()>0&&a.Util.DOM.translate(m,k,l),i.exit().remove(),i.attr("transform",function(a){return"translate("+e._scale.scale(a)+",0)"});var n=g?"middle":"start";i.selectAll("text").text(function(a){return d3.time.format(c.formatString)(a)}).style("text-anchor",n)},c.prototype.canFitLabelFilter=function(a,b,c,d){var e,f,g=this.measurer(c).width+this.tickLabelPadding();return d?(e=this._scale.scale(b)+g/2,f=this._scale.scale(b)-g/2):(e=this._scale.scale(b)+g,f=this._scale.scale(b)),e0},c.prototype.adjustTickLength=function(b,c){var d=this._getTickIntervalValues(c),e=this._tickMarkContainer.selectAll("."+a.Abstract.Axis.TICK_MARK_CLASS).filter(function(a){return d.map(function(a){return a.valueOf()}).indexOf(a.valueOf())>=0});"top"===this._orientation&&(b=this.availableHeight-b),e.attr("y2",b)},c.prototype.generateLabellessTicks=function(b){if(!(0>b)){var d=this._getTickIntervalValues(c.minorIntervals[b]),e=this._getTickValues().concat(d),f=this._tickMarkContainer.selectAll("."+a.Abstract.Axis.TICK_MARK_CLASS).data(e);f.enter().append("line").classed(a.Abstract.Axis.TICK_MARK_CLASS,!0),f.attr(this._generateTickMarkAttrHash()),f.exit().remove(),this.adjustTickLength(this.tickLabelPadding(),c.minorIntervals[b])}},c.prototype._doRender=function(){b.prototype._doRender.call(this);var a=this.getTickLevel();this.renderTickLabels(this._minorTickLabels,c.minorIntervals[a],1),this.renderTickLabels(this._majorTickLabels,c.majorIntervals[a],2);var d=this._scale.domain(),e=this._scale.scale(d[1])-this._scale.scale(d[0]);1.5*this.getIntervalLength(c.minorIntervals[a])>=e&&this.generateLabellessTicks(a-1),this.adjustTickLength(this._maxLabelTickLength()/2,c.minorIntervals[a]),this.adjustTickLength(this._maxLabelTickLength(),c.majorIntervals[a])},c.minorIntervals=[{timeUnit:d3.time.second,step:1,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.second,step:5,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.second,step:10,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.second,step:15,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.second,step:30,formatString:"%I:%M:%S %p"},{timeUnit:d3.time.minute,step:1,formatString:"%I:%M %p"},{timeUnit:d3.time.minute,step:5,formatString:"%I:%M %p"},{timeUnit:d3.time.minute,step:10,formatString:"%I:%M %p"},{timeUnit:d3.time.minute,step:15,formatString:"%I:%M %p"},{timeUnit:d3.time.minute,step:30,formatString:"%I:%M %p"},{timeUnit:d3.time.hour,step:1,formatString:"%I %p"},{timeUnit:d3.time.hour,step:3,formatString:"%I %p"},{timeUnit:d3.time.hour,step:6,formatString:"%I %p"},{timeUnit:d3.time.hour,step:12,formatString:"%I %p"},{timeUnit:d3.time.day,step:1,formatString:"%a %e"},{timeUnit:d3.time.day,step:1,formatString:"%e"},{timeUnit:d3.time.month,step:1,formatString:"%B"},{timeUnit:d3.time.month,step:1,formatString:"%b"},{timeUnit:d3.time.month,step:3,formatString:"%B"},{timeUnit:d3.time.month,step:6,formatString:"%B"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1,formatString:"%y"},{timeUnit:d3.time.year,step:5,formatString:"%Y"},{timeUnit:d3.time.year,step:25,formatString:"%Y"},{timeUnit:d3.time.year,step:50,formatString:"%Y"},{timeUnit:d3.time.year,step:100,formatString:"%Y"},{timeUnit:d3.time.year,step:200,formatString:"%Y"},{timeUnit:d3.time.year,step:500,formatString:"%Y"},{timeUnit:d3.time.year,step:1e3,formatString:"%Y"}],c.majorIntervals=[{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.day,step:1,formatString:"%B %e, %Y"},{timeUnit:d3.time.month,step:1,formatString:"%B %Y"},{timeUnit:d3.time.month,step:1,formatString:"%B %Y"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1,formatString:"%Y"},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""},{timeUnit:d3.time.year,step:1e5,formatString:""}],c}(a.Abstract.Axis);b.Time=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(c,d,e){"undefined"==typeof e&&(e=a.Formatters.general(3,!1)),b.call(this,c,d,e),this.tickLabelPositioning="center",this.showFirstTickLabel=!1,this.showLastTickLabel=!1}return __extends(c,b),c.prototype._setup=function(){b.prototype._setup.call(this),this.measurer=a.Util.Text.getTextMeasurer(this._tickLabelContainer.append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0))},c.prototype._computeWidth=function(){var a=this,b=this._getTickValues(),c=b.map(function(b){var c=a._formatter(b);return a.measurer(c).width}),d=d3.max(c);return this._computedWidth="center"===this.tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+d:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+d),this._computedWidth},c.prototype._computeHeight=function(){var b=this.measurer(a.Util.Text.HEIGHT_TEXT).height;return this._computedHeight="center"===this.tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+b:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+b),this._computedHeight},c.prototype._getTickValues=function(){return this._scale.ticks()},c.prototype._doRender=function(){b.prototype._doRender.call(this);var c={x:0,y:0,dx:"0em",dy:"0.3em"},d=this._maxLabelTickLength(),e=this.tickLabelPadding(),f="middle",g=0,h=0,i=0,j=0;if(this._isHorizontal())switch(this.tickLabelPositioning){case"left":f="end",g=-e,j=e;break;case"center":j=d+e;break;case"right":f="start",g=e,j=e}else switch(this.tickLabelPositioning){case"top":c.dy="-0.3em",i=e,h=-e;break;case"center":i=d+e;break;case"bottom":c.dy="1em",i=e,h=e}var k=this._generateTickMarkAttrHash();switch(this._orientation){case"bottom":c.x=k.x1,c.dy="0.95em",h=k.y1+j;break;case"top":c.x=k.x1,c.dy="-.25em",h=k.y1-j;break;case"left":f="end",g=k.x1-i,c.y=k.y1;break;case"right":f="start",g=k.x1+i,c.y=k.y1}var l=this._getTickValues(),m=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).data(l);m.enter().append("text").classed(a.Abstract.Axis.TICK_LABEL_CLASS,!0),m.exit().remove(),m.style("text-anchor",f).style("visibility","visible").attr(c).text(this._formatter);var n="translate("+g+", "+h+")";this._tickLabelContainer.attr("transform",n),this.showEndTickLabels()||this._hideEndTickLabels(),this._hideOverlappingTickLabels()},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.showEndTickLabel=function(a,b){if(this._isHorizontal()&&"left"===a||!this._isHorizontal()&&"bottom"===a)return void 0===b?this.showFirstTickLabel:(this.showFirstTickLabel=b,this._render(),this);if(this._isHorizontal()&&"right"===a||!this._isHorizontal()&&"top"===a)return void 0===b?this.showLastTickLabel:(this.showLastTickLabel=b,this._render(),this);throw new Error("Attempt to show "+a+" tick label on a "+(this._isHorizontal()?"horizontal":"vertical")+" axis")},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(c,d,e){"undefined"==typeof d&&(d="bottom"),"undefined"==typeof e&&(e=a.Formatters.identity());var f=this;if(b.call(this,c,d,e),this.classed("category-axis",!0),"bands"!==c.rangeType())throw new Error("Only rangeBands category axes are implemented");this._scale.broadcaster.registerListener(this,function(){return f._invalidateLayout()})}return __extends(c,b),c.prototype._setup=function(){b.prototype._setup.call(this),this.measurer=new a.Util.Text.CachingCharacterMeasurer(this._tickLabelContainer.append("text"))},c.prototype._requestedSpace=function(a,b){var c=this._isHorizontal()?0:this._maxLabelTickLength()+this.tickLabelPadding()+this.gutter(),d=this._isHorizontal()?this._maxLabelTickLength()+this.tickLabelPadding()+this.gutter():0;if(0===this._scale.domain().length)return{width:0,height:0,wantsWidth:!1,wantsHeight:!1};var e=this._scale.copy();e.range(this._isHorizontal()?[0,a]:[b,0]);var f=this.measureTicks(a,b,e,this._scale.domain());return{width:f.usedWidth+c,height:f.usedHeight+d,wantsWidth:!f.textFits,wantsHeight:!f.textFits}},c.prototype._getTickValues=function(){return this._scale.domain()},c.prototype.measureTicks=function(b,c,d,e){var f="string"!=typeof e[0],g=this,h=[],i=function(a){return g.measurer.measure(a)},j=f?function(a){return e.each(a)}:function(a){return e.forEach(a)};j(function(e){var j,k=d.fullBandStartAndWidth(e)[1],l=g._isHorizontal()?k:b-g._maxLabelTickLength()-g.tickLabelPadding(),m=g._isHorizontal()?c-g._maxLabelTickLength()-g.tickLabelPadding():k,n=g._formatter;if(f){var o=d3.select(this),p={left:"right",right:"left",top:"center",bottom:"center"},q={left:"center",right:"center",top:"bottom",bottom:"top"};j=a.Util.Text.writeText(n(e),l,m,i,!0,{g:o,xAlign:p[g._orientation],yAlign:q[g._orientation]})}else j=a.Util.Text.writeText(n(e),l,m,i,!0);h.push(j)});var k=this._isHorizontal()?d3.sum:d3.max,l=this._isHorizontal()?d3.max:d3.sum;return{textFits:h.every(function(a){return a.textFits}),usedWidth:k(h,function(a){return a.usedWidth}),usedHeight:l(h,function(a){return a.usedHeight})}},c.prototype._doRender=function(){var c=this;b.prototype._doRender.call(this);var d=this._tickLabelContainer.selectAll("."+a.Abstract.Axis.TICK_LABEL_CLASS).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(a.Abstract.Axis.TICK_LABEL_CLASS,!0),d.exit().remove(),d.attr("transform",e),d.text(""),this.measureTicks(this.availableWidth,this.availableHeight,this._scale,d);var f=this._isHorizontal()?[this._scale.rangeBand()/2,0]:[0,this._scale.rangeBand()/2],g="right"===this._orientation?this._maxLabelTickLength()+this.tickLabelPadding():0,h="bottom"===this._orientation?this._maxLabelTickLength()+this.tickLabelPadding():0;a.Util.DOM.translate(this._tickLabelContainer,g,h),a.Util.DOM.translate(this._tickMarkContainer,f[0],f[1])},c.prototype._computeLayout=function(a,c,d,e){return this.measurer.clear(),b.prototype._computeLayout.call(this,a,c,d,e)},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.text(a),c=c.toLowerCase(),"vertical-left"===c&&(c="left"),"vertical-right"===c&&(c="right"),"horizontal"!==c&&"left"!==c&&"right"!==c)throw new Error(c+" is not a valid orientation for LabelComponent");this.orientation=c,this.xAlign("center").yAlign("center"),this._fixedHeightFlag=!0,this._fixedWidthFlag=!0}return __extends(c,b),c.prototype.xAlign=function(a){var c=a.toLowerCase();return b.prototype.xAlign.call(this,c),this.xAlignment=c,this},c.prototype.yAlign=function(a){var c=a.toLowerCase();return b.prototype.yAlign.call(this,c),this.yAlignment=c,this},c.prototype._requestedSpace=function(a,b){var c=this.measurer(this._text),d="horizontal"===this.orientation?c.width:c.height,e="horizontal"===this.orientation?c.height:c.width;return{width:d,height:e,wantsWidth:d>a,wantsHeight:e>b}},c.prototype._setup=function(){b.prototype._setup.call(this),this.textContainer=this.content.append("g"),this.measurer=a.Util.Text.getTextMeasurer(this.textContainer.append("text")),this.text(this._text)},c.prototype.text=function(a){return void 0===a?this._text:(this._text=a,this._invalidateLayout(),this)},c.prototype._doRender=function(){b.prototype._doRender.call(this),this.textContainer.text("");var c="horizontal"===this.orientation?this.availableWidth:this.availableHeight,d=a.Util.Text.getTruncatedText(this._text,c,this.measurer);"horizontal"===this.orientation?a.Util.Text.writeLineHorizontally(d,this.textContainer,this.availableWidth,this.availableHeight,this.xAlignment,this.yAlignment):a.Util.Text.writeLineVertically(d,this.textContainer,this.availableWidth,this.availableHeight,this.xAlignment,this.yAlignment,this.orientation)},c.prototype._computeLayout=function(c,d,e,f){return this.measurer=a.Util.Text.getTextMeasurer(this.textContainer.append("text")),b.prototype._computeLayout.call(this,c,d,e,f),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),this._fixedWidthFlag=!0,this._fixedHeightFlag=!0}return __extends(c,b),c.prototype.remove=function(){b.prototype.remove.call(this),null!=this.colorScale&&this.colorScale.broadcaster.deregisterListener(this)},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;this.nRowsDrawn=Math.min(g,Math.floor(this.availableHeight/f))},c.prototype._requestedSpace=function(b,d){var e=this.measureTextHeight(),f=this.colorScale.domain().length,g=Math.min(f,Math.floor((d-2*c.MARGIN)/e)),h=this.content.append("g").classed(c.SUBELEMENT_CLASS,!0),i=a.Util.Text.getTextMeasurer(h.append("text")),j=d3.max(this.colorScale.domain(),function(a){return i(a).width});h.remove(),j=void 0===j?0:j;var k=0===g?0:j+e+2*c.MARGIN,l=0===g?0:f*e+2*c.MARGIN;return{width:k,height:l,wantsWidth:k>b,wantsHeight:l>d}},c.prototype.measureTextHeight=function(){var b=this.content.append("g").classed(c.SUBELEMENT_CLASS,!0),d=a.Util.Text.getTextMeasurer(b.append("text"))(a.Util.Text.HEIGHT_TEXT).height;return 0===d&&(d=1),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=.3*e,h=this.content.selectAll("."+c.SUBELEMENT_CLASS).data(d,function(a){return a}),i=h.enter().append("g").classed(c.SUBELEMENT_CLASS,!0);i.append("circle"),i.append("g").classed("text-container",!0),h.exit().remove(),h.selectAll("circle").attr("cx",e/2).attr("cy",e/2).attr("r",g).attr("fill",this.colorScale._d3Scale),h.selectAll("g.text-container").text("").attr("transform","translate("+e+", 0)").each(function(b){var c=d3.select(this),d=a.Util.Text.getTextMeasurer(c.append("text")),e=a.Util.Text.getTruncatedText(b,f,d),g=d(e);a.Util.Text.writeLineHorizontally(e,c,g.width,g.height)}),h.attr("transform",function(a){return"translate("+c.MARGIN+","+(d.indexOf(a)*e+c.MARGIN)+")"}),this.updateClasses(),this.updateListeners()},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;if(a.call(this),null==b&&null==c)throw new Error("Gridlines must have at least one scale");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.remove=function(){return a.prototype.remove.call(this),null!=this.xScale&&this.xScale.broadcaster.deregisterListener(this),null!=this.yScale&&this.yScale.broadcaster.deregisterListener(this),this},b.prototype._setup=function(){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)},b.prototype._doRender=function(){a.prototype._doRender.call(this),this.redrawXLines(),this.redrawYLines()},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).classed("zeroline",function(a){return 0===a}),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).classed("zeroline",function(a){return 0===a}),d.exit().remove()}},b}(a.Abstract.Component);b.Gridlines=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,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("scatter-plot",!0),this.project("r",3),this.project("opacity",.6),this.project("fill",function(){return a.Core.Colors.INDIGO})}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-plot",!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(c){function d(b,d,e){c.call(this,b,d,e),this._baselineValue=0,this._barAlignmentFactor=0,this._animators={"bars-reset":new a.Animator.Null,bars:new a.Animator.IterativeDelay,baseline:new a.Animator.Null},this.classed("bar-plot",!0),this.project("fill",function(){return a.Core.Colors.INDIGO}),this.baseline(this._baselineValue)}return __extends(d,c),d.prototype._setup=function(){c.prototype._setup.call(this),this._baseline=this.renderArea.append("line").classed("baseline",!0),this._bars=this.renderArea.selectAll("rect").data([])},d.prototype._paint=function(){c.prototype._paint.call(this),this._bars=this.renderArea.selectAll("rect").data(this._dataSource.data()),this._bars.enter().append("rect");var a=this._isVertical?this.yScale:this.xScale,b=a.scale(this._baselineValue),d=this._isVertical?"y":"x",e=this._isVertical?"height":"width";if(this._dataChanged&&this._animate){var f=this._generateAttrToProjector();f[d]=function(){return b},f[e]=function(){return 0},this._applyAnimatedAttributes(this._bars,"bars-reset",f)}var g=this._generateAttrToProjector();null!=g.fill&&this._bars.attr("fill",g.fill),this._applyAnimatedAttributes(this._bars,"bars",g),this._bars.exit().remove();var h={x1:this._isVertical?0:b,y1:this._isVertical?b:0,x2:this._isVertical?this.availableWidth:b,y2:this._isVertical?b:this.availableHeight};this._applyAnimatedAttributes(this._baseline,"baseline",h)},d.prototype.baseline=function(a){return this._baselineValue=a,this._updateXDomainer(),this._updateYDomainer(),this._render(),this},d.prototype.barAlignment=function(a){var b=a.toLowerCase(),c=this.constructor._BarAlignmentToFactor;if(void 0===c[b])throw new Error("unsupported bar alignment");return this._barAlignmentFactor=c[b],this._render(),this},d.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")},d.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},d.prototype.deselectAll=function(){return this._isSetup&&this._bars.classed("selected",!1),this},d.prototype._updateDomainer=function(a){if(a instanceof b.QuantitativeScale){var c=a;c._userSetDomainer||(null!=this._baselineValue?c.domainer().addPaddingException(this._baselineValue,"BAR_PLOT+"+this._plottableID).addIncludedValue(this._baselineValue,"BAR_PLOT+"+this._plottableID):c.domainer().removePaddingException("BAR_PLOT+"+this._plottableID).removeIncludedValue("BAR_PLOT+"+this._plottableID),c.domainer().pad()),c._autoDomainIfAutomaticMode()}},d.prototype._updateYDomainer=function(){this._isVertical?this._updateDomainer(this.yScale):c.prototype._updateYDomainer.call(this)},d.prototype._updateXDomainer=function(){this._isVertical?c.prototype._updateXDomainer.call(this):this._updateDomainer(this.xScale)},d.prototype._generateAttrToProjector=function(){var b=this,e=c.prototype._generateAttrToProjector.call(this),f=this._isVertical?this.yScale:this.xScale,g=this._isVertical?this.xScale:this.yScale,h=this._isVertical?"y":"x",i=this._isVertical?"x":"y",j=g instanceof a.Scale.Ordinal&&"bands"===g.rangeType(),k=f.scale(this._baselineValue);if(null==e.width){var l=j?g.rangeBand():d.DEFAULT_WIDTH;e.width=function(){return l}}var m=e[i],n=e.width;if(j){var o=g.rangeBand();e[i]=function(a,b){return m(a,b)-n(a,b)/2+o/2}}else e[i]=function(a,c){return m(a,c)-n(a,c)*b._barAlignmentFactor};var p=e[h];return e[h]=function(a,b){var c=p(a,b);return c>k?k:c},e.height=function(a,b){return Math.abs(k-p(a,b))},e},d.DEFAULT_WIDTH=10,d._BarAlignmentToFactor={},d}(b.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._isVertical=!0}return __extends(b,a),b.prototype._updateYDomainer=function(){this._updateDomainer(this.yScale)},b._BarAlignmentToFactor={left:0,center:.5,right:1},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.isVertical=!1}return __extends(b,a),b.prototype._updateXDomainer=function(){this._updateDomainer(this.xScale)},b.prototype._generateAttrToProjector=function(){var b=a.prototype._generateAttrToProjector.call(this),c=b.width;return b.width=b.height,b.height=c,b},b._BarAlignmentToFactor={top:0,center:.5,bottom:1},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={"line-reset":new a.Animator.Null,line:(new a.Animator.Default).duration(600).easing("exp-in-out")},this.classed("line-plot",!0),this.project("stroke",function(){return a.Core.Colors.INDIGO}),this.project("stroke-width",function(){return"2px"})}return __extends(c,b),c.prototype._setup=function(){b.prototype._setup.call(this),this.linePath=this.renderArea.append("path").classed("line",!0)},c.prototype._getResetYFunction=function(){var a=this.yScale.domain(),b=Math.max(a[0],a[1]),c=Math.min(a[0],a[1]),d=0;0>b?d=b:c>0&&(d=c);var e=this.yScale.scale(d);return function(){return e}},c.prototype._generateAttrToProjector=function(){function a(a){return-1===d.indexOf(a)}var c=b.prototype._generateAttrToProjector.call(this),d=this._wholeDatumAttributes(),e=d3.keys(c).filter(a);return e.forEach(function(a){var b=c[a];c[a]=function(a,c){return a.length>0?b(a[0],c):null}}),c},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this._generateAttrToProjector(),c=a.x,d=a.y;delete a.x,delete a.y,this.linePath.datum(this._dataSource.data()),this._dataChanged&&(a.d=d3.svg.line().x(c).y(this._getResetYFunction()),this._applyAnimatedAttributes(this.linePath,"line-reset",a)),a.d=d3.svg.line().x(c).y(d),this._applyAnimatedAttributes(this.linePath,"line",a)},c.prototype._wholeDatumAttributes=function(){return["x","y"]},c}(a.Abstract.XYPlot);b.Line=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.classed("area-plot",!0),this.project("y0",0,e),this.project("fill",function(){return a.Core.Colors.INDIGO}),this.project("fill-opacity",function(){return.25}),this.project("stroke",function(){return a.Core.Colors.INDIGO}),this._animators["area-reset"]=new a.Animator.Null,this._animators.area=(new a.Animator.Default).duration(600).easing("exp-in-out")}return __extends(c,b),c.prototype._setup=function(){b.prototype._setup.call(this),this.areaPath=this.renderArea.append("path").classed("area",!0)},c.prototype._onDataSourceUpdate=function(){b.prototype._onDataSourceUpdate.call(this),null!=this.yScale&&this._updateYDomainer()},c.prototype._updateYDomainer=function(){b.prototype._updateYDomainer.call(this);var a=this.yScale,c=this._projectors.y0,d=null!=c?c.accessor:null,e=null!=d?this.dataSource()._getExtent(d):[],f=2===e.length&&e[0]===e[1]?e[0]:null;a._userSetDomainer||(null!=f?a.domainer().addPaddingException(f,"AREA_PLOT+"+this._plottableID):a.domainer().removePaddingException("AREA_PLOT+"+this._plottableID),a._autoDomainIfAutomaticMode())},c.prototype.project=function(a,c,d){return b.prototype.project.call(this,a,c,d),"y0"===a&&this._updateYDomainer(),this},c.prototype._getResetYFunction=function(){return this._generateAttrToProjector().y0},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._dataChanged&&(a.d=d3.svg.area().x(c).y0(d).y1(this._getResetYFunction()),this._applyAnimatedAttributes(this.areaPath,"area-reset",a)),a.d=d3.svg.area().x(c).y0(d).y1(e),this._applyAnimatedAttributes(this.areaPath,"area",a)},c.prototype._wholeDatumAttributes=function(){var a=b.prototype._wholeDatumAttributes.call(this);return a.push("y0"),a},c}(b.Line);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(c){function d(b,d){c.call(this,b,d),this._baselineValue=0,this._barAlignmentFactor=0,this._animators={"bars-reset":new a.Animator.Null,bars:new a.Animator.IterativeDelay,baseline:new a.Animator.Null},this.classed("bar-plot",!0),this.project("fill",function(){return a.Core.Colors.INDIGO}),this.baseline(this._baselineValue)}return __extends(d,c),d.prototype._getDrawer=function(b){return new a._Drawer.Rect(b)},d.prototype._setup=function(){c.prototype._setup.call(this),this._baseline=this.renderArea.append("line").classed("baseline",!0)},d.prototype._paint=function(){c.prototype._paint.call(this);var a=this._isVertical?this.yScale:this.xScale,b=a.scale(this._baselineValue),d={x1:this._isVertical?0:b,y1:this._isVertical?b:0,x2:this._isVertical?this.availableWidth:b,y2:this._isVertical?b:this.availableHeight};this._applyAnimatedAttributes(this._baseline,"baseline",d)},d.prototype.baseline=function(a){return b.BarPlot.prototype.baseline.apply(this,[a])},d.prototype._updateDomainer=function(a){return b.BarPlot.prototype._updateDomainer.apply(this,[a])},d.prototype._generateAttrToProjector=function(){return b.BarPlot.prototype._generateAttrToProjector.apply(this)},d.prototype._updateXDomainer=function(){return b.BarPlot.prototype._updateXDomainer.apply(this)},d.prototype._updateYDomainer=function(){return b.BarPlot.prototype._updateYDomainer.apply(this)},d._barAlignmentToFactor={},d.DEFAULT_WIDTH=10,d}(b.NewStylePlot);b.NewStyleBarPlot=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){b.call(this,c,d),this._isVertical=!0,this.innerScale=new a.Scale.Ordinal}return __extends(c,b),c.prototype._generateAttrToProjector=function(){var a=this,c=b.prototype._generateAttrToProjector.call(this),d=c.width;return this.innerScale.range([0,d(null,0)]),c.width=function(){return a.innerScale.rangeBand()},c.x=function(a){return a._PLOTTABLE_PROTECTED_FIELD_X},c},c.prototype.cluster=function(b){var c=this;this.innerScale.domain(this._datasetKeysInOrder);var d=this._getDatasetsInOrder().map(function(a){return a.data().length});a.Util.Methods.uniqNumbers(d).length>1&&a.Util.Methods.warn("Warning: Attempting to cluster data when datasets are of unequal length");var e={};return this._datasetKeysInOrder.forEach(function(a){var d=c._key2DatasetDrawerKey[a].dataset.data(),f=d.map(function(a){return b(a)});e[a]=d.map(function(b,d){return b._PLOTTABLE_PROTECTED_FIELD_X=c.xScale.scale(f[d])+c.innerScale.scale(a),b})}),e},c.prototype._paint=function(){b.prototype._paint.call(this);var a=this._projectors.x.accessor,c=this._generateAttrToProjector(),d=this.cluster(a);this._getDrawersInOrder().forEach(function(a){return a.draw(d[a.key],c)})},c.DEFAULT_WIDTH=10,c}(a.Abstract.NewStyleBarPlot);b.ClusteredBar=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){b.call(this,a,c),this.stackedData=[],this._isVertical=!0,this._baselineValue=0,this.stackedExtent=[]}return __extends(c,b),c.prototype._addDataset=function(a,c){b.prototype._addDataset.call(this,a,c),this.stackedData=this.stack(this._projectors.y.accessor)},c.prototype._updateAllProjectors=function(){b.prototype._updateAllProjectors.call(this),null!=this.yScale&&(this._isAnchored&&this.stackedExtent.length>0?this.yScale.updateExtent(this._plottableID.toString(),"_PLOTTABLE_PROTECTED_FIELD_STACK_EXTENT",this.stackedExtent):this.yScale.removeExtent(this._plottableID.toString(),"_PLOTTABLE_PROTECTED_FIELD_STACK_EXTENT"))},c.prototype._generateAttrToProjector=function(){var a=b.prototype._generateAttrToProjector.call(this),c=this._isVertical?this.yScale:this.xScale,d=function(a){return c.scale(a._PLOTTABLE_PROTECTED_FIELD_Y0)},e=function(a){return c.scale(a._PLOTTABLE_PROTECTED_FIELD_Y)};return a.height=function(a){return Math.abs(e(a)-d(a))},a.y=function(a){return e(a)},a},c.prototype.stack=function(b){var c=d3.values(this._key2DatasetDrawerKey),d=c.map(function(a){return a.dataset.data().length});a.Util.Methods.uniqNumbers(d).length>1&&a.Util.Methods.warn("Warning: Attempting to stack data when datasets are of unequal length");var e=a.Util.Methods.createFilledArray(0,d[0]),f=this._getDatasetsInOrder().map(function(c){var d=c.data(),f=e.slice(),g=d.map(b);return g.some(function(a){return 0>a})&&a.Util.Methods.warn("Warning: Behavior for stacked bars undefined when data includes negative values"),e=a.Util.Methods.addArrays(f,g),d.map(function(a,b){return a._PLOTTABLE_PROTECTED_FIELD_Y0=f[b],a._PLOTTABLE_PROTECTED_FIELD_Y=e[b],a})});return this.stackedExtent=[0,d3.max(e)],this._onDataSourceUpdate(),f},c.prototype._paint=function(){var a=this,b=this._generateAttrToProjector();this._getDrawersInOrder().forEach(function(c,d){return c.draw(a.stackedData[d],b)})},c}(a.Abstract.NewStyleBarPlot);b.StackedBar=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(a){var b=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.Default);a.IterativeDelay=b}(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){if(null==a)throw new Error("Interactions require a component to listen to");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(b){function c(c,d,e){var f=this;b.call(this,c),null==d&&(d=new a.Scale.Linear),null==e&&(e=new a.Scale.Linear),this.xScale=d,this.yScale=e,this.zoom=d3.behavior.zoom(),this.zoom.x(this.xScale._d3Scale),this.zoom.y(this.yScale._d3Scale),this.zoom.on("zoom",function(){return f.rerenderZoomed()})}return __extends(c,b),c.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)},c.prototype._anchor=function(a){b.prototype._anchor.call(this,a),this.zoom(a)},c.prototype.rerenderZoomed=function(){var a=this.xScale._d3Scale.domain(),b=this.yScale._d3Scale.domain();this.xScale.domain(a),this.yScale.domain(b)},c}(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(b){function c(c){b.call(this,c),this.plotIsVertical=!0,this.currentBar=null,this._hoverMode="point",this.plotIsVertical=a.Plot.VerticalBar.prototype.isPrototypeOf(this.componentToListenTo)}return __extends(c,b),c.prototype._anchor=function(b){var c=this;this.dispatcher=new a.Dispatcher.Mouse(b),this.dispatcher.mousemove(function(a){var b=c.getHoveredBar(a);if(null==b)c._hoverOut();else{if(null!=c.currentBar){if(c.currentBar.node()===b.node())return;c._hoverOut()}c.componentToListenTo._bars.classed("not-hovered",!0).classed("hovered",!1),b.classed("not-hovered",!1).classed("hovered",!0),null!=c.hoverCallback&&c.hoverCallback(b.data()[0],b)}c.currentBar=b}),this.dispatcher.mouseout(function(){return c._hoverOut()}),this.dispatcher.connect()},c.prototype._hoverOut=function(){this.componentToListenTo._bars.classed("not-hovered hovered",!1),null!=this.unhoverCallback&&null!=this.currentBar&&this.unhoverCallback(this.currentBar.data()[0],this.currentBar),this.currentBar=null},c.prototype.getHoveredBar=function(a){if("point"===this._hoverMode)return this.componentToListenTo.selectBar(a.x,a.y,!1);var b={min:-1/0,max:1/0};return this.plotIsVertical?this.componentToListenTo.selectBar(a.x,b,!1):this.componentToListenTo.selectBar(b,a.y,!1)},c.prototype.hoverMode=function(a){if(null==a)return this._hoverMode;var b=a.toLowerCase();if("point"!==b&&"line"!==b)throw new Error(a+" is not a valid hover mode for Interaction.BarHover");return this._hoverMode=b,this},c.prototype.onHover=function(a){return this.hoverCallback=a,this},c.prototype.onUnhover=function(a){return this.unhoverCallback=a,this},c}(a.Abstract.Interaction);b.BarHover=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.dragstart=function(a){return void 0===a?this.ondragstart:(this.ondragstart=a,this)},b.prototype.drag=function(a){return void 0===a?this.ondrag:(this.ondrag=a,this)},b.prototype.dragend=function(a){return void 0===a?this.ondragend:(this.ondragend=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._doDragstart=function(){null!=this.ondragstart&&this.ondragstart({x:this.origin[0],y:this.origin[1]})},b.prototype._drag=function(){this.dragInitialized||(this.origin=[d3.event.x,d3.event.y],this.dragInitialized=!0,this._doDragstart()),this.location=[this.constrainX(d3.event.x),this.constrainY(d3.event.y)],this._doDrag()},b.prototype._doDrag=function(){if(null!=this.ondrag){var a={x:this.origin[0],y:this.origin[1]},b={x:this.location[0],y:this.location[1]};this.ondrag(a,b)}},b.prototype._dragend=function(){this.dragInitialized&&(this.dragInitialized=!1,this._doDragend())},b.prototype._doDragend=function(){if(null!=this.ondragend){var a={x:this.origin[0],y:this.origin[1]},b={x:this.location[0],y:this.location[1]};this.ondragend(a,b)}},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,g){return null==c||null==g?(f&&(null!=a&&a.domain(d),null!=b&&b.domain(e)),void(f=!f)):(f=!1,null!=a&&a.domain([a.invert(c.x),a.invert(g.x)]),null!=b&&b.domain([b.invert(g.y),b.invert(c.y)]),void this.clearBox())}var d=null!=a?a.domain():null,e=null!=b?b.domain():null,f=!1;return this.drag(c),this.dragend(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(a){var b=function(a){function b(){a.apply(this,arguments),this.boxIsDrawn=!1}return __extends(b,a),b.prototype._dragstart=function(){a.prototype._dragstart.call(this),this.clearBox()},b.prototype.clearBox=function(){return null!=this.dragBox?(this.dragBox.attr("height",0).attr("width",0),this.boxIsDrawn=!1,this):void 0},b.prototype.setBox=function(a,b,c,d){if(null!=this.dragBox){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.backgroundContainer;return this.dragBox=e.append("rect").classed(d,!0).attr("x",0).attr("y",0),this},b.CLASS_DRAG_BOX="drag-box",b}(a.Drag);a.DragBox=b}(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(a){var b=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.setBox=function(b,c){return a.prototype.setBox.call(this,b,c,0,this.componentToListenTo.availableHeight),this},b}(a.DragBox);a.XDragBox=b}(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(a){var b=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}(a.DragBox);a.XYDragBox=b}(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(a){var b=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.setBox=function(b,c){return a.prototype.setBox.call(this,0,this.componentToListenTo.availableWidth,b,c),this},b}(a.DragBox);a.YDragBox=b}(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(a){var b=function(a){function b(b){a.call(this),this._event2Callback={},this.connected=!1,this._target=b}return __extends(b,a),b.prototype.target=function(a){if(null==a)return this._target;var b=this.connected;return this.disconnect(),this._target=a,b&&this.connect(),this},b.prototype.getEventString=function(a){return a+".dispatcher"+this._plottableID},b.prototype.connect=function(){var a=this;if(this.connected)throw new Error("Can't connect dispatcher twice!");return this.connected=!0,Object.keys(this._event2Callback).forEach(function(b){var c=a._event2Callback[b];a._target.on(a.getEventString(b),c)}),this},b.prototype.disconnect=function(){var a=this;return this.connected=!1,Object.keys(this._event2Callback).forEach(function(b){a._target.on(a.getEventString(b),null)}),this},b}(a.PlottableObject);a.Dispatcher=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){var c=this;a.call(this,b),this._event2Callback.mouseover=function(){null!=c._mouseover&&c._mouseover(c.getMousePosition())},this._event2Callback.mousemove=function(){null!=c._mousemove&&c._mousemove(c.getMousePosition())},this._event2Callback.mouseout=function(){null!=c._mouseout&&c._mouseout(c.getMousePosition())}}return __extends(b,a),b.prototype.getMousePosition=function(){var a=d3.mouse(this._target.node());return{x:a[0],y:a[1]}},b.prototype.mouseover=function(a){return void 0===a?this._mouseover:(this._mouseover=a,this)},b.prototype.mousemove=function(a){return void 0===a?this._mousemove:(this._mousemove=a,this)},b.prototype.mouseout=function(a){return void 0===a?this._mouseout:(this._mouseout=a,this)},b}(a.Abstract.Dispatcher);b.Mouse=c}(a.Dispatcher||(a.Dispatcher={}));a.Dispatcher}(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.text(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.text(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.text(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 40f0b2988f..66d294da04 100644
Binary files a/plottable.zip and b/plottable.zip differ
diff --git a/src/core/component.ts b/src/core/component.ts
index bd5e40ef5e..691a00ca4a 100644
--- a/src/core/component.ts
+++ b/src/core/component.ts
@@ -332,7 +332,10 @@ export module Abstract {
private generateClipPath() {
// The clip path will prevent content from overflowing its component space.
- this.element.attr("clip-path", "url(#clipPath" + this._plottableID + ")");
+ // HACKHACK: IE <=9 does not respect the HTML base element in SVG.
+ // They don't need the current URL in the clip path reference.
+ var prefix = /MSIE [5-9]/.test(navigator.userAgent) ? "" : document.location.href;
+ this.element.attr("clip-path", "url(" + prefix + "#clipPath" + this._plottableID + ")");
var clipPathParent = this.boxContainer.append("clipPath")
.attr("id", "clipPath" + this._plottableID);
this.addBox("clip-rect", clipPathParent);
diff --git a/test/core/componentTests.ts b/test/core/componentTests.ts
index 765c616f5a..721f0d840c 100644
--- a/test/core/componentTests.ts
+++ b/test/core/componentTests.ts
@@ -205,7 +205,8 @@ it("components can be offset relative to their alignment, and throw errors if th
c._anchor(svg);
c._computeLayout(0, 0, 100, 100);
c._render();
- var expectedClipPathURL = "url(#clipPath" + expectedClipPathID+ ")";
+ var expectedPrefix = /MSIE [5-9]/.test(navigator.userAgent) ? "" : document.location.href;
+ var expectedClipPathURL = "url(" + expectedPrefix + "#clipPath" + expectedClipPathID+ ")";
// IE 9 has clipPath like 'url("#clipPath")', must accomodate
var normalizeClipPath = (s: string) => s.replace(/"/g, "");
assert.isTrue(normalizeClipPath(c.element.attr("clip-path")) === expectedClipPathURL,
diff --git a/test/tests.js b/test/tests.js
index 101dd2fb84..c94ff0ff65 100644
--- a/test/tests.js
+++ b/test/tests.js
@@ -2739,7 +2739,8 @@ describe("Component behavior", function () {
c._anchor(svg);
c._computeLayout(0, 0, 100, 100);
c._render();
- var expectedClipPathURL = "url(#clipPath" + expectedClipPathID + ")";
+ var expectedPrefix = /MSIE [5-9]/.test(navigator.userAgent) ? "" : document.location.href;
+ var expectedClipPathURL = "url(" + expectedPrefix + "#clipPath" + expectedClipPathID + ")";
var normalizeClipPath = function (s) { return s.replace(/"/g, ""); };
assert.isTrue(normalizeClipPath(c.element.attr("clip-path")) === expectedClipPathURL, "the element has clip-path url attached");
var clipRect = c.boxContainer.select(".clip-rect");