@hisptz/dhis2-analytics 2.0.0-alpha.0 → 2.0.0

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 (726) hide show
  1. package/dist/components/ChartAnalytics/DHIS2Chart.js +11 -11
  2. package/dist/components/ChartAnalytics/DHIS2Chart.js.map +1 -1
  3. package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +2 -2
  4. package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -1
  5. package/dist/components/ChartAnalytics/components/DownloadMenu/index.js +10 -10
  6. package/dist/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -1
  7. package/dist/components/ChartAnalytics/hooks/useChart.js +7 -7
  8. package/dist/components/ChartAnalytics/hooks/useChart.js.map +1 -1
  9. package/dist/components/ChartAnalytics/index.js +3 -3
  10. package/dist/components/ChartAnalytics/index.js.map +1 -1
  11. package/dist/components/ChartAnalytics/models/bar.js +2 -2
  12. package/dist/components/ChartAnalytics/models/bar.js.map +1 -1
  13. package/dist/components/ChartAnalytics/models/column.js +5 -5
  14. package/dist/components/ChartAnalytics/models/column.js.map +1 -1
  15. package/dist/components/ChartAnalytics/models/index.js +0 -3
  16. package/dist/components/ChartAnalytics/models/index.js.map +1 -1
  17. package/dist/components/ChartAnalytics/models/line.js +5 -5
  18. package/dist/components/ChartAnalytics/models/line.js.map +1 -1
  19. package/dist/components/ChartAnalytics/models/multi-series.js +22 -9
  20. package/dist/components/ChartAnalytics/models/multi-series.js.map +1 -1
  21. package/dist/components/ChartAnalytics/models/pie.js +5 -3
  22. package/dist/components/ChartAnalytics/models/pie.js.map +1 -1
  23. package/dist/components/ChartAnalytics/services/export.js +3 -3
  24. package/dist/components/ChartAnalytics/services/export.js.map +1 -1
  25. package/dist/components/ChartAnalytics/styles/custom-highchart.css +40 -0
  26. package/dist/components/ChartAnalytics/styles/custom-highchart.css.map +1 -0
  27. package/dist/components/ChartAnalytics/utils/chart.js +12 -12
  28. package/dist/components/ChartAnalytics/utils/chart.js.map +1 -1
  29. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js +3 -3
  30. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -1
  31. package/dist/components/CircularProgressDashboard/index.js +6 -6
  32. package/dist/components/CircularProgressDashboard/index.js.map +1 -1
  33. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js +10 -10
  34. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -1
  35. package/dist/components/DHIS2PivotTable/components/TableBody/index.js +8 -8
  36. package/dist/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -1
  37. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js +5 -5
  38. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -1
  39. package/dist/components/DHIS2PivotTable/index.js +6 -6
  40. package/dist/components/DHIS2PivotTable/index.js.map +1 -1
  41. package/dist/components/DHIS2PivotTable/services/engine.js +0 -6
  42. package/dist/components/DHIS2PivotTable/services/engine.js.map +1 -1
  43. package/dist/components/DHIS2PivotTable/state/engine.js.map +1 -1
  44. package/dist/components/Map/DHIS2Map.js +3 -3
  45. package/dist/components/Map/DHIS2Map.js.map +1 -1
  46. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js +2 -2
  47. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -1
  48. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js +10 -10
  49. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -1
  50. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js +2 -2
  51. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -1
  52. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js +11 -11
  53. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -1
  54. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js +2 -2
  55. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -1
  56. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js +3 -3
  57. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -1
  58. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js +4 -4
  59. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -1
  60. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js +3 -3
  61. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -1
  62. package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +8 -8
  63. package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -1
  64. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js +6 -6
  65. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -1
  66. package/dist/components/Map/components/MapArea/index.js +42 -27
  67. package/dist/components/Map/components/MapArea/index.js.map +1 -1
  68. package/dist/components/Map/components/MapControls/index.js +16 -4
  69. package/dist/components/Map/components/MapControls/index.js.map +1 -1
  70. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +2 -2
  71. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -1
  72. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js +5 -5
  73. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -1
  74. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +49 -14
  75. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js.map +1 -1
  76. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +26 -8
  77. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js.map +1 -1
  78. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +2 -2
  79. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -1
  80. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +8 -8
  81. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -1
  82. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31468 -0
  83. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
  84. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +56 -34
  85. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map +1 -1
  86. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +33 -22
  87. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -1
  88. package/dist/components/Map/components/MapLayer/components/LegendArea/index.js +10 -10
  89. package/dist/components/Map/components/MapLayer/components/LegendArea/index.js.map +1 -1
  90. package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +22 -8
  91. package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js.map +1 -1
  92. package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +2 -2
  93. package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -1
  94. package/dist/components/Map/components/MapLayer/components/PointLayer/index.js +5 -5
  95. package/dist/components/Map/components/MapLayer/components/PointLayer/index.js.map +1 -1
  96. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +34 -6
  97. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js.map +1 -1
  98. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +28 -9
  99. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js.map +1 -1
  100. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +2 -2
  101. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js.map +1 -1
  102. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +5 -5
  103. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js.map +1 -1
  104. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +18 -4
  105. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js.map +1 -1
  106. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +9 -6
  107. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js.map +1 -1
  108. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +2 -2
  109. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js.map +1 -1
  110. package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +2 -2
  111. package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -1
  112. package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js +3 -3
  113. package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js.map +1 -1
  114. package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +56 -0
  115. package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css.map +1 -0
  116. package/dist/components/Map/components/MapLayer/index.js +5 -5
  117. package/dist/components/Map/components/MapLayer/index.js.map +1 -1
  118. package/dist/components/Map/components/MapLayer/interfaces/index.js +6 -1
  119. package/dist/components/Map/components/MapLayer/interfaces/index.js.map +1 -1
  120. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +24 -24
  121. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -1
  122. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js +9 -9
  123. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -1
  124. package/dist/components/Map/components/MapProvider/hooks/index.js +4 -4
  125. package/dist/components/Map/components/MapProvider/hooks/index.js.map +1 -1
  126. package/dist/components/Map/components/MapProvider/index.js +7 -7
  127. package/dist/components/Map/components/MapProvider/index.js.map +1 -1
  128. package/dist/components/Map/components/MapUpdater/index.js +2 -2
  129. package/dist/components/Map/components/MapUpdater/index.js.map +1 -1
  130. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js +2 -2
  131. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -1
  132. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js +12 -12
  133. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -1
  134. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +16 -4
  135. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -1
  136. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +6 -6
  137. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -1
  138. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +13 -5
  139. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -1
  140. package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +5 -5
  141. package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -1
  142. package/dist/components/Map/components/ThematicLayerConfiguration/index.js +9 -9
  143. package/dist/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -1
  144. package/dist/components/Map/hooks/map.js +2 -2
  145. package/dist/components/Map/hooks/map.js.map +1 -1
  146. package/dist/components/Map/index.js +15 -15
  147. package/dist/components/Map/index.js.map +1 -1
  148. package/dist/components/Map/state/index.js.map +1 -1
  149. package/dist/components/Map/utils/colors.js +13 -5
  150. package/dist/components/Map/utils/colors.js.map +1 -1
  151. package/dist/components/Map/utils/map.js +18 -7
  152. package/dist/components/Map/utils/map.js.map +1 -1
  153. package/dist/components/SingleValueContainer/SingleValueVisualizer.js +4 -4
  154. package/dist/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -1
  155. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +1 -1
  156. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -1
  157. package/dist/components/SingleValueContainer/index.js +13 -6
  158. package/dist/components/SingleValueContainer/index.js.map +1 -1
  159. package/dist/components/Visualization/components/AnalyticsDataProvider/index.js +39 -12
  160. package/dist/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -1
  161. package/dist/components/Visualization/components/LayoutProvider/index.js +5 -4
  162. package/dist/components/Visualization/components/LayoutProvider/index.js.map +1 -1
  163. package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js +6 -6
  164. package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -1
  165. package/dist/components/Visualization/components/VisualizationProvider/index.js +12 -6
  166. package/dist/components/Visualization/components/VisualizationProvider/index.js.map +1 -1
  167. package/dist/components/Visualization/components/VisualizationSelector/index.js +17 -17
  168. package/dist/components/Visualization/components/VisualizationSelector/index.js.map +1 -1
  169. package/dist/components/Visualization/components/VisualizationTypeProvider/index.js +5 -1
  170. package/dist/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -1
  171. package/dist/components/Visualization/components/VisualizationTypeSelector/index.js +25 -9
  172. package/dist/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -1
  173. package/dist/components/Visualization/index.js +8 -8
  174. package/dist/components/Visualization/index.js.map +1 -1
  175. package/dist/{components/ChartAnalytics/ChartAnalytics.stories.mjs → esm/components/ChartAnalytics/ChartAnalytics.stories.js} +1 -1
  176. package/dist/esm/components/ChartAnalytics/ChartAnalytics.stories.js.map +1 -0
  177. package/dist/{components/ChartAnalytics/DHIS2Chart.mjs → esm/components/ChartAnalytics/DHIS2Chart.js} +5 -5
  178. package/dist/esm/components/ChartAnalytics/DHIS2Chart.js.map +1 -0
  179. package/dist/{components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs → esm/components/ChartAnalytics/components/DownloadMenu/components/Menu.js} +2 -2
  180. package/dist/esm/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -0
  181. package/dist/{components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs → esm/components/ChartAnalytics/components/DownloadMenu/constants/menu.js} +1 -1
  182. package/dist/esm/components/ChartAnalytics/components/DownloadMenu/constants/menu.js.map +1 -0
  183. package/dist/{components/ChartAnalytics/components/DownloadMenu/index.mjs → esm/components/ChartAnalytics/components/DownloadMenu/index.js} +3 -3
  184. package/dist/esm/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -0
  185. package/dist/{components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs → esm/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js} +1 -1
  186. package/dist/{components/ChartAnalytics/hooks/useChart.mjs → esm/components/ChartAnalytics/hooks/useChart.js} +2 -2
  187. package/dist/esm/components/ChartAnalytics/hooks/useChart.js.map +1 -0
  188. package/dist/esm/components/ChartAnalytics/index.js +3 -0
  189. package/dist/esm/components/ChartAnalytics/index.js.map +1 -0
  190. package/dist/{components/ChartAnalytics/models/bar.mjs → esm/components/ChartAnalytics/models/bar.js} +2 -2
  191. package/dist/esm/components/ChartAnalytics/models/bar.js.map +1 -0
  192. package/dist/{components/ChartAnalytics/models/column.mjs → esm/components/ChartAnalytics/models/column.js} +3 -3
  193. package/dist/esm/components/ChartAnalytics/models/column.js.map +1 -0
  194. package/dist/{components/ChartAnalytics/models/index.mjs → esm/components/ChartAnalytics/models/index.js} +1 -4
  195. package/dist/esm/components/ChartAnalytics/models/index.js.map +1 -0
  196. package/dist/{components/ChartAnalytics/models/line.mjs → esm/components/ChartAnalytics/models/line.js} +3 -3
  197. package/dist/esm/components/ChartAnalytics/models/line.js.map +1 -0
  198. package/dist/{components/ChartAnalytics/models/multi-series.mjs → esm/components/ChartAnalytics/models/multi-series.js} +21 -8
  199. package/dist/esm/components/ChartAnalytics/models/multi-series.js.map +1 -0
  200. package/dist/{components/ChartAnalytics/models/pie.mjs → esm/components/ChartAnalytics/models/pie.js} +5 -3
  201. package/dist/esm/components/ChartAnalytics/models/pie.js.map +1 -0
  202. package/dist/{components/ChartAnalytics/services/export.mjs → esm/components/ChartAnalytics/services/export.js} +4 -4
  203. package/dist/esm/components/ChartAnalytics/services/export.js.map +1 -0
  204. package/dist/esm/components/ChartAnalytics/styles/custom-highchart.css +40 -0
  205. package/dist/esm/components/ChartAnalytics/styles/custom-highchart.css.map +1 -0
  206. package/dist/esm/components/ChartAnalytics/types/props.js +3 -0
  207. package/dist/{components/ChartAnalytics/utils/chart.mjs → esm/components/ChartAnalytics/utils/chart.js} +6 -6
  208. package/dist/esm/components/ChartAnalytics/utils/chart.js.map +1 -0
  209. package/dist/{components/CircularProgressDashboard/CircularProgressIndicator.mjs → esm/components/CircularProgressDashboard/CircularProgressIndicator.js} +2 -2
  210. package/dist/esm/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -0
  211. package/dist/{components/CircularProgressDashboard/CircularProgressIndicator.stories.mjs → esm/components/CircularProgressDashboard/CircularProgressIndicator.stories.js} +1 -1
  212. package/dist/esm/components/CircularProgressDashboard/CircularProgressIndicator.stories.js.map +1 -0
  213. package/dist/esm/components/CircularProgressDashboard/index.js +4 -0
  214. package/dist/esm/components/CircularProgressDashboard/index.js.map +1 -0
  215. package/dist/esm/components/CircularProgressDashboard/types/props.js +3 -0
  216. package/dist/{components/DHIS2PivotTable/DHIS2PivotTable.mjs → esm/components/DHIS2PivotTable/DHIS2PivotTable.js} +6 -6
  217. package/dist/esm/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -0
  218. package/dist/{components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs → esm/components/DHIS2PivotTable/DHIS2PivotTable.stories.js} +1 -1
  219. package/dist/esm/components/DHIS2PivotTable/DHIS2PivotTable.stories.js.map +1 -0
  220. package/dist/{components/DHIS2PivotTable/components/Table/index.mjs → esm/components/DHIS2PivotTable/components/Table/index.js} +1 -1
  221. package/dist/esm/components/DHIS2PivotTable/components/Table/index.js.map +1 -0
  222. package/dist/esm/components/DHIS2PivotTable/components/TableBody/TableBody.module.css +11 -0
  223. package/dist/esm/components/DHIS2PivotTable/components/TableBody/TableBody.module.css.map +1 -0
  224. package/dist/{components/DHIS2PivotTable/components/TableBody/index.mjs → esm/components/DHIS2PivotTable/components/TableBody/index.js} +2 -2
  225. package/dist/esm/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -0
  226. package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css +10 -0
  227. package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css.map +1 -0
  228. package/dist/{components/DHIS2PivotTable/components/TableHeaders/index.mjs → esm/components/DHIS2PivotTable/components/TableHeaders/index.js} +2 -2
  229. package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -0
  230. package/dist/esm/components/DHIS2PivotTable/index.js +4 -0
  231. package/dist/esm/components/DHIS2PivotTable/index.js.map +1 -0
  232. package/dist/esm/components/DHIS2PivotTable/interfaces/index.js +3 -0
  233. package/dist/{components/DHIS2PivotTable/services/engine.mjs → esm/components/DHIS2PivotTable/services/engine.js} +1 -7
  234. package/dist/esm/components/DHIS2PivotTable/services/engine.js.map +1 -0
  235. package/dist/{components/DHIS2PivotTable/state/engine.mjs → esm/components/DHIS2PivotTable/state/engine.js} +1 -1
  236. package/dist/esm/components/DHIS2PivotTable/state/engine.js.map +1 -0
  237. package/dist/{components/Map/DHIS2Map.mjs → esm/components/Map/DHIS2Map.js} +3 -3
  238. package/dist/esm/components/Map/DHIS2Map.js.map +1 -0
  239. package/dist/{components/Map/DHIS2Map.stories.mjs → esm/components/Map/DHIS2Map.stories.js} +1 -1
  240. package/dist/esm/components/Map/DHIS2Map.stories.js.map +1 -0
  241. package/dist/{components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js} +2 -2
  242. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -0
  243. package/dist/{components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js} +1 -1
  244. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js.map +1 -0
  245. package/dist/{components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js} +6 -6
  246. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -0
  247. package/dist/{components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js} +1 -1
  248. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js.map +1 -0
  249. package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js} +2 -2
  250. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -0
  251. package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js} +3 -3
  252. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -0
  253. package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/Name.js} +2 -2
  254. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -0
  255. package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js} +2 -2
  256. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -0
  257. package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js} +3 -3
  258. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -0
  259. package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js} +2 -2
  260. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -0
  261. package/dist/{components/Map/components/EarthEngineLayerConfiguration/hooks/data.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js} +4 -4
  262. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -0
  263. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/index.js +4 -0
  264. package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -0
  265. package/dist/{components/Map/components/MapArea/index.mjs → esm/components/Map/components/MapArea/index.js} +41 -26
  266. package/dist/esm/components/Map/components/MapArea/index.js.map +1 -0
  267. package/dist/esm/components/Map/components/MapArea/interfaces/index.js +3 -0
  268. package/dist/{components/Map/components/MapControls/components/CustomControl/index.mjs → esm/components/Map/components/MapControls/components/CustomControl/index.js} +1 -1
  269. package/dist/esm/components/Map/components/MapControls/components/CustomControl/index.js.map +1 -0
  270. package/dist/{components/Map/components/MapControls/components/DownloadControl/index.mjs → esm/components/Map/components/MapControls/components/DownloadControl/index.js} +1 -1
  271. package/dist/esm/components/Map/components/MapControls/components/DownloadControl/index.js.map +1 -0
  272. package/dist/{components/Map/components/MapControls/components/FullscreenControl/index.mjs → esm/components/Map/components/MapControls/components/FullscreenControl/index.js} +1 -1
  273. package/dist/esm/components/Map/components/MapControls/components/FullscreenControl/index.js.map +1 -0
  274. package/dist/{components/Map/components/MapControls/index.mjs → esm/components/Map/components/MapControls/index.js} +17 -5
  275. package/dist/esm/components/Map/components/MapControls/index.js.map +1 -0
  276. package/dist/{components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs → esm/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js} +2 -2
  277. package/dist/esm/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -0
  278. package/dist/{components/Map/components/MapLayer/components/BoundaryLayer/index.mjs → esm/components/Map/components/MapLayer/components/BoundaryLayer/index.js} +3 -3
  279. package/dist/esm/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -0
  280. package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js} +50 -15
  281. package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js.map +1 -0
  282. package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js} +27 -9
  283. package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js.map +1 -0
  284. package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js} +2 -2
  285. package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -0
  286. package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/index.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js} +5 -5
  287. package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -0
  288. package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +3 -0
  289. package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31466 -0
  290. package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
  291. package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js} +29 -23
  292. package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map +1 -0
  293. package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js} +34 -23
  294. package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -0
  295. package/dist/esm/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +10 -0
  296. package/dist/esm/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css.map +1 -0
  297. package/dist/{components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.mjs → esm/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js} +1 -1
  298. package/dist/esm/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js.map +1 -0
  299. package/dist/{components/Map/components/MapLayer/components/LegendArea/index.mjs → esm/components/Map/components/MapLayer/components/LegendArea/index.js} +8 -8
  300. package/dist/esm/components/Map/components/MapLayer/components/LegendArea/index.js.map +1 -0
  301. package/dist/{components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.mjs → esm/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js} +20 -6
  302. package/dist/esm/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js.map +1 -0
  303. package/dist/{components/Map/components/MapLayer/components/PointLayer/hooks/index.mjs → esm/components/Map/components/MapLayer/components/PointLayer/hooks/index.js} +2 -2
  304. package/dist/esm/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -0
  305. package/dist/{components/Map/components/MapLayer/components/PointLayer/index.mjs → esm/components/Map/components/MapLayer/components/PointLayer/index.js} +3 -3
  306. package/dist/esm/components/Map/components/MapLayer/components/PointLayer/index.js.map +1 -0
  307. package/dist/{components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js} +33 -5
  308. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js.map +1 -0
  309. package/dist/{components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js} +27 -8
  310. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js.map +1 -0
  311. package/dist/{components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js} +3 -3
  312. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js.map +1 -0
  313. package/dist/{components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js} +3 -3
  314. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js.map +1 -0
  315. package/dist/{components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js} +19 -5
  316. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js.map +1 -0
  317. package/dist/{components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js} +7 -4
  318. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js.map +1 -0
  319. package/dist/{components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js} +2 -2
  320. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js.map +1 -0
  321. package/dist/{components/Map/components/MapLayer/components/ThematicLayer/hooks/config.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js} +2 -2
  322. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -0
  323. package/dist/{components/Map/components/MapLayer/components/ThematicLayer/index.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/index.js} +4 -4
  324. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/index.js.map +1 -0
  325. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +56 -0
  326. package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css.map +1 -0
  327. package/dist/{components/Map/components/MapLayer/index.mjs → esm/components/Map/components/MapLayer/index.js} +5 -5
  328. package/dist/esm/components/Map/components/MapLayer/index.js.map +1 -0
  329. package/dist/esm/components/Map/components/MapLayer/interfaces/index.js +10 -0
  330. package/dist/esm/components/Map/components/MapLayer/interfaces/index.js.map +1 -0
  331. package/dist/{components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.mjs → esm/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js} +8 -8
  332. package/dist/esm/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -0
  333. package/dist/{components/Map/components/MapProvider/components/MapLayerProvider/index.mjs → esm/components/Map/components/MapProvider/components/MapLayerProvider/index.js} +4 -4
  334. package/dist/esm/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -0
  335. package/dist/{components/Map/components/MapProvider/hooks/index.mjs → esm/components/Map/components/MapProvider/hooks/index.js} +2 -2
  336. package/dist/esm/components/Map/components/MapProvider/hooks/index.js.map +1 -0
  337. package/dist/{components/Map/components/MapProvider/index.mjs → esm/components/Map/components/MapProvider/index.js} +3 -3
  338. package/dist/esm/components/Map/components/MapProvider/index.js.map +1 -0
  339. package/dist/{components/Map/components/MapUpdater/index.mjs → esm/components/Map/components/MapUpdater/index.js} +2 -2
  340. package/dist/esm/components/Map/components/MapUpdater/index.js.map +1 -0
  341. package/dist/{components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs → esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js} +2 -2
  342. package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -0
  343. package/dist/{components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs → esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js} +1 -1
  344. package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js.map +1 -0
  345. package/dist/{components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs → esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js} +7 -7
  346. package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -0
  347. package/dist/{components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs → esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js} +1 -1
  348. package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js.map +1 -0
  349. package/dist/{components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js} +16 -4
  350. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -0
  351. package/dist/{components/Map/constants/colors.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js} +1 -1
  352. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js.map +1 -0
  353. package/dist/{components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js} +3 -3
  354. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -0
  355. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +15 -0
  356. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css.map +1 -0
  357. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +12 -0
  358. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css.map +1 -0
  359. package/dist/{components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js} +13 -5
  360. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -0
  361. package/dist/{components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js} +3 -3
  362. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -0
  363. package/dist/{components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js} +1 -1
  364. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js.map +1 -0
  365. package/dist/{components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js} +1 -1
  366. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js.map +1 -0
  367. package/dist/{components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js} +1 -1
  368. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js.map +1 -0
  369. package/dist/{components/Map/components/ThematicLayerConfiguration/components/TypeField.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/TypeField.js} +1 -1
  370. package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/TypeField.js.map +1 -0
  371. package/dist/esm/components/Map/components/ThematicLayerConfiguration/index.js +5 -0
  372. package/dist/esm/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -0
  373. package/dist/esm/components/Map/components/ThematicLayerConfiguration/types/index.js +3 -0
  374. package/dist/{components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.mjs → esm/components/Map/constants/colors.js} +1 -1
  375. package/dist/esm/components/Map/constants/colors.js.map +1 -0
  376. package/dist/{components/Map/constants/legendSet.mjs → esm/components/Map/constants/legendSet.js} +1 -1
  377. package/dist/esm/components/Map/constants/legendSet.js.map +1 -0
  378. package/dist/{components/Map/hooks/map.mjs → esm/components/Map/hooks/map.js} +2 -2
  379. package/dist/esm/components/Map/hooks/map.js.map +1 -0
  380. package/dist/esm/components/Map/index.js +7 -0
  381. package/dist/esm/components/Map/index.js.map +1 -0
  382. package/dist/esm/components/Map/interfaces/index.js +3 -0
  383. package/dist/{components/Map/state/index.mjs → esm/components/Map/state/index.js} +1 -1
  384. package/dist/esm/components/Map/state/index.js.map +1 -0
  385. package/dist/{components/Map/utils/colors.mjs → esm/components/Map/utils/colors.js} +13 -5
  386. package/dist/esm/components/Map/utils/colors.js.map +1 -0
  387. package/dist/{components/Map/utils/helpers.mjs → esm/components/Map/utils/helpers.js} +1 -1
  388. package/dist/esm/components/Map/utils/helpers.js.map +1 -0
  389. package/dist/{components/Map/utils/map.mjs → esm/components/Map/utils/map.js} +16 -5
  390. package/dist/esm/components/Map/utils/map.js.map +1 -0
  391. package/dist/{components/SingleValueContainer/SingleValueContainer.stories.mjs → esm/components/SingleValueContainer/SingleValueContainer.stories.js} +1 -1
  392. package/dist/esm/components/SingleValueContainer/SingleValueContainer.stories.js.map +1 -0
  393. package/dist/{components/SingleValueContainer/SingleValueVisualizer.mjs → esm/components/SingleValueContainer/SingleValueVisualizer.js} +4 -4
  394. package/dist/esm/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -0
  395. package/dist/{components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs → esm/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js} +2 -2
  396. package/dist/esm/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -0
  397. package/dist/{components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.mjs → esm/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js} +1 -1
  398. package/dist/esm/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js.map +1 -0
  399. package/dist/esm/components/SingleValueContainer/index.js +5 -0
  400. package/dist/esm/components/SingleValueContainer/index.js.map +1 -0
  401. package/dist/esm/components/SingleValueContainer/styles/SingleValueContainer.module.css +32 -0
  402. package/dist/esm/components/SingleValueContainer/styles/SingleValueContainer.module.css.map +1 -0
  403. package/dist/esm/components/SingleValueContainer/types/props.js +3 -0
  404. package/dist/{components/Visualization/components/AnalyticsDataProvider/index.mjs → esm/components/Visualization/components/AnalyticsDataProvider/index.js} +38 -11
  405. package/dist/esm/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -0
  406. package/dist/{components/Visualization/components/DimensionsProvider/index.mjs → esm/components/Visualization/components/DimensionsProvider/index.js} +1 -1
  407. package/dist/esm/components/Visualization/components/DimensionsProvider/index.js.map +1 -0
  408. package/dist/{components/Visualization/components/LayoutProvider/index.mjs → esm/components/Visualization/components/LayoutProvider/index.js} +6 -5
  409. package/dist/esm/components/Visualization/components/LayoutProvider/index.js.map +1 -0
  410. package/dist/{components/Visualization/components/VisualizationDimensionSelector/index.mjs → esm/components/Visualization/components/VisualizationDimensionSelector/index.js} +4 -4
  411. package/dist/esm/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -0
  412. package/dist/{components/Visualization/components/VisualizationProvider/index.mjs → esm/components/Visualization/components/VisualizationProvider/index.js} +12 -6
  413. package/dist/esm/components/Visualization/components/VisualizationProvider/index.js.map +1 -0
  414. package/dist/{components/Visualization/components/VisualizationSelector/index.mjs → esm/components/Visualization/components/VisualizationSelector/index.js} +8 -8
  415. package/dist/esm/components/Visualization/components/VisualizationSelector/index.js.map +1 -0
  416. package/dist/{components/Visualization/components/VisualizationTypeProvider/index.mjs → esm/components/Visualization/components/VisualizationTypeProvider/index.js} +6 -2
  417. package/dist/esm/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -0
  418. package/dist/{components/Visualization/components/VisualizationTypeSelector/index.mjs → esm/components/Visualization/components/VisualizationTypeSelector/index.js} +24 -8
  419. package/dist/esm/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -0
  420. package/dist/{components/Visualization/index.mjs → esm/components/Visualization/index.js} +5 -5
  421. package/dist/esm/components/Visualization/index.js.map +1 -0
  422. package/dist/esm/index.js +8 -0
  423. package/dist/esm/index.js.map +1 -0
  424. package/dist/index.js +18 -18
  425. package/dist/index.js.map +1 -1
  426. package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts +4 -4
  427. package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts.map +1 -1
  428. package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +2 -2
  429. package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts.map +1 -1
  430. package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts +2 -2
  431. package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts.map +1 -1
  432. package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts +1 -1
  433. package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts.map +1 -1
  434. package/dist/types/components/ChartAnalytics/index.d.ts +1 -1
  435. package/dist/types/components/ChartAnalytics/index.d.ts.map +1 -1
  436. package/dist/types/components/ChartAnalytics/models/bar.d.ts +1 -1
  437. package/dist/types/components/ChartAnalytics/models/bar.d.ts.map +1 -1
  438. package/dist/types/components/ChartAnalytics/models/column.d.ts +1 -1
  439. package/dist/types/components/ChartAnalytics/models/column.d.ts.map +1 -1
  440. package/dist/types/components/ChartAnalytics/models/index.d.ts +1 -1
  441. package/dist/types/components/ChartAnalytics/models/index.d.ts.map +1 -1
  442. package/dist/types/components/ChartAnalytics/models/line.d.ts +1 -1
  443. package/dist/types/components/ChartAnalytics/models/line.d.ts.map +1 -1
  444. package/dist/types/components/ChartAnalytics/models/multi-series.d.ts +1 -1
  445. package/dist/types/components/ChartAnalytics/models/multi-series.d.ts.map +1 -1
  446. package/dist/types/components/ChartAnalytics/models/pie.d.ts +1 -1
  447. package/dist/types/components/ChartAnalytics/models/pie.d.ts.map +1 -1
  448. package/dist/types/components/ChartAnalytics/services/export.d.ts.map +1 -1
  449. package/dist/types/components/ChartAnalytics/utils/chart.d.ts +2 -2
  450. package/dist/types/components/ChartAnalytics/utils/chart.d.ts.map +1 -1
  451. package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts +2 -2
  452. package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts.map +1 -1
  453. package/dist/types/components/CircularProgressDashboard/index.d.ts +2 -2
  454. package/dist/types/components/CircularProgressDashboard/index.d.ts.map +1 -1
  455. package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts +2 -2
  456. package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts.map +1 -1
  457. package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts +1 -1
  458. package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts.map +1 -1
  459. package/dist/types/components/DHIS2PivotTable/index.d.ts +2 -2
  460. package/dist/types/components/DHIS2PivotTable/index.d.ts.map +1 -1
  461. package/dist/types/components/DHIS2PivotTable/services/engine.d.ts +1 -1
  462. package/dist/types/components/DHIS2PivotTable/services/engine.d.ts.map +1 -1
  463. package/dist/types/components/DHIS2PivotTable/state/engine.d.ts +2 -2
  464. package/dist/types/components/DHIS2PivotTable/state/engine.d.ts.map +1 -1
  465. package/dist/types/components/Map/DHIS2Map.d.ts +1 -1
  466. package/dist/types/components/Map/DHIS2Map.d.ts.map +1 -1
  467. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts +2 -2
  468. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts.map +1 -1
  469. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts +1 -1
  470. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts.map +1 -1
  471. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts +1 -1
  472. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts.map +1 -1
  473. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts +1 -1
  474. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts.map +1 -1
  475. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts +1 -1
  476. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts.map +1 -1
  477. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts +1 -1
  478. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts.map +1 -1
  479. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts +1 -1
  480. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts.map +1 -1
  481. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts +1 -1
  482. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts.map +1 -1
  483. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +2 -2
  484. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts.map +1 -1
  485. package/dist/types/components/Map/components/MapArea/index.d.ts +1 -1
  486. package/dist/types/components/Map/components/MapArea/index.d.ts.map +1 -1
  487. package/dist/types/components/Map/components/MapControls/index.d.ts +2 -2
  488. package/dist/types/components/Map/components/MapControls/index.d.ts.map +1 -1
  489. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +1 -1
  490. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts.map +1 -1
  491. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +2 -2
  492. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts.map +1 -1
  493. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +2 -2
  494. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts.map +1 -1
  495. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +1 -1
  496. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts.map +1 -1
  497. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +2 -2
  498. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts.map +1 -1
  499. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +1 -1
  500. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts.map +1 -1
  501. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +1 -1
  502. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts.map +1 -1
  503. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +2 -2
  504. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts.map +1 -1
  505. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +2 -2
  506. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts.map +1 -1
  507. package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts +3 -3
  508. package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts.map +1 -1
  509. package/dist/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts.map +1 -1
  510. package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +1 -1
  511. package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts.map +1 -1
  512. package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +1 -1
  513. package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts.map +1 -1
  514. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +1 -1
  515. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts.map +1 -1
  516. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +2 -2
  517. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts.map +1 -1
  518. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +1 -1
  519. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts.map +1 -1
  520. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +2 -2
  521. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts.map +1 -1
  522. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +1 -1
  523. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts.map +1 -1
  524. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +4 -4
  525. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts.map +1 -1
  526. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +2 -2
  527. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts.map +1 -1
  528. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +1 -1
  529. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts.map +1 -1
  530. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +1 -1
  531. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts.map +1 -1
  532. package/dist/types/components/Map/components/MapLayer/index.d.ts +2 -2
  533. package/dist/types/components/Map/components/MapLayer/index.d.ts.map +1 -1
  534. package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts +4 -4
  535. package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts.map +1 -1
  536. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +2 -2
  537. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts.map +1 -1
  538. package/dist/types/components/Map/components/MapProvider/hooks/index.d.ts +3 -3
  539. package/dist/types/components/Map/components/MapProvider/index.d.ts +2 -2
  540. package/dist/types/components/Map/components/MapProvider/index.d.ts.map +1 -1
  541. package/dist/types/components/Map/components/MapUpdater/index.d.ts +1 -1
  542. package/dist/types/components/Map/components/MapUpdater/index.d.ts.map +1 -1
  543. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts +2 -2
  544. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts.map +1 -1
  545. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +1 -1
  546. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts.map +1 -1
  547. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +1 -1
  548. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts.map +1 -1
  549. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +1 -1
  550. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts.map +1 -1
  551. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +1 -1
  552. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts.map +1 -1
  553. package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +3 -3
  554. package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts.map +1 -1
  555. package/dist/types/components/Map/hooks/map.d.ts.map +1 -1
  556. package/dist/types/components/Map/index.d.ts +5 -5
  557. package/dist/types/components/Map/index.d.ts.map +1 -1
  558. package/dist/types/components/Map/interfaces/index.d.ts +2 -2
  559. package/dist/types/components/Map/interfaces/index.d.ts.map +1 -1
  560. package/dist/types/components/Map/state/index.d.ts +2 -2
  561. package/dist/types/components/Map/state/index.d.ts.map +1 -1
  562. package/dist/types/components/Map/utils/colors.d.ts +1 -1
  563. package/dist/types/components/Map/utils/colors.d.ts.map +1 -1
  564. package/dist/types/components/Map/utils/map.d.ts.map +1 -1
  565. package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts +3 -3
  566. package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts.map +1 -1
  567. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +1 -1
  568. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts.map +1 -1
  569. package/dist/types/components/SingleValueContainer/index.d.ts +3 -2
  570. package/dist/types/components/SingleValueContainer/index.d.ts.map +1 -1
  571. package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts +1 -1
  572. package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts.map +1 -1
  573. package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts +2 -2
  574. package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts.map +1 -1
  575. package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts +1 -1
  576. package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts.map +1 -1
  577. package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts +4 -4
  578. package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts.map +1 -1
  579. package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts +10 -10
  580. package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts.map +1 -1
  581. package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts +2 -2
  582. package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts.map +1 -1
  583. package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts +1 -1
  584. package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts.map +1 -1
  585. package/dist/types/components/Visualization/index.d.ts +6 -6
  586. package/dist/types/components/Visualization/index.d.ts.map +1 -1
  587. package/dist/types/index.d.ts +6 -6
  588. package/dist/types/index.d.ts.map +1 -1
  589. package/package.json +5 -5
  590. package/dist/components/ChartAnalytics/ChartAnalytics.stories.mjs.map +0 -1
  591. package/dist/components/ChartAnalytics/DHIS2Chart.mjs.map +0 -1
  592. package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs.map +0 -1
  593. package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs.map +0 -1
  594. package/dist/components/ChartAnalytics/components/DownloadMenu/index.mjs.map +0 -1
  595. package/dist/components/ChartAnalytics/hooks/useChart.mjs.map +0 -1
  596. package/dist/components/ChartAnalytics/index.mjs +0 -3
  597. package/dist/components/ChartAnalytics/index.mjs.map +0 -1
  598. package/dist/components/ChartAnalytics/models/bar.mjs.map +0 -1
  599. package/dist/components/ChartAnalytics/models/column.mjs.map +0 -1
  600. package/dist/components/ChartAnalytics/models/index.mjs.map +0 -1
  601. package/dist/components/ChartAnalytics/models/line.mjs.map +0 -1
  602. package/dist/components/ChartAnalytics/models/multi-series.mjs.map +0 -1
  603. package/dist/components/ChartAnalytics/models/pie.mjs.map +0 -1
  604. package/dist/components/ChartAnalytics/services/export.mjs.map +0 -1
  605. package/dist/components/ChartAnalytics/types/props.mjs +0 -3
  606. package/dist/components/ChartAnalytics/utils/chart.mjs.map +0 -1
  607. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.mjs.map +0 -1
  608. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.mjs.map +0 -1
  609. package/dist/components/CircularProgressDashboard/index.mjs +0 -4
  610. package/dist/components/CircularProgressDashboard/index.mjs.map +0 -1
  611. package/dist/components/CircularProgressDashboard/types/props.mjs +0 -3
  612. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.mjs.map +0 -1
  613. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs.map +0 -1
  614. package/dist/components/DHIS2PivotTable/components/Table/index.mjs.map +0 -1
  615. package/dist/components/DHIS2PivotTable/components/TableBody/index.mjs.map +0 -1
  616. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.mjs.map +0 -1
  617. package/dist/components/DHIS2PivotTable/index.mjs +0 -4
  618. package/dist/components/DHIS2PivotTable/index.mjs.map +0 -1
  619. package/dist/components/DHIS2PivotTable/interfaces/index.mjs +0 -3
  620. package/dist/components/DHIS2PivotTable/services/engine.mjs.map +0 -1
  621. package/dist/components/DHIS2PivotTable/state/engine.mjs.map +0 -1
  622. package/dist/components/Map/DHIS2Map.mjs.map +0 -1
  623. package/dist/components/Map/DHIS2Map.stories.mjs.map +0 -1
  624. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs.map +0 -1
  625. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs.map +0 -1
  626. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs.map +0 -1
  627. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs.map +0 -1
  628. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs.map +0 -1
  629. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs.map +0 -1
  630. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs.map +0 -1
  631. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs.map +0 -1
  632. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs.map +0 -1
  633. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs.map +0 -1
  634. package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.mjs.map +0 -1
  635. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.mjs +0 -4
  636. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.mjs.map +0 -1
  637. package/dist/components/Map/components/MapArea/index.mjs.map +0 -1
  638. package/dist/components/Map/components/MapArea/interfaces/index.mjs +0 -3
  639. package/dist/components/Map/components/MapControls/components/CustomControl/index.mjs.map +0 -1
  640. package/dist/components/Map/components/MapControls/components/DownloadControl/index.mjs.map +0 -1
  641. package/dist/components/Map/components/MapControls/components/FullscreenControl/index.mjs.map +0 -1
  642. package/dist/components/Map/components/MapControls/index.mjs.map +0 -1
  643. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs.map +0 -1
  644. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.mjs.map +0 -1
  645. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.mjs.map +0 -1
  646. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.mjs.map +0 -1
  647. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.mjs.map +0 -1
  648. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.mjs.map +0 -1
  649. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.mjs +0 -3
  650. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.mjs.map +0 -1
  651. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.mjs.map +0 -1
  652. package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.mjs.map +0 -1
  653. package/dist/components/Map/components/MapLayer/components/LegendArea/index.mjs.map +0 -1
  654. package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.mjs.map +0 -1
  655. package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.mjs.map +0 -1
  656. package/dist/components/Map/components/MapLayer/components/PointLayer/index.mjs.map +0 -1
  657. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.mjs.map +0 -1
  658. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.mjs.map +0 -1
  659. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.mjs.map +0 -1
  660. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.mjs.map +0 -1
  661. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.mjs.map +0 -1
  662. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.mjs.map +0 -1
  663. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.mjs.map +0 -1
  664. package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.mjs.map +0 -1
  665. package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.mjs.map +0 -1
  666. package/dist/components/Map/components/MapLayer/index.mjs.map +0 -1
  667. package/dist/components/Map/components/MapLayer/interfaces/index.mjs +0 -5
  668. package/dist/components/Map/components/MapLayer/interfaces/index.mjs.map +0 -1
  669. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.mjs.map +0 -1
  670. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.mjs.map +0 -1
  671. package/dist/components/Map/components/MapProvider/hooks/index.mjs.map +0 -1
  672. package/dist/components/Map/components/MapProvider/index.mjs.map +0 -1
  673. package/dist/components/Map/components/MapUpdater/index.mjs.map +0 -1
  674. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs.map +0 -1
  675. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs.map +0 -1
  676. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs.map +0 -1
  677. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs.map +0 -1
  678. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.mjs.map +0 -1
  679. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.mjs.map +0 -1
  680. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs.map +0 -1
  681. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs.map +0 -1
  682. package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs.map +0 -1
  683. package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs.map +0 -1
  684. package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs.map +0 -1
  685. package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs.map +0 -1
  686. package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.mjs.map +0 -1
  687. package/dist/components/Map/components/ThematicLayerConfiguration/index.mjs +0 -5
  688. package/dist/components/Map/components/ThematicLayerConfiguration/index.mjs.map +0 -1
  689. package/dist/components/Map/components/ThematicLayerConfiguration/types/index.mjs +0 -3
  690. package/dist/components/Map/constants/colors.mjs.map +0 -1
  691. package/dist/components/Map/constants/legendSet.mjs.map +0 -1
  692. package/dist/components/Map/hooks/map.mjs.map +0 -1
  693. package/dist/components/Map/index.mjs +0 -7
  694. package/dist/components/Map/index.mjs.map +0 -1
  695. package/dist/components/Map/interfaces/index.mjs +0 -3
  696. package/dist/components/Map/state/index.mjs.map +0 -1
  697. package/dist/components/Map/utils/colors.mjs.map +0 -1
  698. package/dist/components/Map/utils/helpers.mjs.map +0 -1
  699. package/dist/components/Map/utils/map.mjs.map +0 -1
  700. package/dist/components/SingleValueContainer/SingleValueContainer.stories.mjs.map +0 -1
  701. package/dist/components/SingleValueContainer/SingleValueVisualizer.mjs.map +0 -1
  702. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs.map +0 -1
  703. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.mjs.map +0 -1
  704. package/dist/components/SingleValueContainer/index.mjs +0 -4
  705. package/dist/components/SingleValueContainer/index.mjs.map +0 -1
  706. package/dist/components/SingleValueContainer/types/props.mjs +0 -3
  707. package/dist/components/Visualization/components/AnalyticsDataProvider/index.mjs.map +0 -1
  708. package/dist/components/Visualization/components/DimensionsProvider/index.mjs.map +0 -1
  709. package/dist/components/Visualization/components/LayoutProvider/index.mjs.map +0 -1
  710. package/dist/components/Visualization/components/VisualizationDimensionSelector/index.mjs.map +0 -1
  711. package/dist/components/Visualization/components/VisualizationProvider/index.mjs.map +0 -1
  712. package/dist/components/Visualization/components/VisualizationSelector/index.mjs.map +0 -1
  713. package/dist/components/Visualization/components/VisualizationTypeProvider/index.mjs.map +0 -1
  714. package/dist/components/Visualization/components/VisualizationTypeSelector/index.mjs.map +0 -1
  715. package/dist/components/Visualization/index.mjs.map +0 -1
  716. package/dist/index.mjs +0 -8
  717. package/dist/index.mjs.map +0 -1
  718. /package/dist/{components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs.map → esm/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js.map} +0 -0
  719. /package/dist/{components/ChartAnalytics/types/props.mjs.map → esm/components/ChartAnalytics/types/props.js.map} +0 -0
  720. /package/dist/{components/CircularProgressDashboard/types/props.mjs.map → esm/components/CircularProgressDashboard/types/props.js.map} +0 -0
  721. /package/dist/{components/DHIS2PivotTable/interfaces/index.mjs.map → esm/components/DHIS2PivotTable/interfaces/index.js.map} +0 -0
  722. /package/dist/{components/Map/components/MapArea/interfaces/index.mjs.map → esm/components/Map/components/MapArea/interfaces/index.js.map} +0 -0
  723. /package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.mjs.map → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js.map} +0 -0
  724. /package/dist/{components/Map/components/ThematicLayerConfiguration/types/index.mjs.map → esm/components/Map/components/ThematicLayerConfiguration/types/index.js.map} +0 -0
  725. /package/dist/{components/Map/interfaces/index.mjs.map → esm/components/Map/interfaces/index.js.map} +0 -0
  726. /package/dist/{components/SingleValueContainer/types/props.mjs.map → esm/components/SingleValueContainer/types/props.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/hooks/data.ts"],"names":[],"mappings":"AACA,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,2BAA2B;AAE7B,SAAS,eACf,WACA,QACC;AACD,QAAM,EAAE,QAAQ,IAAI,qBAAqB;AAEzC,iBAAe,UAAU;AACxB,QAAI,QAAQ;AACX,YAAM,YAAY,MAAM,QAAQ;AAChC,YAAM,YAAY,SAAS,UAAU,OAAO,OAAO;AACnD,YAAM,SAAS,IAAI,YAAY;AAAA,QAC9B,SAAS;AAAA,MACV,CAAC;AACD,aAAO,OAAO,UAAU;AAAA,IACzB;AAAA,EACD;AAEA,QAAM,EAAE,MAAM,OAAO,UAAU,IAAI,SAAS,CAAC,MAAM,GAAG,OAAO;AAE7D,QAAM,UAAU,QAAQ,MAAM;AAC7B,UAAM,WAAY,MAAc;AAChC,WAAO,UAAU,IAAI,CAAC,YAAiB;AACtC,aAAO,IAAI;AAAA,QACV,SAAS,WAAW,mBAAmB;AAAA,MACxC,GAAG,YAAY;AAAA,IAChB,CAAC;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AAET,SAAO;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,UAAU;AACzB,QAAM,OAAO,SAAS;AAAA,IACrB,MAAM;AAAA,EACP,CAAC;AACD,SAAO,KAAK,qBAAqB,CAAC,MAAM,IAAI,CAAC;AAC9C","sourcesContent":["import { EarthEngineOptions } from \"../../MapLayer/components/GoogleEngineLayer/interfaces\";\nimport { useGoogleEngineToken } from \"../../MapLayer/components/GoogleEngineLayer/hooks\";\nimport { EarthEngine } from \"../../MapLayer/components/GoogleEngineLayer/services/engine\";\nimport { useQuery } from \"react-query\";\nimport { useMemo } from \"react\";\nimport { useWatch } from \"react-hook-form\";\nimport { find } from \"lodash\";\nimport { EARTH_ENGINE_LAYERS } from \"../../MapLayer/components/GoogleEngineLayer/constants\";\n\nexport function useDatasetInfo(\n\tshouldRun: boolean,\n\tconfig?: EarthEngineOptions,\n) {\n\tconst { refresh } = useGoogleEngineToken();\n\n\tasync function getInfo() {\n\t\tif (config) {\n\t\t\tconst tokenData = await refresh();\n\t\t\tawait EarthEngine.setToken(tokenData.token, refresh);\n\t\t\tconst engine = new EarthEngine({\n\t\t\t\toptions: config,\n\t\t\t});\n\t\t\treturn engine.getPeriod();\n\t\t}\n\t}\n\n\tconst { data, error, isLoading } = useQuery([config], getInfo);\n\n\tconst periods = useMemo(() => {\n\t\tconst features = (data as any)?.features;\n\t\treturn features?.map((feature: any) => {\n\t\t\treturn new Date(\n\t\t\t\tfeature?.properties[\"system:time_start\"],\n\t\t\t)?.getFullYear();\n\t\t});\n\t}, [data]);\n\n\treturn {\n\t\tloading: isLoading,\n\t\terror: error as any,\n\t\tperiods,\n\t};\n}\n\nexport function useType() {\n\tconst type = useWatch({\n\t\tname: \"type\",\n\t});\n\treturn find(EARTH_ENGINE_LAYERS, [\"id\", type]);\n}\n"]}
@@ -1,4 +0,0 @@
1
- export * from './EarthEngineLayerConfigModal';
2
- export * from './EarthEngineLayerConfiguration';
3
- //# sourceMappingURL=out.js.map
4
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/EarthEngineLayerConfiguration/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,cAAc","sourcesContent":["export * from \"./EarthEngineLayerConfigModal\";\nexport * from \"./EarthEngineLayerConfiguration\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/MapArea/index.tsx"],"names":[],"mappings":"AAgCE,mBACC,KADD;AAhCF,SAAS,WAAW;AAEpB,SAAS,eAAe;A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MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA,oBAAkB;AAAA,MAClB;AAAA,MACA,OAAO,EAAE,QAAQ,QAAQ,OAAO,QAAQ,WAAW,IAAI;AAAA,MAEvD,aAAW;AAAA,MACV,GAAG;AAAA,MACJ;AAAA,4BAAC,cAAW,QAAgB;AAAA,QAC5B,oBAAC,qBAAkB,QACjB,8BAAC,gBAAa,MAAY,IAAQ,UAAoB,SAAkB,GAC1E;AAAA;AAAA;AAAA,IANK;AAAA,EAOP,GACF;AAEJ;AAEA,IAAO,kBAAQ,WAAW,OAAO","sourcesContent":["import { uid } from \"@hisptz/dhis2-utils\";\nimport { Map as LeafletMap } from \"leaflet\";\nimport { isEmpty } from \"lodash\";\nimport React, { forwardRef, useRef } from \"react\";\nimport { LayersControl, MapContainer, TileLayer } from \"react-leaflet\";\nimport { useMapBounds } from \"../../hooks/map\";\nimport MapControl from \"../MapControls\";\nimport MapLayer from \"../MapLayer\";\nimport LegendArea from \"../MapLayer/components/LegendArea\";\nimport { CustomThematicLayer } from \"../MapLayer/interfaces\";\nimport { MapLayersProvider } from \"../MapProvider/components/MapLayerProvider\";\nimport { useMapLayers } from \"../MapProvider/hooks\";\nimport { MapAreaProps, MapControls, MapLegendConfig } from \"./interfaces\";\nimport MapUpdater from \"../MapUpdater\";\n\nfunction MapLayerArea({\n\tid,\n\tbase,\n\tcontrols,\n\tlegends,\n}: {\n\tid: string;\n\tbase?: {\n\t\turl: string;\n\t\tattribution: string;\n\t};\n\tcontrols?: MapControls[];\n\tlegends?: MapLegendConfig;\n}) {\n\tconst { layers } = useMapLayers();\n\n\treturn (\n\t\t<>\n\t\t\t<TileLayer\n\t\t\t\tid={id}\n\t\t\t\tattribution={\n\t\t\t\t\tbase?.attribution ??\n\t\t\t\t\t'&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> | &copy; <a href=\"https://carto.com/attribution\">CARTO</a>'\n\t\t\t\t}\n\t\t\t\turl={\n\t\t\t\t\tbase?.url ??\n\t\t\t\t\t\"https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png\"\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{controls?.map((control) => (\n\t\t\t\t<MapControl\n\t\t\t\t\tmapId={id}\n\t\t\t\t\tkey={`${control.type}-control`}\n\t\t\t\t\t{...control}\n\t\t\t\t/>\n\t\t\t))}\n\t\t\t{!isEmpty(layers) && (\n\t\t\t\t<LayersControl hideSingleBase position={\"topleft\"}>\n\t\t\t\t\t{(layers as CustomThematicLayer[]).map(\n\t\t\t\t\t\t(layer: CustomThematicLayer, index) => (\n\t\t\t\t\t\t\t<MapLayer\n\t\t\t\t\t\t\t\tkey={layer.id}\n\t\t\t\t\t\t\t\tlayer={layer}\n\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t)}\n\t\t\t\t</LayersControl>\n\t\t\t)}\n\t\t\t{!isEmpty(layers) && (\n\t\t\t\t<LegendArea\n\t\t\t\t\tlegends={legends}\n\t\t\t\t\tlayers={layers as CustomThematicLayer[]}\n\t\t\t\t\tposition={\"topright\"}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nconst MapArea = ({ base, controls, mapOptions, key, legends, layers }: MapAreaProps, ref: React.Ref<LeafletMap> | undefined) => {\n const { center, bounds } = useMapBounds();\n const { current: id } = useRef<string>(uid());\n\n return (\n <div id={`${id}-\"map-container`} style={{ height: \"100%\", width: \"100%\" }}>\n <MapContainer\n attributionControl\n ref={ref}\n id={id}\n center={center}\n bounceAtZoomLimits\n bounds={bounds}\n style={{ height: \"100%\", width: \"100%\", minHeight: 500 }}\n key={key}\n trackResize\n {...mapOptions}>\n <MapUpdater bounds={bounds} />\n <MapLayersProvider layers={layers}>\n <MapLayerArea base={base} id={id} controls={controls} legends={legends} />\n </MapLayersProvider>\n </MapContainer>\n </div>\n );\n};\n\nexport default forwardRef(MapArea);\n"]}
@@ -1,3 +0,0 @@
1
-
2
- //# sourceMappingURL=out.js.map
3
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapControls/components/CustomControl/index.tsx"],"names":[],"mappings":"AAkBM;AAfN,MAAM,mBAAmB;AAAA,EACxB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,SAAS;AAAA,EACT,UAAU;AACX;AAMO,SAAS,cAAc,EAAE,UAAU,UAAU,GAAG,QAAQ,GAAyB;AACtF,QAAM,gBAAiB,YAAY,iBAAiB,QAAQ,KAAM,iBAAiB;AACnF,SACE,oBAAC,SAAK,GAAG,SAAS,WAAW,GAAG,aAAa,IAC3C,8BAAC,SAAI,OAAO,EAAE,UAAU,UAAU,QAAQ,OAAO,GAAG,WAAU,+BAC3D,UACH,GACF;AAEJ","sourcesContent":["import { ControlOptions } from \"leaflet\";\nimport React from \"react\";\n\nconst POSITION_CLASSES = {\n\tbottomleft: \"leaflet-bottom leaflet-left\",\n\tbottomright: \"leaflet-bottom leaflet-right\",\n\ttopleft: \"leaflet-top leaflet-left\",\n\ttopright: \"leaflet-top leaflet-right\",\n};\n\ninterface CustomControlOptions extends ControlOptions {\n children: React.ReactNode;\n}\n\nexport function CustomControl({ children, position, ...options }: CustomControlOptions) {\n const positionClass = (position && POSITION_CLASSES[position]) || POSITION_CLASSES.topright;\n return (\n <div {...options} className={`${positionClass}`}>\n <div style={{ overflow: \"hidden\", border: \"none\" }} className=\"leaflet-control leaflet-bar\">\n {children}\n </div>\n </div>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapControls/components/DownloadControl/index.tsx"],"names":[],"mappings":"AASS;AATT,SAAS,8BAA8B;AACvC,OAAO,OAA4B;AACnC,OAAO;AAGP,MAAM,2BAA2B,uBAAuB,CAAC,UAAU;AAClE,SAAQ,EAAU,UAAU,KAAK;AAClC,CAAC;AACc,SAAR,gBAAiC,EAAE,SAAS,UAAU,MAAM,GAA+D;AAChI,SAAO,oBAAC,4BAA0B,GAAG,EAAE,GAAG,SAAS,SAAS,GAAG;AACjE","sourcesContent":["import { createControlComponent } from \"@react-leaflet/core\";\nimport L, { ControlPosition } from \"leaflet\";\nimport \"leaflet-easyprint\";\nimport React from \"react\";\n\nconst DownloadControlComponent = createControlComponent((props) => {\n\treturn (L as any).easyPrint(props);\n});\nexport default function DownloadControl({ options, position, mapId }: { options: any; position: ControlPosition; mapId: string }) {\n return <DownloadControlComponent {...{ ...options, position }} />;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapControls/components/FullscreenControl/index.tsx"],"names":[],"mappings":"AAAA,SAAS,8BAA8B;AACvC,SAAS,eAAe;AACxB,OAAO;AACP,OAAO;AAEP,MAAM,oBAAoB;AAAA,EAAuB,CAAC,UAChD,QAAgB,WAAW,KAAK;AAClC;AACA,IAAO,4BAAQ","sourcesContent":["import { createControlComponent } from \"@react-leaflet/core\";\nimport { control } from \"leaflet\";\nimport \"leaflet.fullscreen\";\nimport \"leaflet.fullscreen/Control.FullScreen.css\";\n\nconst FullscreenControl = createControlComponent((props) =>\n\t(control as any).fullscreen(props),\n);\nexport default FullscreenControl;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/MapControls/index.tsx"],"names":[],"mappings":"AAaa;AAZb,SAAS,cAAc,mBAAmB;AAE1C,OAAO,uBAAuB;AAC9B,OAAO,qBAAqB;AAMb,SAAR,WAA4B,EAAE,MAAM,SAAS,UAAU,MAAM,GAAoB;AACtF,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO,oBAAC,eAAY,UAAqB,GAAG,SAAS;AAAA,IACvD,KAAK;AACH,aAAO,oBAAC,gBAAa,UAAqB,GAAG,SAAS;AAAA,IACxD,KAAK;AACH,aAAO,oBAAC,qBAAkB,UAAqB,GAAG,SAAS;AAAA,IAC7D,KAAK;AACH,aAAO,oBAAC,mBAAgB,OAAc,UAAoB,SAAkB;AAAA,IAC9E;AACE,aAAO;AAAA,EACX;AACF","sourcesContent":["import React from \"react\";\nimport { ScaleControl, ZoomControl } from \"react-leaflet\";\nimport { MapControls } from \"../MapArea/interfaces\";\nimport FullscreenControl from \"./components/FullscreenControl\";\nimport DownloadControl from \"./components/DownloadControl\";\n\nexport interface MapControlProps extends MapControls {\n\tmapId: string;\n}\n\nexport default function MapControl({ type, options, position, mapId }: MapControlProps) {\n switch (type) {\n case \"zoom\":\n return <ZoomControl position={position} {...options} />;\n case \"scale\":\n return <ScaleControl position={position} {...options} />;\n case \"fullscreen\":\n return <FullscreenControl position={position} {...options} />;\n case \"print\":\n return <DownloadControl mapId={mapId} position={position} options={options} />;\n default:\n return null;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.ts"],"names":[],"mappings":"AAAA,SAAS,8BAA8B;AAEhC,SAAS,kBAAkB;AACjC,QAAM,EAAE,SAAS,IAAI,uBAAuB;AAE5C,SAAO;AACR","sourcesContent":["import { useMapOrganisationUnit } from \"../../../../MapProvider/hooks\";\n\nexport function useBoundaryData() {\n\tconst { orgUnits } = useMapOrganisationUnit();\n\n\treturn orgUnits;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapLayer/components/BoundaryLayer/index.tsx"],"names":[],"mappings":"AA8Cc,cAGE,YAHF;AA9Cd,OAAO,UAAU;AACjB,SAAS,cAAc;AAEvB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,SAAS,kBAAkB,sBAAsB;AAEjD,SAAS,uBAAuB;AAEzB,MAAM,eAAe;AAAA,EAC3B,QAAQ;AAAA,EACR,OAAO,OAAO;AAAA,EACd,WAAW,OAAO;AAAA,EAClB,aAAa;AACd;AACO,MAAM,iBAAiB;AAAA,EAC5B,QAAQ;AAAA,EACR,OAAO,OAAO;AAAA,EACd,WAAW;AAAA,EACX,aAAa;AACf;AAEe,SAAR,cAA+B,OAA+B;AACnE,QAAM,EAAE,QAAQ,IAAI,SAAS,CAAC;AAC9B,QAAM,WAAW,gBAAgB;AAEjC,SACE,oBAAC,cAAc,SAAd,EAAsB,SAAS,SAAS,MAAM,KAAK,EAAE,YAAY,GAChE,8BAAC,cACE,oBAAU,IAAI,CAAC,SAAqB;AACnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,KAAK;AAAA,QACX,aAAW;AAAA,QACX,eAAe;AAAA,UACb,WAAW,CAAC,MAAM,iBAAiB,GAAG,cAAc;AAAA,UACpD,UAAU,CAAC,MAAM,eAAe,GAAG,YAAY;AAAA,QACjD;AAAA,QAEA,aAAa;AAAA,QACb;AAAA,8BAAC,WAAS,eAAK,MAAK;AAAA,UACpB,qBAAC,SAAM,UAAU,IACf;AAAA,gCAAC,QAAI,eAAK,MAAK;AAAA,YACf,qBAAC,SACC;AAAA,kCAAC,OAAE,qBAAO;AAAA,cACT,KAAK;AAAA,eACR;AAAA,aACF;AAAA;AAAA;AAAA,MATK,GAAG,KAAK,EAAE;AAAA,IAUjB;AAAA,EAEJ,CAAC,GACH,GACF;AAEJ","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { colors } from \"@dhis2/ui\";\nimport React from \"react\";\nimport {\n\tGeoJSON,\n\tLayerGroup,\n\tLayersControl,\n\tPopup,\n\tTooltip,\n} from \"react-leaflet\";\nimport { MapOrgUnit } from \"../../../../interfaces\";\nimport { highlightFeature, resetHighlight } from \"../../../../utils/map\";\nimport { CustomBoundaryLayer as BoundaryLayerInterface } from \"../../interfaces\";\nimport { useBoundaryData } from \"./hooks/useBoundaryData\";\n\nexport const defaultStyle = {\n\tweight: 1,\n\tcolor: colors.grey900,\n\tfillColor: colors.grey900,\n\tfillOpacity: 0.0,\n};\nexport const highlightStyle = {\n weight: 2,\n color: colors.grey900,\n dashArray: \"\",\n fillOpacity: 0.1,\n};\n\nexport default function BoundaryLayer(props: BoundaryLayerInterface) {\n const { enabled } = props ?? {};\n const orgUnits = useBoundaryData();\n\n return (\n <LayersControl.Overlay checked={enabled} name={i18n.t(\"Boundaries\")}>\n <LayerGroup>\n {orgUnits?.map((area: MapOrgUnit) => {\n return (\n <GeoJSON\n data={area.geoJSON}\n interactive\n eventHandlers={{\n mouseover: (e) => highlightFeature(e, highlightStyle),\n mouseout: (e) => resetHighlight(e, defaultStyle),\n }}\n key={`${area.id}-polygon`}\n pathOptions={defaultStyle}>\n <Tooltip>{area.name}</Tooltip>\n <Popup minWidth={80}>\n <h3>{area.name}</h3>\n <div>\n <b>Level: </b>\n {area.level}\n </div>\n </Popup>\n </GeoJSON>\n );\n })}\n </LayerGroup>\n </LayersControl.Overlay>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.tsx"],"names":["min","max"],"mappings":"AAaE,SACC,KADD;AAbF,SAAgB,kBAAkB;AAClC,OAAO,sBAAsB;AAE7B,SAAS,eAAe;AACxB,OAAO,UAAU;AACjB,SAAS,eAAe;AAEjB,SAAS,WAAW;AAAA,EAC1B;AACD,GAEG;AACF,SACC,qBAAC,SAAI,WAAU,eACd;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,OAAO,EAAE,iBAAiB,OAAO,MAAM;AAAA;AAAA,IACxC;AAAA,IACC,OAAO,OACP,oBAAC,SAAI,WAAU,qBAAqB,aAAG,OAAO,IAAI,IAAG,IAErD,oBAAC,SAAI,WAAU,qBAAqB,aAAG,OAAO,GAAG,MAAM,OAAO,GAAG,IAAG;AAAA,KAEtE;AAEF;AAEA,SAAS,qBAAqB,QAAmE;AAC/F,MAAI,CAAC;AAAQ,WAAO,CAAC;AAErB,QAAM,EAAE,SAAS,KAAK,IAAI,IAAI;AAC9B,QAAM,mBAAm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BAAe,eAAc,MAAM,SAAS,WACnF,mBAAS,UAAU,IACtB;AAAA,OACF;AAAA,KAEJ;AAEJ;AAEA,IAAO,4BAAQ,WAAW,iBAAiB","sourcesContent":["import React, { forwardRef } from \"react\";\nimport LegendCardHeader from \"../../LegendArea/components/LegendCardHeader\";\nimport { CustomGoogleEngineLayer } from \"../../../interfaces\";\nimport { Divider } from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { isEmpty } from \"lodash\";\n\nexport function LegendItem({\n\tlegend,\n}: {\n\tlegend: { min: number; max: number; color: string; name?: string };\n}) {\n\treturn (\n\t\t<div className=\"legend-item\">\n\t\t\t<div\n\t\t\t\tclassName=\"legend-item-color\"\n\t\t\t\tstyle={{ backgroundColor: legend.color }}\n\t\t\t/>\n\t\t\t{legend.name ? (\n\t\t\t\t<div className=\"legend-item-label\">{`${legend.name}`}</div>\n\t\t\t) : (\n\t\t\t\t<div className=\"legend-item-label\">{`${legend.min} - ${legend.max}`}</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction getLegendsFromParams(params?: { min: number; max: number; palette: string | string[] }) {\n if (!params) return [];\n\n const { palette, min, max } = params;\n const sanitizedPalette = Array.isArray(palette) ? palette : palette.split(\",\");\n const classes = sanitizedPalette.length;\n const difference = max - min;\n const interval = Math.round(difference / classes);\n const legends = [];\n for (let i = 0; i < classes; i++) {\n const min = i * interval;\n const max = min + interval;\n\n const name = i === classes - 1 ? `> ${min}` : undefined;\n\n legends.push({\n id: sanitizedPalette[i],\n color: sanitizedPalette[i],\n min,\n max,\n name,\n });\n }\n\n return legends;\n}\n\nfunction EarthEngineLegend(\n { layer, collapsible, onCollapse, name }: { layer: CustomGoogleEngineLayer; collapsible?: boolean; onCollapse?: () => void; name: string },\n ref: React.LegacyRef<HTMLDivElement>\n) {\n const { options } = layer;\n const legends = options?.legend?.items ?? getLegendsFromParams(options?.params);\n\n return (\n <div style={{ maxWidth: 200, alignItems: \"start\", gap: 8 }} className=\"legend-card\" ref={ref}>\n <LegendCardHeader title={name} collapsible={collapsible} onCollapse={onCollapse} />\n <Divider margin={\"0\"} />\n <p style={{ margin: 0 }}>{options?.description ?? \"\"}</p>\n {!isEmpty(legends) && <b>{options?.unit ?? \"\"}</b>}\n <div className=\"legend-list\">\n {legends?.map((legend: any) => (\n <LegendItem key={`${legend?.color}-legend-list`} legend={legend} />\n ))}\n </div>\n {options?.source && (\n <div className=\"row gap-8\">\n {i18n.t(\"Source\")}:\n <a className=\"source-url\" target=\"_blank\" referrerPolicy=\"no-referrer\" href={options?.sourceUrl}>\n {options?.source ?? \"\"}\n </a>\n </div>\n )}\n </div>\n );\n}\n\nexport default forwardRef(EarthEngineLegend);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU;AAGV,MAAM,qBAAqB;AAE3B,MAAM,sBAA4C;AAAA,EACvD;AAAA,IACE,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,WAAW;AAAA,IACX,MAAM;AAAA,IACN,MAAM,KAAK,EAAE,YAAY;AAAA,IACzB,MAAM,KAAK,EAAE,oBAAoB;AAAA,IACjC,aAAa,KAAK,EAAE,+CAA+C;AAAA,IACnE,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,KAAK;AAAA,IACL,qBAAqB,CAAC,OAAO,MAAM;AAAA,IACnC,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS,CAAC,QAAQ;AAAA,IAClB,QAAQ;AAAA,IACR,QAAQ;AAAA,MACN,KAAK;AAAA,MACL,KAAK;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,IACX,IAAI;AAAA,IACJ,WAAW;AAAA,IACX,MAAM,KAAK,EAAE,uBAAuB;AAAA,IACp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A,MACF;AAAA,IACF;AAAA,IACA,MAAM;AAAA,IACN,KAAK;AAAA,IACL,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA,IACX,QAAQ;AAAA;AAAA,IACR,WAAW;AAAA,IACX,MAAM,KAAK,EAAE,kBAAkB;AAAA,IAC/B,MAAM,KAAK,EAAE,iBAAiB;AAAA,IAC9B,aAAa,KAAK,EAAE,qGAAqG;AAAA,IACzH,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,eAAe,CAAC,eAAe;AAAA,IAC/B,MAAM;AAAA,IACN,KAAK;AAAA,IACL,QAAQ;AAAA,MACN,KAAK;AAAA,MACL,KAAK;AAAA,MACL,SAAS;AAAA;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACX;AACF;AAEO,MAAM,gCAAgC,CAAC,cAAc,aAAa,YAAY","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { EarthEngineOptions } from \"../interfaces\";\n\nexport const EARTH_ENGINE_LAYER = \"earthEngine\";\n\nexport const EARTH_ENGINE_LAYERS: EarthEngineOptions[] = [\n {\n layer: EARTH_ENGINE_LAYER,\n id: \"population\",\n datasetId: \"WorldPop/GP/100m/pop\",\n type: \"ImageCollection\",\n name: i18n.t(\"Population\"),\n unit: i18n.t(\"people per hectare\"),\n description: i18n.t(\"Estimated number of people living in an area.\"),\n source: \"WorldPop / Google Earth Engine\",\n sourceUrl: \"https://developers.google.com/earth-engine/datasets/catalog/WorldPop_GP_100m_pop\",\n img: \"images/population.png\",\n defaultAggregations: [\"sum\", \"mean\"],\n tokenType: \"Bearer\",\n periodType: \"Yearly\",\n filters: [\"period\"],\n mosaic: true,\n params: {\n min: 0,\n max: 10,\n palette: \"#fee5d9,#fcbba1,#fc9272,#fb6a4a,#de2d26,#a50f15\", // Reds\n },\n opacity: 0.9,\n },\n {\n layer: EARTH_ENGINE_LAYER,\n type: \"ImageCollection\",\n tokenType: \"Bearer\",\n id: \"populationAgeGroups\",\n datasetId: \"WorldPop/GP/100m/pop_age_sex_cons_unadj\",\n name: i18n.t(\"Population age groups\"),\n unit: i18n.t(\"people per hectare\"),\n description: i18n.t(\"Estimated number of people living in an area, grouped by age and gender.\"),\n source: \"WorldPop / Google Earth Engine\",\n sourceUrl: \"https://developers.google.com/earth-engine/datasets/catalog/WorldPop_GP_100m_pop_age_sex_cons_unadj\",\n img: \"images/population.png\",\n periodType: \"Yearly\",\n defaultAggregations: [\"sum\", \"mean\"],\n bands: [\n {\n id: \"M_0\",\n name: i18n.t(\"Male 0 - 1 years\"),\n },\n {\n id: \"M_1\",\n name: i18n.t(\"Male 1 - 4 years\"),\n },\n {\n id: \"M_5\",\n name: i18n.t(\"Male 5 - 9 years\"),\n },\n {\n id: \"M_10\",\n name: i18n.t(\"Male 10 - 14 years\"),\n },\n {\n id: \"M_15\",\n name: i18n.t(\"Male 15 - 19 years\"),\n },\n {\n id: \"M_20\",\n name: i18n.t(\"Male 20 - 24 years\"),\n },\n {\n id: \"M_25\",\n name: i18n.t(\"Male 25 - 29 years\"),\n },\n {\n id: \"M_30\",\n name: i18n.t(\"Male 30 - 34 years\"),\n },\n {\n id: \"M_35\",\n name: i18n.t(\"Male 35 - 39 years\"),\n },\n {\n id: \"M_40\",\n name: i18n.t(\"Male 40 - 44 years\"),\n },\n {\n id: \"M_45\",\n name: i18n.t(\"Male 45 - 49 years\"),\n },\n {\n id: \"M_50\",\n name: i18n.t(\"Male 50 - 54 years\"),\n },\n {\n id: \"M_55\",\n name: i18n.t(\"Male 55 - 59 years\"),\n },\n {\n id: \"M_60\",\n name: i18n.t(\"Male 60 - 64 years\"),\n },\n {\n id: \"M_65\",\n name: i18n.t(\"Male 65 - 69 years\"),\n },\n {\n id: \"M_70\",\n name: i18n.t(\"Male 70 - 74 years\"),\n },\n {\n id: \"M_75\",\n name: i18n.t(\"Male 75 - 79 years\"),\n },\n {\n id: \"M_80\",\n name: i18n.t(\"Male 80 years and above\"),\n },\n {\n id: \"F_0\",\n name: i18n.t(\"Female 0 - 1 years\"),\n },\n {\n id: \"F_1\",\n name: i18n.t(\"Female 1 - 4 years\"),\n },\n {\n id: \"F_5\",\n name: i18n.t(\"Female 5 - 9 years\"),\n },\n {\n id: \"F_10\",\n name: i18n.t(\"Female 10 - 14 years\"),\n },\n {\n id: \"F_15\",\n name: i18n.t(\"Female 15 - 19 years\"),\n },\n {\n id: \"F_20\",\n name: i18n.t(\"Female 20 - 24 years\"),\n },\n {\n id: \"F_25\",\n name: i18n.t(\"Female 25 - 29 years\"),\n },\n {\n id: \"F_30\",\n name: i18n.t(\"Female 30 - 34 years\"),\n },\n {\n id: \"F_35\",\n name: i18n.t(\"Female 35 - 39 years\"),\n },\n {\n id: \"F_40\",\n name: i18n.t(\"Female 40 - 44 years\"),\n },\n {\n id: \"F_45\",\n name: i18n.t(\"Female 45 - 49 years\"),\n },\n {\n id: \"F_50\",\n name: i18n.t(\"Female 50 - 54 years\"),\n },\n {\n id: \"F_55\",\n name: i18n.t(\"Female 55 - 59 years\"),\n },\n {\n id: \"F_60\",\n name: i18n.t(\"Female 60 - 64 years\"),\n },\n {\n id: \"F_65\",\n name: i18n.t(\"Female 65 - 69 years\"),\n },\n {\n id: \"F_70\",\n name: i18n.t(\"Female 70 - 74 years\"),\n multiple: true,\n },\n {\n id: \"F_75\",\n name: i18n.t(\"Female 75 - 79 years\"),\n },\n {\n id: \"F_80\",\n name: i18n.t(\"Female 80 years and above\"),\n },\n ],\n filters: [\"period\"],\n mosaic: true,\n params: {\n min: 0,\n max: 10,\n palette: \"#fee5d9,#fcbba1,#fc9272,#fb6a4a,#de2d26,#a50f15\", // Reds\n },\n opacity: 0.9,\n tileScale: 4,\n },\n {\n layer: EARTH_ENGINE_LAYER,\n id: \"footprints\",\n datasetId: \"GOOGLE/Research/open-buildings/v1/polygons\",\n type: \"FeatureCollection\",\n name: i18n.t(\"Building footprints\"),\n unit: i18n.t(\"Number of buildings\"),\n description: i18n.t(\"The outlines of buildings derived from high-resolution satellite imagery. Only for the continent of Africa.\"),\n notice: i18n.t(\"Building counts are only available for smaller organisation unit areas.\"),\n error: i18n.t(\"Select a smaller area or single organization unit to see the count of buildings.\"),\n source: \"NASA / USGS / JPL-Caltech / Google Earth Engine\",\n sourceUrl: \"https://sites.research.google/open-buildings/\",\n img: \"images/buildings.png\",\n aggregations: [\"count\"],\n defaultAggregations: [\"count\"],\n opacity: 0.9,\n tokenType: \"Bearer\",\n },\n {\n layer: EARTH_ENGINE_LAYER,\n id: \"elevation\",\n type: \"Image\",\n tokenType: \"Bearer\",\n datasetId: \"USGS/SRTMGL1_003\",\n name: i18n.t(\"Elevation\"),\n unit: i18n.t(\"meters\"),\n description: i18n.t(\"Elevation above sea-level.\"),\n source: \"NASA / USGS / JPL-Caltech / Google Earth Engine\",\n sourceUrl: \"https://explorer.earthengine.google.com/#detail/USGS%2FSRTMGL1_003\",\n img: \"images/elevation.png\",\n aggregations: [\"min\", \"max\", \"mean\", \"median\", \"stdDev\", \"variance\"],\n defaultAggregations: [\"mean\", \"min\", \"max\"],\n selectedBands: [\"elevation\"],\n params: {\n min: 0,\n max: 1500,\n palette: \"#ffffd4,#fee391,#fec44f,#fe9929,#d95f0e,#993404\", // YlOrBr\n },\n opacity: 0.9,\n },\n {\n layer: EARTH_ENGINE_LAYER,\n datasetId: \"UCSB-CHG/CHIRPS/PENTAD\",\n id: \"precipitation\",\n type: \"ImageCollection\",\n tokenType: \"Bearer\",\n name: i18n.t(\"Precipitation\"),\n unit: i18n.t(\"millimeter\"),\n description: i18n.t(\n \"Precipitation collected from satellite and weather stations on the ground. The values are in millimeters within 5 days periods. Updated monthly, during the 3rd week of the following month.\"\n ),\n source: \"UCSB / CHG / Google Earth Engine\",\n sourceUrl: \"https://explorer.earthengine.google.com/#detail/UCSB-CHG%2FCHIRPS%2FPENTAD\",\n periodType: \"Custom\",\n selectedBands: [\"precipitation\"],\n aggregations: [\"min\", \"max\", \"mean\", \"median\", \"stdDev\", \"variance\"],\n defaultAggregations: [\"mean\", \"min\", \"max\"],\n mask: true,\n img: \"images/precipitation.png\",\n params: {\n min: 0,\n max: 100,\n palette: \"#eff3ff,#c6dbef,#9ecae1,#6baed6,#3182bd,#08519c\", // Blues\n },\n opacity: 0.9,\n },\n {\n layer: EARTH_ENGINE_LAYER,\n datasetId: \"MODIS/006/MOD11A2\",\n id: \"temperature\",\n type: \"ImageCollection\",\n tokenType: \"Bearer\",\n name: i18n.t(\"Temperature\"),\n unit: i18n.t(\"°C during daytime\"),\n description: i18n.t(\"Land surface temperatures collected from satellite. Blank spots will appear in areas with a persistent cloud cover.\"),\n source: \"NASA LP DAAC / Google Earth Engine\",\n sourceUrl: \"https://explorer.earthengine.google.com/#detail/MODIS%2FMOD11A2\",\n img: \"images/temperature.png\",\n aggregations: [\"min\", \"max\", \"mean\", \"median\", \"stdDev\", \"variance\"],\n defaultAggregations: [\"mean\", \"min\", \"max\"],\n periodType: \"Custom\",\n selectedBands: [\"LST_Day_1km\"],\n mask: true,\n methods: {\n toFloat: [],\n multiply: [0.02],\n subtract: [273.15],\n },\n params: {\n min: 0,\n max: 40,\n palette: \"#fff5f0,#fee0d2,#fcbba1,#fc9272,#fb6a4a,#ef3b2c,#cb181d,#a50f15,#67000d\", // Reds\n },\n opacity: 0.9,\n },\n {\n layer: EARTH_ENGINE_LAYER,\n type: \"ImageCollection\",\n tokenType: \"Bearer\",\n id: \"landCover\",\n datasetId: \"MODIS/006/MCD12Q1\", // No longer in use: 'MODIS/051/MCD12Q1',\n name: i18n.t(\"Landcover\"),\n description: i18n.t(\"Distinct landcover types collected from satellites.\"),\n source: \"NASA LP DAAC / Google Earth Engine\",\n sourceUrl: \"https://developers.google.com/earth-engine/datasets/catalog/MODIS_006_MCD12Q1\",\n periodType: \"Yearly\",\n filters: [\"period\"],\n selectedBands: [\"LC_Type1\"],\n defaultAggregations: [\"percentage\", \"hectares\", \"acres\"],\n maxAggregations: 1,\n legend: {\n items: [\n // http://www.eomf.ou.edu/static/IGBP.pdf\n {\n id: 1,\n name: i18n.t(\"Evergreen Needleleaf forest\"),\n color: \"#162103\",\n },\n {\n id: 2,\n name: i18n.t(\"Evergreen Broadleaf forest\"),\n color: \"#235123\",\n },\n {\n id: 3,\n name: i18n.t(\"Deciduous Needleleaf forest\"),\n color: \"#399b38\",\n },\n {\n id: 4,\n name: i18n.t(\"Deciduous Broadleaf forest\"),\n color: \"#38eb38\",\n },\n {\n id: 5,\n name: i18n.t(\"Mixed forest\"),\n color: \"#39723b\",\n },\n {\n id: 6,\n name: i18n.t(\"Closed shrublands\"),\n color: \"#6a2424\",\n },\n {\n id: 7,\n name: i18n.t(\"Open shrublands\"),\n color: \"#c3a55f\",\n },\n {\n id: 8,\n name: i18n.t(\"Woody savannas\"),\n color: \"#b76124\",\n },\n {\n id: 9,\n name: i18n.t(\"Savannas\"),\n color: \"#d99125\",\n },\n {\n id: 10,\n name: i18n.t(\"Grasslands\"),\n color: \"#92af1f\",\n },\n {\n id: 11,\n name: i18n.t(\"Permanent wetlands\"),\n color: \"#10104c\",\n },\n {\n id: 12,\n name: i18n.t(\"Croplands\"),\n color: \"#cdb400\",\n },\n {\n id: 13,\n name: i18n.t(\"Urban and built-up\"),\n color: \"#cc0202\",\n },\n {\n id: 14,\n name: i18n.t(\"Cropland/Natural vegetation mosaic\"),\n color: \"#332808\",\n },\n {\n id: 15,\n name: i18n.t(\"Snow and ice\"),\n color: \"#d7cdcc\",\n },\n {\n id: 16,\n name: i18n.t(\"Barren or sparsely vegetated\"),\n color: \"#f7e174\",\n },\n {\n id: 17,\n name: i18n.t(\"Water\"),\n color: \"#aec3d6\",\n },\n ],\n },\n mask: false,\n img: \"images/landcover.png\",\n opacity: 0.9,\n },\n {\n layer: EARTH_ENGINE_LAYER,\n id: \"nightLights\",\n type: \"ImageCollection\",\n tokenType: \"Bearer\",\n legacy: true, // Kept for backward compability\n datasetId: \"NOAA/DMSP-OLS/NIGHTTIME_LIGHTS\",\n name: i18n.t(\"Nighttime lights\"),\n unit: i18n.t(\"light intensity\"),\n description: i18n.t(\"Light intensity from cities, towns, and other sites with persistent lighting, including gas flares.\"),\n source: \"NOAA / Google Earth Engine\",\n sourceUrl: \"https://explorer.earthengine.google.com/#detail/NOAA%2FDMSP-OLS%2FNIGHTTIME_LIGHTS\",\n periodType: \"Yearly\",\n selectedBands: [\"stable_lights\"],\n mask: true,\n img: \"images/nighttime.png\",\n params: {\n min: 0,\n max: 63,\n palette: \"#ffffd4,#fee391,#fec44f,#fe9929,#ec7014,#cc4c02,#8c2d04\", // YlOrBr\n },\n opacity: 0.9,\n },\n];\n\nexport const SUPPORTED_EARTH_ENGINE_LAYERS = [\"population\", \"landCover\", \"footprints\"];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.ts"],"names":[],"mappings":"AAAA,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAG7B,SAAS,gBAAgB;AAEzB,MAAM,uBAAuB;AAAA,EAC5B,OAAO;AAAA,IACN,UAAU;AAAA,EACX;AACD;AAEO,SAAS,uBAAuB;AACrC,QAAM,SAAS,cAAc;AAC7B,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAE5C,QAAM,WAAW,YAAY;AAC3B,eAAW,IAAI;AACf,UAAM,QAAQ,MAAM,OAAO,MAAM,oBAAoB;AACrD,eAAW,KAAK;AAChB,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT;AAAA,EACF;AACF;AAEe,SAAR,qBAAsC,SAAsD;AACjG,QAAM,EAAE,OAAO,IAAI,aAAa;AAChC,SAAO,KAAK,QAAqC,CAAC,MAAM,OAAO,CAAC;AAClE","sourcesContent":["import { useDataEngine } from \"@dhis2/app-runtime\";\nimport { find } from \"lodash\";\nimport { useMapLayers } from \"../../../../MapProvider/hooks\";\nimport { CustomGoogleEngineLayer } from \"../../../interfaces\";\nimport { EarthEngineToken } from \"../interfaces\";\nimport { useState } from \"react\";\n\nconst googleEngineKeyQuery = {\n\ttoken: {\n\t\tresource: \"tokens/google\",\n\t},\n};\n\nexport function useGoogleEngineToken() {\n const engine = useDataEngine();\n const [loading, setLoading] = useState(false);\n\n const getToken = async () => {\n setLoading(true);\n const token = await engine.query(googleEngineKeyQuery);\n setLoading(false);\n return token;\n };\n\n return {\n refresh: getToken as unknown as () => Promise<{ token: EarthEngineToken }>,\n loading,\n };\n}\n\nexport default function useGoogleEngineLayer(layerId: string): CustomGoogleEngineLayer | undefined {\n const { layers } = useMapLayers();\n return find(layers as CustomGoogleEngineLayer[], [\"id\", layerId]);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapLayer/components/GoogleEngineLayer/index.tsx"],"names":[],"mappings":"AA+CG,SACC,KADD;AA/CH,SAAS,YAAY,MAAM,MAAM,SAAS,cAAc;AACxD,SAAgB,SAAS,cAAc;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,uBAAuB;AAChC,OAAO,0BAA0B;AAEjC,SAAS,kBAAkB,sBAAsB;AACjD,SAAS,cAAc,sBAAsB;AAC7C,SAAS,gBAAgB;AACzB,SAAS,QAAQ,gBAAgB,eAAe;AAChD,OAAO,UAAU;AAGjB,SAAS,aAAa,OAAuB;AAC5C,SAAO,KAAK,aAAa,SAAS,EAAE,uBAAuB,EAAE,CAAC,EAAE;AAAA,IAC/D;AAAA,EACD;AACD;AAEA,SAAS,QAAQ,MAAe;AAC/B,MAAI,SAAS,cAAc;AAC1B,WAAO;AAAA,EACR;AACD;AAEA,SAAS,OAAO;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAKG;AACF,QAAM,SAAS,KAAK,SAAS,CAAC,MAAM,MAAM,CAAC;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A,OACE,OAAe,SAAS;AAAA,cAE1B,SAAS;AAAA,cAET;AAAA,cACA;AAAA;AAAA,YAFK,GAAG,KAAK,EAAE;AAAA,UAGhB;AAAA,QAEF,CAAC;AAAA,SACF;AAAA;AAAA,EACD;AAEF","sourcesContent":["import { capitalize, find, head, isEmpty, sortBy } from \"lodash\";\nimport React, { useMemo, useRef } from \"react\";\nimport {\n\tGeoJSON,\n\tLayerGroup,\n\tLayersControl,\n\tPopup,\n\tTileLayer,\n\tTooltip,\n} from \"react-leaflet\";\nimport { useBoundaryData } from \"../BoundaryLayer/hooks/useBoundaryData\";\nimport useGoogleEngineLayer from \"./hooks\";\nimport { MapOrgUnit } from \"../../../../interfaces\";\nimport { highlightFeature, resetHighlight } from \"../../../../utils/map\";\nimport { defaultStyle, highlightStyle } from \"../BoundaryLayer\";\nimport { useQuery } from \"react-query\";\nimport { Center, CircularLoader, Divider } from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { CustomGoogleEngineLayer } from \"../../interfaces\";\n\nfunction formatValues(value: number): string {\n\treturn Intl.NumberFormat(\"en-GB\", { maximumFractionDigits: 2 }).format(\n\t\tvalue,\n\t);\n}\n\nfunction getUnit(unit?: string) {\n\tif (unit === \"percentage\") {\n\t\treturn \"%\";\n\t}\n}\n\nfunction Legend({\n\theader,\n\tlegends,\n\tvalue,\n\tunit,\n}: {\n\theader: number;\n\tlegends: { id: number | string; color: string; name: string }[];\n\tvalue: number;\n\tunit?: string;\n}) {\n\tconst legend = find(legends, [\"id\", header]);\n\n\treturn (\n\t\t<div className=\"row gap-8 space-between\">\n\t\t\t<div className=\"row gap-8\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"legend-item-color\"\n\t\t\t\t\tstyle={{ backgroundColor: legend?.color }}\n\t\t\t\t/>\n\t\t\t\t<div>{legend?.name}</div>\n\t\t\t</div>\n\t\t\t<span>\n\t\t\t\t{formatValues(value)}\n\t\t\t\t{getUnit(unit)}\n\t\t\t</span>\n\t\t</div>\n\t);\n}\n\nfunction AggregationView({ header, value }: { header: string; value: number }) {\n\treturn (\n\t\t<div className=\"row space-between\">\n\t\t\t<span>{capitalize(header.toString())}</span>\n\t\t\t<span>{formatValues(value)}</span>\n\t\t</div>\n\t);\n}\n\nfunction EarthEnginePopup({\n\tlayer,\n\torgUnit,\n\tloading,\n\terror,\n}: {\n\tlayer?: CustomGoogleEngineLayer;\n\torgUnit: MapOrgUnit;\n\tloading: boolean;\n\terror?: string;\n}) {\n\tconst engine = layer?.engine;\n\tconst legends = layer?.engine?.options?.legend?.items;\n\tconst data = engine?.getAggregation(orgUnit)?.data;\n\tconst unit =\n\t\tlayer?.engine?.options?.unit ??\n\t\thead(layer?.engine?.options.aggregations);\n\n\tconst aggregations = useMemo(() => {\n\t\tif (!isEmpty(legends)) {\n\t\t\treturn sortBy(\n\t\t\t\tObject.keys(data ?? {}).map((key) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: parseInt(key),\n\t\t\t\t\t\tvalue: data[key],\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t\t[\"value\"],\n\t\t\t).reverse();\n\t\t}\n\t\treturn data ?? {};\n\t}, [data]);\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div style={{ width: 200, height: 200 }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<CircularLoader extrasmall />\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (error) {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<h3 style={{ margin: \"0\" }}>{orgUnit.name}</h3>\n\t\t\t\t<Divider margin={\"0\"} />\n\t\t\t\t<div className=\"column gap-8\">\n\t\t\t\t\t<div className=\"column\">\n\t\t\t\t\t\t<b>{layer?.options?.name}</b>\n\t\t\t\t\t\t<div>{layer?.options?.unit}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"column\">\n\t\t\t\t\t\t<p>{i18n.t(\"Could not get aggregate data\")}</p>\n\t\t\t\t\t\t<p>{error}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div>\n\t\t\t<h3 style={{ margin: \"0\" }}>{orgUnit.name}</h3>\n\t\t\t<Divider margin={\"0\"} />\n\t\t\t<div className=\"column gap-8\">\n\t\t\t\t<div className=\"column\">\n\t\t\t\t\t<b>{layer?.options?.name}</b>\n\t\t\t\t\t<div>{layer?.options?.unit ?? unit}</div>\n\t\t\t\t</div>\n\t\t\t\t{data && (\n\t\t\t\t\t<div className=\"column\">\n\t\t\t\t\t\t{Array.isArray(aggregations)\n\t\t\t\t\t\t\t? aggregations?.map(({ id, value }) => (\n\t\t\t\t\t\t\t\t\t<Legend\n\t\t\t\t\t\t\t\t\t\tkey={`${orgUnit.id}-legend-details-${id}`}\n\t\t\t\t\t\t\t\t\t\tlegends={legends ?? []}\n\t\t\t\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\t\t\t\theader={id}\n\t\t\t\t\t\t\t\t\t\tunit={unit}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\t: Object.keys(aggregations)?.map((key) => (\n\t\t\t\t\t\t\t\t\t<AggregationView\n\t\t\t\t\t\t\t\t\t\tkey={`${orgUnit.id}-aggregate-details-${key}`}\n\t\t\t\t\t\t\t\t\t\theader={key}\n\t\t\t\t\t\t\t\t\t\tvalue={aggregations[key]}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction EarthEngineArea({\n\tarea,\n\tlayer,\n\tloading,\n\terror,\n}: {\n\tarea: MapOrgUnit;\n\tlayer?: CustomGoogleEngineLayer;\n\tloading: boolean;\n\terror?: string;\n}) {\n\tconst ref = useRef<any>();\n\n\treturn (\n\t\t<GeoJSON\n\t\t\tref={ref}\n\t\t\tdata={area.geoJSON}\n\t\t\tinteractive\n\t\t\teventHandlers={{\n\t\t\t\tmouseover: (e) => highlightFeature(e, highlightStyle),\n\t\t\t\tmouseout: (e) => resetHighlight(e, defaultStyle),\n\t\t\t}}\n\t\t\tkey={`${area.id}-polygon`}\n\t\t\tpathOptions={defaultStyle}\n\t\t>\n\t\t\t<Tooltip>{area.name}</Tooltip>\n\t\t\t<Popup minWidth={100}>\n\t\t\t\t<EarthEnginePopup\n\t\t\t\t\terror={error}\n\t\t\t\t\tlayer={layer}\n\t\t\t\t\torgUnit={area}\n\t\t\t\t\tloading={loading}\n\t\t\t\t/>\n\t\t\t</Popup>\n\t\t</GeoJSON>\n\t);\n}\n\nexport default function GoogleEngineLayer({ layerId }: { layerId: string }) {\n\tconst layer = useGoogleEngineLayer(layerId);\n\tconst { name, type, enabled, url, options, engine } = layer ?? {};\n\tconst { isLoading: loadingAggregateData, error } = useQuery(\n\t\t[engine],\n\t\tasync () => engine?.getAggregations(),\n\t\t{\n\t\t\tsuspense: false,\n\t\t},\n\t);\n\tconst orgUnits = useBoundaryData();\n\n\tif (!url) return null;\n\n\treturn (\n\t\t<LayersControl.Overlay\n\t\t\tchecked={enabled}\n\t\t\tname={name ?? capitalize(type)}\n\t\t>\n\t\t\t<LayerGroup>\n\t\t\t\t<TileLayer id={options?.id} url={url} />\n\t\t\t\t{orgUnits?.map((area: MapOrgUnit) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<EarthEngineArea\n\t\t\t\t\t\t\terror={\n\t\t\t\t\t\t\t\t(error as any)?.toString() as string | undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tloading={loadingAggregateData}\n\t\t\t\t\t\t\tkey={`${area.id}-polygon`}\n\t\t\t\t\t\t\tarea={area}\n\t\t\t\t\t\t\tlayer={layer}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</LayerGroup>\n\t\t</LayersControl.Overlay>\n\t);\n}\n"]}
@@ -1,3 +0,0 @@
1
-
2
- //# sourceMappingURL=out.js.map
3
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.ts"],"names":["token"],"mappings":"AAMA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,MAAM,MAAM,eAAe;AAWpC,OAAO,QAAQ;AAEf,MAAM,KAAK;AAEX,OAAO,KAAK;AAEZ,MAAM,gBAAgB,EAAC,OAAO,UAAU,aAAa,EAAC;AACtD,MAAM,qBAAqB;AAEpB,MAAM,YAAY;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,EAAC,QAAO,GAAoC;AACpD,SAAK,UAAU;AACf,SAAK,cAAc;AACnB,SAAK,YAAY;AAAA,EACrB;AAAA,EAEA,aAAa,SAAS,OAAyB,SAAsC;AACjF,UAAM,YAAY;AAElB,aAAS,aAAa,UAA0B,UAAgC;AAC5E,cAAQ,EAAE,KAAK,CAAC,EAAC,OAAAA,OAAK,MAAmC;AACrD,iBAAS;AAAA,UACL,GAAGA;AAAA,UACH,YAAY,aAAa;AAAA,UACzB,OAAO,UAAU;AAAA,QACrB,CAAC;AAAA,MACL,CAAC;AAAA,IACL;AAEA,UAAM,IAAI,QAAQ,CAAC,SAAS,WAAW;AACnC,UAAI,GAAG,KAAK,aAAa,GAAG;AACxB,WAAG,WAAW,MAAM,MAAM,SAAS,MAAM;AAAA,MAC7C;AACA,UAAI,OAAO;AACP,cAAM,EAAC,cAAc,WAAW,WAAU,IAAI;AAC9C,WAAG,KAAK;AAAA,UACJ;AAAA,UACA,aAAa;AAAA,UACb;AAAA,UACA;AAAA,UACA;AAAA,UACA,MAAM;AACF,eAAG,WAAW,MAAM,MAAM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C,KAAI,IAAI,KAAK;AACpB,QAAI;AACJ,YAAQ,MAAM;AAAA,MACV,KAAK;AACD,gBAAQ,KAAK,oBAAoB;AACjC;AAAA,MACJ,KAAK;AACD,gBAAQ,KAAK,8BAA8B;AAC3C;AAAA,MACJ,KAAK;AACD,gBAAQ,KAAK,kBAAkB;AAC/B;AAAA,MACJ,KAAK;AACD,gBAAQ,KAAK,4BAA4B;AACzC;AAAA,MACJ;AACI,gBAAQ,KAAK,kBAAkB;AAAA,IACvC;AACA,YAAQ,KAAK,UAAU,KAAK;AAC5B,YAAQ,KAAK,UAAU,KAAK;AAC5B,SAAK,QAAQ;AACb,WAAO;AAAA,EACX;AACJ","sourcesContent":["import { MapOrgUnit } from \"../../../../../interfaces\";\nimport {\n\tEarthEngineOptions,\n\tEarthEngineToken,\n\tRefreshToken,\n} from \"../interfaces\";\nimport {\n\tcombineReducers,\n\tgetFeatureCollectionProperties,\n\tgetHistogramStatistics,\n\tgetInfo,\n\tgetScale,\n\thasClasses,\n} from \"../utils\";\nimport { find, head, isEmpty } from \"lodash\";\n\n// async function importEEModule(): Promise<any> {\n// // @ts-ignore\n// if (import.meta.env.STORYBOOK_BUILD === \"true\") {\n// return await import(\"@google/earthengine\");\n// }\n// return await import(\"./api\");\n// }\n// const EE = await importEEModule();\n//@ts-ignore\nimport EE from \"./api\";\n// @ts-ignore\nconst ee = EE as any;\n// @ts-ignore\nwindow.ee = ee;\n\nconst FEATURE_STYLE = {color: \"FFA500\", strokeWidth: 2};\nconst DEFAULT_TILE_SCALE = 1;\n\nexport class EarthEngine {\n token?: EarthEngineToken;\n options: EarthEngineOptions;\n refresh?: RefreshToken;\n orgUnits?: MapOrgUnit[];\n initialized = false;\n period?: string | string[];\n instance: any;\n scale?: any;\n image: any;\n aggregationData: any;\n\n constructor({options}: { options: EarthEngineOptions }) {\n this.options = options;\n this.initialized = true;\n this.getInstance();\n }\n\n static async setToken(token: EarthEngineToken, refresh: RefreshToken): Promise<void> {\n const tokenType = \"Bearer\";\n\n function refreshToken(authArgs: { scope: any }, callback: (props: any) => void) {\n refresh().then(({token}: { token: EarthEngineToken }) => {\n callback({\n ...token,\n token_type: tokenType ?? \"Bearer\",\n state: authArgs?.scope,\n });\n });\n }\n\n await new Promise((resolve, reject) => {\n if (ee.data.getAuthToken()) {\n ee.initialize(null, null, resolve, reject);\n }\n if (token) {\n const {access_token, client_id, expires_in} = token;\n ee.data.setAuthToken(\n client_id,\n tokenType ?? \"Bearer\",\n access_token,\n expires_in,\n null,\n () => {\n ee.initialize(null, null, resolve, reject);\n },\n false\n );\n ee.data.setAuthTokenRefresher(refreshToken);\n }\n resolve(\"Token not found\");\n });\n }\n\n setOrgUnits(orgUnits: MapOrgUnit[]): EarthEngine {\n this.orgUnits = orgUnits;\n return this;\n }\n\n setPeriod(period: string) {\n this.period = period;\n }\n\n async getValue(geoJSON: any, type: string) {\n return new Promise((resolve, reject) => {\n const point = this.getGeometryByType(geoJSON);\n const reducer = this.getReducerByType(type);\n const image = this.getImage();\n\n const reducedImage = image.reduceRegion(reducer, point, 1);\n\n reducedImage.evaluate((data: unknown, error: any) => {\n if (error) {\n reject(error);\n } else {\n resolve(data);\n }\n });\n });\n }\n\n async getPeriod() {\n const {type} = this.options;\n if (type !== \"ImageCollection\") {\n return;\n }\n\n const imageCollection = this.instance.distinct(\"system:time_start\").sort(\"system:time_start\", false);\n const featureCollection = ee.FeatureCollection(imageCollection).select([\"system:time_start\", \"system:time_end\"], null, false);\n\n return getInfo(featureCollection);\n }\n\n async info() {\n return new Promise((resolve) => {\n this.instance.getInfo(resolve);\n });\n }\n\n async getScale() {\n try {\n const {type} = this.options;\n switch (type) {\n case \"ImageCollection\":\n this.scale = await getScale(this.instance.first());\n break;\n default:\n this.scale = await getScale(this.getImage());\n }\n } catch (e) {\n }\n }\n\n async getFeatureCollectionAggregation() {\n const {datasetId} = this.options;\n const dataset = ee.FeatureCollection(datasetId);\n const collection = this.getFeatureCollection() as any;\n const aggFeatures = collection\n ?.map((feature: any) => {\n feature = ee.Feature(feature);\n const count = dataset.filterBounds(feature.geometry()).size();\n\n return feature.set(\"count\", count);\n })\n .select([\"count\"], null, false);\n\n return getInfo(aggFeatures).then(getFeatureCollectionProperties);\n }\n\n async getHistogramAggregations() {\n try {\n const aggregation = head(this.options.aggregations) ?? \"\";\n const reducer = ee.Reducer.frequencyHistogram();\n const collection = this.getFeatureCollection();\n const legend = this.options.legend?.items;\n const scale = this.scale;\n const tileScale = this.options.tileScale ?? DEFAULT_TILE_SCALE;\n const scaleValue = await getInfo(scale);\n\n const image = this.getImage();\n const features = Object.values(\n await getInfo(\n image\n .reduceRegions({\n collection,\n reducer,\n scale,\n tileScale,\n })\n .select([\"histogram\"], null, false)\n ).then((data) =>\n getHistogramStatistics({\n data,\n scale: scaleValue,\n aggregationType: aggregation,\n legend,\n })\n )\n );\n\n return features.map((feature: any, index: number) => {\n return {\n orgUnit: this.orgUnits?.[index],\n data: feature,\n };\n });\n } catch (e: any) {\n throw Error(\"Could not get histogram\", {\n cause: e,\n });\n }\n }\n\n async getAggregations() {\n await this.getScale();\n const {type} = this.options;\n if (type === \"FeatureCollection\") {\n this.aggregationData = await this.getFeatureCollectionAggregation();\n return;\n }\n const aggregations = this.options.aggregations;\n if (!aggregations) return;\n\n if (hasClasses(head(aggregations) ?? \"\")) {\n this.aggregationData = await this.getHistogramAggregations();\n return;\n }\n\n const reducer = combineReducers(ee)(aggregations);\n const collection = this.getFeatureCollection();\n const image = this.getImage();\n const scale = this.scale;\n const tileScale = this.options.tileScale ?? DEFAULT_TILE_SCALE;\n const aggregatedFeatures = image\n .reduceRegions({\n collection,\n reducer,\n scale,\n tileScale,\n })\n .select(aggregations, null, false);\n\n const features = Object.values(getFeatureCollectionProperties(await getInfo(aggregatedFeatures))) as any[];\n if (!isEmpty(features) && features.length === this.orgUnits?.length) {\n //Mapping features to orgUnits using index.\n this.aggregationData = features.map((feature: any, index: number) => {\n return {\n orgUnit: this.orgUnits?.[index],\n data: feature,\n };\n });\n }\n }\n\n getAggregation(orgUnit: MapOrgUnit) {\n if (isEmpty(this.aggregationData)) {\n return;\n }\n return find(this.aggregationData, (aggregation) => aggregation.orgUnit.id === orgUnit.id);\n }\n\n async url(): Promise<string> {\n if (!this.initialized) throw \"You need to call init() first\";\n return this.visualize(this.getImage());\n }\n\n protected applyPeriod(imageCollection: any) {\n const period = this.period;\n if (period) {\n return imageCollection.filterDate(period);\n }\n }\n\n protected applyMask(image: any) {\n if (this.options.mask) {\n return image.updateMask(image.gt(0));\n } else {\n return image;\n }\n }\n\n protected applyBand(imageCollection: any) {\n if (this.options.selectedBands) {\n return imageCollection.select(this.options.selectedBands);\n } else {\n return imageCollection;\n }\n }\n\n protected getReducerByType(type: string) {\n return ee.Reducer[type].call();\n }\n\n protected getGeometryByType(geoJSON: any) {\n return ee.Geometry(geoJSON?.geometry);\n }\n\n protected getFeatureByType(geoJSON: any) {\n const featureType = geoJSON.type;\n const features = geoJSON.features ?? [];\n const geometry = this.getGeometryByType(geoJSON);\n switch (featureType) {\n case \"Feature\":\n return ee.Feature(geometry);\n case \"FeatureCollection\":\n return ee.FeatureCollection([...features.map((feature: any) => ee.Feature(this.getGeometryByType(feature)))]);\n }\n }\n\n protected getFeatureCollection(): unknown {\n if (this.orgUnits) {\n return ee.FeatureCollection(this.orgUnits.map((orgUnit: MapOrgUnit) => this.getFeatureByType(orgUnit.geoJSON)));\n } else {\n throw \"You need to set org units first\";\n }\n }\n\n protected getParamsFromLegend() {\n if (!this.options.legend) return;\n const legend = this.options.legend.items;\n const keys = legend.map((l) => l.id);\n const min = Math.min(...keys);\n const max = Math.max(...keys);\n const palette = legend.map((l) => l.color).join(\",\");\n return {min, max, palette};\n }\n\n protected async visualize(image: any): Promise<string> {\n const {min, max, palette} = this.getParamsFromLegend() ??\n this.options.params ?? {\n min: null,\n max: null,\n palette: null,\n };\n return (\n (await new Promise((resolve, reject) => {\n image.getMap({min, max, palette}, resolve);\n })) as any\n )?.urlFormat;\n }\n\n protected getImageCollectionInstance() {\n const {datasetId} = this.options;\n let imageCollection = ee.ImageCollection(datasetId);\n if (this.period) {\n imageCollection = this.applyPeriod(imageCollection);\n }\n imageCollection = this.applyBand(imageCollection);\n return imageCollection;\n }\n\n protected getImageFromImageCollection() {\n const {mosaic} = this.options;\n const imageCollection = this.instance;\n return mosaic\n ? imageCollection.mosaic().clipToCollection(this.getFeatureCollection())\n : ee.Image(imageCollection.first()).clipToCollection(this.getFeatureCollection());\n }\n\n protected getImageInstance() {\n const {datasetId} = this.options;\n return ee.Image(datasetId).clipToCollection(this.getFeatureCollection());\n }\n\n protected getImageFromImage() {\n return this.instance;\n }\n\n protected getFeatureInstance() {\n const {datasetId} = this.options;\n const feature = ee.Feature(datasetId);\n this.instance = feature;\n return feature;\n }\n\n protected getImageFromFeature() {\n return this.instance;\n }\n\n protected getFeatureCollectionInstance() {\n const {datasetId} = this.options;\n let featureCollection = ee.FeatureCollection(datasetId);\n if (this.period) {\n featureCollection = this.applyPeriod(featureCollection);\n }\n return featureCollection;\n }\n\n protected getImageFromFeatureCollection() {\n let featureCollection = this.instance;\n return featureCollection.draw(FEATURE_STYLE).clipToCollection(this.getFeatureCollection());\n }\n\n protected getInstance() {\n const {type} = this.options;\n switch (type) {\n case \"Feature\":\n this.instance = this.getFeatureInstance();\n break;\n case \"FeatureCollection\":\n this.instance = this.getFeatureCollectionInstance();\n break;\n case \"Image\":\n this.instance = this.getImageInstance();\n break;\n case \"ImageCollection\":\n this.instance = this.getImageCollectionInstance();\n break;\n default:\n this.instance = this.getImageFromImage();\n }\n }\n\n protected getImage(): any {\n if (this.image) {\n return this.image;\n }\n const {type} = this.options;\n let image;\n switch (type) {\n case \"Feature\":\n image = this.getImageFromFeature();\n break;\n case \"FeatureCollection\":\n image = this.getImageFromFeatureCollection();\n break;\n case \"Image\":\n image = this.getImageFromImage();\n break;\n case \"ImageCollection\":\n image = this.getImageFromImageCollection();\n break;\n default:\n image = this.getImageFromImage();\n }\n image = this.applyMask(image);\n image = this.applyBand(image);\n this.image = image;\n return image;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.ts"],"names":["id"],"mappings":"AAEO,MAAM,kBAAkB,CAAC,OAAY,CAAC,UAC5C,MAAM;AAAA,EACL,CAAC,GAAQ,GAAQ,MAChB,MAAM,IACH,EAAE,CAAC,EAAE,IACL,EAAE,QAAQ;AAAA,IACV,UAAU,GAAG,QAAQ,CAAC,EAAE;AAAA,IACxB,cAAc;AAAA,EACf,CAAC;AAAA,EACJ,GAAG;AACJ;AAEM,MAAM,UAAU,CAAC,aACtB,IAAI;AAAA,EAAQ,CAAC,SAAS,WACpB,SAAS,SAAS,CAAC,MAAW,UAAiB;AAC7C,QAAI,OAAO;AACT,aAAO,KAAK;AAAA,IACd,OAAO;AACL,cAAQ,IAAI;AAAA,IACd;AAAA,EACF,CAAC;AACH;AAEK,MAAM,iCAAiC,CAAC,SAC7C,KAAK,SAAS;AAAA,EACZ,CAAC,KAAU,OAAY;AAAA,IACrB,GAAG;AAAA,IACH,CAAC,EAAE,EAAE,GAAG,EAAE;AAAA,EACZ;AAAA,EACA,CAAC;AACH;AAEK,MAAM,WAAW,OAAO,UAAe;AAC5C,SAAO,MAAM,OAAO,CAAC,EAAE,WAAW,EAAE,aAAa;AACnD;AAEA,MAAM,sBAAsB,CAAC,WAAkB;AAC7C,QAAM,OAAO,OAAO,IAAI,CAAC,MAAM,EAAE,EAAE;AACnC,QAAM,MAAM,KAAK,IAAI,GAAG,IAAI;AAC5B,QAAM,MAAM,KAAK,IAAI,GAAG,IAAI;AAC5B,QAAM,UAAU,OAAO,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG;AAEnD,SAAO,EAAE,KAAK,KAAK,QAAQ;AAC7B;AAEO,MAAM,qBAAqB,CAAC,SAAc,EAAE,QAAQ,SAAS,OAAO,MAA0B;AACnG,QAAM,SAAS,SAAS,S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AC;AAChD;AAAA,MACF;AACE,gBAAS,QAAQ,MAAO;AAAA,IAC5B;AAEA,WAAOA,GAAE,IAAI;AAEb,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,SAAO;AACT,GAAG,CAAC,CAAC","sourcesContent":["import { EarthEngineOptions } from \"../interfaces\";\n\nexport const combineReducers = (ee: any) => (types: string[]) =>\n\ttypes.reduce(\n\t\t(r: any, t: any, i: any) =>\n\t\t\ti === 0\n\t\t\t\t? r[t]()\n\t\t\t\t: r.combine({\n\t\t\t\t\t\treducer2: ee.Reducer[t](),\n\t\t\t\t\t\tsharedInputs: true,\n\t\t\t\t\t}),\n\t\tee.Reducer,\n\t);\n\nexport const getInfo = (instance: any) =>\n new Promise((resolve, reject) =>\n instance.evaluate((data: any, error: Error) => {\n if (error) {\n reject(error);\n } else {\n resolve(data);\n }\n })\n );\n\nexport const getFeatureCollectionProperties = (data: any) =>\n data.features.reduce(\n (obj: any, f: any) => ({\n ...obj,\n [f.id]: f.properties,\n }),\n {}\n );\n\nexport const getScale = async (image: any) => {\n return image.select(0).projection().nominalScale();\n};\n\nconst getParamsFromLegend = (legend: any[]) => {\n const keys = legend.map((l) => l.id);\n const min = Math.min(...keys);\n const max = Math.max(...keys);\n const palette = legend.map((l) => l.color).join(\",\");\n\n return { min, max, palette };\n};\n\nexport const getClassifiedImage = (eeImage: any, { legend: legends, params }: EarthEngineOptions) => {\n const legend = legends?.items ?? [];\n if (!params) {\n // Image has classes (e.g. landcover)\n return { eeImage, params: getParamsFromLegend(legend) };\n }\n\n const min = 0;\n const max = legend.length - 1;\n const { palette } = params;\n let zones;\n\n for (let i = min, item; i < max; i++) {\n item = legend[i] as any;\n\n if (!zones) {\n zones = eeImage.gt(item.to);\n } else {\n zones = zones.add(eeImage.gt(item.to));\n }\n }\n\n return { eeImage: zones, params: { min, max, palette } };\n};\n\nconst squareMetersToHectares = (value: number) => value / 10000;\n\nconst squareMetersToAcres = (value: number) => value / 4046.8564224;\n\nconst classAggregation = [\"percentage\", \"hectares\", \"acres\"];\n\nexport const hasClasses = (type: string) => classAggregation.includes(type);\n\nexport const getHistogramStatistics = ({ data, scale, aggregationType, legend }: { data: any; scale: any; aggregationType: string; legend: any }) =>\n data.features.reduce((obj: Record<any, any>, { id, properties }: { id: string; properties: any }) => {\n const { histogram } = properties;\n const sum: number = Object.values(histogram).reduce((a: any, b: any) => a + b, 0) as number;\n obj[id] = legend.reduce((values: any, { id }: { id: string }) => {\n const count = histogram[id] || 0;\n const sqMeters = count * (scale * scale);\n let value;\n switch (aggregationType) {\n case \"hectares\":\n value = Math.round(squareMetersToHectares(sqMeters));\n break;\n case \"acres\":\n value = Math.round(squareMetersToAcres(sqMeters));\n break;\n default:\n value = (count / sum) * 100; // percentage\n }\n\n values[id] = value;\n\n return values;\n }, {});\n return obj;\n }, {});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../../src/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.tsx"],"names":[],"mappings":"AAaE,SACC,KADD;AAbF,SAAS,oBAAoB;AAGd,SAAR,iBAAkC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AACD,GAIG;AACF,SACC,qBAAC,SAAI,WAAU,8CACd;AAAA,wBAAC,QAAG,OAAO,EAAE,QAAQ,EAAE,GAAG,WAAU,iBAClC,iBACF;AAAA,IACC,eACA,oBAAC,SAAI,SAAS,YACb,8BAAC,gBAAa,GACf;AAAA,KAEF;AAEF","sourcesContent":["import { IconLaunch16 } from \"@dhis2/ui\";\nimport React from \"react\";\n\nexport default function LegendCardHeader({\n\ttitle,\n\tcollapsible,\n\tonCollapse,\n}: {\n\ttitle: string;\n\tonCollapse?: () => void;\n\tcollapsible?: boolean;\n}) {\n\treturn (\n\t\t<div className=\"row w-100 space-between align-items-center\">\n\t\t\t<h4 style={{ margin: 0 }} className=\"legend-header\">\n\t\t\t\t{title}\n\t\t\t</h4>\n\t\t\t{collapsible && (\n\t\t\t\t<div onClick={onCollapse}>\n\t\t\t\t\t<IconLaunch16 />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapLayer/components/LegendArea/index.tsx"],"names":[],"mappings":"AA0BS,cAkGP,YAlGO;AA1BT,SAAS,QAAQ,cAAc,QAAQ,cAAc;AAErD,SAAS,SAAS,YAAY;AAC9B,OAAO,SAAS,WAAW,QAAQ,gBAAgB;AAEnD,SAAS,qBAAqB;AAC9B;AAAA,EAKC;AAAA,OACM;AACP,OAAO,iBAAiB;AACxB,OAAO,kBAAkB;AACzB,OAAO,sBAAsB;AAC7B,OAAO,uBAAuB;AAC9B,OAAO,aAAa;AACpB,SAAS,qBAAqB;AAE9B,MAAM,iBAAiB;AAEvB,SAAS,mBACR,OACC;AACD,MAAI,MAAM,SAAS,SAAS;AAC3B,WAAO,oBAAC,eAAY,MAAM,MAAM,OAAO;AAAA,EACxC;AAEA,MAAI,8BAA8B,SAAS,MAAM,IAAI,GAAG;AACvD,WACC;AAAA,MAAC;AAAA;AAAA,QACA,MAAM,MAAM,QAAQ;AAAA,QACpB;AAAA;AAAA,IACD;AAAA,EAEF;AAEA,QAAM,EAAE,MAAM,SAAS,SAAS,UAAU,MAAM,MAAM,QAAQ,IAC5D,SAAiC,CAAC;AAEpC,MAAI,CAAC,WAAW,CAAC,SAAS;AACzB,WAAO;AAAA,EACR;AACA,UAAQ,MAAM;AAAA,IACb,KAAK;AACJ,aACC;AAAA,QAAC;AAAA;AAAA,UACA,QACE,OAA6B,UAAU;AAAA,YACvC,KAAK;AAAA,YACL,KAAK;AAAA,UACN;AAAA,UAED,SAAS,WAAW,CAAC;AAAA,UACrB,MAAM,QAAQ,SAAS;AAAA,UACvB;AAAA,UACA,UAAU,KAAK,IAAI,GAAG,YAAY;AAAA;AAAA,MACnC;AAAA,IAEF,KAAK;AACJ,aACC;AAAA,QAAC;AAAA;AAAA,UACA,SAAS,WAA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AA,IAAC;AAAA;AAAA,MACA,aAAa,eAAe;AAAA,MAG3B;AAAA;AAAA,IAFI,GAAG,KAAK;AAAA,EAGd,CACA,GACF,GACD;AAEF","sourcesContent":["import { colors, IconLegend24, Popper, Portal } from \"@dhis2/ui\";\nimport { ControlPosition } from \"leaflet\";\nimport { compact, head } from \"lodash\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { MapLegendConfig } from \"../../../MapArea/interfaces\";\nimport { CustomControl } from \"../../../MapControls/components/CustomControl\";\nimport {\n\tCustomBubbleLayer,\n\tCustomGoogleEngineLayer,\n\tCustomPointLayer,\n\tCustomThematicLayer,\n\tSUPPORTED_EARTH_ENGINE_LAYERS,\n} from \"../../interfaces\";\nimport PointLegend from \"../PointLayer/components/PointLegend\";\nimport BubbleLegend from \"../ThematicLayer/components/Bubble/components/BubbleLegend\";\nimport ChoroplethLegend from \"../ThematicLayer/components/Choropleth/components/ChoroplethLegend\";\nimport EarthEngineLegend from \"../GoogleEngineLayer/components/EarthEngineLegend\";\nimport classes from \"./LegendArea.module.css\";\nimport { usePrintMedia } from \"../../../../hooks/map\";\n\nconst TOOLTIP_OFFSET = 4;\n\nfunction getLegendComponent(\n\tlayer: CustomThematicLayer | CustomPointLayer | CustomGoogleEngineLayer,\n) {\n\tif (layer.type === \"point\") {\n\t\treturn <PointLegend name={layer.label} />;\n\t}\n\n\tif (SUPPORTED_EARTH_ENGINE_LAYERS.includes(layer.type)) {\n\t\treturn (\n\t\t\t<EarthEngineLegend\n\t\t\t\tname={layer.name ?? \"\"}\n\t\t\t\tlayer={layer as CustomGoogleEngineLayer}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst { type, enabled, control, dataItem, name, data, legends } =\n\t\t(layer as CustomThematicLayer) ?? {};\n\n\tif (!enabled || !control) {\n\t\treturn null;\n\t}\n\tswitch (type) {\n\t\tcase \"bubble\":\n\t\t\treturn (\n\t\t\t\t<BubbleLegend\n\t\t\t\t\tradius={\n\t\t\t\t\t\t(layer as CustomBubbleLayer)?.radius ?? {\n\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\tmax: 50,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlegends={legends ?? []}\n\t\t\t\t\tname={name ?? dataItem.displayName}\n\t\t\t\t\tdata={data}\n\t\t\t\t\tdataItem={head(data)?.dataItem ?? dataItem}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"choropleth\":\n\t\t\treturn (\n\t\t\t\t<ChoroplethLegend\n\t\t\t\t\tlegends={legends ?? []}\n\t\t\t\t\tname={name ?? dataItem.displayName}\n\t\t\t\t\tdata={data}\n\t\t\t\t\tdataItem={head(data)?.dataItem ?? dataItem}\n\t\t\t\t/>\n\t\t\t);\n\t}\n}\n\nfunction CollapsedLegendIcon({\n\tonCollapse,\n\tname,\n}: {\n\tname: string;\n\tonCollapse: () => void;\n}) {\n\tconst openDelay = 200;\n\tconst closeDelay = 200;\n\tconst [openTooltip, setOpenTooltip] = useState(false);\n\tconst openTimerRef = useRef<any>(null);\n\tconst closeTimerRef = useRef<any>(null);\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst hideModifier = { name: \"hide\" };\n\tconst offsetModifier = {\n\t\tname: \"offset\",\n\t\toptions: {\n\t\t\toffset: [0, TOOLTIP_OFFSET],\n\t\t},\n\t};\n\n\tconst flipModifier = {\n\t\tname: \"flip\",\n\t\toptions: { altBoundary: true },\n\t};\n\n\tconst onMouseOver = () => {\n\t\tclearTimeout(closeTimerRef.current);\n\n\t\topenTimerRef.current = setTimeout(() => {\n\t\t\tsetOpenTooltip(true);\n\t\t}, openDelay);\n\t};\n\n\tconst onMouseOut = () => {\n\t\tclearTimeout(openTimerRef.current);\n\n\t\tcloseTimerRef.current = setTimeout(() => {\n\t\t\tsetOpenTooltip(false);\n\t\t}, closeDelay);\n\t};\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tclearTimeout(openTimerRef.current);\n\t\t\tclearTimeout(closeTimerRef.current);\n\t\t},\n\t\t[],\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tonMouseOver={onMouseOver}\n\t\t\tonMouseOut={onMouseOut}\n\t\t\tonClick={onCollapse}\n\t\t\tstyle={{ width: 28, height: 28 }}\n\t\t\tclassName=\"legend-card collapsed\"\n\t\t>\n\t\t\t<IconLegend24 />\n\t\t\t{openTooltip && (\n\t\t\t\t<Portal\n\t\t\t\t\t/*\n\t\t\t // @ts-ignore */\n\t\t\t\t\tclassName={classes[\"map-tooltip\"]}\n\t\t\t\t>\n\t\t\t\t\t<Popper\n\t\t\t\t\t\tclassName={classes[\"map-tooltip\"]}\n\t\t\t\t\t\treference={ref}\n\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\tmodifiers={[offsetModifier, flipModifier, hideModifier]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tbackgroundColor: `${colors.grey900}`,\n\t\t\t\t\t\t\t\tborderRadius: 3,\n\t\t\t\t\t\t\t\tcolor: `${colors.white}`,\n\t\t\t\t\t\t\t\tpadding: \"4px 6px\",\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdata-test={`content`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popper>\n\t\t\t\t</Portal>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction Legend({\n\tchildren,\n\tcollapsible,\n}: {\n\tchildren: React.ReactElement;\n\tcollapsible: boolean;\n}) {\n\tconst [collapsed, setCollapsed] = useState(collapsible);\n\tconst inPrintMode = usePrintMedia();\n\tconst onCollapse = () => {\n\t\tif (collapsible) {\n\t\t\tsetCollapsed((prevState) => !prevState);\n\t\t}\n\t};\n\n\tconst name = head(React.Children.toArray(children) as React.ReactElement[])\n\t\t?.props.name;\n\n\tconst shouldCollapse = collapsed && !inPrintMode;\n\n\treturn (\n\t\t<div className=\"w-100\">\n\t\t\t{shouldCollapse ? (\n\t\t\t\t<CollapsedLegendIcon name={name} onCollapse={onCollapse} />\n\t\t\t) : (\n\t\t\t\tReact.Children.map(children, (child) =>\n\t\t\t\t\tReact.cloneElement(child, { collapsible, onCollapse }),\n\t\t\t\t)\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport default function LegendArea({\n\tlayers,\n\tlegends: legendConfig,\n}: {\n\tlayers: Array<\n\t\tCustomThematicLayer | CustomPointLayer | CustomGoogleEngineLayer\n\t>;\n\tposition: ControlPosition;\n\tlegends?: MapLegendConfig;\n}) {\n\tconst legends: JSX.Element[] = compact(\n\t\tlayers.filter((layer) => layer.enabled).map(getLegendComponent),\n\t);\n\tconst { position, collapsible } = legendConfig ?? {};\n\n\treturn (\n\t\t<CustomControl position={position}>\n\t\t\t<div className=\"column gap-16 align-items-end\">\n\t\t\t\t{legends?.map((legend: any, index) => (\n\t\t\t\t\t<Legend\n\t\t\t\t\t\tcollapsible={collapsible ?? true}\n\t\t\t\t\t\tkey={`${index}-map-legend`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{legend}\n\t\t\t\t\t</Legend>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</CustomControl>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../../src/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.tsx"],"names":["name"],"mappings":"AAwBI,SAIC,KAJD;AAxBJ,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAgB,kBAAkB;AAClC,SAAS,kBAAkB;AAC3B,OAAO,sBAAsB;AAC7B,SAAS,qBAAqB;AAE9B,SAAS,aAAa;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AACD,GAIG;AACF,QAAM,EAAE,QAAQ,IAAI,UAAU;AAE9B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAO,EAAE,UAAU,KAAK,YAAY,aAAa;AAAA,MACjD,WAAU;AAAA,MAET;AAAA,gBACA;AAAA,UAAC;AAAA;AAAA,YAEA,WAAU;AAAA,YAEV;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,QAAQ;AAAA,kBACR,OAAO;AAAA,kBACP,KAAK,GAAG,IAAI;AAAA,kBACZ,KAAK,WAAW,MAAM,EAAE,QAAQ,CAAC;AAAA;AAAA,cAClC;AAAA,cACA,oBAAC,OAAG,iBAAM;AAAA;AAAA;AAAA,UATL,GAAG,IAAI;AAAA,QAUb;AAAA,QAEA,cAAc,IAAI,CAAC,EAAE,MAAAA,OAAM,OAAO,MAAM;AACxC,iBACC;AAAA,YAAC;AAAA;AAAA,cAEA,WAAU;AAAA,cAEV;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACA,QAAQ;AAAA,oBACR,OAAO;AAAA,oBACP,KAAK,GAAGA,KAAI;AAAA,oBACZ,KAAK,WAAW,UAAU,IAAI,EAAE,QAAQ,CAAC;AAAA;AAAA,gBAC1C;AAAA,gBACA,oBAAC,OAAG,UAAAA,OAAK;AAAA;AAAA;AAAA,YATJ,GAAGA,KAAI;AAAA,UAUb;AAAA,QAEF,CAAC;AAAA;AAAA;AAAA,EACF;AAEF;AAEA,SAAS,YAAY,EAAE,aAAa,WAAW,GAAQ,KAAsC;AAC3F,QAAM,aAAa,cAAc;AACjC,QAAM,EAAE,OAAO,MAAM,IAAI,cAAc,CAAC;AAExC,SACE,qBAAC,SAAI,KAAU,WAAU,eACvB;AAAA,wBAAC,oBAAiB,aAA0B,YAAwB,OAAO,SAAS,UAAU;AAAA,IAC9F,oBAAC,WAAQ,QAAQ,KAAK;AAAA,IACtB,oBAAC,gBAAa,OAAc,eAAe,OAAO,iBAAiB,CAAC,GAAG,MAAM,OAAO,MAAM;AAAA,KAC5F;AAEJ;AAEA,IAAO,sBAAQ,WAAW,WAAW","sourcesContent":["import { useConfig } from \"@dhis2/app-runtime\";\nimport { Divider } from \"@dhis2/ui\";\nimport React, { forwardRef } from \"react\";\nimport { getIconUrl } from \"../../../../../../utils/helpers\";\nimport LegendCardHeader from \"../../../LegendArea/components/LegendCardHeader\";\nimport { usePointLayer } from \"../../hooks\";\n\nfunction PointLegends({\n\torgUnitGroups,\n\ticon,\n\tlabel,\n}: {\n\torgUnitGroups: { name: string; symbol: string }[];\n\ticon?: string;\n\tlabel?: string;\n}) {\n\tconst { baseUrl } = useConfig();\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{ minWidth: 100, alignItems: \"flex-start\" }}\n\t\t\tclassName=\"w-100 p-8 legend-list column\"\n\t\t>\n\t\t\t{icon && (\n\t\t\t\t<div\n\t\t\t\t\tkey={`${icon}-legend`}\n\t\t\t\t\tclassName=\"row gap-16 align-items-center\"\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\theight={20}\n\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\talt={`${name}-icon`}\n\t\t\t\t\t\tsrc={getIconUrl(icon, { baseUrl })}\n\t\t\t\t\t/>\n\t\t\t\t\t<p>{label}</p>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{orgUnitGroups.map(({ name, symbol }) => {\n\t\t\t\treturn (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={`${name}-legend`}\n\t\t\t\t\t\tclassName=\"row gap-16 align-items-center\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\theight={20}\n\t\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\t\talt={`${name}-icon`}\n\t\t\t\t\t\t\tsrc={getIconUrl(symbol ?? \"\", { baseUrl })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<p>{name}</p>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n}\n\nfunction PointLegend({ collapsible, onCollapse }: any, ref: React.LegacyRef<HTMLDivElement>) {\n const pointLayer = usePointLayer();\n const { label, style } = pointLayer ?? {};\n\n return (\n <div ref={ref} className=\"legend-card\">\n <LegendCardHeader collapsible={collapsible} onCollapse={onCollapse} title={label ?? \"Points\"} />\n <Divider margin={\"0\"} />\n <PointLegends label={label} orgUnitGroups={style?.orgUnitGroups ?? []} icon={style?.icon} />\n </div>\n );\n}\n\nexport default forwardRef(PointLegend);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/PointLayer/hooks/index.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAGtB,SAAS,gBAAgB;AAC/B,QAAM,EAAE,OAAO,IAAI,aAAa;AAChC,SAAO,KAAK,QAAQ,CAAC,QAAQ,OAAO,CAAC;AACtC","sourcesContent":["import { find } from \"lodash\";\nimport { useMapLayers } from \"../../../../MapProvider/hooks\";\nimport { CustomPointLayer } from \"../../../interfaces\";\n\nexport function usePointLayer() {\n\tconst { layers } = useMapLayers();\n\treturn find(layers, [\"type\", \"point\"]) as CustomPointLayer;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapLayer/components/PointLayer/index.tsx"],"names":[],"mappings":"AA2BM,SAeC,KAfD;AA3BN,SAAS,iBAAiB;AAC1B,OAAO,UAAU;AACjB,OAAO,OAAO;AAEd;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,SAAS,SAAS,kBAAkB;AACpC,SAAS,qBAAqB;AAEvB,SAAS,aAAa;AAC5B,QAAM,aAAa,cAAc;AACjC,QAAM,EAAE,SAAS,OAAO,QAAQ,UAAU,MAAM,IAAI,cAAc,CAAC;AACnE,QAAM,EAAE,QAAQ,IAAI,UAAU;AAC9B,SACC;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACA,SAAS;AAAA,MACT,MAAM,SAAS,KAAK,EAAE,QAAQ;AAAA,MAE9B,8BAAC,cACC,oBAAU,IAAI,CAAC,SAAuB;AACtC,eACC;AAAA,UAAC;AAAA;AAAA,YACA,cAAc,CAAC,GAAG,gBAAgB;AACjC,qBAAO,EAAE,OAAO,aAAa;AAAA,gBAC5B,MAAM;AAAA,kBACL;AAAA,oBACC,KAAK,KAAK,QAAQ,OAAO;AAAA,oBACzB,EAAE,QAAQ;AAAA,kBACX;AAAA,gBACD;AAAA,cACD,CAAC;AAAA,YACF;AAAA,YACA,MAAM,KAAK;AAAA,YACX,aAAW;AAAA,YAGX;AAAA,kCAAC,WAAS,eAAK,MAAK;AAAA,cACpB,oBAAC,SAAM,UAAU,IAChB,8BAAC,QAAI,eAAK,MAAK,GAChB;AAAA;AAAA;AAAA,UALK,GAAG,KAAK,EAAE;AAAA,QAMhB;AAAA,MAEF,CAAC,GACF;AAAA;AAAA,EACD;AAEF","sourcesContent":["import { useConfig } from \"@dhis2/app-runtime\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport L from \"leaflet\";\nimport React from \"react\";\nimport {\n\tGeoJSON,\n\tLayerGroup,\n\tLayersControl,\n\tPopup,\n\tTooltip,\n} from \"react-leaflet\";\nimport { PointOrgUnit } from \"../../../../interfaces\";\nimport { getIcon, getIconUrl } from \"../../../../utils/helpers\";\nimport { usePointLayer } from \"./hooks\";\n\nexport function PointLayer() {\n\tconst pointLayer = usePointLayer();\n\tconst { enabled, label, points: orgUnits, style } = pointLayer ?? {};\n\tconst { baseUrl } = useConfig();\n\treturn (\n\t\t<LayersControl.Overlay\n\t\t\tchecked={enabled}\n\t\t\tname={label ?? i18n.t(\"Points\")}\n\t\t>\n\t\t\t<LayerGroup>\n\t\t\t\t{orgUnits?.map((area: PointOrgUnit) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<GeoJSON\n\t\t\t\t\t\t\tpointToLayer={(_, coordinates) => {\n\t\t\t\t\t\t\t\treturn L.marker(coordinates, {\n\t\t\t\t\t\t\t\t\ticon: getIcon(\n\t\t\t\t\t\t\t\t\t\tgetIconUrl(\n\t\t\t\t\t\t\t\t\t\t\tarea.icon.icon ?? style?.icon,\n\t\t\t\t\t\t\t\t\t\t\t{ baseUrl },\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdata={area.geoJSON}\n\t\t\t\t\t\t\tinteractive\n\t\t\t\t\t\t\tkey={`${area.id}-polygon`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Tooltip>{area.name}</Tooltip>\n\t\t\t\t\t\t\t<Popup minWidth={80}>\n\t\t\t\t\t\t\t\t<h3>{area.name}</h3>\n\t\t\t\t\t\t\t</Popup>\n\t\t\t\t\t\t</GeoJSON>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</LayerGroup>\n\t\t</LayersControl.Overlay>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.tsx"],"names":[],"mappings":"AAyBM,cAWE,YAXF;AAxBN,SAAS,aAAa,mBAAmB;AAazC,MAAM,SAAS,CAAC,EAAE,QAAQ,WAAW,MAAM,WAAW,OAAO,QAAQ,QAAQ,MAAmB;AAC9F,QAAM,YAAY,cAAc;AAChC,QAAM,IAAI;AACV,QAAM,IAAI,YAAY,IAAI;AAC1B,QAAM,KAAK,YAAY,IAAI,YAAY,cAAc,IAAI,YAAY;AACrE,QAAM,KAAK,YAAY,IAAI,SAAS;AACpC,QAAM,QAAQ,MAAM,YAAY,CAAC,cAAc;AAC/C,QAAM,aAAa,YAAY,QAAQ;AAEvC,SACE,qBAAC,OACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,GAAG;AAAA,QACH,QAAQ,UAAU;AAAA,QAClB,OAAO;AAAA,UACL,MAAM,UAAU,QAAQ,OAAO,MAAM,SAAS;AAAA,UAC9C,aAAa;AAAA,QACf;AAAA;AAAA,IACF;AAAA,IACC,QACC,qBAAC,OACC;AAAA,0BAAC,UAAK,IAAI,GAAG,IAAQ,IAAI,IAAI,IAAQ,QAAO,SAAQ,OAAO,EAAE,iBAAiB,QAAQ,aAAa,IAAI,GAAG;AAAA,MAC1G,oBAAC,UAAK,GAAG,OAAO,GAAG,IAAI,YAAwB,mBAAkB,UAAS,OAAO,EAAE,UAAU,GAAG,GAC7F,gBACH;AAAA,OACF;AAAA,KAEJ;AAEJ;AAEA,IAAO,iBAAQ","sourcesContent":["import React from \"react\";\nimport { guideLength, textPadding } from \"./Bubbles\";\n\nexport interface BubbleProps {\n\tradius: number;\n\tmaxRadius: number;\n\ttext?: string;\n\ttextAlign?: \"left\" | \"right\";\n\tcolor?: string;\n\tstroke?: string;\n\tpattern?: string;\n\tgap?: number;\n}\n\nconst Bubble = ({ radius, maxRadius, text, textAlign, color, stroke, pattern }: BubbleProps) => {\n const leftAlign = textAlign === \"left\";\n const x = maxRadius;\n const y = maxRadius * 2 - radius;\n const x2 = leftAlign ? x - maxRadius - guideLength : x + maxRadius + guideLength;\n const y2 = maxRadius * 2 - radius * 2;\n const textX = x2 + (leftAlign ? -textPadding : textPadding);\n const textAnchor = leftAlign ? \"end\" : \"start\";\n\n return (\n <g>\n <circle\n cx={x}\n cy={y}\n r={radius}\n stroke={stroke || \"#000\"}\n style={{\n fill: pattern ? `url(#${pattern})` : color || \"none\",\n strokeWidth: 0.5,\n }}\n />\n {text && (\n <g>\n <line x1={x} x2={x2} y1={y2} y2={y2} stroke=\"black\" style={{ strokeDasharray: \"2, 2\", strokeWidth: 0.5 }} />\n <text x={textX} y={y2} textAnchor={textAnchor} alignmentBaseline=\"middle\" style={{ fontSize: 12 }}>\n {text}\n </text>\n </g>\n )}\n </g>\n );\n};\n\nexport default Bubble;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.tsx"],"names":["smallestGap"],"mappings":"AA6IY;AA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AAC,MAAM,SAAU,KAAK,UAAU,aAAa,KAAK,SAAS,YAAY,KAAK,SAAS,YAAY,OAAO,IAAK;AAE9I,kBAAY,KAAK,QAAQ,QAAQ,SAAS,CAAC;AAAA,IAC7C;AAEA,YAAQ,QAAQ,CAAC,GAAG,MAAM;AACxB,UAAI,CAAC,YAAY,SAAS,CAAC,GAAG;AAC5B,eAAO,EAAE;AAAA,MACX;AAAA,IACF,CAAC;AAAA,EACH;AAEA,eAAa,KAAK,KAAK,qBAAqB,SAAS,MAAM,IAAI,UAAU;AAEzE,QAAM,SAAS,aAAa,cAAc;AAE1C,SACE,oBAAC,SAAI,OACH,8BAAC,SAAI,OAAO,aAAa,QAAQ,SAAS,IACxC,8BAAC,OAAE,WAAW,aAAa,YAAY,SAAS,IAAI,QACjD,kBAAQ,IAAI,CAAC,QAAQ,MACpB,oBAAC,UAAgB,GAAG,QAAQ,WAAW,aAAa,IAAI,KAAK,IAAI,SAAS,WAA7D,CAAsE,CACpF,GACH,GACF,GACF;AAEJ;AAEA,IAAO,kBAAQ,KAAK,OAAO","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { scaleSqrt } from \"d3-scale\";\nimport { reduce } from \"lodash\";\nimport React, { memo } from \"react\";\nimport { getContrastColor } from \"../../../../../../../../../utils/colors\";\nimport { getLongestTextLength } from \"../../../../../../../../../utils/helpers\";\nimport Bubble, { BubbleProps } from \"./Bubble\";\n\nconst style = {\n\tpaddingTop: 10,\n\tdisplay: \"flex\",\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n};\n\nconst legendWidth = 200;\nconst digitWidth = 6.8;\nexport const guideLength = 16;\nexport const textPadding = 4;\n\nconst Bubbles = ({ radiusLow, radiusHigh, color, classes }: { radiusLow: number; radiusHigh: number; color?: string; classes: Array<any> }) => {\n const height = radiusHigh * 2 + 4;\n const scale = scaleSqrt().range([radiusLow, radiusHigh]);\n const radiusMid = scale(0.5);\n\n if (isNaN(radiusLow) || isNaN(radiusHigh)) {\n return null;\n }\n\n let bubbles: Array<BubbleProps> = [];\n\n // If color legend\n if (Array.isArray(classes) && classes.length) {\n const startValue = classes[0].startValue;\n const endValue = classes[classes.length - 1].endValue;\n const itemScale = scale.domain([startValue, endValue]);\n\n bubbles = [...classes].reverse().map((c) => ({\n radius: itemScale(c.endValue),\n maxRadius: radiusHigh,\n color: c.color,\n text: String(c.endValue),\n }));\n\n // Add the smallest bubble for the lowest value\n bubbles.push({\n radius: itemScale(startValue),\n maxRadius: radiusHigh,\n text: String(startValue),\n });\n } else {\n // If single color\n const stroke = color && getContrastColor(color);\n\n bubbles = [\n {\n radius: radiusHigh,\n maxRadius: radiusHigh,\n color,\n stroke,\n text: i18n.t(\"Max\"),\n },\n {\n radius: radiusMid,\n maxRadius: radiusHigh,\n color,\n stroke,\n text: i18n.t(\"Mid\"),\n },\n {\n radius: radiusLow,\n maxRadius: radiusHigh,\n color,\n stroke,\n text: i18n.t(\"Min\"),\n },\n ];\n }\n\n // Calculate the pixel length of the longest number\n let textLength = Math.ceil(Math.max(getLongestTextLength(classes, \"startValue\"), getLongestTextLength(classes, \"endValue\")) * digitWidth);\n\n // Calculate the total length if numbers are alternate on each side\n const alternateLength = (radiusHigh + guideLength + textPadding + textLength) * 2;\n\n let smallestGap = reduce(bubbles, (prev, curr: any, i) => {\n const gap = prev.radius - curr.radius;\n const smallestGap = prev.gap === undefined || gap < prev.gap ? gap : prev.gap;\n\n return i === bubbles.length - 1\n ? Math.round(smallestGap * 2)\n : {\n radius: curr.radius,\n gap: smallestGap,\n };\n });\n\n const alternateFit = alternateLength < legendWidth;\n\n const alternate = alternateFit && smallestGap > 5 && smallestGap < 12;\n\n if (!alternateFit) {\n smallestGap = smallestGap / 2;\n }\n\n // Too cramped to show number for each bubble\n if (smallestGap < 4) {\n const [maxBubble] = bubbles;\n const minBubble = bubbles[bubbles.length - 1];\n const gap = maxBubble.radius - minBubble.radius;\n const showNumbers = [0]; // Always show the largest number\n\n if (gap > 4) {\n showNumbers.push(bubbles.length - 1);\n }\n\n if (gap > 15) {\n const midRadius = minBubble.radius + gap / 2;\n\n // Find the closest bubble above the mid-radius\n const midBubble = bubbles.reduce((prev, curr) => (curr.radius >= midRadius && curr.radius - midRadius < prev.radius - midRadius ? curr : prev));\n\n showNumbers.push(bubbles.indexOf(midBubble));\n }\n\n bubbles.forEach((b, i) => {\n if (!showNumbers.includes(i)) {\n delete b.text;\n }\n });\n }\n\n textLength = Math.ceil(getLongestTextLength(bubbles, \"text\") * digitWidth);\n\n const offset = textLength + guideLength + textPadding;\n\n return (\n <div style={style}>\n <svg width={legendWidth} height={height + 50}>\n <g transform={`translate(${alternate ? offset : \"16\"} 24)`}>\n {bubbles.map((bubble, i) => (\n <Bubble key={i} {...bubble} textAlign={alternate && i % 2 == 0 ? \"left\" : \"right\"} />\n ))}\n </g>\n </svg>\n </div>\n );\n};\n\nexport default memo(Bubbles);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.tsx"],"names":[],"mappings":"AA+BE,SACC,KADD;AA/BF,SAAS,eAAe;AAExB,SAAgB,kBAAkB;AAKlC,OAAO,sBAAsB;AAC7B,OAAO,aAAa;AAEpB,SAAS,aACR;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GASA,KACC;AACD,SACC,qBAAC,SAAI,WAAU,eAAc,KAC5B;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAO,SAAS;AAAA,QAChB;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA,oBAAC,WAAQ,QAAQ,KAAK;AAAA,IACtB,oBAAC,SAAI,WAAU,oBACd;AAAA,MAAC;AAAA;AAAA,QACA,SAAS,QAAQ,QAAQ;AAAA,QACzB,YAAY,OAAO;AAAA,QACnB,WAAW,OAAO;AAAA,QAClB,OAAO;AAAA;AAAA,IACR,GACD;AAAA,KACD;AAEF;AAEA,IAAO,uBAAQ,WAAW,YAAY","sourcesContent":["import { Divider } from \"@dhis2/ui\";\nimport type { Legend } from \"@hisptz/dhis2-utils\";\nimport React, { forwardRef } from \"react\";\nimport {\n\tThematicLayerData,\n\tThematicLayerDataItem,\n} from \"../../../../../../interfaces\";\nimport LegendCardHeader from \"../../../../../LegendArea/components/LegendCardHeader\";\nimport Bubbles from \"./components/Bubbles\";\n\nfunction BubbleLegend(\n\t{\n\t\tradius,\n\t\tdataItem,\n\t\tdata,\n\t\tname,\n\t\tcollapsible,\n\t\tonCollapse,\n\t\tlegends,\n\t}: {\n\t\tradius: { min: number; max: number };\n\t\tdataItem: ThematicLayerDataItem;\n\t\tdata: ThematicLayerData[];\n\t\tname?: string;\n\t\tcollapsible?: boolean;\n\t\tonCollapse?: () => void;\n\t\tlegends: Legend[];\n\t},\n\tref: React.LegacyRef<HTMLDivElement> | undefined,\n) {\n\treturn (\n\t\t<div className=\"legend-card\" ref={ref}>\n\t\t\t<LegendCardHeader\n\t\t\t\ttitle={dataItem.displayName}\n\t\t\t\tonCollapse={onCollapse}\n\t\t\t\tcollapsible={collapsible}\n\t\t\t/>\n\t\t\t<Divider margin={\"0\"} />\n\t\t\t<div className=\"legend-list pt-8\">\n\t\t\t\t<Bubbles\n\t\t\t\t\tclasses={legends.reverse()}\n\t\t\t\t\tradiusHigh={radius.max}\n\t\t\t\t\tradiusLow={radius.min}\n\t\t\t\t\tcolor={\"#FF0000\"}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default forwardRef(BubbleLegend);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.tsx"],"names":[],"mappings":"AAyCI,mBAeI,WAfJ;AAzCJ,SAAS,cAAc;AAEvB,SAAS,eAAe;AACxB,SAAgB,eAAe;AAC/B,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,OAAO,mBAAmB;AAE1B,MAAM,eAAe;AAAA,EACpB,QAAQ;AACT;AACA,MAAM,iBAAiB;AAAA,EACrB,QAAQ;AACV;AAEe,SAAR,OAAwB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,QAAM,EAAE,SAAS,MAAM,MAAM,IAAI,QAAQ,CAAC;AAE1C,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,SAAS,QAAQ,aAAa,EAAE,UAAU,EAAE,UAAU;AAE5D,QAAM,eAAe,QAAQ,MAAM;AACjC,YAAS,SAAS,MAAM,QAAQ,OAAO,MAAO;AAAA,EAChD,GAAG,CAAC,QAAQ,MAAM,WAAW,CAAC;AAE9B,SACE,gCACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,eAAe;AAAA,QACb,WAAW,CAAC,MAAM,iBAAiB,GAAG,cAAc;AAAA,QACpD,UAAU,CAAC,MAAM,eAAe,GAAG,YAAY;AAAA,MACjD;AAAA,MACA,aAAa;AAAA,QACX,WAAW,sBAAsB,SAAS,KAAK,IAAI;AAAA,QACnD,aAAa;AAAA,QACb,OAAO,OAAO;AAAA,QACd,QAAQ;AAAA,MACV;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA,8BAAC,iBAAc,MAAY;AAAA;AAAA,EAC7B,GACF;AAEJ","sourcesContent":["import { colors } from \"@dhis2/ui\";\nimport type { Legend } from \"@hisptz/dhis2-utils\";\nimport { geoJSON } from \"leaflet\";\nimport React, { useMemo } from \"react\";\nimport { CircleMarker } from \"react-leaflet\";\nimport {\n\tgetColorFromLegendSet,\n\thighlightFeature,\n\tresetHighlight,\n} from \"../../../../../../utils/map\";\nimport { ThematicLayerData } from \"../../../../interfaces\";\nimport CustomTooltip from \"../CustomTooltip\";\n\nconst defaultStyle = {\n\tweight: 1,\n};\nconst highlightStyle = {\n weight: 2,\n};\n\nexport default function Bubble({\n data,\n highestData,\n legends,\n radius,\n}: {\n data: ThematicLayerData;\n highestData: number;\n legends: Legend[];\n radius?: { min: number; max: number };\n}) {\n const { orgUnit, data: value } = data ?? {};\n\n const geoJSONObject = orgUnit.geoJSON;\n const center = geoJSON(geoJSONObject).getBounds().getCenter();\n\n const circleRadius = useMemo(() => {\n return ((value ?? 0) * (radius?.max ?? 50)) / highestData;\n }, [radius, data, highestData]);\n\n return (\n <>\n <CircleMarker\n interactive\n eventHandlers={{\n mouseover: (e) => highlightFeature(e, highlightStyle),\n mouseout: (e) => resetHighlight(e, defaultStyle),\n }}\n pathOptions={{\n fillColor: getColorFromLegendSet(legends, data.data),\n fillOpacity: 1,\n color: colors.grey900,\n weight: 1,\n }}\n radius={circleRadius}\n center={center}>\n <CustomTooltip data={data} />\n </CircleMarker>\n </>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.tsx"],"names":[],"mappings":"AAmBE,SACC,KADD;AAnBF,OAAO;AACP,SAAS,eAAe;AAExB,SAAgB,kBAAkB;AAClC,SAAS,sBAAsB;AAK/B,OAAO,sBAAsB;AAEtB,SAAS,WAAW;AAAA,EAC1B;AAAA,EACA;AACD,GAGG;AACF,SACC,qBAAC,SAAI,WAAU,eACd;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,OAAO,EAAE,iBAAiB,OAAO,MAAM;AAAA;AAAA,IACxC;AAAA,IACA,oBAAC,SAAI,WAAU,qBAAqB,aAAG,OAAO,UAAU,MAAM,OAAO,QAAQ,IAAG;AAAA,IAChF,oBAAC,SAAI,WAAU,qBAAqB,cAAI,KAAK,KAAI;AAAA,KAClD;AAEF;AAEA,SAAS,iBACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACA,KACA;AACA,SACE,qBAAC,SAAI,WAAU,eAAc,KAC3B;AAAA,wBAAC,oBAAiB,OAAO,SAAS,aAAa,aAA0B,YAAwB;AAAA,IACjG,oBAAC,WAAQ,QAAQ,KAAK;AAAA,IACtB,oBAAC,SAAI,WAAU,oBACZ,mBAAS,IAAI,CAAC,WACb,oBAAC,cAAgD,QAAgB,OAAO,eAAe,QAAQ,IAAI,KAAlF,GAAG,QAAQ,KAAK,cAAqE,CACvG,GACH;AAAA,KACF;AAEJ;AAEA,IAAO,2BAAQ,WAAW,gBAAgB","sourcesContent":["import \"../../../styles/legends.css\";\nimport { Divider } from \"@dhis2/ui\";\nimport type { Legend } from \"@hisptz/dhis2-utils\";\nimport React, { forwardRef } from \"react\";\nimport { getLegendCount } from \"../../../../../../../utils/map\";\nimport {\n\tThematicLayerData,\n\tThematicLayerDataItem,\n} from \"../../../../../interfaces\";\nimport LegendCardHeader from \"../../../../LegendArea/components/LegendCardHeader\";\n\nexport function LegendItem({\n\tlegend,\n\tvalue,\n}: {\n\tlegend: { startValue: number; endValue: number; color: string };\n\tvalue: number;\n}) {\n\treturn (\n\t\t<div className=\"legend-item\">\n\t\t\t<div\n\t\t\t\tclassName=\"legend-item-color\"\n\t\t\t\tstyle={{ backgroundColor: legend.color }}\n\t\t\t/>\n\t\t\t<div className=\"legend-item-label\">{`${legend.startValue} - ${legend.endValue}`}</div>\n\t\t\t<div className=\"legend-item-value\">{`(${value})`}</div>\n\t\t</div>\n\t);\n}\n\nfunction ChoroplethLegend(\n {\n dataItem,\n data,\n name,\n collapsible,\n onCollapse,\n legends,\n }: { data: ThematicLayerData[]; dataItem: ThematicLayerDataItem; name?: string; collapsible?: boolean; onCollapse?: () => void; legends: Legend[] },\n ref: React.LegacyRef<HTMLDivElement> | undefined\n) {\n return (\n <div className=\"legend-card\" ref={ref}>\n <LegendCardHeader title={dataItem.displayName} collapsible={collapsible} onCollapse={onCollapse} />\n <Divider margin={\"0\"} />\n <div className=\"legend-list pt-8\">\n {legends?.map((legend: any) => (\n <LegendItem key={`${legend?.color}-legend-list`} legend={legend} value={getLegendCount(legend, data)} />\n ))}\n </div>\n </div>\n );\n}\n\nexport default forwardRef(ChoroplethLegend);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.tsx"],"names":[],"mappings":"AAuBI,mBAcI,WAdJ;AAvBJ,SAAS,cAAc;AAGvB,SAAS,eAAe;AAExB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,OAAO,mBAAmB;AAE1B,MAAM,eAAe;AAAA,EACpB,QAAQ;AACT;AACA,MAAM,iBAAiB;AAAA,EACrB,QAAQ;AACV;AAEe,SAAR,WAA4B,EAAE,MAAM,QAAQ,GAAyG;AAC1J,QAAM,EAAE,QAAQ,IAAI;AACpB,SACE,gCACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,QAAQ;AAAA,MACd,eAAe;AAAA,QACb,WAAW,CAAC,MAAM,iBAAiB,GAAG,cAAc;AAAA,QACpD,UAAU,CAAC,MAAM,eAAe,GAAG,YAAY;AAAA,MACjD;AAAA,MACA,aAAa;AAAA,QACX,WAAW,sBAAsB,SAAS,KAAK,IAAI;AAAA,QACnD,aAAa;AAAA,QACb,OAAO,OAAO;AAAA,QACd,QAAQ;AAAA,MACV;AAAA,MAEA,8BAAC,iBAAc,MAAY;AAAA;AAAA,IADtB,GAAG,KAAK,SAAS,EAAE;AAAA,EAE1B,GACF;AAEJ","sourcesContent":["import { colors } from \"@dhis2/ui\";\nimport type { Legend } from \"@hisptz/dhis2-utils\";\nimport React from \"react\";\nimport { GeoJSON } from \"react-leaflet\";\nimport { MapOrgUnit } from \"../../../../../../interfaces\";\nimport {\n\tgetColorFromLegendSet,\n\thighlightFeature,\n\tresetHighlight,\n} from \"../../../../../../utils/map\";\nimport { ThematicLayerDataItem } from \"../../../../interfaces\";\nimport CustomTooltip from \"../CustomTooltip\";\n\nconst defaultStyle = {\n\tweight: 1,\n};\nconst highlightStyle = {\n weight: 2,\n};\n\nexport default function Choropleth({ data, legends }: { data: { orgUnit: MapOrgUnit; data?: number; dataItem: ThematicLayerDataItem }; legends: Legend[] }) {\n const { orgUnit } = data;\n return (\n <>\n <GeoJSON\n data={orgUnit.geoJSON}\n eventHandlers={{\n mouseover: (e) => highlightFeature(e, highlightStyle),\n mouseout: (e) => resetHighlight(e, defaultStyle),\n }}\n pathOptions={{\n fillColor: getColorFromLegendSet(legends, data.data),\n fillOpacity: 1,\n color: colors.grey900,\n weight: 1,\n }}\n key={`${data.dataItem.id}-layer`}>\n <CustomTooltip data={data} />\n </GeoJSON>\n </>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.tsx"],"names":[],"mappings":"AAmBG,SAIC,KAJD;AAnBH,OAAO,UAAU;AAEjB,SAAS,MAAM,OAAO,eAAe;AACrC,SAAS,qBAAqB;AAGf,SAAR,cAA+B;AAAA,EACrC,MAAM;AACP,GAEG;AACF,QAAM,EAAE,UAAU,SAAS,KAAK,IAAI,cAAc,CAAC;AACnD,QAAM,EAAE,QAAQ,IAAI,cAAc,KAAK,CAAC;AAExC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAM,GAAG,SAAS,WAAW,IAAI,QAAQ,EAAE;AAAA,MAC3C,MAAK;AAAA,MAEL;AAAA,6BAAC,WACC;AAAA,mBAAS;AAAA,UAAK;AAAA,UAAG;AAAA,UAAK;AAAA,WACxB;AAAA,QACA,qBAAC,SAAM,UAAU,IAChB;AAAA,8BAAC,QAAG,OAAO,EAAE,QAAQ,EAAE,GAAI,mBAAS,MAAK;AAAA,UACzC,oBAAC,SAAK,oBAAU,aAAY;AAAA,UAC5B,oBAAC,SAAK,mBAAS,IAAI,CAAC,WAAW,OAAO,IAAI,EAAE,KAAK,GAAG,GAAE;AAAA,UACtD,qBAAC,SACC;AAAA,iBAAK,EAAE,OAAO;AAAA,YAAE;AAAA,YAAG;AAAA,aACrB;AAAA,WACD;AAAA;AAAA;AAAA,EACD;AAEF","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport React from \"react\";\nimport { Pane, Popup, Tooltip } from \"react-leaflet\";\nimport { useMapPeriods } from \"../../../../../MapProvider/hooks\";\nimport { ThematicLayerData } from \"../../../../interfaces\";\n\nexport default function CustomTooltip({\n\tdata: dataObject,\n}: {\n\tdata: ThematicLayerData;\n}) {\n\tconst { dataItem, orgUnit, data } = dataObject ?? {};\n\tconst { periods } = useMapPeriods() ?? {};\n\n\treturn (\n\t\t<Pane\n\t\t\tname={`${dataItem.displayName}-${orgUnit.id}-popup-pane`}\n\t\t\tpane=\"popupPane\"\n\t\t>\n\t\t\t<Tooltip>\n\t\t\t\t{orgUnit?.name} ({data})\n\t\t\t</Tooltip>\n\t\t\t<Popup minWidth={80}>\n\t\t\t\t<h3 style={{ margin: 0 }}>{orgUnit?.name}</h3>\n\t\t\t\t<div>{dataItem?.displayName}</div>\n\t\t\t\t<div>{periods?.map((period) => period.name).join(\",\")}</div>\n\t\t\t\t<div>\n\t\t\t\t\t{i18n.t(\"Value\")}: {data}\n\t\t\t\t</div>\n\t\t\t</Popup>\n\t\t</Pane>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AAGlB,SAAR,iBACN,SACkC;AAClC,QAAM,EAAE,OAAO,IAAI,WAAW,gBAAgB;AAE9C,SAAO,KAAK,QAAiC,CAAC,MAAM,OAAO,CAAC;AAC7D","sourcesContent":["import { find } from \"lodash\";\nimport { useContext } from \"react\";\nimport { MapLayersContext } from \"../../../../../state\";\nimport { CustomThematicLayer } from \"../../../interfaces\";\n\nexport default function useThematicLayer(\n\tlayerId: string,\n): CustomThematicLayer | undefined {\n\tconst { layers } = useContext(MapLayersContext);\n\n\treturn find(layers as CustomThematicLayer[], [\"id\", layerId]);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/index.tsx"],"names":[],"mappings":"AAwBE,mBAWM,KAHH,YARH;AAxBF,SAAS,YAAY;AAErB,SAAS,YAAY,eAAe,YAAY;AAEhD,OAAO,YAAY;AACnB,OAAO,gBAAgB;AACvB,OAAO,sBAAsB;AAEd,SAAR,cAA+B;AAAA,EACrC;AAAA,EACA;AACD,GAGG;AACF,QAAM,QAAQ,iBAAiB,OAAO;AAEtC,MAAI,CAAC,OAAO;AACX,WAAO;AAAA,EACR;AAEA,QAAM,EAAE,MAAM,UAAU,MAAM,MAAM,SAAS,QAAQ,IAAI,SAAS,CAAC;AACnE,QAAM,aAAa,QAAQ,SAAS;AACpC,SACC,gCACC,8BAAC,cAAc,SAAd,EAAsB,SAAS,SAAS,MAAM,YAC9C;AAAA,IAAC;AAAA;AAAA,MACA,OAAO;AAAA,QACN,QAAQ,SAAS,WAAW,MAAM,OAAO,QAAQ;AAAA,MAClD;AAAA,MACA,MAAM;AAAA,MAEN,+BAAC,cACC;AAAA,cAAM;AAAA,UAAI,CAAC,UACX,SAAS,eACR;AAAA,YAAC;AAAA;AAAA,cACA,SAAS,WAAW,CAAC;AAAA,cACrB,MAAM;AAAA;AAAA,YACD,GAAG,OAAO,UAAU,EAAE,IAAI,OAAO,SAAS,EAAE;AAAA,UAClD,IACG;AAAA,QACL;AAAA,QACC,MAAM;AAAA,UAAI,CAAC,UACX,SAAS,WACR;AAAA,YAAC;AAAA;AAAA,cACA,QACE,OAA6B;AAAA,cAE/B,SAAS,WAAW,CAAC;AAAA,cACrB,aAAa,KAAK,IAAI,GAAG,QAAQ;AAAA,cACjC,MAAM;AAAA;AAAA,YACD,GAAG,OAAO,UAAU,EAAE,IAAI,OAAO,SAAS,EAAE;AAAA,UAClD,IACG;AAAA,QACL;AAAA,SACD;AAAA;AAAA,EACD,GACD,GACD;AAEF","sourcesContent":["import { last } from \"lodash\";\nimport React from \"react\";\nimport { LayerGroup, LayersControl, Pane } from \"react-leaflet\";\nimport { CustomBubbleLayer } from \"../../interfaces\";\nimport Bubble from \"./components/Bubble\";\nimport Choropleth from \"./components/Choropleth\";\nimport useThematicLayer from \"./hooks/config\";\n\nexport default function ThematicLayer({\n\tlayerId,\n\tindex,\n}: {\n\tlayerId: string;\n\tindex: number;\n}) {\n\tconst layer = useThematicLayer(layerId);\n\n\tif (!layer) {\n\t\treturn null;\n\t}\n\n\tconst { type, dataItem, name, data, enabled, legends } = layer ?? {};\n\tconst uniqueName = name ?? dataItem.displayName;\n\treturn (\n\t\t<>\n\t\t\t<LayersControl.Overlay checked={enabled} name={uniqueName}>\n\t\t\t\t<Pane\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tzIndex: type === \"bubble\" ? 500 : 500 - (index + 1),\n\t\t\t\t\t}}\n\t\t\t\t\tname={uniqueName}\n\t\t\t\t>\n\t\t\t\t\t<LayerGroup>\n\t\t\t\t\t\t{data?.map((datum) =>\n\t\t\t\t\t\t\ttype === \"choropleth\" ? (\n\t\t\t\t\t\t\t\t<Choropleth\n\t\t\t\t\t\t\t\t\tlegends={legends ?? []}\n\t\t\t\t\t\t\t\t\tdata={datum}\n\t\t\t\t\t\t\t\t\tkey={`${datum?.dataItem?.id}-${datum?.orgUnit?.id}-layer`}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null,\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{data?.map((datum) =>\n\t\t\t\t\t\t\ttype === \"bubble\" ? (\n\t\t\t\t\t\t\t\t<Bubble\n\t\t\t\t\t\t\t\t\tradius={\n\t\t\t\t\t\t\t\t\t\t(layer as CustomBubbleLayer)?.radius\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlegends={legends ?? []}\n\t\t\t\t\t\t\t\t\thighestData={last(data)?.data ?? 1}\n\t\t\t\t\t\t\t\t\tdata={datum}\n\t\t\t\t\t\t\t\t\tkey={`${datum?.dataItem?.id}-${datum?.orgUnit?.id}-layer`}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</LayerGroup>\n\t\t\t\t</Pane>\n\t\t\t</LayersControl.Overlay>\n\t\t</>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/MapLayer/index.tsx"],"names":[],"mappings":"AA0BU;AAzBV,OAAO,mBAAmB;AAC1B,OAAO,uBAAuB;AAC9B,SAAS,kBAAkB;AAC3B,OAAO,mBAAmB;AAQX,SAAR,SAA0B;AAAA,EAChC;AAAA,EACA;AACD,GAOG;AACF,UAAQ,MAAM,MAAM;AAAA,IACnB,KAAK;AAAA,IACL,KAAK;AACJ,aAAO,oBAAC,iBAAe,GAAG,OAAO;AAAA,IAClC,KAAK;AAAA,IACL,KAAK;AACJ,aAAO,oBAAC,iBAAc,SAAS,MAAM,IAAI,OAAc;AAAA,IACxD,KAAK;AACJ,aAAO,oBAAC,cAAW;AAAA,IACpB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACJ,aAAO,oBAAC,qBAAkB,SAAS,MAAM,IAAI;AAAA,IAC9C;AACC,aAAO;AAAA,EACT;AACD","sourcesContent":["import React from \"react\";\nimport BoundaryLayer from \"./components/BoundaryLayer\";\nimport GoogleEngineLayer from \"./components/GoogleEngineLayer\";\nimport { PointLayer } from \"./components/PointLayer\";\nimport ThematicLayer from \"./components/ThematicLayer\";\nimport {\n\tCustomBoundaryLayer,\n\tCustomGoogleEngineLayer,\n\tCustomPointLayer,\n\tCustomThematicLayer,\n} from \"./interfaces\";\n\nexport default function MapLayer({\n\tlayer,\n\tindex,\n}: {\n\tlayer:\n\t\t| CustomThematicLayer\n\t\t| CustomBoundaryLayer\n\t\t| CustomPointLayer\n\t\t| CustomGoogleEngineLayer;\n\tindex: number;\n}) {\n\tswitch (layer.type) {\n\t\tcase \"overlay\":\n\t\tcase \"basemap\":\n\t\t\treturn <BoundaryLayer {...layer} />;\n\t\tcase \"bubble\":\n\t\tcase \"choropleth\":\n\t\t\treturn <ThematicLayer layerId={layer.id} index={index} />;\n\t\tcase \"point\":\n\t\t\treturn <PointLayer />;\n\t\tcase \"population\":\n\t\tcase \"elevation\":\n\t\tcase \"footprints\":\n\t\tcase \"landCover\":\n\t\t\treturn <GoogleEngineLayer layerId={layer.id} />;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n"]}
@@ -1,5 +0,0 @@
1
- const SUPPORTED_EARTH_ENGINE_LAYERS = ["population", "footprints", "elevation", "landCover"];
2
-
3
- export { SUPPORTED_EARTH_ENGINE_LAYERS };
4
- //# sourceMappingURL=out.js.map
5
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/components/Map/components/MapLayer/interfaces/index.ts"],"names":[],"mappings":"AASO,MAAM,gCAAgC,CAAC,cAAc,cAAc,aAAa,WAAW","sourcesContent":["import type { Legend } from \"@hisptz/dhis2-utils\";\nimport { MapOrgUnit, PointOrgUnit } from \"../../../interfaces\";\nimport { LegendColorScale } from \"../../../utils/colors\";\nimport { EarthEngineOptions } from \"../components/GoogleEngineLayer/interfaces\";\nimport { EarthEngine } from \"../components/GoogleEngineLayer/services/engine\";\n\nexport type BoundaryLayerType = \"basemap\" | \"overlay\";\nexport type ThematicLayerType = \"choropleth\" | \"bubble\";\n\nexport const SUPPORTED_EARTH_ENGINE_LAYERS = [\"population\", \"footprints\", \"elevation\", \"landCover\"];\n\nexport type GoogleEngineLayerType = \"population\" | \"footprints\" | \"elevation\" | \"landCover\";\n\nexport interface CustomBoundaryLayer extends CustomMapLayer {\n id: string;\n type: BoundaryLayerType;\n enabled: boolean;\n}\n\nexport interface EarthEngineLayerConfig extends CustomMapLayer {\n type: GoogleEngineLayerType;\n aggregations?: string[];\n name?: string;\n filters?: {\n period: string;\n };\n params?: {\n min: number;\n max: number;\n palette?: string;\n };\n}\n\nexport interface CustomGoogleEngineLayer extends CustomMapLayer {\n type: GoogleEngineLayerType;\n options: EarthEngineOptions;\n aggregations?: string[];\n name: string;\n url: string;\n engine?: EarthEngine;\n}\n\nexport interface CustomPointLayer extends CustomMapLayer {\n id: string;\n type: \"point\";\n label?: string;\n level?: string | number;\n group?: string;\n style?: {\n icon?: string;\n groupSet?: string;\n orgUnitGroups?: Array<{ name: string; symbol: string }>;\n };\n points?: Array<PointOrgUnit>;\n}\n\nexport type DataItemType = \"dataElement\" | \"indicator\" | \"programIndicator\";\n\nexport interface ThematicLayerDataItem {\n id: string;\n displayName: string;\n type: DataItemType;\n legendSet?: string;\n legendConfig?: {\n colorClass: LegendColorScale;\n scale: number;\n };\n}\n\nexport interface ThematicLayerControl {\n position: \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\";\n enabled: boolean;\n}\n\nexport interface ThematicLayerData {\n orgUnit: MapOrgUnit;\n data?: number;\n dataItem: ThematicLayerDataItem;\n}\n\nexport interface ThematicLayerRawData {\n orgUnit: string;\n data?: number;\n dataItem: string;\n}\n\nexport interface CustomChoroplethLayer extends CustomMapLayer {\n enabled: boolean;\n name?: string;\n data: ThematicLayerData[];\n dataItem: ThematicLayerDataItem;\n type: \"choropleth\";\n control?: ThematicLayerControl;\n legends?: Legend[];\n}\n\nexport interface CustomBubbleLayer extends CustomMapLayer {\n enabled: boolean;\n name?: string;\n data: ThematicLayerData[];\n dataItem: ThematicLayerDataItem;\n type: \"bubble\";\n control?: ThematicLayerControl;\n legends?: Legend[];\n radius?: {\n min: number;\n max: number;\n };\n}\n\nexport type CustomThematicLayer = CustomBubbleLayer | CustomChoroplethLayer;\n\nexport interface ThematicLayerConfig {\n id: string;\n data?: ThematicLayerRawData[];\n enabled: boolean;\n name?: string;\n dataItem: ThematicLayerDataItem;\n type: ThematicLayerType;\n control?: ThematicLayerControl;\n radius?: {\n min: number;\n max: number;\n };\n}\n\nexport interface CustomMapLayer {\n id: string;\n type: string;\n enabled: boolean;\n}\n\nexport type MapLayer = CustomBoundaryLayer | ThematicLayerConfig | CustomPointLayer | CustomGoogleEngineLayer;\n\nexport interface MapLayerProps {\n enabled: boolean;\n type: \"boundary\" | \"thematic\" | \"external\" | \"point\" | \"earthEngine\";\n layer: MapLayer;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../src/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.tsx"],"names":["pe","ou","row","ouGroup"],"mappings":"AAAA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,wBAAwB,qBAAqB;AACtD,SAAS,aAAa,SAAS,gBAAgB;AAC/C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,qBAAqB;AAS9B,SAAS,UAAU,WAAW;AAE9B;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AAGpC,MAAM,iBAAiB;AAAA,EACtB,WAAW;AAAA,IACV,UAAU;AAAA,IACV,QAAQ,CAAC,EAAE,IAAI,IAAI,IAAI,WAAW,QAAQ,MAAW;AACpD,YAAM,cAAc,CAAC,QAAQ,EAAE,IAC5B,MAAM,IAAI,KAAK,GAAG,CAAC,KACnB;AACH,YAAM,cAAc,CAAC,QAAQ,EAAE,IAC5B,MAAM,IAAI,KAAK,GAAG,CAAC,KACnB;AACH,YAAM,cAAc,CAAC,QAAQ,EAAE,IAC5B,MAAM,IAAI,KAAK,GAAG,CAAC,KACnB;AAEH,aAAO;AAAA,QACN,WAAW,QAAQ,CAAC,aAAa,aAAa,WAAW,CAAC;AAAA,QAC1D;AAAA,QACA;AAAA,QACA,iBAAiB;AAAA,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oBAAM,iBACL,KAAK,qBAAqB,CAAC,MAAM,MAAM,IAAI,CAAC,KAC5C,CAAC;AACF,oBAAM,UAA8B;AAAA,gBACnC,GAAG;AAAA,gBACH,cACC,MAAM,gBACN,gBAAgB;AAAA,gBACjB,QAAQ,MAAM,UAAU,gBAAgB;AAAA,cACzC;AACA,oBAAM,eAAe;AAAA,gBACpB,GAAG;AAAA,gBACH;AAAA,cACD;AACA,oBAAM,cAAc,IAAI,YAAY,EAAE,QAAQ,CAAC;AAC/C,oBAAM,MAAM,MAAM;AAAA,gBACjB;AAAA,gBACA;AAAA,cACD;AACA,qBAAO;AAAA,gBACN,GAAG;AAAA,gBACH,QAAQ;AAAA,gBACR;AAAA,cACD;AAAA,YACD,SAAS,GAAG;AACX,sBAAQ,MAAM,CAAC;AACf;AAAA,YACD;AAAA,UACD,CAAC;AAAA,QACF;AAAA,MACD,SAAS,GAAQ;AAChB,gBAAQ,MAAM,iCAAiC,EAAE,OAAO;AACxD,eAAO,CAAC;AAAA,MACT;AAAA,IACD;AAAA,IACA,CAAC,OAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACN;AAAA,EACD;AACD","sourcesContent":["import {\n\tcompact,\n\tdifferenceBy,\n\tfind,\n\thead,\n\tisEmpty,\n\tlast,\n\tsortBy,\n} from \"lodash\";\nimport { useMapOrganisationUnit, useMapPeriods } from \"../../../hooks\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport {\n\tgenerateLegends,\n\tgetOrgUnitsSelection,\n\tsanitizeDate,\n\tsanitizeOrgUnits,\n\ttoGeoJson,\n} from \"../../../../../utils/map\";\nimport { useDataEngine } from \"@dhis2/app-runtime\";\nimport {\n\tCustomGoogleEngineLayer,\n\tCustomPointLayer,\n\tCustomThematicLayer,\n\tEarthEngineLayerConfig,\n\tThematicLayerConfig,\n} from \"../../../../MapLayer/interfaces\";\nimport { MapOrgUnit, PointOrgUnit } from \"../../../../../interfaces\";\nimport { asyncify, map } from \"async-es\";\nimport { LegendSet } from \"@hisptz/dhis2-utils\";\nimport {\n\tdefaultClasses,\n\tdefaultColorScaleName,\n} from \"../../../../../utils/colors\";\nimport { useGoogleEngineToken } from \"../../../../MapLayer/components/GoogleEngineLayer/hooks\";\nimport { useBoundaryData } from \"../../../../MapLayer/components/BoundaryLayer/hooks/useBoundaryData\";\nimport { EarthEngine } from \"../../../../MapLayer/components/GoogleEngineLayer/services/engine\";\nimport { EARTH_ENGINE_LAYERS } from \"../../../../MapLayer/components/GoogleEngineLayer/constants\";\nimport { EarthEngineOptions } from \"../../../../MapLayer/components/GoogleEngineLayer/interfaces\";\n\nconst analyticsQuery = {\n\tanalytics: {\n\t\tresource: \"analytics\",\n\t\tparams: ({ ou, pe, dx, startDate, endDate }: any) => {\n\t\t\tconst peDimension = !isEmpty(pe)\n\t\t\t\t? `pe:${pe?.join(\";\")}`\n\t\t\t\t: undefined;\n\t\t\tconst ouDimension = !isEmpty(ou)\n\t\t\t\t? `ou:${ou?.join(\";\")}`\n\t\t\t\t: undefined;\n\t\t\tconst dxDimension = !isEmpty(dx)\n\t\t\t\t? `dx:${dx?.join(\";\")}`\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tdimension: compact([dxDimension, peDimension, ouDimension]),\n\t\t\t\tstartDate,\n\t\t\t\tendDate,\n\t\t\t\tdisplayProperty: \"NAME\",\n\t\t\t};\n\t\t},\n\t},\n};\nconst query = {\n\tlayer: {\n\t\tresource: \"geoFeatures\",\n\t\tparams: ({ ous }: any) => ({\n\t\t\tou: `ou:${ous.join(\";\")}`,\n\t\t}),\n\t},\n\tanalytics: {\n\t\tresource: \"analytics\",\n\t\tparams: ({ ous }: any) => ({\n\t\t\tdimension: [\n\t\t\t\t`ou:${ous.join(\";\")}`,\n\t\t\t\t`pe:${new Date().getFullYear()}`,\n\t\t\t],\n\t\t\tskipData: true,\n\t\t\thierarchyMeta: true,\n\t\t}),\n\t},\n};\nconst groupSetQuery = {\n\tgroupSet: {\n\t\tresource: \"organisationUnitGroupSets\",\n\t\tid: ({ groupSet }: any) => groupSet,\n\t\tparams: {\n\t\t\tfields: [\n\t\t\t\t\"organisationUnitGroups[name,color,symbol,organisationUnits[id]]\",\n\t\t\t],\n\t\t},\n\t},\n};\nconst legendSetsQuery = {\n\tlegendSets: {\n\t\tresource: \"legendSets\",\n\t\tid: ({ id }: any) => id,\n\t\tparams: {\n\t\t\tfields: [\n\t\t\t\t\"id\",\n\t\t\t\t\"displayName\",\n\t\t\t\t\"legends[id,code,startValue,endValue,color]\",\n\t\t\t],\n\t\t},\n\t},\n};\n\nexport function useThematicLayers(): any {\n\tconst engine = useDataEngine();\n\tconst [loading, setLoading] = useState(false);\n\tconst { orgUnits, orgUnitSelection } = useMapOrganisationUnit();\n\tconst { periods, range } = useMapPeriods() ?? {};\n\tconst ou = useMemo(\n\t\t() => getOrgUnitsSelection(orgUnitSelection),\n\t\t[orgUnitSelection],\n\t);\n\tconst pe = useMemo(() => periods?.map((pe: any) => pe.id), [periods]);\n\n\tconst { startDate, endDate } = useMemo(() => {\n\t\tif (!range) {\n\t\t\treturn {\n\t\t\t\tstartDate: undefined,\n\t\t\t\tendDate: undefined,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tstartDate: sanitizeDate(range.start.toDateString()),\n\t\t\tendDate: sanitizeDate(range.end.toDateString()),\n\t\t};\n\t}, [range]);\n\tconst sanitizeData = (data: any, layer: ThematicLayerConfig) => {\n\t\tif (data) {\n\t\t\tconst { analytics } = data as any;\n\t\t\tconst rows = analytics?.rows;\n\t\t\tconst ouIndex = analytics.headers.findIndex(\n\t\t\t\t(header: any) => header.name === \"ou\",\n\t\t\t);\n\t\t\tconst dxIndex = analytics.headers.findIndex(\n\t\t\t\t(header: any) => header.name === \"dx\",\n\t\t\t);\n\t\t\tconst valueIndex = analytics.headers.findIndex(\n\t\t\t\t(header: any) => header.name === \"value\",\n\t\t\t);\n\n\t\t\tif (!isEmpty(rows)) {\n\t\t\t\treturn sortBy(\n\t\t\t\t\torgUnits?.map((ou: MapOrgUnit) => {\n\t\t\t\t\t\tconst row = rows.find(\n\t\t\t\t\t\t\t(row: any) =>\n\t\t\t\t\t\t\t\trow[ouIndex] === ou.id &&\n\t\t\t\t\t\t\t\trow[dxIndex] === layer.dataItem.id,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\torgUnit: ou,\n\t\t\t\t\t\t\tdata: row ? parseFloat(row[valueIndex]) : undefined,\n\t\t\t\t\t\t\tdataItem: {\n\t\t\t\t\t\t\t\t...layer.dataItem,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\t\t\t\t\t}),\n\t\t\t\t\t[\"data\"],\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn [];\n\t\t}\n\t\treturn [];\n\t};\n\n\tconst sanitizeLegends = async (\n\t\tlayers: CustomThematicLayer[],\n\t): Promise<CustomThematicLayer[]> => {\n\t\treturn (await map(\n\t\t\tlayers,\n\t\t\tasyncify(async (layer: CustomThematicLayer) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst legends = [];\n\t\t\t\t\tif (layer.dataItem.legendSet) {\n\t\t\t\t\t\tconst legendSetData = await engine.query(\n\t\t\t\t\t\t\tlegendSetsQuery,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvariables: {\n\t\t\t\t\t\t\t\t\tid: layer.dataItem.legendSet,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst legendSet: LegendSet =\n\t\t\t\t\t\t\tlegendSetData?.legendSets as LegendSet;\n\t\t\t\t\t\tif (legendSet) {\n\t\t\t\t\t\t\tlegends.push(...legendSet.legends);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst { scale, colorClass } = layer.dataItem\n\t\t\t\t\t\t\t.legendConfig ?? {\n\t\t\t\t\t\t\tscale: defaultClasses,\n\t\t\t\t\t\t\tcolorClass: defaultColorScaleName,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst sortedData = sortBy(\n\t\t\t\t\t\t\tlayer.data.filter((datum) => !!datum.data),\n\t\t\t\t\t\t\t\"data\",\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst autoLegends = generateLegends(\n\t\t\t\t\t\t\tlast(sortedData)?.data ?? 0,\n\t\t\t\t\t\t\thead(sortedData)?.data ?? 0,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclassesCount: scale,\n\t\t\t\t\t\t\t\tcolorClass,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlegends.push(...autoLegends);\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...layer,\n\t\t\t\t\t\tlegends,\n\t\t\t\t\t};\n\t\t\t\t} catch (e) {\n\t\t\t\t\treturn layer;\n\t\t\t\t}\n\t\t\t}),\n\t\t)) as CustomThematicLayer[];\n\t};\n\n\tconst sanitizeLayers = async (\n\t\tlayers: ThematicLayerConfig[],\n\t): Promise<CustomThematicLayer[]> => {\n\t\ttry {\n\t\t\tsetLoading(true);\n\t\t\tconst layersWithoutData = layers?.filter((layer) => !layer.data);\n\t\t\tconst layersWithData = differenceBy(\n\t\t\t\tlayers,\n\t\t\t\tlayersWithoutData,\n\t\t\t\t\"id\",\n\t\t\t);\n\t\t\tconst dx = layersWithoutData.map((layer) => layer.dataItem.id);\n\t\t\tlet sanitizedLayersWithData: any = [];\n\n\t\t\tconsole.log({ layersWithoutData });\n\n\t\t\tif (!isEmpty(dx)) {\n\t\t\t\tconst data = await engine.query(analyticsQuery, {\n\t\t\t\t\tvariables: {\n\t\t\t\t\t\tdx,\n\t\t\t\t\t\tou,\n\t\t\t\t\t\tpe,\n\t\t\t\t\t\tstartDate,\n\t\t\t\t\t\tendDate,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tsanitizedLayersWithData = layersWithoutData.map((layer) => ({\n\t\t\t\t\t...layer,\n\t\t\t\t\tname:\n\t\t\t\t\t\tlayer?.name ?? layer?.dataItem?.displayName ?? layer.id,\n\t\t\t\t\tdata: sanitizeData(data, layer),\n\t\t\t\t}));\n\t\t\t}\n\t\t\tconst sanitizedLayersWithOrgUnits = layersWithData.map((layer) => ({\n\t\t\t\t...layer,\n\t\t\t\tdata: layer.data?.map((datum) => ({\n\t\t\t\t\t...datum,\n\t\t\t\t\torgUnit: find(orgUnits, [\n\t\t\t\t\t\t\"id\",\n\t\t\t\t\t\tdatum.orgUnit,\n\t\t\t\t\t]) as MapOrgUnit,\n\t\t\t\t\tdataItem: layer.dataItem,\n\t\t\t\t\tname:\n\t\t\t\t\t\tlayer?.name ?? layer?.dataItem?.displayName ?? layer.id,\n\t\t\t\t})),\n\t\t\t}));\n\t\t\tsetLoading(false);\n\t\t\treturn await sanitizeLegends([\n\t\t\t\t...sanitizedLayersWithData,\n\t\t\t\t...sanitizedLayersWithOrgUnits,\n\t\t\t]);\n\t\t} catch (e: any) {\n\t\t\tconsole.error(`Error getting thematic layers`, e.details);\n\t\t\tsetLoading(false);\n\t\t\treturn [];\n\t\t}\n\t};\n\n\treturn {\n\t\tsanitizeLayers,\n\t\tloading,\n\t};\n}\n\nexport function usePointLayer() {\n\tconst engine = useDataEngine();\n\tconst { orgUnitSelection } = useMapOrganisationUnit();\n\tconst [loading, setLoading] = useState(false);\n\n\tconst sanitizePointData = useCallback(\n\t\t(orgUnitData: any, groupSetData: any): PointOrgUnit[] => {\n\t\t\tconst { analytics, layer } = (orgUnitData as any) ?? {};\n\t\t\tconst rawOrgUnits = sanitizeOrgUnits(analytics?.metaData);\n\t\t\tconst geoJSONObjects = toGeoJson(\n\t\t\t\tlayer?.filter((bound: any) => bound.co),\n\t\t\t);\n\t\t\treturn compact(\n\t\t\t\trawOrgUnits.map((orgUnit: any) => {\n\t\t\t\t\tconst geoJSONObject: any = geoJSONObjects?.find(\n\t\t\t\t\t\t(geoJSON: any) => geoJSON.properties.id === orgUnit.id,\n\t\t\t\t\t);\n\t\t\t\t\tconst orgUnitGroups: any =\n\t\t\t\t\t\t(groupSetData?.groupSet as any)\n\t\t\t\t\t\t\t?.organisationUnitGroups ?? [];\n\t\t\t\t\tconst ouGroup = find(\n\t\t\t\t\t\torgUnitGroups,\n\t\t\t\t\t\t(ouGroup) =>\n\t\t\t\t\t\t\t!!find(ouGroup?.organisationUnits ?? [], [\n\t\t\t\t\t\t\t\t\"id\",\n\t\t\t\t\t\t\t\torgUnit.id,\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t!geoJSONObject ||\n\t\t\t\t\t\tgeoJSONObject.properties.type !== \"Point\"\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...orgUnit,\n\t\t\t\t\t\tgeoJSON: geoJSONObject,\n\t\t\t\t\t\tlevel: geoJSONObject.properties.level,\n\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\ttype: \"groupIcon\",\n\t\t\t\t\t\t\ticon: ouGroup?.symbol,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t);\n\t\t},\n\t\t[],\n\t);\n\n\tconst sanitizeLayer = useCallback(\n\t\tasync (\n\t\t\tlayer: CustomPointLayer,\n\t\t): Promise<CustomPointLayer | undefined> => {\n\t\t\ttry {\n\t\t\t\tif (!layer.level && !layer.group) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsetLoading(true);\n\t\t\t\tconst level = layer.level ? `LEVEL-${layer.level}` : undefined;\n\t\t\t\tconst group = layer.group\n\t\t\t\t\t? `OU_GROUP-${layer.group}`\n\t\t\t\t\t: undefined;\n\t\t\t\tconst ous = [\n\t\t\t\t\t...getOrgUnitsSelection(orgUnitSelection),\n\t\t\t\t\tlevel,\n\t\t\t\t\tgroup,\n\t\t\t\t];\n\n\t\t\t\tconst pointData = await engine.query(query, {\n\t\t\t\t\tvariables: {\n\t\t\t\t\t\tous,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tconst groupSetData = await engine.query(groupSetQuery, {\n\t\t\t\t\tvariables: {\n\t\t\t\t\t\tgroupSet: layer.style?.groupSet,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tconst sanitizedOrgUnitData = sanitizePointData(\n\t\t\t\t\tpointData,\n\t\t\t\t\tgroupSetData,\n\t\t\t\t);\n\n\t\t\t\tconst orgUnitGroups =\n\t\t\t\t\t(groupSetData?.groupSet as any)?.organisationUnitGroups ??\n\t\t\t\t\t[];\n\n\t\t\t\tconst sanitizedOrgUnitGroups = orgUnitGroups.map(\n\t\t\t\t\t(ouGroup: any) => ({\n\t\t\t\t\t\t...ouGroup,\n\t\t\t\t\t\torganisationUnits: undefined,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tsetLoading(false);\n\t\t\t\treturn {\n\t\t\t\t\t...layer,\n\t\t\t\t\tpoints: sanitizedOrgUnitData,\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...layer.style,\n\t\t\t\t\t\torgUnitGroups: sanitizedOrgUnitGroups,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} catch (e: any) {\n\t\t\t\tsetLoading(false);\n\t\t\t\tconsole.error(`Error getting point layer`, e.details);\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\treturn {\n\t\tloading,\n\t\tsanitizeLayer,\n\t};\n}\n\nexport function useGoogleEngineLayers() {\n\tconst { refresh } = useGoogleEngineToken();\n\tconst orgUnits = useBoundaryData();\n\n\tasync function getImageUrl(\n\t\tearthEngine: EarthEngine,\n\t\t{ filters }: EarthEngineLayerConfig,\n\t): Promise<string | undefined> {\n\t\tif (earthEngine.initialized) {\n\t\t\ttry {\n\t\t\t\tearthEngine.setOrgUnits(orgUnits ?? []);\n\t\t\t\tconst period = filters?.period;\n\t\t\t\tif (period) {\n\t\t\t\t\tearthEngine.setPeriod(period);\n\t\t\t\t}\n\t\t\t\treturn earthEngine.url();\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst sanitizeLayers = useCallback(\n\t\tasync (\n\t\t\tlayers: EarthEngineLayerConfig[],\n\t\t): Promise<CustomGoogleEngineLayer[]> => {\n\t\t\tif (isEmpty(layers)) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst { token } = await refresh();\n\t\t\t\tif (!token) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Google token not available in this instance`,\n\t\t\t\t\t);\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tawait EarthEngine.setToken(token, refresh);\n\t\t\t\treturn map(\n\t\t\t\t\tlayers,\n\t\t\t\t\tasyncify(async (layer: EarthEngineLayerConfig) => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst defaultOptions: any =\n\t\t\t\t\t\t\t\tfind(EARTH_ENGINE_LAYERS, [\"id\", layer.type]) ??\n\t\t\t\t\t\t\t\t{};\n\t\t\t\t\t\t\tconst options: EarthEngineOptions = {\n\t\t\t\t\t\t\t\t...defaultOptions,\n\t\t\t\t\t\t\t\taggregations:\n\t\t\t\t\t\t\t\t\tlayer.aggregations ??\n\t\t\t\t\t\t\t\t\tdefaultOptions?.aggregations,\n\t\t\t\t\t\t\t\tparams: layer.params ?? defaultOptions?.params,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst updatedLayer = {\n\t\t\t\t\t\t\t\t...layer,\n\t\t\t\t\t\t\t\toptions,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst earthEngine = new EarthEngine({ options });\n\t\t\t\t\t\t\tconst url = await getImageUrl(\n\t\t\t\t\t\t\t\tearthEngine,\n\t\t\t\t\t\t\t\tupdatedLayer,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...updatedLayer,\n\t\t\t\t\t\t\t\tengine: earthEngine,\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t} catch (e: any) {\n\t\t\t\tconsole.error(`Error getting thematic layers`, e.details);\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t\t[refresh],\n\t);\n\n\treturn {\n\t\tsanitizeLayers,\n\t};\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapProvider/components/MapLayerProvider/index.tsx"],"names":["updatedLayers"],"mappings":"AAyIK,cASA,YATA;AAzIL,OAAO,UAAU;AACjB,SAAS,QAAQ,sBAAsB;AAEvC,SAAS,SAAS,MAAM,MAAM,WAAW;AACzC,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAUjC,SAAS,wBAAwB,qBAAqB;AACtD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEA,SAAS,kBAAkB;AAAA,EACjC;AAAA,EACA;AACD,GAGG;AACF,QAAM,SAAS,cAAc;AAC7B,QAAM,UAAU,uBAAuB;AACvC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAOxC,CAAC,CAAC;AACJ,QAAM,EAAE,gBAAgB,wBAAwB,MAAM,IACrD,kBAAkB;AACnB,QAAM,EAAE,eAAe,mBAAmB,IAAI,cAAc;AAC5D,QAAM,EAAE,gBAAgB,0BAA0B,IACjD,sBAAsB;AACvB,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAE5C,eAAa;AAAA,IACZ,eAAe,CAAC,UAAU;AACzB,0BAAoB,UAAU,KAAK;AAAA,IACpC;AAAA,IACA,YAAY,CAAC,UAAU;AACtB,0BAAoB,OAAO,KAAK;AAAA,IACjC;AA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AM,cAAc,KAAK,eAAe,CAAC,UAAe;AACvD,YAAM,iBACL,OAAO,QAAQ,OAAO,UAAU,eAAe,OAAO;AACvD,aAAO,mBAAmB;AAAA,IAC3B,CAAC;AAED,QAAI,aAAa;AAChB,kBAAY,YAAY,IAAI;AAAA,QAC3B,GAAG;AAAA,QACH,SAAS,SAAS;AAAA,MACnB,CAAC;AAAA,IACF;AAAA,EACD;AAEA,MAAI,SAAS;AACZ,WACC,oBAAC,SAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,OAAO,GAC3C,8BAAC,UACA,8BAAC,kBAAe,OAAK,MAAC,GACvB,GACD;AAAA,EAEF;AACA,MAAI,OAAO;AACV,WACC,oBAAC,SAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,OAAO,GAC3C,8BAAC,UACA,+BAAC,QACC;AAAA,WAAK,EAAE,OAAO;AAAA,MAAE;AAAA,MAAG,MAAM;AAAA,OAC3B,GACD,GACD;AAAA,EAEF;AACA,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,OAAO,EAAE,QAAQ,eAAe,YAAY;AAAA,MAE3C;AAAA;AAAA,EACF;AAEF","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { Center, CircularLoader } from \"@dhis2/ui\";\nimport { LayersControlEvent } from \"leaflet\";\nimport { compact, find, head, set } from \"lodash\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { useMapEvents } from \"react-leaflet\";\nimport { MapLayersContext } from \"../../../../state\";\nimport { MapLayerConfig } from \"../../../MapArea/interfaces\";\nimport {\n\tCustomBoundaryLayer,\n\tCustomGoogleEngineLayer,\n\tCustomMapLayer,\n\tCustomPointLayer,\n\tCustomThematicLayer,\n\tThematicLayerConfig,\n} from \"../../../MapLayer/interfaces\";\nimport { useMapOrganisationUnit, useMapPeriods } from \"../../hooks\";\nimport {\n\tuseGoogleEngineLayers,\n\tusePointLayer,\n\tuseThematicLayers,\n} from \"./hooks\";\n\nexport function MapLayersProvider({\n\tlayers,\n\tchildren,\n}: {\n\tlayers: MapLayerConfig;\n\tchildren: React.ReactNode;\n}) {\n\tconst period = useMapPeriods();\n\tconst orgUnit = useMapOrganisationUnit();\n\tconst [updatedLayers, setUpdatedLayers] = useState<\n\t\tArray<\n\t\t\t| CustomThematicLayer\n\t\t\t| CustomBoundaryLayer\n\t\t\t| CustomPointLayer\n\t\t\t| CustomGoogleEngineLayer\n\t\t>\n\t>([]);\n\tconst { sanitizeLayers: sanitizeThematicLayers, error } =\n\t\tuseThematicLayers();\n\tconst { sanitizeLayer: sanitizePointLayer } = usePointLayer();\n\tconst { sanitizeLayers: sanitizeEarthEngineLayers } =\n\t\tuseGoogleEngineLayers();\n\tconst [loading, setLoading] = useState(false);\n\n\tuseMapEvents({\n\t\toverlayremove: (event) => {\n\t\t\tsetupLayerListeners(\"remove\", event);\n\t\t},\n\t\toverlayadd: (event) => {\n\t\t\tsetupLayerListeners(\"add\", event);\n\t\t},\n\t});\n\n\tconst sanitizeLayers = async () => {\n\t\tsetLoading(true);\n\t\ttry {\n\t\t\tconst {\n\t\t\t\tboundaryLayers,\n\t\t\t\tthematicLayers,\n\t\t\t\tpointLayers,\n\t\t\t\tearthEngineLayers,\n\t\t\t} = layers;\n\t\t\tconst sanitizedThematicLayers = await sanitizeThematicLayers([\n\t\t\t\t...(thematicLayers ?? []),\n\t\t\t] as ThematicLayerConfig[]);\n\t\t\tconst sanitizedBoundaryLayers = (boundaryLayers ??\n\t\t\t\t[]) as CustomBoundaryLayer[];\n\t\t\tconst sanitizedPointLayer = head(pointLayers ?? [])\n\t\t\t\t? await sanitizePointLayer(\n\t\t\t\t\t\thead(pointLayers) as CustomPointLayer,\n\t\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t\tconst sanitizedEarthEngineLayers = await sanitizeEarthEngineLayers([\n\t\t\t\t...(earthEngineLayers ?? []),\n\t\t\t] as unknown as CustomGoogleEngineLayer[]);\n\t\t\tsetUpdatedLayers(\n\t\t\t\tcompact([\n\t\t\t\t\t...(sanitizedBoundaryLayers ?? []),\n\t\t\t\t\t...(sanitizedThematicLayers ?? []),\n\t\t\t\t\tsanitizedPointLayer,\n\t\t\t\t\t...(sanitizedEarthEngineLayers ?? []),\n\t\t\t\t]),\n\t\t\t);\n\t\t} catch (e: any) {\n\t\t\tconsole.error(`Error sanitizing layers`, e.toString());\n\t\t}\n\t\tsetLoading(false);\n\t};\n\n\tconst updateLayer = useCallback(\n\t\t(id: string, updatedLayer: CustomMapLayer) => {\n\t\t\tsetUpdatedLayers((prevLayers) => {\n\t\t\t\tconst updatedLayers = [...prevLayers];\n\t\t\t\tconst layerIndex = updatedLayers.findIndex(\n\t\t\t\t\t(layer) => layer.id === updatedLayer.id,\n\t\t\t\t);\n\t\t\t\tif (layerIndex < 0) {\n\t\t\t\t\treturn prevLayers;\n\t\t\t\t}\n\t\t\t\tset(updatedLayers, layerIndex, updatedLayer);\n\t\t\t\treturn updatedLayers;\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\tsanitizeLayers().catch(console.error);\n\t}, [period, orgUnit]);\n\n\tconst setupLayerListeners = (\n\t\ttype: \"add\" | \"remove\",\n\t\tevent: LayersControlEvent,\n\t) => {\n\t\tconst name = event.name;\n\n\t\tconst layerConfig = find(updatedLayers, (layer: any) => {\n\t\t\tconst nameFromConfig =\n\t\t\t\tlayer?.name ?? layer?.dataItem?.displayname ?? layer?.label;\n\t\t\treturn nameFromConfig === name;\n\t\t});\n\n\t\tif (layerConfig) {\n\t\t\tupdateLayer(layerConfig.id, {\n\t\t\t\t...layerConfig,\n\t\t\t\tenabled: type === \"add\",\n\t\t\t});\n\t\t}\n\t};\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<CircularLoader small />\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\tif (error) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<h4>\n\t\t\t\t\t\t{i18n.t(\"Error\")}: {error.message}\n\t\t\t\t\t</h4>\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<MapLayersContext.Provider\n\t\t\tvalue={{ layers: updatedLayers, updateLayer }}\n\t\t>\n\t\t\t{children}\n\t\t</MapLayersContext.Provider>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/components/Map/components/MapProvider/hooks/index.ts"],"names":[],"mappings":"AAAA,SAAS,kBAAkB;AAC3B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEA,SAAS,yBAAyB;AACxC,SAAO,WAAW,iBAAiB;AACpC;AAEO,SAAS,gBAAgB;AAC9B,SAAO,WAAW,gBAAgB;AACpC;AAEO,SAAS,eAAe;AAC7B,SAAO,WAAW,gBAAgB;AACpC","sourcesContent":["import { useContext } from \"react\";\nimport {\n\tMapLayersContext,\n\tMapOrgUnitContext,\n\tMapPeriodContext,\n} from \"../../../state\";\n\nexport function useMapOrganisationUnit() {\n\treturn useContext(MapOrgUnitContext);\n}\n\nexport function useMapPeriods() {\n return useContext(MapPeriodContext);\n}\n\nexport function useMapLayers() {\n return useContext(MapLayersContext);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/MapProvider/index.tsx"],"names":["orgUnits","error"],"mappings":"AAgFK,cAUA,YAVA;AAhFL,SAAS,oBAAoB;AAC7B,OAAO,UAAU;AACjB,SAAS,QAAQ,sBAAsB;AACvC,SAAS,SAAS,eAAe;AACjC,SAAgB,WAAW,gBAAgB;AAE3C,SAAS,mBAAmB,wBAAwB;AACpD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAqB,qBAAqB;AAE1C,MAAM,gBAAgB;AAAA,EACrB,YAAY;AAAA,IACX,UAAU;A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Q;AAAA,IACrB;AAEA,gBAAY,EAAE,MAAM,CAACC,WAAU,QAAQ,IAAIA,MAAK,CAAC;AAAA,EAClD,GAAG,CAAC,kBAAkB,OAAO,CAAC;AAE9B,MAAI,SAAS;AACZ,WACC,oBAAC,SAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,OAAO,GAC3C,8BAAC,UACA,8BAAC,kBAAe,OAAK,MAAC,GACvB,GACD;AAAA,EAEF;AAEA,MAAI,OAAO;AACV,WACC,oBAAC,SAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,OAAO,GAC3C,8BAAC,UACA,+BAAC,QACC;AAAA,WAAK,EAAE,OAAO;AAAA,MAAE;AAAA,MAAG,MAAM;AAAA,OAC3B,GACD,GACD;AAAA,EAEF;AAEA,QAAM,UAAwB;AAAA,IAC7B,iBAAiB,SAAS,IAAI,CAAC,OAAO,cAAc,cAAc,EAAE,CAAC;AAAA,EACtE;AAEA,MAAI,CAAC,QAAQ,QAAQ,GAAG;AACvB,WACC,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,EAAE,kBAAkB,SAAS,GAC/D;AAAA,MAAC,iBAAiB;AAAA,MAAjB;AAAA,QACA,OAAO,EAAE,GAAG,iBAAiB,QAAQ;AAAA,QAEpC;AAAA;AAAA,IACF,GACD;AAAA,EAEF;AAEA,SAAO;AACR","sourcesContent":["import { useDataQuery } from \"@dhis2/app-runtime\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { Center, CircularLoader } from \"@dhis2/ui\";\nimport { compact, isEmpty } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { MapOrgUnit, MapProviderProps } from \"../../interfaces\";\nimport { MapOrgUnitContext, MapPeriodContext } from \"../../state\";\nimport {\n\tgetOrgUnitsSelection,\n\tsanitizeOrgUnits,\n\ttoGeoJson,\n} from \"../../utils/map\";\nimport { BasePeriod, PeriodUtility } from \"@hisptz/dhis2-utils\";\n\nconst boundaryQuery = {\n\tboundaries: {\n\t\tresource: \"geoFeatures\",\n\t\tparams: ({ orgUnitIds }: any) => ({\n\t\t\tou: `ou:${orgUnitIds?.join(\";\")}`,\n\t\t}),\n\t},\n\tanalytics: {\n\t\tresource: \"analytics\",\n\t\tparams: ({ orgUnitIds }: any) => ({\n\t\t\tdimension: [\n\t\t\t\t`ou:${orgUnitIds.join(\";\")}`,\n\t\t\t\t`pe:${new Date().getFullYear()}`,\n\t\t\t],\n\t\t\tskipData: true,\n\t\t\thierarchyMeta: true,\n\t\t}),\n\t},\n};\n\nexport function MapProvider({\n\tchildren,\n\torgUnitSelection,\n\tperiodSelection,\n}: MapProviderProps) {\n\tconst [orgUnits, setOrgUnits] = useState<MapOrgUnit[]>([]);\n\tconst { refetch, loading, error } = useDataQuery(boundaryQuery, {\n\t\tlazy: true,\n\t});\n\n\tuseEffect(() => {\n\t\tasync function getOrgUnits() {\n\t\t\tconst rawOrgUnitIds = getOrgUnitsSelection(orgUnitSelection);\n\t\t\tconst data = await refetch({ orgUnitIds: rawOrgUnitIds });\n\t\t\tconst { analytics, boundaries } = (data as any) ?? {};\n\t\t\tconst rawOrgUnits = sanitizeOrgUnits(analytics?.metaData);\n\t\t\tconst geoJSONObjects = toGeoJson(\n\t\t\t\tboundaries.filter((bound: any) => bound.co),\n\t\t\t);\n\t\t\tconst orgUnits: MapOrgUnit[] = compact(\n\t\t\t\trawOrgUnits.map((orgUnit: any) => {\n\t\t\t\t\tconst geoJSONObject: any = geoJSONObjects?.find(\n\t\t\t\t\t\t(geoJSON: any) => geoJSON.properties.id === orgUnit.id,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (!geoJSONObject) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...orgUnit,\n\t\t\t\t\t\tgeoJSON: geoJSONObject,\n\t\t\t\t\t\tbounds: [],\n\t\t\t\t\t\tlevel: geoJSONObject.properties.level,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t);\n\t\t\tsetOrgUnits(orgUnits);\n\t\t}\n\n\t\tgetOrgUnits().catch((error) => console.log(error));\n\t}, [orgUnitSelection, refetch]);\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<CircularLoader small />\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (error) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<h4>\n\t\t\t\t\t\t{i18n.t(\"Error\")}: {error.message}\n\t\t\t\t\t</h4>\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst periods: BasePeriod[] = compact(\n\t\tperiodSelection?.periods?.map((pe) => PeriodUtility.getPeriodById(pe)),\n\t);\n\n\tif (!isEmpty(orgUnits)) {\n\t\treturn (\n\t\t\t<MapOrgUnitContext.Provider value={{ orgUnitSelection, orgUnits }}>\n\t\t\t\t<MapPeriodContext.Provider\n\t\t\t\t\tvalue={{ ...periodSelection, periods }}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</MapPeriodContext.Provider>\n\t\t\t</MapOrgUnitContext.Provider>\n\t\t);\n\t}\n\n\treturn null;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/MapUpdater/index.tsx"],"names":[],"mappings":"AAMQ;AANR,SAAS,oBAAoB;AAId,SAAR,WAA4B,EAAE,OAAO,GAA8B;AACzE,QAAM,MAAM,aAAa,EAAE,OAAO,CAAC;AACnC,SAAO,oBAAC,SAAI,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO,GAAG,KAAU;AACjE","sourcesContent":["import { useCenterMap } from \"../../hooks/map\";\nimport React from \"react\";\nimport { LatLngTuple } from \"leaflet\";\n\nexport default function MapUpdater({ bounds }: { bounds: LatLngTuple[] }) {\n\tconst ref = useCenterMap({ bounds });\n\treturn <div style={{ width: \"100%\", height: \"100%\" }} ref={ref}></div>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.tsx"],"names":[],"mappings":"AAkCG,cAKC,YALD;AAjCH,SAAS,eAAe;AAExB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,UAAU;AAEjB,SAAS,kCAAkC;AAEpC,SAAS,yBAAyB;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAkC;AACjC,QAAM,OAAO,QAA6B;AAAA,IACzC,eAAe;AAAA,EAChB,CAAC;AAED,QAAM,gBAAgB,CAAC,WAAgC;AACtD,aAAS,MAAM;AACf,YAAQ;AAAA,EACT;AAEA,SACC,qBAAC,SAAO,GAAG,OAAO,MAAM,CAAC,MAAM,SAC9B;AAAA,wBAAC,cAAY,eAAK,EAAE,0BAA0B,GAAE;AAAA,IAChD,oBAAC,gBACA,8BAAC,8BAA2B,MAAY,SAAkB,GAC3D;AAAA,IACA,oBAAC,gBACA,+BAAC,eACA;AAAA,0BAAC,UAAO,SAAS,SAAU,eAAK,EAAE,QAAQ,GAAE;AAAA,MAC5C;AAAA,QAAC;AAAA;AAAA,UACA,SAAO;AAAA,UACP,SAAS,MAAM,KAAK,aAAa,aAAa,EAAE;AAAA,UAE/C,eAAK,EAAE,MAAM;AAAA;AAAA,MACf;AAAA,OACD,GACD;AAAA,KACD;AAEF","sourcesContent":["import { ThematicLayerConfigModalProps } from \"./types\";\nimport { useForm } from \"react-hook-form\";\nimport { ThematicLayerConfig } from \"../MapLayer/interfaces\";\nimport {\n\tButton,\n\tButtonStrip,\n\tModal,\n\tModalActions,\n\tModalContent,\n\tModalTitle,\n} from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport React from \"react\";\nimport { ThematicLayerConfiguration } from \"./ThematicLayerConfiguration\";\n\nexport function ThematicLayerConfigModal({\n\topen,\n\texclude,\n\tconfig,\n\tonClose,\n\tonChange,\n\t...props\n}: ThematicLayerConfigModalProps) {\n\tconst form = useForm<ThematicLayerConfig>({\n\t\tdefaultValues: config,\n\t});\n\n\tconst onSubmitClick = (values: ThematicLayerConfig) => {\n\t\tonChange(values);\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<Modal {...props} hide={!open} onClose={onClose}>\n\t\t\t<ModalTitle>{i18n.t(\"Configure Thematic Layer\")}</ModalTitle>\n\t\t\t<ModalContent>\n\t\t\t\t<ThematicLayerConfiguration form={form} exclude={exclude} />\n\t\t\t</ModalContent>\n\t\t\t<ModalActions>\n\t\t\t\t<ButtonStrip>\n\t\t\t\t\t<Button onClick={onClose}>{i18n.t(\"Cancel\")}</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tprimary\n\t\t\t\t\t\tonClick={() => form.handleSubmit(onSubmitClick)()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{i18n.t(\"Save\")}\n\t\t\t\t\t</Button>\n\t\t\t\t</ButtonStrip>\n\t\t\t</ModalActions>\n\t\t</Modal>\n\t);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.tsx"],"names":[],"mappings":"AAmBK;AAlBL,SAAS,gCAAgC;AAIlC,MAAM,UAAiB,CAAC;AAC/B,QAAQ,OAAO;AAAA,EACd,UAAU,QAAQ;AAAA,EAClB,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,MAAM;AACP;AAEA,MAAM,OAA8C;AAAA,EACnD,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,IACX,CAAC,aAAkB;AAClB,aACC,oBAAC,SAAI,OAAO,EAAE,OAAO,OAAO,QAAQ,MAAM,GACzC,8BAAC,YAAS,GACX;AAAA,IAEF;AAAA,EACD;AACD;AAEA,IAAO,2CAAQ","sourcesContent":["import React from \"react\";\nimport { ThematicLayerConfigModal } from \"./ThematicLayerConfigModal\";\nimport { Meta, StoryObj } from \"@storybook/react\";\n\ntype Story = StoryObj<typeof ThematicLayerConfigModal>;\nexport const Default: Story = {};\nDefault.args = {\n\tonChange: console.info,\n\tonClose: () => {},\n\topen: true,\n};\n\nconst meta: Meta<typeof ThematicLayerConfigModal> = {\n\ttitle: \"DHIS2 Map/Thematic Layer Config Modal\",\n\tcomponent: ThematicLayerConfigModal,\n\tdecorators: [\n\t\t(MapStory: any) => {\n\t\t\treturn (\n\t\t\t\t<div style={{ width: \"50%\", height: \"50%\" }}>\n\t\t\t\t\t<MapStory />\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t],\n};\n\nexport default meta;\n"]}