/* Highcharts JS v11.1.0 (2023-06-05) Treegraph chart series type (c) 2010-2022 Pawel Lysy Grzegorz Blachlinski License: www.highcharts.com/license */ 'use strict';(function(b){"object"===typeof module&&module.exports?(b["default"]=b,module.exports=b):"function"===typeof define&&define.amd?define("highcharts/modules/treegraph",["highcharts","highcharts/modules/treemap"],function(h){b(h);b.Highcharts=h;return b}):b("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(b){function h(b,f,a,c){b.hasOwnProperty(f)||(b[f]=c.apply(null,a),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:f, module:b[f]}})))}b=b?b._modules:{};h(b,"Series/PathUtilities.js",[],function(){function b(b,a){const c=[];for(let g=0;g"",style:{textOverflow:"none"}}}});h(b,"Series/Treegraph/TreegraphSeries.js",[b["Series/PathUtilities.js"],b["Core/Series/SeriesRegistry.js"],b["Core/Renderer/SVG/SVGRenderer.js"],b["Series/Treegraph/TreegraphNode.js"],b["Series/Treegraph/TreegraphPoint.js"],b["Series/TreeUtilities.js"],b["Core/Utilities.js"],b["Series/Treegraph/TreegraphLink.js"],b["Series/Treegraph/TreegraphLayout.js"],b["Series/Treegraph/TreegraphSeriesDefaults.js"]], function(b,f,a,c,e,d,g,k,l,h){const {getLinkPath:v}=b,{series:{prototype:q},seriesTypes:{treemap:t,column:A}}=f,{prototype:{symbols:E}}=a,{getLevelOptions:z}=d,{extend:F,merge:u,pick:w,relativeLength:B,splat:G}=g;class y extends t{constructor(){super(...arguments);this.tree=this.nodeMap=this.layoutModifier=this.points=this.options=this.data=void 0;this.nodeList=[];this.layoutAlgorythm=void 0;this.links=[];this.mapOptionsToLevel=void 0}init(){super.init.apply(this,arguments);this.layoutAlgorythm=new l}getLayoutModifiers(){var a= this.chart;const c=this,b=a.plotSizeX,d=a.plotSizeY;let e=Infinity,f=-Infinity,g=Infinity,k=-Infinity,l=0,h=0,D=0,r=0;this.points.forEach(a=>{if(!this.options.fillSpace||a.visible){var p=a.node;a=u(this.options.marker,(c.mapOptionsToLevel[a.node.level]||{}).marker,a.options.marker);var m=B(a.radius||0,Math.min(b,d)),n=a.symbol,C="circle"!==n&&a.height?B(a.height,d):2*m;m="circle"!==n&&a.width?B(a.width,b):2*m;p.nodeSizeX=m;p.nodeSizeY=C;p.xPosition<=e&&(e=p.xPosition,n=a.lineWidth||0,h=Math.max(m+ n,h));p.xPosition>=f&&(f=p.xPosition,n=a.lineWidth||0,l=Math.max(m+n,l));p.yPosition<=g&&(g=p.yPosition,n=a.lineWidth||0,r=Math.max(C+n,r));p.yPosition>=k&&(k=p.yPosition,n=a.lineWidth||0,D=Math.max(C+n,D))}});a=k===g?1:(d-(r+D)/2)/(k-g);const H=f===e?1:(b-(l+l)/2)/(f-e);return{ax:H,bx:f===e?b/2:-H*e+h/2,ay:a,by:k===g?d/2:-a*g+r/2}}getLinks(){const a=this,c=[];this.data.forEach((b,d)=>{d=a.mapOptionsToLevel[b.node.level||0]||{};b.node.parent?(d=u(d,b.options),!b.linkToParent||b.linkToParent.destroyed? (d=(new a.LinkClass).init(a,d,void 0,b),b.linkToParent=d):b.linkToParent.update({collapsed:d.collapsed},!1),b.linkToParent.index=c.push(b.linkToParent)-1):b.linkToParent&&(a.links.splice(b.linkToParent.index),b.linkToParent.destroy(),delete b.linkToParent)});return c}buildTree(a,c,b,d,e){const m=this.points[c];b=m&&m.level||b;return super.buildTree.call(this,a,c,b,d,e)}markerAttribs(){return{}}setCollapsedStatus(a,c){const b=a.point;b&&(b.collapsed=w(b.collapsed,(this.mapOptionsToLevel[a.level]|| {}).collapsed),b.visible=c,c=!1===c?!1:!b.collapsed);a.children.forEach(a=>{this.setCollapsedStatus(a,c)})}drawTracker(){A.prototype.drawTracker.apply(this,arguments);A.prototype.drawTracker.call(this,this.links)}translate(){const a=this.options;let c=d.updateRootId(this),b;q.translate.call(this);const e=this.tree=this.getTree();b=this.nodeMap[c];""===c||b&&b.children.length||(this.setRootNode("",!1),c=this.rootNode,b=this.nodeMap[c]);this.mapOptionsToLevel=z({from:b.level+1,levels:a.levels,to:e.height, defaults:{levelIsConstant:this.options.levelIsConstant,colorByPoint:a.colorByPoint}});this.setCollapsedStatus(e,!0);this.links=this.getLinks();this.setTreeValues(e);this.layoutAlgorythm.calculatePositions(this);this.layoutModifier=this.getLayoutModifiers();this.points.forEach(a=>{this.translateNode(a)});this.points.forEach(a=>{a.linkToParent&&this.translateLink(a.linkToParent)});a.colorByPoint||this.setColorRecursive(this.tree)}translateLink(a){var c=a.fromNode;const b=a.toNode,d=this.options.link.lineWidth, e=Math.round(d)%2/2;var f=w(this.options.link.curveFactor,.5);const m=w(a.options.link&&a.options.link.type,this.options.link.type);if(c.shapeArgs&&b.shapeArgs){var g=c.shapeArgs.width||0;const p=this.chart.inverted,k=Math.floor((c.shapeArgs.y||0)+(c.shapeArgs.height||0)/2)+e,l=Math.floor((b.shapeArgs.y||0)+(b.shapeArgs.height||0)/2)+e;let n=Math.floor((c.shapeArgs.x||0)+g)+e,h=Math.floor(b.shapeArgs.x||0)+e;p&&(n-=g,h+=b.shapeArgs.width||0);c=b.node.xPosition-c.node.xPosition;a.shapeType="path"; g=(Math.abs(h-n)+g)/c-g;f=g*f*(p?-1:1);a.plotX=Math.floor((h+n)/2)+e;a.plotY=l;a.shapeArgs={d:v[m]({x1:n,y1:k,x2:h,y2:l,width:g,offset:f,inverted:p,parentVisible:b.visible,radius:this.options.link.radius})};a.dlBox={x:(n+h)/2,y:(k+l)/2,height:d,width:0};a.tooltipPos=p?[(this.chart.plotSizeY||0)-a.dlBox.y,(this.chart.plotSizeX||0)-a.dlBox.x]:[a.dlBox.x,a.dlBox.y]}}drawNodeLabels(a){const c=this.mapOptionsToLevel;let b,d;for(const e of a)d=c[e.node.level],b={style:{}},d&&d.dataLabels&&(b=u(b,d.dataLabels), this._hasPointLabels=!0),e.shapeArgs&&!G(this.options.dataLabels)[0].style.width&&(b.style.width=e.shapeArgs.width,e.dataLabel&&e.dataLabel.css({width:e.shapeArgs.width+"px"})),e.dlOptions=u(b,e.options.dataLabels);q.drawDataLabels.call(this,a)}alignDataLabel(a,c){const b=a.visible;a.visible=!0;super.alignDataLabel.apply(this,arguments);c.animate({opacity:!1===b?0:1},void 0,function(){b||c.hide()});a.visible=b}drawDataLabels(){this.options.dataLabels&&(this.options.dataLabels=G(this.options.dataLabels), this.drawNodeLabels(this.points),q.drawDataLabels.call(this,this.links))}destroy(){if(this.links){for(const a of this.links)a.destroy();this.links.length=0}return q.destroy.apply(this,arguments)}pointAttribs(a,b){var c=this.mapOptionsToLevel[a.node.level||0]||{};const d=a.options,e=c.states&&c.states[b]||{};a.options.marker=u(this.options.marker,c.marker,a.options.marker);const f=w(e.link&&e.link.color,d.link&&d.link.color,c.link&&c.link.color,this.options.link&&this.options.link.color);c=w(e.link&& e.link.lineWidth,d.link&&d.link.lineWidth,c.link&&c.link.lineWidth,this.options.link&&this.options.link.lineWidth);b=q.pointAttribs.call(this,a,b);a.isLink&&(b.stroke=f,b["stroke-width"]=c,delete b.fill);a.visible||(b.opacity=0);return b}drawPoints(){t.prototype.drawPoints.apply(this,arguments);A.prototype.drawPoints.call(this,this.links)}translateNode(a){const c=this.chart;var b=a.node;const d=c.plotSizeY,e=c.plotSizeX,{ax:f,bx:g,ay:k,by:l}=this.layoutModifier;var h=f*b.xPosition+g,m=k*b.yPosition+ l,r=this.mapOptionsToLevel[b.level]||{};const t=u(this.options.marker,r.marker,a.options.marker).symbol,q=b.nodeSizeY,x=b.nodeSizeX,v=this.options.reversed;h=b.x=c.inverted?e-x/2-h:h-x/2;b=b.y=v?m-q/2:d-m-q/2;r=w(a.options.borderRadius,r.borderRadius,this.options.borderRadius);a.shapeType="path";if(!a.visible&&a.linkToParent){if(m=a.linkToParent.fromNode){const {x:b=0,y:c=0,width:d=0,height:e=0}=m.shapeArgs||{};a.shapeArgs||(a.shapeArgs={});F(a.shapeArgs,{d:E[t||"circle"](b,c,d,e,r?{r}:void 0),x:b, y:c});a.plotX=m.plotX;a.plotY=m.plotY}}else a.plotX=h,a.plotY=b,a.shapeArgs={d:E[t||"circle"](h,b,x,q,r?{r}:void 0),x:h,y:b,width:x,height:q,cursor:a.node.isLeaf?"default":"pointer"};a.tooltipPos=c.inverted?[d-b-q/2,e-h-x/2]:[h+x/2,b]}}y.defaultOptions=u(t.defaultOptions,h);F(y.prototype,{pointClass:e,NodeClass:c,LinkClass:k});f.registerSeriesType("treegraph",y);"";return y});h(b,"masters/modules/treegraph.src.js",[],function(){})}); //# sourceMappingURL=treegraph.js.map