@dynatrace/strato-geo 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/map/MapView.js +5 -3
- package/esm/map/MapView.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js +25 -57
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js +18 -41
- package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js +22 -47
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js.map +2 -2
- package/esm/map/components/DefaultTooltip/DefaultTooltip.js +70 -29
- package/esm/map/components/DefaultTooltip/DefaultTooltip.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayerTooltip.js +18 -45
- package/esm/map/components/DotLayer/DotLayerTooltip.js.map +2 -2
- package/esm/map/components/toolbar/MapToolbar.js +10 -8
- package/esm/map/components/toolbar/MapToolbar.js.map +2 -2
- package/esm/map/hooks/use-geo-layer-tooltip.js +23 -0
- package/esm/map/hooks/use-geo-layer-tooltip.js.map +7 -0
- package/esm/map/hooks/use-geo-tooltip-sync.js +79 -0
- package/esm/map/hooks/use-geo-tooltip-sync.js.map +7 -0
- package/esm/map/hooks/use-overlay-events.js +98 -29
- package/esm/map/hooks/use-overlay-events.js.map +2 -2
- package/esm/map/hooks/use-tooltip-event-listeners.js +6 -5
- package/esm/map/hooks/use-tooltip-event-listeners.js.map +2 -2
- package/esm/map/hooks/use-tooltip-template.js +22 -2
- package/esm/map/hooks/use-tooltip-template.js.map +2 -2
- package/esm/map/store/map-store.context.js +1 -5
- package/esm/map/store/map-store.context.js.map +2 -2
- package/esm/map/store/selectors.js +0 -10
- package/esm/map/store/selectors.js.map +2 -2
- package/esm/map/store/store.js +1 -67
- package/esm/map/store/store.js.map +2 -2
- package/esm/map/utils/build-geo-tooltip-state.js +28 -0
- package/esm/map/utils/build-geo-tooltip-state.js.map +7 -0
- package/esm/map/utils/tooltip-type-guards.js +2 -0
- package/esm/map/utils/tooltip-type-guards.js.map +2 -2
- package/map/MapView.d.ts +2 -2
- package/map/MapView.js +2 -2
- package/map/components/BubbleLayer/BubbleCircleLayer.d.ts +1 -1
- package/map/components/BubbleLayer/BubbleLayer.d.ts +1 -1
- package/map/components/BubbleLayer/BubbleLayerTooltip.d.ts +1 -1
- package/map/components/BubbleLayer/BubbleLayerTooltip.js +24 -50
- package/map/components/BubbleLayer/BubbleOutlineLayer.d.ts +1 -1
- package/map/components/ChoroplethLayer/ChoroplethLayer.d.ts +1 -1
- package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.d.ts +1 -1
- package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js +17 -34
- package/map/components/ChoroplethLayer/ChoroplethOutlineLayer.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayer.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerDirection.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerLine.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.js +21 -40
- package/map/components/DefaultTooltip/DefaultTooltip.d.ts +7 -2
- package/map/components/DefaultTooltip/DefaultTooltip.js +74 -27
- package/map/components/DotLayer/BackgroundLayer.d.ts +1 -1
- package/map/components/DotLayer/BackgroundSymbolLayer.d.ts +1 -1
- package/map/components/DotLayer/DotLayer.d.ts +1 -1
- package/map/components/DotLayer/DotLayerTooltip.d.ts +1 -1
- package/map/components/DotLayer/DotLayerTooltip.js +17 -38
- package/map/components/MapUnavailable.d.ts +1 -1
- package/map/components/TooltipWrapper.d.ts +1 -1
- package/map/components/legend/CategoricalLegendRenderer.d.ts +1 -1
- package/map/components/legend/MapLegendRenderer.d.ts +1 -1
- package/map/components/legend/SequentialLegendRenderer.d.ts +1 -1
- package/map/components/legend/ThresholdLegendRenderer.d.ts +1 -1
- package/map/components/toolbar/MapToolbar.d.ts +1 -1
- package/map/components/toolbar/MapToolbar.js +9 -7
- package/map/components/toolbar/buttons/MapDownloadDataButton.d.ts +1 -1
- package/map/components/toolbar/buttons/MapResetButton.d.ts +1 -1
- package/map/components/toolbar/buttons/MapZoomInOutButtons.d.ts +1 -1
- package/map/components/toolbar/buttons/MapZoomToFitButton.d.ts +1 -1
- package/map/hooks/use-geo-layer-tooltip.d.ts +10 -0
- package/map/hooks/use-geo-layer-tooltip.js +38 -0
- package/map/hooks/use-geo-tooltip-sync.d.ts +24 -0
- package/map/hooks/use-geo-tooltip-sync.js +95 -0
- package/map/hooks/use-overlay-events.js +94 -25
- package/map/hooks/use-tooltip-event-listeners.js +6 -5
- package/map/hooks/use-tooltip-template.d.ts +6 -1
- package/map/hooks/use-tooltip-template.js +22 -2
- package/map/providers/color-scale.provider.d.ts +1 -1
- package/map/providers/layer-color-strategy.provider.d.ts +1 -1
- package/map/providers/map-initial-view.provider.d.ts +1 -1
- package/map/slots/BubbleLayer.d.ts +1 -1
- package/map/slots/BubbleLayerTooltip.d.ts +1 -1
- package/map/slots/DotLayer.d.ts +1 -1
- package/map/slots/DotLayerTooltip.d.ts +1 -1
- package/map/store/map-store.context.d.ts +1 -1
- package/map/store/map-store.context.js +1 -5
- package/map/store/map-store.provider.d.ts +1 -1
- package/map/store/selectors.d.ts +6 -15
- package/map/store/selectors.js +0 -10
- package/map/store/store.d.ts +2 -6
- package/map/store/store.js +1 -67
- package/map/types/state.d.ts +3 -7
- package/map/types/tooltip.d.ts +11 -1
- package/map/utils/build-geo-tooltip-state.d.ts +17 -0
- package/map/{components/DefaultTooltip/utils/handle-copy-to-clipboard.js → utils/build-geo-tooltip-state.js} +27 -11
- package/map/utils/tooltip-type-guards.d.ts +6 -4
- package/map/utils/tooltip-type-guards.js +2 -0
- package/package.json +4 -4
- package/esm/map/components/DefaultTooltip/utils/get-default-actions.js +0 -21
- package/esm/map/components/DefaultTooltip/utils/get-default-actions.js.map +0 -7
- package/esm/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.js +0 -12
- package/esm/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.js.map +0 -7
- package/map/components/DefaultTooltip/utils/get-default-actions.d.ts +0 -2
- package/map/components/DefaultTooltip/utils/get-default-actions.js +0 -40
- package/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.d.ts +0 -2
|
@@ -3,16 +3,8 @@ import { useStoreSelector } from "@dynatrace/strato-components/core";
|
|
|
3
3
|
import { MapStore } from "./map-store.context.js";
|
|
4
4
|
const useSelector = (selector) => useStoreSelector(MapStore, selector, isEqual);
|
|
5
5
|
const useMapSelectionState = () => useSelector(({ selection }) => selection);
|
|
6
|
-
const useMapTooltipState = () => useSelector(({ tooltip }) => {
|
|
7
|
-
const { pinned, ...tooltipState } = tooltip;
|
|
8
|
-
return tooltipState;
|
|
9
|
-
});
|
|
10
6
|
const useMapTooltipLocationState = () => useSelector(({ tooltip }) => tooltip.location);
|
|
11
7
|
const useMapTooltipHoveredLayerIdState = () => useSelector(({ tooltip }) => tooltip.hoveredLayerId);
|
|
12
|
-
const useMapTooltipPinnedState = () => useSelector(({ tooltip }) => {
|
|
13
|
-
const { pinned } = tooltip;
|
|
14
|
-
return pinned;
|
|
15
|
-
});
|
|
16
8
|
const useMapOverlayState = () => useSelector(({ overlay }) => overlay);
|
|
17
9
|
const useMapZoomState = () => useSelector(({ zoom }) => zoom);
|
|
18
10
|
export {
|
|
@@ -20,8 +12,6 @@ export {
|
|
|
20
12
|
useMapSelectionState,
|
|
21
13
|
useMapTooltipHoveredLayerIdState,
|
|
22
14
|
useMapTooltipLocationState,
|
|
23
|
-
useMapTooltipPinnedState,
|
|
24
|
-
useMapTooltipState,
|
|
25
15
|
useMapZoomState,
|
|
26
16
|
useSelector
|
|
27
17
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/store/selectors.ts"],
|
|
4
|
-
"sourcesContent": ["import { isEqual } from 'lodash-es';\nimport { type Context } from 'react';\n\nimport { Store, useStoreSelector } from '@dynatrace/strato-components/core';\n\nimport { MapStore } from './map-store.context.js';\nimport type { MapState } from '../types/state.js';\n\nexport const useSelector = <
|
|
5
|
-
"mappings": "AAAA,SAAS,eAAe;AAGxB,SAAgB,wBAAwB;AAExC,SAAS,gBAAgB;AAGlB,MAAM,cAAc,
|
|
4
|
+
"sourcesContent": ["import { isEqual } from 'lodash-es';\nimport { type Context } from 'react';\n\nimport { Store, useStoreSelector } from '@dynatrace/strato-components/core';\n\nimport { MapStore } from './map-store.context.js';\nimport type { MapState } from '../types/state.js';\n\nexport const useSelector = <O>(selector: (state: MapState) => O): O =>\n useStoreSelector(MapStore as Context<Store<MapState>>, selector, isEqual);\n\nexport const useMapSelectionState = () =>\n useSelector(({ selection }: MapState) => selection);\n\nexport const useMapTooltipLocationState = () =>\n useSelector(({ tooltip }: MapState) => tooltip.location);\n\nexport const useMapTooltipHoveredLayerIdState = () =>\n useSelector(({ tooltip }: MapState) => tooltip.hoveredLayerId);\n\nexport const useMapOverlayState = () =>\n useSelector(({ overlay }: MapState) => overlay);\n\nexport const useMapZoomState = () => useSelector(({ zoom }: MapState) => zoom);\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe;AAGxB,SAAgB,wBAAwB;AAExC,SAAS,gBAAgB;AAGlB,MAAM,cAAc,CAAI,aAC7B,iBAAiB,UAAsC,UAAU,OAAO;AAEnE,MAAM,uBAAuB,MAClC,YAAY,CAAC,EAAE,UAAU,MAAgB,SAAS;AAE7C,MAAM,6BAA6B,MACxC,YAAY,CAAC,EAAE,QAAQ,MAAgB,QAAQ,QAAQ;AAElD,MAAM,mCAAmC,MAC9C,YAAY,CAAC,EAAE,QAAQ,MAAgB,QAAQ,cAAc;AAExD,MAAM,qBAAqB,MAChC,YAAY,CAAC,EAAE,QAAQ,MAAgB,OAAO;AAEzC,MAAM,kBAAkB,MAAM,YAAY,CAAC,EAAE,KAAK,MAAgB,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/esm/map/store/store.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { MapStore } from "./map-store.context.js";
|
|
3
|
-
import { extractDataFromEvent } from "../utils/parse-tooltip-data.js";
|
|
4
3
|
const useSetState = () => {
|
|
5
4
|
const { setState } = useContext(MapStore);
|
|
6
5
|
return setState;
|
|
@@ -18,68 +17,6 @@ const useSetStateSelection = () => {
|
|
|
18
17
|
}));
|
|
19
18
|
};
|
|
20
19
|
};
|
|
21
|
-
const useSetStateTooltip = () => {
|
|
22
|
-
const setState = useSetState();
|
|
23
|
-
return (newTooltipState) => {
|
|
24
|
-
setState((prev) => {
|
|
25
|
-
const { location, data, hoveredLayerId, ...tooltipState } = newTooltipState;
|
|
26
|
-
return {
|
|
27
|
-
...prev,
|
|
28
|
-
tooltip: {
|
|
29
|
-
...prev.tooltip,
|
|
30
|
-
...tooltipState,
|
|
31
|
-
hoveredLayerId: prev.tooltip.pinned ? prev.tooltip.hoveredLayerId : hoveredLayerId,
|
|
32
|
-
data: prev.tooltip.pinned ? prev.tooltip.data : data,
|
|
33
|
-
location: prev.tooltip.pinned ? prev.tooltip.location : location
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
const clearTooltip = (prev) => {
|
|
40
|
-
return {
|
|
41
|
-
...prev,
|
|
42
|
-
tooltip: {
|
|
43
|
-
...prev.tooltip,
|
|
44
|
-
pinned: false,
|
|
45
|
-
data: void 0,
|
|
46
|
-
pinnedId: void 0,
|
|
47
|
-
hoveredLayerId: void 0,
|
|
48
|
-
visible: false,
|
|
49
|
-
location: void 0
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
const useClearTooltip = () => {
|
|
54
|
-
const setState = useSetState();
|
|
55
|
-
return () => {
|
|
56
|
-
setState(clearTooltip);
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
const useTooltipPinnedState = () => {
|
|
60
|
-
const setState = useSetState();
|
|
61
|
-
return (event) => {
|
|
62
|
-
setState((prev) => {
|
|
63
|
-
const { data, featureId, hoveredLayerId } = extractDataFromEvent(event);
|
|
64
|
-
if (!featureId) {
|
|
65
|
-
return clearTooltip(prev);
|
|
66
|
-
}
|
|
67
|
-
const isPinned = prev.tooltip.pinnedId !== featureId;
|
|
68
|
-
return {
|
|
69
|
-
...prev,
|
|
70
|
-
tooltip: {
|
|
71
|
-
...prev.tooltip,
|
|
72
|
-
data,
|
|
73
|
-
hoveredLayerId,
|
|
74
|
-
visible: true,
|
|
75
|
-
location: event.lngLat,
|
|
76
|
-
pinned: isPinned,
|
|
77
|
-
pinnedId: isPinned ? featureId : void 0
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
20
|
const useSetStateOverlay = () => {
|
|
84
21
|
const setState = useSetState();
|
|
85
22
|
return (newOverlayState) => {
|
|
@@ -105,12 +42,9 @@ const useSetStateZoom = () => {
|
|
|
105
42
|
};
|
|
106
43
|
};
|
|
107
44
|
export {
|
|
108
|
-
useClearTooltip,
|
|
109
45
|
useSetState,
|
|
110
46
|
useSetStateOverlay,
|
|
111
47
|
useSetStateSelection,
|
|
112
|
-
|
|
113
|
-
useSetStateZoom,
|
|
114
|
-
useTooltipPinnedState
|
|
48
|
+
useSetStateZoom
|
|
115
49
|
};
|
|
116
50
|
//# sourceMappingURL=store.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/store/store.ts"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { useContext } from 'react';\n\nimport { MapStore } from './map-store.context.js';\nimport type {\n MapOverlayState,\n MapSelectionState,\n ZoomState,\n} from '../types/state.js';\n\nexport const useSetState = () => {\n const { setState } = useContext(MapStore);\n\n return setState;\n};\n\nexport * from './selectors.js';\n\nexport const useSetStateSelection = () => {\n const setState = useSetState();\n\n return (newSelectionState: Partial<MapSelectionState>) => {\n setState((prev) => ({\n ...prev,\n selection: {\n ...prev.selection,\n ...newSelectionState,\n },\n }));\n };\n};\n\nexport const useSetStateOverlay = () => {\n const setState = useSetState();\n\n return (newOverlayState: Partial<MapOverlayState>) => {\n setState((prev) => ({\n ...prev,\n overlay: {\n ...prev.overlay,\n ...newOverlayState,\n },\n }));\n };\n};\n\nexport const useSetStateZoom = () => {\n const setState = useSetState();\n\n return (newZoomState: Partial<ZoomState>) => {\n setState((prev) => ({\n ...prev,\n zoom: {\n ...prev.zoom,\n ...newZoomState,\n },\n }));\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AAOlB,MAAM,cAAc,MAAM;AAC/B,QAAM,EAAE,SAAS,IAAI,WAAW,QAAQ;AAExC,SAAO;AACT;AAEA,cAAc;AAEP,MAAM,uBAAuB,MAAM;AACxC,QAAM,WAAW,YAAY;AAE7B,SAAO,CAAC,sBAAkD;AACxD,aAAS,CAAC,UAAU;AAAA,MAClB,GAAG;AAAA,MACH,WAAW;AAAA,QACT,GAAG,KAAK;AAAA,QACR,GAAG;AAAA,MACL;AAAA,IACF,EAAE;AAAA,EACJ;AACF;AAEO,MAAM,qBAAqB,MAAM;AACtC,QAAM,WAAW,YAAY;AAE7B,SAAO,CAAC,oBAA8C;AACpD,aAAS,CAAC,UAAU;AAAA,MAClB,GAAG;AAAA,MACH,SAAS;AAAA,QACP,GAAG,KAAK;AAAA,QACR,GAAG;AAAA,MACL;AAAA,IACF,EAAE;AAAA,EACJ;AACF;AAEO,MAAM,kBAAkB,MAAM;AACnC,QAAM,WAAW,YAAY;AAE7B,SAAO,CAAC,iBAAqC;AAC3C,aAAS,CAAC,UAAU;AAAA,MAClB,GAAG;AAAA,MACH,MAAM;AAAA,QACJ,GAAG,KAAK;AAAA,QACR,GAAG;AAAA,MACL;AAAA,IACF,EAAE;AAAA,EACJ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const buildGeoTooltipState = ({
|
|
2
|
+
absoluteX,
|
|
3
|
+
absoluteY,
|
|
4
|
+
relativeX,
|
|
5
|
+
relativeY,
|
|
6
|
+
pinned,
|
|
7
|
+
geometry,
|
|
8
|
+
metadata
|
|
9
|
+
}) => ({
|
|
10
|
+
absoluteX,
|
|
11
|
+
absoluteY,
|
|
12
|
+
relativeX,
|
|
13
|
+
relativeY,
|
|
14
|
+
percentX: 0,
|
|
15
|
+
percentY: 0,
|
|
16
|
+
inBounds: true,
|
|
17
|
+
pinned,
|
|
18
|
+
activeSeries: null,
|
|
19
|
+
data: {
|
|
20
|
+
geometry,
|
|
21
|
+
series: [],
|
|
22
|
+
metadata
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
buildGeoTooltipState
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=build-geo-tooltip-state.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/map/utils/build-geo-tooltip-state.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n _OverlayTooltipGeometryTypes as GeometryTypes,\n _OverlayTooltipState as TooltipState,\n} from '@dynatrace/strato-components/charts';\n\n/**\n * Builds the full TooltipState object for the geo map context.\n *\n * Centralises the state shape so that both the event-side\n * (`useOverlayEvents`) and the sync-side (`useGeoTooltipSync`)\n * produce the exact same structure.\n */\nexport const buildGeoTooltipState = ({\n absoluteX,\n absoluteY,\n relativeX,\n relativeY,\n pinned,\n geometry,\n metadata,\n}: {\n absoluteX: number;\n absoluteY: number;\n relativeX: number;\n relativeY: number;\n pinned: boolean;\n geometry: GeometryTypes;\n metadata: unknown[] | undefined;\n}): TooltipState =>\n ({\n absoluteX,\n absoluteY,\n relativeX,\n relativeY,\n percentX: 0,\n percentY: 0,\n inBounds: true,\n pinned,\n activeSeries: null,\n data: {\n geometry,\n series: [],\n metadata,\n },\n } as TooltipState);\n"],
|
|
5
|
+
"mappings": "AAYO,MAAM,uBAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,OASG;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV;AAAA,EACA,cAAc;AAAA,EACd,MAAM;AAAA,IACJ;AAAA,IACA,QAAQ,CAAC;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isDefaultTooltipHandler } from "../hooks/use-tooltip-template.js";
|
|
1
2
|
import { BubbleLayerTooltip } from "../slots/BubbleLayerTooltip.js";
|
|
2
3
|
import { ChoroplethLayerTooltip } from "../slots/ChoroplethLayerTooltip.js";
|
|
3
4
|
import { ConnectionLayerTooltip } from "../slots/ConnectionLayerTooltip.js";
|
|
@@ -13,6 +14,7 @@ export {
|
|
|
13
14
|
isChoroplethTooltipTemplate,
|
|
14
15
|
isConnection,
|
|
15
16
|
isConnectionTooltipTemplate,
|
|
17
|
+
isDefaultTooltipHandler,
|
|
16
18
|
isDotTooltipTemplate,
|
|
17
19
|
isRegion
|
|
18
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/map/utils/tooltip-type-guards.ts"],
|
|
4
|
-
"sourcesContent": ["import { BubbleLayerTooltip } from '../slots/BubbleLayerTooltip.js';\nimport { ChoroplethLayerTooltip } from '../slots/ChoroplethLayerTooltip.js';\nimport { ConnectionLayerTooltip } from '../slots/ConnectionLayerTooltip.js';\nimport { DotLayerTooltip } from '../slots/DotLayerTooltip.js';\nimport type {\n BubbleLayerTooltipHandler,\n ChoroplethLayerTooltipData,\n ChoroplethLayerTooltipHandler,\n ConnectionLayerTooltipData,\n ConnectionLayerTooltipHandler,\n DotLayerTooltipHandler,\n LayerTooltipData,\n LayerTooltipHandler,\n} from '../types/tooltip.js';\n\n/**\n * Type guards for tooltip template\n * @param template -\n */\nexport const isDotTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is DotLayerTooltipHandler =>\n typeof template === typeof DotLayerTooltip;\n\nexport const isBubbleTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is BubbleLayerTooltipHandler =>\n typeof template === typeof BubbleLayerTooltip;\n\nexport const isConnectionTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is ConnectionLayerTooltipHandler =>\n typeof template === typeof ConnectionLayerTooltip;\n\nexport const isChoroplethTooltipTemplate = (\n template?: LayerTooltipHandler,\n): template is ChoroplethLayerTooltipHandler =>\n typeof template === typeof ChoroplethLayerTooltip;\n\n/**\n * Type guards for map types in tooltip context\n * @param data -\n */\nexport const isConnection = (\n data: LayerTooltipData,\n): data is ConnectionLayerTooltipData => 'path' in data.data;\n\nexport const isRegion = (\n data: LayerTooltipData,\n): data is ChoroplethLayerTooltipData => 'name' in data;\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AACvC,SAAS,uBAAuB;AAgBzB,MAAM,uBAAuB,CAClC,aAEA,OAAO,aAAa,OAAO;AAEtB,MAAM,0BAA0B,CACrC,aAEA,OAAO,aAAa,OAAO;AAEtB,MAAM,8BAA8B,CACzC,aAEA,OAAO,aAAa,OAAO;AAEtB,MAAM,8BAA8B,CACzC,aAEA,OAAO,aAAa,OAAO;AAMtB,MAAM,eAAe,CAC1B,SACuC,UAAU,KAAK;AAEjD,MAAM,WAAW,CACtB,SACuC,UAAU;",
|
|
4
|
+
"sourcesContent": ["import { isDefaultTooltipHandler } from '../hooks/use-tooltip-template.js';\nimport { BubbleLayerTooltip } from '../slots/BubbleLayerTooltip.js';\nimport { ChoroplethLayerTooltip } from '../slots/ChoroplethLayerTooltip.js';\nimport { ConnectionLayerTooltip } from '../slots/ConnectionLayerTooltip.js';\nimport { DotLayerTooltip } from '../slots/DotLayerTooltip.js';\nimport type {\n BubbleLayerTooltipHandler,\n ChoroplethLayerTooltipData,\n ChoroplethLayerTooltipHandler,\n ConnectionLayerTooltipData,\n ConnectionLayerTooltipHandler,\n DotLayerTooltipHandler,\n LayerTooltipData,\n LayerTooltipHandler,\n} from '../types/tooltip.js';\n\n/**\n * Type guards for tooltip template\n * @param template -\n */\nexport const isDotTooltipTemplate = (\n template?: LayerTooltipHandler | null,\n): template is DotLayerTooltipHandler =>\n typeof template === typeof DotLayerTooltip;\n\nexport const isBubbleTooltipTemplate = (\n template?: LayerTooltipHandler | null,\n): template is BubbleLayerTooltipHandler =>\n typeof template === typeof BubbleLayerTooltip;\n\nexport const isConnectionTooltipTemplate = (\n template?: LayerTooltipHandler | null,\n): template is ConnectionLayerTooltipHandler =>\n typeof template === typeof ConnectionLayerTooltip;\n\nexport const isChoroplethTooltipTemplate = (\n template?: LayerTooltipHandler | null,\n): template is ChoroplethLayerTooltipHandler =>\n typeof template === typeof ChoroplethLayerTooltip;\n\n/**\n * Type guards for map types in tooltip context\n * @param data -\n */\nexport const isConnection = (\n data: LayerTooltipData,\n): data is ConnectionLayerTooltipData => 'path' in data.data;\n\nexport const isRegion = (\n data: LayerTooltipData,\n): data is ChoroplethLayerTooltipData => 'name' in data;\n\nexport { isDefaultTooltipHandler };\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,+BAA+B;AACxC,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AACvC,SAAS,uBAAuB;AAgBzB,MAAM,uBAAuB,CAClC,aAEA,OAAO,aAAa,OAAO;AAEtB,MAAM,0BAA0B,CACrC,aAEA,OAAO,aAAa,OAAO;AAEtB,MAAM,8BAA8B,CACzC,aAEA,OAAO,aAAa,OAAO;AAEtB,MAAM,8BAA8B,CACzC,aAEA,OAAO,aAAa,OAAO;AAMtB,MAAM,eAAe,CAC1B,SACuC,UAAU,KAAK;AAEjD,MAAM,WAAW,CACtB,SACuC,UAAU;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/map/MapView.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import './styles/react-mapgl-styles.css';
|
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
8
|
export declare const MapView: ((props: PropsWithChildren<MapViewProps> & import("react").RefAttributes<MapViewRef>) => import("react").ReactElement | null) & {
|
|
9
|
-
ErrorState: (props: import("./
|
|
9
|
+
ErrorState: (props: import("./index.js").ErrorStateSlotProps) => null;
|
|
10
10
|
Toolbar: {
|
|
11
11
|
(props: import("./index.js").MapToolbarSlotProps): null;
|
|
12
12
|
displayName: string;
|
|
@@ -16,7 +16,7 @@ export declare const MapView: ((props: PropsWithChildren<MapViewProps> & import(
|
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
Zoom: {
|
|
19
|
-
(props: import("./
|
|
19
|
+
(props: import("./index.js").MapViewZoomSlotProps): null;
|
|
20
20
|
displayName: string;
|
|
21
21
|
};
|
|
22
22
|
};
|
package/map/MapView.js
CHANGED
|
@@ -119,7 +119,7 @@ const _MapView = (0, import_react.forwardRef)(
|
|
|
119
119
|
import_map_truncation_mode_context.MapTruncationModeContext.Provider,
|
|
120
120
|
{
|
|
121
121
|
value: truncationMode ?? import_constants.DEFAULT_TRUNCATION_MODE,
|
|
122
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_formatter_context.FormatterContext.Provider, { value: formatter, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_map_raw_data_context.MapRawDataContext.Provider, { value: layersData, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_map_store_provider.MapStoreProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_formatter_context.FormatterContext.Provider, { value: formatter, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_map_raw_data_context.MapRawDataContext.Provider, { value: layersData, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_charts._OverlayProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_charts._OverlayTooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_map_store_provider.MapStoreProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
123
|
import_color_scale_provider.ColorScaleProvider,
|
|
124
124
|
{
|
|
125
125
|
categories,
|
|
@@ -155,7 +155,7 @@ const _MapView = (0, import_react.forwardRef)(
|
|
|
155
155
|
}
|
|
156
156
|
) })
|
|
157
157
|
}
|
|
158
|
-
) }) }) })
|
|
158
|
+
) }) }) }) }) })
|
|
159
159
|
}
|
|
160
160
|
) }) })
|
|
161
161
|
}
|
|
@@ -2,4 +2,4 @@ import type { BehaviorTrackingProps } from '@dynatrace/strato-components/core';
|
|
|
2
2
|
export declare const BubbleCircleLayer: ({ id, source, ...behavioralTrackingProps }: {
|
|
3
3
|
id: string;
|
|
4
4
|
source: string;
|
|
5
|
-
} & BehaviorTrackingProps) => import("react/jsx-runtime
|
|
5
|
+
} & BehaviorTrackingProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,6 @@ import { type PropsWithChildren } from 'react';
|
|
|
2
2
|
import { type InternalBubbleLayerProps } from '../../types/bubble-layer.js';
|
|
3
3
|
import type { Location } from '../../types/location.js';
|
|
4
4
|
export declare const BubbleLayer: {
|
|
5
|
-
<T extends Location>(props: PropsWithChildren<InternalBubbleLayerProps<T>>): import("react/jsx-runtime
|
|
5
|
+
<T extends Location>(props: PropsWithChildren<InternalBubbleLayerProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
@@ -3,6 +3,6 @@ export interface BubbleLayerTooltipProps {
|
|
|
3
3
|
tooltipTemplate?: BubbleLayerTooltipHandler;
|
|
4
4
|
}
|
|
5
5
|
export declare const BubbleLayerTooltip: {
|
|
6
|
-
(props: BubbleLayerTooltipProps): import("react/jsx-runtime
|
|
6
|
+
(props: BubbleLayerTooltipProps): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
@@ -23,64 +23,38 @@ __export(BubbleLayerTooltip_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(BubbleLayerTooltip_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_lodash_es = require("lodash");
|
|
26
|
-
var import_react = require("react");
|
|
27
26
|
var import_charts = require("@dynatrace/strato-components/charts");
|
|
28
|
-
var
|
|
29
|
-
var
|
|
27
|
+
var import_use_geo_layer_tooltip = require("../../hooks/use-geo-layer-tooltip.js");
|
|
28
|
+
var import_tooltip_type_guards = require("../../utils/tooltip-type-guards.js");
|
|
30
29
|
const BubbleLayerTooltip = (props) => {
|
|
31
30
|
const { tooltipTemplate } = props;
|
|
32
|
-
const {
|
|
33
|
-
|
|
34
|
-
actionsMenuRef,
|
|
35
|
-
updateSelectedItem,
|
|
36
|
-
onLeave
|
|
37
|
-
} = (0, import_charts._useChartActionsMenu)();
|
|
38
|
-
const tooltipRef = (0, import_react.useRef)(null);
|
|
39
|
-
const { data, visible, enabled } = (0, import_selectors.useMapTooltipState)();
|
|
40
|
-
const pinned = (0, import_selectors.useMapTooltipPinnedState)();
|
|
41
|
-
const closestPoint = (0, import_react.useRef)(null);
|
|
42
|
-
const remainingPoints = (0, import_react.useRef)([]);
|
|
43
|
-
const forceHideTooltip = !pinned && (!visible || !enabled);
|
|
44
|
-
const position = (0, import_use_get_position.useGetPosition)(pinned, !forceHideTooltip);
|
|
45
|
-
if (!tooltipTemplate || forceHideTooltip || !position) {
|
|
31
|
+
const { data, inBounds, position } = (0, import_use_geo_layer_tooltip.useGeoLayerTooltip)("geoBubble");
|
|
32
|
+
if (!tooltipTemplate || !inBounds || !position) {
|
|
46
33
|
return null;
|
|
47
34
|
}
|
|
48
|
-
if (data
|
|
49
|
-
|
|
50
|
-
const {
|
|
51
|
-
__color: color,
|
|
52
|
-
__radius: radius,
|
|
53
|
-
data: customData
|
|
54
|
-
} = bubbleProps;
|
|
55
|
-
return {
|
|
56
|
-
color,
|
|
57
|
-
radius,
|
|
58
|
-
data: customData
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
const sortedBubbles = (0, import_lodash_es.sortBy)(sanitizedData, ({ radius }) => radius);
|
|
62
|
-
closestPoint.current = sortedBubbles[0];
|
|
63
|
-
remainingPoints.current = sortedBubbles.slice(1);
|
|
35
|
+
if (!data || !data[0]) {
|
|
36
|
+
return null;
|
|
64
37
|
}
|
|
65
|
-
const
|
|
38
|
+
const sanitizedData = data.map((bubbleProps) => {
|
|
39
|
+
const { __color: color, __radius: radius, data: customData } = bubbleProps;
|
|
40
|
+
return {
|
|
41
|
+
color,
|
|
42
|
+
radius,
|
|
43
|
+
data: customData
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const sortedBubbles = [
|
|
47
|
+
...(0, import_lodash_es.sortBy)(sanitizedData, ({ radius }) => radius)
|
|
48
|
+
];
|
|
49
|
+
const closestPoint = sortedBubbles[0];
|
|
50
|
+
const remainingPoints = sortedBubbles.slice(1);
|
|
51
|
+
const template = closestPoint ? tooltipTemplate(closestPoint, remainingPoints) : null;
|
|
66
52
|
if (!template) {
|
|
67
53
|
return null;
|
|
68
54
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
position,
|
|
74
|
-
pinned,
|
|
75
|
-
ref: tooltipRef,
|
|
76
|
-
onMouseLeave: onLeave,
|
|
77
|
-
actionSelectionValue: {
|
|
78
|
-
selectedItemId,
|
|
79
|
-
actionsMenuRef,
|
|
80
|
-
updateSelectedItem
|
|
81
|
-
},
|
|
82
|
-
children: template
|
|
83
|
-
}
|
|
84
|
-
);
|
|
55
|
+
if ((0, import_tooltip_type_guards.isDefaultTooltipHandler)(tooltipTemplate)) {
|
|
56
|
+
return template;
|
|
57
|
+
}
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_charts._OverlayTooltip, { legacyTemplate: template });
|
|
85
59
|
};
|
|
86
60
|
BubbleLayerTooltip["displayName"] = "BubbleLayerTooltip";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
import type { InternalChoroplethLayerProps } from '../../types/choropleth-layer.js';
|
|
3
3
|
export declare const ChoroplethLayer: {
|
|
4
|
-
<T extends Record<string, unknown>>(props: PropsWithChildren<InternalChoroplethLayerProps<T>>): import("react/jsx-runtime
|
|
4
|
+
<T extends Record<string, unknown>>(props: PropsWithChildren<InternalChoroplethLayerProps<T>>): import("react/jsx-runtime").JSX.Element | undefined;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -3,6 +3,6 @@ export interface ChoroplethLayerTooltipProps {
|
|
|
3
3
|
tooltipTemplate?: ChoroplethLayerTooltipHandler;
|
|
4
4
|
}
|
|
5
5
|
export declare const ChoroplethLayerTooltip: {
|
|
6
|
-
(props: ChoroplethLayerTooltipProps): import("react/jsx-runtime
|
|
6
|
+
(props: ChoroplethLayerTooltipProps): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
@@ -22,48 +22,31 @@ __export(ChoroplethLayerTooltip_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(ChoroplethLayerTooltip_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
var import_react = require("react");
|
|
26
25
|
var import_charts = require("@dynatrace/strato-components/charts");
|
|
27
|
-
var
|
|
28
|
-
var
|
|
26
|
+
var import_use_geo_layer_tooltip = require("../../hooks/use-geo-layer-tooltip.js");
|
|
27
|
+
var import_tooltip_type_guards = require("../../utils/tooltip-type-guards.js");
|
|
29
28
|
const ChoroplethLayerTooltip = (props) => {
|
|
30
29
|
const { tooltipTemplate } = props;
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
actionsMenuRef,
|
|
34
|
-
updateSelectedItem,
|
|
35
|
-
onLeave
|
|
36
|
-
} = (0, import_charts._useChartActionsMenu)();
|
|
37
|
-
const { data, visible, enabled } = (0, import_selectors.useMapTooltipState)();
|
|
38
|
-
const pinned = (0, import_selectors.useMapTooltipPinnedState)();
|
|
39
|
-
const regionData = (0, import_react.useRef)(null);
|
|
40
|
-
const forceHideTooltip = !pinned && (!visible || !enabled);
|
|
41
|
-
const position = (0, import_use_get_position.useGetPosition)(pinned, !forceHideTooltip);
|
|
42
|
-
if (!tooltipTemplate || forceHideTooltip || !position) {
|
|
30
|
+
const { data, inBounds, position } = (0, import_use_geo_layer_tooltip.useGeoLayerTooltip)("geoChoropleth");
|
|
31
|
+
if (!tooltipTemplate || !inBounds || !position) {
|
|
43
32
|
return null;
|
|
44
33
|
}
|
|
45
|
-
if (data
|
|
46
|
-
|
|
47
|
-
regionData.current = { data: customData, name, color };
|
|
34
|
+
if (!data || !data[0]) {
|
|
35
|
+
return null;
|
|
48
36
|
}
|
|
49
|
-
const
|
|
37
|
+
const { name, __color: color, data: customData } = data[0];
|
|
38
|
+
const regionData = {
|
|
39
|
+
data: customData,
|
|
40
|
+
name,
|
|
41
|
+
color
|
|
42
|
+
};
|
|
43
|
+
const template = tooltipTemplate(regionData);
|
|
50
44
|
if (!template) {
|
|
51
45
|
return null;
|
|
52
46
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
position,
|
|
58
|
-
pinned,
|
|
59
|
-
onMouseLeave: onLeave,
|
|
60
|
-
actionSelectionValue: {
|
|
61
|
-
selectedItemId,
|
|
62
|
-
actionsMenuRef,
|
|
63
|
-
updateSelectedItem
|
|
64
|
-
},
|
|
65
|
-
children: template
|
|
66
|
-
}
|
|
67
|
-
);
|
|
47
|
+
if ((0, import_tooltip_type_guards.isDefaultTooltipHandler)(tooltipTemplate)) {
|
|
48
|
+
return template;
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_charts._OverlayTooltip, { legacyTemplate: template });
|
|
68
51
|
};
|
|
69
52
|
ChoroplethLayerTooltip["displayName"] = "ChoroplethLayerTooltip";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
import type { Connection, InternalConnectionLayerProps } from '../../types/connection-layer.js';
|
|
3
3
|
export declare const ConnectionLayer: {
|
|
4
|
-
<T extends Connection>(props: PropsWithChildren<InternalConnectionLayerProps<T>>): import("react/jsx-runtime
|
|
4
|
+
<T extends Connection>(props: PropsWithChildren<InternalConnectionLayerProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -3,7 +3,7 @@ interface ConnectionLayerDirectionProps<T extends Connection> extends Required<P
|
|
|
3
3
|
geoJsonData: GeoJSON.FeatureCollection;
|
|
4
4
|
}
|
|
5
5
|
export declare const ConnectionLayerDirection: {
|
|
6
|
-
<T extends Connection>(props: ConnectionLayerDirectionProps<T>): import("react/jsx-runtime
|
|
6
|
+
<T extends Connection>(props: ConnectionLayerDirectionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
export {};
|
|
@@ -6,7 +6,7 @@ interface ConnectionLayerLineProps<T extends Connection> extends Required<Pick<I
|
|
|
6
6
|
line: 'dashed' | 'solid' | undefined;
|
|
7
7
|
}
|
|
8
8
|
export declare const ConnectionLayerLine: {
|
|
9
|
-
<T extends Connection>(props: PropsWithChildren<ConnectionLayerLineProps<T>>): import("react/jsx-runtime
|
|
9
|
+
<T extends Connection>(props: PropsWithChildren<ConnectionLayerLineProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
export {};
|
|
@@ -3,6 +3,6 @@ export interface ConnectionLayerTooltipProps {
|
|
|
3
3
|
tooltipTemplate?: ConnectionLayerTooltipHandler;
|
|
4
4
|
}
|
|
5
5
|
export declare const ConnectionLayerTooltip: {
|
|
6
|
-
(props: ConnectionLayerTooltipProps): import("react/jsx-runtime
|
|
6
|
+
(props: ConnectionLayerTooltipProps): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
@@ -22,56 +22,37 @@ __export(ConnectionLayerTooltip_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(ConnectionLayerTooltip_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
var import_react = require("react");
|
|
26
25
|
var import_charts = require("@dynatrace/strato-components/charts");
|
|
27
26
|
var import_restore_null_props = require("./utils/restore-null-props.js");
|
|
28
|
-
var
|
|
29
|
-
var
|
|
27
|
+
var import_use_geo_layer_tooltip = require("../../hooks/use-geo-layer-tooltip.js");
|
|
28
|
+
var import_tooltip_type_guards = require("../../utils/tooltip-type-guards.js");
|
|
30
29
|
const ConnectionLayerTooltip = (props) => {
|
|
31
30
|
const { tooltipTemplate } = props;
|
|
32
31
|
const {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
data: dataWithoutNullProps,
|
|
40
|
-
visible,
|
|
41
|
-
enabled
|
|
42
|
-
} = (0, import_selectors.useMapTooltipState)();
|
|
43
|
-
const pinned = (0, import_selectors.useMapTooltipPinnedState)();
|
|
44
|
-
const data = (0, import_restore_null_props.restoreNullProps)(dataWithoutNullProps);
|
|
45
|
-
const connectionData = (0, import_react.useRef)(
|
|
46
|
-
null
|
|
47
|
-
);
|
|
48
|
-
const forceHideTooltip = !pinned && (!visible || !enabled);
|
|
49
|
-
const position = (0, import_use_get_position.useGetPosition)(pinned, !forceHideTooltip);
|
|
50
|
-
if (!tooltipTemplate || forceHideTooltip || !position) {
|
|
32
|
+
data: rawData,
|
|
33
|
+
inBounds,
|
|
34
|
+
position
|
|
35
|
+
} = (0, import_use_geo_layer_tooltip.useGeoLayerTooltip)("geoConnection");
|
|
36
|
+
const data = (0, import_restore_null_props.restoreNullProps)(rawData);
|
|
37
|
+
if (!tooltipTemplate || !inBounds || !position) {
|
|
51
38
|
return null;
|
|
52
39
|
}
|
|
53
|
-
if (data
|
|
54
|
-
|
|
55
|
-
connectionData.current = { color, thickness, data: rest };
|
|
40
|
+
if (!data || !data[0]) {
|
|
41
|
+
return null;
|
|
56
42
|
}
|
|
57
|
-
const
|
|
43
|
+
const { __lineColor: color, __lineWidth: thickness, ...rest } = data[0];
|
|
44
|
+
const connectionData = {
|
|
45
|
+
color,
|
|
46
|
+
thickness,
|
|
47
|
+
data: rest
|
|
48
|
+
};
|
|
49
|
+
const template = tooltipTemplate(connectionData);
|
|
58
50
|
if (!template) {
|
|
59
51
|
return null;
|
|
60
52
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
position,
|
|
66
|
-
pinned,
|
|
67
|
-
onMouseLeave: onLeave,
|
|
68
|
-
actionSelectionValue: {
|
|
69
|
-
selectedItemId,
|
|
70
|
-
actionsMenuRef,
|
|
71
|
-
updateSelectedItem
|
|
72
|
-
},
|
|
73
|
-
children: template
|
|
74
|
-
}
|
|
75
|
-
);
|
|
53
|
+
if ((0, import_tooltip_type_guards.isDefaultTooltipHandler)(tooltipTemplate)) {
|
|
54
|
+
return template;
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_charts._OverlayTooltip, { legacyTemplate: template });
|
|
76
57
|
};
|
|
77
58
|
ConnectionLayerTooltip["displayName"] = "ConnectionLayerTooltip";
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { _OverlayTooltipData as Data, type SeriesActionsTemplate } from '@dynatrace/strato-components/charts';
|
|
2
|
+
import type { Location } from '../../types/location.js';
|
|
3
|
+
import type { ChoroplethLayerTooltipData, LayerTooltipData } from '../../types/tooltip.js';
|
|
4
|
+
type SeriesData = Data['series'][number];
|
|
2
5
|
interface DefaultTooltipProps {
|
|
3
6
|
closestPoint: LayerTooltipData;
|
|
4
7
|
layerData?: LayerTooltipData[];
|
|
8
|
+
actionsForItem?: (item: SeriesData) => (() => SeriesActionsTemplate) | undefined;
|
|
9
|
+
seriesActions?: (data: Location | ChoroplethLayerTooltipData) => SeriesActionsTemplate;
|
|
5
10
|
}
|
|
6
11
|
export declare const DefaultTooltip: {
|
|
7
|
-
(props: DefaultTooltipProps): import("react/jsx-runtime
|
|
12
|
+
(props: DefaultTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
8
13
|
displayName: string;
|
|
9
14
|
};
|
|
10
15
|
export {};
|