@unovis/ts 1.3.0-beta.3 → 1.3.0
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.
- package/components/area/config.d.ts +6 -10
- package/components/area/config.js +3 -12
- package/components/area/config.js.map +1 -1
- package/components/area/index.d.ts +5 -6
- package/components/area/index.js +10 -9
- package/components/area/index.js.map +1 -1
- package/components/axis/config.d.ts +3 -27
- package/components/axis/config.js +3 -30
- package/components/axis/config.js.map +1 -1
- package/components/axis/index.d.ts +4 -3
- package/components/axis/index.js +8 -5
- package/components/axis/index.js.map +1 -1
- package/components/brush/config.d.ts +2 -12
- package/components/brush/config.js +11 -20
- package/components/brush/config.js.map +1 -1
- package/components/brush/index.d.ts +4 -3
- package/components/brush/index.js +4 -3
- package/components/brush/index.js.map +1 -1
- package/components/bullet-legend/config.d.ts +1 -10
- package/components/bullet-legend/config.js +11 -14
- package/components/bullet-legend/config.js.map +1 -1
- package/components/bullet-legend/index.d.ts +4 -3
- package/components/bullet-legend/index.js +5 -2
- package/components/bullet-legend/index.js.map +1 -1
- package/components/chord-diagram/config.d.ts +7 -23
- package/components/chord-diagram/config.js +4 -23
- package/components/chord-diagram/config.js.map +1 -1
- package/components/chord-diagram/index.d.ts +4 -3
- package/components/chord-diagram/index.js +8 -7
- package/components/chord-diagram/index.js.map +1 -1
- package/components/chord-diagram/modules/label.d.ts +3 -3
- package/components/chord-diagram/modules/label.js +1 -1
- package/components/chord-diagram/modules/label.js.map +1 -1
- package/components/chord-diagram/modules/link.d.ts +2 -2
- package/components/chord-diagram/modules/link.js.map +1 -1
- package/components/chord-diagram/modules/node.d.ts +2 -2
- package/components/chord-diagram/modules/node.js.map +1 -1
- package/components/chord-diagram/types.d.ts +3 -2
- package/components/chord-diagram/types.js.map +1 -1
- package/components/crosshair/config.d.ts +4 -14
- package/components/crosshair/config.js +3 -16
- package/components/crosshair/config.js.map +1 -1
- package/components/crosshair/index.d.ts +4 -3
- package/components/crosshair/index.js +4 -3
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/config.d.ts +3 -20
- package/components/donut/config.js +3 -24
- package/components/donut/config.js.map +1 -1
- package/components/donut/index.d.ts +4 -3
- package/components/donut/index.js +5 -4
- package/components/donut/index.js.map +1 -1
- package/components/donut/modules/arc.d.ts +3 -3
- package/components/donut/modules/arc.js.map +1 -1
- package/components/flow-legend/config.d.ts +1 -11
- package/components/flow-legend/config.js +11 -16
- package/components/flow-legend/config.js.map +1 -1
- package/components/flow-legend/index.d.ts +4 -3
- package/components/flow-legend/index.js +5 -2
- package/components/flow-legend/index.js.map +1 -1
- package/components/free-brush/config.d.ts +2 -12
- package/components/free-brush/config.js +11 -20
- package/components/free-brush/config.js.map +1 -1
- package/components/free-brush/index.d.ts +4 -3
- package/components/free-brush/index.js +13 -12
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/config.d.ts +3 -75
- package/components/graph/config.js +13 -79
- package/components/graph/config.js.map +1 -1
- package/components/graph/index.d.ts +8 -7
- package/components/graph/index.js +7 -5
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/layout.d.ts +7 -7
- package/components/graph/modules/layout.js +7 -2
- package/components/graph/modules/layout.js.map +1 -1
- package/components/graph/modules/link/helper.d.ts +5 -5
- package/components/graph/modules/link/helper.js.map +1 -1
- package/components/graph/modules/link/index.d.ts +6 -6
- package/components/graph/modules/link/index.js.map +1 -1
- package/components/graph/modules/node/helper.d.ts +1 -1
- package/components/graph/modules/node/helper.js.map +1 -1
- package/components/graph/modules/node/index.d.ts +9 -6
- package/components/graph/modules/node/index.js +7 -9
- package/components/graph/modules/node/index.js.map +1 -1
- package/components/graph/modules/panel/helper.d.ts +4 -4
- package/components/graph/modules/panel/helper.js.map +1 -1
- package/components/graph/modules/panel/index.d.ts +3 -3
- package/components/graph/modules/panel/index.js.map +1 -1
- package/components/graph/modules/shape.js +2 -2
- package/components/graph/modules/shape.js.map +1 -1
- package/components/grouped-bar/config.d.ts +5 -13
- package/components/grouped-bar/config.js +3 -16
- package/components/grouped-bar/config.js.map +1 -1
- package/components/grouped-bar/index.d.ts +5 -9
- package/components/grouped-bar/index.js +5 -15
- package/components/grouped-bar/index.js.map +1 -1
- package/components/leaflet-flow-map/config.d.ts +2 -16
- package/components/leaflet-flow-map/config.js +3 -21
- package/components/leaflet-flow-map/config.js.map +1 -1
- package/components/leaflet-flow-map/index.d.ts +4 -3
- package/components/leaflet-flow-map/index.js +3 -2
- package/components/leaflet-flow-map/index.js.map +1 -1
- package/components/leaflet-map/config.d.ts +4 -59
- package/components/leaflet-map/config.js +24 -68
- package/components/leaflet-map/config.js.map +1 -1
- package/components/leaflet-map/index.d.ts +5 -4
- package/components/leaflet-map/index.js +4 -3
- package/components/leaflet-map/index.js.map +1 -1
- package/components/leaflet-map/modules/clusterBackground.d.ts +4 -2
- package/components/leaflet-map/modules/clusterBackground.js.map +1 -1
- package/components/leaflet-map/modules/map.d.ts +4 -4
- package/components/leaflet-map/modules/map.js +6 -6
- package/components/leaflet-map/modules/map.js.map +1 -1
- package/components/leaflet-map/modules/node.d.ts +3 -0
- package/components/leaflet-map/modules/node.js +8 -12
- package/components/leaflet-map/modules/node.js.map +1 -1
- package/components/leaflet-map/modules/utils.d.ts +4 -4
- package/components/leaflet-map/modules/utils.js +6 -2
- package/components/leaflet-map/modules/utils.js.map +1 -1
- package/components/leaflet-map/renderer/mapboxgl-layer.d.ts +2 -2
- package/components/leaflet-map/renderer/mapboxgl-layer.js.map +1 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.d.ts +5 -1
- package/components/leaflet-map/renderer/mapboxgl-utils.js +3 -3
- package/components/leaflet-map/renderer/mapboxgl-utils.js.map +1 -1
- package/components/leaflet-map/style.js.map +1 -1
- package/components/leaflet-map/types.d.ts +5 -1
- package/components/leaflet-map/types.js.map +1 -1
- package/components/line/config.d.ts +6 -11
- package/components/line/config.js +3 -13
- package/components/line/config.js.map +1 -1
- package/components/line/index.d.ts +6 -5
- package/components/line/index.js +7 -6
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/config.d.ts +2 -21
- package/components/nested-donut/config.js +3 -24
- package/components/nested-donut/config.js.map +1 -1
- package/components/nested-donut/index.d.ts +4 -3
- package/components/nested-donut/index.js +18 -8
- package/components/nested-donut/index.js.map +1 -1
- package/components/nested-donut/modules/arc.d.ts +3 -3
- package/components/nested-donut/modules/arc.js.map +1 -1
- package/components/nested-donut/modules/label.d.ts +2 -2
- package/components/nested-donut/modules/label.js.map +1 -1
- package/components/nested-donut/style.js.map +1 -1
- package/components/sankey/config.d.ts +3 -48
- package/components/sankey/config.js +11 -58
- package/components/sankey/config.js.map +1 -1
- package/components/sankey/index.d.ts +4 -3
- package/components/sankey/index.js +3 -2
- package/components/sankey/index.js.map +1 -1
- package/components/sankey/modules/label.d.ts +7 -7
- package/components/sankey/modules/label.js.map +1 -1
- package/components/sankey/modules/link.d.ts +12 -2
- package/components/sankey/modules/link.js +4 -8
- package/components/sankey/modules/link.js.map +1 -1
- package/components/sankey/modules/node.d.ts +7 -7
- package/components/sankey/modules/node.js +1 -1
- package/components/sankey/modules/node.js.map +1 -1
- package/components/scatter/config.d.ts +5 -17
- package/components/scatter/config.js +3 -19
- package/components/scatter/config.js.map +1 -1
- package/components/scatter/index.d.ts +4 -3
- package/components/scatter/index.js +8 -8
- package/components/scatter/index.js.map +1 -1
- package/components/scatter/modules/point.d.ts +2 -2
- package/components/scatter/modules/point.js.map +1 -1
- package/components/scatter/modules/utils.d.ts +2 -2
- package/components/scatter/modules/utils.js.map +1 -1
- package/components/stacked-bar/config.d.ts +5 -13
- package/components/stacked-bar/config.js +3 -16
- package/components/stacked-bar/config.js.map +1 -1
- package/components/stacked-bar/index.d.ts +4 -3
- package/components/stacked-bar/index.js +4 -3
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/config.d.ts +5 -16
- package/components/timeline/config.js +3 -21
- package/components/timeline/config.js.map +1 -1
- package/components/timeline/index.d.ts +4 -3
- package/components/timeline/index.js +4 -3
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/config.d.ts +1 -15
- package/components/tooltip/config.js +12 -16
- package/components/tooltip/config.js.map +1 -1
- package/components/tooltip/index.d.ts +6 -4
- package/components/tooltip/index.js +15 -6
- package/components/tooltip/index.js.map +1 -1
- package/components/tooltip/style.d.ts +6 -0
- package/components/tooltip/style.js +13 -14
- package/components/tooltip/style.js.map +1 -1
- package/components/topojson-map/config.d.ts +4 -36
- package/components/topojson-map/config.js +3 -38
- package/components/topojson-map/config.js.map +1 -1
- package/components/topojson-map/index.d.ts +4 -3
- package/components/topojson-map/index.js +4 -5
- package/components/topojson-map/index.js.map +1 -1
- package/components/vis-controls/config.d.ts +1 -5
- package/components/vis-controls/config.js +6 -9
- package/components/vis-controls/config.js.map +1 -1
- package/components/vis-controls/index.d.ts +3 -2
- package/components/vis-controls/index.js +5 -2
- package/components/vis-controls/index.js.map +1 -1
- package/components/xy-labels/config.d.ts +4 -16
- package/components/xy-labels/config.js +3 -20
- package/components/xy-labels/config.js.map +1 -1
- package/components/xy-labels/index.d.ts +4 -3
- package/components/xy-labels/index.js +3 -2
- package/components/xy-labels/index.js.map +1 -1
- package/components/xy-labels/modules/label.d.ts +3 -3
- package/components/xy-labels/modules/label.js +1 -1
- package/components/xy-labels/modules/label.js.map +1 -1
- package/containers/single-container/config.d.ts +2 -4
- package/containers/single-container/config.js +3 -8
- package/containers/single-container/config.js.map +1 -1
- package/containers/single-container/index.d.ts +4 -3
- package/containers/single-container/index.js +2 -2
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/config.d.ts +2 -22
- package/containers/xy-container/config.js +3 -26
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.d.ts +5 -2
- package/containers/xy-container/index.js +9 -8
- package/containers/xy-container/index.js.map +1 -1
- package/core/component/config.d.ts +1 -6
- package/core/component/config.js +6 -12
- package/core/component/config.js.map +1 -1
- package/core/component/index.d.ts +7 -5
- package/core/component/index.js +14 -9
- package/core/component/index.js.map +1 -1
- package/core/container/config.d.ts +1 -21
- package/core/container/config.js +21 -25
- package/core/container/config.js.map +1 -1
- package/core/container/index.d.ts +5 -4
- package/core/container/index.js +4 -3
- package/core/container/index.js.map +1 -1
- package/core/xy-component/config.d.ts +2 -10
- package/core/xy-component/config.js +3 -16
- package/core/xy-component/config.js.map +1 -1
- package/core/xy-component/index.d.ts +5 -4
- package/core/xy-component/index.js +2 -0
- package/core/xy-component/index.js.map +1 -1
- package/data-models/map-graph.d.ts +1 -1
- package/data-models/map-graph.js +4 -7
- package/data-models/map-graph.js.map +1 -1
- package/package.json +3 -1
- package/styles/colors.d.ts +2 -2
- package/styles/index.d.ts +1 -1
- package/styles/patterns.js +2 -1
- package/styles/patterns.js.map +1 -1
- package/types/accessor.d.ts +5 -5
- package/types/component.js +2 -0
- package/types/component.js.map +1 -1
- package/utils/d3.d.ts +10 -1
- package/utils/d3.js.map +1 -1
- package/utils/data.d.ts +7 -7
- package/utils/data.js +2 -1
- package/utils/data.js.map +1 -1
- package/utils/text.js +2 -2
- package/utils/text.js.map +1 -1
- package/core/config/index.d.ts +0 -3
- package/core/config/index.js +0 -16
- package/core/config/index.js.map +0 -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 { 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;AA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A,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;;;;"}
|
|
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 LeafletMapExpandedCluster,\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: LeafletMapExpandedCluster<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 protected 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":";;;;;;;;;;;;;;;;;;AA0DM,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,GAAwB,IAAI,YAAY,EAAE,CAAA;QAY3C,IAAgB,CAAA,gBAAA,GAAqC,IAAI,CAAA;QACzD,IAAsB,CAAA,sBAAA,GAAG,KAAK,CAAA;QAC9B,IAAa,CAAA,aAAA,GAAG,KAAK,CAAA;QACrB,IAAc,CA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B;IAEM,OAAO,GAAA;;QACZ,0BAA0B,CAAC,MAAM,EAAE,CAAA;AACnC,QAAA,oBAAoB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA;AACtD,QAAA,oBAAoB,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAA;QACvD,MAAM,GAAG,GAAG,CAAA,EAAA,GAAA,IAAI,CAAC,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,OAAO,CAAA;AAC9B,QAAA,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;;AA7vBM,UAAS,CAAA,SAAA,GAAGE,KAAC,CAAA;AACb,UAAA,CAAA,YAAY,GAAGC,SAAW,CAAA;AA4CjC;AACO,UAAwB,CAAA,wBAAA,GAAG,GAAG;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { Selection } from 'd3-selection';
|
|
1
2
|
import type L from 'leaflet';
|
|
2
3
|
import { GenericDataRecord } from "../../../types/data";
|
|
4
|
+
import { LeafletMapExpandedCluster } from '../types';
|
|
3
5
|
import { LeafletMapConfigInterface } from '../config';
|
|
4
|
-
export declare function createBackgroundNode(selection:
|
|
5
|
-
export declare function updateBackgroundNode<
|
|
6
|
+
export declare function createBackgroundNode(selection: Selection<SVGGElement, unknown, SVGElement, undefined>): void;
|
|
7
|
+
export declare function updateBackgroundNode<D extends GenericDataRecord>(selection: Selection<SVGGElement, unknown, SVGElement, undefined>, expandedCluster: LeafletMapExpandedCluster<D>, config: LeafletMapConfigInterface<D>, leafletMap: L.Map, clusterBackgroundRadius: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clusterBackground.js","sources":["../../../../src/components/leaflet-map/modules/clusterBackground.ts"],"sourcesContent":["import type L from 'leaflet'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { cloneDeep } from 'utils/data'\nimport { getPointPos, getNodePathData } from './utils'\n\n// Local Types\nimport { LeafletMapPointShape } from '../types'\n\n// Config Interface\nimport { LeafletMapConfigInterface } from '../config'\n\nexport function createBackgroundNode (selection): void {\n selection.datum({ _zIndex: 1 })\n selection.append('path')\n}\n\nexport function updateBackgroundNode<
|
|
1
|
+
{"version":3,"file":"clusterBackground.js","sources":["../../../../src/components/leaflet-map/modules/clusterBackground.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport type L from 'leaflet'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { cloneDeep } from 'utils/data'\nimport { getPointPos, getNodePathData } from './utils'\n\n// Local Types\nimport { LeafletMapPointShape, LeafletMapExpandedCluster } from '../types'\n\n// Config Interface\nimport { LeafletMapConfigInterface } from '../config'\n\nexport function createBackgroundNode (selection: Selection<SVGGElement, unknown, SVGElement, undefined>): void {\n selection.datum({ _zIndex: 1 })\n selection.append('path')\n}\n\nexport function updateBackgroundNode<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, unknown, SVGElement, undefined>,\n expandedCluster: LeafletMapExpandedCluster<D>,\n config: LeafletMapConfigInterface<D>,\n leafletMap: L.Map,\n clusterBackgroundRadius: number\n): void {\n const { clusterBackground } = config\n if (expandedCluster && clusterBackground) {\n const node = cloneDeep(expandedCluster.cluster)\n const { x, y } = getPointPos(node, leafletMap)\n const path = getNodePathData({ x: 0, y: 0 }, clusterBackgroundRadius, LeafletMapPointShape.Circle)\n selection.select('path').attr('d', d => path)\n selection\n .classed('active', true)\n .attr('transform', `translate(${x},${y})`)\n } else {\n selection.classed('active', false)\n }\n}\n"],"names":[],"mappings":";;;;AAMA;AAUM,SAAU,oBAAoB,CAAE,SAAiE,EAAA;IACrG,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;AAC/B,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAC1B,CAAC;AAEK,SAAU,oBAAoB,CAClC,SAAiE,EACjE,eAA6C,EAC7C,MAAoC,EACpC,UAAiB,EACjB,uBAA+B,EAAA;AAE/B,IAAA,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAA;IACpC,IAAI,eAAe,IAAI,iBAAiB,EAAE;QACxC,MAAM,IAAI,GAAG,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;AAC/C,QAAA,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QAC9C,MAAM,IAAI,GAAG,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,uBAAuB,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAA;AAClG,QAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,CAAA;QAC7C,SAAS;AACN,aAAA,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;aACvB,IAAI,CAAC,WAAW,EAAE,CAAA,UAAA,EAAa,CAAC,CAAI,CAAA,EAAA,CAAC,CAAG,CAAA,CAAA,CAAC,CAAA;AAC7C,KAAA;AAAM,SAAA;AACL,QAAA,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AACnC,KAAA;AACH;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type L from 'leaflet';
|
|
2
2
|
import { Selection } from 'd3-selection';
|
|
3
|
-
import { Map } from 'maplibre-gl';
|
|
3
|
+
import type { Map } from 'maplibre-gl';
|
|
4
4
|
import { GenericDataRecord } from "../../../types/data";
|
|
5
|
-
import {
|
|
5
|
+
import { LeafletMapConfigInterface } 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:
|
|
9
|
-
export declare function setupMap<T extends GenericDataRecord>(mapContainer: HTMLElement, config:
|
|
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<{
|
|
10
10
|
leaflet: L.Map;
|
|
11
11
|
layer: L.Layer;
|
|
12
12
|
svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
2
|
import { select } from 'd3-selection';
|
|
3
3
|
import { feature } from 'topojson-client';
|
|
4
|
-
import {
|
|
4
|
+
import { mapboxglWheelEventThrottled, constraintMapView } from '../renderer/mapboxgl-utils.js';
|
|
5
5
|
import { mapboxglCanvas, onFeatureHover } from '../style.js';
|
|
6
6
|
import { LeafletMapRenderer } from '../types.js';
|
|
7
7
|
|
|
@@ -109,6 +109,10 @@ function setupMap(mapContainer, config) {
|
|
|
109
109
|
const { getMaplibreGLLayer } = yield import('../renderer/mapboxgl-layer.js');
|
|
110
110
|
layer = getMaplibreGLLayer(config, L, maplibre.default);
|
|
111
111
|
maplibreMap = (_b = (_a = layer).getMaplibreMap) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
112
|
+
select(mapContainer).on('wheel', (event) => {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
mapboxglWheelEventThrottled(leafletMap, layer, event);
|
|
115
|
+
});
|
|
112
116
|
break;
|
|
113
117
|
case LeafletMapRenderer.Raster:
|
|
114
118
|
layer = L.tileLayer(style);
|
|
@@ -116,12 +120,8 @@ function setupMap(mapContainer, config) {
|
|
|
116
120
|
}
|
|
117
121
|
layer.addTo(leafletMap);
|
|
118
122
|
// leaflet-mapbox-gl has a layer positioning issue on far zoom levels which leads to having wrong
|
|
119
|
-
// map points projection. We
|
|
123
|
+
// map points projection. We constrain the view to prevent that.
|
|
120
124
|
constraintMapView(leafletMap);
|
|
121
|
-
select(mapContainer).on('wheel', (event) => {
|
|
122
|
-
event.preventDefault();
|
|
123
|
-
mapboxglWheelEventThrottled(leafletMap, layer, event);
|
|
124
|
-
});
|
|
125
125
|
if (maplibreMap && (topoJSONLayer === null || topoJSONLayer === void 0 ? void 0 : topoJSONLayer.sources)) {
|
|
126
126
|
const canvas = maplibreMap.getCanvas();
|
|
127
127
|
const canvasSelection = select(canvas).classed(mapboxglCanvas, true);
|
|
@@ -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 { 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,CAA+B,WAAgB,EAAE,MAA2B,EAAA;;AACxG,IAAA,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAA;IAEhC,IAAI,aAAa,CAAC,OAAO,EAAE;AACzB,QAAA,MAAM,aAAa,GAAG,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,aAAa,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,MAAG,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,aAAa,CAAC,WAAW,CAAC,CAAA;AACjF,QAAA,IAAI,aAAa,EAAE;YACjB,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CA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A,MAAM,QAAQ,GAAG,WAAW,CAAC,qBAAqB,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;gBACxF,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AACpC,gBAAA,eAAe,CAAC,OAAO,CAACC,cAAgB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjE,aAAC,CAAC,CAAA;AAEF,YAAA,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAK;AAC1B,gBAAA,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AACrC,aAAC,CAAC,CAAA;AACH,SAAA;AAED,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC1E,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEvC,OAAO;AACL,YAAA,OAAO,EAAE,UAAU;YACnB,KAAK;YACL,UAAU;YACV,QAAQ;SACT,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 type { 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 | (L.Layer & { getMaplibreMap(): Map })\n let maplibreMap: Map = 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\n select(mapContainer).on('wheel', (event: WheelEvent) => {\n event.preventDefault()\n mapboxglWheelEventThrottled(leafletMap, layer as (L.Layer & { getMaplibreMap(): Map }), event)\n })\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 constrain the view to prevent that.\n constraintMapView(leafletMap)\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,CAA+B,WAAgB,EAAE,MAAoC,EAAA;;AACjH,IAAA,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAA;IAEhC,IAAI,aAAa,CAAC,OAAO,EAAE;AACzB,QAAA,MAAM,aAAa,GAAG,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,aAAa,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,MAAG,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,aAAa,CAAC,WAAW,CAAC,CAAA;AACjF,QAA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AAS,CAAC,CAAA;AAC7C,gBAAA,IAAI,CAAC,KAAK;oBAAE,OAAM;AAElB,gBAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,qBAAqB,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;gBACxF,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AACpC,gBAAA,eAAe,CAAC,OAAO,CAACC,cAAgB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjE,aAAC,CAAC,CAAA;AAEF,YAAA,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAK;AAC1B,gBAAA,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AACrC,aAAC,CAAC,CAAA;AACH,SAAA;AAED,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC1E,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEvC,OAAO;AACL,YAAA,OAAO,EAAE,UAAU;YACnB,KAAK;YACL,UAAU;YACV,QAAQ;SACT,CAAA;;AACF;;;;"}
|
|
@@ -5,5 +5,8 @@ import { LeafletMapPoint } from '../types';
|
|
|
5
5
|
import { LeafletMapConfigInterface } from '../config';
|
|
6
6
|
export declare function createNodes<D extends GenericDataRecord>(selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>): void;
|
|
7
7
|
export declare function updateNodes<D extends GenericDataRecord>(selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>, config: LeafletMapConfigInterface<D>, leafletMap: L.Map, mapMoveZoomUpdateOnly: boolean): void;
|
|
8
|
+
export interface LabelSVGGElement extends SVGGElement {
|
|
9
|
+
labelVisible?: boolean;
|
|
10
|
+
}
|
|
8
11
|
export declare function collideLabels<D extends GenericDataRecord>(selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>, leafletMap: L.Map): void;
|
|
9
12
|
export declare function removeNodes<D extends GenericDataRecord>(selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>): void;
|
|
@@ -101,11 +101,10 @@ function updateNodes(selection, config, leafletMap, mapMoveZoomUpdateOnly) {
|
|
|
101
101
|
}
|
|
102
102
|
function collideLabels(selection, leafletMap) {
|
|
103
103
|
selection.each((datum1, i, elements) => {
|
|
104
|
-
const
|
|
105
|
-
const group1 = select(
|
|
104
|
+
const group1LabelElement = elements[i];
|
|
105
|
+
const group1 = select(group1LabelElement);
|
|
106
106
|
const label1 = group1.select(`.${bottomLabel}`);
|
|
107
|
-
|
|
108
|
-
group1HTMLNode['labelVisible'] = true;
|
|
107
|
+
group1LabelElement.labelVisible = true;
|
|
109
108
|
// Calculate bounding rect of point's bottom label
|
|
110
109
|
const bottomLabelFontSizePx = getCSSVariableValueInPixels(cssvar(variables.mapPointBottomLabelFontSize), selection.node());
|
|
111
110
|
const p1Pos = getPointPos(datum1, leafletMap);
|
|
@@ -119,8 +118,8 @@ function collideLabels(selection, leafletMap) {
|
|
|
119
118
|
for (let j = 0; j < elements.length; j += 1) {
|
|
120
119
|
if (i === j)
|
|
121
120
|
continue;
|
|
122
|
-
const
|
|
123
|
-
const group2 = select(
|
|
121
|
+
const group2LabelElement = elements[j];
|
|
122
|
+
const group2 = select(group2LabelElement);
|
|
124
123
|
const label2 = group2.select(`.${bottomLabel}`);
|
|
125
124
|
const datum2 = group2.datum();
|
|
126
125
|
// Calculate bounding rect of the second point's circle
|
|
@@ -133,8 +132,7 @@ function collideLabels(selection, leafletMap) {
|
|
|
133
132
|
};
|
|
134
133
|
let intersect = rectIntersect(label1BoundingRect, point2BoundingRect);
|
|
135
134
|
// If there's not intersection, check a collision with the second point's label
|
|
136
|
-
|
|
137
|
-
const label2Visible = group2HTMLNode['labelVisible'];
|
|
135
|
+
const label2Visible = group2LabelElement.labelVisible;
|
|
138
136
|
if (!intersect && label2Visible) {
|
|
139
137
|
const label2Size = estimateTextSize(label2, bottomLabelFontSizePx, 0.32, true, 0.6);
|
|
140
138
|
intersect = rectIntersect(label1BoundingRect, {
|
|
@@ -145,13 +143,11 @@ function collideLabels(selection, leafletMap) {
|
|
|
145
143
|
});
|
|
146
144
|
}
|
|
147
145
|
if (intersect) {
|
|
148
|
-
|
|
149
|
-
group1HTMLNode['labelVisible'] = false;
|
|
146
|
+
group1LabelElement.labelVisible = false;
|
|
150
147
|
break;
|
|
151
148
|
}
|
|
152
149
|
}
|
|
153
|
-
|
|
154
|
-
smartTransition(label1, 0).attr('opacity', group1HTMLNode['labelVisible'] ? 1 : 0);
|
|
150
|
+
smartTransition(label1, 0).attr('opacity', group1LabelElement.labelVisible ? 1 : 0);
|
|
155
151
|
});
|
|
156
152
|
}
|
|
157
153
|
function removeNodes(selection) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sources":["../../../../src/components/leaflet-map/modules/node.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { color } from 'd3-color'\nimport type L from 'leaflet'\n\n// Types\nimport { Rect } from 'types/misc'\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\nimport { estimateTextSize, trimStringMiddle } from 'utils/text'\nimport { clamp, getString } from 'utils/data'\nimport { getCSSVariableValueInPixels, rectIntersect } from 'utils/misc'\nimport { hexToBrightness } from 'utils/color'\nimport { cssvar } from 'utils/style'\nimport { getPointPos } from './utils'\n\n\n// Local Types\nimport { LeafletMapPointDatum, LeafletMapClusterDatum, LeafletMapPoint, LeafletMapPointShape } from '../types'\n\n// Modules\nimport { updateDonut } from './donut'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\nimport * as s from '../style'\n\nconst BOTTOM_LABEL_TOP_MARGIN = 10\n\nexport function createNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>\n): void {\n selection.append('path')\n .attr('class', s.pointPath)\n .attr('id', d => `point-${d.id}`)\n .style('opacity', 0)\n\n selection.append('g')\n .attr('class', s.donutCluster)\n\n selection.append('text')\n .attr('class', s.innerLabel)\n .classed(s.innerLabelCluster, d => (d.properties as LeafletMapClusterDatum<D>).cluster)\n .attr('id', d => `label-${d.id}`)\n .attr('dy', '0.32em')\n\n selection.append('text')\n .attr('class', s.bottomLabel)\n .attr('dy', '0.32em')\n .attr('opacity', 1)\n}\n\nexport function updateNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>,\n config: LeafletMapConfigInterface<D>,\n leafletMap: L.Map,\n mapMoveZoomUpdateOnly: boolean\n): void {\n selection.each((d, i, elements) => {\n const group = select(elements[i])\n const node: Selection<SVGPathElement, any, SVGGElement, any> = group.select(`.${s.pointPath}`)\n const innerLabel: Selection<SVGTextElement, any, SVGElement, any> = group.select(`.${s.innerLabel}`)\n const bottomLabel: Selection<SVGTextElement, any, SVGElement, any> = group.select(`.${s.bottomLabel}`)\n\n const { x, y } = getPointPos(d, leafletMap)\n const donutData = d.donutData\n const isCluster = (d.properties as LeafletMapClusterDatum<D>).cluster\n const fromExpandedCluster = !!(d.properties as LeafletMapPointDatum<D>).expandedClusterPoint\n\n const innerLabelText = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterLabel)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointLabel)\n ) ?? ''\n const innerLabelColor = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterLabelColor)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointLabelColor)\n ) ?? null\n const bottomLabelText = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterBottomLabel)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointBottomLabel)\n ) ?? ''\n const pointCursor = getString(d.properties as LeafletMapPointDatum<D>, config.pointCursor)\n const pointShape = getString(d.properties as LeafletMapPointDatum<D>, config.pointShape)\n const isRing = pointShape === LeafletMapPointShape.Ring\n const isCircular = (pointShape === LeafletMapPointShape.Circle) || isRing || isCluster || !pointShape\n\n // To get updated on every render call\n const ringWidth = (isCluster && config.clusterRingWidth) || (isRing && config.pointRingWidth) || 0\n group.attr('transform', `translate(${x},${y})`)\n group.select<SVGGElement>(`.${s.donutCluster}`)\n .call(updateDonut, donutData, isCircular ? d.radius : 0, ringWidth)\n\n node.attr('d', d.path)\n node.style('cursor', isCluster ? 'pointer' : pointCursor)\n bottomLabel.attr('transform', `translate(0,${d.radius + BOTTOM_LABEL_TOP_MARGIN})`)\n innerLabel.attr('font-size', () => {\n const fontSize = d.radius / Math.pow(innerLabelText.length, 0.4)\n return clamp(fontSize, fontSize, 16)\n })\n\n if (mapMoveZoomUpdateOnly) return\n\n // Updates required only when data changes\n node\n .classed(s.pointPathCluster, isCluster)\n .classed(s.pointPathRing, isRing)\n .style('fill', d.color)\n .style('stroke', d.color) // being used for hover\n .style('stroke-width', ringWidth)\n .style('opacity', 1)\n\n innerLabel\n .text(innerLabelText || null)\n .attr('visibility', innerLabelText ? null : 'hidden')\n .style('fill', () => {\n if (innerLabelColor) return innerLabelColor\n\n // Determine the label color based on the point brightness\n const c = getComputedStyle(node.node()).fill\n const hex = color(c)?.hex()\n if (!hex) return null\n\n const brightness = hexToBrightness(hex)\n return brightness > 0.5\n ? (isCluster ? cssvar(s.variables.mapClusterInnerLabelTextColorDark) : cssvar(s.variables.mapPointInnerLabelTextColorDark))\n : (isCluster ? cssvar(s.variables.mapClusterInnerLabelTextColorLight) : cssvar(s.variables.mapPointInnerLabelTextColorLight))\n })\n\n const bottomLabelTextTrimmed = trimStringMiddle(bottomLabelText, 15)\n bottomLabel\n .text(bottomLabelTextTrimmed)\n .attr('font-size', getCSSVariableValueInPixels(cssvar(s.variables.mapPointBottomLabelFontSize), selection.node()))\n .attr('visibility', fromExpandedCluster ? 'hidden' : null)\n })\n}\n\nexport function collideLabels<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>,\n leafletMap: L.Map\n): void {\n selection.each((datum1: LeafletMapPoint<D>, i, elements) => {\n const group1HTMLNode = elements[i]\n const group1 = select(group1HTMLNode)\n const label1: Selection<SVGTextElement, any, SVGElement, any> = group1.select(`.${s.bottomLabel}`)\n // eslint-disable-next-line dot-notation\n group1HTMLNode['labelVisible'] = true\n\n // Calculate bounding rect of point's bottom label\n const bottomLabelFontSizePx = getCSSVariableValueInPixels(cssvar(s.variables.mapPointBottomLabelFontSize), selection.node())\n const p1Pos = getPointPos(datum1, leafletMap)\n const label1Size = estimateTextSize(label1, bottomLabelFontSizePx, 0.32, true, 0.6)\n const label1BoundingRect: Rect = {\n x: p1Pos.x - label1Size.width / 2,\n y: p1Pos.y - label1Size.height / 2 + datum1.radius + BOTTOM_LABEL_TOP_MARGIN,\n width: label1Size.width,\n height: label1Size.height,\n }\n\n for (let j = 0; j < elements.length; j += 1) {\n if (i === j) continue\n const group2HTMLNode = elements[j]\n const group2 = select(group2HTMLNode)\n const label2: Selection<SVGTextElement, any, SVGElement, any> = group2.select(`.${s.bottomLabel}`)\n const datum2 = group2.datum() as LeafletMapPoint<D>\n\n // Calculate bounding rect of the second point's circle\n const p2Pos = getPointPos(datum2, leafletMap)\n const point2BoundingRect = {\n x: p2Pos.x - datum2.radius,\n y: p2Pos.y - datum2.radius,\n width: 2 * datum2.radius,\n height: 2 * datum2.radius,\n }\n\n let intersect = rectIntersect(label1BoundingRect, point2BoundingRect)\n\n // If there's not intersection, check a collision with the second point's label\n // eslint-disable-next-line dot-notation\n const label2Visible = group2HTMLNode['labelVisible']\n if (!intersect && label2Visible) {\n const label2Size = estimateTextSize(label2, bottomLabelFontSizePx, 0.32, true, 0.6)\n intersect = rectIntersect(label1BoundingRect, {\n x: p2Pos.x - label2Size.width / 2,\n y: p2Pos.y + datum2.radius + BOTTOM_LABEL_TOP_MARGIN - label2Size.height / 2,\n width: label2Size.width,\n height: label2Size.height,\n })\n }\n\n if (intersect) {\n // eslint-disable-next-line dot-notation\n group1HTMLNode['labelVisible'] = false\n break\n }\n }\n\n // eslint-disable-next-line dot-notation\n smartTransition(label1, 0).attr('opacity', group1HTMLNode['labelVisible'] ? 1 : 0)\n })\n}\n\nexport function removeNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>\n): void {\n selection.remove()\n}\n"],"names":["s.pointPath","s.donutCluster","s.innerLabel","s.innerLabelCluster","s.bottomLabel","innerLabel","bottomLabel","s.pointPathCluster","s.pointPathRing","s.variables"],"mappings":";;;;;;;;;;;;;AA6BA,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAE5B,SAAU,WAAW,CACzB,SAA2E,EAAA;AAE3E,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEA,SAAW,CAAC;AAC1B,SAAA,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAA,MAAA,EAAS,CAAC,CAAC,EAAE,CAAA,CAAE,CAAC;AAChC,SAAA,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AAEtB,IAAA,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC;AAClB,SAAA,IAAI,CAAC,OAAO,EAAEC,YAAc,CAAC,CAAA;AAEhC,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEC,UAAY,CAAC;AAC3B,SAAA,OAAO,CAACC,iBAAmB,EAAE,CAAC,IAAK,CAAC,CAAC,UAAwC,CAAC,OAAO,CAAC;AACtF,SAAA,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAA,MAAA,EAAS,CAAC,CAAC,EAAE,CAAA,CAAE,CAAC;AAChC,SAAA,IAAI,CAAC,IAAI,EAAE,Q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,aAAA;AAED,YAAA,IAAI,SAAS,EAAE;;AAEb,gBAAA,cAAc,CAAC,cAAc,CAAC,GAAG,KAAK,CAAA;gBACtC,MAAK;AACN,aAAA;AACF,SAAA;;QAGD,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AACpF,KAAC,CAAC,CAAA;AACJ,CAAC;AAEK,SAAU,WAAW,CACzB,SAA2E,EAAA;IAE3E,SAAS,CAAC,MAAM,EAAE,CAAA;AACpB;;;;"}
|
|
1
|
+
{"version":3,"file":"node.js","sources":["../../../../src/components/leaflet-map/modules/node.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { color } from 'd3-color'\nimport type L from 'leaflet'\n\n// Types\nimport { Rect } from 'types/misc'\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { smartTransition } from 'utils/d3'\nimport { estimateTextSize, trimStringMiddle } from 'utils/text'\nimport { clamp, getString } from 'utils/data'\nimport { getCSSVariableValueInPixels, rectIntersect } from 'utils/misc'\nimport { hexToBrightness } from 'utils/color'\nimport { cssvar } from 'utils/style'\nimport { getPointPos } from './utils'\n\n\n// Local Types\nimport { LeafletMapPointDatum, LeafletMapClusterDatum, LeafletMapPoint, LeafletMapPointShape } from '../types'\n\n// Modules\nimport { updateDonut } from './donut'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\nimport * as s from '../style'\n\nconst BOTTOM_LABEL_TOP_MARGIN = 10\n\nexport function createNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>\n): void {\n selection.append('path')\n .attr('class', s.pointPath)\n .attr('id', d => `point-${d.id}`)\n .style('opacity', 0)\n\n selection.append('g')\n .attr('class', s.donutCluster)\n\n selection.append('text')\n .attr('class', s.innerLabel)\n .classed(s.innerLabelCluster, d => (d.properties as LeafletMapClusterDatum<D>).cluster)\n .attr('id', d => `label-${d.id}`)\n .attr('dy', '0.32em')\n\n selection.append('text')\n .attr('class', s.bottomLabel)\n .attr('dy', '0.32em')\n .attr('opacity', 1)\n}\n\nexport function updateNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>,\n config: LeafletMapConfigInterface<D>,\n leafletMap: L.Map,\n mapMoveZoomUpdateOnly: boolean\n): void {\n selection.each((d, i, elements) => {\n const group = select(elements[i])\n const node: Selection<SVGPathElement, any, SVGGElement, any> = group.select(`.${s.pointPath}`)\n const innerLabel: Selection<SVGTextElement, any, SVGElement, any> = group.select(`.${s.innerLabel}`)\n const bottomLabel: Selection<SVGTextElement, any, SVGElement, any> = group.select(`.${s.bottomLabel}`)\n\n const { x, y } = getPointPos(d, leafletMap)\n const donutData = d.donutData\n const isCluster = (d.properties as LeafletMapClusterDatum<D>).cluster\n const fromExpandedCluster = !!(d.properties as LeafletMapPointDatum<D>).expandedClusterPoint\n\n const innerLabelText = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterLabel)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointLabel)\n ) ?? ''\n const innerLabelColor = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterLabelColor)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointLabelColor)\n ) ?? null\n const bottomLabelText = (isCluster\n ? getString(d.properties as LeafletMapClusterDatum<D>, config.clusterBottomLabel)\n : getString(d.properties as LeafletMapPointDatum<D>, config.pointBottomLabel)\n ) ?? ''\n const pointCursor = getString(d.properties as LeafletMapPointDatum<D>, config.pointCursor)\n const pointShape = getString(d.properties as LeafletMapPointDatum<D>, config.pointShape)\n const isRing = pointShape === LeafletMapPointShape.Ring\n const isCircular = (pointShape === LeafletMapPointShape.Circle) || isRing || isCluster || !pointShape\n\n // To get updated on every render call\n const ringWidth = (isCluster && config.clusterRingWidth) || (isRing && config.pointRingWidth) || 0\n group.attr('transform', `translate(${x},${y})`)\n group.select<SVGGElement>(`.${s.donutCluster}`)\n .call(updateDonut, donutData, isCircular ? d.radius : 0, ringWidth)\n\n node.attr('d', d.path)\n node.style('cursor', isCluster ? 'pointer' : pointCursor)\n bottomLabel.attr('transform', `translate(0,${d.radius + BOTTOM_LABEL_TOP_MARGIN})`)\n innerLabel.attr('font-size', () => {\n const fontSize = d.radius / Math.pow(innerLabelText.length, 0.4)\n return clamp(fontSize, fontSize, 16)\n })\n\n if (mapMoveZoomUpdateOnly) return\n\n // Updates required only when data changes\n node\n .classed(s.pointPathCluster, isCluster)\n .classed(s.pointPathRing, isRing)\n .style('fill', d.color)\n .style('stroke', d.color) // being used for hover\n .style('stroke-width', ringWidth)\n .style('opacity', 1)\n\n innerLabel\n .text(innerLabelText || null)\n .attr('visibility', innerLabelText ? null : 'hidden')\n .style('fill', () => {\n if (innerLabelColor) return innerLabelColor\n\n // Determine the label color based on the point brightness\n const c = getComputedStyle(node.node()).fill\n const hex = color(c)?.hex()\n if (!hex) return null\n\n const brightness = hexToBrightness(hex)\n return brightness > 0.5\n ? (isCluster ? cssvar(s.variables.mapClusterInnerLabelTextColorDark) : cssvar(s.variables.mapPointInnerLabelTextColorDark))\n : (isCluster ? cssvar(s.variables.mapClusterInnerLabelTextColorLight) : cssvar(s.variables.mapPointInnerLabelTextColorLight))\n })\n\n const bottomLabelTextTrimmed = trimStringMiddle(bottomLabelText, 15)\n bottomLabel\n .text(bottomLabelTextTrimmed)\n .attr('font-size', getCSSVariableValueInPixels(cssvar(s.variables.mapPointBottomLabelFontSize), selection.node()))\n .attr('visibility', fromExpandedCluster ? 'hidden' : null)\n })\n}\n\nexport interface LabelSVGGElement extends SVGGElement {\n labelVisible?: boolean;\n}\n\nexport function collideLabels<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>,\n leafletMap: L.Map\n): void {\n selection.each((datum1: LeafletMapPoint<D>, i, elements: ArrayLike<LabelSVGGElement>) => {\n const group1LabelElement = elements[i]\n const group1 = select(group1LabelElement)\n const label1: Selection<SVGTextElement, any, SVGElement, any> = group1.select(`.${s.bottomLabel}`)\n group1LabelElement.labelVisible = true\n\n // Calculate bounding rect of point's bottom label\n const bottomLabelFontSizePx = getCSSVariableValueInPixels(cssvar(s.variables.mapPointBottomLabelFontSize), selection.node())\n const p1Pos = getPointPos(datum1, leafletMap)\n const label1Size = estimateTextSize(label1, bottomLabelFontSizePx, 0.32, true, 0.6)\n const label1BoundingRect: Rect = {\n x: p1Pos.x - label1Size.width / 2,\n y: p1Pos.y - label1Size.height / 2 + datum1.radius + BOTTOM_LABEL_TOP_MARGIN,\n width: label1Size.width,\n height: label1Size.height,\n }\n\n for (let j = 0; j < elements.length; j += 1) {\n if (i === j) continue\n const group2LabelElement = elements[j]\n const group2 = select(group2LabelElement)\n const label2: Selection<SVGTextElement, any, SVGElement, any> = group2.select(`.${s.bottomLabel}`)\n const datum2 = group2.datum() as LeafletMapPoint<D>\n\n // Calculate bounding rect of the second point's circle\n const p2Pos = getPointPos(datum2, leafletMap)\n const point2BoundingRect = {\n x: p2Pos.x - datum2.radius,\n y: p2Pos.y - datum2.radius,\n width: 2 * datum2.radius,\n height: 2 * datum2.radius,\n }\n\n let intersect = rectIntersect(label1BoundingRect, point2BoundingRect)\n\n // If there's not intersection, check a collision with the second point's label\n const label2Visible = group2LabelElement.labelVisible\n if (!intersect && label2Visible) {\n const label2Size = estimateTextSize(label2, bottomLabelFontSizePx, 0.32, true, 0.6)\n intersect = rectIntersect(label1BoundingRect, {\n x: p2Pos.x - label2Size.width / 2,\n y: p2Pos.y + datum2.radius + BOTTOM_LABEL_TOP_MARGIN - label2Size.height / 2,\n width: label2Size.width,\n height: label2Size.height,\n })\n }\n\n if (intersect) {\n group1LabelElement.labelVisible = false\n break\n }\n }\n\n smartTransition(label1, 0).attr('opacity', group1LabelElement.labelVisible ? 1 : 0)\n })\n}\n\nexport function removeNodes<D extends GenericDataRecord> (\n selection: Selection<SVGGElement, LeafletMapPoint<D>, SVGGElement, unknown>\n): void {\n selection.remove()\n}\n"],"names":["s.pointPath","s.donutCluster","s.innerLabel","s.innerLabelCluster","s.bottomLabel","innerLabel","bottomLabel","s.pointPathCluster","s.pointPathRing","s.variables"],"mappings":";;;;;;;;;;;;;AA6BA,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAE5B,SAAU,WAAW,CACzB,SAA2E,EAAA;AAE3E,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEA,SAAW,CAAC;AAC1B,SAAA,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAA,MAAA,EAAS,CAAC,CAAC,EAAE,CAAA,CAAE,CAAC;AAChC,SAAA,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AAEtB,IAAA,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC;AAClB,SAAA,IAAI,CAAC,OAAO,EAAEC,YAAc,CAAC,CAAA;AAEhC,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEC,UAAY,CAAC;AAC3B,SAAA,OAAO,CAACC,iBAAmB,EAAE,CAAC,IAAK,CAAC,CAAC,UAAwC,CAAC,OAAO,CAAC;AACtF,SAAA,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAA,MAAA,EAAS,CAAC,CAAC,EAAE,CAAA,CAAE,CAAC;AAChC,SAAA,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAEvB,IAAA,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB,SAAA,IAAI,CAAC,OAAO,EAAEC,WAAa,CAAC;AAC5B,SAAA,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACpB,SAAA,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AACvB,CAAC;AAEK,SAAU,WAAW,CACzB,SAA2E,EAC3E,MAA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