/*
 Highcharts JS v7.2.0 (2019-09-03)

 ColorAxis module

 (c) 2012-2019 Pawel Potaczek

 License: www.highcharts.com/license
*/
(function(k){"object"===typeof module&&module.exports?(k["default"]=k,module.exports=k):"function"===typeof define&&define.amd?define("highcharts/modules/color-axis",["highcharts"],function(m){k(m);k.Highcharts=m;return k}):k("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(k){function m(d,f,k,z){d.hasOwnProperty(f)||(d[f]=z.apply(null,k))}var n=k?k._modules:{};m(n,"parts-map/ColorSeriesMixin.js",[n["parts/Globals.js"]],function(d){d.colorPointMixin={setVisible:function(d){var f=this,
k=d?"show":"hide";f.visible=!!d;["graphic","dataLabel"].forEach(function(d){if(f[d])f[d][k]()})}};d.colorSeriesMixin={optionalAxis:"colorAxis",colorAxis:0,translateColors:function(){var d=this,k=this.options.nullColor,m=this.colorAxis,n=this.colorKey;(this.data.length?this.data:this.points).forEach(function(f){var l=f[n];if(l=f.options.color||(f.isNull?k:m&&void 0!==l?m.toColor(l,f):f.color||d.color))f.color=l})}}});m(n,"parts-map/ColorAxis.js",[n["parts/Globals.js"],n["parts/Utilities.js"]],function(d,
f){var m=f.erase,n=f.isNumber,A=f.splat;f=d.addEvent;var l=d.Axis,B=d.Chart,t=d.Series,C=d.Point,q=d.color,r=d.extend,v=d.Legend,D=d.LegendSymbolMixin,E=d.colorPointMixin,y=d.noop,w=d.merge,p=d.pick;r(t.prototype,d.colorSeriesMixin);r(C.prototype,E);var x=d.ColorAxis=function(){this.init.apply(this,arguments)};r(x.prototype,l.prototype);r(x.prototype,{defaultColorAxisOptions:{lineWidth:0,minPadding:0,maxPadding:0,gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},
width:.01,color:"#999999"},labels:{overflow:"justify",rotation:0},minColor:"#e6ebf5",maxColor:"#003399",tickLength:5,showInLegend:!0},keepProps:["legendGroup","legendItemHeight","legendItemWidth","legendItem","legendSymbol"].concat(l.prototype.keepProps),init:function(a,b){this.coll="colorAxis";var e=this.buildOptions.call(a,this.defaultColorAxisOptions,b);l.prototype.init.call(this,a,e);b.dataClasses&&this.initDataClasses(b);this.initStops();this.horiz=!e.opposite;this.zoomEnabled=!1;this.defaultLegendLength=
200},initDataClasses:function(a){var b=this.chart,e,c=0,g=b.options.chart.colorCount,d=this.options,h=a.dataClasses.length;this.dataClasses=e=[];this.legendItems=[];a.dataClasses.forEach(function(a,u){a=w(a);e.push(a);if(b.styledMode||!a.color)"category"===d.dataClassColor?(b.styledMode||(u=b.options.colors,g=u.length,a.color=u[c]),a.colorIndex=c,c++,c===g&&(c=0)):a.color=q(d.minColor).tweenTo(q(d.maxColor),2>h?.5:u/(h-1))})},hasData:function(){return!(!this.tickPositions||!this.tickPositions.length)},
setTickPositions:function(){if(!this.dataClasses)return l.prototype.setTickPositions.call(this)},initStops:function(){this.stops=this.options.stops||[[0,this.options.minColor],[1,this.options.maxColor]];this.stops.forEach(function(a){a.color=q(a[1])})},buildOptions:function(a,b){var e=this.options.legend,c=b.layout?"vertical"!==b.layout:"vertical"!==e.layout;return w(a,{side:c?2:1,reversed:!c},b,{opposite:!c,showEmpty:!1,title:null,visible:e.enabled&&(b?!1!==b.visible:!0)})},setOptions:function(a){l.prototype.setOptions.call(this,
a);this.options.crosshair=this.options.marker},setAxisSize:function(){var a=this.legendSymbol,b=this.chart,e=b.options.legend||{},c,g;a?(this.left=e=a.attr("x"),this.top=c=a.attr("y"),this.width=g=a.attr("width"),this.height=a=a.attr("height"),this.right=b.chartWidth-e-g,this.bottom=b.chartHeight-c-a,this.len=this.horiz?g:a,this.pos=this.horiz?e:c):this.len=(this.horiz?e.symbolWidth:e.symbolHeight)||this.defaultLegendLength},normalizedValue:function(a){this.isLog&&(a=this.val2lin(a));return 1-(this.max-
a)/(this.max-this.min||1)},toColor:function(a,b){var e=this.stops,c=this.dataClasses,g;if(c)for(g=c.length;g--;){var d=c[g];var h=d.from;e=d.to;if((void 0===h||a>=h)&&(void 0===e||a<=e)){var f=d.color;b&&(b.dataClass=g,b.colorIndex=d.colorIndex);break}}else{a=this.normalizedValue(a);for(g=e.length;g--&&!(a>e[g][0]););h=e[g]||e[g+1];e=e[g+1]||h;a=1-(e[0]-a)/(e[0]-h[0]||1);f=h.color.tweenTo(e.color,a)}return f},getOffset:function(){var a=this.legendGroup,b=this.chart.axisOffset[this.side];a&&(this.axisParent=
a,l.prototype.getOffset.call(this),this.added||(this.added=!0,this.labelLeft=0,this.labelRight=this.width),this.chart.axisOffset[this.side]=b)},setLegendColor:function(){var a=this.reversed;var b=a?1:0;a=a?0:1;b=this.horiz?[b,0,a,0]:[0,a,0,b];this.legendColor={linearGradient:{x1:b[0],y1:b[1],x2:b[2],y2:b[3]},stops:this.stops}},drawLegendSymbol:function(a,b){var e=a.padding,c=a.options,g=this.horiz,d=p(c.symbolWidth,g?this.defaultLegendLength:12),h=p(c.symbolHeight,g?12:this.defaultLegendLength),f=
p(c.labelPadding,g?16:30);c=p(c.itemDistance,10);this.setLegendColor();b.legendSymbol=this.chart.renderer.rect(0,a.baseline-11,d,h).attr({zIndex:1}).add(b.legendGroup);this.legendItemWidth=d+e+(g?c:f);this.legendItemHeight=h+e+(g?f:0)},setState:function(a){this.series.forEach(function(b){b.setState(a)})},visible:!0,setVisible:y,getSeriesExtremes:function(){var a=this.series,b=a.length,e;this.dataMin=Infinity;for(this.dataMax=-Infinity;b--;){var c=a[b];var g=c.colorKey=p(c.options.colorKey,c.colorKey,
c.pointValKey,c.zoneAxis,"y");var d=c.pointArrayMap;var h=c[g+"Min"]&&c[g+"Max"];if(c[g+"Data"])var f=c[g+"Data"];else if(d){f=[];d=d.indexOf(g);var l=c.yData;if(0<=d&&l)for(e=0;e<l.length;e++)f.push(p(l[e][d],l[e]))}else f=c.yData;h?(c.minColorValue=c[g+"Min"],c.maxColorValue=c[g+"Max"]):(t.prototype.getExtremes.call(c,f),c.minColorValue=c.dataMin,c.maxColorValue=c.dataMax);void 0!==c.minColorValue&&(this.dataMin=Math.min(this.dataMin,c.minColorValue),this.dataMax=Math.max(this.dataMax,c.maxColorValue));
h||k.Series.prototype.getExtremes.call(c)}},drawCrosshair:function(a,b){var e=b&&b.plotX,c=b&&b.plotY,d=this.pos,f=this.len;if(b){var h=this.toPixels(b[b.series.colorKey]);h<d?h=d-2:h>d+f&&(h=d+f+2);b.plotX=h;b.plotY=this.len-h;l.prototype.drawCrosshair.call(this,a,b);b.plotX=e;b.plotY=c;this.cross&&!this.cross.addedToColorAxis&&this.legendGroup&&(this.cross.addClass("highcharts-coloraxis-marker").add(this.legendGroup),this.cross.addedToColorAxis=!0,this.chart.styledMode||this.cross.attr({fill:this.crosshair.color}))}},
getPlotLinePath:function(a){var b=a.translatedValue;return n(b)?this.horiz?["M",b-4,this.top-6,"L",b+4,this.top-6,b,this.top,"Z"]:["M",this.left,b,"L",this.left-6,b+6,this.left-6,b-6,"Z"]:l.prototype.getPlotLinePath.apply(this,arguments)},update:function(a,b){var e=this.chart,c=e.legend,d=this.buildOptions.call(e,{},a);this.series.forEach(function(a){a.isDirtyData=!0});(a.dataClasses&&c.allItems||this.dataClasses)&&this.destroyItems();e.options[this.coll]=w(this.userOptions,d);l.prototype.update.call(this,
d,b);this.legendItem&&(this.setLegendColor(),c.colorizeItem(this,!0))},destroyItems:function(){var a=this.chart;this.legendItem?a.legend.destroyItem(this):this.legendItems&&this.legendItems.forEach(function(b){a.legend.destroyItem(b)});a.isDirtyLegend=!0},remove:function(a){this.destroyItems();l.prototype.remove.call(this,a)},getDataClassLegendSymbols:function(){var a=this,b=this.chart,e=this.legendItems,c=b.options.legend,g=c.valueDecimals,f=c.valueSuffix||"",h;e.length||this.dataClasses.forEach(function(c,
l){var k=!0,m=c.from,n=c.to;h="";void 0===m?h="< ":void 0===n&&(h="> ");void 0!==m&&(h+=d.numberFormat(m,g)+f);void 0!==m&&void 0!==n&&(h+=" - ");void 0!==n&&(h+=d.numberFormat(n,g)+f);e.push(r({chart:b,name:h,options:{},drawLegendSymbol:D.drawRectangle,visible:!0,setState:y,isDataClass:!0,setVisible:function(){k=this.visible=!k;a.series.forEach(function(a){a.points.forEach(function(a){a.dataClass===l&&a.setVisible(k)})});b.legend.colorizeItem(this,k)}},c))});return e},beforePadding:!1,name:""});
["fill","stroke"].forEach(function(a){d.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,q(this.start).tweenTo(q(this.end),this.pos),null,!0)}});f(B,"afterGetAxes",function(){var a=this,b=a.options;this.colorAxis=[];b.colorAxis&&(b.colorAxis=A(b.colorAxis),b.colorAxis.forEach(function(b,c){b.index=c;new x(a,b)}))});f(t,"bindAxes",function(){var a=this.axisTypes;a?-1===a.indexOf("colorAxis")&&a.push("colorAxis"):this.axisTypes=["colorAxis"]});f(v,"afterGetAllItems",function(a){var b=[],d,c;(this.chart.colorAxis||
[]).forEach(function(c){(d=c.options)&&d.showInLegend&&(d.dataClasses&&d.visible?b=b.concat(c.getDataClassLegendSymbols()):d.visible&&b.push(c),c.series.forEach(function(b){if(!b.options.showInLegend||d.dataClasses)"point"===b.options.legendType?b.points.forEach(function(b){m(a.allItems,b)}):m(a.allItems,b)}))});for(c=b.length;c--;)a.allItems.unshift(b[c])});f(v,"afterColorizeItem",function(a){a.visible&&a.item.legendColor&&a.item.legendSymbol.attr({fill:a.item.legendColor})});f(v,"afterUpdate",function(){var a=
this.chart.colorAxis;a&&a.forEach(function(a,d,c){a.update({},c)})});f(t,"afterTranslate",function(){(this.chart.colorAxis&&this.chart.colorAxis.length||this.colorAttribs)&&this.translateColors()})});m(n,"masters/modules/coloraxis.src.js",[],function(){})});
//# sourceMappingURL=coloraxis.js.map