/*
 Highcharts JS v11.1.0 (2023-06-05)

 ColorAxis module

 (c) 2012-2021 Pawel Potaczek

 License: www.highcharts.com/license
*/
'use strict';(function(c){"object"===typeof module&&module.exports?(c["default"]=c,module.exports=c):"function"===typeof define&&define.amd?define("highcharts/modules/color-axis",["highcharts"],function(n){c(n);c.Highcharts=n;return c}):c("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(c){function n(c,m,u,r){c.hasOwnProperty(m)||(c[m]=r.apply(null,u),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:m,module:c[m]}})))}c=c?c._modules:
{};n(c,"Core/Axis/Color/ColorAxisComposition.js",[c["Core/Color/Color.js"],c["Core/Utilities.js"]],function(c,m){const {parse:l}=c,{addEvent:r,extend:n,merge:y,pick:z,splat:B}=m;var t;(function(c){function t(){const a=this.options;this.colorAxis=[];a.colorAxis&&(a.colorAxis=B(a.colorAxis),a.colorAxis.forEach(a=>{new e(this,a)}))}function u(a){const b=b=>{b=a.allItems.indexOf(b);-1!==b&&(this.destroyItem(a.allItems[b]),a.allItems.splice(b,1))};let d=[],g,f;(this.chart.colorAxis||[]).forEach(function(a){(g=
a.options)&&g.showInLegend&&(g.dataClasses&&g.visible?d=d.concat(a.getDataClassLegendSymbols()):g.visible&&d.push(a),a.series.forEach(function(a){if(!a.options.showInLegend||g.dataClasses)"point"===a.options.legendType?a.points.forEach(function(a){b(a)}):b(a)}))});for(f=d.length;f--;)a.allItems.unshift(d[f])}function x(a){a.visible&&a.item.legendColor&&a.item.legendItem.symbol.attr({fill:a.item.legendColor})}function q(){const a=this.chart.colorAxis;a&&a.forEach(function(a,b,d){a.update({},d)})}function p(){(this.chart.colorAxis&&
this.chart.colorAxis.length||this.colorAttribs)&&this.translateColors()}function b(){const a=this.axisTypes;a?-1===a.indexOf("colorAxis")&&a.push("colorAxis"):this.axisTypes=["colorAxis"]}function a(a){const b=this,d=a?"show":"hide";b.visible=b.options.visible=!!a;["graphic","dataLabel"].forEach(function(a){if(b[a])b[a][d]()});this.series.buildKDTree()}function f(){const a=this,b=this.options.nullColor,d=this.colorAxis,f=this.colorKey;(this.data.length?this.data:this.points).forEach(e=>{var g=e.getNestedProperty(f);
(g=e.options.color||(e.isNull||null===e.value?b:d&&"undefined"!==typeof g?d.toColor(g,e):e.color||a.color))&&e.color!==g&&(e.color=g,"point"===a.options.legendType&&e.legendItem&&e.legendItem.label&&a.chart.legend.colorizeItem(e,e.visible))})}function d(a){const b=a.prototype.createAxis;a.prototype.createAxis=function(a,d){if("colorAxis"!==a)return b.apply(this,arguments);const f=new e(this,y(d.axis,{index:this[a].length,isX:!1}));this.isDirtyLegend=!0;this.axes.forEach(function(a){a.series=[]});
this.series.forEach(function(a){a.bindAxes();a.isDirtyData=!0});z(d.redraw,!0)&&this.redraw(d.animation);return f}}function E(){this.elem.attr("fill",l(this.start).tweenTo(l(this.end),this.pos),void 0,!0)}function k(){this.elem.attr("stroke",l(this.start).tweenTo(l(this.end),this.pos),void 0,!0)}const h=[];let e;c.compose=function(g,c,l,w,v){e||(e=g);m.pushUnique(h,c)&&(g=c.prototype,g.collectionsWithUpdate.push("colorAxis"),g.collectionsWithInit.colorAxis=[g.addColorAxis],r(c,"afterGetAxes",t),d(c));
m.pushUnique(h,l)&&(c=l.prototype,c.fillSetter=E,c.strokeSetter=k);m.pushUnique(h,w)&&(r(w,"afterGetAllItems",u),r(w,"afterColorizeItem",x),r(w,"afterUpdate",q));m.pushUnique(h,v)&&(n(v.prototype,{optionalAxis:"colorAxis",translateColors:f}),n(v.prototype.pointClass.prototype,{setVisible:a}),r(v,"afterTranslate",p,{order:1}),r(v,"bindAxes",b))};c.pointSetVisible=a})(t||(t={}));return t});n(c,"Core/Axis/Color/ColorAxisDefaults.js",[],function(){return{lineWidth:0,minPadding:0,maxPadding:0,gridLineColor:"#ffffff",
gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},width:.01,color:"#999999"},labels:{distance:8,overflow:"justify",rotation:0},minColor:"#e6e9ff",maxColor:"#0022ff",tickLength:5,showInLegend:!0}});n(c,"Core/Axis/Color/ColorAxis.js",[c["Core/Axis/Axis.js"],c["Core/Color/Color.js"],c["Core/Axis/Color/ColorAxisComposition.js"],c["Core/Axis/Color/ColorAxisDefaults.js"],c["Core/Legend/LegendSymbol.js"],c["Core/Series/SeriesRegistry.js"],c["Core/Utilities.js"]],
function(c,m,n,r,A,y,z){const {parse:l}=m,{series:t}=y,{extend:u,isArray:C,isNumber:D,merge:x,pick:q}=z;class p extends c{static compose(b,a,f,d){n.compose(p,b,a,f,d)}constructor(b,a){super(b,a);this.beforePadding=!1;this.chart=void 0;this.coll="colorAxis";this.stops=this.options=this.dataClasses=void 0;this.visible=!0;this.init(b,a)}init(b,a){var f=b.options.legend||{};const d=a.layout?"vertical"!==a.layout:"vertical"!==f.layout,c=a.visible;f=x(p.defaultColorAxisOptions,a,{showEmpty:!1,title:null,
visible:f.enabled&&!1!==c});this.side=a.side||d?2:1;this.reversed=a.reversed||!d;this.opposite=!d;super.init(b,f,"colorAxis");this.userOptions=a;C(b.userOptions.colorAxis)&&(b.userOptions.colorAxis[this.index]=a);a.dataClasses&&this.initDataClasses(a);this.initStops();this.horiz=d;this.zoomEnabled=!1}initDataClasses(b){const a=this.chart,f=this.legendItem=this.legendItem||{},d=b.dataClasses.length,c=this.options;let k,h=0,e=a.options.chart.colorCount;this.dataClasses=k=[];f.labels=[];(b.dataClasses||
[]).forEach(function(b,f){b=x(b);k.push(b);if(a.styledMode||!b.color)"category"===c.dataClassColor?(a.styledMode||(f=a.options.colors,e=f.length,b.color=f[h]),b.colorIndex=h,h++,h===e&&(h=0)):b.color=l(c.minColor).tweenTo(l(c.maxColor),2>d?.5:f/(d-1))})}hasData(){return!!(this.tickPositions||[]).length}setTickPositions(){if(!this.dataClasses)return super.setTickPositions()}initStops(){this.stops=this.options.stops||[[0,this.options.minColor],[1,this.options.maxColor]];this.stops.forEach(function(b){b.color=
l(b[1])})}setOptions(b){super.setOptions(b);this.options.crosshair=this.options.marker}setAxisSize(){var b=this.legendItem&&this.legendItem.symbol;const a=this.chart;var f=a.options.legend||{};let d,c;b?(this.left=f=b.attr("x"),this.top=d=b.attr("y"),this.width=c=b.attr("width"),this.height=b=b.attr("height"),this.right=a.chartWidth-f-c,this.bottom=a.chartHeight-d-b,this.len=this.horiz?c:b,this.pos=this.horiz?f:d):this.len=(this.horiz?f.symbolWidth:f.symbolHeight)||p.defaultLegendLength}normalizedValue(b){this.logarithmic&&
(b=this.logarithmic.log2lin(b));return 1-(this.max-b)/(this.max-this.min||1)}toColor(b,a){const f=this.dataClasses;var d=this.stops;let c,k,h,e;if(f)for(e=f.length;e--;){if(h=f[e],c=h.from,d=h.to,("undefined"===typeof c||b>=c)&&("undefined"===typeof d||b<=d)){k=h.color;a&&(a.dataClass=e,a.colorIndex=h.colorIndex);break}}else{b=this.normalizedValue(b);for(e=d.length;e--&&!(b>d[e][0]););c=d[e]||d[e+1];d=d[e+1]||c;b=1-(d[0]-b)/(d[0]-c[0]||1);k=c.color.tweenTo(d.color,b)}return k}getOffset(){const b=
this.legendItem&&this.legendItem.group,a=this.chart.axisOffset[this.side];if(b){this.axisParent=b;super.getOffset();const f=this.chart.legend;f.allItems.forEach(function(a){a instanceof p&&a.drawLegendSymbol(f,a)});f.render();this.chart.getMargins(!0);this.added||(this.added=!0,this.labelLeft=0,this.labelRight=this.width);this.chart.axisOffset[this.side]=a}}setLegendColor(){var b=this.reversed,a=b?1:0;b=b?0:1;a=this.horiz?[a,0,b,0]:[0,b,0,a];this.legendColor={linearGradient:{x1:a[0],y1:a[1],x2:a[2],
y2:a[3]},stops:this.stops}}drawLegendSymbol(b,a){var f;a=a.legendItem||{};const d=b.padding,c=b.options,k=this.options.labels,h=q(c.itemDistance,10),e=this.horiz,g=q(c.symbolWidth,e?p.defaultLegendLength:12),l=q(c.symbolHeight,e?12:p.defaultLegendLength),m=q(c.labelPadding,e?16:30);this.setLegendColor();a.symbol||(a.symbol=this.chart.renderer.symbol("roundedRect",0,b.baseline-11,g,l,{r:null!==(f=c.symbolRadius)&&void 0!==f?f:3}).attr({zIndex:1}).add(a.group));a.labelWidth=g+d+(e?h:q(k.x,k.distance)+
this.maxLabelLength);a.labelHeight=l+d+(e?m:0)}setState(b){this.series.forEach(function(a){a.setState(b)})}setVisible(){}getSeriesExtremes(){const b=this.series;let a;let c,d,l=b.length,k,h;this.dataMin=Infinity;for(this.dataMax=-Infinity;l--;){d=b[l];a=d.colorKey=q(d.options.colorKey,d.colorKey,d.pointValKey,d.zoneAxis,"y");var e=d.pointArrayMap;c=d[a+"Min"]&&d[a+"Max"];if(d[a+"Data"])var g=d[a+"Data"];else if(e){if(g=[],e=e.indexOf(a),k=d.yData,0<=e&&k)for(h=0;h<k.length;h++)g.push(q(k[h][e],k[h]))}else g=
d.yData;c?(d.minColorValue=d[a+"Min"],d.maxColorValue=d[a+"Max"]):(g=t.prototype.getExtremes.call(d,g),d.minColorValue=g.dataMin,d.maxColorValue=g.dataMax);"undefined"!==typeof d.minColorValue&&(this.dataMin=Math.min(this.dataMin,d.minColorValue),this.dataMax=Math.max(this.dataMax,d.maxColorValue));c||t.prototype.applyExtremes.call(d)}}drawCrosshair(b,a){const c=this.legendItem||{},d=a&&a.plotX,l=a&&a.plotY,k=this.pos,h=this.len;let e;a&&(e=this.toPixels(a.getNestedProperty(a.series.colorKey)),e<
k?e=k-2:e>k+h&&(e=k+h+2),a.plotX=e,a.plotY=this.len-e,super.drawCrosshair(b,a),a.plotX=d,a.plotY=l,this.cross&&!this.cross.addedToColorAxis&&c.group&&(this.cross.addClass("highcharts-coloraxis-marker").add(c.group),this.cross.addedToColorAxis=!0,this.chart.styledMode||"object"!==typeof this.crosshair||this.cross.attr({fill:this.crosshair.color})))}getPlotLinePath(b){const a=this.left,c=b.translatedValue,d=this.top;return D(c)?this.horiz?[["M",c-4,d-6],["L",c+4,d-6],["L",c,d],["Z"]]:[["M",a,c],["L",
a-6,c+6],["L",a-6,c-6],["Z"]]:super.getPlotLinePath(b)}update(b,a){const c=this.chart.legend;this.series.forEach(a=>{a.isDirtyData=!0});(b.dataClasses&&c.allItems||this.dataClasses)&&this.destroyItems();super.update(b,a);this.legendItem&&this.legendItem.label&&(this.setLegendColor(),c.colorizeItem(this,!0))}destroyItems(){const b=this.chart,a=this.legendItem||{};if(a.label)b.legend.destroyItem(this);else if(a.labels)for(const c of a.labels)b.legend.destroyItem(c);b.isDirtyLegend=!0}destroy(){this.chart.isDirtyLegend=
!0;this.destroyItems();super.destroy(...[].slice.call(arguments))}remove(b){this.destroyItems();super.remove(b)}getDataClassLegendSymbols(){const b=this,a=b.chart,c=b.legendItem&&b.legendItem.labels||[],d=a.options.legend,l=q(d.valueDecimals,-1),k=q(d.valueSuffix,""),h=a=>b.series.reduce((b,c)=>{b.push(...c.points.filter(b=>b.dataClass===a));return b},[]);let e;c.length||b.dataClasses.forEach((d,f)=>{const g=d.from,m=d.to,{numberFormatter:p}=a;let n=!0;e="";"undefined"===typeof g?e="< ":"undefined"===
typeof m&&(e="> ");"undefined"!==typeof g&&(e+=p(g,l)+k);"undefined"!==typeof g&&"undefined"!==typeof m&&(e+=" - ");"undefined"!==typeof m&&(e+=p(m,l)+k);c.push(u({chart:a,name:e,options:{},drawLegendSymbol:A.rectangle,visible:!0,isDataClass:!0,setState:a=>{for(const b of h(f))b.setState(a)},setVisible:function(){this.visible=n=b.visible=!n;for(const a of h(f))a.setVisible(n);a.legend.colorizeItem(this,n)}},d))});return c}}p.defaultColorAxisOptions=r;p.defaultLegendLength=200;p.keepProps=["legendItem"];
Array.prototype.push.apply(c.keepProps,p.keepProps);"";return p});n(c,"masters/modules/coloraxis.src.js",[c["Core/Globals.js"],c["Core/Axis/Color/ColorAxis.js"]],function(c,m){c.ColorAxis=m;m.compose(c.Chart,c.Fx,c.Legend,c.Series)})});
//# sourceMappingURL=coloraxis.js.map