/* Highcharts JS v8.2.0 (2020-08-20) Marker clusters module for Highcharts (c) 2010-2019 Wojciech Chmiel License: www.highcharts.com/license */ (function(t){"object"===typeof module&&module.exports?(t["default"]=t,module.exports=t):"function"===typeof define&&define.amd?define("highcharts/modules/marker-clusters",["highcharts"],function(y){t(y);t.Highcharts=y;return t}):t("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(t){function y(t,F,C,y){t.hasOwnProperty(F)||(t[F]=y.apply(null,C))}t=t?t._modules:{};y(t,"Extensions/MarkerClusters.js",[t["Core/Chart/Chart.js"],t["Core/Globals.js"],t["Core/Options.js"],t["Core/Series/Point.js"], t["Core/Renderer/SVG/SVGRenderer.js"],t["Core/Utilities.js"]],function(t,y,C,P,Z,v){function I(a){var b=a.length,e=0,f=0,c;for(c=0;cClustered points: {point.clusterPointsAmount}
"}});Z.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)};w.prototype.animateClusterPoint= function(a){var b=this.xAxis,e=this.yAxis,f=this.chart,c=T((this.options.cluster||{}).animation),k=c.duration||500,h=(this.markerClusterInfo||{}).pointsState,m=(h||{}).newState,r=(h||{}).oldState,g=[],l=h=0,p=0,q=!1,u=!1;if(r&&m){var d=m[a.stateId];l=b.toPixels(d.x)-f.plotLeft;p=e.toPixels(d.y)-f.plotTop;if(1===d.parentsId.length){a=(m||{})[a.stateId].parentsId[0];var n=r[a];d.point&&d.point.graphic&&n&&n.point&&n.point.plotX&&n.point.plotY&&n.point.plotX!==d.point.plotX&&n.point.plotY!==d.point.plotY&& (a=d.point.graphic.getBBox(),h=a.width/2,d.point.graphic.attr({x:n.point.plotX-h,y:n.point.plotY-h}),d.point.graphic.animate({x:l-(d.point.graphic.radius||0),y:p-(d.point.graphic.radius||0)},c,function(){u=!0;n.point&&n.point.destroy&&n.point.destroy()}),d.point.dataLabel&&d.point.dataLabel.alignAttr&&n.point.dataLabel&&n.point.dataLabel.alignAttr&&(d.point.dataLabel.attr({x:n.point.dataLabel.alignAttr.x,y:n.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?(R(d,!0,!0),J(function(){Q(d,.1,c,!0,!0)},k/2)):(R(d,!0,!0),d.parentsId.forEach(function(a){r&&r[a]&&(n=r[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||0),y:p-(n.point.graphic.radius||0),opacity:.4},c,function(){u=!0;L(d,g,c,.7)}),n.point.dataLabel&&-9999!==n.point.dataLabel.y&&d.point&&d.point.dataLabel&&d.point.dataLabel.alignAttr&&(n.point.dataLabel.show(), n.point.dataLabel.animate({x:d.point.dataLabel.alignAttr.x,y:d.point.dataLabel.alignAttr.y,opacity:.4},c))))}),J(function(){u||L(d,g,c,.85)},k),q||J(function(){L(d,g,c,.1)},k/2))}};w.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}};w.prototype.getScaledGridSize= function(a){var b=this.xAxis,e=!0,f=1,c=1;a=a.processedGridSize||E.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};w.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}};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 r=h[h.length-1];h=m[0];var g=m[m.length-1];m=Math.abs(.1*(r-b));var l=Math.abs(.1*(g-h));k.pointer.zoomX=!0;k.pointer.zoomY=!0;b>r&&(r=[r,b],b=r[0],r=r[1]);h>g&&(g=[g,h],h=g[0],g=g[1]);k.zoom({originalEvent:a,xAxis:[{axis:f,min:b-m,max:r+m}],yAxis:[{axis:c,min:h-l,max:g+l}]})}})};w.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].posYr.minX||this.initMaxY&&this.initMaxYr.minY?(this.initMaxX=r.maxX,this.initMinX=r.minX,this.initMaxY=r.maxY,this.initMinY=r.minY,m=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){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:E.marker.radius;l=0<=h-q?h-q:q;p>q+l&&D(a.pointsOutside)?a.pointsOutside.push(b):D(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,e=this.yAxis,f=a.key.split("-").map(parseFloat),c=f[0],k=f[1],h=a.gridSize,m=a.groupedData,r=a.defaultRadius,g=a.clusterRadius,l=k*h,p=c*h,q=b.toPixels(a.x),u=e.toPixels(a.y);f=[];var d=0,n=0,t=(this.options.cluster||{}).marker,x=(this.options.cluster||{}).zones,v=this.getGridOffset(),w,y,A,B,C,F,G;q-=v.plotLeft;u-=v.plotTop;for(A=1;5>A;A++){var H=A%2?-1:1;var z=3>A?-1:1;H=Math.floor((q+H*g)/h);z=Math.floor((u+ z*g)/h);H=[z+"-"+H,z+"-"+k,c+"-"+H];for(z=0;z=x[A].from&&d<=x[A].to&&(n=D((x[A].marker||{}).radius)?x[A].marker.radius||0:t&&t.radius?t.radius:E.marker.radius);1B-k?l+g:l+h-g);C!==c&&Math.abs(u-y)C-c?p+g:p+h-g)}});f=b.toValue(q+v.plotLeft);z=e.toValue(u+v.plotTop);m[a.key].posX=f;m[a.key].posY=z;return{x:f,y:z}};w.prototype.isValidGroupedDataObject=function(a){var b=!1,e;if(!N(a))return!1;S(a,function(a){b=!0;if(V(a)&&a.length)for(e=0;e=r){var p=a[l];var q=Math.random().toString(36).substring(2,7)+"-"+Y++;var u=p.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 n=b.zones[g].marker;var t=b.zones[g].className}var x= I(p);"grid"!==b.layoutAlgorithm.type||b.allowOverlap?x={x:x.x,y:x.y}:(g=this.options.marker||{},x=this.preventClusterCollisions({x:x.x,y:x.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||E.marker.radius}));for(g=0;g=k.minX-e&&a.xData[q]<=k.maxX+e&&(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]),r.push(q))}D(n)&&D(g)&&G(t)&&G(l)&&(a.dataMaxX=n,a.dataMinX=g,a.dataMaxY=t,a.dataMinY=l);k=M(u)?u:a.markerClusterAlgorithms?u&&a.markerClusterAlgorithms[u]?a.markerClusterAlgorithms[u]:h.length