gantt.js 40.9 KB
/*
 Highcharts JS v6.2.0 (2018-10-17)
 Gantt series

 (c) 2016 Lars A. V. Cabrera

 --- WORK IN PROGRESS ---

 License: www.highcharts.com/license
*/
(function(D){"object"===typeof module&&module.exports?module.exports=D:"function"===typeof define&&define.amd?define(function(){return D}):D(Highcharts)})(function(D){(function(a){var v=a.addEvent,m=a.PlotLineOrBand,t=a.merge,r={currentDateIndicator:!0,color:"#ccd6eb",width:2,label:{format:"%a, %b %d %Y, %H:%M",formatter:void 0,rotation:0,style:{fontSize:"10px"}}};v(a.Axis,"afterSetOptions",function(){var a=this.options,m=a.currentDateIndicator;m&&("object"===typeof m?(m.label&&m.label.format&&(m.label.formatter=
void 0),m=t(r,m)):m=t(r),m.value=new Date,a.plotLines||(a.plotLines=[]),a.plotLines.push(m))});v(m,"render",function(){var n=this.options,m,q;n.currentDateIndicator&&n.label&&(m=n.label.format,q=n.label.formatter,n.value=new Date,n.label.text="function"===typeof q?q(this):a.dateFormat(m,new Date),this.label&&this.label.attr({text:n.label.text}))})})(D);(function(a){var v=function(e){return Array.prototype.slice.call(e,1)},m=a.dateFormat,t=a.defined,r=a.each,n=a.isArray,w=a.isNumber,q=function(e){return a.isObject(e,
!0)},y=a.merge,g=a.pick,h=a.wrap,d=a.Axis,p=a.Tick,u={top:0,right:1,bottom:2,left:3,0:"top",1:"right",2:"bottom",3:"left"};d.prototype.isNavigatorAxis=function(){return/highcharts-navigator-[xy]axis/.test(this.options.className)};d.prototype.isOuterAxis=function(){var e=this,b=-1,c=!0;r(e.chart.axes,function(k,l){k.side!==e.side||k.isNavigatorAxis()||(k===e?b=l:0<=b&&l>b&&(c=!1))});return c};d.prototype.getMaxLabelDimensions=function(e,b){var c={width:0,height:0};r(b,function(b){b=e[b];var l;q(b)&&
(l=q(b.label)?b.label:{},b=l.getBBox?l.getBBox().height:0,l=w(l.textPxLength)?l.textPxLength:0,c.height=Math.max(b,c.height),c.width=Math.max(l,c.width))});return c};a.dateFormats={W:function(e){e=new Date(e);var b;e.setHours(0,0,0,0);e.setDate(e.getDate()-(e.getDay()||7));b=new Date(e.getFullYear(),0,1);return Math.ceil(((e-b)/864E5+1)/7)},E:function(e){return m("%a",e,!0).charAt(0)}};h(d.prototype,"autoLabelAlign",function(e){return this.chart.isStock?"left":e.apply(this,v(arguments))});h(p.prototype,
"getLabelPosition",function(e,b,c,k,l,a,g,h){var f=this.axis,d=f.reversed,x=f.chart,p=f.options,A=p&&q(p.grid)?p.grid:{},p=a.align,m=u[f.side],B=f.tickPositions,G=this.pos-g,L=w(B[h+1])?B[h+1]-g:f.max+g,C=f.tickSize("tick",!0),B=n(C)?C[0]:0,C=C&&C[1]/2,H;!0===A.enabled?("top"===m?(A=f.top+f.offset,H=A-B):"bottom"===m?(H=x.chartHeight-f.bottom+f.offset,A=H+B):(A=f.top+f.len-f.translate(d?L:G),H=f.top+f.len-f.translate(d?G:L)),"right"===m?(m=x.chartWidth-f.right+f.offset,d=m+B):"left"===m?(d=f.left+
f.offset,m=d-B):(m=Math.round(f.left+f.translate(d?L:G))-C,d=Math.round(f.left+f.translate(d?G:L))-C),this.slotWidth=d-m,d={x:"left"===p?m:"right"===p?d:m+(d-m)/2,y:H+(A-H)/2},x=x.renderer.fontMetrics(a.style.fontSize,k.element),p=k.getBBox().height,a.useHTML?d.y+=x.b+-(p/2):(p=Math.round(p/x.h),d.y+=(x.b-(x.h-x.f))/2+-((p-1)*x.h/2)),d.x+=f.horiz&&a.x||0):d=e.apply(this,v(arguments));return d});h(d.prototype,"tickSize",function(e){var b=this.maxLabelDimensions,c=this.options,k=c&&q(c.grid)?c.grid:
{},c=e.apply(this,v(arguments));!0===k.enabled&&(k=2*Math.abs(this.defaultLeftAxisOptions.labels.x),b=k+(this.horiz?b.height:b.width),n(c)?c[0]=b:c=[b]);return c});h(d.prototype,"getTitlePosition",function(e){var b=this.options;if(!0===(b&&q(b.grid)?b.grid:{}).enabled){var c=this.axisTitle,k=c&&c.getBBox().width,l=this.horiz,f=this.left,a=this.top,d=this.width,h=this.height,p=b.title,b=this.opposite,m=this.offset,n=this.tickSize()||[0],r=p.x||0,z=p.y||0,B=g(p.margin,l?5:10),c=this.chart.renderer.fontMetrics(p.style&&
p.style.fontSize,c).f,n=(l?a+h:f)+n[0]/2*(b?-1:1)*(l?1:-1)+(this.side===u.bottom?c:0);return{x:l?f-k/2-B+r:n+(b?d:0)+m+r,y:l?n-(b?h:0)+(b?c:-c)/2+m+z:a-B+z}}return e.apply(this,v(arguments))});h(d.prototype,"unsquish",function(e){var b=this.options;return!0===(b&&q(b.grid)?b.grid:{}).enabled&&this.categories?this.tickInterval:e.apply(this,v(arguments))});a.addEvent(d,"afterSetOptions",function(e){var b=this.options;e=e.userOptions;var c,k=b&&q(b.grid)?b.grid:{};!0===k.enabled&&(c=y(!0,{className:"highcharts-grid-axis "+
(e.className||""),dateTimeLabelFormats:{hour:{list:["%H:%M","%H"]},day:{list:["%A, %e. %B","%a, %e. %b","%E"]},week:{list:["Week %W","W%W"]},month:{list:["%B","%b","%o"]}},grid:{borderWidth:1},labels:{padding:2,style:{fontSize:"13px"}},title:{text:null,reserveSpace:!1,rotation:0},units:[["millisecond",[1,10,100]],["second",[1,10]],["minute",[1,5,15]],["hour",[1,6]],["day",[1]],["week",[1]],["month",[1]],["year",null]]},e),"xAxis"===this.coll&&(t(e.linkedTo)&&!t(e.tickPixelInterval)&&(c.tickPixelInterval=
350),t(e.tickPixelInterval)||!t(e.linkedTo)||t(e.tickPositioner)||t(e.tickInterval)||(c.tickPositioner=function(b,e){var l=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(l){var k,f,g,d,h=c.units;for(d=0;d<h.length;d++)if(h[d][0]===l.unitName){k=d;break}if(h[k][1])return h[k+1]&&(g=h[k+1][0],f=(h[k+1][1]||[1])[0]),l=a.timeUnits[g],this.tickInterval=l*f,this.getTimeTicks({unitRange:l,count:f,unitName:g},b,e,this.options.startOfWeek)}})),y(!0,this.options,
c),this.horiz&&(b.minPadding=g(e.minPadding,0),b.maxPadding=g(e.maxPadding,0)),w(b.grid.borderWidth)&&(b.tickWidth=b.lineWidth=k.borderWidth))});h(d.prototype,"setAxisTranslation",function(e){var b=this.options,c=b&&q(b.grid)?b.grid:{},k=this.tickPositions&&this.tickPositions.info,l=this.userOptions.labels||{};this.horiz&&(!0===c.enabled&&r(this.series,function(c){c.options.pointRange=0}),k&&(!1===b.dateTimeLabelFormats[k.unitName].range||1<k.count)&&!t(l.align)&&(b.labels.align="left",t(l.x)||(b.labels.x=
3)));e.apply(this,v(arguments))});h(d.prototype,"trimTicks",function(e){var b=this.options,c=b&&q(b.grid)?b.grid:{},k=this.categories,l=this.tickPositions,f=l[0],a=l[l.length-1],g=this.linkedParent&&this.linkedParent.min||this.min,d=this.linkedParent&&this.linkedParent.max||this.max,h=this.tickInterval,p=f>g,u=a<d,f=f<g&&f+h>g,a=a>d&&a-h<d;!0!==c.enabled||k||!this.horiz&&!this.isLinked||(!p&&!f||b.startOnTick||(l[0]=g),!u&&!a||b.endOnTick||(l[l.length-1]=d));e.apply(this,v(arguments))});h(d.prototype,
"render",function(e){var b=this.options,c=b&&q(b.grid)?b.grid:{},k,l,f,a,g,d=this.chart.renderer,h=this.horiz;if(!0===c.enabled){if(c=2*Math.abs(this.defaultLeftAxisOptions.labels.x),this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,this.tickPositions),c=this.maxLabelDimensions.width+c,k=b.lineWidth,this.rightWall&&this.rightWall.destroy(),e.apply(this),e=this.axisGroup.getBBox(),this.isOuterAxis()&&this.axisLine&&(h&&(c=e.height-1),k)){e=this.getLinePath(k);a=e.indexOf("M")+1;g=e.indexOf("L")+
1;l=e.indexOf("M")+2;f=e.indexOf("L")+2;if(this.side===u.top||this.side===u.left)c=-c;h?(e[l]+=c,e[f]+=c):(e[a]+=c,e[g]+=c);this.axisLineExtra?this.axisLineExtra.animate({d:e}):this.axisLineExtra=d.path(e).attr({stroke:b.lineColor,"stroke-width":k,zIndex:7}).addClass("highcharts-axis-line").add(this.axisGroup);this.axisLine[this.showAxis?"show":"hide"](!0)}}else e.apply(this)});h(d.prototype,"init",function(e,b,c){function k(c){var b=c.options,e=25/11,k=c.chart.renderer.fontMetrics(b.labels.style.fontSize);
b.labels||(b.labels={});b.labels.align=g(b.labels.align,"center");c.categories||(b.showLastLabel=!1);c.horiz&&(b.tickLength=l.cellHeight||k.h*e);c.labelRotation=0;b.labels.rotation=0}var l=c&&q(c.grid)?c.grid:{},f,p,u;if(l.enabled)if(t(l.borderColor)&&(c.tickColor=c.lineColor=l.borderColor),n(l.columns))for(p=0,u=l.columns.length;u--;)f=y(c,l.columns[u],{type:"category"}),delete f.grid.columns,f=new d(b,f),f.isColumn=!0,f.columnIndex=p,h(f,"labelFormatter",function(c){var b=this.axis,e=b.tickPositions,
k=this.value,l=k===e[0],e=k===e[e.length-1],f=a.find(b.series[0].options.data,function(c){return c[b.isXAxis?"x":"y"]===k});this.isFirst=l;this.isLast=e;this.point=f;return c.call(this)}),p++;else e.apply(this,v(arguments)),k(this);else e.apply(this,v(arguments))})})(D);(function(a){var v=a.Chart,m=a.each,t=a.pick;a.addEvent(a.Axis,"afterSetOptions",function(){this.horiz||!a.isNumber(this.options.staticScale)||this.chart.options.chart.height||(this.staticScale=this.options.staticScale)});v.prototype.adjustHeight=
function(){"adjustHeight"!==this.redrawTrigger&&(m(this.axes||[],function(r){var n=r.chart,v=!!n.initiatedScale&&n.options.animation,q=r.options.staticScale,y;r.staticScale&&a.defined(r.min)&&(y=t(r.unitLength,r.max+r.tickInterval-r.min)*q,y=Math.max(y,q),q=y-n.plotHeight,1<=Math.abs(q)&&(n.plotHeight=y,n.redrawTrigger="adjustHeight",n.setSize(void 0,n.chartHeight+q,v)),m(r.series,function(a){(a=a.sharedClipKey&&n[a.sharedClipKey])&&a.attr({height:n.plotHeight})}))}),this.initiatedScale=!0);this.redrawTrigger=
null};a.addEvent(v,"render",v.prototype.adjustHeight)})(D);var M=function(a){var v=a.each,m=a.extend,t=a.isNumber,r=a.keys,n=a.map,w=a.pick,q=a.reduce,y=function(g,d){var h=q(g,function(a,e){var b=w(e.parent,"");void 0===a[b]&&(a[b]=[]);a[b].push(e);return a},{});g=r(h);v(g,function(g,e){var b=h[g];""!==g&&-1===a.inArray(g,d)&&(v(b,function(c){e[""].push(c)}),delete e[g])});return h},g=function(a,d,p,u,e,b){var c=0,k=0,l=b&&b.after,f=b&&b.before;d={data:u,depth:p-1,id:a,level:p,parent:d};var h,A;
"function"===typeof f&&f(d,b);f=n(e[a]||[],function(l){var f=g(l.id,a,p+1,l,e,b),d=l.start;l=!0===l.milestone?d:l.end;h=!t(h)||d<h?d:h;A=!t(A)||l>A?l:A;c=c+1+f.descendants;k=Math.max(f.height+1,k);return f});u&&(u.start=w(u.start,h),u.end=w(u.end,A));m(d,{children:f,descendants:c,height:k});"function"===typeof l&&l(d,b);return d};return{getListOfParents:y,getNode:g,getTree:function(a,d){var h=n(a,function(a){return a.id});a=y(a,h);return g("",null,1,null,a,d)}}}(D),N=function(a){var v=a.each,m=a.extend,
t=a.isArray,r=a.isObject,n=a.isNumber,w=a.merge,q=a.pick,y=a.reduce;return{getColor:function(g,h){var d=h.index,p=h.mapOptionsToLevel,u=h.parentColor,e=h.parentColorIndex,b=h.series,c=h.colors,k=h.siblings,l=b.points,f,x,A,E;if(g){l=l[g.i];g=p[g.level]||{};if(f=l&&g.colorByPoint)A=l.index%(c?c.length:b.chart.options.chart.colorCount),x=c&&c[A];c=l&&l.options.color;f=g&&g.color;if(p=u)p=(p=g&&g.colorVariation)&&"brightness"===p.key?a.color(u).brighten(d/k*p.to).get():u;f=q(c,f,x,p,b.color);E=q(l&&
l.options.colorIndex,g&&g.colorIndex,A,e,h.colorIndex)}return{color:f,colorIndex:E}},getLevelOptions:function(a){var g=null,d,p,u,e;if(r(a))for(g={},u=n(a.from)?a.from:1,e=a.levels,p={},d=r(a.defaults)?a.defaults:{},t(e)&&(p=y(e,function(b,c){var e,a;r(c)&&n(c.level)&&(a=w({},c),e="boolean"===typeof a.levelIsConstant?a.levelIsConstant:d.levelIsConstant,delete a.levelIsConstant,delete a.level,c=c.level+(e?0:u-1),r(b[c])?m(b[c],a):b[c]=a);return b},{})),e=n(a.to)?a.to:1,a=0;a<=e;a++)g[a]=w({},d,r(p[a])?
p[a]:{});return g},setTreeValues:function h(a,p){var d=p.before,e=p.idRoot,b=p.mapIdToNode[e],c=p.points[a.i],k=c&&c.options||{},l=0,f=[];m(a,{levelDynamic:a.level-(("boolean"===typeof p.levelIsConstant?p.levelIsConstant:1)?0:b.level),name:q(c&&c.name,""),visible:e===a.id||("boolean"===typeof p.visible?p.visible:!1)});"function"===typeof d&&(a=d(a,p));v(a.children,function(c,b){var e=m({},p);m(e,{index:b,siblings:a.children.length,visible:a.visible});c=h(c,e);f.push(c);c.visible&&(l+=c.val)});a.visible=
0<l||a.visible;d=q(k.value,l);m(a,{children:f,childrenTotal:l,isLeaf:a.visible&&!l,val:d});return a},updateRootId:function(a){var d;r(a)&&(d=r(a.options)?a.options:{},d=q(a.rootNode,d.rootId,""),r(a.userOptions)&&(a.userOptions.rootId=d),a.rootNode=d);return d}}}(D);(function(a){function v(){return Array.prototype.slice.call(arguments,1)}function m(a){a.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,r(this.pointArrayMap,["y"]))}var t=a.addEvent,r=a.pick,n=a.wrap,w=a.each,
q=a.extend,y=a.isArray,g=a.fireEvent,h=a.Axis,d=a.Series;q(h.prototype,{isInBreak:function(a,g){var e=a.repeat||Infinity,b=a.from,c=a.to-a.from;g=g>=b?(g-b)%e:e-(b-g)%e;return a.inclusive?g<=c:g<c&&0!==g},isInAnyBreak:function(a,g){var e=this.options.breaks,b=e&&e.length,c,k,l;if(b){for(;b--;)this.isInBreak(e[b],a)&&(c=!0,k||(k=r(e[b].showPoints,this.isXAxis?!1:!0)));l=c&&g?c&&!k:c}return l}});t(h,"afterInit",function(){"function"===typeof this.setBreaks&&this.setBreaks(this.options.breaks,!1)});
t(h,"afterSetTickPositions",function(){if(this.isBroken){var a=this.tickPositions,g=this.tickPositions.info,e=[],b;for(b=0;b<a.length;b++)this.isInAnyBreak(a[b])||e.push(a[b]);this.tickPositions=e;this.tickPositions.info=g}});t(h,"afterSetOptions",function(){this.isBroken&&(this.options.ordinal=!1)});h.prototype.setBreaks=function(a,d){function e(b){var e=b,a,k;for(k=0;k<c.breakArray.length;k++)if(a=c.breakArray[k],a.to<=b)e-=a.len;else if(a.from>=b)break;else if(c.isInBreak(a,b)){e-=b-a.from;break}return e}
function b(b){var a,e;for(e=0;e<c.breakArray.length&&!(a=c.breakArray[e],a.from>=b);e++)a.to<b?b+=a.len:c.isInBreak(a,b)&&(b+=a.len);return b}var c=this,k=y(a)&&!!a.length;c.isDirty=c.isBroken!==k;c.isBroken=k;c.options.breaks=c.userOptions.breaks=a;c.forceRedraw=!0;k||c.val2lin!==e||(delete c.val2lin,delete c.lin2val);k&&(c.userOptions.ordinal=!1,c.val2lin=e,c.lin2val=b,c.setExtremes=function(c,b,a,e,k){if(this.isBroken){for(;this.isInAnyBreak(c);)c-=this.closestPointRange;for(;this.isInAnyBreak(b);)b-=
this.closestPointRange}h.prototype.setExtremes.call(this,c,b,a,e,k)},c.setAxisTranslation=function(b){h.prototype.setAxisTranslation.call(this,b);this.unitLength=null;if(this.isBroken){b=c.options.breaks;var a=[],e=[],k=0,l,d,p=c.userMin||c.min,m=c.userMax||c.max,u=r(c.pointRangePadding,0),n,B;w(b,function(b){d=b.repeat||Infinity;c.isInBreak(b,p)&&(p+=b.to%d-p%d);c.isInBreak(b,m)&&(m-=m%d-b.from%d)});w(b,function(b){n=b.from;for(d=b.repeat||Infinity;n-d>p;)n-=d;for(;n<p;)n+=d;for(B=n;B<m;B+=d)a.push({value:B,
move:"in"}),a.push({value:B+(b.to-b.from),move:"out",size:b.breakSize})});a.sort(function(b,c){return b.value===c.value?("in"===b.move?0:1)-("in"===c.move?0:1):b.value-c.value});l=0;n=p;w(a,function(b){l+="in"===b.move?1:-1;1===l&&"in"===b.move&&(n=b.value);0===l&&(e.push({from:n,to:b.value,len:b.value-n-(b.size||0)}),k+=b.value-n-(b.size||0))});c.breakArray=e;c.unitLength=m-p-k+u;g(c,"afterBreaks");c.staticScale?c.transA=c.staticScale:c.unitLength&&(c.transA*=(m-c.min+u)/c.unitLength);u&&(c.minPixelPadding=
c.transA*c.minPointOffset);c.min=p;c.max=m}});r(d,!0)&&this.chart.redraw()};n(d.prototype,"generatePoints",function(a){a.apply(this,v(arguments));var g=this.xAxis,e=this.yAxis,b=this.points,c,k=b.length,l=this.options.connectNulls,d;if(g&&e&&(g.options.breaks||e.options.breaks))for(;k--;)c=b[k],d=null===c.y&&!1===l,d||!g.isInAnyBreak(c.x,!0)&&!e.isInAnyBreak(c.y,!0)||(b.splice(k,1),this.data[k]&&this.data[k].destroyElements())});a.Series.prototype.drawBreaks=function(a,d){var e=this,b=e.points,c,
k,l,f;a&&w(d,function(d){c=a.breakArray||[];k=a.isXAxis?a.min:r(e.options.threshold,a.min);w(b,function(b){f=r(b["stack"+d.toUpperCase()],b[d]);w(c,function(c){l=!1;if(k<c.from&&f>c.to||k>c.from&&f<c.from)l="pointBreak";else if(k<c.from&&f>c.from&&f<c.to||k>c.from&&f>c.to&&f<c.from)l="pointInBreak";l&&g(a,l,{point:b,brk:c})})})})};a.Series.prototype.gappedPath=function(){var g=this.currentDataGrouping,d=g&&g.totalRange,g=this.options.gapSize,e=this.points.slice(),b=e.length-1,c=this.yAxis;if(g&&0<
b)for("value"!==this.options.gapUnit&&(g*=this.closestPointRange),d&&d>g&&(g=d);b--;)e[b+1].x-e[b].x>g&&(d=(e[b].x+e[b+1].x)/2,e.splice(b+1,0,{isNull:!0,x:d}),this.options.stacking&&(d=c.stacks[this.stackKey][d]=new a.StackItem(c,c.options.stackLabels,!1,d,this.stack),d.total=0));return this.getGraphPath(e)};n(a.seriesTypes.column.prototype,"drawPoints",m);n(a.Series.prototype,"drawPoints",m)})(D);(function(a,v,m){var t=function(b){return Array.prototype.slice.call(b,1)},r=a.defined,n=a.each,w=a.extend,
q=a.find,y=a.fireEvent,g=m.getLevelOptions,h=a.map,d=a.merge,p=a.inArray,u=a.isNumber,e=function(b){return a.isObject(b,!0)},b=a.isString,c=a.keys,k=a.pick,l=a.reduce,f=a.wrap;m=a.Axis;var x=a.Tick,A=function(b,c){var a=!1;n(b,function(b,e,k){a||(a=c(b,e,k))});return a},E=function(b,c){var a,e;for(a in c)c.hasOwnProperty(a)&&(e=c[a],f(b,a,e))},F=function(b,c){var a=b.collapseStart;b=b.collapseEnd;b>=c&&(a-=.5);return{from:a,to:b,showPoints:!1}},J=function(b){return l(c(b.mapOfPosToGridNode),function(c,
a){a=+a;b.min<=a&&b.max>=a&&!b.isInAnyBreak(a)&&c.push(a);return c},[])},K=function(b,c){var a=b.options.breaks||[],e=F(c,b.max);return A(a,function(b){return b.from===e.from&&b.to===e.to})},I=function(b,c){var a=b.options.breaks||[];b=F(c,b.max);a.push(b);return a},z=function(b,c){var a=b.options.breaks||[],e=F(c,b.max);return l(a,function(b,c){c.to===e.to&&c.from===e.from||b.push(c);return b},[])},B=function(b,c){var e=b.labelIcon,g=!e,d=c.renderer,l=c.xy,f=c.options,h=f.width,p=f.height,C=l.x-
h/2-f.padding,l=l.y-p/2,m=c.collapsed?90:180,x=c.show&&a.isNumber(l);g&&(b.labelIcon=e=d.path(d.symbols[f.type](f.x,f.y,h,p)).addClass("highcharts-label-icon").add(c.group));x||e.attr({y:-9999});e.attr({"stroke-width":1,fill:k(c.color,"#666666")}).css({cursor:"pointer",stroke:f.lineColor,strokeWidth:f.lineWidth});e[g?"attr":"animate"]({translateX:C,translateY:l,rotation:m})},G=function(c,a,k){var g=[],d=[],l={},f={},h=-1,p="boolean"===typeof a?a:!1;c=v.getTree(c,{after:function(b){b=f[b.pos];var c=
0,a=0;n(b.children,function(b){a+=b.descendants+1;c=Math.max(b.height+1,c)});b.descendants=a;b.height=c;b.collapsed&&d.push(b)},before:function(c){var a=e(c.data)?c.data:{},k=b(a.name)?a.name:"",d=l[c.parent],d=e(d)?f[d.pos]:null,C=function(b){return b.name===k},m;p&&e(d)&&(m=q(d.children,C))?(C=m.pos,m.nodes.push(c)):C=h++;f[C]||(f[C]=m={depth:d?d.depth+1:0,name:k,nodes:[c],children:[],pos:C},-1!==C&&g.push(k),e(d)&&d.children.push(m));b(c.id)&&(l[c.id]=c);!0===a.collapsed&&(m.collapsed=!0);c.pos=
C}});f=function(b,c){var a=function(b,k,d){var g=k+(-1===k?0:c-1),l=(g-k)/2,f=k+l;n(b.nodes,function(b){var c=b.data;e(c)&&(c.y=k+c.seriesIndex,delete c.seriesIndex);b.pos=f});d[f]=b;b.pos=f;b.tickmarkOffset=l+.5;b.collapseStart=g+.5;n(b.children,function(b){a(b,g+1,d);g=b.collapseEnd-.5});b.collapseEnd=g+.5;return d};return a(b["-1"],-1,{})}(f,k);return{categories:g,mapOfIdToNode:l,mapOfPosToGridNode:f,collapsedNodes:d,tree:c}};E(m.prototype,{init:function(b,c,e){var k=this,l,f="treegrid"===e.type;
f&&(e=d({grid:{enabled:!0},labels:{align:"left",levels:[{level:void 0},{level:1,style:{fontWeight:"bold"}}],symbol:{type:"triangle",x:-5,y:-5,height:10,width:10,padding:5}},uniqueNames:!1},e,{reversed:!0,grid:{columns:void 0}}));b.apply(k,[c,e]);f&&(a.addEvent(k.chart,"beforeRender",function(){var b=k.options&&k.options.labels;k.updateYNames();n(k.series,function(b){b.yData=h(b.options.data,function(b){return b.y})});k.mapOptionsToLevel=g({defaults:b,from:1,levels:b.levels,to:k.tree.height});l=a.addEvent(k,
"foundExtremes",function(){n(k.collapsedNodes,function(b){b=I(k,b);k.setBreaks(b,!1)});l()})}),k.hasNames=!0,k.options.showLastLabel=!0)},getMaxLabelDimensions:function(b){var c=this.options,a=c&&c.labels,c=a&&u(a.indentation)?c.labels.indentation:0,a=b.apply(this,t(arguments)),e;"treegrid"===this.options.type&&(e=this.mapOfPosToGridNode[-1].height,a.width+=c*(e-1));return a},generateTick:function(b,c){var a=e(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},k=this.ticks,d=k[c],g,l;"treegrid"===
this.options.type?(l=this.mapOfPosToGridNode[c],(a=a[l.depth])&&(g={labels:a}),d?(d.parameters.category=l.name,d.options=g,d.addLabel()):k[c]=new x(this,c,null,void 0,{category:l.name,tickmarkOffset:l.tickmarkOffset,options:g})):b.apply(this,t(arguments))},setTickInterval:function(b){var c=this.options;"treegrid"===c.type?(this.min=k(this.userMin,c.min,this.dataMin),this.max=k(this.userMax,c.max,this.dataMax),y(this,"foundExtremes"),this.setAxisTranslation(!0),this.tickmarkOffset=.5,this.tickInterval=
1,this.tickPositions=J(this)):b.apply(this,t(arguments))}});E(x.prototype,{getLabelPosition:function(b,c,a,d,g,l,f,h,p){var m=k(this.options&&this.options.labels,l);l=this.pos;var x=this.axis,n="treegrid"===x.options.type;b=b.apply(this,[c,a,d,g,m,f,h,p]);n&&(c=m&&e(m.symbol)?m.symbol:{},m=m&&u(m.indentation)?m.indentation:0,l=(l=(x=x.mapOfPosToGridNode)&&x[l])&&l.depth||1,b.x+=c.width+2*c.padding+(l-1)*m);return b},renderLabel:function(b){var c=this,d=c.pos,g=c.axis,l=c.label,f=g.mapOfPosToGridNode,
h=g.options,m=k(c.options&&c.options.labels,h&&h.labels),x=m&&e(m.symbol)?m.symbol:{},A=(f=f&&f[d])&&f.depth,h="treegrid"===h.type,q=!(!l||!l.element),d=-1<p(d,g.tickPositions);h&&f&&q&&l.addClass("highcharts-treegrid-node-level-"+A);b.apply(c,t(arguments));h&&f&&q&&0<f.descendants&&(g=K(g,f),B(c,{color:l.styles.color,collapsed:g,group:l.parentGroup,options:x,renderer:l.renderer,show:d,xy:l.xy}),x="highcharts-treegrid-node-"+(g?"expanded":"collapsed"),l.addClass("highcharts-treegrid-node-"+(g?"collapsed":
"expanded")).removeClass(x),l.css({cursor:"pointer"}),n([l,c.labelIcon],function(b){b.attachedTreeGridEvents||(a.addEvent(b.element,"mouseover",function(){var b=l;b.addClass("highcharts-treegrid-node-active");b.css({textDecoration:"underline"})}),a.addEvent(b.element,"mouseout",function(){var b=l,c=m,c=r(c.style)?c.style:{};b.removeClass("highcharts-treegrid-node-active");b.css({textDecoration:c.textDecoration})}),a.addEvent(b.element,"click",function(){c.toggleCollapse()}),b.attachedTreeGridEvents=
!0)}))}});w(x.prototype,{collapse:function(b){var c=this.axis,a=I(c,c.mapOfPosToGridNode[this.pos]);c.setBreaks(a,k(b,!0))},expand:function(b){var c=this.axis,a=z(c,c.mapOfPosToGridNode[this.pos]);c.setBreaks(a,k(b,!0))},toggleCollapse:function(b){var c=this.axis,a;a=c.mapOfPosToGridNode[this.pos];a=K(c,a)?z(c,a):I(c,a);c.setBreaks(a,k(b,!0))}});m.prototype.updateYNames=function(){var b=this.options,c=b.uniqueNames,a=!this.isXAxis,k=this.series,d=0;"treegrid"===b.type&&a&&(b=l(k,function(b,a){a.visible&&
(n(a.options.data,function(c){e(c)&&(c.seriesIndex=d,b.push(c))}),!0===c&&d++);return b},[]),b=G(b,c,!0===c?d:1),this.categories=b.categories,this.mapOfPosToGridNode=b.mapOfPosToGridNode,this.collapsedNodes=b.collapsedNodes,this.hasNames=!0,this.tree=b.tree)};m.prototype.utils={getNode:v.getNode}})(D,M,N);M=function(a){function v(a,h,d){d=d||0;var g=a.length-1;h-=1e-7;for(var m,e;d<=g;)if(m=g+d>>1,e=h-a[m].xMin,0<e)d=m+1;else if(0>e)g=m-1;else return m;return 0<d?d-1:0}function m(a,h){for(var d=v(a,
h.x+1)+1;d--;){var g;if(g=a[d].xMax>=h.x)g=a[d],g=h.x<=g.xMax&&h.x>=g.xMin&&h.y<=g.yMax&&h.y>=g.yMin;if(g)return d}return-1}function t(a){var g=[];if(a.length){g.push("M",a[0].start.x,a[0].start.y);for(var d=0;d<a.length;++d)g.push("L",a[d].end.x,a[d].end.y)}return g}function r(a,h){a.yMin=w(a.yMin,h.yMin);a.yMax=n(a.yMax,h.yMax);a.xMin=w(a.xMin,h.xMin);a.xMax=n(a.xMax,h.xMax)}var n=Math.min,w=Math.max,q=Math.abs,y=a.pick;return{straight:function(a,h){return{path:["M",a.x,a.y,"L",h.x,h.y],obstacles:[{start:a,
end:h}]}},simpleConnect:a.extend(function(a,h,d){function g(b,c,a,e,k){b={x:b.x,y:b.y};b[c]=a[e||c]+(k||0);return b}function n(b,c,a){var e=q(c[a]-b[a+"Min"])>q(c[a]-b[a+"Max"]);return g(c,a,b,a+(e?"Max":"Min"),e?1:-1)}var e=[],b,c=y(d.startDirectionX,q(h.x-a.x)>q(h.y-a.y))?"x":"y",k=d.chartObstacles,l=m(k,a);d=m(k,h);var f;-1<d?(b=k[d],d=n(b,h,c),b={start:d,end:h},f=d):f=h;-1<l&&(k=k[l],d=n(k,a,c),e.push({start:a,end:d}),d[c]>a[c]===d[c]>f[c]&&(c="y"===c?"x":"y",h=a[c]<h[c],e.push({start:d,end:g(d,
c,k,c+(h?"Max":"Min"),h?1:-1)}),c="y"===c?"x":"y"));a=e.length?e[e.length-1].end:a;d=g(a,c,f);e.push({start:a,end:d});c=g(d,"y"===c?"x":"y",f);e.push({start:d,end:c});e.push(b);return{path:t(e),obstacles:e}},{requiresObstacles:!0}),fastAvoid:a.extend(function(a,h,d){function g(b,c,a){var e,k,d,l,f,g=b.x<c.x?1:-1;b.x<c.x?(e=b,k=c):(e=c,k=b);b.y<c.y?(l=b,d=c):(l=c,d=b);for(f=0>g?n(v(z,k.x),z.length-1):0;z[f]&&(0<g&&z[f].xMin<=k.x||0>g&&z[f].xMax>=e.x);){if(z[f].xMin<=k.x&&z[f].xMax>=e.x&&z[f].yMin<=
d.y&&z[f].yMax>=l.y)return a?{y:b.y,x:b.x<c.x?z[f].xMin-1:z[f].xMax+1,obstacle:z[f]}:{x:b.x,y:b.y<c.y?z[f].yMin-1:z[f].yMax+1,obstacle:z[f]};f+=g}return c}function u(b,c,a,e,k){var d=k.soft,l=k.hard,f=e?"x":"y",h={x:c.x,y:c.y},m={x:c.x,y:c.y};k=b[f+"Max"]>=d[f+"Max"];var d=b[f+"Min"]<=d[f+"Min"],p=b[f+"Max"]>=l[f+"Max"],l=b[f+"Min"]<=l[f+"Min"],n=q(b[f+"Min"]-c[f]),x=q(b[f+"Max"]-c[f]);a=10>q(n-x)?c[f]<a[f]:x<n;m[f]=b[f+"Min"];h[f]=b[f+"Max"];b=g(c,m,e)[f]!==m[f];c=g(c,h,e)[f]!==h[f];a=b?c?a:!0:c?
!1:a;a=d?k?a:!0:k?!1:a;return l?p?a:!0:p?!1:a}function e(b,c,a){if(b.x===c.x&&b.y===c.y)return[];var k=a?"x":"y",f,l,h,p,x=d.obstacleOptions.margin;f={soft:{xMin:F,xMax:J,yMin:K,yMax:I},hard:d.hardBounds};l=m(z,b);-1<l?(l=z[l],f=u(l,b,c,a,f),r(l,d.hardBounds),p=a?{y:b.y,x:l[f?"xMax":"xMin"]+(f?1:-1)}:{x:b.x,y:l[f?"yMax":"yMin"]+(f?1:-1)},h=m(z,p),-1<h&&(h=z[h],r(h,d.hardBounds),p[k]=f?w(l[k+"Max"]-x+1,(h[k+"Min"]+l[k+"Max"])/2):n(l[k+"Min"]+x-1,(h[k+"Max"]+l[k+"Min"])/2),b.x===p.x&&b.y===p.y?(A&&
(p[k]=f?w(l[k+"Max"],h[k+"Max"])+1:n(l[k+"Min"],h[k+"Min"])-1),A=!A):A=!1),b=[{start:b,end:p}]):(k=g(b,{x:a?c.x:b.x,y:a?b.y:c.y},a),b=[{start:b,end:{x:k.x,y:k.y}}],k[a?"x":"y"]!==c[a?"x":"y"]&&(f=u(k.obstacle,k,c,!a,f),r(k.obstacle,d.hardBounds),f={x:a?k.x:k.obstacle[f?"xMax":"xMin"]+(f?1:-1),y:a?k.obstacle[f?"yMax":"yMin"]+(f?1:-1):k.y},a=!a,b=b.concat(e({x:k.x,y:k.y},f,a))));return b=b.concat(e(b[b.length-1].end,c,!a))}function b(b,c,a){var e=n(b.xMax-c.x,c.x-b.xMin)<n(b.yMax-c.y,c.y-b.yMin);a=
u(b,c,a,e,{soft:d.hardBounds,hard:d.hardBounds});return e?{y:c.y,x:b[a?"xMax":"xMin"]+(a?1:-1)}:{x:c.x,y:b[a?"yMax":"yMin"]+(a?1:-1)}}var c=y(d.startDirectionX,q(h.x-a.x)>q(h.y-a.y)),k=c?"x":"y",l,f,x=[],A=!1,E=d.obstacleMetrics,F=n(a.x,h.x)-E.maxWidth-10,J=w(a.x,h.x)+E.maxWidth+10,K=n(a.y,h.y)-E.maxHeight-10,I=w(a.y,h.y)+E.maxHeight+10,z=d.chartObstacles;l=v(z,F);E=v(z,J);z=z.slice(l,E+1);-1<(E=m(z,h))&&(f=b(z[E],h,a),x.push({end:h,start:f}),h=f);for(;-1<(E=m(z,h));)l=0>h[k]-a[k],f={x:h.x,y:h.y},
f[k]=z[E][l?k+"Max":k+"Min"]+(l?1:-1),x.push({end:h,start:f}),h=f;a=e(a,h,c);a=a.concat(x.reverse());return{path:t(a),obstacles:a}},{requiresObstacles:!0})}}(D);(function(a){a.SVGRenderer.prototype.symbols.arrow=function(a,m,t,r){return["M",a,m+r/2,"L",a+t,m,"L",a,m+r/2,"L",a+t,m+r]};a.SVGRenderer.prototype.symbols["arrow-half"]=function(v,m,t,r){return a.SVGRenderer.prototype.symbols.arrow(v,m,t/2,r)};a.SVGRenderer.prototype.symbols["triangle-left"]=function(a,m,t,r){return["M",a+t,m,"L",a,m+r/2,
"L",a+t,m+r,"Z"]};a.SVGRenderer.prototype.symbols["arrow-filled"]=a.SVGRenderer.prototype.symbols["triangle-left"];a.SVGRenderer.prototype.symbols["triangle-left-half"]=function(v,m,t,r){return a.SVGRenderer.prototype.symbols["triangle-left"](v,m,t/2,r)};a.SVGRenderer.prototype.symbols["arrow-filled-half"]=a.SVGRenderer.prototype.symbols["triangle-left-half"]})(D);(function(a,v){function m(b){var c=b.shapeArgs;return c?{xMin:c.x,xMax:c.x+c.width,yMin:c.y,yMax:c.y+c.height}:(c=b.graphic&&b.graphic.getBBox())?
{xMin:b.plotX-c.width/2,xMax:b.plotX+c.width/2,yMin:b.plotY-c.height/2,yMax:b.plotY+c.height/2}:null}function t(b){for(var c=b.length,a=0,l,f,d=[],g=function(b,c,a){a=p(a,10);var k=b.yMax+a>c.yMin-a&&b.yMin-a<c.yMax+a,f=b.xMax+a>c.xMin-a&&b.xMin-a<c.xMax+a,l=k?b.xMin>c.xMax?b.xMin-c.xMax:c.xMin-b.xMax:Infinity,d=f?b.yMin>c.yMax?b.yMin-c.yMax:c.yMin-b.yMax:Infinity;return f&&k?a?g(b,c,Math.floor(a/2)):Infinity:e(l,d)};a<c;++a)for(l=a+1;l<c;++l)f=g(b[a],b[l]),80>f&&d.push(f);d.push(80);return u(Math.floor(d.sort(function(b,
c){return b-c})[Math.floor(d.length/10)]/2-1),1)}function r(b,c,a){this.init(b,c,a)}function n(b){this.init(b)}var w=a.defined,q=a.deg2rad,y=a.extend,g=a.each,h=a.addEvent,d=a.merge,p=a.pick,u=Math.max,e=Math.min;y(a.defaultOptions,{pathfinder:{type:"straight",lineWidth:1,marker:{enabled:!1,align:"center",verticalAlign:"middle",inside:!1,lineWidth:1},startMarker:{symbol:"diamond"},endMarker:{symbol:"arrow-filled"}}});r.prototype={init:function(b,c,a){this.fromPoint=b;this.toPoint=c;this.options=a;
this.chart=b.series.chart;this.pathfinder=this.chart.pathfinder},renderPath:function(b,c,a){var e=this.chart,k=e.pathfinder,d=!e.options.chart.forExport&&!1!==a,g=this.graphics&&this.graphics.path;k.group||(k.group=e.renderer.g().addClass("highcharts-pathfinder-group").attr({zIndex:-1}).add(e.seriesGroup));k.group.translate(e.plotLeft,e.plotTop);g&&g.renderer||(g=e.renderer.path().attr({opacity:0}).add(k.group));g.attr(c);g[d?"animate":"attr"]({opacity:1,d:b},a);this.graphics=this.graphics||{};this.graphics.path=
g},addMarker:function(b,c,a){var e=this.fromPoint.series.chart,k=e.pathfinder,e=e.renderer,d="start"===b?this.fromPoint:this.toPoint,g=d.getPathfinderAnchorPoint(c),h,m;c.enabled&&(a="start"===b?{x:a[4],y:a[5]}:{x:a[a.length-5],y:a[a.length-4]},a=d.getRadiansToVector(a,g),g=d.getMarkerVector(a,c.radius,g),a=-a/q,c.width&&c.height?(h=c.width,m=c.height):h=m=2*c.radius,this.graphics=this.graphics||{},g={x:g.x-h/2,y:g.y-m/2,width:h,height:m,rotation:a,rotationOriginX:g.x,rotationOriginY:g.y},this.graphics[b]?
this.graphics[b].animate(g):this.graphics[b]=e.symbol(c.symbol).addClass("highcharts-point-connecting-path-"+b+"-marker").attr(g).attr({fill:c.color||this.fromPoint.color,stroke:c.lineColor,"stroke-width":c.lineWidth,opacity:0}).animate({opacity:1},d.series.options.animation).add(k.group))},getPath:function(b){var c=this.pathfinder,e=this.chart,l=c.algorithms[b.type],f=c.chartObstacles;if("function"!==typeof l)a.error('"'+b.type+'" is not a Pathfinder algorithm.');else return l.requiresObstacles&&
!f&&(f=c.chartObstacles=c.getChartObstacles(b),e.options.pathfinder.algorithmMargin=b.algorithmMargin,c.chartObstacleMetrics=c.getObstacleMetrics(f)),l(this.fromPoint.getPathfinderAnchorPoint(b.startMarker),this.toPoint.getPathfinderAnchorPoint(b.endMarker),d({chartObstacles:f,lineObstacles:c.lineObstacles||[],obstacleMetrics:c.chartObstacleMetrics,hardBounds:{xMin:0,xMax:e.plotWidth,yMin:0,yMax:e.plotHeight},obstacleOptions:{margin:b.algorithmMargin},startDirectionX:c.getAlgorithmStartDirection(b.startMarker)},
b))},render:function(){var b=this.fromPoint,c=b.series,a=c.chart,l=a.pathfinder,f,a=d(a.options.pathfinder,c.options.pathfinder,b.options.pathfinder,this.options),g={};g.stroke=a.lineColor||b.color;g["stroke-width"]=a.lineWidth;a.dashStyle&&(g.dashstyle=a.dashStyle);g.class="highcharts-point-connecting-path highcharts-color-"+b.colorIndex;a=d(g,a);w(a.marker.radius)||(a.marker.radius=e(u(Math.ceil((a.algorithmMargin||8)/2)-1,1),5));b=this.getPath(a);f=b.path;b.obstacles&&(l.lineObstacles=l.lineObstacles||
[],l.lineObstacles=l.lineObstacles.concat(b.obstacles));this.renderPath(f,g,c.options.animation);this.addMarker("start",d(a.marker,a.startMarker),f);this.addMarker("end",d(a.marker,a.endMarker),f)},destroy:function(){this.graphics&&(a.objectEach(this.graphics,function(b){b.destroy()}),delete this.graphics)}};n.prototype={algorithms:v,init:function(b){this.chart=b;this.connections=[];h(b,"redraw",function(){this.pathfinder.update()})},update:function(b){var c=this.chart,e=this,d=e.connections;e.connections=
[];g(c.series,function(b){b.visible&&g(b.points,function(b){var d,f=b.options&&b.options.connect&&a.splat(b.options.connect);b.visible&&!1!==b.isInside&&f&&g(f,function(f){d=c.get("string"===typeof f?f:f.to);d instanceof a.Point&&d.series.visible&&d.visible&&!1!==d.isInside&&e.connections.push(new r(b,d,"string"===typeof f?{}:f))})})});for(var f=0,h,m,p=d.length,n=e.connections.length;f<p;++f){m=!1;for(h=0;h<n;++h)if(d[f].fromPoint===e.connections[h].fromPoint&&d[f].toPoint===e.connections[h].toPoint){e.connections[h].graphics=
d[f].graphics;m=!0;break}m||d[f].destroy()}delete this.chartObstacles;delete this.lineObstacles;e.renderConnections(b)},renderConnections:function(b){b?g(this.chart.series,function(b){var a=function(){var a=b.chart.pathfinder;g(a&&a.connections||[],function(a){a.fromPoint&&a.fromPoint.series===b&&a.render()});b.pathfinderRemoveRenderEvent&&(b.pathfinderRemoveRenderEvent(),delete b.pathfinderRemoveRenderEvent)};!1===b.options.animation?a():b.pathfinderRemoveRenderEvent=h(b,"afterAnimate",a)}):g(this.connections,
function(b){b.render()})},getChartObstacles:function(b){for(var a=[],e=this.chart.series,d=p(b.algorithmMargin,0),f,h=0,n=e.length;h<n;++h)if(e[h].visible)for(var q=0,r=e[h].points.length,u;q<r;++q)u=e[h].points[q],u.visible&&(u=m(u))&&a.push({xMin:u.xMin-d,xMax:u.xMax+d,yMin:u.yMin-d,yMax:u.yMax+d});a=a.sort(function(b,a){return b.xMin-a.xMin});w(b.algorithmMargin)||(f=b.algorithmMargin=t(a),g(a,function(b){b.xMin-=f;b.xMax+=f;b.yMin-=f;b.yMax+=f}));return a},getObstacleMetrics:function(b){for(var a=
0,e=0,d,f,g=b.length;g--;)d=b[g].xMax-b[g].xMin,f=b[g].yMax-b[g].yMin,a<d&&(a=d),e<f&&(e=f);return{maxHeight:e,maxWidth:a}},getAlgorithmStartDirection:function(b){var a="top"!==b.verticalAlign&&"bottom"!==b.verticalAlign;return"left"!==b.align&&"right"!==b.align?a?void 0:!1:a?!0:void 0}};a.Connection=r;a.Pathfinder=n;y(a.Point.prototype,{getPathfinderAnchorPoint:function(b){var a=m(this),e,d;switch(b.align){case "right":e="xMax";break;case "left":e="xMin"}switch(b.verticalAlign){case "top":d="yMin";
break;case "bottom":d="yMax"}return{x:e?a[e]:(a.xMin+a.xMax)/2,y:d?a[d]:(a.yMin+a.yMax)/2}},getRadiansToVector:function(b,a){w(a)||(a=m(this),a={x:(a.xMin+a.xMax)/2,y:(a.yMin+a.yMax)/2});return Math.atan2(a.y-b.y,b.x-a.x)},getMarkerVector:function(b,a,e){for(var c=2*Math.PI,d=m(this),g=d.xMax-d.xMin,k=d.yMax-d.yMin,h=Math.atan2(k,g),p=!1,g=g/2,n=k/2,q=d.xMin+g,d=d.yMin+n,r=q,u=d,t={},v=1,w=1;b<-Math.PI;)b+=c;for(;b>Math.PI;)b-=c;c=Math.tan(b);b>-h&&b<=h?(w=-1,p=!0):b>h&&b<=Math.PI-h?w=-1:b>Math.PI-
h||b<=-(Math.PI-h)?(v=-1,p=!0):v=-1;p?(r+=v*g,u+=w*g*c):(r+=k/(2*c)*v,u+=w*n);e.x!==q&&(r=e.x);e.y!==d&&(u=e.y);t.x=r+a*Math.cos(b);t.y=u-a*Math.sin(b);return t}});a.Chart.prototype.callbacks.push(function(b){!1!==b.options.pathfinder.enabled&&(this.pathfinder=new n(this),this.pathfinder.update(!0))})})(D,M);(function(a){var v=a.addEvent,m=a.defined,t=a.Color,r=a.seriesTypes.column,n=a.each,w=a.isNumber,q=a.isObject,y=a.merge,g=a.pick,h=a.seriesType,d=a.Axis,p=a.Point,u=a.Series;h("xrange","column",
{colorByPoint:!0,dataLabels:{verticalAlign:"middle",inside:!0,formatter:function(){var a=this.point.partialFill;q(a)&&(a=a.amount);m(a)||(a=0);return 100*a+"%"}},tooltip:{headerFormat:'\x3cspan style\x3d"font-size: 0.85em"\x3e{point.x} - {point.x2}\x3c/span\x3e\x3cbr/\x3e',pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e {series.name}: \x3cb\x3e{point.yCategory}\x3c/b\x3e\x3cbr/\x3e'},borderRadius:3,pointRange:0},{type:"xrange",parallelArrays:["x","x2","y"],requireSorting:!1,
animate:a.seriesTypes.line.prototype.animate,cropShoulder:1,getExtremesFromAll:!0,autoIncrement:a.noop,getColumnMetrics:function(){function a(){n(c.series,function(b){var a=b.xAxis;b.xAxis=b.yAxis;b.yAxis=a})}var b,c=this.chart;a();b=r.prototype.getColumnMetrics.call(this);a();return b},cropData:function(a,b,c,d){b=u.prototype.cropData.call(this,this.x2Data,b,c,d);b.xData=a.slice(b.start,b.end);return b},translatePoint:function(a){var b=this.xAxis,c=this.yAxis,e=this.columnMetrics,d=this.options,
f=d.minPointLength||0,h=a.plotX,p=g(a.x2,a.x+(a.len||0)),n=b.translate(p,0,0,0,1),p=Math.abs(n-h),r=this.chart.inverted,u=g(d.borderWidth,1)%2/2,t=e.offset,v=Math.round(e.width);f&&(f-=p,0>f&&(f=0),h-=f/2,n+=f/2);h=Math.max(h,-10);n=Math.min(Math.max(n,-10),b.len+10);m(a.options.pointWidth)&&(t-=(Math.ceil(a.options.pointWidth)-v)/2,v=Math.ceil(a.options.pointWidth));d.pointPlacement&&w(a.plotY)&&c.categories&&(a.plotY=c.translate(a.y,0,1,0,1,d.pointPlacement));a.shapeArgs={x:Math.floor(Math.min(h,
n))+u,y:Math.floor(a.plotY+t)+u,width:Math.round(Math.abs(n-h)),height:v,r:this.options.borderRadius};d=a.shapeArgs.x;f=d+a.shapeArgs.width;0>d||f>b.len?(d=Math.min(b.len,Math.max(0,d)),f=Math.max(0,Math.min(f,b.len)),b=f-d,a.dlBox=y(a.shapeArgs,{x:d,width:f-d,centerX:b?b/2:null})):a.dlBox=null;a.tooltipPos[0]+=r?0:p/2;a.tooltipPos[1]-=r?-p/2:e.width/2;if(b=a.partialFill)q(b)&&(b=b.amount),w(b)||(b=0),e=a.shapeArgs,a.partShapeArgs={x:e.x,y:e.y,width:e.width,height:e.height,r:this.options.borderRadius},
a.clipRectArgs={x:e.x,y:e.y,width:Math.max(Math.round(p*b+(a.plotX-h)),0),height:e.height};c.categories&&(a.category=c.categories[a.y])},translate:function(){r.prototype.translate.apply(this,arguments);n(this.points,function(a){this.translatePoint(a)},this)},drawPoint:function(a,b){var c=this.options,e=this.chart.renderer,d=a.graphic,f=a.shapeType,g=a.shapeArgs,h=a.partShapeArgs,m=a.clipRectArgs,p=a.partialFill,n=a.selected&&"select",r=c.stacking&&!c.borderRadius;if(a.isNull)d&&(a.graphic=d.destroy());
else{if(d)a.graphicOriginal[b](y(g));else a.graphic=d=e.g("point").addClass(a.getClassName()).add(a.group||this.group),a.graphicOriginal=e[f](g).addClass(a.getClassName()).addClass("highcharts-partfill-original").add(d);h&&(a.graphicOverlay?(a.graphicOverlay[b](y(h)),a.clipRect.animate(y(m))):(a.clipRect=e.clipRect(m.x,m.y,m.width,m.height),a.graphicOverlay=e[f](h).addClass("highcharts-partfill-overlay").add(d).clip(a.clipRect)));a.graphicOriginal.attr(this.pointAttribs(a,n)).shadow(c.shadow,null,
r);h&&(q(p)||(p={}),q(c.partialFill)&&(p=y(p,c.partialFill)),b=p.fill||t(a.color||this.color).brighten(-.3).get(),a.graphicOverlay.attr(this.pointAttribs(a,n)).attr({fill:b}).shadow(c.shadow,null,r))}},drawPoints:function(){var a=this,b=a.getAnimationVerb();n(a.points,function(c){a.drawPoint(c,b)})},getAnimationVerb:function(){return this.chart.pointCount<(this.options.animationLimit||250)?"animate":"attr"}},{applyOptions:function(){var a,b=p.prototype.applyOptions.apply(this,arguments),c=b.series;
c.options.colorByPoint&&!b.options.color&&(a=c.options.colors||c.chart.options.colors,c=b.y%(a?a.length:c.chart.options.chart.colorCount),a=a&&a[c],b.color=a,b.options.colorIndex||(b.colorIndex=c));return b},init:function(){p.prototype.init.apply(this,arguments);this.y||(this.y=0);return this},setState:function(){p.prototype.setState.apply(this,arguments);this.series.drawPoint(this,this.series.getAnimationVerb())},getLabelConfig:function(){var a=p.prototype.getLabelConfig.call(this),b=this.series.yAxis.categories;
a.x2=this.x2;a.yCategory=this.yCategory=b&&b[this.y];return a},tooltipDateKeys:["x","x2"],isValid:function(){return"number"===typeof this.x&&"number"===typeof this.x2}});v(d,"afterGetSeriesExtremes",function(){var a=this.series,b,c;this.isXAxis&&(b=g(this.dataMax,-Number.MAX_VALUE),n(a,function(a){a.x2Data&&n(a.x2Data,function(a){a>b&&(b=a,c=!0)})}),c&&(this.dataMax=b))})})(D);(function(a){var v=a.dateFormat,m=a.isObject,t=a.isNumber,r=a.merge,n=a.pick,w=a.seriesType,q=a.stop,y=a.seriesTypes.xrange;
w("gantt","xrange",{grouping:!1,dataLabels:{enabled:!0,formatter:function(){var a=this.point.partialFill;m(a)&&(a=a.amount);if(t(a)&&0<a)return 100*a+"%"}},tooltip:{headerFormat:'\x3cspan style\x3d"color:{point.color};text-align:right"\x3e{series.name}\x3c/span\x3e\x3cbr/\x3e',pointFormat:null,pointFormatter:function(){var g=this.series,h=g.chart.tooltip,d=g.xAxis,m=d.options.dateTimeLabelFormats,n=d.options.startOfWeek,e=g.tooltipOptions,b=e.xDateFormat,c=this.end?this.end-this.start:0,g=this.options.milestone,
d="\x3cb\x3e"+(this.name||this.category)+"\x3c/b\x3e";if(e.pointFormat)return this.tooltipFormatter(e.pointFormat);b||(b=a.splat(h.getDateFormat(c,this.start,n,m))[0]);h=v(b,this.start);m=v(b,this.end);d+="\x3cbr/\x3e";return g?d+('\x3cspan style\x3d"font-size: 0.8em"\x3eDate '+h+"\x3c/span\x3e\x3cbr/\x3e"):d+('\x3cspan style\x3d"font-size: 0.8em"\x3eStart: '+h+"\x3c/span\x3e\x3cbr/\x3e")+('\x3cspan style\x3d"font-size: 0.8em"\x3eEnd: '+m+"\x3c/span\x3e\x3cbr/\x3e")}},pathfinder:{type:"simpleConnect",
animation:{reversed:!0},startMarker:{enabled:!0,symbol:"arrow-filled",radius:4,fill:"#fa0",align:"left"},endMarker:{enabled:!1,align:"right"}}},{keyboardMoveVertical:!1,translatePoint:function(a){var g,d;y.prototype.translatePoint.call(this,a);a.options.milestone&&(g=a.shapeArgs,d=g.height,a.shapeArgs={x:g.x-d/2,y:g.y,width:d,height:d})},drawPoint:function(a,h){var d=this.options,g=this.chart.renderer,m=a.shapeArgs,e=a.plotY,b=a.graphic,c=a.selected&&"select",k=d.stacking&&!d.borderRadius;a.options.milestone?
t(e)&&null!==a.y?(m=g.symbols.diamond(m.x,m.y,m.width,m.height),b?(q(b),b[h]({d:m})):a.graphic=g.path(m).addClass(a.getClassName(),!0).add(a.group||this.group),a.graphic.attr(this.pointAttribs(a,c)).shadow(d.shadow,null,k)):b&&(a.graphic=b.destroy()):y.prototype.drawPoint.call(this,a,h)},setData:a.Series.prototype.setData,setGanttPointAliases:function(a){function g(d,g){void 0!==g&&(a[d]=g)}g("x",n(a.start,a.x));g("x2",n(a.end,a.x2));g("partialFill",n(a.completed,a.partialFill));g("connect",n(a.dependency,
a.connect))}},r(y.prototype.pointClass.prototype,{applyOptions:function(a,h){var d=this.series;a=r(a);d.setGanttPointAliases(a);return a=y.prototype.pointClass.prototype.applyOptions.call(this,a,h)}}))})(D);(function(a){var v=a.each,m=a.map,t=a.merge,r=a.splat,n=a.Chart;a.ganttChart=function(w,q,y){var g="string"===typeof w||w.nodeName,h=q.series,d=a.getOptions(),p;q=arguments[g?1:0];a.isArray(q.xAxis)||(q.xAxis=[q.xAxis||{},{}]);q.xAxis=m(q.xAxis,function(a,e){1===e&&(p=0);return t(d.xAxis,{grid:{enabled:!0},
opposite:!0,linkedTo:p},a,{type:"datetime"})});q.yAxis=m(r(q.yAxis||{}),function(a){return t(d.yAxis,{grid:{enabled:!0},staticScale:50,reversed:!0,type:a.categories?a.type:"treegrid"},a)});q.series=null;q=t({chart:{type:"gantt"},title:{text:null},legend:{enabled:!1}},q);q.series=h;v(q.series,function(d){v(d.data,function(d){a.seriesTypes.gantt.prototype.setGanttPointAliases(d)})});return g?new n(w,q,y):new n(q,q)}})(D)});
//# sourceMappingURL=gantt.js.map