@dynatrace/strato-geo 3.5.2 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/map/MapView.js +42 -34
- package/esm/map/MapView.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js +2 -0
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayer.js +14 -3
- package/esm/map/components/BubbleLayer/BubbleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js +9 -3
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js.map +2 -2
- package/esm/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.js +5 -5
- package/esm/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js +15 -7
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js +9 -3
- package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethOutlineLayer.js +3 -1
- package/esm/map/components/ChoroplethLayer/ChoroplethOutlineLayer.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js +6 -5
- package/esm/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js +11 -6
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js +3 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js +16 -12
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js.map +2 -2
- package/esm/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js +20 -18
- package/esm/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayer.js +12 -3
- package/esm/map/components/DotLayer/DotLayer.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayerTooltip.js +9 -3
- package/esm/map/components/DotLayer/DotLayerTooltip.js.map +2 -2
- package/esm/map/components/DotLayer/utils/parse-dot-data-to-geo-json.js +5 -5
- package/esm/map/components/DotLayer/utils/parse-dot-data-to-geo-json.js.map +2 -2
- package/esm/map/components/MapContent.js +22 -12
- package/esm/map/components/MapContent.js.map +2 -2
- package/esm/map/contexts/geo-data-lookup.context.js +8 -0
- package/esm/map/contexts/geo-data-lookup.context.js.map +7 -0
- package/esm/map/contexts/map-view-provider.context.js +9 -0
- package/esm/map/contexts/map-view-provider.context.js.map +7 -0
- package/esm/map/hooks/use-active-interaction.js +59 -43
- package/esm/map/hooks/use-active-interaction.js.map +2 -2
- package/esm/map/hooks/use-attach-image-from-icon.js +4 -2
- package/esm/map/hooks/use-attach-image-from-icon.js.map +2 -2
- package/esm/map/hooks/use-hover-interaction.js +59 -41
- package/esm/map/hooks/use-hover-interaction.js.map +2 -2
- package/esm/map/hooks/use-layer-before-id.js +24 -0
- package/esm/map/hooks/use-layer-before-id.js.map +7 -0
- package/esm/map/hooks/use-load-map-base-layer.js +13 -3
- package/esm/map/hooks/use-load-map-base-layer.js.map +2 -2
- package/esm/map/hooks/use-map-runtime-error.js +93 -0
- package/esm/map/hooks/use-map-runtime-error.js.map +7 -0
- package/esm/map/hooks/use-map-view-provider-context.js +7 -0
- package/esm/map/hooks/use-map-view-provider-context.js.map +7 -0
- package/esm/map/hooks/use-overlay-events.js +11 -2
- package/esm/map/hooks/use-overlay-events.js.map +2 -2
- package/esm/map/hooks/use-tooltip-template.js +17 -2
- package/esm/map/hooks/use-tooltip-template.js.map +2 -2
- package/esm/map/hooks/use-webgl-context-error.js +2 -1
- package/esm/map/hooks/use-webgl-context-error.js.map +2 -2
- package/esm/map/index.js +2 -0
- package/esm/map/index.js.map +2 -2
- package/esm/map/providers/map-view.provider.js +18 -0
- package/esm/map/providers/map-view.provider.js.map +7 -0
- package/esm/map/slots/Tooltip.js.map +2 -2
- package/esm/map/types/map-view-provider.js +1 -0
- package/esm/map/types/map-view-provider.js.map +7 -0
- package/esm/map/utils/attach-image-from-shape.js +4 -2
- package/esm/map/utils/attach-image-from-shape.js.map +2 -2
- package/esm/map/utils/extract-layers-data.js +24 -15
- package/esm/map/utils/extract-layers-data.js.map +2 -2
- package/esm/map/utils/fetch-base-layer-features.js +1 -1
- package/esm/map/utils/fetch-base-layer-features.js.map +2 -2
- package/esm/map/utils/is-browser-firefox.js +7 -0
- package/esm/map/utils/is-browser-firefox.js.map +7 -0
- package/esm/map/utils/parse-tooltip-data.js +22 -7
- package/esm/map/utils/parse-tooltip-data.js.map +2 -2
- package/map/MapView.js +42 -34
- package/map/components/BubbleLayer/BubbleCircleLayer.d.ts +2 -1
- package/map/components/BubbleLayer/BubbleCircleLayer.js +2 -0
- package/map/components/BubbleLayer/BubbleLayer.js +14 -3
- package/map/components/BubbleLayer/BubbleLayerTooltip.d.ts +2 -0
- package/map/components/BubbleLayer/BubbleLayerTooltip.js +9 -3
- package/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.d.ts +3 -1
- package/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.js +5 -5
- package/map/components/ChoroplethLayer/ChoroplethLayer.js +15 -7
- package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.d.ts +2 -0
- package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js +9 -3
- package/map/components/ChoroplethLayer/ChoroplethOutlineLayer.d.ts +1 -0
- package/map/components/ChoroplethLayer/ChoroplethOutlineLayer.js +3 -1
- package/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.d.ts +3 -1
- package/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js +6 -5
- package/map/components/ConnectionLayer/ConnectionLayer.js +11 -6
- package/map/components/ConnectionLayer/ConnectionLayerLine.js +3 -0
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.d.ts +2 -0
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.js +16 -12
- package/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.d.ts +3 -1
- package/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js +20 -18
- package/map/components/DotLayer/DotLayer.js +12 -3
- package/map/components/DotLayer/DotLayerTooltip.d.ts +2 -0
- package/map/components/DotLayer/DotLayerTooltip.js +9 -3
- package/map/components/DotLayer/utils/parse-dot-data-to-geo-json.d.ts +3 -1
- package/map/components/DotLayer/utils/parse-dot-data-to-geo-json.js +5 -5
- package/map/components/MapContent.js +21 -12
- package/map/contexts/geo-data-lookup.context.d.ts +9 -0
- package/map/contexts/geo-data-lookup.context.js +27 -0
- package/map/contexts/map-view-provider.context.d.ts +2 -0
- package/map/{components/ConnectionLayer/utils/restore-null-props.js → contexts/map-view-provider.context.js} +8 -8
- package/map/hooks/use-active-interaction.d.ts +8 -1
- package/map/hooks/use-active-interaction.js +58 -42
- package/map/hooks/use-attach-image-from-icon.js +4 -2
- package/map/hooks/use-hover-interaction.d.ts +6 -2
- package/map/hooks/use-hover-interaction.js +52 -39
- package/map/hooks/use-layer-before-id.d.ts +13 -0
- package/map/hooks/{use-map-mouse-move.js → use-layer-before-id.js} +20 -15
- package/map/hooks/use-load-map-base-layer.js +13 -3
- package/map/hooks/use-map-runtime-error.d.ts +34 -0
- package/map/hooks/use-map-runtime-error.js +112 -0
- package/map/hooks/use-map-view-provider-context.d.ts +1 -0
- package/map/hooks/use-map-view-provider-context.js +26 -0
- package/map/hooks/use-overlay-events.js +11 -2
- package/map/hooks/use-tooltip-template.d.ts +8 -0
- package/map/hooks/use-tooltip-template.js +17 -2
- package/map/hooks/use-webgl-context-error.js +2 -1
- package/map/index.d.ts +2 -0
- package/map/index.js +2 -0
- package/map/providers/map-view.provider.d.ts +7 -0
- package/map/providers/map-view.provider.js +37 -0
- package/map/slots/Tooltip.d.ts +2 -0
- package/map/types/connection-layer.d.ts +1 -8
- package/map/types/map-view-provider.d.ts +10 -0
- package/map/types/map-view-provider.js +16 -0
- package/map/types/tooltip.d.ts +17 -0
- package/map/utils/attach-image-from-shape.js +4 -2
- package/map/utils/extract-layers-data.d.ts +2 -0
- package/map/utils/extract-layers-data.js +24 -15
- package/map/utils/fetch-base-layer-features.js +1 -1
- package/map/utils/is-browser-firefox.d.ts +5 -0
- package/map/utils/is-browser-firefox.js +26 -0
- package/map/utils/parse-tooltip-data.d.ts +11 -3
- package/map/utils/parse-tooltip-data.js +22 -7
- package/package.json +2 -2
- package/esm/map/components/ConnectionLayer/utils/restore-null-props.js +0 -9
- package/esm/map/components/ConnectionLayer/utils/restore-null-props.js.map +0 -7
- package/esm/map/hooks/use-map-mouse-move.js +0 -19
- package/esm/map/hooks/use-map-mouse-move.js.map +0 -7
- package/map/components/ConnectionLayer/utils/restore-null-props.d.ts +0 -2
- package/map/hooks/use-map-mouse-move.d.ts +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-load-map-base-layer.ts"],
|
|
4
|
-
"sourcesContent": ["import { FeatureCollection } from 'geojson';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport type { BaseLayerRules } from '../types/base-layer.js';\nimport { applyFeatureFilterRules } from '../utils/apply-feature-filter-rules.js';\nimport {\n getCountryRegionsRules,\n getRegionsRules,\n getWorldViewRules,\n} from '../utils/base-layer-rules.js';\nimport {\n fetchCountryFeatures,\n fetchWorldViewFeatures,\n} from '../utils/fetch-base-layer-features.js';\nimport { fetchClientConfigMapEnabled } from '../utils/fetch-client-config-map-enabled.js';\nimport { getBaseLayerShapesRequestConfig } from '../utils/get-base-layer-shapes-request-config.js';\nimport { getTenantCountryCode } from '../utils/get-tenant-country-code.js';\nimport { mergeFeatureCollections } from '../utils/merge-feature-collections.js';\n\nexport const useLoadMapBaseLayer = (baseLayerConfig: BaseLayerRules) => {\n const [isFetchingFeatures, setIsFetchingFeatures] = useState(true);\n const [isMapEnabled, setIsMapEnabled] = useState(false);\n const [baseFeatureCollection, setBaseFeatureCollection] = useState<\n FeatureCollection | undefined\n >(undefined);\n const [error, setError] = useState<boolean>(false);\n\n const getData = useCallback(async () => {\n setIsFetchingFeatures(true);\n\n const isMapEnabledResponse
|
|
5
|
-
"mappings": "AACA,SAAS,aAAa,WAAW,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import { FeatureCollection } from 'geojson';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { useMapViewProviderContext } from './use-map-view-provider-context.js';\nimport type { BaseLayerRules } from '../types/base-layer.js';\nimport { applyFeatureFilterRules } from '../utils/apply-feature-filter-rules.js';\nimport {\n getCountryRegionsRules,\n getRegionsRules,\n getWorldViewRules,\n} from '../utils/base-layer-rules.js';\nimport {\n fetchCountryFeatures,\n fetchWorldViewFeatures,\n} from '../utils/fetch-base-layer-features.js';\nimport { fetchClientConfigMapEnabled } from '../utils/fetch-client-config-map-enabled.js';\nimport { getBaseLayerShapesRequestConfig } from '../utils/get-base-layer-shapes-request-config.js';\nimport { getTenantCountryCode } from '../utils/get-tenant-country-code.js';\nimport { mergeFeatureCollections } from '../utils/merge-feature-collections.js';\n\nexport const useLoadMapBaseLayer = (baseLayerConfig: BaseLayerRules) => {\n const [isFetchingFeatures, setIsFetchingFeatures] = useState(true);\n const [isMapEnabled, setIsMapEnabled] = useState(false);\n const [baseFeatureCollection, setBaseFeatureCollection] = useState<\n FeatureCollection | undefined\n >(undefined);\n const [error, setError] = useState<boolean>(false);\n\n const {\n countryCode: providerCountryCode,\n displayWorldMap: providerDisplayWorldMap,\n } = useMapViewProviderContext();\n\n const getData = useCallback(async () => {\n setIsFetchingFeatures(true);\n\n const isMapEnabledResponse =\n providerDisplayWorldMap ?? (await fetchClientConfigMapEnabled());\n\n setIsMapEnabled(isMapEnabledResponse);\n\n try {\n if (isMapEnabledResponse) {\n const tenantCountryCode =\n providerCountryCode ?? (await getTenantCountryCode());\n\n const { includeWorldView, countryRegions } =\n getBaseLayerShapesRequestConfig(baseLayerConfig.include);\n\n const featuresRequests: Promise<FeatureCollection>[] = [];\n\n if (includeWorldView) {\n const worldViewRules = getWorldViewRules(baseLayerConfig);\n const worldViewRequest = fetchWorldViewFeatures(\n tenantCountryCode,\n ).then(applyFeatureFilterRules(worldViewRules));\n featuresRequests.push(worldViewRequest);\n }\n\n if (countryRegions.length > 0) {\n const regionsRules = getRegionsRules(baseLayerConfig);\n countryRegions.forEach((countryCode: string) => {\n const countryRules = getCountryRegionsRules(\n regionsRules,\n countryCode,\n );\n const countryRequest = fetchCountryFeatures(\n tenantCountryCode,\n countryCode,\n ).then(applyFeatureFilterRules(countryRules, countryCode));\n featuresRequests.push(countryRequest);\n });\n }\n\n const featureCollections = await Promise.all(featuresRequests);\n\n setBaseFeatureCollection(mergeFeatureCollections(featureCollections));\n }\n } catch {\n setError(true);\n }\n\n setIsFetchingFeatures(false);\n }, [\n baseLayerConfig.include,\n baseLayerConfig.exclude,\n providerCountryCode,\n providerDisplayWorldMap,\n ]);\n\n useEffect(() => {\n getData();\n }, [getData]);\n return { isFetchingFeatures, baseFeatureCollection, isMapEnabled, error };\n};\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,aAAa,WAAW,gBAAgB;AAEjD,SAAS,iCAAiC;AAE1C,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,mCAAmC;AAC5C,SAAS,uCAAuC;AAChD,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AAEjC,MAAM,sBAAsB,CAAC,oBAAoC;AACtE,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAAS,IAAI;AACjE,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AACtD,QAAM,CAAC,uBAAuB,wBAAwB,IAAI,SAExD,MAAS;AACX,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAkB,KAAK;AAEjD,QAAM;AAAA,IACJ,aAAa;AAAA,IACb,iBAAiB;AAAA,EACnB,IAAI,0BAA0B;AAE9B,QAAM,UAAU,YAAY,YAAY;AACtC,0BAAsB,IAAI;AAE1B,UAAM,uBACJ,2BAA4B,MAAM,4BAA4B;AAEhE,oBAAgB,oBAAoB;AAEpC,QAAI;AACF,UAAI,sBAAsB;AACxB,cAAM,oBACJ,uBAAwB,MAAM,qBAAqB;AAErD,cAAM,EAAE,kBAAkB,eAAe,IACvC,gCAAgC,gBAAgB,OAAO;AAEzD,cAAM,mBAAiD,CAAC;AAExD,YAAI,kBAAkB;AACpB,gBAAM,iBAAiB,kBAAkB,eAAe;AACxD,gBAAM,mBAAmB;AAAA,YACvB;AAAA,UACF,EAAE,KAAK,wBAAwB,cAAc,CAAC;AAC9C,2BAAiB,KAAK,gBAAgB;AAAA,QACxC;AAEA,YAAI,eAAe,SAAS,GAAG;AAC7B,gBAAM,eAAe,gBAAgB,eAAe;AACpD,yBAAe,QAAQ,CAAC,gBAAwB;AAC9C,kBAAM,eAAe;AAAA,cACnB;AAAA,cACA;AAAA,YACF;AACA,kBAAM,iBAAiB;AAAA,cACrB;AAAA,cACA;AAAA,YACF,EAAE,KAAK,wBAAwB,cAAc,WAAW,CAAC;AACzD,6BAAiB,KAAK,cAAc;AAAA,UACtC,CAAC;AAAA,QACH;AAEA,cAAM,qBAAqB,MAAM,QAAQ,IAAI,gBAAgB;AAE7D,iCAAyB,wBAAwB,kBAAkB,CAAC;AAAA,MACtE;AAAA,IACF,QAAQ;AACN,eAAS,IAAI;AAAA,IACf;AAEA,0BAAsB,KAAK;AAAA,EAC7B,GAAG;AAAA,IACD,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,EACF,CAAC;AAED,YAAU,MAAM;AACd,YAAQ;AAAA,EACV,GAAG,CAAC,OAAO,CAAC;AACZ,SAAO,EAAE,oBAAoB,uBAAuB,cAAc,MAAM;AAC1E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { useMap } from "@vis.gl/react-maplibre";
|
|
2
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
3
|
+
import { useWebGLContextError } from "./use-webgl-context-error.js";
|
|
4
|
+
const MAX_RETRIES = 3;
|
|
5
|
+
const ERROR_DEBOUNCE_MS = 500;
|
|
6
|
+
const MAPLIBRE_RUNTIME_ERROR_PATTERNS = [
|
|
7
|
+
"Could not compile fragment shader",
|
|
8
|
+
"Could not compile vertex shader",
|
|
9
|
+
"Program failed to link",
|
|
10
|
+
"feature index out of bounds",
|
|
11
|
+
"Out of bounds. Index requested"
|
|
12
|
+
];
|
|
13
|
+
const isMaplibreRuntimeError = (message) => MAPLIBRE_RUNTIME_ERROR_PATTERNS.some((pattern) => message.includes(pattern));
|
|
14
|
+
const useMapRuntimeError = ({
|
|
15
|
+
onError,
|
|
16
|
+
onRetry
|
|
17
|
+
}) => {
|
|
18
|
+
const { current: mapRef } = useMap();
|
|
19
|
+
const retryCountRef = useRef(0);
|
|
20
|
+
const lastErrorTimeRef = useRef(0);
|
|
21
|
+
const isMapActiveRef = useRef(true);
|
|
22
|
+
const onErrorRef = useRef(onError);
|
|
23
|
+
onErrorRef.current = onError;
|
|
24
|
+
const onRetryRef = useRef(onRetry);
|
|
25
|
+
onRetryRef.current = onRetry;
|
|
26
|
+
const handleError = useCallback(() => {
|
|
27
|
+
const now = Date.now();
|
|
28
|
+
if (now - lastErrorTimeRef.current < ERROR_DEBOUNCE_MS) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
lastErrorTimeRef.current = now;
|
|
32
|
+
retryCountRef.current += 1;
|
|
33
|
+
if (retryCountRef.current >= MAX_RETRIES) {
|
|
34
|
+
onErrorRef.current();
|
|
35
|
+
} else {
|
|
36
|
+
onRetryRef.current?.(retryCountRef.current);
|
|
37
|
+
}
|
|
38
|
+
}, []);
|
|
39
|
+
useWebGLContextError(handleError);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const map = mapRef?.getMap();
|
|
42
|
+
if (!map) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const handleMapError = ({ error }) => {
|
|
46
|
+
if (isMaplibreRuntimeError(error.message)) {
|
|
47
|
+
handleError();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
map.on("error", handleMapError);
|
|
51
|
+
return () => {
|
|
52
|
+
map.off("error", handleMapError);
|
|
53
|
+
};
|
|
54
|
+
}, [mapRef, handleError]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const handleWindowError = (event) => {
|
|
57
|
+
if (!isMapActiveRef.current) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (isMaplibreRuntimeError(event.message)) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
handleError();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
window.addEventListener("error", handleWindowError);
|
|
66
|
+
return () => {
|
|
67
|
+
window.removeEventListener("error", handleWindowError);
|
|
68
|
+
};
|
|
69
|
+
}, [handleError]);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
const map = mapRef?.getMap();
|
|
72
|
+
if (!map) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const handleRender = () => {
|
|
76
|
+
isMapActiveRef.current = true;
|
|
77
|
+
};
|
|
78
|
+
const handleIdle = () => {
|
|
79
|
+
isMapActiveRef.current = false;
|
|
80
|
+
retryCountRef.current = 0;
|
|
81
|
+
};
|
|
82
|
+
map.on("render", handleRender);
|
|
83
|
+
map.on("idle", handleIdle);
|
|
84
|
+
return () => {
|
|
85
|
+
map.off("render", handleRender);
|
|
86
|
+
map.off("idle", handleIdle);
|
|
87
|
+
};
|
|
88
|
+
}, [mapRef]);
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
useMapRuntimeError
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=use-map-runtime-error.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-map-runtime-error.ts"],
|
|
4
|
+
"sourcesContent": ["import { useMap } from '@vis.gl/react-maplibre';\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport { useWebGLContextError } from './use-webgl-context-error.js';\n\nconst MAX_RETRIES = 3;\n\n/** Prevents a burst of identical errors from exhausting the retry budget in one frame. */\nconst ERROR_DEBOUNCE_MS = 500;\n\n/**\n * Patterns that identify errors thrown from the maplibre-gl internal render\n * pipeline (shader compilation, program linking, vector-tile feature decoding).\n * These originate from rAF callbacks or from maplibre's own error event and\n * are not caused by consumer code.\n *\n * APPDEV-17938\n */\nconst MAPLIBRE_RUNTIME_ERROR_PATTERNS: readonly string[] = [\n 'Could not compile fragment shader',\n 'Could not compile vertex shader',\n 'Program failed to link',\n 'feature index out of bounds',\n 'Out of bounds. Index requested',\n];\n\nconst isMaplibreRuntimeError = (message: string): boolean =>\n MAPLIBRE_RUNTIME_ERROR_PATTERNS.some((pattern) => message.includes(pattern));\n\nexport interface UseMapRuntimeErrorOptions {\n /**\n * Called when the retry budget (3 attempts) is exhausted and the map cannot\n * recover. Throwing inside this callback will propagate to the nearest React\n * ErrorBoundary, showing the fallback UI.\n */\n onError: () => void;\n /**\n * Optional callback invoked on each recoverable error attempt before the\n * budget is exhausted. The `attempt` argument is 1-indexed.\n */\n onRetry?: (attempt: number) => void;\n}\n\n/**\n * Unified hook that guards MapView against maplibre-gl runtime errors from\n * three distinct sources:\n *\n * 1. **WebGL context loss** (`webglcontextlost` on the canvas) \u2014 composed via\n * `useWebGLContextError`.\n * 2. **maplibre's own error events** (`map.on('error', ...)`), covering tile\n * load failures and other internally dispatched errors.\n * 3. **Synchronous throws from the rAF render loop** that escape to\n * `window.onerror` \u2014 shader compilation, program link, and feature-index\n * out-of-bounds errors that maplibre does not catch internally.\n *\n * A shared retry counter (max 3) is maintained across all sources. Error\n * counting is debounced at 500 ms so that a burst of errors within a single\n * render frame counts as one occurrence. The counter resets whenever the map\n * fires an `idle` event (indicating a successful render). Once the budget is\n * exhausted, `onError` is invoked.\n *\n * APPDEV-17938\n */\nexport const useMapRuntimeError = ({\n onError,\n onRetry,\n}: UseMapRuntimeErrorOptions) => {\n const { current: mapRef } = useMap();\n const retryCountRef = useRef(0);\n const lastErrorTimeRef = useRef(0);\n // Tracks whether this map instance is actively rendering. Without this guard,\n // all mounted <MapView> instances would increment on a single window error\n // event. Initialised to true so early errors (before first idle) are caught.\n const isMapActiveRef = useRef(true);\n\n const onErrorRef = useRef(onError);\n onErrorRef.current = onError;\n const onRetryRef = useRef(onRetry);\n onRetryRef.current = onRetry;\n\n const handleError = useCallback(() => {\n const now = Date.now();\n\n if (now - lastErrorTimeRef.current < ERROR_DEBOUNCE_MS) {\n return;\n }\n\n lastErrorTimeRef.current = now;\n retryCountRef.current += 1;\n\n if (retryCountRef.current >= MAX_RETRIES) {\n onErrorRef.current();\n } else {\n onRetryRef.current?.(retryCountRef.current);\n }\n }, []);\n\n useWebGLContextError(handleError);\n\n useEffect(() => {\n const map = mapRef?.getMap();\n if (!map) {\n return;\n }\n\n const handleMapError = ({ error }: { error: Error }) => {\n if (isMaplibreRuntimeError(error.message)) {\n handleError();\n }\n };\n\n map.on('error', handleMapError);\n return () => {\n map.off('error', handleMapError);\n };\n }, [mapRef, handleError]);\n\n // rAF render-loop throws escape to window because they run outside React's\n // render cycle and are not caught by component-level error boundaries.\n useEffect(() => {\n const handleWindowError = (event: ErrorEvent) => {\n if (!isMapActiveRef.current) {\n return;\n }\n if (isMaplibreRuntimeError(event.message)) {\n // Stops the red console overlay in dev and top-level error boundaries.\n event.preventDefault();\n handleError();\n }\n };\n\n window.addEventListener('error', handleWindowError);\n return () => {\n window.removeEventListener('error', handleWindowError);\n };\n }, [handleError]);\n\n useEffect(() => {\n const map = mapRef?.getMap();\n if (!map) {\n return;\n }\n\n const handleRender = () => {\n isMapActiveRef.current = true;\n };\n\n const handleIdle = () => {\n isMapActiveRef.current = false;\n retryCountRef.current = 0;\n };\n\n map.on('render', handleRender);\n map.on('idle', handleIdle);\n return () => {\n map.off('render', handleRender);\n map.off('idle', handleIdle);\n };\n }, [mapRef]);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,aAAa,WAAW,cAAc;AAE/C,SAAS,4BAA4B;AAErC,MAAM,cAAc;AAGpB,MAAM,oBAAoB;AAU1B,MAAM,kCAAqD;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,yBAAyB,CAAC,YAC9B,gCAAgC,KAAK,CAAC,YAAY,QAAQ,SAAS,OAAO,CAAC;AAoCtE,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AACF,MAAiC;AAC/B,QAAM,EAAE,SAAS,OAAO,IAAI,OAAO;AACnC,QAAM,gBAAgB,OAAO,CAAC;AAC9B,QAAM,mBAAmB,OAAO,CAAC;AAIjC,QAAM,iBAAiB,OAAO,IAAI;AAElC,QAAM,aAAa,OAAO,OAAO;AACjC,aAAW,UAAU;AACrB,QAAM,aAAa,OAAO,OAAO;AACjC,aAAW,UAAU;AAErB,QAAM,cAAc,YAAY,MAAM;AACpC,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,MAAM,iBAAiB,UAAU,mBAAmB;AACtD;AAAA,IACF;AAEA,qBAAiB,UAAU;AAC3B,kBAAc,WAAW;AAEzB,QAAI,cAAc,WAAW,aAAa;AACxC,iBAAW,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,UAAU,cAAc,OAAO;AAAA,IAC5C;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,uBAAqB,WAAW;AAEhC,YAAU,MAAM;AACd,UAAM,MAAM,QAAQ,OAAO;AAC3B,QAAI,CAAC,KAAK;AACR;AAAA,IACF;AAEA,UAAM,iBAAiB,CAAC,EAAE,MAAM,MAAwB;AACtD,UAAI,uBAAuB,MAAM,OAAO,GAAG;AACzC,oBAAY;AAAA,MACd;AAAA,IACF;AAEA,QAAI,GAAG,SAAS,cAAc;AAC9B,WAAO,MAAM;AACX,UAAI,IAAI,SAAS,cAAc;AAAA,IACjC;AAAA,EACF,GAAG,CAAC,QAAQ,WAAW,CAAC;AAIxB,YAAU,MAAM;AACd,UAAM,oBAAoB,CAAC,UAAsB;AAC/C,UAAI,CAAC,eAAe,SAAS;AAC3B;AAAA,MACF;AACA,UAAI,uBAAuB,MAAM,OAAO,GAAG;AAEzC,cAAM,eAAe;AACrB,oBAAY;AAAA,MACd;AAAA,IACF;AAEA,WAAO,iBAAiB,SAAS,iBAAiB;AAClD,WAAO,MAAM;AACX,aAAO,oBAAoB,SAAS,iBAAiB;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAEhB,YAAU,MAAM;AACd,UAAM,MAAM,QAAQ,OAAO;AAC3B,QAAI,CAAC,KAAK;AACR;AAAA,IACF;AAEA,UAAM,eAAe,MAAM;AACzB,qBAAe,UAAU;AAAA,IAC3B;AAEA,UAAM,aAAa,MAAM;AACvB,qBAAe,UAAU;AACzB,oBAAc,UAAU;AAAA,IAC1B;AAEA,QAAI,GAAG,UAAU,YAAY;AAC7B,QAAI,GAAG,QAAQ,UAAU;AACzB,WAAO,MAAM;AACX,UAAI,IAAI,UAAU,YAAY;AAC9B,UAAI,IAAI,QAAQ,UAAU;AAAA,IAC5B;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AACb;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { MapViewProviderContext } from "../contexts/map-view-provider.context.js";
|
|
3
|
+
const useMapViewProviderContext = () => useContext(MapViewProviderContext);
|
|
4
|
+
export {
|
|
5
|
+
useMapViewProviderContext
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=use-map-view-provider-context.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/hooks/use-map-view-provider-context.ts"],
|
|
4
|
+
"sourcesContent": ["import { useContext } from 'react';\n\nimport { MapViewProviderContext } from '../contexts/map-view-provider.context.js';\n\nexport const useMapViewProviderContext = () =>\n useContext(MapViewProviderContext);\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAE3B,SAAS,8BAA8B;AAEhC,MAAM,4BAA4B,MACvC,WAAW,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
1
2
|
import {
|
|
2
3
|
_useOverlayTooltipReducer as useTooltipReducer,
|
|
3
4
|
_useOverlayTooltipStore as useOverlayTooltipStore,
|
|
4
5
|
_useOverlayChart as useOverlayChart
|
|
5
6
|
} from "@dynatrace/strato-components/charts";
|
|
7
|
+
import { GeoDataLookupContext } from "../contexts/geo-data-lookup.context.js";
|
|
6
8
|
import { useSetStateOverlay, useSetState } from "../store/store.js";
|
|
7
9
|
import { buildGeoTooltipState } from "../utils/build-geo-tooltip-state.js";
|
|
8
10
|
import { extractDataFromEvent } from "../utils/parse-tooltip-data.js";
|
|
@@ -19,6 +21,7 @@ const layerIdToGeometry = (layerId) => {
|
|
|
19
21
|
return "geoDot";
|
|
20
22
|
};
|
|
21
23
|
const useOverlayEvents = () => {
|
|
24
|
+
const dataLookupRegistry = useContext(GeoDataLookupContext);
|
|
22
25
|
const setOverlayState = useSetStateOverlay();
|
|
23
26
|
const setState = useSetState();
|
|
24
27
|
const dispatch = useTooltipReducer();
|
|
@@ -53,7 +56,10 @@ const useOverlayEvents = () => {
|
|
|
53
56
|
if (currentState.pinned) {
|
|
54
57
|
return;
|
|
55
58
|
}
|
|
56
|
-
const { data, hoveredLayerId } = extractDataFromEvent(
|
|
59
|
+
const { data, hoveredLayerId } = extractDataFromEvent(
|
|
60
|
+
event,
|
|
61
|
+
dataLookupRegistry
|
|
62
|
+
);
|
|
57
63
|
overlay.clear();
|
|
58
64
|
setTooltipMarker(hoveredLayerId, event.lngLat);
|
|
59
65
|
const pos = getAbsolutePosition(event);
|
|
@@ -83,7 +89,10 @@ const useOverlayEvents = () => {
|
|
|
83
89
|
}
|
|
84
90
|
};
|
|
85
91
|
const handleMouseClick = (event) => {
|
|
86
|
-
const { data, featureId, hoveredLayerId } = extractDataFromEvent(
|
|
92
|
+
const { data, featureId, hoveredLayerId } = extractDataFromEvent(
|
|
93
|
+
event,
|
|
94
|
+
dataLookupRegistry
|
|
95
|
+
);
|
|
87
96
|
if (!featureId) {
|
|
88
97
|
hideTooltip();
|
|
89
98
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-overlay-events.ts"],
|
|
4
|
-
"sourcesContent": ["import type { MapLayerMouseEvent } from 'maplibre-gl';\n\nimport {\n _useOverlayTooltipReducer as useTooltipReducer,\n _useOverlayTooltipStore as useOverlayTooltipStore,\n _useOverlayChart as useOverlayChart,\n type _OverlayTooltipGeometryTypes as GeometryTypes,\n} from '@dynatrace/strato-components/charts';\n\nimport { useSetStateOverlay, useSetState } from '../store/store.js';\nimport { buildGeoTooltipState } from '../utils/build-geo-tooltip-state.js';\nimport { extractDataFromEvent } from '../utils/parse-tooltip-data.js';\n\nconst layerIdToGeometry = (layerId: string | undefined): GeometryTypes => {\n if (layerId?.includes('bubble')) {\n return 'geoBubble';\n }\n if (layerId?.includes('choropleth')) {\n return 'geoChoropleth';\n }\n if (layerId?.includes('connection')) {\n return 'geoConnection';\n }\n return 'geoDot';\n};\n\nexport const useOverlayEvents = () => {\n const setOverlayState = useSetStateOverlay();\n const setState = useSetState();\n const dispatch = useTooltipReducer();\n const store = useOverlayTooltipStore();\n const overlay = useOverlayChart();\n\n const getAbsolutePosition = (event: MapLayerMouseEvent) => {\n return {\n x: Math.round(event.originalEvent.clientX),\n y: Math.round(event.originalEvent.clientY),\n };\n };\n\n const setTooltipMarker = (\n hoveredLayerId: string | undefined,\n location: { lng: number; lat: number } | undefined,\n ) => {\n setState((prev) => ({\n ...prev,\n tooltip: {\n ...prev.tooltip,\n hoveredLayerId,\n location: location as typeof prev.tooltip.location,\n },\n }));\n };\n\n const hideTooltip = () => {\n dispatch({ type: 'RESET_TOOLTIP' })();\n setTooltipMarker(undefined, undefined);\n };\n\n const handleMouseEnter = () => {\n setOverlayState({ mouseInBounds: true });\n };\n\n const handleMouseMove = (event: MapLayerMouseEvent) => {\n if (event.features?.length) {\n const currentState = store.getState();\n\n if (currentState.pinned) {\n return;\n }\n\n const { data, hoveredLayerId } = extractDataFromEvent(event);\n\n overlay.clear();\n\n setTooltipMarker(hoveredLayerId, event.lngLat);\n\n const pos = getAbsolutePosition(event);\n store.setState(\n buildGeoTooltipState({\n absoluteX: pos.x,\n absoluteY: pos.y,\n relativeX: Math.round(event.point.x),\n relativeY: Math.round(event.point.y),\n pinned: false,\n geometry: layerIdToGeometry(hoveredLayerId),\n metadata: data,\n }),\n );\n } else {\n const currentState = store.getState();\n if (!currentState.pinned) {\n hideTooltip();\n }\n }\n };\n\n const handleMouseLeave = () => {\n setOverlayState({ mouseInBounds: false });\n const currentState = store.getState();\n if (!currentState.pinned) {\n hideTooltip();\n }\n };\n\n const handleMouseClick = (event: MapLayerMouseEvent) => {\n const { data, featureId, hoveredLayerId } = extractDataFromEvent(event);\n\n if (!featureId) {\n hideTooltip();\n return;\n }\n\n if (!hoveredLayerId) {\n hideTooltip();\n return;\n }\n\n overlay.clear();\n\n setTooltipMarker(hoveredLayerId, event.lngLat);\n\n const pos = getAbsolutePosition(event);\n store.setState(\n buildGeoTooltipState({\n absoluteX: pos.x,\n absoluteY: pos.y,\n relativeX: Math.round(event.point.x),\n relativeY: Math.round(event.point.y),\n pinned: true,\n geometry: layerIdToGeometry(hoveredLayerId),\n metadata: data,\n }),\n );\n };\n\n const hideTooltipIfNotPinned = () => {\n const currentState = store.getState();\n if (!currentState.pinned) {\n hideTooltip();\n }\n };\n\n return {\n handleMouseEnter,\n handleMouseMove,\n handleMouseLeave,\n handleMouseClick,\n handleZoom: hideTooltipIfNotPinned,\n handleDrag: hideTooltipIfNotPinned,\n };\n};\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { MapLayerMouseEvent } from 'maplibre-gl';\nimport { useContext } from 'react';\n\nimport {\n _useOverlayTooltipReducer as useTooltipReducer,\n _useOverlayTooltipStore as useOverlayTooltipStore,\n _useOverlayChart as useOverlayChart,\n type _OverlayTooltipGeometryTypes as GeometryTypes,\n} from '@dynatrace/strato-components/charts';\n\nimport { GeoDataLookupContext } from '../contexts/geo-data-lookup.context.js';\nimport { useSetStateOverlay, useSetState } from '../store/store.js';\nimport { buildGeoTooltipState } from '../utils/build-geo-tooltip-state.js';\nimport { extractDataFromEvent } from '../utils/parse-tooltip-data.js';\n\nconst layerIdToGeometry = (layerId: string | undefined): GeometryTypes => {\n if (layerId?.includes('bubble')) {\n return 'geoBubble';\n }\n if (layerId?.includes('choropleth')) {\n return 'geoChoropleth';\n }\n if (layerId?.includes('connection')) {\n return 'geoConnection';\n }\n return 'geoDot';\n};\n\nexport const useOverlayEvents = () => {\n const dataLookupRegistry = useContext(GeoDataLookupContext);\n const setOverlayState = useSetStateOverlay();\n const setState = useSetState();\n const dispatch = useTooltipReducer();\n const store = useOverlayTooltipStore();\n const overlay = useOverlayChart();\n\n const getAbsolutePosition = (event: MapLayerMouseEvent) => {\n return {\n x: Math.round(event.originalEvent.clientX),\n y: Math.round(event.originalEvent.clientY),\n };\n };\n\n const setTooltipMarker = (\n hoveredLayerId: string | undefined,\n location: { lng: number; lat: number } | undefined,\n ) => {\n setState((prev) => ({\n ...prev,\n tooltip: {\n ...prev.tooltip,\n hoveredLayerId,\n location: location as typeof prev.tooltip.location,\n },\n }));\n };\n\n const hideTooltip = () => {\n dispatch({ type: 'RESET_TOOLTIP' })();\n setTooltipMarker(undefined, undefined);\n };\n\n const handleMouseEnter = () => {\n setOverlayState({ mouseInBounds: true });\n };\n\n const handleMouseMove = (event: MapLayerMouseEvent) => {\n if (event.features?.length) {\n const currentState = store.getState();\n\n if (currentState.pinned) {\n return;\n }\n\n const { data, hoveredLayerId } = extractDataFromEvent(\n event,\n dataLookupRegistry,\n );\n\n overlay.clear();\n\n setTooltipMarker(hoveredLayerId, event.lngLat);\n\n const pos = getAbsolutePosition(event);\n store.setState(\n buildGeoTooltipState({\n absoluteX: pos.x,\n absoluteY: pos.y,\n relativeX: Math.round(event.point.x),\n relativeY: Math.round(event.point.y),\n pinned: false,\n geometry: layerIdToGeometry(hoveredLayerId),\n metadata: data,\n }),\n );\n } else {\n const currentState = store.getState();\n if (!currentState.pinned) {\n hideTooltip();\n }\n }\n };\n\n const handleMouseLeave = () => {\n setOverlayState({ mouseInBounds: false });\n const currentState = store.getState();\n if (!currentState.pinned) {\n hideTooltip();\n }\n };\n\n const handleMouseClick = (event: MapLayerMouseEvent) => {\n const { data, featureId, hoveredLayerId } = extractDataFromEvent(\n event,\n dataLookupRegistry,\n );\n\n if (!featureId) {\n hideTooltip();\n return;\n }\n\n if (!hoveredLayerId) {\n hideTooltip();\n return;\n }\n\n overlay.clear();\n\n setTooltipMarker(hoveredLayerId, event.lngLat);\n\n const pos = getAbsolutePosition(event);\n store.setState(\n buildGeoTooltipState({\n absoluteX: pos.x,\n absoluteY: pos.y,\n relativeX: Math.round(event.point.x),\n relativeY: Math.round(event.point.y),\n pinned: true,\n geometry: layerIdToGeometry(hoveredLayerId),\n metadata: data,\n }),\n );\n };\n\n const hideTooltipIfNotPinned = () => {\n const currentState = store.getState();\n if (!currentState.pinned) {\n hideTooltip();\n }\n };\n\n return {\n handleMouseEnter,\n handleMouseMove,\n handleMouseLeave,\n handleMouseClick,\n handleZoom: hideTooltipIfNotPinned,\n handleDrag: hideTooltipIfNotPinned,\n };\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -20,10 +20,18 @@ const createDefaultHandlerWithActions = (seriesActions) => {
|
|
|
20
20
|
return handler;
|
|
21
21
|
};
|
|
22
22
|
const isDefaultTooltipHandler = (handler) => handler.__isDefault ?? false;
|
|
23
|
-
function useTooltipTemplate(children, layerType) {
|
|
23
|
+
function useTooltipTemplate(children, layerType, options) {
|
|
24
24
|
let template = void 0;
|
|
25
|
+
let hidden = void 0;
|
|
26
|
+
let symbolAlignment = void 0;
|
|
25
27
|
Children.forEach(children, (child) => {
|
|
26
28
|
if (isValidElement(child) && child.type === layerType) {
|
|
29
|
+
hidden = child.props.hidden;
|
|
30
|
+
symbolAlignment = child.props.symbolAlignment;
|
|
31
|
+
if (child.props.hidden) {
|
|
32
|
+
template = void 0;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
27
35
|
if (isNil(child.props.children)) {
|
|
28
36
|
template = child.props.seriesActions ? createDefaultHandlerWithActions(child.props.seriesActions) : defaultTooltipHandler;
|
|
29
37
|
} else {
|
|
@@ -31,7 +39,14 @@ function useTooltipTemplate(children, layerType) {
|
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
});
|
|
34
|
-
|
|
42
|
+
if (options?.extractProps) {
|
|
43
|
+
return {
|
|
44
|
+
handler: hidden ? void 0 : template ?? defaultTooltipHandler,
|
|
45
|
+
hidden,
|
|
46
|
+
symbolAlignment
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return hidden ? void 0 : template ?? defaultTooltipHandler;
|
|
35
50
|
}
|
|
36
51
|
export {
|
|
37
52
|
defaultTooltipHandler,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-tooltip-template.tsx"],
|
|
4
|
-
"sourcesContent": ["import { isNil } from 'lodash-es';\nimport {\n Children,\n type ReactNode,\n type JSXElementConstructor,\n isValidElement,\n} from 'react';\n\nimport type { SeriesActionsTemplate } from '@dynatrace/strato-components/charts';\n\nimport { DefaultTooltip } from '../components/DefaultTooltip/DefaultTooltip.js';\nimport type { Location } from '../types/location.js';\nimport type {\n ChoroplethLayerTooltipData,\n LayerTooltipData,\n LayerTooltipHandler,\n} from '../types/tooltip.js';\n\nexport const defaultTooltipHandler: LayerTooltipHandler = (\n closestPoint: LayerTooltipData,\n layerData?: LayerTooltipData[],\n) => <DefaultTooltip closestPoint={closestPoint} layerData={layerData} />;\n\n(defaultTooltipHandler as { __isDefault?: boolean }).__isDefault = true;\n\nconst createDefaultHandlerWithActions = (\n seriesActions: (\n data: Location | ChoroplethLayerTooltipData,\n ) => SeriesActionsTemplate,\n): LayerTooltipHandler => {\n const handler: LayerTooltipHandler = (\n closestPoint: LayerTooltipData,\n layerData?: LayerTooltipData[],\n ) => (\n <DefaultTooltip\n closestPoint={closestPoint}\n layerData={layerData}\n seriesActions={seriesActions}\n />\n );\n (handler as { __isDefault?: boolean }).__isDefault = true;\n return handler;\n};\n\nexport const isDefaultTooltipHandler = (\n handler: LayerTooltipHandler,\n): boolean => (handler as { __isDefault?: boolean }).__isDefault ?? false;\n\n/**\n * It returns the tooltip template handler or undefined (tooltip disabled).\n *\n * - No tooltip slot found (undefined) \u2192 default tooltip handler.\n * - Tooltip slot with `null` children \u2192 `null` (tooltip disabled).\n * - Tooltip slot with `undefined` children \u2192 default tooltip handler.\n * - Tooltip slot with a custom handler \u2192 that handler.\n * @param children -\n * @param layerType -\n */\nexport function useTooltipTemplate<T>(\n children: ReactNode | undefined,\n layerType: string | JSXElementConstructor<T>,\n): LayerTooltipHandler | undefined {\n let template: LayerTooltipHandler | undefined = undefined;\n\n Children.forEach(children, (child) => {\n if (\n isValidElement<{\n children: LayerTooltipHandler;\n seriesActions?: (\n data: Location | ChoroplethLayerTooltipData,\n ) => SeriesActionsTemplate;\n }>(child) &&\n child.type === layerType\n ) {\n if (isNil(child.props.children)) {\n template = child.props.seriesActions\n ? createDefaultHandlerWithActions(child.props.seriesActions)\n : defaultTooltipHandler;\n } else {\n template = child.props.children;\n }\n }\n });\n\n return template;\n}\n"],
|
|
5
|
-
"mappings": "AAqBK;AArBL,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EAGA;AAAA,OACK;AAIP,SAAS,sBAAsB;AAQxB,MAAM,wBAA6C,CACxD,cACA,cACG,oBAAC,kBAAe,cAA4B,WAAsB;AAEtE,sBAAoD,cAAc;AAEnE,MAAM,kCAAkC,CACtC,kBAGwB;AACxB,QAAM,UAA+B,CACnC,cACA,cAEA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEF,EAAC,QAAsC,cAAc;AACrD,SAAO;AACT;AAEO,MAAM,0BAA0B,CACrC,YACa,QAAsC,eAAe;
|
|
4
|
+
"sourcesContent": ["import { isNil } from 'lodash-es';\nimport {\n Children,\n type ReactNode,\n type JSXElementConstructor,\n isValidElement,\n} from 'react';\n\nimport type { SeriesActionsTemplate } from '@dynatrace/strato-components/charts';\n\nimport { DefaultTooltip } from '../components/DefaultTooltip/DefaultTooltip.js';\nimport type { Location } from '../types/location.js';\nimport type {\n ChoroplethLayerTooltipData,\n LayerTooltipData,\n LayerTooltipHandler,\n} from '../types/tooltip.js';\n\nexport const defaultTooltipHandler: LayerTooltipHandler = (\n closestPoint: LayerTooltipData,\n layerData?: LayerTooltipData[],\n) => <DefaultTooltip closestPoint={closestPoint} layerData={layerData} />;\n\n(defaultTooltipHandler as { __isDefault?: boolean }).__isDefault = true;\n\nconst createDefaultHandlerWithActions = (\n seriesActions: (\n data: Location | ChoroplethLayerTooltipData,\n ) => SeriesActionsTemplate,\n): LayerTooltipHandler => {\n const handler: LayerTooltipHandler = (\n closestPoint: LayerTooltipData,\n layerData?: LayerTooltipData[],\n ) => (\n <DefaultTooltip\n closestPoint={closestPoint}\n layerData={layerData}\n seriesActions={seriesActions}\n />\n );\n (handler as { __isDefault?: boolean }).__isDefault = true;\n return handler;\n};\n\nexport const isDefaultTooltipHandler = (\n handler: LayerTooltipHandler,\n): boolean => (handler as { __isDefault?: boolean }).__isDefault ?? false;\n\n/**\n * It returns the tooltip template handler or undefined (tooltip disabled).\n *\n * - No tooltip slot found (undefined) \u2192 default tooltip handler.\n * - Tooltip slot with `null` children \u2192 `null` (tooltip disabled).\n * - Tooltip slot with `undefined` children \u2192 default tooltip handler.\n * - Tooltip slot with a custom handler \u2192 that handler.\n * @param children -\n * @param layerType -\n */\nexport interface TooltipTemplateResult {\n handler: LayerTooltipHandler | undefined;\n hidden?: boolean;\n symbolAlignment?: 'left' | 'right';\n}\n\nexport function useTooltipTemplate<T>(\n children: ReactNode | undefined,\n layerType: string | JSXElementConstructor<T>,\n): LayerTooltipHandler | undefined;\nexport function useTooltipTemplate<T>(\n children: ReactNode | undefined,\n layerType: string | JSXElementConstructor<T>,\n options: { extractProps: true },\n): TooltipTemplateResult;\nexport function useTooltipTemplate<T>(\n children: ReactNode | undefined,\n layerType: string | JSXElementConstructor<T>,\n options?: { extractProps: true },\n): LayerTooltipHandler | undefined | TooltipTemplateResult {\n let template: LayerTooltipHandler | undefined = undefined;\n let hidden: boolean | undefined = undefined;\n let symbolAlignment: 'left' | 'right' | undefined = undefined;\n\n Children.forEach(children, (child) => {\n if (\n isValidElement<{\n children: LayerTooltipHandler;\n seriesActions?: (\n data: Location | ChoroplethLayerTooltipData,\n ) => SeriesActionsTemplate;\n hidden?: boolean;\n symbolAlignment?: 'left' | 'right';\n }>(child) &&\n child.type === layerType\n ) {\n hidden = child.props.hidden;\n symbolAlignment = child.props.symbolAlignment;\n\n if (child.props.hidden) {\n template = undefined;\n return;\n }\n if (isNil(child.props.children)) {\n template = child.props.seriesActions\n ? createDefaultHandlerWithActions(child.props.seriesActions)\n : defaultTooltipHandler;\n } else {\n template = child.props.children;\n }\n }\n });\n\n if (options?.extractProps) {\n return {\n handler: hidden ? undefined : template ?? defaultTooltipHandler,\n hidden,\n symbolAlignment,\n };\n }\n\n return hidden ? undefined : template ?? defaultTooltipHandler;\n}\n"],
|
|
5
|
+
"mappings": "AAqBK;AArBL,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EAGA;AAAA,OACK;AAIP,SAAS,sBAAsB;AAQxB,MAAM,wBAA6C,CACxD,cACA,cACG,oBAAC,kBAAe,cAA4B,WAAsB;AAEtE,sBAAoD,cAAc;AAEnE,MAAM,kCAAkC,CACtC,kBAGwB;AACxB,QAAM,UAA+B,CACnC,cACA,cAEA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEF,EAAC,QAAsC,cAAc;AACrD,SAAO;AACT;AAEO,MAAM,0BAA0B,CACrC,YACa,QAAsC,eAAe;AA2B7D,SAAS,mBACd,UACA,WACA,SACyD;AACzD,MAAI,WAA4C;AAChD,MAAI,SAA8B;AAClC,MAAI,kBAAgD;AAEpD,WAAS,QAAQ,UAAU,CAAC,UAAU;AACpC,QACE,eAOG,KAAK,KACR,MAAM,SAAS,WACf;AACA,eAAS,MAAM,MAAM;AACrB,wBAAkB,MAAM,MAAM;AAE9B,UAAI,MAAM,MAAM,QAAQ;AACtB,mBAAW;AACX;AAAA,MACF;AACA,UAAI,MAAM,MAAM,MAAM,QAAQ,GAAG;AAC/B,mBAAW,MAAM,MAAM,gBACnB,gCAAgC,MAAM,MAAM,aAAa,IACzD;AAAA,MACN,OAAO;AACL,mBAAW,MAAM,MAAM;AAAA,MACzB;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,SAAS,cAAc;AACzB,WAAO;AAAA,MACL,SAAS,SAAS,SAAY,YAAY;AAAA,MAC1C;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO,SAAS,SAAY,YAAY;AAC1C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,7 +7,8 @@ const useWebGLContextError = (onContextLost) => {
|
|
|
7
7
|
if (!canvas) {
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
|
-
const handleContextLost = () => {
|
|
10
|
+
const handleContextLost = (event) => {
|
|
11
|
+
event.preventDefault();
|
|
11
12
|
onContextLost?.();
|
|
12
13
|
};
|
|
13
14
|
canvas.addEventListener("webglcontextlost", handleContextLost);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/hooks/use-webgl-context-error.ts"],
|
|
4
|
-
"sourcesContent": ["import { useMap } from '@vis.gl/react-maplibre';\nimport { useEffect } from 'react';\n\n/**\n * Hook to detect WebGL context loss events.\n * Browsers have a limit of active WebGL canvas contexts.\n */\nexport const useWebGLContextError = (onContextLost?: () => void) => {\n const { current: mapRef } = useMap();\n\n useEffect(() => {\n const canvas = mapRef?.getMap()?.getCanvas();\n if (!canvas) {\n return;\n }\n\n const handleContextLost = () => {\n onContextLost?.();\n };\n\n canvas.addEventListener('webglcontextlost', handleContextLost);\n\n return () => {\n canvas.removeEventListener('webglcontextlost', handleContextLost);\n };\n }, [mapRef, onContextLost]);\n};\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAMnB,MAAM,uBAAuB,CAAC,kBAA+B;AAClE,QAAM,EAAE,SAAS,OAAO,IAAI,OAAO;AAEnC,YAAU,MAAM;AACd,UAAM,SAAS,QAAQ,OAAO,GAAG,UAAU;AAC3C,QAAI,CAAC,QAAQ;AACX;AAAA,IACF;AAEA,UAAM,oBAAoB,
|
|
4
|
+
"sourcesContent": ["import { useMap } from '@vis.gl/react-maplibre';\nimport { useEffect } from 'react';\n\n/**\n * Hook to detect WebGL context loss events.\n * Browsers have a limit of active WebGL canvas contexts.\n */\nexport const useWebGLContextError = (onContextLost?: () => void) => {\n const { current: mapRef } = useMap();\n\n useEffect(() => {\n const canvas = mapRef?.getMap()?.getCanvas();\n if (!canvas) {\n return;\n }\n\n const handleContextLost = (event: Event) => {\n // Prevent the browser default so it will attempt to restore the context\n // via a subsequent `webglcontextrestored` event.\n event.preventDefault();\n onContextLost?.();\n };\n\n canvas.addEventListener('webglcontextlost', handleContextLost);\n\n return () => {\n canvas.removeEventListener('webglcontextlost', handleContextLost);\n };\n }, [mapRef, onContextLost]);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAMnB,MAAM,uBAAuB,CAAC,kBAA+B;AAClE,QAAM,EAAE,SAAS,OAAO,IAAI,OAAO;AAEnC,YAAU,MAAM;AACd,UAAM,SAAS,QAAQ,OAAO,GAAG,UAAU;AAC3C,QAAI,CAAC,QAAQ;AACX;AAAA,IACF;AAEA,UAAM,oBAAoB,CAAC,UAAiB;AAG1C,YAAM,eAAe;AACrB,sBAAgB;AAAA,IAClB;AAEA,WAAO,iBAAiB,oBAAoB,iBAAiB;AAE7D,WAAO,MAAM;AACX,aAAO,oBAAoB,oBAAoB,iBAAiB;AAAA,IAClE;AAAA,EACF,GAAG,CAAC,QAAQ,aAAa,CAAC;AAC5B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/esm/map/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { SequentialLegend } from "./slots/SequentialLegend.js";
|
|
|
11
11
|
import { ThresholdLegend } from "./slots/ThresholdLegend.js";
|
|
12
12
|
import { CategoricalLegend } from "./slots/CategoricalLegend.js";
|
|
13
13
|
import { getAllCountries } from "./utils/get-all-countries.js";
|
|
14
|
+
import { MapViewProvider } from "./providers/map-view.provider.js";
|
|
14
15
|
export {
|
|
15
16
|
BaseLayer,
|
|
16
17
|
BubbleLayer,
|
|
@@ -21,6 +22,7 @@ export {
|
|
|
21
22
|
DotLayer,
|
|
22
23
|
DownloadCSV,
|
|
23
24
|
MapView,
|
|
25
|
+
MapViewProvider,
|
|
24
26
|
SequentialLegend,
|
|
25
27
|
ThresholdLegend,
|
|
26
28
|
Tooltip,
|
package/esm/map/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/map/index.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable
|
|
5
|
-
"mappings": "AACA,SAAS,yBAAyB;AAClC,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,SAAS,oBAAoB;AACtC,SAAS,mBAAmB;AA2D5B,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAkBlC,SAAS,uBAAuB;",
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-deprecated -- DEPRECATION: [APPDEV-17834] Re-exports of legacy geo Tooltip API. BREAKING-CHANGE: migrate to ChartTooltip before next major. */\nexport { ChartInteractions } from './slots/ChartInteractions.js';\nexport { MapView } from './MapView.js';\nexport { ConnectionLayer } from './slots/ConnectionLayer.js';\nexport { DotLayer } from './slots/DotLayer.js';\nexport { BubbleLayer } from './slots/BubbleLayer.js';\nexport { BaseLayer } from './slots/BaseLayer.js';\nexport { ChoroplethLayer } from './slots/ChoroplethLayer.js';\nexport { Tooltip, TooltipAtoms } from './slots/Tooltip.js';\nexport { DownloadCSV } from './slots/DownloadCSV.js';\n\nexport type {\n MapViewProps,\n MapViewBaseProps,\n MapViewUncontrolledProps,\n MapViewControlledProps,\n DisallowAll,\n ViewState,\n MapViewRef,\n} from './types/map-view.js';\n\nexport type { BaseLayerProps } from './types/base-layer.js';\n\nexport type { MapViewZoomSlotProps } from './slots/Zoom.js';\n\nexport type {\n Connection,\n ConnectionColorProps,\n ConnectionLayerBaseProps,\n ConnectionLayerProps,\n CurvedLine,\n} from './types/connection-layer.js';\n\nexport type { DotLayerBaseProps, DotLayerProps } from './types/dot-layer.js';\n\nexport type {\n BubbleLayerBaseProps,\n BubbleLayerProps,\n ScaleNoneProps,\n ScaleRadiusProps,\n} from './types/bubble-layer.js';\n\nexport type {\n ChoroplethLayerBaseProps,\n ChoroplethLayerProps,\n} from './types/choropleth-layer.js';\n\nexport type { Location } from './types/location.js';\nexport type { MapShape } from './types/shapes.js';\nexport type {\n ChartInteractionsProps,\n MapToolbarSlotProps,\n} from './types/toolbar.js';\nexport type { ErrorStateSlotProps } from './slots/states/ErrorStateSlot.js';\n\nexport type {\n BaseLegendProps,\n CategoricalLegendProps,\n SequentialLegendProps,\n ThresholdLegendProps,\n} from './types/legend.js';\n\nexport type {\n LocationColorProps,\n LegendColorLayerProps,\n ChoroplethCustomColorProps,\n} from './types/coloring.js';\n\nexport { SequentialLegend } from './slots/SequentialLegend.js';\nexport { ThresholdLegend } from './slots/ThresholdLegend.js';\nexport { CategoricalLegend } from './slots/CategoricalLegend.js';\n\nexport type {\n BubbleLayerTooltipHandler,\n BubbleLayerTooltipHandlerProps,\n DotLayerTooltipHandler,\n DotLayerTooltipHandlerProps,\n ConnectionLayerTooltipHandler,\n ConnectionLayerTooltipHandlerProps,\n ChoroplethLayerTooltipHandlerProps,\n ChoroplethLayerTooltipHandler,\n ChartTooltip,\n DotLayerTooltipData,\n BubbleLayerTooltipData,\n ConnectionLayerTooltipData,\n ChoroplethLayerTooltipData,\n} from './types/tooltip.js';\n\nexport { getAllCountries } from './utils/get-all-countries.js';\n\nexport { MapViewProvider } from './providers/map-view.provider.js';\nexport type { MapViewProviderProps } from './types/map-view-provider.js';\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,yBAAyB;AAClC,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,SAAS,oBAAoB;AACtC,SAAS,mBAAmB;AA2D5B,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAkBlC,SAAS,uBAAuB;AAEhC,SAAS,uBAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { MapViewProviderContext } from "../contexts/map-view-provider.context.js";
|
|
4
|
+
const MapViewProvider = ({
|
|
5
|
+
children,
|
|
6
|
+
countryCode,
|
|
7
|
+
displayWorldMap
|
|
8
|
+
}) => {
|
|
9
|
+
const value = useMemo(
|
|
10
|
+
() => ({ countryCode, displayWorldMap }),
|
|
11
|
+
[countryCode, displayWorldMap]
|
|
12
|
+
);
|
|
13
|
+
return /* @__PURE__ */ jsx(MapViewProviderContext.Provider, { value, children });
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
MapViewProvider
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=map-view.provider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/providers/map-view.provider.tsx"],
|
|
4
|
+
"sourcesContent": ["import { type PropsWithChildren, useMemo } from 'react';\n\nimport { MapViewProviderContext } from '../contexts/map-view-provider.context.js';\nimport type { MapViewProviderProps } from '../types/map-view-provider.js';\n\n/**\n * The `MapViewProvider` is a component that provides shared configuration to nested `MapView` instances.\n * @public\n */\nexport const MapViewProvider = ({\n children,\n countryCode,\n displayWorldMap,\n}: PropsWithChildren<MapViewProviderProps>) => {\n const value = useMemo(\n () => ({ countryCode, displayWorldMap }),\n [countryCode, displayWorldMap],\n );\n\n return (\n <MapViewProviderContext.Provider value={value}>\n {children}\n </MapViewProviderContext.Provider>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAoBI;AApBJ,SAAiC,eAAe;AAEhD,SAAS,8BAA8B;AAOhC,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF,MAA+C;AAC7C,QAAM,QAAQ;AAAA,IACZ,OAAO,EAAE,aAAa,gBAAgB;AAAA,IACtC,CAAC,aAAa,eAAe;AAAA,EAC/B;AAEA,SACE,oBAAC,uBAAuB,UAAvB,EAAgC,OAC9B,UACH;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/slots/Tooltip.tsx"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-deprecated -- DEPRECATION: [APPDEV-17834] Legacy geo Tooltip slot. BREAKING-CHANGE: migrate to ChartTooltip before next major. */\nimport type { _ChartTooltipAtomsType as ChartTooltipAtomsType } from '@dynatrace/strato-components/charts';\nimport {\n _ChartTooltipSlots as ChartTooltipSlots,\n _ChartTooltipAtoms as ChartTooltipAtoms,\n _ChartTooltipTemplate as ChartTooltipTemplate,\n} from '@dynatrace/strato-components/charts';\n\nimport type { ChartTooltip } from '../types/tooltip.js';\n\n/**\n * Tooltip is responsible for exposing the\n * ChartTooltip props, such as, sections, to the consumer\n * @public\n * @deprecated Use `ChartTooltip` from `@dynatrace/strato-components/charts` instead. Removal: APPDEV-17834\n */\nexport const Tooltip: ChartTooltip = {\n ...ChartTooltipSlots,\n ...ChartTooltipTemplate,\n};\n\n/**\n * TooltipAtoms is responsible for exposing the\n * ChartTooltip atoms.\n * @public\n * @deprecated Use `ChartTooltip` from `@dynatrace/strato-components/charts` instead. Removal: APPDEV-17834\n */\nexport const TooltipAtoms: ChartTooltipAtomsType = { ...ChartTooltipAtoms };\n"],
|
|
5
|
+
"mappings": "AAEA;AAAA,EACE,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,yBAAyB;AAAA,OACpB;AAUA,MAAM,UAAwB;AAAA,EACnC,GAAG;AAAA,EACH,GAAG;AACL;AAQO,MAAM,eAAsC,EAAE,GAAG,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=map-view-provider.js.map
|
|
@@ -2,20 +2,22 @@ import { attachImageToMap } from "./attach-image-to-map.js";
|
|
|
2
2
|
import { createBitmapConfigOptions } from "./create-bitmap-config-options.js";
|
|
3
3
|
import { getDataUri } from "./get-data-uri.js";
|
|
4
4
|
import { DEFAULT_INPUT_ICON_SIZE } from "../constants.js";
|
|
5
|
+
import { isFirefox } from "./is-browser-firefox.js";
|
|
5
6
|
import { getShape } from "../shapes/shape-picker.js";
|
|
6
7
|
const attachImageFromShape = (map, shape, name, outputSize) => {
|
|
7
8
|
const pickedShape = getShape(shape);
|
|
8
9
|
const stringUrl = getDataUri(encodeURIComponent(pickedShape));
|
|
9
10
|
const img = new Image(DEFAULT_INPUT_ICON_SIZE, DEFAULT_INPUT_ICON_SIZE);
|
|
10
11
|
img.addEventListener("load", () => {
|
|
11
|
-
createImageBitmap(
|
|
12
|
+
const bitmapPromise = isFirefox() ? createImageBitmap(img, createBitmapConfigOptions(outputSize)) : createImageBitmap(
|
|
12
13
|
img,
|
|
13
14
|
0,
|
|
14
15
|
0,
|
|
15
16
|
DEFAULT_INPUT_ICON_SIZE,
|
|
16
17
|
DEFAULT_INPUT_ICON_SIZE,
|
|
17
18
|
createBitmapConfigOptions(outputSize)
|
|
18
|
-
)
|
|
19
|
+
);
|
|
20
|
+
bitmapPromise.then((bitmap) => {
|
|
19
21
|
if (!map) {
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/utils/attach-image-from-shape.ts"],
|
|
4
|
-
"sourcesContent": ["import type { MapRef } from '@vis.gl/react-maplibre';\n\nimport { attachImageToMap } from './attach-image-to-map.js';\nimport { createBitmapConfigOptions } from './create-bitmap-config-options.js';\nimport { getDataUri } from './get-data-uri.js';\nimport { DEFAULT_INPUT_ICON_SIZE } from '../constants.js';\nimport { getShape } from '../shapes/shape-picker.js';\nimport type { MapShape } from '../types/shapes.js';\n\nexport const attachImageFromShape = (\n map: MapRef,\n shape: MapShape,\n name: string,\n outputSize?: number,\n) => {\n const pickedShape = getShape(shape);\n const stringUrl = getDataUri(encodeURIComponent(pickedShape));\n const img = new Image(DEFAULT_INPUT_ICON_SIZE, DEFAULT_INPUT_ICON_SIZE);\n img.addEventListener('load', () => {\n createImageBitmap(\n img,\n
|
|
5
|
-
"mappings": "AAEA,SAAS,wBAAwB;AACjC,SAAS,iCAAiC;AAC1C,SAAS,kBAAkB;AAC3B,SAAS,+BAA+B;AACxC,SAAS,gBAAgB;AAGlB,MAAM,uBAAuB,CAClC,KACA,OACA,MACA,eACG;AACH,QAAM,cAAc,SAAS,KAAK;AAClC,QAAM,YAAY,WAAW,mBAAmB,WAAW,CAAC;AAC5D,QAAM,MAAM,IAAI,MAAM,yBAAyB,uBAAuB;AACtE,MAAI,iBAAiB,QAAQ,MAAM;
|
|
4
|
+
"sourcesContent": ["import type { MapRef } from '@vis.gl/react-maplibre';\n\nimport { attachImageToMap } from './attach-image-to-map.js';\nimport { createBitmapConfigOptions } from './create-bitmap-config-options.js';\nimport { getDataUri } from './get-data-uri.js';\nimport { DEFAULT_INPUT_ICON_SIZE } from '../constants.js';\nimport { isFirefox } from './is-browser-firefox.js';\nimport { getShape } from '../shapes/shape-picker.js';\nimport type { MapShape } from '../types/shapes.js';\n\nexport const attachImageFromShape = (\n map: MapRef,\n shape: MapShape,\n name: string,\n outputSize?: number,\n) => {\n const pickedShape = getShape(shape);\n const stringUrl = getDataUri(encodeURIComponent(pickedShape));\n const img = new Image(DEFAULT_INPUT_ICON_SIZE, DEFAULT_INPUT_ICON_SIZE);\n img.addEventListener('load', () => {\n // passing an explicit source rect to createImageBitmap\n // clips SVG icons on Firefox. Drop the rect on Firefox only \u2014 other\n // browsers keep the original path.\n const bitmapPromise = isFirefox()\n ? createImageBitmap(img, createBitmapConfigOptions(outputSize))\n : createImageBitmap(\n img,\n 0,\n 0,\n DEFAULT_INPUT_ICON_SIZE,\n DEFAULT_INPUT_ICON_SIZE,\n createBitmapConfigOptions(outputSize),\n );\n bitmapPromise.then((bitmap) => {\n if (!map) {\n return;\n }\n attachImageToMap(map, bitmap, name);\n });\n });\n img.src = stringUrl;\n};\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,wBAAwB;AACjC,SAAS,iCAAiC;AAC1C,SAAS,kBAAkB;AAC3B,SAAS,+BAA+B;AACxC,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AAGlB,MAAM,uBAAuB,CAClC,KACA,OACA,MACA,eACG;AACH,QAAM,cAAc,SAAS,KAAK;AAClC,QAAM,YAAY,WAAW,mBAAmB,WAAW,CAAC;AAC5D,QAAM,MAAM,IAAI,MAAM,yBAAyB,uBAAuB;AACtE,MAAI,iBAAiB,QAAQ,MAAM;AAIjC,UAAM,gBAAgB,UAAU,IAC5B,kBAAkB,KAAK,0BAA0B,UAAU,CAAC,IAC5D;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,0BAA0B,UAAU;AAAA,IACtC;AACJ,kBAAc,KAAK,CAAC,WAAW;AAC7B,UAAI,CAAC,KAAK;AACR;AAAA,MACF;AACA,uBAAiB,KAAK,QAAQ,IAAI;AAAA,IACpC,CAAC;AAAA,EACH,CAAC;AACD,MAAI,MAAM;AACZ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -24,17 +24,20 @@ const extractLayersData = (children, valueAccessors) => {
|
|
|
24
24
|
let flattenData = [];
|
|
25
25
|
const categoriesSet = /* @__PURE__ */ new Set();
|
|
26
26
|
let legendDomain = [Infinity, -Infinity];
|
|
27
|
+
const dataLookupRegistry = /* @__PURE__ */ new Map();
|
|
27
28
|
Children.forEach(children, (child) => {
|
|
28
29
|
if (isComponent(child, BubbleLayer) || isComponent(child, DotLayer)) {
|
|
29
|
-
const { data } = child.props;
|
|
30
|
-
|
|
30
|
+
const { data, layerId } = child.props;
|
|
31
|
+
const lookup = /* @__PURE__ */ new Map();
|
|
32
|
+
data.forEach((dataPoint, index) => {
|
|
33
|
+
lookup.set(index, dataPoint);
|
|
31
34
|
const extendedDataPoint = {
|
|
32
35
|
...dataPoint,
|
|
33
|
-
"layer-name":
|
|
36
|
+
"layer-name": layerId
|
|
34
37
|
};
|
|
35
38
|
const category = addCategory(
|
|
36
39
|
extendedDataPoint,
|
|
37
|
-
valueAccessors.get(
|
|
40
|
+
valueAccessors.get(layerId)
|
|
38
41
|
);
|
|
39
42
|
category && categoriesSet.add(category);
|
|
40
43
|
if (typeof category === "number") {
|
|
@@ -42,14 +45,14 @@ const extractLayersData = (children, valueAccessors) => {
|
|
|
42
45
|
}
|
|
43
46
|
flattenData = flattenData.concat(extendedDataPoint);
|
|
44
47
|
});
|
|
48
|
+
dataLookupRegistry.set(`source-${layerId}`, lookup);
|
|
45
49
|
} else if (isComponent(child, ConnectionLayer)) {
|
|
46
|
-
const { data } = child.props;
|
|
50
|
+
const { data, layerId } = child.props;
|
|
51
|
+
const lookup = /* @__PURE__ */ new Map();
|
|
47
52
|
data.forEach((connection, connectionIndex) => {
|
|
53
|
+
lookup.set(connectionIndex, connection);
|
|
48
54
|
if (connection.path.length >= 2) {
|
|
49
|
-
const category = addCategory(
|
|
50
|
-
connection,
|
|
51
|
-
valueAccessors.get(child.props.layerId)
|
|
52
|
-
);
|
|
55
|
+
const category = addCategory(connection, valueAccessors.get(layerId));
|
|
53
56
|
category && categoriesSet.add(category);
|
|
54
57
|
if (typeof category === "number") {
|
|
55
58
|
legendDomain = updateDomain(legendDomain, category);
|
|
@@ -59,24 +62,28 @@ const extractLayersData = (children, valueAccessors) => {
|
|
|
59
62
|
...path,
|
|
60
63
|
"connection-name": `connection-${connectionIndex + 1}`,
|
|
61
64
|
"connection-item-index": pathIndex,
|
|
62
|
-
"layer-name":
|
|
65
|
+
"layer-name": layerId
|
|
63
66
|
};
|
|
64
67
|
flattenData.push(parsedPath);
|
|
65
68
|
});
|
|
66
69
|
}
|
|
67
70
|
});
|
|
71
|
+
dataLookupRegistry.set(`source-${layerId}`, lookup);
|
|
68
72
|
} else if (isComponent(child, ChoroplethLayer)) {
|
|
69
|
-
const { data, regionAccessor } = child.props;
|
|
70
|
-
|
|
73
|
+
const { data, regionAccessor, layerId } = child.props;
|
|
74
|
+
const sourceId = layerId.replace("layer", "source");
|
|
75
|
+
const lookup = /* @__PURE__ */ new Map();
|
|
76
|
+
data.forEach((dataEntry, index) => {
|
|
77
|
+
lookup.set(index, dataEntry);
|
|
71
78
|
const region = isString(regionAccessor) ? dataEntry[regionAccessor] : regionAccessor(dataEntry);
|
|
72
79
|
const choroplethLayerData = {
|
|
73
80
|
...dataEntry,
|
|
74
81
|
region,
|
|
75
|
-
"layer-name":
|
|
82
|
+
"layer-name": layerId
|
|
76
83
|
};
|
|
77
84
|
const category = addCategory(
|
|
78
85
|
choroplethLayerData,
|
|
79
|
-
valueAccessors.get(
|
|
86
|
+
valueAccessors.get(layerId)
|
|
80
87
|
);
|
|
81
88
|
category && categoriesSet.add(category);
|
|
82
89
|
if (typeof category === "number") {
|
|
@@ -84,12 +91,14 @@ const extractLayersData = (children, valueAccessors) => {
|
|
|
84
91
|
}
|
|
85
92
|
flattenData.push(choroplethLayerData);
|
|
86
93
|
});
|
|
94
|
+
dataLookupRegistry.set(sourceId, lookup);
|
|
87
95
|
}
|
|
88
96
|
});
|
|
89
97
|
return {
|
|
90
98
|
flattenData,
|
|
91
99
|
categories: [...categoriesSet],
|
|
92
|
-
legendDomain
|
|
100
|
+
legendDomain,
|
|
101
|
+
dataLookupRegistry
|
|
93
102
|
};
|
|
94
103
|
};
|
|
95
104
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/utils/extract-layers-data.ts"],
|
|
4
|
-
"sourcesContent": ["import { isString } from 'lodash-es';\nimport { Children, type ReactNode } from 'react';\n\nimport { isComponent } from './is-component.js';\nimport { BubbleLayer } from '../components/BubbleLayer/BubbleLayer.js';\nimport { ChoroplethLayer } from '../components/ChoroplethLayer/ChoroplethLayer.js';\nimport { ConnectionLayer } from '../components/ConnectionLayer/ConnectionLayer.js';\nimport { DotLayer } from '../components/DotLayer/DotLayer.js';\n\nconst addCategory = (\n extendedDataPoint: Record<string, unknown>,\n valueAccessor?: string,\n) => {\n if (valueAccessor && extendedDataPoint[valueAccessor]) {\n return extendedDataPoint[valueAccessor];\n }\n};\n\nconst updateDomain = (\n domain: [number, number],\n value: number,\n): [number, number] => {\n let [min, max] = domain;\n if (value < min) {\n min = value;\n }\n if (value > max) {\n max = value;\n }\n return [min, max];\n};\n\n/**\n * Extract layers data\n * @param children - MapView children\n * @param valueAccessors - MapView Layer valueAccessor\n * @returns flattened data array\n */\nexport const extractLayersData = (\n children: ReactNode,\n valueAccessors: Map<string, string>,\n) => {\n let flattenData: Record<string, unknown>[] = [];\n const categoriesSet = new Set<string>();\n let legendDomain: [number, number] = [Infinity, -Infinity];\n\n Children.forEach(children, (child) => {\n if (isComponent(child, BubbleLayer) || isComponent(child, DotLayer)) {\n const { data } = child.props;\n\n data.forEach((dataPoint) => {\n const extendedDataPoint = {\n ...dataPoint,\n 'layer-name':
|
|
5
|
-
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,gBAAgC;AAEzC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import { isString } from 'lodash-es';\nimport { Children, type ReactNode } from 'react';\n\nimport { isComponent } from './is-component.js';\nimport { BubbleLayer } from '../components/BubbleLayer/BubbleLayer.js';\nimport { ChoroplethLayer } from '../components/ChoroplethLayer/ChoroplethLayer.js';\nimport { ConnectionLayer } from '../components/ConnectionLayer/ConnectionLayer.js';\nimport { DotLayer } from '../components/DotLayer/DotLayer.js';\nimport type {\n GeoDataLookup,\n GeoDataLookupRegistry,\n} from '../contexts/geo-data-lookup.context.js';\n\nconst addCategory = (\n extendedDataPoint: Record<string, unknown>,\n valueAccessor?: string,\n) => {\n if (valueAccessor && extendedDataPoint[valueAccessor]) {\n return extendedDataPoint[valueAccessor];\n }\n};\n\nconst updateDomain = (\n domain: [number, number],\n value: number,\n): [number, number] => {\n let [min, max] = domain;\n if (value < min) {\n min = value;\n }\n if (value > max) {\n max = value;\n }\n return [min, max];\n};\n\n/**\n * Extract layers data\n * @param children - MapView children\n * @param valueAccessors - MapView Layer valueAccessor\n * @returns flattened data array\n */\nexport const extractLayersData = (\n children: ReactNode,\n valueAccessors: Map<string, string>,\n) => {\n let flattenData: Record<string, unknown>[] = [];\n const categoriesSet = new Set<string>();\n let legendDomain: [number, number] = [Infinity, -Infinity];\n const dataLookupRegistry: GeoDataLookupRegistry = new Map();\n\n Children.forEach(children, (child) => {\n if (isComponent(child, BubbleLayer) || isComponent(child, DotLayer)) {\n const { data, layerId } = child.props;\n const lookup: GeoDataLookup = new Map();\n\n data.forEach((dataPoint, index) => {\n lookup.set(index, dataPoint);\n\n const extendedDataPoint = {\n ...dataPoint,\n 'layer-name': layerId,\n };\n\n const category = addCategory(\n extendedDataPoint,\n valueAccessors.get(layerId),\n );\n\n category && categoriesSet.add(category as string);\n\n if (typeof category === 'number') {\n legendDomain = updateDomain(legendDomain, category);\n }\n\n flattenData = flattenData.concat(extendedDataPoint);\n });\n\n dataLookupRegistry.set(`source-${layerId}`, lookup);\n } else if (isComponent(child, ConnectionLayer)) {\n const { data, layerId } = child.props;\n const lookup: GeoDataLookup = new Map();\n\n data.forEach((connection, connectionIndex) => {\n lookup.set(connectionIndex, connection);\n if (connection.path.length >= 2) {\n const category = addCategory(connection, valueAccessors.get(layerId));\n\n category && categoriesSet.add(category as string);\n\n if (typeof category === 'number') {\n legendDomain = updateDomain(legendDomain, category);\n }\n\n connection.path.forEach((path, pathIndex) => {\n const parsedPath = {\n ...path,\n 'connection-name': `connection-${connectionIndex + 1}`,\n 'connection-item-index': pathIndex,\n 'layer-name': layerId,\n };\n\n flattenData.push(parsedPath);\n });\n }\n });\n\n dataLookupRegistry.set(`source-${layerId}`, lookup);\n } else if (isComponent(child, ChoroplethLayer)) {\n const { data, regionAccessor, layerId } = child.props;\n const sourceId = layerId.replace('layer', 'source');\n const lookup: GeoDataLookup = new Map();\n\n data.forEach((dataEntry, index) => {\n lookup.set(index, dataEntry);\n const region = isString(regionAccessor)\n ? dataEntry[regionAccessor]\n : regionAccessor(dataEntry);\n\n const choroplethLayerData = {\n ...dataEntry,\n region,\n 'layer-name': layerId,\n };\n\n const category = addCategory(\n choroplethLayerData,\n valueAccessors.get(layerId),\n );\n\n category && categoriesSet.add(category as string);\n\n if (typeof category === 'number') {\n legendDomain = updateDomain(legendDomain, category);\n }\n\n flattenData.push(choroplethLayerData);\n });\n\n dataLookupRegistry.set(sourceId, lookup);\n }\n });\n\n return {\n flattenData,\n categories: [...categoriesSet],\n legendDomain,\n dataLookupRegistry,\n };\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|