Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datagovsg-plottable-charts

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datagovsg-plottable-charts - npm Package Compare versions

Comparing version 3.4.1 to 3.4.2

1

dist/components/Chart.js

@@ -140,2 +140,3 @@ 'use strict';

value: function mount(element) {
element.classList.add('datagovsg-chart');
this.layout.renderTo(element);

@@ -142,0 +143,0 @@ window.addEventListener('resize', this.resizeHandler);

@@ -130,2 +130,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; }; }();

value: function mount(element) {
element.classList.add('datagovsg-chart');
this.layout.renderTo(element);

@@ -132,0 +133,0 @@ window.addEventListener('resize', this.resizeHandler);

2

lib/datagovsg-charts.min.js

@@ -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):_t(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 Ft(t);this.size=e.size}function i(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new de;++e<n;)this.add(t[e])}function l(t,e,n,r,o){return t===e||(null==t||null==e||!q(t)&&!q(e)?t!==t&&e!==e:zn(t,e,n,r,l,o))}function u(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Yn);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||de),n}function s(t){if("string"==typeof t)return t;if(kt(t))return Ct(t,s)+"";if(K(t))return nr?nr.call(t):"";var e=t+"";return"0"==e&&1/t==-tr?"-0":e}function c(){return(new Plottable.Scales.Linear).tickGenerator(b())}function f(t){return(new Plottable.Scales.Category).outerPadding(.2)}function d(){return(new Plottable.Scales.Color).range(Kr)}function p(){var t=(new Plottable.Scales.Color).range([Kr[0]]);return t.scale=function(t){return this._d3Scale(t)},t}function h(){return new Jr}function v(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 b(){var t=b.targetLineCount||4;return function(e){var n=e.domain(),r=yt(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 Zr(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(gt(g()),gt(y()));case"quarter":case"financial_quarter":return[].concat(gt(P()),gt(y()));case"month":return[].concat(gt(_()),gt(y()));case"week":return[].concat(gt(w()),gt(y()));case"date":return[].concat(gt(x()),gt(_()),gt(y()));case"date_time":return[].concat(gt(O()),gt(x()),gt(_()),gt(y()));case"time":return j()}}function y(){return to.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 P(){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 _(){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 eo.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")}])}),no.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 eo.forEach(function(e){t.push([{interval:Plottable.TimeInterval.hour,step:e,formatter:Plottable.Formatters.time("%I %p")}])}),no.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){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 A(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 S(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(gt(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(5).tickLabelPadding(5),e.margin(12).innerTickLength(0).endTickLength(0).tickLabelPadding(5).showEndTickLabels(!0).addClass("hide-baseline").formatter(v(n.isPercentage)),e._hideOverflowingTickLabels=function(){return null}}var L=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},C="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},E="object"==typeof C&&C&&C.Object===Object&&C,M="object"==typeof self&&self&&self.Object===Object&&self,z=E||M||Function("return this")(),F=function(){return z.Date.now()},R=z.Symbol,N=Object.prototype,D=N.hasOwnProperty,B=N.toString,G=R?R.toStringTag:void 0,U=function(t){var e=D.call(t,G),n=t[G];try{t[G]=void 0;var r=!0}catch(t){}var o=B.call(t);return r&&(e?t[G]=n:delete t[G]),o},H=Object.prototype.toString,V=function(t){return H.call(t)},W="[object Null]",Y="[object Undefined]",Q=R?R.toStringTag:void 0,X=function(t){return null==t?void 0===t?Y:W:Q&&Q in Object(t)?U(t):V(t)},q=function(t){return null!=t&&"object"==typeof t},Z="[object Symbol]",K=function(t){return"symbol"==typeof t||q(t)&&X(t)==Z},J=NaN,tt=/^\s+|\s+$/g,et=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,rt=/^0o[0-7]+$/i,ot=parseInt,at=function(t){if("number"==typeof t)return t;if(K(t))return J;if(L(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=L(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(tt,"");var n=nt.test(t);return n||rt.test(t)?ot(t.slice(2),n?2:8):et.test(t)?J:+t},it="Expected a function",lt=Math.max,ut=Math.min,st=function(t,e,n){function r(e){var n=c,r=f;return c=f=void 0,b=e,p=t.apply(r,n)}function o(t){return b=t,h=setTimeout(l,e),m?r(t):p}function a(t){var n=t-b,r=e-(t-v);return y?ut(r,d-n):r}function i(t){var n=t-v,r=t-b;return void 0===v||n>=e||n<0||y&&r>=d}function l(){var t=F();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=F(),n=i(t);if(c=arguments,f=this,v=t,n){if(void 0===h)return o(v);if(y)return h=setTimeout(l,e),r(v)}return void 0===h&&(h=setTimeout(l,e)),p}var c,f,d,p,h,v,b=0,m=!1,y=!1,g=!0;if("function"!=typeof t)throw new TypeError(it);return e=at(e)||0,L(n)&&(m=!!n.leading,d=(y="maxWait"in n)?lt(at(n.maxWait)||0,e):d,g="trailing"in n?!!n.trailing:g),s.cancel=function(){void 0!==h&&clearTimeout(h),b=0,c=v=f=h=void 0},s.flush=function(){return void 0===h?p:u(F())},s},ct="Expected a function",ft=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError(ct);return L(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),st(t,e,{leading:r,maxWait:e,trailing:o})},dt=(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")}),pt=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}}(),ht=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)},bt=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)},mt=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},yt=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")}}(),gt=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(){dt(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=ft(this.resizeHandler,200).bind(this),this._onMount=[],this._onUnmount=[],this._onUpdate=[],this._onResize=[]}return pt(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}(),_t=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},wt="[object Arguments]",xt=function(t){return q(t)&&X(t)==wt},Ot=Object.prototype,jt=Ot.hasOwnProperty,Tt=Ot.propertyIsEnumerable,At=xt(function(){return arguments}())?xt:function(t){return q(t)&&jt.call(t,"callee")&&!Tt.call(t,"callee")},kt=Array.isArray,St=R?R.isConcatSpreadable:void 0,It=function(t){return kt(t)||At(t)||!!(St&&t&&t[St])},Lt=e,Ct=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},Et=function(t,e){return t===e||t!==t&&e!==e},Mt=function(t,e){for(var n=t.length;n--;)if(Et(t[n][0],e))return n;return-1},zt=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():zt.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 Ft=n,Rt="[object AsyncFunction]",Nt="[object Function]",Dt="[object GeneratorFunction]",Bt="[object Proxy]",$t=function(t){if(!L(t))return!1;var e=X(t);return e==Nt||e==Dt||e==Rt||e==Bt},Gt=z["__core-js_shared__"],Ut=function(){var t=/[^.]+$/.exec(Gt&&Gt.keys&&Gt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ht=function(t){return!!Ut&&Ut in t},Vt=Function.prototype.toString,Wt=function(t){if(null!=t){try{return Vt.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Yt=/[\\^$.*+?()[\]{}|]/g,Qt=/^\[object .+?Constructor\]$/,Xt=Function.prototype,qt=Object.prototype,Zt=Xt.toString,Kt=qt.hasOwnProperty,Jt=RegExp("^"+Zt.call(Kt).replace(Yt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),te=function(t){return!(!L(t)||Ht(t))&&($t(t)?Jt:Qt).test(Wt(t))},ee=function(t,e){return null==t?void 0:t[e]},ne=function(t,e){var n=ee(t,e);return te(n)?n:void 0},re=ne(z,"Map"),oe=ne(Object,"create"),ae="__lodash_hash_undefined__",ie=Object.prototype.hasOwnProperty,le=Object.prototype.hasOwnProperty,ue="__lodash_hash_undefined__";r.prototype.clear=function(){this.__data__=oe?oe(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(oe){var n=e[t];return n===ae?void 0:n}return ie.call(e,t)?e[t]:void 0},r.prototype.has=function(t){var e=this.__data__;return oe?void 0!==e[t]:le.call(e,t)},r.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=oe&&void 0===e?ue:e,this};var se=r,ce=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t},fe=function(t,e){var n=t.__data__;return ce(e)?n["string"==typeof e?"string":"hash"]:n.map};o.prototype.clear=function(){this.size=0,this.__data__={hash:new se,map:new(re||Ft),string:new se}},o.prototype.delete=function(t){var e=fe(this,t).delete(t);return this.size-=e?1:0,e},o.prototype.get=function(t){return fe(this,t).get(t)},o.prototype.has=function(t){return fe(this,t).has(t)},o.prototype.set=function(t,e){var n=fe(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var de=o,pe=200;a.prototype.clear=function(){this.__data__=new Ft,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 Ft){var r=n.__data__;if(!re||r.length<pe-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new de(r)}return n.set(t,e),this.size=n.size,this};var he=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 be=i,me=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},ye=function(t,e){return t.has(e)},ge=1,Pe=2,_e=function(t,e,n,r,o,a){var i=n&ge,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 be:void 0;for(a.set(t,e),a.set(e,t);++c<l;){var p=t[c],h=e[c];if(r)var v=i?r(h,p,c,e,t,a):r(p,h,c,t,e,a);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!me(e,function(t,e){if(!ye(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},we=z.Uint8Array,xe=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n},Oe=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n},je=1,Te=2,Ae="[object Boolean]",ke="[object Date]",Se="[object Error]",Ie="[object Map]",Le="[object Number]",Ce="[object RegExp]",Ee="[object Set]",Me="[object String]",ze="[object Symbol]",Fe="[object ArrayBuffer]",Re="[object DataView]",Ne=R?R.prototype:void 0,De=Ne?Ne.valueOf:void 0,Be=function(t,e,n,r,o,a,i){switch(n){case Re:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Fe:return!(t.byteLength!=e.byteLength||!a(new we(t),new we(e)));case Ae:case ke:case Le:return Et(+t,+e);case Se:return t.name==e.name&&t.message==e.message;case Ce:case Me:return t==e+"";case Ie:var l=xe;case Ee:var u=r&je;if(l||(l=Oe),t.size!=e.size&&!u)return!1;var s=i.get(t);if(s)return s==e;r|=Te,i.set(t,e);var c=_e(l(t),l(e),r,o,a,i);return i.delete(t),c;case ze:if(De)return De.call(t)==De.call(e)}return!1},$e=function(t,e,n){var r=e(t);return kt(t)?r:_t(r,n(t))},Ge=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},Ue=Object.prototype.propertyIsEnumerable,He=Object.getOwnPropertySymbols,Ve=He?function(t){return null==t?[]:(t=Object(t),Ge(He(t),function(e){return Ue.call(t,e)}))}:function(){return[]},We=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r},Ye=function(){return!1},Qe=t(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n?z.Buffer:void 0,a=(o?o.isBuffer:void 0)||Ye;t.exports=a}),Xe=9007199254740991,qe=/^(?:0|[1-9]\d*)$/,Ze=function(t,e){return!!(e=null==e?Xe:e)&&("number"==typeof t||qe.test(t))&&t>-1&&t%1==0&&t<e},Ke=9007199254740991,Je=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ke},tn={};tn["[object Float32Array]"]=tn["[object Float64Array]"]=tn["[object Int8Array]"]=tn["[object Int16Array]"]=tn["[object Int32Array]"]=tn["[object Uint8Array]"]=tn["[object Uint8ClampedArray]"]=tn["[object Uint16Array]"]=tn["[object Uint32Array]"]=!0,tn["[object Arguments]"]=tn["[object Array]"]=tn["[object ArrayBuffer]"]=tn["[object Boolean]"]=tn["[object DataView]"]=tn["[object Date]"]=tn["[object Error]"]=tn["[object Function]"]=tn["[object Map]"]=tn["[object Number]"]=tn["[object Object]"]=tn["[object RegExp]"]=tn["[object Set]"]=tn["[object String]"]=tn["[object WeakMap]"]=!1;var en=function(t){return function(e){return t(e)}},nn=t(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n&&E.process,a=function(){try{return o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}),rn=nn&&nn.isTypedArray,on=rn?en(rn):function(t){return q(t)&&Je(t.length)&&!!tn[X(t)]},an=Object.prototype.hasOwnProperty,ln=function(t,e){var n=kt(t),r=!n&&At(t),o=!n&&!r&&Qe(t),a=!n&&!r&&!o&&on(t),i=n||r||o||a,l=i?We(t.length,String):[],u=l.length;for(var s in t)!e&&!an.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ze(s,u))||l.push(s);return l},un=Object.prototype,sn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||un)},cn=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),fn=Object.prototype.hasOwnProperty,dn=function(t){if(!sn(t))return cn(t);var e=[];for(var n in Object(t))fn.call(t,n)&&"constructor"!=n&&e.push(n);return e},pn=function(t){return null!=t&&Je(t.length)&&!$t(t)},hn=function(t){return pn(t)?ln(t):dn(t)},vn=function(t){return $e(t,hn,Ve)},bn=1,mn=Object.prototype.hasOwnProperty,yn=function(t,e,n,r,o,a){var i=n&bn,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:mn.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]],v=e[c];if(r)var b=i?r(v,h,c,e,t,a):r(h,v,c,t,e,a);if(!(void 0===b?h===v||o(h,v,n,r,a):b)){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},gn=ne(z,"DataView"),Pn=ne(z,"Promise"),_n=ne(z,"Set"),wn=ne(z,"WeakMap"),xn=Wt(gn),On=Wt(re),jn=Wt(Pn),Tn=Wt(_n),An=Wt(wn),kn=X;(gn&&"[object DataView]"!=kn(new gn(new ArrayBuffer(1)))||re&&"[object Map]"!=kn(new re)||Pn&&"[object Promise]"!=kn(Pn.resolve())||_n&&"[object Set]"!=kn(new _n)||wn&&"[object WeakMap]"!=kn(new wn))&&(kn=function(t){var e=X(t),n="[object Object]"==e?t.constructor:void 0,r=n?Wt(n):"";if(r)switch(r){case xn:return"[object DataView]";case On:return"[object Map]";case jn:return"[object Promise]";case Tn:return"[object Set]";case An:return"[object WeakMap]"}return e});var Sn=kn,In=1,Ln="[object Arguments]",Cn="[object Array]",En="[object Object]",Mn=Object.prototype.hasOwnProperty,zn=function(t,e,n,r,o,a){var i=kt(t),l=kt(e),u=i?Cn:Sn(t),s=l?Cn:Sn(e),c=(u=u==Ln?En:u)==En,f=(s=s==Ln?En:s)==En,d=u==s;if(d&&Qe(t)){if(!Qe(e))return!1;i=!0,c=!1}if(d&&!c)return a||(a=new he),i||on(t)?_e(t,e,n,r,o,a):Be(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 v=p?t.value():t,b=h?e.value():e;return a||(a=new he),o(v,b,n,r,a)}}return!!d&&(a||(a=new he),yn(t,e,n,r,o,a))},Fn=l,Rn=1,Nn=2,Dn=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 he;if(r)var d=r(s,c,u,t,e,f);if(!(void 0===d?Fn(c,s,Rn|Nn,r,f):d))return!1}}return!0},Bn=function(t){return t===t&&!L(t)},$n=function(t){for(var e=hn(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Bn(o)]}return e},Gn=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},Un=function(t){var e=$n(t);return 1==e.length&&e[0][2]?Gn(e[0][0],e[0][1]):function(n){return n===t||Dn(n,t,e)}},Hn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vn=/^\w*$/,Wn=function(t,e){if(kt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!K(t))||Vn.test(t)||!Hn.test(t)||null!=e&&t in Object(e)},Yn="Expected a function";u.Cache=de;var Qn=u,Xn=500,qn=/^\./,Zn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kn=/\\(\\)?/g,Jn=function(t){var e=Qn(t,function(t){return n.size===Xn&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return qn.test(t)&&e.push(""),t.replace(Zn,function(t,n,r,o){e.push(r?o.replace(Kn,"$1"):n||t)}),e}),tr=1/0,er=R?R.prototype:void 0,nr=er?er.toString:void 0,rr=s,or=function(t){return null==t?"":rr(t)},ar=function(t,e){return kt(t)?t:Wn(t,e)?[t]:Jn(or(t))},ir=1/0,lr=function(t){if("string"==typeof t||K(t))return t;var e=t+"";return"0"==e&&1/t==-ir?"-0":e},ur=function(t,e){for(var n=0,r=(e=ar(e,t)).length;null!=t&&n<r;)t=t[lr(e[n++])];return n&&n==r?t:void 0},sr=function(t,e,n){var r=null==t?void 0:ur(t,e);return void 0===r?n:r},cr=function(t,e){return null!=t&&e in Object(t)},fr=function(t,e,n){for(var r=-1,o=(e=ar(e,t)).length,a=!1;++r<o;){var i=lr(e[r]);if(!(a=null!=t&&n(t,i)))break;t=t[i]}return a||++r!=o?a:!!(o=null==t?0:t.length)&&Je(o)&&Ze(i,o)&&(kt(t)||At(t))},dr=function(t,e){return null!=t&&fr(t,e,cr)},pr=1,hr=2,vr=function(t,e){return Wn(t)&&Bn(e)?Gn(lr(t),e):function(n){var r=sr(n,t);return void 0===r&&r===e?dr(n,t):Fn(e,r,pr|hr)}},br=function(t){return t},mr=function(t){return function(e){return null==e?void 0:e[t]}},yr=function(t){return function(e){return ur(e,t)}},gr=function(t){return Wn(t)?mr(lr(t)):yr(t)},Pr=function(t){return"function"==typeof t?t:null==t?br:"object"==typeof t?kt(t)?vr(t[0],t[1]):Un(t):gr(t)},_r=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}}(),wr=function(t,e){return function(n,r){if(null==n)return n;if(!pn(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&&_r(t,e,hn)}),xr=function(t,e){var n=-1,r=pn(t)?Array(t.length):[];return wr(t,function(t,o,a){r[++n]=e(t,o,a)}),r},Or=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t},jr=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t===t,a=K(t),i=void 0!==e,l=null===e,u=e===e,s=K(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},Tr=function(t,e,n){for(var r=-1,o=t.criteria,a=e.criteria,i=o.length,l=n.length;++r<i;){var u=jr(o[r],a[r]);if(u)return r>=l?u:u*("desc"==n[r]?-1:1)}return t.index-e.index},Ar=function(t,e,n){var r=-1;e=Ct(e.length?e:[br],en(Pr));var o=xr(t,function(t,n,o){return{criteria:Ct(e,function(e){return e(t)}),index:++r,value:t}});return Or(o,function(t,e){return Tr(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)},Sr=Math.max,Ir=function(t,e,n){return e=Sr(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,a=Sr(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)}},Lr=function(t){return function(){return t}},Cr=function(){try{var t=ne(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Er=Cr?function(t,e){return Cr(t,"toString",{configurable:!0,enumerable:!1,value:Lr(e),writable:!0})}:br,Mr=800,zr=16,Fr=Date.now,Rr=function(t){var e=0,n=0;return function(){var r=Fr(),o=zr-(r-n);if(n=r,o>0){if(++e>=Mr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Er),Nr=function(t,e,n){if(!L(n))return!1;var r=typeof e;return!!("number"==r?pn(n)&&Ze(e,n.length):"string"==r&&e in n)&&Et(n[e],t)},Dr=function(t,e){return Rr(Ir(t,e,br),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]]),Ar(t,Lt(e,1),[])}),Br=function(t){function e(t){dt(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.options.legendPosition="none",(t=Object.assign(n.options,t)).sorted&&(t.data=Dr(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 bt(e,Pt),pt(e,[{key:"update",value:function(t){this.options.sorted&&(t.data=Dr(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}(),$r=function(t){function e(t){dt(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.options.legendPosition="none",(t=Object.assign(n.options,t)).sorted&&(t.data=Dr(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 bt(e,Pt),pt(e,[{key:"update",value:function(t){this.options.sorted&&(t.data=Dr(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}(),Gr=function(t){function e(t){dt(this,e);var n=mt(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 bt(e,Pt),e}(),Ur=function(t){function e(t){dt(this,e);var n=mt(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 bt(e,Pt),e}(),Hr=function(t){function e(t){dt(this,e);var n=mt(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 bt(e,Pt),pt(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}(),Vr=Math.ceil,Wr=Math.max,Yr=function(t,e,n,r){for(var o=-1,a=Wr(Vr((e-t)/(n||1)),0),i=Array(a);a--;)i[r?a:++o]=t,t+=n;return i},Qr=1/0,Xr=1.7976931348623157e308,qr=function(t){return t?(t=at(t))===Qr||t===-Qr?(t<0?-1:1)*Xr:t===t?t:0:0===t?t:0},Zr=function(t){return function(e,n,r){return r&&"number"!=typeof r&&Nr(e,n,r)&&(n=r=void 0),e=qr(e),void 0===n?(n=e,e=0):n=qr(n),r=void 0===r?e<n?1:-1:qr(r),Yr(e,n,r,t)}}(),Kr=["#C64D26","#FF7733","#415961","#65828A","#B2D0D8","#DAE3E8"],Jr=function(t){function e(){return dt(this,e),mt(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return bt(e,t),pt(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),to=[1,5,10,25,50,100,200,500,1e3],eo=[1,3,6,12],no=[1,5,10,15,30],ro=Object.freeze({DATAGOVSG_COLORS:Kr,getScale:c,getCategoryScale:f,getColorScale:d,getSingleColorScale:p,getTimeScale:h,getCustomNumberFormatter:v,getCustomTickGenerator:b,getCustomTimeAxisConfigs:m}),oo=Object.freeze({highlightOnHover:function(t,e){t.plot.markers?(new Plottable.Interactions.Pointer).onPointerMove(function(e){t.plot.markers.entities().forEach(function(t){t.selection.classed("highlight",!1).style("stroke","").style("fill","")});var n=t.plot.markers.entityNearest(e);n&&n.selection.classed("highlight",!0).style("stroke","black").style("fill","white")}).onPointerExit(function(e){t.plot.markers.entities().forEach(function(t){t.selection.classed("highlight",!1).style("stroke","").style("fill","")})}).attachTo(t.plot.markers):(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)},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(e){(n=$(e).find(r)).tooltip({animation:!1,container:e.parentNode,html:!0,placement:function(t,n){var r=e.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.plot.markers&&(new Plottable.Interactions.Pointer).onPointerMove(function(e){t.plot.markers.entities().forEach(function(t){$(t.selection.node()).tooltip("hide")});var n=t.plot.markers.entityNearest(e);n&&$(n.selection.node()).tooltip("show")}).onPointerExit(function(e){t.plot.markers.entities().forEach(function(t){$(t.selection.node()).tooltip("hide")})}).attachTo(t.plot.markers)},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(e){(r=$(e).find(o)).popover({animation:!1,container:e.parentNode,html:!0,trigger:"hover",placement:function(t,n){var r=e.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.plot.markers&&(new Plottable.Interactions.Pointer).onPointerMove(function(e){t.plot.markers.entities().forEach(function(t){$(t.selection.node()).popover("hide")});var n=t.plot.markers.entityNearest(e);n&&$(n.selection.node()).popover("show")}).onPointerExit(function(e){t.plot.markers.entities().forEach(function(t){$(t.selection.node()).popover("hide")})}).attachTo(t.plot.markers)},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:T,customizeTimeAxis:A,removeInnerPadding:k,downsampleTicks:S}),ao=function(t){function e(t){dt(this,e),t=Object.assign({colorScale:d()},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return T(n,{labelFormatter:function(t){return t.label}}),n}return bt(e,Br),e}(),io=function(t){function e(t){dt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:p(),showGridlines:!0},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return S(n),A(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return bt(e,$r),e}(),lo=function(t){function e(t){dt(this,e),t=Object.assign({orientation:"h",sorted:"d",scale:c(),categoryScale:f(),colorScale:p(),showGridlines:!0},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return I(n.yAxis,n.xAxis,t),n.xAxis.tickLabelPadding(0),n}return bt(e,$r),e}(),uo=function(t){function e(t){dt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:d(),showGridlines:!0},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return S(n),k(n),A(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return bt(e,Gr),e}(),so=function(t){function e(t){dt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:d(),showGridlines:!0},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return S(n),k(n),A(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return bt(e,Ur),e}(),co=function(t){function e(t){dt(this,e),t=Object.assign({yScale:c(),xScale:t.isTimeSeries?h():f(),colorScale:d(),showYgridlines:!0,guideLine:"v"},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return S(n),A(n,t.isTimeSeries),I(n.xAxis,n.yAxis,t),n}return bt(e,Hr),e}(),fo=Object.freeze({SimplePie:Br,SimpleBar:$r,GroupedBar:Gr,StackedBar:Ur,MultipleLine:Hr,DatagovsgSimplePie:ao,DatagovsgSimpleBar:io,DatagovsgHorizontalBar:lo,DatagovsgGroupedBar:uo,DatagovsgStackedBar:so,DatagovsgLine:co});window.DatagovsgCharts=ht({},fo,{plugins:oo,helpers:ro})}();
!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=Lt),a||(a=[]);++i<l;){var u=t[i];n>0&&r(u)?n>1?e(u,n-1,r,o,a):_t(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 Ft(t);this.size=e.size}function i(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new de;++e<n;)this.add(t[e])}function l(t,e,n,r,o){return t===e||(null==t||null==e||!q(t)&&!q(e)?t!==t&&e!==e:zn(t,e,n,r,l,o))}function u(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Yn);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||de),n}function s(t){if("string"==typeof t)return t;if(kt(t))return Ct(t,s)+"";if(K(t))return nr?nr.call(t):"";var e=t+"";return"0"==e&&1/t==-tr?"-0":e}function c(){return(new Plottable.Scales.Linear).tickGenerator(b())}function f(t){return(new Plottable.Scales.Category).outerPadding(.2)}function d(){return(new Plottable.Scales.Color).range(Kr)}function p(){var t=(new Plottable.Scales.Color).range([Kr[0]]);return t.scale=function(t){return this._d3Scale(t)},t}function h(){return new Jr}function v(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 b(){var t=b.targetLineCount||4;return function(e){var n=e.domain(),r=yt(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 Zr(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(gt(g()),gt(y()));case"quarter":case"financial_quarter":return[].concat(gt(P()),gt(y()));case"month":return[].concat(gt(_()),gt(y()));case"week":return[].concat(gt(w()),gt(y()));case"date":return[].concat(gt(x()),gt(_()),gt(y()));case"date_time":return[].concat(gt(O()),gt(x()),gt(_()),gt(y()));case"time":return j()}}function y(){return to.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 P(){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 _(){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 eo.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")}])}),no.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 eo.forEach(function(e){t.push([{interval:Plottable.TimeInterval.hour,step:e,formatter:Plottable.Formatters.time("%I %p")}])}),no.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){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 A(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 S(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(gt(e)));return this._wrapper.wrap=o,a}}}function L(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.margin(12).innerTickLength(5).endTickLength(5).tickLabelPadding(5),e.margin(12).innerTickLength(0).endTickLength(0).tickLabelPadding(5).showEndTickLabels(!0).addClass("hide-baseline").formatter(v(n.isPercentage)),e._hideOverflowingTickLabels=function(){return null}}var I=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},C="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},E="object"==typeof C&&C&&C.Object===Object&&C,M="object"==typeof self&&self&&self.Object===Object&&self,z=E||M||Function("return this")(),F=function(){return z.Date.now()},R=z.Symbol,N=Object.prototype,D=N.hasOwnProperty,B=N.toString,G=R?R.toStringTag:void 0,U=function(t){var e=D.call(t,G),n=t[G];try{t[G]=void 0;var r=!0}catch(t){}var o=B.call(t);return r&&(e?t[G]=n:delete t[G]),o},H=Object.prototype.toString,V=function(t){return H.call(t)},W="[object Null]",Y="[object Undefined]",Q=R?R.toStringTag:void 0,X=function(t){return null==t?void 0===t?Y:W:Q&&Q in Object(t)?U(t):V(t)},q=function(t){return null!=t&&"object"==typeof t},Z="[object Symbol]",K=function(t){return"symbol"==typeof t||q(t)&&X(t)==Z},J=NaN,tt=/^\s+|\s+$/g,et=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,rt=/^0o[0-7]+$/i,ot=parseInt,at=function(t){if("number"==typeof t)return t;if(K(t))return J;if(I(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=I(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(tt,"");var n=nt.test(t);return n||rt.test(t)?ot(t.slice(2),n?2:8):et.test(t)?J:+t},it="Expected a function",lt=Math.max,ut=Math.min,st=function(t,e,n){function r(e){var n=c,r=f;return c=f=void 0,b=e,p=t.apply(r,n)}function o(t){return b=t,h=setTimeout(l,e),m?r(t):p}function a(t){var n=t-b,r=e-(t-v);return y?ut(r,d-n):r}function i(t){var n=t-v,r=t-b;return void 0===v||n>=e||n<0||y&&r>=d}function l(){var t=F();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=F(),n=i(t);if(c=arguments,f=this,v=t,n){if(void 0===h)return o(v);if(y)return h=setTimeout(l,e),r(v)}return void 0===h&&(h=setTimeout(l,e)),p}var c,f,d,p,h,v,b=0,m=!1,y=!1,g=!0;if("function"!=typeof t)throw new TypeError(it);return e=at(e)||0,I(n)&&(m=!!n.leading,d=(y="maxWait"in n)?lt(at(n.maxWait)||0,e):d,g="trailing"in n?!!n.trailing:g),s.cancel=function(){void 0!==h&&clearTimeout(h),b=0,c=v=f=h=void 0},s.flush=function(){return void 0===h?p:u(F())},s},ct="Expected a function",ft=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError(ct);return I(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),st(t,e,{leading:r,maxWait:e,trailing:o})},dt=(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")}),pt=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}}(),ht=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)},bt=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)},mt=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},yt=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")}}(),gt=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(){dt(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=ft(this.resizeHandler,200).bind(this),this._onMount=[],this._onUnmount=[],this._onUpdate=[],this._onResize=[]}return pt(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){t.classList.add("datagovsg-chart"),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}(),_t=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t},wt="[object Arguments]",xt=function(t){return q(t)&&X(t)==wt},Ot=Object.prototype,jt=Ot.hasOwnProperty,Tt=Ot.propertyIsEnumerable,At=xt(function(){return arguments}())?xt:function(t){return q(t)&&jt.call(t,"callee")&&!Tt.call(t,"callee")},kt=Array.isArray,St=R?R.isConcatSpreadable:void 0,Lt=function(t){return kt(t)||At(t)||!!(St&&t&&t[St])},It=e,Ct=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},Et=function(t,e){return t===e||t!==t&&e!==e},Mt=function(t,e){for(var n=t.length;n--;)if(Et(t[n][0],e))return n;return-1},zt=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():zt.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 Ft=n,Rt="[object AsyncFunction]",Nt="[object Function]",Dt="[object GeneratorFunction]",Bt="[object Proxy]",$t=function(t){if(!I(t))return!1;var e=X(t);return e==Nt||e==Dt||e==Rt||e==Bt},Gt=z["__core-js_shared__"],Ut=function(){var t=/[^.]+$/.exec(Gt&&Gt.keys&&Gt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ht=function(t){return!!Ut&&Ut in t},Vt=Function.prototype.toString,Wt=function(t){if(null!=t){try{return Vt.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Yt=/[\\^$.*+?()[\]{}|]/g,Qt=/^\[object .+?Constructor\]$/,Xt=Function.prototype,qt=Object.prototype,Zt=Xt.toString,Kt=qt.hasOwnProperty,Jt=RegExp("^"+Zt.call(Kt).replace(Yt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),te=function(t){return!(!I(t)||Ht(t))&&($t(t)?Jt:Qt).test(Wt(t))},ee=function(t,e){return null==t?void 0:t[e]},ne=function(t,e){var n=ee(t,e);return te(n)?n:void 0},re=ne(z,"Map"),oe=ne(Object,"create"),ae="__lodash_hash_undefined__",ie=Object.prototype.hasOwnProperty,le=Object.prototype.hasOwnProperty,ue="__lodash_hash_undefined__";r.prototype.clear=function(){this.__data__=oe?oe(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(oe){var n=e[t];return n===ae?void 0:n}return ie.call(e,t)?e[t]:void 0},r.prototype.has=function(t){var e=this.__data__;return oe?void 0!==e[t]:le.call(e,t)},r.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=oe&&void 0===e?ue:e,this};var se=r,ce=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t},fe=function(t,e){var n=t.__data__;return ce(e)?n["string"==typeof e?"string":"hash"]:n.map};o.prototype.clear=function(){this.size=0,this.__data__={hash:new se,map:new(re||Ft),string:new se}},o.prototype.delete=function(t){var e=fe(this,t).delete(t);return this.size-=e?1:0,e},o.prototype.get=function(t){return fe(this,t).get(t)},o.prototype.has=function(t){return fe(this,t).has(t)},o.prototype.set=function(t,e){var n=fe(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var de=o,pe=200;a.prototype.clear=function(){this.__data__=new Ft,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 Ft){var r=n.__data__;if(!re||r.length<pe-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new de(r)}return n.set(t,e),this.size=n.size,this};var he=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 be=i,me=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},ye=function(t,e){return t.has(e)},ge=1,Pe=2,_e=function(t,e,n,r,o,a){var i=n&ge,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 be:void 0;for(a.set(t,e),a.set(e,t);++c<l;){var p=t[c],h=e[c];if(r)var v=i?r(h,p,c,e,t,a):r(p,h,c,t,e,a);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!me(e,function(t,e){if(!ye(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},we=z.Uint8Array,xe=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n},Oe=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n},je=1,Te=2,Ae="[object Boolean]",ke="[object Date]",Se="[object Error]",Le="[object Map]",Ie="[object Number]",Ce="[object RegExp]",Ee="[object Set]",Me="[object String]",ze="[object Symbol]",Fe="[object ArrayBuffer]",Re="[object DataView]",Ne=R?R.prototype:void 0,De=Ne?Ne.valueOf:void 0,Be=function(t,e,n,r,o,a,i){switch(n){case Re:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Fe:return!(t.byteLength!=e.byteLength||!a(new we(t),new we(e)));case Ae:case ke:case Ie:return Et(+t,+e);case Se:return t.name==e.name&&t.message==e.message;case Ce:case Me:return t==e+"";case Le:var l=xe;case Ee:var u=r&je;if(l||(l=Oe),t.size!=e.size&&!u)return!1;var s=i.get(t);if(s)return s==e;r|=Te,i.set(t,e);var c=_e(l(t),l(e),r,o,a,i);return i.delete(t),c;case ze:if(De)return De.call(t)==De.call(e)}return!1},$e=function(t,e,n){var r=e(t);return kt(t)?r:_t(r,n(t))},Ge=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},Ue=Object.prototype.propertyIsEnumerable,He=Object.getOwnPropertySymbols,Ve=He?function(t){return null==t?[]:(t=Object(t),Ge(He(t),function(e){return Ue.call(t,e)}))}:function(){return[]},We=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r},Ye=function(){return!1},Qe=t(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n?z.Buffer:void 0,a=(o?o.isBuffer:void 0)||Ye;t.exports=a}),Xe=9007199254740991,qe=/^(?:0|[1-9]\d*)$/,Ze=function(t,e){return!!(e=null==e?Xe:e)&&("number"==typeof t||qe.test(t))&&t>-1&&t%1==0&&t<e},Ke=9007199254740991,Je=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ke},tn={};tn["[object Float32Array]"]=tn["[object Float64Array]"]=tn["[object Int8Array]"]=tn["[object Int16Array]"]=tn["[object Int32Array]"]=tn["[object Uint8Array]"]=tn["[object Uint8ClampedArray]"]=tn["[object Uint16Array]"]=tn["[object Uint32Array]"]=!0,tn["[object Arguments]"]=tn["[object Array]"]=tn["[object ArrayBuffer]"]=tn["[object Boolean]"]=tn["[object DataView]"]=tn["[object Date]"]=tn["[object Error]"]=tn["[object Function]"]=tn["[object Map]"]=tn["[object Number]"]=tn["[object Object]"]=tn["[object RegExp]"]=tn["[object Set]"]=tn["[object String]"]=tn["[object WeakMap]"]=!1;var en=function(t){return function(e){return t(e)}},nn=t(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,o=r&&r.exports===n&&E.process,a=function(){try{return o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a}),rn=nn&&nn.isTypedArray,on=rn?en(rn):function(t){return q(t)&&Je(t.length)&&!!tn[X(t)]},an=Object.prototype.hasOwnProperty,ln=function(t,e){var n=kt(t),r=!n&&At(t),o=!n&&!r&&Qe(t),a=!n&&!r&&!o&&on(t),i=n||r||o||a,l=i?We(t.length,String):[],u=l.length;for(var s in t)!e&&!an.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ze(s,u))||l.push(s);return l},un=Object.prototype,sn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||un)},cn=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),fn=Object.prototype.hasOwnProperty,dn=function(t){if(!sn(t))return cn(t);var e=[];for(var n in Object(t))fn.call(t,n)&&"constructor"!=n&&e.push(n);return e},pn=function(t){return null!=t&&Je(t.length)&&!$t(t)},hn=function(t){return pn(t)?ln(t):dn(t)},vn=function(t){return $e(t,hn,Ve)},bn=1,mn=Object.prototype.hasOwnProperty,yn=function(t,e,n,r,o,a){var i=n&bn,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:mn.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]],v=e[c];if(r)var b=i?r(v,h,c,e,t,a):r(h,v,c,t,e,a);if(!(void 0===b?h===v||o(h,v,n,r,a):b)){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},gn=ne(z,"DataView"),Pn=ne(z,"Promise"),_n=ne(z,"Set"),wn=ne(z,"WeakMap"),xn=Wt(gn),On=Wt(re),jn=Wt(Pn),Tn=Wt(_n),An=Wt(wn),kn=X;(gn&&"[object DataView]"!=kn(new gn(new ArrayBuffer(1)))||re&&"[object Map]"!=kn(new re)||Pn&&"[object Promise]"!=kn(Pn.resolve())||_n&&"[object Set]"!=kn(new _n)||wn&&"[object WeakMap]"!=kn(new wn))&&(kn=function(t){var e=X(t),n="[object Object]"==e?t.constructor:void 0,r=n?Wt(n):"";if(r)switch(r){case xn:return"[object DataView]";case On:return"[object Map]";case jn:return"[object Promise]";case Tn:return"[object Set]";case An:return"[object WeakMap]"}return e});var Sn=kn,Ln=1,In="[object Arguments]",Cn="[object Array]",En="[object Object]",Mn=Object.prototype.hasOwnProperty,zn=function(t,e,n,r,o,a){var i=kt(t),l=kt(e),u=i?Cn:Sn(t),s=l?Cn:Sn(e),c=(u=u==In?En:u)==En,f=(s=s==In?En:s)==En,d=u==s;if(d&&Qe(t)){if(!Qe(e))return!1;i=!0,c=!1}if(d&&!c)return a||(a=new he),i||on(t)?_e(t,e,n,r,o,a):Be(t,e,u,n,r,o,a);if(!(n&Ln)){var p=c&&Mn.call(t,"__wrapped__"),h=f&&Mn.call(e,"__wrapped__");if(p||h){var v=p?t.value():t,b=h?e.value():e;return a||(a=new he),o(v,b,n,r,a)}}return!!d&&(a||(a=new he),yn(t,e,n,r,o,a))},Fn=l,Rn=1,Nn=2,Dn=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 he;if(r)var d=r(s,c,u,t,e,f);if(!(void 0===d?Fn(c,s,Rn|Nn,r,f):d))return!1}}return!0},Bn=function(t){return t===t&&!I(t)},$n=function(t){for(var e=hn(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Bn(o)]}return e},Gn=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}},Un=function(t){var e=$n(t);return 1==e.length&&e[0][2]?Gn(e[0][0],e[0][1]):function(n){return n===t||Dn(n,t,e)}},Hn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vn=/^\w*$/,Wn=function(t,e){if(kt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!K(t))||Vn.test(t)||!Hn.test(t)||null!=e&&t in Object(e)},Yn="Expected a function";u.Cache=de;var Qn=u,Xn=500,qn=/^\./,Zn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kn=/\\(\\)?/g,Jn=function(t){var e=Qn(t,function(t){return n.size===Xn&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return qn.test(t)&&e.push(""),t.replace(Zn,function(t,n,r,o){e.push(r?o.replace(Kn,"$1"):n||t)}),e}),tr=1/0,er=R?R.prototype:void 0,nr=er?er.toString:void 0,rr=s,or=function(t){return null==t?"":rr(t)},ar=function(t,e){return kt(t)?t:Wn(t,e)?[t]:Jn(or(t))},ir=1/0,lr=function(t){if("string"==typeof t||K(t))return t;var e=t+"";return"0"==e&&1/t==-ir?"-0":e},ur=function(t,e){for(var n=0,r=(e=ar(e,t)).length;null!=t&&n<r;)t=t[lr(e[n++])];return n&&n==r?t:void 0},sr=function(t,e,n){var r=null==t?void 0:ur(t,e);return void 0===r?n:r},cr=function(t,e){return null!=t&&e in Object(t)},fr=function(t,e,n){for(var r=-1,o=(e=ar(e,t)).length,a=!1;++r<o;){var i=lr(e[r]);if(!(a=null!=t&&n(t,i)))break;t=t[i]}return a||++r!=o?a:!!(o=null==t?0:t.length)&&Je(o)&&Ze(i,o)&&(kt(t)||At(t))},dr=function(t,e){return null!=t&&fr(t,e,cr)},pr=1,hr=2,vr=function(t,e){return Wn(t)&&Bn(e)?Gn(lr(t),e):function(n){var r=sr(n,t);return void 0===r&&r===e?dr(n,t):Fn(e,r,pr|hr)}},br=function(t){return t},mr=function(t){return function(e){return null==e?void 0:e[t]}},yr=function(t){return function(e){return ur(e,t)}},gr=function(t){return Wn(t)?mr(lr(t)):yr(t)},Pr=function(t){return"function"==typeof t?t:null==t?br:"object"==typeof t?kt(t)?vr(t[0],t[1]):Un(t):gr(t)},_r=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}}(),wr=function(t,e){return function(n,r){if(null==n)return n;if(!pn(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&&_r(t,e,hn)}),xr=function(t,e){var n=-1,r=pn(t)?Array(t.length):[];return wr(t,function(t,o,a){r[++n]=e(t,o,a)}),r},Or=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t},jr=function(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t===t,a=K(t),i=void 0!==e,l=null===e,u=e===e,s=K(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},Tr=function(t,e,n){for(var r=-1,o=t.criteria,a=e.criteria,i=o.length,l=n.length;++r<i;){var u=jr(o[r],a[r]);if(u)return r>=l?u:u*("desc"==n[r]?-1:1)}return t.index-e.index},Ar=function(t,e,n){var r=-1;e=Ct(e.length?e:[br],en(Pr));var o=xr(t,function(t,n,o){return{criteria:Ct(e,function(e){return e(t)}),index:++r,value:t}});return Or(o,function(t,e){return Tr(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)},Sr=Math.max,Lr=function(t,e,n){return e=Sr(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,a=Sr(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)}},Ir=function(t){return function(){return t}},Cr=function(){try{var t=ne(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Er=Cr?function(t,e){return Cr(t,"toString",{configurable:!0,enumerable:!1,value:Ir(e),writable:!0})}:br,Mr=800,zr=16,Fr=Date.now,Rr=function(t){var e=0,n=0;return function(){var r=Fr(),o=zr-(r-n);if(n=r,o>0){if(++e>=Mr)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Er),Nr=function(t,e,n){if(!I(n))return!1;var r=typeof e;return!!("number"==r?pn(n)&&Ze(e,n.length):"string"==r&&e in n)&&Et(n[e],t)},Dr=function(t,e){return Rr(Lr(t,e,br),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]]),Ar(t,It(e,1),[])}),Br=function(t){function e(t){dt(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.options.legendPosition="none",(t=Object.assign(n.options,t)).sorted&&(t.data=Dr(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 bt(e,Pt),pt(e,[{key:"update",value:function(t){this.options.sorted&&(t.data=Dr(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}(),$r=function(t){function e(t){dt(this,e);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.options.legendPosition="none",(t=Object.assign(n.options,t)).sorted&&(t.data=Dr(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 bt(e,Pt),pt(e,[{key:"update",value:function(t){this.options.sorted&&(t.data=Dr(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}(),Gr=function(t){function e(t){dt(this,e);var n=mt(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 bt(e,Pt),e}(),Ur=function(t){function e(t){dt(this,e);var n=mt(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 bt(e,Pt),e}(),Hr=function(t){function e(t){dt(this,e);var n=mt(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 bt(e,Pt),pt(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}(),Vr=Math.ceil,Wr=Math.max,Yr=function(t,e,n,r){for(var o=-1,a=Wr(Vr((e-t)/(n||1)),0),i=Array(a);a--;)i[r?a:++o]=t,t+=n;return i},Qr=1/0,Xr=1.7976931348623157e308,qr=function(t){return t?(t=at(t))===Qr||t===-Qr?(t<0?-1:1)*Xr:t===t?t:0:0===t?t:0},Zr=function(t){return function(e,n,r){return r&&"number"!=typeof r&&Nr(e,n,r)&&(n=r=void 0),e=qr(e),void 0===n?(n=e,e=0):n=qr(n),r=void 0===r?e<n?1:-1:qr(r),Yr(e,n,r,t)}}(),Kr=["#C64D26","#FF7733","#415961","#65828A","#B2D0D8","#DAE3E8"],Jr=function(t){function e(){return dt(this,e),mt(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return bt(e,t),pt(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),to=[1,5,10,25,50,100,200,500,1e3],eo=[1,3,6,12],no=[1,5,10,15,30],ro=Object.freeze({DATAGOVSG_COLORS:Kr,getScale:c,getCategoryScale:f,getColorScale:d,getSingleColorScale:p,getTimeScale:h,getCustomNumberFormatter:v,getCustomTickGenerator:b,getCustomTimeAxisConfigs:m}),oo=Object.freeze({highlightOnHover:function(t,e){t.plot.markers?(new Plottable.Interactions.Pointer).onPointerMove(function(e){t.plot.markers.entities().forEach(function(t){t.selection.classed("highlight",!1).style("stroke","").style("fill","")});var n=t.plot.markers.entityNearest(e);n&&n.selection.classed("highlight",!0).style("stroke","black").style("fill","white")}).onPointerExit(function(e){t.plot.markers.entities().forEach(function(t){t.selection.classed("highlight",!1).style("stroke","").style("fill","")})}).attachTo(t.plot.markers):(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)},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(e){(n=$(e).find(r)).tooltip({animation:!1,container:e.parentNode,html:!0,placement:function(t,n){var r=e.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.plot.markers&&(new Plottable.Interactions.Pointer).onPointerMove(function(e){t.plot.markers.entities().forEach(function(t){$(t.selection.node()).tooltip("hide")});var n=t.plot.markers.entityNearest(e);n&&$(n.selection.node()).tooltip("show")}).onPointerExit(function(e){t.plot.markers.entities().forEach(function(t){$(t.selection.node()).tooltip("hide")})}).attachTo(t.plot.markers)},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(e){(r=$(e).find(o)).popover({animation:!1,container:e.parentNode,html:!0,trigger:"hover",placement:function(t,n){var r=e.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.plot.markers&&(new Plottable.Interactions.Pointer).onPointerMove(function(e){t.plot.markers.entities().forEach(function(t){$(t.selection.node()).popover("hide")});var n=t.plot.markers.entityNearest(e);n&&$(n.selection.node()).popover("show")}).onPointerExit(function(e){t.plot.markers.entities().forEach(function(t){$(t.selection.node()).popover("hide")})}).attachTo(t.plot.markers)},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:T,customizeTimeAxis:A,removeInnerPadding:k,downsampleTicks:S}),ao=function(t){function e(t){dt(this,e),t=Object.assign({colorScale:d()},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return T(n,{labelFormatter:function(t){return t.label}}),n}return bt(e,Br),e}(),io=function(t){function e(t){dt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:p(),showGridlines:!0},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return S(n),A(n,t.isTimeSeries),L(n.xAxis,n.yAxis,t),n}return bt(e,$r),e}(),lo=function(t){function e(t){dt(this,e),t=Object.assign({orientation:"h",sorted:"d",scale:c(),categoryScale:f(),colorScale:p(),showGridlines:!0},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return L(n.yAxis,n.xAxis,t),n.xAxis.tickLabelPadding(0),n}return bt(e,$r),e}(),uo=function(t){function e(t){dt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:d(),showGridlines:!0},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return S(n),k(n),A(n,t.isTimeSeries),L(n.xAxis,n.yAxis,t),n}return bt(e,Gr),e}(),so=function(t){function e(t){dt(this,e),t=Object.assign({scale:c(),categoryScale:t.isTimeSeries?h():f(),colorScale:d(),showGridlines:!0},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return S(n),k(n),A(n,t.isTimeSeries),L(n.xAxis,n.yAxis,t),n}return bt(e,Ur),e}(),co=function(t){function e(t){dt(this,e),t=Object.assign({yScale:c(),xScale:t.isTimeSeries?h():f(),colorScale:d(),showYgridlines:!0,guideLine:"v"},t);var n=mt(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return S(n),A(n,t.isTimeSeries),L(n.xAxis,n.yAxis,t),n}return bt(e,Hr),e}(),fo=Object.freeze({SimplePie:Br,SimpleBar:$r,GroupedBar:Gr,StackedBar:Ur,MultipleLine:Hr,DatagovsgSimplePie:ao,DatagovsgSimpleBar:io,DatagovsgHorizontalBar:lo,DatagovsgGroupedBar:uo,DatagovsgStackedBar:so,DatagovsgLine:co});window.DatagovsgCharts=ht({},fo,{plugins:oo,helpers:ro})}();
{
"name": "datagovsg-plottable-charts",
"version": "3.4.1",
"version": "3.4.2",
"description": "Reusable Plottable chart components",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc