UNPKG

@syncfusion/ej2-heatmap

Version:

Feature rich data visulization control used to visualize the matrix data where the individual values are represented as colors

10 lines 224 kB
/*! * filename: ej2-heatmap.min.js * version : 33.2.3 * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ this.ej=this.ej||{},this.ej.heatmap=function(e,t,i,l,a){"use strict";function n(e){var t;switch(e.toLowerCase()){case"highcontrastlight":case"highcontrast":t={heatMapTitle:"#ffffff",axisTitle:"#ffffff",axisLabel:"#ffffff",cellBorder:"#EEEEEE",background:"#000000",cellTextColor:"#000000",toggledColor:"#000000",emptyCellColor:"#EEEEEE",legendLabel:"#ffffff",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"materialdark":case"fabricdark":case"bootstrapdark":t={heatMapTitle:"#ffffff",axisTitle:"#ffffff",axisLabel:"#DADADA",cellBorder:"#EEEEEE",background:"#000000",cellTextColor:"#000000",toggledColor:"#000000",emptyCellColor:"#EEEEEE",legendLabel:"#ffffff",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"bootstrap4":t={heatMapTitle:"#212529",axisTitle:"#212529",axisLabel:"#212529",cellBorder:"#E9ECEF",background:"#FFFFFF",cellTextColor:"#212529",toggledColor:"#ffffff",emptyCellColor:"#E9ECEF",legendLabel:"#212529",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"tailwind":t={heatMapTitle:"#374151",axisTitle:"#374151",axisLabel:"#6B7280",cellBorder:"#E5E7EB",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#E5E7EB",legendLabel:"#374151",palette:[{color:"#5A61F6"},{color:"#65A30D"},{color:"#14B8A6"}]};break;case"tailwinddark":t={heatMapTitle:"#D1D5DB",axisTitle:"#D1D5DB",axisLabel:"#9CA3AF",cellBorder:"#4B5563",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#374151",legendLabel:"#D1D5DB",palette:[{color:"#8B5CF6"},{color:"#22D3EE"},{color:"#F87171"}]};break;case"tailwind3":t={heatMapTitle:"#111827",axisTitle:"#111827",axisLabel:"#4B5563",cellBorder:"#E5E7EB",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#E5E7EB",legendLabel:"#4B5563",palette:[{color:"#2F4074"},{color:"#03B4B4"},{color:"#0D72DE"}]};break;case"tailwind3dark":t={heatMapTitle:"#FFFFFF",axisTitle:"#FFFFFF",axisLabel:"#D1D5DB",cellBorder:"#282F3C",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#282F3C",legendLabel:"#D1D5DB",palette:[{color:"#8029F1"},{color:"#1ABC9C"},{color:"#0D72DE"}]};break;case"bootstrap5":t={heatMapTitle:"#212529",axisTitle:"#212529",axisLabel:"#212529",cellBorder:"transparent",background:"transparent",toggledColor:"#E9ECEF",emptyCellColor:"#E9ECEF",legendLabel:"#212529",palette:[{color:"#DC3545"},{color:"#FFC107"},{color:"#D63384"}]};break;case"bootstrap5dark":t={heatMapTitle:"#DEE2E6",axisTitle:"#DEE2E6",axisLabel:"#DEE2E6",cellBorder:"transparent",background:"transparent",toggledColor:"#343A40",emptyCellColor:"#343A40",legendLabel:"#DEE2E6",palette:[{color:"#DC3545"},{color:"#FFC107"},{color:"#D63384"}]};break;case"fluent":t={heatMapTitle:"#201F1E",axisTitle:"#201F1E",axisLabel:"#201F1E",cellBorder:"#EDEBE9",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#EDEBE9",legendLabel:"#201F1E",palette:[{color:"#EDEBE9"},{color:"#614570"},{color:"#4C6FB1"}]};break;case"fluentdark":t={heatMapTitle:"#F3F2F1",axisTitle:"#F3F2F1",axisLabel:"#F3F2F1",cellBorder:"#EDEBE9",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#292827",legendLabel:"#F3F2F1",palette:[{color:"#292827"},{color:"#2A72D5"},{color:"#43B786"}]};break;case"material3":t={heatMapTitle:"#1C1B1F",axisTitle:"#1C1B1F",axisLabel:"#1C1B1F",cellBorder:"#C4C7C5",background:"transparent",cellTextColor:"#1C1B1F",toggledColor:"#F6F0FB",emptyCellColor:"#F6F0FB",legendLabel:"#49454E",palette:[{color:"#6200EE"},{color:"#E77A16"},{color:"#82C100"}]};break;case"material3dark":t={heatMapTitle:"#E6E1E5",axisTitle:"#E6E1E5",axisLabel:"#E6E1E5",cellBorder:"#444746",background:"transparent",cellTextColor:"#E6E1E5",toggledColor:"#49454F",emptyCellColor:"#49454E",legendLabel:"#CAC4D0",palette:[{color:"#4EAAFF"},{color:"#FA4EAB"},{color:"#FFF500"}]};break;case"fluent2":t={heatMapTitle:"#242424",axisTitle:"#242424",axisLabel:"#242424",cellBorder:"transparent",background:"transparent",cellTextColor:"#242424",toggledColor:"#EDEBE9",emptyCellColor:"#EDEBE9",legendLabel:"#242424",palette:[{color:"#6200EE"},{color:"#09AF74"},{color:"#0076E5"}]};break;case"fluent2dark":case"fluent2highcontrast":t={heatMapTitle:"#FFFFFF",axisTitle:"#FFFFFF",axisLabel:"#FFFFFF",cellBorder:"transparent",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"#292827",emptyCellColor:"#292827",legendLabel:"#FFFFFF",palette:[{color:"#9BB449"},{color:"#2A72D5"},{color:"#43B786"}]};break;default:t={heatMapTitle:"#424242",axisTitle:"#424242",axisLabel:"#686868",cellBorder:"#EEEEEE",cellTextColor:"#000000",toggledColor:"#ffffff",background:"#FFFFFF",emptyCellColor:"#EEEEEE",legendLabel:"#353535",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]}}return t}function o(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function s(e,i){var l=e||"",a=document.getElementById("heatmapmeasuretext");if(null===a&&(a=t.createElement("text",{id:"heatmapmeasuretext"}),document.body.appendChild(a)),"string"==typeof e&&(e.indexOf("<")>-1||e.indexOf(">")>-1)){for(var n=e.split(" "),o=0;o<n.length;o++)-1===n[o].indexOf("<br/>")&&(n[o]=n[o].replace(/[<>]/g,"&"));e=n.join(" ")}a.innerText=l.indexOf("<br>")>-1||l.indexOf("<br/>")>-1?l:e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontSize=-1!==i.size.indexOf("px")?i.size:i.size+"px",a.style.fontWeight=i.fontWeight,a.style.fontStyle=i.fontStyle,a.style.fontFamily=i.fontFamily,a.style.top="-100",a.style.left="0",a.style.whiteSpace="nowrap",a.style.lineHeight="normal";var s=a.clientWidth,r=a.clientHeight;return M(),new ae(s,r)}function r(e,t,i,l){return"Near"===l.textAlignment?t:"Center"===l.textAlignment?t+e/2:e+t}function h(e,i,l,a,n,o,s){i.enableHtmlSanitizer&&"string"==typeof e&&(e=t.SanitizeHtmlHelper.sanitize(e));var r=d(e,i),h=null,g=i.dataSource;if(!i.dataSourceSettings.isJsonData||"Cell"!==i.dataSourceSettings.adaptorType&&"Table"!==i.dataSourceSettings.adaptorType)h={value:a.value,xLabel:n[a.xIndex],yLabel:o[a.yIndex]};else{var c="Numeric"===i.yAxis.valueType?i.yAxis.labels:o,u="Numeric"===i.xAxis.valueType?i.xAxis.labels:n;g.forEach(function(e){var t="Cell"===i.dataSourceSettings.adaptorType?Object.keys(e).some(function(t){return e[t]===c[a.yIndex]}):Object.prototype.hasOwnProperty.call(e,c[a.yIndex]);Object.keys(e).some(function(t){return e[t]===u[a.xIndex]})&&t&&(h=e)})}if(!t.isNullOrUndefined(r)){var m=p(r(h,i,r,i.element.id+"_Template"+s,!1),i.element.id+"_LabelTemplate_"+s);m.style.cssText="opacity: 1; display: flex; align-items: center; justify-content: center; z-index: 2; position: absolute;top:"+a.y+"px;left:"+a.x+"px;height:"+a.height+"px;width:"+a.width+"px;";for(var y=0;y<m.children.length;y++)m.children[y].style.pointerEvents="none";l.appendChild(m)}return l}function d(e,i){var l=null;try{"function"!=typeof e&&document.querySelectorAll(e).length?l=t.compile(document.querySelector(e).innerHTML.trim()):i.isVue||i.isVue3?l=t.compile(e):"function"==typeof e&&(l=t.compile(e))}catch(i){l=t.compile(e)}return l}function p(e,i){var l=t.createElement("div",{id:i});l.style.cssText="position: absolute;pointer-events: auto;";for(var a=e.length;a>0;)l.appendChild(e[0]),a--;return l}function g(e){for(var t=0,i=0,l=e;i<l.length;i++)t+=l[i];return t}function c(e,t,i,l){return"Near"===l.textAlignment?e.height-i:"Center"===l.textAlignment?e.height/2:t}function u(e,l,a){var n,o,r,h=new i.SvgRenderer("heatmapMeasureRotateText"),d=h.createSvg({id:"heatmapMeasureRotateText_svg",width:100,height:100}),p={"font-size":e.size,"font-style":e.fontStyle.toLowerCase(),"font-family":e.fontFamily,"font-weight":e.fontWeight.toLowerCase(),transform:"rotate("+a+", 0, 0)","text-anchor":"middle"},g=h.createText(p,l[0]);if("string"!=typeof l&&l.length>1)for(var c=1,u=l.length;c<u;c++)n=0+c*s(l[c],e).height,o=l[c],r=h.createTSpan({x:0,id:"heatmapMeasureRotateText_"+c,y:n},o),g.appendChild(r);d.appendChild(g),document.body.appendChild(d);var m=g.getBoundingClientRect();return t.remove(d),new ae(m.right-m.left,m.bottom-m.top)}function m(e,t,i){var l=[];switch(t.textOverflow){case"Wrap":l=x(e,i,t);break;case"Trim":l.push(b(i,e,t));break;default:l.push(f(i,e,t))}return l}function y(e,i){if(i)for(var l=0;l<e.length;l++)e[l]=t.SanitizeHtmlHelper.sanitize(e[l]);return e}function v(e){for(var t=!1,i=0;i<e.length;i++)if(-1!==e[i].indexOf("<br>")||-1!==e[i].indexOf("<br/>")){t=!0;break}return t}function x(e,t,i,l){for(var a,n=e.split(" "),o="",r=[],h=0,d=n.length;h<d;h++)a=n[h],s(o.concat(a),i).width<t?o=o.concat((""===o?"":" ")+a):""!==o?(o=l?o.concat((""===o?"":" ")+a):o,r.push(b(t,o,i)),o=l?"":a):(r.push(b(t,a,i)),a=""),o&&h===d-1&&r.push(b(t,o,i));return r}function b(e,t,i){var l=t,a=s(t,i).width;if(a>e)for(var n=t.length-1;n>=0;--n)if(l=t.substring(0,n)+"...",(a=s(l,i).width)<=e)return l;return l}function f(e,t,i){var l=t,a=s(t,i).width;if(a>e)for(var n=t.length-1;n>=0;--n)if(l=t.substring(0,n),(a=s(l,i).width)<=e)return l;return l}function S(e,i,l,a,n,o,r,h){var d=document.getElementById(n),p=s(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"}),g=p.width+5;i=(i=i+g>a?i-g:i)<0?5:i,d?(d.innerText=e,d.style.top=(l+15).toString()+"px",d.style.left=(i+15).toString()+"px"):((d=t.createElement("div",{id:n})).style.cssText="top:"+(l+15).toString()+"px;left:"+(i+15).toString()+"px;background-color: rgb(255, 255, 255) !important; color:black !important; position:absolute;border:1px solid rgb(112, 112, 112); padding-left : 3px; padding-right : 2px;padding-bottom : 2px; padding-top : 2px; font-size:12px; font-family: Segoe UI",d.innerText=e,o.appendChild(d)),e===h.titleSettings.text?d.style.width=i+15+p.width+7>h.availableSize.width?(h.availableSize.width-(i+15)).toString()+"px":"":(d.style.left=i+15+p.width+7>h.availableSize.width?(h.availableSize.width-(p.width+7)).toString()+"px":i.toString()+"px",d.style.top=l+15+p.height+6>h.availableSize.height?(l-(p.height+6)-10).toString()+"px":d.style.top),r&&(t.isNullOrUndefined(h.tooltipTimer)||window.clearTimeout(h.tooltipTimer),h.tooltipTimer=setTimeout(function(){C(n)},1500))}function C(e){var i=w(e);i&&(t.remove(i),M())}function M(){C("heatmapmeasuretext")}function w(e){return document.getElementById(e)}function L(e,t,i,l){var a=new Date(e);switch(t=Math.ceil(t*l),i){case"Years":a.setFullYear(a.getFullYear()+t);break;case"Months":a.setMonth(a.getMonth()+t);break;case"Days":a.setDate(a.getDate()+t);break;case"Hours":a.setHours(a.getHours()+t);break;case"Minutes":a.setMinutes(a.getMinutes()+t)}return a}function T(e,t,i){for(var l,a,n,o=e.length,s=0;s<o;s++)if(l=e[s],a=l.region,t>=a.x&&t<=a.x+a.width&&i>=a.y&&i<=a.y+a.height){n=l.text;break}return n}function R(e){e="transparent"===e?"white":e;var i=document.getElementById("heatmapmeasuretext");null===i&&(i=t.createElement("text",{id:"heatmapmeasuretext"}),document.body.appendChild(i)),i.style.color=e;var l=(e=window.getComputedStyle(i).color).replace(/[()RGBrgba ]/g,"").split(",");return M(),O(new ee(parseInt(l[0],10),parseInt(l[1],10),parseInt(l[2],10)))}function O(e){return"#"+z(e.R)+z(e.G)+z(e.B)}function z(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function P(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new ee(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new ee(255,255,255)}function D(e,t,i,l){return e?t.replace("{value}",l(i)):l(i)}var A;!function(e){e.heatMapTitleFont={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.titleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},e.axisTitleFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},e.legendLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},e.rectLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},e.tooltipFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"}}(A||(A={}));var F=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),I=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("16px")],i.prototype,"size",void 0),I([t.Property("")],i.prototype,"color",void 0),I([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),I([t.Property("Normal")],i.prototype,"fontWeight",void 0),I([t.Property("Normal")],i.prototype,"fontStyle",void 0),I([t.Property("Center")],i.prototype,"textAlignment",void 0),I([t.Property("Trim")],i.prototype,"textOverflow",void 0),i}(t.ChildProperty),E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property(10)],i.prototype,"left",void 0),I([t.Property(10)],i.prototype,"right",void 0),I([t.Property(10)],i.prototype,"top",void 0),I([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("")],i.prototype,"color",void 0),I([t.Property(1)],i.prototype,"width",void 0),I([t.Property("")],i.prototype,"radius",void 0),i}(t.ChildProperty),B=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("")],i.prototype,"color",void 0),I([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property(null)],i.prototype,"size",void 0),I([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),H=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("")],i.prototype,"text",void 0),I([t.Complex({},V)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),k=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("#eeeeee")],i.prototype,"minColor",void 0),I([t.Property("#eeeeee")],i.prototype,"maxColor",void 0),i}(t.ChildProperty),G=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property(null)],i.prototype,"value",void 0),I([t.Property(null)],i.prototype,"color",void 0),I([t.Property(null)],i.prototype,"label",void 0),I([t.Property(null)],i.prototype,"startValue",void 0),I([t.Property(null)],i.prototype,"endValue",void 0),I([t.Property(null)],i.prototype,"minColor",void 0),I([t.Property(null)],i.prototype,"maxColor",void 0),i}(t.ChildProperty),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("#b5b5b5")],i.prototype,"color",void 0),I([t.Property(1)],i.prototype,"width",void 0),I([t.Property("Rectangle")],i.prototype,"type",void 0),i}(t.ChildProperty),W=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("0%")],i.prototype,"minimum",void 0),I([t.Property("100%")],i.prototype,"maximum",void 0),i}(t.ChildProperty),j=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property(null)],i.prototype,"start",void 0),I([t.Property(null)],i.prototype,"end",void 0),I([t.Property("")],i.prototype,"text",void 0),I([t.Property(null)],i.prototype,"maximumTextWidth",void 0),i}(t.ChildProperty),Y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("Center")],i.prototype,"alignment",void 0),I([t.Property("Wrap")],i.prototype,"overflow",void 0),I([t.Complex(A.axisLabelFont,V)],i.prototype,"textStyle",void 0),I([t.Complex({color:"#b5b5b5",width:1,type:"Rectangle"},U)],i.prototype,"border",void 0),I([t.Collection([],j)],i.prototype,"categories",void 0),i}(t.ChildProperty),X=function(){function e(e,t,i,l,a,n,o){this.value=e,this.color=t,this.label=i,this.startValue=l,this.endValue=a,this.minColor=n,this.maxColor=o}return e}(),J=function(){function e(e,t,i){this.mappingName=e,this.bubbleData=t,this.valueType=i}return e}(),K=function(){function e(e,t,i,l,a,n,o,s){this.value=e,this.color=t,this.label=i,this.startValue=l,this.endValue=a,this.minColor=n,this.maxColor=o,this.isHidden=s}return e}(),q=function(){function e(e,t,i,l,a){this.index=1,this.row=1,this.start=e,this.end=t,this.index=i,this.label=l,this.row=a}return e}(),Z=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),$=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Q=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Collection([{}],G)],i.prototype,"palette",void 0),$([t.Property("Gradient")],i.prototype,"type",void 0),$([t.Property("")],i.prototype,"emptyPointColor",void 0),$([t.Property("Table")],i.prototype,"colorGradientMode",void 0),$([t.Complex({},k)],i.prototype,"fillColor",void 0),i}(t.ChildProperty),ee=function(){function e(e,t,i){this.R=e,this.G=t,this.B=i}return e}(),te=function(){function e(e){this.heatMap=e}return e.prototype.convertToRGB=function(e,t){var i,l,a=this.heatMap.isColorRange?t[0].startValue:t[0].value,n=0,o=0;if(this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type)for(o=0;o<t.length;o++)if(e<=(s=Number(t[o].endValue))&&e>=Number(t[o].startValue))n=s,i=this.heatMap.colorCollection[o].minColor,l=this.heatMap.colorCollection[o].maxColor;else{if(t[0].startValue!==this.heatMap.dataSourceMinValue&&e<t[0].startValue){n=t[0].startValue,a=this.heatMap.dataSourceMinValue,i=this.heatMap.paletteSettings.fillColor.minColor,l=this.heatMap.paletteSettings.fillColor.maxColor;break}if(e>s&&e<=(o===t.length-1?this.heatMap.dataSourceMaxValue:t[o+1].startValue)){n=o===t.length-1?this.heatMap.dataSourceMaxValue:t[o+1].startValue,a=s,i=this.heatMap.paletteSettings.fillColor.minColor,l=this.heatMap.paletteSettings.fillColor.maxColor;break}n=s,a=s}else for(o=1;o<t.length;o++){var s=Number(t[o].value);if(e<=s){n=s,i=this.getEqualColor(t,a),l=this.getEqualColor(t,n);break}n=s,a=s}var r=0;return r=(e-a)/(n-a),r=isNaN(r)||!isFinite(r)?0:r,this.getPercentageColor(r,i,l)},e.prototype.rgbToHex=function(e,t,i){return"#"+this.componentToHex(e)+this.componentToHex(t)+this.componentToHex(i)},e.prototype.componentToHex=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.prototype.getEqualColor=function(e,i){for(var l=0;l<e.length;l++)if(Number(e[l].value)===i){var a=e[l].color;return t.isNullOrUndefined(a)?a="#FFFFFF":-1!==a.indexOf("rgb")?a=this.convertToHex(a):-1===a.indexOf("#")&&(a="#FFFFFF"),a}return"#00000"},e.prototype.convertToHex=function(e){var t=e.substr(3),i=(t=t.split("(")[1].split(")")[0]).split(",");return t=this.rgbToHex(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10))},e.prototype.getPercentageColor=function(e,t,i){var l=i.split("#")[1],a=t.split("#")[1],n=this.getPercentage(e,parseInt(a.substr(0,2),16),parseInt(l.substr(0,2),16)),o=this.getPercentage(e,parseInt(a.substr(2,2),16),parseInt(l.substr(2,2),16)),s=this.getPercentage(e,parseInt(a.substr(4,2),16),parseInt(l.substr(4,2),16));return new ee(n,o,s)},e.prototype.getPercentage=function(e,t,i){var l=i-t;return Math.round(t+l*e)},e.prototype.getColorCollection=function(){var e=this.heatMap;e.colorCollection=[],e.legendColorCollection=[];for(var i,l=0;l<this.heatMap.paletteSettings.palette.length;l++){if(null===this.heatMap.paletteSettings.palette[l].startValue||null===this.heatMap.paletteSettings.palette[l].endValue){this.heatMap.isColorRange=!1;break}this.heatMap.isColorRange=!0}var a=e.bubbleSizeWithColor?e.minColorValue:e.dataSourceMinValue,n=e.bubbleSizeWithColor?e.maxColorValue:e.dataSourceMaxValue;e.emptyPointColor=e.paletteSettings.emptyPointColor?e.paletteSettings.emptyPointColor:e.themeStyle.emptyCellColor;var o=this.orderbyOffset(this.heatMap.isColorRange?e.paletteSettings.palette:e.paletteSettings.palette&&e.paletteSettings.palette.length>1?e.paletteSettings.palette:e.themeStyle.palette);if(o.isCompact)e.colorCollection=o.offsets,e.legendColorCollection=t.extend([],o.offsets,null,!0);else if(i="Gradient"===e.paletteSettings.type?(n-a)/(o.offsets.length-1):(n-a)/o.offsets.length,o.offsets.length>=2)for(var s=0;s<o.offsets.length;s++)e.colorCollection.push(new X(Math.round(100*(a+s*i))/100,o.offsets[s].color,o.offsets[s].label,o.offsets[s].startValue,o.offsets[s].endValue,o.offsets[s].minColor,o.offsets[s].maxColor)),e.legendColorCollection.push(new K(Math.round(100*(a+s*i))/100,o.offsets[s].color,o.offsets[s].label,o.offsets[s].startValue,o.offsets[s].endValue,o.offsets[s].minColor,o.offsets[s].maxColor,!1));this.heatMap.isColorRange||this.updateLegendColorCollection(a,n,o)},e.prototype.updateLegendColorCollection=function(e,t,i){"Fixed"===this.heatMap.paletteSettings.type&&(i.isCompact||i.isLabel)||(Math.round(100*e)/100<this.heatMap.legendColorCollection[0].value&&this.heatMap.legendColorCollection.unshift(new K(Math.round(100*e)/100,this.heatMap.legendColorCollection[0].color,this.heatMap.legendColorCollection[0].label,this.heatMap.legendColorCollection[0].startValue,this.heatMap.legendColorCollection[0].endValue,this.heatMap.legendColorCollection[0].minColor,this.heatMap.legendColorCollection[0].maxColor,!0)),Math.round(100*t)/100>this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].value&&this.heatMap.legendColorCollection.push(new K(Math.round(100*t)/100,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].color,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].label,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].startValue,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].endValue,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].minColor,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].maxColor,!0)))},e.prototype.orderbyOffset=function(e){var i=new Ce,l=this.heatMap.isColorRange?"to":"value";return i.isCompact=!0,i.isLabel=!0,i.offsets=e.sort(function(e,a){return t.isNullOrUndefined(e.label)&&t.isNullOrUndefined(a.label)&&(i.isLabel=!1),t.isNullOrUndefined(e[l])||t.isNullOrUndefined(a[l])?(i.isCompact=!1,e):e[l]-a[l]}),i.isCompact||(i.offsets=this.heatMap.paletteSettings.palette&&this.heatMap.paletteSettings.palette.length>1?this.heatMap.paletteSettings.palette:this.heatMap.themeStyle.palette),i},e.prototype.getColorByValue=function(e){var t,i="",l=0;if(""!==e.toString())if("Bubble"!==this.heatMap.cellSettings.tileType||"Size"!==this.heatMap.cellSettings.bubbleType&&"Sector"!==this.heatMap.cellSettings.bubbleType)if("Fixed"===this.heatMap.paletteSettings.type)for(var a=0;a<this.heatMap.colorCollection.length;a++){l=this.heatMap.isColorRange?this.heatMap.paletteSettings.palette[a].startValue:this.heatMap.colorCollection[a+1]?this.heatMap.colorCollection[a+1].value:this.heatMap.colorCollection[a].value;var n=this.heatMap.dataSourceMinValue===this.heatMap.dataSourceMaxValue;if(this.heatMap.isColorRange){o=void 0;e<=this.heatMap.colorCollection[a].endValue&&e>=this.heatMap.colorCollection[a].startValue?(this.heatMap.legendVisibilityByCellType&&(o=this.heatMap.legendModule.legendRange),i=this.heatMap.legendVisibilityByCellType&&o[a]&&!o[a].visible?this.heatMap.themeStyle.toggledColor:this.heatMap.colorCollection[a].minColor):""===i&&(i=this.heatMap.paletteSettings.fillColor.minColor)}else if(e<=l&&n&&0===a||e<l||e>=l&&a===this.heatMap.colorCollection.length-1){var o=void 0;this.heatMap.legendVisibilityByCellType&&(o=this.heatMap.legendModule.legendRange),i=this.heatMap.legendVisibilityByCellType&&o[a]&&!o[a].visible?this.heatMap.themeStyle.toggledColor:this.heatMap.colorCollection[a].color;break}}else"Table"!==this.heatMap.paletteSettings.colorGradientMode&&this.getColorCollection(),e<this.heatMap.colorCollection[0].value&&!this.heatMap.isColorRange?i=this.heatMap.colorCollection[0].color:e>this.heatMap.colorCollection[this.heatMap.colorCollection.length-1].value&&!this.heatMap.isColorRange?i=this.heatMap.colorCollection[this.heatMap.colorCollection.length-1].color:(t=this.convertToRGB(e,this.heatMap.colorCollection),i=this.rgbToHex(t.R,t.G,t.B));else i=this.heatMap.isColorRange?this.heatMap.colorCollection[0].minColor:this.heatMap.colorCollection[0].color;else i=this.heatMap.emptyPointColor;return i},e.prototype.destroy=function(){this.heatMap=null},e}(),ie=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),le=function(){function e(e,t){this["font-size"]=e.size,this["font-style"]=e.fontStyle.toLowerCase(),this["font-family"]=e.fontFamily,this["font-weight"]=e.fontWeight.toLowerCase(),this.fill=t||""}return e}(),ae=function(){function e(e,t){this.width=e,this.height=t}return e}(),ne=function(){function e(e){this.id=e}return e}(),oe=function(e){function t(t,i,l,a,n,o,s){var r=e.call(this,t)||this;return r.opacity=n,r.fill=i,r.stroke=a||"",r["stroke-width"]=parseFloat(l.toString()),r["stroke-dasharray"]=o,r.d=s,r}return ie(t,e),t}(ne),se=function(){function e(e,t,i,l,a,n,o,s,r,h,d,p,g,c){this.x=e,this.y=t,this.width=i,this.height=l,this.value=a,this.id=n,this.xIndex=o,this.yIndex=s,this.xValue=r,this.yValue=h,this.visible=d,this.displayText=p,this.textId=g,this.allowCollection=c}return e}(),re=function(){function e(e,t,i,l,a,n,o,s,r,h,d,p){this.value=e,this.xLabel=t,this.yLabel=i,this.xValue=l,this.yValue=a,this.cellElement=n,this.xPosition=o,this.yPosition=s,this.width=r,this.height=h,this.x=d,this.y=p}return e}(),he=function(e){function t(t,i,l,a,n,o,s,r,h,d){var p=e.call(this,t,i,l.width,o,a,d)||this;return p.y=n.y,p.x=n.x,p.height=n.height>0?n.height:0,p.width=n.width>0?n.width:0,p.rx=s||0,p.ry=r||0,p.transform=h||"",p}return ie(t,e),t}(oe),de=function(e){function t(t,i,l,a,n,o,s,r){var h=e.call(this,t,i,l.width,n,a)||this;return h.cx=o||0,h.cy=s||0,h.r=r||0,h}return ie(t,e),t}(oe),pe=function(){function e(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l}return e}(),ge=function(e){function t(t,i,l,a){var n=e.call(this,l,a)||this;return n.transform="",n["dominant-baseline"]="auto",n.role="region",n.labelRotation=0,n.baseline="auto",n.id=t,n.x=i.x,n.y=i.y,n["text-anchor"]=i["text-anchor"],n.text=i.text,n["aria-label"]=i.text,n.transform=i.transform,n.labelRotation=i.labelRotation,n["dominant-baseline"]=i["dominant-baseline"],n.baseline=i.baseline,n.dy=i.dy,n}return ie(t,e),t}(le),ce=function(){function e(e,t,i,l,a,n,o,s){this.transform="",this["dominant-baseline"]="auto",this.labelRotation=0,this.baseline="auto",this.x=e||0,this.y=t||0,this["text-anchor"]=i||"start",this.text=l||"",this["aria-label"]=l,this.transform=n||"",this.labelRotation=a,this["dominant-baseline"]=o||"auto",this.baseline=o||"",this.dy=s||""}return e}(),ue=function(){function e(e,t,i,l){this.x1=e,this.y1=t,this.x2=i,this.y2=l}return e}(),me=function(e){function t(t,i,l,a,n,o){var s=e.call(this,t,null,a,l,n,o,null)||this;return s.x1=i.x1,s.y1=i.y1,s.x2=i.x2,s.y2=i.y2,s}return ie(t,e),t}(oe),ye=function(e){function t(t,i,l,a,n,o,s){var r=e.call(this,t,l,n,s,o,null)||this;return r.d=i.d,r.x=i.x,r.y=i.y,r}return ie(t,e),t}(oe),ve=function(){function e(e,t,i,l,a,n,o,s,r,h,d,p){this.d=e,this.innerR=t,this.cx=o,this.cy=s,this.x=i,this.y=l,this.x1=a,this.y1=n,this.start=r,this.end=h,this.radius=d,this.counterClockWise=p}return e}(),xe=function(){function e(e){this.heatMap=e}return e.prototype.drawRectangle=function(e,t,i){if(this.heatMap.enableCanvasRendering)this.drawCanvasRectangle(this.heatMap.canvasRenderer,e,i);else{delete e.d;var l=t.appendChild(this.heatMap.renderer.drawRectangle(e));if(-1===l.id.indexOf("Rect"))l.setAttribute("title","Rect Element"),l.setAttribute("role","img"),l.setAttribute("aria-hidden","false");else{var a=this.heatMap.cellSettings.enableCellHighlighting||this.heatMap.allowSelection?0:-1;l.setAttribute("tabindex",a.toString()),l.style.outline="none"}}},e.prototype.drawCircle=function(e,t){if(this.heatMap.enableCanvasRendering)this.drawCanvasCircle(this.heatMap.canvasRenderer,e);else{delete e.d;var i=t.appendChild(this.heatMap.renderer.drawCircle(e)),l=this.heatMap.cellSettings.enableCellHighlighting?0:-1;i.setAttribute("tabindex",l.toString()),i.style.outline="none"}},e.prototype.drawPath=function(e,t,i){this.heatMap.enableCanvasRendering?this.drawCanvasPath(this.heatMap.canvasRenderer,e,t):(delete e.x,delete e.y,i.appendChild(this.heatMap.renderer.drawPath(e)))},e.prototype.createText=function(e,t,i){this.heatMap.enableCanvasRendering?this.canvasDrawText(e,i):(delete e.labelRotation,delete e.baseline,delete e.text,t.appendChild(this.heatMap.renderer.createText(e,i)),e.text=i)},e.prototype.createWrapText=function(e,t,i){var l,a,n,o={};o={id:e.id,x:e.x,y:e.y,fill:e.fill,"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight.toLowerCase(),"text-anchor":e["text-anchor"],transform:e.transform,"dominant-baseline":e["dominant-baseline"],"aria-label":e.text[0]};var r=e.text[0];if(this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.createText(e,r):l=this.heatMap.renderer.createText(o,r),"string"!=typeof e.text&&e.text.length>1)for(var h=1,d=e.text.length;h<d;h++)n=s(e.text[h],t).height,this.heatMap.enableCanvasRendering?(e.id=e.id+h,e.y+=n,this.heatMap.canvasRenderer.createText(e,e.text[h])):(a=this.heatMap.renderer.createTSpan({x:e.x,id:e.id+h,y:e.y+h*n},e.text[h]),l.appendChild(a));this.heatMap.enableCanvasRendering||i.appendChild(l)},e.prototype.drawLine=function(e,t){this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawLine(e):(delete e.d,t.appendChild(this.heatMap.renderer.drawLine(e)))},e.prototype.canvasDrawText=function(e,i,l,a,n,o,s){var r=this.heatMap.canvasRenderer.ctx;l||(l=e.x),a||(a=e.y);var h=this.getOptionValue(e,"font-weight");t.isNullOrUndefined(h)||"regular"!==h.toLowerCase()||(h="normal");var d=this.getOptionValue(e,"font-family"),p=-1===e["font-size"].toString().indexOf("px")?e["font-size"]+"px":e["font-size"],g=this.getOptionValue(e,"text-anchor"),c=this.getOptionValue(e,"font-style").toLowerCase()+" "+h+" "+p+" "+d;if("middle"===g&&(g="center"),r.save(),r.fillStyle=e.fill,r.font=c,r.textAlign=g,e.baseline&&(r.textBaseline=e.baseline),r.translate(l,a),r.rotate(e.labelRotation*Math.PI/180),s)for(var u=0;u<n.length;u++)e.y=0!==u?e.y+o:e.y,r.fillText(n[u],e.x-l,e.y-a);else r.fillText(i,e.x-l,e.y-a);r.restore()},e.prototype.getOptionValue=function(e,t){return e[t]},e.prototype.setAttributes=function(e,i){e.ctx.lineWidth=i["stroke-width"];var l=i["stroke-dasharray"];if(!t.isNullOrUndefined(l)){var a=l.split(",");e.ctx.setLineDash([parseInt(a[0],10),parseInt(a[1],10)])}e.ctx.strokeStyle=i.stroke},e.prototype.drawCanvasRectangle=function(e,t,i){var l=e.ctx;e.ctx.save(),e.ctx.beginPath(),e.ctx.globalAlpha=t.opacity,this.setAttributes(e,t),this.drawCornerRadius(e,t),(t["stroke-width"]&&0!==t["stroke-width"]||i)&&e.ctx.stroke(),e.ctx.restore(),e.ctx=l},e.prototype.drawCornerRadius=function(e,t){var i=t.rx,l=t.x,a=t.y,n=t.width,o=t.height;"none"===t.fill&&(t.fill="transparent"),e.ctx.fillStyle=t.fill,n<2*i&&(i=n/2),o<2*i&&(i=o/2),e.ctx.beginPath(),e.ctx.moveTo(l+n-i,a),e.ctx.arcTo(l+n,a,l+n,a+o,i),e.ctx.arcTo(l+n,a+o,l,a+o,i),e.ctx.arcTo(l,a+o,l,a,i),e.ctx.arcTo(l,a,l+n,a,i),e.ctx.closePath(),e.ctx.fill()},e.prototype.drawCanvasCircle=function(e,t){e.ctx.save(),e.ctx.beginPath(),e.ctx.arc(t.cx,t.cy,t.r,0,2*Math.PI),e.ctx.fillStyle=t.fill,e.ctx.globalAlpha=t.opacity,e.ctx.fill(),this.setAttributes(e,t),t["stroke-width"]&&0!==t["stroke-width"]&&e.ctx.stroke(),e.ctx.restore()},e.prototype.drawCanvasPath=function(e,t,i){var l=t.d.split(" ");e.ctx.save(),e.ctx.beginPath(),e.ctx.globalAlpha=t.opacity,e.ctx.fillStyle=t.fill,this.setAttributes(e,t);for(var a=0;a<l.length;a+=3){var n=parseFloat(l[a+1]),o=parseFloat(l[a+2]);switch(l[a]){case"M":e.ctx.moveTo(n,o);break;case"L":e.ctx.lineTo(n,o);break;case"A":case"a":e.ctx.arc(i.x,i.y,i.radius,.0174533*i.start,.0174533*i.end,!1),a="a"===l[a]?a+13:a+5;break;case"Z":e.ctx.closePath()}}e.ctx.fill(),t["stroke-width"]&&0!==t["stroke-width"]&&e.ctx.stroke(),e.ctx.restore()},e}(),be=function(){function e(e,t,i,l,a){this.id=e,this.x1=t,this.x2=i,this.y1=l,this.y2=a}return e}(),fe=function(){function e(e,t){this.color=e,this.colorStop=t}return e}(),Se=function(){function e(e,t){this.region=new pe(0,0,0,0),this.text=e,this.region=t}return e}(),Ce=function(){function e(){}return e}(),Me=function(){function e(e,t,i,l,a,n){this.pathX1=e,this.pathY1=t,this.pathX2=i,this.pathY2=l,this.pathX3=a,this.pathY3=n}return e}(),we=function(){function e(e,t,i,l,a,n){this.x=e,this.y=t,this.width=i,this.height=l,this.label=a,this.id=n}return e}(),Le=function(){function e(e,t,i,l,a,n,o){this.x=e,this.y=t,this.width=i,this.height=l,this.value=a,this.visible=n,this.currentPage=o}return e}(),Te=function(){function e(e,t,i,l){this.visible=e,this.value=t,this.startValue=i,this.endValue=l}return e}(),Re=function(){function e(e,t){this.x=e,this.y=t}return e}(),Oe=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),ze=function(e,t,i,l){var a,n=arguments.length,o=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Pe=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.multipleRow=[],t.rect=new pe(void 0,void 0,0,0),t.nearSizes=[],t.farSizes=[],t.maxLabelSize=new ae(0,0),t.titleSize=new ae(0,0),t.multilevel=[],t.axisLabels=[],t.tooltipLabels=[],t.labelValue=[],t.axisLabelSize=0,t.axisLabelInterval=0,t.dateTimeAxisLabelInterval=[],t.maxLength=0,t.min=0,t.max=0,t.isIntersect=!1,t.jsonCellLabel=[],t.multiLevelSize=[],t.xAxisMultiLabelHeight=[],t.yAxisMultiLabelHeight=[],t.multiLevelPosition=[],t}return Oe(i,e),i.prototype.computeSize=function(e,t,i){var l=new ae(0,0);this.titleSize=e.getTitleSize(e,10),this.maxLabelSize=e.getMaxLabelSize(e,t),this.getMultilevelLabelsHeight(e,i,t);for(var a=0;a<this.multiLevelLabels.length;a++)l=e.multiLevelLabelSize(10,a),this.multiLevelSize.push(l)},i.prototype.multiPosition=function(e,t){var i="Horizontal"===e.orientation?10:20,l=new Re(0,0);if("Horizontal"===e.orientation){var a=e.maxLabelSize.height+i+(0===e.angle||180===e.angle||360===e.angle?0:i),n=this.xAxisMultiLabelHeight[t-1];l.x=e.isInversed?e.rect.x+e.rect.width:e.rect.x,l.y=0===t?e.rect.y+(e.opposedPosition?-a:a):e.multiLevelPosition[t-1].y+(e.opposedPosition?-n:n)}else{var a=e.maxLabelSize.width+i,n=0!==t&&this.multiLevelSize[t-1].width;l.x=0===t?e.rect.x-(e.opposedPosition?-a:a):e.multiLevelPosition[t-1].x-(e.opposedPosition?-(n+i):n+i),l.y=e.isInversed?e.rect.y:e.rect.y+e.rect.height}return l},i.prototype.multiLevelLabelSize=function(e,t){for(var i=new ae(0,0),l=this.multiLevelLabels,a=l[t].categories,n=0;n<a.length;n++){var o=s(a[n].text,l[t].textStyle);i.width=i.width>o.width?i.width:o.width,i.height=i.height>o.height?i.height:o.height}var r="Horizontal"===this.orientation?this.xAxisMultiLabelHeight[t]:this.yAxisMultiLabelHeight[t];return this.opposedPosition?this.farSizes.push(r):this.nearSizes.push(r),i},i.prototype.getMultilevelLabelsHeight=function(e,t,i){var l,a,n,o,r,h,d,p=[],g="Vertical"===e.orientation,c="Vertical"===e.orientation?20:10;this.multiLevelLabels.map(function(u,m){u.categories.map(function(y){o="number"==typeof y.start?y.start:Number(new Date(y.start)),r="number"==typeof y.end?y.end:Number(new Date(y.end)),""!==y.text&&null!==y.start&&null!==y.end&&(l=s(y.text,u.textStyle),n=g?l.width:l.height,h=i.heatMapAxis.calculateLeftPosition(e,o,y.start,t),d=i.heatMapAxis.calculateWidth(e,y.end,r,t),l=s(y.text,u.textStyle),a=null===y.maximumTextWidth?Math.abs(d-h):y.maximumTextWidth,l.width>a-c&&"Wrap"===u.overflow&&!g&&(n*=x(y.text,a-c,u.textStyle).length),p[m]=p[m]?p[m]<n?n+c:p[m]:n+c)})}),g?this.yAxisMultiLabelHeight=p:this.xAxisMultiLabelHeight=p},i.prototype.getTitleSize=function(e,t){var i=new ae(0,0);return this.title.text&&((i=s(this.title.text,this.title.textStyle)).height+=t),e.opposedPosition?this.farSizes.push(i.height):this.nearSizes.push(i.height),i},i.prototype.getMaxLabelSize=function(e,i){var l=new ae(0,0),a=this.axisLabels,n=e.border.width>0||e.multiLevelLabels.length>0?10:0,o=1,r="DateTime"===e.valueType&&"None"!==e.showLabelOn||"Wrap"===e.textStyle.textOverflow||"Trim"===e.textStyle.textOverflow?i.initialClipRect.width/e.axisLabelSize:i.initialClipRect.width/e.axisLabels.length;e.angle=e.labelRotation,e.isIntersect=!1;var h=v(a);if(("Horizontal"===e.orientation&&("Rotate45"===e.labelIntersectAction||e.labelRotation%180==0&&"Trim"===e.labelIntersectAction||e.enableTrim)||"MultipleRows"===e.labelIntersectAction)&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow){var d=i.initialClipRect.x+(e.isInversed?i.initialClipRect.width:0),p=void 0,g=void 0;this.clearMultipleRow();for(var c=0,m=a.length;c<m;c++){var y=s(L=a[c],e.textStyle),f="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[c]*r:r,S=d+(e.isInversed?-(r+y.width)/2:(r-y.width)/2),C=(S=S<i.initialClipRect.x?i.initialClipRect.x:S)+y.width;if(e.isInversed){if(t.isNullOrUndefined(g))g=S;else if(g<C&&"MultipleRows"!==e.labelIntersectAction){"Rotate45"!==e.labelIntersectAction||h||e.enableTrim?e.isIntersect=!0:e.angle=45;break}g=S}else{if(t.isNullOrUndefined(p))p=C;else if(S<p&&"MultipleRows"!==e.labelIntersectAction){"Rotate45"!==e.labelIntersectAction||h||e.enableTrim?e.isIntersect=!0:e.angle=45;break}p=C}d+=e.isInversed?-f:f,"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&0===e.labelRotation&&this.multipleRow.push(new q(S,C,o,L,1))}"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&e.isInversed&&(this.multipleRow=this.multipleRow.reverse())}for(var M=1,c=0;c<a.length;c++){var w=this.multipleRow,L=void 0;L=e.enableTrim||"Trim"===e.textStyle.textOverflow&&-1===a[c].indexOf("<br>")&&-1===a[c].indexOf("<br/>")?b("Trim"===e.textStyle.textOverflow&&"Horizontal"===e.orientation?r:e.maxLabelLength,a[c],e.textStyle):a[c];var T=[];if("Wrap"!==e.textStyle.textOverflow&&!h||e.enableTrim){if(h&&e.enableTrim){T=L.split(/<br\s*\/?>/,-1);var R=b(e.maxLabelLength,T[0],e.textStyle);L=-1===L.indexOf("<br>")&&-1===L.indexOf("<br/>")||-1!==R.indexOf("...")?R:R+"...",T=[]}T.push(L)}else{var O="Horizontal"===e.orientation?r:e.maxLabelLength;if(h){T=L.split(/<br\s*\/?>/,-1);for(var z=0;z<T.length;z++)T[z]=b(O,T[z],e.textStyle)}else T=x(L,O,e.textStyle);if(M=T.length>M&&!e.enableTrim?T.length:M,"Vertical"===e.orientation||"Horizontal"===e.orientation&&e.angle%180!=0)for(var P=0,D=0;D<T.length;D++){var A=s(T[D],e.textStyle);A.width>P&&(P=A.width,L=T[D])}if("Vertical"===e.orientation)for(var F=i.initialClipRect.height/(e.axisLabelSize/e.axisLabelInterval),D=0;D<T.length;D++)s(L,e.textStyle).height*T.length>F-10&&T.length>0&&90!==e.angle&&270!==e.angle&&(T.pop(),T.length>0&&(T[T.length-1]=T[T.length-1]+"...",T[T.length-1]=b(e.maxLabelLength,T[T.length-1],e.textStyle)))}var I=e.angle%180==0?s(L,e.textStyle):u(e.textStyle,T,e.angle);if(l.width=l.width>I.width?l.width:I.width,"MultipleRows"===e.labelIntersectAction&&"Horizontal"===e.orientation&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&c>0&&0===e.labelRotation){w[c].end>=i.initialClipRect.width&&c<a.length-1&&(w[c].row=w[c].row+1);for(var V=1;V<=e.multilevel.length;V++)if(w[c].start<w[c-1].end){if(e.multilevel[V]<w[c].start){o=V;break}if(V===e.multilevel.length-1){o=e.multilevel.length;break}}else if(I.width<r)for(var E=1;E<=e.multilevel.length;E++)if(e.multilevel[E]<w[c].start){o=E,w[E].row=o;break}l.height=l.height>I.height*o+.5*I.height/2*(o-1)?l.height:I.height*o+.5*I.height/2*o,this.multipleRow[c].index=o,e.multilevel[o]=w[c].end}else"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&0===c&&0===e.labelRotation&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&(e.multilevel[1]=w[c].end),l.height=l.height>I.height?l.height:I.height}return l.height=e.angle%180==0?l.height*M:l.height,i.cellSettings.border.width>=20&&"Horizontal"!==e.orientation&&(l.width=l.width+i.cellSettings.border.width/4),e.opposedPosition?this.farSizes.push("Horizontal"===e.orientation?l.height:l.width+n):this.nearSizes.push("Horizontal"===e.orientation?l.height:l.width+n),l},i.prototype.calculateNumericAxisLabels=function(e){var i,l,a=0,n=0,o=this.interval?this.interval:1;e.adaptorModule&&e.isCellData&&(i="Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax.min:e.adaptorModule.adaptiveYMinMax.min,l="Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax.max:e.adaptorModule.adaptiveYMinMax.max),a=t.isNullOrUndefined(this.minimum)?i||0:this.minimum,n=t.isNullOrUndefined(this.maximum)?l||this.maxLength*this.increment:this.maximum;var s;this.minimum&&this.maximum&&a>n&&(s=a,a=n,n=s),n=t.isNullOrUndefined(this.maximum)?l||n+a:n;var r=t.isNullOrUndefined(this.labelFormat)?"":this.labelFormat,h=null!==r.match("{value}");this.format=e.intl.getNumberFormat({format:h?"":r});for(d=a;d<=n;d+=o*this.increment){p=D(h,r,d,this.format);this.axisLabels.push(p)}this.min=0,this.axisLabelSize=Math.floor((n-a)/this.increment+1),this.max=this.axisLabelSize-1,this.axisLabelInterval=o;for(var d=a;d<=n;d+=this.increment){var p=D(h,r,d,this.format);this.tooltipLabels.push(p),this.labelValue.push(d)}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},i.prototype.calculateCategoryAxisLabels=function(){var e=this.labels?this.labels:[];e=e.length>0?e:this.jsonCellLabel;var i,l=t.isNullOrUndefined(this.minimum)||this.minimum instanceof Date?0:this.minimum,a=t.isNullOrUndefined(this.maximum)||this.maximum instanceof Date?this.maxLength:this.maximum,n=this.interval?this.interval:1,o=t.isNullOrUndefined(this.labelFormat)?"":this.labelFormat,s=null!==o.match("{value}");if(!t.isNullOrUndefined(this.minimum)&&!t.isNullOrUndefined(this.maximum)&&l>a&&(i=l,l=a,a=i),e&&e.length>0)for(h=l;h<=a;h+=n){r=t.isNullOrUndefined(e[h])?s?o.replace("{value}",h.toString()):h.toString():s?o.replace("{value}",e[h].toString()):e[h].toString();this.axisLabels.push(r)}else for(h=l;h<=a;h+=n){var r=s?o.replace("{value}",h.toString()):h.toString();this.axisLabels.push(r)}for(var h=l;h<=a;h++)this.tooltipLabels.push(t.isNullOrUndefined(e[h])?s?o.replace("{value}",h.toString()):h.toString():s?o.replace("{value}",e[h].toString()):e[h].toString()),this.labelValue.push(t.isNullOrUndefined(e[h])?h.toString():e[h].toString());this.min=l,this.max=a,this.axisLabelSize=a-l+1,this.axisLabelInterval=n,this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},i.prototype.calculateDateTimeAxisLabel=function(e){var t,i,a=this.interval?this.interval:1,n={skeleton:"full",type:"dateTime"},o=e.intl.getDateParser(n),s=e.intl.getDateFormat(n),r=null,h=null;e.adaptorModule&&e.isCellData&&(r="Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax.min:e.adaptorModule.adaptiveYMinMax.min,h="Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax.max:e.adaptorModule.adaptiveYMinMax.max);var d=this.minimum?this.minimum:r||null,p=this.maximum?this.maximum:h||null;if(null===d&&null===p){t=0,i=this.maxLength*this.increment;for(var g=t;g<=i;g+=a*this.increment)this.axisLabels.push(g.toString()),this.tooltipLabels.push(g.toString()),this.labelValue.push(g.toString());this.min=0,this.max=this.maxLength,this.axisLabelSize=(i-t)/this.increment+1,this.axisLabelInterval=a}else{null!==d&&null===p?i=L(t=Date.parse(o(s(new Date(l.DataUtil.parse.parseJson({val:d}).val)))),this.maxLength,this.intervalType,this.increment).getTime():null===d&&null!==p?t=L(i=Date.parse(o(s(new Date(l.DataUtil.parse.parseJson({val:p}).val)))),-this.maxLength,this.intervalType,this.increment).getTime():(t=Date.parse(o(s(new Date(l.DataUtil.parse.parseJson({val:d}).val)))),i=Date.parse(o(s(new Date(l.DataUtil.parse.parseJson({val:p}).val))))),this.format=e.intl.getDateFormat({format:this.labelFormat,skeleton:this.getSkeleton()});for(var c=t;c<=i;){u=this.format(new Date(c));this.axisLabels.push(u),"None"!==this.showLabelOn&&(a=this.calculateLabelInterval(c),this.dateTimeAxisLabelInterval.push(a)),c=L(c,a,this.intervalType,this.increment).getTime()}for(this.min=0,this.axisLabelInterval=a,this.axisLabelSize=this.getTotalLabelLength(t,i),this.max=this.axisLabelSize-1,c=t;c<=i;){var u=this.format(new Date(c));this.tooltipLabels.push(u),this.labelValue.push(new Date(c)),c=L(c,1,this.intervalType,this.increment).getTime()}}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},i.prototype.calculateLabelInterval=function(e){var t,i,l=new Date(e).getFullYear(),a=new Date(e).getMonth()+1,n=new Date(e).getDate();if("Years"===this.showLabelOn||"Months"===this.showLabelOn)"Years"===this.showLabelOn&&"Months"===this.intervalType?i=Math.ceil(12/this.increment):(t="Years"===this.showLabelOn?l%4==0?366:365:new Date(l,a,0).getDate(),t+=1-n,i="Days"===this.intervalType?Math.ceil(t/this.increment):"Hours"===this.intervalType?Math.ceil(24*t/this.increment):"Minutes"===this.intervalType?Math.ceil(24*t*60/this.increment):1);else if("Days"===this.showLabelOn)i="Hours"===this.intervalType?Math.ceil(24/this.increment):"Minutes"===this.intervalType?Math.ceil(1440/this.increment):1;else if("Hours"===this.showLabelOn){var o=new Date(e).getMinutes();i="Minutes"===this.intervalType?Math.ceil((60-o)/this.increment):1}else i=1;return i},i.prototype.getSkeleton=function(){return"Years"===this.intervalType?"yMMM":"Months"===this.intervalType?"MMMd":"Days"===this.intervalType?"yMd":"Hours"===this.intervalType?"EHm":(this.intervalType,"Hms")},i.prototype.getTotalLabelLength=function(e,t){var i,l,a=0,n=new Date(e),o=new Date(t);switch(this.intervalType){case"Years":var s=(o.getFullYear()-n.getFullYear())/this.increment+1;a=Math.floor(s);break;case"Months":var r=12*(o.getFullYear()-n.getFullYear());r-=n.getMonth(),a=(r+=o.getMonth())<=0?1:Math.floor(r/this.increment+1);break;case"Days":i=Math.abs(n.getTime()-o.getTime()),l=Math.floor(i/864e5),a=Math.floor(l/this.increment+1);break;case"Hours":i=Math.abs(n.getTime()-o.getTime());var h=Math.floor(i/36e5);a=Math.floor(h/this.increment)+1;break;case"Minutes":i=Math.abs(n.getTime()-o.getTime());var d=Math.floor(i/6e4);a=Math.floor(d/this.increment)+1}return a},i.prototype.clearAxisLabel=function(){this.axisLabels=[],this.tooltipLabels=[],this.dateTimeAxisLabelInterval=[],this.labelValue=[]},i.prototype.clearMultipleRow=function(){this.multipleRow=[],this.multilevel=[]},i.prototype.destroy=function(){this.axisLabels=null,this.multipleRow=null,this.rect=null,this.nearSizes=null,this.farSizes=null,this.maxLabelSize=null,this.titleSize=null,this.labelValue=null,this.format=null,this.multilevel=[],this.tooltipLabels=[],this.dateTimeAxisLabelInterval=[],this.jsonCellLabel=[],this.multiLevelSize=[],this.xAxisMultiLabelHeight=[],this.yAxisMultiLabelHeight=[],this.multiLevelPosition=[]},ze([t.Complex({text:"",textStyle:A.axisTitleFont},H)],i.prototype,"title",void 0),ze([t.Property(!1)],i.prototype,"opposedPosition",void 0),ze([t.Property(null)],i.prototype,"labels",void 0),ze([t.Complex(A.axisLabelFont,V)],i.prototype,"textStyle",void 0),ze([t.Property(0)],i.prototype,"labelRotation",void 0),ze([t.Property(!1)],i.prototype,"isInversed",void 0),ze([t.Property("Category")],i.prototype,"valueType",void 0),ze([t.Property(1)],i.prototype,"increment",void 0),ze([t.Property("None")],i.prototype,"showLabelOn",void 0),ze([t.Property(null)],i.prototype,"minimum",void 0),ze([t.Property(null)],i.prototype,"maximum",void 0),ze([t.Property(null)],i.prototype,"interval",void 0),ze([t.Property("")],i.prototype,"labelFormat",void 0),ze([t.Property("Days")],i.prototype,"intervalType",void 0),ze([t.Property("Trim")],