text: /*
    Highcharts JS v7.0.2 (2019-01-17)
   Sankey diagram module
  
   (c) 2010-2019 Torstein Honsi
  
   License: www.highcharts.com/license
  */
  (function(g){"object"===typeof module&&module.exports?(g["default"]=g,module.exports=g):"function"===typeof define&&define.amd?define(function(){return g}):g("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(g){(function(f){f.NodesMixin={createNode:function(g){function q(c,e){return f.find(c,function(a){return a.id===e})}var b=q(this.nodes,g),k=this.pointClass,d;b||(d=this.options.nodes&&q(this.options.nodes,g),b=(new k).init(this,f.extend({className:"highcharts-node",isNode:!0,id:g,y:1},
  d)),b.linksTo=[],b.linksFrom=[],b.formatPrefix="node",b.name=b.name||b.options.id,b.getSum=function(){var c=0,e=0;b.linksTo.forEach(function(a){c+=a.weight});b.linksFrom.forEach(function(a){e+=a.weight});return Math.max(c,e)},b.offset=function(c,e){for(var a=0,d=0;d<b[e].length;d++){if(b[e][d]===c)return a;a+=b[e][d].weight}},b.hasShape=function(){var c=0;b.linksTo.forEach(function(d){d.outgoing&&c++});return!b.linksTo.length||c!==b.linksTo.length},this.nodes.push(b));return b}}})(g);(function(f){var g=
  f.defined,q=f.seriesType,b=f.pick,k=f.Point;q("sankey","column",{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(){return""},inside:!0},linkOpacity:.5,nodeWidth:20,nodePadding:10,showInLegend:!1,states:{hover:{linkOpacity:1}},tooltip:{followPointer:!0,headerFormat:'\x3cspan style\x3d"font-size: 10px"\x3e{series.name}\x3c/span\x3e\x3cbr/\x3e',pointFormat:"{point.fromNode.name} \u2192 {point.toNode.name}: \x3cb\x3e{point.weight}\x3c/b\x3e\x3cbr/\x3e",
  nodeFormat:"{point.name}: \x3cb\x3e{point.sum}\x3c/b\x3e\x3cbr/\x3e"}},{isCartesian:!1,forceDL:!0,createNode:f.NodesMixin.createNode,createNodeColumn:function(){var d=this.chart,c=[],e=this.options.nodePadding;c.sum=function(){var a=0;this.forEach(function(c){a+=c.getSum()});return a};c.offset=function(a,d){for(var b=0,l=0;l<c.length;l++){if(c[l]===a)return b+(a.options.offset||0);b+=c[l].getSum()*d+e}};c.top=function(a){for(var b=0,f=0;f<c.length;f++)0<f&&(b+=e),b+=c[f].getSum()*a;return(d.plotSizeY-
  b)/2};return c},createNodeColumns:function(){var d=[];this.nodes.forEach(function(c){var a=-1,b,e;if(!f.defined(c.options.column))if(0===c.linksTo.length)c.column=0;else{for(b=0;b<c.linksTo.length;b++)e=c.linksTo[0],e.fromNode.column>a&&(a=e.fromNode.column);c.column=a+1}d[c.column]||(d[c.column]=this.createNodeColumn());d[c.column].push(c)},this);for(var c=0;c<d.length;c++)void 0===d[c]&&(d[c]=this.createNodeColumn());return d},pointAttribs:function(d,c){var b=this.options.linkOpacity,a=d.color;
  c&&(b=this.options.states[c].linkOpacity||b,a=this.options.states[c].color||d.color);return{fill:d.isNode?a:f.color(a).setOpacity(b).get()}},generatePoints:function(){function d(a,c){a.level=c;a.linksFrom.forEach(function(a){d(a.toNode,c+1)})}var c={},e=this.chart;f.Series.prototype.generatePoints.call(this);this.nodes||(this.nodes=[]);this.colorCounter=0;this.nodes.forEach(function(a){a.linksFrom.length=0;a.linksTo.length=0});this.points.forEach(function(a){g(a.from)&&(c[a.from]||(c[a.from]=this.createNode(a.from)),
  c[a.from].linksFrom.push(a),a.fromNode=c[a.from],e.styledMode?a.colorIndex=b(a.options.colorIndex,c[a.from].colorIndex):a.color=a.options.color||c[a.from].color);g(a.to)&&(c[a.to]||(c[a.to]=this.createNode(a.to)),c[a.to].linksTo.push(a),a.toNode=c[a.to]);a.name=a.name||a.options.id},this);this.nodes.filter(function(a){return 0===a.linksTo.length}).forEach(function(a){d(a,0)});this.nodes.sort(function(a,c){return a.level-c.level})},setData:function(){this.nodes&&(this.nodes.forEach(function(d){d.destroy()}),
  this.nodes.length=0);f.Series.prototype.setData.apply(this,arguments)},translate:function(){this.processedXData||this.processData();this.generatePoints();this.nodeColumns=this.createNodeColumns();var d=this.chart,c=d.inverted,b=this.options,a=0,f=b.nodeWidth,g=this.nodeColumns,q=(d.plotSizeX-f)/(g.length-1),B=(c?-q:q)*b.curveFactor,p=Infinity;this.nodeColumns.forEach(function(a){p=Math.min(p,(d.plotSizeY-(a.length-1)*b.nodePadding)/a.sum())});this.nodeColumns.forEach(function(b){b.forEach(function(e){var l=
  e.getSum(),k=l*p,E=b.top(p)+b.offset(e,p),n=c?d.plotSizeX-a:a;e.sum=l;e.shapeType="rect";e.shapeArgs=c?{x:n-f,y:d.plotSizeY-E-k,width:f,height:k}:{x:n,y:E,width:f,height:k};e.shapeArgs.display=e.hasShape()?"":"none";e.plotY=1;e.linksFrom.forEach(function(a){var b=a.weight*p,m=e.offset(a,"linksFrom")*p,m=E+m,h=a.toNode,r=g[h.column].top(p)+h.offset(a,"linksTo")*p+g[h.column].offset(h,p),t=f,h=h.column*q,k=a.outgoing,u=h>n;c&&(m=d.plotSizeY-m,r=d.plotSizeY-r,h=d.plotSizeX-h,t=-t,b=-b,u=n>h);a.shapeType=
  "path";if(u)a.shapeArgs={d:["M",n+t,m,"C",n+t+B,m,h-B,r,h,r,"L",h+(k?t:0),r+b/2,"L",h,r+b,"C",h-B,r+b,n+t+B,m+b,n+t,m+b,"z"]};else{var k=h-20-b,u=h-20,l=h,x=n+t,w=x+20,C=w+b,H=m,y=m+b,F=y+20,z=F+(d.plotHeight-m-b),v=z+20,D=v+b,G=r,A=G+b,I=A+20,J=v+.7*b,K=l-.7*b,L=x+.7*b;a.shapeArgs={d:["M",x,H,"C",L,H,C,y-.7*b,C,F,"L",C,z,"C",C,J,L,D,x,D,"L",l,D,"C",K,D,k,J,k,z,"L",k,I,"C",k,A-.7*b,K,G,l,G,"L",l,A,"C",u,A,u,A,u,I,"L",u,z,"C",u,v,u,v,l,v,"L",x,v,"C",w,v,w,v,w,z,"L",w,F,"C",w,y,w,y,x,y,"z"]}}a.dlBox=
  {x:n+(h-n+t)/2,y:m+(r-m)/2,height:b,width:0};a.y=a.plotY=1;a.color||(a.color=e.color)})});a+=q},this)},render:function(){var b=this.points;this.points=this.points.concat(this.nodes);f.seriesTypes.column.prototype.render.call(this);this.points=b},animate:f.Series.prototype.animate,destroy:function(){this.data=[].concat(this.points,this.nodes);f.Series.prototype.destroy.call(this)}},{getClassName:function(){return(this.isNode?"highcharts-node ":"highcharts-link ")+k.prototype.getClassName.call(this)},
  isValid:function(){return this.isNode||"number"===typeof this.weight}})})(g)});
  //# sourceMappingURL=sankey.js.map
  