datagovsg-plottable-charts
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -48,3 +48,3 @@ 'use strict'; | ||
this.datasets = nextProps.data.map(function (s) { | ||
return new Plottable.Dataset(s.items, s.label); | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
@@ -51,0 +51,0 @@ this.plot.datasets(this.datasets); |
@@ -69,6 +69,2 @@ 'use strict'; | ||
_this.datasets = props.data.map(function (t) { | ||
return new Plottable.Dataset(t.series, t.label); | ||
}); | ||
var scale = props.scale || new Plottable.Scales.Linear(); | ||
@@ -89,6 +85,12 @@ var categoryScale = props.categoryScale || new Plottable.Scales.Category(); | ||
}, categoryScale); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.addDataset(dataset); | ||
}); | ||
if (props.data) { | ||
_this.datasets = props.data.map(function (s) { | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.addDataset(dataset); | ||
}); | ||
} | ||
if (props.labelFormatter) { | ||
@@ -95,0 +97,0 @@ _this.plot.labelFormatter(props.labelFormatter).labelsEnabled(true); |
@@ -7,2 +7,4 @@ 'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _Chart2 = require('./Chart'); | ||
@@ -73,6 +75,2 @@ | ||
_this.datasets = props.data.map(function (t) { | ||
return new Plottable.Dataset(t.series, t.label); | ||
}); | ||
var scale = props.yScale || new Plottable.Scales.Linear(); | ||
@@ -99,6 +97,11 @@ var categoryScale = props.xScale || new Plottable.Scales.Linear(); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.lines.addDataset(dataset); | ||
_this.plot.markers.addDataset(dataset); | ||
}); | ||
if (props.data) { | ||
_this.datasets = props.data.map(function (s) { | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.lines.addDataset(dataset); | ||
_this.plot.markers.addDataset(dataset); | ||
}); | ||
} | ||
@@ -194,2 +197,15 @@ if (props.clickHandler) { | ||
_createClass(MultipleLine, [{ | ||
key: 'update', | ||
value: function update(nextProps) { | ||
this.datasets = nextProps.data.map(function (s) { | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
this.plot.lines.datasets(this.datasets); | ||
this.plot.markers.datasets(this.datasets); | ||
this.options.data = nextProps.data; | ||
this.onUpdate(nextProps); | ||
} | ||
}]); | ||
return MultipleLine; | ||
@@ -196,0 +212,0 @@ }(_Chart3.default); |
@@ -69,6 +69,2 @@ 'use strict'; | ||
_this.datasets = props.data.map(function (t) { | ||
return new Plottable.Dataset(t.series, t.label); | ||
}); | ||
var scale = props.scale || new Plottable.Scales.Linear(); | ||
@@ -89,6 +85,12 @@ var categoryScale = props.categoryScale || new Plottable.Scales.Category(); | ||
}, categoryScale); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.addDataset(dataset); | ||
}); | ||
if (props.data) { | ||
_this.datasets = props.data.map(function (s) { | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.addDataset(dataset); | ||
}); | ||
} | ||
if (props.labelFormatter) { | ||
@@ -95,0 +97,0 @@ _this.plot.labelFormatter(_this.props.labelFormatter).labelsEnabled(true); |
@@ -38,3 +38,3 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
this.datasets = nextProps.data.map(function (s) { | ||
return new Plottable.Dataset(s.items, s.label); | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
@@ -41,0 +41,0 @@ this.plot.datasets(this.datasets); |
@@ -59,6 +59,2 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
_this.datasets = props.data.map(function (t) { | ||
return new Plottable.Dataset(t.series, t.label); | ||
}); | ||
var scale = props.scale || new Plottable.Scales.Linear(); | ||
@@ -79,6 +75,12 @@ var categoryScale = props.categoryScale || new Plottable.Scales.Category(); | ||
}, categoryScale); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.addDataset(dataset); | ||
}); | ||
if (props.data) { | ||
_this.datasets = props.data.map(function (s) { | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.addDataset(dataset); | ||
}); | ||
} | ||
if (props.labelFormatter) { | ||
@@ -85,0 +87,0 @@ _this.plot.labelFormatter(props.labelFormatter).labelsEnabled(true); |
@@ -0,1 +1,3 @@ | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -62,6 +64,2 @@ | ||
_this.datasets = props.data.map(function (t) { | ||
return new Plottable.Dataset(t.series, t.label); | ||
}); | ||
var scale = props.yScale || new Plottable.Scales.Linear(); | ||
@@ -88,6 +86,11 @@ var categoryScale = props.xScale || new Plottable.Scales.Linear(); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.lines.addDataset(dataset); | ||
_this.plot.markers.addDataset(dataset); | ||
}); | ||
if (props.data) { | ||
_this.datasets = props.data.map(function (s) { | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.lines.addDataset(dataset); | ||
_this.plot.markers.addDataset(dataset); | ||
}); | ||
} | ||
@@ -183,2 +186,15 @@ if (props.clickHandler) { | ||
_createClass(MultipleLine, [{ | ||
key: 'update', | ||
value: function update(nextProps) { | ||
this.datasets = nextProps.data.map(function (s) { | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
this.plot.lines.datasets(this.datasets); | ||
this.plot.markers.datasets(this.datasets); | ||
this.options.data = nextProps.data; | ||
this.onUpdate(nextProps); | ||
} | ||
}]); | ||
return MultipleLine; | ||
@@ -185,0 +201,0 @@ }(Chart); |
@@ -59,6 +59,2 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
_this.datasets = props.data.map(function (t) { | ||
return new Plottable.Dataset(t.series, t.label); | ||
}); | ||
var scale = props.scale || new Plottable.Scales.Linear(); | ||
@@ -79,6 +75,12 @@ var categoryScale = props.categoryScale || new Plottable.Scales.Category(); | ||
}, categoryScale); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.addDataset(dataset); | ||
}); | ||
if (props.data) { | ||
_this.datasets = props.data.map(function (s) { | ||
return new Plottable.Dataset(s.series, s.label); | ||
}); | ||
_this.datasets.forEach(function (dataset) { | ||
_this.plot.addDataset(dataset); | ||
}); | ||
} | ||
if (props.labelFormatter) { | ||
@@ -85,0 +87,0 @@ _this.plot.labelFormatter(_this.props.labelFormatter).labelsEnabled(true); |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}function e(t,n,r,o,a){var i=-1,l=t.length;for(r||(r=It),a||(a=[]);++i<l;){var u=t[i];n>0&&r(u)?n>1?e(u,n-1,r,o,a):wt(a,u):o||(a[a.length]=u)}return a}function n(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function a(t){var e=this.__data__=new Rt(t);this.size=e.size}function i(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new pe;++e<n;)this.add(t[e])}function l(t,e,n,r,o){return t===e||(null==t||null==e||!Z(t)&&!Z(e)?t!==t&&e!==e:Fn(t,e,n,r,l,o))}function u(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Qn);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(u.Cache||pe),n}function s(t){if("string"==typeof t)return t;if(kt(t))return Et(t,s)+"";if(J(t))return rr?rr.call(t):"";var e=t+"";return"0"==e&&1/t==-er?"-0":e}function c(){return(new Plottable.Scales.Linear).tickGenerator(v())}function f(t){return(new Plottable.Scales.Category).outerPadding(.2)}function d(){return(new Plottable.Scales.Color).range(Jr)}function p(){var t=(new Plottable.Scales.Color).range([Jr[0]]);return t.scale=function(t){return this._d3Scale(t)},t}function h(){return new to}function b(t){if(t){var e=Plottable.Formatters.general(5);return function(t){return e(t)+"%"}}var n=Plottable.Formatters.shortScale();return function(t){var e=n(t);return e.indexOf(".")>-1&&(e=e.replace(/\.?(0*|0{3}\d*)([KMBTQ]?)$/,"$2")),"-0"===e&&(e="0"),e}}function v(){var t=v.targetLineCount||4;return function(e){var n=e.domain(),r=gt(n,2),o=r[0],a=r[1],i=a-o,l=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),u=i/l/t,s=l*(10*(u=[2,1,.5,.2].filter(function(t){return t<=u})[0]))/10,c=Math.ceil(o/s),f=Math.floor(a/s);return Kr(c,f+1).map(function(t){return t*s})}}function m(t){switch(t){case"year":case"financial_year":return y();case"half_year":case"financial_half_year":return[].concat(_t(g()),_t(y()));case"quarter":case"financial_quarter":return[].concat(_t(_()),_t(y()));case"month":return[].concat(_t(P()),_t(y()));case"week":return[].concat(_t(w()),_t(y()));case"date":return[].concat(_t(x()),_t(P()),_t(y()));case"date_time":return[].concat(_t(O()),_t(x()),_t(P()),_t(y()));case"time":return j()}}function y(){return eo.map(function(t){return[{interval:Plottable.TimeInterval.year,step:t,formatter:Plottable.Formatters.time("%Y")}]})}function g(){return[[{interval:Plottable.TimeInterval.month,step:6,formatter:function(t){var e=new Date(t);return"H"+Math.floor(e.getMonth()/6)+1}},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function _(){return[[{interval:Plottable.TimeInterval.month,step:3,formatter:function(t){var e=new Date(t);return"Q"+Math.floor(e.getMonth()/3)+1}},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function P(){return[[{interval:Plottable.TimeInterval.month,step:1,formatter:Plottable.Formatters.time("%B")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}],[{interval:Plottable.TimeInterval.month,step:1,formatter:Plottable.Formatters.time("%b")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}],[{interval:Plottable.TimeInterval.month,step:1,formatter:Plottable.Formatters.time("%m")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}],[{interval:Plottable.TimeInterval.month,step:1,formatter:Plottable.Formatters.time("%-m")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function w(){return[[{interval:Plottable.TimeInterval.week,step:1,formatter:function(t){return"W"+d3.time.mondayOfYear(t)+1}},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function x(){return[[{interval:Plottable.TimeInterval.day,step:1,formatter:Plottable.Formatters.time("%e")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function O(){var t=[];return no.forEach(function(e){t.push([{interval:Plottable.TimeInterval.hour,step:e,formatter:Plottable.Formatters.time("%I %p")},{interval:Plottable.TimeInterval.day,step:1,formatter:Plottable.Formatters.time("%B %e, %Y")}])}),ro.forEach(function(e){t.push([{interval:Plottable.TimeInterval.minute,step:e,formatter:Plottable.Formatters.time("%I:%M %p")},{interval:Plottable.TimeInterval.day,step:1,formatter:Plottable.Formatters.time("%B %e, %Y")}]),t.push([{interval:Plottable.TimeInterval.second,step:e,formatter:Plottable.Formatters.time("%I:%M:%S %p")},{interval:Plottable.TimeInterval.day,step:1,formatter:Plottable.Formatters.time("%B %e, %Y")}])}),t}function j(){var t=[];return no.forEach(function(e){t.push([{interval:Plottable.TimeInterval.hour,step:e,formatter:Plottable.Formatters.time("%I %p")}])}),ro.forEach(function(e){t.push([{interval:Plottable.TimeInterval.minute,step:e,formatter:Plottable.Formatters.time("%I:%M %p")}]),t.push([{interval:Plottable.TimeInterval.second,step:e,formatter:Plottable.Formatters.time("%I:%M:%S %p")}])}),t}function T(t,e){(new Plottable.Interactions.Pointer).onPointerMove(function(e){t.plot.entities().forEach(function(t){t.selection.classed("highlight",!1).style("fill","")});var n=t.plot.entitiesAt(e)[0];n&&n.selection.classed("highlight",!0).style("fill","lightgrey")}).onPointerExit(function(e){t.plot.entities().forEach(function(t){t.selection.classed("highlight",!1).style("fill","")})}).attachTo(t.plot)}function A(t){function e(){t.plot.background().select(".label-area").remove()}function n(){var n=Math.min(t.plot.width(),t.plot.height())/2,o=d3.svg.arc().innerRadius(0).outerRadius(.8*n),a=d3.svg.arc().innerRadius(.8*n).outerRadius(n),i=d3.layout.pie().sort(null).value(function(t){return t.value})(t.dataset.data()).map(function(t,e){var i=.5*t.startAngle+.5*t.endAngle<Math.PI,l=o.centroid(t),u=a.centroid(t),s=[(i?1:-1)*n*.95,u[1]],c=[(i?1:-1)*n,u[1]];return{text:r.labelFormatter(t.data,e),textAnchor:i?"start":"end",textOffset:c,polyline:[l,u,s]}}),l=[t.plot.width()/2,t.plot.height()/2];e();var u=t.plot.background().insert("g").classed("label-area",!0).attr("transform","translate("+l.join(",")+")").selectAll("g").data(i).enter().append("g").classed("label",!0);u.append("text").text(function(t){return t.text}).attr("dy","0.35em").attr("transform",function(t){return"translate("+t.textOffset.join(",")+")"}).style("text-anchor",function(t){return t.textAnchor}),u.append("polyline").attr("points",function(t){return t.polyline})}var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{labelFormatter:function(t){return t.label}};t.plot.outerRadius(function(e){return.8*(Math.min(t.plot.width(),t.plot.height())/2)}),t.plot._clipPathEnabled=!1,t.onMount=function(t){n()},t.onUpdate=function(t){n()},t.onResize=function(){n()},t.onUnmount=function(){e()}}function S(t,e){var n=t.xAxis;n instanceof Plottable.Axes.Time&&(n.axisConfigurations(m(e)),"year"!==e&&"financial_year"!==e||n.tierLabelPositions(n.tierLabelPositions().map(function(t){return"center"})))}function k(t){var e=t.plot._makeInnerScale;t.plot._makeInnerScale=function(){return e.call(this).innerPadding(0).outerPadding(0)}}function L(t){var e=t.xAxis;if(e instanceof Plottable.Axes.Category){var n=e.renderImmediately;e.renderImmediately=function(){var t=this,e=1.5*d3.max(this._scale.domain(),function(e){return t._measurer.measure(e.toString()).width}),r=Math.ceil(e/this._scale.stepWidth()),o=this._scale.domain,a=this._scale.stepWidth;this._scale.domain=function(){return o.call(this).filter(function(t,e){return e%r==0})},this._scale.stepWidth=function(){return a.call(this)*r},n.call(this),this._scale.domain=o,this._scale.stepWidth=a};var r=e._measureTicks;e._measureTicks=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var o=this._wrapper.wrap;this._wrapper.wrap=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=o.call.apply(o,[this].concat(e));return r.wrappedText=r.originalText,r};var a=r.call.apply(r,[this].concat(_t(e)));return this._wrapper.wrap=o,a}}}function I(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.margin(12).innerTickLength(5).endTickLength(0).tickLabelPadding(5),e.margin(12).innerTickLength(0).endTickLength(0).tickLabelPadding(5).showEndTickLabels(!0).addClass("hide-baseline").formatter(b(n.isPercentage)),e._hideOverflowingTickLabels=function(){return null}}var C=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},E="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},z="object"==typeof E&&E&&E.Object===Object&&E,M="object"==typeof self&&self&&self.Object===Object&&self,F=z||M||Function("return this")(),R=function(){return F.Date.now()},D=F.Symbol,N=Object.prototype,B=N.hasOwnProperty,G=N.toString,U=D?D.toStringTag:void 0,H=function(t){var e=B.call(t,U),n=t[U];try{t[U]=void 0;var r=!0}catch(t){}var o=G.call(t);return r&&(e?t[U]=n:delete t[U]),o},V=Object.prototype.toString,W=function(t){return V.call(t)},Y="[object Null]",Q="[object Undefined]",X=D?D.toStringTag:void 0,q=function(t){return null==t?void 0===t?Q:Y:X&&X in Object(t)?H(t):W(t)},Z=function(t){return null!=t&&"object"==typeof t},K="[object Symbol]",J=function(t){return"symbol"==typeof t||Z(t)&&q(t)==K},tt=NaN,et=/^\s+|\s+$/g,nt=/^[-+]0x[0-9a-f]+$/i,rt=/^0b[01]+$/i,ot=/^0o[0-7]+$/i,at=parseInt,it=function(t){if("number"==typeof t)return t;if(J(t))return tt;if(C(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=C(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(et,"");var n=rt.test(t);return n||ot.test(t)?at(t.slice(2),n?2:8):nt.test(t)?tt:+t},lt="Expected a function",ut=Math.max,st=Math.min,ct=function(t,e,n){function r(e){var n=c,r=f;return c=f=void 0,v=e,p=t.apply(r,n)}function o(t){return v=t,h=setTimeout(l,e),m?r(t):p}function a(t){var n=t-v,r=e-(t-b);return y?st(r,d-n):r}function i(t){var n=t-b,r=t-v;return void 0===b||n>=e||n<0||y&&r>=d}function l(){var t=R();if(i(t))return u(t);h=setTimeout(l,a(t))}function u(t){return h=void 0,g&&c?r(t):(c=f=void 0,p)}function s(){var t=R(),n=i(t);if(c=arguments,f=this,b=t,n){if(void 0===h)return o(b);if(y)return h=setTimeout(l,e),r(b)}return void 0===h&&(h=setTimeout(l,e)),p}var c,f,d,p,h,b,v=0,m=!1,y=!1,g=!0;if("function"!=typeof t)throw new TypeError(lt);return e=it(e)||0,C(n)&&(m=!!n.leading,d=(y="maxWait"in n)?ut(it(n.maxWait)||0,e):d,g="trailing"in n?!!n.trailing:g),s.cancel=function(){void 0!==h&&clearTimeout(h),v=0,c=b=f=h=void 0},s.flush=function(){return void 0===h?p:u(R())},s},ft="Expected a function",dt=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError(ft);return C(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),ct(t,e,{leading:r,maxWait:e,trailing:o})},pt=(function(){function t(t){this.value=t}function e(e){function n(o,a){try{var i=e[o](a),l=i.value;l instanceof t?Promise.resolve(l.value).then(function(t){n("next",t)},function(t){n("throw",t)}):r(i.done?"return":"normal",i.value)}catch(t){r("throw",t)}}function r(t,e){switch(t){case"return":o.resolve({value:e,done:!0});break;case"throw":o.reject(e);break;default:o.resolve({value:e,done:!1})}(o=o.next)?n(o.key,o.arg):a=null}var o,a;this._invoke=function(t,e){return new Promise(function(r,i){var l={key:t,arg:e,resolve:r,reject:i,next:null};a?a=a.next=l:(o=a=l,n(t,e))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(t){return this._invoke("next",t)},e.prototype.throw=function(t){return this._invoke("throw",t)},e.prototype.return=function(t){return this._invoke("return",t)}}(),function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}),ht=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),bt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},vt=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,r)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(r)},mt=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},yt=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},gt=function(){function t(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=t[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_t=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)},Pt=function(){function t(){pt(this,t),this.options={innerRadius:0,strokeWidth:2,markerSize:0,sorted:!1,orientation:"v",baselineValue:0,hideXaxis:!1,hideYaxis:!1,showGridLines:!1,showXgridlines:!1,showYgridlines:!1,guideLine:"none",legendPosition:"r",animated:!0},this.resizeHandler=dt(this.resizeHandler,200).bind(this),this._onMount=[],this._onUnmount=[],this._onUpdate=[],this._onResize=[]}return ht(t,[{key:"update",value:function(t){this.datasets=t.data.map(function(t){return new Plottable.Dataset(t.items,t.label)}),this.plot.datasets(this.datasets),this.options.data=t.data,this.onUpdate(t)}},{key:"_setGridlines",value:function(t,e){if(t.showGridlines){var n="h"===t.orientation,r=n?e:null,o=n?null:e;this.gridlines=new Plottable.Components.Gridlines(r,o)}}},{key:"_setAxes",value:function(t,e,n){var r="h"===t.orientation;t.hideXaxis||(this.xAxis=r?new Plottable.Axes.Numeric(e,"bottom"):n instanceof Plottable.Scales.Time?new Plottable.Axes.Time(n,"bottom"):new Plottable.Axes.Category(n,"bottom"),this.layout.add(this.xAxis,1,2)),t.hideYaxis||(this.yAxis=r?n instanceof Plottable.Scales.Time?new Plottable.Axes.Time(n,"left"):new Plottable.Axes.Category(n,"left"):new Plottable.Axes.Numeric(e,"left"),this.layout.add(this.yAxis,0,1)),t.xLabel&&this.layout.add(new Plottable.Components.AxisLabel(t.xLabel),2,2),t.yLabel&&this.layout.add(new Plottable.Components.AxisLabel(t.yLabel,-90),0,0)}},{key:"_setLegend",value:function(t,e){switch(this.legend=new Plottable.Components.Legend(e).xAlignment("center").yAlignment("center"),t.legendPosition){case"t":this.layout=new Plottable.Components.Table([[this.legend.maxEntriesPerRow(1/0)],[this.layout]]).rowPadding(10);break;case"r":this.layout=new Plottable.Components.Table([[this.layout,this.legend]]).columnPadding(10);break;case"b":this.layout=new Plottable.Components.Table([[this.layout],[this.legend.maxEntriesPerRow(1/0)]]).rowPadding(10);break;case"l":this.layout=new Plottable.Components.Table([[this.legend,this.layout]]).columnPadding(10)}}},{key:"_setInteractions",value:function(t){var e=this;t.clickHandler&&(new Plottable.Interactions.Click).onClick(function(n){var r=e.plot.entitiesAt(n)[0];t.clickHandler(r,e.plot.entities())}).attachTo(this.plot),t.hoverHandler&&(new Plottable.Interactions.Pointer).onPointerMove(function(n){var r=e.plot.entitiesAt(n)[0];t.hoverHandler(r,e.plot.entities())}).onPointerExit(function(n){t.hoverHandler(null,e.plot.entities())}).attachTo(this.plot)}},{key:"resizeHandler",value:function(){this.layout.redraw(),this.onResize()}},{key:"mount",value:function(t){this.layout.renderTo(t),window.addEventListener("resize",this.resizeHandler),this.onMount(t)}},{key:"unmount",value:function(){this.onUnmount(),window.removeEventListener("resize",this.resizeHandler),this.layout.detach()}},{key:"onMount",get:function(){return function(t){var e=this;this._onMount.forEach(function(n){n.call(e,t)})}},set:function(t){this._onMount.push(t)}},{key:"onUnmount",get:function(){return function(t){var e=this;this._onUnmount.forEach(function(t){t.call(e)})}},set:function(t){this._onUnmount.push(t)}},{key:"onUpdate",get:function(){return function(t){var e=this;Plottable.Utils.DOM.requestAnimationFramePolyfill(function(){e._onUpdate.forEach(function(n){n.call(e,t)})})}},set:function(t){this._onUpdate.push(t)}},{key:"onResize",get:function(){return function(){var t=this;Plottable.Utils.DOM.requestAnimationFramePolyfill(function(){t._onResize.forEach(function(e){e.call(t)})})}},set:function(t){this._onResize.push(t)}}]),t}(),wt=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},xt="[object Arguments]",Ot=function(t){return Z(t)&&q(t)==xt},jt=Object.prototype,Tt=jt.hasOwnProperty,At=jt.propertyIsEnumerable,St=Ot(function(){return arguments}())?Ot:function(t){return Z(t)&&Tt.call(t,"callee")&&!At.call(t,"callee")},kt=Array.isArray,Lt=D?D.isConcatSpreadable:void 0,It=function(t){return kt(t)||St(t)||!!(Lt&&t&&t[Lt])},Ct=e,Et=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},zt=function(t,e){return t===e||t!==t&&e!==e},Mt=function(t,e){for(var n=t.length;n--;)if(zt(t[n][0],e))return n;return-1},Ft=Array.prototype.splice;n.prototype.clear=function(){this.__data__=[],this.size=0},n.prototype.delete=function(t){var e=this.__data__,n=Mt(e,t);return!(n<0||(n==e.length-1?e.pop():Ft.call(e,n,1),--this.size,0))},n.prototype.get=function(t){var e=this.__data__,n=Mt(e,t);return n<0?void 0:e[n][1]},n.prototype.has=function(t){return Mt(this.__data__,t)>-1},n.prototype.set=function(t,e){var n=this.__data__,r=Mt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Rt=n,Dt="[object AsyncFunction]",Nt="[object Function]",Bt="[object GeneratorFunction]",Gt="[object Proxy]",Ut=function(t){if(!C(t))return!1;var e=q(t);return e==Nt||e==Bt||e==Dt||e==Gt},$t=F["__core-js_shared__"],Ht=function(){var t=/[^.]+$/.exec($t&&$t.keys&&$t.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Vt=function(t){return!!Ht&&Ht in t},Wt=Function.prototype.toString,Yt=function(t){if(null!=t){try{return Wt.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Qt=/[\\^$.*+?()[\]{}|]/g,Xt=/^\[object .+?Constructor\]$/,qt=Function.prototype,Zt=Object.prototype,Kt=qt.toString,Jt=Zt.hasOwnProperty,te=RegExp("^"+Kt.call(Jt).replace(Qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ee=function(t){return!(!C(t)||Vt(t))&&(Ut(t)?te:Xt).test(Yt(t))},ne=function(t,e){return null==t?void 0:t[e]},re=function(t,e){var n=ne(t,e);return ee(n)?n:void 0},oe=re(F,"Map"),ae=re(Object,"create"),ie="__lodash_hash_undefined__",le=Object.prototype.hasOwnProperty,ue=Object.prototype.hasOwnProperty,se="__lodash_hash_undefined__";r.prototype.clear=function(){this.__data__=ae?ae(null):{},this.size=0},r.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},r.prototype.get=function(t){var e=this.__data__;if(ae){var n=e[t];return n===ie?void 0:n}return le.call(e,t)?e[t]:void 0},r.prototype.has=function(t){var e=this.__data__;return ae?void 0!==e[t]:ue.call(e,t)},r.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ae&&void 0===e?se:e,this};var ce=r,fe=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t},de=function(t,e){var n=t.__data__;return fe(e)?n["string"==typeof e?"string":"hash"]:n.map};o.prototype.clear=function(){this.size=0,this.__data__={hash:new ce,map:new(oe||Rt),string:new ce}},o.prototype.delete=function(t){var e=de(this,t).delete(t);return this.size-=e?1:0,e},o.prototype.get=function(t){return de(this,t).get(t)},o.prototype.has=function(t){return de(this,t).has(t)},o.prototype.set=function(t,e){var n=de(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var pe=o,he=200;a.prototype.clear=function(){this.__data__=new Rt,this.size=0},a.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},a.prototype.get=function(t){return this.__data__.get(t)},a.prototype.has=function(t){return this.__data__.has(t)},a.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Rt){var r=n.__data__;if(!oe||r.length<he-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new pe(r)}return n.set(t,e),this.size=n.size,this};var be=a,ve="__lodash_hash_undefined__";i.prototype.add=i.prototype.push=function(t){return this.__data__.set(t,ve),this},i.prototype.has=function(t){return this.__data__.has(t)};var me=i,ye=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},ge=function(t,e){return t.has(e)},_e=1,Pe=2,we=function(t,e,n,r,o,a){var i=n&_e,l=t.length,u=e.length;if(l!=u&&!(i&&u>l))return!1;var s=a.get(t);if(s&&a.get(e))return s==e;var c=-1,f=!0,d=n&Pe?new me:void 0;for(a.set(t,e),a.set(e,t);++c<l;){var p=t[c],h=e[c];if(r)var b=i?r(h,p,c,e,t,a):r(p,h,c,t,e,a);if(void 0!==b){if(b)continue;f=!1;break}if(d){if(!ye(e,function(t,e){if(!ge(d,e)&&(p===t||o(p,t,n,r,a)))return d.push(e)})){f=!1;break}}else if(p!==h&&!o(p,h,n,r,a)){f=!1;break}}return a.delete(t),a.delete(e),f},xe=F.Uint8Array,Oe=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n},je=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n},Te=1,Ae=2,Se="[object Boolean]",ke="[object Date]",Le="[object Error]",Ie="[object Map]",Ce="[object Number]",Ee="[object RegExp]",ze="[object Set]",Me="[object String]",Fe="[object Symbol]",Re="[object ArrayBuffer]",De="[object DataView]",Ne=D?D.prototype:void 0,Be=Ne?Ne.valueOf:void 0,Ge=function(t,e,n,r,o,a,i){switch(n){case De:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Re:return!(t.byteLength!=e.byteLength||!a(new xe(t),new xe(e)));case Se:case ke:case Ce:return zt(+t,+e);case Le:return t.name==e.name&&t.message==e.message;case Ee:case Me:return t==e+"";case Ie:var l=Oe;case ze:var u=r&Te;if(l||(l=je),t.size!=e.size&&!u)return!1;var s=i.get(t);if(s)return s==e;r|=Ae,i.set(t,e);var c=we(l(t),l(e),r,o,a,i);return i.delete(t),c;case Fe:if(Be)return Be.call(t)==Be.call(e)}return!1},Ue=function(t,e,n){var r=e(t);return kt(t)?r:wt(r,n(t))},$e=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[o++]=i)}return a},He=Object.prototype.propertyIsEnumerable,Ve=Object.getOwnPropertySymbols,We=Ve?function(t){return null==t?[]:(t=Object(t),$e(Ve(t),function(e){return He.call(t,e)}))}:function(){return[]},Ye=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r},Qe=function(){return!1},Xe=t(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n?F.Buffer:void 0,a=(o?o.isBuffer:void 0)||Qe;t.exports=a}),qe=9007199254740991,Ze=/^(?:0|[1-9]\d*)$/,Ke=function(t,e){return!!(e=null==e?qe:e)&&("number"==typeof t||Ze.test(t))&&t>-1&&t%1==0&&t<e},Je=9007199254740991,tn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Je},en={};en["[object Float32Array]"]=en["[object Float64Array]"]=en["[object Int8Array]"]=en["[object Int16Array]"]=en["[object Int32Array]"]=en["[object Uint8Array]"]=en["[object Uint8ClampedArray]"]=en["[object Uint16Array]"]=en["[object Uint32Array]"]=!0,en["[object Arguments]"]=en["[object Array]"]=en["[object ArrayBuffer]"]=en["[object Boolean]"]=en["[object DataView]"]=en["[object Date]"]=en["[object Error]"]=en["[object Function]"]=en["[object Map]"]=en["[object Number]"]=en["[object Object]"]=en["[object RegExp]"]=en["[object Set]"]=en["[object String]"]=en["[object WeakMap]"]=!1;var nn=function(t){return function(e){return t(e)}},rn=t(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n&&z.process,a=function(){try{return o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}),on=rn&&rn.isTypedArray,an=on?nn(on):function(t){return Z(t)&&tn(t.length)&&!!en[q(t)]},ln=Object.prototype.hasOwnProperty,un=function(t,e){var n=kt(t),r=!n&&St(t),o=!n&&!r&&Xe(t),a=!n&&!r&&!o&&an(t),i=n||r||o||a,l=i?Ye(t.length,String):[],u=l.length;for(var s in t)!e&&!ln.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ke(s,u))||l.push(s);return l},sn=Object.prototype,cn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||sn)},fn=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),dn=Object.prototype.hasOwnProperty,pn=function(t){if(!cn(t))return fn(t);var e=[];for(var n in Object(t))dn.call(t,n)&&"constructor"!=n&&e.push(n);return e},hn=function(t){return null!=t&&tn(t.length)&&!Ut(t)},bn=function(t){return hn(t)?un(t):pn(t)},vn=function(t){return Ue(t,bn,We)},mn=1,yn=Object.prototype.hasOwnProperty,gn=function(t,e,n,r,o,a){var i=n&mn,l=vn(t),u=l.length;if(u!=vn(e).length&&!i)return!1;for(var s=u;s--;){var c=l[s];if(!(i?c in e:yn.call(e,c)))return!1}var f=a.get(t);if(f&&a.get(e))return f==e;var d=!0;a.set(t,e),a.set(e,t);for(var p=i;++s<u;){var h=t[c=l[s]],b=e[c];if(r)var v=i?r(b,h,c,e,t,a):r(h,b,c,t,e,a);if(!(void 0===v?h===b||o(h,b,n,r,a):v)){d=!1;break}p||(p="constructor"==c)}if(d&&!p){var m=t.constructor,y=e.constructor;m!=y&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y)&&(d=!1)}return a.delete(t),a.delete(e),d},_n=re(F,"DataView"),Pn=re(F,"Promise"),wn=re(F,"Set"),xn=re(F,"WeakMap"),On=Yt(_n),jn=Yt(oe),Tn=Yt(Pn),An=Yt(wn),Sn=Yt(xn),kn=q;(_n&&"[object DataView]"!=kn(new _n(new ArrayBuffer(1)))||oe&&"[object Map]"!=kn(new oe)||Pn&&"[object Promise]"!=kn(Pn.resolve())||wn&&"[object Set]"!=kn(new wn)||xn&&"[object WeakMap]"!=kn(new xn))&&(kn=function(t){var e=q(t),n="[object Object]"==e?t.constructor:void 0,r=n?Yt(n):"";if(r)switch(r){case On:return"[object DataView]";case jn:return"[object Map]";case Tn:return"[object Promise]";case An:return"[object Set]";case Sn:return"[object WeakMap]"}return e});var Ln=kn,In=1,Cn="[object Arguments]",En="[object Array]",zn="[object Object]",Mn=Object.prototype.hasOwnProperty,Fn=function(t,e,n,r,o,a){var i=kt(t),l=kt(e),u=i?En:Ln(t),s=l?En:Ln(e),c=(u=u==Cn?zn:u)==zn,f=(s=s==Cn?zn:s)==zn,d=u==s;if(d&&Xe(t)){if(!Xe(e))return!1;i=!0,c=!1}if(d&&!c)return a||(a=new be),i||an(t)?we(t,e,n,r,o,a):Ge(t,e,u,n,r,o,a);if(!(n&In)){var p=c&&Mn.call(t,"__wrapped__"),h=f&&Mn.call(e,"__wrapped__");if(p||h){var b=p?t.value():t,v=h?e.value():e;return a||(a=new be),o(b,v,n,r,a)}}return!!d&&(a||(a=new be),gn(t,e,n,r,o,a))},Rn=l,Dn=1,Nn=2,Bn=function(t,e,n,r){var o=n.length,a=o,i=!r;if(null==t)return!a;for(t=Object(t);o--;){var l=n[o];if(i&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++o<a;){var u=(l=n[o])[0],s=t[u],c=l[1];if(i&&l[2]){if(void 0===s&&!(u in t))return!1}else{var f=new be;if(r)var d=r(s,c,u,t,e,f);if(!(void 0===d?Rn(c,s,Dn|Nn,r,f):d))return!1}}return!0},Gn=function(t){return t===t&&!C(t)},Un=function(t){for(var e=bn(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Gn(o)]}return e},$n=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},Hn=function(t){var e=Un(t);return 1==e.length&&e[0][2]?$n(e[0][0],e[0][1]):function(n){return n===t||Bn(n,t,e)}},Vn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wn=/^\w*$/,Yn=function(t,e){if(kt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!J(t))||Wn.test(t)||!Vn.test(t)||null!=e&&t in Object(e)},Qn="Expected a function";u.Cache=pe;var Xn=u,qn=500,Zn=/^\./,Kn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jn=/\\(\\)?/g,tr=function(t){var e=Xn(t,function(t){return n.size===qn&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return Zn.test(t)&&e.push(""),t.replace(Kn,function(t,n,r,o){e.push(r?o.replace(Jn,"$1"):n||t)}),e}),er=1/0,nr=D?D.prototype:void 0,rr=nr?nr.toString:void 0,or=s,ar=function(t){return null==t?"":or(t)},ir=function(t,e){return kt(t)?t:Yn(t,e)?[t]:tr(ar(t))},lr=1/0,ur=function(t){if("string"==typeof t||J(t))return t;var e=t+"";return"0"==e&&1/t==-lr?"-0":e},sr=function(t,e){for(var n=0,r=(e=ir(e,t)).length;null!=t&&n<r;)t=t[ur(e[n++])];return n&&n==r?t:void 0},cr=function(t,e,n){var r=null==t?void 0:sr(t,e);return void 0===r?n:r},fr=function(t,e){return null!=t&&e in Object(t)},dr=function(t,e,n){for(var r=-1,o=(e=ir(e,t)).length,a=!1;++r<o;){var i=ur(e[r]);if(!(a=null!=t&&n(t,i)))break;t=t[i]}return a||++r!=o?a:!!(o=null==t?0:t.length)&&tn(o)&&Ke(i,o)&&(kt(t)||St(t))},pr=function(t,e){return null!=t&&dr(t,e,fr)},hr=1,br=2,vr=function(t,e){return Yn(t)&&Gn(e)?$n(ur(t),e):function(n){var r=cr(n,t);return void 0===r&&r===e?pr(n,t):Rn(e,r,hr|br)}},mr=function(t){return t},yr=function(t){return function(e){return null==e?void 0:e[t]}},gr=function(t){return function(e){return sr(e,t)}},_r=function(t){return Yn(t)?yr(ur(t)):gr(t)},Pr=function(t){return"function"==typeof t?t:null==t?mr:"object"==typeof t?kt(t)?vr(t[0],t[1]):Hn(t):_r(t)},wr=function(t){return function(e,n,r){for(var o=-1,a=Object(e),i=r(e),l=i.length;l--;){var u=i[t?l:++o];if(!1===n(a[u],u,a))break}return e}}(),xr=function(t,e){return function(n,r){if(null==n)return n;if(!hn(n))return t(n,r);for(var o=n.length,a=e?o:-1,i=Object(n);(e?a--:++a<o)&&!1!==r(i[a],a,i););return n}}(function(t,e){return t&&wr(t,e,bn)}),Or=function(t,e){var n=-1,r=hn(t)?Array(t.length):[];return xr(t,function(t,o,a){r[++n]=e(t,o,a)}),r},jr=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t},Tr=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t===t,a=J(t),i=void 0!==e,l=null===e,u=e===e,s=J(e);if(!l&&!s&&!a&&t>e||a&&i&&u&&!l&&!s||r&&i&&u||!n&&u||!o)return 1;if(!r&&!a&&!s&&t<e||s&&n&&o&&!r&&!a||l&&n&&o||!i&&o||!u)return-1}return 0},Ar=function(t,e,n){for(var r=-1,o=t.criteria,a=e.criteria,i=o.length,l=n.length;++r<i;){var u=Tr(o[r],a[r]);if(u)return r>=l?u:u*("desc"==n[r]?-1:1)}return t.index-e.index},Sr=function(t,e,n){var r=-1;e=Et(e.length?e:[mr],nn(Pr));var o=Or(t,function(t,n,o){return{criteria:Et(e,function(e){return e(t)}),index:++r,value:t}});return jr(o,function(t,e){return Ar(t,e,n)})},kr=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},Lr=Math.max,Ir=function(t,e,n){return e=Lr(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,a=Lr(r.length-e,0),i=Array(a);++o<a;)i[o]=r[e+o];o=-1;for(var l=Array(e+1);++o<e;)l[o]=r[o];return l[e]=n(i),kr(t,this,l)}},Cr=function(t){return function(){return t}},Er=function(){try{var t=re(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),zr=Er?function(t,e){return Er(t,"toString",{configurable:!0,enumerable:!1,value:Cr(e),writable:!0})}:mr,Mr=800,Fr=16,Rr=Date.now,Dr=function(t){var e=0,n=0;return function(){var r=Rr(),o=Fr-(r-n);if(n=r,o>0){if(++e>=Mr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(zr),Nr=function(t,e,n){if(!C(n))return!1;var r=typeof e;return!!("number"==r?hn(n)&&Ke(e,n.length):"string"==r&&e in n)&&zt(n[e],t)},Br=function(t,e){return Dr(Ir(t,e,mr),t+"")}(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Nr(t,e[0],e[1])?e=[]:n>2&&Nr(e[0],e[1],e[2])&&(e=[e[0]]),Sr(t,Ct(e,1),[])}),Gr=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.options.legendPosition="none",(t=Object.assign(n.options,t)).sorted&&(t.data=Br(t.data,"value")),"d"===t.sorted&&t.data.reverse(),n.dataset=new Plottable.Dataset(t.data);var r=t.data.reduce(function(t,e){return t+e.value},0),o=(new Plottable.Scales.Linear).domain([0,r]),a=t.colorScale||new Plottable.Scales.Color;return t.outerRadius=t.outerRadius||function(t){return Math.min(n.plot.width(),n.plot.height())/2},n.plot=(new Plottable.Plots.Pie).addClass("simple-pie-plot").addDataset(n.dataset).sectorValue(function(t){return t.value},o).attr("fill",function(t){return t.label},a).labelsEnabled(!1).innerRadius(t.innerRadius).outerRadius(t.outerRadius).animated(t.animated),t.labelFormatter&&n.plot.labelFormatter(t.labelFormatter).labelsEnabled(!0),n.layout=n.plot,n._setLegend(t,a),n._setInteractions(t),n}return mt(e,Pt),ht(e,[{key:"update",value:function(t){this.options.sorted&&(t.data=Br(t.data,"value")),"d"===this.options.sorted&&t.data.reverse();var e=t.data.reduce(function(t,e){return t+e.value},0);this.plot.sectorValue().scale.domain([0,e]),this.dataset.data(t.data),Object.assign(this.options,{data:t.data}),this.onUpdate(t)}}]),e}(),Ur=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.options.legendPosition="none",(t=Object.assign(n.options,t)).sorted&&(t.data=Br(t.data,"value")),"d"===t.sorted&&t.data.reverse(),n.dataset=new Plottable.Dataset(t.data);var r=t.scale||new Plottable.Scales.Linear,o=t.categoryScale||new Plottable.Scales.Category,a=t.colorScale||new Plottable.Scales.Color,i="h"===t.orientation,l=i?Plottable.Plots.Bar.ORIENTATION_HORIZONTAL:Plottable.Plots.Bar.ORIENTATION_VERTICAL;n.plot=new Plottable.Plots.Bar(l).addDataset(n.dataset).attr("fill",function(t){return t.label},a).labelsEnabled(!1).animated(t.animated).baselineValue(t.baselineValue),n.plot[i?"x":"y"](function(t){return t.value},r),n.plot[i?"y":"x"](function(t){return t.label},o),t.labelFormatter&&n.plot.labelFormatter(n.props.labelFormatter).labelsEnabled(!0),n._setGridlines(t,r);var u=n.gridlines?new Plottable.Components.Group([n.gridlines,n.plot]):n.plot;return n.layout=new Plottable.Components.Table([[null,null,u],[null,null,null],[null,null,null]]),n._setAxes(t,r,o),n._setLegend(t,a),n._setInteractions(t),n}return mt(e,Pt),ht(e,[{key:"update",value:function(t){this.options.sorted&&(t.data=Br(t.data,"value")),"d"===this.options.sorted&&t.data.reverse(),this.dataset.data(t.data),Object.assign(this.options,{data:t.data}),this.onUpdate(t)}}]),e}(),$r=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));t=Object.assign(n.options,t),n.datasets=t.data.map(function(t){return new Plottable.Dataset(t.series,t.label)});var r=t.scale||new Plottable.Scales.Linear,o=t.categoryScale||new Plottable.Scales.Category,a=t.colorScale||new Plottable.Scales.Color,i="h"===t.orientation,l=i?Plottable.Plots.Bar.ORIENTATION_HORIZONTAL:Plottable.Plots.Bar.ORIENTATION_VERTICAL;n.plot=new Plottable.Plots.ClusteredBar(l).attr("fill",function(t,e,n){return n.metadata()},a).labelsEnabled(!1).animated(t.animated).baselineValue(t.baselineValue),n.plot[i?"x":"y"](function(t){return t.value},r),n.plot[i?"y":"x"](function(t){return t.label},o),n.datasets.forEach(function(t){n.plot.addDataset(t)}),t.labelFormatter&&n.plot.labelFormatter(t.labelFormatter).labelsEnabled(!0),n._setGridlines(t,r);var u=n.gridlines?new Plottable.Components.Group([n.gridlines,n.plot]):n.plot;return n.layout=new Plottable.Components.Table([[null,null,u],[null,null,null],[null,null,null]]),n._setAxes(t,r,o),n._setLegend(t,a),n._setInteractions(t),n}return mt(e,Pt),e}(),Hr=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));t=Object.assign(n.options,t),n.datasets=t.data.map(function(t){return new Plottable.Dataset(t.series,t.label)});var r=t.scale||new Plottable.Scales.Linear,o=t.categoryScale||new Plottable.Scales.Category,a=t.colorScale||new Plottable.Scales.Color,i="h"===t.orientation,l=i?Plottable.Plots.Bar.ORIENTATION_HORIZONTAL:Plottable.Plots.Bar.ORIENTATION_VERTICAL;n.plot=new Plottable.Plots.StackedBar(l).attr("fill",function(t,e,n){return n.metadata()},a).labelsEnabled(!1).animated(t.animated).baselineValue(t.baselineValue),n.plot[i?"x":"y"](function(t){return t.value},r),n.plot[i?"y":"x"](function(t){return t.label},o),n.datasets.forEach(function(t){n.plot.addDataset(t)}),t.labelFormatter&&n.plot.labelFormatter(n.props.labelFormatter).labelsEnabled(!0),n._setGridlines(t,r);var u=n.gridlines?new Plottable.Components.Group([n.gridlines,n.plot]):n.plot;return n.layout=new Plottable.Components.Table([[null,null,u],[null,null,null],[null,null,null]]),n._setAxes(t,r,o),n._setLegend(t,a),n._setInteractions(t),n}return mt(e,Pt),e}(),Vr=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));t=Object.assign(n.options,t),n.datasets=t.data.map(function(t){return new Plottable.Dataset(t.series,t.label)});var r=t.yScale||new Plottable.Scales.Linear,o=t.xScale||new Plottable.Scales.Linear,a=t.colorScale||new Plottable.Scales.Color;n.plot={lines:(new Plottable.Plots.Line).attr("stroke",function(t,e,n){return n.metadata()},a).x(function(t){return t.label},o).y(function(t){return t.value},r).attr("stroke-width",t.strokeWidth),markers:(new Plottable.Plots.Scatter).attr("opacity",1).attr("fill",function(t,e,n){return n.metadata()},a).x(function(t){return t.label},o).y(function(t){return t.value},r).size(t.markerSize)},n.datasets.forEach(function(t){n.plot.lines.addDataset(t),n.plot.markers.addDataset(t)}),t.clickHandler&&(new Plottable.Interactions.Click).onClick(function(e){var r=n.plot.markers.entityNearest(e);t.clickHandler(r,n.plot.markers.entities())}).attachTo(n.plot.markers),t.hoverHandler&&(new Plottable.Interactions.Pointer).onPointerMove(function(e){var r=n.plot.markers.entityNearest(e);t.hoverHandler(r,n.plot.markers.entities())}).onPointerExit(function(e){t.hoverHandler(null,n.plot.markers.entities())}).attachTo(n.plot.markers),n.gridlines=new Plottable.Components.Gridlines(t.showXgridlines&&o instanceof Plottable.QuantitativeScale?o:null,t.showYgridlines&&r instanceof Plottable.QuantitativeScale?r:null),n.guideLine={horizontal:null,vertical:null},["v","vh","hv"].indexOf(t.guideLine)>-1&&(n.guideLine.vertical=new Plottable.Components.GuideLineLayer(Plottable.Components.GuideLineLayer.ORIENTATION_VERTICAL).scale(o),(new Plottable.Interactions.Pointer).onPointerMove(function(t){var e=n.plot.markers.entityNearest(t);e?(n.guideLine.vertical.value(e.datum.label),n.guideLine.vertical.content().style("visibility","visible")):n.guideLine.vertical.content().style("visibility","hidden")}).onPointerExit(function(t){n.guideLine.vertical.content().style("visibility","hidden")}).attachTo(n.plot.markers),n.onMount=function(t){this.guideLine.vertical.content().style("visibility","hidden")}),["h","vh","hv"].indexOf(t.guideLine)>-1&&(n.guideLine.horizontal=new Plottable.Components.GuideLineLayer(Plottable.Components.GuideLineLayer.ORIENTATION_HORIZONTAL).scale(r),(new Plottable.Interactions.Pointer).onPointerMove(function(t){var e=n.plot.markers.entityNearest(t);e?(n.guideLine.horizontal.value(e.datum.value),n.guideLine.horizontal.content().style("visibility","visible")):n.guideLine.horizontal.content().style("visibility","hidden")}).onPointerExit(function(t){n.guideLine.horizontal.content().style("visibility","hidden")}).attachTo(n.plot.markers),n.onMount=function(t){this.guideLine.horizontal.content().style("visibility","hidden")});var i=new Plottable.Components.Group([n.gridlines,n.guideLine.horizontal,n.guideLine.vertical,n.plot.lines,n.plot.markers]);return n.layout=new Plottable.Components.Table([[null,null,i],[null,null,null],[null,null,null]]),t.hideXaxis||(o instanceof Plottable.Scales.Time?n.xAxis=new Plottable.Axes.Time(o,"bottom"):o instanceof Plottable.QuantitativeScale?n.xAxis=new Plottable.Axes.Numeric(o,"bottom"):n.xAxis=new Plottable.Axes.Category(o,"bottom"),n.layout.add(n.xAxis,1,2)),t.hideYaxis||(r instanceof Plottable.Scales.Time?n.yAxis=new Plottable.Axes.Time(r,"left"):r instanceof Plottable.QuantitativeScale?n.yAxis=new Plottable.Axes.Numeric(r,"left"):n.yAxis=new Plottable.Axes.Category(r,"left"),n.layout.add(n.yAxis,0,1)),t.xLabel&&n.layout.add(new Plottable.Components.AxisLabel(t.xLabel),2,2),t.yLabel&&n.layout.add(new Plottable.Components.AxisLabel(t.yLabel,-90),0,0),n._setLegend(t,a),n}return mt(e,Pt),e}(),Wr=Math.ceil,Yr=Math.max,Qr=function(t,e,n,r){for(var o=-1,a=Yr(Wr((e-t)/(n||1)),0),i=Array(a);a--;)i[r?a:++o]=t,t+=n;return i},Xr=1/0,qr=1.7976931348623157e308,Zr=function(t){return t?(t=it(t))===Xr||t===-Xr?(t<0?-1:1)*qr:t===t?t:0:0===t?t:0},Kr=function(t){return function(e,n,r){return r&&"number"!=typeof r&&Nr(e,n,r)&&(n=r=void 0),e=Zr(e),void 0===n?(n=e,e=0):n=Zr(n),r=void 0===r?e<n?1:-1:Zr(r),Qr(e,n,r,t)}}(),Jr=["#C64D26","#FF7733","#415961","#65828A","#B2D0D8","#DAE3E8"],to=function(t){function e(){return pt(this,e),yt(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return mt(e,t),ht(e,[{key:"_expandSingleValueDomain",value:function(t){var n=t.map(function(t){return t.toDate()});return vt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_expandSingleValueDomain",this).call(this,n)}}]),e}(Plottable.Scales.Time),eo=[1,5,10,25,50,100,200,500,1e3],no=[1,3,6,12],ro=[1,5,10,15,30],oo=Object.freeze({DATAGOVSG_COLORS:Jr,getScale:c,getCategoryScale:f,getColorScale:d,getSingleColorScale:p,getTimeScale:h,getCustomNumberFormatter:b,getCustomTickGenerator:v,getCustomTimeAxisConfigs:m}),ao=Object.freeze({highlightOnHover:T,setupTooltip:function(t,e){(t.plot.markers||t.plot).attr("data-title",e.title);var n=void 0,r=[".render-area .bar-area rect",".render-area .symbol",".render-area .arc.outline"].join(",");t.onMount=function(t){(n=$(t).find(r)).tooltip({animation:!1,container:t.parentNode,html:!0,placement:function(e,n){var r=t.getBoundingClientRect(),o=r.width,a=r.height,i=r.top,l=r.left,u=n.getBoundingClientRect(),s=u.width,c=u.height,f=u.top,d=u.left;return d+s-l<=.7*o?"right":d-l>=.3*o?"left":f-i>=.4*a?"top":f+c-i<=.6*a?"bottom":"left"}})},t.onUnmount=function(){n.tooltip("destroy")}},setupPopover:function(t,e){var n=t.plot.markers||t.plot;n.attr("data-title",e.title),n.attr("data-content",e.content);var r=void 0,o=[".render-area .bar-area rect",".render-area .symbol",".render-area .arc.outline"].join(",");t.onMount=function(t){(r=$(t).find(o)).popover({animation:!1,container:t.parentNode,html:!0,trigger:"hover",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.width,a=r.height,i=r.top,l=r.left,u=n.getBoundingClientRect(),s=u.width,c=u.height,f=u.top,d=u.left;return d+s-l<=.7*o?"right":d-l>=.3*o?"left":f-i>=.4*a?"top":f+c-i<=.6*a?"bottom":"left"}})},t.onUnmount=function(){r.popover("destroy")}},setupPopoverOnGuideLine:function(t,e){var n=void 0;(new Plottable.Interactions.Pointer).onPointerMove(function(r){var o=t.plot.markers.entityNearest(r);o?n.attr("data-original-title",e.title(o.datum,o.index,o.dataset)).attr("data-content",e.content(o.datum,o.index,o.dataset)).popover("show"):n.popover("hide")}).onPointerExit(function(t){n.popover("hide")}).attachTo(t.plot.markers),t.onMount=function(t){this.guideLine.vertical?(n=$(t).find(".guide-line-layer.vertical .guide-line")).popover({animation:!1,container:t.parentNode,html:!0,trigger:"manual",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.width,a=r.left,i=n.getBoundingClientRect(),l=i.width;return i.left+l-a<=.7*o?"right":"left"}}):this.guideLine.horizontal&&(n=$(t).find(".guide-line-layer.horizontal .guide-line")).popover({animation:!1,container:t.parentNode,html:!0,trigger:"manual",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.height,a=r.top;return n.getBoundingClientRect().top-a>=.4*o?"top":"bottom"}})},t.onUnmount=function(){n.popover("destroy")}},setupShadowWithPopover:function(t,e){function n(){return o.domain().map(function(t){return{label:t}})}var r=t.plot.parent(),o="vertical"===t.plot.orientation()?t.plot.x().scale:t.plot.y().scale,a=new Plottable.Dataset,i=(new Plottable.Plots.Rectangle).addClass("shadow").addDataset(a).attr("data-title",e.title).attr("data-content",e.content).attr("fill","rgba(0, 0, 0, 0.1)");"vertical"===t.plot.orientation()?i.x(function(t){return o.scale(t.label)-o.stepWidth()/2}).x2(function(t){return o.scale(t.label)+o.stepWidth()/2}).y(function(t){return 0}).y2(function(t){return i.height()}):i.x(function(t){return 0}).x2(function(t){return i.width()}).y(function(t){return o.scale(t.label)-o.stepWidth()/2}).y2(function(t){return o.scale(t.label)+o.stepWidth()/2}),r.remove(t.plot),r.append(i),r.append(t.plot),(new Plottable.Interactions.Pointer).onPointerMove(function(t){i.entities().forEach(function(t){$(t.selection.node()).css("visibility","hidden").popover("hide")});var e=i.entitiesAt(t)[0];e&&$(e.selection.node()).css("visibility","visible").popover("show")}).onPointerExit(function(t){i.entities().forEach(function(t){$(t.selection.node()).css("visibility","hidden").popover("hide")})}).attachTo(i);var l=void 0;return t.onMount=function(t){a.data(n()),o.onUpdate(function(){a.data(n())}),i.renderImmediately(),(l=$(t).find(".shadow .render-area rect")).css("visibility","hidden"),"vertical"===this.plot.orientation()?l.popover({animation:!1,container:t.parentNode,html:!0,trigger:"manual",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.width,a=r.left,i=n.getBoundingClientRect(),l=i.width;return i.left+l-a<=.7*o?"right":"left"}}):l.popover({animation:!1,container:t.parentNode,html:!0,trigger:"manual",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.height,a=r.top;return n.getBoundingClientRect().top-a>=.4*o?"top":"bottom"}})},t.onUnmount=function(){l.popover("destroy")},i},setupOuterLabel:A,customizeTimeAxis:S,removeInnerPadding:k,downsampleTicks:L}),io=function(t){function e(t){pt(this,e),t=Object.assign({colorScale:d()},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return T(n),A(n,{labelFormatter:function(t){return t.label}}),n}return mt(e,Gr),e}(),lo=function(t){function e(t){pt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:p(),showGridlines:!0},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return T(n),L(n),S(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return mt(e,Ur),e}(),uo=function(t){function e(t){pt(this,e),t=Object.assign({orientation:"h",sorted:"d",scale:c(),categoryScale:f(),colorScale:p(),showGridlines:!0},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return T(n,t.isTimeSeries),I(n.yAxis,n.xAxis,t),n.xAxis.tickLabelPadding(0),n}return mt(e,Ur),e}(),so=function(t){function e(t){pt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:d(),showGridlines:!0},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return L(n),k(n),S(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return mt(e,$r),e}(),co=function(t){function e(t){pt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:d(),showGridlines:!0},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return L(n),k(n),S(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return mt(e,Hr),e}(),fo=function(t){function e(t){pt(this,e),t=Object.assign({yScale:c(),xScale:t.isTimeSeries?h():f(),colorScale:d(),showYgridlines:!0,guideLine:"v"},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return L(n),S(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return mt(e,Vr),e}(),po=Object.freeze({SimplePie:Gr,SimpleBar:Ur,GroupedBar:$r,StackedBar:Hr,MultipleLine:Vr,DatagovsgSimplePie:io,DatagovsgSimpleBar:lo,DatagovsgHorizontalBar:uo,DatagovsgGroupedBar:so,DatagovsgStackedBar:co,DatagovsgLine:fo});window.DatagovsgCharts=bt({},po,{plugins:ao,helpers:oo})}(); | ||
!function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}function e(t,n,r,o,a){var i=-1,l=t.length;for(r||(r=It),a||(a=[]);++i<l;){var u=t[i];n>0&&r(u)?n>1?e(u,n-1,r,o,a):wt(a,u):o||(a[a.length]=u)}return a}function n(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function a(t){var e=this.__data__=new Rt(t);this.size=e.size}function i(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new pe;++e<n;)this.add(t[e])}function l(t,e,n,r,o){return t===e||(null==t||null==e||!Z(t)&&!Z(e)?t!==t&&e!==e:Fn(t,e,n,r,l,o))}function u(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Qn);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(u.Cache||pe),n}function s(t){if("string"==typeof t)return t;if(kt(t))return Et(t,s)+"";if(J(t))return rr?rr.call(t):"";var e=t+"";return"0"==e&&1/t==-er?"-0":e}function c(){return(new Plottable.Scales.Linear).tickGenerator(v())}function f(t){return(new Plottable.Scales.Category).outerPadding(.2)}function d(){return(new Plottable.Scales.Color).range(Jr)}function p(){var t=(new Plottable.Scales.Color).range([Jr[0]]);return t.scale=function(t){return this._d3Scale(t)},t}function h(){return new to}function b(t){if(t){var e=Plottable.Formatters.general(5);return function(t){return e(t)+"%"}}var n=Plottable.Formatters.shortScale();return function(t){var e=n(t);return e.indexOf(".")>-1&&(e=e.replace(/\.?(0*|0{3}\d*)([KMBTQ]?)$/,"$2")),"-0"===e&&(e="0"),e}}function v(){var t=v.targetLineCount||4;return function(e){var n=e.domain(),r=gt(n,2),o=r[0],a=r[1],i=a-o,l=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),u=i/l/t,s=l*(10*(u=[2,1,.5,.2].filter(function(t){return t<=u})[0]))/10,c=Math.ceil(o/s),f=Math.floor(a/s);return Kr(c,f+1).map(function(t){return t*s})}}function m(t){switch(t){case"year":case"financial_year":return y();case"half_year":case"financial_half_year":return[].concat(_t(g()),_t(y()));case"quarter":case"financial_quarter":return[].concat(_t(_()),_t(y()));case"month":return[].concat(_t(P()),_t(y()));case"week":return[].concat(_t(w()),_t(y()));case"date":return[].concat(_t(x()),_t(P()),_t(y()));case"date_time":return[].concat(_t(O()),_t(x()),_t(P()),_t(y()));case"time":return j()}}function y(){return eo.map(function(t){return[{interval:Plottable.TimeInterval.year,step:t,formatter:Plottable.Formatters.time("%Y")}]})}function g(){return[[{interval:Plottable.TimeInterval.month,step:6,formatter:function(t){var e=new Date(t);return"H"+Math.floor(e.getMonth()/6)+1}},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function _(){return[[{interval:Plottable.TimeInterval.month,step:3,formatter:function(t){var e=new Date(t);return"Q"+Math.floor(e.getMonth()/3)+1}},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function P(){return[[{interval:Plottable.TimeInterval.month,step:1,formatter:Plottable.Formatters.time("%B")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}],[{interval:Plottable.TimeInterval.month,step:1,formatter:Plottable.Formatters.time("%b")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}],[{interval:Plottable.TimeInterval.month,step:1,formatter:Plottable.Formatters.time("%m")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}],[{interval:Plottable.TimeInterval.month,step:1,formatter:Plottable.Formatters.time("%-m")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function w(){return[[{interval:Plottable.TimeInterval.week,step:1,formatter:function(t){return"W"+d3.time.mondayOfYear(t)+1}},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function x(){return[[{interval:Plottable.TimeInterval.day,step:1,formatter:Plottable.Formatters.time("%e")},{interval:Plottable.TimeInterval.year,step:1,formatter:Plottable.Formatters.time("%Y")}]]}function O(){var t=[];return no.forEach(function(e){t.push([{interval:Plottable.TimeInterval.hour,step:e,formatter:Plottable.Formatters.time("%I %p")},{interval:Plottable.TimeInterval.day,step:1,formatter:Plottable.Formatters.time("%B %e, %Y")}])}),ro.forEach(function(e){t.push([{interval:Plottable.TimeInterval.minute,step:e,formatter:Plottable.Formatters.time("%I:%M %p")},{interval:Plottable.TimeInterval.day,step:1,formatter:Plottable.Formatters.time("%B %e, %Y")}]),t.push([{interval:Plottable.TimeInterval.second,step:e,formatter:Plottable.Formatters.time("%I:%M:%S %p")},{interval:Plottable.TimeInterval.day,step:1,formatter:Plottable.Formatters.time("%B %e, %Y")}])}),t}function j(){var t=[];return no.forEach(function(e){t.push([{interval:Plottable.TimeInterval.hour,step:e,formatter:Plottable.Formatters.time("%I %p")}])}),ro.forEach(function(e){t.push([{interval:Plottable.TimeInterval.minute,step:e,formatter:Plottable.Formatters.time("%I:%M %p")}]),t.push([{interval:Plottable.TimeInterval.second,step:e,formatter:Plottable.Formatters.time("%I:%M:%S %p")}])}),t}function T(t,e){(new Plottable.Interactions.Pointer).onPointerMove(function(e){t.plot.entities().forEach(function(t){t.selection.classed("highlight",!1).style("fill","")});var n=t.plot.entitiesAt(e)[0];n&&n.selection.classed("highlight",!0).style("fill","lightgrey")}).onPointerExit(function(e){t.plot.entities().forEach(function(t){t.selection.classed("highlight",!1).style("fill","")})}).attachTo(t.plot)}function A(t){function e(){t.plot.background().select(".label-area").remove()}function n(){var n=Math.min(t.plot.width(),t.plot.height())/2,o=d3.svg.arc().innerRadius(0).outerRadius(.8*n),a=d3.svg.arc().innerRadius(.8*n).outerRadius(n),i=d3.layout.pie().sort(null).value(function(t){return t.value})(t.dataset.data()).map(function(t,e){var i=.5*t.startAngle+.5*t.endAngle<Math.PI,l=o.centroid(t),u=a.centroid(t),s=[(i?1:-1)*n*.95,u[1]],c=[(i?1:-1)*n,u[1]];return{text:r.labelFormatter(t.data,e),textAnchor:i?"start":"end",textOffset:c,polyline:[l,u,s]}}),l=[t.plot.width()/2,t.plot.height()/2];e();var u=t.plot.background().insert("g").classed("label-area",!0).attr("transform","translate("+l.join(",")+")").selectAll("g").data(i).enter().append("g").classed("label",!0);u.append("text").text(function(t){return t.text}).attr("dy","0.35em").attr("transform",function(t){return"translate("+t.textOffset.join(",")+")"}).style("text-anchor",function(t){return t.textAnchor}),u.append("polyline").attr("points",function(t){return t.polyline})}var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{labelFormatter:function(t){return t.label}};t.plot.outerRadius(function(e){return.8*(Math.min(t.plot.width(),t.plot.height())/2)}),t.plot._clipPathEnabled=!1,t.onMount=function(t){n()},t.onUpdate=function(t){n()},t.onResize=function(){n()},t.onUnmount=function(){e()}}function S(t,e){var n=t.xAxis;n instanceof Plottable.Axes.Time&&(n.axisConfigurations(m(e)),"year"!==e&&"financial_year"!==e||n.tierLabelPositions(n.tierLabelPositions().map(function(t){return"center"})))}function k(t){var e=t.plot._makeInnerScale;t.plot._makeInnerScale=function(){return e.call(this).innerPadding(0).outerPadding(0)}}function L(t){var e=t.xAxis;if(e instanceof Plottable.Axes.Category){var n=e.renderImmediately;e.renderImmediately=function(){var t=this,e=1.5*d3.max(this._scale.domain(),function(e){return t._measurer.measure(e.toString()).width}),r=Math.ceil(e/this._scale.stepWidth()),o=this._scale.domain,a=this._scale.stepWidth;this._scale.domain=function(){return o.call(this).filter(function(t,e){return e%r==0})},this._scale.stepWidth=function(){return a.call(this)*r},n.call(this),this._scale.domain=o,this._scale.stepWidth=a};var r=e._measureTicks;e._measureTicks=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var o=this._wrapper.wrap;this._wrapper.wrap=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=o.call.apply(o,[this].concat(e));return r.wrappedText=r.originalText,r};var a=r.call.apply(r,[this].concat(_t(e)));return this._wrapper.wrap=o,a}}}function I(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.margin(12).innerTickLength(5).endTickLength(0).tickLabelPadding(5),e.margin(12).innerTickLength(0).endTickLength(0).tickLabelPadding(5).showEndTickLabels(!0).addClass("hide-baseline").formatter(b(n.isPercentage)),e._hideOverflowingTickLabels=function(){return null}}var C=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},E="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},z="object"==typeof E&&E&&E.Object===Object&&E,M="object"==typeof self&&self&&self.Object===Object&&self,F=z||M||Function("return this")(),R=function(){return F.Date.now()},D=F.Symbol,N=Object.prototype,B=N.hasOwnProperty,G=N.toString,U=D?D.toStringTag:void 0,H=function(t){var e=B.call(t,U),n=t[U];try{t[U]=void 0;var r=!0}catch(t){}var o=G.call(t);return r&&(e?t[U]=n:delete t[U]),o},V=Object.prototype.toString,W=function(t){return V.call(t)},Y="[object Null]",Q="[object Undefined]",X=D?D.toStringTag:void 0,q=function(t){return null==t?void 0===t?Q:Y:X&&X in Object(t)?H(t):W(t)},Z=function(t){return null!=t&&"object"==typeof t},K="[object Symbol]",J=function(t){return"symbol"==typeof t||Z(t)&&q(t)==K},tt=NaN,et=/^\s+|\s+$/g,nt=/^[-+]0x[0-9a-f]+$/i,rt=/^0b[01]+$/i,ot=/^0o[0-7]+$/i,at=parseInt,it=function(t){if("number"==typeof t)return t;if(J(t))return tt;if(C(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=C(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(et,"");var n=rt.test(t);return n||ot.test(t)?at(t.slice(2),n?2:8):nt.test(t)?tt:+t},lt="Expected a function",ut=Math.max,st=Math.min,ct=function(t,e,n){function r(e){var n=c,r=f;return c=f=void 0,v=e,p=t.apply(r,n)}function o(t){return v=t,h=setTimeout(l,e),m?r(t):p}function a(t){var n=t-v,r=e-(t-b);return y?st(r,d-n):r}function i(t){var n=t-b,r=t-v;return void 0===b||n>=e||n<0||y&&r>=d}function l(){var t=R();if(i(t))return u(t);h=setTimeout(l,a(t))}function u(t){return h=void 0,g&&c?r(t):(c=f=void 0,p)}function s(){var t=R(),n=i(t);if(c=arguments,f=this,b=t,n){if(void 0===h)return o(b);if(y)return h=setTimeout(l,e),r(b)}return void 0===h&&(h=setTimeout(l,e)),p}var c,f,d,p,h,b,v=0,m=!1,y=!1,g=!0;if("function"!=typeof t)throw new TypeError(lt);return e=it(e)||0,C(n)&&(m=!!n.leading,d=(y="maxWait"in n)?ut(it(n.maxWait)||0,e):d,g="trailing"in n?!!n.trailing:g),s.cancel=function(){void 0!==h&&clearTimeout(h),v=0,c=b=f=h=void 0},s.flush=function(){return void 0===h?p:u(R())},s},ft="Expected a function",dt=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError(ft);return C(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),ct(t,e,{leading:r,maxWait:e,trailing:o})},pt=(function(){function t(t){this.value=t}function e(e){function n(o,a){try{var i=e[o](a),l=i.value;l instanceof t?Promise.resolve(l.value).then(function(t){n("next",t)},function(t){n("throw",t)}):r(i.done?"return":"normal",i.value)}catch(t){r("throw",t)}}function r(t,e){switch(t){case"return":o.resolve({value:e,done:!0});break;case"throw":o.reject(e);break;default:o.resolve({value:e,done:!1})}(o=o.next)?n(o.key,o.arg):a=null}var o,a;this._invoke=function(t,e){return new Promise(function(r,i){var l={key:t,arg:e,resolve:r,reject:i,next:null};a?a=a.next=l:(o=a=l,n(t,e))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(t){return this._invoke("next",t)},e.prototype.throw=function(t){return this._invoke("throw",t)},e.prototype.return=function(t){return this._invoke("return",t)}}(),function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}),ht=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),bt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},vt=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,r)}if("value"in o)return o.value;var i=o.get;if(void 0!==i)return i.call(r)},mt=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},yt=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},gt=function(){function t(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=t[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_t=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)},Pt=function(){function t(){pt(this,t),this.options={innerRadius:0,strokeWidth:2,markerSize:0,sorted:!1,orientation:"v",baselineValue:0,hideXaxis:!1,hideYaxis:!1,showGridLines:!1,showXgridlines:!1,showYgridlines:!1,guideLine:"none",legendPosition:"r",animated:!0},this.resizeHandler=dt(this.resizeHandler,200).bind(this),this._onMount=[],this._onUnmount=[],this._onUpdate=[],this._onResize=[]}return ht(t,[{key:"update",value:function(t){this.datasets=t.data.map(function(t){return new Plottable.Dataset(t.series,t.label)}),this.plot.datasets(this.datasets),this.options.data=t.data,this.onUpdate(t)}},{key:"_setGridlines",value:function(t,e){if(t.showGridlines){var n="h"===t.orientation,r=n?e:null,o=n?null:e;this.gridlines=new Plottable.Components.Gridlines(r,o)}}},{key:"_setAxes",value:function(t,e,n){var r="h"===t.orientation;t.hideXaxis||(this.xAxis=r?new Plottable.Axes.Numeric(e,"bottom"):n instanceof Plottable.Scales.Time?new Plottable.Axes.Time(n,"bottom"):new Plottable.Axes.Category(n,"bottom"),this.layout.add(this.xAxis,1,2)),t.hideYaxis||(this.yAxis=r?n instanceof Plottable.Scales.Time?new Plottable.Axes.Time(n,"left"):new Plottable.Axes.Category(n,"left"):new Plottable.Axes.Numeric(e,"left"),this.layout.add(this.yAxis,0,1)),t.xLabel&&this.layout.add(new Plottable.Components.AxisLabel(t.xLabel),2,2),t.yLabel&&this.layout.add(new Plottable.Components.AxisLabel(t.yLabel,-90),0,0)}},{key:"_setLegend",value:function(t,e){switch(this.legend=new Plottable.Components.Legend(e).xAlignment("center").yAlignment("center"),t.legendPosition){case"t":this.layout=new Plottable.Components.Table([[this.legend.maxEntriesPerRow(1/0)],[this.layout]]).rowPadding(10);break;case"r":this.layout=new Plottable.Components.Table([[this.layout,this.legend]]).columnPadding(10);break;case"b":this.layout=new Plottable.Components.Table([[this.layout],[this.legend.maxEntriesPerRow(1/0)]]).rowPadding(10);break;case"l":this.layout=new Plottable.Components.Table([[this.legend,this.layout]]).columnPadding(10)}}},{key:"_setInteractions",value:function(t){var e=this;t.clickHandler&&(new Plottable.Interactions.Click).onClick(function(n){var r=e.plot.entitiesAt(n)[0];t.clickHandler(r,e.plot.entities())}).attachTo(this.plot),t.hoverHandler&&(new Plottable.Interactions.Pointer).onPointerMove(function(n){var r=e.plot.entitiesAt(n)[0];t.hoverHandler(r,e.plot.entities())}).onPointerExit(function(n){t.hoverHandler(null,e.plot.entities())}).attachTo(this.plot)}},{key:"resizeHandler",value:function(){this.layout.redraw(),this.onResize()}},{key:"mount",value:function(t){this.layout.renderTo(t),window.addEventListener("resize",this.resizeHandler),this.onMount(t)}},{key:"unmount",value:function(){this.onUnmount(),window.removeEventListener("resize",this.resizeHandler),this.layout.detach()}},{key:"onMount",get:function(){return function(t){var e=this;this._onMount.forEach(function(n){n.call(e,t)})}},set:function(t){this._onMount.push(t)}},{key:"onUnmount",get:function(){return function(t){var e=this;this._onUnmount.forEach(function(t){t.call(e)})}},set:function(t){this._onUnmount.push(t)}},{key:"onUpdate",get:function(){return function(t){var e=this;Plottable.Utils.DOM.requestAnimationFramePolyfill(function(){e._onUpdate.forEach(function(n){n.call(e,t)})})}},set:function(t){this._onUpdate.push(t)}},{key:"onResize",get:function(){return function(){var t=this;Plottable.Utils.DOM.requestAnimationFramePolyfill(function(){t._onResize.forEach(function(e){e.call(t)})})}},set:function(t){this._onResize.push(t)}}]),t}(),wt=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},xt="[object Arguments]",Ot=function(t){return Z(t)&&q(t)==xt},jt=Object.prototype,Tt=jt.hasOwnProperty,At=jt.propertyIsEnumerable,St=Ot(function(){return arguments}())?Ot:function(t){return Z(t)&&Tt.call(t,"callee")&&!At.call(t,"callee")},kt=Array.isArray,Lt=D?D.isConcatSpreadable:void 0,It=function(t){return kt(t)||St(t)||!!(Lt&&t&&t[Lt])},Ct=e,Et=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o},zt=function(t,e){return t===e||t!==t&&e!==e},Mt=function(t,e){for(var n=t.length;n--;)if(zt(t[n][0],e))return n;return-1},Ft=Array.prototype.splice;n.prototype.clear=function(){this.__data__=[],this.size=0},n.prototype.delete=function(t){var e=this.__data__,n=Mt(e,t);return!(n<0||(n==e.length-1?e.pop():Ft.call(e,n,1),--this.size,0))},n.prototype.get=function(t){var e=this.__data__,n=Mt(e,t);return n<0?void 0:e[n][1]},n.prototype.has=function(t){return Mt(this.__data__,t)>-1},n.prototype.set=function(t,e){var n=this.__data__,r=Mt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Rt=n,Dt="[object AsyncFunction]",Nt="[object Function]",Bt="[object GeneratorFunction]",Gt="[object Proxy]",Ut=function(t){if(!C(t))return!1;var e=q(t);return e==Nt||e==Bt||e==Dt||e==Gt},$t=F["__core-js_shared__"],Ht=function(){var t=/[^.]+$/.exec($t&&$t.keys&&$t.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Vt=function(t){return!!Ht&&Ht in t},Wt=Function.prototype.toString,Yt=function(t){if(null!=t){try{return Wt.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Qt=/[\\^$.*+?()[\]{}|]/g,Xt=/^\[object .+?Constructor\]$/,qt=Function.prototype,Zt=Object.prototype,Kt=qt.toString,Jt=Zt.hasOwnProperty,te=RegExp("^"+Kt.call(Jt).replace(Qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ee=function(t){return!(!C(t)||Vt(t))&&(Ut(t)?te:Xt).test(Yt(t))},ne=function(t,e){return null==t?void 0:t[e]},re=function(t,e){var n=ne(t,e);return ee(n)?n:void 0},oe=re(F,"Map"),ae=re(Object,"create"),ie="__lodash_hash_undefined__",le=Object.prototype.hasOwnProperty,ue=Object.prototype.hasOwnProperty,se="__lodash_hash_undefined__";r.prototype.clear=function(){this.__data__=ae?ae(null):{},this.size=0},r.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},r.prototype.get=function(t){var e=this.__data__;if(ae){var n=e[t];return n===ie?void 0:n}return le.call(e,t)?e[t]:void 0},r.prototype.has=function(t){var e=this.__data__;return ae?void 0!==e[t]:ue.call(e,t)},r.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ae&&void 0===e?se:e,this};var ce=r,fe=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t},de=function(t,e){var n=t.__data__;return fe(e)?n["string"==typeof e?"string":"hash"]:n.map};o.prototype.clear=function(){this.size=0,this.__data__={hash:new ce,map:new(oe||Rt),string:new ce}},o.prototype.delete=function(t){var e=de(this,t).delete(t);return this.size-=e?1:0,e},o.prototype.get=function(t){return de(this,t).get(t)},o.prototype.has=function(t){return de(this,t).has(t)},o.prototype.set=function(t,e){var n=de(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var pe=o,he=200;a.prototype.clear=function(){this.__data__=new Rt,this.size=0},a.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},a.prototype.get=function(t){return this.__data__.get(t)},a.prototype.has=function(t){return this.__data__.has(t)},a.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Rt){var r=n.__data__;if(!oe||r.length<he-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new pe(r)}return n.set(t,e),this.size=n.size,this};var be=a,ve="__lodash_hash_undefined__";i.prototype.add=i.prototype.push=function(t){return this.__data__.set(t,ve),this},i.prototype.has=function(t){return this.__data__.has(t)};var me=i,ye=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},ge=function(t,e){return t.has(e)},_e=1,Pe=2,we=function(t,e,n,r,o,a){var i=n&_e,l=t.length,u=e.length;if(l!=u&&!(i&&u>l))return!1;var s=a.get(t);if(s&&a.get(e))return s==e;var c=-1,f=!0,d=n&Pe?new me:void 0;for(a.set(t,e),a.set(e,t);++c<l;){var p=t[c],h=e[c];if(r)var b=i?r(h,p,c,e,t,a):r(p,h,c,t,e,a);if(void 0!==b){if(b)continue;f=!1;break}if(d){if(!ye(e,function(t,e){if(!ge(d,e)&&(p===t||o(p,t,n,r,a)))return d.push(e)})){f=!1;break}}else if(p!==h&&!o(p,h,n,r,a)){f=!1;break}}return a.delete(t),a.delete(e),f},xe=F.Uint8Array,Oe=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n},je=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n},Te=1,Ae=2,Se="[object Boolean]",ke="[object Date]",Le="[object Error]",Ie="[object Map]",Ce="[object Number]",Ee="[object RegExp]",ze="[object Set]",Me="[object String]",Fe="[object Symbol]",Re="[object ArrayBuffer]",De="[object DataView]",Ne=D?D.prototype:void 0,Be=Ne?Ne.valueOf:void 0,Ge=function(t,e,n,r,o,a,i){switch(n){case De:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Re:return!(t.byteLength!=e.byteLength||!a(new xe(t),new xe(e)));case Se:case ke:case Ce:return zt(+t,+e);case Le:return t.name==e.name&&t.message==e.message;case Ee:case Me:return t==e+"";case Ie:var l=Oe;case ze:var u=r&Te;if(l||(l=je),t.size!=e.size&&!u)return!1;var s=i.get(t);if(s)return s==e;r|=Ae,i.set(t,e);var c=we(l(t),l(e),r,o,a,i);return i.delete(t),c;case Fe:if(Be)return Be.call(t)==Be.call(e)}return!1},Ue=function(t,e,n){var r=e(t);return kt(t)?r:wt(r,n(t))},$e=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[o++]=i)}return a},He=Object.prototype.propertyIsEnumerable,Ve=Object.getOwnPropertySymbols,We=Ve?function(t){return null==t?[]:(t=Object(t),$e(Ve(t),function(e){return He.call(t,e)}))}:function(){return[]},Ye=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r},Qe=function(){return!1},Xe=t(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n?F.Buffer:void 0,a=(o?o.isBuffer:void 0)||Qe;t.exports=a}),qe=9007199254740991,Ze=/^(?:0|[1-9]\d*)$/,Ke=function(t,e){return!!(e=null==e?qe:e)&&("number"==typeof t||Ze.test(t))&&t>-1&&t%1==0&&t<e},Je=9007199254740991,tn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Je},en={};en["[object Float32Array]"]=en["[object Float64Array]"]=en["[object Int8Array]"]=en["[object Int16Array]"]=en["[object Int32Array]"]=en["[object Uint8Array]"]=en["[object Uint8ClampedArray]"]=en["[object Uint16Array]"]=en["[object Uint32Array]"]=!0,en["[object Arguments]"]=en["[object Array]"]=en["[object ArrayBuffer]"]=en["[object Boolean]"]=en["[object DataView]"]=en["[object Date]"]=en["[object Error]"]=en["[object Function]"]=en["[object Map]"]=en["[object Number]"]=en["[object Object]"]=en["[object RegExp]"]=en["[object Set]"]=en["[object String]"]=en["[object WeakMap]"]=!1;var nn=function(t){return function(e){return t(e)}},rn=t(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n&&z.process,a=function(){try{return o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}),on=rn&&rn.isTypedArray,an=on?nn(on):function(t){return Z(t)&&tn(t.length)&&!!en[q(t)]},ln=Object.prototype.hasOwnProperty,un=function(t,e){var n=kt(t),r=!n&&St(t),o=!n&&!r&&Xe(t),a=!n&&!r&&!o&&an(t),i=n||r||o||a,l=i?Ye(t.length,String):[],u=l.length;for(var s in t)!e&&!ln.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ke(s,u))||l.push(s);return l},sn=Object.prototype,cn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||sn)},fn=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),dn=Object.prototype.hasOwnProperty,pn=function(t){if(!cn(t))return fn(t);var e=[];for(var n in Object(t))dn.call(t,n)&&"constructor"!=n&&e.push(n);return e},hn=function(t){return null!=t&&tn(t.length)&&!Ut(t)},bn=function(t){return hn(t)?un(t):pn(t)},vn=function(t){return Ue(t,bn,We)},mn=1,yn=Object.prototype.hasOwnProperty,gn=function(t,e,n,r,o,a){var i=n&mn,l=vn(t),u=l.length;if(u!=vn(e).length&&!i)return!1;for(var s=u;s--;){var c=l[s];if(!(i?c in e:yn.call(e,c)))return!1}var f=a.get(t);if(f&&a.get(e))return f==e;var d=!0;a.set(t,e),a.set(e,t);for(var p=i;++s<u;){var h=t[c=l[s]],b=e[c];if(r)var v=i?r(b,h,c,e,t,a):r(h,b,c,t,e,a);if(!(void 0===v?h===b||o(h,b,n,r,a):v)){d=!1;break}p||(p="constructor"==c)}if(d&&!p){var m=t.constructor,y=e.constructor;m!=y&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y)&&(d=!1)}return a.delete(t),a.delete(e),d},_n=re(F,"DataView"),Pn=re(F,"Promise"),wn=re(F,"Set"),xn=re(F,"WeakMap"),On=Yt(_n),jn=Yt(oe),Tn=Yt(Pn),An=Yt(wn),Sn=Yt(xn),kn=q;(_n&&"[object DataView]"!=kn(new _n(new ArrayBuffer(1)))||oe&&"[object Map]"!=kn(new oe)||Pn&&"[object Promise]"!=kn(Pn.resolve())||wn&&"[object Set]"!=kn(new wn)||xn&&"[object WeakMap]"!=kn(new xn))&&(kn=function(t){var e=q(t),n="[object Object]"==e?t.constructor:void 0,r=n?Yt(n):"";if(r)switch(r){case On:return"[object DataView]";case jn:return"[object Map]";case Tn:return"[object Promise]";case An:return"[object Set]";case Sn:return"[object WeakMap]"}return e});var Ln=kn,In=1,Cn="[object Arguments]",En="[object Array]",zn="[object Object]",Mn=Object.prototype.hasOwnProperty,Fn=function(t,e,n,r,o,a){var i=kt(t),l=kt(e),u=i?En:Ln(t),s=l?En:Ln(e),c=(u=u==Cn?zn:u)==zn,f=(s=s==Cn?zn:s)==zn,d=u==s;if(d&&Xe(t)){if(!Xe(e))return!1;i=!0,c=!1}if(d&&!c)return a||(a=new be),i||an(t)?we(t,e,n,r,o,a):Ge(t,e,u,n,r,o,a);if(!(n&In)){var p=c&&Mn.call(t,"__wrapped__"),h=f&&Mn.call(e,"__wrapped__");if(p||h){var b=p?t.value():t,v=h?e.value():e;return a||(a=new be),o(b,v,n,r,a)}}return!!d&&(a||(a=new be),gn(t,e,n,r,o,a))},Rn=l,Dn=1,Nn=2,Bn=function(t,e,n,r){var o=n.length,a=o,i=!r;if(null==t)return!a;for(t=Object(t);o--;){var l=n[o];if(i&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++o<a;){var u=(l=n[o])[0],s=t[u],c=l[1];if(i&&l[2]){if(void 0===s&&!(u in t))return!1}else{var f=new be;if(r)var d=r(s,c,u,t,e,f);if(!(void 0===d?Rn(c,s,Dn|Nn,r,f):d))return!1}}return!0},Gn=function(t){return t===t&&!C(t)},Un=function(t){for(var e=bn(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Gn(o)]}return e},$n=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},Hn=function(t){var e=Un(t);return 1==e.length&&e[0][2]?$n(e[0][0],e[0][1]):function(n){return n===t||Bn(n,t,e)}},Vn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wn=/^\w*$/,Yn=function(t,e){if(kt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!J(t))||Wn.test(t)||!Vn.test(t)||null!=e&&t in Object(e)},Qn="Expected a function";u.Cache=pe;var Xn=u,qn=500,Zn=/^\./,Kn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jn=/\\(\\)?/g,tr=function(t){var e=Xn(t,function(t){return n.size===qn&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return Zn.test(t)&&e.push(""),t.replace(Kn,function(t,n,r,o){e.push(r?o.replace(Jn,"$1"):n||t)}),e}),er=1/0,nr=D?D.prototype:void 0,rr=nr?nr.toString:void 0,or=s,ar=function(t){return null==t?"":or(t)},ir=function(t,e){return kt(t)?t:Yn(t,e)?[t]:tr(ar(t))},lr=1/0,ur=function(t){if("string"==typeof t||J(t))return t;var e=t+"";return"0"==e&&1/t==-lr?"-0":e},sr=function(t,e){for(var n=0,r=(e=ir(e,t)).length;null!=t&&n<r;)t=t[ur(e[n++])];return n&&n==r?t:void 0},cr=function(t,e,n){var r=null==t?void 0:sr(t,e);return void 0===r?n:r},fr=function(t,e){return null!=t&&e in Object(t)},dr=function(t,e,n){for(var r=-1,o=(e=ir(e,t)).length,a=!1;++r<o;){var i=ur(e[r]);if(!(a=null!=t&&n(t,i)))break;t=t[i]}return a||++r!=o?a:!!(o=null==t?0:t.length)&&tn(o)&&Ke(i,o)&&(kt(t)||St(t))},pr=function(t,e){return null!=t&&dr(t,e,fr)},hr=1,br=2,vr=function(t,e){return Yn(t)&&Gn(e)?$n(ur(t),e):function(n){var r=cr(n,t);return void 0===r&&r===e?pr(n,t):Rn(e,r,hr|br)}},mr=function(t){return t},yr=function(t){return function(e){return null==e?void 0:e[t]}},gr=function(t){return function(e){return sr(e,t)}},_r=function(t){return Yn(t)?yr(ur(t)):gr(t)},Pr=function(t){return"function"==typeof t?t:null==t?mr:"object"==typeof t?kt(t)?vr(t[0],t[1]):Hn(t):_r(t)},wr=function(t){return function(e,n,r){for(var o=-1,a=Object(e),i=r(e),l=i.length;l--;){var u=i[t?l:++o];if(!1===n(a[u],u,a))break}return e}}(),xr=function(t,e){return function(n,r){if(null==n)return n;if(!hn(n))return t(n,r);for(var o=n.length,a=e?o:-1,i=Object(n);(e?a--:++a<o)&&!1!==r(i[a],a,i););return n}}(function(t,e){return t&&wr(t,e,bn)}),Or=function(t,e){var n=-1,r=hn(t)?Array(t.length):[];return xr(t,function(t,o,a){r[++n]=e(t,o,a)}),r},jr=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t},Tr=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t===t,a=J(t),i=void 0!==e,l=null===e,u=e===e,s=J(e);if(!l&&!s&&!a&&t>e||a&&i&&u&&!l&&!s||r&&i&&u||!n&&u||!o)return 1;if(!r&&!a&&!s&&t<e||s&&n&&o&&!r&&!a||l&&n&&o||!i&&o||!u)return-1}return 0},Ar=function(t,e,n){for(var r=-1,o=t.criteria,a=e.criteria,i=o.length,l=n.length;++r<i;){var u=Tr(o[r],a[r]);if(u)return r>=l?u:u*("desc"==n[r]?-1:1)}return t.index-e.index},Sr=function(t,e,n){var r=-1;e=Et(e.length?e:[mr],nn(Pr));var o=Or(t,function(t,n,o){return{criteria:Et(e,function(e){return e(t)}),index:++r,value:t}});return jr(o,function(t,e){return Ar(t,e,n)})},kr=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},Lr=Math.max,Ir=function(t,e,n){return e=Lr(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,a=Lr(r.length-e,0),i=Array(a);++o<a;)i[o]=r[e+o];o=-1;for(var l=Array(e+1);++o<e;)l[o]=r[o];return l[e]=n(i),kr(t,this,l)}},Cr=function(t){return function(){return t}},Er=function(){try{var t=re(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),zr=Er?function(t,e){return Er(t,"toString",{configurable:!0,enumerable:!1,value:Cr(e),writable:!0})}:mr,Mr=800,Fr=16,Rr=Date.now,Dr=function(t){var e=0,n=0;return function(){var r=Rr(),o=Fr-(r-n);if(n=r,o>0){if(++e>=Mr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(zr),Nr=function(t,e,n){if(!C(n))return!1;var r=typeof e;return!!("number"==r?hn(n)&&Ke(e,n.length):"string"==r&&e in n)&&zt(n[e],t)},Br=function(t,e){return Dr(Ir(t,e,mr),t+"")}(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Nr(t,e[0],e[1])?e=[]:n>2&&Nr(e[0],e[1],e[2])&&(e=[e[0]]),Sr(t,Ct(e,1),[])}),Gr=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.options.legendPosition="none",(t=Object.assign(n.options,t)).sorted&&(t.data=Br(t.data,"value")),"d"===t.sorted&&t.data.reverse(),n.dataset=new Plottable.Dataset(t.data);var r=t.data.reduce(function(t,e){return t+e.value},0),o=(new Plottable.Scales.Linear).domain([0,r]),a=t.colorScale||new Plottable.Scales.Color;return t.outerRadius=t.outerRadius||function(t){return Math.min(n.plot.width(),n.plot.height())/2},n.plot=(new Plottable.Plots.Pie).addClass("simple-pie-plot").addDataset(n.dataset).sectorValue(function(t){return t.value},o).attr("fill",function(t){return t.label},a).labelsEnabled(!1).innerRadius(t.innerRadius).outerRadius(t.outerRadius).animated(t.animated),t.labelFormatter&&n.plot.labelFormatter(t.labelFormatter).labelsEnabled(!0),n.layout=n.plot,n._setLegend(t,a),n._setInteractions(t),n}return mt(e,Pt),ht(e,[{key:"update",value:function(t){this.options.sorted&&(t.data=Br(t.data,"value")),"d"===this.options.sorted&&t.data.reverse();var e=t.data.reduce(function(t,e){return t+e.value},0);this.plot.sectorValue().scale.domain([0,e]),this.dataset.data(t.data),Object.assign(this.options,{data:t.data}),this.onUpdate(t)}}]),e}(),Ur=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.options.legendPosition="none",(t=Object.assign(n.options,t)).sorted&&(t.data=Br(t.data,"value")),"d"===t.sorted&&t.data.reverse(),n.dataset=new Plottable.Dataset(t.data);var r=t.scale||new Plottable.Scales.Linear,o=t.categoryScale||new Plottable.Scales.Category,a=t.colorScale||new Plottable.Scales.Color,i="h"===t.orientation,l=i?Plottable.Plots.Bar.ORIENTATION_HORIZONTAL:Plottable.Plots.Bar.ORIENTATION_VERTICAL;n.plot=new Plottable.Plots.Bar(l).addDataset(n.dataset).attr("fill",function(t){return t.label},a).labelsEnabled(!1).animated(t.animated).baselineValue(t.baselineValue),n.plot[i?"x":"y"](function(t){return t.value},r),n.plot[i?"y":"x"](function(t){return t.label},o),t.labelFormatter&&n.plot.labelFormatter(n.props.labelFormatter).labelsEnabled(!0),n._setGridlines(t,r);var u=n.gridlines?new Plottable.Components.Group([n.gridlines,n.plot]):n.plot;return n.layout=new Plottable.Components.Table([[null,null,u],[null,null,null],[null,null,null]]),n._setAxes(t,r,o),n._setLegend(t,a),n._setInteractions(t),n}return mt(e,Pt),ht(e,[{key:"update",value:function(t){this.options.sorted&&(t.data=Br(t.data,"value")),"d"===this.options.sorted&&t.data.reverse(),this.dataset.data(t.data),Object.assign(this.options,{data:t.data}),this.onUpdate(t)}}]),e}(),$r=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this)),r=(t=Object.assign(n.options,t)).scale||new Plottable.Scales.Linear,o=t.categoryScale||new Plottable.Scales.Category,a=t.colorScale||new Plottable.Scales.Color,i="h"===t.orientation,l=i?Plottable.Plots.Bar.ORIENTATION_HORIZONTAL:Plottable.Plots.Bar.ORIENTATION_VERTICAL;n.plot=new Plottable.Plots.ClusteredBar(l).attr("fill",function(t,e,n){return n.metadata()},a).labelsEnabled(!1).animated(t.animated).baselineValue(t.baselineValue),n.plot[i?"x":"y"](function(t){return t.value},r),n.plot[i?"y":"x"](function(t){return t.label},o),t.data&&(n.datasets=t.data.map(function(t){return new Plottable.Dataset(t.series,t.label)}),n.datasets.forEach(function(t){n.plot.addDataset(t)})),t.labelFormatter&&n.plot.labelFormatter(t.labelFormatter).labelsEnabled(!0),n._setGridlines(t,r);var u=n.gridlines?new Plottable.Components.Group([n.gridlines,n.plot]):n.plot;return n.layout=new Plottable.Components.Table([[null,null,u],[null,null,null],[null,null,null]]),n._setAxes(t,r,o),n._setLegend(t,a),n._setInteractions(t),n}return mt(e,Pt),e}(),Hr=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this)),r=(t=Object.assign(n.options,t)).scale||new Plottable.Scales.Linear,o=t.categoryScale||new Plottable.Scales.Category,a=t.colorScale||new Plottable.Scales.Color,i="h"===t.orientation,l=i?Plottable.Plots.Bar.ORIENTATION_HORIZONTAL:Plottable.Plots.Bar.ORIENTATION_VERTICAL;n.plot=new Plottable.Plots.StackedBar(l).attr("fill",function(t,e,n){return n.metadata()},a).labelsEnabled(!1).animated(t.animated).baselineValue(t.baselineValue),n.plot[i?"x":"y"](function(t){return t.value},r),n.plot[i?"y":"x"](function(t){return t.label},o),t.data&&(n.datasets=t.data.map(function(t){return new Plottable.Dataset(t.series,t.label)}),n.datasets.forEach(function(t){n.plot.addDataset(t)})),t.labelFormatter&&n.plot.labelFormatter(n.props.labelFormatter).labelsEnabled(!0),n._setGridlines(t,r);var u=n.gridlines?new Plottable.Components.Group([n.gridlines,n.plot]):n.plot;return n.layout=new Plottable.Components.Table([[null,null,u],[null,null,null],[null,null,null]]),n._setAxes(t,r,o),n._setLegend(t,a),n._setInteractions(t),n}return mt(e,Pt),e}(),Vr=function(t){function e(t){pt(this,e);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this)),r=(t=Object.assign(n.options,t)).yScale||new Plottable.Scales.Linear,o=t.xScale||new Plottable.Scales.Linear,a=t.colorScale||new Plottable.Scales.Color;n.plot={lines:(new Plottable.Plots.Line).attr("stroke",function(t,e,n){return n.metadata()},a).x(function(t){return t.label},o).y(function(t){return t.value},r).attr("stroke-width",t.strokeWidth),markers:(new Plottable.Plots.Scatter).attr("opacity",1).attr("fill",function(t,e,n){return n.metadata()},a).x(function(t){return t.label},o).y(function(t){return t.value},r).size(t.markerSize)},t.data&&(n.datasets=t.data.map(function(t){return new Plottable.Dataset(t.series,t.label)}),n.datasets.forEach(function(t){n.plot.lines.addDataset(t),n.plot.markers.addDataset(t)})),t.clickHandler&&(new Plottable.Interactions.Click).onClick(function(e){var r=n.plot.markers.entityNearest(e);t.clickHandler(r,n.plot.markers.entities())}).attachTo(n.plot.markers),t.hoverHandler&&(new Plottable.Interactions.Pointer).onPointerMove(function(e){var r=n.plot.markers.entityNearest(e);t.hoverHandler(r,n.plot.markers.entities())}).onPointerExit(function(e){t.hoverHandler(null,n.plot.markers.entities())}).attachTo(n.plot.markers),n.gridlines=new Plottable.Components.Gridlines(t.showXgridlines&&o instanceof Plottable.QuantitativeScale?o:null,t.showYgridlines&&r instanceof Plottable.QuantitativeScale?r:null),n.guideLine={horizontal:null,vertical:null},["v","vh","hv"].indexOf(t.guideLine)>-1&&(n.guideLine.vertical=new Plottable.Components.GuideLineLayer(Plottable.Components.GuideLineLayer.ORIENTATION_VERTICAL).scale(o),(new Plottable.Interactions.Pointer).onPointerMove(function(t){var e=n.plot.markers.entityNearest(t);e?(n.guideLine.vertical.value(e.datum.label),n.guideLine.vertical.content().style("visibility","visible")):n.guideLine.vertical.content().style("visibility","hidden")}).onPointerExit(function(t){n.guideLine.vertical.content().style("visibility","hidden")}).attachTo(n.plot.markers),n.onMount=function(t){this.guideLine.vertical.content().style("visibility","hidden")}),["h","vh","hv"].indexOf(t.guideLine)>-1&&(n.guideLine.horizontal=new Plottable.Components.GuideLineLayer(Plottable.Components.GuideLineLayer.ORIENTATION_HORIZONTAL).scale(r),(new Plottable.Interactions.Pointer).onPointerMove(function(t){var e=n.plot.markers.entityNearest(t);e?(n.guideLine.horizontal.value(e.datum.value),n.guideLine.horizontal.content().style("visibility","visible")):n.guideLine.horizontal.content().style("visibility","hidden")}).onPointerExit(function(t){n.guideLine.horizontal.content().style("visibility","hidden")}).attachTo(n.plot.markers),n.onMount=function(t){this.guideLine.horizontal.content().style("visibility","hidden")});var i=new Plottable.Components.Group([n.gridlines,n.guideLine.horizontal,n.guideLine.vertical,n.plot.lines,n.plot.markers]);return n.layout=new Plottable.Components.Table([[null,null,i],[null,null,null],[null,null,null]]),t.hideXaxis||(o instanceof Plottable.Scales.Time?n.xAxis=new Plottable.Axes.Time(o,"bottom"):o instanceof Plottable.QuantitativeScale?n.xAxis=new Plottable.Axes.Numeric(o,"bottom"):n.xAxis=new Plottable.Axes.Category(o,"bottom"),n.layout.add(n.xAxis,1,2)),t.hideYaxis||(r instanceof Plottable.Scales.Time?n.yAxis=new Plottable.Axes.Time(r,"left"):r instanceof Plottable.QuantitativeScale?n.yAxis=new Plottable.Axes.Numeric(r,"left"):n.yAxis=new Plottable.Axes.Category(r,"left"),n.layout.add(n.yAxis,0,1)),t.xLabel&&n.layout.add(new Plottable.Components.AxisLabel(t.xLabel),2,2),t.yLabel&&n.layout.add(new Plottable.Components.AxisLabel(t.yLabel,-90),0,0),n._setLegend(t,a),n}return mt(e,Pt),ht(e,[{key:"update",value:function(t){this.datasets=t.data.map(function(t){return new Plottable.Dataset(t.series,t.label)}),this.plot.lines.datasets(this.datasets),this.plot.markers.datasets(this.datasets),this.options.data=t.data,this.onUpdate(t)}}]),e}(),Wr=Math.ceil,Yr=Math.max,Qr=function(t,e,n,r){for(var o=-1,a=Yr(Wr((e-t)/(n||1)),0),i=Array(a);a--;)i[r?a:++o]=t,t+=n;return i},Xr=1/0,qr=1.7976931348623157e308,Zr=function(t){return t?(t=it(t))===Xr||t===-Xr?(t<0?-1:1)*qr:t===t?t:0:0===t?t:0},Kr=function(t){return function(e,n,r){return r&&"number"!=typeof r&&Nr(e,n,r)&&(n=r=void 0),e=Zr(e),void 0===n?(n=e,e=0):n=Zr(n),r=void 0===r?e<n?1:-1:Zr(r),Qr(e,n,r,t)}}(),Jr=["#C64D26","#FF7733","#415961","#65828A","#B2D0D8","#DAE3E8"],to=function(t){function e(){return pt(this,e),yt(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return mt(e,t),ht(e,[{key:"_expandSingleValueDomain",value:function(t){var n=t.map(function(t){return t.toDate()});return vt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_expandSingleValueDomain",this).call(this,n)}}]),e}(Plottable.Scales.Time),eo=[1,5,10,25,50,100,200,500,1e3],no=[1,3,6,12],ro=[1,5,10,15,30],oo=Object.freeze({DATAGOVSG_COLORS:Jr,getScale:c,getCategoryScale:f,getColorScale:d,getSingleColorScale:p,getTimeScale:h,getCustomNumberFormatter:b,getCustomTickGenerator:v,getCustomTimeAxisConfigs:m}),ao=Object.freeze({highlightOnHover:T,setupTooltip:function(t,e){(t.plot.markers||t.plot).attr("data-title",e.title);var n=void 0,r=[".render-area .bar-area rect",".render-area .symbol",".render-area .arc.outline"].join(",");t.onMount=function(t){(n=$(t).find(r)).tooltip({animation:!1,container:t.parentNode,html:!0,placement:function(e,n){var r=t.getBoundingClientRect(),o=r.width,a=r.height,i=r.top,l=r.left,u=n.getBoundingClientRect(),s=u.width,c=u.height,f=u.top,d=u.left;return d+s-l<=.7*o?"right":d-l>=.3*o?"left":f-i>=.4*a?"top":f+c-i<=.6*a?"bottom":"left"}})},t.onUnmount=function(){n.tooltip("destroy")}},setupPopover:function(t,e){var n=t.plot.markers||t.plot;n.attr("data-title",e.title),n.attr("data-content",e.content);var r=void 0,o=[".render-area .bar-area rect",".render-area .symbol",".render-area .arc.outline"].join(",");t.onMount=function(t){(r=$(t).find(o)).popover({animation:!1,container:t.parentNode,html:!0,trigger:"hover",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.width,a=r.height,i=r.top,l=r.left,u=n.getBoundingClientRect(),s=u.width,c=u.height,f=u.top,d=u.left;return d+s-l<=.7*o?"right":d-l>=.3*o?"left":f-i>=.4*a?"top":f+c-i<=.6*a?"bottom":"left"}})},t.onUnmount=function(){r.popover("destroy")}},setupPopoverOnGuideLine:function(t,e){var n=void 0;(new Plottable.Interactions.Pointer).onPointerMove(function(r){var o=t.plot.markers.entityNearest(r);o?n.attr("data-original-title",e.title(o.datum,o.index,o.dataset)).attr("data-content",e.content(o.datum,o.index,o.dataset)).popover("show"):n.popover("hide")}).onPointerExit(function(t){n.popover("hide")}).attachTo(t.plot.markers),t.onMount=function(t){this.guideLine.vertical?(n=$(t).find(".guide-line-layer.vertical .guide-line")).popover({animation:!1,container:t.parentNode,html:!0,trigger:"manual",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.width,a=r.left,i=n.getBoundingClientRect(),l=i.width;return i.left+l-a<=.7*o?"right":"left"}}):this.guideLine.horizontal&&(n=$(t).find(".guide-line-layer.horizontal .guide-line")).popover({animation:!1,container:t.parentNode,html:!0,trigger:"manual",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.height,a=r.top;return n.getBoundingClientRect().top-a>=.4*o?"top":"bottom"}})},t.onUnmount=function(){n.popover("destroy")}},setupShadowWithPopover:function(t,e){function n(){return o.domain().map(function(t){return{label:t}})}var r=t.plot.parent(),o="vertical"===t.plot.orientation()?t.plot.x().scale:t.plot.y().scale,a=new Plottable.Dataset,i=(new Plottable.Plots.Rectangle).addClass("shadow").addDataset(a).attr("data-title",e.title).attr("data-content",e.content).attr("fill","rgba(0, 0, 0, 0.1)");"vertical"===t.plot.orientation()?i.x(function(t){return o.scale(t.label)-o.stepWidth()/2}).x2(function(t){return o.scale(t.label)+o.stepWidth()/2}).y(function(t){return 0}).y2(function(t){return i.height()}):i.x(function(t){return 0}).x2(function(t){return i.width()}).y(function(t){return o.scale(t.label)-o.stepWidth()/2}).y2(function(t){return o.scale(t.label)+o.stepWidth()/2}),r.remove(t.plot),r.append(i),r.append(t.plot),(new Plottable.Interactions.Pointer).onPointerMove(function(t){i.entities().forEach(function(t){$(t.selection.node()).css("visibility","hidden").popover("hide")});var e=i.entitiesAt(t)[0];e&&$(e.selection.node()).css("visibility","visible").popover("show")}).onPointerExit(function(t){i.entities().forEach(function(t){$(t.selection.node()).css("visibility","hidden").popover("hide")})}).attachTo(i);var l=void 0;return t.onMount=function(t){a.data(n()),o.onUpdate(function(){a.data(n())}),i.renderImmediately(),(l=$(t).find(".shadow .render-area rect")).css("visibility","hidden"),"vertical"===this.plot.orientation()?l.popover({animation:!1,container:t.parentNode,html:!0,trigger:"manual",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.width,a=r.left,i=n.getBoundingClientRect(),l=i.width;return i.left+l-a<=.7*o?"right":"left"}}):l.popover({animation:!1,container:t.parentNode,html:!0,trigger:"manual",placement:function(e,n){var r=t.getBoundingClientRect(),o=r.height,a=r.top;return n.getBoundingClientRect().top-a>=.4*o?"top":"bottom"}})},t.onUnmount=function(){l.popover("destroy")},i},setupOuterLabel:A,customizeTimeAxis:S,removeInnerPadding:k,downsampleTicks:L}),io=function(t){function e(t){pt(this,e),t=Object.assign({colorScale:d()},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return T(n),A(n,{labelFormatter:function(t){return t.label}}),n}return mt(e,Gr),e}(),lo=function(t){function e(t){pt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:p(),showGridlines:!0},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return T(n),L(n),S(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return mt(e,Ur),e}(),uo=function(t){function e(t){pt(this,e),t=Object.assign({orientation:"h",sorted:"d",scale:c(),categoryScale:f(),colorScale:p(),showGridlines:!0},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return T(n,t.isTimeSeries),I(n.yAxis,n.xAxis,t),n.xAxis.tickLabelPadding(0),n}return mt(e,Ur),e}(),so=function(t){function e(t){pt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:d(),showGridlines:!0},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return L(n),k(n),S(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return mt(e,$r),e}(),co=function(t){function e(t){pt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:d(),showGridlines:!0},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return L(n),k(n),S(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return mt(e,Hr),e}(),fo=function(t){function e(t){pt(this,e),t=Object.assign({yScale:c(),xScale:t.isTimeSeries?h():f(),colorScale:d(),showYgridlines:!0,guideLine:"v"},t);var n=yt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return L(n),S(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return mt(e,Vr),e}(),po=Object.freeze({SimplePie:Gr,SimpleBar:Ur,GroupedBar:$r,StackedBar:Hr,MultipleLine:Vr,DatagovsgSimplePie:io,DatagovsgSimpleBar:lo,DatagovsgHorizontalBar:uo,DatagovsgGroupedBar:so,DatagovsgStackedBar:co,DatagovsgLine:fo});window.DatagovsgCharts=bt({},po,{plugins:ao,helpers:oo})}(); |
{ | ||
"name": "datagovsg-plottable-charts", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "Reusable Plottable chart components", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -29,3 +29,3 @@ import throttle from 'lodash/throttle' | ||
update (nextProps) { | ||
this.datasets = nextProps.data.map(s => new Plottable.Dataset(s.items, s.label)) | ||
this.datasets = nextProps.data.map(s => new Plottable.Dataset(s.series, s.label)) | ||
this.plot.datasets(this.datasets) | ||
@@ -32,0 +32,0 @@ this.options.data = nextProps.data |
@@ -48,4 +48,2 @@ import Chart from './Chart' | ||
this.datasets = props.data.map(t => new Plottable.Dataset(t.series, t.label)) | ||
const scale = props.scale || new Plottable.Scales.Linear() | ||
@@ -66,6 +64,10 @@ const categoryScale = props.categoryScale || new Plottable.Scales.Category() | ||
this.plot[horizontal ? 'y' : 'x'](d => d.label, categoryScale) | ||
this.datasets.forEach(dataset => { | ||
this.plot.addDataset(dataset) | ||
}) | ||
if (props.data) { | ||
this.datasets = props.data.map(s => new Plottable.Dataset(s.series, s.label)) | ||
this.datasets.forEach(dataset => { | ||
this.plot.addDataset(dataset) | ||
}) | ||
} | ||
if (props.labelFormatter) { | ||
@@ -72,0 +74,0 @@ this.plot.labelFormatter(props.labelFormatter).labelsEnabled(true) |
@@ -51,4 +51,2 @@ import Chart from './Chart' | ||
this.datasets = props.data.map(t => new Plottable.Dataset(t.series, t.label)) | ||
const scale = props.yScale || new Plottable.Scales.Linear() | ||
@@ -72,6 +70,9 @@ const categoryScale = props.xScale || new Plottable.Scales.Linear() | ||
this.datasets.forEach(dataset => { | ||
this.plot.lines.addDataset(dataset) | ||
this.plot.markers.addDataset(dataset) | ||
}) | ||
if (props.data) { | ||
this.datasets = props.data.map(s => new Plottable.Dataset(s.series, s.label)) | ||
this.datasets.forEach(dataset => { | ||
this.plot.lines.addDataset(dataset) | ||
this.plot.markers.addDataset(dataset) | ||
}) | ||
} | ||
@@ -193,2 +194,10 @@ if (props.clickHandler) { | ||
} | ||
update (nextProps) { | ||
this.datasets = nextProps.data.map(s => new Plottable.Dataset(s.series, s.label)) | ||
this.plot.lines.datasets(this.datasets) | ||
this.plot.markers.datasets(this.datasets) | ||
this.options.data = nextProps.data | ||
this.onUpdate(nextProps) | ||
} | ||
} |
@@ -48,4 +48,2 @@ import Chart from './Chart' | ||
this.datasets = props.data.map(t => new Plottable.Dataset(t.series, t.label)) | ||
const scale = props.scale || new Plottable.Scales.Linear() | ||
@@ -66,6 +64,10 @@ const categoryScale = props.categoryScale || new Plottable.Scales.Category() | ||
this.plot[horizontal ? 'y' : 'x'](d => d.label, categoryScale) | ||
this.datasets.forEach(dataset => { | ||
this.plot.addDataset(dataset) | ||
}) | ||
if (props.data) { | ||
this.datasets = props.data.map(s => new Plottable.Dataset(s.series, s.label)) | ||
this.datasets.forEach(dataset => { | ||
this.plot.addDataset(dataset) | ||
}) | ||
} | ||
if (props.labelFormatter) { | ||
@@ -72,0 +74,0 @@ this.plot.labelFormatter(this.props.labelFormatter).labelsEnabled(true) |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
554814
13906