UNPKG

highcharts

Version:
13 lines 20.8 kB
!/** * Highcharts JS v13.0.1 (2026-08-17) * @module highcharts/modules/marker-clusters * @requires highcharts * * Marker clusters module for Highcharts * * (c) 2010-2026 Highsoft AS * Author: Wojciech Chmiel * * A commercial license may be required depending on use, * see www.highcharts.com/license */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts):"function"==typeof define&&define.amd?define("highcharts/modules/marker-clusters",["highcharts/highcharts"],function(t){return e(t)}):"object"==typeof exports?exports["highcharts/modules/marker-clusters"]=e(t._Highcharts):t.Highcharts=e(t.Highcharts)}("u"<typeof window?this:window,t=>(()=>{"use strict";let e;var i={944(e){e.exports=t}};let r={};function s(t){let e=r[t];if(void 0!==e)return e.exports;let a=r[t]={exports:{}};return i[t](a,a.exports,s),a.exports}s.n=t=>{let e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{if(Array.isArray(e))for(var i=0;i<e.length;){var r=e[i++],a=e[i++];s.o(t,r)?0===a&&i++:0===a?Object.defineProperty(t,r,{enumerable:!0,value:e[i++]}):Object.defineProperty(t,r,{enumerable:!0,get:a})}else for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let a={};s.d(a,{default:()=>B});var o=s(944),n=s.n(o);let l={cluster:{enabled:!1,allowOverlap:!0,animation:{duration:500},drillToCluster:!0,minimumClusterSize:2,layoutAlgorithm:{gridSize:50,distance:40,kmeansThreshold:100},marker:{symbol:"cluster",radius:15,lineWidth:0,lineColor:"var(--highcharts-background-color)"},dataLabels:{enabled:!0,format:"{point.clusterPointsAmount}",verticalAlign:"middle",align:"center",style:{color:"contrast"},inside:!0}},tooltip:{clusterFormat:"<span>Clustered points: {point.clusterPointsAmount}</span><br/>"}},{setLength:u,splice:h}={convertToNumber:function(t,e){switch(typeof t){case"boolean":return+!!t;case"number":return isNaN(t)&&!e?null:t;default:return isNaN(t=parseFloat(`${t??""}`))&&!e?null:t}},setLength:function(t,e,i){return Array.isArray(t)?(t.length=e,t):t[i?"subarray":"slice"](0,e)},splice:function(t,e,i,r,s=[]){if(Array.isArray(t))return Array.isArray(s)||(s=Array.from(s)),{removed:t.splice(e,i,...s),array:t};let a=Object.getPrototypeOf(t).constructor,o=t[r?"subarray":"slice"](e,e+i),n=new a(t.length-i+s.length);return n.set(t.subarray(0,e),0),n.set(s,e),n.set(t.subarray(e+i),e+s.length),{removed:o,array:n}}},p=class{constructor(t={}){this.isDataTable=!0,this.autoId=!t.id,this.columns={},this.id=t.id||(0,o.uniqueKey)(),this.rowCount=0,this.versionTag=(0,o.uniqueKey)();let e=0;(0,o.objectEach)(t.columns||{},(t,i)=>{this.columns[i]=t.slice(),e=Math.max(e,t.length)}),this.applyRowCount(e)}applyRowCount(t){this.rowCount=t,(0,o.objectEach)(this.columns,(e,i)=>{e.length!==t&&(this.columns[i]=u(e,t))})}deleteRows(t,e=1){if(e>0&&t<this.rowCount){let i=0;(0,o.objectEach)(this.columns,(r,s)=>{this.columns[s]=h(r,t,e).array,i=r.length}),this.rowCount=i}(0,o.fireEvent)(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=(0,o.uniqueKey)()}getColumn(t,e){return this.columns[t]}getColumns(t,e){return(t||Object.keys(this.columns)).reduce((t,e)=>(t[e]=this.columns[e],t),{})}getRowObject(t,e){let i={},r=this.columns;for(let s of(e??(e=Object.keys(this.columns)),e))i[s]=r[s]?.[t];return i}setColumn(t,e=[],i=0,r){this.setColumns({[t]:e},i,r)}setColumns(t,e,i){let r=this.rowCount;(0,o.objectEach)(t,(t,e)=>{this.columns[e]=t.slice(),r=t.length}),this.applyRowCount(r),i?.silent||((0,o.fireEvent)(this,"afterSetColumns"),this.versionTag=(0,o.uniqueKey)())}setRow(t,e=this.rowCount,i,r){var s;let{columns:a}=this,n=i?this.rowCount+1:e+1,l=Object.keys(t);if(r?.addColumns!==!1)for(let t=0,e=l.length;t<e;t++)a[s=l[t]]||(a[s]=Array(this.rowCount));(0,o.objectEach)(a,(r,s)=>{r&&(i?r=h(r,e,0,!0,[t[s]]).array:r[e]=s in t?t[s]:r[e],a[s]=r)}),this.applyRowCount(Math.max(n,this.rowCount)),r?.silent||((0,o.fireEvent)(this,"afterSetRows",{rowIndex:e}),this.versionTag=(0,o.uniqueKey)())}getModified(){return this.modified||this}},{cluster:d}=l,c={grid:function(t,e,i,r){let s,a,o,n,l,u={},h=this.getGridOffset(),p=this.getScaledGridSize(r);for(l=0;l<t.length;l++){let r=R(this,{x:t[l],y:e[l]});s=r.x-h.plotLeft,a=r.y-h.plotTop,o=Math.floor(s/p),u[n=Math.floor(a/p)+":"+o]??(u[n]=[]),u[n].push({dataIndex:i[l],x:t[l],y:e[l]})}return u},kmeans:function(t,e,i,r){let s=[],a=[],n={},l=Number(r.processedDistance??(0,o.relativeLength)(r.distance||d.layoutAlgorithm.distance,this.chart.plotWidth)),u=r.iterations,h=0,p=!0,c=0,m=0,f,g=[];r.processedGridSize=l;let y=this.markerClusterAlgorithms?this.markerClusterAlgorithms.grid.call(this,t,e,i,r):{};for(let t in y)y[t].length>1&&(f=b(y[t]),s.push({posX:f.x,posY:f.y,oldX:0,oldY:0,startPointsLen:y[t].length,points:[]}));for(;p;){for(let t of s)t.points.length=0;a.length=0;for(let r=0;r<t.length;r++)c=t[r],m=e[r],(g=this.getClusterDistancesFromPoint(s,c,m)).length&&g[0].distance<l?s[g[0].clusterIndex].points.push({x:c,y:m,dataIndex:i[r]}):a.push({x:c,y:m,dataIndex:i[r]});for(let t=0;t<s.length;t++)1===s[t].points.length&&(g=this.getClusterDistancesFromPoint(s,s[t].points[0].x,s[t].points[0].y))[1].distance<l&&(s[g[1].clusterIndex].points.push(s[t].points[0]),s[g[0].clusterIndex].points.length=0);p=!1;for(let t=0;t<s.length;t++)f=b(s[t].points),s[t].oldX=s[t].posX,s[t].oldY=s[t].posY,s[t].posX=f.x,s[t].posY=f.y,(s[t].posX>s[t].oldX+1||s[t].posX<s[t].oldX-1||s[t].posY>s[t].oldY+1||s[t].posY<s[t].oldY-1)&&(p=!0);u&&(p=h<u-1),h++}for(let t=0,e=s.length;t<e;++t)n["cluster"+t]=s[t].points;for(let t=0,e=a.length;t<e;++t)n["noise"+t]=[a[t]];return n},optimizedKmeans:function(t,e,i,r){let s=Number(r.processedDistance??(0,o.relativeLength)(r.distance||d.layoutAlgorithm.gridSize,this.chart.plotWidth)),a=this.getRealExtremes(),n=(this.options.cluster||{}).marker,l,u={};if(!this.markerClusterInfo||this.initMaxX&&this.initMaxX<a.maxX||this.initMinX&&this.initMinX>a.minX||this.initMaxY&&this.initMaxY<a.maxY||this.initMinY&&this.initMinY>a.minY)this.initMaxX=a.maxX,this.initMinX=a.minX,this.initMaxY=a.maxY,this.initMinY=a.minY,u=this.markerClusterAlgorithms?this.markerClusterAlgorithms.kmeans.call(this,t,e,i,r):{},this.baseClusters=null;else{for(let t of(this.baseClusters??(this.baseClusters={clusters:this.markerClusterInfo.clusters,noise:this.markerClusterInfo.noise}),this.baseClusters.clusters)){for(let e of(t.pointsOutside=[],t.pointsInside=[],t.data)){let i=R(this,e),r=R(this,t);l=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2));let a=t.clusterZone?.marker?.radius??n?.radius??d.marker.radius??0,u=s-a>=0?s-a:a;l>a+u&&(0,o.defined)(t.pointsOutside)?t.pointsOutside.push(e):(0,o.defined)(t.pointsInside)&&t.pointsInside.push(e)}t.pointsInside.length&&(u[t.id]=t.pointsInside);let e=0;for(let i of t.pointsOutside)u[t.id+"_noise"+e++]=[i]}for(let t of this.baseClusters.noise)u[t.id]=t.data}return u}},m,f=[],g=0;function y(t,e,i){t.attr({opacity:e}).animate({opacity:1},i)}function x(t,e,i,r){for(let s of(C(t,r,i,!0,!0),e))s.point?.destroy?.()}function C(t,e,i,r,s){t.point&&(r&&t.point.graphic&&(t.point.graphic.show(),y(t.point.graphic,e,i)),s&&t.point.dataLabel&&(t.point.dataLabel.show(),y(t.point.dataLabel,e,i)))}function b(t){let e=t.length,i=0,r=0;for(let s=0;s<e;s++)i+=t[s].x,r+=t[s].y;return{x:i/e,y:r/e}}function k(t,e){let i=[];return i.length=e,t.clusters.forEach(function(t){t.data.forEach(function(t){i[t.dataIndex]=t})}),t.noise.forEach(function(t){i[t.data[0].dataIndex]=t.data[0]}),i}function I(){return Math.random().toString(36).substring(2,7)+"-"+g++}function M(t,e,i){t.point&&(e&&t.point.graphic&&t.point.graphic.hide(),i&&t.point.dataLabel&&t.point.dataLabel.hide())}function S(t){(t.point||t.target).firePointEvent("drillToCluster",t,function(t){let e=t.point||t.target,i=e.series,{xAxis:r,yAxis:s,chart:a}=i,{inverted:o,mapView:n,pointer:l}=a;if(i.options.cluster?.drillToCluster&&e.clusteredData){let t=e.clusteredData.map(t=>t.x).sort((t,e)=>t-e),i=e.clusteredData.map(t=>t.y).sort((t,e)=>t-e),u=t[0],h=t[t.length-1],p=i[0],d=i[i.length-1],c=Math.abs((h-u)*.1),m=Math.abs((d-p)*.1),f=Math.min(u,h)-c,g=Math.max(u,h)+c,y=Math.min(p,d)-m,x=Math.max(p,d)+m;if(n)n.fitToBounds({x1:f,x2:g,y1:y,y2:x});else if(r&&s){let t=r.toPixels(f),e=r.toPixels(g),i=s.toPixels(y),n=s.toPixels(x);o&&([t,e,i,n]=[i,n,t,e]),t>e&&([t,e]=[e,t]),i>n&&([i,n]=[n,i]),l&&(l.zoomX=!0,l.zoomY=!0),a.transform({from:{x:t,y:i,width:e-t,height:n-i}})}}})}function w(t,e){let{chart:i,xAxis:r,yAxis:s}=t;return i.mapView?i.mapView.pixelsToProjectedUnits(e):{x:r?r.toValue(e.x):0,y:s?s.toValue(e.y):0}}function A(t){let e=this.chart,i=e.mapView,r=(0,o.animObject)(this.options.cluster?.animation),s=r.duration||500,a=this.markerClusterInfo?.pointsState,n=a?.newState,l=a?.oldState,u=[],h,p,d,c=0,m=0,f=0,g=!1,y=!1;if(l&&n){let a=R(this,p=n[t.stateId]);m=a.x-(i?0:e.plotLeft),f=a.y-(i?0:e.plotTop),1===p.parentsId.length?(h=l[n?.[t.stateId].parentsId[0]],p.point?.graphic&&h.point?.plotX&&h.point.plotY&&(h.point.plotX!==p.point.plotX||h.point.plotY!==p.point.plotY)&&(d=p.point.graphic.getBBox(),c=p.point.graphic?.isImg?0:d.width/2,p.point.graphic.attr({x:h.point.plotX-c,y:h.point.plotY-c}),p.point.graphic.animate({x:m-(p.point.graphic.radius||0),y:f-(p.point.graphic.radius||0)},r,function(){y=!0,h.point?.destroy?.()}),p.point.dataLabel?.alignAttr&&h.point.dataLabel?.alignAttr&&(p.point.dataLabel.attr({x:h.point.dataLabel.alignAttr.x,y:h.point.dataLabel.alignAttr.y}),p.point.dataLabel.animate({x:p.point.dataLabel.alignAttr.x,y:p.point.dataLabel.alignAttr.y},r)))):0===p.parentsId.length?(M(p,!0,!0),(0,o.syncTimeout)(function(){C(p,.1,r,!0,!0)},s/2)):(M(p,!0,!0),p.parentsId.forEach(function(t){l?.[t]&&(h=l[t],u.push(h),h.point?.graphic&&(g=!0,h.point.graphic.show(),h.point.graphic.animate({x:m-(h.point.graphic.radius||0),y:f-(h.point.graphic.radius||0),opacity:.4},r,function(){y=!0,x(p,u,r,.7)}),h.point.dataLabel&&-9999!==h.point.dataLabel.y&&p.point?.dataLabel?.alignAttr&&(h.point.dataLabel.show(),h.point.dataLabel.animate({x:p.point.dataLabel.alignAttr.x,y:p.point.dataLabel.alignAttr.y,opacity:.4},r))))}),(0,o.syncTimeout)(function(){y||x(p,u,r,.85)},s),g||(0,o.syncTimeout)(function(){x(p,u,r,.1)},s/2))}}function v(){this.markerClusterSeriesData?.forEach(t=>{t?.destroy?.()}),this.markerClusterSeriesData=null}function L(){let t,e,i,r,s,a,n,l,u,h,c,f,g,y,x,C=this,{chart:b}=C,k=b.mapView,I=C.getColumn("x"),M=C.getColumn("y"),A=C.options.cluster,v=C.getRealExtremes(),L=[],P=[],X=[];if(k&&C.is("mappoint")&&I&&M&&C.options.data?.forEach((t,e)=>{let i=C.projectPoint(t);i&&(I[e]=i.x,M[e]=i.y)}),A?.enabled&&I?.length&&M?.length&&!b.polar){c=A.layoutAlgorithm.type,(y=A.layoutAlgorithm).processedGridSize=(0,o.relativeLength)(y.gridSize||d.layoutAlgorithm.gridSize,b.plotWidth),y.processedDistance=(0,o.relativeLength)(y.distance||d.layoutAlgorithm.distance,b.plotWidth),r=y.kmeansThreshold||d.layoutAlgorithm.kmeansThreshold;let k=y.processedGridSize/2,O=w(C,{x:0,y:0}),z=w(C,{x:k,y:k});s=Math.abs(O.x-z.x),a=Math.abs(O.y-z.y);for(let t=0;t<I.length;t++)!C.dataMaxX&&((0,o.defined)(l)&&(0,o.defined)(n)&&(0,o.defined)(h)&&(0,o.defined)(u)?(0,o.isNumber)(M[t])&&(0,o.isNumber)(h)&&(0,o.isNumber)(u)&&(l=Math.max(I[t],l),n=Math.min(I[t],n),h=Math.max(M[t]||h,h),u=Math.min(M[t]||u,u)):(l=n=I[t],h=u=M[t])),I[t]>=v.minX-s&&I[t]<=v.maxX+s&&(M[t]||v.minY)>=v.minY-a&&(M[t]||v.maxY)<=v.maxY+a&&(L.push(I[t]),P.push(M[t]),X.push(t));if((0,o.defined)(l)&&(0,o.defined)(n)&&(0,o.isNumber)(h)&&(0,o.isNumber)(u)&&(C.dataMaxX=l,C.dataMinX=n,C.dataMaxY=h,C.dataMinY=u),f=(g=((0,o.isFunction)(c)?c:C.markerClusterAlgorithms?c&&C.markerClusterAlgorithms[c]?C.markerClusterAlgorithms[c]:L.length<r?C.markerClusterAlgorithms.kmeans:C.markerClusterAlgorithms.grid:()=>!1).call(this,L,P,X,y))?C.getClusteredData(g,A):g,A.animation&&C.markerClusterInfo?.pointsState?.oldState){var Y=C.markerClusterInfo.pointsState.oldState;for(let t of Object.keys(Y))Y[t].point?.destroy?.();t=C.markerClusterInfo.pointsState.newState}else t={};e=I.length,i=C.markerClusterInfo,f&&(C.dataTable.modified=new p({columns:{x:f.groupedXData,y:f.groupedYData}}),C.hasGroupedData=!0,C.markerClusterInfo=f,C.groupMap=f.groupMap),m.apply(this),f&&C.markerClusterInfo&&(C.markerClusterInfo.clusters?.forEach(t=>{(x=C.points[t.index]).isCluster=!0,x.clusteredData=t.data,x.clusterPointsAmount=t.data.length,t.point=x,(0,o.addEvent)(x,"click",S)}),C.markerClusterInfo.noise?.forEach(t=>{t.point=C.points[t.index]}),A.animation&&C.markerClusterInfo&&(C.markerClusterInfo.pointsState={oldState:t,newState:C.getPointsState(f,i,e)}),A.animation?this.hideClusteredData():this.destroyClusteredData(),this.markerClusterSeriesData=this.hasGroupedData?this.points:null)}else m.apply(this)}function P(t,e,i){let r=[];for(let s=0;s<t.length;s++){let a=R(this,{x:e,y:i}),o=R(this,{x:t[s].posX,y:t[s].posY}),n=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2));r.push({clusterIndex:s,distance:n})}return r.sort((t,e)=>t.distance-e.distance)}function X(t,e){let i=this.options.data,r=[],s=[],a=[],n=[],l=[],u=Math.max(2,e.minimumClusterSize||2),h=0,p,c,m,f,g,y,x,C,k,M,S,w;if((0,o.isFunction)(e.layoutAlgorithm.type)&&!this.isValidGroupedDataObject(t))return(0,o.error)("Highcharts marker-clusters module: The custom algorithm result is not valid!",!1,this.chart),!1;for(let A in t)if(t[A].length>=u){if(m=t[A],p=I(),g=m.length,e.zones)for(let t=0;t<e.zones.length;t++)g>=e.zones[t].from&&g<=e.zones[t].to&&((S=e.zones[t]).zoneIndex=t,M=e.zones[t].marker,w=e.zones[t].className);k=b(m),"grid"!==e.layoutAlgorithm.type||e.allowOverlap?x={x:k.x,y:k.y}:(y=this.options.marker||{},x=this.preventClusterCollisions({x:k.x,y:k.y,key:A,groupedData:t,gridSize:this.getScaledGridSize(e.layoutAlgorithm),defaultRadius:y.radius||3+(y.lineWidth||0),clusterRadius:M?.radius??e.marker?.radius??d.marker.radius??0}));for(let t=0;t<g;t++)m[t].parentStateId=p;if(a.push({x:x.x,y:x.y,id:A,stateId:p,index:h,data:m,clusterZone:S,clusterZoneClassName:w}),r.push(x.x),s.push(x.y),l.push({options:{formatPrefix:"cluster",dataLabels:e.dataLabels,marker:(0,o.merge)(e.marker,{states:e.states},M||{})}}),i?.length)for(let t=0;t<g;t++)(0,o.isObject)(i[m[t].dataIndex])&&(m[t].options=i[m[t].dataIndex]);h++,M=null}else for(let e=0;e<t[A].length;e++)c=t[A][e],p=I(),C=null,f=i?.[c.dataIndex],r.push(c.x),s.push(c.y),c.parentStateId=p,n.push({x:c.x,y:c.y,id:A,stateId:p,index:h,data:t[A]}),C=f&&"object"==typeof f&&!(0,o.isArray)(f)?(0,o.merge)(f,{x:c.x,y:c.y}):{userOptions:f,x:c.x,y:c.y},l.push({options:C}),h++;return{clusters:a,noise:n,groupedXData:r,groupedYData:s,groupMap:l}}function Y(){let{chart:t,xAxis:e,yAxis:i}=this,r=0;return{plotLeft:r=e&&this.dataMinX&&this.dataMaxX?e.reversed?e.toPixels(this.dataMaxX):e.toPixels(this.dataMinX):t.plotLeft,plotTop:i&&this.dataMinY&&this.dataMaxY?i.reversed?i.toPixels(this.dataMinY):i.toPixels(this.dataMaxY):t.plotTop}}function O(t,e,i){let r,s,a=e?k(e,i):[],o=k(t,i),n={};f=[],t.clusters.forEach(t=>{n[t.stateId]={x:t.x,y:t.y,id:t.stateId,point:t.point,parentsId:[]}}),t.noise.forEach(t=>{n[t.stateId]={x:t.x,y:t.y,id:t.stateId,point:t.point,parentsId:[]}});for(let t=0;t<o.length;t++)r=o[t],s=a[t],r?.parentStateId&&s?.parentStateId&&n[r.parentStateId]?.parentsId.indexOf(s.parentStateId)===-1&&(n[r.parentStateId].parentsId.push(s.parentStateId),-1===f.indexOf(s.parentStateId)&&f.push(s.parentStateId));return n}function z(){let t=this.chart,e=t.mapView?0:t.plotLeft,i=w(this,{x:e,y:t.mapView?0:t.plotTop}),r=w(this,{x:e+t.plotWidth,y:e+t.plotHeight}),s=i.x,a=r.x,o=i.y,n=r.y;return{minX:Math.min(s,a),maxX:Math.max(s,a),minY:Math.min(o,n),maxY:Math.max(o,n)}}function D(t){let e=this.xAxis,i=this.chart.mapView,r=Number(t.processedGridSize??(0,o.relativeLength)(t.gridSize||d.layoutAlgorithm.gridSize,this.chart.plotWidth)),s=!0,a=1,n=1;this.gridValueSize||(i?this.gridValueSize=r/i.getScale():this.gridValueSize=Math.abs(e.toValue(r)-e.toValue(0)));let l=i?this.gridValueSize*i.getScale():e.toPixels(this.gridValueSize)-e.toPixels(0),u=0!==l?Math.abs(+(r/l).toFixed(14)):1;for(;s&&1!==u;){let t=Math.pow(2,a);u>.75&&u<1.25?s=!1:u>=1/t&&u<1/t*2?(s=!1,n=t):u<=t&&u>t/2&&(s=!1,n=1/t),a++}return r/n/u}function E(){let t=this.markerClusterSeriesData,e=this.markerClusterInfo?.pointsState?.oldState,i=f.map(t=>e?.[t].point?.id||"");t?.forEach(t=>{t&&-1!==i.indexOf(t.id)?(t.graphic&&t.graphic.hide(),t.dataLabel&&t.dataLabel.hide()):t?.destroy?.()})}function T(t){let e=!1;return!!(0,o.isObject)(t)&&((0,o.objectEach)(t,t=>{if(e=!0,!(0,o.isArray)(t)||!t.length){e=!1;return}for(let i=0;i<t.length;i++)if(!(0,o.isObject)(t[i])||!t[i].x||!t[i].y){e=!1;return}}),e)}function j(t){let[e,i]=t.key.split(":").map(parseFloat),r=t.gridSize,s=t.groupedData,a=t.defaultRadius,n=t.clusterRadius,l=i*r,u=e*r,h=R(this,t),p=[],c=this.options.cluster?.marker,m=this.options.cluster?.zones,f=this.getGridOffset(),g=h.x,y=h.y,x=0,C=0,k,I,M,S,A,v,L,P,X,Y,O,z;g-=f.plotLeft,y-=f.plotTop;for(let s=1;s<5;s++)for(L=0,M=s%2?-1:1,S=s<3?-1:1,A=Math.floor((g+M*n)/r),z=[(v=Math.floor((y+S*n)/r))+":"+A,v+":"+i,e+":"+A];L<z.length;L++)-1===p.indexOf(z[L])&&z[L]!==t.key&&p.push(z[L]);for(let t of p)if(s[t]){s[t].posX||(Y=b(s[t]),s[t].posX=Y.x,s[t].posY=Y.y);let h=R(this,{x:s[t].posX||0,y:s[t].posY||0});if(k=h.x-f.plotLeft,I=h.y-f.plotTop,[X,P]=t.split(":").map(parseFloat),m){x=s[t].length;for(let t=0;t<m.length;t++)x>=m[t].from&&x<=m[t].to&&(C=(0,o.defined)(m[t].marker?.radius)?m[t].marker.radius||0:c?.radius?c.radius:d.marker.radius??0)}s[t].length>1&&0===C&&c?.radius?C=c.radius:1===s[t].length&&(C=a),O=n+C,C=0,P!==i&&Math.abs(g-k)<O&&(g=P-i<0?l+n:l+r-n),X!==e&&Math.abs(y-I)<O&&(y=X-e<0?u+n:u+r-n)}let D=w(this,{x:g+f.plotLeft,y:y+f.plotTop});return s[t.key].posX=D.x,s[t.key].posY=D.y,D}function R(t,e){let{chart:i,xAxis:r,yAxis:s}=t;return i.mapView?i.mapView.projectedUnitsToPixels(e):{x:r?r.toPixels(e.x):0,y:s?s.toPixels(e.y):0}}let V=function(t,e){let i=e.prototype;!i.markerClusterAlgorithms&&(m=i.generatePoints,i.markerClusterAlgorithms=c,i.animateClusterPoint=A,i.destroyClusteredData=v,i.generatePoints=L,i.getClusterDistancesFromPoint=P,i.getClusteredData=X,i.getGridOffset=Y,i.getPointsState=O,i.getRealExtremes=z,i.getScaledGridSize=D,i.hideClusteredData=E,i.isValidGroupedDataObject=T,i.preventClusterCollisions=j,(0,o.addEvent)(e,"destroy",i.destroyClusteredData),t.plotOptions&&(t.plotOptions.series=(0,o.merge)(t.plotOptions.series,l)))},{defaultOptions:G}=n(),{composed:N}=n();function F(){let t=this.chart,e=0;for(let i of t.series)if(i.markerClusterInfo){let t=i.options.cluster;e=(0,o.animObject)((t||{}).animation).duration||0}(0,o.syncTimeout)(()=>{t.tooltip&&t.tooltip.destroy()},e)}function q(){for(let t of this.series||[])if(t.markerClusterInfo){let e=t.options.cluster,i=((t.markerClusterInfo||{}).pointsState||{}).oldState;if((e||{}).animation&&t.markerClusterInfo&&0===(t.chart.pointer?.pinchDown||[]).length&&"pan"!==((t.xAxis||{}).eventArgs||{}).trigger&&i&&Object.keys(i).length){for(let e of t.markerClusterInfo.clusters)t.animateClusterPoint(e);for(let e of t.markerClusterInfo.noise)t.animateClusterPoint(e)}}}function W(t){let e=(((t.point||t.target).series.options.cluster||{}).events||{}).drillToCluster;(0,o.isFunction)(e)&&e.call(this,t)}function H(){if(this.dataGroup)return(0,o.error)("Highcharts marker-clusters module: Running `Point.update` when point belongs to clustered series is not supported.",!1,this.series.chart),!1}function K(){let t=(this.options.cluster||{}).drillToCluster;if(this.markerClusterInfo&&this.markerClusterInfo.clusters)for(let e of this.markerClusterInfo.clusters)e.point&&e.point.graphic&&(e.point.graphic.addClass("highcharts-cluster-point"),t&&e.point&&(e.point.graphic.css({cursor:"pointer"}),e.point.dataLabel&&e.point.dataLabel.css({cursor:"pointer"})),(0,o.defined)(e.clusterZone)&&e.point.graphic.addClass(e.clusterZoneClassName||"highcharts-cluster-zone-"+e.clusterZone.zoneIndex))}function _(t,i,r,s){let a=r/2,o=s/2,n=e.arc(t+a,i+o,a-4,o-4,{start:.5*Math.PI,end:2.5*Math.PI,open:!1}),l=e.arc(t+a,i+o,a-3,o-3,{start:.5*Math.PI,end:2.5*Math.PI,innerR:a-2,open:!1});return e.arc(t+a,i+o,a-1,o-1,{start:.5*Math.PI,end:2.5*Math.PI,innerR:a,open:!1}).concat(l,n)}(G.plotOptions||{}).series=(0,o.merge)((G.plotOptions||{}).series,l);let Z=n();({compose:function(t,e,i,r){if((0,o.pushUnique)(N,"MarkerClusters")){let s=r.prototype.pointClass,{scatter:a}=r.types;(0,o.addEvent)(t,"setExtremes",F),(0,o.addEvent)(e,"render",q),(0,o.addEvent)(s,"drillToCluster",W),(0,o.addEvent)(s,"update",H),(0,o.addEvent)(r,"afterRender",K),a&&V(i,a)}}}).compose(Z.Axis,Z.Chart,Z.defaultOptions,Z.Series),({compose:function(t){(e=t.prototype.symbols).cluster=_}}).compose(Z.SVGRenderer);let B=n();return a.default})());