@dynatrace/strato-geo 1.8.2 → 1.9.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.
@@ -30,7 +30,7 @@ const SHAPE_OPACITY_DIMMED = 0.2;
30
30
  const DEFAULT_SYMBOL_SIZE = 32;
31
31
  const FALLBACK_SYMBOL_SIZE = 1;
32
32
  const DEFAULT_TRUNCATION_MODE = "middle";
33
- const CDN_BASE_PATH = "https://dt-cdn.net/scripts/data/worldmap/maps/v004/";
33
+ const CDN_BASE_PATH = "https://dt-cdn.net/scripts/data/worldmap/maps/v005/";
34
34
  const INCLUDE_ALL_WILDCARD_RULE = "*";
35
35
  const DEFAULT_BASIC_SHAPE_COLOR_TOKEN = Colors.Charts.CategoricalThemed.PurpleRain.Color01;
36
36
  const DEFAULT_LEGEND_SIZES = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/map/constants.ts"],
4
- "sourcesContent": ["import type { ExpressionSpecification } from '@maplibre/maplibre-gl-style-spec';\nimport { defineMessages } from 'react-intl';\n\nimport type { TruncationMode } from '@dynatrace/strato-components/typography';\nimport Colors from '@dynatrace/strato-design-tokens/colors';\n\nimport type { BaseLayerRules } from './types/base-layer.js';\nimport type { BoundingBoxCoords } from './types/map-view.js';\n\n//region GENERAL\nexport const DEFAULT_COUNTRIES_FILL_COLOR =\n Colors.Background.Container.Neutral.Default;\nexport const DEFAULT_BOUNDARIES_BORDER_COLOR = Colors.Border.Neutral.Default;\nexport const COUNTRY_BORDER_WIDTH = 1;\nexport const REGION_BORDER_WIDTH = 0.4;\nexport const TRANSPARENT_BORDER_COLOR = '#00000000';\n\n// region Map max bounds:\n// These bounds hide the space used by Antarctica and some portion of the North Pole\nexport const MAX_LATITUDE = 85;\nexport const MIN_LATITUDE = -60;\nexport const MAX_LONGITUDE = 179.99;\nexport const MIN_LONGITUDE = -179.99;\n// endregion\n\nexport const WORLD_VIEW_MAX_BOUNDARIES: BoundingBoxCoords = [\n MAX_LONGITUDE,\n MAX_LATITUDE,\n MIN_LONGITUDE,\n MIN_LATITUDE,\n];\nexport const DEFAULT_COUNTRY_CODE = 'default';\nexport const FIT_BOUNDS_OPTIONS = { padding: 20 };\nexport const DEFAULT_MAP_HEIGHT = 400;\nexport const DEFAULT_MAP_LEGEND_RATIO = 'auto';\nexport const DEFAULT_MAP_POSITION = 'auto';\nexport const DEFAULT_INPUT_ICON_SIZE = 20;\nexport const ACTIVE_COLOR = Colors.Border.Neutral.Accent;\n\nexport const BASE_LAYER_FILL_ID = 'geojson-fill';\nexport const BASE_LAYER_LINE_ID = 'geojson-line';\nexport const BASE_LAYER_IDS = [BASE_LAYER_LINE_ID, BASE_LAYER_FILL_ID];\nexport const SHAPE_OPACITY_DEFAULT = 1;\nexport const SHAPE_OPACITY_DIMMED = 0.2;\n\nexport const DEFAULT_SYMBOL_SIZE = 32;\nexport const FALLBACK_SYMBOL_SIZE = 1;\nexport const DEFAULT_TRUNCATION_MODE = 'middle' as TruncationMode;\n\nexport const CDN_BASE_PATH =\n 'https://dt-cdn.net/scripts/data/worldmap/maps/v004/' as const;\nexport const INCLUDE_ALL_WILDCARD_RULE = '*' as const;\n//endregion\n\n//region LEGEND\nexport const DEFAULT_BASIC_SHAPE_COLOR_TOKEN =\n Colors.Charts.CategoricalThemed.PurpleRain.Color01;\nexport const DEFAULT_LEGEND_SIZES = {\n // Minimum size in which the legend can be resized (vertical layout)\n minWidth: 0.1,\n // Minimum size in which the legend can be resized (horizontal layout)\n minHeight: 0.1,\n // Maximum size in which the legend can be resized (vertical layout). 80% represent 4 / 5ths of the container.\n maxWidth: 0.8,\n // Maximum size in which the legend can be resized (horizontal layout). 80% represent 4 / 5ths of the container.\n maxHeight: 0.8,\n};\nexport const DEFAULT_FORMATTER = {\n maximumFractionDigits: 1,\n};\nexport const DEFAULT_RANGE_COLOR = Colors.Background.Container.Neutral.Accent;\nexport const DEFAULT_SEQUENTIAL_LEGEND_COLOR_PALETTE = 'blue';\n//endregion\n\n//region DOT LAYER\nexport const ICON_BACKGROUND_OPACITY = 0.7;\nexport const ICON_BACKGROUND_RADIUS = 16;\nexport const DEFAULT_ICON_BACKGROUND_COLOR =\n Colors.Background.Container.Neutral.Subdued;\nexport const DEFAULT_ICON_SIZE_RATIO = 0.6;\nexport const DEFAULT_SHAPE_COLOR = Colors.Charts.Categorical.Color15.Default;\nexport const DEFAULT_ICON_COLOR = Colors.Icon.Neutral.Default;\n//endregion\n\n//region BUBBLE LAYER\nexport const DEFAULT_BUBBLE_COLOR = Colors.Charts.Categorical.Color07.Default;\nexport const DEFAULT_RADIUS = 12;\nexport const BUBBLE_DEFAULT_OPACITY = 0.4;\nexport const BUBBLE_STROKE = 1;\nexport const BUBBLE_OUTLINE_STROKE = 1;\nexport const DEFAULT_RADIUS_EXPRESSION: ExpressionSpecification = [\n 'get',\n '__radius',\n];\n//endregion\n\n//region CONNECTION LAYER\nexport const DEFAULT_LINE_JOIN: 'bevel' | 'round' | 'miter' = 'miter';\nexport const DEFAULT_LINE_CAP: 'butt' | 'round' | 'square' = 'butt';\nexport const DEFAULT_LINE_THICKNESS = 2;\nexport const DEFAULT_LINE_COLOR = Colors.Charts.Categorical.Color03.Default;\nexport const DEFAULT_LINE_DASH_ARRAY = [5, 2.5];\nexport const MIN_LINE_THICKNESS = 1;\nexport const MAX_LINE_THICKNESS = 64;\nexport const DIRECTION_ICON_OUTPUT_SIZE = 128;\nexport const DIRECTION_ICON_SHRINK_RATIO = 1 / 15;\n//endregion\n\n//region CHOROPLETH LAYER\nexport const ACTIVE_BORDER_WIDTH_OUTER = 3;\nexport const ACTIVE_BORDER_WIDTH_INNER = 1;\n\nexport const DEFAULT_CHOROPLETH_COLOR =\n Colors.Charts.Sequential.Blue.Color05.Default;\n\nexport const COPY_TO_CLIPBOARD_MESSAGES = defineMessages({\n copyActionCoords: {\n id: 'g2qESM+ibB5sUyjf',\n defaultMessage: 'Copy coordinates',\n description:\n 'Text in a tooltip shown when hovering a tooltip item and hovering the copy button next to its coordinates',\n },\n});\n//endregion\n\n//region BASE LAYER RULES\nexport const DEFAULT_BASE_LAYER_RULES = {\n include: [INCLUDE_ALL_WILDCARD_RULE],\n exclude: [],\n} as const as BaseLayerRules;\n\n//endregion\n\n//region Zoom state comparison precision\nexport const BOUNDING_BOX_PRECISION = 6;\nexport const VIEW_STATE_PRECISION = 4;\nexport const MAX_BOUNDS_PRECISION = 2;\n//endregion\n\nexport const MAP_VIEW_ARIA_LABEL = 'Map View';\n"],
4
+ "sourcesContent": ["import type { ExpressionSpecification } from '@maplibre/maplibre-gl-style-spec';\nimport { defineMessages } from 'react-intl';\n\nimport type { TruncationMode } from '@dynatrace/strato-components/typography';\nimport Colors from '@dynatrace/strato-design-tokens/colors';\n\nimport type { BaseLayerRules } from './types/base-layer.js';\nimport type { BoundingBoxCoords } from './types/map-view.js';\n\n//region GENERAL\nexport const DEFAULT_COUNTRIES_FILL_COLOR =\n Colors.Background.Container.Neutral.Default;\nexport const DEFAULT_BOUNDARIES_BORDER_COLOR = Colors.Border.Neutral.Default;\nexport const COUNTRY_BORDER_WIDTH = 1;\nexport const REGION_BORDER_WIDTH = 0.4;\nexport const TRANSPARENT_BORDER_COLOR = '#00000000';\n\n// region Map max bounds:\n// These bounds hide the space used by Antarctica and some portion of the North Pole\nexport const MAX_LATITUDE = 85;\nexport const MIN_LATITUDE = -60;\nexport const MAX_LONGITUDE = 179.99;\nexport const MIN_LONGITUDE = -179.99;\n// endregion\n\nexport const WORLD_VIEW_MAX_BOUNDARIES: BoundingBoxCoords = [\n MAX_LONGITUDE,\n MAX_LATITUDE,\n MIN_LONGITUDE,\n MIN_LATITUDE,\n];\nexport const DEFAULT_COUNTRY_CODE = 'default';\nexport const FIT_BOUNDS_OPTIONS = { padding: 20 };\nexport const DEFAULT_MAP_HEIGHT = 400;\nexport const DEFAULT_MAP_LEGEND_RATIO = 'auto';\nexport const DEFAULT_MAP_POSITION = 'auto';\nexport const DEFAULT_INPUT_ICON_SIZE = 20;\nexport const ACTIVE_COLOR = Colors.Border.Neutral.Accent;\n\nexport const BASE_LAYER_FILL_ID = 'geojson-fill';\nexport const BASE_LAYER_LINE_ID = 'geojson-line';\nexport const BASE_LAYER_IDS = [BASE_LAYER_LINE_ID, BASE_LAYER_FILL_ID];\nexport const SHAPE_OPACITY_DEFAULT = 1;\nexport const SHAPE_OPACITY_DIMMED = 0.2;\n\nexport const DEFAULT_SYMBOL_SIZE = 32;\nexport const FALLBACK_SYMBOL_SIZE = 1;\nexport const DEFAULT_TRUNCATION_MODE = 'middle' as TruncationMode;\n\nexport const CDN_BASE_PATH =\n 'https://dt-cdn.net/scripts/data/worldmap/maps/v005/' as const;\nexport const INCLUDE_ALL_WILDCARD_RULE = '*' as const;\n//endregion\n\n//region LEGEND\nexport const DEFAULT_BASIC_SHAPE_COLOR_TOKEN =\n Colors.Charts.CategoricalThemed.PurpleRain.Color01;\nexport const DEFAULT_LEGEND_SIZES = {\n // Minimum size in which the legend can be resized (vertical layout)\n minWidth: 0.1,\n // Minimum size in which the legend can be resized (horizontal layout)\n minHeight: 0.1,\n // Maximum size in which the legend can be resized (vertical layout). 80% represent 4 / 5ths of the container.\n maxWidth: 0.8,\n // Maximum size in which the legend can be resized (horizontal layout). 80% represent 4 / 5ths of the container.\n maxHeight: 0.8,\n};\nexport const DEFAULT_FORMATTER = {\n maximumFractionDigits: 1,\n};\nexport const DEFAULT_RANGE_COLOR = Colors.Background.Container.Neutral.Accent;\nexport const DEFAULT_SEQUENTIAL_LEGEND_COLOR_PALETTE = 'blue';\n//endregion\n\n//region DOT LAYER\nexport const ICON_BACKGROUND_OPACITY = 0.7;\nexport const ICON_BACKGROUND_RADIUS = 16;\nexport const DEFAULT_ICON_BACKGROUND_COLOR =\n Colors.Background.Container.Neutral.Subdued;\nexport const DEFAULT_ICON_SIZE_RATIO = 0.6;\nexport const DEFAULT_SHAPE_COLOR = Colors.Charts.Categorical.Color15.Default;\nexport const DEFAULT_ICON_COLOR = Colors.Icon.Neutral.Default;\n//endregion\n\n//region BUBBLE LAYER\nexport const DEFAULT_BUBBLE_COLOR = Colors.Charts.Categorical.Color07.Default;\nexport const DEFAULT_RADIUS = 12;\nexport const BUBBLE_DEFAULT_OPACITY = 0.4;\nexport const BUBBLE_STROKE = 1;\nexport const BUBBLE_OUTLINE_STROKE = 1;\nexport const DEFAULT_RADIUS_EXPRESSION: ExpressionSpecification = [\n 'get',\n '__radius',\n];\n//endregion\n\n//region CONNECTION LAYER\nexport const DEFAULT_LINE_JOIN: 'bevel' | 'round' | 'miter' = 'miter';\nexport const DEFAULT_LINE_CAP: 'butt' | 'round' | 'square' = 'butt';\nexport const DEFAULT_LINE_THICKNESS = 2;\nexport const DEFAULT_LINE_COLOR = Colors.Charts.Categorical.Color03.Default;\nexport const DEFAULT_LINE_DASH_ARRAY = [5, 2.5];\nexport const MIN_LINE_THICKNESS = 1;\nexport const MAX_LINE_THICKNESS = 64;\nexport const DIRECTION_ICON_OUTPUT_SIZE = 128;\nexport const DIRECTION_ICON_SHRINK_RATIO = 1 / 15;\n//endregion\n\n//region CHOROPLETH LAYER\nexport const ACTIVE_BORDER_WIDTH_OUTER = 3;\nexport const ACTIVE_BORDER_WIDTH_INNER = 1;\n\nexport const DEFAULT_CHOROPLETH_COLOR =\n Colors.Charts.Sequential.Blue.Color05.Default;\n\nexport const COPY_TO_CLIPBOARD_MESSAGES = defineMessages({\n copyActionCoords: {\n id: 'g2qESM+ibB5sUyjf',\n defaultMessage: 'Copy coordinates',\n description:\n 'Text in a tooltip shown when hovering a tooltip item and hovering the copy button next to its coordinates',\n },\n});\n//endregion\n\n//region BASE LAYER RULES\nexport const DEFAULT_BASE_LAYER_RULES = {\n include: [INCLUDE_ALL_WILDCARD_RULE],\n exclude: [],\n} as const as BaseLayerRules;\n\n//endregion\n\n//region Zoom state comparison precision\nexport const BOUNDING_BOX_PRECISION = 6;\nexport const VIEW_STATE_PRECISION = 4;\nexport const MAX_BOUNDS_PRECISION = 2;\n//endregion\n\nexport const MAP_VIEW_ARIA_LABEL = 'Map View';\n"],
5
5
  "mappings": "AACA,SAAS,sBAAsB;AAG/B,OAAO,YAAY;AAMZ,MAAM,+BACX,OAAO,WAAW,UAAU,QAAQ;AAC/B,MAAM,kCAAkC,OAAO,OAAO,QAAQ;AAC9D,MAAM,uBAAuB;AAC7B,MAAM,sBAAsB;AAC5B,MAAM,2BAA2B;AAIjC,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;AAGtB,MAAM,4BAA+C;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACO,MAAM,uBAAuB;AAC7B,MAAM,qBAAqB,EAAE,SAAS,GAAG;AACzC,MAAM,qBAAqB;AAC3B,MAAM,2BAA2B;AACjC,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAChC,MAAM,eAAe,OAAO,OAAO,QAAQ;AAE3C,MAAM,qBAAqB;AAC3B,MAAM,qBAAqB;AAC3B,MAAM,iBAAiB,CAAC,oBAAoB,kBAAkB;AAC9D,MAAM,wBAAwB;AAC9B,MAAM,uBAAuB;AAE7B,MAAM,sBAAsB;AAC5B,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAEhC,MAAM,gBACX;AACK,MAAM,4BAA4B;AAIlC,MAAM,kCACX,OAAO,OAAO,kBAAkB,WAAW;AACtC,MAAM,uBAAuB;AAAA;AAAA,EAElC,UAAU;AAAA;AAAA,EAEV,WAAW;AAAA;AAAA,EAEX,UAAU;AAAA;AAAA,EAEV,WAAW;AACb;AACO,MAAM,oBAAoB;AAAA,EAC/B,uBAAuB;AACzB;AACO,MAAM,sBAAsB,OAAO,WAAW,UAAU,QAAQ;AAChE,MAAM,0CAA0C;AAIhD,MAAM,0BAA0B;AAChC,MAAM,yBAAyB;AAC/B,MAAM,gCACX,OAAO,WAAW,UAAU,QAAQ;AAC/B,MAAM,0BAA0B;AAChC,MAAM,sBAAsB,OAAO,OAAO,YAAY,QAAQ;AAC9D,MAAM,qBAAqB,OAAO,KAAK,QAAQ;AAI/C,MAAM,uBAAuB,OAAO,OAAO,YAAY,QAAQ;AAC/D,MAAM,iBAAiB;AACvB,MAAM,yBAAyB;AAC/B,MAAM,gBAAgB;AACtB,MAAM,wBAAwB;AAC9B,MAAM,4BAAqD;AAAA,EAChE;AAAA,EACA;AACF;AAIO,MAAM,oBAAiD;AACvD,MAAM,mBAAgD;AACtD,MAAM,yBAAyB;AAC/B,MAAM,qBAAqB,OAAO,OAAO,YAAY,QAAQ;AAC7D,MAAM,0BAA0B,CAAC,GAAG,GAAG;AACvC,MAAM,qBAAqB;AAC3B,MAAM,qBAAqB;AAC3B,MAAM,6BAA6B;AACnC,MAAM,8BAA8B,IAAI;AAIxC,MAAM,4BAA4B;AAClC,MAAM,4BAA4B;AAElC,MAAM,2BACX,OAAO,OAAO,WAAW,KAAK,QAAQ;AAEjC,MAAM,6BAA6B,eAAe;AAAA,EACvD,kBAAkB;AAAA,IAChB,IAAI;AAAA,IACJ,gBAAgB;AAAA,IAChB,aACE;AAAA,EACJ;AACF,CAAC;AAIM,MAAM,2BAA2B;AAAA,EACtC,SAAS,CAAC,yBAAyB;AAAA,EACnC,SAAS,CAAC;AACZ;AAKO,MAAM,yBAAyB;AAC/B,MAAM,uBAAuB;AAC7B,MAAM,uBAAuB;AAG7B,MAAM,sBAAsB;",
6
6
  "names": []
7
7
  }
package/esm/map/index.js CHANGED
@@ -9,6 +9,7 @@ import { Tooltip, TooltipAtoms } from "./slots/Tooltip.js";
9
9
  import { SequentialLegend } from "./slots/SequentialLegend.js";
10
10
  import { ThresholdLegend } from "./slots/ThresholdLegend.js";
11
11
  import { CategoricalLegend } from "./slots/CategoricalLegend.js";
12
+ import { getAllCountries } from "./utils/get-all-countries.js";
12
13
  export {
13
14
  BaseLayer,
14
15
  BubbleLayer,
@@ -21,6 +22,7 @@ export {
21
22
  SequentialLegend,
22
23
  ThresholdLegend,
23
24
  Tooltip,
24
- TooltipAtoms
25
+ TooltipAtoms,
26
+ getAllCountries
25
27
  };
26
28
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/map/index.ts"],
4
- "sourcesContent": ["export { ChartInteractions } from './slots/ChartInteractions.js';\nexport { MapView } from './MapView.js';\nexport { ConnectionLayer } from './slots/ConnectionLayer.js';\nexport { DotLayer } from './slots/DotLayer.js';\nexport { BubbleLayer } from './slots/BubbleLayer.js';\nexport { BaseLayer } from './slots/BaseLayer.js';\nexport { ChoroplethLayer } from './slots/ChoroplethLayer.js';\nexport { Tooltip, TooltipAtoms } from './slots/Tooltip.js';\n\nexport type {\n MapViewProps,\n MapViewBaseProps,\n MapViewUncontrolledProps,\n MapViewControlledProps,\n DisallowAll,\n ViewState,\n MapViewRef,\n} from './types/map-view.js';\n\nexport type { BaseLayerProps } from './types/base-layer.js';\n\nexport type {\n Connection,\n ConnectionLayerBaseProps,\n ConnectionLayerProps,\n CurvedLine,\n} from './types/connection-layer.js';\n\nexport type { DotLayerBaseProps, DotLayerProps } from './types/dot-layer.js';\n\nexport type {\n BubbleLayerBaseProps,\n BubbleLayerProps,\n ScaleNoneProps,\n ScaleRadiusProps,\n} from './types/bubble-layer.js';\n\nexport type {\n ChoroplethLayerBaseProps,\n ChoroplethLayerProps,\n} from './types/choropleth-layer.js';\n\nexport type { Location } from './types/location.js';\nexport type { MapShape } from './types/shapes.js';\nexport type { ChartInteractionsProps } from './types/toolbar.js';\nexport type { ErrorStateSlotProps } from './slots/states/ErrorStateSlot.js';\n\nexport type {\n BaseLegendProps,\n CategoricalLegendProps,\n SequentialLegendProps,\n ThresholdLegendProps,\n} from './types/legend.js';\n\nexport type {\n LocationColorProps,\n LegendColorLayerProps,\n ChoroplethCustomColorProps,\n ConnectionColorProps,\n} from './types/coloring.js';\n\nexport { SequentialLegend } from './slots/SequentialLegend.js';\nexport { ThresholdLegend } from './slots/ThresholdLegend.js';\nexport { CategoricalLegend } from './slots/CategoricalLegend.js';\n\nexport type {\n BubbleLayerTooltipHandler,\n BubbleLayerTooltipHandlerProps,\n DotLayerTooltipHandler,\n DotLayerTooltipHandlerProps,\n ConnectionLayerTooltipHandler,\n ConnectionLayerTooltipHandlerProps,\n ChoroplethLayerTooltipHandlerProps,\n ChoroplethLayerTooltipHandler,\n ChartTooltip,\n DotLayerTooltipData,\n BubbleLayerTooltipData,\n ConnectionLayerTooltipData,\n ChoroplethLayerTooltipData,\n} from './types/tooltip.js';\n"],
5
- "mappings": "AAAA,SAAS,yBAAyB;AAClC,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,SAAS,oBAAoB;AAsDtC,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;",
4
+ "sourcesContent": ["export { ChartInteractions } from './slots/ChartInteractions.js';\nexport { MapView } from './MapView.js';\nexport { ConnectionLayer } from './slots/ConnectionLayer.js';\nexport { DotLayer } from './slots/DotLayer.js';\nexport { BubbleLayer } from './slots/BubbleLayer.js';\nexport { BaseLayer } from './slots/BaseLayer.js';\nexport { ChoroplethLayer } from './slots/ChoroplethLayer.js';\nexport { Tooltip, TooltipAtoms } from './slots/Tooltip.js';\n\nexport type {\n MapViewProps,\n MapViewBaseProps,\n MapViewUncontrolledProps,\n MapViewControlledProps,\n DisallowAll,\n ViewState,\n MapViewRef,\n} from './types/map-view.js';\n\nexport type { BaseLayerProps } from './types/base-layer.js';\n\nexport type {\n Connection,\n ConnectionLayerBaseProps,\n ConnectionLayerProps,\n CurvedLine,\n} from './types/connection-layer.js';\n\nexport type { DotLayerBaseProps, DotLayerProps } from './types/dot-layer.js';\n\nexport type {\n BubbleLayerBaseProps,\n BubbleLayerProps,\n ScaleNoneProps,\n ScaleRadiusProps,\n} from './types/bubble-layer.js';\n\nexport type {\n ChoroplethLayerBaseProps,\n ChoroplethLayerProps,\n} from './types/choropleth-layer.js';\n\nexport type { Location } from './types/location.js';\nexport type { MapShape } from './types/shapes.js';\nexport type { ChartInteractionsProps } from './types/toolbar.js';\nexport type { ErrorStateSlotProps } from './slots/states/ErrorStateSlot.js';\n\nexport type {\n BaseLegendProps,\n CategoricalLegendProps,\n SequentialLegendProps,\n ThresholdLegendProps,\n} from './types/legend.js';\n\nexport type {\n LocationColorProps,\n LegendColorLayerProps,\n ChoroplethCustomColorProps,\n ConnectionColorProps,\n} from './types/coloring.js';\n\nexport { SequentialLegend } from './slots/SequentialLegend.js';\nexport { ThresholdLegend } from './slots/ThresholdLegend.js';\nexport { CategoricalLegend } from './slots/CategoricalLegend.js';\n\nexport type {\n BubbleLayerTooltipHandler,\n BubbleLayerTooltipHandlerProps,\n DotLayerTooltipHandler,\n DotLayerTooltipHandlerProps,\n ConnectionLayerTooltipHandler,\n ConnectionLayerTooltipHandlerProps,\n ChoroplethLayerTooltipHandlerProps,\n ChoroplethLayerTooltipHandler,\n ChartTooltip,\n DotLayerTooltipData,\n BubbleLayerTooltipData,\n ConnectionLayerTooltipData,\n ChoroplethLayerTooltipData,\n} from './types/tooltip.js';\n\nexport { getAllCountries } from './utils/get-all-countries.js';\n"],
5
+ "mappings": "AAAA,SAAS,yBAAyB;AAClC,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,SAAS,oBAAoB;AAsDtC,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAkBlC,SAAS,uBAAuB;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,29 @@
1
+ import { fetchWorldViewFeatures } from "./fetch-base-layer-features.js";
2
+ import { fetchClientConfigMapEnabled } from "./fetch-client-config-map-enabled.js";
3
+ import { getTenantCountryCode } from "./get-tenant-country-code.js";
4
+ const getAllCountries = async () => {
5
+ const isMapEnabledResponse = await fetchClientConfigMapEnabled();
6
+ try {
7
+ if (isMapEnabledResponse) {
8
+ const tenantCountryCode = await getTenantCountryCode();
9
+ const worldViewResponse = await fetchWorldViewFeatures(tenantCountryCode);
10
+ const mappedWorldViewResponse = [];
11
+ for (const feature of worldViewResponse.features) {
12
+ if (feature.id?.toString().length === 2) {
13
+ mappedWorldViewResponse.push({
14
+ id: String(feature.id) || "",
15
+ name: feature.properties?.name || ""
16
+ });
17
+ }
18
+ }
19
+ return mappedWorldViewResponse;
20
+ }
21
+ return [];
22
+ } catch {
23
+ return [];
24
+ }
25
+ };
26
+ export {
27
+ getAllCountries
28
+ };
29
+ //# sourceMappingURL=get-all-countries.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/map/utils/get-all-countries.ts"],
4
+ "sourcesContent": ["import { fetchWorldViewFeatures } from './fetch-base-layer-features.js';\nimport { fetchClientConfigMapEnabled } from './fetch-client-config-map-enabled.js';\nimport { getTenantCountryCode } from './get-tenant-country-code.js';\n\n/**\n * Fetches all the available countries given the current tenant's settings.\n * @returns An array of all countries with their id and name.\n * @public\n */\nexport const getAllCountries = async (): Promise<\n { id: string; name: string }[]\n> => {\n const isMapEnabledResponse = await fetchClientConfigMapEnabled();\n try {\n if (isMapEnabledResponse) {\n const tenantCountryCode = await getTenantCountryCode();\n\n const worldViewResponse = await fetchWorldViewFeatures(tenantCountryCode);\n\n const mappedWorldViewResponse: { id: string; name: string }[] = [];\n\n for (const feature of worldViewResponse.features) {\n if (feature.id?.toString().length === 2) {\n mappedWorldViewResponse.push({\n id: String(feature.id) || '',\n name: feature.properties?.name || '',\n });\n }\n }\n\n return mappedWorldViewResponse;\n }\n return [];\n } catch {\n return [];\n }\n};\n"],
5
+ "mappings": "AAAA,SAAS,8BAA8B;AACvC,SAAS,mCAAmC;AAC5C,SAAS,4BAA4B;AAO9B,MAAM,kBAAkB,YAE1B;AACH,QAAM,uBAAuB,MAAM,4BAA4B;AAC/D,MAAI;AACF,QAAI,sBAAsB;AACxB,YAAM,oBAAoB,MAAM,qBAAqB;AAErD,YAAM,oBAAoB,MAAM,uBAAuB,iBAAiB;AAExE,YAAM,0BAA0D,CAAC;AAEjE,iBAAW,WAAW,kBAAkB,UAAU;AAChD,YAAI,QAAQ,IAAI,SAAS,EAAE,WAAW,GAAG;AACvC,kCAAwB,KAAK;AAAA,YAC3B,IAAI,OAAO,QAAQ,EAAE,KAAK;AAAA,YAC1B,MAAM,QAAQ,YAAY,QAAQ;AAAA,UACpC,CAAC;AAAA,QACH;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;",
6
+ "names": []
7
+ }
@@ -29,7 +29,7 @@ export declare const SHAPE_OPACITY_DIMMED = 0.2;
29
29
  export declare const DEFAULT_SYMBOL_SIZE = 32;
30
30
  export declare const FALLBACK_SYMBOL_SIZE = 1;
31
31
  export declare const DEFAULT_TRUNCATION_MODE: TruncationMode;
32
- export declare const CDN_BASE_PATH: "https://dt-cdn.net/scripts/data/worldmap/maps/v004/";
32
+ export declare const CDN_BASE_PATH: "https://dt-cdn.net/scripts/data/worldmap/maps/v005/";
33
33
  export declare const INCLUDE_ALL_WILDCARD_RULE: "*";
34
34
  export declare const DEFAULT_BASIC_SHAPE_COLOR_TOKEN: {
35
35
  Default: string;
package/map/constants.js CHANGED
@@ -124,7 +124,7 @@ const SHAPE_OPACITY_DIMMED = 0.2;
124
124
  const DEFAULT_SYMBOL_SIZE = 32;
125
125
  const FALLBACK_SYMBOL_SIZE = 1;
126
126
  const DEFAULT_TRUNCATION_MODE = "middle";
127
- const CDN_BASE_PATH = "https://dt-cdn.net/scripts/data/worldmap/maps/v004/";
127
+ const CDN_BASE_PATH = "https://dt-cdn.net/scripts/data/worldmap/maps/v005/";
128
128
  const INCLUDE_ALL_WILDCARD_RULE = "*";
129
129
  const DEFAULT_BASIC_SHAPE_COLOR_TOKEN = import_colors.default.Charts.CategoricalThemed.PurpleRain.Color01;
130
130
  const DEFAULT_LEGEND_SIZES = {
package/map/index.d.ts CHANGED
@@ -22,3 +22,4 @@ export { SequentialLegend } from './slots/SequentialLegend.js';
22
22
  export { ThresholdLegend } from './slots/ThresholdLegend.js';
23
23
  export { CategoricalLegend } from './slots/CategoricalLegend.js';
24
24
  export type { BubbleLayerTooltipHandler, BubbleLayerTooltipHandlerProps, DotLayerTooltipHandler, DotLayerTooltipHandlerProps, ConnectionLayerTooltipHandler, ConnectionLayerTooltipHandlerProps, ChoroplethLayerTooltipHandlerProps, ChoroplethLayerTooltipHandler, ChartTooltip, DotLayerTooltipData, BubbleLayerTooltipData, ConnectionLayerTooltipData, ChoroplethLayerTooltipData, } from './types/tooltip.js';
25
+ export { getAllCountries } from './utils/get-all-countries.js';
package/map/index.js CHANGED
@@ -29,7 +29,8 @@ __export(map_exports, {
29
29
  SequentialLegend: () => import_SequentialLegend.SequentialLegend,
30
30
  ThresholdLegend: () => import_ThresholdLegend.ThresholdLegend,
31
31
  Tooltip: () => import_Tooltip.Tooltip,
32
- TooltipAtoms: () => import_Tooltip.TooltipAtoms
32
+ TooltipAtoms: () => import_Tooltip.TooltipAtoms,
33
+ getAllCountries: () => import_get_all_countries.getAllCountries
33
34
  });
34
35
  module.exports = __toCommonJS(map_exports);
35
36
  var import_ChartInteractions = require("./slots/ChartInteractions.js");
@@ -43,3 +44,4 @@ var import_Tooltip = require("./slots/Tooltip.js");
43
44
  var import_SequentialLegend = require("./slots/SequentialLegend.js");
44
45
  var import_ThresholdLegend = require("./slots/ThresholdLegend.js");
45
46
  var import_CategoricalLegend = require("./slots/CategoricalLegend.js");
47
+ var import_get_all_countries = require("./utils/get-all-countries.js");
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Fetches all the available countries given the current tenant's settings.
3
+ * @returns An array of all countries with their id and name.
4
+ * @public
5
+ */
6
+ export declare const getAllCountries: () => Promise<{
7
+ id: string;
8
+ name: string;
9
+ }[]>;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var get_all_countries_exports = {};
20
+ __export(get_all_countries_exports, {
21
+ getAllCountries: () => getAllCountries
22
+ });
23
+ module.exports = __toCommonJS(get_all_countries_exports);
24
+ var import_fetch_base_layer_features = require("./fetch-base-layer-features.js");
25
+ var import_fetch_client_config_map_enabled = require("./fetch-client-config-map-enabled.js");
26
+ var import_get_tenant_country_code = require("./get-tenant-country-code.js");
27
+ const getAllCountries = async () => {
28
+ const isMapEnabledResponse = await (0, import_fetch_client_config_map_enabled.fetchClientConfigMapEnabled)();
29
+ try {
30
+ if (isMapEnabledResponse) {
31
+ const tenantCountryCode = await (0, import_get_tenant_country_code.getTenantCountryCode)();
32
+ const worldViewResponse = await (0, import_fetch_base_layer_features.fetchWorldViewFeatures)(tenantCountryCode);
33
+ const mappedWorldViewResponse = [];
34
+ for (const feature of worldViewResponse.features) {
35
+ if (feature.id?.toString().length === 2) {
36
+ mappedWorldViewResponse.push({
37
+ id: String(feature.id) || "",
38
+ name: feature.properties?.name || ""
39
+ });
40
+ }
41
+ }
42
+ return mappedWorldViewResponse;
43
+ }
44
+ return [];
45
+ } catch {
46
+ return [];
47
+ }
48
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace/strato-geo",
3
- "version": "1.8.2",
3
+ "version": "1.9.1",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "lang": "lang/uncompiled",
@@ -48,8 +48,8 @@
48
48
  "react-intl": "^6.0.8 || ^7.0.0",
49
49
  "react-is": "^18.0.0",
50
50
  "@dynatrace/strato-components": "^1.7.2",
51
+ "@dynatrace/strato-components-preview": "^1.9.1",
51
52
  "@dynatrace/strato-design-tokens": "^1.0.1",
52
- "@dynatrace/strato-components-preview": "^1.8.2",
53
53
  "@dynatrace/strato-icons": "^1.5.1"
54
54
  },
55
55
  "sideEffects": [