/*
 Highcharts JS v7.1.3 (2019-08-14)

 (c) 2014-2019 Highsoft AS
 Authors: Jon Arild Nygard / Oystein Moseng

 License: www.highcharts.com/license
*/
(function(f){"object"===typeof module&&module.exports?(f["default"]=f,module.exports=f):"function"===typeof define&&define.amd?define("highcharts/modules/treemap",["highcharts"],function(n){f(n);f.Highcharts=n;return f}):f("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(f){function n(d,c,f,p){d.hasOwnProperty(c)||(d[c]=p.apply(null,f))}f=f?f._modules:{};n(f,"mixins/tree-series.js",[f["parts/Globals.js"],f["parts/Utilities.js"]],function(d,c){var f=c.isArray,p=c.isNumber,h=c.isObject,
y=d.extend,n=d.merge,u=d.pick;return{getColor:function(g,k){var f=k.index,c=k.mapOptionsToLevel,p=k.parentColor,h=k.parentColorIndex,B=k.series,x=k.colors,y=k.siblings,q=B.points,n=B.chart.options.chart,m;if(g){q=q[g.i];g=c[g.level]||{};if(c=q&&g.colorByPoint){var w=q.index%(x?x.length:n.colorCount);var E=x&&x[w]}if(!B.chart.styledMode){x=q&&q.options.color;n=g&&g.color;if(m=p)m=(m=g&&g.colorVariation)&&"brightness"===m.key?d.color(p).brighten(f/y*m.to).get():p;m=u(x,n,E,m,B.color)}var z=u(q&&q.options.colorIndex,
g&&g.colorIndex,w,h,k.colorIndex)}return{color:m,colorIndex:z}},getLevelOptions:function(g){var k=null;if(h(g)){k={};var d=p(g.from)?g.from:1;var c=g.levels;var v={};var u=h(g.defaults)?g.defaults:{};f(c)&&(v=c.reduce(function(k,g){if(h(g)&&p(g.level)){var c=n({},g);var f="boolean"===typeof c.levelIsConstant?c.levelIsConstant:u.levelIsConstant;delete c.levelIsConstant;delete c.level;g=g.level+(f?0:d-1);h(k[g])?y(k[g],c):k[g]=c}return k},{}));c=p(g.to)?g.to:1;for(g=0;g<=c;g++)k[g]=n({},u,h(v[g])?v[g]:
{})}return k},setTreeValues:function C(k,c){var d=c.before,f=c.idRoot,p=c.mapIdToNode[f],h=c.points[k.i],n=h&&h.options||{},q=0,A=[];y(k,{levelDynamic:k.level-(("boolean"===typeof c.levelIsConstant?c.levelIsConstant:1)?0:p.level),name:u(h&&h.name,""),visible:f===k.id||("boolean"===typeof c.visible?c.visible:!1)});"function"===typeof d&&(k=d(k,c));k.children.forEach(function(d,f){var p=y({},c);y(p,{index:f,siblings:k.children.length,visible:k.visible});d=C(d,p);A.push(d);d.visible&&(q+=d.val)});k.visible=
0<q||k.visible;d=u(n.value,q);y(k,{children:A,childrenTotal:q,isLeaf:k.visible&&!q,val:d});return k},updateRootId:function(c){if(h(c)){var d=h(c.options)?c.options:{};d=u(c.rootNode,d.rootId,"");h(c.userOptions)&&(c.userOptions.rootId=d);c.rootNode=d}return d}}});n(f,"mixins/draw-point.js",[],function(){var d=function(c){var d=this,f=d.graphic,h=c.animatableAttribs,n=c.onComplete,z=c.css,u=c.renderer;if(d.shouldDraw())f||(d.graphic=f=u[c.shapeType](c.shapeArgs).add(c.group)),f.css(z).attr(c.attribs).animate(h,
c.isNew?!1:void 0,n);else if(f){var g=function(){d.graphic=f=f.destroy();"function"===typeof n&&n()};Object.keys(h).length?f.animate(h,void 0,function(){g()}):g()}};return function(c){(c.attribs=c.attribs||{})["class"]=this.getClassName();d.call(this,c)}});n(f,"modules/treemap.src.js",[f["parts/Globals.js"],f["mixins/tree-series.js"],f["mixins/draw-point.js"],f["parts/Utilities.js"]],function(d,c,f,p){var h=p.defined,n=p.isArray,z=p.isNumber,u=p.isObject,g=p.isString,k=p.objectEach;p=d.seriesType;
var A=d.seriesTypes,C=d.addEvent,v=d.merge,F=d.extend,B=d.error,x=d.noop,E=d.fireEvent,q=c.getColor,H=c.getLevelOptions,m=d.pick,w=d.Series,I=d.stableSort,G=d.Color,J=function(a,b,e){e=e||this;k(a,function(t,l){b.call(e,t,l,a)})},D=function(a,b,e){e=e||this;a=b.call(e,a);!1!==a&&D(a,b,e)},K=c.updateRootId;p("treemap","scatter",{allowTraversingTree:!1,animationLimit:250,showInLegend:!1,marker:!1,colorByPoint:!1,dataLabels:{defer:!1,enabled:!0,formatter:function(){var a=this&&this.point?this.point:
{};return g(a.name)?a.name:""},inside:!0,verticalAlign:"middle"},tooltip:{headerFormat:"",pointFormat:"<b>{point.name}</b>: {point.value}<br/>"},ignoreHiddenPoint:!0,layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,drillUpButton:{position:{align:"right",x:-10,y:10}},traverseUpButton:{position:{align:"right",x:-10,y:10}},borderColor:"#e6e6e6",borderWidth:1,opacity:.15,states:{hover:{borderColor:"#999999",brightness:A.heatmap?0:.1,halo:!1,
opacity:.75,shadow:!1}}},{pointArrayMap:["value"],directTouch:!0,optionalAxis:"colorAxis",getSymbol:x,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",trackerGroups:["group","dataLabelsGroup"],getListOfParents:function(a,b){a=n(a)?a:[];var e=n(b)?b:[];b=a.reduce(function(a,b,e){b=m(b.parent,"");void 0===a[b]&&(a[b]=[]);a[b].push(e);return a},{"":[]});J(b,function(a,b,c){""!==b&&-1===e.indexOf(b)&&(a.forEach(function(a){c[""].push(a)}),delete c[b])});return b},getTree:function(){var a=
this.data.map(function(a){return a.id});a=this.getListOfParents(this.data,a);this.nodeMap=[];return this.buildNode("",-1,0,a,null)},hasData:function(){return!!this.processedXData.length},init:function(a,b){var e=d.colorSeriesMixin;d.colorSeriesMixin&&(this.translateColors=e.translateColors,this.colorAttribs=e.colorAttribs,this.axisTypes=e.axisTypes);C(this,"setOptions",function(a){a=a.userOptions;h(a.allowDrillToNode)&&!h(a.allowTraversingTree)&&(a.allowTraversingTree=a.allowDrillToNode,delete a.allowDrillToNode);
h(a.drillUpButton)&&!h(a.traverseUpButton)&&(a.traverseUpButton=a.drillUpButton,delete a.drillUpButton)});w.prototype.init.call(this,a,b);this.options.allowTraversingTree&&C(this,"click",this.onClickDrillToNode)},buildNode:function(a,b,e,t,l){var c=this,d=[],f=c.points[b],g=0,r;(t[a]||[]).forEach(function(b){r=c.buildNode(c.points[b].id,b,e+1,t,a);g=Math.max(r.height+1,g);d.push(r)});b={id:a,i:b,children:d,height:g,level:e,parent:l,visible:!1};c.nodeMap[b.id]=b;f&&(f.node=b);return b},setTreeValues:function(a){var b=
this,e=b.options,c=b.nodeMap[b.rootNode];e="boolean"===typeof e.levelIsConstant?e.levelIsConstant:!0;var l=0,d=[],f=b.points[a.i];a.children.forEach(function(a){a=b.setTreeValues(a);d.push(a);a.ignore||(l+=a.val)});I(d,function(a,b){return a.sortIndex-b.sortIndex});var g=m(f&&f.options.value,l);f&&(f.value=g);F(a,{children:d,childrenTotal:l,ignore:!(m(f&&f.visible,!0)&&0<g),isLeaf:a.visible&&!l,levelDynamic:a.level-(e?0:c.level),name:m(f&&f.name,""),sortIndex:m(f&&f.sortIndex,-g),val:g});return a},
calculateChildrenAreas:function(a,b){var e=this,c=e.options,l=e.mapOptionsToLevel[a.level+1],d=m(e[l&&l.layoutAlgorithm]&&l.layoutAlgorithm,c.layoutAlgorithm),f=c.alternateStartingDirection,g=[];a=a.children.filter(function(a){return!a.ignore});l&&l.layoutStartingDirection&&(b.direction="vertical"===l.layoutStartingDirection?0:1);g=e[d](b,a);a.forEach(function(a,l){l=g[l];a.values=v(l,{val:a.childrenTotal,direction:f?1-b.direction:b.direction});a.pointValues=v(l,{x:l.x/e.axisRatio,width:l.width/e.axisRatio});
a.children.length&&e.calculateChildrenAreas(a,a.values)})},setPointValues:function(){var a=this,b=a.xAxis,e=a.yAxis;a.points.forEach(function(c){var l=c.node,d=l.pointValues,f=0;a.chart.styledMode||(f=(a.pointAttribs(c)["stroke-width"]||0)%2/2);if(d&&l.visible){l=Math.round(b.translate(d.x,0,0,0,1))-f;var g=Math.round(b.translate(d.x+d.width,0,0,0,1))-f;var t=Math.round(e.translate(d.y,0,0,0,1))-f;d=Math.round(e.translate(d.y+d.height,0,0,0,1))-f;c.shapeArgs={x:Math.min(l,g),y:Math.min(t,d),width:Math.abs(g-
l),height:Math.abs(d-t)};c.plotX=c.shapeArgs.x+c.shapeArgs.width/2;c.plotY=c.shapeArgs.y+c.shapeArgs.height/2}else delete c.plotX,delete c.plotY})},setColorRecursive:function(a,b,e,c,l){var d=this,f=d&&d.chart;f=f&&f.options&&f.options.colors;if(a){var g=q(a,{colors:f,index:c,mapOptionsToLevel:d.mapOptionsToLevel,parentColor:b,parentColorIndex:e,series:d,siblings:l});if(b=d.points[a.i])b.color=g.color,b.colorIndex=g.colorIndex;(a.children||[]).forEach(function(b,e){d.setColorRecursive(b,g.color,g.colorIndex,
e,a.children.length)})}},algorithmGroup:function(a,b,e,c){this.height=a;this.width=b;this.plot=c;this.startDirection=this.direction=e;this.lH=this.nH=this.lW=this.nW=this.total=0;this.elArr=[];this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(a,b){return Math.max(a/b,b/a)}};this.addElement=function(a){this.lP.total=this.elArr[this.elArr.length-1];this.total+=a;0===this.direction?(this.lW=this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,this.lP.lH),
this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW,this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/this.nH,this.lP.nR=this.lP.aspectRatio(this.lP.nW,this.nH));this.elArr.push(a)};this.reset=function(){this.lW=this.nW=0;this.elArr=[];this.total=0}},algorithmCalcPoints:function(a,b,e,c){var l,f,g,t,k=e.lW,r=e.lH,h=e.plot,n=0,p=e.elArr.length-
1;if(b)k=e.nW,r=e.nH;else var m=e.elArr[e.elArr.length-1];e.elArr.forEach(function(a){if(b||n<p)0===e.direction?(l=h.x,f=h.y,g=k,t=a/g):(l=h.x,f=h.y,t=r,g=a/t),c.push({x:l,y:f,width:g,height:d.correctFloat(t)}),0===e.direction?h.y+=t:h.x+=g;n+=1});e.reset();0===e.direction?e.width-=k:e.height-=r;h.y=h.parent.y+(h.parent.height-e.height);h.x=h.parent.x+(h.parent.width-e.width);a&&(e.direction=1-e.direction);b||e.addElement(m)},algorithmLowAspectRatio:function(a,b,e){var c=[],d=this,f,g={x:b.x,y:b.y,
parent:b},h=0,k=e.length-1,r=new this.algorithmGroup(b.height,b.width,b.direction,g);e.forEach(function(e){f=e.val/b.val*b.height*b.width;r.addElement(f);r.lP.nR>r.lP.lR&&d.algorithmCalcPoints(a,!1,r,c,g);h===k&&d.algorithmCalcPoints(a,!0,r,c,g);h+=1});return c},algorithmFill:function(a,b,e){var c=[],d,f=b.direction,g=b.x,h=b.y,k=b.width,r=b.height,n,p,m,q;e.forEach(function(e){d=e.val/b.val*b.height*b.width;n=g;p=h;0===f?(q=r,m=d/q,k-=m,g+=m):(m=k,q=d/m,r-=q,h+=q);c.push({x:n,y:p,width:m,height:q});
a&&(f=1-f)});return c},strip:function(a,b){return this.algorithmLowAspectRatio(!1,a,b)},squarified:function(a,b){return this.algorithmLowAspectRatio(!0,a,b)},sliceAndDice:function(a,b){return this.algorithmFill(!0,a,b)},stripes:function(a,b){return this.algorithmFill(!1,a,b)},translate:function(){var a=this,b=a.options,e=K(a);w.prototype.translate.call(a);var c=a.tree=a.getTree();var d=a.nodeMap[e];a.renderTraverseUpButton(e);a.mapOptionsToLevel=H({from:d.level+1,levels:b.levels,to:c.height,defaults:{levelIsConstant:a.options.levelIsConstant,
colorByPoint:b.colorByPoint}});""===e||d&&d.children.length||(a.setRootNode("",!1),e=a.rootNode,d=a.nodeMap[e]);D(a.nodeMap[a.rootNode],function(b){var e=!1,c=b.parent;b.visible=!0;if(c||""===c)e=a.nodeMap[c];return e});D(a.nodeMap[a.rootNode].children,function(a){var b=!1;a.forEach(function(a){a.visible=!0;a.children.length&&(b=(b||[]).concat(a.children))});return b});a.setTreeValues(c);a.axisRatio=a.xAxis.len/a.yAxis.len;a.nodeMap[""].pointValues=e={x:0,y:0,width:100,height:100};a.nodeMap[""].values=
e=v(e,{width:e.width*a.axisRatio,direction:"vertical"===b.layoutStartingDirection?0:1,val:c.val});a.calculateChildrenAreas(c,e);a.colorAxis?a.translateColors():b.colorByPoint||a.setColorRecursive(a.tree);b.allowTraversingTree&&(b=d.pointValues,a.xAxis.setExtremes(b.x,b.x+b.width,!1),a.yAxis.setExtremes(b.y,b.y+b.height,!1),a.xAxis.setScale(),a.yAxis.setScale());a.setPointValues()},drawDataLabels:function(){var a=this,b=a.mapOptionsToLevel,e,c;a.points.filter(function(a){return a.node.visible}).forEach(function(d){c=
b[d.node.level];e={style:{}};d.node.isLeaf||(e.enabled=!1);c&&c.dataLabels&&(e=v(e,c.dataLabels),a._hasPointLabels=!0);d.shapeArgs&&(e.style.width=d.shapeArgs.width,d.dataLabel&&d.dataLabel.css({width:d.shapeArgs.width+"px"}));d.dlOptions=v(e,d.options.dataLabels)});w.prototype.drawDataLabels.call(this)},alignDataLabel:function(a,b,e){var c=e.style;!h(c.textOverflow)&&b.text&&b.getBBox().width>b.text.textWidth&&b.css({textOverflow:"ellipsis",width:c.width+="px"});A.column.prototype.alignDataLabel.apply(this,
arguments);a.dataLabel&&a.dataLabel.attr({zIndex:(a.node.zIndex||0)+1})},pointAttribs:function(a,b){var e=u(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},c=a&&e[a.node.level]||{};e=this.options;var d=b&&e.states[b]||{},f=a&&a.getClassName()||"";a={stroke:a&&a.borderColor||c.borderColor||d.borderColor||e.borderColor,"stroke-width":m(a&&a.borderWidth,c.borderWidth,d.borderWidth,e.borderWidth),dashstyle:a&&a.borderDashStyle||c.borderDashStyle||d.borderDashStyle||e.borderDashStyle,fill:a&&a.color||
this.color};-1!==f.indexOf("highcharts-above-level")?(a.fill="none",a["stroke-width"]=0):-1!==f.indexOf("highcharts-internal-node-interactive")?(b=m(d.opacity,e.opacity),a.fill=G(a.fill).setOpacity(b).get(),a.cursor="pointer"):-1!==f.indexOf("highcharts-internal-node")?a.fill="none":b&&(a.fill=G(a.fill).brighten(d.brightness).get());return a},drawPoints:function(){var a=this,b=a.chart,c=b.renderer,d=b.styledMode,f=a.options,g=d?{}:f.shadow,h=f.borderRadius,k=b.pointCount<f.animationLimit,n=f.allowTraversingTree;
a.points.forEach(function(b){var e=b.node.levelDynamic,l={},m={},p={},q="level-group-"+e,t=!!b.graphic,r=k&&t,u=b.shapeArgs;b.shouldDraw()&&(h&&(m.r=h),v(!0,r?l:m,t?u:{},d?{}:a.pointAttribs(b,b.selected&&"select")),a.colorAttribs&&d&&F(p,a.colorAttribs(b)),a[q]||(a[q]=c.g(q).attr({zIndex:1E3-e}).add(a.group)));b.draw({animatableAttribs:l,attribs:m,css:p,group:a[q],renderer:c,shadow:g,shapeArgs:u,shapeType:"rect"});n&&b.graphic&&(b.drillId=f.interactByLeaf?a.drillToByLeaf(b):a.drillToByGroup(b))})},
onClickDrillToNode:function(a){var b=(a=a.point)&&a.drillId;g(b)&&(a.setState(""),this.setRootNode(b,!0,{trigger:"click"}))},drillToByGroup:function(a){var b=!1;1!==a.node.level-this.nodeMap[this.rootNode].level||a.node.isLeaf||(b=a.id);return b},drillToByLeaf:function(a){var b=!1;if(a.node.parent!==this.rootNode&&a.node.isLeaf)for(a=a.node;!b;)a=this.nodeMap[a.parent],a.parent===this.rootNode&&(b=a.id);return b},drillUp:function(){var a=this.nodeMap[this.rootNode];a&&g(a.parent)&&this.setRootNode(a.parent,
!0,{trigger:"traverseUpButton"})},drillToNode:function(a,b){B("WARNING: treemap.drillToNode has been renamed to treemap.setRootNode, and will be removed in the next major version.");this.setRootNode(a,b)},setRootNode:function(a,b,c){a=F({newRootId:a,previousRootId:this.rootNode,redraw:m(b,!0),series:this},c);E(this,"setRootNode",a,function(a){var b=a.series;b.idPreviousRoot=a.previousRootId;b.rootNode=a.newRootId;b.isDirty=!0;a.redraw&&b.chart.redraw()})},renderTraverseUpButton:function(a){var b=
this,c=b.options.traverseUpButton,d=m(c.text,b.nodeMap[a].name,"< Back");if(""===a)b.drillUpButton&&(b.drillUpButton=b.drillUpButton.destroy());else if(this.drillUpButton)this.drillUpButton.placed=!1,this.drillUpButton.attr({text:d}).align();else{var f=(a=c.theme)&&a.states;this.drillUpButton=this.chart.renderer.button(d,null,null,function(){b.drillUp()},a,f&&f.hover,f&&f.select).addClass("highcharts-drillup-button").attr({align:c.position.align,zIndex:7}).add().align(c.position,!1,c.relativeTo||
"plotBox")}},buildKDTree:x,drawLegendSymbol:d.LegendSymbolMixin.drawRectangle,getExtremes:function(){w.prototype.getExtremes.call(this,this.colorValueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;w.prototype.getExtremes.call(this)},getExtremesFromAll:!0,bindAxes:function(){var a={endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,dataMin:0,minPadding:0,max:100,dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};w.prototype.bindAxes.call(this);d.extend(this.yAxis.options,
a);d.extend(this.xAxis.options,a)},setState:function(a){this.options.inactiveOtherPoints=!0;w.prototype.setState.call(this,a,!1);this.options.inactiveOtherPoints=!1},utils:{recursive:D}},{draw:f,getClassName:function(){var a=d.Point.prototype.getClassName.call(this),b=this.series,c=b.options;this.node.level<=b.nodeMap[b.rootNode].level?a+=" highcharts-above-level":this.node.isLeaf||m(c.interactByLeaf,!c.allowTraversingTree)?this.node.isLeaf||(a+=" highcharts-internal-node"):a+=" highcharts-internal-node-interactive";
return a},isValid:function(){return this.id||z(this.value)},setState:function(a){d.Point.prototype.setState.call(this,a);this.graphic&&this.graphic.attr({zIndex:"hover"===a?1:0})},setVisible:A.pie.prototype.pointClass.prototype.setVisible,shouldDraw:function(){return z(this.plotY)&&null!==this.y}})});n(f,"masters/modules/treemap.src.js",[],function(){})});
//# sourceMappingURL=treemap.js.map