@dynatrace/strato-geo 1.0.3 → 1.2.1
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/index.js.map +2 -2
- package/esm/map/MapView.js +14 -10
- package/esm/map/MapView.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js +6 -6
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayer.js +1 -1
- package/esm/map/components/BubbleLayer/BubbleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleOutlineLayer.js +1 -1
- package/esm/map/components/BubbleLayer/BubbleOutlineLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js +47 -24
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js +2 -1
- package/esm/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js +30 -48
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js +10 -3
- package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js +44 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js.map +7 -0
- package/esm/map/components/ConnectionLayer/utils/{get-arc-line-features.js → get-arc-line-feature.js} +4 -8
- package/esm/map/components/ConnectionLayer/utils/{get-arc-line-features.js.map → get-arc-line-feature.js.map} +3 -3
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-feature.js +11 -0
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-feature.js.map +7 -0
- package/esm/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js +24 -19
- package/esm/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ConnectionLayer/utils/parse-direction-data-to-geo-json.js.map +1 -1
- package/esm/map/components/DotLayer/BackgroundLayer.js +1 -1
- package/esm/map/components/DotLayer/BackgroundLayer.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayer.js +5 -5
- package/esm/map/components/DotLayer/DotLayer.js.map +2 -2
- package/esm/map/components/DotLayer/utils/parse-dot-data-to-geo-json.js.map +2 -2
- package/esm/map/components/MapContent.js +33 -7
- package/esm/map/components/MapContent.js.map +2 -2
- package/esm/map/components/MapUnavailable.js +2 -2
- package/esm/map/components/MapUnavailable.js.map +2 -2
- package/esm/map/components/toolbar/buttons/MapResetButton.js +1 -1
- package/esm/map/components/toolbar/buttons/MapResetButton.js.map +2 -2
- package/esm/map/components/toolbar/buttons/MapZoomInOutButtons.js +1 -1
- package/esm/map/components/toolbar/buttons/MapZoomInOutButtons.js.map +2 -2
- package/esm/map/components/toolbar/buttons/MapZoomToFitButton.js +1 -1
- package/esm/map/components/toolbar/buttons/MapZoomToFitButton.js.map +2 -2
- package/esm/map/constants.js +23 -17
- package/esm/map/constants.js.map +2 -2
- package/esm/map/contexts/map-data-bounding-box.context.js +2 -2
- package/esm/map/contexts/map-data-bounding-box.context.js.map +2 -2
- package/esm/map/hooks/use-active-interaction.js +14 -1
- package/esm/map/hooks/use-active-interaction.js.map +2 -2
- package/esm/map/hooks/use-attach-image-from-icon.js +4 -1
- package/esm/map/hooks/use-attach-image-from-icon.js.map +2 -2
- package/esm/map/hooks/use-attach-symbol-to-map.js +2 -2
- package/esm/map/hooks/use-attach-symbol-to-map.js.map +2 -2
- package/esm/map/hooks/use-hover-interaction.js +1 -1
- package/esm/map/hooks/use-hover-interaction.js.map +2 -2
- package/esm/map/hooks/use-legend-interaction-highlighting.js +30 -1
- package/esm/map/hooks/use-legend-interaction-highlighting.js.map +2 -2
- package/esm/map/hooks/use-legend-interaction-visibility.js +10 -1
- package/esm/map/hooks/use-legend-interaction-visibility.js.map +2 -2
- package/esm/map/hooks/use-load-map-base-layer.js +4 -4
- package/esm/map/hooks/use-load-map-base-layer.js.map +2 -2
- package/esm/map/hooks/use-map-mouse-move.js +1 -1
- package/esm/map/hooks/use-map-mouse-move.js.map +2 -2
- package/esm/map/hooks/use-resolve-color.js +4 -0
- package/esm/map/hooks/use-resolve-color.js.map +2 -2
- package/esm/map/providers/imperative-handler.provider.js +1 -1
- package/esm/map/providers/imperative-handler.provider.js.map +2 -2
- package/esm/map/providers/map-initial-view.provider.js +1 -1
- package/esm/map/providers/map-initial-view.provider.js.map +2 -2
- package/esm/map/slots/BaseLayer.js.map +2 -2
- package/esm/map/slots/BubbleLayer.js.map +2 -2
- package/esm/map/slots/CategoricalLegend.js.map +2 -2
- package/esm/map/slots/ChartInteractions.js +3 -3
- package/esm/map/slots/ChartInteractions.js.map +2 -2
- package/esm/map/slots/ChoroplethLayer.js.map +2 -2
- package/esm/map/slots/ConnectionLayer.js.map +2 -2
- package/esm/map/slots/DotLayer.js.map +2 -2
- package/esm/map/slots/SequentialLegend.js.map +2 -2
- package/esm/map/slots/ThresholdLegend.js.map +2 -2
- package/esm/map/slots/states/ErrorStateSlot.js.map +2 -2
- package/esm/map/types/bubble-layer.js.map +2 -2
- package/esm/map/types/coloring.js.map +2 -2
- package/esm/map/utils/attach-image-from-shape.js +3 -0
- package/esm/map/utils/attach-image-from-shape.js.map +2 -2
- package/esm/map/utils/attach-image-from-string.js.map +1 -1
- package/esm/map/utils/attach-image-from-text.js.map +1 -1
- package/esm/map/utils/attach-image-to-map.js +12 -5
- package/esm/map/utils/attach-image-to-map.js.map +2 -2
- package/esm/map/utils/build-scale-from-legend-config.js +5 -1
- package/esm/map/utils/build-scale-from-legend-config.js.map +2 -2
- package/esm/map/utils/create-categorical-color-scheme-from-custom-color-object.js +17 -0
- package/esm/map/utils/create-categorical-color-scheme-from-custom-color-object.js.map +7 -0
- package/esm/map/utils/extract-layers-data.js +50 -13
- package/esm/map/utils/extract-layers-data.js.map +2 -2
- package/esm/map/utils/iterate-config-slots.js +4 -2
- package/esm/map/utils/iterate-config-slots.js.map +2 -2
- package/esm/map/utils/set-layers-id.js +12 -4
- package/esm/map/utils/set-layers-id.js.map +2 -2
- package/esm/map/utils/tooltip-type-guards.js +1 -1
- package/esm/map/utils/tooltip-type-guards.js.map +2 -2
- package/esm/map/utils/use-set-map-initial-configuration.js.map +2 -2
- package/index.d.ts +2 -2
- package/map/MapView.d.ts +1 -1
- package/map/MapView.js +13 -9
- package/map/components/BubbleLayer/BubbleCircleLayer.js +5 -5
- package/map/components/BubbleLayer/BubbleLayer.js +2 -2
- package/map/components/BubbleLayer/BubbleOutlineLayer.js +2 -2
- package/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.d.ts +2 -18
- package/map/components/ChoroplethLayer/ChoroplethLayer.d.ts +1 -1
- package/map/components/ChoroplethLayer/ChoroplethLayer.js +42 -22
- package/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js +2 -1
- package/map/components/ConnectionLayer/ConnectionLayer.d.ts +2 -2
- package/map/components/ConnectionLayer/ConnectionLayer.js +29 -41
- package/map/components/ConnectionLayer/ConnectionLayerDirection.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerDirection.js +9 -4
- package/map/components/ConnectionLayer/ConnectionLayerLine.d.ts +12 -0
- package/map/components/ConnectionLayer/ConnectionLayerLine.js +66 -0
- package/map/components/ConnectionLayer/utils/{get-arc-line-features.d.ts → get-arc-line-feature.d.ts} +1 -1
- package/map/components/ConnectionLayer/utils/{get-arc-line-features.js → get-arc-line-feature.js} +6 -10
- package/map/components/ConnectionLayer/utils/{get-straight-line-features.d.ts → get-straight-line-feature.d.ts} +1 -1
- package/map/components/ConnectionLayer/utils/{get-straight-line-features.js → get-straight-line-feature.js} +6 -7
- package/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.d.ts +1 -1
- package/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js +24 -19
- package/map/components/ConnectionLayer/utils/parse-direction-data-to-geo-json.d.ts +1 -1
- package/map/components/DotLayer/BackgroundLayer.js +2 -2
- package/map/components/DotLayer/DotLayer.js +5 -5
- package/map/components/DotLayer/utils/parse-dot-data-to-geo-json.d.ts +2 -19
- package/map/components/MapContent.d.ts +5 -1
- package/map/components/MapContent.js +28 -8
- package/map/components/MapUnavailable.d.ts +2 -2
- package/map/components/MapUnavailable.js +2 -2
- package/map/components/toolbar/buttons/MapResetButton.js +2 -2
- package/map/components/toolbar/buttons/MapZoomInOutButtons.js +2 -2
- package/map/components/toolbar/buttons/MapZoomToFitButton.js +2 -2
- package/map/constants.d.ts +13 -10
- package/map/constants.js +23 -17
- package/map/contexts/map-data-bounding-box.context.js +1 -1
- package/map/hooks/use-active-interaction.js +15 -2
- package/map/hooks/use-attach-image-from-icon.js +5 -2
- package/map/hooks/use-attach-symbol-to-map.js +2 -2
- package/map/hooks/use-hover-interaction.js +2 -2
- package/map/hooks/use-legend-interaction-highlighting.d.ts +2 -1
- package/map/hooks/use-legend-interaction-highlighting.js +31 -2
- package/map/hooks/use-legend-interaction-visibility.d.ts +2 -1
- package/map/hooks/use-legend-interaction-visibility.js +11 -2
- package/map/hooks/use-load-map-base-layer.d.ts +1 -1
- package/map/hooks/use-load-map-base-layer.js +4 -4
- package/map/hooks/use-map-mouse-move.js +2 -2
- package/map/hooks/use-resolve-color.d.ts +4 -2
- package/map/hooks/use-resolve-color.js +4 -0
- package/map/providers/imperative-handler.provider.js +2 -2
- package/map/providers/map-initial-view.provider.js +2 -2
- package/map/slots/BaseLayer.d.ts +4 -1
- package/map/slots/BubbleLayer.d.ts +1 -0
- package/map/slots/CategoricalLegend.d.ts +4 -1
- package/map/slots/ChartInteractions.d.ts +4 -1
- package/map/slots/ChartInteractions.js +3 -3
- package/map/slots/ChoroplethLayer.d.ts +1 -0
- package/map/slots/ConnectionLayer.d.ts +2 -1
- package/map/slots/DotLayer.d.ts +1 -0
- package/map/slots/SequentialLegend.d.ts +4 -1
- package/map/slots/ThresholdLegend.d.ts +4 -1
- package/map/slots/states/ErrorStateSlot.d.ts +6 -0
- package/map/types/base-layer.d.ts +4 -0
- package/map/types/bubble-layer.d.ts +4 -0
- package/map/types/choropleth-layer.d.ts +2 -0
- package/map/types/coloring.d.ts +16 -0
- package/map/types/connection-layer.d.ts +11 -7
- package/map/types/dot-layer.d.ts +2 -0
- package/map/types/legend.d.ts +18 -6
- package/map/types/location.d.ts +4 -1
- package/map/types/map-view.d.ts +10 -1
- package/map/types/shapes.d.ts +5 -1
- package/map/types/toolbar.d.ts +4 -1
- package/map/types/tooltip.d.ts +16 -1
- package/map/utils/attach-image-from-shape.d.ts +1 -1
- package/map/utils/attach-image-from-shape.js +3 -0
- package/map/utils/attach-image-from-string.d.ts +1 -1
- package/map/utils/attach-image-from-text.d.ts +1 -1
- package/map/utils/attach-image-to-map.d.ts +1 -1
- package/map/utils/attach-image-to-map.js +12 -5
- package/map/utils/build-scale-from-legend-config.js +5 -1
- package/map/utils/create-categorical-color-scheme-from-custom-color-object.d.ts +5 -0
- package/map/utils/create-categorical-color-scheme-from-custom-color-object.js +35 -0
- package/map/utils/extract-layers-data.d.ts +3 -2
- package/map/utils/extract-layers-data.js +50 -13
- package/map/utils/iterate-config-slots.d.ts +2 -1
- package/map/utils/iterate-config-slots.js +4 -2
- package/map/utils/set-layers-id.d.ts +1 -1
- package/map/utils/set-layers-id.js +12 -4
- package/map/utils/tooltip-type-guards.js +1 -1
- package/map/utils/use-set-map-initial-configuration.d.ts +1 -1
- package/package.json +8 -9
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-features.js +0 -12
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-features.js.map +0 -7
|
@@ -30,15 +30,15 @@ __export(MapZoomInOutButtons_exports, {
|
|
|
30
30
|
MapZoomInOutButtons: () => MapZoomInOutButtons
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(MapZoomInOutButtons_exports);
|
|
33
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
33
34
|
var import_react = __toESM(require("react"));
|
|
34
35
|
var import_react_intl = require("react-intl");
|
|
35
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
36
36
|
var import_charts = require("@dynatrace/strato-components-preview/charts");
|
|
37
37
|
var import_strato_icons = require("@dynatrace/strato-icons");
|
|
38
38
|
var import_constants = require("../constants.js");
|
|
39
39
|
var import_use_a11y_toolbar_tab_index = require("../hooks/use-a11y-toolbar-tab-index.js");
|
|
40
40
|
const MapZoomInOutButtons = () => {
|
|
41
|
-
const { current: map } = (0,
|
|
41
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
42
42
|
const isMaxZoom = map && map?.getMaxZoom() === map?.getZoom();
|
|
43
43
|
const isMinZoom = map && map?.getMinZoom() === map?.getZoom();
|
|
44
44
|
const zoomInButtonRef = (0, import_react.useRef)();
|
|
@@ -30,9 +30,9 @@ __export(MapZoomToFitButton_exports, {
|
|
|
30
30
|
MapZoomToFitButton: () => MapZoomToFitButton
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(MapZoomToFitButton_exports);
|
|
33
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
33
34
|
var import_react = __toESM(require("react"));
|
|
34
35
|
var import_react_intl = require("react-intl");
|
|
35
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
36
36
|
var import_charts = require("@dynatrace/strato-components-preview/charts");
|
|
37
37
|
var import_strato_icons = require("@dynatrace/strato-icons");
|
|
38
38
|
var import_constants = require("../../../constants.js");
|
|
@@ -41,7 +41,7 @@ var import_constants2 = require("../constants.js");
|
|
|
41
41
|
var import_use_a11y_toolbar_tab_index = require("../hooks/use-a11y-toolbar-tab-index.js");
|
|
42
42
|
const MapZoomToFitButton = () => {
|
|
43
43
|
const resetButtonRef = (0, import_react.useRef)();
|
|
44
|
-
const { current: map } = (0,
|
|
44
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
45
45
|
const tabIndex = (0, import_use_a11y_toolbar_tab_index.useA11yToolbarTabIndex)("zoom-to-fit");
|
|
46
46
|
const intl = (0, import_react_intl.useIntl)();
|
|
47
47
|
const boundingBox = (0, import_use_data_bounding_box.useDataBoundingBox)();
|
package/map/constants.d.ts
CHANGED
|
@@ -2,13 +2,15 @@ import type { ExpressionSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
|
2
2
|
import type { _TruncationMode as TruncationMode } from '@dynatrace/strato-components/typography';
|
|
3
3
|
import type { BaseLayerRules } from './types/base-layer.js';
|
|
4
4
|
export declare const DEFAULT_COUNTRIES_FILL_COLOR: string;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const DEFAULT_BOUNDARIES_BORDER_COLOR: string;
|
|
6
|
+
export declare const COUNTRY_BORDER_WIDTH = 1;
|
|
7
|
+
export declare const REGION_BORDER_WIDTH = 0.4;
|
|
6
8
|
export declare const TRANSPARENT_BORDER_COLOR = "#00000000";
|
|
7
|
-
export declare const MAX_LATITUDE =
|
|
8
|
-
export declare const MIN_LATITUDE = -
|
|
9
|
-
export declare const MAX_LONGITUDE =
|
|
10
|
-
export declare const MIN_LONGITUDE = -
|
|
11
|
-
export declare const
|
|
9
|
+
export declare const MAX_LATITUDE = 85;
|
|
10
|
+
export declare const MIN_LATITUDE = -60;
|
|
11
|
+
export declare const MAX_LONGITUDE = 179.99;
|
|
12
|
+
export declare const MIN_LONGITUDE = -179.99;
|
|
13
|
+
export declare const WORLD_VIEW_MAX_BOUNDARIES: [number, number, number, number];
|
|
12
14
|
export declare const DEFAULT_COUNTRY_CODE = "default";
|
|
13
15
|
export declare const FIT_BOUNDS_OPTIONS: {
|
|
14
16
|
padding: number;
|
|
@@ -21,11 +23,12 @@ export declare const ACTIVE_COLOR: string;
|
|
|
21
23
|
export declare const BASE_LAYER_FILL_ID = "geojson-fill";
|
|
22
24
|
export declare const BASE_LAYER_LINE_ID = "geojson-line";
|
|
23
25
|
export declare const BASE_LAYER_IDS: string[];
|
|
24
|
-
export declare const
|
|
26
|
+
export declare const SHAPE_OPACITY_DEFAULT = 1;
|
|
27
|
+
export declare const SHAPE_OPACITY_DIMMED = 0.2;
|
|
25
28
|
export declare const DEFAULT_SYMBOL_SIZE = 32;
|
|
26
29
|
export declare const FALLBACK_SYMBOL_SIZE = 1;
|
|
27
30
|
export declare const DEFAULT_TRUNCATION_MODE: TruncationMode;
|
|
28
|
-
export declare const CDN_BASE_PATH: "https://dt-cdn.net/scripts/data/worldmap/maps/
|
|
31
|
+
export declare const CDN_BASE_PATH: "https://dt-cdn.net/scripts/data/worldmap/maps/v004/";
|
|
29
32
|
export declare const INCLUDE_ALL_WILDCARD_RULE: "*";
|
|
30
33
|
export declare const DEFAULT_BASIC_SHAPE_COLOR_TOKEN: {
|
|
31
34
|
Default: string;
|
|
@@ -40,7 +43,6 @@ export declare const DEFAULT_FORMATTER: {
|
|
|
40
43
|
maximumFractionDigits: number;
|
|
41
44
|
};
|
|
42
45
|
export declare const DEFAULT_RANGE_COLOR: string;
|
|
43
|
-
export declare const LEGEND_DIM_OPACITY = 0.2;
|
|
44
46
|
export declare const DEFAULT_SEQUENTIAL_LEGEND_COLOR_PALETTE = "blue";
|
|
45
47
|
export declare const ICON_BACKGROUND_OPACITY = 0.7;
|
|
46
48
|
export declare const ICON_BACKGROUND_RADIUS = 16;
|
|
@@ -63,7 +65,8 @@ export declare const MIN_LINE_THICKNESS = 1;
|
|
|
63
65
|
export declare const MAX_LINE_THICKNESS = 64;
|
|
64
66
|
export declare const DIRECTION_ICON_OUTPUT_SIZE = 128;
|
|
65
67
|
export declare const DIRECTION_ICON_SHRINK_RATIO: number;
|
|
66
|
-
export declare const
|
|
68
|
+
export declare const ACTIVE_BORDER_WIDTH_OUTER = 3;
|
|
69
|
+
export declare const ACTIVE_BORDER_WIDTH_INNER = 1;
|
|
67
70
|
export declare const DEFAULT_CHOROPLETH_COLOR: string;
|
|
68
71
|
export declare const COPY_TO_CLIPBOARD_MESSAGES: {
|
|
69
72
|
copyActionCoords: {
|
package/map/constants.js
CHANGED
|
@@ -27,8 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
var constants_exports = {};
|
|
29
29
|
__export(constants_exports, {
|
|
30
|
+
ACTIVE_BORDER_WIDTH_INNER: () => ACTIVE_BORDER_WIDTH_INNER,
|
|
31
|
+
ACTIVE_BORDER_WIDTH_OUTER: () => ACTIVE_BORDER_WIDTH_OUTER,
|
|
30
32
|
ACTIVE_COLOR: () => ACTIVE_COLOR,
|
|
31
|
-
ACTIVE_STATE_BORDERS_WIDTH: () => ACTIVE_STATE_BORDERS_WIDTH,
|
|
32
33
|
BASE_LAYER_FILL_ID: () => BASE_LAYER_FILL_ID,
|
|
33
34
|
BASE_LAYER_IDS: () => BASE_LAYER_IDS,
|
|
34
35
|
BASE_LAYER_LINE_ID: () => BASE_LAYER_LINE_ID,
|
|
@@ -37,11 +38,12 @@ __export(constants_exports, {
|
|
|
37
38
|
BUBBLE_STROKE: () => BUBBLE_STROKE,
|
|
38
39
|
CDN_BASE_PATH: () => CDN_BASE_PATH,
|
|
39
40
|
COPY_TO_CLIPBOARD_MESSAGES: () => COPY_TO_CLIPBOARD_MESSAGES,
|
|
41
|
+
COUNTRY_BORDER_WIDTH: () => COUNTRY_BORDER_WIDTH,
|
|
40
42
|
DEFAULT_BASE_LAYER_RULES: () => DEFAULT_BASE_LAYER_RULES,
|
|
41
43
|
DEFAULT_BASIC_SHAPE_COLOR_TOKEN: () => DEFAULT_BASIC_SHAPE_COLOR_TOKEN,
|
|
44
|
+
DEFAULT_BOUNDARIES_BORDER_COLOR: () => DEFAULT_BOUNDARIES_BORDER_COLOR,
|
|
42
45
|
DEFAULT_BUBBLE_COLOR: () => DEFAULT_BUBBLE_COLOR,
|
|
43
46
|
DEFAULT_CHOROPLETH_COLOR: () => DEFAULT_CHOROPLETH_COLOR,
|
|
44
|
-
DEFAULT_COUNTRIES_BORDER_COLOR: () => DEFAULT_COUNTRIES_BORDER_COLOR,
|
|
45
47
|
DEFAULT_COUNTRIES_FILL_COLOR: () => DEFAULT_COUNTRIES_FILL_COLOR,
|
|
46
48
|
DEFAULT_COUNTRY_CODE: () => DEFAULT_COUNTRY_CODE,
|
|
47
49
|
DEFAULT_FORMATTER: () => DEFAULT_FORMATTER,
|
|
@@ -72,28 +74,31 @@ __export(constants_exports, {
|
|
|
72
74
|
ICON_BACKGROUND_OPACITY: () => ICON_BACKGROUND_OPACITY,
|
|
73
75
|
ICON_BACKGROUND_RADIUS: () => ICON_BACKGROUND_RADIUS,
|
|
74
76
|
INCLUDE_ALL_WILDCARD_RULE: () => INCLUDE_ALL_WILDCARD_RULE,
|
|
75
|
-
LEGEND_DIM_OPACITY: () => LEGEND_DIM_OPACITY,
|
|
76
77
|
MAX_LATITUDE: () => MAX_LATITUDE,
|
|
77
78
|
MAX_LINE_THICKNESS: () => MAX_LINE_THICKNESS,
|
|
78
79
|
MAX_LONGITUDE: () => MAX_LONGITUDE,
|
|
79
80
|
MIN_LATITUDE: () => MIN_LATITUDE,
|
|
80
81
|
MIN_LINE_THICKNESS: () => MIN_LINE_THICKNESS,
|
|
81
82
|
MIN_LONGITUDE: () => MIN_LONGITUDE,
|
|
82
|
-
|
|
83
|
+
REGION_BORDER_WIDTH: () => REGION_BORDER_WIDTH,
|
|
84
|
+
SHAPE_OPACITY_DEFAULT: () => SHAPE_OPACITY_DEFAULT,
|
|
85
|
+
SHAPE_OPACITY_DIMMED: () => SHAPE_OPACITY_DIMMED,
|
|
83
86
|
TRANSPARENT_BORDER_COLOR: () => TRANSPARENT_BORDER_COLOR,
|
|
84
|
-
|
|
87
|
+
WORLD_VIEW_MAX_BOUNDARIES: () => WORLD_VIEW_MAX_BOUNDARIES
|
|
85
88
|
});
|
|
86
89
|
module.exports = __toCommonJS(constants_exports);
|
|
87
90
|
var import_react_intl = require("react-intl");
|
|
88
91
|
var import_colors = __toESM(require("@dynatrace/strato-design-tokens/colors"));
|
|
89
|
-
const DEFAULT_COUNTRIES_FILL_COLOR = import_colors.default.
|
|
90
|
-
const
|
|
92
|
+
const DEFAULT_COUNTRIES_FILL_COLOR = import_colors.default.Background.Container.Neutral.Default;
|
|
93
|
+
const DEFAULT_BOUNDARIES_BORDER_COLOR = import_colors.default.Border.Neutral.Default;
|
|
94
|
+
const COUNTRY_BORDER_WIDTH = 1;
|
|
95
|
+
const REGION_BORDER_WIDTH = 0.4;
|
|
91
96
|
const TRANSPARENT_BORDER_COLOR = "#00000000";
|
|
92
|
-
const MAX_LATITUDE =
|
|
93
|
-
const MIN_LATITUDE = -
|
|
94
|
-
const MAX_LONGITUDE =
|
|
95
|
-
const MIN_LONGITUDE = -
|
|
96
|
-
const
|
|
97
|
+
const MAX_LATITUDE = 85;
|
|
98
|
+
const MIN_LATITUDE = -60;
|
|
99
|
+
const MAX_LONGITUDE = 179.99;
|
|
100
|
+
const MIN_LONGITUDE = -179.99;
|
|
101
|
+
const WORLD_VIEW_MAX_BOUNDARIES = [
|
|
97
102
|
MAX_LONGITUDE,
|
|
98
103
|
MAX_LATITUDE,
|
|
99
104
|
MIN_LONGITUDE,
|
|
@@ -105,15 +110,16 @@ const DEFAULT_MAP_HEIGHT = 400;
|
|
|
105
110
|
const DEFAULT_MAP_LEGEND_RATIO = "auto";
|
|
106
111
|
const DEFAULT_MAP_POSITION = "auto";
|
|
107
112
|
const DEFAULT_INPUT_ICON_SIZE = 20;
|
|
108
|
-
const ACTIVE_COLOR = import_colors.default.Border.Neutral.
|
|
113
|
+
const ACTIVE_COLOR = import_colors.default.Border.Neutral.Accent;
|
|
109
114
|
const BASE_LAYER_FILL_ID = "geojson-fill";
|
|
110
115
|
const BASE_LAYER_LINE_ID = "geojson-line";
|
|
111
116
|
const BASE_LAYER_IDS = [BASE_LAYER_LINE_ID, BASE_LAYER_FILL_ID];
|
|
112
|
-
const
|
|
117
|
+
const SHAPE_OPACITY_DEFAULT = 1;
|
|
118
|
+
const SHAPE_OPACITY_DIMMED = 0.2;
|
|
113
119
|
const DEFAULT_SYMBOL_SIZE = 32;
|
|
114
120
|
const FALLBACK_SYMBOL_SIZE = 1;
|
|
115
121
|
const DEFAULT_TRUNCATION_MODE = "middle";
|
|
116
|
-
const CDN_BASE_PATH = "https://dt-cdn.net/scripts/data/worldmap/maps/
|
|
122
|
+
const CDN_BASE_PATH = "https://dt-cdn.net/scripts/data/worldmap/maps/v004/";
|
|
117
123
|
const INCLUDE_ALL_WILDCARD_RULE = "*";
|
|
118
124
|
const DEFAULT_BASIC_SHAPE_COLOR_TOKEN = import_colors.default.Charts.CategoricalThemed.PurpleRain.Color01;
|
|
119
125
|
const DEFAULT_LEGEND_SIZES = {
|
|
@@ -130,7 +136,6 @@ const DEFAULT_FORMATTER = {
|
|
|
130
136
|
maximumFractionDigits: 1
|
|
131
137
|
};
|
|
132
138
|
const DEFAULT_RANGE_COLOR = import_colors.default.Background.Container.Neutral.Accent;
|
|
133
|
-
const LEGEND_DIM_OPACITY = 0.2;
|
|
134
139
|
const DEFAULT_SEQUENTIAL_LEGEND_COLOR_PALETTE = "blue";
|
|
135
140
|
const ICON_BACKGROUND_OPACITY = 0.7;
|
|
136
141
|
const ICON_BACKGROUND_RADIUS = 16;
|
|
@@ -156,7 +161,8 @@ const MIN_LINE_THICKNESS = 1;
|
|
|
156
161
|
const MAX_LINE_THICKNESS = 64;
|
|
157
162
|
const DIRECTION_ICON_OUTPUT_SIZE = 128;
|
|
158
163
|
const DIRECTION_ICON_SHRINK_RATIO = 1 / 15;
|
|
159
|
-
const
|
|
164
|
+
const ACTIVE_BORDER_WIDTH_OUTER = 3;
|
|
165
|
+
const ACTIVE_BORDER_WIDTH_INNER = 1;
|
|
160
166
|
const DEFAULT_CHOROPLETH_COLOR = import_colors.default.Charts.Sequential.Blue.Color05.Default;
|
|
161
167
|
const COPY_TO_CLIPBOARD_MESSAGES = (0, import_react_intl.defineMessages)({
|
|
162
168
|
copyActionCoords: {
|
|
@@ -32,4 +32,4 @@ __export(map_data_bounding_box_context_exports, {
|
|
|
32
32
|
module.exports = __toCommonJS(map_data_bounding_box_context_exports);
|
|
33
33
|
var import_react = __toESM(require("react"));
|
|
34
34
|
var import_constants = require("../constants.js");
|
|
35
|
-
const MapDataBoundingBoxContext = import_react.default.createContext(import_constants.
|
|
35
|
+
const MapDataBoundingBoxContext = import_react.default.createContext(import_constants.WORLD_VIEW_MAX_BOUNDARIES);
|
|
@@ -20,17 +20,18 @@ __export(use_active_interaction_exports, {
|
|
|
20
20
|
useActiveInteraction: () => useActiveInteraction
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_active_interaction_exports);
|
|
23
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
23
24
|
var import_lodash_es = require("lodash");
|
|
24
25
|
var import_react = require("react");
|
|
25
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
26
26
|
var import_constants = require("../constants.js");
|
|
27
27
|
const useActiveInteraction = () => {
|
|
28
|
-
const map = (0,
|
|
28
|
+
const map = (0, import_react_maplibre.useMap)().current;
|
|
29
29
|
let featureId;
|
|
30
30
|
let sourceId;
|
|
31
31
|
const handleClick = (0, import_react.useCallback)(
|
|
32
32
|
({ point }) => {
|
|
33
33
|
const features = map.queryRenderedFeatures(point);
|
|
34
|
+
const allFeatures = map.queryRenderedFeatures();
|
|
34
35
|
const layerId = features?.[0]?.layer?.id;
|
|
35
36
|
const hasHoveredFeatures = !(0, import_lodash_es.isNil)(features) && features.length > 0 && !(0, import_lodash_es.isUndefined)(layerId);
|
|
36
37
|
const isBaseLayer = import_constants.BASE_LAYER_IDS.includes(layerId);
|
|
@@ -48,12 +49,24 @@ const useActiveInteraction = () => {
|
|
|
48
49
|
{ source: sourceId, id: featureId },
|
|
49
50
|
{ active: !activeState }
|
|
50
51
|
);
|
|
52
|
+
allFeatures.map(
|
|
53
|
+
(feature) => map.setFeatureState(
|
|
54
|
+
{ source: feature.layer.source, id: feature.id },
|
|
55
|
+
{ isAnyActive: !activeState }
|
|
56
|
+
)
|
|
57
|
+
);
|
|
51
58
|
} else {
|
|
52
59
|
if (!(0, import_lodash_es.isUndefined)(featureId) && !(0, import_lodash_es.isUndefined)(sourceId)) {
|
|
53
60
|
map.setFeatureState(
|
|
54
61
|
{ source: sourceId, id: featureId },
|
|
55
62
|
{ active: false }
|
|
56
63
|
);
|
|
64
|
+
allFeatures.map(
|
|
65
|
+
(feature) => map.setFeatureState(
|
|
66
|
+
{ source: feature.layer.source, id: feature.id },
|
|
67
|
+
{ isAnyActive: false }
|
|
68
|
+
)
|
|
69
|
+
);
|
|
57
70
|
}
|
|
58
71
|
}
|
|
59
72
|
},
|
|
@@ -20,10 +20,10 @@ __export(use_attach_image_from_icon_exports, {
|
|
|
20
20
|
useAttachImageFromIcon: () => useAttachImageFromIcon
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_attach_image_from_icon_exports);
|
|
23
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
23
24
|
var import_lodash_es = require("lodash");
|
|
24
25
|
var import_react = require("react");
|
|
25
26
|
var import_client = require("react-dom/client");
|
|
26
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
27
27
|
var import_use_safe_svg_parser = require("./use-safe-svg-parser.js");
|
|
28
28
|
var import_constants = require("../constants.js");
|
|
29
29
|
var import_attach_image_to_map = require("../utils/attach-image-to-map.js");
|
|
@@ -33,7 +33,7 @@ var import_get_scaled_symbol_size = require("../utils/get-scaled-symbol-size.js"
|
|
|
33
33
|
const useAttachImageFromIcon = (icon, suffix, outputSize) => {
|
|
34
34
|
const { elementAsString, ref } = (0, import_use_safe_svg_parser.useSafeSvgParser)();
|
|
35
35
|
const defaultScaledIconSize = (0, import_get_scaled_symbol_size.getScaledSymbolSize)();
|
|
36
|
-
const { current: map } = (0,
|
|
36
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
37
37
|
const img = new Image(defaultScaledIconSize, defaultScaledIconSize);
|
|
38
38
|
const fakeDomContainer = document.createElement("div");
|
|
39
39
|
(0, import_react.useLayoutEffect)(() => {
|
|
@@ -55,6 +55,9 @@ const useAttachImageFromIcon = (icon, suffix, outputSize) => {
|
|
|
55
55
|
import_constants.DEFAULT_INPUT_ICON_SIZE,
|
|
56
56
|
(0, import_create_bitmap_config_options.createBitmapConfigOptions)(outputSize)
|
|
57
57
|
).then((bitmap) => {
|
|
58
|
+
if (!map) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
58
61
|
const iconName = `custom-icon-${suffix}`;
|
|
59
62
|
(0, import_attach_image_to_map.attachImageToMap)(map, bitmap, iconName);
|
|
60
63
|
});
|
|
@@ -20,12 +20,12 @@ __export(use_attach_symbol_to_map_exports, {
|
|
|
20
20
|
useAttachSymbolToMap: () => useAttachSymbolToMap
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_attach_symbol_to_map_exports);
|
|
23
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
23
24
|
var import_lodash_es = require("lodash");
|
|
24
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
25
25
|
var import_use_attach_image_from_icon = require("./use-attach-image-from-icon.js");
|
|
26
26
|
var import_attach_image_from_string = require("../utils/attach-image-from-string.js");
|
|
27
27
|
const useAttachSymbolToMap = (icon, suffix = "", outputSize) => {
|
|
28
|
-
const { current: map } = (0,
|
|
28
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
29
29
|
const customIconAttached = (0, import_use_attach_image_from_icon.useAttachImageFromIcon)(icon, suffix, outputSize);
|
|
30
30
|
if ((0, import_lodash_es.isNil)(map)) {
|
|
31
31
|
return null;
|
|
@@ -20,9 +20,9 @@ __export(use_hover_interaction_exports, {
|
|
|
20
20
|
useHoverInteraction: () => useHoverInteraction
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_hover_interaction_exports);
|
|
23
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
23
24
|
var import_lodash_es = require("lodash");
|
|
24
25
|
var import_react = require("react");
|
|
25
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
26
26
|
var import_constants = require("../constants.js");
|
|
27
27
|
var import_associated_features = require("../utils/associated-features.js");
|
|
28
28
|
const featureExists = (map, source, id) => {
|
|
@@ -67,7 +67,7 @@ const hoverFeature = (map, source, id) => {
|
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
const useHoverInteraction = () => {
|
|
70
|
-
const map = (0,
|
|
70
|
+
const map = (0, import_react_maplibre.useMap)().current;
|
|
71
71
|
let featureId;
|
|
72
72
|
let sourceId;
|
|
73
73
|
const handleMouseOut = (0, import_react.useCallback)(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BubbleLayerProps } from '../types/bubble-layer.js';
|
|
2
2
|
import type { ChoroplethLayerProps } from '../types/choropleth-layer.js';
|
|
3
|
+
import type { Connection, ConnectionLayerProps } from '../types/connection-layer.js';
|
|
3
4
|
import type { DotLayerProps } from '../types/dot-layer.js';
|
|
4
5
|
import type { Location } from '../types/location.js';
|
|
5
|
-
export declare const useLegendInteractionHighlighting: <L extends Location, R extends Record<string, unknown>>(props: DotLayerProps<L> | BubbleLayerProps<L> | ChoroplethLayerProps<R>, sourceId: string) => void;
|
|
6
|
+
export declare const useLegendInteractionHighlighting: <L extends Location, C extends Connection, R extends Record<string, unknown>>(props: DotLayerProps<L> | BubbleLayerProps<L> | ChoroplethLayerProps<R> | ConnectionLayerProps<C>, sourceId: string) => void;
|
|
@@ -20,13 +20,14 @@ __export(use_legend_interaction_highlighting_exports, {
|
|
|
20
20
|
useLegendInteractionHighlighting: () => useLegendInteractionHighlighting
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_legend_interaction_highlighting_exports);
|
|
23
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
23
24
|
var import_lodash_es = require("lodash");
|
|
24
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
25
25
|
var import_selectors = require("../store/selectors.js");
|
|
26
26
|
var import_coloring = require("../types/coloring.js");
|
|
27
|
+
var import_associated_features = require("../utils/associated-features.js");
|
|
27
28
|
const useLegendInteractionHighlighting = (props, sourceId) => {
|
|
28
29
|
const { highlightedSeries } = (0, import_selectors.useMapSelectionState)();
|
|
29
|
-
const { current: map } = (0,
|
|
30
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
30
31
|
if ((0, import_coloring.isLegendColoring)(props) && !(0, import_lodash_es.isUndefined)(map)) {
|
|
31
32
|
const hoveredByLegend = map.querySourceFeatures(sourceId, {
|
|
32
33
|
filter: ["all"]
|
|
@@ -37,6 +38,18 @@ const useLegendInteractionHighlighting = (props, sourceId) => {
|
|
|
37
38
|
{ legendHover: true }
|
|
38
39
|
)
|
|
39
40
|
);
|
|
41
|
+
if ((0, import_associated_features.hasAssociatedFeatures)(sourceId)) {
|
|
42
|
+
const associatedId = `${sourceId}-direction`;
|
|
43
|
+
const hoveredByLegend2 = map.querySourceFeatures(associatedId, {
|
|
44
|
+
filter: ["all"]
|
|
45
|
+
});
|
|
46
|
+
hoveredByLegend2?.map(
|
|
47
|
+
(ft) => map.setFeatureState(
|
|
48
|
+
{ source: associatedId, id: ft.id },
|
|
49
|
+
{ legendHover: true }
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
40
53
|
if (highlightedSeries) {
|
|
41
54
|
const highlightedSeriesNames = highlightedSeries.map((s) => s.name);
|
|
42
55
|
const hoveredByLegend2 = map.querySourceFeatures(sourceId, {
|
|
@@ -48,6 +61,22 @@ const useLegendInteractionHighlighting = (props, sourceId) => {
|
|
|
48
61
|
{ legendHover: false }
|
|
49
62
|
)
|
|
50
63
|
);
|
|
64
|
+
if ((0, import_associated_features.hasAssociatedFeatures)(sourceId)) {
|
|
65
|
+
const associatedId = `${sourceId}-direction`;
|
|
66
|
+
const hoveredByLegend3 = map.querySourceFeatures(associatedId, {
|
|
67
|
+
filter: ["!in", props.valueAccessor, ...highlightedSeriesNames]
|
|
68
|
+
});
|
|
69
|
+
hoveredByLegend3?.map(
|
|
70
|
+
(ft) => map.setFeatureState(
|
|
71
|
+
{ source: associatedId, id: ft.id },
|
|
72
|
+
{ legendHover: false }
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
hoveredByLegend?.map(
|
|
78
|
+
(ft) => map.removeFeatureState({ source: sourceId, id: ft.id }, "legendHover")
|
|
79
|
+
);
|
|
51
80
|
}
|
|
52
81
|
}
|
|
53
82
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BubbleLayerProps } from '../types/bubble-layer.js';
|
|
2
2
|
import type { ChoroplethLayerProps } from '../types/choropleth-layer.js';
|
|
3
|
+
import { Connection, ConnectionLayerProps } from '../types/connection-layer.js';
|
|
3
4
|
import type { DotLayerProps } from '../types/dot-layer.js';
|
|
4
5
|
import type { Location } from '../types/location.js';
|
|
5
|
-
export declare const useLegendInteractionVisibility: <L extends Location, R extends Record<string, unknown>>(props: DotLayerProps<L> | BubbleLayerProps<L> | ChoroplethLayerProps<R>, layerId: string) => void;
|
|
6
|
+
export declare const useLegendInteractionVisibility: <L extends Location, C extends Connection, R extends Record<string, unknown>>(props: DotLayerProps<L> | BubbleLayerProps<L> | ChoroplethLayerProps<R> | ConnectionLayerProps<C>, layerId: string) => void;
|
|
@@ -20,13 +20,14 @@ __export(use_legend_interaction_visibility_exports, {
|
|
|
20
20
|
useLegendInteractionVisibility: () => useLegendInteractionVisibility
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_legend_interaction_visibility_exports);
|
|
23
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
23
24
|
var import_lodash_es = require("lodash");
|
|
24
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
25
25
|
var import_selectors = require("../store/selectors.js");
|
|
26
26
|
var import_coloring = require("../types/coloring.js");
|
|
27
|
+
var import_associated_features = require("../utils/associated-features.js");
|
|
27
28
|
const useLegendInteractionVisibility = (props, layerId) => {
|
|
28
29
|
const { visible } = (0, import_selectors.useMapSelectionState)();
|
|
29
|
-
const { current: map } = (0,
|
|
30
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
30
31
|
if ((0, import_coloring.isLegendColoring)(props) && !(0, import_lodash_es.isUndefined)(map)) {
|
|
31
32
|
if (!(0, import_lodash_es.isUndefined)(visible)) {
|
|
32
33
|
const mapInstance = map.getMap();
|
|
@@ -36,6 +37,14 @@ const useLegendInteractionVisibility = (props, layerId) => {
|
|
|
36
37
|
props.valueAccessor,
|
|
37
38
|
...visibleCategoriesNames
|
|
38
39
|
]);
|
|
40
|
+
if ((0, import_associated_features.hasAssociatedFeatures)(layerId)) {
|
|
41
|
+
const associatedId = `${layerId}-direction`;
|
|
42
|
+
mapInstance.setFilter(associatedId, [
|
|
43
|
+
"in",
|
|
44
|
+
props.valueAccessor,
|
|
45
|
+
...visibleCategoriesNames
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
39
48
|
} else {
|
|
40
49
|
const layer = map.getLayer(layerId);
|
|
41
50
|
if (!(0, import_lodash_es.isUndefined)(layer)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FeatureCollection } from 'geojson';
|
|
2
2
|
import type { BaseLayerRules } from '../types/base-layer.js';
|
|
3
3
|
export declare const useLoadMapBaseLayer: (baseLayerConfig: BaseLayerRules) => {
|
|
4
|
-
|
|
4
|
+
isFetchingFeatures: boolean;
|
|
5
5
|
baseFeatureCollection: FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties> | undefined;
|
|
6
6
|
isMapEnabled: boolean;
|
|
7
7
|
error: boolean;
|
|
@@ -29,12 +29,12 @@ var import_get_base_layer_shapes_request_config = require("../utils/get-base-lay
|
|
|
29
29
|
var import_get_tenant_country_code = require("../utils/get-tenant-country-code.js");
|
|
30
30
|
var import_merge_feature_collections = require("../utils/merge-feature-collections.js");
|
|
31
31
|
const useLoadMapBaseLayer = (baseLayerConfig) => {
|
|
32
|
-
const [
|
|
32
|
+
const [isFetchingFeatures, setIsFetchingFeatures] = (0, import_react.useState)(true);
|
|
33
33
|
const [isMapEnabled, setIsMapEnabled] = (0, import_react.useState)(false);
|
|
34
34
|
const [baseFeatureCollection, setBaseFeatureCollection] = (0, import_react.useState)(void 0);
|
|
35
35
|
const [error, setError] = (0, import_react.useState)(false);
|
|
36
36
|
const getData = (0, import_react.useCallback)(async () => {
|
|
37
|
-
|
|
37
|
+
setIsFetchingFeatures(true);
|
|
38
38
|
const isMapEnabledResponse = await (0, import_fetch_client_config_map_enabled.fetchClientConfigMapEnabled)();
|
|
39
39
|
setIsMapEnabled(isMapEnabledResponse);
|
|
40
40
|
try {
|
|
@@ -69,10 +69,10 @@ const useLoadMapBaseLayer = (baseLayerConfig) => {
|
|
|
69
69
|
} catch {
|
|
70
70
|
setError(true);
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
setIsFetchingFeatures(false);
|
|
73
73
|
}, [baseLayerConfig.include, baseLayerConfig.exclude]);
|
|
74
74
|
(0, import_react.useEffect)(() => {
|
|
75
75
|
getData();
|
|
76
76
|
}, [getData]);
|
|
77
|
-
return {
|
|
77
|
+
return { isFetchingFeatures, baseFeatureCollection, isMapEnabled, error };
|
|
78
78
|
};
|
|
@@ -20,10 +20,10 @@ __export(use_map_mouse_move_exports, {
|
|
|
20
20
|
useMapMouseMove: () => useMapMouseMove
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_map_mouse_move_exports);
|
|
23
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
23
24
|
var import_react = require("react");
|
|
24
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
25
25
|
const useMapMouseMove = (layerIds, callback) => {
|
|
26
|
-
const { current: map } = (0,
|
|
26
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
27
27
|
(0, import_react.useEffect)(() => {
|
|
28
28
|
layerIds.forEach((layerId) => {
|
|
29
29
|
map?.on("mousemove", layerId, callback);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ChoroplethCustomColorProps, ColorParser, LegendColorLayerProps, LocationColorProps } from '../types/coloring.js';
|
|
1
|
+
import { ChoroplethCustomColorProps, ColorParser, ConnectionColorProps, LegendColorLayerProps, LocationColorProps } from '../types/coloring.js';
|
|
2
|
+
import { Connection } from '../types/connection-layer.js';
|
|
2
3
|
import { Location } from '../types/location.js';
|
|
3
|
-
export declare const useResolveColor: (defaultColor: string, props: LocationColorProps<never> | ChoroplethCustomColorProps<never> | LegendColorLayerProps, colorParser?: ColorParser) => string | ((item: never) => string);
|
|
4
|
+
export declare const useResolveColor: (defaultColor: string, props: LocationColorProps<never> | ConnectionColorProps<never> | ChoroplethCustomColorProps<never> | LegendColorLayerProps, colorParser?: ColorParser) => string | ((item: never) => string);
|
|
4
5
|
export declare const useResolveLocationColor: <T extends Location>(defaultColor: string, props: LocationColorProps<T> | LegendColorLayerProps, colorParser?: ColorParser) => string | ((item: T) => string);
|
|
6
|
+
export declare const useResolveConnectionColor: <T extends Connection>(defaultColor: string, props: ConnectionColorProps<T> | LegendColorLayerProps, colorParser?: ColorParser) => string | ((item: T) => string);
|
|
5
7
|
export declare const useResolveChoroplethColor: <T extends Record<string, unknown>>(defaultColor: string, props: ChoroplethCustomColorProps<T> | LegendColorLayerProps, colorParser?: ColorParser) => string | ((item: T) => string);
|
|
@@ -19,6 +19,7 @@ var use_resolve_color_exports = {};
|
|
|
19
19
|
__export(use_resolve_color_exports, {
|
|
20
20
|
useResolveChoroplethColor: () => useResolveChoroplethColor,
|
|
21
21
|
useResolveColor: () => useResolveColor,
|
|
22
|
+
useResolveConnectionColor: () => useResolveConnectionColor,
|
|
22
23
|
useResolveLocationColor: () => useResolveLocationColor
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(use_resolve_color_exports);
|
|
@@ -51,6 +52,9 @@ const useResolveColor = (defaultColor, props, colorParser) => {
|
|
|
51
52
|
const useResolveLocationColor = (defaultColor, props, colorParser) => {
|
|
52
53
|
return useResolveColor(defaultColor, props, colorParser);
|
|
53
54
|
};
|
|
55
|
+
const useResolveConnectionColor = (defaultColor, props, colorParser) => {
|
|
56
|
+
return useResolveColor(defaultColor, props, colorParser);
|
|
57
|
+
};
|
|
54
58
|
const useResolveChoroplethColor = (defaultColor, props, colorParser) => {
|
|
55
59
|
return useResolveColor(defaultColor, props, colorParser);
|
|
56
60
|
};
|
|
@@ -20,8 +20,8 @@ __export(imperative_handler_provider_exports, {
|
|
|
20
20
|
MapViewImperativeHandler: () => MapViewImperativeHandler
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(imperative_handler_provider_exports);
|
|
23
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
23
24
|
var import_react = require("react");
|
|
24
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
25
25
|
var import_constants = require("../constants.js");
|
|
26
26
|
var import_use_data_bounding_box = require("../hooks/use-data-bounding-box.js");
|
|
27
27
|
var import_use_initial_view_context = require("../hooks/use-initial-view-context.js");
|
|
@@ -33,7 +33,7 @@ const MapViewImperativeHandler = ({
|
|
|
33
33
|
children
|
|
34
34
|
}) => {
|
|
35
35
|
const layersData = (0, import_use_map_raw_data.useMapRawData)();
|
|
36
|
-
const { current: map } = (0,
|
|
36
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
37
37
|
const { longitude = 0, latitude = 0, zoom = 0 } = (0, import_use_initial_view_context.useInitialViewContext)();
|
|
38
38
|
const boundingBox = (0, import_use_data_bounding_box.useDataBoundingBox)();
|
|
39
39
|
const zoomOutEnabled = map && map?.getMinZoom() !== map?.getZoom();
|
|
@@ -30,14 +30,14 @@ __export(map_initial_view_provider_exports, {
|
|
|
30
30
|
MapInitialViewProvider: () => MapInitialViewProvider
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(map_initial_view_provider_exports);
|
|
33
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
33
34
|
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_react_map_gl = require("react-map-gl");
|
|
35
35
|
var import_map_initial_view_context = require("../contexts/map-initial-view.context.js");
|
|
36
36
|
const DEFAULT_CENTER = { lat: 0, lng: 0 };
|
|
37
37
|
const MapInitialViewProvider = ({
|
|
38
38
|
children
|
|
39
39
|
}) => {
|
|
40
|
-
const { current: map } = (0,
|
|
40
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
41
41
|
const boundaries = (0, import_react.useRef)(map?.getCenter() ?? DEFAULT_CENTER);
|
|
42
42
|
const zoom = (0, import_react.useRef)(map?.getZoom()).current;
|
|
43
43
|
const { lng: longitude, lat: latitude } = boundaries.current;
|
package/map/slots/BaseLayer.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { BaseLayerProps } from '../types/base-layer.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The base layer component, used to configure the inclusion and exclusion of countries and regions
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export declare const BaseLayer: {
|
|
4
7
|
(_props: BaseLayerProps): null;
|
|
5
8
|
displayName: string;
|
|
@@ -5,6 +5,7 @@ import type { Location } from '../types/location.js';
|
|
|
5
5
|
* The `BubbleLayer` component renders data points as bubbles on a map, accepting an array of data points
|
|
6
6
|
* with required properties like latitude and longitude. It supports customization of bubble size
|
|
7
7
|
* using the radius prop and optional tooltips for displaying additional information.
|
|
8
|
+
* @public
|
|
8
9
|
*/
|
|
9
10
|
export declare const BubbleLayer: {
|
|
10
11
|
<T extends Location>(_: PropsWithChildren<BubbleLayerProps<T>>): null;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { CategoricalLegendProps } from '../types/legend.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The categorical legend slot component
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export declare const CategoricalLegend: {
|
|
4
7
|
(props: CategoricalLegendProps): null;
|
|
5
8
|
displayName: string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
2
|
import type { ChartInteractionsProps } from '../types/toolbar.js';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* ChartInteractions interactions slot component
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
4
7
|
export declare const ChartInteractions: {
|
|
5
8
|
(props: PropsWithChildren<ChartInteractionsProps>): null;
|
|
6
9
|
displayName: string;
|
|
@@ -22,9 +22,9 @@ __export(ChartInteractions_exports, {
|
|
|
22
22
|
module.exports = __toCommonJS(ChartInteractions_exports);
|
|
23
23
|
var import_Zoom = require("./Zoom.js");
|
|
24
24
|
var import_ZoomToFit = require("./ZoomToFit.js");
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const ChartInteractions = Object.assign(
|
|
25
|
+
const ChartInteractionsRoot = (props) => null;
|
|
26
|
+
ChartInteractionsRoot["displayName"] = "ChartInteractions";
|
|
27
|
+
const ChartInteractions = Object.assign(ChartInteractionsRoot, {
|
|
28
28
|
Zoom: import_Zoom.Zoom,
|
|
29
29
|
ZoomToFit: import_ZoomToFit.ZoomToFit
|
|
30
30
|
});
|
|
@@ -5,6 +5,7 @@ import type { ChoroplethLayerProps } from '../types/choropleth-layer.js';
|
|
|
5
5
|
* areas or regions that are coloured in relation to a given data. It provides an
|
|
6
6
|
* easy way to visualize how a variable varies across a geographic area or show
|
|
7
7
|
* the level of variability within a region.
|
|
8
|
+
* @public
|
|
8
9
|
*/
|
|
9
10
|
export declare const ChoroplethLayer: {
|
|
10
11
|
<T extends Record<string, unknown>>(_: PropsWithChildren<ChoroplethLayerProps<T>>): null;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Connection, ConnectionLayerProps } from '../types/connection-layer.js';
|
|
3
3
|
/**
|
|
4
4
|
* The `ConnectionLayer` component renders connections between points on a map,
|
|
5
5
|
* accepting an array of `Connection` data points with required properties like
|
|
6
6
|
* latitude and longitude. It supports customization of color, thickness,
|
|
7
7
|
* direction the connection indicators.
|
|
8
|
+
* @public
|
|
8
9
|
*/
|
|
9
10
|
export declare const ConnectionLayer: {
|
|
10
11
|
<T extends Connection>(_: PropsWithChildren<ConnectionLayerProps<T>>): null;
|