/** * Highcharts JS v11.2.0 (2023-10-30) * * (c) 2014-2021 Highsoft AS * Authors: Jon Arild Nygard / Oystein Moseng * * License: www.highcharts.com/license */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/treemap",["highcharts"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function i(t,e,i,s){t.hasOwnProperty(e)||(t[e]=s.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Extensions/Breadcrumbs/BreadcrumbsDefaults.js",[],function(){return{lang:{mainBreadcrumb:"Main"},options:{buttonTheme:{fill:"none",height:18,padding:2,"stroke-width":0,zIndex:7,states:{select:{fill:"none"}},style:{color:"#334eff"}},buttonSpacing:5,floating:!1,format:void 0,relativeTo:"plotBox",rtl:!1,position:{align:"left",verticalAlign:"top",x:0,y:void 0},separator:{text:"/",style:{color:"#666666",fontSize:"0.8em"}},showFullPath:!0,style:{},useHTML:!1,zIndex:7}}}),i(e,"Extensions/Breadcrumbs/Breadcrumbs.js",[e["Extensions/Breadcrumbs/BreadcrumbsDefaults.js"],e["Core/Chart/Chart.js"],e["Core/Templating.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{format:o}=i,{addEvent:r,defined:l,extend:n,fireEvent:a,isString:h,merge:d,objectEach:p,pick:u}=s,c=[];function g(){if(this.breadcrumbs){let t=this.resetZoomButton&&this.resetZoomButton.getBBox(),e=this.breadcrumbs.options;t&&"right"===e.position.align&&"plotBox"===e.relativeTo&&this.breadcrumbs.alignBreadcrumbsGroup(-t.width-e.buttonSpacing)}}function m(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function v(){let t=this.breadcrumbs;if(t&&!t.options.floating&&t.level){let e=t.options,i=e.buttonTheme,s=(i.height||0)+2*(i.padding||0)+e.buttonSpacing,o=e.position.verticalAlign;"bottom"===o?(this.marginBottom=(this.marginBottom||0)+s,t.yOffset=s):"middle"!==o?(this.plotTop+=s,t.yOffset=-s):t.yOffset=void 0}}function b(){this.breadcrumbs&&this.breadcrumbs.redraw()}function f(t){!0===t.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}class y{static compose(i,o){s.pushUnique(c,i)&&(r(e,"destroy",m),r(e,"afterShowResetZoom",g),r(e,"getMargins",v),r(e,"redraw",b),r(e,"selection",f)),s.pushUnique(c,o)&&n(o.lang,t.lang)}constructor(t,e){this.elementList={},this.isDirty=!0,this.level=0,this.list=[];let i=d(t.options.drilldown&&t.options.drilldown.drillUpButton,y.defaultOptions,t.options.navigation&&t.options.navigation.breadcrumbs,e);this.chart=t,this.options=i||{}}updateProperties(t){this.setList(t),this.setLevel(),this.isDirty=!0}setList(t){this.list=t}setLevel(){this.level=this.list.length&&this.list.length-1}getLevel(){return this.level}getButtonText(t){let e=this.chart,i=this.options,s=e.options.lang,r=u(i.format,i.showFullPath?"{level.name}":"← {level.name}"),n=s&&u(s.drillUpText,s.mainBreadcrumb),a=i.formatter&&i.formatter(t)||o(r,{level:t.levelOptions},e)||"";return(h(a)&&!a.length||"← "===a)&&l(n)&&(a=i.showFullPath?n:"← "+n),a}redraw(){this.isDirty&&this.render(),this.group&&this.group.align(),this.isDirty=!1}render(){let t=this.chart,e=this.options;!this.group&&e&&(this.group=t.renderer.g("breadcrumbs-group").addClass("highcharts-no-tooltip highcharts-breadcrumbs").attr({zIndex:e.zIndex}).add()),e.showFullPath?this.renderFullPathButtons():this.renderSingleButton(),this.alignBreadcrumbsGroup()}renderFullPathButtons(){this.destroySingleButton(),this.resetElementListState(),this.updateListElements(),this.destroyListElements()}renderSingleButton(){let t=this.chart,e=this.list,i=this.options,s=i.buttonSpacing;this.destroyListElements();let o=this.group?this.group.getBBox().width:s,r=e[e.length-2];!t.drillUpButton&&this.level>0?t.drillUpButton=this.renderButton(r,o,s):t.drillUpButton&&(this.level>0?this.updateSingleButton():this.destroySingleButton())}alignBreadcrumbsGroup(t){if(this.group){let e=this.options,i=e.buttonTheme,s=e.position,o="chart"===e.relativeTo||"spacingBox"===e.relativeTo?void 0:"scrollablePlotBox",r=this.group.getBBox(),l=2*(i.padding||0)+e.buttonSpacing;s.width=r.width+l,s.height=r.height+l;let n=d(s);t&&(n.x+=t),this.options.rtl&&(n.x+=s.width),n.y=u(n.y,this.yOffset,0),this.group.align(n,!0,o)}}renderButton(t,e,i){let s=this,o=this.chart,r=s.options,l=d(r.buttonTheme),n=o.renderer.button(s.getButtonText(t),e,i,function(e){let i;let o=r.events&&r.events.click;o&&(i=o.call(s,e,t)),!1!==i&&(r.showFullPath?e.newLevel=t.level:e.newLevel=s.level-1,a(s,"up",e))},l).addClass("highcharts-breadcrumbs-button").add(s.group);return o.styledMode||n.attr(r.style),n}renderSeparator(t,e){let i=this.chart,s=this.options,o=s.separator,r=i.renderer.label(o.text,t,e,void 0,void 0,void 0,!1).addClass("highcharts-breadcrumbs-separator").add(this.group);return i.styledMode||r.css(o.style),r}update(t){d(!0,this.options,t),this.destroy(),this.isDirty=!0}updateSingleButton(){let t=this.chart,e=this.list[this.level-1];t.drillUpButton&&t.drillUpButton.attr({text:this.getButtonText(e)})}destroy(){this.destroySingleButton(),this.destroyListElements(!0),this.group&&this.group.destroy(),this.group=void 0}destroyListElements(t){let e=this.elementList;p(e,(i,s)=>{(t||!e[s].updated)&&((i=e[s]).button&&i.button.destroy(),i.separator&&i.separator.destroy(),delete i.button,delete i.separator,delete e[s])}),t&&(this.elementList={})}destroySingleButton(){this.chart.drillUpButton&&(this.chart.drillUpButton.destroy(),this.chart.drillUpButton=void 0)}resetElementListState(){p(this.elementList,t=>{t.updated=!1})}updateListElements(){let t=this.elementList,e=this.options.buttonSpacing,i=this.list,s=this.options.rtl,o=s?-1:1,r=function(t,e){return o*t.getBBox().width+o*e},l=function(t,e,i){t.translate(e-t.getBBox().width,i)},n=this.group?r(this.group,e):e,a,h;for(let d=0,p=i.length;d{t.graphic=n=n&&n.destroy(),"function"==typeof s&&s()};Object.keys(i).length?n.animate(i,void 0,()=>e()):e()}}}}),i(e,"Series/Treemap/TreemapPoint.js",[e["Series/DrawPointUtilities.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{pie:{prototype:{pointClass:s}},scatter:{prototype:{pointClass:o}}}=e.seriesTypes,{extend:r,isNumber:l,pick:n}=i;class a extends o{constructor(){super(...arguments),this.name=void 0,this.node=void 0,this.options=void 0,this.series=void 0,this.shapeType="rect",this.value=void 0}draw(e){t.draw(this,e)}getClassName(){let t=this.series,e=t.options,i=super.getClassName();return this.node.level<=t.nodeMap[t.rootNode].level?i+=" highcharts-above-level":this.node.isLeaf||n(e.interactByLeaf,!e.allowTraversingTree)?this.node.isLeaf||(i+=" highcharts-internal-node"):i+=" highcharts-internal-node-interactive",i}isValid(){return!!(this.id||l(this.value))}setState(t){super.setState.apply(this,arguments),this.graphic&&this.graphic.attr({zIndex:"hover"===t?1:0})}shouldDraw(){return l(this.plotY)&&null!==this.y}}return r(a.prototype,{setVisible:s.prototype.setVisible}),a}),i(e,"Series/Treemap/TreemapSeriesDefaults.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e){let{isString:i}=e,s={allowTraversingTree:!1,animationLimit:250,borderRadius:0,showInLegend:!1,marker:void 0,colorByPoint:!1,dataLabels:{defer:!1,enabled:!0,formatter:function(){let t=this&&this.point?this.point:{},e=i(t.name)?t.name:"";return e},inside:!0,verticalAlign:"middle"},tooltip:{headerFormat:"",pointFormat:"{point.name}: {point.value}
"},ignoreHiddenPoint:!0,layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,traverseUpButton:{position:{align:"right",x:-10,y:10}},borderColor:"#e6e6e6",borderWidth:1,colorKey:"colorValue",opacity:.15,states:{hover:{borderColor:"#999999",brightness:t.seriesTypes.heatmap?0:.1,halo:!1,opacity:.75,shadow:!1}},legendSymbol:"rectangle"};return s}),i(e,"Series/Treemap/TreemapUtilities.js",[e["Core/Utilities.js"]],function(t){var e;let{objectEach:i}=t;return(e||(e={})).recursive=function t(e,i,s){let o;!1!==(o=i.call(s||this,e))&&t(o,i,s)},e}),i(e,"Series/TreeUtilities.js",[e["Core/Color/Color.js"],e["Core/Utilities.js"]],function(t,e){let{extend:i,isArray:s,isNumber:o,isObject:r,merge:l,pick:n}=e;return{getColor:function(e,i){let s,o,r,l,a,h;let d=i.index,p=i.mapOptionsToLevel,u=i.parentColor,c=i.parentColorIndex,g=i.series,m=i.colors,v=i.siblings,b=g.points,f=g.chart.options.chart;return e&&(s=b[e.i],o=p[e.level]||{},s&&o.colorByPoint&&(l=s.index%(m?m.length:f.colorCount),r=m&&m[l]),g.chart.styledMode||(a=n(s&&s.options.color,o&&o.color,r,u&&(e=>{let i=o&&o.colorVariation;return i&&"brightness"===i.key&&d&&v?t.parse(e).brighten(i.to*(d/v)).get():e})(u),g.color)),h=n(s&&s.options.colorIndex,o&&o.colorIndex,l,c,i.colorIndex)),{color:a,colorIndex:h}},getLevelOptions:function(t){let e={},i,a,h,d,p,u;if(r(t))for(d=o(t.from)?t.from:1,u=t.levels,a={},i=r(t.defaults)?t.defaults:{},s(u)&&(a=u.reduce((t,e)=>{let s,a,h;return r(e)&&o(e.level)&&(a=n((h=l({},e)).levelIsConstant,i.levelIsConstant),delete h.levelIsConstant,delete h.level,r(t[s=e.level+(a?0:d-1)])?l(!0,t[s],h):t[s]=h),t},{})),p=o(t.to)?t.to:1,h=0;h<=p;h++)e[h]=l({},i,r(a[h])?a[h]:{});return e},setTreeValues:function t(e,s){let o=s.before,r=s.idRoot,l=s.mapIdToNode,a=l[r],h=!1!==s.levelIsConstant,d=s.points,p=d[e.i],u=p&&p.options||{},c=[],g=0;e.levelDynamic=e.level-(h?0:a.level),e.name=n(p&&p.name,""),e.visible=r===e.id||!0===s.visible,"function"==typeof o&&(e=o(e,s)),e.children.forEach((o,r)=>{let l=i({},s);i(l,{index:r,siblings:e.children.length,visible:e.visible}),o=t(o,l),c.push(o),o.visible&&(g+=o.val)});let m=n(u.value,g);return e.visible=m>=0&&(g>0||e.visible),e.children=c,e.childrenTotal=g,e.isLeaf=e.visible&&!g,e.val=m,e},updateRootId:function(t){let e,i;return r(t)&&(i=r(t.options)?t.options:{},e=n(t.rootNode,i.rootId,""),r(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e}}}),i(e,"Series/Treemap/TreemapSeries.js",[e["Extensions/Breadcrumbs/Breadcrumbs.js"],e["Core/Color/Color.js"],e["Series/ColorMapComposition.js"],e["Core/Globals.js"],e["Core/Series/SeriesRegistry.js"],e["Series/Treemap/TreemapAlgorithmGroup.js"],e["Series/Treemap/TreemapNode.js"],e["Series/Treemap/TreemapPoint.js"],e["Series/Treemap/TreemapSeriesDefaults.js"],e["Series/Treemap/TreemapUtilities.js"],e["Series/TreeUtilities.js"],e["Core/Utilities.js"]],function(t,e,i,s,o,r,l,n,a,h,d,p){let{parse:u}=e,{noop:c}=s,{column:g,scatter:m}=o.seriesTypes,{getColor:v,getLevelOptions:b,updateRootId:f}=d,{addEvent:y,correctFloat:x,defined:T,error:w,extend:B,fireEvent:C,isArray:S,isNumber:L,isObject:P,isString:A,merge:O,pick:R,pushUnique:U,stableSort:j}=p,D=[],M=!1;function I(){let t;let e=this.xAxis,i=this.yAxis;e&&i&&(this.is("treemap")?(t={endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,minPadding:0,max:100,maxPadding:0,startOnTick:!1,title:void 0,tickPositions:[]},B(i.options,t),B(e.options,t),M=!0):M&&(i.setOptions(i.userOptions),e.setOptions(e.userOptions),M=!1))}class N extends m{constructor(){super(...arguments),this.axisRatio=void 0,this.data=void 0,this.mapOptionsToLevel=void 0,this.nodeMap=void 0,this.nodeList=void 0,this.options=void 0,this.points=void 0,this.rootNode=void 0,this.tree=void 0,this.level=void 0}static compose(t){U(D,t)&&y(t,"afterBindAxes",I)}algorithmCalcPoints(t,e,i,s){let o=i.plot,r=i.elArr.length-1,l,n,a,h,d=i.lW,p=i.lH,u,c=0;for(let t of(e?(d=i.nW,p=i.nH):u=i.elArr[r],i.elArr))(e||ca.lP.lR&&this.algorithmCalcPoints(t,!1,a,s,o),d===n&&this.algorithmCalcPoints(t,!0,a,s,o),++d;return s}alignDataLabel(t,e,i){let s=i.style;s&&!T(s.textOverflow)&&e.text&&e.getBBox().width>e.text.textWidth&&e.css({textOverflow:"ellipsis",width:s.width+="px"}),g.prototype.alignDataLabel.apply(this,arguments),t.dataLabel&&t.dataLabel.attr({zIndex:(t.node.zIndex||0)+1})}calculateChildrenAreas(t,e){let i=this.options,s=this.mapOptionsToLevel,o=s[t.level+1],r=R(this[o&&o.layoutAlgorithm]&&o.layoutAlgorithm,i.layoutAlgorithm),l=i.alternateStartingDirection,n=t.children.filter(t=>!t.ignore),a=[];o&&o.layoutStartingDirection&&(e.direction="vertical"===o.layoutStartingDirection?0:1),a=this[r](e,n);let h=-1;for(let t of n){let i=a[++h];t.values=O(i,{val:t.childrenTotal,direction:l?1-e.direction:e.direction}),t.pointValues=O(i,{x:i.x/this.axisRatio,y:100-i.y-i.height,width:i.width/this.axisRatio}),t.children.length&&this.calculateChildrenAreas(t,t.values)}}createList(t){let e=this.chart,i=e.breadcrumbs,s=[];if(i){let i=0;s.push({level:i,levelOptions:e.series[0]});let o=t.target.nodeMap[t.newRootId],r=[];for(;o.parent||""===o.parent;)r.push(o),o=t.target.nodeMap[o.parent];for(let t of r.reverse())s.push({level:++i,levelOptions:t});s.length<=1&&(s.length=0)}return s}drawDataLabels(){let t,e;let i=this.mapOptionsToLevel,s=this.points.filter(function(t){return t.node.visible});for(let o of s)e=i[o.node.level],t={style:{}},o.node.isLeaf||(t.enabled=!1),e&&e.dataLabels&&(t=O(t,e.dataLabels),this.hasDataLabels=()=>!0),o.shapeArgs&&(t.style.width=o.shapeArgs.width,o.dataLabel&&o.dataLabel.css({width:o.shapeArgs.width+"px"})),o.dlOptions=O(t,o.options.dataLabels);super.drawDataLabels()}drawPoints(t=this.points){let e=this.chart,i=e.renderer,s=e.styledMode,o=this.options,r=s?{}:o.shadow,l=o.borderRadius,n=e.pointCount{let e=t.userOptions;T(e.allowDrillToNode)&&!T(e.allowTraversingTree)&&(e.allowTraversingTree=e.allowDrillToNode,delete e.allowDrillToNode),T(e.drillUpButton)&&!T(e.traverseUpButton)&&(e.traverseUpButton=e.drillUpButton,delete e.drillUpButton)});super.init(e,i),delete s.opacity,s.eventsToUnbind.push(r),s.options.allowTraversingTree&&(s.eventsToUnbind.push(y(s,"click",s.onClickDrillToNode)),s.eventsToUnbind.push(y(s,"setRootNode",function(t){let e=s.chart;e.breadcrumbs&&e.breadcrumbs.updateProperties(s.createList(t))})),s.eventsToUnbind.push(y(s,"update",function(t,e){let i=this.chart.breadcrumbs;i&&t.options.breadcrumbs&&i.update(t.options.breadcrumbs)})),s.eventsToUnbind.push(y(s,"destroy",function(t){let e=this.chart;e.breadcrumbs&&!t.keepEventsForUpdate&&(e.breadcrumbs.destroy(),e.breadcrumbs=void 0)}))),e.breadcrumbs||(e.breadcrumbs=new t(e,o)),s.eventsToUnbind.push(y(e.breadcrumbs,"up",function(t){let e=this.level-t.newLevel;for(let t=0;to?0:(t.pointAttribs(e)["stroke-width"]||0)%2/2;for(let t of e){let{pointValues:e,visible:o}=t.node;if(e&&o){let{height:o,width:l,x:n,y:a}=e,h=r(t),d=Math.round(i.toPixels(n,!0))-h,p=Math.round(i.toPixels(n+l,!0))-h,u=Math.round(s.toPixels(a,!0))-h,c=Math.round(s.toPixels(a+o,!0))-h,g={x:Math.min(d,p),y:Math.min(u,c),width:Math.abs(p-d),height:Math.abs(c-u)};t.plotX=g.x+g.width/2,t.plotY=g.y+g.height/2,t.shapeArgs=g}else delete t.plotX,delete t.plotY}}setRootNode(t,e,i){let s=B({newRootId:t,previousRootId:this.rootNode,redraw:R(e,!0),series:this},i);C(this,"setRootNode",s,function(t){let e=t.series;e.idPreviousRoot=t.previousRootId,e.rootNode=t.newRootId,e.isDirty=!0,t.redraw&&e.chart.redraw()})}setState(t){this.options.inactiveOtherPoints=!0,super.setState(t,!1),this.options.inactiveOtherPoints=!1}setTreeValues(t){let e=this.options,i=this.rootNode,s=this.nodeMap,o=s[i],r="boolean"!=typeof e.levelIsConstant||e.levelIsConstant,l=[],n=this.points[t.i],a=0;for(let e of t.children)e=this.setTreeValues(e),l.push(e),e.ignore||(a+=e.val);j(l,(t,e)=>(t.sortIndex||0)-(e.sortIndex||0));let h=R(n&&n.options.value,a);return n&&(n.value=h),B(t,{children:l,childrenTotal:a,ignore:!(R(n&&n.visible,!0)&&h>0),isLeaf:t.visible&&!a,levelDynamic:t.level-(r?0:o.level),name:R(n&&n.name,""),sortIndex:R(n&&n.sortIndex,-h),val:h}),t}sliceAndDice(t,e){return this.algorithmFill(!0,t,e)}squarified(t,e){return this.algorithmLowAspectRatio(!0,t,e)}strip(t,e){return this.algorithmLowAspectRatio(!1,t,e)}stripes(t,e){return this.algorithmFill(!1,t,e)}translate(){let t=this,e=t.options,i=f(t),s,o,r,l;super.translate();let n=t.tree=t.getTree();s=t.nodeMap[i],""===i||s&&s.children.length||(t.setRootNode("",!1),i=t.rootNode,s=t.nodeMap[i]),t.mapOptionsToLevel=b({from:s.level+1,levels:e.levels,to:n.height,defaults:{levelIsConstant:t.options.levelIsConstant,colorByPoint:e.colorByPoint}}),h.recursive(t.nodeMap[t.rootNode],e=>{let i=e.parent,s=!1;return e.visible=!0,(i||""===i)&&(s=t.nodeMap[i]),s}),h.recursive(t.nodeMap[t.rootNode].children,t=>{let e=!1;for(let i of t)i.visible=!0,i.children.length&&(e=(e||[]).concat(i.children));return e}),t.setTreeValues(n),t.axisRatio=t.xAxis.len/t.yAxis.len,t.nodeMap[""].pointValues=o={x:0,y:0,width:100,height:100},t.nodeMap[""].values=r=O(o,{width:o.width*t.axisRatio,direction:"vertical"===e.layoutStartingDirection?0:1,val:n.val}),t.calculateChildrenAreas(n,r),t.colorAxis||e.colorByPoint||t.setColorRecursive(t.tree),e.allowTraversingTree&&(l=s.pointValues,t.xAxis.setExtremes(l.x,l.x+l.width,!1),t.yAxis.setExtremes(l.y,l.y+l.height,!1),t.xAxis.setScale(),t.yAxis.setScale()),t.setPointValues()}}return N.defaultOptions=O(m.defaultOptions,a),B(N.prototype,{buildKDTree:c,colorAttribs:i.seriesMembers.colorAttribs,colorKey:"colorValue",directTouch:!0,getExtremesFromAll:!0,getSymbol:c,optionalAxis:"colorAxis",parallelArrays:["x","y","value","colorValue"],pointArrayMap:["value"],pointClass:n,NodeClass:l,trackerGroups:["group","dataLabelsGroup"],utils:h}),i.compose(N),o.registerSeriesType("treemap",N),N}),i(e,"masters/modules/treemap.src.js",[e["Core/Globals.js"],e["Series/Treemap/TreemapSeries.js"],e["Extensions/Breadcrumbs/Breadcrumbs.js"]],function(t,e,i){t.Breadcrumbs=i,i.compose(t.Chart,t.defaultOptions),e.compose(t.Series)})});//# sourceMappingURL=treemap.js.map