@dynatrace/strato-geo 2.10.2 → 2.12.2
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 +7 -1
- package/esm/map/MapView.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayer.js +8 -10
- package/esm/map/components/BubbleLayer/BubbleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js +12 -5
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js +32 -85
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js +12 -5
- package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethOutlineLayer.js +71 -0
- package/esm/map/components/ChoroplethLayer/ChoroplethOutlineLayer.js.map +7 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js +8 -8
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js +30 -27
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js +11 -6
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js.map +2 -2
- package/esm/map/components/ConnectionLayer/utils/restore-null-props.js +1 -1
- package/esm/map/components/ConnectionLayer/utils/restore-null-props.js.map +2 -2
- package/esm/map/components/DefaultTooltip/DefaultTooltip.js +1 -4
- package/esm/map/components/DefaultTooltip/DefaultTooltip.js.map +2 -2
- package/esm/map/components/DefaultTooltip/utils/get-default-actions.js +12 -4
- package/esm/map/components/DefaultTooltip/utils/get-default-actions.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayer.js +50 -52
- package/esm/map/components/DotLayer/DotLayer.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayerTooltip.js +12 -5
- package/esm/map/components/DotLayer/DotLayerTooltip.js.map +2 -2
- package/esm/map/components/MapContent.js +6 -6
- package/esm/map/components/MapContent.js.map +2 -2
- package/esm/map/components/TooltipWrapper.js +26 -0
- package/esm/map/components/TooltipWrapper.js.map +7 -0
- package/esm/map/components/toolbar/MapToolbar.js +14 -4
- package/esm/map/components/toolbar/MapToolbar.js.map +2 -2
- package/esm/map/contexts/formatter.context.js.map +2 -2
- package/esm/map/contexts/tooltip.context.js +8 -0
- package/esm/map/contexts/tooltip.context.js.map +7 -0
- package/esm/map/hooks/use-active-interaction.js +24 -0
- package/esm/map/hooks/use-active-interaction.js.map +2 -2
- package/esm/map/hooks/use-formatter-context.js.map +2 -2
- package/esm/map/hooks/use-get-position.js +56 -0
- package/esm/map/hooks/use-get-position.js.map +7 -0
- package/esm/map/hooks/use-overlay-events.js +10 -20
- package/esm/map/hooks/use-overlay-events.js.map +2 -2
- package/esm/map/hooks/use-tooltip-event-listeners.js +6 -22
- package/esm/map/hooks/use-tooltip-event-listeners.js.map +2 -2
- package/esm/map/index.js +2 -0
- package/esm/map/index.js.map +2 -2
- package/esm/map/slots/DownloadCSV.js +6 -0
- package/esm/map/slots/DownloadCSV.js.map +7 -0
- package/esm/map/slots/Toolbar.js +6 -0
- package/esm/map/slots/Toolbar.js.map +7 -0
- package/esm/map/store/map-store.context.js +3 -2
- package/esm/map/store/map-store.context.js.map +2 -2
- package/esm/map/store/map-store.provider.js +1 -1
- package/esm/map/store/map-store.provider.js.map +2 -2
- package/esm/map/store/selectors.js +4 -0
- package/esm/map/store/selectors.js.map +2 -2
- package/esm/map/store/store.js +59 -24
- package/esm/map/store/store.js.map +2 -2
- package/esm/map/utils/iterate-config-slots.js +21 -1
- package/esm/map/utils/iterate-config-slots.js.map +2 -2
- package/esm/map/utils/parse-tooltip-data.js +17 -0
- package/esm/map/utils/parse-tooltip-data.js.map +3 -3
- package/map/MapView.d.ts +12 -0
- package/map/MapView.js +7 -1
- package/map/components/BubbleLayer/BubbleLayer.js +7 -9
- package/map/components/BubbleLayer/BubbleLayerTooltip.d.ts +0 -1
- package/map/components/BubbleLayer/BubbleLayerTooltip.js +12 -5
- package/map/components/ChoroplethLayer/ChoroplethLayer.js +30 -76
- package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.d.ts +0 -1
- package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js +12 -5
- package/map/components/ChoroplethLayer/ChoroplethOutlineLayer.d.ts +3 -0
- package/map/components/ChoroplethLayer/ChoroplethOutlineLayer.js +82 -0
- package/map/components/ConnectionLayer/ConnectionLayer.js +8 -8
- package/map/components/ConnectionLayer/ConnectionLayerLine.d.ts +2 -1
- package/map/components/ConnectionLayer/ConnectionLayerLine.js +29 -26
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.d.ts +1 -2
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.js +11 -6
- package/map/components/ConnectionLayer/utils/restore-null-props.js +1 -1
- package/map/components/DefaultTooltip/DefaultTooltip.js +1 -4
- package/map/components/DefaultTooltip/utils/get-default-actions.d.ts +2 -2
- package/map/components/DefaultTooltip/utils/get-default-actions.js +12 -4
- package/map/components/DotLayer/DotLayer.js +49 -51
- package/map/components/DotLayer/DotLayerTooltip.d.ts +0 -1
- package/map/components/DotLayer/DotLayerTooltip.js +12 -5
- package/map/components/MapContent.js +1 -1
- package/map/components/TooltipWrapper.d.ts +4 -0
- package/map/components/TooltipWrapper.js +42 -0
- package/map/components/toolbar/MapToolbar.js +14 -4
- package/map/contexts/formatter.context.d.ts +2 -2
- package/map/contexts/tooltip.context.d.ts +3 -0
- package/map/contexts/tooltip.context.js +27 -0
- package/map/hooks/use-active-interaction.js +24 -0
- package/map/hooks/use-formatter-context.d.ts +3 -1
- package/map/hooks/use-get-position.d.ts +4 -0
- package/map/hooks/use-get-position.js +75 -0
- package/map/hooks/use-overlay-events.js +7 -17
- package/map/hooks/use-tooltip-event-listeners.js +5 -18
- package/map/index.d.ts +2 -1
- package/map/index.js +2 -0
- package/map/slots/DownloadCSV.d.ts +8 -0
- package/map/slots/DownloadCSV.js +25 -0
- package/map/slots/Toolbar.d.ts +9 -0
- package/map/slots/Toolbar.js +25 -0
- package/map/store/map-store.context.d.ts +1 -23
- package/map/store/map-store.context.js +3 -2
- package/map/store/map-store.provider.js +1 -1
- package/map/store/selectors.d.ts +4 -4
- package/map/store/selectors.js +4 -0
- package/map/store/store.d.ts +5 -3
- package/map/store/store.js +59 -24
- package/map/types/state.d.ts +3 -4
- package/map/types/toolbar.d.ts +14 -11
- package/map/utils/iterate-config-slots.js +21 -1
- package/map/utils/parse-tooltip-data.d.ts +10 -1
- package/map/utils/parse-tooltip-data.js +17 -0
- package/package.json +5 -5
package/map/types/toolbar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartToolbarConfig, DraggableToolbarProps, ZoomChangeHandler } from '@dynatrace/strato-components-preview/charts';
|
|
2
2
|
export type ToolbarInteractionModes = 'zoom' | 'zoom-to-fit' | 'zoom-in' | 'zoom-out' | 'reset' | 'download-data';
|
|
3
3
|
/**
|
|
4
4
|
* Props for the ChartInteractions component
|
|
@@ -9,16 +9,15 @@ export interface ChartInteractionsProps {
|
|
|
9
9
|
onZoomChange?: ZoomChangeHandler;
|
|
10
10
|
}
|
|
11
11
|
/** Internal toolbar configuration interface **/
|
|
12
|
-
export
|
|
13
|
-
/** When enabled show the
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
12
|
+
export type MapToolbarConfig = Omit<ChartToolbarConfig, 'downloadData'> & DraggableToolbarProps & {
|
|
13
|
+
/** When enabled show the download CSV button in the toolbar */
|
|
14
|
+
downloadCSV?: {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
};
|
|
17
|
+
zoom?: {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
22
21
|
/** API config for the chart interactions */
|
|
23
22
|
export interface ChartInteractionsConfig {
|
|
24
23
|
/** Handler triggered when there is a change on the time domain caused by a zoom action */
|
|
@@ -33,3 +32,7 @@ export interface ChartInteractionsConfig {
|
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
export type A11yToolbarTabIndex = Record<string, number>;
|
|
35
|
+
/** Props for the ChartToolbar implementation in MapView
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export type MapToolbarSlotProps = DraggableToolbarProps;
|
|
@@ -21,6 +21,7 @@ __export(iterate_config_slots_exports, {
|
|
|
21
21
|
iterateConfigSlots: () => iterateConfigSlots
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(iterate_config_slots_exports);
|
|
24
|
+
var import_lodash_es = require("lodash");
|
|
24
25
|
var import_react = require("react");
|
|
25
26
|
var import_charts = require("@dynatrace/strato-components-preview/charts");
|
|
26
27
|
var import_constants = require("../constants.js");
|
|
@@ -29,8 +30,11 @@ var import_replace_infinite_values_in_ranges = require("./replace-infinite-value
|
|
|
29
30
|
var import_BaseLayer = require("../slots/BaseLayer.js");
|
|
30
31
|
var import_CategoricalLegend = require("../slots/CategoricalLegend.js");
|
|
31
32
|
var import_ChartInteractions = require("../slots/ChartInteractions.js");
|
|
33
|
+
var import_DownloadCSV = require("../slots/DownloadCSV.js");
|
|
32
34
|
var import_SequentialLegend = require("../slots/SequentialLegend.js");
|
|
33
35
|
var import_ThresholdLegend = require("../slots/ThresholdLegend.js");
|
|
36
|
+
var import_Toolbar = require("../slots/Toolbar.js");
|
|
37
|
+
var import_Zoom = require("../slots/Zoom.js");
|
|
34
38
|
const iterateConfigSlots = (children, legendDomain) => {
|
|
35
39
|
let slots = {
|
|
36
40
|
toolbar: void 0,
|
|
@@ -38,6 +42,7 @@ const iterateConfigSlots = (children, legendDomain) => {
|
|
|
38
42
|
legend: void 0,
|
|
39
43
|
baseLayer: import_constants.DEFAULT_BASE_LAYER_RULES
|
|
40
44
|
};
|
|
45
|
+
let slotMapToolbarConfig = {};
|
|
41
46
|
import_react.Children.forEach(children, (child) => {
|
|
42
47
|
if ((0, import_is_slot.isSlot)(child, import_ChartInteractions.ChartInteractions)) {
|
|
43
48
|
const { children: children2, ...previousInteractions } = child.props;
|
|
@@ -97,6 +102,18 @@ const iterateConfigSlots = (children, legendDomain) => {
|
|
|
97
102
|
ranges
|
|
98
103
|
}
|
|
99
104
|
};
|
|
105
|
+
} else if ((0, import_is_slot.isSlot)(child, import_Toolbar.Toolbar)) {
|
|
106
|
+
slotMapToolbarConfig = { ...slotMapToolbarConfig, ...child.props };
|
|
107
|
+
} else if ((0, import_is_slot.isSlot)(child, import_DownloadCSV.DownloadCSV)) {
|
|
108
|
+
slotMapToolbarConfig = {
|
|
109
|
+
...slotMapToolbarConfig,
|
|
110
|
+
downloadCSV: { enabled: true }
|
|
111
|
+
};
|
|
112
|
+
} else if ((0, import_is_slot.isSlot)(child, import_Zoom.Zoom)) {
|
|
113
|
+
slotMapToolbarConfig = {
|
|
114
|
+
...slotMapToolbarConfig,
|
|
115
|
+
zoom: { enabled: true }
|
|
116
|
+
};
|
|
100
117
|
} else if ((0, import_is_slot.isSlot)(child, import_BaseLayer.BaseLayer)) {
|
|
101
118
|
slots = {
|
|
102
119
|
...slots,
|
|
@@ -107,6 +124,9 @@ const iterateConfigSlots = (children, legendDomain) => {
|
|
|
107
124
|
};
|
|
108
125
|
}
|
|
109
126
|
});
|
|
127
|
+
if (!(0, import_lodash_es.isEmpty)(slotMapToolbarConfig)) {
|
|
128
|
+
slots.toolbar = { ...slots.toolbar, ...slotMapToolbarConfig };
|
|
129
|
+
}
|
|
110
130
|
return slots;
|
|
111
131
|
};
|
|
112
132
|
const iterateChartInteractionsSlots = (children) => {
|
|
@@ -126,7 +146,7 @@ const iterateChartToolbarSlots = (children) => {
|
|
|
126
146
|
if ((0, import_is_slot.isSlot)(childToolbar, import_charts.ChartToolbar.DownloadData)) {
|
|
127
147
|
toolbar = {
|
|
128
148
|
...toolbar,
|
|
129
|
-
|
|
149
|
+
downloadCSV: { enabled: true }
|
|
130
150
|
};
|
|
131
151
|
}
|
|
132
152
|
});
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import type { MapGeoJSONFeature } from 'maplibre-gl';
|
|
1
|
+
import type { MapGeoJSONFeature, MapLayerMouseEvent } from 'maplibre-gl';
|
|
2
2
|
/**
|
|
3
3
|
* Extracts useful map features data for the tooltip
|
|
4
4
|
* @param features - map features
|
|
5
5
|
*/
|
|
6
6
|
export declare const parseTooltipData: (features: MapGeoJSONFeature[]) => unknown[];
|
|
7
|
+
export declare const extractDataFromEvent: (event: MapLayerMouseEvent) => {
|
|
8
|
+
featureId?: undefined;
|
|
9
|
+
hoveredLayerId?: undefined;
|
|
10
|
+
data?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
featureId: string;
|
|
13
|
+
hoveredLayerId: string;
|
|
14
|
+
data: unknown[];
|
|
15
|
+
};
|
|
@@ -18,6 +18,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var parse_tooltip_data_exports = {};
|
|
20
20
|
__export(parse_tooltip_data_exports, {
|
|
21
|
+
extractDataFromEvent: () => extractDataFromEvent,
|
|
21
22
|
parseTooltipData: () => parseTooltipData
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(parse_tooltip_data_exports);
|
|
@@ -52,3 +53,19 @@ const parseTooltipData = (features) => {
|
|
|
52
53
|
}
|
|
53
54
|
return data;
|
|
54
55
|
};
|
|
56
|
+
const extractDataFromEvent = (event) => {
|
|
57
|
+
if (!event.features?.length) {
|
|
58
|
+
return {};
|
|
59
|
+
}
|
|
60
|
+
const feature = event.features[0];
|
|
61
|
+
const hoveredLayerId = feature.layer.id;
|
|
62
|
+
const hoveredFeatures = event.features.filter(
|
|
63
|
+
(feature2) => feature2.layer.id === hoveredLayerId
|
|
64
|
+
);
|
|
65
|
+
const data = parseTooltipData(hoveredFeatures);
|
|
66
|
+
return {
|
|
67
|
+
featureId: `${hoveredLayerId}-${feature.id}`,
|
|
68
|
+
hoveredLayerId,
|
|
69
|
+
data
|
|
70
|
+
};
|
|
71
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynatrace/strato-geo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"d3-array": "^3.2.4",
|
|
49
49
|
"d3-interpolate": "^3.0.1",
|
|
50
50
|
"d3-scale": "^4.0.2",
|
|
51
|
-
"maplibre-gl": "
|
|
51
|
+
"maplibre-gl": ">=5.0.0 <5.12.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@dynatrace-sdk/client-classic-environment-v2": "^3.7.3",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"react-dom": "^18.0.0",
|
|
59
59
|
"react-intl": "^6.0.8 || ^7.0.0",
|
|
60
60
|
"react-is": "^18.0.0",
|
|
61
|
-
"@dynatrace/strato-components": "^1.
|
|
62
|
-
"@dynatrace/strato-components-preview": "^2.
|
|
61
|
+
"@dynatrace/strato-components": "^1.14.0",
|
|
62
|
+
"@dynatrace/strato-components-preview": "^2.12.2",
|
|
63
63
|
"@dynatrace/strato-design-tokens": "^1.2.0",
|
|
64
|
-
"@dynatrace/strato-icons": "^1.
|
|
64
|
+
"@dynatrace/strato-icons": "^1.11.0"
|
|
65
65
|
},
|
|
66
66
|
"sideEffects": [
|
|
67
67
|
"./map/styles/react-mapgl-styles.css",
|