@gooddata/sdk-ui-geo 11.6.0-alpha.5 → 11.6.0-alpha.7

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 (231) hide show
  1. package/esm/next/GeoPushpinChartNext.d.ts +12 -0
  2. package/esm/next/GeoPushpinChartNext.d.ts.map +1 -0
  3. package/esm/next/GeoPushpinChartNext.js +42 -0
  4. package/esm/next/GeoPushpinChartNext.js.map +1 -0
  5. package/esm/next/RenderGeoPushpinChart.d.ts +15 -0
  6. package/esm/next/RenderGeoPushpinChart.d.ts.map +1 -0
  7. package/esm/next/RenderGeoPushpinChart.js +97 -0
  8. package/esm/next/RenderGeoPushpinChart.js.map +1 -0
  9. package/esm/next/components/ErrorComponent.d.ts +13 -0
  10. package/esm/next/components/ErrorComponent.d.ts.map +1 -0
  11. package/esm/next/components/ErrorComponent.js +19 -0
  12. package/esm/next/components/ErrorComponent.js.map +1 -0
  13. package/esm/next/components/LoadingComponent.d.ts +5 -0
  14. package/esm/next/components/LoadingComponent.d.ts.map +1 -0
  15. package/esm/next/components/LoadingComponent.js +13 -0
  16. package/esm/next/components/LoadingComponent.js.map +1 -0
  17. package/esm/next/components/legends/Legend.d.ts +28 -0
  18. package/esm/next/components/legends/Legend.d.ts.map +1 -0
  19. package/esm/next/components/legends/Legend.js +54 -0
  20. package/esm/next/components/legends/Legend.js.map +1 -0
  21. package/esm/next/components/legends/LegendBody.d.ts +12 -0
  22. package/esm/next/components/legends/LegendBody.d.ts.map +1 -0
  23. package/esm/next/components/legends/LegendBody.js +30 -0
  24. package/esm/next/components/legends/LegendBody.js.map +1 -0
  25. package/esm/next/components/legends/legendPropsAdapter.d.ts +14 -0
  26. package/esm/next/components/legends/legendPropsAdapter.d.ts.map +1 -0
  27. package/esm/next/components/legends/legendPropsAdapter.js +34 -0
  28. package/esm/next/components/legends/legendPropsAdapter.js.map +1 -0
  29. package/esm/next/components/legends/types.d.ts +16 -0
  30. package/esm/next/components/legends/types.d.ts.map +1 -0
  31. package/esm/next/components/legends/types.js +3 -0
  32. package/esm/next/components/legends/types.js.map +1 -0
  33. package/esm/next/constants/geoChart.d.ts +108 -0
  34. package/esm/next/constants/geoChart.d.ts.map +1 -0
  35. package/esm/next/constants/geoChart.js +130 -0
  36. package/esm/next/constants/geoChart.js.map +1 -0
  37. package/esm/next/constants/internal.d.ts +19 -0
  38. package/esm/next/constants/internal.d.ts.map +1 -0
  39. package/esm/next/constants/internal.js +20 -0
  40. package/esm/next/constants/internal.js.map +1 -0
  41. package/esm/next/context/GeoDataContext.d.ts +69 -0
  42. package/esm/next/context/GeoDataContext.d.ts.map +1 -0
  43. package/esm/next/context/GeoDataContext.js +80 -0
  44. package/esm/next/context/GeoDataContext.js.map +1 -0
  45. package/esm/next/context/GeoLegendContext.d.ts +78 -0
  46. package/esm/next/context/GeoLegendContext.d.ts.map +1 -0
  47. package/esm/next/context/GeoLegendContext.js +74 -0
  48. package/esm/next/context/GeoLegendContext.js.map +1 -0
  49. package/esm/next/context/GeoPushpinPropsContext.d.ts +47 -0
  50. package/esm/next/context/GeoPushpinPropsContext.d.ts.map +1 -0
  51. package/esm/next/context/GeoPushpinPropsContext.js +81 -0
  52. package/esm/next/context/GeoPushpinPropsContext.js.map +1 -0
  53. package/esm/next/context/InitialExecutionContext.d.ts +43 -0
  54. package/esm/next/context/InitialExecutionContext.d.ts.map +1 -0
  55. package/esm/next/context/InitialExecutionContext.js +45 -0
  56. package/esm/next/context/InitialExecutionContext.js.map +1 -0
  57. package/esm/next/context/MapInstanceContext.d.ts +42 -0
  58. package/esm/next/context/MapInstanceContext.d.ts.map +1 -0
  59. package/esm/next/context/MapInstanceContext.js +62 -0
  60. package/esm/next/context/MapInstanceContext.js.map +1 -0
  61. package/esm/next/features/clustering/clustering.d.ts +23 -0
  62. package/esm/next/features/clustering/clustering.d.ts.map +1 -0
  63. package/esm/next/features/clustering/clustering.js +26 -0
  64. package/esm/next/features/clustering/clustering.js.map +1 -0
  65. package/esm/next/features/coloring/colorStrategy.d.ts +22 -0
  66. package/esm/next/features/coloring/colorStrategy.d.ts.map +1 -0
  67. package/esm/next/features/coloring/colorStrategy.js +83 -0
  68. package/esm/next/features/coloring/colorStrategy.js.map +1 -0
  69. package/esm/next/features/coloring/palette.d.ts +81 -0
  70. package/esm/next/features/coloring/palette.d.ts.map +1 -0
  71. package/esm/next/features/coloring/palette.js +233 -0
  72. package/esm/next/features/coloring/palette.js.map +1 -0
  73. package/esm/next/features/data/dataSourceManagement.d.ts +20 -0
  74. package/esm/next/features/data/dataSourceManagement.d.ts.map +1 -0
  75. package/esm/next/features/data/dataSourceManagement.js +30 -0
  76. package/esm/next/features/data/dataSourceManagement.js.map +1 -0
  77. package/esm/next/features/data/transformation.d.ts +99 -0
  78. package/esm/next/features/data/transformation.d.ts.map +1 -0
  79. package/esm/next/features/data/transformation.js +369 -0
  80. package/esm/next/features/data/transformation.js.map +1 -0
  81. package/esm/next/features/map/initializeMap.d.ts +30 -0
  82. package/esm/next/features/map/initializeMap.d.ts.map +1 -0
  83. package/esm/next/features/map/initializeMap.js +58 -0
  84. package/esm/next/features/map/initializeMap.js.map +1 -0
  85. package/esm/next/features/map/layerManagement.d.ts +51 -0
  86. package/esm/next/features/map/layerManagement.d.ts.map +1 -0
  87. package/esm/next/features/map/layerManagement.js +95 -0
  88. package/esm/next/features/map/layerManagement.js.map +1 -0
  89. package/esm/next/features/map/viewportManagement.d.ts +76 -0
  90. package/esm/next/features/map/viewportManagement.d.ts.map +1 -0
  91. package/esm/next/features/map/viewportManagement.js +193 -0
  92. package/esm/next/features/map/viewportManagement.js.map +1 -0
  93. package/esm/next/features/size/calculations.d.ts +32 -0
  94. package/esm/next/features/size/calculations.d.ts.map +1 -0
  95. package/esm/next/features/size/calculations.js +37 -0
  96. package/esm/next/features/size/calculations.js.map +1 -0
  97. package/esm/next/features/tooltip/formatting.d.ts +28 -0
  98. package/esm/next/features/tooltip/formatting.d.ts.map +1 -0
  99. package/esm/next/features/tooltip/formatting.js +51 -0
  100. package/esm/next/features/tooltip/formatting.js.map +1 -0
  101. package/esm/next/features/tooltip/tooltipManagement.d.ts +47 -0
  102. package/esm/next/features/tooltip/tooltipManagement.d.ts.map +1 -0
  103. package/esm/next/features/tooltip/tooltipManagement.js +73 -0
  104. package/esm/next/features/tooltip/tooltipManagement.js.map +1 -0
  105. package/esm/next/hooks/init/useInitExecution.d.ts +29 -0
  106. package/esm/next/hooks/init/useInitExecution.d.ts.map +1 -0
  107. package/esm/next/hooks/init/useInitExecution.js +91 -0
  108. package/esm/next/hooks/init/useInitExecution.js.map +1 -0
  109. package/esm/next/hooks/init/useInitExecutionResult.d.ts +17 -0
  110. package/esm/next/hooks/init/useInitExecutionResult.d.ts.map +1 -0
  111. package/esm/next/hooks/init/useInitExecutionResult.js +44 -0
  112. package/esm/next/hooks/init/useInitExecutionResult.js.map +1 -0
  113. package/esm/next/hooks/legend/useLegendConfig.d.ts +35 -0
  114. package/esm/next/hooks/legend/useLegendConfig.d.ts.map +1 -0
  115. package/esm/next/hooks/legend/useLegendConfig.js +25 -0
  116. package/esm/next/hooks/legend/useLegendConfig.js.map +1 -0
  117. package/esm/next/hooks/legend/useLegendDetails.d.ts +27 -0
  118. package/esm/next/hooks/legend/useLegendDetails.d.ts.map +1 -0
  119. package/esm/next/hooks/legend/useLegendDetails.js +39 -0
  120. package/esm/next/hooks/legend/useLegendDetails.js.map +1 -0
  121. package/esm/next/hooks/legend/useLegendItemClick.d.ts +16 -0
  122. package/esm/next/hooks/legend/useLegendItemClick.d.ts.map +1 -0
  123. package/esm/next/hooks/legend/useLegendItemClick.js +23 -0
  124. package/esm/next/hooks/legend/useLegendItemClick.js.map +1 -0
  125. package/esm/next/hooks/legend/useLegendItems.d.ts +27 -0
  126. package/esm/next/hooks/legend/useLegendItems.d.ts.map +1 -0
  127. package/esm/next/hooks/legend/useLegendItems.js +54 -0
  128. package/esm/next/hooks/legend/useLegendItems.js.map +1 -0
  129. package/esm/next/hooks/legend/useLegendItemsWithState.d.ts +21 -0
  130. package/esm/next/hooks/legend/useLegendItemsWithState.d.ts.map +1 -0
  131. package/esm/next/hooks/legend/useLegendItemsWithState.js +42 -0
  132. package/esm/next/hooks/legend/useLegendItemsWithState.js.map +1 -0
  133. package/esm/next/hooks/legend/useLegendProps.d.ts +53 -0
  134. package/esm/next/hooks/legend/useLegendProps.d.ts.map +1 -0
  135. package/esm/next/hooks/legend/useLegendProps.js +38 -0
  136. package/esm/next/hooks/legend/useLegendProps.js.map +1 -0
  137. package/esm/next/hooks/legend/useSelectedSegments.d.ts +17 -0
  138. package/esm/next/hooks/legend/useSelectedSegments.d.ts.map +1 -0
  139. package/esm/next/hooks/legend/useSelectedSegments.js +32 -0
  140. package/esm/next/hooks/legend/useSelectedSegments.js.map +1 -0
  141. package/esm/next/hooks/map/useAfterRender.d.ts +19 -0
  142. package/esm/next/hooks/map/useAfterRender.d.ts.map +1 -0
  143. package/esm/next/hooks/map/useAfterRender.js +99 -0
  144. package/esm/next/hooks/map/useAfterRender.js.map +1 -0
  145. package/esm/next/hooks/map/useMapCallbacks.d.ts +20 -0
  146. package/esm/next/hooks/map/useMapCallbacks.d.ts.map +1 -0
  147. package/esm/next/hooks/map/useMapCallbacks.js +44 -0
  148. package/esm/next/hooks/map/useMapCallbacks.js.map +1 -0
  149. package/esm/next/hooks/map/useMapDataSync.d.ts +44 -0
  150. package/esm/next/hooks/map/useMapDataSync.d.ts.map +1 -0
  151. package/esm/next/hooks/map/useMapDataSync.js +87 -0
  152. package/esm/next/hooks/map/useMapDataSync.js.map +1 -0
  153. package/esm/next/hooks/map/useMapInitialization.d.ts +56 -0
  154. package/esm/next/hooks/map/useMapInitialization.d.ts.map +1 -0
  155. package/esm/next/hooks/map/useMapInitialization.js +121 -0
  156. package/esm/next/hooks/map/useMapInitialization.js.map +1 -0
  157. package/esm/next/hooks/map/useTooltipHandlers.d.ts +22 -0
  158. package/esm/next/hooks/map/useTooltipHandlers.d.ts.map +1 -0
  159. package/esm/next/hooks/map/useTooltipHandlers.js +28 -0
  160. package/esm/next/hooks/map/useTooltipHandlers.js.map +1 -0
  161. package/esm/next/hooks/shared/useGeoDataTransformation.d.ts +23 -0
  162. package/esm/next/hooks/shared/useGeoDataTransformation.d.ts.map +1 -0
  163. package/esm/next/hooks/shared/useGeoDataTransformation.js +37 -0
  164. package/esm/next/hooks/shared/useGeoDataTransformation.js.map +1 -0
  165. package/esm/next/hooks/shared/usePushData.d.ts +8 -0
  166. package/esm/next/hooks/shared/usePushData.d.ts.map +1 -0
  167. package/esm/next/hooks/shared/usePushData.js +36 -0
  168. package/esm/next/hooks/shared/usePushData.js.map +1 -0
  169. package/esm/next/hooks/shared/useResolvedProps.d.ts +16 -0
  170. package/esm/next/hooks/shared/useResolvedProps.d.ts.map +1 -0
  171. package/esm/next/hooks/shared/useResolvedProps.js +40 -0
  172. package/esm/next/hooks/shared/useResolvedProps.js.map +1 -0
  173. package/esm/next/index.d.ts +5 -0
  174. package/esm/next/index.d.ts.map +1 -0
  175. package/esm/next/index.js +3 -0
  176. package/esm/next/index.js.map +1 -0
  177. package/esm/next/providers/maplibre/maplibreConfig.d.ts +68 -0
  178. package/esm/next/providers/maplibre/maplibreConfig.d.ts.map +1 -0
  179. package/esm/next/providers/maplibre/maplibreConfig.js +104 -0
  180. package/esm/next/providers/maplibre/maplibreConfig.js.map +1 -0
  181. package/esm/next/providers/maplibre/maplibreDataLayers.d.ts +51 -0
  182. package/esm/next/providers/maplibre/maplibreDataLayers.d.ts.map +1 -0
  183. package/esm/next/providers/maplibre/maplibreDataLayers.js +195 -0
  184. package/esm/next/providers/maplibre/maplibreDataLayers.js.map +1 -0
  185. package/esm/next/providers/maplibre/maplibreDataSource.d.ts +28 -0
  186. package/esm/next/providers/maplibre/maplibreDataSource.d.ts.map +1 -0
  187. package/esm/next/providers/maplibre/maplibreDataSource.js +117 -0
  188. package/esm/next/providers/maplibre/maplibreDataSource.js.map +1 -0
  189. package/esm/next/providers/maplibre/maplibreTooltip.d.ts +54 -0
  190. package/esm/next/providers/maplibre/maplibreTooltip.d.ts.map +1 -0
  191. package/esm/next/providers/maplibre/maplibreTooltip.js +158 -0
  192. package/esm/next/providers/maplibre/maplibreTooltip.js.map +1 -0
  193. package/esm/next/providers/maplibre/maplibreViewport.d.ts +45 -0
  194. package/esm/next/providers/maplibre/maplibreViewport.d.ts.map +1 -0
  195. package/esm/next/providers/maplibre/maplibreViewport.js +92 -0
  196. package/esm/next/providers/maplibre/maplibreViewport.js.map +1 -0
  197. package/esm/next/providers/maplibre/style.d.ts +3 -0
  198. package/esm/next/providers/maplibre/style.d.ts.map +1 -0
  199. package/esm/next/providers/maplibre/style.js +8361 -0
  200. package/esm/next/providers/maplibre/style.js.map +1 -0
  201. package/esm/next/types/config.d.ts +89 -0
  202. package/esm/next/types/config.d.ts.map +1 -0
  203. package/esm/next/types/config.js +3 -0
  204. package/esm/next/types/config.js.map +1 -0
  205. package/esm/next/types/internal.d.ts +17 -0
  206. package/esm/next/types/internal.d.ts.map +1 -0
  207. package/esm/next/types/internal.js +3 -0
  208. package/esm/next/types/internal.js.map +1 -0
  209. package/esm/next/types/mapProvider.d.ts +122 -0
  210. package/esm/next/types/mapProvider.d.ts.map +1 -0
  211. package/esm/next/types/mapProvider.js +3 -0
  212. package/esm/next/types/mapProvider.js.map +1 -0
  213. package/esm/next/types/public.d.ts +84 -0
  214. package/esm/next/types/public.d.ts.map +1 -0
  215. package/esm/next/types/public.js +15 -0
  216. package/esm/next/types/public.js.map +1 -0
  217. package/esm/next/types/shared.d.ts +209 -0
  218. package/esm/next/types/shared.d.ts.map +1 -0
  219. package/esm/next/types/shared.js +3 -0
  220. package/esm/next/types/shared.js.map +1 -0
  221. package/esm/next/utils/mapLocale.d.ts +26 -0
  222. package/esm/next/utils/mapLocale.d.ts.map +1 -0
  223. package/esm/next/utils/mapLocale.js +22 -0
  224. package/esm/next/utils/mapLocale.js.map +1 -0
  225. package/package.json +13 -10
  226. package/styles/css/main.css +925 -0
  227. package/styles/css/main.css.map +1 -1
  228. package/styles/scss/_geo-pushpin-next-legend.scss +166 -0
  229. package/styles/scss/_maplibre-overrides.scss +64 -0
  230. package/styles/scss/geo-pushpin-next.scss +58 -0
  231. package/styles/scss/main.scss +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTooltipHandlers.js","sourceRoot":"","sources":["../../../../src/next/hooks/map/useTooltipHandlers.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAGnF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kBAAkB,CAC9B,GAAuB,EACvB,OAAqB,EACrB,MAA8B,EAC9B,mBAAuC,EACvC,IAAe;IAEf,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;YAC9B,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,OAAO,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;IACjF,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { DataViewFacade } from "@gooddata/sdk-ui";
2
+ import { IGeoData } from "../../types/shared.js";
3
+ /**
4
+ * Transforms DataView into IGeoData structure.
5
+ *
6
+ * @remarks
7
+ * This hook transforms the execution result data view into the IGeoData format
8
+ * required for rendering pushpins on the map. It handles:
9
+ * - Parsing location coordinates (single location or lat/lng pair)
10
+ * - Extracting size and color measure values
11
+ * - Processing segment attribute values and URIs
12
+ * - Handling tooltip text attribute values
13
+ * - Managing empty and null values with localized strings
14
+ *
15
+ * The transformation logic is based on the existing getGeoData helper from the core implementation.
16
+ *
17
+ * @param dataView - Data view facade containing execution results
18
+ * @returns Transformed geographic data ready for map rendering, or null if no data view
19
+ *
20
+ * @alpha
21
+ */
22
+ export declare function useGeoDataTransformation(dataView: DataViewFacade | null): IGeoData | null;
23
+ //# sourceMappingURL=useGeoDataTransformation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGeoDataTransformation.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useGeoDataTransformation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,CAezF"}
@@ -0,0 +1,37 @@
1
+ // (C) 2025 GoodData Corporation
2
+ import { useMemo } from "react";
3
+ import { useIntl } from "react-intl";
4
+ import { getGeoData } from "../../features/data/transformation.js";
5
+ /**
6
+ * Transforms DataView into IGeoData structure.
7
+ *
8
+ * @remarks
9
+ * This hook transforms the execution result data view into the IGeoData format
10
+ * required for rendering pushpins on the map. It handles:
11
+ * - Parsing location coordinates (single location or lat/lng pair)
12
+ * - Extracting size and color measure values
13
+ * - Processing segment attribute values and URIs
14
+ * - Handling tooltip text attribute values
15
+ * - Managing empty and null values with localized strings
16
+ *
17
+ * The transformation logic is based on the existing getGeoData helper from the core implementation.
18
+ *
19
+ * @param dataView - Data view facade containing execution results
20
+ * @returns Transformed geographic data ready for map rendering, or null if no data view
21
+ *
22
+ * @alpha
23
+ */
24
+ export function useGeoDataTransformation(dataView) {
25
+ const intl = useIntl();
26
+ return useMemo(() => {
27
+ if (!dataView) {
28
+ return null;
29
+ }
30
+ // Localized strings for empty and null values
31
+ const emptyHeaderString = intl.formatMessage({ id: "visualization.emptyValue" });
32
+ const nullHeaderString = intl.formatMessage({ id: "visualization.emptyValue" });
33
+ // Transform data view to geo data structure
34
+ return getGeoData(dataView, emptyHeaderString, nullHeaderString);
35
+ }, [dataView, intl]);
36
+ }
37
+ //# sourceMappingURL=useGeoDataTransformation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGeoDataTransformation.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useGeoDataTransformation.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAGnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA+B;IACpE,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,OAAO,OAAO,CAAC,GAAG,EAAE;QAChB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,8CAA8C;QAC9C,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,0BAA0B,EAAE,CAAC,CAAC;QACjF,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,0BAA0B,EAAE,CAAC,CAAC;QAEhF,4CAA4C;QAC5C,OAAO,UAAU,CAAC,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IACrE,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { IColorPalette } from "@gooddata/sdk-model";
2
+ import { IColorStrategy } from "@gooddata/sdk-ui-vis-commons";
3
+ /**
4
+ * Hook to push data to analytical designer for configuration panel updates
5
+ * @internal
6
+ */
7
+ export declare function usePushData(colorStrategy: IColorStrategy | null, colorPalette: IColorPalette): void;
8
+ //# sourceMappingURL=usePushData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePushData.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/usePushData.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAM9D;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,cAAc,GAAG,IAAI,EAAE,YAAY,EAAE,aAAa,GAAG,IAAI,CA6BnG"}
@@ -0,0 +1,36 @@
1
+ // (C) 2025 GoodData Corporation
2
+ import { useEffect } from "react";
3
+ import { useGeoData } from "../../context/GeoDataContext.js";
4
+ import { useGeoPushpinProps } from "../../context/GeoPushpinPropsContext.js";
5
+ import { useInitialExecution } from "../../context/InitialExecutionContext.js";
6
+ /**
7
+ * Hook to push data to analytical designer for configuration panel updates
8
+ * @internal
9
+ */
10
+ export function usePushData(colorStrategy, colorPalette) {
11
+ const props = useGeoPushpinProps();
12
+ const { availableLegends } = useGeoData();
13
+ const { initialDataView } = useInitialExecution();
14
+ const { pushData } = props;
15
+ useEffect(() => {
16
+ if (!pushData || !colorStrategy) {
17
+ return;
18
+ }
19
+ // Check if legend should be visible
20
+ const isLegendVisible = availableLegends.hasCategoryLegend ||
21
+ availableLegends.hasColorLegend ||
22
+ availableLegends.hasSizeLegend;
23
+ pushData({
24
+ dataView: initialDataView?.dataView,
25
+ propertiesMeta: {
26
+ // toggle legend section
27
+ legend_enabled: isLegendVisible,
28
+ },
29
+ colors: {
30
+ colorAssignments: colorStrategy.getColorAssignment(),
31
+ colorPalette,
32
+ },
33
+ });
34
+ }, [pushData, availableLegends, colorStrategy, colorPalette, initialDataView]);
35
+ }
36
+ //# sourceMappingURL=usePushData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePushData.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/usePushData.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlC,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,aAAoC,EAAE,YAA2B;IACzF,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAC;IACnC,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,EAAE,CAAC;IAC1C,MAAM,EAAE,eAAe,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAClD,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE3B,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,QAAQ,IAAI,CAAC,aAAa,EAAE,CAAC;YAC9B,OAAO;QACX,CAAC;QAED,oCAAoC;QACpC,MAAM,eAAe,GACjB,gBAAgB,CAAC,iBAAiB;YAClC,gBAAgB,CAAC,cAAc;YAC/B,gBAAgB,CAAC,aAAa,CAAC;QAEnC,QAAQ,CAAC;YACL,QAAQ,EAAE,eAAe,EAAE,QAAQ;YACnC,cAAc,EAAE;gBACZ,wBAAwB;gBACxB,cAAc,EAAE,eAAe;aAClC;YACD,MAAM,EAAE;gBACJ,gBAAgB,EAAE,aAAa,CAAC,kBAAkB,EAAE;gBACpD,YAAY;aACf;SACJ,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;AACnF,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { IGeoPushpinChartNextResolvedProps } from "../../types/internal.js";
2
+ import { IGeoPushpinChartNextProps } from "../../types/public.js";
3
+ /**
4
+ * Resolves placeholders in GeoPushpinChartNext props and returns strongly-typed props.
5
+ *
6
+ * @remarks
7
+ * This hook resolves all placeholder values in location, size, color, segmentBy, filters,
8
+ * and sortBy props using the provided placeholdersResolutionContext.
9
+ *
10
+ * @param props - Component props potentially containing placeholders
11
+ * @returns Props with all placeholders resolved
12
+ *
13
+ * @alpha
14
+ */
15
+ export declare function useResolvedProps(props: IGeoPushpinChartNextProps): IGeoPushpinChartNextResolvedProps;
16
+ //# sourceMappingURL=useResolvedProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResolvedProps.d.ts","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useResolvedProps.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EACH,yBAAyB,EAE5B,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,yBAAyB,GAAG,iCAAiC,CA6BpG"}
@@ -0,0 +1,40 @@
1
+ // (C) 2025 GoodData Corporation
2
+ import { useResolveValuesWithPlaceholders } from "@gooddata/sdk-ui";
3
+ import { isGeoPushpinChartNextLatitudeLongitudeProps, } from "../../types/public.js";
4
+ /**
5
+ * Resolves placeholders in GeoPushpinChartNext props and returns strongly-typed props.
6
+ *
7
+ * @remarks
8
+ * This hook resolves all placeholder values in location, size, color, segmentBy, filters,
9
+ * and sortBy props using the provided placeholdersResolutionContext.
10
+ *
11
+ * @param props - Component props potentially containing placeholders
12
+ * @returns Props with all placeholders resolved
13
+ *
14
+ * @alpha
15
+ */
16
+ export function useResolvedProps(props) {
17
+ const isLatLngMode = isGeoPushpinChartNextLatitudeLongitudeProps(props);
18
+ const [location, latitude, longitude, segmentBy, size, color, filters, sortBy] = useResolveValuesWithPlaceholders([
19
+ isLatLngMode ? undefined : props.location,
20
+ isLatLngMode ? props.latitude : undefined,
21
+ isLatLngMode ? props.longitude : undefined,
22
+ props.segmentBy,
23
+ props.size,
24
+ props.color,
25
+ props.filters,
26
+ props.sortBy,
27
+ ], undefined);
28
+ return {
29
+ ...props,
30
+ location,
31
+ latitude,
32
+ longitude,
33
+ segmentBy,
34
+ size,
35
+ color,
36
+ filters,
37
+ sortBy,
38
+ };
39
+ }
40
+ //# sourceMappingURL=useResolvedProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResolvedProps.js","sourceRoot":"","sources":["../../../../src/next/hooks/shared/useResolvedProps.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAGpE,OAAO,EAEH,2CAA2C,GAC9C,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAgC;IAC7D,MAAM,YAAY,GAAG,2CAA2C,CAAC,KAAK,CAAC,CAAC;IAExE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,GAC1E,gCAAgC,CAC5B;QACI,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ;QACzC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QACzC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC1C,KAAK,CAAC,SAAS;QACf,KAAK,CAAC,IAAI;QACV,KAAK,CAAC,KAAK;QACX,KAAK,CAAC,OAAO;QACb,KAAK,CAAC,MAAM;KACf,EACD,SAAS,CACZ,CAAC;IAEN,OAAO;QACH,GAAG,KAAK;QACR,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,SAAS;QACT,IAAI;QACJ,KAAK;QACL,OAAO;QACP,MAAM;KACT,CAAC;AACN,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { GeoPushpinChartNext, GeoPushpinChartNextImplementation } from "./GeoPushpinChartNext.js";
2
+ export type { IGeoPushpinChartNextBaseProps, IGeoPushpinChartNextLocationProps, IGeoPushpinChartNextLatitudeLongitudeProps, IGeoPushpinChartNextProps, isGeoPushpinChartNextLocationProps, isGeoPushpinChartNextLatitudeLongitudeProps, } from "./types/public.js";
3
+ export type { ICoreGeoPushpinChartNextProps } from "./types/internal.js";
4
+ export type { IGeoPushpinChartNextConfig, IGeoConfigViewportNext, IGeoConfigViewportAreaNext, IGeoPointsConfigNext, PushpinSizeOptionNext, IGeoLegendConfigNext, } from "./types/config.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/next/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAClG,YAAY,EACR,6BAA6B,EAC7B,iCAAiC,EACjC,0CAA0C,EAC1C,yBAAyB,EACzB,kCAAkC,EAClC,2CAA2C,GAC9C,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AACzE,YAAY,EACR,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ // (C) 2025 GoodData Corporation
2
+ export { GeoPushpinChartNext, GeoPushpinChartNextImplementation } from "./GeoPushpinChartNext.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/next/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,68 @@
1
+ import type { LngLatBoundsLike, MapOptions, PopupOptions } from "maplibre-gl";
2
+ import { IGeoLngLat } from "../../types/shared.js";
3
+ /**
4
+ * Type for viewport definitions
5
+ */
6
+ type IGeoViewports = {
7
+ [key: string]: LngLatBoundsLike;
8
+ };
9
+ /**
10
+ * Default world bounds for the map viewport
11
+ *
12
+ * @alpha
13
+ */
14
+ export declare const DEFAULT_WORLD_BOUNDS: {
15
+ northEast: {
16
+ lat: number;
17
+ lng: number;
18
+ };
19
+ southWest: {
20
+ lat: number;
21
+ lng: number;
22
+ };
23
+ };
24
+ /**
25
+ * Predefined viewport areas for different continents and world view
26
+ *
27
+ * @alpha
28
+ */
29
+ export declare const VIEWPORTS: IGeoViewports;
30
+ /**
31
+ * Filter for identifying clustered points
32
+ *
33
+ * @alpha
34
+ */
35
+ export declare const DEFAULT_CLUSTER_FILTER: string[];
36
+ /**
37
+ * Configuration for cluster labels layer
38
+ *
39
+ * @alpha
40
+ */
41
+ export declare const DEFAULT_CLUSTER_LABELS_CONFIG: {
42
+ id: string;
43
+ type: "symbol";
44
+ layout: {
45
+ "text-allow-overlap": boolean;
46
+ "text-field": string;
47
+ "text-size": number;
48
+ };
49
+ paint: {
50
+ "text-color": string;
51
+ };
52
+ };
53
+ export declare const DEFAULT_ZOOM: number;
54
+ export declare const DEFAULT_CENTER: IGeoLngLat;
55
+ /**
56
+ * Default MapLibre map options
57
+ *
58
+ * @alpha
59
+ */
60
+ export declare const DEFAULT_MAPLIBRE_OPTIONS: Partial<MapOptions>;
61
+ /**
62
+ * Default tooltip popup options
63
+ *
64
+ * @alpha
65
+ */
66
+ export declare const DEFAULT_TOOLTIP_OPTIONS: PopupOptions;
67
+ export {};
68
+ //# sourceMappingURL=maplibreConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maplibreConfig.d.ts","sourceRoot":"","sources":["../../../../src/next/providers/maplibre/maplibreConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;GAEG;AACH,KAAK,aAAa,GAAG;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;CACnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;CAA2E,CAAC;AAE7G;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,aA0BvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,UAAyB,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;CAYzC,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,MAAU,CAAC;AACtC,eAAO,MAAM,cAAc,EAAE,UAG5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAAC,UAAU,CAiBxD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,YAIrC,CAAC"}
@@ -0,0 +1,104 @@
1
+ // (C) 2025 GoodData Corporation
2
+ /**
3
+ * Default world bounds for the map viewport
4
+ *
5
+ * @alpha
6
+ */
7
+ export const DEFAULT_WORLD_BOUNDS = { northEast: { lat: 84, lng: 180 }, southWest: { lat: -84, lng: -180 } };
8
+ /**
9
+ * Predefined viewport areas for different continents and world view
10
+ *
11
+ * @alpha
12
+ */
13
+ export const VIEWPORTS = {
14
+ continent_af: [
15
+ { lat: -36, lng: -20 },
16
+ { lat: 38, lng: 54 },
17
+ ], // Africa
18
+ continent_as: [
19
+ { lat: -8, lng: 26 },
20
+ { lat: 64, lng: 146 },
21
+ ], // Asia
22
+ continent_au: [
23
+ { lat: -50, lng: 107 },
24
+ { lat: 0, lng: 180 },
25
+ ], // Australia + NZ
26
+ continent_eu: [
27
+ { lat: 36, lng: -24 },
28
+ { lat: 72, lng: 43 },
29
+ ], // Europe
30
+ continent_na: [
31
+ { lat: 11, lng: -170 },
32
+ { lat: 72, lng: -52 },
33
+ ], // North America
34
+ continent_sa: [
35
+ { lat: -56, lng: -90 },
36
+ { lat: 14, lng: -31 },
37
+ ], // South America
38
+ world: [DEFAULT_WORLD_BOUNDS.southWest, DEFAULT_WORLD_BOUNDS.northEast], // World
39
+ };
40
+ /**
41
+ * Filter for identifying clustered points
42
+ *
43
+ * @alpha
44
+ */
45
+ export const DEFAULT_CLUSTER_FILTER = ["has", "point_count"];
46
+ /**
47
+ * Configuration for cluster labels layer
48
+ *
49
+ * @alpha
50
+ */
51
+ export const DEFAULT_CLUSTER_LABELS_CONFIG = {
52
+ id: "gdcClusterLabels",
53
+ type: "symbol",
54
+ layout: {
55
+ "text-allow-overlap": true,
56
+ "text-field": "{point_count_abbreviated}",
57
+ // "text-font": ["Open Sans Semibold"], // Commented out to allow MapLibre to use style's default fonts
58
+ "text-size": 14,
59
+ },
60
+ paint: {
61
+ "text-color": "#fff",
62
+ },
63
+ };
64
+ const DEFAULT_LATITUDE = 34;
65
+ const DEFAULT_LONGITUDE = 5;
66
+ export const DEFAULT_ZOOM = 2;
67
+ export const DEFAULT_CENTER = {
68
+ lat: DEFAULT_LATITUDE,
69
+ lng: DEFAULT_LONGITUDE,
70
+ };
71
+ /**
72
+ * Default MapLibre map options
73
+ *
74
+ * @alpha
75
+ */
76
+ export const DEFAULT_MAPLIBRE_OPTIONS = {
77
+ // hide maplibre's information on map
78
+ attributionControl: false,
79
+ // If false, the "drag to rotate" interaction is disabled
80
+ dragRotate: false,
81
+ // set maxDuration: 1 will remove the animation when viewport is changed
82
+ fitBoundsOptions: { padding: 45, maxDuration: 1 },
83
+ // Disable infinite geochart scrolling
84
+ // maxBounds: VIEWPORTS["world"] as LngLatBoundsLike,
85
+ // The maximum zoom level of the map (0-24).
86
+ maxZoom: 14,
87
+ // If false, the map's pitch (tilt) control with "drag to rotate" interaction will be disabled.
88
+ pitchWithRotate: false,
89
+ // Disable infinite geochart scrolling
90
+ renderWorldCopies: false,
91
+ // If false, the "pinch to rotate and zoom" interaction is disabled
92
+ touchZoomRotate: false,
93
+ };
94
+ /**
95
+ * Default tooltip popup options
96
+ *
97
+ * @alpha
98
+ */
99
+ export const DEFAULT_TOOLTIP_OPTIONS = {
100
+ closeButton: false,
101
+ closeOnClick: false,
102
+ offset: 10,
103
+ };
104
+ //# sourceMappingURL=maplibreConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maplibreConfig.js","sourceRoot":"","sources":["../../../../src/next/providers/maplibre/maplibreConfig.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,51 @@
1
+ import type { CircleLayerSpecification, FilterSpecification, SymbolLayerSpecification } from "maplibre-gl";
2
+ import { IGeoPushpinChartNextConfig } from "../../types/config.js";
3
+ import { IGeoData } from "../../types/shared.js";
4
+ /**
5
+ * Creates a filter expression for pushpins based on selected segment items
6
+ *
7
+ * @param selectedSegmentItems - Array of segment URIs to show
8
+ * @returns MapLibre expression for filtering
9
+ *
10
+ * @alpha
11
+ */
12
+ export declare function createPushpinFilter(selectedSegmentItems: string[]): FilterSpecification;
13
+ /**
14
+ * Creates the main pushpin data layer for non-clustered visualization
15
+ *
16
+ * @param dataSourceName - Name of the GeoJSON data source
17
+ * @param geoData - Geographic data for size calculations
18
+ * @param config - Geo chart configuration
19
+ * @returns MapLibre circle layer specification
20
+ *
21
+ * @alpha
22
+ */
23
+ export declare function createPushpinDataLayer(dataSourceName: string, geoData: IGeoData, config: IGeoPushpinChartNextConfig): CircleLayerSpecification;
24
+ /**
25
+ * Create layer for clustered points/pins which have 'properties.point_count' indicates number of same points is clustered together
26
+ *
27
+ * @param dataSourceName - Name of the GeoJSON data source
28
+ * @returns MapLibre circle layer specification for clusters
29
+ *
30
+ * @alpha
31
+ */
32
+ export declare function createClusterPoints(dataSourceName: string): CircleLayerSpecification;
33
+ /**
34
+ * Create layer for cluster labels which indicate number of points/pins is clustered
35
+ *
36
+ * @param dataSourceName - Name of the GeoJSON data source
37
+ * @returns MapLibre symbol layer specification for cluster labels
38
+ *
39
+ * @alpha
40
+ */
41
+ export declare function createClusterLabels(dataSourceName: string): SymbolLayerSpecification;
42
+ /**
43
+ * Create layer for un-clustered points which are not close to others
44
+ *
45
+ * @param dataSourceName - Name of the GeoJSON data source
46
+ * @returns MapLibre circle layer specification for unclustered points
47
+ *
48
+ * @alpha
49
+ */
50
+ export declare function createUnclusterPoints(dataSourceName: string): CircleLayerSpecification;
51
+ //# sourceMappingURL=maplibreDataLayers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maplibreDataLayers.d.ts","sourceRoot":"","sources":["../../../../src/next/providers/maplibre/maplibreDataLayers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,wBAAwB,EAExB,mBAAmB,EACnB,wBAAwB,EAC3B,MAAM,aAAa,CAAC;AAkBrB,OAAO,EAAwB,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAmGjD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,oBAAoB,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAQvF;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAClC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,QAAQ,EACjB,MAAM,EAAE,0BAA0B,GACnC,wBAAwB,CAkB1B;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,wBAAwB,CAYpF;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,wBAAwB,CAMpF;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,wBAAwB,CAatF"}
@@ -0,0 +1,195 @@
1
+ // (C) 2025 GoodData Corporation
2
+ import { partial } from "lodash-es";
3
+ import { BucketNames } from "@gooddata/sdk-ui";
4
+ import { DEFAULT_CLUSTER_FILTER, DEFAULT_CLUSTER_LABELS_CONFIG } from "./maplibreConfig.js";
5
+ import { DEFAULT_CLUSTER_LAYER_NAME, DEFAULT_LAYER_NAME, DEFAULT_PUSHPIN_BORDER_COLOR_VALUE, DEFAULT_PUSHPIN_OPTIONS, EMPTY_SEGMENT_VALUE, PUSHPIN_SIZE_OPTIONS_MAP, PUSHPIN_STYLE_CIRCLE, PUSHPIN_STYLE_CIRCLE_COLOR, PUSHPIN_STYLE_CIRCLE_SIZE, PUSHPIN_STYLE_CIRCLE_STROKE_COLOR, } from "../../constants/geoChart.js";
6
+ import { getMinMax } from "../../features/size/calculations.js";
7
+ const DEFAULT_CLUSTER_POINT_BORDERS = {
8
+ "circle-stroke-color": [
9
+ "step",
10
+ ["get", "point_count"],
11
+ "#00D398", // point count is less than 10
12
+ 10,
13
+ "#F38700", // point count is between 10 and 100
14
+ 100,
15
+ "#E84C3C", // point count is greater than or equal to 100
16
+ ],
17
+ "circle-stroke-opacity": 0.2,
18
+ "circle-stroke-width": 8,
19
+ };
20
+ const DEFAULT_CLUSTER_POINT_COLORS = [
21
+ "step",
22
+ ["get", "point_count"],
23
+ "#00D398", // point count is less than 10
24
+ 10,
25
+ "#F38700", // point count is between 10 and 100
26
+ 100,
27
+ "#E84C3C", // point count is greater than or equal to 100
28
+ ];
29
+ const DEFAULT_CLUSTER_POINT_SIZES = [
30
+ "step",
31
+ ["get", "point_count"],
32
+ 15, // point count is less than 100
33
+ 100,
34
+ 25, // point count is greater than or equal to 100
35
+ ];
36
+ /**
37
+ * Helper function to calculate point size in geometric progression
38
+ *
39
+ * @param minSizeInPixel - Minimum size in pixels
40
+ * @param base - Base for geometric progression
41
+ * @param exponent - Exponent for progression
42
+ * @returns Calculated point size
43
+ *
44
+ * @internal
45
+ */
46
+ function getPointSize(minSizeInPixel, base, exponent) {
47
+ const stepValue = minSizeInPixel * Math.pow(base, exponent);
48
+ return parseFloat(stepValue.toFixed(2));
49
+ }
50
+ /**
51
+ * Creates pushpin size options based on data distribution
52
+ *
53
+ * @param geoData - Geographic data containing size information
54
+ * @param geoPointsConfig - Configuration for point sizing
55
+ * @returns MapLibre expression for data-driven sizing or constant radius
56
+ *
57
+ * @internal
58
+ */
59
+ function createPushpinSizeOptions(geoData, geoPointsConfig) {
60
+ const { size } = geoData;
61
+ const defaultRadius = PUSHPIN_SIZE_OPTIONS_MAP.min.default / 2;
62
+ if (size === undefined || size.data.length === 0) {
63
+ return defaultRadius;
64
+ }
65
+ const { min: minSizeFromData, max: maxSizeFromData } = getMinMax(size.data);
66
+ if (maxSizeFromData === minSizeFromData) {
67
+ return defaultRadius;
68
+ }
69
+ const { minSize: minSizeFromConfig = "default", maxSize: maxSizeFromConfig = "default" } = geoPointsConfig || {};
70
+ const minSizeInPixel = PUSHPIN_SIZE_OPTIONS_MAP.min[minSizeFromConfig];
71
+ const maxSizeInPixel = PUSHPIN_SIZE_OPTIONS_MAP.max[maxSizeFromConfig];
72
+ const base = Math.pow(maxSizeInPixel / minSizeInPixel, 0.25);
73
+ const getStopPointSize = partial(getPointSize, minSizeInPixel, base);
74
+ // The mouseenter event uses queryRenderedFeatures to determine when the mouse is touching a feature
75
+ // And queryRenderedFeatures is not supporting nested object in expression
76
+ // https://github.com/mapbox/mapbox-gl-js/issues/7194
77
+ return [
78
+ "step",
79
+ ["get", "pushpinSize"],
80
+ Math.round(minSizeInPixel / 2), // a
81
+ getStopPointSize(1),
82
+ Math.round(getStopPointSize(1) / 2), // ar^1
83
+ getStopPointSize(2),
84
+ Math.round(getStopPointSize(2) / 2), // ar^2
85
+ getStopPointSize(3),
86
+ Math.round(getStopPointSize(3) / 2), // ar^3
87
+ maxSizeInPixel,
88
+ Math.round(maxSizeInPixel / 2), // ar^4
89
+ ];
90
+ }
91
+ /**
92
+ * Creates a filter expression for pushpins based on selected segment items
93
+ *
94
+ * @param selectedSegmentItems - Array of segment URIs to show
95
+ * @returns MapLibre expression for filtering
96
+ *
97
+ * @alpha
98
+ */
99
+ export function createPushpinFilter(selectedSegmentItems) {
100
+ return [
101
+ "match",
102
+ ["get", "uri", ["get", BucketNames.SEGMENT]],
103
+ selectedSegmentItems.length ? selectedSegmentItems : [EMPTY_SEGMENT_VALUE],
104
+ true,
105
+ false,
106
+ ]; // true/false are the output values
107
+ }
108
+ /**
109
+ * Creates the main pushpin data layer for non-clustered visualization
110
+ *
111
+ * @param dataSourceName - Name of the GeoJSON data source
112
+ * @param geoData - Geographic data for size calculations
113
+ * @param config - Geo chart configuration
114
+ * @returns MapLibre circle layer specification
115
+ *
116
+ * @alpha
117
+ */
118
+ export function createPushpinDataLayer(dataSourceName, geoData, config) {
119
+ const { selectedSegmentItems = [], points: geoPointsConfig = {} } = config || {};
120
+ const layer = {
121
+ id: DEFAULT_LAYER_NAME,
122
+ type: PUSHPIN_STYLE_CIRCLE,
123
+ source: dataSourceName,
124
+ paint: {
125
+ ...DEFAULT_PUSHPIN_OPTIONS,
126
+ // Use data-driven styling from flattened feature properties
127
+ [PUSHPIN_STYLE_CIRCLE_COLOR]: ["coalesce", ["get", "color_background"], "rgba(20,178,226,0.7)"],
128
+ [PUSHPIN_STYLE_CIRCLE_STROKE_COLOR]: ["coalesce", ["get", "color_border"], "rgb(233,237,241)"],
129
+ [PUSHPIN_STYLE_CIRCLE_SIZE]: createPushpinSizeOptions(geoData, geoPointsConfig),
130
+ },
131
+ };
132
+ if (selectedSegmentItems.length > 0) {
133
+ layer.filter = createPushpinFilter(selectedSegmentItems);
134
+ }
135
+ return layer;
136
+ }
137
+ /**
138
+ * Create layer for clustered points/pins which have 'properties.point_count' indicates number of same points is clustered together
139
+ *
140
+ * @param dataSourceName - Name of the GeoJSON data source
141
+ * @returns MapLibre circle layer specification for clusters
142
+ *
143
+ * @alpha
144
+ */
145
+ export function createClusterPoints(dataSourceName) {
146
+ return {
147
+ id: DEFAULT_CLUSTER_LAYER_NAME,
148
+ type: PUSHPIN_STYLE_CIRCLE,
149
+ source: dataSourceName,
150
+ filter: DEFAULT_CLUSTER_FILTER,
151
+ paint: {
152
+ ...DEFAULT_CLUSTER_POINT_BORDERS,
153
+ [PUSHPIN_STYLE_CIRCLE_COLOR]: DEFAULT_CLUSTER_POINT_COLORS,
154
+ [PUSHPIN_STYLE_CIRCLE_SIZE]: DEFAULT_CLUSTER_POINT_SIZES,
155
+ },
156
+ };
157
+ }
158
+ /**
159
+ * Create layer for cluster labels which indicate number of points/pins is clustered
160
+ *
161
+ * @param dataSourceName - Name of the GeoJSON data source
162
+ * @returns MapLibre symbol layer specification for cluster labels
163
+ *
164
+ * @alpha
165
+ */
166
+ export function createClusterLabels(dataSourceName) {
167
+ return {
168
+ ...DEFAULT_CLUSTER_LABELS_CONFIG,
169
+ source: dataSourceName,
170
+ filter: DEFAULT_CLUSTER_FILTER,
171
+ };
172
+ }
173
+ /**
174
+ * Create layer for un-clustered points which are not close to others
175
+ *
176
+ * @param dataSourceName - Name of the GeoJSON data source
177
+ * @returns MapLibre circle layer specification for unclustered points
178
+ *
179
+ * @alpha
180
+ */
181
+ export function createUnclusterPoints(dataSourceName) {
182
+ return {
183
+ id: DEFAULT_LAYER_NAME,
184
+ type: PUSHPIN_STYLE_CIRCLE,
185
+ source: dataSourceName,
186
+ filter: ["!", DEFAULT_CLUSTER_FILTER],
187
+ paint: {
188
+ ...DEFAULT_PUSHPIN_OPTIONS,
189
+ [PUSHPIN_STYLE_CIRCLE_COLOR]: ["get", "background", ["get", "color"]],
190
+ [PUSHPIN_STYLE_CIRCLE_STROKE_COLOR]: DEFAULT_PUSHPIN_BORDER_COLOR_VALUE,
191
+ [PUSHPIN_STYLE_CIRCLE_SIZE]: 4,
192
+ },
193
+ };
194
+ }
195
+ //# sourceMappingURL=maplibreDataLayers.js.map