/* Highcharts JS v9.0.1 (2021-02-15) Marker clusters module for Highcharts (c) 2010-2021 Wojciech Chmiel License: www.highcharts.com/license */ (function(n){"object"===typeof module&&module.exports?(n["default"]=n,module.exports=n):"function"===typeof define&&define.amd?define("highcharts/modules/marker-clusters",["highcharts"],function(w){n(w);n.Highcharts=w;return n}):n("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(n){function w(n,w,G,H){n.hasOwnProperty(w)||(n[w]=H.apply(null,G))}n=n?n._modules:{};w(n,"Extensions/MarkerClusters.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Chart/Chart.js"],n["Core/Options.js"], n["Core/Color/Palette.js"],n["Core/Series/Point.js"],n["Core/Series/Series.js"],n["Core/Series/SeriesRegistry.js"],n["Core/Renderer/SVG/SVGRenderer.js"],n["Core/Utilities.js"],n["Core/Axis/Axis.js"]],function(n,w,G,H,P,J,K,aa,m,ba){function I(a){var b=a.length,e=0,f=0,c;for(c=0;cClustered points: {point.clusterPointsAmount}
"}});aa.prototype.symbols.cluster=function(a,b,e,f){e/=2;f/=2;var c=this.arc(a+e,b+f,e-4,f-4,{start:.5*Math.PI,end:2.5*Math.PI,open:!1});var k=this.arc(a+e,b+f,e-3,f-3,{start:.5*Math.PI, end:2.5*Math.PI,innerR:e-2,open:!1});return this.arc(a+e,b+f,e-1,f-1,{start:.5*Math.PI,end:2.5*Math.PI,innerR:e,open:!1}).concat(k,c)};m.prototype.animateClusterPoint=function(a){var b=this.xAxis,e=this.yAxis,f=this.chart,c=U((this.options.cluster||{}).animation),k=c.duration||500,h=(this.markerClusterInfo||{}).pointsState,p=(h||{}).newState,v=(h||{}).oldState,g=[],l=h=0,r=0,t=!1,u=!1;if(v&&p){var d=p[a.stateId];l=b.toPixels(d.x)-f.plotLeft;r=e.toPixels(d.y)-f.plotTop;if(1===d.parentsId.length){a= (p||{})[a.stateId].parentsId[0];var q=v[a];d.point&&d.point.graphic&&q&&q.point&&q.point.plotX&&q.point.plotY&&q.point.plotX!==d.point.plotX&&q.point.plotY!==d.point.plotY&&(a=d.point.graphic.getBBox(),h=d.point.graphic&&d.point.graphic.isImg?0:a.width/2,d.point.graphic.attr({x:q.point.plotX-h,y:q.point.plotY-h}),d.point.graphic.animate({x:l-(d.point.graphic.radius||0),y:r-(d.point.graphic.radius||0)},c,function(){u=!0;q.point&&q.point.destroy&&q.point.destroy()}),d.point.dataLabel&&d.point.dataLabel.alignAttr&& q.point.dataLabel&&q.point.dataLabel.alignAttr&&(d.point.dataLabel.attr({x:q.point.dataLabel.alignAttr.x,y:q.point.dataLabel.alignAttr.y}),d.point.dataLabel.animate({x:d.point.dataLabel.alignAttr.x,y:d.point.dataLabel.alignAttr.y},c)))}else 0===d.parentsId.length?(S(d,!0,!0),E(function(){R(d,.1,c,!0,!0)},k/2)):(S(d,!0,!0),d.parentsId.forEach(function(a){v&&v[a]&&(q=v[a],g.push(q),q.point&&q.point.graphic&&(t=!0,q.point.graphic.show(),q.point.graphic.animate({x:l-(q.point.graphic.radius||0),y:r-(q.point.graphic.radius|| 0),opacity:.4},c,function(){u=!0;L(d,g,c,.7)}),q.point.dataLabel&&-9999!==q.point.dataLabel.y&&d.point&&d.point.dataLabel&&d.point.dataLabel.alignAttr&&(q.point.dataLabel.show(),q.point.dataLabel.animate({x:d.point.dataLabel.alignAttr.x,y:d.point.dataLabel.alignAttr.y,opacity:.4},c))))}),E(function(){u||L(d,g,c,.85)},k),t||E(function(){L(d,g,c,.1)},k/2))}};m.prototype.getGridOffset=function(){var a=this.chart,b=this.xAxis,e=this.yAxis;b=this.dataMinX&&this.dataMaxX?b.reversed?b.toPixels(this.dataMaxX): b.toPixels(this.dataMinX):a.plotLeft;a=this.dataMinY&&this.dataMaxY?e.reversed?e.toPixels(this.dataMinY):e.toPixels(this.dataMaxY):a.plotTop;return{plotLeft:b,plotTop:a}};m.prototype.getScaledGridSize=function(a){var b=this.xAxis,e=!0,f=1,c=1;a=a.processedGridSize||B.layoutAlgorithm.gridSize;this.gridValueSize||(this.gridValueSize=Math.abs(b.toValue(a)-b.toValue(0)));b=b.toPixels(this.gridValueSize)-b.toPixels(0);for(b=+(a/b).toFixed(14);e&&1!==b;){var k=Math.pow(2,f);.75b?e=!1:b>=1/k&&b< 1/k*2?(e=!1,c=k):b<=k&&b>k/2&&(e=!1,c=1/k);f++}return a/c/b};m.prototype.getRealExtremes=function(){var a=this.chart,b=this.xAxis,e=this.yAxis;var f=b?b.toValue(a.plotLeft):0;b=b?b.toValue(a.plotLeft+a.plotWidth):0;var c=e?e.toValue(a.plotTop):0;a=e?e.toValue(a.plotTop+a.plotHeight):0;f>b&&(f=[f,b],b=f[0],f=f[1]);c>a&&(c=[c,a],a=c[0],c=c[1]);return{minX:f,maxX:b,minY:c,maxY:a}};m.prototype.onDrillToCluster=function(a){(a.point||a.target).firePointEvent("drillToCluster",a,function(a){var b=a.point|| a.target,f=b.series.xAxis,c=b.series.yAxis,k=b.series.chart;if((b.series.options.cluster||{}).drillToCluster&&b.clusteredData){var h=b.clusteredData.map(function(a){return a.x}).sort(function(a,b){return a-b});var p=b.clusteredData.map(function(a){return a.y}).sort(function(a,b){return a-b});b=h[0];var v=h[h.length-1];h=p[0];var g=p[p.length-1];p=Math.abs(.1*(v-b));var l=Math.abs(.1*(g-h));k.pointer.zoomX=!0;k.pointer.zoomY=!0;b>v&&(v=[v,b],b=v[0],v=v[1]);h>g&&(g=[g,h],h=g[0],g=g[1]);k.zoom({originalEvent:a, xAxis:[{axis:f,min:b-p,max:v+p}],yAxis:[{axis:c,min:h-l,max:g+l}]})}})};m.prototype.getClusterDistancesFromPoint=function(a,b,e){var f=this.xAxis,c=this.yAxis,k=[],h;for(h=0;hc[d].oldX+1||c[d].posXc[d].oldY+1||c[d].posYv.minX||this.initMaxY&&this.initMaxYv.minY?(this.initMaxX=v.maxX,this.initMinX=v.minX,this.initMaxY=v.maxY,this.initMinY=v.minY,p=this.markerClusterAlgorithms?this.markerClusterAlgorithms.kmeans.call(this,a,b,e,f):{},this.baseClusters=null):(this.baseClusters|| (this.baseClusters={clusters:this.markerClusterInfo.clusters,noise:this.markerClusterInfo.noise}),this.baseClusters.clusters.forEach(function(a){a.pointsOutside=[];a.pointsInside=[];a.data.forEach(function(b){r=Math.sqrt(Math.pow(c.toPixels(b.x)-c.toPixels(a.x),2)+Math.pow(k.toPixels(b.y)-k.toPixels(a.y),2));t=a.clusterZone&&a.clusterZone.marker&&a.clusterZone.marker.radius?a.clusterZone.marker.radius:g&&g.radius?g.radius:B.marker.radius;l=0<=h-t?h-t:t;r>t+l&&A(a.pointsOutside)?a.pointsOutside.push(b): A(a.pointsInside)&&a.pointsInside.push(b)});a.pointsInside.length&&(p[a.id]=a.pointsInside);a.pointsOutside.forEach(function(b,f){p[a.id+"_noise"+f]=[b]})}),this.baseClusters.noise.forEach(function(a){p[a.id]=a.data}));return p}};m.prototype.preventClusterCollisions=function(a){var b=this.xAxis,e=this.yAxis,f=a.key.split("-").map(parseFloat),c=f[0],k=f[1],h=a.gridSize,p=a.groupedData,v=a.defaultRadius,g=a.clusterRadius,l=k*h,r=c*h,t=b.toPixels(a.x),u=e.toPixels(a.y);f=[];var d=0,q=0,n=(this.options.cluster|| {}).marker,m=(this.options.cluster||{}).zones,w=this.getGridOffset(),z,D,y,E,F,G,H;t-=w.plotLeft;u-=w.plotTop;for(y=1;5>y;y++){var C=y%2?-1:1;var x=3>y?-1:1;C=Math.floor((t+C*g)/h);x=Math.floor((u+x*g)/h);C=[x+"-"+C,x+"-"+k,c+"-"+C];for(x=0;x=m[y].from&&d<=m[y].to&&(q=A((m[y].marker||{}).radius)?m[y].marker.radius||0:n&&n.radius?n.radius:B.marker.radius);1E-k?l+g:l+h-g);F!==c&&Math.abs(u-D)F-c?r+g:r+h-g)}});f=b.toValue(t+w.plotLeft);x=e.toValue(u+w.plotTop);p[a.key].posX=f;p[a.key].posY=x;return{x:f,y:x}};m.prototype.isValidGroupedDataObject=function(a){var b=!1,e;if(!N(a))return!1; T(a,function(a){b=!0;if(W(a)&&a.length)for(e=0;e=v){var r=a[l];var t=Math.random().toString(36).substring(2, 7)+"-"+Z++;var u=r.length;if(b.zones)for(g=0;g=b.zones[g].from&&u<=b.zones[g].to){var d=b.zones[g];d.zoneIndex=g;var q=b.zones[g].marker;var n=b.zones[g].className}var m=I(r);"grid"!==b.layoutAlgorithm.type||b.allowOverlap?m={x:m.x,y:m.y}:(g=this.options.marker||{},m=this.preventClusterCollisions({x:m.x,y:m.y,key:l,groupedData:a,gridSize:this.getScaledGridSize(b.layoutAlgorithm),defaultRadius:g.radius||3+(g.lineWidth||0),clusterRadius:q&&q.radius?q.radius:(b.marker||{}).radius|| B.marker.radius}));for(g=0;g=k.minX-e&&a.xData[t]<=k.maxX+e&&(a.yData[t]||k.minY)>=k.minY-f&&(a.yData[t]||k.maxY)<=k.maxY+f&&(h.push(a.xData[t]),p.push(a.yData[t]),m.push(t))}A(q)&&A(g)&&D(n)&&D(l)&&(a.dataMaxX=q,a.dataMinX=g,a.dataMaxY=n,a.dataMinY=l);k=M(u)?u:a.markerClusterAlgorithms?u&&a.markerClusterAlgorithms[u]?a.markerClusterAlgorithms[u]:h.length