@unovis/ts 1.3.0-beta.2 → 1.3.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/components/area/config.d.ts +10 -6
  2. package/components/area/config.js +12 -3
  3. package/components/area/config.js.map +1 -1
  4. package/components/area/index.d.ts +6 -5
  5. package/components/area/index.js +9 -10
  6. package/components/area/index.js.map +1 -1
  7. package/components/axis/config.d.ts +27 -3
  8. package/components/axis/config.js +30 -3
  9. package/components/axis/config.js.map +1 -1
  10. package/components/axis/index.d.ts +3 -4
  11. package/components/axis/index.js +4 -7
  12. package/components/axis/index.js.map +1 -1
  13. package/components/brush/config.d.ts +12 -2
  14. package/components/brush/config.js +20 -11
  15. package/components/brush/config.js.map +1 -1
  16. package/components/brush/index.d.ts +3 -4
  17. package/components/brush/index.js +3 -4
  18. package/components/brush/index.js.map +1 -1
  19. package/components/bullet-legend/config.d.ts +10 -1
  20. package/components/bullet-legend/config.js +14 -11
  21. package/components/bullet-legend/config.js.map +1 -1
  22. package/components/bullet-legend/index.d.ts +3 -4
  23. package/components/bullet-legend/index.js +2 -5
  24. package/components/bullet-legend/index.js.map +1 -1
  25. package/components/chord-diagram/config.d.ts +23 -7
  26. package/components/chord-diagram/config.js +22 -3
  27. package/components/chord-diagram/config.js.map +1 -1
  28. package/components/chord-diagram/index.d.ts +3 -4
  29. package/components/chord-diagram/index.js +6 -7
  30. package/components/chord-diagram/index.js.map +1 -1
  31. package/components/chord-diagram/modules/label.d.ts +3 -3
  32. package/components/chord-diagram/modules/label.js +1 -1
  33. package/components/chord-diagram/modules/label.js.map +1 -1
  34. package/components/chord-diagram/modules/link.d.ts +2 -2
  35. package/components/chord-diagram/modules/link.js.map +1 -1
  36. package/components/chord-diagram/modules/node.d.ts +2 -2
  37. package/components/chord-diagram/modules/node.js.map +1 -1
  38. package/components/chord-diagram/types.d.ts +2 -3
  39. package/components/chord-diagram/types.js.map +1 -1
  40. package/components/crosshair/config.d.ts +14 -4
  41. package/components/crosshair/config.js +16 -3
  42. package/components/crosshair/config.js.map +1 -1
  43. package/components/crosshair/index.d.ts +3 -4
  44. package/components/crosshair/index.js +3 -4
  45. package/components/crosshair/index.js.map +1 -1
  46. package/components/donut/config.d.ts +19 -2
  47. package/components/donut/config.js +24 -5
  48. package/components/donut/config.js.map +1 -1
  49. package/components/donut/index.d.ts +3 -4
  50. package/components/donut/index.js +4 -5
  51. package/components/donut/index.js.map +1 -1
  52. package/components/donut/modules/arc.d.ts +3 -3
  53. package/components/donut/modules/arc.js.map +1 -1
  54. package/components/flow-legend/config.d.ts +11 -1
  55. package/components/flow-legend/config.js +16 -11
  56. package/components/flow-legend/config.js.map +1 -1
  57. package/components/flow-legend/index.d.ts +3 -4
  58. package/components/flow-legend/index.js +2 -5
  59. package/components/flow-legend/index.js.map +1 -1
  60. package/components/free-brush/config.d.ts +12 -2
  61. package/components/free-brush/config.js +20 -11
  62. package/components/free-brush/config.js.map +1 -1
  63. package/components/free-brush/index.d.ts +3 -4
  64. package/components/free-brush/index.js +5 -6
  65. package/components/free-brush/index.js.map +1 -1
  66. package/components/graph/config.d.ts +75 -3
  67. package/components/graph/config.js +78 -12
  68. package/components/graph/config.js.map +1 -1
  69. package/components/graph/index.d.ts +7 -8
  70. package/components/graph/index.js +3 -4
  71. package/components/graph/index.js.map +1 -1
  72. package/components/graph/modules/layout.d.ts +7 -7
  73. package/components/graph/modules/layout.js.map +1 -1
  74. package/components/graph/modules/link/helper.d.ts +5 -5
  75. package/components/graph/modules/link/helper.js.map +1 -1
  76. package/components/graph/modules/link/index.d.ts +6 -6
  77. package/components/graph/modules/link/index.js.map +1 -1
  78. package/components/graph/modules/node/index.d.ts +6 -6
  79. package/components/graph/modules/node/index.js +2 -2
  80. package/components/graph/modules/node/index.js.map +1 -1
  81. package/components/graph/modules/panel/helper.d.ts +4 -4
  82. package/components/graph/modules/panel/helper.js.map +1 -1
  83. package/components/graph/modules/panel/index.d.ts +3 -3
  84. package/components/graph/modules/panel/index.js.map +1 -1
  85. package/components/grouped-bar/config.d.ts +13 -5
  86. package/components/grouped-bar/config.js +16 -5
  87. package/components/grouped-bar/config.js.map +1 -1
  88. package/components/grouped-bar/index.d.ts +3 -4
  89. package/components/grouped-bar/index.js +3 -4
  90. package/components/grouped-bar/index.js.map +1 -1
  91. package/components/leaflet-flow-map/config.d.ts +16 -2
  92. package/components/leaflet-flow-map/config.js +21 -3
  93. package/components/leaflet-flow-map/config.js.map +1 -1
  94. package/components/leaflet-flow-map/index.d.ts +3 -4
  95. package/components/leaflet-flow-map/index.js +2 -3
  96. package/components/leaflet-flow-map/index.js.map +1 -1
  97. package/components/leaflet-map/config.d.ts +59 -4
  98. package/components/leaflet-map/config.js +67 -23
  99. package/components/leaflet-map/config.js.map +1 -1
  100. package/components/leaflet-map/index.d.ts +3 -4
  101. package/components/leaflet-map/index.js +3 -4
  102. package/components/leaflet-map/index.js.map +1 -1
  103. package/components/leaflet-map/modules/map.d.ts +3 -3
  104. package/components/leaflet-map/modules/map.js.map +1 -1
  105. package/components/leaflet-map/modules/utils.d.ts +4 -4
  106. package/components/leaflet-map/modules/utils.js +2 -6
  107. package/components/leaflet-map/modules/utils.js.map +1 -1
  108. package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +2 -2
  109. package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -1
  110. package/components/line/config.d.ts +11 -6
  111. package/components/line/config.js +13 -3
  112. package/components/line/config.js.map +1 -1
  113. package/components/line/index.d.ts +3 -4
  114. package/components/line/index.js +4 -5
  115. package/components/line/index.js.map +1 -1
  116. package/components/nested-donut/config.d.ts +21 -2
  117. package/components/nested-donut/config.js +24 -3
  118. package/components/nested-donut/config.js.map +1 -1
  119. package/components/nested-donut/index.d.ts +3 -4
  120. package/components/nested-donut/index.js +3 -4
  121. package/components/nested-donut/index.js.map +1 -1
  122. package/components/nested-donut/modules/arc.d.ts +3 -3
  123. package/components/nested-donut/modules/arc.js.map +1 -1
  124. package/components/nested-donut/modules/label.d.ts +2 -2
  125. package/components/nested-donut/modules/label.js.map +1 -1
  126. package/components/sankey/config.d.ts +47 -2
  127. package/components/sankey/config.js +57 -10
  128. package/components/sankey/config.js.map +1 -1
  129. package/components/sankey/index.d.ts +3 -4
  130. package/components/sankey/index.js +2 -3
  131. package/components/sankey/index.js.map +1 -1
  132. package/components/sankey/modules/label.d.ts +7 -7
  133. package/components/sankey/modules/label.js.map +1 -1
  134. package/components/sankey/modules/link.d.ts +2 -2
  135. package/components/sankey/modules/link.js.map +1 -1
  136. package/components/sankey/modules/node.d.ts +7 -7
  137. package/components/sankey/modules/node.js +1 -1
  138. package/components/sankey/modules/node.js.map +1 -1
  139. package/components/scatter/config.d.ts +16 -4
  140. package/components/scatter/config.js +19 -5
  141. package/components/scatter/config.js.map +1 -1
  142. package/components/scatter/index.d.ts +3 -4
  143. package/components/scatter/index.js +5 -5
  144. package/components/scatter/index.js.map +1 -1
  145. package/components/scatter/modules/point.d.ts +2 -2
  146. package/components/scatter/modules/point.js.map +1 -1
  147. package/components/scatter/modules/utils.d.ts +2 -2
  148. package/components/scatter/modules/utils.js.map +1 -1
  149. package/components/stacked-bar/config.d.ts +13 -5
  150. package/components/stacked-bar/config.js +16 -5
  151. package/components/stacked-bar/config.js.map +1 -1
  152. package/components/stacked-bar/index.d.ts +3 -4
  153. package/components/stacked-bar/index.js +3 -4
  154. package/components/stacked-bar/index.js.map +1 -1
  155. package/components/timeline/config.d.ts +16 -5
  156. package/components/timeline/config.js +21 -9
  157. package/components/timeline/config.js.map +1 -1
  158. package/components/timeline/index.d.ts +3 -4
  159. package/components/timeline/index.js +3 -4
  160. package/components/timeline/index.js.map +1 -1
  161. package/components/tooltip/config.d.ts +15 -1
  162. package/components/tooltip/config.js +16 -12
  163. package/components/tooltip/config.js.map +1 -1
  164. package/components/tooltip/index.d.ts +3 -4
  165. package/components/tooltip/index.js +3 -5
  166. package/components/tooltip/index.js.map +1 -1
  167. package/components/topojson-map/config.d.ts +36 -4
  168. package/components/topojson-map/config.js +38 -3
  169. package/components/topojson-map/config.js.map +1 -1
  170. package/components/topojson-map/index.d.ts +3 -4
  171. package/components/topojson-map/index.js +4 -4
  172. package/components/topojson-map/index.js.map +1 -1
  173. package/components/vis-controls/config.d.ts +5 -1
  174. package/components/vis-controls/config.js +9 -6
  175. package/components/vis-controls/config.js.map +1 -1
  176. package/components/vis-controls/index.d.ts +2 -3
  177. package/components/vis-controls/index.js +2 -5
  178. package/components/vis-controls/index.js.map +1 -1
  179. package/components/xy-labels/config.d.ts +16 -4
  180. package/components/xy-labels/config.js +20 -5
  181. package/components/xy-labels/config.js.map +1 -1
  182. package/components/xy-labels/index.d.ts +3 -4
  183. package/components/xy-labels/index.js +2 -3
  184. package/components/xy-labels/index.js.map +1 -1
  185. package/components/xy-labels/modules/label.d.ts +3 -3
  186. package/components/xy-labels/modules/label.js +1 -1
  187. package/components/xy-labels/modules/label.js.map +1 -1
  188. package/containers/single-container/config.d.ts +4 -2
  189. package/containers/single-container/config.js +8 -3
  190. package/containers/single-container/config.js.map +1 -1
  191. package/containers/single-container/index.d.ts +3 -4
  192. package/containers/single-container/index.js +2 -2
  193. package/containers/single-container/index.js.map +1 -1
  194. package/containers/xy-container/config.d.ts +22 -2
  195. package/containers/xy-container/config.js +26 -3
  196. package/containers/xy-container/config.js.map +1 -1
  197. package/containers/xy-container/index.d.ts +2 -5
  198. package/containers/xy-container/index.js +2 -2
  199. package/containers/xy-container/index.js.map +1 -1
  200. package/core/component/config.d.ts +6 -1
  201. package/core/component/config.js +12 -6
  202. package/core/component/config.js.map +1 -1
  203. package/core/component/index.d.ts +5 -7
  204. package/core/component/index.js +7 -8
  205. package/core/component/index.js.map +1 -1
  206. package/core/config/index.d.ts +3 -0
  207. package/core/config/index.js +16 -0
  208. package/core/config/index.js.map +1 -0
  209. package/core/container/config.d.ts +21 -1
  210. package/core/container/config.js +25 -21
  211. package/core/container/config.js.map +1 -1
  212. package/core/container/index.d.ts +4 -5
  213. package/core/container/index.js +3 -4
  214. package/core/container/index.js.map +1 -1
  215. package/core/xy-component/config.d.ts +10 -2
  216. package/core/xy-component/config.js +16 -7
  217. package/core/xy-component/config.js.map +1 -1
  218. package/core/xy-component/index.d.ts +4 -5
  219. package/core/xy-component/index.js +0 -2
  220. package/core/xy-component/index.js.map +1 -1
  221. package/data-models/map-graph.d.ts +1 -1
  222. package/data-models/map-graph.js +1 -1
  223. package/data-models/map-graph.js.map +1 -1
  224. package/package.json +1 -1
  225. package/types/accessor.d.ts +1 -1
  226. package/utils/data.d.ts +1 -1
  227. package/utils/data.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/leaflet-map/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { packSiblings } from 'd3-hierarchy'\nimport type L from 'leaflet'\nimport Supercluster, { ClusterFeature, PointFeature } from 'supercluster'\nimport { StyleSpecification } from 'maplibre-gl'\n\n// Core\nimport { ComponentCore } from 'core/component'\n\n// Model\nimport { MapDataModel } from 'data-models/map'\n\n// Types\nimport { ComponentType } from 'types/component'\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { ResizeObserver } from 'utils/resize-observer'\nimport { clamp, isNil, getNumber, getString, isString } from 'utils/data'\nimport { constraintMapViewThrottled } from './renderer/mapboxgl-utils'\nimport {\n projectPoint,\n bBoxMerge,\n calculateClusterIndex,\n getNextZoomLevelOnClusterClick,\n findPointAndClusterByPointId,\n geoJsonPointToScreenPoint,\n getClusterRadius,\n getClustersAndPoints,\n getNodeRelativePosition,\n getPointRadius,\n shouldClusterExpand,\n} from './modules/utils'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapClusterDatum,\n LeafletMapPoint,\n LeafletMapPointDatum,\n LeafletMapRenderer,\n MapZoomState,\n PointExpandedClusterProperties,\n} from './types'\n\n// Config\nimport { LeafletMapDefaultConfig, LeafletMapConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\n// Modules\nimport { initialMapCenter, initialMapZoom, setupMap, updateTopoJson } from './modules/map'\nimport { collideLabels, createNodes, removeNodes, updateNodes } from './modules/node'\nimport { createNodeSelectionRing, updateNodeSelectionRing } from './modules/selectionRing'\nimport { createBackgroundNode, updateBackgroundNode } from './modules/clusterBackground'\n\nexport class LeafletMap<Datum extends GenericDataRecord> extends ComponentCore<Datum[], LeafletMapConfigInterface<Datum>> {\n static selectors = s\n static cssVariables = s.variables\n protected _defaultConfig = LeafletMapDefaultConfig as LeafletMapConfigInterface<Datum>\n public config: LeafletMapConfigInterface<Datum> = this._defaultConfig\n\n g: Selection<HTMLElement, unknown, null, undefined>\n type = ComponentType.HTML\n element: HTMLElement\n datamodel: MapDataModel<Datum> = new MapDataModel()\n protected _container: HTMLElement\n protected _containerSelection: Selection<HTMLElement, unknown, null, undefined>\n public _onMapMoveEndInternal: (leaflet: L.Map) => void // Internal callback needed by Leaflet Flow Map\n private _map: {\n leaflet: L.Map;\n layer: L.Layer;\n svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;\n svgGroup: Selection<SVGGElement, unknown, SVGElement, undefined>;\n }\n\n private _clusterIndex: Supercluster<Datum>\n private _expandedCluster: { points: PointFeature<PointExpandedClusterProperties<Datum>>[]; cluster: LeafletMapPoint<Datum> } = null\n private _cancelBackgroundClick = false\n private _hasBeenMoved = false\n private _hasBeenZoomed = false\n private _isMoving = false\n private _isZooming = false\n private _eventInitiatedByComponent = false\n private _triggerBackgroundClick = false\n private _externallySelectedPoint: LeafletMapPoint<Datum> | PointFeature<Datum> | null = null\n private _zoomingToExternallySelectedPoint = false\n private _forceExpandCluster = false\n private _pointGroup: Selection<SVGGElement, unknown, SVGElement, undefined>\n private _pointSelectionRing: Selection<SVGGElement, unknown, SVGElement, undefined>\n private _clusterBackground: Selection<SVGGElement, unknown, SVGElement, undefined>\n private _clusterBackgroundRadius = 0\n private _selectedPoint: LeafletMapPoint<Datum> = null\n private _currentZoomLevel: number | null = null\n private _firstRender = true\n private _isDarkThemeActive = false\n private resizeObserver: ResizeObserver\n private themeObserver: MutationObserver\n private _renderDataAnimationFrameId: number | null = null\n private _flyToBoundsAnimationFrameId: number | null = null\n readonly _leafletInitializationPromise: Promise<L.Map>\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n static DEFAULT_CONTAINER_HEIGHT = 600\n\n events = {\n [LeafletMap.selectors.point]: {\n mouseup: this._onPointMouseUp.bind(this),\n mousedown: this._onPointMouseDown.bind(this),\n click: this._onPointClick.bind(this),\n },\n }\n\n constructor (container: HTMLElement, config?: LeafletMapConfigInterface<Datum>, data?: Datum[]) {\n super(ComponentType.HTML)\n this._container = container\n this._containerSelection = select(this._container).attr('role', 'figure')\n\n this._container.appendChild(this.element)\n this.g\n .attr('class', s.root)\n .attr('aria-hidden', true)\n\n if (config) this.setConfig(config)\n\n if (!this._container.clientWidth) {\n console.warn('Unovis | Leaflet Map: The width of the container is not set. Setting to 100%.')\n this._containerSelection.style('width', '100%')\n }\n\n if (!this._container.clientHeight) {\n console.warn(`Unovis | Leaflet Map: The height of the container is not set. Setting to ${LeafletMap.DEFAULT_CONTAINER_HEIGHT}px.`)\n this._containerSelection.style('height', `${LeafletMap.DEFAULT_CONTAINER_HEIGHT}px`)\n }\n\n // Initialize map asynchronously\n this._leafletInitializationPromise = new Promise((resolve) => {\n setupMap(this.element, this.config).then(map => {\n // Apply the `s.map` class to `tilePane` to allow tooltip interactions\n select(map.leaflet.getPanes().tilePane).classed(s.map, true)\n if (config) this.setConfig(config)\n\n this._map = map\n this._map.leaflet.on('drag', this._onMapDragLeaflet.bind(this))\n this._map.leaflet.on('move', this._onMapMove.bind(this))\n this._map.leaflet.on('movestart', this._onMapMoveStart.bind(this))\n this._map.leaflet.on('moveend', this._onMapMoveEnd.bind(this))\n this._map.leaflet.on('zoom', this._onMapZoom.bind(this))\n this._map.leaflet.on('zoomstart', this._onMapZoomStart.bind(this))\n this._map.leaflet.on('zoomend', this._onMapZoomEnd.bind(this))\n\n // We need to handle background click in a special way to deal\n // with d3 svg overlay that might have smaller size than the map itself\n // (see this._onNodeMouseDown() and this this._onNodeMouseDown())\n this._map.leaflet.on('mousedown', () => {\n if (!this._cancelBackgroundClick) this._triggerBackgroundClick = true\n })\n\n this._map.leaflet.on('mouseup', (e) => {\n if (this._triggerBackgroundClick) {\n this._triggerBackgroundClick = false\n const originalEvent = (e as any).originalEvent\n this._onBackgroundClick(originalEvent.target, originalEvent)\n }\n })\n\n this._map.svgOverlay\n .attr('class', s.svgOverlay)\n .insert('rect', ':first-child')\n .attr('class', s.backgroundRect)\n .attr('width', '100%')\n .attr('height', '100%')\n\n this._pointGroup = this._map.svgGroup.append('g').attr('class', s.points)\n this._clusterBackground = this._pointGroup.append('g')\n .attr('class', s.clusterBackground)\n .call(createBackgroundNode)\n this._pointSelectionRing = this._pointGroup.append('g')\n .attr('class', s.pointSelectionRing)\n .call(createNodeSelectionRing)\n\n this._map.leaflet.setView(initialMapCenter, initialMapZoom)\n\n if (document.body.classList.contains('theme-dark') && config.styleDarkTheme) {\n this._isDarkThemeActive = true\n this.setTheme(config.styleDarkTheme)\n }\n\n this.config.onMapInitialized?.()\n resolve(this._map.leaflet)\n })\n })\n\n\n // Set data and render the map when it's ready\n this.setData(data ?? [])\n\n // When the container size changes we have to initiate map resize in order to update its dimensions\n this.resizeObserver = new ResizeObserver(() => {\n this._map?.leaflet?.invalidateSize()\n this.config.tooltip?.hide()\n })\n this.resizeObserver.observe(container)\n\n // If dark theme is enabled, update map's style when document body's class list changes\n if (this.config.styleDarkTheme) {\n this.themeObserver = new MutationObserver((mutations) => {\n mutations.forEach(change => {\n if (change.attributeName === 'class') {\n const isDarkTheme = (change.target as HTMLElement).classList.contains('theme-dark')\n if (this._isDarkThemeActive !== isDarkTheme) {\n this.setTheme(isDarkTheme ? this.config.styleDarkTheme : this.config.style)\n this._isDarkThemeActive = isDarkTheme\n }\n }\n })\n })\n this.themeObserver.observe(document.body, { attributes: true })\n }\n }\n\n setConfig (config: LeafletMapConfigInterface<Datum>): void {\n super.setConfig(config)\n\n if (config.width) this._containerSelection.style('width', isString(config.width) ? config.width : `${config.width}px`)\n if (config.height) this._containerSelection.style('height', isString(config.height) ? config.height : `${config.height}px`)\n\n if (this._map && config.renderer === LeafletMapRenderer.MapLibre) {\n const layer = this._map.layer as any // Using any because the typings are not full\n const maplibreMap = layer.getMaplibreMap()\n if (maplibreMap.isStyleLoaded()) updateTopoJson(maplibreMap, this.config)\n }\n\n if (this.config.tooltip) {\n this.config.tooltip.setContainer(this._container)\n this.config.tooltip.setComponents([this])\n this.config.tooltip.update()\n }\n\n // Apply the `aria-label` attribute\n this._containerSelection.attr('aria-label', config.ariaLabel)\n }\n\n setData (data: Datum[]): void {\n const { config, datamodel } = this\n\n const dataValid = data.filter(d => {\n const lat = getNumber(d, config.pointLatitude)\n const lon = getNumber(d, config.pointLongitude)\n const valid = isFinite(lat) && isFinite(lon)\n\n if (!valid) console.warn('Unovis | Leaflet Map: Invalid point coordinates', d)\n return valid\n })\n\n datamodel.data = dataValid\n\n // We use Supercluster for real-time node clustering\n this._clusterIndex = calculateClusterIndex<Datum>(dataValid, this.config)\n\n // If there was an expanded cluster, try to find its successor and expand it too\n if (this._expandedCluster && this._map.leaflet) {\n // Reset expanded cluster before calling `_getPointData()` to get data with all clusters collapsed\n const expandedCluster = this._expandedCluster\n this._resetExpandedCluster()\n const pointData = this._getPointData()\n\n const expandedClusterCenterPx = projectPoint(expandedCluster.cluster, this._map.leaflet)\n const expandedClusterRadiusPx = expandedCluster.cluster.radius\n const cluster = pointData.find((c) => {\n if (!c.isCluster) return false\n const pos = projectPoint(c, this._map.leaflet)\n const r = c.radius\n const distance = Math.sqrt((expandedClusterCenterPx.x - pos.x) ** 2 + (expandedClusterCenterPx.y - pos.y) ** 2)\n return distance < (expandedClusterRadiusPx + r)\n })\n\n if (cluster) this._expandCluster(cluster, true)\n }\n\n // Render\n this._leafletInitializationPromise.then(() => {\n this.render()\n })\n }\n\n setTheme (theme: StyleSpecification | string): void {\n const layer = this._map.layer as any // Using any because the typings are not full\n if (this.config.renderer === LeafletMapRenderer.MapLibre) {\n const maplibreMap = layer.getMaplibreMap()\n maplibreMap.setStyle?.(theme)\n updateTopoJson(maplibreMap, this.config)\n } else {\n if (typeof theme !== 'string') {\n console.warn('Unovis | Leaflet Map: Invalid style. Provide a URL string for raster rendering mode.')\n return\n }\n layer.setUrl(theme)\n }\n }\n\n // We redefine the ComponentCore render function to bind event to newly created elements in this._renderData(),\n // which is being called after almost every map interaction\n render (): void {\n const { config } = this\n if (!this._map) return\n\n this._renderData()\n if (this._firstRender) {\n if (config.initialBounds) this.fitToBounds(config.initialBounds)\n else if (config.fitViewOnInit) this.fitToPoints(0, config.fitViewPadding)\n } else {\n if (config.fitViewOnUpdate) this.fitToPoints(0, config.fitViewPadding)\n else if (config.fitBoundsOnUpdate) this.fitToBounds(config.fitBoundsOnUpdate)\n }\n\n this._firstRender = false\n }\n\n public getLeafletInstancePromise (): Promise<L.Map> {\n return this._leafletInitializationPromise\n }\n\n public fitToPoints (duration = this.config.flyToDuration, padding = this.config.fitViewPadding): void {\n const { config, datamodel, datamodel: { data } } = this\n\n if (!this._map || !this._map.leaflet) return\n if (!data?.length) return\n const bounds = datamodel.getDataLatLngBounds(config.pointLatitude, config.pointLongitude)\n this._flyToBoundsAnimationFrameId = requestAnimationFrame(() => this._flyToBounds(bounds, duration, padding))\n }\n\n public fitToBounds (bounds: Bounds, duration = this.config.flyToDuration, padding = this.config.fitViewPadding): void {\n const { northEast, southWest } = bounds\n if (isNil(northEast) || isNil(southWest)) return\n if (isNil(northEast.lat) || isNil(northEast.lng)) return\n if (isNil(southWest.lat) || isNil(southWest.lng)) return\n if (!this._map || !this._map.leaflet) return\n this._flyToBoundsAnimationFrameId = requestAnimationFrame(() => this._flyToBounds([\n [northEast.lat, southWest.lng],\n [southWest.lat, northEast.lng],\n ], duration, padding))\n }\n\n /* Select a point by id and optionally center the map view.\n * This method was designed to be used mainly with the `[LeafletMap.selectors.point]` click events\n * (when the user actually clicks on a point) and the specified point is inside one of the collapsed\n * clusters it won't be selected. You can use the `zoomToPointById` method to achieve that.\n */\n public selectPointById (id: string, centerView = false): void {\n const { config } = this\n const pointData = this._getPointData()\n const foundPoint = pointData.find(d => (d.properties as LeafletMapPointDatum<Datum>).id === id)\n\n if (!foundPoint) {\n console.warn(`Unovis | Leaflet Map: Node with id ${id} can not be found`)\n return\n }\n\n if ((foundPoint.properties as LeafletMapClusterDatum<Datum>)?.cluster) {\n console.warn('Unovis | Leaflet Map: Cluster can\\'t be selected')\n return\n }\n\n this._selectedPoint = foundPoint\n\n const isPointInsideExpandedCluster = this._expandedCluster?.points?.find(d => getString(d.properties, config.pointId) === id)\n if (!isPointInsideExpandedCluster) this._resetExpandedCluster()\n\n if (centerView) {\n const coordinates = {\n lng: getNumber(foundPoint.properties as LeafletMapPointDatum<Datum>, config.pointLongitude),\n lat: getNumber(foundPoint.properties as LeafletMapPointDatum<Datum>, config.pointLatitude),\n }\n\n const zoomLevel = this._map.leaflet.getZoom()\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, zoomLevel, { duration: 0 })\n } else {\n this._renderData()\n }\n }\n\n /* Get the id of the selected point */\n public getSelectedPointId (): string | number | undefined {\n return this._selectedPoint?.id\n }\n\n /* Unselect point if it was selected before */\n public unselectPoint (): void {\n this._selectedPoint = null\n this._externallySelectedPoint = null\n this.render()\n }\n\n /** Get the currently expanded cluster */\n public getExpandedCluster (): { id: string; points: Datum[] } | undefined {\n if (!this._expandedCluster) return\n const id = this._expandedCluster.cluster?.id as string\n const points = this._expandedCluster.cluster?.clusterPoints.map(d => this.datamodel.data[(d as LeafletMapPointDatum<Datum>)._index])\n return { id, points }\n }\n\n /* Zoom to a point by id and optionally select it.\n * If the point is inside a cluster, it'll be automatically expanded to show the enclosed point.\n * You can also force set the zoom level by providing the `customZoomLevel` argument.\n */\n public zoomToPointById (id: string, selectPoint = false, customZoomLevel?: number): void {\n const { config, datamodel } = this\n if (!datamodel.data.length) {\n console.warn('Unovis | Leaflet Map: There are no points on the map')\n return\n }\n const dataBoundsAll = datamodel.getDataLatLngBounds(config.pointLatitude, config.pointLongitude)\n const bounds: [number, number, number, number] = [dataBoundsAll[0][1], dataBoundsAll[1][0], dataBoundsAll[1][1], dataBoundsAll[0][0]]\n const pointDataAll = this._getPointData(bounds)\n\n let foundPoint: LeafletMapPoint<Datum> | PointFeature<Datum> = pointDataAll\n .find((d: LeafletMapPoint<Datum>) => getString(d.properties as LeafletMapPointDatum<Datum>, config.pointId) === id)\n\n // If point was found and it's a cluster -> do nothing\n if ((foundPoint?.properties as LeafletMapClusterDatum<Datum>)?.cluster) {\n console.warn('Unovis | Leaflet Map: Cluster can\\'t be zoomed in')\n return\n }\n\n // If point was not found -> search for it in all collapsed clusters\n if (!foundPoint) {\n const { point } = findPointAndClusterByPointId(pointDataAll, id, config.pointId)\n foundPoint = point\n }\n\n if (foundPoint) {\n // If point was found and it's inside an expanded cluster -> simply select it\n const isPointInsideExpandedCluster = this._expandedCluster?.points?.find(d => getString(d.properties, config.pointId) === id)\n if (isPointInsideExpandedCluster && selectPoint) {\n this._selectedPoint = foundPoint as LeafletMapPoint<Datum>\n this._renderData()\n return\n }\n\n // Else - trigger zoom\n this._externallySelectedPoint = foundPoint\n this._zoomingToExternallySelectedPoint = true\n\n this._forceExpandCluster = !isNil(customZoomLevel)\n if (selectPoint) this._selectedPoint = foundPoint as LeafletMapPoint<Datum>\n\n const zoomLevel = isNil(customZoomLevel) ? this._map.leaflet.getZoom() : customZoomLevel\n const pointDatum = foundPoint.properties as LeafletMapPointDatum<Datum>\n const coordinates = {\n lng: getNumber(pointDatum, config.pointLongitude),\n lat: getNumber(pointDatum, config.pointLatitude),\n }\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, zoomLevel, { duration: 0 })\n } else {\n console.warn(`Unovis | Leaflet Map: Node with id ${id} can not be found`)\n }\n }\n\n public getNodeRelativePosition (node: LeafletMapPoint<Datum>): { x: number; y: number } {\n return getNodeRelativePosition(node, this._map.leaflet)\n }\n\n public hasBeenZoomed (): boolean {\n return this._hasBeenZoomed\n }\n\n public hasBeenMoved (): boolean {\n return this._hasBeenMoved\n }\n\n public isZooming (): boolean {\n return this._isZooming\n }\n\n public isMoving (): boolean {\n return this._isMoving\n }\n\n\n private _flyToBounds (bounds: [[number, number], [number, number]], durationMs: number, paddingPx?: [number, number]): void {\n this._eventInitiatedByComponent = true\n const duration = durationMs / 1000\n const padding: [number, number] | undefined = paddingPx ? [\n paddingPx[0] < this._container.clientWidth / 2 ? paddingPx[0] : this._container.clientWidth / 2,\n paddingPx[1] < this._container.clientHeight / 2 ? paddingPx[1] : this._container.clientHeight / 2,\n ] : undefined\n if (duration) {\n this._map.leaflet.flyToBounds(bounds, { duration, padding })\n } else {\n this._map.leaflet.fitBounds(bounds, { padding })\n }\n }\n\n private _renderData (mapMoveZoomUpdateOnly = false): void {\n const { config } = this\n\n const pointData = this._getPointData()\n const contentBBox = pointData.length ? bBoxMerge(pointData.map(d => d.bbox)) : { x: 0, y: 0, width: 0, height: 0 }\n\n // Set SVG size to match Leaflet transform\n const svgExtraPadding = 40 + this._clusterBackgroundRadius // We need it to fit point labels and expanded cluster background circle\n const dx = contentBBox.x - svgExtraPadding\n const dy = contentBBox.y - svgExtraPadding\n this._map.svgOverlay\n .attr('width', contentBBox.width + 2 * svgExtraPadding)\n .attr('height', contentBBox.height + 2 * svgExtraPadding)\n .style('left', `${dx}px`)\n .style('top', `${dy}px`)\n\n this._map.svgGroup\n .attr('transform', `translate(${-dx},${-dy})`)\n\n // Render content\n const points = this._pointGroup.selectAll<SVGGElement, LeafletMapPoint<Datum>>(`.${s.point}:not(.exit)`)\n .data(pointData, (d: LeafletMapPoint<Datum>, i) => `${d.id || d.geometry.coordinates.join('')}`)\n\n points.exit<LeafletMapPoint<Datum>>().classed('exit', true).call(removeNodes)\n const pointsEnter = points.enter().append('g').attr('class', s.point)\n .call(createNodes)\n\n const pointsMerged = points.merge(pointsEnter)\n pointsEnter.call(updateNodes, config, this._map.leaflet)\n points.call(updateNodes, config, this._map.leaflet, mapMoveZoomUpdateOnly)\n pointsMerged.call(collideLabels, this._map.leaflet)\n\n this._clusterBackground.call(updateBackgroundNode, this._expandedCluster, config, this._map.leaflet, this._clusterBackgroundRadius)\n if (this._expandedCluster && config.clusterBackground) {\n pointData.forEach((d, i) => { d._zIndex = (d.properties as LeafletMapPointDatum<Datum>)?.expandedClusterPoint ? 2 : 0 })\n this._pointGroup\n .selectAll<SVGGElement, LeafletMapPoint<Datum>>(`.${s.point}, .${s.clusterBackground}, .${s.pointSelectionRing}`)\n .sort((a: LeafletMapPoint<Datum>, b: LeafletMapPoint<Datum>) => a._zIndex - b._zIndex)\n }\n\n // Show selection border and hide it when the node\n // is out of visible box\n if (config.selectedPointId) {\n const foundPoint = pointData.find(d => getString(d.properties as LeafletMapPointDatum<Datum>, config.pointId) === config.selectedPointId)\n const { cluster } = findPointAndClusterByPointId(pointData, config.selectedPointId, config.pointId)\n if (foundPoint) this._selectedPoint = foundPoint\n else this._selectedPoint = cluster\n }\n this._pointSelectionRing.call(updateNodeSelectionRing, this._selectedPoint, pointData, config, this._map.leaflet)\n\n // Set up events and attributes for the rendered points\n this._setUpComponentEventsThrottled()\n this._setCustomAttributesThrottled()\n\n // Tooltip\n config.tooltip?.update()\n }\n\n private _zoomToExternallySelectedPoint (): void {\n const { config } = this\n if (!this._externallySelectedPoint) return\n\n const externallySelectedPointDatum = this._externallySelectedPoint.properties as LeafletMapPointDatum<Datum>\n const externallySelectedPointId = getString(externallySelectedPointDatum, config.pointId)\n const pointData = this._getPointData()\n const foundPoint: LeafletMapPoint<Datum> = pointData.find(\n d => getString(d.properties as Datum, config.pointId) === externallySelectedPointId\n )\n\n if (foundPoint) {\n this._zoomingToExternallySelectedPoint = false\n this._currentZoomLevel = null\n } else {\n const { cluster } = findPointAndClusterByPointId(pointData, externallySelectedPointId, config.pointId)\n if (!cluster) return\n\n const zoomLevel = this._map.leaflet.getZoom()\n // Expand cluster or fly further\n if (this._forceExpandCluster || shouldClusterExpand(cluster, zoomLevel, 8, 13)) {\n this._expandCluster(cluster)\n } else {\n const newZoomLevel = getNextZoomLevelOnClusterClick(zoomLevel)\n const coordinates = {\n lng: getNumber(externallySelectedPointDatum, config.pointLongitude),\n lat: getNumber(externallySelectedPointDatum, config.pointLatitude),\n }\n if (this._currentZoomLevel !== newZoomLevel) {\n this._currentZoomLevel = newZoomLevel\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, newZoomLevel, { duration: 0 })\n }\n }\n }\n }\n\n private _expandCluster (clusterPoint: LeafletMapPoint<Datum>, preventRender?: boolean): void {\n const { config, config: { clusterBackground } } = this\n const padding = 1\n\n config.tooltip?.hide()\n\n this._forceExpandCluster = false\n if (clusterPoint) {\n const points: PointFeature<PointExpandedClusterProperties<Datum>>[] =\n clusterPoint.clusterIndex.getLeaves((clusterPoint.properties as LeafletMapClusterDatum<Datum>).cluster_id as number, Infinity)\n const packPoints: {x: number; y: number; r: number }[] = points.map(p => ({\n x: null,\n y: null,\n r: getPointRadius(p, config.pointRadius, this._map.leaflet.getZoom()) + padding,\n }))\n packSiblings(packPoints)\n\n points.forEach((p, i) => {\n p.properties.expandedClusterPoint = clusterPoint\n p.properties.r = packPoints[i].r\n p.properties.dx = packPoints[i].x\n p.properties.dy = packPoints[i].y\n })\n\n this._resetExpandedCluster()\n this._expandedCluster = {\n cluster: clusterPoint,\n points,\n }\n\n if (clusterBackground) this._clusterBackgroundRadius = getClusterRadius(this._expandedCluster)\n\n if (!preventRender) this._renderData()\n }\n\n this._zoomingToExternallySelectedPoint = false\n }\n\n private _resetExpandedCluster (): void {\n this._expandedCluster?.points?.forEach(d => { delete d.properties.expandedClusterPoint })\n this._expandedCluster = null\n }\n\n private _getPointData (customBounds?: [number, number, number, number]): LeafletMapPoint<Datum>[] {\n const { config, datamodel: { data } } = this\n\n if (!data || !this._clusterIndex) return []\n\n let geoJSONPoints: (ClusterFeature<LeafletMapClusterDatum<Datum>> | PointFeature<PointExpandedClusterProperties<Datum>>)[] =\n getClustersAndPoints<Datum>(this._clusterIndex, this._map.leaflet, customBounds)\n\n if (this._expandedCluster) {\n // Remove expanded cluster from the data\n geoJSONPoints = geoJSONPoints.filter(c => (c as ClusterFeature<LeafletMapClusterDatum<Datum>>).properties.cluster_id !== (this._expandedCluster.cluster.properties as LeafletMapClusterDatum<Datum>).cluster_id)\n // Add points from the expanded cluster\n geoJSONPoints = geoJSONPoints.concat(this._expandedCluster.points)\n }\n\n const pointData = geoJSONPoints\n // Todo: Remove explicitly set ClusterFeature<LeafletMapPointDatum<Datum>> type\n .map((d, i: number) => {\n return geoJsonPointToScreenPoint(d as ClusterFeature<LeafletMapPointDatum<Datum>>, i, this._map.leaflet, config)\n })\n // .sort((a, b) => getPointDisplayOrder(a, config.pointStatus, config.colorMap) - getPointDisplayOrder(b, config.pointStatus, config.colorMap))\n\n return pointData\n }\n\n private _getMapZoomState (): MapZoomState {\n const leafletBounds = this._map.leaflet.getBounds()\n const southWest = leafletBounds.getSouthWest()\n const northEast = leafletBounds.getNorthEast()\n\n return {\n mapCenter: this._map.leaflet.getCenter(),\n zoomLevel: this._map.leaflet.getZoom(),\n bounds: { southWest, northEast },\n userDriven: !this._eventInitiatedByComponent,\n }\n }\n\n private _onMapDragLeaflet (): void {\n this._cancelBackgroundClick = true\n }\n\n private _onMapMove (): void {\n const { config } = this\n if (!this._map) return\n this._hasBeenMoved = true\n this._renderDataAnimationFrameId = requestAnimationFrame(() => {\n this._renderData(true)\n })\n config.onMapMoveZoom?.(this._getMapZoomState())\n }\n\n private _onMapMoveStart (): void {\n const { config } = this\n if (!this._map) return\n this._isMoving = true\n config.onMapMoveStart?.(this._getMapZoomState())\n }\n\n private _onMapMoveEnd (): void {\n const { config } = this\n if (!this._map) return\n this._onMapMoveEndInternal?.(this._map.leaflet)\n config.onMapMoveEnd?.(this._getMapZoomState())\n\n constraintMapViewThrottled(this._map.leaflet)\n const events = this._map.layer.getEvents()\n\n if (events.zoomend) {\n const zoomEndEvent = events.zoomend.bind(this._map.layer)\n zoomEndEvent(null)\n }\n\n if (this._externallySelectedPoint || this._zoomingToExternallySelectedPoint) {\n this._zoomToExternallySelectedPoint()\n }\n\n this._isMoving = false\n this._eventInitiatedByComponent = false\n }\n\n private _onMapZoomStart (): void {\n const { config } = this\n if (!this._map) return\n this._isZooming = true\n config.onMapZoomStart?.(this._getMapZoomState())\n }\n\n private _onMapZoomEnd (): void {\n const { config } = this\n if (!this._map) return\n config.onMapZoomEnd?.(this._getMapZoomState())\n this._isZooming = false\n if (!this._isMoving) this._eventInitiatedByComponent = false\n }\n\n private _onMapZoom (): void {\n const { config } = this\n if (!this._map) return\n this._hasBeenZoomed = true\n\n if (!this._externallySelectedPoint) this._resetExpandedCluster()\n else if (!this._zoomingToExternallySelectedPoint) {\n this._externallySelectedPoint = null\n }\n\n config.tooltip?.hide()\n config.onMapMoveZoom?.(this._getMapZoomState())\n }\n\n private _onBackgroundClick (el: HTMLElement, event: MouseEvent): void {\n const { config } = this\n\n if (this._cancelBackgroundClick) {\n this._cancelBackgroundClick = false\n return\n }\n\n this._externallySelectedPoint = null\n this._resetExpandedCluster()\n this._renderData()\n config.onMapClick?.(this._getMapZoomState())\n }\n\n private _onPointClick (d: LeafletMapPoint<Datum>, event: MouseEvent): void {\n const { config: { flyToDuration, clusterExpandOnClick } } = this\n this._externallySelectedPoint = null\n event.stopPropagation()\n\n if ((d.properties as LeafletMapClusterDatum<Datum>).cluster) {\n const zoomLevel = this._map.leaflet.getZoom()\n const coordinates = { lng: d.geometry.coordinates[0], lat: d.geometry.coordinates[1] }\n\n if (clusterExpandOnClick && shouldClusterExpand(d, zoomLevel)) this._expandCluster(d)\n else {\n const newZoomLevel = getNextZoomLevelOnClusterClick(zoomLevel)\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, newZoomLevel, { duration: flyToDuration / 1000 })\n }\n }\n }\n\n private _onPointMouseDown (d: LeafletMapPoint<Datum>, event: MouseEvent): void {\n this._cancelBackgroundClick = true\n }\n\n private _onPointMouseUp (d: LeafletMapPoint<Datum>, event: MouseEvent): void {\n this._cancelBackgroundClick = false\n }\n\n public zoomIn (increment = 1): void {\n if (!this._map?.leaflet) return\n this.setZoom(this._map.leaflet.getZoom() + increment)\n }\n\n public zoomOut (increment = 1): void {\n if (!this._map?.leaflet) return\n this.setZoom(this._map.leaflet.getZoom() - increment)\n }\n\n public setZoom (zoomLevel: number): void {\n const leaflet = this._map?.leaflet\n if (!leaflet) return\n\n this._eventInitiatedByComponent = true\n leaflet.flyTo(\n leaflet.getCenter(),\n clamp(zoomLevel, leaflet.getMinZoom(), leaflet.getMaxZoom()),\n { duration: this.config.zoomDuration / 1000 }\n )\n }\n\n public fitView (): void {\n this.fitToPoints()\n }\n\n public destroy (): void {\n constraintMapViewThrottled.cancel()\n cancelAnimationFrame(this._renderDataAnimationFrameId)\n cancelAnimationFrame(this._flyToBoundsAnimationFrameId)\n const map = this._map?.leaflet\n this._map = undefined\n\n map?.stop()\n map?.remove()\n this.g.remove()\n this.resizeObserver.disconnect()\n this.themeObserver?.disconnect()\n }\n}\n"],"names":["s.root","map","s.map","s.svgOverlay","s.backgroundRect","s.points","s.clusterBackground","s.pointSelectionRing","s.point","s","s.variables"],"mappings":";;;;;;;;;;;;;;;;;;AAyDM,MAAO,UAA4C,SAAQ,aAAwD,CAAA;AAyDvH,IAAA,WAAA,CAAa,SAAsB,EAAE,MAAyC,EAAE,IAAc,EAAA;AAC5F,QAAA,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;QAvDjB,IAAc,CAAA,cAAA,GAAG,uBAA2D,CAAA;AAC/E,QAAA,IAAA,CAAA,MAAM,GAAqC,IAAI,CAAC,cAAc,CAAA;AAGrE,QAAA,IAAA,CAAA,IAAI,GAAG,aAAa,CAAC,IAAI,CAAA;AAEzB,QAAA,IAAA,CAAA,SAAS,G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'd3-selection'\nimport { packSiblings } from 'd3-hierarchy'\nimport type L from 'leaflet'\nimport Supercluster, { ClusterFeature, PointFeature } from 'supercluster'\nimport { StyleSpecification } from 'maplibre-gl'\n\n// Core\nimport { ComponentCore } from 'core/component'\n\n// Model\nimport { MapDataModel } from 'data-models/map'\n\n// Types\nimport { ComponentType } from 'types/component'\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { ResizeObserver } from 'utils/resize-observer'\nimport { clamp, isNil, getNumber, getString, isString } from 'utils/data'\nimport { constraintMapViewThrottled } from './renderer/mapboxgl-utils'\nimport {\n projectPoint,\n bBoxMerge,\n calculateClusterIndex,\n getNextZoomLevelOnClusterClick,\n findPointAndClusterByPointId,\n geoJsonPointToScreenPoint,\n getClusterRadius,\n getClustersAndPoints,\n getNodeRelativePosition,\n getPointRadius,\n shouldClusterExpand,\n} from './modules/utils'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapClusterDatum,\n LeafletMapPoint,\n LeafletMapPointDatum,\n LeafletMapRenderer,\n MapZoomState,\n PointExpandedClusterProperties,\n} from './types'\n\n// Config\nimport { LeafletMapConfig, LeafletMapConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\n// Modules\nimport { initialMapCenter, initialMapZoom, setupMap, updateTopoJson } from './modules/map'\nimport { collideLabels, createNodes, removeNodes, updateNodes } from './modules/node'\nimport { createNodeSelectionRing, updateNodeSelectionRing } from './modules/selectionRing'\nimport { createBackgroundNode, updateBackgroundNode } from './modules/clusterBackground'\n\nexport class LeafletMap<Datum extends GenericDataRecord> extends ComponentCore<Datum[], LeafletMapConfig<Datum>, LeafletMapConfigInterface<Datum>> {\n static selectors = s\n static cssVariables = s.variables\n g: Selection<HTMLElement, unknown, null, undefined>\n type = ComponentType.HTML\n element: HTMLElement\n config: LeafletMapConfig<Datum> = new LeafletMapConfig()\n datamodel: MapDataModel<Datum> = new MapDataModel()\n protected _container: HTMLElement\n protected _containerSelection: Selection<HTMLElement, unknown, null, undefined>\n public _onMapMoveEndInternal: (leaflet: L.Map) => void // Internal callback needed by Leaflet Flow Map\n private _map: {\n leaflet: L.Map;\n layer: L.Layer;\n svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;\n svgGroup: Selection<SVGGElement, unknown, SVGElement, undefined>;\n }\n\n private _clusterIndex: Supercluster<Datum>\n private _expandedCluster: { points: PointFeature<PointExpandedClusterProperties<Datum>>[]; cluster: LeafletMapPoint<Datum> } = null\n private _cancelBackgroundClick = false\n private _hasBeenMoved = false\n private _hasBeenZoomed = false\n private _isMoving = false\n private _isZooming = false\n private _eventInitiatedByComponent = false\n private _triggerBackgroundClick = false\n private _externallySelectedPoint: LeafletMapPoint<Datum> | PointFeature<Datum> | null = null\n private _zoomingToExternallySelectedPoint = false\n private _forceExpandCluster = false\n private _pointGroup: Selection<SVGGElement, unknown, SVGElement, undefined>\n private _pointSelectionRing: Selection<SVGGElement, unknown, SVGElement, undefined>\n private _clusterBackground: Selection<SVGGElement, unknown, SVGElement, undefined>\n private _clusterBackgroundRadius = 0\n private _selectedPoint: LeafletMapPoint<Datum> = null\n private _currentZoomLevel: number | null = null\n private _firstRender = true\n private _isDarkThemeActive = false\n private resizeObserver: ResizeObserver\n private themeObserver: MutationObserver\n private _renderDataAnimationFrameId: number | null = null\n private _flyToBoundsAnimationFrameId: number | null = null\n readonly _leafletInitializationPromise: Promise<L.Map>\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n static DEFAULT_CONTAINER_HEIGHT = 600\n\n events = {\n [LeafletMap.selectors.point]: {\n mouseup: this._onPointMouseUp.bind(this),\n mousedown: this._onPointMouseDown.bind(this),\n click: this._onPointClick.bind(this),\n },\n }\n\n constructor (container: HTMLElement, config?: LeafletMapConfigInterface<Datum>, data?: Datum[]) {\n super(ComponentType.HTML)\n this._container = container\n this._containerSelection = select(this._container).attr('role', 'figure')\n\n this._container.appendChild(this.element)\n this.g\n .attr('class', s.root)\n .attr('aria-hidden', true)\n\n if (config) this.setConfig(config)\n\n if (!this._container.clientWidth) {\n console.warn('Unovis | Leaflet Map: The width of the container is not set. Setting to 100%.')\n this._containerSelection.style('width', '100%')\n }\n\n if (!this._container.clientHeight) {\n console.warn(`Unovis | Leaflet Map: The height of the container is not set. Setting to ${LeafletMap.DEFAULT_CONTAINER_HEIGHT}px.`)\n this._containerSelection.style('height', `${LeafletMap.DEFAULT_CONTAINER_HEIGHT}px`)\n }\n\n // Initialize map asynchronously\n this._leafletInitializationPromise = new Promise((resolve) => {\n setupMap(this.element, this.config).then(map => {\n // Apply the `s.map` class to `tilePane` to allow tooltip interactions\n select(map.leaflet.getPanes().tilePane).classed(s.map, true)\n if (config) this.setConfig(config)\n\n this._map = map\n this._map.leaflet.on('drag', this._onMapDragLeaflet.bind(this))\n this._map.leaflet.on('move', this._onMapMove.bind(this))\n this._map.leaflet.on('movestart', this._onMapMoveStart.bind(this))\n this._map.leaflet.on('moveend', this._onMapMoveEnd.bind(this))\n this._map.leaflet.on('zoom', this._onMapZoom.bind(this))\n this._map.leaflet.on('zoomstart', this._onMapZoomStart.bind(this))\n this._map.leaflet.on('zoomend', this._onMapZoomEnd.bind(this))\n\n // We need to handle background click in a special way to deal\n // with d3 svg overlay that might have smaller size than the map itself\n // (see this._onNodeMouseDown() and this this._onNodeMouseDown())\n this._map.leaflet.on('mousedown', () => {\n if (!this._cancelBackgroundClick) this._triggerBackgroundClick = true\n })\n\n this._map.leaflet.on('mouseup', (e) => {\n if (this._triggerBackgroundClick) {\n this._triggerBackgroundClick = false\n const originalEvent = (e as any).originalEvent\n this._onBackgroundClick(originalEvent.target, originalEvent)\n }\n })\n\n this._map.svgOverlay\n .attr('class', s.svgOverlay)\n .insert('rect', ':first-child')\n .attr('class', s.backgroundRect)\n .attr('width', '100%')\n .attr('height', '100%')\n\n this._pointGroup = this._map.svgGroup.append('g').attr('class', s.points)\n this._clusterBackground = this._pointGroup.append('g')\n .attr('class', s.clusterBackground)\n .call(createBackgroundNode)\n this._pointSelectionRing = this._pointGroup.append('g')\n .attr('class', s.pointSelectionRing)\n .call(createNodeSelectionRing)\n\n this._map.leaflet.setView(initialMapCenter, initialMapZoom)\n\n if (document.body.classList.contains('theme-dark') && config.styleDarkTheme) {\n this._isDarkThemeActive = true\n this.setTheme(config.styleDarkTheme)\n }\n\n this.config.onMapInitialized?.()\n resolve(this._map.leaflet)\n })\n })\n\n\n // Set data and render the map when it's ready\n this.setData(data ?? [])\n\n // When the container size changes we have to initiate map resize in order to update its dimensions\n this.resizeObserver = new ResizeObserver(() => {\n this._map?.leaflet?.invalidateSize()\n this.config.tooltip?.hide()\n })\n this.resizeObserver.observe(container)\n\n // If dark theme is enabled, update map's style when document body's class list changes\n if (this.config.styleDarkTheme) {\n this.themeObserver = new MutationObserver((mutations) => {\n mutations.forEach(change => {\n if (change.attributeName === 'class') {\n const isDarkTheme = (change.target as HTMLElement).classList.contains('theme-dark')\n if (this._isDarkThemeActive !== isDarkTheme) {\n this.setTheme(isDarkTheme ? this.config.styleDarkTheme : this.config.style)\n this._isDarkThemeActive = isDarkTheme\n }\n }\n })\n })\n this.themeObserver.observe(document.body, { attributes: true })\n }\n }\n\n setConfig (config: LeafletMapConfigInterface<Datum>): void {\n this.config = new LeafletMapConfig<Datum>().init(config)\n\n if (config.width) this._containerSelection.style('width', isString(config.width) ? config.width : `${config.width}px`)\n if (config.height) this._containerSelection.style('height', isString(config.height) ? config.height : `${config.height}px`)\n\n if (this._map && config.renderer === LeafletMapRenderer.MapLibre) {\n const layer = this._map.layer as any // Using any because the typings are not full\n const maplibreMap = layer.getMaplibreMap()\n if (maplibreMap.isStyleLoaded()) updateTopoJson(maplibreMap, this.config)\n }\n\n if (this.config.tooltip) {\n this.config.tooltip.setContainer(this._container)\n this.config.tooltip.setComponents([this])\n this.config.tooltip.update()\n }\n\n // Apply the `aria-label` attribute\n this._containerSelection.attr('aria-label', config.ariaLabel)\n }\n\n setData (data: Datum[]): void {\n const { config, datamodel } = this\n\n const dataValid = data.filter(d => {\n const lat = getNumber(d, config.pointLatitude)\n const lon = getNumber(d, config.pointLongitude)\n const valid = isFinite(lat) && isFinite(lon)\n\n if (!valid) console.warn('Unovis | Leaflet Map: Invalid point coordinates', d)\n return valid\n })\n\n datamodel.data = dataValid\n\n // We use Supercluster for real-time node clustering\n this._clusterIndex = calculateClusterIndex<Datum>(dataValid, this.config)\n\n // If there was an expanded cluster, try to find its successor and expand it too\n if (this._expandedCluster && this._map.leaflet) {\n // Reset expanded cluster before calling `_getPointData()` to get data with all clusters collapsed\n const expandedCluster = this._expandedCluster\n this._resetExpandedCluster()\n const pointData = this._getPointData()\n\n const expandedClusterCenterPx = projectPoint(expandedCluster.cluster, this._map.leaflet)\n const expandedClusterRadiusPx = expandedCluster.cluster.radius\n const cluster = pointData.find((c) => {\n if (!c.isCluster) return false\n const pos = projectPoint(c, this._map.leaflet)\n const r = c.radius\n const distance = Math.sqrt((expandedClusterCenterPx.x - pos.x) ** 2 + (expandedClusterCenterPx.y - pos.y) ** 2)\n return distance < (expandedClusterRadiusPx + r)\n })\n\n if (cluster) this._expandCluster(cluster, true)\n }\n\n // Render\n this._leafletInitializationPromise.then(() => {\n this.render()\n })\n }\n\n setTheme (theme: StyleSpecification | string): void {\n const layer = this._map.layer as any // Using any because the typings are not full\n if (this.config.renderer === LeafletMapRenderer.MapLibre) {\n const maplibreMap = layer.getMaplibreMap()\n maplibreMap.setStyle?.(theme)\n updateTopoJson(maplibreMap, this.config)\n } else {\n if (typeof theme !== 'string') {\n console.warn('Unovis | Leaflet Map: Invalid style. Provide a URL string for raster rendering mode.')\n return\n }\n layer.setUrl(theme)\n }\n }\n\n // We redefine the ComponentCore render function to bind event to newly created elements in this._renderData(),\n // which is being called after almost every map interaction\n render (): void {\n const { config } = this\n if (!this._map) return\n\n this._renderData()\n if (this._firstRender) {\n if (config.initialBounds) this.fitToBounds(config.initialBounds)\n else if (config.fitViewOnInit) this.fitToPoints(0, config.fitViewPadding)\n } else {\n if (config.fitViewOnUpdate) this.fitToPoints(0, config.fitViewPadding)\n else if (config.fitBoundsOnUpdate) this.fitToBounds(config.fitBoundsOnUpdate)\n }\n\n this._firstRender = false\n }\n\n public getLeafletInstancePromise (): Promise<L.Map> {\n return this._leafletInitializationPromise\n }\n\n public fitToPoints (duration = this.config.flyToDuration, padding = this.config.fitViewPadding): void {\n const { config, datamodel, datamodel: { data } } = this\n\n if (!this._map || !this._map.leaflet) return\n if (!data?.length) return\n const bounds = datamodel.getDataLatLngBounds(config.pointLatitude, config.pointLongitude)\n this._flyToBoundsAnimationFrameId = requestAnimationFrame(() => this._flyToBounds(bounds, duration, padding))\n }\n\n public fitToBounds (bounds: Bounds, duration = this.config.flyToDuration, padding = this.config.fitViewPadding): void {\n const { northEast, southWest } = bounds\n if (isNil(northEast) || isNil(southWest)) return\n if (isNil(northEast.lat) || isNil(northEast.lng)) return\n if (isNil(southWest.lat) || isNil(southWest.lng)) return\n if (!this._map || !this._map.leaflet) return\n this._flyToBoundsAnimationFrameId = requestAnimationFrame(() => this._flyToBounds([\n [northEast.lat, southWest.lng],\n [southWest.lat, northEast.lng],\n ], duration, padding))\n }\n\n /* Select a point by id and optionally center the map view.\n * This method was designed to be used mainly with the `[LeafletMap.selectors.point]` click events\n * (when the user actually clicks on a point) and the specified point is inside one of the collapsed\n * clusters it won't be selected. You can use the `zoomToPointById` method to achieve that.\n */\n public selectPointById (id: string, centerView = false): void {\n const { config } = this\n const pointData = this._getPointData()\n const foundPoint = pointData.find(d => (d.properties as LeafletMapPointDatum<Datum>).id === id)\n\n if (!foundPoint) {\n console.warn(`Unovis | Leaflet Map: Node with id ${id} can not be found`)\n return\n }\n\n if ((foundPoint.properties as LeafletMapClusterDatum<Datum>)?.cluster) {\n console.warn('Unovis | Leaflet Map: Cluster can\\'t be selected')\n return\n }\n\n this._selectedPoint = foundPoint\n\n const isPointInsideExpandedCluster = this._expandedCluster?.points?.find(d => getString(d.properties, config.pointId) === id)\n if (!isPointInsideExpandedCluster) this._resetExpandedCluster()\n\n if (centerView) {\n const coordinates = {\n lng: getNumber(foundPoint.properties as LeafletMapPointDatum<Datum>, config.pointLongitude),\n lat: getNumber(foundPoint.properties as LeafletMapPointDatum<Datum>, config.pointLatitude),\n }\n\n const zoomLevel = this._map.leaflet.getZoom()\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, zoomLevel, { duration: 0 })\n } else {\n this._renderData()\n }\n }\n\n /* Get the id of the selected point */\n public getSelectedPointId (): string | number | undefined {\n return this._selectedPoint?.id\n }\n\n /* Unselect point if it was selected before */\n public unselectPoint (): void {\n this._selectedPoint = null\n this._externallySelectedPoint = null\n this.render()\n }\n\n /** Get the currently expanded cluster */\n public getExpandedCluster (): { id: string; points: Datum[] } | undefined {\n if (!this._expandedCluster) return\n const id = this._expandedCluster.cluster?.id as string\n const points = this._expandedCluster.cluster?.clusterPoints.map(d => this.datamodel.data[(d as LeafletMapPointDatum<Datum>)._index])\n return { id, points }\n }\n\n /* Zoom to a point by id and optionally select it.\n * If the point is inside a cluster, it'll be automatically expanded to show the enclosed point.\n * You can also force set the zoom level by providing the `customZoomLevel` argument.\n */\n public zoomToPointById (id: string, selectPoint = false, customZoomLevel?: number): void {\n const { config, datamodel } = this\n if (!datamodel.data.length) {\n console.warn('Unovis | Leaflet Map: There are no points on the map')\n return\n }\n const dataBoundsAll = datamodel.getDataLatLngBounds(config.pointLatitude, config.pointLongitude)\n const bounds: [number, number, number, number] = [dataBoundsAll[0][1], dataBoundsAll[1][0], dataBoundsAll[1][1], dataBoundsAll[0][0]]\n const pointDataAll = this._getPointData(bounds)\n\n let foundPoint: LeafletMapPoint<Datum> | PointFeature<Datum> = pointDataAll\n .find((d: LeafletMapPoint<Datum>) => getString(d.properties as LeafletMapPointDatum<Datum>, config.pointId) === id)\n\n // If point was found and it's a cluster -> do nothing\n if ((foundPoint?.properties as LeafletMapClusterDatum<Datum>)?.cluster) {\n console.warn('Unovis | Leaflet Map: Cluster can\\'t be zoomed in')\n return\n }\n\n // If point was not found -> search for it in all collapsed clusters\n if (!foundPoint) {\n const { point } = findPointAndClusterByPointId(pointDataAll, id, config.pointId)\n foundPoint = point\n }\n\n if (foundPoint) {\n // If point was found and it's inside an expanded cluster -> simply select it\n const isPointInsideExpandedCluster = this._expandedCluster?.points?.find(d => getString(d.properties, config.pointId) === id)\n if (isPointInsideExpandedCluster && selectPoint) {\n this._selectedPoint = foundPoint as LeafletMapPoint<Datum>\n this._renderData()\n return\n }\n\n // Else - trigger zoom\n this._externallySelectedPoint = foundPoint\n this._zoomingToExternallySelectedPoint = true\n\n this._forceExpandCluster = !isNil(customZoomLevel)\n if (selectPoint) this._selectedPoint = foundPoint as LeafletMapPoint<Datum>\n\n const zoomLevel = isNil(customZoomLevel) ? this._map.leaflet.getZoom() : customZoomLevel\n const pointDatum = foundPoint.properties as LeafletMapPointDatum<Datum>\n const coordinates = {\n lng: getNumber(pointDatum, config.pointLongitude),\n lat: getNumber(pointDatum, config.pointLatitude),\n }\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, zoomLevel, { duration: 0 })\n } else {\n console.warn(`Unovis | Leaflet Map: Node with id ${id} can not be found`)\n }\n }\n\n public getNodeRelativePosition (node: LeafletMapPoint<Datum>): { x: number; y: number } {\n return getNodeRelativePosition(node, this._map.leaflet)\n }\n\n public hasBeenZoomed (): boolean {\n return this._hasBeenZoomed\n }\n\n public hasBeenMoved (): boolean {\n return this._hasBeenMoved\n }\n\n public isZooming (): boolean {\n return this._isZooming\n }\n\n public isMoving (): boolean {\n return this._isMoving\n }\n\n\n private _flyToBounds (bounds: [[number, number], [number, number]], durationMs: number, paddingPx?: [number, number]): void {\n this._eventInitiatedByComponent = true\n const duration = durationMs / 1000\n const padding: [number, number] | undefined = paddingPx ? [\n paddingPx[0] < this._container.clientWidth / 2 ? paddingPx[0] : this._container.clientWidth / 2,\n paddingPx[1] < this._container.clientHeight / 2 ? paddingPx[1] : this._container.clientHeight / 2,\n ] : undefined\n if (duration) {\n this._map.leaflet.flyToBounds(bounds, { duration, padding })\n } else {\n this._map.leaflet.fitBounds(bounds, { padding })\n }\n }\n\n private _renderData (mapMoveZoomUpdateOnly = false): void {\n const { config } = this\n\n const pointData = this._getPointData()\n const contentBBox = pointData.length ? bBoxMerge(pointData.map(d => d.bbox)) : { x: 0, y: 0, width: 0, height: 0 }\n\n // Set SVG size to match Leaflet transform\n const svgExtraPadding = 40 + this._clusterBackgroundRadius // We need it to fit point labels and expanded cluster background circle\n const dx = contentBBox.x - svgExtraPadding\n const dy = contentBBox.y - svgExtraPadding\n this._map.svgOverlay\n .attr('width', contentBBox.width + 2 * svgExtraPadding)\n .attr('height', contentBBox.height + 2 * svgExtraPadding)\n .style('left', `${dx}px`)\n .style('top', `${dy}px`)\n\n this._map.svgGroup\n .attr('transform', `translate(${-dx},${-dy})`)\n\n // Render content\n const points = this._pointGroup.selectAll<SVGGElement, LeafletMapPoint<Datum>>(`.${s.point}:not(.exit)`)\n .data(pointData, (d: LeafletMapPoint<Datum>, i) => `${d.id || d.geometry.coordinates.join('')}`)\n\n points.exit<LeafletMapPoint<Datum>>().classed('exit', true).call(removeNodes)\n const pointsEnter = points.enter().append('g').attr('class', s.point)\n .call(createNodes)\n\n const pointsMerged = points.merge(pointsEnter)\n pointsEnter.call(updateNodes, config, this._map.leaflet)\n points.call(updateNodes, config, this._map.leaflet, mapMoveZoomUpdateOnly)\n pointsMerged.call(collideLabels, this._map.leaflet)\n\n this._clusterBackground.call(updateBackgroundNode, this._expandedCluster, config, this._map.leaflet, this._clusterBackgroundRadius)\n if (this._expandedCluster && config.clusterBackground) {\n pointData.forEach((d, i) => { d._zIndex = (d.properties as LeafletMapPointDatum<Datum>)?.expandedClusterPoint ? 2 : 0 })\n this._pointGroup\n .selectAll<SVGGElement, LeafletMapPoint<Datum>>(`.${s.point}, .${s.clusterBackground}, .${s.pointSelectionRing}`)\n .sort((a: LeafletMapPoint<Datum>, b: LeafletMapPoint<Datum>) => a._zIndex - b._zIndex)\n }\n\n // Show selection border and hide it when the node\n // is out of visible box\n if (config.selectedPointId) {\n const foundPoint = pointData.find(d => getString(d.properties as LeafletMapPointDatum<Datum>, config.pointId) === config.selectedPointId)\n const { cluster } = findPointAndClusterByPointId(pointData, config.selectedPointId, config.pointId)\n if (foundPoint) this._selectedPoint = foundPoint\n else this._selectedPoint = cluster\n }\n this._pointSelectionRing.call(updateNodeSelectionRing, this._selectedPoint, pointData, config, this._map.leaflet)\n\n // Set up events and attributes for the rendered points\n this._setUpComponentEventsThrottled()\n this._setCustomAttributesThrottled()\n\n // Tooltip\n config.tooltip?.update()\n }\n\n private _zoomToExternallySelectedPoint (): void {\n const { config } = this\n if (!this._externallySelectedPoint) return\n\n const externallySelectedPointDatum = this._externallySelectedPoint.properties as LeafletMapPointDatum<Datum>\n const externallySelectedPointId = getString(externallySelectedPointDatum, config.pointId)\n const pointData = this._getPointData()\n const foundPoint: LeafletMapPoint<Datum> = pointData.find(\n d => getString(d.properties as Datum, config.pointId) === externallySelectedPointId\n )\n\n if (foundPoint) {\n this._zoomingToExternallySelectedPoint = false\n this._currentZoomLevel = null\n } else {\n const { cluster } = findPointAndClusterByPointId(pointData, externallySelectedPointId, config.pointId)\n if (!cluster) return\n\n const zoomLevel = this._map.leaflet.getZoom()\n // Expand cluster or fly further\n if (this._forceExpandCluster || shouldClusterExpand(cluster, zoomLevel, 8, 13)) {\n this._expandCluster(cluster)\n } else {\n const newZoomLevel = getNextZoomLevelOnClusterClick(zoomLevel)\n const coordinates = {\n lng: getNumber(externallySelectedPointDatum, config.pointLongitude),\n lat: getNumber(externallySelectedPointDatum, config.pointLatitude),\n }\n if (this._currentZoomLevel !== newZoomLevel) {\n this._currentZoomLevel = newZoomLevel\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, newZoomLevel, { duration: 0 })\n }\n }\n }\n }\n\n private _expandCluster (clusterPoint: LeafletMapPoint<Datum>, preventRender?: boolean): void {\n const { config, config: { clusterBackground } } = this\n const padding = 1\n\n config.tooltip?.hide()\n\n this._forceExpandCluster = false\n if (clusterPoint) {\n const points: PointFeature<PointExpandedClusterProperties<Datum>>[] =\n clusterPoint.clusterIndex.getLeaves((clusterPoint.properties as LeafletMapClusterDatum<Datum>).cluster_id as number, Infinity)\n const packPoints: {x: number; y: number; r: number }[] = points.map(p => ({\n x: null,\n y: null,\n r: getPointRadius(p, config.pointRadius, this._map.leaflet.getZoom()) + padding,\n }))\n packSiblings(packPoints)\n\n points.forEach((p, i) => {\n p.properties.expandedClusterPoint = clusterPoint\n p.properties.r = packPoints[i].r\n p.properties.dx = packPoints[i].x\n p.properties.dy = packPoints[i].y\n })\n\n this._resetExpandedCluster()\n this._expandedCluster = {\n cluster: clusterPoint,\n points,\n }\n\n if (clusterBackground) this._clusterBackgroundRadius = getClusterRadius(this._expandedCluster)\n\n if (!preventRender) this._renderData()\n }\n\n this._zoomingToExternallySelectedPoint = false\n }\n\n private _resetExpandedCluster (): void {\n this._expandedCluster?.points?.forEach(d => { delete d.properties.expandedClusterPoint })\n this._expandedCluster = null\n }\n\n private _getPointData (customBounds?: [number, number, number, number]): LeafletMapPoint<Datum>[] {\n const { config, datamodel: { data } } = this\n\n if (!data || !this._clusterIndex) return []\n\n let geoJSONPoints: (ClusterFeature<LeafletMapClusterDatum<Datum>> | PointFeature<PointExpandedClusterProperties<Datum>>)[] =\n getClustersAndPoints<Datum>(this._clusterIndex, this._map.leaflet, customBounds)\n\n if (this._expandedCluster) {\n // Remove expanded cluster from the data\n geoJSONPoints = geoJSONPoints.filter(c => (c as ClusterFeature<LeafletMapClusterDatum<Datum>>).properties.cluster_id !== (this._expandedCluster.cluster.properties as LeafletMapClusterDatum<Datum>).cluster_id)\n // Add points from the expanded cluster\n geoJSONPoints = geoJSONPoints.concat(this._expandedCluster.points)\n }\n\n const pointData = geoJSONPoints\n // Todo: Remove explicitly set ClusterFeature<LeafletMapPointDatum<Datum>> type\n .map((d, i: number) => {\n return geoJsonPointToScreenPoint(d as ClusterFeature<LeafletMapPointDatum<Datum>>, i, this._map.leaflet, config)\n })\n // .sort((a, b) => getPointDisplayOrder(a, config.pointStatus, config.colorMap) - getPointDisplayOrder(b, config.pointStatus, config.colorMap))\n\n return pointData\n }\n\n private _getMapZoomState (): MapZoomState {\n const leafletBounds = this._map.leaflet.getBounds()\n const southWest = leafletBounds.getSouthWest()\n const northEast = leafletBounds.getNorthEast()\n\n return {\n mapCenter: this._map.leaflet.getCenter(),\n zoomLevel: this._map.leaflet.getZoom(),\n bounds: { southWest, northEast },\n userDriven: !this._eventInitiatedByComponent,\n }\n }\n\n private _onMapDragLeaflet (): void {\n this._cancelBackgroundClick = true\n }\n\n private _onMapMove (): void {\n const { config } = this\n if (!this._map) return\n this._hasBeenMoved = true\n this._renderDataAnimationFrameId = requestAnimationFrame(() => {\n this._renderData(true)\n })\n config.onMapMoveZoom?.(this._getMapZoomState())\n }\n\n private _onMapMoveStart (): void {\n const { config } = this\n if (!this._map) return\n this._isMoving = true\n config.onMapMoveStart?.(this._getMapZoomState())\n }\n\n private _onMapMoveEnd (): void {\n const { config } = this\n if (!this._map) return\n this._onMapMoveEndInternal?.(this._map.leaflet)\n config.onMapMoveEnd?.(this._getMapZoomState())\n\n constraintMapViewThrottled(this._map.leaflet)\n const events = this._map.layer.getEvents()\n\n if (events.zoomend) {\n const zoomEndEvent = events.zoomend.bind(this._map.layer)\n zoomEndEvent(null)\n }\n\n if (this._externallySelectedPoint || this._zoomingToExternallySelectedPoint) {\n this._zoomToExternallySelectedPoint()\n }\n\n this._isMoving = false\n this._eventInitiatedByComponent = false\n }\n\n private _onMapZoomStart (): void {\n const { config } = this\n if (!this._map) return\n this._isZooming = true\n config.onMapZoomStart?.(this._getMapZoomState())\n }\n\n private _onMapZoomEnd (): void {\n const { config } = this\n if (!this._map) return\n config.onMapZoomEnd?.(this._getMapZoomState())\n this._isZooming = false\n if (!this._isMoving) this._eventInitiatedByComponent = false\n }\n\n private _onMapZoom (): void {\n const { config } = this\n if (!this._map) return\n this._hasBeenZoomed = true\n\n if (!this._externallySelectedPoint) this._resetExpandedCluster()\n else if (!this._zoomingToExternallySelectedPoint) {\n this._externallySelectedPoint = null\n }\n\n config.tooltip?.hide()\n config.onMapMoveZoom?.(this._getMapZoomState())\n }\n\n private _onBackgroundClick (el: HTMLElement, event: MouseEvent): void {\n const { config } = this\n\n if (this._cancelBackgroundClick) {\n this._cancelBackgroundClick = false\n return\n }\n\n this._externallySelectedPoint = null\n this._resetExpandedCluster()\n this._renderData()\n config.onMapClick?.(this._getMapZoomState())\n }\n\n private _onPointClick (d: LeafletMapPoint<Datum>, event: MouseEvent): void {\n const { config: { flyToDuration, clusterExpandOnClick } } = this\n this._externallySelectedPoint = null\n event.stopPropagation()\n\n if ((d.properties as LeafletMapClusterDatum<Datum>).cluster) {\n const zoomLevel = this._map.leaflet.getZoom()\n const coordinates = { lng: d.geometry.coordinates[0], lat: d.geometry.coordinates[1] }\n\n if (clusterExpandOnClick && shouldClusterExpand(d, zoomLevel)) this._expandCluster(d)\n else {\n const newZoomLevel = getNextZoomLevelOnClusterClick(zoomLevel)\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, newZoomLevel, { duration: flyToDuration / 1000 })\n }\n }\n }\n\n private _onPointMouseDown (d: LeafletMapPoint<Datum>, event: MouseEvent): void {\n this._cancelBackgroundClick = true\n }\n\n private _onPointMouseUp (d: LeafletMapPoint<Datum>, event: MouseEvent): void {\n this._cancelBackgroundClick = false\n }\n\n public zoomIn (increment = 1): void {\n if (!this._map?.leaflet) return\n this.setZoom(this._map.leaflet.getZoom() + increment)\n }\n\n public zoomOut (increment = 1): void {\n if (!this._map?.leaflet) return\n this.setZoom(this._map.leaflet.getZoom() - increment)\n }\n\n public setZoom (zoomLevel: number): void {\n const leaflet = this._map?.leaflet\n if (!leaflet) return\n\n this._eventInitiatedByComponent = true\n leaflet.flyTo(\n leaflet.getCenter(),\n clamp(zoomLevel, leaflet.getMinZoom(), leaflet.getMaxZoom()),\n { duration: this.config.zoomDuration / 1000 }\n )\n }\n\n public fitView (): void {\n this.fitToPoints()\n }\n\n public destroy (): void {\n constraintMapViewThrottled.cancel()\n cancelAnimationFrame(this._renderDataAnimationFrameId)\n cancelAnimationFrame(this._flyToBoundsAnimationFrameId)\n const map = this._map?.leaflet\n this._map = undefined\n\n map?.stop()\n map?.remove()\n this.g.remove()\n this.resizeObserver.disconnect()\n this.themeObserver?.disconnect()\n }\n}\n"],"names":["s.root","map","s.map","s.svgOverlay","s.backgroundRect","s.points","s.clusterBackground","s.pointSelectionRing","s.point","s","s.variables"],"mappings":";;;;;;;;;;;;;;;;;;AAyDM,MAAO,UAA4C,SAAQ,aAAiF,CAAA;AAuDhJ,IAAA,WAAA,CAAa,SAAsB,EAAE,MAAyC,EAAE,IAAc,EAAA;AAC5F,QAAA,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;AApD3B,QAAA,IAAA,CAAA,IAAI,GAAG,aAAa,CAAC,IAAI,CAAA;AAEzB,QAAA,IAAA,CAAA,MAAM,GAA4B,IAAI,gBAAgB,EAAE,CAAA;AACxD,QAAA,IAAA,CAAA,SAAS,GAAwB,IAAI,YAAY,EAAE,CAAA;QAY3C,IAAgB,CAAA,gBAAA,GAAuG,IAAI,CAAA;QAC3H,IAAsB,CAAA,sBAAA,GAAG,KAAK,CAAA;QAC9B,IAAa,CAAA,aAAA,GAAG,KAAK,CAAA;QACrB,IAAc,CAAA,cAAA,GAAG,KAAK,CAAA;QACtB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAA;QACjB,IAAU,CAAA,UAAA,GAAG,KAAK,CAAA;QAClB,IAA0B,CAAA,0BAAA,GAAG,KAAK,CAAA;QAClC,IAAuB,CAAA,uBAAA,GAAG,KAAK,CAAA;QAC/B,IAAwB,CAAA,wBAAA,GAAwD,IAAI,CAAA;QACpF,IAAiC,CAAA,iCAAA,GAAG,KAAK,CAAA;QACzC,IAAmB,CAAA,mBAAA,GAAG,KAAK,CAAA;QAI3B,IAAwB,CAAA,wBAAA,GA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AAA,IAAI,CAAC,IAAI,GAAG,SAAS,CAAA;AAErB,QAAA,GAAG,aAAH,GAAG,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAH,GAAG,CAAE,IAAI,EAAE,CAAA;AACX,QAAA,GAAG,aAAH,GAAG,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAH,GAAG,CAAE,MAAM,EAAE,CAAA;AACb,QAAA,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAA;AACf,QAAA,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAA;AAChC,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,aAAa,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,UAAU,EAAE,CAAA;KACjC;;AA3vBM,UAAS,CAAA,SAAA,GAAGE,KAAC,CAAA;AACb,UAAA,CAAA,YAAY,GAAGC,SAAW,CAAA;AA0CjC;AACO,UAAwB,CAAA,wBAAA,GAAG,GAAG;;;;"}
@@ -2,11 +2,11 @@ import type L from 'leaflet';
2
2
  import { Selection } from 'd3-selection';
3
3
  import { Map } from 'maplibre-gl';
4
4
  import { GenericDataRecord } from "../../../types/data";
5
- import { LeafletMapConfigInterface } from '../config';
5
+ import { LeafletMapConfig } from '../config';
6
6
  export declare const initialMapCenter: L.LatLngExpression;
7
7
  export declare const initialMapZoom = 1.9;
8
- export declare function updateTopoJson<T extends GenericDataRecord>(maplibreMap: Map, config: LeafletMapConfigInterface<T>): void;
9
- export declare function setupMap<T extends GenericDataRecord>(mapContainer: HTMLElement, config: LeafletMapConfigInterface<T>): Promise<{
8
+ export declare function updateTopoJson<T extends GenericDataRecord>(maplibreMap: Map, config: LeafletMapConfig<T>): void;
9
+ export declare function setupMap<T extends GenericDataRecord>(mapContainer: HTMLElement, config: LeafletMapConfig<T>): Promise<{
10
10
  leaflet: L.Map;
11
11
  layer: L.Layer;
12
12
  svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"map.js","sources":["../../../../src/components/leaflet-map/modules/map.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { select, Selection } from 'd3-selection'\nimport { GeoJSONSource, Map } from 'maplibre-gl'\nimport { feature } from 'topojson-client'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\n// Local Types\n\n// Utils\nimport { constraintMapView, mapboxglWheelEventThrottled } from '../renderer/mapboxgl-utils'\n\n// Styles\nimport * as s from '../style'\nimport { LeafletMapRenderer } from '../types'\n\nexport const initialMapCenter: L.LatLngExpression = [36, 14]\nexport const initialMapZoom = 1.9\n\nexport function updateTopoJson<T extends GenericDataRecord> (maplibreMap: Map, config: LeafletMapConfigInterface<T>): void {\n const { topoJSONLayer } = config\n\n if (topoJSONLayer.sources) {\n const featureObject = topoJSONLayer.sources?.objects?.[topoJSONLayer.featureName]\n if (featureObject) {\n const mapSource = maplibreMap.getSource(topoJSONLayer.featureName) as GeoJSONSource\n const featureCollection = feature(topoJSONLayer.sources, featureObject)\n if (mapSource) {\n mapSource.setData(featureCollection)\n } else {\n maplibreMap.addSource(topoJSONLayer.featureName, { type: 'geojson', data: featureCollection })\n }\n }\n }\n\n const fillLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-area`)\n if (topoJSONLayer.fillProperty) {\n if (!fillLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-area`,\n type: 'fill',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-antialias': false,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-opacity': topoJSONLayer.fillOpacity,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-area`, 'fill-color', [\n 'case',\n ['!', ['has', topoJSONLayer.fillProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.fillProperty],\n ])\n } else if (fillLayer) maplibreMap.removeLayer(`${topoJSONLayer.featureName}-area`)\n\n const strokeLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-stroke`)\n if (topoJSONLayer.strokeProperty) {\n if (!strokeLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-stroke`,\n type: 'line',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-opacity': topoJSONLayer.strokeOpacity,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-width': topoJSONLayer.strokeWidth,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-stroke`, 'line-color', [\n 'case',\n ['!', ['has', topoJSONLayer.strokeProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.strokeProperty],\n ])\n } else if (strokeLayer) { maplibreMap.removeLayer(`${topoJSONLayer.featureName}-stroke`) }\n}\n\nexport async function setupMap<T extends GenericDataRecord> (mapContainer: HTMLElement, config: LeafletMapConfigInterface<T>): Promise<{\n leaflet: L.Map;\n layer: L.Layer;\n svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;\n svgGroup: Selection<SVGGElement, unknown, SVGElement, undefined>;\n}> {\n const { style, renderer, topoJSONLayer } = config\n const leaflet = await import('leaflet')\n const L = leaflet.default\n\n if (!style) {\n console.error('Unovis | Leaflet Map: Please provide style settings in the map configuration object')\n return\n }\n\n const leafletMap = L.map(mapContainer, {\n scrollWheelZoom: renderer === LeafletMapRenderer.Raster, // We define custom scroll event for MapboxGL to enabling smooth zooming\n zoomControl: false,\n zoomDelta: renderer === LeafletMapRenderer.Raster ? 1 : 0.5,\n zoomSnap: renderer === LeafletMapRenderer.Raster ? 1 : 0,\n attributionControl: true,\n center: initialMapCenter,\n zoom: initialMapZoom,\n minZoom: Math.sqrt(mapContainer.offsetWidth) / 17,\n maxZoom: 23,\n maxBounds: L.latLngBounds(\n [-75, -290],\n [85, 290]\n ),\n maxBoundsViscosity: 1,\n })\n\n for (const attr of config.attribution) {\n leafletMap.attributionControl.addAttribution(attr)\n }\n\n let layer: L.Layer\n let maplibreMap = null\n\n switch (renderer) {\n case LeafletMapRenderer.MapLibre:\n // eslint-disable-next-line no-case-declarations\n const maplibre = await import('maplibre-gl')\n // eslint-disable-next-line no-case-declarations\n const { getMaplibreGLLayer } = await import('../renderer/mapboxgl-layer')\n layer = getMaplibreGLLayer(config, L, maplibre.default)\n maplibreMap = (layer as ReturnType<typeof getMaplibreGLLayer>).getMaplibreMap?.()\n break\n case LeafletMapRenderer.Raster:\n layer = L.tileLayer(style as string)\n break\n }\n layer.addTo(leafletMap)\n\n // leaflet-mapbox-gl has a layer positioning issue on far zoom levels which leads to having wrong\n // map points projection. We constraint the view to prevent that.\n constraintMapView(leafletMap)\n select(mapContainer).on('wheel', (event: WheelEvent) => {\n event.preventDefault()\n mapboxglWheelEventThrottled(leafletMap, layer, event)\n })\n\n if (maplibreMap && topoJSONLayer?.sources) {\n const canvas = maplibreMap.getCanvas()\n const canvasSelection = select(canvas).classed(s.mapboxglCanvas, true)\n const tilePaneSelection = select(leafletMap.getPanes().tilePane)\n\n maplibreMap.on('mousemove', (event) => {\n const layerName = `${topoJSONLayer.featureName}-area`\n const layer = maplibreMap.getLayer(layerName)\n if (!layer) return\n\n const features = maplibreMap.queryRenderedFeatures(event.point, { layers: [layerName] })\n tilePaneSelection.datum(features[0])\n canvasSelection.classed(s.onFeatureHover, Boolean(features[0]))\n })\n\n maplibreMap.on('load', () => {\n updateTopoJson(maplibreMap, config)\n })\n }\n\n const svgOverlay = select(leafletMap.getPanes().overlayPane).append('svg')\n const svgGroup = svgOverlay.append('g')\n\n return {\n leaflet: leafletMap,\n layer,\n svgOverlay,\n svgGroup,\n }\n}\n"],"names":["s.mapboxglCanvas","s.onFeatureHover"],"mappings":";;;;;;;MAoBa,gBAAgB,GAAuB,CAAC,EAAE,EAAE,EAAE,EAAC;AACrD,MAAM,cAAc,GAAG,IAAG;AAEj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T,CAAA;;AACF;;;;"}
1
+ {"version":3,"file":"map.js","sources":["../../../../src/components/leaflet-map/modules/map.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { select, Selection } from 'd3-selection'\nimport { GeoJSONSource, Map } from 'maplibre-gl'\nimport { feature } from 'topojson-client'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletMapConfig } from '../config'\n\n// Local Types\n\n// Utils\nimport { constraintMapView, mapboxglWheelEventThrottled } from '../renderer/mapboxgl-utils'\n\n// Styles\nimport * as s from '../style'\nimport { LeafletMapRenderer } from '../types'\n\nexport const initialMapCenter: L.LatLngExpression = [36, 14]\nexport const initialMapZoom = 1.9\n\nexport function updateTopoJson<T extends GenericDataRecord> (maplibreMap: Map, config: LeafletMapConfig<T>): void {\n const { topoJSONLayer } = config\n\n if (topoJSONLayer.sources) {\n const featureObject = topoJSONLayer.sources?.objects?.[topoJSONLayer.featureName]\n if (featureObject) {\n const mapSource = maplibreMap.getSource(topoJSONLayer.featureName) as GeoJSONSource\n const featureCollection = feature(topoJSONLayer.sources, featureObject)\n if (mapSource) {\n mapSource.setData(featureCollection)\n } else {\n maplibreMap.addSource(topoJSONLayer.featureName, { type: 'geojson', data: featureCollection })\n }\n }\n }\n\n const fillLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-area`)\n if (topoJSONLayer.fillProperty) {\n if (!fillLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-area`,\n type: 'fill',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-antialias': false,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-opacity': topoJSONLayer.fillOpacity,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-area`, 'fill-color', [\n 'case',\n ['!', ['has', topoJSONLayer.fillProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.fillProperty],\n ])\n } else if (fillLayer) maplibreMap.removeLayer(`${topoJSONLayer.featureName}-area`)\n\n const strokeLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-stroke`)\n if (topoJSONLayer.strokeProperty) {\n if (!strokeLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-stroke`,\n type: 'line',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-opacity': topoJSONLayer.strokeOpacity,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-width': topoJSONLayer.strokeWidth,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-stroke`, 'line-color', [\n 'case',\n ['!', ['has', topoJSONLayer.strokeProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.strokeProperty],\n ])\n } else if (strokeLayer) { maplibreMap.removeLayer(`${topoJSONLayer.featureName}-stroke`) }\n}\n\nexport async function setupMap<T extends GenericDataRecord> (mapContainer: HTMLElement, config: LeafletMapConfig<T>): Promise<{\n leaflet: L.Map;\n layer: L.Layer;\n svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;\n svgGroup: Selection<SVGGElement, unknown, SVGElement, undefined>;\n}> {\n const { style, renderer, topoJSONLayer } = config\n const leaflet = await import('leaflet')\n const L = leaflet.default\n\n if (!style) {\n console.error('Unovis | Leaflet Map: Please provide style settings in the map configuration object')\n return\n }\n\n const leafletMap = L.map(mapContainer, {\n scrollWheelZoom: renderer === LeafletMapRenderer.Raster, // We define custom scroll event for MapboxGL to enabling smooth zooming\n zoomControl: false,\n zoomDelta: renderer === LeafletMapRenderer.Raster ? 1 : 0.5,\n zoomSnap: renderer === LeafletMapRenderer.Raster ? 1 : 0,\n attributionControl: true,\n center: initialMapCenter,\n zoom: initialMapZoom,\n minZoom: Math.sqrt(mapContainer.offsetWidth) / 17,\n maxZoom: 23,\n maxBounds: L.latLngBounds(\n [-75, -290],\n [85, 290]\n ),\n maxBoundsViscosity: 1,\n })\n\n for (const attr of config.attribution) {\n leafletMap.attributionControl.addAttribution(attr)\n }\n\n let layer: L.Layer\n let maplibreMap = null\n\n switch (renderer) {\n case LeafletMapRenderer.MapLibre:\n // eslint-disable-next-line no-case-declarations\n const maplibre = await import('maplibre-gl')\n // eslint-disable-next-line no-case-declarations\n const { getMaplibreGLLayer } = await import('../renderer/mapboxgl-layer')\n layer = getMaplibreGLLayer(config, L, maplibre.default)\n maplibreMap = (layer as ReturnType<typeof getMaplibreGLLayer>).getMaplibreMap?.()\n break\n case LeafletMapRenderer.Raster:\n layer = L.tileLayer(style)\n break\n }\n layer.addTo(leafletMap)\n\n // leaflet-mapbox-gl has a layer positioning issue on far zoom levels which leads to having wrong\n // map points projection. We constraint the view to prevent that.\n constraintMapView(leafletMap)\n select(mapContainer).on('wheel', (event: WheelEvent) => {\n event.preventDefault()\n mapboxglWheelEventThrottled(leafletMap, layer, event)\n })\n\n if (maplibreMap && topoJSONLayer?.sources) {\n const canvas = maplibreMap.getCanvas()\n const canvasSelection = select(canvas).classed(s.mapboxglCanvas, true)\n const tilePaneSelection = select(leafletMap.getPanes().tilePane)\n\n maplibreMap.on('mousemove', (event) => {\n const layerName = `${topoJSONLayer.featureName}-area`\n const layer = maplibreMap.getLayer(layerName)\n if (!layer) return\n\n const features = maplibreMap.queryRenderedFeatures(event.point, { layers: [layerName] })\n tilePaneSelection.datum(features[0])\n canvasSelection.classed(s.onFeatureHover, Boolean(features[0]))\n })\n\n maplibreMap.on('load', () => {\n updateTopoJson(maplibreMap, config)\n })\n }\n\n const svgOverlay = select(leafletMap.getPanes().overlayPane).append('svg')\n const svgGroup = svgOverlay.append('g')\n\n return {\n leaflet: leafletMap,\n layer,\n svgOverlay,\n svgGroup,\n }\n}\n"],"names":["s.mapboxglCanvas","s.onFeatureHover"],"mappings":";;;;;;;MAoBa,gBAAgB,GAAuB,CAAC,EAAE,EAAE,EAAE,EAAC;AACrD,MAAM,cAAc,GAAG,IAAG;AAEjB,SAAA,cAAc,CA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;;"}
@@ -3,7 +3,7 @@ import Supercluster, { ClusterFeature, PointFeature } from 'supercluster';
3
3
  import { NumericAccessor, StringAccessor } from "../../../types/accessor";
4
4
  import { GenericDataRecord } from "../../../types/data";
5
5
  import { LeafletMapPoint, LeafletMapPointShape, LeafletMapPieDatum, LeafletMapPointStyles, PointExpandedClusterProperties, LeafletMapPointDatum, LeafletMapClusterDatum } from '../types';
6
- import { LeafletMapConfigInterface } from '../config';
6
+ import { LeafletMapConfig } from '../config';
7
7
  export declare function bBoxMerge(bBoxArray: ({
8
8
  x1: number;
9
9
  x2: number;
@@ -20,20 +20,20 @@ export declare function projectPoint<D extends GenericDataRecord>(geoJSONPoint:
20
20
  x: number;
21
21
  y: number;
22
22
  };
23
- export declare function getPointRadius<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>, pointRadius: NumericAccessor<LeafletMapPointDatum<D>> | NumericAccessor<LeafletMapClusterDatum<D>>, zoomLevel: number): number;
23
+ export declare function getPointRadius<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>, pointRadius: NumericAccessor<D>, zoomLevel: number): number;
24
24
  export declare function getPointPos<D extends GenericDataRecord>(point: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): {
25
25
  x: number;
26
26
  y: number;
27
27
  };
28
28
  export declare function getPointDisplayOrder<D extends GenericDataRecord>(d: LeafletMapPoint<D>, pointStatus: StringAccessor<LeafletMapPointDatum<D> | LeafletMapClusterDatum<D>>, colorMap: LeafletMapPointStyles<D>): number;
29
29
  export declare function toGeoJSONPoint<D extends GenericDataRecord>(d: D, i: number, pointLatitude: NumericAccessor<D>, pointLongitude: NumericAccessor<D>): PointFeature<D>;
30
- export declare function calculateClusterIndex<D extends GenericDataRecord>(data: D[], config: LeafletMapConfigInterface<D>, maxClusterZoomLevel?: number): Supercluster<D>;
30
+ export declare function calculateClusterIndex<D extends GenericDataRecord>(data: D[], config: LeafletMapConfig<D>, maxClusterZoomLevel?: number): Supercluster<D>;
31
31
  export declare function getNodePathData({ x, y }: {
32
32
  x: number;
33
33
  y: number;
34
34
  }, radius: number, shape: LeafletMapPointShape): string;
35
35
  export declare function getDonutData<D extends GenericDataRecord>(d: LeafletMapClusterDatum<D> | LeafletMapPointDatum<D>, colorMap: LeafletMapPointStyles<D>): LeafletMapPieDatum[];
36
- export declare function geoJsonPointToScreenPoint<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, i: number, leafletMap: L.Map, config: LeafletMapConfigInterface<D>): LeafletMapPoint<D>;
36
+ export declare function geoJsonPointToScreenPoint<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, i: number, leafletMap: L.Map, config: LeafletMapConfig<D>): LeafletMapPoint<D>;
37
37
  export declare function shouldClusterExpand<D extends GenericDataRecord>(cluster: LeafletMapPoint<D>, zoomLevel: number, midLevel?: number, maxLevel?: number, maxClusterZoomLevel?: number): boolean;
38
38
  export declare function findPointAndClusterByPointId<D extends GenericDataRecord>(points: LeafletMapPoint<D>[], id: string, pointId: StringAccessor<D>): {
39
39
  point: PointFeature<D> | undefined;
@@ -39,10 +39,7 @@ function projectPoint(geoJSONPoint, leafletMap) {
39
39
  }
40
40
  function getPointRadius(geoPoint, pointRadius, zoomLevel) {
41
41
  const isDynamic = !pointRadius;
42
- const radius = isDynamic
43
- ? 1 + 2 * Math.pow(zoomLevel, 0.80)
44
- // Todo: Needs a better typings handling
45
- : getNumber(geoPoint.properties, pointRadius);
42
+ const radius = isDynamic ? 1 + 2 * Math.pow(zoomLevel, 0.80) : getNumber(geoPoint.properties, pointRadius);
46
43
  const isCluster = geoPoint.properties.cluster;
47
44
  return (isCluster && isDynamic)
48
45
  ? clamp(Math.pow(geoPoint.properties.point_count, 0.35) * radius, radius * 1.1, radius * 3)
@@ -130,8 +127,7 @@ function geoJsonPointToScreenPoint(geoPoint, i, leafletMap, config) {
130
127
  const clusterPoints = isCluster ? clusterIndex.getLeaves(geoPoint.properties.cluster_id, Infinity).map(d => d.properties) : undefined;
131
128
  const { x, y } = getPointPos(geoPoint, leafletMap);
132
129
  const id = isCluster ? `cluster-${geoPoint.id}` : ((_a = getString(geoPoint.properties, config.pointId)) !== null && _a !== void 0 ? _a : geoPoint.geometry.coordinates.join(''));
133
- // Todo: Needs a better typings handling
134
- const pointColor = getColor(geoPoint.properties, (isCluster ? config.clusterColor : config.pointColor));
130
+ const pointColor = getColor(geoPoint.properties, isCluster ? config.clusterColor : config.pointColor);
135
131
  const radius = getPointRadius(geoPoint, isCluster ? config.clusterRadius : config.pointRadius, zoomLevel);
136
132
  const shape = isCluster ? LeafletMapPointShape.Circle : getString(geoPoint.properties, config.pointShape);
137
133
  const isRing = shape === LeafletMapPointShape.Ring;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../src/components/leaflet-map/modules/utils.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { min, max } from 'd3-array'\nimport Supercluster, { ClusterFeature, PointFeature } from 'supercluster'\n\n// Utils\nimport { clamp, getString, getNumber } from 'utils/data'\nimport { getColor } from 'utils/color'\nimport { polygon, circlePath } from 'utils/path'\nimport { getHTMLTransform } from 'utils/html'\n\n// Types\nimport { ColorAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n LeafletMapPoint,\n LeafletMapPointShape,\n LeafletMapPieDatum,\n LeafletMapPointStyles,\n PointExpandedClusterProperties,\n LeafletMapPointDatum,\n LeafletMapClusterDatum,\n} from '../types'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\nexport function bBoxMerge (\n bBoxArray: ({x1: number; x2: number; y1: number; y2: number})[]):\n { x: number; y: number; width: number; height: number } {\n let box = { x1: 0, x2: 0, y1: 0, y2: 0 }\n bBoxArray.forEach(coords => {\n if (!box) {\n box = { ...coords }\n } else {\n if (box.x1 > coords.x1) box.x1 = coords.x1\n if (box.y1 > coords.y1) box.y1 = coords.y1\n if (box.x2 < coords.x2) box.x2 = coords.x2\n if (box.y2 < coords.y2) box.y2 = coords.y2\n }\n })\n\n return {\n x: box.x1,\n y: box.y1,\n width: box.x2 - box.x1,\n height: box.y2 - box.y1,\n }\n}\n\nexport const getNextZoomLevelOnClusterClick = (level: number): number => clamp(1 + level * 1.5, level, 12)\n\nexport function projectPoint<D extends GenericDataRecord> (\n geoJSONPoint: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>,\n leafletMap: L.Map\n): { x: number; y: number } {\n const lat = geoJSONPoint.geometry.coordinates[1]\n const lon = geoJSONPoint.geometry.coordinates[0]\n const projected = leafletMap.latLngToLayerPoint([lat, lon])\n return projected\n}\n\nexport function getPointRadius<D extends GenericDataRecord> (\n geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>,\n pointRadius: NumericAccessor<LeafletMapPointDatum<D>> | NumericAccessor<LeafletMapClusterDatum<D>>,\n zoomLevel: number\n): number {\n const isDynamic = !pointRadius\n const radius = isDynamic\n ? 1 + 2 * Math.pow(zoomLevel, 0.80)\n // Todo: Needs a better typings handling\n : getNumber((geoPoint.properties as LeafletMapPointDatum<D>), pointRadius as NumericAccessor<LeafletMapPointDatum<D>>)\n\n const isCluster = (geoPoint as ClusterFeature<D>).properties.cluster\n return (isCluster && isDynamic)\n ? clamp(Math.pow((geoPoint as ClusterFeature<D>).properties.point_count, 0.35) * radius, radius * 1.1, radius * 3)\n : radius\n}\n\nexport function getPointPos<D extends GenericDataRecord> (point: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): { x: number; y: number } {\n const properties = point.properties as LeafletMapPointDatum<D>\n const isFromCluster = !!(properties).expandedClusterPoint\n\n if (isFromCluster) {\n const { x, y } = projectPoint(properties.expandedClusterPoint, leafletMap)\n return {\n x: x + properties.dx,\n y: y + properties.dy,\n }\n } else {\n return projectPoint(point, leafletMap)\n }\n}\n\nexport function getPointDisplayOrder<D extends GenericDataRecord> (\n d: LeafletMapPoint<D>,\n pointStatus: StringAccessor<LeafletMapPointDatum<D> | LeafletMapClusterDatum<D>>,\n colorMap: LeafletMapPointStyles<D>\n): number {\n const status = getString(d.properties, pointStatus)\n const statusList = Object.keys(colorMap)\n return Object.keys(statusList).indexOf(status)\n}\n\nexport function toGeoJSONPoint<D extends GenericDataRecord> (d: D, i: number, pointLatitude: NumericAccessor<D>, pointLongitude: NumericAccessor<D>): PointFeature<D> {\n const lat = getNumber(d, pointLatitude) as number\n const lon = getNumber(d, pointLongitude) as number\n\n return {\n type: 'Feature',\n properties: {\n ...d,\n _index: i,\n },\n geometry: {\n type: 'Point',\n coordinates: [lon, lat],\n },\n }\n}\n\nexport function calculateClusterIndex<D extends GenericDataRecord> (data: D[], config: LeafletMapConfigInterface<D>, maxClusterZoomLevel = 23): Supercluster<D> {\n const { colorMap, pointShape, pointLatitude, pointLongitude, clusteringDistance } = config\n return new Supercluster<D, Supercluster.AnyProps>({\n radius: clusteringDistance,\n maxZoom: maxClusterZoomLevel,\n map: (d): Supercluster.AnyProps => {\n const shape = getString(d, pointShape)\n\n const clusterPoint = { shape }\n for (const key of Object.keys(colorMap)) {\n clusterPoint[key] = d[key] || 0\n }\n\n return clusterPoint\n },\n reduce: (acc, clusterPoint): void => {\n acc.shape = acc.shape === clusterPoint.shape ? acc.shape : LeafletMapPointShape.Circle\n acc.value = (acc.value ?? 0) + (clusterPoint.value ?? 0)\n\n for (const key of Object.keys(colorMap)) {\n acc[key] += clusterPoint[key]\n }\n },\n }).load(data.map((d, i) => toGeoJSONPoint(d, i, pointLatitude, pointLongitude)))\n}\n\nexport function getNodePathData ({ x, y }: { x: number; y: number }, radius: number, shape: LeafletMapPointShape): string {\n switch (shape) {\n case LeafletMapPointShape.Triangle:\n return polygon(radius * 2, 3)\n case LeafletMapPointShape.Square:\n return polygon(radius * 2, 4)\n case LeafletMapPointShape.Circle:\n case LeafletMapPointShape.Ring:\n default:\n return circlePath(x, y, radius)\n }\n}\n\nexport function getDonutData<D extends GenericDataRecord> (\n d: LeafletMapClusterDatum<D> | LeafletMapPointDatum<D>,\n colorMap: LeafletMapPointStyles<D>\n): LeafletMapPieDatum[] {\n return Object.keys(colorMap).map(key => ({\n name: key,\n value: d[key] as number,\n color: colorMap[key].color,\n className: colorMap[key].className,\n }))\n}\n\nexport function geoJsonPointToScreenPoint<D extends GenericDataRecord> (\n geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>,\n i: number,\n leafletMap: L.Map,\n config: LeafletMapConfigInterface<D>\n): LeafletMapPoint<D> {\n const zoomLevel = leafletMap.getZoom()\n const isCluster = (geoPoint.properties as LeafletMapClusterDatum<D>).cluster\n const clusterIndex = (geoPoint.properties as LeafletMapClusterDatum<D>).clusterIndex\n const clusterPoints = isCluster ? clusterIndex.getLeaves((geoPoint.properties as LeafletMapClusterDatum<D>).cluster_id as number, Infinity).map(d => d.properties) : undefined\n const { x, y } = getPointPos(geoPoint, leafletMap)\n\n const id = isCluster ? `cluster-${geoPoint.id}` : (getString(geoPoint.properties as LeafletMapPointDatum<D>, config.pointId) ?? geoPoint.geometry.coordinates.join(''))\n // Todo: Needs a better typings handling\n const pointColor = getColor(geoPoint.properties as LeafletMapPointDatum<D>, (isCluster ? config.clusterColor : config.pointColor) as ColorAccessor<LeafletMapPointDatum<D>>)\n const radius = getPointRadius(geoPoint, isCluster ? config.clusterRadius : config.pointRadius, zoomLevel)\n const shape = isCluster ? LeafletMapPointShape.Circle : getString(geoPoint.properties as LeafletMapPointDatum<D>, config.pointShape) as LeafletMapPointShape\n const isRing = shape === LeafletMapPointShape.Ring\n\n const donutData = getDonutData(geoPoint.properties, config.colorMap)\n const maxValue = max(donutData, d => d.value)\n const maxValueIndex = donutData.map(d => d.value).indexOf(maxValue)\n const biggestDatum = donutData[maxValueIndex ?? 0]\n\n const color = isCluster ? pointColor\n : (isRing ? null : (pointColor ?? biggestDatum?.color))\n const bbox = { x1: x - radius, y1: y - radius, x2: x + radius, y2: y + radius }\n const path = getNodePathData({ x: 0, y: 0 }, radius, shape)\n const _zIndex = 0\n\n const screenPoint: LeafletMapPoint<D> = {\n ...geoPoint,\n id,\n bbox,\n radius,\n donutData,\n path,\n color,\n isCluster,\n clusterIndex,\n clusterPoints,\n _zIndex,\n }\n\n return screenPoint\n}\n\nexport function shouldClusterExpand<D extends GenericDataRecord> (\n cluster: LeafletMapPoint<D>,\n zoomLevel: number,\n midLevel = 4,\n maxLevel = 8,\n maxClusterZoomLevel = 23\n): boolean {\n if (!cluster) return false\n\n const clusterExpansionZoomLevel = cluster.clusterIndex.getClusterExpansionZoom(cluster.properties.cluster_id as number)\n return zoomLevel >= maxLevel ||\n (zoomLevel >= midLevel && (cluster.properties.point_count < 20 || clusterExpansionZoomLevel >= maxClusterZoomLevel))\n}\n\nexport function findPointAndClusterByPointId<D extends GenericDataRecord> (\n points: LeafletMapPoint<D>[],\n id: string,\n pointId: StringAccessor<D>\n): {\n point: PointFeature<D> | undefined;\n cluster: LeafletMapPoint<D> | undefined;\n } {\n let point\n let cluster\n points.forEach(p => {\n if (p.isCluster) {\n const leaves = p.clusterIndex.getLeaves((p.properties as LeafletMapClusterDatum<D>).cluster_id as number, Infinity) ?? []\n const foundPoint = leaves.find(d => getString(d.properties, pointId) === id)\n if (foundPoint) {\n point = foundPoint\n cluster = p\n }\n }\n })\n return { point, cluster }\n}\n\nexport function getNodeRelativePosition<D extends GenericDataRecord> (d: LeafletMapPoint<D>, leafletMap: L.Map): { x: number; y: number } {\n const paneTransform = getHTMLTransform(leafletMap.getPane('mapPane'))\n const { x, y } = getPointPos(d, leafletMap)\n return { x: x + paneTransform[0], y: y + paneTransform[1] }\n}\n\nexport function getClusterRadius<D extends GenericDataRecord> (cluster: { points: PointFeature<PointExpandedClusterProperties<D>>[]; cluster: LeafletMapPoint<D> }): number {\n const { points } = cluster\n const minX = min<number>(points.map(d => d.properties.dx - d.properties.r))\n const maxX = max<number>(points.map(d => d.properties.dx + d.properties.r))\n const minY = min<number>(points.map(d => d.properties.dy - d.properties.r))\n const maxY = max<number>(points.map(d => d.properties.dy + d.properties.r))\n return Math.sqrt((maxX - minX) ** 2 + (maxY - minY) ** 2) * 0.5\n}\n\nexport function getClustersAndPoints<D extends GenericDataRecord> (\n clusterIndex: Supercluster<D>,\n leafletMap: L.Map,\n customBounds?: [number, number, number, number]\n): (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[] {\n const leafletBounds = leafletMap.getBounds()\n const southWest = leafletBounds.getSouthWest()\n const northEast = leafletBounds.getNorthEast()\n const bounds = customBounds || [southWest.lng, southWest.lat, northEast.lng, northEast.lat]\n const zoom = Math.round(leafletMap.getZoom())\n const points = clusterIndex.getClusters(bounds, zoom) // as ClusterFeature<LeafletMapPointDatum<D>>[]\n\n for (const p of points) {\n const point = p as ClusterFeature<LeafletMapClusterDatum<D>>\n const isCluster = point.properties.cluster\n if (isCluster) {\n point.properties.clusterIndex = clusterIndex\n point.properties.clusterPoints = clusterIndex.getLeaves(point.properties.cluster_id, Infinity).map(d => d.properties)\n }\n }\n\n return points as (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[]\n}\n"],"names":[],"mappings":";;;;;;;;AA4BM,SAAU,SAAS,CACvB,SAA+D,EAAA;AAE/D,IAAA,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,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AC,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAA;IAC3F,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;AAC7C,IAAA,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAErD,IAAA,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;QACtB,MAAM,KAAK,GAAG,CAA8C,CAAA;AAC5D,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAA;AAC1C,QAAA,IAAI,SAAS,EAAE;AACb,YAAA,KAAK,CAAC,UAAU,CAAC,YAAY,GAAG,YAAY,CAAA;AAC5C,YAAA,KAAK,CAAC,UAAU,CAAC,aAAa,GAAG,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAA;AACtH,SAAA;AACF,KAAA;AAED,IAAA,OAAO,MAAyE,CAAA;AAClF;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/components/leaflet-map/modules/utils.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { min, max } from 'd3-array'\nimport Supercluster, { ClusterFeature, PointFeature } from 'supercluster'\n\n// Utils\nimport { clamp, getString, getNumber } from 'utils/data'\nimport { getColor } from 'utils/color'\nimport { polygon, circlePath } from 'utils/path'\nimport { getHTMLTransform } from 'utils/html'\n\n// Types\nimport { NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n LeafletMapPoint,\n LeafletMapPointShape,\n LeafletMapPieDatum,\n LeafletMapPointStyles,\n PointExpandedClusterProperties,\n LeafletMapPointDatum,\n LeafletMapClusterDatum,\n} from '../types'\n\n// Config\nimport { LeafletMapConfig } from '../config'\n\nexport function bBoxMerge (\n bBoxArray: ({x1: number; x2: number; y1: number; y2: number})[]):\n { x: number; y: number; width: number; height: number } {\n let box = { x1: 0, x2: 0, y1: 0, y2: 0 }\n bBoxArray.forEach(coords => {\n if (!box) {\n box = { ...coords }\n } else {\n if (box.x1 > coords.x1) box.x1 = coords.x1\n if (box.y1 > coords.y1) box.y1 = coords.y1\n if (box.x2 < coords.x2) box.x2 = coords.x2\n if (box.y2 < coords.y2) box.y2 = coords.y2\n }\n })\n\n return {\n x: box.x1,\n y: box.y1,\n width: box.x2 - box.x1,\n height: box.y2 - box.y1,\n }\n}\n\nexport const getNextZoomLevelOnClusterClick = (level: number): number => clamp(1 + level * 1.5, level, 12)\n\nexport function projectPoint<D extends GenericDataRecord> (\n geoJSONPoint: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>,\n leafletMap: L.Map\n): { x: number; y: number } {\n const lat = geoJSONPoint.geometry.coordinates[1]\n const lon = geoJSONPoint.geometry.coordinates[0]\n const projected = leafletMap.latLngToLayerPoint([lat, lon])\n return projected\n}\n\nexport function getPointRadius<D extends GenericDataRecord> (\n geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>,\n pointRadius: NumericAccessor<D>,\n zoomLevel: number\n): number {\n const isDynamic = !pointRadius\n const radius = isDynamic ? 1 + 2 * Math.pow(zoomLevel, 0.80) : getNumber((geoPoint.properties as LeafletMapPointDatum<D>), pointRadius)\n\n const isCluster = (geoPoint as ClusterFeature<D>).properties.cluster\n return (isCluster && isDynamic)\n ? clamp(Math.pow((geoPoint as ClusterFeature<D>).properties.point_count, 0.35) * radius, radius * 1.1, radius * 3)\n : radius\n}\n\nexport function getPointPos<D extends GenericDataRecord> (point: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): { x: number; y: number } {\n const properties = point.properties as LeafletMapPointDatum<D>\n const isFromCluster = !!(properties).expandedClusterPoint\n\n if (isFromCluster) {\n const { x, y } = projectPoint(properties.expandedClusterPoint, leafletMap)\n return {\n x: x + properties.dx,\n y: y + properties.dy,\n }\n } else {\n return projectPoint(point, leafletMap)\n }\n}\n\nexport function getPointDisplayOrder<D extends GenericDataRecord> (\n d: LeafletMapPoint<D>,\n pointStatus: StringAccessor<LeafletMapPointDatum<D> | LeafletMapClusterDatum<D>>,\n colorMap: LeafletMapPointStyles<D>\n): number {\n const status = getString(d.properties, pointStatus)\n const statusList = Object.keys(colorMap)\n return Object.keys(statusList).indexOf(status)\n}\n\nexport function toGeoJSONPoint<D extends GenericDataRecord> (d: D, i: number, pointLatitude: NumericAccessor<D>, pointLongitude: NumericAccessor<D>): PointFeature<D> {\n const lat = getNumber(d, pointLatitude) as number\n const lon = getNumber(d, pointLongitude) as number\n\n return {\n type: 'Feature',\n properties: {\n ...d,\n _index: i,\n },\n geometry: {\n type: 'Point',\n coordinates: [lon, lat],\n },\n }\n}\n\nexport function calculateClusterIndex<D extends GenericDataRecord> (data: D[], config: LeafletMapConfig<D>, maxClusterZoomLevel = 23): Supercluster<D> {\n const { colorMap, pointShape, pointLatitude, pointLongitude, clusteringDistance } = config\n return new Supercluster<D, Supercluster.AnyProps>({\n radius: clusteringDistance,\n maxZoom: maxClusterZoomLevel,\n map: (d): Supercluster.AnyProps => {\n const shape = getString(d, pointShape)\n\n const clusterPoint = { shape }\n for (const key of Object.keys(colorMap)) {\n clusterPoint[key] = d[key] || 0\n }\n\n return clusterPoint\n },\n reduce: (acc, clusterPoint): void => {\n acc.shape = acc.shape === clusterPoint.shape ? acc.shape : LeafletMapPointShape.Circle\n acc.value = (acc.value ?? 0) + (clusterPoint.value ?? 0)\n\n for (const key of Object.keys(colorMap)) {\n acc[key] += clusterPoint[key]\n }\n },\n }).load(data.map((d, i) => toGeoJSONPoint(d, i, pointLatitude, pointLongitude)))\n}\n\nexport function getNodePathData ({ x, y }: { x: number; y: number }, radius: number, shape: LeafletMapPointShape): string {\n switch (shape) {\n case LeafletMapPointShape.Triangle:\n return polygon(radius * 2, 3)\n case LeafletMapPointShape.Square:\n return polygon(radius * 2, 4)\n case LeafletMapPointShape.Circle:\n case LeafletMapPointShape.Ring:\n default:\n return circlePath(x, y, radius)\n }\n}\n\nexport function getDonutData<D extends GenericDataRecord> (\n d: LeafletMapClusterDatum<D> | LeafletMapPointDatum<D>,\n colorMap: LeafletMapPointStyles<D>\n): LeafletMapPieDatum[] {\n return Object.keys(colorMap).map(key => ({\n name: key,\n value: d[key] as number,\n color: colorMap[key].color,\n className: colorMap[key].className,\n }))\n}\n\nexport function geoJsonPointToScreenPoint<D extends GenericDataRecord> (\n geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>,\n i: number,\n leafletMap: L.Map,\n config: LeafletMapConfig<D>\n): LeafletMapPoint<D> {\n const zoomLevel = leafletMap.getZoom()\n const isCluster = (geoPoint.properties as LeafletMapClusterDatum<D>).cluster\n const clusterIndex = (geoPoint.properties as LeafletMapClusterDatum<D>).clusterIndex\n const clusterPoints = isCluster ? clusterIndex.getLeaves((geoPoint.properties as LeafletMapClusterDatum<D>).cluster_id as number, Infinity).map(d => d.properties) : undefined\n const { x, y } = getPointPos(geoPoint, leafletMap)\n\n const id = isCluster ? `cluster-${geoPoint.id}` : (getString(geoPoint.properties as LeafletMapPointDatum<D>, config.pointId) ?? geoPoint.geometry.coordinates.join(''))\n const pointColor = getColor(geoPoint.properties, isCluster ? config.clusterColor : config.pointColor)\n const radius = getPointRadius(geoPoint, isCluster ? config.clusterRadius : config.pointRadius, zoomLevel)\n const shape = isCluster ? LeafletMapPointShape.Circle : getString(geoPoint.properties as LeafletMapPointDatum<D>, config.pointShape) as LeafletMapPointShape\n const isRing = shape === LeafletMapPointShape.Ring\n\n const donutData = getDonutData(geoPoint.properties, config.colorMap)\n const maxValue = max(donutData, d => d.value)\n const maxValueIndex = donutData.map(d => d.value).indexOf(maxValue)\n const biggestDatum = donutData[maxValueIndex ?? 0]\n\n const color = isCluster ? pointColor\n : (isRing ? null : (pointColor ?? biggestDatum?.color))\n const bbox = { x1: x - radius, y1: y - radius, x2: x + radius, y2: y + radius }\n const path = getNodePathData({ x: 0, y: 0 }, radius, shape)\n const _zIndex = 0\n\n const screenPoint: LeafletMapPoint<D> = {\n ...geoPoint,\n id,\n bbox,\n radius,\n donutData,\n path,\n color,\n isCluster,\n clusterIndex,\n clusterPoints,\n _zIndex,\n }\n\n return screenPoint\n}\n\nexport function shouldClusterExpand<D extends GenericDataRecord> (\n cluster: LeafletMapPoint<D>,\n zoomLevel: number,\n midLevel = 4,\n maxLevel = 8,\n maxClusterZoomLevel = 23\n): boolean {\n if (!cluster) return false\n\n const clusterExpansionZoomLevel = cluster.clusterIndex.getClusterExpansionZoom(cluster.properties.cluster_id as number)\n return zoomLevel >= maxLevel ||\n (zoomLevel >= midLevel && (cluster.properties.point_count < 20 || clusterExpansionZoomLevel >= maxClusterZoomLevel))\n}\n\nexport function findPointAndClusterByPointId<D extends GenericDataRecord> (\n points: LeafletMapPoint<D>[],\n id: string,\n pointId: StringAccessor<D>\n): {\n point: PointFeature<D> | undefined;\n cluster: LeafletMapPoint<D> | undefined;\n } {\n let point\n let cluster\n points.forEach(p => {\n if (p.isCluster) {\n const leaves = p.clusterIndex.getLeaves((p.properties as LeafletMapClusterDatum<D>).cluster_id as number, Infinity) ?? []\n const foundPoint = leaves.find(d => getString(d.properties, pointId) === id)\n if (foundPoint) {\n point = foundPoint\n cluster = p\n }\n }\n })\n return { point, cluster }\n}\n\nexport function getNodeRelativePosition<D extends GenericDataRecord> (d: LeafletMapPoint<D>, leafletMap: L.Map): { x: number; y: number } {\n const paneTransform = getHTMLTransform(leafletMap.getPane('mapPane'))\n const { x, y } = getPointPos(d, leafletMap)\n return { x: x + paneTransform[0], y: y + paneTransform[1] }\n}\n\nexport function getClusterRadius<D extends GenericDataRecord> (cluster: { points: PointFeature<PointExpandedClusterProperties<D>>[]; cluster: LeafletMapPoint<D> }): number {\n const { points } = cluster\n const minX = min<number>(points.map(d => d.properties.dx - d.properties.r))\n const maxX = max<number>(points.map(d => d.properties.dx + d.properties.r))\n const minY = min<number>(points.map(d => d.properties.dy - d.properties.r))\n const maxY = max<number>(points.map(d => d.properties.dy + d.properties.r))\n return Math.sqrt((maxX - minX) ** 2 + (maxY - minY) ** 2) * 0.5\n}\n\nexport function getClustersAndPoints<D extends GenericDataRecord> (\n clusterIndex: Supercluster<D>,\n leafletMap: L.Map,\n customBounds?: [number, number, number, number]\n): (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[] {\n const leafletBounds = leafletMap.getBounds()\n const southWest = leafletBounds.getSouthWest()\n const northEast = leafletBounds.getNorthEast()\n const bounds = customBounds || [southWest.lng, southWest.lat, northEast.lng, northEast.lat]\n const zoom = Math.round(leafletMap.getZoom())\n const points = clusterIndex.getClusters(bounds, zoom) // as ClusterFeature<LeafletMapPointDatum<D>>[]\n\n for (const p of points) {\n const point = p as ClusterFeature<LeafletMapClusterDatum<D>>\n const isCluster = point.properties.cluster\n if (isCluster) {\n point.properties.clusterIndex = clusterIndex\n point.properties.clusterPoints = clusterIndex.getLeaves(point.properties.cluster_id, Infinity).map(d => d.properties)\n }\n }\n\n return points as (ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<D>)[]\n}\n"],"names":[],"mappings":";;;;;;;;AA4BM,SAAU,SAAS,CACvB,SAA+D,EAAA;AAE/D,IAAA,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAA;AACxC,IAAA,SAAS,CAAC,OAAO,CAAC,MAAM,IAAG;QACzB,IAAI,CAAC,GAAG,EAAE;YACR,GAAG,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAQ,MAAM,C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A,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAErD,IAAA,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;QACtB,MAAM,KAAK,GAAG,CAA8C,CAAA;AAC5D,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAA;AAC1C,QAAA,IAAI,SAAS,EAAE;AACb,YAAA,KAAK,CAAC,UAAU,CAAC,YAAY,GAAG,YAAY,CAAA;AAC5C,YAAA,KAAK,CAAC,UAAU,CAAC,aAAa,GAAG,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAA;AACtH,SAAA;AACF,KAAA;AAED,IAAA,OAAO,MAAyE,CAAA;AAClF;;;;"}
@@ -2,7 +2,7 @@ import type L from 'leaflet';
2
2
  import type Maplibre from 'maplibre-gl';
3
3
  import type { Map } from 'maplibre-gl';
4
4
  import { GenericDataRecord } from "../../../types/data";
5
- import { LeafletMapConfigInterface } from '../config';
6
- export declare function getMaplibreGLLayer<Datum extends GenericDataRecord>(config: LeafletMapConfigInterface<Datum>, leaflet: typeof L, maplibre: typeof Maplibre): L.Layer & {
5
+ import { LeafletMapConfig } from '../config';
6
+ export declare function getMaplibreGLLayer<Datum extends GenericDataRecord>(config: LeafletMapConfig<Datum>, leaflet: typeof L, maplibre: typeof Maplibre): L.Layer & {
7
7
  getMaplibreMap(): Map;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mapboxgl-layer.js","sources":["../../../../src/components/leaflet-map/renderer/mapboxgl-layer.ts"],"sourcesContent":["import type L from 'leaflet'\nimport type Maplibre from 'maplibre-gl'\nimport type { Map } from 'maplibre-gl'\n\nimport { injectGlobal } from '@emotion/css'\n\n// Utils\nimport { isObject } from 'utils/data'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\nimport { MapLibreStyleSpecs } from './map-style'\nimport { MaplibreGLLayer } from './leaflet-maplibre-gl'\n\n// Inject MapLibreGL global style\nimport mapLibreStyles from './maplibre-gl.css.js'\ninjectGlobal(mapLibreStyles)\n\nexport function getMaplibreGLLayer<Datum extends GenericDataRecord> (config: LeafletMapConfigInterface<Datum>, leaflet: typeof L, maplibre: typeof Maplibre): L.Layer & { getMaplibreMap(): Map } {\n const { accessToken, style } = config\n\n if (isObject(style) && !(style as MapLibreStyleSpecs).glyphs) {\n console.warn('Unovis | Leaflet Map: Glyphs URL is required in order to show the map. Set `mapboxglGlyphs` URL in the style settings')\n return\n }\n\n if (isObject(style) && !(style as MapLibreStyleSpecs).sources) {\n console.warn('Unovis | Leaflet Map: Sources settings are required in order to show map. Set the `sources` property in the style settings')\n return\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const layer = MaplibreGLLayer(leaflet, maplibre, {\n style: style,\n accessToken: accessToken || 'not-needed',\n })\n\n return layer\n}\n"],"names":[],"mappings":";;;;;AAmBA,YAAY,CAAC,cAAc,CAAC,CAAA;SAEZ,kBAAkB,CAAmC,MAAwC,EAAE,OAAiB,EAAE,QAAyB,EAAA;AACzJ,IAAA,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAErC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAE,KAA4B,CAAC,MAAM,EAAE;AAC5D,QAAA,OAAO,CAAC,IAAI,CAAC,uHAAuH,CAAC,CAAA;QACrI,OAAM;AACP,KAAA;IAED,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAE,KAA4B,CAAC,OAAO,EAAE;AAC7D,QAAA,OAAO,CAAC,IAAI,CAAC,4HAA4H,CAAC,CAAA;QAC1I,OAAM;AACP,KAAA;;;AAID,IAAA,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE;AAC/C,QAAA,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,WAAW,IAAI,YAAY;AACzC,KAAA,CAAC,CAAA;AAEF,IAAA,OAAO,KAAK,CAAA;AACd;;;;"}
1
+ {"version":3,"file":"mapboxgl-layer.js","sources":["../../../../src/components/leaflet-map/renderer/mapboxgl-layer.ts"],"sourcesContent":["import type L from 'leaflet'\nimport type Maplibre from 'maplibre-gl'\nimport type { Map } from 'maplibre-gl'\n\nimport { injectGlobal } from '@emotion/css'\n\n// Utils\nimport { isObject } from 'utils/data'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletMapConfig } from '../config'\nimport { MapLibreStyleSpecs } from './map-style'\nimport { MaplibreGLLayer } from './leaflet-maplibre-gl'\n\n// Inject MapLibreGL global style\nimport mapLibreStyles from './maplibre-gl.css.js'\ninjectGlobal(mapLibreStyles)\n\nexport function getMaplibreGLLayer<Datum extends GenericDataRecord> (config: LeafletMapConfig<Datum>, leaflet: typeof L, maplibre: typeof Maplibre): L.Layer & { getMaplibreMap(): Map } {\n const { accessToken, style } = config\n\n if (isObject(style) && !(style as MapLibreStyleSpecs).glyphs) {\n console.warn('Unovis | Leaflet Map: Glyphs URL is required in order to show the map. Set `mapboxglGlyphs` URL in the style settings')\n return\n }\n\n if (isObject(style) && !(style as MapLibreStyleSpecs).sources) {\n console.warn('Unovis | Leaflet Map: Sources settings are required in order to show map. Set the `sources` property in the style settings')\n return\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const layer = MaplibreGLLayer(leaflet, maplibre, {\n style: style,\n accessToken: accessToken || 'not-needed',\n })\n\n return layer\n}\n"],"names":[],"mappings":";;;;;AAmBA,YAAY,CAAC,cAAc,CAAC,CAAA;SAEZ,kBAAkB,CAAmC,MAA+B,EAAE,OAAiB,EAAE,QAAyB,EAAA;AAChJ,IAAA,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAErC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAE,KAA4B,CAAC,MAAM,EAAE;AAC5D,QAAA,OAAO,CAAC,IAAI,CAAC,uHAAuH,CAAC,CAAA;QACrI,OAAM;AACP,KAAA;IAED,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAE,KAA4B,CAAC,OAAO,EAAE;AAC7D,QAAA,OAAO,CAAC,IAAI,CAAC,4HAA4H,CAAC,CAAA;QAC1I,OAAM;AACP,KAAA;;;AAID,IAAA,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE;AAC/C,QAAA,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,WAAW,IAAI,YAAY;AACzC,KAAA,CAAC,CAAA;AAEF,IAAA,OAAO,KAAK,CAAA;AACd;;;;"}