@unovis/ts 1.3.0-beta.0 → 1.3.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/area/config.d.ts +10 -6
- package/components/area/config.js +12 -3
- package/components/area/config.js.map +1 -1
- package/components/area/index.d.ts +6 -5
- package/components/area/index.js +9 -10
- package/components/area/index.js.map +1 -1
- package/components/axis/config.d.ts +27 -3
- package/components/axis/config.js +30 -3
- package/components/axis/config.js.map +1 -1
- package/components/axis/index.d.ts +3 -4
- package/components/axis/index.js +4 -7
- package/components/axis/index.js.map +1 -1
- package/components/brush/config.d.ts +12 -2
- package/components/brush/config.js +20 -11
- package/components/brush/config.js.map +1 -1
- package/components/brush/index.d.ts +3 -4
- package/components/brush/index.js +3 -4
- package/components/brush/index.js.map +1 -1
- package/components/bullet-legend/config.d.ts +10 -1
- package/components/bullet-legend/config.js +14 -11
- package/components/bullet-legend/config.js.map +1 -1
- package/components/bullet-legend/index.d.ts +3 -4
- package/components/bullet-legend/index.js +2 -5
- package/components/bullet-legend/index.js.map +1 -1
- package/components/bullet-legend/modules/shape.js +7 -6
- package/components/bullet-legend/modules/shape.js.map +1 -1
- package/components/bullet-legend/style.js +4 -0
- package/components/bullet-legend/style.js.map +1 -1
- package/components/chord-diagram/config.d.ts +23 -7
- package/components/chord-diagram/config.js +22 -3
- package/components/chord-diagram/config.js.map +1 -1
- package/components/chord-diagram/index.d.ts +3 -4
- package/components/chord-diagram/index.js +6 -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 +2 -3
- package/components/chord-diagram/types.js.map +1 -1
- package/components/crosshair/config.d.ts +22 -7
- package/components/crosshair/config.js +16 -3
- package/components/crosshair/config.js.map +1 -1
- package/components/crosshair/index.d.ts +3 -4
- package/components/crosshair/index.js +3 -4
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/config.d.ts +19 -2
- package/components/donut/config.js +24 -5
- package/components/donut/config.js.map +1 -1
- package/components/donut/index.d.ts +3 -4
- package/components/donut/index.js +4 -5
- 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 +11 -1
- package/components/flow-legend/config.js +16 -11
- package/components/flow-legend/config.js.map +1 -1
- package/components/flow-legend/index.d.ts +3 -4
- package/components/flow-legend/index.js +2 -5
- package/components/flow-legend/index.js.map +1 -1
- package/components/free-brush/config.d.ts +12 -2
- package/components/free-brush/config.js +20 -11
- package/components/free-brush/config.js.map +1 -1
- package/components/free-brush/index.d.ts +3 -4
- package/components/free-brush/index.js +5 -6
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/config.d.ts +75 -3
- package/components/graph/config.js +78 -12
- package/components/graph/config.js.map +1 -1
- package/components/graph/index.d.ts +7 -8
- package/components/graph/index.js +4 -5
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/layout.d.ts +7 -7
- 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/index.d.ts +6 -6
- package/components/graph/modules/node/index.js +2 -2
- 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/grouped-bar/config.d.ts +13 -5
- package/components/grouped-bar/config.js +16 -5
- package/components/grouped-bar/config.js.map +1 -1
- package/components/grouped-bar/index.d.ts +3 -4
- package/components/grouped-bar/index.js +3 -4
- package/components/grouped-bar/index.js.map +1 -1
- package/components/leaflet-flow-map/config.d.ts +16 -2
- package/components/leaflet-flow-map/config.js +21 -3
- package/components/leaflet-flow-map/config.js.map +1 -1
- package/components/leaflet-flow-map/index.d.ts +3 -4
- package/components/leaflet-flow-map/index.js +2 -3
- package/components/leaflet-flow-map/index.js.map +1 -1
- package/components/leaflet-map/config.d.ts +59 -4
- package/components/leaflet-map/config.js +67 -23
- package/components/leaflet-map/config.js.map +1 -1
- package/components/leaflet-map/index.d.ts +3 -4
- package/components/leaflet-map/index.js +3 -4
- package/components/leaflet-map/index.js.map +1 -1
- package/components/leaflet-map/modules/map.d.ts +3 -3
- package/components/leaflet-map/modules/map.js.map +1 -1
- package/components/leaflet-map/modules/utils.d.ts +4 -4
- package/components/leaflet-map/modules/utils.js +2 -6
- 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/line/config.d.ts +11 -6
- package/components/line/config.js +13 -3
- package/components/line/config.js.map +1 -1
- package/components/line/index.d.ts +3 -4
- package/components/line/index.js +4 -5
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/config.d.ts +21 -2
- package/components/nested-donut/config.js +24 -3
- package/components/nested-donut/config.js.map +1 -1
- package/components/nested-donut/index.d.ts +3 -4
- package/components/nested-donut/index.js +3 -4
- 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/sankey/config.d.ts +47 -2
- package/components/sankey/config.js +57 -10
- package/components/sankey/config.js.map +1 -1
- package/components/sankey/index.d.ts +3 -4
- package/components/sankey/index.js +2 -3
- 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 +2 -2
- 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 +16 -4
- package/components/scatter/config.js +19 -5
- package/components/scatter/config.js.map +1 -1
- package/components/scatter/index.d.ts +3 -4
- package/components/scatter/index.js +5 -5
- 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 +13 -5
- package/components/stacked-bar/config.js +16 -5
- package/components/stacked-bar/config.js.map +1 -1
- package/components/stacked-bar/index.d.ts +3 -4
- package/components/stacked-bar/index.js +3 -4
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/config.d.ts +16 -5
- package/components/timeline/config.js +21 -9
- package/components/timeline/config.js.map +1 -1
- package/components/timeline/index.d.ts +3 -4
- package/components/timeline/index.js +3 -4
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/config.d.ts +15 -1
- package/components/tooltip/config.js +16 -12
- package/components/tooltip/config.js.map +1 -1
- package/components/tooltip/index.d.ts +3 -4
- package/components/tooltip/index.js +3 -5
- package/components/tooltip/index.js.map +1 -1
- package/components/topojson-map/config.d.ts +36 -4
- package/components/topojson-map/config.js +38 -3
- package/components/topojson-map/config.js.map +1 -1
- package/components/topojson-map/index.d.ts +3 -4
- package/components/topojson-map/index.js +4 -4
- package/components/topojson-map/index.js.map +1 -1
- package/components/vis-controls/config.d.ts +5 -1
- package/components/vis-controls/config.js +9 -6
- package/components/vis-controls/config.js.map +1 -1
- package/components/vis-controls/index.d.ts +2 -3
- package/components/vis-controls/index.js +2 -5
- package/components/vis-controls/index.js.map +1 -1
- package/components/xy-labels/config.d.ts +16 -4
- package/components/xy-labels/config.js +20 -5
- package/components/xy-labels/config.js.map +1 -1
- package/components/xy-labels/index.d.ts +3 -4
- package/components/xy-labels/index.js +2 -3
- 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 +4 -2
- package/containers/single-container/config.js +8 -3
- package/containers/single-container/config.js.map +1 -1
- package/containers/single-container/index.d.ts +3 -4
- package/containers/single-container/index.js +4 -2
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/config.d.ts +23 -3
- package/containers/xy-container/config.js +26 -3
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.d.ts +2 -4
- package/containers/xy-container/index.js +5 -5
- package/containers/xy-container/index.js.map +1 -1
- package/core/component/config.d.ts +6 -1
- package/core/component/config.js +12 -6
- package/core/component/config.js.map +1 -1
- package/core/component/index.d.ts +5 -7
- package/core/component/index.js +7 -8
- package/core/component/index.js.map +1 -1
- package/core/config/index.d.ts +3 -0
- package/core/config/index.js +16 -0
- package/core/config/index.js.map +1 -0
- package/core/container/config.d.ts +21 -1
- package/core/container/config.js +25 -21
- package/core/container/config.js.map +1 -1
- package/core/container/index.d.ts +5 -5
- package/core/container/index.js +4 -4
- package/core/container/index.js.map +1 -1
- package/core/xy-component/config.d.ts +10 -2
- package/core/xy-component/config.js +16 -7
- package/core/xy-component/config.js.map +1 -1
- package/core/xy-component/index.d.ts +4 -5
- package/core/xy-component/index.js +0 -2
- package/core/xy-component/index.js.map +1 -1
- package/data-models/map-graph.d.ts +1 -1
- package/data-models/map-graph.js +1 -1
- package/data-models/map-graph.js.map +1 -1
- package/package.json +1 -1
- package/styles/index.js +26 -1
- package/styles/index.js.map +1 -1
- package/styles/patterns.d.ts +17 -0
- package/styles/patterns.js +53 -0
- package/styles/patterns.js.map +1 -0
- package/types/accessor.d.ts +1 -1
- package/utils/data.d.ts +1 -1
- package/utils/data.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation, no-irregular-whitespace */\n\n// Core\nimport { ComponentDefaultConfig, ComponentConfigInterface } from 'core/component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapPointStyles,\n MapZoomState,\n LeafletMapPointDatum,\n LeafletMapPointShape,\n LeafletMapClusterDatum,\n LeafletMapRenderer,\n} from './types'\n\n// Renderer settings\nimport { MapLibreStyleSpecs } from './renderer/map-style'\n\nexport interface LeafletMapConfigInterface<Datum extends GenericDataRecord> extends ComponentConfigInterface {\n // General\n /** Width in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n width?: number | string;\n /** Height in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n height?: number | string;\n /** Animation duration when the map is automatically panning or zooming to a point or area. Default: `1500` ms */\n flyToDuration?: number;\n /** Padding to be used when the `fitView` function has been called. The value is in pixels, [topLeft, bottomRight]. Default: `[150, 150]` */\n fitViewPadding?: [number, number];\n /** Animation duration for the `setZoom` function. Default: `800` ms */\n zoomDuration?: number;\n /** Default bounds that will be applied on the first map render if the bounds property is not set. Default: `undefined` */\n initialBounds?: Bounds;\n /** Force set map bounds on config and data updates. Default: `undefined` */\n fitBoundsOnUpdate?: Bounds;\n /** Fit the view to contain the data points on map initialization. Default: `true` */\n fitViewOnInit?: boolean;\n /** Fit the view to contain the data points on map config and data updates. Default: `false` */\n fitViewOnUpdate?: boolean;\n /** MapLibre `StyleSpecification` settings, or a URL to it. When renderer is set to`LeafletMapRenderer.Raster`, provide a template URL. Default: `undefined` */\n style: MapLibreStyleSpecs | string | undefined;\n /** MapLibre `StyleSpecification` settings or URL for dark theme. Default: `undefined` */\n styleDarkTheme?: MapLibreStyleSpecs | string | undefined;\n /** Tile server access token or API key. Default: `''` */\n accessToken?: string;\n /** Array of attribution labels. Default: `['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']` */\n attribution?: string[];\n /** Rendering mode for map's tile layer. For raster files, use `LeafletMapRenderer.Raster`. Default: `LeafletMapRenderer.MapLibre` */\n renderer?: LeafletMapRenderer | string;\n\n // Map events\n /** Function to be called after the map's async initialization is done. Default: `undefined` */\n onMapInitialized?: (() => void);\n /** Map Move / Zoom unified callback function. Default: `undefined` */\n onMapMoveZoom?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move Start callback function. Default: `undefined` */\n onMapMoveStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move End callback function. Default: `undefined` */\n onMapMoveEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Start callback function. Default: `undefined` */\n onMapZoomStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom End callback function. Default: `undefined` */\n onMapZoomEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Click callback function. Default: `undefined` */\n onMapClick?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n\n // Point\n /** Point longitude accessor function. Default: `d => d.longitude` */\n pointLongitude?: NumericAccessor<Datum>;\n /** Point latitude accessor function. Default: `d => d.latitude` */\n pointLatitude?: NumericAccessor<Datum>;\n /** Point id accessor function or constant value. Default: `d => d.id` */\n pointId?: StringAccessor<Datum>;\n /** Point shape accessor function or constant value. Default: `d => d.shape` */\n pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;\n /** Point color accessor function or constant value. Default: `d => d.color` */\n pointColor?: ColorAccessor<LeafletMapPointDatum<Datum>>;\n /** Point radius accessor function or constant value. Default: `undefined` */\n pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-point-inner-label-text-color-light` or to `--vis-map-point-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n pointLabelColor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point bottom label accessor function. Default: `''` */\n pointBottomLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point cursor value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** The width of the ring when a point has a `LeafletMapPointShape.Ring` shape. Default: `1.25` */\n pointRingWidth?: number;\n /** Set selected point by its unique id. Default: `undefined` */\n selectedPointId?: string;\n\n // Cluster\n /** Cluster color accessor function or constant value. Default: `undefined` */\n clusterColor?: ColorAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster radius accessor function or constant value. Default: `undefined` */\n clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label accessor function. Default: `d => d.point_count` */\n clusterLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-cluster-inner-label-text-color-light` or to `--vis-map-cluster-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n clusterLabelColor?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster bottom label accessor function. Default: `''` */\n clusterBottomLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** The width of the cluster point ring. Default: `1.25` */\n clusterRingWidth?: number;\n /** When cluster is expanded, show a background circle to better separate points from the base map. Default: `true` */\n clusterBackground?: boolean;\n /** Defines whether the cluster should expand on click or not. Default: `true` */\n clusterExpandOnClick?: boolean;\n /** Clustering distance in pixels. This value will be passed to Supercluster as the `radius` property https://github.com/mapbox/supercluster. Default: `55` */\n clusteringDistance?: number;\n /** A single map point can have multiple properties displayed as a small pie chart (or a donut chart for a cluster of points).\n * By setting the colorMap configuration you can specify data properties that should be mapped to various pie / donut segments.\n *\n * ```\n * {\n * [key in keyof Datum]?: { color: string, className?: string }\n * }\n * ```\n * e.g.:\n * ```\n * {\n * healthy: { color: 'green' },\n * warning: { color: 'orange' },\n * danger: { color: 'red' }\n * }\n * ```\n * where every data point has the `healthy`, `warning` and `danger` numerical or boolean property.\n */\n colorMap?: LeafletMapPointStyles<Datum>;\n\n // TopoJSON overlay\n /** A TopoJSON Geometry layer to be displayed on top of the map. Supports fill and stroke */\n topoJSONLayer?: {\n /** The TopoJSON.Topology object. Default: `undefined` */\n sources: any;\n /** Name of the geometry feature to be displayed. Default: `undefined` */\n featureName?: string;\n /** Name of the property to be used for defining the fill color of the geometry. Default: `undefined` */\n fillProperty?: string;\n /** Name of the property to be used for defining the stroke color of the geometry. Default: `undefined` */\n strokeProperty?: string;\n /** Geometry fill opacity value. Default: `0.6` */\n fillOpacity?: number;\n /** Geometry stroke opacity value. Default: `0.8` */\n strokeOpacity?: number;\n /** Geometry stroke width. Default: `2` */\n strokeWidth?: number;\n };\n\n // Misc\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n\n /** Alternative text description of the chart for accessibility purposes. It will be applied as an\n * `aria-label` attribute to the div element containing your chart. Default: `undefined`.\n */\n ariaLabel?: string | null | undefined;\n}\n\nexport const LeafletMapDefaultConfig: LeafletMapConfigInterface<GenericDataRecord> = {\n ...ComponentDefaultConfig,\n // General\n width: undefined,\n height: undefined,\n flyToDuration: 1500,\n fitViewPadding: [150, 150],\n zoomDuration: 800,\n initialBounds: undefined,\n fitBoundsOnUpdate: undefined,\n fitViewOnInit: true,\n fitViewOnUpdate: false,\n attribution: ['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>'],\n accessToken: '',\n style: undefined,\n styleDarkTheme: undefined,\n renderer: LeafletMapRenderer.MapLibre,\n\n // Map events\n onMapInitialized: undefined,\n onMapMoveZoom: undefined,\n onMapMoveStart: undefined,\n onMapMoveEnd: undefined,\n onMapZoomStart: undefined,\n onMapZoomEnd: undefined,\n onMapClick: undefined,\n\n // Point\n pointLongitude: <Datum>(d: Datum): number => d['longitude'] as number,\n pointLatitude: <Datum>(d: Datum): number => d['latitude'] as number,\n pointId: <Datum>(d: Datum): string => d['id'] as string,\n pointShape: <Datum>(d: Datum): string => d['shape'] as string,\n pointColor: <Datum>(d: Datum): string => d['color'] as string,\n pointRadius: undefined,\n pointLabel: undefined,\n pointLabelColor: undefined,\n pointBottomLabel: '',\n pointCursor: null,\n pointRingWidth: 1.25,\n selectedPointId: undefined,\n\n // Cluster\n clusterColor: undefined,\n clusterRadius: undefined,\n clusterLabel: <Datum extends GenericDataRecord>(d: LeafletMapClusterDatum<Datum>): string => `${d.point_count}`,\n clusterLabelColor: undefined,\n clusterBottomLabel: '',\n clusterRingWidth: 1.25,\n clusterBackground: true,\n clusterExpandOnClick: true,\n clusteringDistance: 55,\n colorMap: {},\n\n // TopoJSON Overlay\n topoJSONLayer: {\n sources: undefined,\n fillOpacity: 0.6,\n strokeOpacity: 0.8,\n strokeWidth: 1,\n featureName: undefined,\n fillProperty: undefined,\n strokeProperty: undefined,\n },\n\n // Misc\n tooltip: undefined,\n ariaLabel: undefined,\n}\n"],"names":[],"mappings":";;;AAAA;AA6KO,MAAM,uBAAuB,GAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAC/B,sBAAsB,CAAA,EAAA;;AAEzB,IAAA,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS,EACjB,aAAa,EAAE,IAAI,EACnB,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAC1B,YAAY,EAAE,GAAG,EACjB,aAAa,EAAE,SAAS,EACxB,iBAAiB,EAAE,SAAS,EAC5B,aA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S;AAClB,QAAA,WAAW,EAAE,GAAG;AAChB,QAAA,aAAa,EAAE,GAAG;AAClB,QAAA,WAAW,EAAE,CAAC;AACd,QAAA,WAAW,EAAE,SAAS;AACtB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,cAAc,EAAE,SAAS;AAC1B,KAAA;;AAGD,IAAA,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS;;;;"}
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/components/leaflet-map/config.ts"],"sourcesContent":["/* eslint-disable dot-notation, no-irregular-whitespace */\n\n// Core\nimport { ComponentConfig, ComponentConfigInterface } from 'core/component/config'\nimport { Tooltip } from 'components/tooltip'\n\n// Types\nimport { ColorAccessor, GenericAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { GenericDataRecord } from 'types/data'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapPointStyles,\n MapZoomState,\n LeafletMapPointDatum,\n LeafletMapPointShape,\n LeafletMapClusterDatum,\n LeafletMapRenderer,\n} from './types'\n\n// Renderer settings\nimport { MapLibreStyleSpecs } from './renderer/map-style'\n\nexport interface LeafletMapConfigInterface<Datum extends GenericDataRecord> extends ComponentConfigInterface {\n // General\n /** Width in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n width?: number | string;\n /** Height in pixels or in CSS units. By default, the map will automatically fit to the size of the parent element. Default: `undefined`. */\n height?: number | string;\n /** Animation duration when the map is automatically panning or zooming to a point or area. Default: `1500` ms */\n flyToDuration?: number;\n /** Padding to be used when the `fitView` function has been called. The value is in pixels, [topLeft, bottomRight]. Default: `[150, 150]` */\n fitViewPadding?: [number, number];\n /** Animation duration for the `setZoom` function. Default: `800` ms */\n zoomDuration?: number;\n /** Default bounds that will be applied on the first map render if the bounds property is not set. Default: `undefined` */\n initialBounds?: Bounds;\n /** Force set map bounds on config and data updates. Default: `undefined` */\n fitBoundsOnUpdate?: Bounds;\n /** Fit the view to contain the data points on map initialization. Default: `true` */\n fitViewOnInit?: boolean;\n /** Fit the view to contain the data points on map config and data updates. Default: `false` */\n fitViewOnUpdate?: boolean;\n /** MapLibre `StyleSpecification` settings, or a URL to it. When renderer is set to`LeafletMapRenderer.Raster`, provide a template URL. Default: `undefined` */\n style: MapLibreStyleSpecs | string | undefined;\n /** MapLibre `StyleSpecification` settings or URL for dark theme. Default: `undefined` */\n styleDarkTheme?: MapLibreStyleSpecs | string | undefined;\n /** Tile server access token or API key. Default: `''` */\n accessToken?: string;\n /** Array of attribution labels. Default: `['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']` */\n attribution?: string[];\n /** Rendering mode for map's tile layer. For raster files, use `LeafletMapRenderer.Raster`. Default: `LeafletMapRenderer.MapLibre` */\n renderer?: LeafletMapRenderer | string;\n\n // Map events\n /** Function to be called after the map's async initialization is done. Default: `undefined` */\n onMapInitialized?: (() => void);\n /** Map Move / Zoom unified callback function. Default: `undefined` */\n onMapMoveZoom?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move Start callback function. Default: `undefined` */\n onMapMoveStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Move End callback function. Default: `undefined` */\n onMapMoveEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Start callback function. Default: `undefined` */\n onMapZoomStart?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom End callback function. Default: `undefined` */\n onMapZoomEnd?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n /** Map Zoom Click callback function. Default: `undefined` */\n onMapClick?: (({ mapCenter, zoomLevel, bounds }: MapZoomState) => void);\n\n // Point\n /** Point longitude accessor function. Default: `d => d.longitude` */\n pointLongitude?: NumericAccessor<Datum>;\n /** Point latitude accessor function. Default: `d => d.latitude` */\n pointLatitude?: NumericAccessor<Datum>;\n /** Point id accessor function or constant value. Default: `d => d.id` */\n pointId?: StringAccessor<Datum>;\n /** Point shape accessor function or constant value. Default: `d => d.shape` */\n pointShape?: GenericAccessor<LeafletMapPointShape | string, Datum>;\n /** Point color accessor function or constant value. Default: `d => d.color` */\n pointColor?: ColorAccessor<Datum>;\n /** Point radius accessor function or constant value. Default: `undefined` */\n pointRadius?: NumericAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label accessor function. Default: `undefined` */\n pointLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-point-inner-label-text-color-light` or to `--vis-map-point-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n pointLabelColor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point bottom label accessor function. Default: `''` */\n pointBottomLabel?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** Point cursor value or accessor function. Default: `null` */\n pointCursor?: StringAccessor<LeafletMapPointDatum<Datum>>;\n /** The width of the ring when a point has a `LeafletMapPointShape.Ring` shape. Default: `1.25` */\n pointRingWidth?: number;\n /** Set selected point by its unique id. Default: `undefined` */\n selectedPointId?: string;\n\n // Cluster\n /** Cluster color accessor function or constant value. Default: `undefined` */\n clusterColor?: ColorAccessor<Datum>;\n /** Cluster radius accessor function or constant value. Default: `undefined` */\n clusterRadius?: NumericAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label accessor function. Default: `d => d.point_count` */\n clusterLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster inner label color accessor function or constant value.\n * By default, the label color will be set, depending on the point brightness, either to\n * `--vis-map-cluster-inner-label-text-color-light` or to `--vis-map-cluster-inner-label-text-color-dark` CSS variable.\n * Default: `undefined`\n */\n clusterLabelColor?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** Cluster bottom label accessor function. Default: `''` */\n clusterBottomLabel?: StringAccessor<LeafletMapClusterDatum<Datum>>;\n /** The width of the cluster point ring. Default: `1.25` */\n clusterRingWidth?: number;\n /** When cluster is expanded, show a background circle to better separate points from the base map. Default: `true` */\n clusterBackground?: boolean;\n /** Defines whether the cluster should expand on click or not. Default: `true` */\n clusterExpandOnClick?: boolean;\n /** Clustering distance in pixels. This value will be passed to Supercluster as the `radius` property https://github.com/mapbox/supercluster. Default: `55` */\n clusteringDistance?: number;\n /** A single map point can have multiple properties displayed as a small pie chart (or a donut chart for a cluster of points).\n * By setting the colorMap configuration you can specify data properties that should be mapped to various pie / donut segments.\n *\n * ```\n * {\n * [key in keyof Datum]?: { color: string, className?: string }\n * }\n * ```\n * e.g.:\n * ```\n * {\n * healthy: { color: 'green' },\n * warning: { color: 'orange' },\n * danger: { color: 'red' }\n * }\n * ```\n * where every data point has the `healthy`, `warning` and `danger` numerical or boolean property.\n */\n colorMap?: LeafletMapPointStyles<Datum>;\n\n // TopoJSON overlay\n /** A TopoJSON Geometry layer to be displayed on top of the map. Supports fill and stroke */\n topoJSONLayer?: {\n /** The TopoJSON.Topology object. Default: `undefined` */\n sources: any;\n /** Name of the geometry feature to be displayed. Default: `undefined` */\n featureName?: string;\n /** Name of the property to be used for defining the fill color of the geometry. Default: `undefined` */\n fillProperty?: string;\n /** Name of the property to be used for defining the stroke color of the geometry. Default: `undefined` */\n strokeProperty?: string;\n /** Geometry fill opacity value. Default: `0.6` */\n fillOpacity?: number;\n /** Geometry stroke opacity value. Default: `0.8` */\n strokeOpacity?: number;\n /** Geometry stroke width. Default: `2` */\n strokeWidth?: number;\n };\n\n // Misc\n /** Tooltip component. Default: `undefined` */\n tooltip?: Tooltip;\n\n /** Alternative text description of the chart for accessibility purposes. It will be applied as an\n * `aria-label` attribute to the div element containing your chart. Default: `undefined`.\n */\n ariaLabel?: string | null | undefined;\n}\n\nexport class LeafletMapConfig<Datum extends GenericDataRecord> extends ComponentConfig implements LeafletMapConfigInterface<Datum> {\n // General\n width = undefined\n height = undefined\n flyToDuration = 1500\n fitViewPadding = [150, 150] as [number, number]\n zoomDuration = 800\n initialBounds = undefined\n fitBoundsOnUpdate = undefined\n fitViewOnInit = true\n fitViewOnUpdate = false\n attribution = ['<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap contributors</a>']\n accessToken = ''\n style = undefined\n styleDarkTheme = undefined\n renderer = LeafletMapRenderer.MapLibre\n\n // Map events\n onMapInitialized = undefined\n onMapMoveZoom = undefined\n onMapMoveStart = undefined\n onMapMoveEnd = undefined\n onMapZoomStart = undefined\n onMapZoomEnd = undefined\n onMapClick = undefined\n\n // Point\n pointLongitude = (d: Datum): number => d['longitude'] as number\n pointLatitude = (d: Datum): number => d['latitude'] as number\n pointId = (d: Datum): string => d['id'] as string\n pointShape = (d: Datum): string => d['shape'] as string\n pointColor = (d: Datum): string => d['color'] as string\n pointRadius = undefined\n pointLabel = undefined\n pointLabelColor = undefined\n pointBottomLabel = ''\n pointCursor = null\n pointRingWidth = 1.25\n selectedPointId = undefined\n\n // Cluster\n clusterColor = undefined\n clusterRadius = undefined\n clusterLabel = (d: LeafletMapClusterDatum<Datum>): string => `${d.point_count}`\n clusterLabelColor = undefined\n clusterBottomLabel = ''\n clusterRingWidth = 1.25\n clusterBackground = true\n clusterExpandOnClick = true\n clusteringDistance = 55\n colorMap = {} as LeafletMapPointStyles<Datum>\n\n // TopoJSON Overlay\n topoJSONLayer = {\n sources: undefined,\n fillOpacity: 0.6,\n strokeOpacity: 0.8,\n strokeWidth: 1,\n featureName: undefined,\n fillProperty: undefined,\n strokeProperty: undefined,\n }\n\n // Misc\n tooltip = undefined\n ariaLabel = undefined\n}\n"],"names":[],"mappings":";;;AAAA;AA6KM,MAAO,gBAAkD,SAAQ,eAAe,CAAA;AAAtF,IAAA,WAAA,GAAA;;;QAEE,IAAK,CAAA,KAAA,GAAG,SAAS,CAAA;QACjB,IAAM,CAAA,MAAA,GAAG,SAAS,CAAA;QAClB,IAAa,CAAA,aAAA,GAAG,IAAI,CAAA;AACpB,QAAA,IAAA,CAAA,cAAc,GAAG,CAAC,GAAG,EAA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,CAAA;QACvB,IAAU,CAAA,UAAA,GAAG,SAAS,CAAA;QACtB,IAAe,CAAA,eAAA,GAAG,SAAS,CAAA;QAC3B,IAAgB,CAAA,gBAAA,GAAG,EAAE,CAAA;QACrB,IAAW,CAAA,WAAA,GAAG,IAAI,CAAA;QAClB,IAAc,CAAA,cAAA,GAAG,IAAI,CAAA;QACrB,IAAe,CAAA,eAAA,GAAG,SAAS,CAAA;;QAG3B,IAAY,CAAA,YAAA,GAAG,SAAS,CAAA;QACxB,IAAa,CAAA,aAAA,GAAG,SAAS,CAAA;QACzB,IAAY,CAAA,YAAA,GAAG,CAAC,CAAgC,KAAa,CAAA,EAAG,CAAC,CAAC,WAAW,CAAA,CAAE,CAAA;QAC/E,IAAiB,CAAA,iBAAA,GAAG,SAAS,CAAA;QAC7B,IAAkB,CAAA,kBAAA,GAAG,EAAE,CAAA;QACvB,IAAgB,CAAA,gBAAA,GAAG,IAAI,CAAA;QACvB,IAAiB,CAAA,iBAAA,GAAG,IAAI,CAAA;QACxB,IAAoB,CAAA,oBAAA,GAAG,IAAI,CAAA;QAC3B,IAAkB,CAAA,kBAAA,GAAG,EAAE,CAAA;QACvB,IAAQ,CAAA,QAAA,GAAG,EAAkC,CAAA;;AAG7C,QAAA,IAAA,CAAA,aAAa,GAAG;AACd,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,WAAW,EAAE,GAAG;AAChB,YAAA,aAAa,EAAE,GAAG;AAClB,YAAA,WAAW,EAAE,CAAC;AACd,YAAA,WAAW,EAAE,SAAS;AACtB,YAAA,YAAY,EAAE,SAAS;AACvB,YAAA,cAAc,EAAE,SAAS;SAC1B,CAAA;;QAGD,IAAO,CAAA,OAAA,GAAG,SAAS,CAAA;QACnB,IAAS,CAAA,SAAA,GAAG,SAAS,CAAA;KACtB;AAAA;;;;"}
|
|
@@ -6,9 +6,9 @@ import { MapDataModel } from "../../data-models/map";
|
|
|
6
6
|
import { ComponentType } from "../../types/component";
|
|
7
7
|
import { GenericDataRecord } from "../../types/data";
|
|
8
8
|
import { Bounds, LeafletMapPoint } from './types';
|
|
9
|
-
import { LeafletMapConfigInterface } from './config';
|
|
9
|
+
import { LeafletMapConfig, LeafletMapConfigInterface } from './config';
|
|
10
10
|
import * as s from './style';
|
|
11
|
-
export declare class LeafletMap<Datum extends GenericDataRecord> extends ComponentCore<Datum[], LeafletMapConfigInterface<Datum>> {
|
|
11
|
+
export declare class LeafletMap<Datum extends GenericDataRecord> extends ComponentCore<Datum[], LeafletMapConfig<Datum>, LeafletMapConfigInterface<Datum>> {
|
|
12
12
|
static selectors: typeof s;
|
|
13
13
|
static cssVariables: {
|
|
14
14
|
mapContainerBackgroundColor: "--vis-map-container-background-color";
|
|
@@ -43,11 +43,10 @@ export declare class LeafletMap<Datum extends GenericDataRecord> extends Compone
|
|
|
43
43
|
darkMapPointBottomLabelTextColor: "--vis-dark-map-point-bottom-label-text-color";
|
|
44
44
|
darkMapClusterExpandedBackgroundFillColor: "--vis-dark-map-cluster-expanded-background-fill-color";
|
|
45
45
|
};
|
|
46
|
-
protected _defaultConfig: LeafletMapConfigInterface<Datum>;
|
|
47
|
-
config: LeafletMapConfigInterface<Datum>;
|
|
48
46
|
g: Selection<HTMLElement, unknown, null, undefined>;
|
|
49
47
|
type: ComponentType;
|
|
50
48
|
element: HTMLElement;
|
|
49
|
+
config: LeafletMapConfig<Datum>;
|
|
51
50
|
datamodel: MapDataModel<Datum>;
|
|
52
51
|
protected _container: HTMLElement;
|
|
53
52
|
protected _containerSelection: Selection<HTMLElement, unknown, null, undefined>;
|
|
@@ -8,7 +8,7 @@ import { isString, getNumber, isNil, getString, clamp } from '../../utils/data.j
|
|
|
8
8
|
import { constraintMapViewThrottled } from './renderer/mapboxgl-utils.js';
|
|
9
9
|
import { calculateClusterIndex, projectPoint, findPointAndClusterByPointId, getNodeRelativePosition, bBoxMerge, shouldClusterExpand, getNextZoomLevelOnClusterClick, getPointRadius, getClusterRadius, getClustersAndPoints, geoJsonPointToScreenPoint } from './modules/utils.js';
|
|
10
10
|
import { LeafletMapRenderer } from './types.js';
|
|
11
|
-
import {
|
|
11
|
+
import { LeafletMapConfig } from './config.js';
|
|
12
12
|
import * as style from './style.js';
|
|
13
13
|
import { root, map, svgOverlay, backgroundRect, points, clusterBackground, pointSelectionRing, point, variables } from './style.js';
|
|
14
14
|
import { setupMap, initialMapCenter, initialMapZoom, updateTopoJson } from './modules/map.js';
|
|
@@ -19,9 +19,8 @@ import { createBackgroundNode, updateBackgroundNode } from './modules/clusterBac
|
|
|
19
19
|
class LeafletMap extends ComponentCore {
|
|
20
20
|
constructor(container, config, data) {
|
|
21
21
|
super(ComponentType.HTML);
|
|
22
|
-
this._defaultConfig = LeafletMapDefaultConfig;
|
|
23
|
-
this.config = this._defaultConfig;
|
|
24
22
|
this.type = ComponentType.HTML;
|
|
23
|
+
this.config = new LeafletMapConfig();
|
|
25
24
|
this.datamodel = new MapDataModel();
|
|
26
25
|
this._expandedCluster = null;
|
|
27
26
|
this._cancelBackgroundClick = false;
|
|
@@ -142,7 +141,7 @@ class LeafletMap extends ComponentCore {
|
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
setConfig(config) {
|
|
145
|
-
|
|
144
|
+
this.config = new LeafletMapConfig().init(config);
|
|
146
145
|
if (config.width)
|
|
147
146
|
this._containerSelection.style('width', isString(config.width) ? config.width : `${config.width}px`);
|
|
148
147
|
if (config.height)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/leaflet-map/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\nimport { packSiblings } from 'd3-hierarchy'\nimport type L from 'leaflet'\nimport Supercluster, { ClusterFeature, PointFeature } from 'supercluster'\nimport { StyleSpecification } from 'maplibre-gl'\n\n// Core\nimport { ComponentCore } from 'core/component'\n\n// Model\nimport { MapDataModel } from 'data-models/map'\n\n// Types\nimport { ComponentType } from 'types/component'\nimport { GenericDataRecord } from 'types/data'\n\n// Utils\nimport { ResizeObserver } from 'utils/resize-observer'\nimport { clamp, isNil, getNumber, getString, isString } from 'utils/data'\nimport { constraintMapViewThrottled } from './renderer/mapboxgl-utils'\nimport {\n projectPoint,\n bBoxMerge,\n calculateClusterIndex,\n getNextZoomLevelOnClusterClick,\n findPointAndClusterByPointId,\n geoJsonPointToScreenPoint,\n getClusterRadius,\n getClustersAndPoints,\n getNodeRelativePosition,\n getPointRadius,\n shouldClusterExpand,\n} from './modules/utils'\n\n// Local Types\nimport {\n Bounds,\n LeafletMapClusterDatum,\n LeafletMapPoint,\n LeafletMapPointDatum,\n LeafletMapRenderer,\n MapZoomState,\n PointExpandedClusterProperties,\n} from './types'\n\n// Config\nimport { LeafletMapDefaultConfig, LeafletMapConfigInterface } from './config'\n\n// Styles\nimport * as s from './style'\n\n// Modules\nimport { initialMapCenter, initialMapZoom, setupMap, updateTopoJson } from './modules/map'\nimport { collideLabels, createNodes, removeNodes, updateNodes } from './modules/node'\nimport { createNodeSelectionRing, updateNodeSelectionRing } from './modules/selectionRing'\nimport { createBackgroundNode, updateBackgroundNode } from './modules/clusterBackground'\n\nexport class LeafletMap<Datum extends GenericDataRecord> extends ComponentCore<Datum[], LeafletMapConfigInterface<Datum>> {\n static selectors = s\n static cssVariables = s.variables\n protected _defaultConfig = LeafletMapDefaultConfig as LeafletMapConfigInterface<Datum>\n public config: LeafletMapConfigInterface<Datum> = this._defaultConfig\n\n g: Selection<HTMLElement, unknown, null, undefined>\n type = ComponentType.HTML\n element: HTMLElement\n datamodel: MapDataModel<Datum> = new MapDataModel()\n protected _container: HTMLElement\n protected _containerSelection: Selection<HTMLElement, unknown, null, undefined>\n public _onMapMoveEndInternal: (leaflet: L.Map) => void // Internal callback needed by Leaflet Flow Map\n private _map: {\n leaflet: L.Map;\n layer: L.Layer;\n svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;\n svgGroup: Selection<SVGGElement, unknown, SVGElement, undefined>;\n }\n\n private _clusterIndex: Supercluster<Datum>\n private _expandedCluster: { points: PointFeature<PointExpandedClusterProperties<Datum>>[]; cluster: LeafletMapPoint<Datum> } = null\n private _cancelBackgroundClick = false\n private _hasBeenMoved = false\n private _hasBeenZoomed = false\n private _isMoving = false\n private _isZooming = false\n private _eventInitiatedByComponent = false\n private _triggerBackgroundClick = false\n private _externallySelectedPoint: LeafletMapPoint<Datum> | PointFeature<Datum> | null = null\n private _zoomingToExternallySelectedPoint = false\n private _forceExpandCluster = false\n private _pointGroup: Selection<SVGGElement, unknown, SVGElement, undefined>\n private _pointSelectionRing: Selection<SVGGElement, unknown, SVGElement, undefined>\n private _clusterBackground: Selection<SVGGElement, unknown, SVGElement, undefined>\n private _clusterBackgroundRadius = 0\n private _selectedPoint: LeafletMapPoint<Datum> = null\n private _currentZoomLevel: number | null = null\n private _firstRender = true\n private _isDarkThemeActive = false\n private resizeObserver: ResizeObserver\n private themeObserver: MutationObserver\n private _renderDataAnimationFrameId: number | null = null\n private _flyToBoundsAnimationFrameId: number | null = null\n readonly _leafletInitializationPromise: Promise<L.Map>\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n static DEFAULT_CONTAINER_HEIGHT = 600\n\n events = {\n [LeafletMap.selectors.point]: {\n mouseup: this._onPointMouseUp.bind(this),\n mousedown: this._onPointMouseDown.bind(this),\n click: this._onPointClick.bind(this),\n },\n }\n\n constructor (container: HTMLElement, config?: LeafletMapConfigInterface<Datum>, data?: Datum[]) {\n super(ComponentType.HTML)\n this._container = container\n this._containerSelection = select(this._container).attr('role', 'figure')\n\n this._container.appendChild(this.element)\n this.g\n .attr('class', s.root)\n .attr('aria-hidden', true)\n\n if (config) this.setConfig(config)\n\n if (!this._container.clientWidth) {\n console.warn('Unovis | Leaflet Map: The width of the container is not set. Setting to 100%.')\n this._containerSelection.style('width', '100%')\n }\n\n if (!this._container.clientHeight) {\n console.warn(`Unovis | Leaflet Map: The height of the container is not set. Setting to ${LeafletMap.DEFAULT_CONTAINER_HEIGHT}px.`)\n this._containerSelection.style('height', `${LeafletMap.DEFAULT_CONTAINER_HEIGHT}px`)\n }\n\n // Initialize map asynchronously\n this._leafletInitializationPromise = new Promise((resolve) => {\n setupMap(this.element, this.config).then(map => {\n // Apply the `s.map` class to `tilePane` to allow tooltip interactions\n select(map.leaflet.getPanes().tilePane).classed(s.map, true)\n if (config) this.setConfig(config)\n\n this._map = map\n this._map.leaflet.on('drag', this._onMapDragLeaflet.bind(this))\n this._map.leaflet.on('move', this._onMapMove.bind(this))\n this._map.leaflet.on('movestart', this._onMapMoveStart.bind(this))\n this._map.leaflet.on('moveend', this._onMapMoveEnd.bind(this))\n this._map.leaflet.on('zoom', this._onMapZoom.bind(this))\n this._map.leaflet.on('zoomstart', this._onMapZoomStart.bind(this))\n this._map.leaflet.on('zoomend', this._onMapZoomEnd.bind(this))\n\n // We need to handle background click in a special way to deal\n // with d3 svg overlay that might have smaller size than the map itself\n // (see this._onNodeMouseDown() and this this._onNodeMouseDown())\n this._map.leaflet.on('mousedown', () => {\n if (!this._cancelBackgroundClick) this._triggerBackgroundClick = true\n })\n\n this._map.leaflet.on('mouseup', (e) => {\n if (this._triggerBackgroundClick) {\n this._triggerBackgroundClick = false\n const originalEvent = (e as any).originalEvent\n this._onBackgroundClick(originalEvent.target, originalEvent)\n }\n })\n\n this._map.svgOverlay\n .attr('class', s.svgOverlay)\n .insert('rect', ':first-child')\n .attr('class', s.backgroundRect)\n .attr('width', '100%')\n .attr('height', '100%')\n\n this._pointGroup = this._map.svgGroup.append('g').attr('class', s.points)\n this._clusterBackground = this._pointGroup.append('g')\n .attr('class', s.clusterBackground)\n .call(createBackgroundNode)\n this._pointSelectionRing = this._pointGroup.append('g')\n .attr('class', s.pointSelectionRing)\n .call(createNodeSelectionRing)\n\n this._map.leaflet.setView(initialMapCenter, initialMapZoom)\n\n if (document.body.classList.contains('theme-dark') && config.styleDarkTheme) {\n this._isDarkThemeActive = true\n this.setTheme(config.styleDarkTheme)\n }\n\n this.config.onMapInitialized?.()\n resolve(this._map.leaflet)\n })\n })\n\n\n // Set data and render the map when it's ready\n this.setData(data ?? [])\n\n // When the container size changes we have to initiate map resize in order to update its dimensions\n this.resizeObserver = new ResizeObserver(() => {\n this._map?.leaflet?.invalidateSize()\n this.config.tooltip?.hide()\n })\n this.resizeObserver.observe(container)\n\n // If dark theme is enabled, update map's style when document body's class list changes\n if (this.config.styleDarkTheme) {\n this.themeObserver = new MutationObserver((mutations) => {\n mutations.forEach(change => {\n if (change.attributeName === 'class') {\n const isDarkTheme = (change.target as HTMLElement).classList.contains('theme-dark')\n if (this._isDarkThemeActive !== isDarkTheme) {\n this.setTheme(isDarkTheme ? this.config.styleDarkTheme : this.config.style)\n this._isDarkThemeActive = isDarkTheme\n }\n }\n })\n })\n this.themeObserver.observe(document.body, { attributes: true })\n }\n }\n\n setConfig (config: LeafletMapConfigInterface<Datum>): void {\n super.setConfig(config)\n\n if (config.width) this._containerSelection.style('width', isString(config.width) ? config.width : `${config.width}px`)\n if (config.height) this._containerSelection.style('height', isString(config.height) ? config.height : `${config.height}px`)\n\n if (this._map && config.renderer === LeafletMapRenderer.MapLibre) {\n const layer = this._map.layer as any // Using any because the typings are not full\n const maplibreMap = layer.getMaplibreMap()\n if (maplibreMap.isStyleLoaded()) updateTopoJson(maplibreMap, this.config)\n }\n\n if (this.config.tooltip) {\n this.config.tooltip.setContainer(this._container)\n this.config.tooltip.setComponents([this])\n this.config.tooltip.update()\n }\n\n // Apply the `aria-label` attribute\n this._containerSelection.attr('aria-label', config.ariaLabel)\n }\n\n setData (data: Datum[]): void {\n const { config, datamodel } = this\n\n const dataValid = data.filter(d => {\n const lat = getNumber(d, config.pointLatitude)\n const lon = getNumber(d, config.pointLongitude)\n const valid = isFinite(lat) && isFinite(lon)\n\n if (!valid) console.warn('Unovis | Leaflet Map: Invalid point coordinates', d)\n return valid\n })\n\n datamodel.data = dataValid\n\n // We use Supercluster for real-time node clustering\n this._clusterIndex = calculateClusterIndex<Datum>(dataValid, this.config)\n\n // If there was an expanded cluster, try to find its successor and expand it too\n if (this._expandedCluster && this._map.leaflet) {\n // Reset expanded cluster before calling `_getPointData()` to get data with all clusters collapsed\n const expandedCluster = this._expandedCluster\n this._resetExpandedCluster()\n const pointData = this._getPointData()\n\n const expandedClusterCenterPx = projectPoint(expandedCluster.cluster, this._map.leaflet)\n const expandedClusterRadiusPx = expandedCluster.cluster.radius\n const cluster = pointData.find((c) => {\n if (!c.isCluster) return false\n const pos = projectPoint(c, this._map.leaflet)\n const r = c.radius\n const distance = Math.sqrt((expandedClusterCenterPx.x - pos.x) ** 2 + (expandedClusterCenterPx.y - pos.y) ** 2)\n return distance < (expandedClusterRadiusPx + r)\n })\n\n if (cluster) this._expandCluster(cluster, true)\n }\n\n // Render\n this._leafletInitializationPromise.then(() => {\n this.render()\n })\n }\n\n setTheme (theme: StyleSpecification | string): void {\n const layer = this._map.layer as any // Using any because the typings are not full\n if (this.config.renderer === LeafletMapRenderer.MapLibre) {\n const maplibreMap = layer.getMaplibreMap()\n maplibreMap.setStyle?.(theme)\n updateTopoJson(maplibreMap, this.config)\n } else {\n if (typeof theme !== 'string') {\n console.warn('Unovis | Leaflet Map: Invalid style. Provide a URL string for raster rendering mode.')\n return\n }\n layer.setUrl(theme)\n }\n }\n\n // We redefine the ComponentCore render function to bind event to newly created elements in this._renderData(),\n // which is being called after almost every map interaction\n render (): void {\n const { config } = this\n if (!this._map) return\n\n this._renderData()\n if (this._firstRender) {\n if (config.initialBounds) this.fitToBounds(config.initialBounds)\n else if (config.fitViewOnInit) this.fitToPoints(0, config.fitViewPadding)\n } else {\n if (config.fitViewOnUpdate) this.fitToPoints(0, config.fitViewPadding)\n else if (config.fitBoundsOnUpdate) this.fitToBounds(config.fitBoundsOnUpdate)\n }\n\n this._firstRender = false\n }\n\n public getLeafletInstancePromise (): Promise<L.Map> {\n return this._leafletInitializationPromise\n }\n\n public fitToPoints (duration = this.config.flyToDuration, padding = this.config.fitViewPadding): void {\n const { config, datamodel, datamodel: { data } } = this\n\n if (!this._map || !this._map.leaflet) return\n if (!data?.length) return\n const bounds = datamodel.getDataLatLngBounds(config.pointLatitude, config.pointLongitude)\n this._flyToBoundsAnimationFrameId = requestAnimationFrame(() => this._flyToBounds(bounds, duration, padding))\n }\n\n public fitToBounds (bounds: Bounds, duration = this.config.flyToDuration, padding = this.config.fitViewPadding): void {\n const { northEast, southWest } = bounds\n if (isNil(northEast) || isNil(southWest)) return\n if (isNil(northEast.lat) || isNil(northEast.lng)) return\n if (isNil(southWest.lat) || isNil(southWest.lng)) return\n if (!this._map || !this._map.leaflet) return\n this._flyToBoundsAnimationFrameId = requestAnimationFrame(() => this._flyToBounds([\n [northEast.lat, southWest.lng],\n [southWest.lat, northEast.lng],\n ], duration, padding))\n }\n\n /* Select a point by id and optionally center the map view.\n * This method was designed to be used mainly with the `[LeafletMap.selectors.point]` click events\n * (when the user actually clicks on a point) and the specified point is inside one of the collapsed\n * clusters it won't be selected. You can use the `zoomToPointById` method to achieve that.\n */\n public selectPointById (id: string, centerView = false): void {\n const { config } = this\n const pointData = this._getPointData()\n const foundPoint = pointData.find(d => (d.properties as LeafletMapPointDatum<Datum>).id === id)\n\n if (!foundPoint) {\n console.warn(`Unovis | Leaflet Map: Node with id ${id} can not be found`)\n return\n }\n\n if ((foundPoint.properties as LeafletMapClusterDatum<Datum>)?.cluster) {\n console.warn('Unovis | Leaflet Map: Cluster can\\'t be selected')\n return\n }\n\n this._selectedPoint = foundPoint\n\n const isPointInsideExpandedCluster = this._expandedCluster?.points?.find(d => getString(d.properties, config.pointId) === id)\n if (!isPointInsideExpandedCluster) this._resetExpandedCluster()\n\n if (centerView) {\n const coordinates = {\n lng: getNumber(foundPoint.properties as LeafletMapPointDatum<Datum>, config.pointLongitude),\n lat: getNumber(foundPoint.properties as LeafletMapPointDatum<Datum>, config.pointLatitude),\n }\n\n const zoomLevel = this._map.leaflet.getZoom()\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, zoomLevel, { duration: 0 })\n } else {\n this._renderData()\n }\n }\n\n /* Get the id of the selected point */\n public getSelectedPointId (): string | number | undefined {\n return this._selectedPoint?.id\n }\n\n /* Unselect point if it was selected before */\n public unselectPoint (): void {\n this._selectedPoint = null\n this._externallySelectedPoint = null\n this.render()\n }\n\n /** Get the currently expanded cluster */\n public getExpandedCluster (): { id: string; points: Datum[] } | undefined {\n if (!this._expandedCluster) return\n const id = this._expandedCluster.cluster?.id as string\n const points = this._expandedCluster.cluster?.clusterPoints.map(d => this.datamodel.data[(d as LeafletMapPointDatum<Datum>)._index])\n return { id, points }\n }\n\n /* Zoom to a point by id and optionally select it.\n * If the point is inside a cluster, it'll be automatically expanded to show the enclosed point.\n * You can also force set the zoom level by providing the `customZoomLevel` argument.\n */\n public zoomToPointById (id: string, selectPoint = false, customZoomLevel?: number): void {\n const { config, datamodel } = this\n if (!datamodel.data.length) {\n console.warn('Unovis | Leaflet Map: There are no points on the map')\n return\n }\n const dataBoundsAll = datamodel.getDataLatLngBounds(config.pointLatitude, config.pointLongitude)\n const bounds: [number, number, number, number] = [dataBoundsAll[0][1], dataBoundsAll[1][0], dataBoundsAll[1][1], dataBoundsAll[0][0]]\n const pointDataAll = this._getPointData(bounds)\n\n let foundPoint: LeafletMapPoint<Datum> | PointFeature<Datum> = pointDataAll\n .find((d: LeafletMapPoint<Datum>) => getString(d.properties as LeafletMapPointDatum<Datum>, config.pointId) === id)\n\n // If point was found and it's a cluster -> do nothing\n if ((foundPoint?.properties as LeafletMapClusterDatum<Datum>)?.cluster) {\n console.warn('Unovis | Leaflet Map: Cluster can\\'t be zoomed in')\n return\n }\n\n // If point was not found -> search for it in all collapsed clusters\n if (!foundPoint) {\n const { point } = findPointAndClusterByPointId(pointDataAll, id, config.pointId)\n foundPoint = point\n }\n\n if (foundPoint) {\n // If point was found and it's inside an expanded cluster -> simply select it\n const isPointInsideExpandedCluster = this._expandedCluster?.points?.find(d => getString(d.properties, config.pointId) === id)\n if (isPointInsideExpandedCluster && selectPoint) {\n this._selectedPoint = foundPoint as LeafletMapPoint<Datum>\n this._renderData()\n return\n }\n\n // Else - trigger zoom\n this._externallySelectedPoint = foundPoint\n this._zoomingToExternallySelectedPoint = true\n\n this._forceExpandCluster = !isNil(customZoomLevel)\n if (selectPoint) this._selectedPoint = foundPoint as LeafletMapPoint<Datum>\n\n const zoomLevel = isNil(customZoomLevel) ? this._map.leaflet.getZoom() : customZoomLevel\n const pointDatum = foundPoint.properties as LeafletMapPointDatum<Datum>\n const coordinates = {\n lng: getNumber(pointDatum, config.pointLongitude),\n lat: getNumber(pointDatum, config.pointLatitude),\n }\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, zoomLevel, { duration: 0 })\n } else {\n console.warn(`Unovis | Leaflet Map: Node with id ${id} can not be found`)\n }\n }\n\n public getNodeRelativePosition (node: LeafletMapPoint<Datum>): { x: number; y: number } {\n return getNodeRelativePosition(node, this._map.leaflet)\n }\n\n public hasBeenZoomed (): boolean {\n return this._hasBeenZoomed\n }\n\n public hasBeenMoved (): boolean {\n return this._hasBeenMoved\n }\n\n public isZooming (): boolean {\n return this._isZooming\n }\n\n public isMoving (): boolean {\n return this._isMoving\n }\n\n\n private _flyToBounds (bounds: [[number, number], [number, number]], durationMs: number, paddingPx?: [number, number]): void {\n this._eventInitiatedByComponent = true\n const duration = durationMs / 1000\n const padding: [number, number] | undefined = paddingPx ? [\n paddingPx[0] < this._container.clientWidth / 2 ? paddingPx[0] : this._container.clientWidth / 2,\n paddingPx[1] < this._container.clientHeight / 2 ? paddingPx[1] : this._container.clientHeight / 2,\n ] : undefined\n if (duration) {\n this._map.leaflet.flyToBounds(bounds, { duration, padding })\n } else {\n this._map.leaflet.fitBounds(bounds, { padding })\n }\n }\n\n private _renderData (mapMoveZoomUpdateOnly = false): void {\n const { config } = this\n\n const pointData = this._getPointData()\n const contentBBox = pointData.length ? bBoxMerge(pointData.map(d => d.bbox)) : { x: 0, y: 0, width: 0, height: 0 }\n\n // Set SVG size to match Leaflet transform\n const svgExtraPadding = 40 + this._clusterBackgroundRadius // We need it to fit point labels and expanded cluster background circle\n const dx = contentBBox.x - svgExtraPadding\n const dy = contentBBox.y - svgExtraPadding\n this._map.svgOverlay\n .attr('width', contentBBox.width + 2 * svgExtraPadding)\n .attr('height', contentBBox.height + 2 * svgExtraPadding)\n .style('left', `${dx}px`)\n .style('top', `${dy}px`)\n\n this._map.svgGroup\n .attr('transform', `translate(${-dx},${-dy})`)\n\n // Render content\n const points = this._pointGroup.selectAll<SVGGElement, LeafletMapPoint<Datum>>(`.${s.point}:not(.exit)`)\n .data(pointData, (d: LeafletMapPoint<Datum>, i) => `${d.id || d.geometry.coordinates.join('')}`)\n\n points.exit<LeafletMapPoint<Datum>>().classed('exit', true).call(removeNodes)\n const pointsEnter = points.enter().append('g').attr('class', s.point)\n .call(createNodes)\n\n const pointsMerged = points.merge(pointsEnter)\n pointsEnter.call(updateNodes, config, this._map.leaflet)\n points.call(updateNodes, config, this._map.leaflet, mapMoveZoomUpdateOnly)\n pointsMerged.call(collideLabels, this._map.leaflet)\n\n this._clusterBackground.call(updateBackgroundNode, this._expandedCluster, config, this._map.leaflet, this._clusterBackgroundRadius)\n if (this._expandedCluster && config.clusterBackground) {\n pointData.forEach((d, i) => { d._zIndex = (d.properties as LeafletMapPointDatum<Datum>)?.expandedClusterPoint ? 2 : 0 })\n this._pointGroup\n .selectAll<SVGGElement, LeafletMapPoint<Datum>>(`.${s.point}, .${s.clusterBackground}, .${s.pointSelectionRing}`)\n .sort((a: LeafletMapPoint<Datum>, b: LeafletMapPoint<Datum>) => a._zIndex - b._zIndex)\n }\n\n // Show selection border and hide it when the node\n // is out of visible box\n if (config.selectedPointId) {\n const foundPoint = pointData.find(d => getString(d.properties as LeafletMapPointDatum<Datum>, config.pointId) === config.selectedPointId)\n const { cluster } = findPointAndClusterByPointId(pointData, config.selectedPointId, config.pointId)\n if (foundPoint) this._selectedPoint = foundPoint\n else this._selectedPoint = cluster\n }\n this._pointSelectionRing.call(updateNodeSelectionRing, this._selectedPoint, pointData, config, this._map.leaflet)\n\n // Set up events and attributes for the rendered points\n this._setUpComponentEventsThrottled()\n this._setCustomAttributesThrottled()\n\n // Tooltip\n config.tooltip?.update()\n }\n\n private _zoomToExternallySelectedPoint (): void {\n const { config } = this\n if (!this._externallySelectedPoint) return\n\n const externallySelectedPointDatum = this._externallySelectedPoint.properties as LeafletMapPointDatum<Datum>\n const externallySelectedPointId = getString(externallySelectedPointDatum, config.pointId)\n const pointData = this._getPointData()\n const foundPoint: LeafletMapPoint<Datum> = pointData.find(\n d => getString(d.properties as Datum, config.pointId) === externallySelectedPointId\n )\n\n if (foundPoint) {\n this._zoomingToExternallySelectedPoint = false\n this._currentZoomLevel = null\n } else {\n const { cluster } = findPointAndClusterByPointId(pointData, externallySelectedPointId, config.pointId)\n if (!cluster) return\n\n const zoomLevel = this._map.leaflet.getZoom()\n // Expand cluster or fly further\n if (this._forceExpandCluster || shouldClusterExpand(cluster, zoomLevel, 8, 13)) {\n this._expandCluster(cluster)\n } else {\n const newZoomLevel = getNextZoomLevelOnClusterClick(zoomLevel)\n const coordinates = {\n lng: getNumber(externallySelectedPointDatum, config.pointLongitude),\n lat: getNumber(externallySelectedPointDatum, config.pointLatitude),\n }\n if (this._currentZoomLevel !== newZoomLevel) {\n this._currentZoomLevel = newZoomLevel\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, newZoomLevel, { duration: 0 })\n }\n }\n }\n }\n\n private _expandCluster (clusterPoint: LeafletMapPoint<Datum>, preventRender?: boolean): void {\n const { config, config: { clusterBackground } } = this\n const padding = 1\n\n config.tooltip?.hide()\n\n this._forceExpandCluster = false\n if (clusterPoint) {\n const points: PointFeature<PointExpandedClusterProperties<Datum>>[] =\n clusterPoint.clusterIndex.getLeaves((clusterPoint.properties as LeafletMapClusterDatum<Datum>).cluster_id as number, Infinity)\n const packPoints: {x: number; y: number; r: number }[] = points.map(p => ({\n x: null,\n y: null,\n r: getPointRadius(p, config.pointRadius, this._map.leaflet.getZoom()) + padding,\n }))\n packSiblings(packPoints)\n\n points.forEach((p, i) => {\n p.properties.expandedClusterPoint = clusterPoint\n p.properties.r = packPoints[i].r\n p.properties.dx = packPoints[i].x\n p.properties.dy = packPoints[i].y\n })\n\n this._resetExpandedCluster()\n this._expandedCluster = {\n cluster: clusterPoint,\n points,\n }\n\n if (clusterBackground) this._clusterBackgroundRadius = getClusterRadius(this._expandedCluster)\n\n if (!preventRender) this._renderData()\n }\n\n this._zoomingToExternallySelectedPoint = false\n }\n\n private _resetExpandedCluster (): void {\n this._expandedCluster?.points?.forEach(d => { delete d.properties.expandedClusterPoint })\n this._expandedCluster = null\n }\n\n private _getPointData (customBounds?: [number, number, number, number]): LeafletMapPoint<Datum>[] {\n const { config, datamodel: { data } } = this\n\n if (!data || !this._clusterIndex) return []\n\n let geoJSONPoints: (ClusterFeature<LeafletMapClusterDatum<Datum>> | PointFeature<PointExpandedClusterProperties<Datum>>)[] =\n getClustersAndPoints<Datum>(this._clusterIndex, this._map.leaflet, customBounds)\n\n if (this._expandedCluster) {\n // Remove expanded cluster from the data\n geoJSONPoints = geoJSONPoints.filter(c => (c as ClusterFeature<LeafletMapClusterDatum<Datum>>).properties.cluster_id !== (this._expandedCluster.cluster.properties as LeafletMapClusterDatum<Datum>).cluster_id)\n // Add points from the expanded cluster\n geoJSONPoints = geoJSONPoints.concat(this._expandedCluster.points)\n }\n\n const pointData = geoJSONPoints\n // Todo: Remove explicitly set ClusterFeature<LeafletMapPointDatum<Datum>> type\n .map((d, i: number) => {\n return geoJsonPointToScreenPoint(d as ClusterFeature<LeafletMapPointDatum<Datum>>, i, this._map.leaflet, config)\n })\n // .sort((a, b) => getPointDisplayOrder(a, config.pointStatus, config.colorMap) - getPointDisplayOrder(b, config.pointStatus, config.colorMap))\n\n return pointData\n }\n\n private _getMapZoomState (): MapZoomState {\n const leafletBounds = this._map.leaflet.getBounds()\n const southWest = leafletBounds.getSouthWest()\n const northEast = leafletBounds.getNorthEast()\n\n return {\n mapCenter: this._map.leaflet.getCenter(),\n zoomLevel: this._map.leaflet.getZoom(),\n bounds: { southWest, northEast },\n userDriven: !this._eventInitiatedByComponent,\n }\n }\n\n private _onMapDragLeaflet (): void {\n this._cancelBackgroundClick = true\n }\n\n private _onMapMove (): void {\n const { config } = this\n if (!this._map) return\n this._hasBeenMoved = true\n this._renderDataAnimationFrameId = requestAnimationFrame(() => {\n this._renderData(true)\n })\n config.onMapMoveZoom?.(this._getMapZoomState())\n }\n\n private _onMapMoveStart (): void {\n const { config } = this\n if (!this._map) return\n this._isMoving = true\n config.onMapMoveStart?.(this._getMapZoomState())\n }\n\n private _onMapMoveEnd (): void {\n const { config } = this\n if (!this._map) return\n this._onMapMoveEndInternal?.(this._map.leaflet)\n config.onMapMoveEnd?.(this._getMapZoomState())\n\n constraintMapViewThrottled(this._map.leaflet)\n const events = this._map.layer.getEvents()\n\n if (events.zoomend) {\n const zoomEndEvent = events.zoomend.bind(this._map.layer)\n zoomEndEvent(null)\n }\n\n if (this._externallySelectedPoint || this._zoomingToExternallySelectedPoint) {\n this._zoomToExternallySelectedPoint()\n }\n\n this._isMoving = false\n this._eventInitiatedByComponent = false\n }\n\n private _onMapZoomStart (): void {\n const { config } = this\n if (!this._map) return\n this._isZooming = true\n config.onMapZoomStart?.(this._getMapZoomState())\n }\n\n private _onMapZoomEnd (): void {\n const { config } = this\n if (!this._map) return\n config.onMapZoomEnd?.(this._getMapZoomState())\n this._isZooming = false\n if (!this._isMoving) this._eventInitiatedByComponent = false\n }\n\n private _onMapZoom (): void {\n const { config } = this\n if (!this._map) return\n this._hasBeenZoomed = true\n\n if (!this._externallySelectedPoint) this._resetExpandedCluster()\n else if (!this._zoomingToExternallySelectedPoint) {\n this._externallySelectedPoint = null\n }\n\n config.tooltip?.hide()\n config.onMapMoveZoom?.(this._getMapZoomState())\n }\n\n private _onBackgroundClick (el: HTMLElement, event: MouseEvent): void {\n const { config } = this\n\n if (this._cancelBackgroundClick) {\n this._cancelBackgroundClick = false\n return\n }\n\n this._externallySelectedPoint = null\n this._resetExpandedCluster()\n this._renderData()\n config.onMapClick?.(this._getMapZoomState())\n }\n\n private _onPointClick (d: LeafletMapPoint<Datum>, event: MouseEvent): void {\n const { config: { flyToDuration, clusterExpandOnClick } } = this\n this._externallySelectedPoint = null\n event.stopPropagation()\n\n if ((d.properties as LeafletMapClusterDatum<Datum>).cluster) {\n const zoomLevel = this._map.leaflet.getZoom()\n const coordinates = { lng: d.geometry.coordinates[0], lat: d.geometry.coordinates[1] }\n\n if (clusterExpandOnClick && shouldClusterExpand(d, zoomLevel)) this._expandCluster(d)\n else {\n const newZoomLevel = getNextZoomLevelOnClusterClick(zoomLevel)\n this._eventInitiatedByComponent = true\n this._map.leaflet.flyTo(coordinates, newZoomLevel, { duration: flyToDuration / 1000 })\n }\n }\n }\n\n private _onPointMouseDown (d: LeafletMapPoint<Datum>, event: MouseEvent): void {\n this._cancelBackgroundClick = true\n }\n\n private _onPointMouseUp (d: LeafletMapPoint<Datum>, event: MouseEvent): void {\n this._cancelBackgroundClick = false\n }\n\n public zoomIn (increment = 1): void {\n if (!this._map?.leaflet) return\n this.setZoom(this._map.leaflet.getZoom() + increment)\n }\n\n public zoomOut (increment = 1): void {\n if (!this._map?.leaflet) return\n this.setZoom(this._map.leaflet.getZoom() - increment)\n }\n\n public setZoom (zoomLevel: number): void {\n const leaflet = this._map?.leaflet\n if (!leaflet) return\n\n this._eventInitiatedByComponent = true\n leaflet.flyTo(\n leaflet.getCenter(),\n clamp(zoomLevel, leaflet.getMinZoom(), leaflet.getMaxZoom()),\n { duration: this.config.zoomDuration / 1000 }\n )\n }\n\n public fitView (): void {\n this.fitToPoints()\n }\n\n public destroy (): void {\n constraintMapViewThrottled.cancel()\n cancelAnimationFrame(this._renderDataAnimationFrameId)\n cancelAnimationFrame(this._flyToBoundsAnimationFrameId)\n const map = this._map?.leaflet\n this._map = undefined\n\n map?.stop()\n map?.remove()\n this.g.remove()\n this.resizeObserver.disconnect()\n this.themeObserver?.disconnect()\n }\n}\n"],"names":["s.root","map","s.map","s.svgOverlay","s.backgroundRect","s.points","s.clusterBackground","s.pointSelectionRing","s.point","s","s.variables"],"mappings":";;;;;;;;;;;;;;;;;;AAyDM,MAAO,UAA4C,SAAQ,aAAwD,CAAA;AAyDvH,IAAA,WAAA,CAAa,SAAsB,EAAE,MAAyC,EAAE,IAAc,EAAA;AAC5F,QAAA,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;QAvDjB,IAAc,CAAA,cAAA,GAAG,uBAA2D,CAAA;AAC/E,QAAA,IAAA,CAAA,MAAM,GAAqC,IAAI,CAAC,cAAc,CAAA;AAGrE,QAAA,IAAA,CAAA,IAAI,GAAG,aAAa,CAAC,IAAI,CAAA;AAEzB,QAAA,IAAA,CAAA,SAAS,GAAwB,IAAI,YAAY,EAAE,CAAA;QAY3C,IAAgB,CAAA,gBAAA,GAAuG,IAAI,CAAA;QAC3H,IAAsB,CAAA,sBAAA,GAAG,KAAK,CAAA;QAC9B,IAAa,CAAA,aAAA,GAAG,KAAK,CAAA;QACrB,IAAc,CAAA,cAAA,GAAG,KAAK,CAAA;QACtB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAA;QACjB,IAAU,CAAA,UAAA,GAAG,KAAK,CAAA;QAClB,IAA0B,CAAA,0BAAA,GAAG,KAAK,CAAA;QAClC,IAAuB,CAAA,uBAAA,GAAG,KAAK,CAAA;QAC/B,IAAwB,CAAA,wBAAA,GAAwD,IAAI,CAAA;QACpF,IAAiC,CAAA,iCAAA,GAAG,KAAK,CAAA;QACzC,IAAmB,CAAA,mBAAA,GAAG,KAAK,CAAA;QAI3B,IAAwB,CAAA,wBAAA,GAAG,CAAC,CAAA;QAC5B,IAAc,CAAA,cAAA,GAA2B,IAAI,CAAA;QAC7C,IAAiB,CAAA,iBAAA,GAAkB,IAAI,CAAA;QACvC,IAAY,CAAA,YAAA,GAAG,IAAI,CAAA;QACnB,IAAkB,CAAA,kBAAA,GAAG,KAAK,C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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
|
+
{"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;AAuDhJ,IAAA,WAAA,CAAa,SAAsB,EAAE,MAAyC,EAAE,IAAc,EAAA;AAC5F,QAAA,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;AApD3B,QAAA,IAAA,CAAA,IAAI,GAAG,aAAa,CAAC,IAAI,CAAA;AAEzB,QAAA,IAAA,CAAA,MAAM,GAA4B,IAAI,gBAAgB,EAAE,CAAA;AACxD,QAAA,IAAA,CAAA,SAAS,GAAwB,IAAI,YAAY,EAAE,CAAA;QAY3C,IAAgB,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Map } from 'maplibre-gl';
|
|
4
4
|
import { GenericDataRecord } from "../../../types/data";
|
|
5
|
-
import {
|
|
5
|
+
import { LeafletMapConfig } from '../config';
|
|
6
6
|
export declare const initialMapCenter: L.LatLngExpression;
|
|
7
7
|
export declare const initialMapZoom = 1.9;
|
|
8
|
-
export declare function updateTopoJson<T extends GenericDataRecord>(maplibreMap: Map, config:
|
|
9
|
-
export declare function setupMap<T extends GenericDataRecord>(mapContainer: HTMLElement, config:
|
|
8
|
+
export declare function updateTopoJson<T extends GenericDataRecord>(maplibreMap: Map, config: LeafletMapConfig<T>): void;
|
|
9
|
+
export declare function setupMap<T extends GenericDataRecord>(mapContainer: HTMLElement, config: LeafletMapConfig<T>): Promise<{
|
|
10
10
|
leaflet: L.Map;
|
|
11
11
|
layer: L.Layer;
|
|
12
12
|
svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sources":["../../../../src/components/leaflet-map/modules/map.ts"],"sourcesContent":["import type L from 'leaflet'\nimport { select, Selection } from 'd3-selection'\nimport { GeoJSONSource, Map } from 'maplibre-gl'\nimport { feature } from 'topojson-client'\n\n// Types\nimport { GenericDataRecord } from 'types/data'\n\n// Config\nimport { LeafletMapConfigInterface } from '../config'\n\n// Local Types\n\n// Utils\nimport { constraintMapView, mapboxglWheelEventThrottled } from '../renderer/mapboxgl-utils'\n\n// Styles\nimport * as s from '../style'\nimport { LeafletMapRenderer } from '../types'\n\nexport const initialMapCenter: L.LatLngExpression = [36, 14]\nexport const initialMapZoom = 1.9\n\nexport function updateTopoJson<T extends GenericDataRecord> (maplibreMap: Map, config: LeafletMapConfigInterface<T>): void {\n const { topoJSONLayer } = config\n\n if (topoJSONLayer.sources) {\n const featureObject = topoJSONLayer.sources?.objects?.[topoJSONLayer.featureName]\n if (featureObject) {\n const mapSource = maplibreMap.getSource(topoJSONLayer.featureName) as GeoJSONSource\n const featureCollection = feature(topoJSONLayer.sources, featureObject)\n if (mapSource) {\n mapSource.setData(featureCollection)\n } else {\n maplibreMap.addSource(topoJSONLayer.featureName, { type: 'geojson', data: featureCollection })\n }\n }\n }\n\n const fillLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-area`)\n if (topoJSONLayer.fillProperty) {\n if (!fillLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-area`,\n type: 'fill',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-antialias': false,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'fill-opacity': topoJSONLayer.fillOpacity,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-area`, 'fill-color', [\n 'case',\n ['!', ['has', topoJSONLayer.fillProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.fillProperty],\n ])\n } else if (fillLayer) maplibreMap.removeLayer(`${topoJSONLayer.featureName}-area`)\n\n const strokeLayer = maplibreMap.getLayer(`${topoJSONLayer.featureName}-stroke`)\n if (topoJSONLayer.strokeProperty) {\n if (!strokeLayer) {\n maplibreMap.addLayer({\n id: `${topoJSONLayer.featureName}-stroke`,\n type: 'line',\n source: topoJSONLayer.featureName,\n paint: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-opacity': topoJSONLayer.strokeOpacity,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n 'line-width': topoJSONLayer.strokeWidth,\n },\n })\n }\n maplibreMap.setPaintProperty(`${topoJSONLayer.featureName}-stroke`, 'line-color', [\n 'case',\n ['!', ['has', topoJSONLayer.strokeProperty]],\n 'rgba(255, 255, 255, 0)',\n ['get', topoJSONLayer.strokeProperty],\n ])\n } else if (strokeLayer) { maplibreMap.removeLayer(`${topoJSONLayer.featureName}-stroke`) }\n}\n\nexport async function setupMap<T extends GenericDataRecord> (mapContainer: HTMLElement, config: LeafletMapConfigInterface<T>): Promise<{\n leaflet: L.Map;\n layer: L.Layer;\n svgOverlay: Selection<SVGSVGElement, unknown, null, undefined>;\n svgGroup: Selection<SVGGElement, unknown, SVGElement, undefined>;\n}> {\n const { style, renderer, topoJSONLayer } = config\n const leaflet = await import('leaflet')\n const L = leaflet.default\n\n if (!style) {\n console.error('Unovis | Leaflet Map: Please provide style settings in the map configuration object')\n return\n }\n\n const leafletMap = L.map(mapContainer, {\n scrollWheelZoom: renderer === LeafletMapRenderer.Raster, // We define custom scroll event for MapboxGL to enabling smooth zooming\n zoomControl: false,\n zoomDelta: renderer === LeafletMapRenderer.Raster ? 1 : 0.5,\n zoomSnap: renderer === LeafletMapRenderer.Raster ? 1 : 0,\n attributionControl: true,\n center: initialMapCenter,\n zoom: initialMapZoom,\n minZoom: Math.sqrt(mapContainer.offsetWidth) / 17,\n maxZoom: 23,\n maxBounds: L.latLngBounds(\n [-75, -290],\n [85, 290]\n ),\n maxBoundsViscosity: 1,\n })\n\n for (const attr of config.attribution) {\n leafletMap.attributionControl.addAttribution(attr)\n }\n\n let layer: L.Layer\n let maplibreMap = null\n\n switch (renderer) {\n case LeafletMapRenderer.MapLibre:\n // eslint-disable-next-line no-case-declarations\n const maplibre = await import('maplibre-gl')\n // eslint-disable-next-line no-case-declarations\n const { getMaplibreGLLayer } = await import('../renderer/mapboxgl-layer')\n layer = getMaplibreGLLayer(config, L, maplibre.default)\n maplibreMap = (layer as ReturnType<typeof getMaplibreGLLayer>).getMaplibreMap?.()\n break\n case LeafletMapRenderer.Raster:\n layer = L.tileLayer(style as string)\n break\n }\n layer.addTo(leafletMap)\n\n // leaflet-mapbox-gl has a layer positioning issue on far zoom levels which leads to having wrong\n // map points projection. We constraint the view to prevent that.\n constraintMapView(leafletMap)\n select(mapContainer).on('wheel', (event: WheelEvent) => {\n event.preventDefault()\n mapboxglWheelEventThrottled(leafletMap, layer, event)\n })\n\n if (maplibreMap && topoJSONLayer?.sources) {\n const canvas = maplibreMap.getCanvas()\n const canvasSelection = select(canvas).classed(s.mapboxglCanvas, true)\n const tilePaneSelection = select(leafletMap.getPanes().tilePane)\n\n maplibreMap.on('mousemove', (event) => {\n const layerName = `${topoJSONLayer.featureName}-area`\n const layer = maplibreMap.getLayer(layerName)\n if (!layer) return\n\n const features = maplibreMap.queryRenderedFeatures(event.point, { layers: [layerName] })\n tilePaneSelection.datum(features[0])\n canvasSelection.classed(s.onFeatureHover, Boolean(features[0]))\n })\n\n maplibreMap.on('load', () => {\n updateTopoJson(maplibreMap, config)\n })\n }\n\n const svgOverlay = select(leafletMap.getPanes().overlayPane).append('svg')\n const svgGroup = svgOverlay.append('g')\n\n return {\n leaflet: leafletMap,\n layer,\n svgOverlay,\n svgGroup,\n }\n}\n"],"names":["s.mapboxglCanvas","s.onFeatureHover"],"mappings":";;;;;;;MAoBa,gBAAgB,GAAuB,CAAC,EAAE,EAAE,EAAE,EAAC;AACrD,MAAM,cAAc,GAAG,IAAG;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,QAAA,IAAI,aAAa,EAAE;YACjB,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,WAAW,CAAkB,CAAA;YACnF,MAAM,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;AACvE,YAAA,IAAI,SAAS,EAAE;AACb,gBAAA,SAAS,CAAC,OAAO,CAAC,iBAAi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C,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 { 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,CAAC,aAAa,CAAC,WAAW,CAAkB,CAAA;YACnF,MAAM,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;AACvE,YAAA,IAAI,SAAS,EAAE;AACb,gBAAA,SAAS,CAAC,OAAO,CAAC,iBAAiB,CAAC,C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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;;;;"}
|
|
@@ -3,7 +3,7 @@ import Supercluster, { ClusterFeature, PointFeature } from 'supercluster';
|
|
|
3
3
|
import { NumericAccessor, StringAccessor } from "../../../types/accessor";
|
|
4
4
|
import { GenericDataRecord } from "../../../types/data";
|
|
5
5
|
import { LeafletMapPoint, LeafletMapPointShape, LeafletMapPieDatum, LeafletMapPointStyles, PointExpandedClusterProperties, LeafletMapPointDatum, LeafletMapClusterDatum } from '../types';
|
|
6
|
-
import {
|
|
6
|
+
import { LeafletMapConfig } from '../config';
|
|
7
7
|
export declare function bBoxMerge(bBoxArray: ({
|
|
8
8
|
x1: number;
|
|
9
9
|
x2: number;
|
|
@@ -20,20 +20,20 @@ export declare function projectPoint<D extends GenericDataRecord>(geoJSONPoint:
|
|
|
20
20
|
x: number;
|
|
21
21
|
y: number;
|
|
22
22
|
};
|
|
23
|
-
export declare function getPointRadius<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>, pointRadius: NumericAccessor<
|
|
23
|
+
export declare function getPointRadius<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>> | PointFeature<PointExpandedClusterProperties<D>>, pointRadius: NumericAccessor<D>, zoomLevel: number): number;
|
|
24
24
|
export declare function getPointPos<D extends GenericDataRecord>(point: LeafletMapPoint<D> | ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, leafletMap: L.Map): {
|
|
25
25
|
x: number;
|
|
26
26
|
y: number;
|
|
27
27
|
};
|
|
28
28
|
export declare function getPointDisplayOrder<D extends GenericDataRecord>(d: LeafletMapPoint<D>, pointStatus: StringAccessor<LeafletMapPointDatum<D> | LeafletMapClusterDatum<D>>, colorMap: LeafletMapPointStyles<D>): number;
|
|
29
29
|
export declare function toGeoJSONPoint<D extends GenericDataRecord>(d: D, i: number, pointLatitude: NumericAccessor<D>, pointLongitude: NumericAccessor<D>): PointFeature<D>;
|
|
30
|
-
export declare function calculateClusterIndex<D extends GenericDataRecord>(data: D[], config:
|
|
30
|
+
export declare function calculateClusterIndex<D extends GenericDataRecord>(data: D[], config: LeafletMapConfig<D>, maxClusterZoomLevel?: number): Supercluster<D>;
|
|
31
31
|
export declare function getNodePathData({ x, y }: {
|
|
32
32
|
x: number;
|
|
33
33
|
y: number;
|
|
34
34
|
}, radius: number, shape: LeafletMapPointShape): string;
|
|
35
35
|
export declare function getDonutData<D extends GenericDataRecord>(d: LeafletMapClusterDatum<D> | LeafletMapPointDatum<D>, colorMap: LeafletMapPointStyles<D>): LeafletMapPieDatum[];
|
|
36
|
-
export declare function geoJsonPointToScreenPoint<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, i: number, leafletMap: L.Map, config:
|
|
36
|
+
export declare function geoJsonPointToScreenPoint<D extends GenericDataRecord>(geoPoint: ClusterFeature<LeafletMapClusterDatum<D>> | PointFeature<LeafletMapPointDatum<D>>, i: number, leafletMap: L.Map, config: LeafletMapConfig<D>): LeafletMapPoint<D>;
|
|
37
37
|
export declare function shouldClusterExpand<D extends GenericDataRecord>(cluster: LeafletMapPoint<D>, zoomLevel: number, midLevel?: number, maxLevel?: number, maxClusterZoomLevel?: number): boolean;
|
|
38
38
|
export declare function findPointAndClusterByPointId<D extends GenericDataRecord>(points: LeafletMapPoint<D>[], id: string, pointId: StringAccessor<D>): {
|
|
39
39
|
point: PointFeature<D> | undefined;
|
|
@@ -39,10 +39,7 @@ function projectPoint(geoJSONPoint, leafletMap) {
|
|
|
39
39
|
}
|
|
40
40
|
function getPointRadius(geoPoint, pointRadius, zoomLevel) {
|
|
41
41
|
const isDynamic = !pointRadius;
|
|
42
|
-
const radius = isDynamic
|
|
43
|
-
? 1 + 2 * Math.pow(zoomLevel, 0.80)
|
|
44
|
-
// Todo: Needs a better typings handling
|
|
45
|
-
: getNumber(geoPoint.properties, pointRadius);
|
|
42
|
+
const radius = isDynamic ? 1 + 2 * Math.pow(zoomLevel, 0.80) : getNumber(geoPoint.properties, pointRadius);
|
|
46
43
|
const isCluster = geoPoint.properties.cluster;
|
|
47
44
|
return (isCluster && isDynamic)
|
|
48
45
|
? clamp(Math.pow(geoPoint.properties.point_count, 0.35) * radius, radius * 1.1, radius * 3)
|
|
@@ -130,8 +127,7 @@ function geoJsonPointToScreenPoint(geoPoint, i, leafletMap, config) {
|
|
|
130
127
|
const clusterPoints = isCluster ? clusterIndex.getLeaves(geoPoint.properties.cluster_id, Infinity).map(d => d.properties) : undefined;
|
|
131
128
|
const { x, y } = getPointPos(geoPoint, leafletMap);
|
|
132
129
|
const id = isCluster ? `cluster-${geoPoint.id}` : ((_a = getString(geoPoint.properties, config.pointId)) !== null && _a !== void 0 ? _a : geoPoint.geometry.coordinates.join(''));
|
|
133
|
-
|
|
134
|
-
const pointColor = getColor(geoPoint.properties, (isCluster ? config.clusterColor : config.pointColor));
|
|
130
|
+
const pointColor = getColor(geoPoint.properties, isCluster ? config.clusterColor : config.pointColor);
|
|
135
131
|
const radius = getPointRadius(geoPoint, isCluster ? config.clusterRadius : config.pointRadius, zoomLevel);
|
|
136
132
|
const shape = isCluster ? LeafletMapPointShape.Circle : getString(geoPoint.properties, config.pointShape);
|
|
137
133
|
const isRing = shape === LeafletMapPointShape.Ring;
|