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