You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 line
60 KiB

  1. "use strict";function __$styleInject(t,e){if("undefined"==typeof document)return e;t=t||"";var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");return i.type="text/css",a.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),e}function $$1(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function getOffset(t){var e=t.getBoundingClientRect();return{top:e.top+(document.documentElement.scrollTop||document.body.scrollTop),left:e.left+(document.documentElement.scrollLeft||document.body.scrollLeft)}}function isElementInViewport(t){var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function getElementContentWidth(t){var e=window.getComputedStyle(t),a=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.clientWidth-a}function floatTwo(t){return parseFloat(t.toFixed(2))}function fillArray(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];a||(a=i?t[0]:t[t.length-1]);var n=new Array(Math.abs(e)).fill(a);return t=i?n.concat(t):t.concat(n)}function getStringWidth(t,e){return(t+"").length*e}function getBarHeightAndYAttr(t,e){var a=void 0,i=void 0;return t<=e?(a=e-t,i=t):(a=t-e,i=e),[a,i]}function equilizeNoOfElements(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-t.length;return a>0?t=fillArray(t,a):e=fillArray(e,a),[t,e]}function translate(t,e,a,i){var n="string"==typeof e?e:e.join(", ");return[t,{transform:a.join(", ")},i,STD_EASING,"translate",{transform:n}]}function translateVertLine(t,e,a){return translate(t,[a,0],[e,0],MARKER_LINE_ANIM_DUR)}function translateHoriLine(t,e,a){return translate(t,[0,a],[0,e],MARKER_LINE_ANIM_DUR)}function animateRegion(t,e,a,i){var n=e-a,s=t.childNodes[0];return[[s,{height:n,"stroke-dasharray":s.getAttribute("width")+", "+n},MARKER_LINE_ANIM_DUR,STD_EASING],translate(t,[0,i],[0,a],MARKER_LINE_ANIM_DUR)]}function animateBar(t,e,a,i){var n=getBarHeightAndYAttr(a,(arguments.length>5&&void 0!==arguments[5]?arguments[5]:{}).zeroLine),s=slicedToArray(n,2),r=s[0],o=s[1];return"rect"!==t.nodeName?[[t.childNodes[0],{width:i,height:r},UNIT_ANIM_DUR,STD_EASING],translate(t,t.getAttribute("transform").split("(")[1].slice(0,-1),[e,o],MARKER_LINE_ANIM_DUR)]:[[t,{width:i,height:r,x:e,y:o},UNIT_ANIM_DUR,STD_EASING]]}function $$2(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function createSVG(t,e){var a=document.createElementNS("http://www.w3.org/2000/svg",t);for(var i in e){var n=e[i];if("inside"===i)$$2(n).appendChild(a);else if("around"===i){var s=$$2(n);s.parentNode.insertBefore(a,s),a.appendChild(s)}else"styles"===i?"object"===(void 0===n?"undefined":_typeof(n))&&Object.keys(n).map(function(t){a.style[t]=n[t]}):("className"===i&&(i="class"),"innerHTML"===i?a.textContent=n:a.setAttribute(i,n))}return a}function makeSVGContainer(t,e,a,i){return createSVG("svg",{className:e,inside:t,width:a,height:i})}function makeSVGDefs(t){return createSVG("defs",{inside:t})}function makeSVGGroup(t,e){return createSVG("g",{className:e,inside:t,transform:arguments.length>2&&void 0!==arguments[2]?arguments[2]:""})}function makePath(t){return createSVG("path",{className:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",d:t,styles:{stroke:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"none",fill:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none"}})}function makeHeatSquare(t,e,a,i){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s={className:t,x:e,y:a,width:i,height:i,fill:1};return Object.keys(n).map(function(t){s[t]=n[t]}),createSVG("rect",s)}function makeText(t,e,a,i){return createSVG("text",{className:t,x:e,y:a,dy:FONT_SIZE/2+"px","font-size":FONT_SIZE+"px",innerHTML:i})}function makeVertLine(t,e,a,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};n.stroke||(n.stroke=BASE_LINE_COLOR);var s=createSVG("line",{className:"line-vertical "+n.className,x1:0,x2:0,y1:a,y2:i,styles:{stroke:n.stroke}}),r=createSVG("text",{x:0,y:a>i?a+LABEL_MARGIN:a-LABEL_MARGIN-FONT_SIZE,dy:FONT_SIZE+"px","font-size":FONT_SIZE+"px","text-anchor":"middle",innerHTML:e}),o=createSVG("g",{transform:"translate("+t+", 0)"});return o.appendChild(s),o.appendChild(r),o}function makeHoriLine(t,e,a,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};n.stroke||(n.stroke=BASE_LINE_COLOR),n.lineType||(n.lineType="");var s=createSVG("line",{className:"line-horizontal "+n.className+("dashed"===n.lineType?"dashed":""),x1:a,x2:i,y1:0,y2:0,styles:{stroke:n.stroke}}),r=createSVG("text",{x:a<i?a-LABEL_MARGIN:a+LABEL_MARGIN,y:0,dy:FONT_SIZE/2-2+"px","font-size":FONT_SIZE+"px","text-anchor":a<i?"end":"start",innerHTML:e+""}),o=createSVG("g",{transform:"translate(0, "+t+")","stroke-opacity":1});return 0!==r&&"0"!==r||(o.style.stroke="rgba(27, 31, 35, 0.6)"),o.appendChild(s),o.appendChild(r),o}function yLine(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i.pos||(i.pos="left"),i.offset||(i.offset=0),i.mode||(i.mode="span"),i.stroke||(i.stroke=BASE_LINE_COLOR),i.className||(i.className="");var n=-1*AXIS_TICK_LENGTH,s="span"===i.mode?a+AXIS_TICK_LENGTH:0;return"tick"===i.mode&&"right"===i.pos&&(n=a+AXIS_TICK_LENGTH,s=a),n+=i.offset,s+=i.offset,makeHoriLine(t,e,n,s,{stroke:i.stroke,className:i.className,lineType:i.lineType})}function xLine(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i.pos||(i.pos="bottom"),i.offset||(i.offset=0),i.mode||(i.mode="span"),i.stroke||(i.stroke=BASE_LINE_COLOR),i.className||(i.className="");var n=a+AXIS_TICK_LENGTH,s="span"===i.mode?-1*AXIS_TICK_LENGTH:a;return"tick"===i.mode&&"top"===i.pos&&(n=-1*AXIS_TICK_LENGTH,s=0),makeVertLine(t,e,n,s,{stroke:i.stroke,className:i.className,lineType:i.lineType})}function yMarker(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=createSVG("text",{className:"chart-label",x:a-getStringWidth(e,5)-LABEL_MARGIN,y:0,dy:FONT_SIZE/-2+"px","font-size":FONT_SIZE+"px","text-anchor":"start",innerHTML:e+""}),s=makeHoriLine(t,"",0,a,{stroke:i.stroke||BASE_LINE_COLOR,className:i.className||"",lineType:i.lineType});return s.appendChild(n),s}function yRegion(t,e,a,i){var n=t-e,s=createSVG("rect",{className:"bar mini",styles:{fill:"rgba(228, 234, 239, 0.49)",stroke:BASE_LINE_COLOR,"stroke-dasharray":a+", "+n},x:0,y:0,width:a,height:n}),r=createSVG("text",{className:"chart-label",x:a-getStringWidth(i,4.5)-LABEL_MARGIN,y:0,dy:FONT_SIZE/-2+"px","font-size":FONT_SIZE+"px","text-anchor":"start",innerHTML:i+""}),o=createSVG("g",{transform:"translate(0, "+e+")"});return o.appendChild(s),o.appendChild(r),o}function datasetBar(t,e,a,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},l=getBarHeightAndYAttr(e,o.zeroLine),h=slicedToArray(l,2),c=h[0],u=h[1],p=createSVG("rect",{className:"bar mini",style:"fill: "+i,"data-point-index":s,x:t,y:u-=r,width:a,height:c||o.minHeight});if(n||n.length){p.setAttribute("y",0),p.setAttribute("x",0);var d=createSVG("text",{className:"data-point-value",x:a/2,y:0,dy:FONT_SIZE/2*-1+"px","font-size":FONT_SIZE+"px","text-anchor":"middle",innerHTML:n}),f=createSVG("g",{transform:"translate("+t+", "+u+")"});return f.appendChild(p),f.appendChild(d),f}return p}function limitColor(t){return t>255?255:t<0?0:t}function lightenDarkenColor(t,e){var a=getColor(t),i=!1;"#"==a[0]&&(a=a.slice(1),i=!0);var n=parseInt(a,16),s=limitColor((n>>16)+e),r=limitColor((n>>8&255)+e),o=limitColor((255&n)+e);return(i?"#":"")+(o|r<<8|s<<16).toString(16)}function isValidColor(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}function getDifferentChart(t,e,a){if(t!==e){ALL_CHART_TYPES.includes(t)||console.error("'"+t+"' is not a valid chart type."),COMPATIBLE_CHARTS[e].includes(t)||console.error("'"+e+"' chart cannot be converted to a '"+t+"' chart.");var i=COLOR_COMPATIBLE_CHARTS[e].includes(t);return new Chart({parent:a.parent,title:a.title,data:a.data,type:t,height:a.height,colors:i?a.colors:void 0})}}function animateSVGElement(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"linear",n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=t.cloneNode(!0),o=t.cloneNode(!0);for(var l in e){var h=void 0;h="transform"===l?document.createElementNS("http://www.w3.org/2000/svg","animateTransform"):document.createElementNS("http://www.w3.org/2000/svg","animate");var c=s[l]||t.getAttribute(l),u=e[l],p={attributeName:l,from:c,to:u,begin:"0s",dur:a/1e3+"s",values:c+";"+u,keySplines:EASING[i],keyTimes:"0;1",calcMode:"spline",fill:"freeze"};n&&(p.type=n);for(var d in p)h.setAttribute(d,p[d]);r.appendChild(h),n?o.setAttribute(l,"translate("+u+")"):o.setAttribute(l,u)}return[r,o]}function transform(t,e){t.style.transform=e,t.style.webkitTransform=e,t.style.msTransform=e,t.style.mozTransform=e,t.style.oTransform=e}function animateSVG(t,e){var a=[],i=[];e.map(function(t){var e=t[0],n=e.parentNode,s=void 0,r=void 0;t[0]=e;var o=animateSVGElement.apply(void 0,toConsumableArray(t)),l=slicedToArray(o,2);s=l[0],r=l[1],a.push(r),i.push([s,n]),n.replaceChild(s,e)});var n=t.cloneNode(!0);return i.map(function(t,i){t[1].replaceChild(a[i],t[0]),e[i][0]=a[i]}),n}function runSMILAnimation(t,e,a){if(0!==a.length){var i=animateSVG(e,a);e.parentNode==t&&(t.removeChild(e),t.appendChild(i)),setTimeout(function(){i.parentNode==t&&(t.removeChild(i),t.appendChild(e))},REPLACE_ALL_NEW_DUR)}}function dataPrep(t,e){t.labels=t.labels||[];var a=t.labels.length,i=t.datasets,n=new Array(a).fill(0);return i||(i=[{values:n}]),i.map(function(t,i){if(t.values){var s=t.values;s=(s=s.map(function(t){return isNaN(t)?0:t})).length>a?s.slice(0,a):fillArray(s,a-s.length,0)}else t.values=n;t.chartType||(AXIS_DATASET_CHART_TYPES.includes(e),t.chartType=e)}),t.yRegions&&t.yRegions.map(function(t){if(t.end<t.start){var e=[t.end,start];t.start=e[0],t.end=e[1]}}),t}function zeroDataPrep(t){var e=t.labels.length,a=new Array(e).fill(0);return{labels:t.labels.slice(0,-1),datasets:t.datasets.map(function(t){return{name:"",values:a.slice(0,-1),chartType:t.chartType}}),yRegions:[{start:0,end:0,label:""}],yMarkers:[{value:0,label:""}]}}function getComponent(t,e,a){var i=Object.keys(componentConfigs).filter(function(e){return t.includes(e)}),n=componentConfigs[i[0]];return Object.assign(n,{constants:e,getData:a}),new ChartComponent$1(n)}function normalize(t){if(0===t)return[0,0];if(isNaN(t))return{mantissa:-6755399441055744,exponent:972};var e=t>0?1:-1;if(!isFinite(t))return{mantissa:4503599627370496*e,exponent:972};t=Math.abs(t);var a=Math.floor(Math.log10(t));return[e*(t/Math.pow(10,a)),a]}function getChartRangeIntervals(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=Math.ceil(t),i=Math.floor(e),n=a-i,s=n,r=1;n>5&&(n%2!=0&&(n=++a-i),s=n/2,r=2),n<=2&&(r=n/(s=4)),0===n&&(s=5,r=1);for(var o=[],l=0;l<=s;l++)o.push(i+r*l);return o}function getChartIntervals(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=normalize(t),i=slicedToArray(a,2),n=i[0],s=i[1],r=e?e/Math.pow(10,s):0,o=getChartRangeIntervals(n=n.toFixed(6),r);return o=o.map(function(t){return t*Math.pow(10,s)})}function calcChartIntervals(t){function e(t,e){for(var a=getChartIntervals(t),i=a[1]-a[0],n=0,s=1;n<e;s++)n+=i,a.unshift(-1*n);return a}var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=Math.max.apply(Math,toConsumableArray(t)),n=Math.min.apply(Math,toConsumableArray(t)),s=[];if(i>=0&&n>=0)normalize(i)[1],s=a?getChartIntervals(i,n):getChartIntervals(i);else if(i>0&&n<0){var r=Math.abs(n);i>=r?(normalize(i)[1],s=e(i,r)):(normalize(r)[1],s=e(r,i).map(function(t){return-1*t}))}else if(i<=0&&n<=0){var o=Math.abs(n),l=Math.abs(i);normalize(o)[1],s=(s=a?getChartIntervals(o,l):getChartIntervals(o)).reverse().map(function(t){return-1*t})}return s}function getZeroIndex(t){var e=getIntervalSize(t);return t.indexOf(0)>=0?t.indexOf(0):t[0]>0?-1*t[0]/e:-1*t[t.length-1]/e+(t.length-1)}function getIntervalSize(t){return t[1]-t[0]}function getValueRange(t){return t[t.length-1]-t[0]}function scale(t,e){return floatTwo(e.zeroLine-t*e.scaleMultiplier)}function calcDistribution(t,e){for(var a=Math.max.apply(Math,toConsumableArray(t)),i=1/(e-1),n=[],s=0;s<e;s++){var r=a*(i*s);n.push(r)}return n}function getMaxCheckpoint(t,e){return e.filter(function(e){return e<t}).length}function treatAsUtc(t){var e=new Date(t);return e.setMinutes(e.getMinutes()-e.getTimezoneOffset()),e}function getDdMmYyyy(t){var e=t.getDate(),a=t.getMonth()+1;return[(e>9?"":"0")+e,(a>9?"":"0")+a,t.getFullYear()].join("-")}function getWeeksBetween(t,e){return Math.ceil(getDaysBetween(t,e)/7)}function getDaysBetween(t,e){return(treatAsUtc(e)-treatAsUtc(t))/864e5}function addDays(t,e){t.setDate(t.getDate()+e)}function getChartByType(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"line",e=arguments[1];return"line"===t?(e.type="line",new AxisChart(e)):"bar"===t?(e.type="bar",new AxisChart(e)):chartTypes[t]?new chartTypes[t](e):void console.error("Undefined chart type: "+t)}__$styleInject('.chart-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.chart-container .graph-focus-margin{margin:0 5%}.chart-container>.title{margin-top:25px;margin-left:25px;text-align:left;font-weight:400;font-size:12px;color:#6c7680}.chart-container .graphics{margin-top:10px;padding-top:10px;padding-bottom:10px;position:relative}.chart-container .graph-stats-group{-ms-flex-pack:distribute;-webkit-box-flex:1;-ms-flex:1;flex:1}.chart-container .graph-stats-container,.chart-container .graph-stats-group{display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-around}.chart-container .graph-stats-container{-ms-flex-pack:distribute;padding-top:10px}.chart-container .graph-stats-container .stats{padding-bottom:15px}.chart-container .graph-stats-container .stats-title{color:#8d99a6}.chart-container .graph-stats-container .stats-value{font-size:20px;font-weight:300}.chart-container .graph-stats-container .stats-description{font-size:12px;color:#8d99a6}.chart-container .graph-stats-container .graph-data .stats-value{color:#98d85b}.chart-container .axis,.chart-container .chart-label{fill:#555b51}.chart-container .axis line,.chart-container .chart-label line{stroke:#dadada}.chart-container .percentage-graph .progress{margin-bottom:0}.chart-container .dataset-units circle{stroke:#fff;stroke-width:2}.chart-container .dataset-units path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container .dataset-path,.chart-container .multiaxis-chart .line-horizontal,.chart-container .multiaxis-chart .y-axis-guide{stroke-width:2px}.chart-container .path-group path{fill:none;stroke-opacity:1;stroke-width:2px}.chart-container line.dashed{stroke-dasharray:5,3}.chart-container .axis-line .specific-value{text-anchor:start}.chart-container .axis-line .y-line{text-anchor:end}.chart-container .axis-line .x-line{text-anchor:middle}.chart-container .progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.chart-container .progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#36414c;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;transition:width .6s ease}.chart-container .graph-svg-tip{position:absolute;z-index:1;padding:10px;font-size:12px;color:#959da5;text-align:center;background:rgba(0,0,0,.8);border-radius:3px}.chart-container .graph-svg-tip ol,.chart-container .graph-svg-tip ul{padding-left:0;display:-webkit-box;display:-ms-flexbox;display:flex}.chart-container .graph-svg-tip ul.data-point-list li{min-width:90px;-webkit-box-flex:1;-ms-flex:1;flex:1;font-weight:600}.chart-container .graph-svg-tip strong{color:#dfe2e5;font-weight:600}.chart-container .graph-svg-tip .svg-pointer{position:absolute;height:5px;margin:0 0 0 -5px;content:" ";border:5px solid transparent;border-top-color:rgba(0,0,0,.8)}.chart-container .graph-svg-tip.comparison{padding:0;text-align:left;pointer-events:none}.chart-container .graph-svg-tip.comparison .title{display:block;padding:10px;margin:0;font-weight:600;line-height:1;pointer-events:none}.chart-container .graph-svg-tip.comparison ul{margin:0;white-space:nowrap;list-style:none}.chart-container .graph-svg-tip.comparison li{display:inline-block;padding:5px 10px}.chart-container .indicator,.chart-container .indicator-right{background:none;font-size:12px;vertical-align:middle;font-weight:700;color:#6c7680}.chart-container .indicator i{content:"";display:inline-block;height:8px;width:8px;border-radius:8px}.chart-container .indicator:before,.chart-container .indicator i{margin:0 4px 0 0}.chart-container .indicator-right:after{margin:0 0 0 4px}',void 0);var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},asyncGenerator=function(){function t(t){this.value=t}function e(e){function a(t,e){return new Promise(function(a,n){var o={key:t,arg:e,resolve:a,reject:n,next:null};r?r=r.next=o:(s=r=o,i(t,e))})}function i(a,s){try{var r=e[a](s),o=r.value;o instanceof t?Promise.resolve(o.value).then(function(t){i("next",t)},function(t){i("throw",t)}):n(r.done?"return":"normal",r.value)}catch(t){n("throw",t)}}function n(t,e){switch(t){case"return":s.resolve({value:e,done:!0});break;case"throw":s.reject(e);break;default:s.resolve({value:e,done:!1})}(s=s.next)?i(s.key,s.arg):r=null}var s,r;this._invoke=a,"function"!=typeof e.return&&(this.return=void 0)}return"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)},{wrap:function(t){return function(){return new e(t.apply(this,arguments))}},await:function(e){return new t(e)}}}(),classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},createClass=function(){function t(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,a,i){return a&&t(e.prototype,a),i&&t(e,i),e}}(),get=function t(e,a,i){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,a);if(void 0===n){var s=Object.getPrototypeOf(e);return null===s?void 0:t(s,a,i)}if("value"in n)return n.value;var r=n.get;if(void 0!==r)return r.call(i)},inherits=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)},possibleConstructorReturn=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},slicedToArray=function(){function t(t,e){var a=[],i=!0,n=!1,s=void 0;try{for(var r,o=t[Symbol.iterator]();!(i=(r=o.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){n=!0,s=t}finally{try{!i&&o.return&&o.return()}finally{if(n)throw s}}return a}return function(e,a){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),toConsumableArray=function(t){if(Array.isArray(t)){for(var e=0,a=Array(t.length);e<t.length;e++)a[e]=t[e];return a}return Array.from(t)};$$1.create=function(t,e){var a=document.createElement(t);for(var i in e){var n=e[i];if("inside"===i)$$1(n).appendChild(a);else if("around"===i){var s=$$1(n);s.parentNode.insertBefore(a,s),a.appendChild(s)}else"styles"===i?"object"===(void 0===n?"undefined":_typeof(n))&&Object.keys(n).map(function(t){a.style[t]=n[t]}):i in a?a[i]=n:a.setAttribute(i,n)}return a};var SvgTip=function(){function t(e){var a=e.parent,i=void 0===a?null:a,n=e.colors,s=void 0===n?[]:n;classCallCheck(this,t),this.parent=i,this.colors=s,this.title_name="",this.title_value="",this.list_values=[],this.title_value_first=0,this.x=0,this.y=0,this.top=0,this.left=0,this.setup()}return createClass(t,[{key:"setup",value:function(){this.make_tooltip()}},{key:"refresh",value:function(){this.fill(),this.calc_position()}},{key:"make_tooltip",value:function(){var t=this;this.container=$$1.create("div",{inside:this.parent,className:"graph-svg-tip comparison",innerHTML:'<span class="title"></span>\n\t\t\t\t<ul class="data-point-list"></ul>\n\t\t\t\t<div class="svg-pointer"></div>'}),this.hide_tip(),this.title=this.container.querySelector(".title"),this.data_point_list=this.container.querySelector(".data-point-list"),this.parent.addEventListener("mouseleave",function(){t.hide_tip()})}},{key:"fill",value:function(){var t=this,e=void 0;e=this.title_value_first?"<strong>"+this.title_value+"</strong>"+this.title_name:this.title_name+"<strong>"+this.title_value+"</strong>",this.title.innerHTML=e,this.data_point_list.innerHTML="",this.list_values.map(function(e,a){var i=t.colors[a]||"black",n=$$1.create("li",{styles:{"border-top":"3px solid "+i},innerHTML:'<strong style="display: block;">'+(0===e.value||e.value?e.value:"")+"</strong>\n\t\t\t\t\t"+(e.title?e.title:"")});t.data_point_list.appendChild(n)})}},{key:"calc_position",value:function(){var t=this.container.offsetWidth;this.top=this.y-this.container.offsetHeight,this.left=this.x-t/2;var e=this.parent.offsetWidth-t,a=this.container.querySelector(".svg-pointer");if(this.left<0)a.style.left="calc(50% - "+-1*this.left+"px)",this.left=0;else if(this.left>e){var i="calc(50% + "+(this.left-e)+"px)";a.style.left=i,this.left=e}else a.style.left="50%"}},{key:"set_values",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.title_name=a,this.title_value=i,this.list_values=n,this.x=t,this.y=e,this.title_value_first=s,this.refresh()}},{key:"hide_tip",value:function(){this.container.style.top="0px",this.container.style.left="0px",this.container.style.opacity="0"}},{key:"show_tip",value:function(){this.container.style.top=this.top+"px",this.container.style.left=this.left+"px",this.container.style.opacity="1"}}]),t}(),UNIT_ANIM_DUR=350,PATH_ANIM_DUR=350,MARKER_LINE_ANIM_DUR=UNIT_ANIM_DUR,REPLACE_ALL_NEW_DUR=250,STD_EASING="easein",AXIS_TICK_LENGTH=6,LABEL_MARGIN=4,FONT_SIZE=10,BASE_LINE_COLOR="#dadada",AxisChartRenderer=function(){function t(e){classCallCheck(this,t),this.refreshState(e)}return createClass(t,[{key:"refreshState",value:function(t){this.totalHeight=t.totalHeight,this.totalWidth=t.totalWidth,this.zeroLine=t.zeroLine,this.unitWidth=t.unitWidth,this.xAxisMode=t.xAxisMode,this.yAxisMode=t.yAxisMode}},{key:"setZeroline",value:function(t){this.zeroLine=t}},{key:"xMarker",value:function(){}},{key:"xRegion",value:function(){return createSVG("rect",{className:"bar mini",style:"fill: rgba(228, 234, 239, 0.49)",x:0,y:y2,width:this.totalWidth,height:y1-y2})}},{key:"animatebar",value:function(t,e,a,i,n){var s=e-this.avgUnitWidth/4,r=this.avgUnitWidth/2/n,o=getBarHeightAndYAttr(a,this.zeroLine,this.totalHeight),l=slicedToArray(o,2);return e=s+r*i,[t,{width:r,height:l[0],x:e,y:l[1]},UNIT_ANIM_DUR,STD_EASING]}},{key:"animatedot",value:function(t,e,a){return[t,{cx:e,cy:a},UNIT_ANIM_DUR,STD_EASING]}},{key:"animatepath",value:function(t,e){var a=[],i=[t[0],{d:"M"+e},PATH_ANIM_DUR,STD_EASING];if(a.push(i),t[1]){var n="0,"+this.zeroLine+"L",s="L"+this.totalWidth+", "+this.zeroLine,r=[t[1],{d:"M"+n+e+s},PATH_ANIM_DUR,STD_EASING];a.push(r)}return a}}]),t}(),PRESET_COLOR_MAP={"light-blue":"#7cd6fd",blue:"#5e64ff",violet:"#743ee2",red:"#ff5858",orange:"#ffa00a",yellow:"#feef72",green:"#28a745","light-green":"#98d85b",purple:"#b554ff",magenta:"#ffa3ef",black:"#36114C",grey:"#bdd3e6","light-grey":"#f0f4f7","dark-grey":"#b8c2cc"},DEFAULT_COLORS=["light-blue","blue","violet","red","orange","yellow","green","light-green","purple","magenta"],getColor=function(t){return PRESET_COLOR_MAP[t]||t},ALL_CHART_TYPES=["line","scatter","bar","percentage","heatmap","pie"],COMPATIBLE_CHARTS={bar:["line","scatter","percentage","pie"],line:["scatter","bar","percentage","pie"],pie:["line","scatter","percentage","bar"],scatter:["line","bar","percentage","pie"],percentage:["bar","line","scatter","pie"],heatmap:[]},COLOR_COMPATIBLE_CHARTS={bar:["line","scatter"],line:["scatter","bar"],pie:["percentage"],scatter:["line","bar"],percentage:["pie"],heatmap:[]},EASING={ease:"0.25 0.1 0.25 1",linear:"0 0 1 1",easein:"0.1 0.8 0.2 1",easeout:"0 0 0.58 1",easeinout:"0.42 0 0.58 1"},BaseChart=function(){function t(e){var a=e.height,i=void 0===a?240:a,n=e.title,s=void 0===n?"":n,r=e.subtitle,o=void 0===r?"":r,l=(e.colors,e.isNavigable),h=void 0===l?0:l,c=(e.showLegend,e.type),u=void 0===c?"":c,p=e.parent,d=e.data;classCallCheck(this,t),this.rawChartArgs=arguments[0],this.parent="string"==typeof p?document.querySelector(p):p,this.title=s,this.subtitle=o,this.argHeight=i,this.type=u,this.isNavigable=h,this.isNavigable&&(this.currentIndex=0),this.realData=this.prepareData(d),this.data=this.prepareFirstData(this.realData),this.colors=[],this.config={},this.state={},this.options={},this.configure(arguments[0])}return createClass(t,[{key:"configure",value:function(t){var e=this;this.setColors(),this.config={showTooltip:1,showLegend:1,isNavigable:0,animate:1},this.setMargins(),window.addEventListener("resize",function(){return e.draw()}),window.addEventListener("orientationchange",function(){return e.draw()})}},{key:"setColors",value:function(){var t=this.rawChartArgs,e="percentage"===t.type||"pie"===t.type?t.data.labels:t.data.datasets;!t.colors||e&&t.colors.length<e.length?this.colors=DEFAULT_COLORS:this.colors=t.colors,this.colors=this.colors.map(function(t){return getColor(t)})}},{key:"setMargins",value:function(){var t=this.argHeight;this.baseHeight=t,this.height=t-40,this.translateY=20,this.translateXLeft=60,this.translateXRight=40}},{key:"validate",value:function(){return!!this.parent||(console.error("No parent element to render on was provided."),!1)}},{key:"setup",value:function(){this.validate()&&this._setup()}},{key:"_setup",value:function(){this.makeContainer(),this.makeTooltip(),this.draw(!0)}},{key:"initComponents",value:function(){}},{key:"setupComponents",value:function(){this.components=new Map}},{key:"makeContainer",value:function(){this.container=$$1.create("div",{className:"chart-container",innerHTML:'<h6 class="title">'+this.title+'</h6>\n\t\t\t\t<h6 class="sub-title uppercase">'+this.subtitle+'</h6>\n\t\t\t\t<div class="frappe-chart graphics"></div>\n\t\t\t\t<div class="graph-stats-container"></div>'}),this.parent.innerHTML="",this.parent.appendChild(this.container),this.chartWrapper=this.container.querySelector(".frappe-chart"),this.statsWrapper=this.container.querySelector(".graph-stats-container")}},{key:"makeTooltip",value:function(){this.tip=new SvgTip({parent:this.chartWrapper,colors:this.colors}),this.bindTooltip()}},{key:"bindTooltip",value:function(){}},{key:"draw",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.calcWidth(),this.makeChartArea(),this.calc(),this.initComponents(),this.setupComponents(),this.components.forEach(function(e){return e.setup(t.drawArea)}),this.components.forEach(function(t){return t.make()}),this.renderLegend(),this.setupNavigation(e),e&&(this.data=this.realData,setTimeout(function(){t.update()},1e3))}},{key:"calcWidth",value:function(){this.baseWidth=getElementContentWidth(this.parent)-0,this.width=this.baseWidth-(this.translateXLeft+this.translateXRight)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;this.data=this.prepareData(t),this.calc(),this.render()}},{key:"prepareData",value:function(){}},{key:"calc",value:function(){}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.components,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=[];t.forEach(function(t){a=a.concat(t.update(e))}),a.length>0&&runSMILAnimation(this.chartWrapper,this.svg,a)}},{key:"makeChartArea",value:function(){this.svg&&this.chartWrapper.removeChild(this.svg),this.svg=makeSVGContainer(this.chartWrapper,"chart",this.baseWidth,this.baseHeight),this.svgDefs=makeSVGDefs(this.svg),this.drawArea=makeSVGGroup(this.svg,this.type+"-chart","translate("+this.translateXLeft+", "+this.translateY+")")}},{key:"renderLegend",value:function(){}},{key:"setupNavigation",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isNavigable||(this.makeOverlay(),e&&(this.bindOverlay(),document.addEventListener("keydown",function(e){isElementInViewport(t.chartWrapper)&&("37"==(e=e||window.event).keyCode?t.onLeftArrow():"39"==e.keyCode?t.onRightArrow():"38"==e.keyCode?t.onUpArrow():"40"==e.keyCode?t.onDownArrow():"13"==e.keyCode&&t.onEnterKey())})))}},{key:"makeOverlay",value:function(){}},{key:"bindOverlay",value:function(){}},{key:"bind_units",value:function(){}},{key:"onLeftArrow",value:function(){}},{key:"onRightArrow",value:function(){}},{key:"onUpArrow",value:function(){}},{key:"onDownArrow",value:function(){}},{key:"onEnterKey",value:function(){}},{key:"getDataPoint",value:function(){}},{key:"setCurrentDataPoint",value:function(t){}},{key:"updateDataset",value:function(t,e){}},{key:"addDataset",value:function(t,e){}},{key:"removeDataset",value:function(){}},{key:"updateDatasets",value:function(t){}},{key:"updateDataPoint",value:function(t){}},{key:"addDataPoint",value:function(t){}},{key:"removeDataPoint",value:function(){}},{key:"getDifferentChart",value:function(t){return getDifferentChart(t,this.type,this.rawChartArgs)}}]),t}(),Y_AXIS_MARGIN=60,MIN_BAR_PERCENT_HEIGHT=.01,DEFAULT_AXIS_CHART_TYPE="line",AXIS_DATASET_CHART_TYPES=["line","bar"],BAR_CHART_SPACE_RATIO=.5,ChartComponent$1=function(){function t(e){var a=e.layerClass,i=void 0===a?"":a,n=e.layerTransform,s=void 0===n?"":n,r=e.constants,o=e.getData,l=e.makeElements,h=e.animateElements;classCallCheck(this,t),this.layerTransform=s,this.constants=r,this.makeElements=l,this.getData=o,this.animateElements=h,this.store=[],this.layerClass=i,this.layerClass="function"==typeof this.layerClass?this.layerClass():this.layerClass,this.refresh()}return createClass(t,[{key:"refresh",value:function(t){this.data=t||this.getData()}},{key:"setup",value:function(t){this.layer=makeSVGGroup(t,this.layerClass,this.layerTransform)}},{key:"make",value:function(){this.render(this.data),this.oldData=this.data}},{key:"render",value:function(t){var e=this;this.store=this.makeElements(t),this.layer.textContent="",this.store.forEach(function(t){e.layer.appendChild(t)})}},{key:"update",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.refresh();var a=[];return e&&(a=this.animateElements(this.data)),setTimeout(function(){t.make()},1400),a}}]),t}(),componentConfigs={yAxis:{layerClass:"y axis",makeElements:function(t){var e=this;return t.positions.map(function(a,i){return yLine(a,t.labels[i],e.constants.width,{mode:e.constants.mode,pos:e.constants.pos})})},animateElements:function(t){var e=t.positions,a=t.labels,i=this.oldData.positions,n=this.oldData.labels,s=equilizeNoOfElements(i,e),r=slicedToArray(s,2);i=r[0],e=r[1];var o=equilizeNoOfElements(n,a),l=slicedToArray(o,2);return n=l[0],a=l[1],this.render({positions:i,labels:a}),this.store.map(function(t,a){return translateHoriLine(t,e[a],i[a])})}},xAxis:{layerClass:"x axis",makeElements:function(t){var e=this;return t.positions.map(function(a,i){return xLine(a,t.labels[i],e.constants.height,{mode:e.constants.mode,pos:e.constants.pos})})},animateElements:function(t){var e=t.positions,a=t.labels,i=this.oldData.positions,n=this.oldData.labels,s=equilizeNoOfElements(i,e),r=slicedToArray(s,2);i=r[0],e=r[1];var o=equilizeNoOfElements(n,a),l=slicedToArray(o,2);return n=l[0],a=l[1],this.render({positions:i,labels:a}),this.store.map(function(t,a){return translateVertLine(t,e[a],i[a])})}},yMarkers:{layerClass:"y-markers",makeElements:function(t){var e=this;return t.map(function(t){return yMarker(t.position,t.label,e.constants.width,{pos:"right",mode:"span",lineType:"dashed"})})},animateElements:function(t){var e=equilizeNoOfElements(this.oldData,t),a=slicedToArray(e,2);this.oldData=a[0];var i=(t=a[1]).map(function(t){return t.position}),n=t.map(function(t){return t.label}),s=this.oldData.map(function(t){return t.position});this.oldData.map(function(t){return t.label});return this.render(s.map(function(t,e){return{position:s[e],label:n[e]}})),this.store.map(function(t,e){return translateHoriLine(t,i[e],s[e])})}},yRegions:{layerClass:"y-regions",makeElements:function(t){var e=this;return t.map(function(t){return yRegion(t.start,t.end,e.constants.width,t.label)})},animateElements:function(t){var e=equilizeNoOfElements(this.oldData,t),a=slicedToArray(e,2);this.oldData=a[0];var i=(t=a[1]).map(function(t){return t.end}),n=t.map(function(t){return t.label}),s=t.map(function(t){return t.start}),r=this.oldData.map(function(t){return t.end}),o=(this.oldData.map(function(t){return t.label}),this.oldData.map(function(t){return t.start}));this.render(r.map(function(t,e){return{start:o[e],end:r[e],label:n[e]}}));var l=[];return this.store.map(function(t,e){l=l.concat(animateRegion(t,s[e],i[e],r[e]))}),l}},barGraph:{layerClass:function(){return"dataset-units dataset-"+this.constants.index},makeElements:function(t){var e=this.constants;return t.yPositions.map(function(a,i){return datasetBar(t.xPositions[i],a,t.barWidth,e.color,e.valuesOverPoints?e.stacked?t.cumulativeYs[i]:t.values[i]:"",i,a-(e.stacked?t.cumulativeYPos[i]:a),{zeroLine:t.zeroLine,barsWidth:t.barsWidth,minHeight:e.minHeight})})},animateElements:function(t){var e=this.constants,a=t.xPositions,i=t.yPositions,n=t.cumulativeYPos,s=t.values,r=t.cumulativeYs,o=this.oldData.xPositions,l=this.oldData.yPositions,h=this.oldData.cumulativeYPos,c=this.oldData.values,u=this.oldData.cumulativeYs,p=equilizeNoOfElements(o,a),d=slicedToArray(p,2);o=d[0],a=d[1];var f=equilizeNoOfElements(l,i),v=slicedToArray(f,2);l=v[0],i=v[1];var m=equilizeNoOfElements(h,n),g=slicedToArray(m,2);h=g[0],n=g[1];var y=equilizeNoOfElements(c,s),_=slicedToArray(y,2);c=_[0],s=_[1];var x=equilizeNoOfElements(u,r),b=slicedToArray(x,2);u=b[0],r=b[1],this.render({xPositions:o,yPositions:l,cumulativeYPos:h,values:s,cumulativeYs:r,zeroLine:this.oldData.zeroLine,barsWidth:this.oldData.barsWidth,barWidth:this.oldData.barWidth});var A=[];return this.store.map(function(n,s){A=A.concat(animateBar(n,a[s],i[s],t.barWidth,e.index,{zeroLine:t.zeroLine}))}),A}},lineGraph:{}},AxisChart=function(t){function e(t){classCallCheck(this,e);var a=possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return a.isSeries=t.isSeries,a.valuesOverPoints=t.valuesOverPoints,a.formatTooltipY=t.formatTooltipY,a.formatTooltipX=t.formatTooltipX,a.barOptions=t.barOptions||{},a.lineOptions=t.lineOptions||{},a.type=t.type||"line",a.xAxisMode=t.xAxisMode||"span",a.yAxisMode=t.yAxisMode||"span",a.zeroLine=a.height,a.setup(),a}return inherits(e,t),createClass(e,[{key:"configure",value:function(t){get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"configure",this).call(this),this.config.xAxisMode=t.xAxisMode,this.config.yAxisMode=t.yAxisMode}},{key:"setMargins",value:function(){get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setMargins",this).call(this),this.translateXLeft=Y_AXIS_MARGIN,this.translateXRight=Y_AXIS_MARGIN}},{key:"prepareData",value:function(){return dataPrep(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data,this.type)}},{key:"prepareFirstData",value:function(){return zeroDataPrep(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data)}},{key:"calc",value:function(){this.calcXPositions(),this.calcYAxisParameters(this.getAllYValues(),"line"===this.type)}},{key:"calcXPositions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state,e=this.data.labels;t.datasetLength=e.length,t.unitWidth=this.width/t.datasetLength,t.xOffset=t.unitWidth/2,t.xAxis={labels:e,positions:e.map(function(e,a){return floatTwo(t.xOffset+a*t.unitWidth)})}}},{key:"calcYAxisParameters",value:function(t){var e=calcChartIntervals(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"false"),a=this.height/getValueRange(e),i=getIntervalSize(e)*a,n=this.height-getZeroIndex(e)*i;this.state.yAxis={labels:e,positions:e.map(function(t){return n-t*a}),scaleMultiplier:a,zeroLine:n},this.calcYUnits(),this.calcYExtremes(),this.calcYRegions()}},{key:"calcYUnits",value:function(){var t=this.state,e=function(e){return e.map(function(e){return scale(e,t.yAxis)})};t.datasets=this.data.datasets.map(function(t,a){var i=t.values,n=t.cumulativeYs||[];return{name:t.name,index:a,chartType:t.chartType,values:i,yPositions:e(i),cumulativeYs:n,cumulativeYPos:e(n)}})}},{key:"calcYExtremes",value:function(){var t=this.state;if(this.barOptions&&this.barOptions.stacked)return void(t.yExtremes=t.datasets[t.datasets.length-1].cumulativeYPos);t.yExtremes=new Array(t.datasetLength).fill(9999),t.datasets.map(function(e,a){e.yPositions.map(function(e,a){e<t.yExtremes[a]&&(t.yExtremes[a]=e)})})}},{key:"calcYRegions",value:function(){var t=this.state;this.data.yMarkers&&(this.state.yMarkers=this.data.yMarkers.map(function(e){return e.position=scale(e.value,t.yAxis),e.label+=": "+e.value,e})),this.data.yRegions&&(this.state.yRegions=this.data.yRegions.map(function(e){return e.start=scale(e.start,t.yAxis),e.end=scale(e.end,t.yAxis),e}))}},{key:"getAllYValues",value:function(){var t,e=this,a="values";if(this.barOptions&&this.barOptions.stacked){a="cumulativeYs";var i=new Array(this.state.datasetLength).fill(0);this.data.datasets.map(function(t,n){var s=e.data.datasets[n].values;t[a]=i=i.map(function(t,e){return t+s[e]})})}return(t=[]).concat.apply(t,toConsumableArray(this.data.datasets.map(function(t){return t[a]})))}},{key:"initComponents",value:function(){var t=this;this.componentConfigs=[["yAxis",{mode:this.yAxisMode,width:this.width}],["xAxis",{mode:this.xAxisMode,height:this.height}],["yRegions",{width:this.width,pos:"right"}]],this.componentConfigs.map(function(e){e.push(function(){return this.state[e[0]]}.bind(t))});var e=this.state.datasets.filter(function(t){return"bar"===t.chartType}),a=(this.state.datasets.filter(function(t){return"line"===t.chartType}),e.map(function(a){var i=a.index;return["barGraph-"+a.index,{index:i,color:t.colors[i],valuesOverPoints:t.valuesOverPoints,minHeight:t.height*MIN_BAR_PERCENT_HEIGHT},function(){var t=this.state,a=t.datasets[i],n=this.barOptions.spaceRatio||BAR_CHART_SPACE_RATIO,s=t.unitWidth*(1-n),r=s/(this.barOptions.stacked?1:e.length);return{xPositions:t.xAxis.positions.map(function(t){return t-s/2+r*i}),yPositions:a.yPositions,cumulativeYPos:a.cumulativeYPos,values:a.values,cumulativeYs:a.cumulativeYs,zeroLine:t.yAxis.zeroLine,barsWidth:s,barWidth:r}}.bind(t)]})),i=[["yMarkers",{width:this.width,pos:"right"}]];i.map(function(e){e.push(function(){return this.state[e[0]]}.bind(t))}),this.componentConfigs=this.componentConfigs.concat(a,i)}},{key:"setupComponents",value:function(){var t=this,e=["yMarkers","yRegions"];this.components=new Map(this.componentConfigs.filter(function(a){return!e.includes(a[0])||t.state[a[0]]||"barGraph"===a[0]}).map(function(t){return[t[0],getComponent.apply(void 0,toConsumableArray(t))]}))}},{key:"getChartComponents",value:function(){var t=this,e=[];return this.data.datasets.forEach(function(a,i){"line"===a.chartType&&e.push(t.getPathComponent(a,i));var n=t.unitRenderers[a.chartType];e.push(t.getDataUnitComponent(i,n))}),e}},{key:"getDataUnitComponent",value:function(t,e){var a=this;return new ChartComponent({layerClass:"dataset-units dataset-"+t,makeElements:function(){var i=a.data.datasets[t];return i.positions.map(function(n,s){return e.draw(a.state.xAxis.positions[s],n,a.colors[t],a.valuesOverPoints?a.barOptions&&a.barOptions.stacked?i.cumulativeYs[s]:i.values[s]:"",s,n-(i.cumulativePositions?i.cumulativePositions[s]:n))})},postMake:function(){var a=this;"bar"!==this.meta.type||this.meta.barOptions&&this.meta.barOptions.stacked||function(){a.layer.setAttribute("transform","translate("+e.consts.width*t+", 0)")}()},animate:function(i){var n=a.state.xAxis.positions,s=a.data.datasets[t].positions,r=i[i.length-1],o=r.parentNode;if(a.oldState.xExtra>0)for(var l=0;l<a.oldState.xExtra;l++){var h=r.cloneNode(!0);o.appendChild(h),i.push(h)}i.map(function(i,r){void 0!==n[r]&&void 0!==s[r]&&a.elementsToAnimate.push(e.animate(i,n[r],s[r],t,a.data.datasets.length))})}})}},{key:"getPathComponent",value:function(t,e){var a=this;return new ChartComponent({layerClass:"path dataset-path",setData:function(){},makeElements:function(){var t=a.data.datasets[e],i=a.colors[e];return getPaths(t.positions,a.state.xAxis.positions,i,a.config.heatline,a.config.regionFill)},animate:function(t){var i=a.state.xAxis.positions,n=a.data.datasets[e].positions,s=a.oldState.xAxis.positions,r=a.oldState.datasets[e].positions,o=t[0].parentNode,l=equilizeNoOfElements(s,i),h=slicedToArray(l,2);s=h[0],i=h[1];var c=equilizeNoOfElements(r,n),u=slicedToArray(c,2);r=u[0],n=u[1],a.oldState.xExtra>0&&(t=getPaths(r,s,a.colors[e],a.config.heatline,a.config.regionFill),o.textContent="",t.map(function(t){return o.appendChild(t)}));var p=n.map(function(t,e){return i[e]+","+t});a.elementsToAnimate=a.elementsToAnimate.concat(a.renderer.animatepath(t,p.join("L")))}})}},{key:"bindTooltip",value:function(){var t=this;this.chartWrapper.addEventListener("mousemove",function(e){var a=getOffset(t.chartWrapper),i=e.pageX-a.left-t.translateXLeft;e.pageY-a.top-t.translateY<t.height+2*t.translateY?t.mapTooltipXPosition(i):t.tip.hide_tip()})}},{key:"mapTooltipXPosition",value:function(t){var e=this,a=this.state;if(a.yExtremes){var i=a.xAxis.labels;this.formatTooltipX&&this.formatTooltipX(i[0])&&(i=i.map(function(t){return e.formatTooltipX(t)}));for(var n=this.formatTooltipY&&this.formatTooltipY(this.y[0].values[0]),s=a.datasetLength-1;s>=0;s--){var r=a.xAxis.positions[s];if(t>r-a.unitWidth/2){var o=r+this.translateXLeft,l=a.yExtremes[s]+this.translateY,h=this.data.datasets.map(function(t,a){return{title:t.title,value:n?e.formatTooltipY(t.values[s]):t.values[s],color:e.colors[a]}});this.tip.set_values(o,l,i[s],"",h),this.tip.show_tip();break}}}}},{key:"getDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.current_index,e={index:t},a=this.y[0];return["svg_units","yUnitPositions","values"].map(function(i){var n=i.slice(0,i.length-1);e[n]=a[i][t]}),e.label=this.xAxis.labels[t],e}},{key:"setCurrentDataPoint",value:function(t){(t=parseInt(t))<0&&(t=0),t>=this.xAxis.labels.length&&(t=this.xAxis.labels.length-1),t!==this.current_index&&(this.current_index=t,$.fire(this.parent,"data-select",this.getDataPoint()))}},{key:"addDataPoint",value:function(t,a){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.state.datasetLength;get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"addDataPoint",this).call(this,t,a,i),this.data.labels.splice(i,0,t),this.data.datasets.map(function(t,e){t.values.splice(i,0,a[e])}),this.update(this.data)}},{key:"removeDataPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.datasetLength-1;get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"removeDataPoint",this).call(this,t),this.data.labels.splice(t,1),this.data.datasets.map(function(e){e.values.splice(t,1)}),this.update(this.data)}}]),e}(BaseChart),LineChart=function(t){function e(t){classCallCheck(this,e);var a=possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return a.type="line",Object.getPrototypeOf(a)!==e.prototype?possibleConstructorReturn(a):(a.setup(),a)}return inherits(e,t),createClass(e,[{key:"configure",value:function(t){get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"configure",this).call(this,t),this.config.xAxisMode=t.xAxisMode||"span",this.config.yAxisMode=t.yAxisMode||"span",this.config.dotRadius=t.dotRadius||4,this.config.heatline=t.heatline||0,this.config.regionFill=t.regionFill||0,this.config.showDots=t.showDots||1}},{key:"configUnits",value:function(){this.unitArgs={type:"dot",args:{radius:this.config.dotRadius}}}},{key:"setUnitWidthAndXOffset",value:function(){this.state.unitWidth=this.width/(this.state.datasetLength-1),this.state.xOffset=0}}]),e}(AxisChart),ScatterChart=function(t){function e(t){classCallCheck(this,e);var a=possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return a.type="scatter",t.dotRadius?a.dotRadius=t.dotRadius:a.dotRadius=8,a.setup(),a}return inherits(e,t),createClass(e,[{key:"setup_values",value:function(){get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setup_values",this).call(this),this.unit_args={type:"dot",args:{radius:this.dotRadius}}}},{key:"make_paths",value:function(){}},{key:"make_path",value:function(){}}]),e}(LineChart),MultiAxisChart=function(t){function e(t){return classCallCheck(this,e),possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t))}return inherits(e,t),createClass(e,[{key:"preSetup",value:function(){this.type="multiaxis"}},{key:"setMargins",value:function(){get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setMargins",this).call(this);var t=this.data.datasets.filter(function(t){return"left"===t.axisPosition}).length;this.translateXLeft=t*Y_AXIS_MARGIN||Y_AXIS_MARGIN,this.translateXRight=(this.data.datasets.length-t)*Y_AXIS_MARGIN||Y_AXIS_MARGIN}},{key:"prepareYAxis",value:function(){}},{key:"prepareData",value:function(t){get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"prepareData",this).call(this,t);var a=0,i=0;this.state.datasets.forEach(function(t,e){t.yAxis={position:t.axisPosition,index:"left"===t.axisPosition?a++:i++}})}},{key:"configure",value:function(t){get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"configure",this).call(this,t),this.config.xAxisMode=t.xAxisMode||"tick",this.config.yAxisMode=t.yAxisMode||"span"}},{key:"configUnits",value:function(){this.unitArgs={type:"bar",args:{spaceWidth:this.state.unitWidth/2}}}},{key:"setYAxis",value:function(){var t=this;this.state.datasets.map(function(e){t.calcYAxisParameters(e.yAxis,e.values,"line"===t.unitType)})}},{key:"calcYUnits",value:function(){this.state.datasets.map(function(t){t.positions=t.values.map(function(e){return floatTwo(t.yAxis.zeroLine-e*t.yAxis.scaleMultiplier)})})}},{key:"renderConstants",value:function(){var t=this;this.state.datasets.map(function(e){var a="left"===e.yAxis.position?-1*e.yAxis.index*Y_AXIS_MARGIN:t.width+e.yAxis.index*Y_AXIS_MARGIN;t.renderer.xLine(a,"",{pos:"top",mode:"span",stroke:t.colors[i],className:"y-axis-guide"})})}},{key:"getYAxesComponents",value:function(){var t=this;return this.data.datasets.map(function(e,a){return new ChartComponent({layerClass:"y axis y-axis-"+a,make:function(){var e=t.state.datasets[a].yAxis;t.renderer.setZeroline(e.zeroline);var i={pos:e.position,mode:"tick",offset:e.index*Y_AXIS_MARGIN,stroke:t.colors[a]};return e.positions.map(function(a,n){return t.renderer.yLine(a,e.labels[n],i)})},animate:function(){}})})}},{key:"getChartComponents",value:function(){var t=this;return this.data.datasets.map(function(e,a){return new ChartComponent({layerClass:"dataset-units dataset-"+a,make:function(){var e=t.state.datasets[a],i=t.unitArgs;return t.renderer.setZeroline(e.yAxis.zeroLine),e.positions.map(function(e,n){return t.renderer[i.type](t.state.xAxisPositions[n],e,i.args,t.colors[a],n,a,t.state.datasetLength)})},animate:function(e){var i=t.state.datasets[a],n=t.unitArgs.type,s=t.state.xAxisPositions,r=t.state.datasets[a].positions,o=e[e.length-1],l=o.parentNode;if(t.oldState.xExtra>0)for(var h=0;h<t.oldState.xExtra;h++){var c=o.cloneNode(!0);l.appendChild(c),e.push(c)}t.renderer.setZeroline(i.yAxis.zeroLine),e.map(function(e,i){void 0!==s[i]&&void 0!==r[i]&&t.elementsToAnimate.push(t.renderer["animate"+n](e,s[i],r[i],a,t.state.noOfDatasets))})}})})}}]),e}(AxisChart),PercentageChart=function(t){function e(t){classCallCheck(this,e);var a=possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return a.type="percentage",a.max_slices=10,a.max_legend_points=6,a.setup(),a}return inherits(e,t),createClass(e,[{key:"makeChartArea",value:function(){this.chartWrapper.className+=" graph-focus-margin",this.chartWrapper.style.marginTop="45px",this.statsWrapper.className+=" graph-focus-margin",this.statsWrapper.style.marginBottom="30px",this.statsWrapper.style.paddingTop="0px",this.chartDiv=$$1.create("div",{className:"div",inside:this.chartWrapper}),this.chart=$$1.create("div",{className:"progress-chart",inside:this.chartDiv})}},{key:"setupLayers",value:function(){this.percentageBar=$$1.create("div",{className:"progress",inside:this.chart})}},{key:"setup_values",value:function(){var t=this;this.slice_totals=[];var e=this.data.labels.map(function(e,a){var i=0;return t.data.datasets.map(function(t){i+=t.values[a]}),[i,e]}).filter(function(t){return t[0]>0}),a=e;if(e.length>this.max_slices){e.sort(function(t,e){return e[0]-t[0]}),a=e.slice(0,this.max_slices-1);var i=0;e.slice(this.max_slices-1).map(function(t){i+=t[0]}),a.push([i,"Rest"]),this.colors[this.max_slices-1]="grey"}this.labels=[],a.map(function(e){t.slice_totals.push(e[0]),t.labels.push(e[1])}),this.legend_totals=this.slice_totals.slice(0,this.max_legend_points)}},{key:"renderComponents",value:function(){var t=this;this.grand_total=this.slice_totals.reduce(function(t,e){return t+e},0),this.slices=[],this.slice_totals.map(function(e,a){var i=$$1.create("div",{className:"progress-bar",inside:t.percentageBar,styles:{background:t.colors[a],width:100*e/t.grand_total+"%"}});t.slices.push(i)})}},{key:"calc",value:function(){}},{key:"bindTooltip",value:function(){var t=this;this.slices.map(function(e,a){e.addEventListener("mouseenter",function(){var i=getOffset(t.chartWrapper),n=getOffset(e),s=n.left-i.left+e.offsetWidth/2,r=n.top-i.top-6,o=(t.formatted_labels&&t.formatted_labels.length>0?t.formatted_labels[a]:t.labels[a])+": ",l=(100*t.slice_totals[a]/t.grand_total).toFixed(1);t.tip.set_values(s,r,o,l+"%"),t.tip.show_tip()})})}},{key:"renderLegend",value:function(){var t=this,e=this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels:this.labels;this.legend_totals.map(function(a,i){a&&($$1.create("div",{className:"stats",inside:t.statsWrapper}).innerHTML='<span class="indicator">\n\t\t\t\t\t<i style="background: '+t.colors[i]+'"></i>\n\t\t\t\t\t<span class="text-muted">'+e[i]+":</span>\n\t\t\t\t\t"+a+"\n\t\t\t\t</span>")})}}]),e}(BaseChart),ANGLE_RATIO=Math.PI/180,FULL_ANGLE=360,PieChart=function(t){function e(t){classCallCheck(this,e);var a=possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return a.type="pie",a.elements_to_animate=null,a.hoverRadio=t.hoverRadio||.1,a.max_slices=10,a.max_legend_points=6,a.isAnimate=!1,a.startAngle=t.startAngle||0,a.clockWise=t.clockWise||!1,a.mouseMove=a.mouseMove.bind(a),a.mouseLeave=a.mouseLeave.bind(a),a.setup(),a}return inherits(e,t),createClass(e,[{key:"setup_values",value:function(){var t=this;this.centerX=this.width/2,this.centerY=this.height/2,this.radius=this.height>this.width?this.centerX:this.centerY,this.slice_totals=[];var e=this.data.labels.map(function(e,a){var i=0;return t.data.datasets.map(function(t){i+=t.values[a]}),[i,e]}).filter(function(t){return t[0]>0}),a=e;if(e.length>this.max_slices){e.sort(function(t,e){return e[0]-t[0]}),a=e.slice(0,this.max_slices-1);var i=0;e.slice(this.max_slices-1).map(function(t){i+=t[0]}),a.push([i,"Rest"]),this.colors[this.max_slices-1]="grey"}this.labels=[],a.map(function(e){t.slice_totals.push(e[0]),t.labels.push(e[1])}),this.legend_totals=this.slice_totals.slice(0,this.max_legend_points)}},{key:"makeArcPath",value:function(t,e){var a=this.centerX,i=this.centerY,n=this.radius,s=this.clockWise;return"M"+a+" "+i+" L"+(a+t.x)+" "+(i+t.y)+" A "+n+" "+n+" 0 0 "+(s?1:0)+" "+(a+e.x)+" "+(i+e.y)+" z"}},{key:"renderComponents",value:function(t){var a=this,i=this.radius,n=this.clockWise;this.grand_total=this.slice_totals.reduce(function(t,e){return t+e},0);var s=this.slicesProperties||[];this.slices=[],this.elements_to_animate=[],this.slicesProperties=[];var r=180-this.startAngle;this.slice_totals.map(function(o,l){var h=r,c=o/a.grand_total*FULL_ANGLE,u=n?-c:c,p=r+=u,d=e.getPositionByAngle(h,i),f=e.getPositionByAngle(p,i),v=t&&s[l],m=void 0,g=void 0;t?(m=v?v.startPosition:d,g=v?v.endPosition:d):(m=d,g=f);var y=a.makeArcPath(m,g),_=makePath(y,"pie-path","none",a.colors[l]);_.style.transition="transform .3s;",a.drawArea.appendChild(_),a.slices.push(_),a.slicesProperties.push({startPosition:d,endPosition:f,value:o,total:a.grand_total,startAngle:h,endAngle:p,angle:u}),t&&a.elements_to_animate.push([{unit:_,array:a.slices,index:a.slices.length-1},{d:a.makeArcPath(d,f)},650,"easein",null,{d:y}])}),t&&runSMILAnimation(this.chartWrapper,this.svg,this.elements_to_animate)}},{key:"calTranslateByAngle",value:function(t){var a=this.radius,i=this.hoverRadio,n=e.getPositionByAngle(t.startAngle+t.angle/2,a);return"translate3d("+n.x*i+"px,"+n.y*i+"px,0)"}},{key:"hoverSlice",value:function(t,e,a,i){if(t){var n=this.colors[e];if(a){transform(t,this.calTranslateByAngle(this.slicesProperties[e])),t.style.fill=lightenDarkenColor(n,50);var s=getOffset(this.svg),r=i.pageX-s.left+10,o=i.pageY-s.top-10,l=(this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels[e]:this.labels[e])+": ",h=(100*this.slice_totals[e]/this.grand_total).toFixed(1);this.tip.set_values(r,o,l,h+"%"),this.tip.show_tip()}else transform(t,"translate3d(0,0,0)"),this.tip.hide_tip(),t.style.fill=n}}},{key:"mouseMove",value:function(t){for(var e=t.target,a=this.curActiveSliceIndex,i=this.curActiveSlice,n=0;n<this.slices.length;n++)if(e===this.slices[n]){this.hoverSlice(i,a,!1),this.curActiveSlice=e,this.curActiveSliceIndex=n,this.hoverSlice(e,n,!0,t);break}}},{key:"mouseLeave",value:function(){this.hoverSlice(this.curActiveSlice,this.curActiveSliceIndex,!1)}},{key:"bindTooltip",value:function(){this.drawArea.addEventListener("mousemove",this.mouseMove),this.drawArea.addEventListener("mouseleave",this.mouseLeave)}},{key:"renderLegend",value:function(){var t=this,e=this.formatted_labels&&this.formatted_labels.length>0?this.formatted_labels:this.labels;this.legend_totals.map(function(a,i){var n=t.colors[i];a&&($$1.create("div",{className:"stats",inside:t.statsWrapper}).innerHTML='<span class="indicator">\n\t\t\t\t\t<i style="background-color:'+n+';"></i>\n\t\t\t\t\t<span class="text-muted">'+e[i]+":</span>\n\t\t\t\t\t"+a+"\n\t\t\t\t</span>")})}}],[{key:"getPositionByAngle",value:function(t,e){return{x:Math.sin(t*ANGLE_RATIO)*e,y:Math.cos(t*ANGLE_RATIO)*e}}}]),e}(BaseChart),Heatmap=function(t){function e(t){var a=t.start,i=void 0===a?"":a,n=t.domain,s=void 0===n?"":n,r=t.subdomain,o=void 0===r?"":r,l=t.data,h=void 0===l?{}:l,c=t.discrete_domains,u=void 0===c?0:c,p=t.count_label,d=void 0===p?"":p,f=t.legend_colors,v=void 0===f?[]:f;classCallCheck(this,e);var m=possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,arguments[0]));m.type="heatmap",m.domain=s,m.subdomain=o,m.data=h,m.discrete_domains=u,m.count_label=d;var g=new Date;return m.start=i||addDays(g,365),v=v.slice(0,5),m.legend_colors=m.validate_colors(v)?v:["#ebedf0","#c6e48b","#7bc96f","#239a3b","#196127"],m.distribution_size=5,m.translateX=0,m}return inherits(e,t),createClass(e,[{key:"validate_colors",value:function(t){if(t.length<5)return 0;var e=1;return t.forEach(function(t){isValidColor(t)||(e=0,console.warn('"'+t+'" is not a valid color.'))},this),e}},{key:"configure",value:function(){get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"configure",this).call(this),this.today=new Date,this.start||(this.start=new Date,this.start.setFullYear(this.start.getFullYear()-1)),this.first_week_start=new Date(this.start.toDateString()),this.last_week_start=new Date(this.today.toDateString()),7!==this.first_week_start.getDay()&&addDays(this.first_week_start,-1*this.first_week_start.getDay()),7!==this.last_week_start.getDay()&&addDays(this.last_week_start,-1*this.last_week_start.getDay()),this.no_of_cols=getWeeksBetween(this.first_week_start+"",this.last_week_start+"")+1}},{key:"calcWidth",value:function(){this.baseWidth=12*(this.no_of_cols+3),this.discrete_domains&&(this.baseWidth+=144)}},{key:"setupLayers",value:function(){this.domain_label_group=this.makeLayer("domain-label-group chart-label"),this.data_groups=this.makeLayer("data-groups","translate(0, 20)")}},{key:"setup_values",value:function(){var t=this;this.domain_label_group.textContent="",this.data_groups.textContent="";var e=Object.keys(this.data).map(function(e){return t.data[e]});this.distribution=calcDistribution(e,this.distribution_size),this.month_names=["January","February","March","April","May","June","July","August","September","October","November","December"],this.render_all_weeks_and_store_x_values(this.no_of_cols)}},{key:"render_all_weeks_and_store_x_values",value:function(t){var e=new Date(this.first_week_start);this.week_col=0,this.current_month=e.getMonth(),this.months=[this.current_month+""],this.month_weeks={},this.month_start_points=[],this.month_weeks[this.current_month]=0,this.month_start_points.push(13);for(var a=0;a<t;a++){var i=void 0,n=0,s=new Date(e),r=this.get_week_squares_group(s,this.week_col),o=slicedToArray(r,2);i=o[0],n=o[1],this.data_groups.appendChild(i),this.week_col+=1+parseInt(this.discrete_domains&&n),this.month_weeks[this.current_month]++,n&&(this.current_month=(this.current_month+1)%12,this.months.push(this.current_month+""),this.month_weeks[this.current_month]=1),addDays(e,7)}this.render_month_labels()}},{key:"get_week_squares_group",value:function(t,e){for(var a=this.today.getTime(),i=0,n=0,s=makeSVGGroup(this.data_groups,"data-group"),r=0,o=0;o<7;o+=1,r+=12){var l=0,h=0,c=t.getTime()/1e3,u=Math.floor(c-c%86400).toFixed(1);this.data[u]&&(l=this.data[u]),this.data[Math.round(u)]&&(l=this.data[Math.round(u)]),l&&(h=getMaxCheckpoint(l,this.distribution));var p=13+12*(e+n),d={"data-date":getDdMmYyyy(t),"data-value":l,"data-day":t.getDay()},f=makeHeatSquare("day",p,r,10,this.legend_colors[h],d);s.appendChild(f);var v=new Date(t);if(addDays(v,1),v.getTime()>a)break;v.getMonth()-t.getMonth()&&(i=1,this.discrete_domains&&(n=1),this.month_start_points.push(13+12*(e+n))),t=v}return[s,i]}},{key:"render_month_labels",value:function(){var t=this;this.months.shift(),this.month_start_points.shift(),this.months.pop(),this.month_start_points.pop(),this.month_start_points.map(function(e,a){var i=makeText("y-value-text",e+12,10,t.month_names[t.months[a]].substring(0,3));t.domain_label_group.appendChild(i)})}},{key:"renderComponents",value:function(){Array.prototype.slice.call(this.container.querySelectorAll(".graph-stats-container, .sub-title, .title")).map(function(t){t.style.display="None"}),this.chartWrapper.style.marginTop="0px",this.chartWrapper.style.paddingTop="0px"}},{key:"bindTooltip",value:function(){var t=this;Array.prototype.slice.call(document.querySelectorAll(".data-group .day")).map(function(e){e.addEventListener("mouseenter",function(e){var a=e.target.getAttribute("data-value"),i=e.target.getAttribute("data-date").split("-"),n=t.month_names[parseInt(i[1])-1].substring(0,3),s=t.chartWrapper.getBoundingClientRect(),r=e.target.getBoundingClientRect(),o=parseInt(e.target.getAttribute("width")),l=r.left-s.left+(o+2)/2,h=r.top-s.top-(o+2)/2,c=a+" "+t.count_label,u=" on "+n+" "+i[0]+", "+i[2];t.tip.set_values(l,h,u,c,[],1),t.tip.show_tip()})})}},{key:"update",value:function(t){this.data=t,this.setup_values(),this.bindTooltip()}}]),e}(BaseChart),chartTypes={mixed:AxisChart,multiaxis:MultiAxisChart,scatter:ScatterChart,percentage:PercentageChart,heatmap:Heatmap,pie:PieChart},Chart=function t(e){return classCallCheck(this,t),getChartByType(e.type,arguments[0])};module.exports=Chart;