/* Highcharts JS v10.3.3 (2023-01-20) 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,E,w,J){n.hasOwnProperty(E)||(n[E]=J.apply(null,w),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:E,module:n[E]}})))}n=n?n._modules: {};w(n,"Extensions/MarkerClusters.js",[n["Core/Animation/AnimationUtilities.js"],n["Core/Chart/Chart.js"],n["Core/Defaults.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,ea,J,N,O,t,x,fa){function E(a){var b=a.length,c=0,e=0,d;for(d=0;dClustered points: {point.clusterPointsAmount}
"}});var I=function(a,b){var c=a.chart,e=a.xAxis;a=a.yAxis;return c.mapView?c.mapView.pixelsToProjectedUnits(b): {x:e?e.toValue(b.x):0,y:a?a.toValue(b.y):0}},H=function(a,b){var c=a.chart,e=a.xAxis;a=a.yAxis;return c.mapView?c.mapView.projectedUnitsToPixels(b):{x:e?e.toPixels(b.x):0,y:a?a.toPixels(b.y):0}};K.cluster=function(a,b,c,e){c/=2;e/=2;var d=K.arc(a+c,b+e,c-4,e-4,{start:.5*Math.PI,end:2.5*Math.PI,open:!1}),h=K.arc(a+c,b+e,c-3,e-3,{start:.5*Math.PI,end:2.5*Math.PI,innerR:c-2,open:!1});return K.arc(a+c,b+e,c-1,e-1,{start:.5*Math.PI,end:2.5*Math.PI,innerR:c,open:!1}).concat(h,d)};t.prototype.animateClusterPoint= function(a){var b=this.chart,c=b.mapView,e=X((this.options.cluster||{}).animation),d=e.duration||500,h=(this.markerClusterInfo||{}).pointsState,k=(h||{}).newState,m=(h||{}).oldState,r=[],p=h=0,q=0,l=!1,y=!1;if(m&&k){var g=k[a.stateId];h=H(this,g);p=h.x-(c?0:b.plotLeft);q=h.y-(c?0:b.plotTop);if(1===g.parentsId.length){a=(k||{})[a.stateId].parentsId[0];var f=m[a];g.point&&g.point.graphic&&f&&f.point&&f.point.plotX&&f.point.plotY&&f.point.plotX!==g.point.plotX&&f.point.plotY!==g.point.plotY&&(a=g.point.graphic.getBBox(), h=g.point.graphic&&g.point.graphic.isImg?0:a.width/2,g.point.graphic.attr({x:f.point.plotX-h,y:f.point.plotY-h}),g.point.graphic.animate({x:p-(g.point.graphic.radius||0),y:q-(g.point.graphic.radius||0)},e,function(){y=!0;f.point&&f.point.destroy&&f.point.destroy()}),g.point.dataLabel&&g.point.dataLabel.alignAttr&&f.point.dataLabel&&f.point.dataLabel.alignAttr&&(g.point.dataLabel.attr({x:f.point.dataLabel.alignAttr.x,y:f.point.dataLabel.alignAttr.y}),g.point.dataLabel.animate({x:g.point.dataLabel.alignAttr.x, y:g.point.dataLabel.alignAttr.y},e)))}else 0===g.parentsId.length?(V(g,!0,!0),L(function(){U(g,.1,e,!0,!0)},d/2)):(V(g,!0,!0),g.parentsId.forEach(function(a){m&&m[a]&&(f=m[a],r.push(f),f.point&&f.point.graphic&&(l=!0,f.point.graphic.show(),f.point.graphic.animate({x:p-(f.point.graphic.radius||0),y:q-(f.point.graphic.radius||0),opacity:.4},e,function(){y=!0;P(g,r,e,.7)}),f.point.dataLabel&&-9999!==f.point.dataLabel.y&&g.point&&g.point.dataLabel&&g.point.dataLabel.alignAttr&&(f.point.dataLabel.show(), f.point.dataLabel.animate({x:g.point.dataLabel.alignAttr.x,y:g.point.dataLabel.alignAttr.y,opacity:.4},e))))}),L(function(){y||P(g,r,e,.85)},d),l||L(function(){P(g,r,e,.1)},d/2))}};t.prototype.getGridOffset=function(){var a=this.chart,b=this.xAxis,c=this.yAxis;b=b&&this.dataMinX&&this.dataMaxX?b.reversed?b.toPixels(this.dataMaxX):b.toPixels(this.dataMinX):a.plotLeft;a=c&&this.dataMinY&&this.dataMaxY?c.reversed?c.toPixels(this.dataMinY):c.toPixels(this.dataMaxY):a.plotTop;return{plotLeft:b,plotTop:a}}; t.prototype.getScaledGridSize=function(a){var b=this.xAxis,c=this.chart.mapView;a=a.processedGridSize||C.layoutAlgorithm.gridSize;var e=!0,d=1,h=1;this.gridValueSize||(this.gridValueSize=c?a/c.getScale():Math.abs(b.toValue(a)-b.toValue(0)));b=c?this.gridValueSize*c.getScale():b.toPixels(this.gridValueSize)-b.toPixels(0);for(b=+(a/b).toFixed(14);e&&1!==b;)c=Math.pow(2,d),.75b?e=!1:b>=1/c&&b<1/c*2?(e=!1,h=c):b<=c&&b>c/2&&(e=!1,h=1/c),d++;return a/h/b};t.prototype.getRealExtremes=function(){var a= this.chart,b=a.mapView?0:a.plotLeft,c=I(this,{x:b,y:a.mapView?0:a.plotTop}),e=I(this,{x:b+a.plotWidth,y:b+a.plotHeight});a=c.x;b=e.x;c=c.y;e=e.y;return{minX:Math.min(a,b),maxX:Math.max(a,b),minY:Math.min(c,e),maxY:Math.max(c,e)}};t.prototype.onDrillToCluster=function(a){(a.point||a.target).firePointEvent("drillToCluster",a,function(a){var b=a.point||a.target,e=b.series.xAxis,d=b.series.yAxis,h=b.series.chart,k=h.mapView;if((b.series.options.cluster||{}).drillToCluster&&b.clusteredData){var m=b.clusteredData.map(function(a){return a.x}).sort(function(a, b){return a-b});b=b.clusteredData.map(function(a){return a.y}).sort(function(a,b){return a-b});var r=m[0],p=m[m.length-1];m=b[0];var q=b[b.length-1],l=Math.abs(.1*(p-r)),y=Math.abs(.1*(q-m));b=Math.min(r,p)-l;r=Math.max(r,p)+l;p=Math.min(m,q)-y;m=Math.max(m,q)+y;k?k.fitToBounds({x1:b,x2:r,y1:p,y2:m}):e&&d&&(h.pointer.zoomX=!0,h.pointer.zoomY=!0,h.zoom({originalEvent:a,xAxis:[{axis:e,min:b,max:r}],yAxis:[{axis:d,min:p,max:m}]}))}})};t.prototype.getClusterDistancesFromPoint=function(a,b,c){for(var e= [],d=0;dd[f].oldX+1||d[f].posXd[f].oldY+1||d[f].posY m.minX||d.initMaxY&&d.initMaxYm.minY?(d.initMaxX=m.maxX,d.initMinX=m.minX,d.initMaxY=m.maxY,d.initMinY=m.minY,k=d.markerClusterAlgorithms?d.markerClusterAlgorithms.kmeans.call(d,a,b,c,e):{},d.baseClusters=null):(d.baseClusters||(d.baseClusters={clusters:d.markerClusterInfo.clusters,noise:d.markerClusterInfo.noise}),d.baseClusters.clusters.forEach(function(a){a.pointsOutside=[];a.pointsInside=[];a.data.forEach(function(b){var e=H(d,b),c=H(d,a);q=Math.sqrt(Math.pow(e.x- c.x,2)+Math.pow(e.y-c.y,2));l=a.clusterZone&&a.clusterZone.marker&&a.clusterZone.marker.radius?a.clusterZone.marker.radius:r&&r.radius?r.radius:C.marker.radius;p=0<=h-l?h-l:l;q>l+p&&B(a.pointsOutside)?a.pointsOutside.push(b):B(a.pointsInside)&&a.pointsInside.push(b)});a.pointsInside.length&&(k[a.id]=a.pointsInside);a.pointsOutside.forEach(function(b,e){k[a.id+"_noise"+e]=[b]})}),d.baseClusters.noise.forEach(function(a){k[a.id]=a.data}));return k}};t.prototype.preventClusterCollisions=function(a){var b= this,c=a.key.split("-").map(parseFloat),e=c[0],d=c[1],h=a.gridSize,k=a.groupedData,m=a.defaultRadius,r=a.clusterRadius,p=d*h,q=e*h;c=H(b,a);var l=c.x,y=c.y;c=[];var g=0,f=0,n=(b.options.cluster||{}).marker,u=(b.options.cluster||{}).zones,v=b.getGridOffset(),t,da,z,x,w,A,F;l-=v.plotLeft;y-=v.plotTop;for(z=1;5>z;z++){var G=z%2?-1:1;var D=3>z?-1:1;G=Math.floor((l+G*r)/h);D=Math.floor((y+D*r)/h);G=[D+"-"+G,D+"-"+d,e+"-"+G];for(D=0;D=u[z].from&&g<=u[z].to&&(f=B((u[z].marker||{}).radius)?u[z].marker.radius||0:n&&n.radius?n.radius:C.marker.radius);1x-d?p+r:p+h-r);w!==e&&Math.abs(y-da)w-e?q+r:q+h-r)}});c=I(b,{x:l+ v.plotLeft,y:y+v.plotTop});k[a.key].posX=c.x;k[a.key].posY=c.y;return c};t.prototype.isValidGroupedDataObject=function(a){var b=!1,c;if(!R(a))return!1;W(a,function(a){b=!0;if(Z(a)&&a.length)for(c=0;c=r){var l=a[q];var n=Math.random().toString(36).substring(2,7)+"-"+ca++;var g=l.length;if(b.zones)for(p=0;p=b.zones[p].from&&g<=b.zones[p].to){var f=b.zones[p];f.zoneIndex=p;var t=b.zones[p].marker;var u=b.zones[p].className}var v=E(l);"grid"!==b.layoutAlgorithm.type||b.allowOverlap?v={x:v.x,y:v.y}:(p=this.options.marker||{},v=this.preventClusterCollisions({x:v.x,y:v.y,key:q,groupedData:a,gridSize:this.getScaledGridSize(b.layoutAlgorithm), defaultRadius:p.radius||3+(p.lineWidth||0),clusterRadius:t&&t.radius?t.radius:(b.marker||{}).radius||C.marker.radius}));for(p=0;p=k.minX-f&&e[u]<=k.maxX+f&&(d[u]||k.minY)>=k.minY-x&&(d[u]||k.maxY)<=k.maxY+x&&(m.push(e[u]),n.push(d[u]),p.push(u))}B(v)&&B(q)&&F(w)&&F(l)&&(a.dataMaxX=v,a.dataMinX=q,a.dataMaxY=w,a.dataMinY=l);k=Q(g)?g:a.markerClusterAlgorithms? g&&a.markerClusterAlgorithms[g]?a.markerClusterAlgorithms[g]:m.length