@dynatrace/strato-geo 0.8.13 → 0.9.17

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.
Files changed (195) hide show
  1. package/esm/map/MapView.js +15 -13
  2. package/esm/map/MapView.js.map +2 -2
  3. package/esm/map/components/BubbleLayer/BubbleLayer.js.map +2 -2
  4. package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js.map +1 -1
  5. package/esm/map/components/BubbleLayer/functions/add-outline-size.js.map +1 -1
  6. package/esm/map/components/BubbleLayer/functions/build-radius-scale.js +4 -1
  7. package/esm/map/components/BubbleLayer/functions/build-radius-scale.js.map +2 -2
  8. package/esm/map/components/BubbleLayer/functions/build-stick-to-distance-expressions.js.map +1 -1
  9. package/esm/map/components/BubbleLayer/functions/define-radius.js.map +1 -1
  10. package/esm/map/components/BubbleLayer/functions/parse-bubble-data-to-geo-json.js.map +1 -1
  11. package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js.map +2 -2
  12. package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js.map +1 -1
  13. package/esm/map/components/ConnectionLayer/ConnectionLayer.js.map +1 -1
  14. package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js.map +1 -1
  15. package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js.map +1 -1
  16. package/esm/map/components/ConnectionLayer/functions/get-arc-line-features.js.map +1 -1
  17. package/esm/map/components/ConnectionLayer/functions/get-straight-line-features.js.map +1 -1
  18. package/esm/map/components/ConnectionLayer/functions/parse-connection-data-to-geo-json.js.map +1 -1
  19. package/esm/map/components/ConnectionLayer/functions/parse-direction-data-to-geo-json.js.map +1 -1
  20. package/esm/map/components/DefaultTooltip/DefaultTooltip.js.map +1 -1
  21. package/esm/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.js.map +1 -1
  22. package/esm/map/components/DotLayer/DotLayer.js +1 -1
  23. package/esm/map/components/DotLayer/DotLayer.js.map +2 -2
  24. package/esm/map/components/DotLayer/DotLayerTooltip.js.map +1 -1
  25. package/esm/map/components/DotLayer/functions/define-bearing.js.map +1 -1
  26. package/esm/map/components/DotLayer/functions/parse-dot-data-to-geo-json.js.map +1 -1
  27. package/esm/map/components/MapContent.js.map +2 -2
  28. package/esm/map/components/legend/CategoricalLegendRenderer.js.map +2 -2
  29. package/esm/map/components/legend/SequentialLegendRenderer.js.map +1 -1
  30. package/esm/map/components/legend/ThresholdLegendRenderer.js.map +1 -1
  31. package/esm/map/components/legend/functions/resolve-color.js.map +1 -1
  32. package/esm/map/components/toolbar/constants.js.map +1 -1
  33. package/esm/map/components/toolbar/functions/a11y-toolbar-controls.js.map +1 -1
  34. package/esm/map/components/toolbar/hooks/use-a11y-toolbar-tab-index.js.map +1 -1
  35. package/esm/map/constants.js +4 -2
  36. package/esm/map/constants.js.map +2 -2
  37. package/esm/map/contexts/a11y-toolbar-tab-index.context.js.map +1 -1
  38. package/esm/map/contexts/color-scale.context.js.map +1 -1
  39. package/esm/map/contexts/map-configuration.context.js.map +1 -1
  40. package/esm/map/contexts/map-initial-view.context.js.map +1 -1
  41. package/esm/map/functions/__test__/fixtures/business-locations.js.map +1 -1
  42. package/esm/map/functions/__test__/fixtures/events-locations.js.map +1 -1
  43. package/esm/map/functions/__test__/fixtures/facilities-locations.js.map +1 -1
  44. package/esm/map/functions/__test__/fixtures/flight-connections.js.map +1 -1
  45. package/esm/map/functions/attach-image-from-shape.js.map +1 -1
  46. package/esm/map/functions/attach-image-from-string.js.map +1 -1
  47. package/esm/map/functions/attach-image-from-text.js.map +1 -1
  48. package/esm/map/functions/attach-image-to-map.js.map +1 -1
  49. package/esm/map/functions/build-categorical-scale.js.map +1 -1
  50. package/esm/map/functions/extract-layers-data.js.map +1 -1
  51. package/esm/map/functions/get-client-settings.js.map +1 -1
  52. package/esm/map/functions/get-data-layers-bounding-box.js.map +1 -1
  53. package/esm/map/functions/is-valid-shape.js.map +1 -1
  54. package/esm/map/functions/iterate-config-slots.js +10 -1
  55. package/esm/map/functions/iterate-config-slots.js.map +2 -2
  56. package/esm/map/functions/parse-tooltip-data.js.map +1 -1
  57. package/esm/map/functions/set-layers-id.js +1 -0
  58. package/esm/map/functions/set-layers-id.js.map +2 -2
  59. package/esm/map/functions/tooltip-type-guards.js.map +1 -1
  60. package/esm/map/hooks/use-active-interaction.js.map +1 -1
  61. package/esm/map/hooks/use-attach-image-from-icon.js.map +2 -2
  62. package/esm/map/hooks/use-attach-symbol-to-map.js.map +1 -1
  63. package/esm/map/hooks/use-color-scale.js.map +1 -1
  64. package/esm/map/hooks/use-hover-interaction.js.map +2 -2
  65. package/esm/map/hooks/use-initial-view-state.js.map +1 -1
  66. package/esm/map/hooks/use-legend-interaction-highlighting.js.map +1 -1
  67. package/esm/map/hooks/use-legend-interaction-visibility.js.map +1 -1
  68. package/esm/map/hooks/use-load-symbol-into-map.js.map +1 -1
  69. package/esm/map/hooks/use-map-performance.js +0 -15
  70. package/esm/map/hooks/use-map-performance.js.map +2 -2
  71. package/esm/map/hooks/use-overlay-events.js.map +1 -1
  72. package/esm/map/hooks/use-tooltip-template.js.map +2 -2
  73. package/esm/map/providers/color-scale.provider.js.map +2 -2
  74. package/esm/map/providers/layer-color-strategy.provider.js.map +2 -2
  75. package/esm/map/providers/map-initial-view.provider.js.map +2 -2
  76. package/esm/map/shapes/shape-picker.js.map +1 -1
  77. package/esm/map/slots/BubbleLayer.js.map +1 -1
  78. package/esm/map/slots/BubbleLayerTooltip.js.map +1 -1
  79. package/esm/map/slots/CategoricalLegend.js.map +1 -1
  80. package/esm/map/slots/ChartInteractions.js.map +1 -1
  81. package/esm/map/slots/ChoroplethLayer.js.map +1 -1
  82. package/esm/map/slots/ChoroplethLayerTooltip.js.map +1 -1
  83. package/esm/map/slots/ConnectionLayer.js.map +1 -1
  84. package/esm/map/slots/ConnectionLayerTooltip.js.map +1 -1
  85. package/esm/map/slots/DotLayer.js.map +1 -1
  86. package/esm/map/slots/DotLayerTooltip.js.map +1 -1
  87. package/esm/map/slots/SequentialLegend.js.map +1 -1
  88. package/esm/map/slots/ThresholdLegend.js.map +1 -1
  89. package/esm/map/slots/Tooltip.js.map +2 -2
  90. package/esm/map/slots/states/DisabledState.js.map +2 -2
  91. package/esm/map/slots/states/ErrorStateSlot.js.map +1 -1
  92. package/esm/map/store/map-store.context.js +3 -1
  93. package/esm/map/store/map-store.context.js.map +2 -2
  94. package/esm/map/store/map-store.provider.js +3 -1
  95. package/esm/map/store/map-store.provider.js.map +2 -2
  96. package/esm/map/store/selectors.js.map +1 -1
  97. package/esm/map/store/store.js.map +1 -1
  98. package/esm/map/types/bubble-layer.js.map +1 -1
  99. package/esm/map/types/coloring.js.map +1 -1
  100. package/map/MapView.d.ts +1 -1
  101. package/map/MapView.js +14 -8
  102. package/map/components/BubbleLayer/BubbleLayer.d.ts +3 -3
  103. package/map/components/BubbleLayer/BubbleLayerTooltip.d.ts +1 -1
  104. package/map/components/BubbleLayer/functions/add-outline-size.d.ts +1 -1
  105. package/map/components/BubbleLayer/functions/build-radius-scale.d.ts +2 -2
  106. package/map/components/BubbleLayer/functions/build-stick-to-distance-expressions.d.ts +1 -1
  107. package/map/components/BubbleLayer/functions/define-radius.d.ts +1 -1
  108. package/map/components/BubbleLayer/functions/parse-bubble-data-to-geo-json.d.ts +2 -2
  109. package/map/components/ChoroplethLayer/ChoroplethLayer.d.ts +2 -2
  110. package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.d.ts +1 -1
  111. package/map/components/ConnectionLayer/ConnectionLayer.d.ts +1 -1
  112. package/map/components/ConnectionLayer/ConnectionLayerDirection.d.ts +1 -1
  113. package/map/components/ConnectionLayer/ConnectionLayerTooltip.d.ts +1 -1
  114. package/map/components/ConnectionLayer/functions/get-arc-line-features.d.ts +2 -2
  115. package/map/components/ConnectionLayer/functions/get-straight-line-features.d.ts +2 -2
  116. package/map/components/ConnectionLayer/functions/parse-connection-data-to-geo-json.d.ts +1 -1
  117. package/map/components/ConnectionLayer/functions/parse-direction-data-to-geo-json.d.ts +1 -1
  118. package/map/components/DefaultTooltip/DefaultTooltip.d.ts +1 -1
  119. package/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.d.ts +1 -1
  120. package/map/components/DotLayer/DotLayer.d.ts +3 -3
  121. package/map/components/DotLayer/DotLayer.js +1 -1
  122. package/map/components/DotLayer/DotLayerTooltip.d.ts +1 -1
  123. package/map/components/DotLayer/functions/define-bearing.d.ts +1 -1
  124. package/map/components/DotLayer/functions/parse-dot-data-to-geo-json.d.ts +1 -1
  125. package/map/components/MapContent.d.ts +1 -1
  126. package/map/components/legend/functions/resolve-color.d.ts +1 -1
  127. package/map/components/toolbar/constants.d.ts +1 -1
  128. package/map/components/toolbar/functions/a11y-toolbar-controls.d.ts +1 -1
  129. package/map/components/toolbar/hooks/use-a11y-toolbar-tab-index.d.ts +1 -1
  130. package/map/constants.d.ts +3 -2
  131. package/map/constants.js +4 -2
  132. package/map/contexts/a11y-toolbar-tab-index.context.d.ts +1 -1
  133. package/map/contexts/color-scale.context.d.ts +1 -1
  134. package/map/contexts/map-configuration.context.d.ts +1 -1
  135. package/map/contexts/map-initial-view.context.d.ts +1 -1
  136. package/map/functions/__test__/fixtures/business-locations.d.ts +1 -1
  137. package/map/functions/__test__/fixtures/events-locations.d.ts +1 -1
  138. package/map/functions/__test__/fixtures/facilities-locations.d.ts +1 -1
  139. package/map/functions/__test__/fixtures/flight-connections.d.ts +1 -1
  140. package/map/functions/attach-image-from-shape.d.ts +2 -2
  141. package/map/functions/attach-image-from-string.d.ts +2 -2
  142. package/map/functions/attach-image-from-text.d.ts +1 -1
  143. package/map/functions/attach-image-to-map.d.ts +1 -1
  144. package/map/functions/build-categorical-scale.d.ts +1 -1
  145. package/map/functions/is-valid-shape.d.ts +2 -2
  146. package/map/functions/iterate-config-slots.d.ts +1 -1
  147. package/map/functions/iterate-config-slots.js +5 -0
  148. package/map/functions/parse-tooltip-data.d.ts +1 -1
  149. package/map/functions/set-layers-id.js +1 -0
  150. package/map/functions/tooltip-type-guards.d.ts +1 -1
  151. package/map/hooks/use-attach-image-from-icon.d.ts +2 -2
  152. package/map/hooks/use-attach-symbol-to-map.d.ts +2 -2
  153. package/map/hooks/use-color-scale.d.ts +1 -1
  154. package/map/hooks/use-initial-view-state.d.ts +1 -1
  155. package/map/hooks/use-legend-interaction-highlighting.d.ts +4 -4
  156. package/map/hooks/use-legend-interaction-visibility.d.ts +4 -4
  157. package/map/hooks/use-load-symbol-into-map.d.ts +2 -2
  158. package/map/hooks/use-map-performance.d.ts +0 -15
  159. package/map/hooks/use-map-performance.js +0 -15
  160. package/map/hooks/use-overlay-events.d.ts +1 -1
  161. package/map/hooks/use-tooltip-template.d.ts +2 -2
  162. package/map/providers/color-scale.provider.d.ts +1 -1
  163. package/map/providers/layer-color-strategy.provider.d.ts +3 -3
  164. package/map/providers/map-initial-view.provider.d.ts +2 -2
  165. package/map/shapes/shape-picker.d.ts +1 -1
  166. package/map/slots/BubbleLayer.d.ts +5 -5
  167. package/map/slots/BubbleLayerTooltip.d.ts +1 -1
  168. package/map/slots/CategoricalLegend.d.ts +1 -1
  169. package/map/slots/ChartInteractions.d.ts +2 -2
  170. package/map/slots/ChoroplethLayer.d.ts +3 -3
  171. package/map/slots/ChoroplethLayerTooltip.d.ts +1 -1
  172. package/map/slots/ConnectionLayer.d.ts +3 -3
  173. package/map/slots/ConnectionLayerTooltip.d.ts +1 -1
  174. package/map/slots/DotLayer.d.ts +5 -5
  175. package/map/slots/DotLayerTooltip.d.ts +1 -1
  176. package/map/slots/SequentialLegend.d.ts +1 -1
  177. package/map/slots/ThresholdLegend.d.ts +1 -1
  178. package/map/slots/Tooltip.d.ts +1 -1
  179. package/map/slots/states/ErrorStateSlot.d.ts +2 -2
  180. package/map/store/map-store.context.d.ts +2 -2
  181. package/map/store/map-store.provider.d.ts +1 -1
  182. package/map/store/selectors.d.ts +1 -1
  183. package/map/store/store.d.ts +1 -1
  184. package/map/types/bubble-layer.d.ts +2 -2
  185. package/map/types/choropleth-layer.d.ts +1 -1
  186. package/map/types/coloring.d.ts +1 -1
  187. package/map/types/configuration.d.ts +2 -2
  188. package/map/types/connection-layer.d.ts +1 -1
  189. package/map/types/dot-layer.d.ts +5 -5
  190. package/map/types/legend.d.ts +3 -25
  191. package/map/types/map-view.d.ts +3 -3
  192. package/map/types/state.d.ts +1 -1
  193. package/map/types/toolbar.d.ts +1 -1
  194. package/map/types/tooltip.d.ts +2 -2
  195. package/package.json +3 -3
@@ -10,11 +10,7 @@ import {
10
10
  import { useMergeRefs } from "@dynatrace/strato-components-preview/core";
11
11
  import { MapLegendRenderer } from "./components/legend/MapLegendRenderer.js";
12
12
  import { MapContent } from "./components/MapContent.js";
13
- import {
14
- DEFAULT_LEGEND_SIZES,
15
- DEFAULT_MAP_HEIGHT,
16
- DEFAULT_MAP_LEGEND_RATIO
17
- } from "./constants.js";
13
+ import { DEFAULT_LEGEND_SIZES, DEFAULT_MAP_HEIGHT } from "./constants.js";
18
14
  import { LayerIdsContext } from "./contexts/layer-ids.context.js";
19
15
  import { MapConfigurationContext } from "./contexts/map-configuration.context.js";
20
16
  import { MapCountryCodeContext } from "./contexts/map-country-code.context.js";
@@ -57,18 +53,16 @@ const _MapView = forwardRef(
57
53
  }
58
54
  }));
59
55
  const config = iterateConfigSlots(children);
60
- const hideLegend = !config.legend || config.legend.hidden;
56
+ const isLegendHidden = !config.legend || !!config.legend.hidden;
57
+ const legendPosition = config.legend?.position;
58
+ const legendRatio = config.legend?.ratio;
59
+ const legendOnRatioChange = config.legend?.onRatioChange;
61
60
  const { errorState } = getMapStatesTemplates(children);
62
61
  const {
63
62
  isLoading: isLoadingSettings,
64
63
  isMapEnabled,
65
64
  countryCode
66
65
  } = useMapSettings();
67
- const legendConfig = {
68
- orientation: config?.legend?.position,
69
- sizes: DEFAULT_LEGEND_SIZES,
70
- ratio: config?.legend?.type === "sequential" || config?.legend?.type === "threshold" ? DEFAULT_MAP_LEGEND_RATIO : void 0
71
- };
72
66
  const chartHeight = coerceSizeValue(props.height) || DEFAULT_MAP_HEIGHT;
73
67
  const containerStyles = { width: "100%", ...costumerStyle };
74
68
  return /* @__PURE__ */ React.createElement(
@@ -82,12 +76,20 @@ const _MapView = forwardRef(
82
76
  ChartLayout,
83
77
  {
84
78
  chartHeight,
85
- legendConfig,
86
79
  errorState,
87
80
  showLoader: loading || isLoadingSettings
88
81
  },
89
82
  /* @__PURE__ */ React.createElement(ChartLayout.Graph, null, !isLoadingSettings && /* @__PURE__ */ React.createElement(MapContent, { ref: rootRef, ...remaining }, parsedChildren)),
90
- /* @__PURE__ */ React.createElement(ChartLayout.Legend, null, !hideLegend ? /* @__PURE__ */ React.createElement(MapLegendRenderer, null) : null)
83
+ !isLegendHidden && /* @__PURE__ */ React.createElement(
84
+ ChartLayout.Legend,
85
+ {
86
+ position: legendPosition,
87
+ ratio: legendRatio,
88
+ ratioBoundaries: DEFAULT_LEGEND_SIZES,
89
+ onResize: legendOnRatioChange
90
+ },
91
+ /* @__PURE__ */ React.createElement(MapLegendRenderer, null)
92
+ )
91
93
  )))))))))
92
94
  );
93
95
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/map/MapView.tsx"],
4
- "sourcesContent": ["import React, {\n forwardRef,\n PropsWithChildren,\n useImperativeHandle,\n useRef,\n} from 'react';\n\nimport {\n _ChartLayout as ChartLayout,\n _coerceSizeValue as coerceSizeValue,\n} from '@dynatrace/strato-components-preview/charts';\nimport { useMergeRefs } from '@dynatrace/strato-components-preview/core';\n\nimport { MapLegendRenderer } from './components/legend/MapLegendRenderer.js';\nimport { MapContent } from './components/MapContent.js';\nimport {\n DEFAULT_LEGEND_SIZES,\n DEFAULT_MAP_HEIGHT,\n DEFAULT_MAP_LEGEND_RATIO,\n} from './constants.js';\nimport { LayerIdsContext } from './contexts/layer-ids.context.js';\nimport { MapConfigurationContext } from './contexts/map-configuration.context.js';\nimport { MapCountryCodeContext } from './contexts/map-country-code.context.js';\nimport { MapDataBoundingBoxContext } from './contexts/map-data-bounding-box.context.js';\nimport { MapRawDataContext } from './contexts/map-raw-data.context.js';\nimport { buildAndDownloadCsv } from './functions/build-and-download-csv.js';\nimport { extractLayersData } from './functions/extract-layers-data.js';\nimport { getDataLayersBoundingBox } from './functions/get-data-layers-bounding-box.js';\nimport { getMapStatesTemplates } from './functions/get-map-states-template.js';\nimport { iterateConfigSlots } from './functions/iterate-config-slots.js';\nimport { setLayersId } from './functions/set-layers-id.js';\nimport { useMapSettings } from './hooks/use-map-settings.js';\nimport { ColorScaleProvider } from './providers/color-scale.provider.js';\nimport { LayerColorStrategyProvider } from './providers/layer-color-strategy.provider.js';\nimport { DisabledState } from './slots/states/DisabledState.js';\nimport { ErrorStateSlot } from './slots/states/ErrorStateSlot.js';\nimport { MapStoreProvider } from './store/map-store.provider.js';\n// eslint-disable-next-line no-restricted-imports\nimport './styles/react-mapgl-styles.css';\nimport { MapViewProps, MapViewRef } from './types/map-view.js';\n\n/**\n * MapView Component\n */\nconst _MapView = forwardRef<MapViewRef, PropsWithChildren<MapViewProps>>(\n (props, forwardedRef) => {\n const {\n children,\n loading = false,\n style: costumerStyle,\n className: customerClassNames,\n ...remaining\n } = props;\n const { layerIds, parsedChildren } = setLayersId(children);\n\n const layersData = extractLayersData(parsedChildren);\n const dataLayersBBox = getDataLayersBoundingBox(children);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const rootRef = useMergeRefs<MapViewRef | HTMLDivElement>([\n forwardedRef,\n containerRef,\n ]);\n\n useImperativeHandle(forwardedRef, () => ({\n element: containerRef.current,\n downloadData: () => {\n buildAndDownloadCsv(layersData);\n },\n }));\n\n const config = iterateConfigSlots(children);\n\n const hideLegend = !config.legend || config.legend.hidden;\n\n const { errorState } = getMapStatesTemplates(children);\n\n const {\n isLoading: isLoadingSettings,\n isMapEnabled,\n countryCode,\n } = useMapSettings();\n\n const legendConfig = {\n orientation: config?.legend?.position,\n sizes: DEFAULT_LEGEND_SIZES,\n ratio:\n config?.legend?.type === 'sequential' ||\n config?.legend?.type === 'threshold'\n ? DEFAULT_MAP_LEGEND_RATIO\n : undefined,\n };\n\n const chartHeight = coerceSizeValue(props.height) || DEFAULT_MAP_HEIGHT;\n\n const containerStyles = { width: '100%', ...costumerStyle };\n\n return (\n <div\n style={containerStyles}\n className={customerClassNames}\n data-testid=\"mapview-container\"\n >\n {!isLoadingSettings && !isMapEnabled ? (\n <DisabledState height={chartHeight} />\n ) : (\n <MapCountryCodeContext.Provider value={countryCode}>\n <MapConfigurationContext.Provider value={config}>\n <LayerIdsContext.Provider value={layerIds}>\n <MapRawDataContext.Provider value={layersData}>\n <MapDataBoundingBoxContext.Provider value={dataLayersBBox}>\n <MapStoreProvider>\n <ColorScaleProvider>\n <LayerColorStrategyProvider>\n <ChartLayout\n chartHeight={chartHeight}\n legendConfig={legendConfig}\n errorState={errorState}\n showLoader={loading || isLoadingSettings}\n >\n <ChartLayout.Graph>\n {!isLoadingSettings && (\n <MapContent ref={rootRef} {...remaining}>\n {parsedChildren}\n </MapContent>\n )}\n </ChartLayout.Graph>\n <ChartLayout.Legend>\n {!hideLegend ? <MapLegendRenderer /> : null}\n </ChartLayout.Legend>\n </ChartLayout>\n </LayerColorStrategyProvider>\n </ColorScaleProvider>\n </MapStoreProvider>\n </MapDataBoundingBoxContext.Provider>\n </MapRawDataContext.Provider>\n </LayerIdsContext.Provider>\n </MapConfigurationContext.Provider>\n </MapCountryCodeContext.Provider>\n )}\n </div>\n );\n },\n);\n\n_MapView['displayName'] = 'MapView';\n\n/**\n * The `MapView` is a component that renders a map with various geospatial data layers.\n * @beta\n */\nexport const MapView = Object.assign(_MapView, {\n ErrorState: ErrorStateSlot,\n});\n"],
5
- "mappings": "AAAA,OAAO;AAAA,EACL;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,OACf;AACP,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AACxC,SAAS,6BAA6B;AACtC,SAAS,iCAAiC;AAC1C,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC,SAAS,gCAAgC;AACzC,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC,SAAS,kCAAkC;AAC3C,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAEjC,OAAO;AAMP,MAAM,WAAW;AAAA,EACf,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,UAAU;AAAA,MACV,OAAO;AAAA,MACP,WAAW;AAAA,MACX,GAAG;AAAA,IACL,IAAI;AACJ,UAAM,EAAE,UAAU,eAAe,IAAI,YAAY,QAAQ;AAEzD,UAAM,aAAa,kBAAkB,cAAc;AACnD,UAAM,iBAAiB,yBAAyB,QAAQ;AAExD,UAAM,eAAe,OAAuB,IAAI;AAChD,UAAM,UAAU,aAA0C;AAAA,MACxD;AAAA,MACA;AAAA,IACF,CAAC;AAED,wBAAoB,cAAc,OAAO;AAAA,MACvC,SAAS,aAAa;AAAA,MACtB,cAAc,MAAM;AAClB,4BAAoB,UAAU;AAAA,MAChC;AAAA,IACF,EAAE;AAEF,UAAM,SAAS,mBAAmB,QAAQ;AAE1C,UAAM,aAAa,CAAC,OAAO,UAAU,OAAO,OAAO;AAEnD,UAAM,EAAE,WAAW,IAAI,sBAAsB,QAAQ;AAErD,UAAM;AAAA,MACJ,WAAW;AAAA,MACX;AAAA,MACA;AAAA,IACF,IAAI,eAAe;AAEnB,UAAM,eAAe;AAAA,MACnB,aAAa,QAAQ,QAAQ;AAAA,MAC7B,OAAO;AAAA,MACP,OACE,QAAQ,QAAQ,SAAS,gBACzB,QAAQ,QAAQ,SAAS,cACrB,2BACA;AAAA,IACR;AAEA,UAAM,cAAc,gBAAgB,MAAM,MAAM,KAAK;AAErD,UAAM,kBAAkB,EAAE,OAAO,QAAQ,GAAG,cAAc;AAE1D,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,WAAW;AAAA,QACX,eAAY;AAAA;AAAA,MAEX,CAAC,qBAAqB,CAAC,eACtB,oCAAC,iBAAc,QAAQ,aAAa,IAEpC,oCAAC,sBAAsB,UAAtB,EAA+B,OAAO,eACrC,oCAAC,wBAAwB,UAAxB,EAAiC,OAAO,UACvC,oCAAC,gBAAgB,UAAhB,EAAyB,OAAO,YAC/B,oCAAC,kBAAkB,UAAlB,EAA2B,OAAO,cACjC,oCAAC,0BAA0B,UAA1B,EAAmC,OAAO,kBACzC,oCAAC,wBACC,oCAAC,0BACC,oCAAC,kCACC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA,YAAY,WAAW;AAAA;AAAA,QAEvB,oCAAC,YAAY,OAAZ,MACE,CAAC,qBACA,oCAAC,cAAW,KAAK,SAAU,GAAG,aAC3B,cACH,CAEJ;AAAA,QACA,oCAAC,YAAY,QAAZ,MACE,CAAC,aAAa,oCAAC,uBAAkB,IAAK,IACzC;AAAA,MACF,CACF,CACF,CACF,CACF,CACF,CACF,CACF,CACF;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,SAAS,aAAa,IAAI;AAMnB,MAAM,UAAU,OAAO,OAAO,UAAU;AAAA,EAC7C,YAAY;AACd,CAAC;",
4
+ "sourcesContent": ["import React, {\n forwardRef,\n type PropsWithChildren,\n useImperativeHandle,\n useRef,\n} from 'react';\n\nimport {\n _ChartLayout as ChartLayout,\n _coerceSizeValue as coerceSizeValue,\n} from '@dynatrace/strato-components-preview/charts';\nimport { useMergeRefs } from '@dynatrace/strato-components-preview/core';\n\nimport { MapLegendRenderer } from './components/legend/MapLegendRenderer.js';\nimport { MapContent } from './components/MapContent.js';\nimport { DEFAULT_LEGEND_SIZES, DEFAULT_MAP_HEIGHT } from './constants.js';\nimport { LayerIdsContext } from './contexts/layer-ids.context.js';\nimport { MapConfigurationContext } from './contexts/map-configuration.context.js';\nimport { MapCountryCodeContext } from './contexts/map-country-code.context.js';\nimport { MapDataBoundingBoxContext } from './contexts/map-data-bounding-box.context.js';\nimport { MapRawDataContext } from './contexts/map-raw-data.context.js';\nimport { buildAndDownloadCsv } from './functions/build-and-download-csv.js';\nimport { extractLayersData } from './functions/extract-layers-data.js';\nimport { getDataLayersBoundingBox } from './functions/get-data-layers-bounding-box.js';\nimport { getMapStatesTemplates } from './functions/get-map-states-template.js';\nimport { iterateConfigSlots } from './functions/iterate-config-slots.js';\nimport { setLayersId } from './functions/set-layers-id.js';\nimport { useMapSettings } from './hooks/use-map-settings.js';\nimport { ColorScaleProvider } from './providers/color-scale.provider.js';\nimport { LayerColorStrategyProvider } from './providers/layer-color-strategy.provider.js';\nimport { DisabledState } from './slots/states/DisabledState.js';\nimport { ErrorStateSlot } from './slots/states/ErrorStateSlot.js';\nimport { MapStoreProvider } from './store/map-store.provider.js';\n// eslint-disable-next-line no-restricted-imports\nimport './styles/react-mapgl-styles.css';\nimport type { MapViewProps, MapViewRef } from './types/map-view.js';\n\n/**\n * MapView Component\n */\nconst _MapView = forwardRef<MapViewRef, PropsWithChildren<MapViewProps>>(\n (props, forwardedRef) => {\n const {\n children,\n loading = false,\n style: costumerStyle,\n className: customerClassNames,\n ...remaining\n } = props;\n const { layerIds, parsedChildren } = setLayersId(children);\n\n const layersData = extractLayersData(parsedChildren);\n const dataLayersBBox = getDataLayersBoundingBox(children);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const rootRef = useMergeRefs<MapViewRef | HTMLDivElement>([\n forwardedRef,\n containerRef,\n ]);\n\n useImperativeHandle(forwardedRef, () => ({\n element: containerRef.current,\n downloadData: () => {\n buildAndDownloadCsv(layersData);\n },\n }));\n\n const config = iterateConfigSlots(children);\n\n const isLegendHidden = !config.legend || !!config.legend.hidden;\n const legendPosition = config.legend?.position;\n const legendRatio = config.legend?.ratio;\n const legendOnRatioChange = config.legend?.onRatioChange;\n\n const { errorState } = getMapStatesTemplates(children);\n\n const {\n isLoading: isLoadingSettings,\n isMapEnabled,\n countryCode,\n } = useMapSettings();\n\n const chartHeight = coerceSizeValue(props.height) || DEFAULT_MAP_HEIGHT;\n\n const containerStyles = { width: '100%', ...costumerStyle };\n\n return (\n <div\n style={containerStyles}\n className={customerClassNames}\n data-testid=\"mapview-container\"\n >\n {!isLoadingSettings && !isMapEnabled ? (\n <DisabledState height={chartHeight} />\n ) : (\n <MapCountryCodeContext.Provider value={countryCode}>\n <MapConfigurationContext.Provider value={config}>\n <LayerIdsContext.Provider value={layerIds}>\n <MapRawDataContext.Provider value={layersData}>\n <MapDataBoundingBoxContext.Provider value={dataLayersBBox}>\n <MapStoreProvider>\n <ColorScaleProvider>\n <LayerColorStrategyProvider>\n <ChartLayout\n chartHeight={chartHeight}\n errorState={errorState}\n showLoader={loading || isLoadingSettings}\n >\n <ChartLayout.Graph>\n {!isLoadingSettings && (\n <MapContent ref={rootRef} {...remaining}>\n {parsedChildren}\n </MapContent>\n )}\n </ChartLayout.Graph>\n {!isLegendHidden && (\n <ChartLayout.Legend\n position={legendPosition}\n ratio={legendRatio}\n ratioBoundaries={DEFAULT_LEGEND_SIZES}\n onResize={legendOnRatioChange}\n >\n <MapLegendRenderer />\n </ChartLayout.Legend>\n )}\n </ChartLayout>\n </LayerColorStrategyProvider>\n </ColorScaleProvider>\n </MapStoreProvider>\n </MapDataBoundingBoxContext.Provider>\n </MapRawDataContext.Provider>\n </LayerIdsContext.Provider>\n </MapConfigurationContext.Provider>\n </MapCountryCodeContext.Provider>\n )}\n </div>\n );\n },\n);\n\n_MapView['displayName'] = 'MapView';\n\n/**\n * The `MapView` is a component that renders a map with various geospatial data layers.\n * @beta\n */\nexport const MapView = Object.assign(_MapView, {\n ErrorState: ErrorStateSlot,\n});\n"],
5
+ "mappings": "AAAA,OAAO;AAAA,EACL;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,OACf;AACP,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB,0BAA0B;AACzD,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AACxC,SAAS,6BAA6B;AACtC,SAAS,iCAAiC;AAC1C,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC,SAAS,gCAAgC;AACzC,SAAS,6BAA6B;AACtC,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,0BAA0B;AACnC,SAAS,kCAAkC;AAC3C,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAEjC,OAAO;AAMP,MAAM,WAAW;AAAA,EACf,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,UAAU;AAAA,MACV,OAAO;AAAA,MACP,WAAW;AAAA,MACX,GAAG;AAAA,IACL,IAAI;AACJ,UAAM,EAAE,UAAU,eAAe,IAAI,YAAY,QAAQ;AAEzD,UAAM,aAAa,kBAAkB,cAAc;AACnD,UAAM,iBAAiB,yBAAyB,QAAQ;AAExD,UAAM,eAAe,OAAuB,IAAI;AAChD,UAAM,UAAU,aAA0C;AAAA,MACxD;AAAA,MACA;AAAA,IACF,CAAC;AAED,wBAAoB,cAAc,OAAO;AAAA,MACvC,SAAS,aAAa;AAAA,MACtB,cAAc,MAAM;AAClB,4BAAoB,UAAU;AAAA,MAChC;AAAA,IACF,EAAE;AAEF,UAAM,SAAS,mBAAmB,QAAQ;AAE1C,UAAM,iBAAiB,CAAC,OAAO,UAAU,CAAC,CAAC,OAAO,OAAO;AACzD,UAAM,iBAAiB,OAAO,QAAQ;AACtC,UAAM,cAAc,OAAO,QAAQ;AACnC,UAAM,sBAAsB,OAAO,QAAQ;AAE3C,UAAM,EAAE,WAAW,IAAI,sBAAsB,QAAQ;AAErD,UAAM;AAAA,MACJ,WAAW;AAAA,MACX;AAAA,MACA;AAAA,IACF,IAAI,eAAe;AAEnB,UAAM,cAAc,gBAAgB,MAAM,MAAM,KAAK;AAErD,UAAM,kBAAkB,EAAE,OAAO,QAAQ,GAAG,cAAc;AAE1D,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,WAAW;AAAA,QACX,eAAY;AAAA;AAAA,MAEX,CAAC,qBAAqB,CAAC,eACtB,oCAAC,iBAAc,QAAQ,aAAa,IAEpC,oCAAC,sBAAsB,UAAtB,EAA+B,OAAO,eACrC,oCAAC,wBAAwB,UAAxB,EAAiC,OAAO,UACvC,oCAAC,gBAAgB,UAAhB,EAAyB,OAAO,YAC/B,oCAAC,kBAAkB,UAAlB,EAA2B,OAAO,cACjC,oCAAC,0BAA0B,UAA1B,EAAmC,OAAO,kBACzC,oCAAC,wBACC,oCAAC,0BACC,oCAAC,kCACC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,YAAY,WAAW;AAAA;AAAA,QAEvB,oCAAC,YAAY,OAAZ,MACE,CAAC,qBACA,oCAAC,cAAW,KAAK,SAAU,GAAG,aAC3B,cACH,CAEJ;AAAA,QACC,CAAC,kBACA;AAAA,UAAC,YAAY;AAAA,UAAZ;AAAA,YACC,UAAU;AAAA,YACV,OAAO;AAAA,YACP,iBAAiB;AAAA,YACjB,UAAU;AAAA;AAAA,UAEV,oCAAC,uBAAkB;AAAA,QACrB;AAAA,MAEJ,CACF,CACF,CACF,CACF,CACF,CACF,CACF,CACF;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,SAAS,aAAa,IAAI;AAMnB,MAAM,UAAU,OAAO,OAAO,UAAU;AAAA,EAC7C,YAAY;AACd,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/BubbleLayer/BubbleLayer.tsx"],
4
- "sourcesContent": ["import React, { PropsWithChildren } from 'react';\nimport { Source } from 'react-map-gl/maplibre';\n\nimport { BubbleCircleLayer } from './BubbleCircleLayer.js';\nimport { BubbleLayerTooltip } from './BubbleLayerTooltip.js';\nimport { BubbleOutlineLayer } from './BubbleOutlineLayer.js';\nimport { SizeInterpolationContext } from './contexts/size-interpolation.context.js';\nimport { buildRadiusScale } from './functions/build-radius-scale.js';\nimport { parseBubbleDataToGeoJSON } from './functions/parse-bubble-data-to-geo-json.js';\nimport { DEFAULT_BUBBLE_COLOR, DEFAULT_RADIUS } from '../../constants.js';\nimport { isBubbleTooltipTemplate } from '../../functions/tooltip-type-guards.js';\nimport { useLayerColoringStrategy } from '../../hooks/use-layer-coloring-strategy.js';\nimport { useLegendInteractionHighlighting } from '../../hooks/use-legend-interaction-highlighting.js';\nimport { useLegendInteractionVisibility } from '../../hooks/use-legend-interaction-visibility.js';\nimport { useResolveColor } from '../../hooks/use-resolve-color.js';\nimport { useTooltipTemplate } from '../../hooks/use-tooltip-template.js';\nimport { BubbleLayerTooltip as BubbleLayerTooltipSlot } from '../../slots/BubbleLayerTooltip.js';\nimport {\n InternalBubbleLayerProps,\n isScaleRadius,\n} from '../../types/bubble-layer.js';\nimport { Location } from '../../types/location.js';\n\nexport const BubbleLayer = <T extends Location>(\n props: PropsWithChildren<InternalBubbleLayerProps<T>>,\n) => {\n const {\n data,\n layerId,\n radius = DEFAULT_RADIUS,\n children,\n sizeInterpolation = 'fixed',\n } = props;\n\n const colorParser = useLayerColoringStrategy();\n const bubbleColor = useResolveColor(DEFAULT_BUBBLE_COLOR, props, colorParser);\n\n const sourceId = `source-${layerId}`;\n useLegendInteractionHighlighting(props, sourceId);\n useLegendInteractionVisibility(props, layerId);\n\n let radiusScale = (value: number) => value;\n\n if (isScaleRadius(props)) {\n const { radiusRange = [10, 100], radius, scale = 'linear' } = props;\n\n radiusScale = buildRadiusScale(data, radius, scale, radiusRange);\n }\n\n const dataGeoJson = parseBubbleDataToGeoJSON(\n data,\n bubbleColor,\n radius,\n radiusScale,\n );\n\n const tooltipTemplate = useTooltipTemplate(children, BubbleLayerTooltipSlot);\n\n return (\n <>\n <SizeInterpolationContext.Provider value={sizeInterpolation}>\n <Source id={sourceId} type=\"geojson\" data={dataGeoJson} generateId>\n <BubbleCircleLayer id={layerId} source={sourceId} />\n <BubbleOutlineLayer beforeId={layerId} source={sourceId} />\n </Source>\n </SizeInterpolationContext.Provider>\n\n <BubbleLayerTooltip\n layerId={layerId}\n tooltipTemplate={\n isBubbleTooltipTemplate(tooltipTemplate) ? tooltipTemplate : undefined\n }\n />\n </>\n );\n};\n\nBubbleLayer['displayName'] = 'BubbleLayer';\n"],
5
- "mappings": "AAAA,OAAO,WAAkC;AACzC,SAAS,cAAc;AAEvB,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,gCAAgC;AACzC,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,sBAAsB,sBAAsB;AACrD,SAAS,+BAA+B;AACxC,SAAS,gCAAgC;AACzC,SAAS,wCAAwC;AACjD,SAAS,sCAAsC;AAC/C,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB,8BAA8B;AAC7D;AAAA,EAEE;AAAA,OACK;AAGA,MAAM,cAAc,CACzB,UACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,oBAAoB;AAAA,EACtB,IAAI;AAEJ,QAAM,cAAc,yBAAyB;AAC7C,QAAM,cAAc,gBAAgB,sBAAsB,OAAO,WAAW;AAE5E,QAAM,WAAW,UAAU,OAAO;AAClC,mCAAiC,OAAO,QAAQ;AAChD,iCAA+B,OAAO,OAAO;AAE7C,MAAI,cAAc,CAAC,UAAkB;AAErC,MAAI,cAAc,KAAK,GAAG;AACxB,UAAM,EAAE,cAAc,CAAC,IAAI,GAAG,GAAG,QAAAA,SAAQ,QAAQ,SAAS,IAAI;AAE9D,kBAAc,iBAAiB,MAAMA,SAAQ,OAAO,WAAW;AAAA,EACjE;AAEA,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,kBAAkB,mBAAmB,UAAU,sBAAsB;AAE3E,SACE,0DACE,oCAAC,yBAAyB,UAAzB,EAAkC,OAAO,qBACxC,oCAAC,UAAO,IAAI,UAAU,MAAK,WAAU,MAAM,aAAa,YAAU,QAChE,oCAAC,qBAAkB,IAAI,SAAS,QAAQ,UAAU,GAClD,oCAAC,sBAAmB,UAAU,SAAS,QAAQ,UAAU,CAC3D,CACF,GAEA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,iBACE,wBAAwB,eAAe,IAAI,kBAAkB;AAAA;AAAA,EAEjE,CACF;AAEJ;AAEA,YAAY,aAAa,IAAI;",
4
+ "sourcesContent": ["import React, { type PropsWithChildren } from 'react';\nimport { Source } from 'react-map-gl/maplibre';\n\nimport { BubbleCircleLayer } from './BubbleCircleLayer.js';\nimport { BubbleLayerTooltip } from './BubbleLayerTooltip.js';\nimport { BubbleOutlineLayer } from './BubbleOutlineLayer.js';\nimport { SizeInterpolationContext } from './contexts/size-interpolation.context.js';\nimport { buildRadiusScale } from './functions/build-radius-scale.js';\nimport { parseBubbleDataToGeoJSON } from './functions/parse-bubble-data-to-geo-json.js';\nimport { DEFAULT_BUBBLE_COLOR, DEFAULT_RADIUS } from '../../constants.js';\nimport { isBubbleTooltipTemplate } from '../../functions/tooltip-type-guards.js';\nimport { useLayerColoringStrategy } from '../../hooks/use-layer-coloring-strategy.js';\nimport { useLegendInteractionHighlighting } from '../../hooks/use-legend-interaction-highlighting.js';\nimport { useLegendInteractionVisibility } from '../../hooks/use-legend-interaction-visibility.js';\nimport { useResolveColor } from '../../hooks/use-resolve-color.js';\nimport { useTooltipTemplate } from '../../hooks/use-tooltip-template.js';\nimport { BubbleLayerTooltip as BubbleLayerTooltipSlot } from '../../slots/BubbleLayerTooltip.js';\nimport {\n type InternalBubbleLayerProps,\n isScaleRadius,\n} from '../../types/bubble-layer.js';\nimport type { Location } from '../../types/location.js';\n\nexport const BubbleLayer = <T extends Location>(\n props: PropsWithChildren<InternalBubbleLayerProps<T>>,\n) => {\n const {\n data,\n layerId,\n radius = DEFAULT_RADIUS,\n children,\n sizeInterpolation = 'fixed',\n } = props;\n\n const colorParser = useLayerColoringStrategy();\n const bubbleColor = useResolveColor(DEFAULT_BUBBLE_COLOR, props, colorParser);\n\n const sourceId = `source-${layerId}`;\n useLegendInteractionHighlighting(props, sourceId);\n useLegendInteractionVisibility(props, layerId);\n\n let radiusScale = (value: number) => value;\n\n if (isScaleRadius(props)) {\n const { radiusRange = [10, 100], radius, scale = 'linear' } = props;\n\n radiusScale = buildRadiusScale(data, radius, scale, radiusRange);\n }\n\n const dataGeoJson = parseBubbleDataToGeoJSON(\n data,\n bubbleColor,\n radius,\n radiusScale,\n );\n\n const tooltipTemplate = useTooltipTemplate(children, BubbleLayerTooltipSlot);\n\n return (\n <>\n <SizeInterpolationContext.Provider value={sizeInterpolation}>\n <Source id={sourceId} type=\"geojson\" data={dataGeoJson} generateId>\n <BubbleCircleLayer id={layerId} source={sourceId} />\n <BubbleOutlineLayer beforeId={layerId} source={sourceId} />\n </Source>\n </SizeInterpolationContext.Provider>\n\n <BubbleLayerTooltip\n layerId={layerId}\n tooltipTemplate={\n isBubbleTooltipTemplate(tooltipTemplate) ? tooltipTemplate : undefined\n }\n />\n </>\n );\n};\n\nBubbleLayer['displayName'] = 'BubbleLayer';\n"],
5
+ "mappings": "AAAA,OAAO,WAAuC;AAC9C,SAAS,cAAc;AAEvB,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,gCAAgC;AACzC,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,sBAAsB,sBAAsB;AACrD,SAAS,+BAA+B;AACxC,SAAS,gCAAgC;AACzC,SAAS,wCAAwC;AACjD,SAAS,sCAAsC;AAC/C,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB,8BAA8B;AAC7D;AAAA,EAEE;AAAA,OACK;AAGA,MAAM,cAAc,CACzB,UACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,oBAAoB;AAAA,EACtB,IAAI;AAEJ,QAAM,cAAc,yBAAyB;AAC7C,QAAM,cAAc,gBAAgB,sBAAsB,OAAO,WAAW;AAE5E,QAAM,WAAW,UAAU,OAAO;AAClC,mCAAiC,OAAO,QAAQ;AAChD,iCAA+B,OAAO,OAAO;AAE7C,MAAI,cAAc,CAAC,UAAkB;AAErC,MAAI,cAAc,KAAK,GAAG;AACxB,UAAM,EAAE,cAAc,CAAC,IAAI,GAAG,GAAG,QAAAA,SAAQ,QAAQ,SAAS,IAAI;AAE9D,kBAAc,iBAAiB,MAAMA,SAAQ,OAAO,WAAW;AAAA,EACjE;AAEA,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,kBAAkB,mBAAmB,UAAU,sBAAsB;AAE3E,SACE,0DACE,oCAAC,yBAAyB,UAAzB,EAAkC,OAAO,qBACxC,oCAAC,UAAO,IAAI,UAAU,MAAK,WAAU,MAAM,aAAa,YAAU,QAChE,oCAAC,qBAAkB,IAAI,SAAS,QAAQ,UAAU,GAClD,oCAAC,sBAAmB,UAAU,SAAS,QAAQ,UAAU,CAC3D,CACF,GAEA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,iBACE,wBAAwB,eAAe,IAAI,kBAAkB;AAAA;AAAA,EAEjE,CACF;AAEJ;AAEA,YAAY,aAAa,IAAI;",
6
6
  "names": ["radius"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/BubbleLayer/BubbleLayerTooltip.tsx"],
4
- "sourcesContent": ["import React, { useRef } from 'react';\n\nimport {\n _ChartTooltip as ChartTooltip,\n _useChartActionsMenu as useChartActionsMenu,\n} from '@dynatrace/strato-components-preview/charts';\n\nimport {\n useMapTooltipPinnedState,\n useMapTooltipState,\n} from '../../store/selectors.js';\nimport { Location } from '../../types/location.js';\nimport {\n BubbleLayerTooltipData,\n BubbleLayerTooltipHandler,\n} from '../../types/tooltip.js';\n\ninterface BubbleTooltipStatePayload {\n __color: string;\n __hoveredColor: string;\n __radius: number;\n __lat: number;\n data: Location;\n}\n\nexport interface BubbleLayerTooltipProps {\n layerId: string;\n tooltipTemplate?: BubbleLayerTooltipHandler;\n}\n\nexport const BubbleLayerTooltip = (props: BubbleLayerTooltipProps) => {\n const { layerId, tooltipTemplate } = props;\n const {\n selectedItem: selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n onLeave,\n } = useChartActionsMenu();\n\n const tooltipRef = useRef<HTMLDivElement | null>(null);\n const { hoveredLayerId, data, position, visible, enabled } =\n useMapTooltipState<BubbleTooltipStatePayload>();\n const pinned = useMapTooltipPinnedState();\n\n const closestPoint = useRef<BubbleLayerTooltipData>();\n const remainingPoints = useRef<BubbleLayerTooltipData[]>([]);\n\n const forceHideTooltip =\n !pinned && (hoveredLayerId !== layerId || !visible || !enabled);\n\n if (!tooltipTemplate || forceHideTooltip || !position) {\n return null;\n }\n\n if (!pinned && data?.[0]) {\n const sanitizedData = data.map((bubbleProps) => {\n const {\n __color: color,\n __radius: radius,\n data: customData,\n } = bubbleProps;\n\n return {\n color,\n radius,\n data: customData,\n };\n });\n\n closestPoint.current = sanitizedData[0];\n remainingPoints.current = sanitizedData.slice(1);\n }\n\n return (\n <ChartTooltip\n position={position}\n pinned={pinned}\n ref={tooltipRef}\n onMouseLeave={onLeave}\n actionSelectionValue={{\n selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n }}\n >\n {closestPoint.current\n ? tooltipTemplate(closestPoint.current, remainingPoints.current)\n : null}\n </ChartTooltip>\n );\n};\n\nBubbleLayerTooltip['displayName'] = 'BubbleLayerTooltip';\n"],
4
+ "sourcesContent": ["import React, { useRef } from 'react';\n\nimport {\n _ChartTooltip as ChartTooltip,\n _useChartActionsMenu as useChartActionsMenu,\n} from '@dynatrace/strato-components-preview/charts';\n\nimport {\n useMapTooltipPinnedState,\n useMapTooltipState,\n} from '../../store/selectors.js';\nimport type { Location } from '../../types/location.js';\nimport type {\n BubbleLayerTooltipData,\n BubbleLayerTooltipHandler,\n} from '../../types/tooltip.js';\n\ninterface BubbleTooltipStatePayload {\n __color: string;\n __hoveredColor: string;\n __radius: number;\n __lat: number;\n data: Location;\n}\n\nexport interface BubbleLayerTooltipProps {\n layerId: string;\n tooltipTemplate?: BubbleLayerTooltipHandler;\n}\n\nexport const BubbleLayerTooltip = (props: BubbleLayerTooltipProps) => {\n const { layerId, tooltipTemplate } = props;\n const {\n selectedItem: selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n onLeave,\n } = useChartActionsMenu();\n\n const tooltipRef = useRef<HTMLDivElement | null>(null);\n const { hoveredLayerId, data, position, visible, enabled } =\n useMapTooltipState<BubbleTooltipStatePayload>();\n const pinned = useMapTooltipPinnedState();\n\n const closestPoint = useRef<BubbleLayerTooltipData>();\n const remainingPoints = useRef<BubbleLayerTooltipData[]>([]);\n\n const forceHideTooltip =\n !pinned && (hoveredLayerId !== layerId || !visible || !enabled);\n\n if (!tooltipTemplate || forceHideTooltip || !position) {\n return null;\n }\n\n if (!pinned && data?.[0]) {\n const sanitizedData = data.map((bubbleProps) => {\n const {\n __color: color,\n __radius: radius,\n data: customData,\n } = bubbleProps;\n\n return {\n color,\n radius,\n data: customData,\n };\n });\n\n closestPoint.current = sanitizedData[0];\n remainingPoints.current = sanitizedData.slice(1);\n }\n\n return (\n <ChartTooltip\n position={position}\n pinned={pinned}\n ref={tooltipRef}\n onMouseLeave={onLeave}\n actionSelectionValue={{\n selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n }}\n >\n {closestPoint.current\n ? tooltipTemplate(closestPoint.current, remainingPoints.current)\n : null}\n </ChartTooltip>\n );\n};\n\nBubbleLayerTooltip['displayName'] = 'BubbleLayerTooltip';\n"],
5
5
  "mappings": "AAAA,OAAO,SAAS,cAAc;AAE9B;AAAA,EACE,iBAAiB;AAAA,EACjB,wBAAwB;AAAA,OACnB;AAEP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAoBA,MAAM,qBAAqB,CAAC,UAAmC;AACpE,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,QAAM;AAAA,IACJ,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,oBAAoB;AAExB,QAAM,aAAa,OAA8B,IAAI;AACrD,QAAM,EAAE,gBAAgB,MAAM,UAAU,SAAS,QAAQ,IACvD,mBAA8C;AAChD,QAAM,SAAS,yBAAyB;AAExC,QAAM,eAAe,OAA+B;AACpD,QAAM,kBAAkB,OAAiC,CAAC,CAAC;AAE3D,QAAM,mBACJ,CAAC,WAAW,mBAAmB,WAAW,CAAC,WAAW,CAAC;AAEzD,MAAI,CAAC,mBAAmB,oBAAoB,CAAC,UAAU;AACrD,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,UAAU,OAAO,CAAC,GAAG;AACxB,UAAM,gBAAgB,KAAK,IAAI,CAAC,gBAAgB;AAC9C,YAAM;AAAA,QACJ,SAAS;AAAA,QACT,UAAU;AAAA,QACV,MAAM;AAAA,MACR,IAAI;AAEJ,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA,MAAM;AAAA,MACR;AAAA,IACF,CAAC;AAED,iBAAa,UAAU,cAAc,CAAC;AACtC,oBAAgB,UAAU,cAAc,MAAM,CAAC;AAAA,EACjD;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL,cAAc;AAAA,MACd,sBAAsB;AAAA,QACpB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA;AAAA,IAEC,aAAa,UACV,gBAAgB,aAAa,SAAS,gBAAgB,OAAO,IAC7D;AAAA,EACN;AAEJ;AAEA,mBAAmB,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/BubbleLayer/functions/add-outline-size.ts"],
4
- "sourcesContent": ["import { ExpressionSpecification } from '@maplibre/maplibre-gl-style-spec';\n\nimport { BUBBLE_OUTLINE_STROKE } from '../../../constants.js';\n\n/**\n * It modifies the radius size expression to take the bubble outline stroke size into account\n * @param expression - radius expression\n */\nexport const addOutlineSize = (\n expression: ExpressionSpecification,\n): ExpressionSpecification => ['+', expression, BUBBLE_OUTLINE_STROKE];\n"],
4
+ "sourcesContent": ["import type { ExpressionSpecification } from '@maplibre/maplibre-gl-style-spec';\n\nimport { BUBBLE_OUTLINE_STROKE } from '../../../constants.js';\n\n/**\n * It modifies the radius size expression to take the bubble outline stroke size into account\n * @param expression - radius expression\n */\nexport const addOutlineSize = (\n expression: ExpressionSpecification,\n): ExpressionSpecification => ['+', expression, BUBBLE_OUTLINE_STROKE];\n"],
5
5
  "mappings": "AAEA,SAAS,6BAA6B;AAM/B,MAAM,iBAAiB,CAC5B,eAC4B,CAAC,KAAK,YAAY,qBAAqB;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,7 @@
1
- import { scaleLinear, scaleLog } from "d3-scale";
1
+ import {
2
+ scaleLinear,
3
+ scaleLog
4
+ } from "d3-scale";
2
5
  const calculateDomain = (data, radius) => {
3
6
  let domain = [Infinity, -Infinity];
4
7
  for (let i = 0; i < data.length; i++) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/BubbleLayer/functions/build-radius-scale.ts"],
4
- "sourcesContent": ["import { scaleLinear, ScaleLinear, scaleLog, ScaleLogarithmic } from 'd3-scale';\n\nimport { Location } from '../../../types/location.js';\n\nconst calculateDomain = <T extends Location>(\n data: T[],\n radius: (item: T) => number,\n): [number, number] => {\n let domain: [number, number] = [Infinity, -Infinity];\n\n for (let i = 0; i < data.length; i++) {\n const radiusValue = radius(data[i]);\n\n const [currentMin, currentMax] = domain;\n\n domain = [\n Math.min(currentMin, radiusValue),\n Math.max(currentMax, radiusValue),\n ];\n }\n\n return domain;\n};\n\nexport const buildRadiusScale = <T extends Location>(\n data: T[],\n radius: (item: T) => number,\n scale: 'linear' | 'log',\n range: [number, number],\n): ScaleLinear<number, number> | ScaleLogarithmic<number, number> => {\n const [minRadius, maxRadius] = range;\n const domain = calculateDomain(data, radius);\n\n if (scale === 'linear') {\n return scaleLinear(domain, [minRadius, maxRadius]);\n }\n\n return scaleLog(domain, [minRadius, maxRadius]);\n};\n"],
5
- "mappings": "AAAA,SAAS,aAA0B,gBAAkC;AAIrE,MAAM,kBAAkB,CACtB,MACA,WACqB;AACrB,MAAI,SAA2B,CAAC,UAAU,SAAS;AAEnD,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,cAAc,OAAO,KAAK,CAAC,CAAC;AAElC,UAAM,CAAC,YAAY,UAAU,IAAI;AAEjC,aAAS;AAAA,MACP,KAAK,IAAI,YAAY,WAAW;AAAA,MAChC,KAAK,IAAI,YAAY,WAAW;AAAA,IAClC;AAAA,EACF;AAEA,SAAO;AACT;AAEO,MAAM,mBAAmB,CAC9B,MACA,QACA,OACA,UACmE;AACnE,QAAM,CAAC,WAAW,SAAS,IAAI;AAC/B,QAAM,SAAS,gBAAgB,MAAM,MAAM;AAE3C,MAAI,UAAU,UAAU;AACtB,WAAO,YAAY,QAAQ,CAAC,WAAW,SAAS,CAAC;AAAA,EACnD;AAEA,SAAO,SAAS,QAAQ,CAAC,WAAW,SAAS,CAAC;AAChD;",
4
+ "sourcesContent": ["import {\n scaleLinear,\n type ScaleLinear,\n scaleLog,\n type ScaleLogarithmic,\n} from 'd3-scale';\n\nimport type { Location } from '../../../types/location.js';\n\nconst calculateDomain = <T extends Location>(\n data: T[],\n radius: (item: T) => number,\n): [number, number] => {\n let domain: [number, number] = [Infinity, -Infinity];\n\n for (let i = 0; i < data.length; i++) {\n const radiusValue = radius(data[i]);\n\n const [currentMin, currentMax] = domain;\n\n domain = [\n Math.min(currentMin, radiusValue),\n Math.max(currentMax, radiusValue),\n ];\n }\n\n return domain;\n};\n\nexport const buildRadiusScale = <T extends Location>(\n data: T[],\n radius: (item: T) => number,\n scale: 'linear' | 'log',\n range: [number, number],\n): ScaleLinear<number, number> | ScaleLogarithmic<number, number> => {\n const [minRadius, maxRadius] = range;\n const domain = calculateDomain(data, radius);\n\n if (scale === 'linear') {\n return scaleLinear(domain, [minRadius, maxRadius]);\n }\n\n return scaleLog(domain, [minRadius, maxRadius]);\n};\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EAEA;AAAA,OAEK;AAIP,MAAM,kBAAkB,CACtB,MACA,WACqB;AACrB,MAAI,SAA2B,CAAC,UAAU,SAAS;AAEnD,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,cAAc,OAAO,KAAK,CAAC,CAAC;AAElC,UAAM,CAAC,YAAY,UAAU,IAAI;AAEjC,aAAS;AAAA,MACP,KAAK,IAAI,YAAY,WAAW;AAAA,MAChC,KAAK,IAAI,YAAY,WAAW;AAAA,IAClC;AAAA,EACF;AAEA,SAAO;AACT;AAEO,MAAM,mBAAmB,CAC9B,MACA,QACA,OACA,UACmE;AACnE,QAAM,CAAC,WAAW,SAAS,IAAI;AAC/B,QAAM,SAAS,gBAAgB,MAAM,MAAM;AAE3C,MAAI,UAAU,UAAU;AACtB,WAAO,YAAY,QAAQ,CAAC,WAAW,SAAS,CAAC;AAAA,EACnD;AAEA,SAAO,SAAS,QAAQ,CAAC,WAAW,SAAS,CAAC;AAChD;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/BubbleLayer/functions/build-stick-to-distance-expressions.ts"],
4
- "sourcesContent": ["import {\n DataDrivenPropertyValueSpecification,\n ExpressionSpecification,\n} from '@maplibre/maplibre-gl-style-spec';\n\nimport { addOutlineSize } from './add-outline-size.js';\n\n//#region FIXED PARAMETERS\nconst MAP_MAX_ZOOM_LEVEL = 22;\nconst MAP_MIN_ZOOM_LEVEL = 0;\nconst EQUATOR_METERS_BY_PIXEL_MAX_ZOOM_LEVEL_RATIO = 0.019;\n//#endregion\n\n//#region FINE-TUNING PARAMETERS\nconst shrinkFactor = 4;\nconst gainAtMaxZoomLevel = 10000;\n//#endregion\n\n/**\n * Expression to scale latitude in Mercator projection.\n */\nconst mercatorLatitudeScalingFactor: ExpressionSpecification = [\n 'cos',\n ['*', ['get', '__lat'], ['/', Math.PI, 180]],\n];\n\n/**\n * Expression to calculate the radius size at the minimum zoom level\n */\nconst minZoomLevelCalculation: ExpressionSpecification = [\n '/',\n ['get', '__radius'],\n shrinkFactor,\n];\n\n/**\n * Expression to calculate the radius size at the maximum zoom level\n */\nconst maxZoomLevelCalculation: ExpressionSpecification = [\n '/',\n [\n '/',\n ['*', ['get', '__radius'], gainAtMaxZoomLevel],\n EQUATOR_METERS_BY_PIXEL_MAX_ZOOM_LEVEL_RATIO,\n ],\n mercatorLatitudeScalingFactor,\n];\n\n/**\n * Builds the circle stick to distance expression.\n * It creates an exponential interpolation between the radius size at the minimum zoom level and the maximum zoom level\n * to generate the stick to distance effect.\n */\nexport const buildCircleStickToDistanceExpression =\n (): DataDrivenPropertyValueSpecification<number> => {\n return [\n 'interpolate',\n ['exponential', 2],\n ['zoom'],\n MAP_MIN_ZOOM_LEVEL,\n minZoomLevelCalculation,\n MAP_MAX_ZOOM_LEVEL,\n maxZoomLevelCalculation,\n ];\n };\n\n/**\n * Builds the outline stick to distance expression.\n * It creates an exponential interpolation between the outline radius size at the minimum zoom level and the maximum\n * zoom level to generate the stick to distance effect.\n */\nexport const buildOutlineStickToDistanceExpression =\n (): DataDrivenPropertyValueSpecification<number> => {\n return [\n 'interpolate',\n ['exponential', 2],\n ['zoom'],\n MAP_MIN_ZOOM_LEVEL,\n addOutlineSize(minZoomLevelCalculation),\n MAP_MAX_ZOOM_LEVEL,\n addOutlineSize(maxZoomLevelCalculation),\n ];\n };\n"],
4
+ "sourcesContent": ["import type {\n DataDrivenPropertyValueSpecification,\n ExpressionSpecification,\n} from '@maplibre/maplibre-gl-style-spec';\n\nimport { addOutlineSize } from './add-outline-size.js';\n\n//#region FIXED PARAMETERS\nconst MAP_MAX_ZOOM_LEVEL = 22;\nconst MAP_MIN_ZOOM_LEVEL = 0;\nconst EQUATOR_METERS_BY_PIXEL_MAX_ZOOM_LEVEL_RATIO = 0.019;\n//#endregion\n\n//#region FINE-TUNING PARAMETERS\nconst shrinkFactor = 4;\nconst gainAtMaxZoomLevel = 10000;\n//#endregion\n\n/**\n * Expression to scale latitude in Mercator projection.\n */\nconst mercatorLatitudeScalingFactor: ExpressionSpecification = [\n 'cos',\n ['*', ['get', '__lat'], ['/', Math.PI, 180]],\n];\n\n/**\n * Expression to calculate the radius size at the minimum zoom level\n */\nconst minZoomLevelCalculation: ExpressionSpecification = [\n '/',\n ['get', '__radius'],\n shrinkFactor,\n];\n\n/**\n * Expression to calculate the radius size at the maximum zoom level\n */\nconst maxZoomLevelCalculation: ExpressionSpecification = [\n '/',\n [\n '/',\n ['*', ['get', '__radius'], gainAtMaxZoomLevel],\n EQUATOR_METERS_BY_PIXEL_MAX_ZOOM_LEVEL_RATIO,\n ],\n mercatorLatitudeScalingFactor,\n];\n\n/**\n * Builds the circle stick to distance expression.\n * It creates an exponential interpolation between the radius size at the minimum zoom level and the maximum zoom level\n * to generate the stick to distance effect.\n */\nexport const buildCircleStickToDistanceExpression =\n (): DataDrivenPropertyValueSpecification<number> => {\n return [\n 'interpolate',\n ['exponential', 2],\n ['zoom'],\n MAP_MIN_ZOOM_LEVEL,\n minZoomLevelCalculation,\n MAP_MAX_ZOOM_LEVEL,\n maxZoomLevelCalculation,\n ];\n };\n\n/**\n * Builds the outline stick to distance expression.\n * It creates an exponential interpolation between the outline radius size at the minimum zoom level and the maximum\n * zoom level to generate the stick to distance effect.\n */\nexport const buildOutlineStickToDistanceExpression =\n (): DataDrivenPropertyValueSpecification<number> => {\n return [\n 'interpolate',\n ['exponential', 2],\n ['zoom'],\n MAP_MIN_ZOOM_LEVEL,\n addOutlineSize(minZoomLevelCalculation),\n MAP_MAX_ZOOM_LEVEL,\n addOutlineSize(maxZoomLevelCalculation),\n ];\n };\n"],
5
5
  "mappings": "AAKA,SAAS,sBAAsB;AAG/B,MAAM,qBAAqB;AAC3B,MAAM,qBAAqB;AAC3B,MAAM,+CAA+C;AAIrD,MAAM,eAAe;AACrB,MAAM,qBAAqB;AAM3B,MAAM,gCAAyD;AAAA,EAC7D;AAAA,EACA,CAAC,KAAK,CAAC,OAAO,OAAO,GAAG,CAAC,KAAK,KAAK,IAAI,GAAG,CAAC;AAC7C;AAKA,MAAM,0BAAmD;AAAA,EACvD;AAAA,EACA,CAAC,OAAO,UAAU;AAAA,EAClB;AACF;AAKA,MAAM,0BAAmD;AAAA,EACvD;AAAA,EACA;AAAA,IACE;AAAA,IACA,CAAC,KAAK,CAAC,OAAO,UAAU,GAAG,kBAAkB;AAAA,IAC7C;AAAA,EACF;AAAA,EACA;AACF;AAOO,MAAM,uCACX,MAAoD;AAClD,SAAO;AAAA,IACL;AAAA,IACA,CAAC,eAAe,CAAC;AAAA,IACjB,CAAC,MAAM;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOK,MAAM,wCACX,MAAoD;AAClD,SAAO;AAAA,IACL;AAAA,IACA,CAAC,eAAe,CAAC;AAAA,IACjB,CAAC,MAAM;AAAA,IACP;AAAA,IACA,eAAe,uBAAuB;AAAA,IACtC;AAAA,IACA,eAAe,uBAAuB;AAAA,EACxC;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/BubbleLayer/functions/define-radius.ts"],
4
- "sourcesContent": ["import { Location } from '../../../types/location.js';\n\nexport function defineRadius<T extends Location>(\n radius: number | ((item: T) => number),\n feature: T,\n) {\n return typeof radius === 'number' ? radius : radius(feature);\n}\n"],
4
+ "sourcesContent": ["import type { Location } from '../../../types/location.js';\n\nexport function defineRadius<T extends Location>(\n radius: number | ((item: T) => number),\n feature: T,\n) {\n return typeof radius === 'number' ? radius : radius(feature);\n}\n"],
5
5
  "mappings": "AAEO,SAAS,aACd,QACA,SACA;AACA,SAAO,OAAO,WAAW,WAAW,SAAS,OAAO,OAAO;AAC7D;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/BubbleLayer/functions/parse-bubble-data-to-geo-json.ts"],
4
- "sourcesContent": ["import { ScaleLinear, ScaleLogarithmic } from 'd3-scale';\n\nimport { _getCanvasColor as getCanvasColor } from '@dynatrace/strato-components-preview/charts';\n\nimport { defineRadius } from './define-radius.js';\nimport { calculateHoveredColor } from '../../../functions/calculate-hovered-color.js';\nimport { defineColor } from '../../../functions/define-color.js';\nimport { Location } from '../../../types/location.js';\n\ntype RadiusScale =\n | ScaleLinear<number, number>\n | ScaleLogarithmic<number, number>\n | ((value: number) => number);\n\nexport const parseBubbleDataToGeoJSON = <T extends Location>(\n data: T[],\n color: string | ((item: T) => string),\n radius: number | ((item: T) => number),\n scale: RadiusScale,\n) => {\n return {\n type: 'FeatureCollection',\n features: data.map((feature) => {\n const { longitude, latitude, ...properties } = feature;\n const canvasColor = getCanvasColor(defineColor(color, feature));\n const hoveredColor = calculateHoveredColor(canvasColor);\n const scaledRadius = scale(defineRadius(radius, feature));\n\n return {\n type: 'Feature',\n properties: {\n data: feature,\n ...properties,\n __color: canvasColor,\n __hoveredColor: hoveredColor,\n __radius: scaledRadius,\n __lat: latitude,\n },\n geometry: { type: 'Point', coordinates: [longitude, latitude] },\n };\n }),\n };\n};\n"],
4
+ "sourcesContent": ["import type { ScaleLinear, ScaleLogarithmic } from 'd3-scale';\n\nimport { _getCanvasColor as getCanvasColor } from '@dynatrace/strato-components-preview/charts';\n\nimport { defineRadius } from './define-radius.js';\nimport { calculateHoveredColor } from '../../../functions/calculate-hovered-color.js';\nimport { defineColor } from '../../../functions/define-color.js';\nimport type { Location } from '../../../types/location.js';\n\ntype RadiusScale =\n | ScaleLinear<number, number>\n | ScaleLogarithmic<number, number>\n | ((value: number) => number);\n\nexport const parseBubbleDataToGeoJSON = <T extends Location>(\n data: T[],\n color: string | ((item: T) => string),\n radius: number | ((item: T) => number),\n scale: RadiusScale,\n) => {\n return {\n type: 'FeatureCollection',\n features: data.map((feature) => {\n const { longitude, latitude, ...properties } = feature;\n const canvasColor = getCanvasColor(defineColor(color, feature));\n const hoveredColor = calculateHoveredColor(canvasColor);\n const scaledRadius = scale(defineRadius(radius, feature));\n\n return {\n type: 'Feature',\n properties: {\n data: feature,\n ...properties,\n __color: canvasColor,\n __hoveredColor: hoveredColor,\n __radius: scaledRadius,\n __lat: latitude,\n },\n geometry: { type: 'Point', coordinates: [longitude, latitude] },\n };\n }),\n };\n};\n"],
5
5
  "mappings": "AAEA,SAAS,mBAAmB,sBAAsB;AAElD,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,mBAAmB;AAQrB,MAAM,2BAA2B,CACtC,MACA,OACA,QACA,UACG;AACH,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU,KAAK,IAAI,CAAC,YAAY;AAC9B,YAAM,EAAE,WAAW,UAAU,GAAG,WAAW,IAAI;AAC/C,YAAM,cAAc,eAAe,YAAY,OAAO,OAAO,CAAC;AAC9D,YAAM,eAAe,sBAAsB,WAAW;AACtD,YAAM,eAAe,MAAM,aAAa,QAAQ,OAAO,CAAC;AAExD,aAAO;AAAA,QACL,MAAM;AAAA,QACN,YAAY;AAAA,UACV,MAAM;AAAA,UACN,GAAG;AAAA,UACH,SAAS;AAAA,UACT,gBAAgB;AAAA,UAChB,UAAU;AAAA,UACV,OAAO;AAAA,QACT;AAAA,QACA,UAAU,EAAE,MAAM,SAAS,aAAa,CAAC,WAAW,QAAQ,EAAE;AAAA,MAChE;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/ChoroplethLayer/ChoroplethLayer.tsx"],
4
- "sourcesContent": ["import React, { PropsWithChildren } from 'react';\nimport { Layer, Source } from 'react-map-gl/maplibre';\n\nimport { _getCanvasColor as getCanvasColor } from '@dynatrace/strato-components-preview/charts';\n\nimport { ChoroplethLayerTooltip } from './ChoroplethLayerTooltip.js';\nimport { parseRegionDataToGeoJSON } from './functions/parse-region-data-to-geo-json.js';\nimport {\n ACTIVE_COLOR,\n ACTIVE_STATE_BORDERS_WIDTH,\n DEFAULT_CHOROPLETH_COLOR,\n DEFAULT_COUNTRIES_BORDER_COLOR,\n LEGEND_DIM_OPACITY,\n SHAPE_OPACITY,\n TRANSPARENT_BORDER_COLOR,\n} from '../../constants.js';\nimport { isChoroplethTooltipTemplate } from '../../functions/tooltip-type-guards.js';\nimport { useLayerColoringStrategy } from '../../hooks/use-layer-coloring-strategy.js';\nimport { useLegendInteractionHighlighting } from '../../hooks/use-legend-interaction-highlighting.js';\nimport { useLegendInteractionVisibility } from '../../hooks/use-legend-interaction-visibility.js';\nimport { useMapSource } from '../../hooks/use-map-source.js';\nimport { useResolveColor } from '../../hooks/use-resolve-color.js';\nimport { useTooltipTemplate } from '../../hooks/use-tooltip-template.js';\nimport { ChoroplethLayerTooltip as ChoroplethLayerTooltipSlot } from '../../slots/ChoroplethLayerTooltip.js';\nimport { InternalChoroplethLayerProps } from '../../types/choropleth-layer.js';\n\nexport const ChoroplethLayer = <T extends Record<string, unknown>>(\n props: PropsWithChildren<InternalChoroplethLayerProps<T>>,\n) => {\n const { layerId, data, regionAccessor, children } = props;\n\n const mapSource = useMapSource();\n\n const colorParser = useLayerColoringStrategy();\n const choroplethColor = useResolveColor(\n DEFAULT_CHOROPLETH_COLOR,\n props,\n colorParser,\n );\n const sourceId = layerId.replace('layer', 'source');\n useLegendInteractionHighlighting(props, sourceId);\n useLegendInteractionVisibility(props, layerId);\n\n const dataGeoJSON = parseRegionDataToGeoJSON(\n mapSource,\n data,\n regionAccessor,\n choroplethColor,\n );\n\n const tooltipTemplate = useTooltipTemplate(\n children,\n ChoroplethLayerTooltipSlot,\n );\n\n return (\n <>\n <Source id={sourceId} type=\"geojson\" data={dataGeoJSON} generateId>\n <Layer\n id={layerId}\n type=\"fill\"\n source={sourceId}\n paint={{\n 'fill-color': [\n 'case',\n ['boolean', ['feature-state', 'active'], false],\n ['get', '__color'],\n ['boolean', ['feature-state', 'hover'], false],\n ['get', '__hoveredColor'],\n ['get', '__color'],\n ],\n 'fill-opacity': [\n 'case',\n ['boolean', ['feature-state', 'legendHover'], true],\n SHAPE_OPACITY,\n LEGEND_DIM_OPACITY,\n ],\n }}\n />\n <Layer\n type=\"line\"\n source={sourceId}\n paint={{\n 'line-color': getCanvasColor(DEFAULT_COUNTRIES_BORDER_COLOR),\n }}\n />\n <Layer\n type=\"line\"\n source={sourceId}\n paint={{\n 'line-color': [\n 'case',\n ['boolean', ['feature-state', 'active'], false],\n getCanvasColor(ACTIVE_COLOR),\n getCanvasColor(TRANSPARENT_BORDER_COLOR),\n ],\n 'line-width': ACTIVE_STATE_BORDERS_WIDTH,\n }}\n />\n </Source>\n\n <ChoroplethLayerTooltip\n layerId={layerId}\n tooltipTemplate={\n isChoroplethTooltipTemplate(tooltipTemplate)\n ? tooltipTemplate\n : undefined\n }\n />\n </>\n );\n};\n\nChoroplethLayer['displayName'] = 'ChoroplethLayer';\n"],
5
- "mappings": "AAAA,OAAO,WAAkC;AACzC,SAAS,OAAO,cAAc;AAE9B,SAAS,mBAAmB,sBAAsB;AAElD,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AACzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mCAAmC;AAC5C,SAAS,gCAAgC;AACzC,SAAS,wCAAwC;AACjD,SAAS,sCAAsC;AAC/C,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B,kCAAkC;AAG9D,MAAM,kBAAkB,CAC7B,UACG;AACH,QAAM,EAAE,SAAS,MAAM,gBAAgB,SAAS,IAAI;AAEpD,QAAM,YAAY,aAAa;AAE/B,QAAM,cAAc,yBAAyB;AAC7C,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,WAAW,QAAQ,QAAQ,SAAS,QAAQ;AAClD,mCAAiC,OAAO,QAAQ;AAChD,iCAA+B,OAAO,OAAO;AAE7C,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA;AAAA,EACF;AAEA,SACE,0DACE,oCAAC,UAAO,IAAI,UAAU,MAAK,WAAU,MAAM,aAAa,YAAU,QAChE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,MAAK;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,QACL,cAAc;AAAA,UACZ;AAAA,UACA,CAAC,WAAW,CAAC,iBAAiB,QAAQ,GAAG,KAAK;AAAA,UAC9C,CAAC,OAAO,SAAS;AAAA,UACjB,CAAC,WAAW,CAAC,iBAAiB,OAAO,GAAG,KAAK;AAAA,UAC7C,CAAC,OAAO,gBAAgB;AAAA,UACxB,CAAC,OAAO,SAAS;AAAA,QACnB;AAAA,QACA,gBAAgB;AAAA,UACd;AAAA,UACA,CAAC,WAAW,CAAC,iBAAiB,aAAa,GAAG,IAAI;AAAA,UAClD;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA;AAAA,EACF,GACA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,QACL,cAAc,eAAe,8BAA8B;AAAA,MAC7D;AAAA;AAAA,EACF,GACA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,QACL,cAAc;AAAA,UACZ;AAAA,UACA,CAAC,WAAW,CAAC,iBAAiB,QAAQ,GAAG,KAAK;AAAA,UAC9C,eAAe,YAAY;AAAA,UAC3B,eAAe,wBAAwB;AAAA,QACzC;AAAA,QACA,cAAc;AAAA,MAChB;AAAA;AAAA,EACF,CACF,GAEA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,iBACE,4BAA4B,eAAe,IACvC,kBACA;AAAA;AAAA,EAER,CACF;AAEJ;AAEA,gBAAgB,aAAa,IAAI;",
4
+ "sourcesContent": ["import React, { type PropsWithChildren } from 'react';\nimport { Layer, Source } from 'react-map-gl/maplibre';\n\nimport { _getCanvasColor as getCanvasColor } from '@dynatrace/strato-components-preview/charts';\n\nimport { ChoroplethLayerTooltip } from './ChoroplethLayerTooltip.js';\nimport { parseRegionDataToGeoJSON } from './functions/parse-region-data-to-geo-json.js';\nimport {\n ACTIVE_COLOR,\n ACTIVE_STATE_BORDERS_WIDTH,\n DEFAULT_CHOROPLETH_COLOR,\n DEFAULT_COUNTRIES_BORDER_COLOR,\n LEGEND_DIM_OPACITY,\n SHAPE_OPACITY,\n TRANSPARENT_BORDER_COLOR,\n} from '../../constants.js';\nimport { isChoroplethTooltipTemplate } from '../../functions/tooltip-type-guards.js';\nimport { useLayerColoringStrategy } from '../../hooks/use-layer-coloring-strategy.js';\nimport { useLegendInteractionHighlighting } from '../../hooks/use-legend-interaction-highlighting.js';\nimport { useLegendInteractionVisibility } from '../../hooks/use-legend-interaction-visibility.js';\nimport { useMapSource } from '../../hooks/use-map-source.js';\nimport { useResolveColor } from '../../hooks/use-resolve-color.js';\nimport { useTooltipTemplate } from '../../hooks/use-tooltip-template.js';\nimport { ChoroplethLayerTooltip as ChoroplethLayerTooltipSlot } from '../../slots/ChoroplethLayerTooltip.js';\nimport type { InternalChoroplethLayerProps } from '../../types/choropleth-layer.js';\n\nexport const ChoroplethLayer = <T extends Record<string, unknown>>(\n props: PropsWithChildren<InternalChoroplethLayerProps<T>>,\n) => {\n const { layerId, data, regionAccessor, children } = props;\n\n const mapSource = useMapSource();\n\n const colorParser = useLayerColoringStrategy();\n const choroplethColor = useResolveColor(\n DEFAULT_CHOROPLETH_COLOR,\n props,\n colorParser,\n );\n const sourceId = layerId.replace('layer', 'source');\n useLegendInteractionHighlighting(props, sourceId);\n useLegendInteractionVisibility(props, layerId);\n\n const dataGeoJSON = parseRegionDataToGeoJSON(\n mapSource,\n data,\n regionAccessor,\n choroplethColor,\n );\n\n const tooltipTemplate = useTooltipTemplate(\n children,\n ChoroplethLayerTooltipSlot,\n );\n\n return (\n <>\n <Source id={sourceId} type=\"geojson\" data={dataGeoJSON} generateId>\n <Layer\n id={layerId}\n type=\"fill\"\n source={sourceId}\n paint={{\n 'fill-color': [\n 'case',\n ['boolean', ['feature-state', 'active'], false],\n ['get', '__color'],\n ['boolean', ['feature-state', 'hover'], false],\n ['get', '__hoveredColor'],\n ['get', '__color'],\n ],\n 'fill-opacity': [\n 'case',\n ['boolean', ['feature-state', 'legendHover'], true],\n SHAPE_OPACITY,\n LEGEND_DIM_OPACITY,\n ],\n }}\n />\n <Layer\n type=\"line\"\n source={sourceId}\n paint={{\n 'line-color': getCanvasColor(DEFAULT_COUNTRIES_BORDER_COLOR),\n }}\n />\n <Layer\n type=\"line\"\n source={sourceId}\n paint={{\n 'line-color': [\n 'case',\n ['boolean', ['feature-state', 'active'], false],\n getCanvasColor(ACTIVE_COLOR),\n getCanvasColor(TRANSPARENT_BORDER_COLOR),\n ],\n 'line-width': ACTIVE_STATE_BORDERS_WIDTH,\n }}\n />\n </Source>\n\n <ChoroplethLayerTooltip\n layerId={layerId}\n tooltipTemplate={\n isChoroplethTooltipTemplate(tooltipTemplate)\n ? tooltipTemplate\n : undefined\n }\n />\n </>\n );\n};\n\nChoroplethLayer['displayName'] = 'ChoroplethLayer';\n"],
5
+ "mappings": "AAAA,OAAO,WAAuC;AAC9C,SAAS,OAAO,cAAc;AAE9B,SAAS,mBAAmB,sBAAsB;AAElD,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AACzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mCAAmC;AAC5C,SAAS,gCAAgC;AACzC,SAAS,wCAAwC;AACjD,SAAS,sCAAsC;AAC/C,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B,kCAAkC;AAG9D,MAAM,kBAAkB,CAC7B,UACG;AACH,QAAM,EAAE,SAAS,MAAM,gBAAgB,SAAS,IAAI;AAEpD,QAAM,YAAY,aAAa;AAE/B,QAAM,cAAc,yBAAyB;AAC7C,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,WAAW,QAAQ,QAAQ,SAAS,QAAQ;AAClD,mCAAiC,OAAO,QAAQ;AAChD,iCAA+B,OAAO,OAAO;AAE7C,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA;AAAA,EACF;AAEA,SACE,0DACE,oCAAC,UAAO,IAAI,UAAU,MAAK,WAAU,MAAM,aAAa,YAAU,QAChE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,MAAK;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,QACL,cAAc;AAAA,UACZ;AAAA,UACA,CAAC,WAAW,CAAC,iBAAiB,QAAQ,GAAG,KAAK;AAAA,UAC9C,CAAC,OAAO,SAAS;AAAA,UACjB,CAAC,WAAW,CAAC,iBAAiB,OAAO,GAAG,KAAK;AAAA,UAC7C,CAAC,OAAO,gBAAgB;AAAA,UACxB,CAAC,OAAO,SAAS;AAAA,QACnB;AAAA,QACA,gBAAgB;AAAA,UACd;AAAA,UACA,CAAC,WAAW,CAAC,iBAAiB,aAAa,GAAG,IAAI;AAAA,UAClD;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA;AAAA,EACF,GACA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,QACL,cAAc,eAAe,8BAA8B;AAAA,MAC7D;AAAA;AAAA,EACF,GACA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,QACL,cAAc;AAAA,UACZ;AAAA,UACA,CAAC,WAAW,CAAC,iBAAiB,QAAQ,GAAG,KAAK;AAAA,UAC9C,eAAe,YAAY;AAAA,UAC3B,eAAe,wBAAwB;AAAA,QACzC;AAAA,QACA,cAAc;AAAA,MAChB;AAAA;AAAA,EACF,CACF,GAEA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,iBACE,4BAA4B,eAAe,IACvC,kBACA;AAAA;AAAA,EAER,CACF;AAEJ;AAEA,gBAAgB,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/ChoroplethLayer/ChoroplethLayerTooltip.tsx"],
4
- "sourcesContent": ["import React, { useRef } from 'react';\n\nimport {\n _ChartTooltip as ChartTooltip,\n _useChartActionsMenu as useChartActionsMenu,\n} from '@dynatrace/strato-components-preview/charts';\n\nimport {\n useMapTooltipPinnedState,\n useMapTooltipState,\n} from '../../store/selectors.js';\nimport {\n ChoroplethLayerTooltipData,\n ChoroplethLayerTooltipHandler,\n} from '../../types/tooltip.js';\n\ninterface ChoroplethTooltipStatePayload {\n name: string;\n __color: string;\n __hoveredColor: string;\n data: Record<string, unknown>;\n}\n\nexport interface ChoroplethLayerTooltipProps {\n layerId: string;\n tooltipTemplate?: ChoroplethLayerTooltipHandler;\n}\n\nexport const ChoroplethLayerTooltip = (props: ChoroplethLayerTooltipProps) => {\n const { layerId, tooltipTemplate } = props;\n const {\n selectedItem: selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n onLeave,\n } = useChartActionsMenu();\n\n const { hoveredLayerId, position, data, visible, enabled } =\n useMapTooltipState<ChoroplethTooltipStatePayload>();\n const pinned = useMapTooltipPinnedState();\n\n const regionData = useRef<ChoroplethLayerTooltipData>();\n\n const forceHideTooltip =\n !pinned && (hoveredLayerId !== layerId || !visible || !enabled);\n\n if (!tooltipTemplate || forceHideTooltip || !position) {\n return null;\n }\n\n if (!pinned && data?.[0]) {\n const { name, __color: color, data: customData } = data[0];\n\n regionData.current = { data: customData, name, color };\n }\n\n return (\n <ChartTooltip\n position={position}\n pinned={pinned}\n onMouseLeave={onLeave}\n actionSelectionValue={{\n selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n }}\n >\n {regionData.current ? tooltipTemplate(regionData.current) : null}\n </ChartTooltip>\n );\n};\n\nChoroplethLayerTooltip['displayName'] = 'ChoroplethLayerTooltip';\n"],
4
+ "sourcesContent": ["import React, { useRef } from 'react';\n\nimport {\n _ChartTooltip as ChartTooltip,\n _useChartActionsMenu as useChartActionsMenu,\n} from '@dynatrace/strato-components-preview/charts';\n\nimport {\n useMapTooltipPinnedState,\n useMapTooltipState,\n} from '../../store/selectors.js';\nimport type {\n ChoroplethLayerTooltipData,\n ChoroplethLayerTooltipHandler,\n} from '../../types/tooltip.js';\n\ninterface ChoroplethTooltipStatePayload {\n name: string;\n __color: string;\n __hoveredColor: string;\n data: Record<string, unknown>;\n}\n\nexport interface ChoroplethLayerTooltipProps {\n layerId: string;\n tooltipTemplate?: ChoroplethLayerTooltipHandler;\n}\n\nexport const ChoroplethLayerTooltip = (props: ChoroplethLayerTooltipProps) => {\n const { layerId, tooltipTemplate } = props;\n const {\n selectedItem: selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n onLeave,\n } = useChartActionsMenu();\n\n const { hoveredLayerId, position, data, visible, enabled } =\n useMapTooltipState<ChoroplethTooltipStatePayload>();\n const pinned = useMapTooltipPinnedState();\n\n const regionData = useRef<ChoroplethLayerTooltipData>();\n\n const forceHideTooltip =\n !pinned && (hoveredLayerId !== layerId || !visible || !enabled);\n\n if (!tooltipTemplate || forceHideTooltip || !position) {\n return null;\n }\n\n if (!pinned && data?.[0]) {\n const { name, __color: color, data: customData } = data[0];\n\n regionData.current = { data: customData, name, color };\n }\n\n return (\n <ChartTooltip\n position={position}\n pinned={pinned}\n onMouseLeave={onLeave}\n actionSelectionValue={{\n selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n }}\n >\n {regionData.current ? tooltipTemplate(regionData.current) : null}\n </ChartTooltip>\n );\n};\n\nChoroplethLayerTooltip['displayName'] = 'ChoroplethLayerTooltip';\n"],
5
5
  "mappings": "AAAA,OAAO,SAAS,cAAc;AAE9B;AAAA,EACE,iBAAiB;AAAA,EACjB,wBAAwB;AAAA,OACnB;AAEP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAkBA,MAAM,yBAAyB,CAAC,UAAuC;AAC5E,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,QAAM;AAAA,IACJ,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,oBAAoB;AAExB,QAAM,EAAE,gBAAgB,UAAU,MAAM,SAAS,QAAQ,IACvD,mBAAkD;AACpD,QAAM,SAAS,yBAAyB;AAExC,QAAM,aAAa,OAAmC;AAEtD,QAAM,mBACJ,CAAC,WAAW,mBAAmB,WAAW,CAAC,WAAW,CAAC;AAEzD,MAAI,CAAC,mBAAmB,oBAAoB,CAAC,UAAU;AACrD,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,UAAU,OAAO,CAAC,GAAG;AACxB,UAAM,EAAE,MAAM,SAAS,OAAO,MAAM,WAAW,IAAI,KAAK,CAAC;AAEzD,eAAW,UAAU,EAAE,MAAM,YAAY,MAAM,MAAM;AAAA,EACvD;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,sBAAsB;AAAA,QACpB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA;AAAA,IAEC,WAAW,UAAU,gBAAgB,WAAW,OAAO,IAAI;AAAA,EAC9D;AAEJ;AAEA,uBAAuB,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/ConnectionLayer/ConnectionLayer.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport { Layer, Source } from 'react-map-gl/maplibre';\n\nimport { ConnectionLayerDirection } from './ConnectionLayerDirection.js';\nimport { ConnectionLayerTooltip } from './ConnectionLayerTooltip.js';\nimport { parseConnectionDataToGeoJSON } from './functions/parse-connection-data-to-geo-json.js';\nimport { useConnectionLayerMouseMove } from './hooks/use-connection-layer-mouse-move.js';\nimport {\n DEFAULT_LINE_CAP,\n DEFAULT_LINE_COLOR,\n DEFAULT_LINE_DASH_ARRAY,\n DEFAULT_LINE_JOIN,\n DEFAULT_LINE_THICKNESS,\n} from '../../constants.js';\nimport { isConnectionTooltipTemplate } from '../../functions/tooltip-type-guards.js';\nimport { useTooltipTemplate } from '../../hooks/use-tooltip-template.js';\nimport { ConnectionLayerTooltip as ConnectionLayerTooltipSlot } from '../../slots/ConnectionLayerTooltip.js';\nimport {\n InternalConnectionLayerProps,\n type Connection,\n} from '../../types/connection-layer.js';\n\nexport const ConnectionLayer = <T extends Connection>(\n props: React.PropsWithChildren<InternalConnectionLayerProps<T>>,\n) => {\n const {\n data,\n layerId,\n children,\n color = DEFAULT_LINE_COLOR,\n curve,\n directionIndicator,\n line,\n thickness = DEFAULT_LINE_THICKNESS,\n } = props;\n\n const sourceId = `source-${layerId}`;\n\n const geoJsonData = parseConnectionDataToGeoJSON(\n data,\n thickness,\n color,\n curve,\n );\n\n const tooltipTemplate = useTooltipTemplate(\n children,\n ConnectionLayerTooltipSlot,\n );\n\n const { layerIds } = useConnectionLayerMouseMove(geoJsonData.length, layerId);\n\n return geoJsonData.map((featureCollection, index) => (\n <React.Fragment key={index}>\n <Source\n id={`${sourceId}-${index}`}\n type=\"geojson\"\n data={featureCollection}\n promoteId={'id'}\n >\n <Layer\n type=\"line\"\n id={layerIds[index]}\n layout={{\n 'line-cap': DEFAULT_LINE_CAP,\n 'line-join': DEFAULT_LINE_JOIN,\n }}\n paint={{\n 'line-color': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n ['get', '__lineHoveredColor'],\n ['get', '__lineColor'],\n ],\n 'line-width': ['get', '__lineWidth'],\n ...(line && line === 'dashed'\n ? { 'line-dasharray': DEFAULT_LINE_DASH_ARRAY }\n : null),\n }}\n />\n </Source>\n\n <ConnectionLayerTooltip\n layerId={layerIds[index]}\n tooltipTemplate={\n isConnectionTooltipTemplate(tooltipTemplate)\n ? tooltipTemplate\n : undefined\n }\n />\n\n {directionIndicator && (\n <ConnectionLayerDirection\n geoJsonData={featureCollection}\n layerId={layerIds[index]}\n directionIndicator={directionIndicator}\n />\n )}\n </React.Fragment>\n ));\n};\n\nConnectionLayer['displayName'] = 'ConnectionLayer';\n"],
4
+ "sourcesContent": ["import React from 'react';\nimport { Layer, Source } from 'react-map-gl/maplibre';\n\nimport { ConnectionLayerDirection } from './ConnectionLayerDirection.js';\nimport { ConnectionLayerTooltip } from './ConnectionLayerTooltip.js';\nimport { parseConnectionDataToGeoJSON } from './functions/parse-connection-data-to-geo-json.js';\nimport { useConnectionLayerMouseMove } from './hooks/use-connection-layer-mouse-move.js';\nimport {\n DEFAULT_LINE_CAP,\n DEFAULT_LINE_COLOR,\n DEFAULT_LINE_DASH_ARRAY,\n DEFAULT_LINE_JOIN,\n DEFAULT_LINE_THICKNESS,\n} from '../../constants.js';\nimport { isConnectionTooltipTemplate } from '../../functions/tooltip-type-guards.js';\nimport { useTooltipTemplate } from '../../hooks/use-tooltip-template.js';\nimport { ConnectionLayerTooltip as ConnectionLayerTooltipSlot } from '../../slots/ConnectionLayerTooltip.js';\nimport type {\n InternalConnectionLayerProps,\n Connection,\n} from '../../types/connection-layer.js';\n\nexport const ConnectionLayer = <T extends Connection>(\n props: React.PropsWithChildren<InternalConnectionLayerProps<T>>,\n) => {\n const {\n data,\n layerId,\n children,\n color = DEFAULT_LINE_COLOR,\n curve,\n directionIndicator,\n line,\n thickness = DEFAULT_LINE_THICKNESS,\n } = props;\n\n const sourceId = `source-${layerId}`;\n\n const geoJsonData = parseConnectionDataToGeoJSON(\n data,\n thickness,\n color,\n curve,\n );\n\n const tooltipTemplate = useTooltipTemplate(\n children,\n ConnectionLayerTooltipSlot,\n );\n\n const { layerIds } = useConnectionLayerMouseMove(geoJsonData.length, layerId);\n\n return geoJsonData.map((featureCollection, index) => (\n <React.Fragment key={index}>\n <Source\n id={`${sourceId}-${index}`}\n type=\"geojson\"\n data={featureCollection}\n promoteId={'id'}\n >\n <Layer\n type=\"line\"\n id={layerIds[index]}\n layout={{\n 'line-cap': DEFAULT_LINE_CAP,\n 'line-join': DEFAULT_LINE_JOIN,\n }}\n paint={{\n 'line-color': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n ['get', '__lineHoveredColor'],\n ['get', '__lineColor'],\n ],\n 'line-width': ['get', '__lineWidth'],\n ...(line && line === 'dashed'\n ? { 'line-dasharray': DEFAULT_LINE_DASH_ARRAY }\n : null),\n }}\n />\n </Source>\n\n <ConnectionLayerTooltip\n layerId={layerIds[index]}\n tooltipTemplate={\n isConnectionTooltipTemplate(tooltipTemplate)\n ? tooltipTemplate\n : undefined\n }\n />\n\n {directionIndicator && (\n <ConnectionLayerDirection\n geoJsonData={featureCollection}\n layerId={layerIds[index]}\n directionIndicator={directionIndicator}\n />\n )}\n </React.Fragment>\n ));\n};\n\nConnectionLayer['displayName'] = 'ConnectionLayer';\n"],
5
5
  "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,OAAO,cAAc;AAE9B,SAAS,gCAAgC;AACzC,SAAS,8BAA8B;AACvC,SAAS,oCAAoC;AAC7C,SAAS,mCAAmC;AAC5C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mCAAmC;AAC5C,SAAS,0BAA0B;AACnC,SAAS,0BAA0B,kCAAkC;AAM9D,MAAM,kBAAkB,CAC7B,UACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EACd,IAAI;AAEJ,QAAM,WAAW,UAAU,OAAO;AAElC,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,kBAAkB;AAAA,IACtB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,EAAE,SAAS,IAAI,4BAA4B,YAAY,QAAQ,OAAO;AAE5E,SAAO,YAAY,IAAI,CAAC,mBAAmB,UACzC,oCAAC,MAAM,UAAN,EAAe,KAAK,SACnB;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,GAAG,QAAQ,IAAI,KAAK;AAAA,MACxB,MAAK;AAAA,MACL,MAAM;AAAA,MACN,WAAW;AAAA;AAAA,IAEX;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,IAAI,SAAS,KAAK;AAAA,QAClB,QAAQ;AAAA,UACN,YAAY;AAAA,UACZ,aAAa;AAAA,QACf;AAAA,QACA,OAAO;AAAA,UACL,cAAc;AAAA,YACZ;AAAA,YACA,CAAC,WAAW,CAAC,iBAAiB,OAAO,GAAG,KAAK;AAAA,YAC7C,CAAC,OAAO,oBAAoB;AAAA,YAC5B,CAAC,OAAO,aAAa;AAAA,UACvB;AAAA,UACA,cAAc,CAAC,OAAO,aAAa;AAAA,UACnC,GAAI,QAAQ,SAAS,WACjB,EAAE,kBAAkB,wBAAwB,IAC5C;AAAA,QACN;AAAA;AAAA,IACF;AAAA,EACF,GAEA;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,SAAS,KAAK;AAAA,MACvB,iBACE,4BAA4B,eAAe,IACvC,kBACA;AAAA;AAAA,EAER,GAEC,sBACC;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb,SAAS,SAAS,KAAK;AAAA,MACvB;AAAA;AAAA,EACF,CAEJ,CACD;AACH;AAEA,gBAAgB,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/ConnectionLayer/ConnectionLayerDirection.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport { Layer, Source } from 'react-map-gl';\n\nimport { SorterIcon } from '@dynatrace/strato-icons';\n\nimport { parseDirectionDataToGeoJSON } from './functions/parse-direction-data-to-geo-json.js';\nimport {\n DIRECTION_ICON_OUTPUT_SIZE,\n DIRECTION_ICON_SHRINK_RATIO,\n} from '../../constants.js';\nimport { useLoadSymbolIntoMap } from '../../hooks/use-load-symbol-into-map.js';\nimport {\n InternalConnectionLayerProps,\n type Connection,\n} from '../../types/connection-layer.js';\n\ninterface ConnectionLayerDirectionProps<T extends Connection>\n extends Required<\n Pick<InternalConnectionLayerProps<T>, 'layerId' | 'directionIndicator'>\n > {\n geoJsonData: GeoJSON.FeatureCollection;\n}\n\nexport const ConnectionLayerDirection = <T extends Connection>(\n props: ConnectionLayerDirectionProps<T>,\n) => {\n const { geoJsonData, layerId: connectionLayerId, directionIndicator } = props;\n\n const layerId = `${connectionLayerId}-direction`;\n const sourceId = `source-${layerId}`;\n\n // To get an image with enough quality instead of creating a tiny pic\n // and enlarge it, we create a huge image to shrink it\n const { symbolName } = useLoadSymbolIntoMap(\n <SorterIcon />,\n layerId,\n DIRECTION_ICON_OUTPUT_SIZE,\n );\n\n const parsedGeoJsonData = parseDirectionDataToGeoJSON({\n geoJsonData,\n directionIndicator,\n });\n\n /**\n * This value is necessary due to the icon\n * that comes from the '@dynatrace/strato-icons'\n * SorterIcon points downwards, but it should point upwards\n * for the sake of the angle calculation.\n */\n const iconRotationDegrees = 180;\n\n return (\n <Source\n id={sourceId}\n type=\"geojson\"\n data={parsedGeoJsonData}\n promoteId={'id'}\n >\n <Layer\n id={layerId}\n beforeId={connectionLayerId}\n type=\"symbol\"\n layout={{\n 'symbol-placement': 'point',\n 'icon-image': symbolName,\n 'icon-rotate': ['+', ['get', '__angle'], iconRotationDegrees],\n 'icon-rotation-alignment': 'map',\n 'icon-allow-overlap': true,\n 'icon-ignore-placement': true,\n 'icon-size': [\n '*',\n ['get', '__lineWidth'],\n DIRECTION_ICON_SHRINK_RATIO,\n ],\n }}\n paint={{\n 'icon-color': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n ['get', '__lineHoveredColor'],\n ['get', '__lineColor'],\n ],\n 'icon-opacity': ['get', '__lineOpacity'],\n }}\n />\n </Source>\n );\n};\n\nConnectionLayerDirection['displayName'] = 'ConnectionLayerDirection';\n"],
4
+ "sourcesContent": ["import React from 'react';\nimport { Layer, Source } from 'react-map-gl';\n\nimport { SorterIcon } from '@dynatrace/strato-icons';\n\nimport { parseDirectionDataToGeoJSON } from './functions/parse-direction-data-to-geo-json.js';\nimport {\n DIRECTION_ICON_OUTPUT_SIZE,\n DIRECTION_ICON_SHRINK_RATIO,\n} from '../../constants.js';\nimport { useLoadSymbolIntoMap } from '../../hooks/use-load-symbol-into-map.js';\nimport type {\n InternalConnectionLayerProps,\n Connection,\n} from '../../types/connection-layer.js';\n\ninterface ConnectionLayerDirectionProps<T extends Connection>\n extends Required<\n Pick<InternalConnectionLayerProps<T>, 'layerId' | 'directionIndicator'>\n > {\n geoJsonData: GeoJSON.FeatureCollection;\n}\n\nexport const ConnectionLayerDirection = <T extends Connection>(\n props: ConnectionLayerDirectionProps<T>,\n) => {\n const { geoJsonData, layerId: connectionLayerId, directionIndicator } = props;\n\n const layerId = `${connectionLayerId}-direction`;\n const sourceId = `source-${layerId}`;\n\n // To get an image with enough quality instead of creating a tiny pic\n // and enlarge it, we create a huge image to shrink it\n const { symbolName } = useLoadSymbolIntoMap(\n <SorterIcon />,\n layerId,\n DIRECTION_ICON_OUTPUT_SIZE,\n );\n\n const parsedGeoJsonData = parseDirectionDataToGeoJSON({\n geoJsonData,\n directionIndicator,\n });\n\n /**\n * This value is necessary due to the icon\n * that comes from the '@dynatrace/strato-icons'\n * SorterIcon points downwards, but it should point upwards\n * for the sake of the angle calculation.\n */\n const iconRotationDegrees = 180;\n\n return (\n <Source\n id={sourceId}\n type=\"geojson\"\n data={parsedGeoJsonData}\n promoteId={'id'}\n >\n <Layer\n id={layerId}\n beforeId={connectionLayerId}\n type=\"symbol\"\n layout={{\n 'symbol-placement': 'point',\n 'icon-image': symbolName,\n 'icon-rotate': ['+', ['get', '__angle'], iconRotationDegrees],\n 'icon-rotation-alignment': 'map',\n 'icon-allow-overlap': true,\n 'icon-ignore-placement': true,\n 'icon-size': [\n '*',\n ['get', '__lineWidth'],\n DIRECTION_ICON_SHRINK_RATIO,\n ],\n }}\n paint={{\n 'icon-color': [\n 'case',\n ['boolean', ['feature-state', 'hover'], false],\n ['get', '__lineHoveredColor'],\n ['get', '__lineColor'],\n ],\n 'icon-opacity': ['get', '__lineOpacity'],\n }}\n />\n </Source>\n );\n};\n\nConnectionLayerDirection['displayName'] = 'ConnectionLayerDirection';\n"],
5
5
  "mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,OAAO,cAAc;AAE9B,SAAS,kBAAkB;AAE3B,SAAS,mCAAmC;AAC5C;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AAa9B,MAAM,2BAA2B,CACtC,UACG;AACH,QAAM,EAAE,aAAa,SAAS,mBAAmB,mBAAmB,IAAI;AAExE,QAAM,UAAU,GAAG,iBAAiB;AACpC,QAAM,WAAW,UAAU,OAAO;AAIlC,QAAM,EAAE,WAAW,IAAI;AAAA,IACrB,oCAAC,gBAAW;AAAA,IACZ;AAAA,IACA;AAAA,EACF;AAEA,QAAM,oBAAoB,4BAA4B;AAAA,IACpD;AAAA,IACA;AAAA,EACF,CAAC;AAQD,QAAM,sBAAsB;AAE5B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,MAAK;AAAA,MACL,MAAM;AAAA,MACN,WAAW;AAAA;AAAA,IAEX;AAAA,MAAC;AAAA;AAAA,QACC,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,MAAK;AAAA,QACL,QAAQ;AAAA,UACN,oBAAoB;AAAA,UACpB,cAAc;AAAA,UACd,eAAe,CAAC,KAAK,CAAC,OAAO,SAAS,GAAG,mBAAmB;AAAA,UAC5D,2BAA2B;AAAA,UAC3B,sBAAsB;AAAA,UACtB,yBAAyB;AAAA,UACzB,aAAa;AAAA,YACX;AAAA,YACA,CAAC,OAAO,aAAa;AAAA,YACrB;AAAA,UACF;AAAA,QACF;AAAA,QACA,OAAO;AAAA,UACL,cAAc;AAAA,YACZ;AAAA,YACA,CAAC,WAAW,CAAC,iBAAiB,OAAO,GAAG,KAAK;AAAA,YAC7C,CAAC,OAAO,oBAAoB;AAAA,YAC5B,CAAC,OAAO,aAAa;AAAA,UACvB;AAAA,UACA,gBAAgB,CAAC,OAAO,eAAe;AAAA,QACzC;AAAA;AAAA,IACF;AAAA,EACF;AAEJ;AAEA,yBAAyB,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/ConnectionLayer/ConnectionLayerTooltip.tsx"],
4
- "sourcesContent": ["import React, { useRef } from 'react';\n\nimport {\n _ChartTooltip as ChartTooltip,\n _useChartActionsMenu as useChartActionsMenu,\n} from '@dynatrace/strato-components-preview/charts';\n\nimport {\n useMapTooltipPinnedState,\n useMapTooltipState,\n} from '../../store/selectors.js';\nimport type { Connection } from '../../types/connection-layer.js';\nimport { Location } from '../../types/location.js';\nimport {\n ConnectionLayerTooltipData,\n ConnectionLayerTooltipHandler,\n} from '../../types/tooltip.js';\n\ntype ConnectionTooltipStatePayload = {\n path: Location[];\n __lineColor: string;\n __lineWidth: number;\n};\n\nexport interface ConnectionLayerTooltipProps {\n layerId: string;\n tooltipTemplate?: ConnectionLayerTooltipHandler;\n}\n\nexport const ConnectionLayerTooltip = (props: ConnectionLayerTooltipProps) => {\n const { layerId, tooltipTemplate } = props;\n const {\n selectedItem: selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n onLeave,\n } = useChartActionsMenu();\n const { hoveredLayerId, data, position, visible, enabled } =\n useMapTooltipState<ConnectionTooltipStatePayload>();\n const pinned = useMapTooltipPinnedState();\n\n const connectionData = useRef<ConnectionLayerTooltipData<Connection>>();\n\n const forceHideTooltip =\n !pinned && (hoveredLayerId !== layerId || !visible || !enabled);\n\n if (!tooltipTemplate || forceHideTooltip || !position) {\n return null;\n }\n\n if (!pinned && data?.[0]) {\n const { __lineColor: color, __lineWidth: thickness, ...rest } = data[0];\n\n connectionData.current = { color, thickness, data: rest };\n }\n\n return (\n <ChartTooltip\n position={position}\n pinned={pinned}\n onMouseLeave={onLeave}\n actionSelectionValue={{\n selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n }}\n >\n {connectionData.current ? tooltipTemplate(connectionData.current) : null}\n </ChartTooltip>\n );\n};\n\nConnectionLayerTooltip['displayName'] = 'ConnectionLayerTooltip';\n"],
4
+ "sourcesContent": ["import React, { useRef } from 'react';\n\nimport {\n _ChartTooltip as ChartTooltip,\n _useChartActionsMenu as useChartActionsMenu,\n} from '@dynatrace/strato-components-preview/charts';\n\nimport {\n useMapTooltipPinnedState,\n useMapTooltipState,\n} from '../../store/selectors.js';\nimport type { Connection } from '../../types/connection-layer.js';\nimport type { Location } from '../../types/location.js';\nimport type {\n ConnectionLayerTooltipData,\n ConnectionLayerTooltipHandler,\n} from '../../types/tooltip.js';\n\ntype ConnectionTooltipStatePayload = {\n path: Location[];\n __lineColor: string;\n __lineWidth: number;\n};\n\nexport interface ConnectionLayerTooltipProps {\n layerId: string;\n tooltipTemplate?: ConnectionLayerTooltipHandler;\n}\n\nexport const ConnectionLayerTooltip = (props: ConnectionLayerTooltipProps) => {\n const { layerId, tooltipTemplate } = props;\n const {\n selectedItem: selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n onLeave,\n } = useChartActionsMenu();\n const { hoveredLayerId, data, position, visible, enabled } =\n useMapTooltipState<ConnectionTooltipStatePayload>();\n const pinned = useMapTooltipPinnedState();\n\n const connectionData = useRef<ConnectionLayerTooltipData<Connection>>();\n\n const forceHideTooltip =\n !pinned && (hoveredLayerId !== layerId || !visible || !enabled);\n\n if (!tooltipTemplate || forceHideTooltip || !position) {\n return null;\n }\n\n if (!pinned && data?.[0]) {\n const { __lineColor: color, __lineWidth: thickness, ...rest } = data[0];\n\n connectionData.current = { color, thickness, data: rest };\n }\n\n return (\n <ChartTooltip\n position={position}\n pinned={pinned}\n onMouseLeave={onLeave}\n actionSelectionValue={{\n selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n }}\n >\n {connectionData.current ? tooltipTemplate(connectionData.current) : null}\n </ChartTooltip>\n );\n};\n\nConnectionLayerTooltip['displayName'] = 'ConnectionLayerTooltip';\n"],
5
5
  "mappings": "AAAA,OAAO,SAAS,cAAc;AAE9B;AAAA,EACE,iBAAiB;AAAA,EACjB,wBAAwB;AAAA,OACnB;AAEP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAmBA,MAAM,yBAAyB,CAAC,UAAuC;AAC5E,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,QAAM;AAAA,IACJ,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,oBAAoB;AACxB,QAAM,EAAE,gBAAgB,MAAM,UAAU,SAAS,QAAQ,IACvD,mBAAkD;AACpD,QAAM,SAAS,yBAAyB;AAExC,QAAM,iBAAiB,OAA+C;AAEtE,QAAM,mBACJ,CAAC,WAAW,mBAAmB,WAAW,CAAC,WAAW,CAAC;AAEzD,MAAI,CAAC,mBAAmB,oBAAoB,CAAC,UAAU;AACrD,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,UAAU,OAAO,CAAC,GAAG;AACxB,UAAM,EAAE,aAAa,OAAO,aAAa,WAAW,GAAG,KAAK,IAAI,KAAK,CAAC;AAEtE,mBAAe,UAAU,EAAE,OAAO,WAAW,MAAM,KAAK;AAAA,EAC1D;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,sBAAsB;AAAA,QACpB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA;AAAA,IAEC,eAAe,UAAU,gBAAgB,eAAe,OAAO,IAAI;AAAA,EACtE;AAEJ;AAEA,uBAAuB,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/ConnectionLayer/functions/get-arc-line-features.ts"],
4
- "sourcesContent": ["import turfBearing from '@turf/bearing';\nimport turfDestination from '@turf/destination';\nimport turfDistance from '@turf/distance';\nimport { lineString as turfLineString } from '@turf/helpers';\nimport turfLineDistance from '@turf/length';\nimport turfLineArc from '@turf/line-arc';\nimport turfMidpoint from '@turf/midpoint';\nimport {\n toMercator as turfToMercator,\n toWgs84 as turfToWgs84,\n} from '@turf/projection';\nimport type GeoJSON from 'geojson';\n\nimport { FeatureProperties } from '../../../types/connection-layer.js';\nimport { Location } from '../../../types/location.js';\n\nconst getArcFeatureItem = (\n coordinates: GeoJSON.Position[],\n): GeoJSON.Feature<GeoJSON.LineString> => {\n const feature = turfLineString(coordinates);\n\n const parsedLineString = turfToWgs84(feature);\n\n const {\n geometry: {\n coordinates: [start, end],\n },\n } = parsedLineString;\n\n const lineDistance = turfLineDistance(parsedLineString);\n const midPoint = turfMidpoint(start, end);\n const bearing = turfBearing(start, end) - 90;\n const center = turfDestination(midPoint, lineDistance, bearing);\n\n const lineArc = turfLineArc(\n center,\n turfDistance(center, start),\n turfBearing(center, end),\n turfBearing(center, start),\n { steps: 256 },\n );\n\n return turfToMercator(lineArc);\n};\n\nexport const getArcLineFeatures = (\n path: Location[],\n featureProperties: FeatureProperties,\n): GeoJSON.Feature<GeoJSON.LineString>[] => {\n if (path.length < 2) {\n return [];\n }\n\n const finalCoordinates: GeoJSON.Position[] = [];\n\n for (let i = 0; i < path.length - 1; i++) {\n const start = path[i];\n const end = path[i + 1];\n\n const coordinates: GeoJSON.Position[] = [\n [start.longitude, start.latitude],\n [end.longitude, end.latitude],\n ];\n\n const feature = getArcFeatureItem(coordinates);\n\n finalCoordinates.push(...feature.geometry.coordinates.reverse());\n }\n\n const finalFeature = turfLineString(finalCoordinates, {\n ...featureProperties,\n });\n\n return [finalFeature];\n};\n"],
4
+ "sourcesContent": ["import turfBearing from '@turf/bearing';\nimport turfDestination from '@turf/destination';\nimport turfDistance from '@turf/distance';\nimport { lineString as turfLineString } from '@turf/helpers';\nimport turfLineDistance from '@turf/length';\nimport turfLineArc from '@turf/line-arc';\nimport turfMidpoint from '@turf/midpoint';\nimport {\n toMercator as turfToMercator,\n toWgs84 as turfToWgs84,\n} from '@turf/projection';\nimport type GeoJSON from 'geojson';\n\nimport type { FeatureProperties } from '../../../types/connection-layer.js';\nimport type { Location } from '../../../types/location.js';\n\nconst getArcFeatureItem = (\n coordinates: GeoJSON.Position[],\n): GeoJSON.Feature<GeoJSON.LineString> => {\n const feature = turfLineString(coordinates);\n\n const parsedLineString = turfToWgs84(feature);\n\n const {\n geometry: {\n coordinates: [start, end],\n },\n } = parsedLineString;\n\n const lineDistance = turfLineDistance(parsedLineString);\n const midPoint = turfMidpoint(start, end);\n const bearing = turfBearing(start, end) - 90;\n const center = turfDestination(midPoint, lineDistance, bearing);\n\n const lineArc = turfLineArc(\n center,\n turfDistance(center, start),\n turfBearing(center, end),\n turfBearing(center, start),\n { steps: 256 },\n );\n\n return turfToMercator(lineArc);\n};\n\nexport const getArcLineFeatures = (\n path: Location[],\n featureProperties: FeatureProperties,\n): GeoJSON.Feature<GeoJSON.LineString>[] => {\n if (path.length < 2) {\n return [];\n }\n\n const finalCoordinates: GeoJSON.Position[] = [];\n\n for (let i = 0; i < path.length - 1; i++) {\n const start = path[i];\n const end = path[i + 1];\n\n const coordinates: GeoJSON.Position[] = [\n [start.longitude, start.latitude],\n [end.longitude, end.latitude],\n ];\n\n const feature = getArcFeatureItem(coordinates);\n\n finalCoordinates.push(...feature.geometry.coordinates.reverse());\n }\n\n const finalFeature = turfLineString(finalCoordinates, {\n ...featureProperties,\n });\n\n return [finalFeature];\n};\n"],
5
5
  "mappings": "AAAA,OAAO,iBAAiB;AACxB,OAAO,qBAAqB;AAC5B,OAAO,kBAAkB;AACzB,SAAS,cAAc,sBAAsB;AAC7C,OAAO,sBAAsB;AAC7B,OAAO,iBAAiB;AACxB,OAAO,kBAAkB;AACzB;AAAA,EACE,cAAc;AAAA,EACd,WAAW;AAAA,OACN;AAMP,MAAM,oBAAoB,CACxB,gBACwC;AACxC,QAAM,UAAU,eAAe,WAAW;AAE1C,QAAM,mBAAmB,YAAY,OAAO;AAE5C,QAAM;AAAA,IACJ,UAAU;AAAA,MACR,aAAa,CAAC,OAAO,GAAG;AAAA,IAC1B;AAAA,EACF,IAAI;AAEJ,QAAM,eAAe,iBAAiB,gBAAgB;AACtD,QAAM,WAAW,aAAa,OAAO,GAAG;AACxC,QAAM,UAAU,YAAY,OAAO,GAAG,IAAI;AAC1C,QAAM,SAAS,gBAAgB,UAAU,cAAc,OAAO;AAE9D,QAAM,UAAU;AAAA,IACd;AAAA,IACA,aAAa,QAAQ,KAAK;AAAA,IAC1B,YAAY,QAAQ,GAAG;AAAA,IACvB,YAAY,QAAQ,KAAK;AAAA,IACzB,EAAE,OAAO,IAAI;AAAA,EACf;AAEA,SAAO,eAAe,OAAO;AAC/B;AAEO,MAAM,qBAAqB,CAChC,MACA,sBAC0C;AAC1C,MAAI,KAAK,SAAS,GAAG;AACnB,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,mBAAuC,CAAC;AAE9C,WAAS,IAAI,GAAG,IAAI,KAAK,SAAS,GAAG,KAAK;AACxC,UAAM,QAAQ,KAAK,CAAC;AACpB,UAAM,MAAM,KAAK,IAAI,CAAC;AAEtB,UAAM,cAAkC;AAAA,MACtC,CAAC,MAAM,WAAW,MAAM,QAAQ;AAAA,MAChC,CAAC,IAAI,WAAW,IAAI,QAAQ;AAAA,IAC9B;AAEA,UAAM,UAAU,kBAAkB,WAAW;AAE7C,qBAAiB,KAAK,GAAG,QAAQ,SAAS,YAAY,QAAQ,CAAC;AAAA,EACjE;AAEA,QAAM,eAAe,eAAe,kBAAkB;AAAA,IACpD,GAAG;AAAA,EACL,CAAC;AAED,SAAO,CAAC,YAAY;AACtB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/ConnectionLayer/functions/get-straight-line-features.ts"],
4
- "sourcesContent": ["import { lineString as turfLineString } from '@turf/helpers';\nimport type GeoJSON from 'geojson';\n\nimport { FeatureProperties } from '../../../types/connection-layer.js';\nimport { Location } from '../../../types/location.js';\n\nexport const getStraightLineFeatures = (\n path: Location[],\n featureProperties: FeatureProperties,\n): GeoJSON.Feature[] => {\n const coordinates = path.map((coord) => [coord.longitude, coord.latitude]);\n const feature = turfLineString(coordinates, {\n ...featureProperties,\n });\n\n return [feature];\n};\n"],
4
+ "sourcesContent": ["import { lineString as turfLineString } from '@turf/helpers';\nimport type GeoJSON from 'geojson';\n\nimport type { FeatureProperties } from '../../../types/connection-layer.js';\nimport type { Location } from '../../../types/location.js';\n\nexport const getStraightLineFeatures = (\n path: Location[],\n featureProperties: FeatureProperties,\n): GeoJSON.Feature[] => {\n const coordinates = path.map((coord) => [coord.longitude, coord.latitude]);\n const feature = turfLineString(coordinates, {\n ...featureProperties,\n });\n\n return [feature];\n};\n"],
5
5
  "mappings": "AAAA,SAAS,cAAc,sBAAsB;AAMtC,MAAM,0BAA0B,CACrC,MACA,sBACsB;AACtB,QAAM,cAAc,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,WAAW,MAAM,QAAQ,CAAC;AACzE,QAAM,UAAU,eAAe,aAAa;AAAA,IAC1C,GAAG;AAAA,EACL,CAAC;AAED,SAAO,CAAC,OAAO;AACjB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/ConnectionLayer/functions/parse-connection-data-to-geo-json.ts"],
4
- "sourcesContent": ["import { featureCollection as turfFeatureCollection } from '@turf/helpers';\nimport type GeoJSON from 'geojson';\n\nimport { _getCanvasColor as getCanvasColor } from '@dynatrace/strato-components-preview/charts';\n\nimport { getArcLineFeatures } from './get-arc-line-features.js';\nimport { getStraightLineFeatures } from './get-straight-line-features.js';\nimport { MAX_LINE_THICKNESS, MIN_LINE_THICKNESS } from '../../../constants.js';\nimport { calculateHoveredColor } from '../../../functions/calculate-hovered-color.js';\nimport { defineColor } from '../../../functions/define-color.js';\nimport {\n Connection,\n type CurvedLine,\n FeatureProperties,\n} from '../../../types/connection-layer.js';\nimport type { Location } from '../../../types/location.js';\n\nconst getLineThickness = (thickness: number): number => {\n if (thickness < MIN_LINE_THICKNESS) {\n return MIN_LINE_THICKNESS;\n }\n\n if (thickness > MAX_LINE_THICKNESS) {\n return MAX_LINE_THICKNESS;\n }\n\n return thickness;\n};\n\nconst getFeatureProperties =\n (thickness: number, curve?: CurvedLine) =>\n <T extends Connection>(\n properties: T,\n id: string,\n ): Omit<FeatureProperties, '__lineColor' | '__lineHoveredColor'> => {\n const lineThickness = getLineThickness(thickness);\n\n return {\n ...properties,\n id,\n __lineWidth: lineThickness,\n curve,\n };\n };\n\nconst getFeatures = (\n path: Location[],\n featureProperties: FeatureProperties,\n): GeoJSON.Feature[] => {\n const isCurve = featureProperties.curve === 'smooth';\n\n if (isCurve) {\n return getArcLineFeatures(path, featureProperties);\n }\n\n return getStraightLineFeatures(path, featureProperties);\n};\n\nconst getConnectionColor = <T extends Connection>(\n connection: T,\n color: string | ((connection: T) => string),\n): Pick<FeatureProperties, '__lineColor' | '__lineHoveredColor'> => {\n const parsedColor = defineColor(color, connection);\n\n const canvasColor = getCanvasColor(parsedColor);\n const hoveredColor = calculateHoveredColor(canvasColor);\n\n return {\n __lineColor: canvasColor,\n __lineHoveredColor: hoveredColor,\n };\n};\n\nexport const parseConnectionDataToGeoJSON = <T extends Connection>(\n data: T[],\n thickness: number,\n color: string | ((connection: T) => string),\n curve?: CurvedLine,\n): GeoJSON.FeatureCollection[] => {\n const featuresCollections: GeoJSON.FeatureCollection[] = [];\n\n const getProperties = getFeatureProperties(thickness, curve);\n\n data.forEach((connection, index) => {\n const { path, ...properties } = connection;\n\n const featureProperties = {\n ...getProperties({ path, ...properties }, `connection-${index}`),\n ...getConnectionColor(connection, color),\n };\n\n const features = getFeatures(path, featureProperties);\n\n const featuresCollection: GeoJSON.FeatureCollection =\n turfFeatureCollection(features);\n\n featuresCollections.push(featuresCollection);\n });\n\n return featuresCollections;\n};\n"],
4
+ "sourcesContent": ["import { featureCollection as turfFeatureCollection } from '@turf/helpers';\nimport type GeoJSON from 'geojson';\n\nimport { _getCanvasColor as getCanvasColor } from '@dynatrace/strato-components-preview/charts';\n\nimport { getArcLineFeatures } from './get-arc-line-features.js';\nimport { getStraightLineFeatures } from './get-straight-line-features.js';\nimport { MAX_LINE_THICKNESS, MIN_LINE_THICKNESS } from '../../../constants.js';\nimport { calculateHoveredColor } from '../../../functions/calculate-hovered-color.js';\nimport { defineColor } from '../../../functions/define-color.js';\nimport type {\n Connection,\n CurvedLine,\n FeatureProperties,\n} from '../../../types/connection-layer.js';\nimport type { Location } from '../../../types/location.js';\n\nconst getLineThickness = (thickness: number): number => {\n if (thickness < MIN_LINE_THICKNESS) {\n return MIN_LINE_THICKNESS;\n }\n\n if (thickness > MAX_LINE_THICKNESS) {\n return MAX_LINE_THICKNESS;\n }\n\n return thickness;\n};\n\nconst getFeatureProperties =\n (thickness: number, curve?: CurvedLine) =>\n <T extends Connection>(\n properties: T,\n id: string,\n ): Omit<FeatureProperties, '__lineColor' | '__lineHoveredColor'> => {\n const lineThickness = getLineThickness(thickness);\n\n return {\n ...properties,\n id,\n __lineWidth: lineThickness,\n curve,\n };\n };\n\nconst getFeatures = (\n path: Location[],\n featureProperties: FeatureProperties,\n): GeoJSON.Feature[] => {\n const isCurve = featureProperties.curve === 'smooth';\n\n if (isCurve) {\n return getArcLineFeatures(path, featureProperties);\n }\n\n return getStraightLineFeatures(path, featureProperties);\n};\n\nconst getConnectionColor = <T extends Connection>(\n connection: T,\n color: string | ((connection: T) => string),\n): Pick<FeatureProperties, '__lineColor' | '__lineHoveredColor'> => {\n const parsedColor = defineColor(color, connection);\n\n const canvasColor = getCanvasColor(parsedColor);\n const hoveredColor = calculateHoveredColor(canvasColor);\n\n return {\n __lineColor: canvasColor,\n __lineHoveredColor: hoveredColor,\n };\n};\n\nexport const parseConnectionDataToGeoJSON = <T extends Connection>(\n data: T[],\n thickness: number,\n color: string | ((connection: T) => string),\n curve?: CurvedLine,\n): GeoJSON.FeatureCollection[] => {\n const featuresCollections: GeoJSON.FeatureCollection[] = [];\n\n const getProperties = getFeatureProperties(thickness, curve);\n\n data.forEach((connection, index) => {\n const { path, ...properties } = connection;\n\n const featureProperties = {\n ...getProperties({ path, ...properties }, `connection-${index}`),\n ...getConnectionColor(connection, color),\n };\n\n const features = getFeatures(path, featureProperties);\n\n const featuresCollection: GeoJSON.FeatureCollection =\n turfFeatureCollection(features);\n\n featuresCollections.push(featuresCollection);\n });\n\n return featuresCollections;\n};\n"],
5
5
  "mappings": "AAAA,SAAS,qBAAqB,6BAA6B;AAG3D,SAAS,mBAAmB,sBAAsB;AAElD,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,oBAAoB,0BAA0B;AACvD,SAAS,6BAA6B;AACtC,SAAS,mBAAmB;AAQ5B,MAAM,mBAAmB,CAAC,cAA8B;AACtD,MAAI,YAAY,oBAAoB;AAClC,WAAO;AAAA,EACT;AAEA,MAAI,YAAY,oBAAoB;AAClC,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAEA,MAAM,uBACJ,CAAC,WAAmB,UACpB,CACE,YACA,OACkE;AAClE,QAAM,gBAAgB,iBAAiB,SAAS;AAEhD,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA,aAAa;AAAA,IACb;AAAA,EACF;AACF;AAEF,MAAM,cAAc,CAClB,MACA,sBACsB;AACtB,QAAM,UAAU,kBAAkB,UAAU;AAE5C,MAAI,SAAS;AACX,WAAO,mBAAmB,MAAM,iBAAiB;AAAA,EACnD;AAEA,SAAO,wBAAwB,MAAM,iBAAiB;AACxD;AAEA,MAAM,qBAAqB,CACzB,YACA,UACkE;AAClE,QAAM,cAAc,YAAY,OAAO,UAAU;AAEjD,QAAM,cAAc,eAAe,WAAW;AAC9C,QAAM,eAAe,sBAAsB,WAAW;AAEtD,SAAO;AAAA,IACL,aAAa;AAAA,IACb,oBAAoB;AAAA,EACtB;AACF;AAEO,MAAM,+BAA+B,CAC1C,MACA,WACA,OACA,UACgC;AAChC,QAAM,sBAAmD,CAAC;AAE1D,QAAM,gBAAgB,qBAAqB,WAAW,KAAK;AAE3D,OAAK,QAAQ,CAAC,YAAY,UAAU;AAClC,UAAM,EAAE,MAAM,GAAG,WAAW,IAAI;AAEhC,UAAM,oBAAoB;AAAA,MACxB,GAAG,cAAc,EAAE,MAAM,GAAG,WAAW,GAAG,cAAc,KAAK,EAAE;AAAA,MAC/D,GAAG,mBAAmB,YAAY,KAAK;AAAA,IACzC;AAEA,UAAM,WAAW,YAAY,MAAM,iBAAiB;AAEpD,UAAM,qBACJ,sBAAsB,QAAQ;AAEhC,wBAAoB,KAAK,kBAAkB;AAAA,EAC7C,CAAC;AAED,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/ConnectionLayer/functions/parse-direction-data-to-geo-json.ts"],
4
- "sourcesContent": ["import { point as turfPoint } from '@turf/helpers';\n\nimport { getArrowsAngles } from './get-arrows-angles.js';\nimport {\n GeoJSONFeature,\n InternalConnectionLayerProps,\n type Connection,\n} from '../../../types/connection-layer.js';\n\ninterface ParseGeoJsonDataProps<T extends Connection>\n extends Required<\n Pick<InternalConnectionLayerProps<T>, 'directionIndicator'>\n > {\n geoJsonData: GeoJSON.FeatureCollection;\n}\n\nconst getConnectionGeoJSONFeature = (\n feature: GeoJSONFeature<GeoJSON.LineString>,\n angle: number,\n coordinates: number[],\n): GeoJSONFeature<GeoJSON.Point> =>\n turfPoint(coordinates, { ...feature.properties, __angle: angle });\n\nexport const parseDirectionDataToGeoJSON = <T extends Connection>(\n props: ParseGeoJsonDataProps<T>,\n): GeoJSON.FeatureCollection => {\n const { geoJsonData, directionIndicator } = props;\n\n const features: GeoJSONFeature<GeoJSON.Point>[] = [];\n\n for (let i = 0; i < geoJsonData.features.length; i++) {\n const feature = geoJsonData.features[\n i\n ] as GeoJSONFeature<GeoJSON.LineString>;\n\n const { coordinates } = feature.geometry;\n\n const { endMarkerAngle, startMarkerAngle } = getArrowsAngles(coordinates);\n\n const showStartArrow = directionIndicator !== 'end';\n const showEndArrow = directionIndicator !== 'start';\n\n const startCoordinate = coordinates[0];\n const endCoordinate = coordinates[coordinates.length - 1];\n\n if (showStartArrow) {\n const startPoint = getConnectionGeoJSONFeature(\n feature,\n startMarkerAngle,\n startCoordinate,\n );\n\n features.push({\n ...startPoint,\n properties: {\n ...startPoint.properties,\n id: `${feature.properties.id}-direction-start`,\n },\n });\n }\n\n if (showEndArrow) {\n const endPoint = getConnectionGeoJSONFeature(\n feature,\n endMarkerAngle,\n endCoordinate,\n );\n\n features.push({\n ...endPoint,\n properties: {\n ...endPoint.properties,\n id: `${feature.properties.id}-direction-end`,\n },\n });\n }\n }\n\n return {\n ...geoJsonData,\n features,\n };\n};\n"],
4
+ "sourcesContent": ["import { point as turfPoint } from '@turf/helpers';\n\nimport { getArrowsAngles } from './get-arrows-angles.js';\nimport type {\n GeoJSONFeature,\n InternalConnectionLayerProps,\n Connection,\n} from '../../../types/connection-layer.js';\n\ninterface ParseGeoJsonDataProps<T extends Connection>\n extends Required<\n Pick<InternalConnectionLayerProps<T>, 'directionIndicator'>\n > {\n geoJsonData: GeoJSON.FeatureCollection;\n}\n\nconst getConnectionGeoJSONFeature = (\n feature: GeoJSONFeature<GeoJSON.LineString>,\n angle: number,\n coordinates: number[],\n): GeoJSONFeature<GeoJSON.Point> =>\n turfPoint(coordinates, { ...feature.properties, __angle: angle });\n\nexport const parseDirectionDataToGeoJSON = <T extends Connection>(\n props: ParseGeoJsonDataProps<T>,\n): GeoJSON.FeatureCollection => {\n const { geoJsonData, directionIndicator } = props;\n\n const features: GeoJSONFeature<GeoJSON.Point>[] = [];\n\n for (let i = 0; i < geoJsonData.features.length; i++) {\n const feature = geoJsonData.features[\n i\n ] as GeoJSONFeature<GeoJSON.LineString>;\n\n const { coordinates } = feature.geometry;\n\n const { endMarkerAngle, startMarkerAngle } = getArrowsAngles(coordinates);\n\n const showStartArrow = directionIndicator !== 'end';\n const showEndArrow = directionIndicator !== 'start';\n\n const startCoordinate = coordinates[0];\n const endCoordinate = coordinates[coordinates.length - 1];\n\n if (showStartArrow) {\n const startPoint = getConnectionGeoJSONFeature(\n feature,\n startMarkerAngle,\n startCoordinate,\n );\n\n features.push({\n ...startPoint,\n properties: {\n ...startPoint.properties,\n id: `${feature.properties.id}-direction-start`,\n },\n });\n }\n\n if (showEndArrow) {\n const endPoint = getConnectionGeoJSONFeature(\n feature,\n endMarkerAngle,\n endCoordinate,\n );\n\n features.push({\n ...endPoint,\n properties: {\n ...endPoint.properties,\n id: `${feature.properties.id}-direction-end`,\n },\n });\n }\n }\n\n return {\n ...geoJsonData,\n features,\n };\n};\n"],
5
5
  "mappings": "AAAA,SAAS,SAAS,iBAAiB;AAEnC,SAAS,uBAAuB;AAchC,MAAM,8BAA8B,CAClC,SACA,OACA,gBAEA,UAAU,aAAa,EAAE,GAAG,QAAQ,YAAY,SAAS,MAAM,CAAC;AAE3D,MAAM,8BAA8B,CACzC,UAC8B;AAC9B,QAAM,EAAE,aAAa,mBAAmB,IAAI;AAE5C,QAAM,WAA4C,CAAC;AAEnD,WAAS,IAAI,GAAG,IAAI,YAAY,SAAS,QAAQ,KAAK;AACpD,UAAM,UAAU,YAAY,SAC1B,CACF;AAEA,UAAM,EAAE,YAAY,IAAI,QAAQ;AAEhC,UAAM,EAAE,gBAAgB,iBAAiB,IAAI,gBAAgB,WAAW;AAExE,UAAM,iBAAiB,uBAAuB;AAC9C,UAAM,eAAe,uBAAuB;AAE5C,UAAM,kBAAkB,YAAY,CAAC;AACrC,UAAM,gBAAgB,YAAY,YAAY,SAAS,CAAC;AAExD,QAAI,gBAAgB;AAClB,YAAM,aAAa;AAAA,QACjB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,eAAS,KAAK;AAAA,QACZ,GAAG;AAAA,QACH,YAAY;AAAA,UACV,GAAG,WAAW;AAAA,UACd,IAAI,GAAG,QAAQ,WAAW,EAAE;AAAA,QAC9B;AAAA,MACF,CAAC;AAAA,IACH;AAEA,QAAI,cAAc;AAChB,YAAM,WAAW;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,eAAS,KAAK;AAAA,QACZ,GAAG;AAAA,QACH,YAAY;AAAA,UACV,GAAG,SAAS;AAAA,UACZ,IAAI,GAAG,QAAQ,WAAW,EAAE;AAAA,QAC9B;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/DefaultTooltip/DefaultTooltip.tsx"],
4
- "sourcesContent": ["import React from 'react';\n\nimport { _ChartTooltip as ChartTooltip } from '@dynatrace/strato-components-preview/charts';\n\nimport { getDefaultActions } from './utils/get-default-actions.js';\nimport { handleCopyToClipboard } from './utils/handle-copy-to-clipboard.js';\nimport { isConnection, isRegion } from '../../functions/tooltip-type-guards.js';\nimport { Location } from '../../types/location.js';\nimport {\n BubbleLayerTooltipData,\n DotLayerTooltipData,\n LayerTooltipData,\n} from '../../types/tooltip.js';\n\ninterface DefaultTooltipProps {\n closestPoint: LayerTooltipData;\n layerData?: LayerTooltipData[];\n}\n\nexport const DefaultTooltip = (props: DefaultTooltipProps) => {\n const { closestPoint, layerData } = props;\n let locations: Location[];\n\n if (isRegion(closestPoint)) {\n return (\n <ChartTooltip.Body data-testid=\"default-tooltip-template\">\n <ChartTooltip.SeriesItem\n color={closestPoint.color}\n name={closestPoint.name}\n value={\n closestPoint.data.value && closestPoint.data.value.toString()\n ? closestPoint.data.value.toString()\n : undefined\n }\n />\n </ChartTooltip.Body>\n );\n }\n if (isConnection(closestPoint)) {\n locations = closestPoint.data.path;\n } else {\n locations =\n layerData === undefined || layerData === null || layerData.length === 0\n ? [closestPoint.data]\n : layerData.map(\n (point: DotLayerTooltipData | BubbleLayerTooltipData) => point.data,\n );\n }\n\n return (\n <ChartTooltip.Body\n data-testid=\"default-tooltip-template\"\n virtualization={false}\n >\n {locations.map((location) => (\n <ChartTooltip.GeoItem\n key={`${location.latitude}-${location.longitude}`}\n latitude={location.latitude}\n longitude={location.longitude}\n actions={() =>\n getDefaultActions(() => handleCopyToClipboard(location))\n }\n ></ChartTooltip.GeoItem>\n ))}\n </ChartTooltip.Body>\n );\n};\n\nDefaultTooltip['displayName'] = 'DefaultTooltip';\n"],
4
+ "sourcesContent": ["import React from 'react';\n\nimport { _ChartTooltip as ChartTooltip } from '@dynatrace/strato-components-preview/charts';\n\nimport { getDefaultActions } from './utils/get-default-actions.js';\nimport { handleCopyToClipboard } from './utils/handle-copy-to-clipboard.js';\nimport { isConnection, isRegion } from '../../functions/tooltip-type-guards.js';\nimport type { Location } from '../../types/location.js';\nimport type {\n BubbleLayerTooltipData,\n DotLayerTooltipData,\n LayerTooltipData,\n} from '../../types/tooltip.js';\n\ninterface DefaultTooltipProps {\n closestPoint: LayerTooltipData;\n layerData?: LayerTooltipData[];\n}\n\nexport const DefaultTooltip = (props: DefaultTooltipProps) => {\n const { closestPoint, layerData } = props;\n let locations: Location[];\n\n if (isRegion(closestPoint)) {\n return (\n <ChartTooltip.Body data-testid=\"default-tooltip-template\">\n <ChartTooltip.SeriesItem\n color={closestPoint.color}\n name={closestPoint.name}\n value={\n closestPoint.data.value && closestPoint.data.value.toString()\n ? closestPoint.data.value.toString()\n : undefined\n }\n />\n </ChartTooltip.Body>\n );\n }\n if (isConnection(closestPoint)) {\n locations = closestPoint.data.path;\n } else {\n locations =\n layerData === undefined || layerData === null || layerData.length === 0\n ? [closestPoint.data]\n : layerData.map(\n (point: DotLayerTooltipData | BubbleLayerTooltipData) => point.data,\n );\n }\n\n return (\n <ChartTooltip.Body\n data-testid=\"default-tooltip-template\"\n virtualization={false}\n >\n {locations.map((location) => (\n <ChartTooltip.GeoItem\n key={`${location.latitude}-${location.longitude}`}\n latitude={location.latitude}\n longitude={location.longitude}\n actions={() =>\n getDefaultActions(() => handleCopyToClipboard(location))\n }\n ></ChartTooltip.GeoItem>\n ))}\n </ChartTooltip.Body>\n );\n};\n\nDefaultTooltip['displayName'] = 'DefaultTooltip';\n"],
5
5
  "mappings": "AAAA,OAAO,WAAW;AAElB,SAAS,iBAAiB,oBAAoB;AAE9C,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AACtC,SAAS,cAAc,gBAAgB;AAahC,MAAM,iBAAiB,CAAC,UAA+B;AAC5D,QAAM,EAAE,cAAc,UAAU,IAAI;AACpC,MAAI;AAEJ,MAAI,SAAS,YAAY,GAAG;AAC1B,WACE,oCAAC,aAAa,MAAb,EAAkB,eAAY,8BAC7B;AAAA,MAAC,aAAa;AAAA,MAAb;AAAA,QACC,OAAO,aAAa;AAAA,QACpB,MAAM,aAAa;AAAA,QACnB,OACE,aAAa,KAAK,SAAS,aAAa,KAAK,MAAM,SAAS,IACxD,aAAa,KAAK,MAAM,SAAS,IACjC;AAAA;AAAA,IAER,CACF;AAAA,EAEJ;AACA,MAAI,aAAa,YAAY,GAAG;AAC9B,gBAAY,aAAa,KAAK;AAAA,EAChC,OAAO;AACL,gBACE,cAAc,UAAa,cAAc,QAAQ,UAAU,WAAW,IAClE,CAAC,aAAa,IAAI,IAClB,UAAU;AAAA,MACR,CAAC,UAAwD,MAAM;AAAA,IACjE;AAAA,EACR;AAEA,SACE;AAAA,IAAC,aAAa;AAAA,IAAb;AAAA,MACC,eAAY;AAAA,MACZ,gBAAgB;AAAA;AAAA,IAEf,UAAU,IAAI,CAAC,aACd;AAAA,MAAC,aAAa;AAAA,MAAb;AAAA,QACC,KAAK,GAAG,SAAS,QAAQ,IAAI,SAAS,SAAS;AAAA,QAC/C,UAAU,SAAS;AAAA,QACnB,WAAW,SAAS;AAAA,QACpB,SAAS,MACP,kBAAkB,MAAM,sBAAsB,QAAQ,CAAC;AAAA;AAAA,IAE1D,CACF;AAAA,EACH;AAEJ;AAEA,eAAe,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.ts"],
4
- "sourcesContent": ["import { Location } from '../../../types/location.js';\n\nexport const handleCopyToClipboard = (location: Location) =>\n navigator.clipboard.writeText(`${location.latitude}, ${location.longitude}`);\n"],
4
+ "sourcesContent": ["import type { Location } from '../../../types/location.js';\n\nexport const handleCopyToClipboard = (location: Location) =>\n navigator.clipboard.writeText(`${location.latitude}, ${location.longitude}`);\n"],
5
5
  "mappings": "AAEO,MAAM,wBAAwB,CAAC,aACpC,UAAU,UAAU,UAAU,GAAG,SAAS,QAAQ,KAAK,SAAS,SAAS,EAAE;",
6
6
  "names": []
7
7
  }
@@ -25,7 +25,7 @@ const DotLayer = (props) => {
25
25
  layerId,
26
26
  bearing = 0,
27
27
  children,
28
- shape = "circle",
28
+ shape = "pin",
29
29
  background = false,
30
30
  shapeSize = DEFAULT_SYMBOL_SIZE
31
31
  } = props;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/DotLayer/DotLayer.tsx"],
4
- "sourcesContent": ["import React, { PropsWithChildren } from 'react';\nimport { Layer, Source } from 'react-map-gl/maplibre';\n\nimport { BackgroundLayer } from './BackgroundLayer.js';\nimport { DotLayerTooltip } from './DotLayerTooltip.js';\nimport { parseDotDataToGeoJSON } from './functions/parse-dot-data-to-geo-json.js';\nimport {\n DEFAULT_ICON_COLOR,\n DEFAULT_ICON_SIZE_RATIO,\n DEFAULT_SHAPE_COLOR,\n DEFAULT_SYMBOL_SIZE,\n LEGEND_DIM_OPACITY,\n SHAPE_OPACITY,\n} from '../../constants.js';\nimport { isDotTooltipTemplate } from '../../functions/tooltip-type-guards.js';\nimport { useLayerColoringStrategy } from '../../hooks/use-layer-coloring-strategy.js';\nimport { useLegendInteractionHighlighting } from '../../hooks/use-legend-interaction-highlighting.js';\nimport { useLegendInteractionVisibility } from '../../hooks/use-legend-interaction-visibility.js';\nimport { useLoadSymbolIntoMap } from '../../hooks/use-load-symbol-into-map.js';\nimport { useResolveColor } from '../../hooks/use-resolve-color.js';\nimport { useTooltipTemplate } from '../../hooks/use-tooltip-template.js';\nimport { DotLayerTooltip as DotLayerTooltipSlot } from '../../slots/DotLayerTooltip.js';\nimport { InternalDotLayerProps } from '../../types/dot-layer.js';\nimport { Location } from '../../types/location.js';\n\n/**\n * DotLayer Component\n */\nexport const DotLayer = <T extends Location>(\n props: PropsWithChildren<InternalDotLayerProps<T>>,\n) => {\n const {\n data,\n layerId,\n bearing = 0,\n children,\n shape = 'circle',\n background = false,\n shapeSize = DEFAULT_SYMBOL_SIZE,\n } = props;\n\n const { symbolName, symbolType } = useLoadSymbolIntoMap(\n shape,\n layerId,\n shapeSize,\n );\n\n const defaultSymbolColor =\n symbolType === 'shape' ? DEFAULT_SHAPE_COLOR : DEFAULT_ICON_COLOR;\n\n const colorParser = useLayerColoringStrategy();\n const shapeColor = useResolveColor(defaultSymbolColor, props, colorParser);\n\n const tooltipTemplate = useTooltipTemplate(children, DotLayerTooltipSlot);\n\n const sourceId = `source-${layerId}`;\n useLegendInteractionHighlighting(props, sourceId);\n useLegendInteractionVisibility(props, layerId);\n\n const dataGeoJson = parseDotDataToGeoJSON(data, shapeColor, bearing);\n\n const iconAnchor = shape === 'pin' ? 'bottom' : 'center';\n\n return (\n <>\n <Source id={sourceId} type=\"geojson\" data={dataGeoJson} generateId>\n <Layer\n type=\"symbol\"\n id={layerId}\n layout={{\n 'icon-image': symbolName,\n 'icon-size': DEFAULT_ICON_SIZE_RATIO,\n 'icon-rotate': ['get', '__bearing'],\n // https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-ignore-placement\n 'icon-ignore-placement': true,\n 'icon-anchor': iconAnchor,\n }}\n paint={{\n 'icon-color': ['get', '__color'],\n 'icon-opacity': [\n 'case',\n ['boolean', ['feature-state', 'legendHover'], true],\n SHAPE_OPACITY,\n LEGEND_DIM_OPACITY,\n ],\n }}\n />\n <BackgroundLayer\n background={background}\n beforeId={layerId}\n source={sourceId}\n radius={shapeSize / 2}\n iconAnchor={iconAnchor}\n />\n </Source>\n\n <DotLayerTooltip\n layerId={layerId}\n tooltipTemplate={\n isDotTooltipTemplate(tooltipTemplate) ? tooltipTemplate : undefined\n }\n />\n </>\n );\n};\n\nDotLayer['displayName'] = 'DotLayer';\n"],
5
- "mappings": "AAAA,OAAO,WAAkC;AACzC,SAAS,OAAO,cAAc;AAE9B,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,gCAAgC;AACzC,SAAS,wCAAwC;AACjD,SAAS,sCAAsC;AAC/C,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,mBAAmB,2BAA2B;AAOhD,MAAM,WAAW,CACtB,UACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,YAAY;AAAA,EACd,IAAI;AAEJ,QAAM,EAAE,YAAY,WAAW,IAAI;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,qBACJ,eAAe,UAAU,sBAAsB;AAEjD,QAAM,cAAc,yBAAyB;AAC7C,QAAM,aAAa,gBAAgB,oBAAoB,OAAO,WAAW;AAEzE,QAAM,kBAAkB,mBAAmB,UAAU,mBAAmB;AAExE,QAAM,WAAW,UAAU,OAAO;AAClC,mCAAiC,OAAO,QAAQ;AAChD,iCAA+B,OAAO,OAAO;AAE7C,QAAM,cAAc,sBAAsB,MAAM,YAAY,OAAO;AAEnE,QAAM,aAAa,UAAU,QAAQ,WAAW;AAEhD,SACE,0DACE,oCAAC,UAAO,IAAI,UAAU,MAAK,WAAU,MAAM,aAAa,YAAU,QAChE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,IAAI;AAAA,MACJ,QAAQ;AAAA,QACN,cAAc;AAAA,QACd,aAAa;AAAA,QACb,eAAe,CAAC,OAAO,WAAW;AAAA;AAAA,QAElC,yBAAyB;AAAA,QACzB,eAAe;AAAA,MACjB;AAAA,MACA,OAAO;AAAA,QACL,cAAc,CAAC,OAAO,SAAS;AAAA,QAC/B,gBAAgB;AAAA,UACd;AAAA,UACA,CAAC,WAAW,CAAC,iBAAiB,aAAa,GAAG,IAAI;AAAA,UAClD;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA;AAAA,EACF,GACA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,QAAQ,YAAY;AAAA,MACpB;AAAA;AAAA,EACF,CACF,GAEA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,iBACE,qBAAqB,eAAe,IAAI,kBAAkB;AAAA;AAAA,EAE9D,CACF;AAEJ;AAEA,SAAS,aAAa,IAAI;",
4
+ "sourcesContent": ["import React, { type PropsWithChildren } from 'react';\nimport { Layer, Source } from 'react-map-gl/maplibre';\n\nimport { BackgroundLayer } from './BackgroundLayer.js';\nimport { DotLayerTooltip } from './DotLayerTooltip.js';\nimport { parseDotDataToGeoJSON } from './functions/parse-dot-data-to-geo-json.js';\nimport {\n DEFAULT_ICON_COLOR,\n DEFAULT_ICON_SIZE_RATIO,\n DEFAULT_SHAPE_COLOR,\n DEFAULT_SYMBOL_SIZE,\n LEGEND_DIM_OPACITY,\n SHAPE_OPACITY,\n} from '../../constants.js';\nimport { isDotTooltipTemplate } from '../../functions/tooltip-type-guards.js';\nimport { useLayerColoringStrategy } from '../../hooks/use-layer-coloring-strategy.js';\nimport { useLegendInteractionHighlighting } from '../../hooks/use-legend-interaction-highlighting.js';\nimport { useLegendInteractionVisibility } from '../../hooks/use-legend-interaction-visibility.js';\nimport { useLoadSymbolIntoMap } from '../../hooks/use-load-symbol-into-map.js';\nimport { useResolveColor } from '../../hooks/use-resolve-color.js';\nimport { useTooltipTemplate } from '../../hooks/use-tooltip-template.js';\nimport { DotLayerTooltip as DotLayerTooltipSlot } from '../../slots/DotLayerTooltip.js';\nimport type { InternalDotLayerProps } from '../../types/dot-layer.js';\nimport type { Location } from '../../types/location.js';\n\n/**\n * DotLayer Component\n */\nexport const DotLayer = <T extends Location>(\n props: PropsWithChildren<InternalDotLayerProps<T>>,\n) => {\n const {\n data,\n layerId,\n bearing = 0,\n children,\n shape = 'pin',\n background = false,\n shapeSize = DEFAULT_SYMBOL_SIZE,\n } = props;\n\n const { symbolName, symbolType } = useLoadSymbolIntoMap(\n shape,\n layerId,\n shapeSize,\n );\n\n const defaultSymbolColor =\n symbolType === 'shape' ? DEFAULT_SHAPE_COLOR : DEFAULT_ICON_COLOR;\n\n const colorParser = useLayerColoringStrategy();\n const shapeColor = useResolveColor(defaultSymbolColor, props, colorParser);\n\n const tooltipTemplate = useTooltipTemplate(children, DotLayerTooltipSlot);\n\n const sourceId = `source-${layerId}`;\n useLegendInteractionHighlighting(props, sourceId);\n useLegendInteractionVisibility(props, layerId);\n\n const dataGeoJson = parseDotDataToGeoJSON(data, shapeColor, bearing);\n\n const iconAnchor = shape === 'pin' ? 'bottom' : 'center';\n\n return (\n <>\n <Source id={sourceId} type=\"geojson\" data={dataGeoJson} generateId>\n <Layer\n type=\"symbol\"\n id={layerId}\n layout={{\n 'icon-image': symbolName,\n 'icon-size': DEFAULT_ICON_SIZE_RATIO,\n 'icon-rotate': ['get', '__bearing'],\n // https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-ignore-placement\n 'icon-ignore-placement': true,\n 'icon-anchor': iconAnchor,\n }}\n paint={{\n 'icon-color': ['get', '__color'],\n 'icon-opacity': [\n 'case',\n ['boolean', ['feature-state', 'legendHover'], true],\n SHAPE_OPACITY,\n LEGEND_DIM_OPACITY,\n ],\n }}\n />\n <BackgroundLayer\n background={background}\n beforeId={layerId}\n source={sourceId}\n radius={shapeSize / 2}\n iconAnchor={iconAnchor}\n />\n </Source>\n\n <DotLayerTooltip\n layerId={layerId}\n tooltipTemplate={\n isDotTooltipTemplate(tooltipTemplate) ? tooltipTemplate : undefined\n }\n />\n </>\n );\n};\n\nDotLayer['displayName'] = 'DotLayer';\n"],
5
+ "mappings": "AAAA,OAAO,WAAuC;AAC9C,SAAS,OAAO,cAAc;AAE9B,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,gCAAgC;AACzC,SAAS,wCAAwC;AACjD,SAAS,sCAAsC;AAC/C,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,mBAAmB,2BAA2B;AAOhD,MAAM,WAAW,CACtB,UACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,YAAY;AAAA,EACd,IAAI;AAEJ,QAAM,EAAE,YAAY,WAAW,IAAI;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,qBACJ,eAAe,UAAU,sBAAsB;AAEjD,QAAM,cAAc,yBAAyB;AAC7C,QAAM,aAAa,gBAAgB,oBAAoB,OAAO,WAAW;AAEzE,QAAM,kBAAkB,mBAAmB,UAAU,mBAAmB;AAExE,QAAM,WAAW,UAAU,OAAO;AAClC,mCAAiC,OAAO,QAAQ;AAChD,iCAA+B,OAAO,OAAO;AAE7C,QAAM,cAAc,sBAAsB,MAAM,YAAY,OAAO;AAEnE,QAAM,aAAa,UAAU,QAAQ,WAAW;AAEhD,SACE,0DACE,oCAAC,UAAO,IAAI,UAAU,MAAK,WAAU,MAAM,aAAa,YAAU,QAChE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,IAAI;AAAA,MACJ,QAAQ;AAAA,QACN,cAAc;AAAA,QACd,aAAa;AAAA,QACb,eAAe,CAAC,OAAO,WAAW;AAAA;AAAA,QAElC,yBAAyB;AAAA,QACzB,eAAe;AAAA,MACjB;AAAA,MACA,OAAO;AAAA,QACL,cAAc,CAAC,OAAO,SAAS;AAAA,QAC/B,gBAAgB;AAAA,UACd;AAAA,UACA,CAAC,WAAW,CAAC,iBAAiB,aAAa,GAAG,IAAI;AAAA,UAClD;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA;AAAA,EACF,GACA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,QAAQ,YAAY;AAAA,MACpB;AAAA;AAAA,EACF,CACF,GAEA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,iBACE,qBAAqB,eAAe,IAAI,kBAAkB;AAAA;AAAA,EAE9D,CACF;AAEJ;AAEA,SAAS,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/map/components/DotLayer/DotLayerTooltip.tsx"],
4
- "sourcesContent": ["import React, { useRef } from 'react';\n\nimport {\n _ChartTooltip as ChartTooltip,\n _useChartActionsMenu as useChartActionsMenu,\n} from '@dynatrace/strato-components-preview/charts';\n\nimport {\n useMapTooltipPinnedState,\n useMapTooltipState,\n} from '../../store/selectors.js';\nimport { Location } from '../../types/location.js';\nimport {\n DotLayerTooltipData,\n DotLayerTooltipHandler,\n} from '../../types/tooltip.js';\n\ninterface DotTooltipStatePayload {\n __color: string;\n __hoveredColor: string;\n __bearing: number;\n data: Location;\n}\n\nexport interface DotLayerTooltipProps {\n layerId: string;\n tooltipTemplate?: DotLayerTooltipHandler;\n}\n\nexport const DotLayerTooltip = (props: DotLayerTooltipProps) => {\n const { tooltipTemplate, layerId } = props;\n const {\n selectedItem: selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n onLeave,\n } = useChartActionsMenu();\n\n const { hoveredLayerId, data, position, visible, enabled } =\n useMapTooltipState<DotTooltipStatePayload>();\n const pinned = useMapTooltipPinnedState();\n\n const dotData = useRef<DotLayerTooltipData>();\n\n const forceHideTooltip =\n !pinned && (hoveredLayerId !== layerId || !visible || !enabled);\n\n if (!tooltipTemplate || forceHideTooltip || !position) {\n return null;\n }\n\n if (!pinned && data?.[0]) {\n const { __color: color, __bearing: bearing, data: customData } = data[0];\n\n dotData.current = {\n color,\n bearing,\n data: customData,\n };\n }\n\n return (\n <ChartTooltip\n position={position}\n pinned={pinned}\n onMouseLeave={onLeave}\n actionSelectionValue={{\n selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n }}\n >\n {dotData.current ? tooltipTemplate(dotData.current) : null}\n </ChartTooltip>\n );\n};\n\nDotLayerTooltip['displayName'] = 'DotLayerTooltip';\n"],
4
+ "sourcesContent": ["import React, { useRef } from 'react';\n\nimport {\n _ChartTooltip as ChartTooltip,\n _useChartActionsMenu as useChartActionsMenu,\n} from '@dynatrace/strato-components-preview/charts';\n\nimport {\n useMapTooltipPinnedState,\n useMapTooltipState,\n} from '../../store/selectors.js';\nimport type { Location } from '../../types/location.js';\nimport type {\n DotLayerTooltipData,\n DotLayerTooltipHandler,\n} from '../../types/tooltip.js';\n\ninterface DotTooltipStatePayload {\n __color: string;\n __hoveredColor: string;\n __bearing: number;\n data: Location;\n}\n\nexport interface DotLayerTooltipProps {\n layerId: string;\n tooltipTemplate?: DotLayerTooltipHandler;\n}\n\nexport const DotLayerTooltip = (props: DotLayerTooltipProps) => {\n const { tooltipTemplate, layerId } = props;\n const {\n selectedItem: selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n onLeave,\n } = useChartActionsMenu();\n\n const { hoveredLayerId, data, position, visible, enabled } =\n useMapTooltipState<DotTooltipStatePayload>();\n const pinned = useMapTooltipPinnedState();\n\n const dotData = useRef<DotLayerTooltipData>();\n\n const forceHideTooltip =\n !pinned && (hoveredLayerId !== layerId || !visible || !enabled);\n\n if (!tooltipTemplate || forceHideTooltip || !position) {\n return null;\n }\n\n if (!pinned && data?.[0]) {\n const { __color: color, __bearing: bearing, data: customData } = data[0];\n\n dotData.current = {\n color,\n bearing,\n data: customData,\n };\n }\n\n return (\n <ChartTooltip\n position={position}\n pinned={pinned}\n onMouseLeave={onLeave}\n actionSelectionValue={{\n selectedItemId,\n actionsMenuRef,\n updateSelectedItem,\n }}\n >\n {dotData.current ? tooltipTemplate(dotData.current) : null}\n </ChartTooltip>\n );\n};\n\nDotLayerTooltip['displayName'] = 'DotLayerTooltip';\n"],
5
5
  "mappings": "AAAA,OAAO,SAAS,cAAc;AAE9B;AAAA,EACE,iBAAiB;AAAA,EACjB,wBAAwB;AAAA,OACnB;AAEP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAmBA,MAAM,kBAAkB,CAAC,UAAgC;AAC9D,QAAM,EAAE,iBAAiB,QAAQ,IAAI;AACrC,QAAM;AAAA,IACJ,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,oBAAoB;AAExB,QAAM,EAAE,gBAAgB,MAAM,UAAU,SAAS,QAAQ,IACvD,mBAA2C;AAC7C,QAAM,SAAS,yBAAyB;AAExC,QAAM,UAAU,OAA4B;AAE5C,QAAM,mBACJ,CAAC,WAAW,mBAAmB,WAAW,CAAC,WAAW,CAAC;AAEzD,MAAI,CAAC,mBAAmB,oBAAoB,CAAC,UAAU;AACrD,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,UAAU,OAAO,CAAC,GAAG;AACxB,UAAM,EAAE,SAAS,OAAO,WAAW,SAAS,MAAM,WAAW,IAAI,KAAK,CAAC;AAEvE,YAAQ,UAAU;AAAA,MAChB;AAAA,MACA;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,sBAAsB;AAAA,QACpB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA;AAAA,IAEC,QAAQ,UAAU,gBAAgB,QAAQ,OAAO,IAAI;AAAA,EACxD;AAEJ;AAEA,gBAAgB,aAAa,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/map/components/DotLayer/functions/define-bearing.ts"],
4
- "sourcesContent": ["import { Location } from '../../../types/location.js';\n\nexport function defineBearing<T extends Location>(\n bearing: number | ((item: T) => number),\n feature: T,\n) {\n return typeof bearing === 'number' ? bearing : bearing(feature);\n}\n"],
4
+ "sourcesContent": ["import type { Location } from '../../../types/location.js';\n\nexport function defineBearing<T extends Location>(\n bearing: number | ((item: T) => number),\n feature: T,\n) {\n return typeof bearing === 'number' ? bearing : bearing(feature);\n}\n"],
5
5
  "mappings": "AAEO,SAAS,cACd,SACA,SACA;AACA,SAAO,OAAO,YAAY,WAAW,UAAU,QAAQ,OAAO;AAChE;",
6
6
  "names": []
7
7
  }