/** * Highcharts JS v11.2.0 (2023-10-30) * Treegraph chart series type * * (c) 2010-2022 Pawel Lysy Grzegorz Blachlinski * * 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/treegraph",["highcharts","highcharts/modules/treemap"],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,o){t.hasOwnProperty(e)||(t[e]=o.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Series/PathUtilities.js",[],function(){function t(t,e){for(var i=[],o=0;o=0;i--)if(e[i]&&e[i].point.visible)return e[i]}},e.prototype.getLeftMostChild=function(){for(var t=this.children,e=0;e=0;e--)if(t[e].point.visible)return t[e]},e.prototype.getParent=function(){return this.parentNode},e.prototype.getFirstChild=function(){for(var t=this.children,e=0;e1)for(var l=a.level-o.level-1;l>0;)a=e.createDummyNode(o,a,l,r),l--;++r}},e.prototype.resetValues=function(t){for(var e=0;e=0;o--){var r=t.children[o];r.preX+=e,r.mod+=e,i+=r.change,e+=r.shift+i}},e.prototype.apportion=function(t,e){var i=t.getLeftSibling();if(i){for(var o=t,r=t,n=i,s=o.getLeftMostSibling(),a=o.mod,l=r.mod,p=n.mod,h=s.mod;n&&n.nextRight()&&o&&o.nextLeft();){n=n.nextRight(),s=s.nextLeft(),o=o.nextLeft(),(r=r.nextRight()).ancestor=t;var d=n.preX+p-(o.preX+a)+1;d>0&&(this.moveSubtree(t.getAncestor(n,e),t,d),a+=d,l+=d),p+=n.mod,a+=o.mod,h+=s.mod,l+=r.mod}n&&n.nextRight()&&!r.nextRight()&&(r.thread=n.nextRight(),r.mod+=p-l),o&&o.nextLeft()&&!s.nextLeft()&&(s.thread=o.nextLeft(),s.mod+=a-h),e=t}return e},e.prototype.moveSubtree=function(t,e,i){var o=e.relativeXPosition-t.relativeXPosition;e.change-=i/o,e.shift+=i,e.preX+=i,e.mod+=i,t.change+=i/o},e.prototype.afterLayout=function(t){for(var e=0;e=s&&(s=u.xPosition,p=Math.max(b+(v.lineWidth||0),p)),u.yPosition<=a&&(a=u.yPosition,c=Math.max(m+(v.lineWidth||0),c)),u.yPosition>=l&&(l=u.yPosition,d=Math.max(m+(v.lineWidth||0),d))}});var u=l===a?1:(r-(c+d)/2)/(l-a),f=l===a?r/2:-u*a+c/2,v=s===n?1:(o-(p+p)/2)/(s-n),y=s===n?o/2:-v*n+h/2;return{ax:v,bx:y,ay:u,by:f}},e.prototype.getLinks=function(){var t=this,e=this,i=[];return this.data.forEach(function(o,r){var n=e.mapOptionsToLevel[o.node.level||0]||{};if(o.node.parent){var s=k(n,o.options);if(!o.linkToParent||o.linkToParent.destroyed){var a=new e.LinkClass().init(e,s,void 0,o);o.linkToParent=a}else o.collapsed=L(o.collapsed,(t.mapOptionsToLevel[o.node.level]||{}).collapsed),o.linkToParent.visible=o.linkToParent.toNode.visible;o.linkToParent.index=i.push(o.linkToParent)-1}else o.linkToParent&&(e.links.splice(o.linkToParent.index),o.linkToParent.destroy(),delete o.linkToParent)}),i},e.prototype.buildTree=function(e,i,o,r,n){var s=this.points[i];return o=s&&s.level||o,t.prototype.buildTree.call(this,e,i,o,r,n)},e.prototype.markerAttribs=function(){return{}},e.prototype.setCollapsedStatus=function(t,e){var i=this,o=t.point;o&&(o.collapsed=L(o.collapsed,(this.mapOptionsToLevel[t.level]||{}).collapsed),o.visible=e,e=!1!==e&&!o.collapsed),t.children.forEach(function(t){i.setCollapsedStatus(t,e)})},e.prototype.drawTracker=function(){y.prototype.drawTracker.apply(this,arguments),y.prototype.drawTracker.call(this,this.links)},e.prototype.translate=function(){var t,e=this,i=this.options,o=n.updateRootId(this);u.translate.call(this);var r=this.tree=this.getTree();t=this.nodeMap[o],""===o||t&&t.children.length||(this.setRootNode("",!1),o=this.rootNode,t=this.nodeMap[o]),this.mapOptionsToLevel=m({from:t.level+1,levels:i.levels,to:r.height,defaults:{levelIsConstant:this.options.levelIsConstant,colorByPoint:i.colorByPoint}}),this.setCollapsedStatus(r,!0),this.links=this.getLinks(),this.setTreeValues(r),this.layoutAlgorythm.calculatePositions(this),this.layoutModifier=this.getLayoutModifiers(),this.points.forEach(function(t){e.translateNode(t)}),this.points.forEach(function(t){t.linkToParent&&e.translateLink(t.linkToParent)}),i.colorByPoint||this.setColorRecursive(this.tree)},e.prototype.translateLink=function(t){var e=t.fromNode,i=t.toNode,o=this.options.link.lineWidth,r=Math.round(o)%2/2,n=L(this.options.link.curveFactor,.5),s=L(t.options.link&&t.options.link.type,this.options.link.type);if(e.shapeArgs&&i.shapeArgs){var a=e.shapeArgs.width||0,l=this.chart.inverted,p=Math.floor((e.shapeArgs.y||0)+(e.shapeArgs.height||0)/2)+r,h=Math.floor((i.shapeArgs.y||0)+(i.shapeArgs.height||0)/2)+r,d=Math.floor((e.shapeArgs.x||0)+a)+r,u=Math.floor(i.shapeArgs.x||0)+r;l&&(d-=a,u+=i.shapeArgs.width||0);var f=i.node.xPosition-e.node.xPosition;t.shapeType="path";var v=(Math.abs(u-d)+a)/f-a,y=v*n*(l?-1:1),g=Math.floor((u+d)/2)+r;t.plotX=g,t.plotY=h,t.shapeArgs={d:c[s]({x1:d,y1:p,x2:u,y2:h,width:v,offset:y,inverted:l,parentVisible:i.visible,radius:this.options.link.radius})},t.dlBox={x:(d+u)/2,y:(p+h)/2,height:o,width:0},t.tooltipPos=l?[(this.chart.plotSizeY||0)-t.dlBox.y,(this.chart.plotSizeX||0)-t.dlBox.x]:[t.dlBox.x,t.dlBox.y]}},e.prototype.drawNodeLabels=function(t){for(var e,i,o=this.mapOptionsToLevel,r=0;r