/*
 Highcharts JS v8.1.0 (2020-05-05)

 ColorAxis module

 (c) 2012-2019 Pawel Potaczek

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