/*
 Highcharts JS v7.0.1 (2018-12-19)

 (c) 2009-2018 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(g){"object"===typeof module&&module.exports?module.exports=g:"function"===typeof define&&define.amd?define(function(){return g}):g("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(g){(function(f){function g(){return Array.prototype.slice.call(arguments,1)}function t(b){b.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,p(this.pointArrayMap,["y"]))}var m=f.addEvent,p=f.pick,r=f.wrap,w=f.extend,x=f.isArray,u=f.fireEvent,n=f.Axis,y=f.Series;w(n.prototype,
{isInBreak:function(b,c){var d=b.repeat||Infinity,e=b.from,a=b.to-b.from;c=c>=e?(c-e)%d:d-(e-c)%d;return b.inclusive?c<=a:c<a&&0!==c},isInAnyBreak:function(b,c){var d=this.options.breaks,e=d&&d.length,a,h,k;if(e){for(;e--;)this.isInBreak(d[e],b)&&(a=!0,h||(h=p(d[e].showPoints,this.isXAxis?!1:!0)));k=a&&c?a&&!h:a}return k}});m(n,"afterInit",function(){"function"===typeof this.setBreaks&&this.setBreaks(this.options.breaks,!1)});m(n,"afterSetTickPositions",function(){if(this.isBroken){var b=this.tickPositions,
c=this.tickPositions.info,d=[],e;for(e=0;e<b.length;e++)this.isInAnyBreak(b[e])||d.push(b[e]);this.tickPositions=d;this.tickPositions.info=c}});m(n,"afterSetOptions",function(){this.isBroken&&(this.options.ordinal=!1)});n.prototype.setBreaks=function(b,c){function d(b){var e=b,c,d;for(d=0;d<a.breakArray.length;d++)if(c=a.breakArray[d],c.to<=b)e-=c.len;else if(c.from>=b)break;else if(a.isInBreak(c,b)){e-=b-c.from;break}return e}function e(b){var c,d;for(d=0;d<a.breakArray.length&&!(c=a.breakArray[d],
c.from>=b);d++)c.to<b?b+=c.len:a.isInBreak(c,b)&&(b+=c.len);return b}var a=this,h=x(b)&&!!b.length;a.isDirty=a.isBroken!==h;a.isBroken=h;a.options.breaks=a.userOptions.breaks=b;a.forceRedraw=!0;h||a.val2lin!==d||(delete a.val2lin,delete a.lin2val);h&&(a.userOptions.ordinal=!1,a.val2lin=d,a.lin2val=e,a.setExtremes=function(a,b,c,d,e){if(this.isBroken){for(;this.isInAnyBreak(a);)a-=this.closestPointRange;for(;this.isInAnyBreak(b);)b-=this.closestPointRange}n.prototype.setExtremes.call(this,a,b,c,d,
e)},a.setAxisTranslation=function(b){n.prototype.setAxisTranslation.call(this,b);this.unitLength=null;if(this.isBroken){b=a.options.breaks;var c=[],d=[],e=0,h,f,k=a.userMin||a.min,g=a.userMax||a.max,m=p(a.pointRangePadding,0),l,q;b.forEach(function(b){f=b.repeat||Infinity;a.isInBreak(b,k)&&(k+=b.to%f-k%f);a.isInBreak(b,g)&&(g-=g%f-b.from%f)});b.forEach(function(a){l=a.from;for(f=a.repeat||Infinity;l-f>k;)l-=f;for(;l<k;)l+=f;for(q=l;q<g;q+=f)c.push({value:q,move:"in"}),c.push({value:q+(a.to-a.from),
move:"out",size:a.breakSize})});c.sort(function(a,b){return a.value===b.value?("in"===a.move?0:1)-("in"===b.move?0:1):a.value-b.value});h=0;l=k;c.forEach(function(a){h+="in"===a.move?1:-1;1===h&&"in"===a.move&&(l=a.value);0===h&&(d.push({from:l,to:a.value,len:a.value-l-(a.size||0)}),e+=a.value-l-(a.size||0))});a.breakArray=d;a.unitLength=g-k-e+m;u(a,"afterBreaks");a.staticScale?a.transA=a.staticScale:a.unitLength&&(a.transA*=(g-a.min+m)/a.unitLength);m&&(a.minPixelPadding=a.transA*a.minPointOffset);
a.min=k;a.max=g}});p(c,!0)&&this.chart.redraw()};r(y.prototype,"generatePoints",function(b){b.apply(this,g(arguments));var c=this.xAxis,d=this.yAxis,e=this.points,a,h=e.length,f=this.options.connectNulls,v;if(c&&d&&(c.options.breaks||d.options.breaks))for(;h--;)a=e[h],v=null===a.y&&!1===f,v||!c.isInAnyBreak(a.x,!0)&&!d.isInAnyBreak(a.y,!0)||(e.splice(h,1),this.data[h]&&this.data[h].destroyElements())});f.Series.prototype.drawBreaks=function(b,c){var d=this,e=d.points,a,f,k,g;b&&c.forEach(function(c){a=
b.breakArray||[];f=b.isXAxis?b.min:p(d.options.threshold,b.min);e.forEach(function(d){g=p(d["stack"+c.toUpperCase()],d[c]);a.forEach(function(a){k=!1;if(f<a.from&&g>a.to||f>a.from&&g<a.from)k="pointBreak";else if(f<a.from&&g>a.from&&g<a.to||f>a.from&&g>a.to&&g<a.from)k="pointInBreak";k&&u(b,k,{point:d,brk:a})})})})};f.Series.prototype.gappedPath=function(){var b=this.currentDataGrouping,c=b&&b.totalRange,b=this.options.gapSize,d=this.points.slice(),e=d.length-1,a=this.yAxis;if(b&&0<e)for("value"!==
this.options.gapUnit&&(b*=this.closestPointRange),c&&c>b&&(b=c);e--;)d[e+1].x-d[e].x>b&&(c=(d[e].x+d[e+1].x)/2,d.splice(e+1,0,{isNull:!0,x:c}),this.options.stacking&&(c=a.stacks[this.stackKey][c]=new f.StackItem(a,a.options.stackLabels,!1,c,this.stack),c.total=0));return this.getGraphPath(d)};r(f.seriesTypes.column.prototype,"drawPoints",t);r(f.Series.prototype,"drawPoints",t)})(g)});
//# sourceMappingURL=broken-axis.js.map
