sunburst.js 18.9 KB
/*
 Highcharts JS v6.2.0 (2018-10-17)

 (c) 2016 Highsoft AS
 Authors: Jon Arild Nygard

 License: www.highcharts.com/license
*/
(function(E){"object"===typeof module&&module.exports?module.exports=E:"function"===typeof define&&define.amd?define(function(){return E}):E(Highcharts)})(function(E){var Q=function(){return function(a){var p=this,v=p.graphic,x=a.animate,q=a.attr,w=a.onComplete,G=a.css,H=a.group,g=a.renderer,P=a.shapeArgs;a=a.shapeType;p.shouldDraw()?(v||(p.graphic=v=g[a](P).add(H)),v.css(G).attr(q).animate(x,void 0,w)):v&&v.animate(x,void 0,function(){p.graphic=v=v.destroy();"function"===typeof w&&w()});v&&v.addClass(p.getClassName(),
!0)}}(),O=function(a){var p=a.each,v=a.extend,x=a.isArray,q=a.isObject,w=a.isNumber,G=a.merge,H=a.pick,g=a.reduce;return{getColor:function(a,u){var n=u.mapOptionsToLevel,v=u.parentColorIndex,C=u.series,y=u.colors,z=C.points,f,g;a&&(z=z[a.i],n=n[a.level]||{},(a=z&&n.colorByPoint)&&(f=z.index%(y?y.length:C.chart.options.chart.colorCount)),g=H(z&&z.options.colorIndex,n&&n.colorIndex,f,v,u.colorIndex));return{color:void 0,colorIndex:g}},getLevelOptions:function(a){var u=null,n,I,C,y;if(q(a))for(u={},
C=w(a.from)?a.from:1,y=a.levels,I={},n=q(a.defaults)?a.defaults:{},x(y)&&(I=g(y,function(a,f){var g,u;q(f)&&w(f.level)&&(u=G({},f),g="boolean"===typeof u.levelIsConstant?u.levelIsConstant:n.levelIsConstant,delete u.levelIsConstant,delete u.level,f=f.level+(g?0:C-1),q(a[f])?v(a[f],u):a[f]=u);return a},{})),y=w(a.to)?a.to:1,a=0;a<=y;a++)u[a]=G({},n,q(I[a])?I[a]:{});return u},setTreeValues:function u(a,g){var n=g.before,y=g.idRoot,w=g.mapIdToNode[y],f=g.points[a.i],q=f&&f.options||{},x=0,G=[];v(a,{levelDynamic:a.level-
(("boolean"===typeof g.levelIsConstant?g.levelIsConstant:1)?0:w.level),name:H(f&&f.name,""),visible:y===a.id||("boolean"===typeof g.visible?g.visible:!1)});"function"===typeof n&&(a=n(a,g));p(a.children,function(n,f){var b=v({},g);v(b,{index:f,siblings:a.children.length,visible:a.visible});n=u(n,b);G.push(n);n.visible&&(x+=n.val)});a.visible=0<x||a.visible;n=H(q.value,x);v(a,{children:G,childrenTotal:x,isLeaf:a.visible&&!x,val:n});return a},updateRootId:function(a){var g;q(a)&&(g=q(a.options)?a.options:
{},g=H(a.rootNode,g.rootId,""),q(a.userOptions)&&(a.userOptions.rootId=g),a.rootNode=g);return g}}}(E);(function(a,p){var v=a.seriesType,x=a.seriesTypes,q=a.map,w=a.merge,G=a.extend,H=a.noop,g=a.each,E=p.getColor,u=p.getLevelOptions,n=a.grep,I=a.isArray,C=a.isNumber,y=a.isString,z=a.pick,f=a.Series,J=a.stableSort,M=function(b,e,c){c=c||this;a.objectEach(b,function(d,h){e.call(c,d,h,b)})},L=a.reduce,K=function(b,e,c){c=c||this;b=e.call(c,b);!1!==b&&K(b,e,c)},N=p.updateRootId;v("treemap","scatter",
{showInLegend:!1,marker:!1,colorByPoint:!1,dataLabels:{enabled:!0,defer:!1,verticalAlign:"middle",formatter:function(){return this.point.name||this.point.id},inside:!0},tooltip:{headerFormat:"",pointFormat:"\x3cb\x3e{point.name}\x3c/b\x3e: {point.value}\x3cbr/\x3e"},ignoreHiddenPoint:!0,layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,drillUpButton:{position:{align:"right",x:-10,y:10}}},{pointArrayMap:["value"],directTouch:!0,optionalAxis:"colorAxis",
getSymbol:H,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",trackerGroups:["group","dataLabelsGroup"],getListOfParents:function(b,e){b=I(b)?b:[];var c=I(e)?e:[];e=L(b,function(b,c,e){c=z(c.parent,"");void 0===b[c]&&(b[c]=[]);b[c].push(e);return b},{"":[]});M(e,function(b,e,m){""!==e&&-1===a.inArray(e,c)&&(g(b,function(b){m[""].push(b)}),delete m[e])});return e},getTree:function(){var b=q(this.data,function(b){return b.id}),b=this.getListOfParents(this.data,b);this.nodeMap=[];return this.buildNode("",
-1,0,b,null)},init:function(b,e){var c=a.colorSeriesMixin;a.colorSeriesMixin&&(this.translateColors=c.translateColors,this.colorAttribs=c.colorAttribs,this.axisTypes=c.axisTypes);f.prototype.init.call(this,b,e);this.options.allowDrillToNode&&a.addEvent(this,"click",this.onClickDrillToNode)},buildNode:function(b,e,c,d,a){var h=this,l=[],k=h.points[e],r=0,t;g(d[b]||[],function(e){t=h.buildNode(h.points[e].id,e,c+1,d,b);r=Math.max(t.height+1,r);l.push(t)});e={id:b,i:e,children:l,height:r,level:c,parent:a,
visible:!1};h.nodeMap[e.id]=e;k&&(k.node=e);return e},setTreeValues:function(b){var e=this,c=e.options,d=e.nodeMap[e.rootNode],c="boolean"===typeof c.levelIsConstant?c.levelIsConstant:!0,a=0,m=[],l,k=e.points[b.i];g(b.children,function(b){b=e.setTreeValues(b);m.push(b);b.ignore||(a+=b.val)});J(m,function(b,d){return b.sortIndex-d.sortIndex});l=z(k&&k.options.value,a);k&&(k.value=l);G(b,{children:m,childrenTotal:a,ignore:!(z(k&&k.visible,!0)&&0<l),isLeaf:b.visible&&!a,levelDynamic:b.level-(c?0:d.level),
name:z(k&&k.name,""),sortIndex:z(k&&k.sortIndex,-l),val:l});return b},calculateChildrenAreas:function(b,e){var c=this,d=c.options,a=c.mapOptionsToLevel[b.level+1],m=z(c[a&&a.layoutAlgorithm]&&a.layoutAlgorithm,d.layoutAlgorithm),l=d.alternateStartingDirection,k=[];b=n(b.children,function(b){return!b.ignore});a&&a.layoutStartingDirection&&(e.direction="vertical"===a.layoutStartingDirection?0:1);k=c[m](e,b);g(b,function(b,d){d=k[d];b.values=w(d,{val:b.childrenTotal,direction:l?1-e.direction:e.direction});
b.pointValues=w(d,{x:d.x/c.axisRatio,width:d.width/c.axisRatio});b.children.length&&c.calculateChildrenAreas(b,b.values)})},setPointValues:function(){var b=this.xAxis,a=this.yAxis;g(this.points,function(c){var d=c.node,e=d.pointValues,m,l;e&&d.visible?(d=Math.round(b.translate(e.x,0,0,0,1))-0,m=Math.round(b.translate(e.x+e.width,0,0,0,1))-0,l=Math.round(a.translate(e.y,0,0,0,1))-0,e=Math.round(a.translate(e.y+e.height,0,0,0,1))-0,c.shapeType="rect",c.shapeArgs={x:Math.min(d,m),y:Math.min(l,e),width:Math.abs(m-
d),height:Math.abs(e-l)},c.plotX=c.shapeArgs.x+c.shapeArgs.width/2,c.plotY=c.shapeArgs.y+c.shapeArgs.height/2):(delete c.plotX,delete c.plotY)})},setColorRecursive:function(b,e,a,d,h){var c=this,l=c&&c.chart,l=l&&l.options&&l.options.colors,k;if(b){k=E(b,{colors:l,index:d,mapOptionsToLevel:c.mapOptionsToLevel,parentColor:e,parentColorIndex:a,series:c,siblings:h});if(e=c.points[b.i])e.color=k.color,e.colorIndex=k.colorIndex;g(b.children||[],function(d,e){c.setColorRecursive(d,k.color,k.colorIndex,
e,b.children.length)})}},algorithmGroup:function(b,e,a,d){this.height=b;this.width=e;this.plot=d;this.startDirection=this.direction=a;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(b,d){return Math.max(b/d,d/b)}};this.addElement=function(b){this.lP.total=this.elArr[this.elArr.length-1];this.total+=b;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(b)};this.reset=function(){this.lW=this.nW=0;this.elArr=[];this.total=0}},algorithmCalcPoints:function(b,e,a,d){var c,m,l,k,r=a.lW,t=a.lH,A=a.plot,F,D=0,B=
a.elArr.length-1;e?(r=a.nW,t=a.nH):F=a.elArr[a.elArr.length-1];g(a.elArr,function(b){if(e||D<B)0===a.direction?(c=A.x,m=A.y,l=r,k=b/l):(c=A.x,m=A.y,k=t,l=b/k),d.push({x:c,y:m,width:l,height:k}),0===a.direction?A.y+=k:A.x+=l;D+=1});a.reset();0===a.direction?a.width-=r:a.height-=t;A.y=A.parent.y+(A.parent.height-a.height);A.x=A.parent.x+(A.parent.width-a.width);b&&(a.direction=1-a.direction);e||a.addElement(F)},algorithmLowAspectRatio:function(b,a,c){var d=[],e=this,m,l={x:a.x,y:a.y,parent:a},k=0,r=
c.length-1,t=new this.algorithmGroup(a.height,a.width,a.direction,l);g(c,function(c){m=c.val/a.val*a.height*a.width;t.addElement(m);t.lP.nR>t.lP.lR&&e.algorithmCalcPoints(b,!1,t,d,l);k===r&&e.algorithmCalcPoints(b,!0,t,d,l);k+=1});return d},algorithmFill:function(b,a,c){var d=[],e,m=a.direction,l=a.x,k=a.y,r=a.width,t=a.height,A,F,D,B;g(c,function(c){e=c.val/a.val*a.height*a.width;A=l;F=k;0===m?(B=t,D=e/B,r-=D,l+=D):(D=r,B=e/D,t-=B,k+=B);d.push({x:A,y:F,width:D,height:B});b&&(m=1-m)});return d},strip:function(b,
a){return this.algorithmLowAspectRatio(!1,b,a)},squarified:function(b,a){return this.algorithmLowAspectRatio(!0,b,a)},sliceAndDice:function(b,a){return this.algorithmFill(!0,b,a)},stripes:function(b,a){return this.algorithmFill(!1,b,a)},translate:function(){var b=this,a=b.options,c=N(b),d,h;f.prototype.translate.call(b);h=b.tree=b.getTree();d=b.nodeMap[c];b.mapOptionsToLevel=u({from:d.level+1,levels:a.levels,to:h.height,defaults:{levelIsConstant:b.options.levelIsConstant,colorByPoint:a.colorByPoint}});
""===c||d&&d.children.length||(b.drillToNode("",!1),c=b.rootNode,d=b.nodeMap[c]);K(b.nodeMap[b.rootNode],function(a){var d=!1,c=a.parent;a.visible=!0;if(c||""===c)d=b.nodeMap[c];return d});K(b.nodeMap[b.rootNode].children,function(b){var a=!1;g(b,function(b){b.visible=!0;b.children.length&&(a=(a||[]).concat(b.children))});return a});b.setTreeValues(h);b.axisRatio=b.xAxis.len/b.yAxis.len;b.nodeMap[""].pointValues=c={x:0,y:0,width:100,height:100};b.nodeMap[""].values=c=w(c,{width:c.width*b.axisRatio,
direction:"vertical"===a.layoutStartingDirection?0:1,val:h.val});b.calculateChildrenAreas(h,c);b.colorAxis?b.translateColors():a.colorByPoint||b.setColorRecursive(b.tree);a.allowDrillToNode&&(a=d.pointValues,b.xAxis.setExtremes(a.x,a.x+a.width,!1),b.yAxis.setExtremes(a.y,a.y+a.height,!1),b.xAxis.setScale(),b.yAxis.setScale());b.setPointValues()},drawDataLabels:function(){var b=this,a=b.mapOptionsToLevel,c=n(b.points,function(b){return b.node.visible}),d,h;g(c,function(c){h=a[c.node.level];d={style:{}};
c.node.isLeaf||(d.enabled=!1);h&&h.dataLabels&&(d=w(d,h.dataLabels),b._hasPointLabels=!0);c.shapeArgs&&(d.style.width=c.shapeArgs.width,c.dataLabel&&c.dataLabel.css({width:c.shapeArgs.width+"px"}));c.dlOptions=w(d,c.options.dataLabels)});f.prototype.drawDataLabels.call(this)},alignDataLabel:function(b){x.column.prototype.alignDataLabel.apply(this,arguments);b.dataLabel&&b.dataLabel.attr({zIndex:(b.node.zIndex||0)+1})},drawPoints:function(){var b=this,a=n(b.points,function(b){return b.node.visible});
g(a,function(a){var d="level-group-"+a.node.levelDynamic;b[d]||(b[d]=b.chart.renderer.g(d).attr({zIndex:1E3-a.node.levelDynamic}).add(b.group));a.group=b[d]});x.column.prototype.drawPoints.call(this);this.colorAttribs&&g(this.points,function(b){b.graphic&&b.graphic.css(this.colorAttribs(b))},this);b.options.allowDrillToNode&&g(a,function(a){a.graphic&&(a.drillId=b.options.interactByLeaf?b.drillToByLeaf(a):b.drillToByGroup(a))})},onClickDrillToNode:function(b){var a=(b=b.point)&&b.drillId;y(a)&&(b.setState(""),
this.drillToNode(a))},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&&y(a.parent)&&this.drillToNode(a.parent)},drillToNode:function(a,e){var b=this.nodeMap[a];this.idPreviousRoot=this.rootNode;this.rootNode=
a;""===a?this.drillUpButton=this.drillUpButton.destroy():this.showDrillUpButton(b&&b.name||a);this.isDirty=!0;z(e,!0)&&this.chart.redraw()},showDrillUpButton:function(a){var b=this;a=a||"\x3c Back";var c=b.options.drillUpButton,d,h;c.text&&(a=c.text);this.drillUpButton?(this.drillUpButton.placed=!1,this.drillUpButton.attr({text:a}).align()):(h=(d=c.theme)&&d.states,this.drillUpButton=this.chart.renderer.button(a,null,null,function(){b.drillUp()},d,h&&h.hover,h&&h.select).addClass("highcharts-drillup-button").attr({align:c.position.align,
zIndex:7}).add().align(c.position,!1,c.relativeTo||"plotBox"))},buildKDTree:H,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,getExtremes:function(){f.prototype.getExtremes.call(this,this.colorValueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;f.prototype.getExtremes.call(this)},getExtremesFromAll:!0,bindAxes:function(){var b={endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,dataMin:0,minPadding:0,max:100,dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};f.prototype.bindAxes.call(this);
a.extend(this.yAxis.options,b);a.extend(this.xAxis.options,b)},utils:{recursive:K,reduce:L}},{getClassName:function(){var b=a.Point.prototype.getClassName.call(this),e=this.series,c=e.options;this.node.level<=e.nodeMap[e.rootNode].level?b+=" highcharts-above-level":this.node.isLeaf||z(c.interactByLeaf,!c.allowDrillToNode)?this.node.isLeaf||(b+=" highcharts-internal-node"):b+=" highcharts-internal-node-interactive";return b},isValid:function(){return this.id||C(this.value)},setState:function(b){a.Point.prototype.setState.call(this,
b);this.graphic&&this.graphic.attr({zIndex:"hover"===b?1:0})},setVisible:x.pie.prototype.pointClass.prototype.setVisible})})(E,O);(function(a,p,v){var x=a.CenteredSeriesMixin,q=a.Series,w=a.each,G=a.extend,H=x.getCenter,g=v.getColor,E=v.getLevelOptions,u=x.getStartAndEndRadians,n=a.grep,I=a.inArray,C=a.isNumber,y=a.isObject,z=a.isString,f=a.keys,J=a.merge,M=180/Math.PI,x=a.seriesType,L=v.setTreeValues,K=a.reduce,N=v.updateRootId,b=function(a,b){var d=[];if(C(a)&&C(b)&&a<=b)for(;a<=b;a++)d.push(a);
return d},e=function(a,c){var d;c=y(c)?c:{};var e=0,k,h,t,g;y(a)&&(d=J({},a),a=C(c.from)?c.from:0,g=C(c.to)?c.to:0,h=b(a,g),a=n(f(d),function(a){return-1===I(+a,h)}),k=t=C(c.diffRadius)?c.diffRadius:0,w(h,function(a){a=d[a];var b=a.levelSize.unit,c=a.levelSize.value;"weight"===b?e+=c:"percentage"===b?(a.levelSize={unit:"pixels",value:c/100*k},t-=a.levelSize.value):"pixels"===b&&(t-=c)}),w(h,function(a){var b=d[a];"weight"===b.levelSize.unit&&(b=b.levelSize.value,d[a].levelSize={unit:"pixels",value:b/
e*t})}),w(a,function(a){d[a].levelSize={value:0,unit:"pixels"}}));return d},c=function(a,b){var d=b.mapIdToNode[a.parent],c=b.series,e=c.chart,h=c.points[a.i],d=g(a,{colors:e&&e.options&&e.options.colors,colorIndex:c.colorIndex,index:b.index,mapOptionsToLevel:b.mapOptionsToLevel,parentColor:d&&d.color,parentColorIndex:d&&d.colorIndex,series:b.series,siblings:b.siblings});a.color=d.color;a.colorIndex=d.colorIndex;h&&(h.color=a.color,h.colorIndex=a.colorIndex,a.sliced=a.id!==b.idRoot?h.sliced:!1);return a};
x("sunburst","treemap",{center:["50%","50%"],colorByPoint:!1,dataLabels:{allowOverlap:!0,defer:!0,style:{textOverflow:"ellipsis"},rotationMode:"auto"},rootId:void 0,levelIsConstant:!0,levelSize:{value:1,unit:"weight"},slicedOffset:10},{drawDataLabels:a.noop,drawPoints:function(){var a=this,b=a.mapOptionsToLevel,c=a.shapeRoot,e=a.group,k=a.hasRendered,g=a.rootNode,t=a.idPreviousRoot,A=a.nodeMap,F=A[t],n=F&&F.shapeArgs,F=a.points,B=a.startAndEndRadians,f=a.chart,f=f&&f.options&&f.options.chart||{},
v="boolean"===typeof f.animation?f.animation:!0,u=a.center[3]/2,x=a.chart.renderer,z,p=!1,E=!1;if(f=!!(v&&k&&g!==t&&a.dataLabelsGroup))a.dataLabelsGroup.attr({opacity:0}),z=function(){p=!0;a.dataLabelsGroup&&a.dataLabelsGroup.animate({opacity:1,visibility:"visible"})};w(F,function(d){var h,l,m=d.node,f=b[m.level];h=d.shapeExisting||{};var r=m.shapeArgs||{},F,w=!(!m.visible||!m.shapeArgs);if(k&&v){var D={};l={end:r.end,start:r.start,innerR:r.innerR,r:r.r,x:r.x,y:r.y};w?!d.graphic&&n&&(D=g===d.id?{start:B.start,
end:B.end}:n.end<=r.start?{start:B.end,end:B.end}:{start:B.start,end:B.start},D.innerR=D.r=u):d.graphic&&(t===d.id?l={innerR:u,r:u}:c&&(l=c.end<=h.start?{innerR:u,r:u,start:B.end,end:B.end}:{innerR:u,r:u,start:B.start,end:B.start}));h=D}else l=r,h={};var D=[r.plotX,r.plotY],q;d.node.isLeaf||(g===d.id?(q=A[g],q=q.parent):q=d.id);G(d,{shapeExisting:r,tooltipPos:D,drillId:q,name:""+(d.name||d.id||d.index),plotX:r.plotX,plotY:r.plotY,value:m.val,isNull:!w});q=d.options;m=y(r)?r:{};q=y(q)?q.dataLabels:
{};var f=y(f)?f.dataLabels:{},f=J({style:{}},f,q),p;q=f.rotationMode;C(f.rotation)||("auto"===q&&(1>d.innerArcLength&&d.outerArcLength>m.radius?p=0:q=1<d.innerArcLength&&d.outerArcLength>1.5*m.radius?"parallel":"perpendicular"),"auto"!==q&&(p=m.end-(m.end-m.start)/2),f.style.width="parallel"===q?Math.min(2.5*m.radius,(d.outerArcLength+d.innerArcLength)/2):m.radius,"perpendicular"===q&&d.series.chart.renderer.fontMetrics(f.style.fontSize).h>d.outerArcLength&&(f.style.width=1),f.style.width=Math.max(f.style.width-
2*(f.padding||0),1),p=p*M%180,"parallel"===q&&(p-=90),90<p?p-=180:-90>p&&(p+=180),f.rotation=p);0===f.rotation&&(f.rotation=.001);d.dlOptions=f;!E&&w&&(E=!0,F=z);d.draw({animate:l,attr:G(h,a.pointAttribs&&a.pointAttribs(d,d.selected&&"select")),onComplete:F,group:e,renderer:x,shapeType:"arc",shapeArgs:r})});f&&E?(a.hasRendered=!1,a.options.dataLabels.defer=!0,q.prototype.drawDataLabels.call(a),a.hasRendered=!0,p&&z()):q.prototype.drawDataLabels.call(a)},layoutAlgorithm:function(a,b,c){var d=a.start,
e=a.end-d,h=a.val,t=a.x,f=a.y,g=c&&y(c.levelSize)&&C(c.levelSize.value)?c.levelSize.value:0,m=a.r,q=m+g,u=c&&C(c.slicedOffset)?c.slicedOffset:0;return K(b||[],function(a,b){var c=1/h*b.val*e,r=d+c/2,l=t+Math.cos(r)*u,r=f+Math.sin(r)*u;b={x:b.sliced?l:t,y:b.sliced?r:f,innerR:m,r:q,radius:g,start:d,end:d+c};a.push(b);d=b.end;return a},[])},setShapeArgs:function(a,b,c){var d=[],e=c[a.level+1];a=n(a.children,function(a){return a.visible});d=this.layoutAlgorithm(b,a,e);w(a,function(a,b){b=d[b];var e=b.start+
(b.end-b.start)/2,f=b.innerR+(b.r-b.innerR)/2,h=b.end-b.start,f=0===b.innerR&&6.28<h?{x:b.x,y:b.y}:{x:b.x+Math.cos(e)*f,y:b.y+Math.sin(e)*f},g=a.val?a.childrenTotal>a.val?a.childrenTotal:a.val:a.childrenTotal;this.points[a.i]&&(this.points[a.i].innerArcLength=h*b.innerR,this.points[a.i].outerArcLength=h*b.r);a.shapeArgs=J(b,{plotX:f.x,plotY:f.y+4*Math.abs(Math.cos(e))});a.values=J(b,{val:g});a.children.length&&this.setShapeArgs(a,a.values,c)},this)},translate:function(){var a=this.options,b=this.center=
H.call(this),f=this.startAndEndRadians=u(a.startAngle,a.endAngle),g=b[3]/2,k=b[2]/2-g,r=N(this),t=this.nodeMap,n,p=t&&t[r],v,w;this.shapeRoot=p&&p.shapeArgs;q.prototype.translate.call(this);w=this.tree=this.getTree();t=this.nodeMap;p=t[r];n=z(p.parent)?p.parent:"";v=t[n];n=E({from:0<p.level?p.level:1,levels:this.options.levels,to:w.height,defaults:{colorByPoint:a.colorByPoint,dataLabels:a.dataLabels,levelIsConstant:a.levelIsConstant,levelSize:a.levelSize,slicedOffset:a.slicedOffset}});n=e(n,{diffRadius:k,
from:0<p.level?p.level:1,to:w.height});L(w,{before:c,idRoot:r,levelIsConstant:a.levelIsConstant,mapOptionsToLevel:n,mapIdToNode:t,points:this.points,series:this});a=t[""].shapeArgs={end:f.end,r:g,start:f.start,val:p.val,x:b[0],y:b[1]};this.setShapeArgs(v,a,n);this.mapOptionsToLevel=n},animate:function(a){var b=this.chart,c=[b.plotWidth/2,b.plotHeight/2],d=b.plotLeft,e=b.plotTop,b=this.group;a?(a={translateX:c[0]+d,translateY:c[1]+e,scaleX:.001,scaleY:.001,rotation:10,opacity:.01},b.attr(a)):(a={translateX:d,
translateY:e,scaleX:1,scaleY:1,rotation:0,opacity:1},b.animate(a,this.options.animation),this.animate=null)},utils:{calculateLevelSizes:e,range:b}},{draw:p,shouldDraw:function(){return!this.isNull}})})(E,Q,O)});
//# sourceMappingURL=sunburst.js.map