/* Highcharts JS v9.1.1 (2021-06-03) Sankey diagram module (c) 2010-2021 Torstein Honsi License: www.highcharts.com/license */ 'use strict';(function(c){"object"===typeof module&&module.exports?(c["default"]=c,module.exports=c):"function"===typeof define&&define.amd?define("highcharts/modules/sankey",["highcharts"],function(q){c(q);c.Highcharts=q;return c}):c("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(c){function q(c,f,h,k){c.hasOwnProperty(f)||(c[f]=k.apply(null,h))}c=c?c._modules:{};q(c,"Mixins/Nodes.js",[c["Core/Globals.js"],c["Core/Series/Point.js"],c["Core/Series/Series.js"],c["Core/Utilities.js"]], function(c,f,h,k){var p=k.defined,g=k.extend,e=k.find,n=k.pick;return c.NodesMixin={createNode:function(d){function b(a,b){return e(a,function(a){return a.id===b})}var a=b(this.nodes,d),c=this.pointClass;if(!a){var f=this.options.nodes&&b(this.options.nodes,d);a=(new c).init(this,g({className:"highcharts-node",isNode:!0,id:d,y:1},f));a.linksTo=[];a.linksFrom=[];a.formatPrefix="node";a.name=a.name||a.options.id||"";a.mass=n(a.options.mass,a.options.marker&&a.options.marker.radius,this.options.marker&& this.options.marker.radius,4);a.getSum=function(){var b=0,d=0;a.linksTo.forEach(function(a){b+=a.weight});a.linksFrom.forEach(function(a){d+=a.weight});return Math.max(b,d)};a.offset=function(b,d){for(var c=0,e=0;ed){var e=l.fromNode;d=e.column}}b.column=d+1;e&&"hanging"===e.options.layout&&(b.hangsFrom=e,c=-1,L(e.linksFrom,function(a,d){(a=a.toNode===b)&&(c=d);return a}),b.column+=c)}a[b.column]||(a[b.column]=this.createNodeColumn()); a[b.column].push(b)},this);for(var b=0;bthis.chart.plotSizeY&&(a=this.chart.plotSizeY/b)}return a};e.prototype.hasData=function(){return!!this.processedXData.length};e.prototype.pointAttribs=function(a,b){if(!a)return{};var d=this,e=d.mapOptionsToLevel[(a.isNode?a.level:a.fromNode.level)||0]||{},l=a.options,f=e.states&&e.states[b||""]||{};b=["colorByPoint","borderColor","borderWidth","linkOpacity"].reduce(function(a, b){a[b]=t(f[b],l[b],e[b],d.options[b]);return a},{});var w=t(f.color,l.color,b.colorByPoint?a.color:e.color);return a.isNode?{fill:w,stroke:b.borderColor,"stroke-width":b.borderWidth}:{fill:c.parse(w).setOpacity(b.linkOpacity).get()}};e.prototype.render=function(){var a=this.points;this.points=this.points.concat(this.nodes||[]);b.prototype.render.call(this);this.points=a};e.prototype.translate=function(){var b=this,d=function(a){for(var d=a.slice(),l=b.options.minLinkWidth||0,w,x=0,g,I=e.plotSizeY- f.borderWidth-(a.length-1)*c.nodePadding;a.length;){x=I/a.sum();w=!1;for(g=a.length;g--;)a[g].getSum()*xh+k;e.inverted&&(r=e.plotSizeY-r,b=(e.plotSizeY||0)-b,c=e.plotSizeX-c,k=-k,f=-f,n=h>c);a.shapeType="path";a.linkBase=[r,r+f,b,b+f];if(n&&"number"===typeof b)a.shapeArgs={d:[["M",h+k,r],["C",h+k+g,r,c-g,b,c,b],["L",c+(m?k:0),b+f/2],["L",c,b+f],["C",c-g,b+f,h+k+g,r+f,h+k,r+f],["Z"]]};else if("number"===typeof b){g=c-20-f;m=c-20;n=c;var p=h+k,q=p+20,t=q+f,v=r,u=r+f,G=u+20,C=G+(e.plotHeight-r-f),y=C+20,E=y+f,H= b,D=H+f,z=D+20,A=y+.7*f,B=n-.7*f,J=p+.7*f;a.shapeArgs={d:[["M",p,v],["C",J,v,t,u-.7*f,t,G],["L",t,C],["C",t,A,J,E,p,E],["L",n,E],["C",B,E,g,A,g,C],["L",g,z],["C",g,D-.7*f,B,H,n,H],["L",n,D],["C",m,D,m,D,m,z],["L",m,C],["C",m,y,m,y,n,y],["L",p,y],["C",q,y,q,y,q,C],["L",q,G],["C",q,u,q,u,p,u],["Z"]]}}a.dlBox={x:h+(c-h+k)/2,y:r+(b-r)/2,height:f,width:0};a.tooltipPos=e.inverted?[e.plotSizeY-a.dlBox.y-f/2,e.plotSizeX-a.dlBox.x]:[a.dlBox.x,a.dlBox.y+f/2];a.y=a.plotY=1;a.color||(a.color=d.color)};e.prototype.translateNode= function(a,b){var c=this.translationFactor,d=this.chart,f=this.options,g=a.getSum(),l=Math.max(Math.round(g*c),this.options.minLinkWidth),h=Math.round(f.borderWidth)%2/2,k=b.offset(a,c);b=Math.floor(t(k.absoluteTop,b.top(c)+k.relativeTop))+h;h=Math.floor(this.colDistance*a.column+f.borderWidth/2)+h;h=d.inverted?d.plotSizeX-h:h;c=Math.round(this.nodeWidth);if(a.sum=g){a.shapeType="rect";a.nodeX=h;a.nodeY=b;g=h;k=b;var m=a.options.width||f.width||c,n=a.options.height||f.height||l;d.inverted&&(g=h-c, k=d.plotSizeY-b-l,m=a.options.height||f.height||c,n=a.options.width||f.width||l);a.dlOptions=e.getDLOptions({level:this.mapOptionsToLevel[a.level],optionsPoint:a.options});a.plotX=1;a.plotY=1;a.tooltipPos=d.inverted?[d.plotSizeY-k-n/2,d.plotSizeX-g-m/2]:[g+m/2,k+n/2];a.shapeArgs={x:g,y:k,width:m,height:n,display:a.hasShape()?"":"none"}}else a.dlOptions={enabled:!1}};e.defaultOptions=A(b.defaultOptions,{borderWidth:0,colorByPoint:!0,curveFactor:.33,dataLabels:{enabled:!0,backgroundColor:"none",crop:!1, nodeFormat:void 0,nodeFormatter:function(){return this.point.name},format:void 0,formatter:function(){},inside:!0},inactiveOtherPoints:!0,linkOpacity:.5,minLinkWidth:0,nodeWidth:20,nodePadding:10,showInLegend:!1,states:{hover:{linkOpacity:1},inactive:{linkOpacity:.1,opacity:.1,animation:{duration:50}}},tooltip:{followPointer:!0,headerFormat:'{series.name}
',pointFormat:"{point.fromNode.name} \u2192 {point.toNode.name}: {point.weight}
",nodeFormat:"{point.name}: {point.sum}
"}}); return e}(b);g(e.prototype,{animate:d.prototype.animate,createNode:h.createNode,destroy:h.destroy,forceDL:!0,invertible:!0,isCartesian:!1,orderNodes:!0,pointArrayMap:["from","to"],pointClass:k,searchPoint:f.noop,setData:h.setData});p.registerSeriesType("sankey",e);"";"";return e});q(c,"masters/modules/sankey.src.js",[],function(){})}); //# sourceMappingURL=sankey.js.map