@hisptz/dhis2-analytics 1.0.66 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (724) hide show
  1. package/dist/components/ChartAnalytics/ChartAnalytics.stories.js +254 -0
  2. package/dist/components/ChartAnalytics/ChartAnalytics.stories.js.map +1 -0
  3. package/dist/components/ChartAnalytics/DHIS2Chart.js +36 -0
  4. package/dist/components/ChartAnalytics/DHIS2Chart.js.map +1 -0
  5. package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +52 -0
  6. package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -0
  7. package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +42 -0
  8. package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.js.map +1 -0
  9. package/dist/components/ChartAnalytics/components/DownloadMenu/index.js +65 -0
  10. package/dist/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -0
  11. package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +3 -0
  12. package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js.map +1 -0
  13. package/dist/components/ChartAnalytics/hooks/useChart.js +43 -0
  14. package/dist/components/ChartAnalytics/hooks/useChart.js.map +1 -0
  15. package/dist/components/ChartAnalytics/index.js +3 -0
  16. package/dist/components/ChartAnalytics/index.js.map +1 -0
  17. package/dist/components/ChartAnalytics/models/bar.js +21 -0
  18. package/dist/components/ChartAnalytics/models/bar.js.map +1 -0
  19. package/{build/es → dist}/components/ChartAnalytics/models/column.js +12 -9
  20. package/dist/components/ChartAnalytics/models/column.js.map +1 -0
  21. package/dist/components/ChartAnalytics/models/index.js +114 -0
  22. package/dist/components/ChartAnalytics/models/index.js.map +1 -0
  23. package/{build/es → dist}/components/ChartAnalytics/models/line.js +10 -7
  24. package/dist/components/ChartAnalytics/models/line.js.map +1 -0
  25. package/dist/components/ChartAnalytics/models/multi-series.js +112 -0
  26. package/dist/components/ChartAnalytics/models/multi-series.js.map +1 -0
  27. package/dist/components/ChartAnalytics/models/pie.js +53 -0
  28. package/dist/components/ChartAnalytics/models/pie.js.map +1 -0
  29. package/dist/components/ChartAnalytics/services/export.js +35 -0
  30. package/dist/components/ChartAnalytics/services/export.js.map +1 -0
  31. package/dist/components/ChartAnalytics/styles/custom-highchart.css +40 -0
  32. package/dist/components/ChartAnalytics/styles/custom-highchart.css.map +1 -0
  33. package/dist/components/ChartAnalytics/types/props.js +3 -0
  34. package/dist/components/ChartAnalytics/types/props.js.map +1 -0
  35. package/dist/components/ChartAnalytics/utils/chart.js +130 -0
  36. package/dist/components/ChartAnalytics/utils/chart.js.map +1 -0
  37. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js +66 -0
  38. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -0
  39. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +42 -0
  40. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.js.map +1 -0
  41. package/dist/components/CircularProgressDashboard/index.js +4 -0
  42. package/dist/components/CircularProgressDashboard/index.js.map +1 -0
  43. package/dist/components/CircularProgressDashboard/types/props.js +3 -0
  44. package/dist/components/CircularProgressDashboard/types/props.js.map +1 -0
  45. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js +26 -0
  46. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -0
  47. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.js +30 -0
  48. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.js.map +1 -0
  49. package/dist/components/DHIS2PivotTable/components/Table/index.js +10 -0
  50. package/dist/components/DHIS2PivotTable/components/Table/index.js.map +1 -0
  51. package/dist/components/DHIS2PivotTable/components/TableBody/TableBody.module.css +11 -0
  52. package/dist/components/DHIS2PivotTable/components/TableBody/TableBody.module.css.map +1 -0
  53. package/dist/components/DHIS2PivotTable/components/TableBody/index.js +106 -0
  54. package/dist/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -0
  55. package/dist/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css +10 -0
  56. package/dist/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css.map +1 -0
  57. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js +94 -0
  58. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -0
  59. package/dist/components/DHIS2PivotTable/index.js +4 -0
  60. package/dist/components/DHIS2PivotTable/index.js.map +1 -0
  61. package/dist/components/DHIS2PivotTable/interfaces/index.js +3 -0
  62. package/dist/components/DHIS2PivotTable/interfaces/index.js.map +1 -0
  63. package/dist/components/DHIS2PivotTable/services/engine.js +87 -0
  64. package/dist/components/DHIS2PivotTable/services/engine.js.map +1 -0
  65. package/dist/components/DHIS2PivotTable/state/engine.js +17 -0
  66. package/dist/components/DHIS2PivotTable/state/engine.js.map +1 -0
  67. package/dist/components/Map/DHIS2Map.js +65 -0
  68. package/dist/components/Map/DHIS2Map.js.map +1 -0
  69. package/dist/components/Map/DHIS2Map.stories.js +366 -0
  70. package/dist/components/Map/DHIS2Map.stories.js.map +1 -0
  71. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js +41 -0
  72. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -0
  73. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +34 -0
  74. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js.map +1 -0
  75. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js +26 -0
  76. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -0
  77. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +21 -0
  78. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js.map +1 -0
  79. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js +67 -0
  80. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -0
  81. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js +134 -0
  82. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -0
  83. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js +44 -0
  84. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -0
  85. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js +67 -0
  86. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -0
  87. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js +24 -0
  88. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -0
  89. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js +67 -0
  90. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -0
  91. package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +45 -0
  92. package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -0
  93. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js +4 -0
  94. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -0
  95. package/dist/components/Map/components/MapArea/index.js +100 -0
  96. package/dist/components/Map/components/MapArea/index.js.map +1 -0
  97. package/dist/components/Map/components/MapArea/interfaces/index.js +3 -0
  98. package/dist/components/Map/components/MapArea/interfaces/index.js.map +1 -0
  99. package/dist/components/Map/components/MapControls/components/CustomControl/index.js +16 -0
  100. package/dist/components/Map/components/MapControls/components/CustomControl/index.js.map +1 -0
  101. package/dist/components/Map/components/MapControls/components/DownloadControl/index.js +15 -0
  102. package/dist/components/Map/components/MapControls/components/DownloadControl/index.js.map +1 -0
  103. package/dist/components/Map/components/MapControls/components/FullscreenControl/index.js +13 -0
  104. package/dist/components/Map/components/MapControls/components/FullscreenControl/index.js.map +1 -0
  105. package/dist/components/Map/components/MapControls/index.js +35 -0
  106. package/dist/components/Map/components/MapControls/index.js.map +1 -0
  107. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +10 -0
  108. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -0
  109. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js +52 -0
  110. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -0
  111. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +100 -0
  112. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js.map +1 -0
  113. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +457 -0
  114. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js.map +1 -0
  115. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +32 -0
  116. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -0
  117. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +197 -0
  118. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -0
  119. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +3 -0
  120. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js.map +1 -0
  121. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31466 -0
  122. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
  123. package/{build/es → dist}/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +106 -146
  124. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map +1 -0
  125. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +93 -0
  126. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -0
  127. package/dist/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +10 -0
  128. package/dist/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css.map +1 -0
  129. package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +17 -0
  130. package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js.map +1 -0
  131. package/dist/components/Map/components/MapLayer/components/LegendArea/index.js +179 -0
  132. package/dist/components/Map/components/MapLayer/components/LegendArea/index.js.map +1 -0
  133. package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +92 -0
  134. package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js.map +1 -0
  135. package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +11 -0
  136. package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -0
  137. package/dist/components/Map/components/MapLayer/components/PointLayer/index.js +48 -0
  138. package/dist/components/Map/components/MapLayer/components/PointLayer/index.js.map +1 -0
  139. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +64 -0
  140. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js.map +1 -0
  141. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +130 -0
  142. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js.map +1 -0
  143. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +41 -0
  144. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js.map +1 -0
  145. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +50 -0
  146. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js.map +1 -0
  147. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +56 -0
  148. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js.map +1 -0
  149. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +40 -0
  150. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js.map +1 -0
  151. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +40 -0
  152. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js.map +1 -0
  153. package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +12 -0
  154. package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -0
  155. package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js +55 -0
  156. package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js.map +1 -0
  157. package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +56 -0
  158. package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css.map +1 -0
  159. package/dist/components/Map/components/MapLayer/index.js +32 -0
  160. package/dist/components/Map/components/MapLayer/index.js.map +1 -0
  161. package/dist/components/Map/components/MapLayer/interfaces/index.js +10 -0
  162. package/dist/components/Map/components/MapLayer/interfaces/index.js.map +1 -0
  163. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +405 -0
  164. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -0
  165. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js +115 -0
  166. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -0
  167. package/dist/components/Map/components/MapProvider/hooks/index.js +16 -0
  168. package/dist/components/Map/components/MapProvider/hooks/index.js.map +1 -0
  169. package/dist/components/Map/components/MapProvider/index.js +95 -0
  170. package/dist/components/Map/components/MapProvider/index.js.map +1 -0
  171. package/dist/components/Map/components/MapUpdater/index.js +11 -0
  172. package/dist/components/Map/components/MapUpdater/index.js.map +1 -0
  173. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js +41 -0
  174. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -0
  175. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +24 -0
  176. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js.map +1 -0
  177. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js +174 -0
  178. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -0
  179. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +21 -0
  180. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js.map +1 -0
  181. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +36 -0
  182. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -0
  183. package/{build/es/components/Map → dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect}/constants/colors.js +18 -3
  184. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js.map +1 -0
  185. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +71 -0
  186. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -0
  187. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +15 -0
  188. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css.map +1 -0
  189. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +12 -0
  190. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css.map +1 -0
  191. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +82 -0
  192. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -0
  193. package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +57 -0
  194. package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -0
  195. package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +44 -0
  196. package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js.map +1 -0
  197. package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +60 -0
  198. package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js.map +1 -0
  199. package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js +54 -0
  200. package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js.map +1 -0
  201. package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.js +63 -0
  202. package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.js.map +1 -0
  203. package/dist/components/Map/components/ThematicLayerConfiguration/index.js +5 -0
  204. package/dist/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -0
  205. package/dist/components/Map/components/ThematicLayerConfiguration/types/index.js +3 -0
  206. package/dist/components/Map/components/ThematicLayerConfiguration/types/index.js.map +1 -0
  207. package/{build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect → dist/components/Map}/constants/colors.js +19 -3
  208. package/dist/components/Map/constants/colors.js.map +1 -0
  209. package/dist/components/Map/constants/legendSet.js +23 -0
  210. package/dist/components/Map/constants/legendSet.js.map +1 -0
  211. package/dist/components/Map/hooks/map.js +44 -0
  212. package/dist/components/Map/hooks/map.js.map +1 -0
  213. package/dist/components/Map/index.js +7 -0
  214. package/dist/components/Map/index.js.map +1 -0
  215. package/dist/components/Map/interfaces/index.js +3 -0
  216. package/dist/components/Map/interfaces/index.js.map +1 -0
  217. package/dist/components/Map/state/index.js +18 -0
  218. package/dist/components/Map/state/index.js.map +1 -0
  219. package/dist/components/Map/utils/colors.js +85 -0
  220. package/dist/components/Map/utils/colors.js.map +1 -0
  221. package/dist/components/Map/utils/helpers.js +18 -0
  222. package/dist/components/Map/utils/helpers.js.map +1 -0
  223. package/dist/components/Map/utils/map.js +138 -0
  224. package/dist/components/Map/utils/map.js.map +1 -0
  225. package/dist/components/SingleValueContainer/SingleValueContainer.stories.js +145 -0
  226. package/dist/components/SingleValueContainer/SingleValueContainer.stories.js.map +1 -0
  227. package/dist/components/SingleValueContainer/SingleValueVisualizer.js +44 -0
  228. package/dist/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -0
  229. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +49 -0
  230. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -0
  231. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +22 -0
  232. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js.map +1 -0
  233. package/dist/components/SingleValueContainer/index.js +5 -0
  234. package/dist/components/SingleValueContainer/index.js.map +1 -0
  235. package/dist/components/SingleValueContainer/styles/SingleValueContainer.module.css +32 -0
  236. package/dist/components/SingleValueContainer/styles/SingleValueContainer.module.css.map +1 -0
  237. package/dist/components/SingleValueContainer/types/props.js +3 -0
  238. package/dist/components/SingleValueContainer/types/props.js.map +1 -0
  239. package/dist/components/Visualization/components/AnalyticsDataProvider/index.js +94 -0
  240. package/dist/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -0
  241. package/dist/components/Visualization/components/DimensionsProvider/index.js +35 -0
  242. package/dist/components/Visualization/components/DimensionsProvider/index.js.map +1 -0
  243. package/dist/components/Visualization/components/LayoutProvider/index.js +18 -0
  244. package/dist/components/Visualization/components/LayoutProvider/index.js.map +1 -0
  245. package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js +85 -0
  246. package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -0
  247. package/dist/components/Visualization/components/VisualizationProvider/index.js +19 -0
  248. package/dist/components/Visualization/components/VisualizationProvider/index.js.map +1 -0
  249. package/dist/components/Visualization/components/VisualizationSelector/index.js +167 -0
  250. package/dist/components/Visualization/components/VisualizationSelector/index.js.map +1 -0
  251. package/dist/components/Visualization/components/VisualizationTypeProvider/index.js +27 -0
  252. package/dist/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -0
  253. package/dist/components/Visualization/components/VisualizationTypeSelector/index.js +55 -0
  254. package/dist/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -0
  255. package/dist/components/Visualization/index.js +113 -0
  256. package/dist/components/Visualization/index.js.map +1 -0
  257. package/dist/index.js +8 -0
  258. package/dist/index.js.map +1 -0
  259. package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts +26 -0
  260. package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts.map +1 -0
  261. package/{build → dist}/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +3 -3
  262. package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts.map +1 -0
  263. package/{build → dist}/types/components/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts +1 -0
  264. package/dist/types/components/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts.map +1 -0
  265. package/{build → dist}/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts +3 -2
  266. package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts.map +1 -0
  267. package/{build → dist}/types/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts +1 -0
  268. package/dist/types/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts.map +1 -0
  269. package/{build → dist}/types/components/ChartAnalytics/hooks/useChart.d.ts +3 -2
  270. package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts.map +1 -0
  271. package/dist/types/components/ChartAnalytics/index.d.ts +2 -0
  272. package/dist/types/components/ChartAnalytics/index.d.ts.map +1 -0
  273. package/{build → dist}/types/components/ChartAnalytics/models/bar.d.ts +2 -1
  274. package/dist/types/components/ChartAnalytics/models/bar.d.ts.map +1 -0
  275. package/{build → dist}/types/components/ChartAnalytics/models/column.d.ts +2 -1
  276. package/dist/types/components/ChartAnalytics/models/column.d.ts.map +1 -0
  277. package/{build → dist}/types/components/ChartAnalytics/models/index.d.ts +2 -1
  278. package/dist/types/components/ChartAnalytics/models/index.d.ts.map +1 -0
  279. package/{build → dist}/types/components/ChartAnalytics/models/line.d.ts +2 -1
  280. package/dist/types/components/ChartAnalytics/models/line.d.ts.map +1 -0
  281. package/{build → dist}/types/components/ChartAnalytics/models/multi-series.d.ts +2 -1
  282. package/dist/types/components/ChartAnalytics/models/multi-series.d.ts.map +1 -0
  283. package/{build → dist}/types/components/ChartAnalytics/models/pie.d.ts +2 -1
  284. package/dist/types/components/ChartAnalytics/models/pie.d.ts.map +1 -0
  285. package/{build → dist}/types/components/ChartAnalytics/services/export.d.ts +1 -0
  286. package/dist/types/components/ChartAnalytics/services/export.d.ts.map +1 -0
  287. package/{build → dist}/types/components/ChartAnalytics/types/props.d.ts +1 -0
  288. package/dist/types/components/ChartAnalytics/types/props.d.ts.map +1 -0
  289. package/{build → dist}/types/components/ChartAnalytics/utils/chart.d.ts +3 -2
  290. package/dist/types/components/ChartAnalytics/utils/chart.d.ts.map +1 -0
  291. package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts +6 -0
  292. package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts.map +1 -0
  293. package/dist/types/components/CircularProgressDashboard/index.d.ts +3 -0
  294. package/dist/types/components/CircularProgressDashboard/index.d.ts.map +1 -0
  295. package/{build → dist}/types/components/CircularProgressDashboard/types/props.d.ts +1 -0
  296. package/dist/types/components/CircularProgressDashboard/types/props.d.ts.map +1 -0
  297. package/{build/types/components/CustomPivotTable/index.d.ts → dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts} +8 -12
  298. package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts.map +1 -0
  299. package/dist/types/components/DHIS2PivotTable/components/Table/index.d.ts +9 -0
  300. package/dist/types/components/DHIS2PivotTable/components/Table/index.d.ts.map +1 -0
  301. package/dist/types/components/DHIS2PivotTable/components/TableBody/index.d.ts +2 -0
  302. package/dist/types/components/DHIS2PivotTable/components/TableBody/index.d.ts.map +1 -0
  303. package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts +2 -0
  304. package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts.map +1 -0
  305. package/dist/types/components/DHIS2PivotTable/index.d.ts +3 -0
  306. package/dist/types/components/DHIS2PivotTable/index.d.ts.map +1 -0
  307. package/{build/types/components/CustomPivotTable → dist/types/components/DHIS2PivotTable}/interfaces/index.d.ts +1 -0
  308. package/dist/types/components/DHIS2PivotTable/interfaces/index.d.ts.map +1 -0
  309. package/{build/types/components/CustomPivotTable → dist/types/components/DHIS2PivotTable}/services/engine.d.ts +4 -3
  310. package/dist/types/components/DHIS2PivotTable/services/engine.d.ts.map +1 -0
  311. package/dist/types/components/DHIS2PivotTable/state/engine.d.ts +8 -0
  312. package/dist/types/components/DHIS2PivotTable/state/engine.d.ts.map +1 -0
  313. package/dist/types/components/Map/DHIS2Map.d.ts +9 -0
  314. package/dist/types/components/Map/DHIS2Map.d.ts.map +1 -0
  315. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts +10 -0
  316. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts.map +1 -0
  317. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.d.ts +9 -0
  318. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.d.ts.map +1 -0
  319. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts +2 -0
  320. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts.map +1 -0
  321. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts +2 -0
  322. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts.map +1 -0
  323. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts +2 -0
  324. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts.map +1 -0
  325. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts +2 -0
  326. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts.map +1 -0
  327. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts +2 -0
  328. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts.map +1 -0
  329. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts +4 -0
  330. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts.map +1 -0
  331. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts +8 -0
  332. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts.map +1 -0
  333. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +3 -0
  334. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts.map +1 -0
  335. package/{build → dist}/types/components/Map/components/MapArea/index.d.ts +2 -1
  336. package/dist/types/components/Map/components/MapArea/index.d.ts.map +1 -0
  337. package/{build → dist}/types/components/Map/components/MapArea/interfaces/index.d.ts +1 -0
  338. package/dist/types/components/Map/components/MapArea/interfaces/index.d.ts.map +1 -0
  339. package/{build → dist}/types/components/Map/components/MapControls/components/CustomControl/index.d.ts +2 -1
  340. package/dist/types/components/Map/components/MapControls/components/CustomControl/index.d.ts.map +1 -0
  341. package/{build → dist}/types/components/Map/components/MapControls/components/DownloadControl/index.d.ts +2 -2
  342. package/dist/types/components/Map/components/MapControls/components/DownloadControl/index.d.ts.map +1 -0
  343. package/{build → dist}/types/components/Map/components/MapControls/components/FullscreenControl/index.d.ts +1 -0
  344. package/dist/types/components/Map/components/MapControls/components/FullscreenControl/index.d.ts.map +1 -0
  345. package/dist/types/components/Map/components/MapControls/index.d.ts +6 -0
  346. package/dist/types/components/Map/components/MapControls/index.d.ts.map +1 -0
  347. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +2 -0
  348. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts.map +1 -0
  349. package/{build → dist}/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +6 -6
  350. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts.map +1 -0
  351. package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +4 -3
  352. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts.map +1 -0
  353. package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +2 -1
  354. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts.map +1 -0
  355. package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +3 -2
  356. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts.map +1 -0
  357. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +4 -0
  358. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts.map +1 -0
  359. package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +2 -1
  360. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts.map +1 -0
  361. package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +3 -2
  362. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts.map +1 -0
  363. package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +3 -2
  364. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts.map +1 -0
  365. package/{build → dist}/types/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts +3 -3
  366. package/dist/types/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts.map +1 -0
  367. package/{build → dist}/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts +4 -4
  368. package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts.map +1 -0
  369. package/{build → dist}/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts +1 -0
  370. package/dist/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts.map +1 -0
  371. package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +3 -0
  372. package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts.map +1 -0
  373. package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +2 -0
  374. package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts.map +1 -0
  375. package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +2 -2
  376. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts.map +1 -0
  377. package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +3 -2
  378. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts.map +1 -0
  379. package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +2 -1
  380. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts.map +1 -0
  381. package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +3 -3
  382. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts.map +1 -0
  383. package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +4 -3
  384. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts.map +1 -0
  385. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +12 -0
  386. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts.map +1 -0
  387. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +5 -0
  388. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts.map +1 -0
  389. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +3 -0
  390. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts.map +1 -0
  391. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +5 -0
  392. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts.map +1 -0
  393. package/{build → dist}/types/components/Map/components/MapLayer/index.d.ts +3 -3
  394. package/dist/types/components/Map/components/MapLayer/index.d.ts.map +1 -0
  395. package/{build → dist}/types/components/Map/components/MapLayer/interfaces/index.d.ts +5 -4
  396. package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts.map +1 -0
  397. package/{build → dist}/types/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts +1 -0
  398. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts.map +1 -0
  399. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +7 -0
  400. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts.map +1 -0
  401. package/{build → dist}/types/components/Map/components/MapProvider/hooks/index.d.ts +4 -3
  402. package/dist/types/components/Map/components/MapProvider/hooks/index.d.ts.map +1 -0
  403. package/dist/types/components/Map/components/MapProvider/index.d.ts +3 -0
  404. package/dist/types/components/Map/components/MapProvider/index.d.ts.map +1 -0
  405. package/{build → dist}/types/components/Map/components/MapUpdater/index.d.ts +2 -2
  406. package/dist/types/components/Map/components/MapUpdater/index.d.ts.map +1 -0
  407. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.d.ts +3 -0
  408. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.d.ts.map +1 -0
  409. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts +3 -0
  410. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts.map +1 -0
  411. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +8 -0
  412. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts.map +1 -0
  413. package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts +1 -0
  414. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts.map +1 -0
  415. package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +2 -2
  416. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts.map +1 -0
  417. package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +2 -1
  418. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts.map +1 -0
  419. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +2 -0
  420. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts.map +1 -0
  421. package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts +2 -2
  422. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts.map +1 -0
  423. package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts +2 -2
  424. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts.map +1 -0
  425. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/RadiusField.d.ts +2 -0
  426. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/RadiusField.d.ts.map +1 -0
  427. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/TypeField.d.ts +2 -0
  428. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/TypeField.d.ts.map +1 -0
  429. package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +4 -0
  430. package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts.map +1 -0
  431. package/dist/types/components/Map/components/ThematicLayerConfiguration/types/index.d.ts +15 -0
  432. package/dist/types/components/Map/components/ThematicLayerConfiguration/types/index.d.ts.map +1 -0
  433. package/{build → dist}/types/components/Map/constants/colors.d.ts +1 -0
  434. package/dist/types/components/Map/constants/colors.d.ts.map +1 -0
  435. package/{build → dist}/types/components/Map/constants/legendSet.d.ts +1 -0
  436. package/dist/types/components/Map/constants/legendSet.d.ts.map +1 -0
  437. package/{build → dist}/types/components/Map/hooks/map.d.ts +1 -0
  438. package/dist/types/components/Map/hooks/map.d.ts.map +1 -0
  439. package/dist/types/components/Map/index.d.ts +6 -0
  440. package/dist/types/components/Map/index.d.ts.map +1 -0
  441. package/{build → dist}/types/components/Map/interfaces/index.d.ts +3 -2
  442. package/dist/types/components/Map/interfaces/index.d.ts.map +1 -0
  443. package/{build → dist}/types/components/Map/state/index.d.ts +3 -2
  444. package/dist/types/components/Map/state/index.d.ts.map +1 -0
  445. package/{build → dist}/types/components/Map/utils/colors.d.ts +2 -1
  446. package/dist/types/components/Map/utils/colors.d.ts.map +1 -0
  447. package/{build → dist}/types/components/Map/utils/helpers.d.ts +1 -0
  448. package/dist/types/components/Map/utils/helpers.d.ts.map +1 -0
  449. package/{build → dist}/types/components/Map/utils/map.d.ts +1 -0
  450. package/dist/types/components/Map/utils/map.d.ts.map +1 -0
  451. package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts +11 -0
  452. package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts.map +1 -0
  453. package/{build → dist}/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +2 -1
  454. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts.map +1 -0
  455. package/{build → dist}/types/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts +2 -1
  456. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts.map +1 -0
  457. package/dist/types/components/SingleValueContainer/index.d.ts +4 -0
  458. package/dist/types/components/SingleValueContainer/index.d.ts.map +1 -0
  459. package/{build → dist}/types/components/SingleValueContainer/types/props.d.ts +3 -1
  460. package/dist/types/components/SingleValueContainer/types/props.d.ts.map +1 -0
  461. package/{build → dist}/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts +2 -1
  462. package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts.map +1 -0
  463. package/{build → dist}/types/components/Visualization/components/DimensionsProvider/index.d.ts +2 -1
  464. package/dist/types/components/Visualization/components/DimensionsProvider/index.d.ts.map +1 -0
  465. package/{build → dist}/types/components/Visualization/components/LayoutProvider/index.d.ts +3 -2
  466. package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts.map +1 -0
  467. package/{build → dist}/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts +3 -3
  468. package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts.map +1 -0
  469. package/{build → dist}/types/components/Visualization/components/VisualizationProvider/index.d.ts +5 -4
  470. package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts.map +1 -0
  471. package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts +23 -0
  472. package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts.map +1 -0
  473. package/{build → dist}/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts +3 -2
  474. package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts.map +1 -0
  475. package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts +2 -0
  476. package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts.map +1 -0
  477. package/{build → dist}/types/components/Visualization/index.d.ts +8 -8
  478. package/dist/types/components/Visualization/index.d.ts.map +1 -0
  479. package/dist/types/index.d.ts +7 -0
  480. package/dist/types/index.d.ts.map +1 -0
  481. package/package.json +59 -63
  482. package/README.md +0 -45
  483. package/build/cjs/components/ChartAnalytics/ChartAnalytics.test.js +0 -51
  484. package/build/cjs/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +0 -48
  485. package/build/cjs/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +0 -34
  486. package/build/cjs/components/ChartAnalytics/components/DownloadMenu/index.js +0 -65
  487. package/build/cjs/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +0 -1
  488. package/build/cjs/components/ChartAnalytics/hooks/useChart.js +0 -38
  489. package/build/cjs/components/ChartAnalytics/index.js +0 -86
  490. package/build/cjs/components/ChartAnalytics/models/bar.js +0 -24
  491. package/build/cjs/components/ChartAnalytics/models/column.js +0 -53
  492. package/build/cjs/components/ChartAnalytics/models/index.js +0 -112
  493. package/build/cjs/components/ChartAnalytics/models/line.js +0 -35
  494. package/build/cjs/components/ChartAnalytics/models/multi-series.js +0 -111
  495. package/build/cjs/components/ChartAnalytics/models/pie.js +0 -53
  496. package/build/cjs/components/ChartAnalytics/services/export.js +0 -50
  497. package/build/cjs/components/ChartAnalytics/styles/custom-highchart.css +0 -48
  498. package/build/cjs/components/ChartAnalytics/types/props.js +0 -1
  499. package/build/cjs/components/ChartAnalytics/utils/chart.js +0 -138
  500. package/build/cjs/components/CircularProgressDashboard/CircularProgressIndicator.test.js +0 -13
  501. package/build/cjs/components/CircularProgressDashboard/index.js +0 -64
  502. package/build/cjs/components/CircularProgressDashboard/types/props.js +0 -1
  503. package/build/cjs/components/CustomPivotTable/components/Table/index.js +0 -16
  504. package/build/cjs/components/CustomPivotTable/components/TableBody/TableBody.module.css +0 -12
  505. package/build/cjs/components/CustomPivotTable/components/TableBody/index.js +0 -109
  506. package/build/cjs/components/CustomPivotTable/components/TableHeaders/TableHeaders.module.css +0 -10
  507. package/build/cjs/components/CustomPivotTable/components/TableHeaders/index.js +0 -89
  508. package/build/cjs/components/CustomPivotTable/index.js +0 -30
  509. package/build/cjs/components/CustomPivotTable/interfaces/index.js +0 -1
  510. package/build/cjs/components/CustomPivotTable/services/engine.js +0 -89
  511. package/build/cjs/components/CustomPivotTable/state/engine.js +0 -23
  512. package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +0 -32
  513. package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +0 -40
  514. package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/index.js +0 -458
  515. package/build/cjs/components/Map/components/MapArea/index.js +0 -101
  516. package/build/cjs/components/Map/components/MapArea/interfaces/index.js +0 -1
  517. package/build/cjs/components/Map/components/MapControls/components/CustomControl/index.js +0 -32
  518. package/build/cjs/components/Map/components/MapControls/components/DownloadControl/index.js +0 -25
  519. package/build/cjs/components/Map/components/MapControls/components/FullscreenControl/index.js +0 -13
  520. package/build/cjs/components/Map/components/MapControls/index.js +0 -42
  521. package/build/cjs/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +0 -13
  522. package/build/cjs/components/Map/components/MapLayer/components/BoundaryLayer/index.js +0 -51
  523. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +0 -104
  524. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +0 -379
  525. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +0 -36
  526. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +0 -200
  527. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +0 -1
  528. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +0 -15
  529. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +0 -403
  530. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +0 -124
  531. package/build/cjs/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +0 -12
  532. package/build/cjs/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +0 -26
  533. package/build/cjs/components/Map/components/MapLayer/components/LegendArea/index.js +0 -180
  534. package/build/cjs/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +0 -86
  535. package/build/cjs/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +0 -14
  536. package/build/cjs/components/Map/components/MapLayer/components/PointLayer/index.js +0 -46
  537. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +0 -57
  538. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +0 -145
  539. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +0 -43
  540. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +0 -56
  541. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +0 -61
  542. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +0 -43
  543. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +0 -35
  544. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +0 -15
  545. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/index.js +0 -57
  546. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +0 -62
  547. package/build/cjs/components/Map/components/MapLayer/index.js +0 -40
  548. package/build/cjs/components/Map/components/MapLayer/interfaces/index.js +0 -8
  549. package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +0 -399
  550. package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/index.js +0 -116
  551. package/build/cjs/components/Map/components/MapProvider/hooks/index.js +0 -19
  552. package/build/cjs/components/Map/components/MapProvider/index.js +0 -121
  553. package/build/cjs/components/Map/components/MapUpdater/index.js +0 -24
  554. package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +0 -32
  555. package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +0 -40
  556. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +0 -40
  557. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js +0 -428
  558. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +0 -63
  559. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +0 -15
  560. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +0 -12
  561. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +0 -72
  562. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +0 -71
  563. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +0 -47
  564. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +0 -79
  565. package/build/cjs/components/Map/components/ThematicLayerConfiguration/index.js +0 -265
  566. package/build/cjs/components/Map/constants/colors.js +0 -429
  567. package/build/cjs/components/Map/constants/legendSet.js +0 -22
  568. package/build/cjs/components/Map/hooks/map.js +0 -52
  569. package/build/cjs/components/Map/index.js +0 -108
  570. package/build/cjs/components/Map/interfaces/index.js +0 -1
  571. package/build/cjs/components/Map/state/index.js +0 -23
  572. package/build/cjs/components/Map/utils/colors.js +0 -78
  573. package/build/cjs/components/Map/utils/helpers.js +0 -25
  574. package/build/cjs/components/Map/utils/map.js +0 -161
  575. package/build/cjs/components/SingleValueContainer/SingleValueContainer.test.js +0 -23
  576. package/build/cjs/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +0 -54
  577. package/build/cjs/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +0 -24
  578. package/build/cjs/components/SingleValueContainer/index.js +0 -59
  579. package/build/cjs/components/SingleValueContainer/styles/SingleValueContainer.module.css +0 -39
  580. package/build/cjs/components/SingleValueContainer/types/props.js +0 -1
  581. package/build/cjs/components/Visualization/components/AnalyticsDataProvider/index.js +0 -102
  582. package/build/cjs/components/Visualization/components/DimensionsProvider/index.js +0 -56
  583. package/build/cjs/components/Visualization/components/LayoutProvider/index.js +0 -31
  584. package/build/cjs/components/Visualization/components/VisualizationDimensionSelector/index.js +0 -77
  585. package/build/cjs/components/Visualization/components/VisualizationProvider/index.js +0 -29
  586. package/build/cjs/components/Visualization/components/VisualizationSelector/index.js +0 -180
  587. package/build/cjs/components/Visualization/components/VisualizationTypeProvider/index.js +0 -40
  588. package/build/cjs/components/Visualization/components/VisualizationTypeSelector/index.js +0 -54
  589. package/build/cjs/components/Visualization/index.js +0 -96
  590. package/build/cjs/index.js +0 -71
  591. package/build/cjs/locales/en/translations.json +0 -138
  592. package/build/cjs/locales/index.js +0 -22
  593. package/build/es/components/ChartAnalytics/ChartAnalytics.test.js +0 -46
  594. package/build/es/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +0 -41
  595. package/build/es/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +0 -26
  596. package/build/es/components/ChartAnalytics/components/DownloadMenu/index.js +0 -57
  597. package/build/es/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +0 -1
  598. package/build/es/components/ChartAnalytics/hooks/useChart.js +0 -32
  599. package/build/es/components/ChartAnalytics/index.js +0 -40
  600. package/build/es/components/ChartAnalytics/models/bar.js +0 -16
  601. package/build/es/components/ChartAnalytics/models/index.js +0 -105
  602. package/build/es/components/ChartAnalytics/models/multi-series.js +0 -104
  603. package/build/es/components/ChartAnalytics/models/pie.js +0 -46
  604. package/build/es/components/ChartAnalytics/services/export.js +0 -36
  605. package/build/es/components/ChartAnalytics/styles/custom-highchart.css +0 -48
  606. package/build/es/components/ChartAnalytics/types/props.js +0 -1
  607. package/build/es/components/ChartAnalytics/utils/chart.js +0 -127
  608. package/build/es/components/CircularProgressDashboard/CircularProgressIndicator.test.js +0 -10
  609. package/build/es/components/CircularProgressDashboard/index.js +0 -42
  610. package/build/es/components/CircularProgressDashboard/types/props.js +0 -1
  611. package/build/es/components/CustomPivotTable/components/Table/index.js +0 -9
  612. package/build/es/components/CustomPivotTable/components/TableBody/TableBody.module.css +0 -12
  613. package/build/es/components/CustomPivotTable/components/TableBody/index.js +0 -100
  614. package/build/es/components/CustomPivotTable/components/TableHeaders/TableHeaders.module.css +0 -10
  615. package/build/es/components/CustomPivotTable/components/TableHeaders/index.js +0 -82
  616. package/build/es/components/CustomPivotTable/index.js +0 -22
  617. package/build/es/components/CustomPivotTable/interfaces/index.js +0 -1
  618. package/build/es/components/CustomPivotTable/services/engine.js +0 -82
  619. package/build/es/components/CustomPivotTable/state/engine.js +0 -14
  620. package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +0 -23
  621. package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +0 -31
  622. package/build/es/components/Map/components/EarthEngineLayerConfiguration/index.js +0 -448
  623. package/build/es/components/Map/components/MapArea/index.js +0 -91
  624. package/build/es/components/Map/components/MapArea/interfaces/index.js +0 -1
  625. package/build/es/components/Map/components/MapControls/components/CustomControl/index.js +0 -25
  626. package/build/es/components/Map/components/MapControls/components/DownloadControl/index.js +0 -18
  627. package/build/es/components/Map/components/MapControls/components/FullscreenControl/index.js +0 -6
  628. package/build/es/components/Map/components/MapControls/index.js +0 -35
  629. package/build/es/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +0 -7
  630. package/build/es/components/Map/components/MapLayer/components/BoundaryLayer/index.js +0 -41
  631. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +0 -93
  632. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +0 -369
  633. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +0 -29
  634. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +0 -191
  635. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +0 -1
  636. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +0 -15
  637. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +0 -111
  638. package/build/es/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +0 -12
  639. package/build/es/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +0 -19
  640. package/build/es/components/Map/components/MapLayer/components/LegendArea/index.js +0 -171
  641. package/build/es/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +0 -76
  642. package/build/es/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +0 -8
  643. package/build/es/components/Map/components/MapLayer/components/PointLayer/index.js +0 -39
  644. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +0 -49
  645. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +0 -133
  646. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +0 -33
  647. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +0 -47
  648. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +0 -50
  649. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +0 -36
  650. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +0 -28
  651. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +0 -9
  652. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/index.js +0 -50
  653. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +0 -62
  654. package/build/es/components/Map/components/MapLayer/index.js +0 -33
  655. package/build/es/components/Map/components/MapLayer/interfaces/index.js +0 -1
  656. package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +0 -391
  657. package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/index.js +0 -107
  658. package/build/es/components/Map/components/MapProvider/hooks/index.js +0 -11
  659. package/build/es/components/Map/components/MapProvider/index.js +0 -112
  660. package/build/es/components/Map/components/MapUpdater/index.js +0 -17
  661. package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +0 -23
  662. package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +0 -31
  663. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +0 -33
  664. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +0 -53
  665. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +0 -15
  666. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +0 -12
  667. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +0 -56
  668. package/build/es/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +0 -64
  669. package/build/es/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +0 -38
  670. package/build/es/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +0 -70
  671. package/build/es/components/Map/components/ThematicLayerConfiguration/index.js +0 -254
  672. package/build/es/components/Map/constants/legendSet.js +0 -15
  673. package/build/es/components/Map/hooks/map.js +0 -44
  674. package/build/es/components/Map/index.js +0 -51
  675. package/build/es/components/Map/interfaces/index.js +0 -1
  676. package/build/es/components/Map/state/index.js +0 -14
  677. package/build/es/components/Map/utils/colors.js +0 -61
  678. package/build/es/components/Map/utils/helpers.js +0 -14
  679. package/build/es/components/Map/utils/map.js +0 -147
  680. package/build/es/components/SingleValueContainer/SingleValueContainer.test.js +0 -20
  681. package/build/es/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +0 -47
  682. package/build/es/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +0 -17
  683. package/build/es/components/SingleValueContainer/index.js +0 -30
  684. package/build/es/components/SingleValueContainer/styles/SingleValueContainer.module.css +0 -39
  685. package/build/es/components/SingleValueContainer/types/props.js +0 -1
  686. package/build/es/components/Visualization/components/AnalyticsDataProvider/index.js +0 -93
  687. package/build/es/components/Visualization/components/DimensionsProvider/index.js +0 -44
  688. package/build/es/components/Visualization/components/LayoutProvider/index.js +0 -20
  689. package/build/es/components/Visualization/components/VisualizationDimensionSelector/index.js +0 -68
  690. package/build/es/components/Visualization/components/VisualizationProvider/index.js +0 -22
  691. package/build/es/components/Visualization/components/VisualizationSelector/index.js +0 -166
  692. package/build/es/components/Visualization/components/VisualizationTypeProvider/index.js +0 -25
  693. package/build/es/components/Visualization/components/VisualizationTypeSelector/index.js +0 -45
  694. package/build/es/components/Visualization/index.js +0 -89
  695. package/build/es/index.js +0 -7
  696. package/build/es/locales/en/translations.json +0 -138
  697. package/build/es/locales/index.js +0 -13
  698. package/build/types/components/ChartAnalytics/index.d.ts +0 -7
  699. package/build/types/components/CircularProgressDashboard/index.d.ts +0 -4
  700. package/build/types/components/CustomPivotTable/components/Table/index.d.ts +0 -12
  701. package/build/types/components/CustomPivotTable/components/TableBody/index.d.ts +0 -2
  702. package/build/types/components/CustomPivotTable/components/TableHeaders/index.d.ts +0 -2
  703. package/build/types/components/CustomPivotTable/state/engine.d.ts +0 -7
  704. package/build/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +0 -17
  705. package/build/types/components/Map/components/MapControls/index.d.ts +0 -6
  706. package/build/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +0 -1
  707. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +0 -4
  708. package/build/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +0 -2
  709. package/build/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +0 -2
  710. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +0 -12
  711. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +0 -5
  712. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +0 -2
  713. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +0 -5
  714. package/build/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +0 -6
  715. package/build/types/components/Map/components/MapProvider/index.d.ts +0 -3
  716. package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +0 -8
  717. package/build/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +0 -2
  718. package/build/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +0 -18
  719. package/build/types/components/Map/index.d.ts +0 -8
  720. package/build/types/components/SingleValueContainer/index.d.ts +0 -6
  721. package/build/types/components/Visualization/components/VisualizationSelector/index.d.ts +0 -23
  722. package/build/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts +0 -2
  723. package/build/types/index.d.ts +0 -6
  724. /package/{LICENSE → LICENCE} +0 -0
@@ -1,43 +1,14 @@
1
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
- import { combineReducers, getFeatureCollectionProperties, getHistogramStatistics, getInfo, getScale, hasClasses } from "../utils";
5
- import { find, head, isEmpty } from "lodash";
1
+ import { getInfo, getScale, getFeatureCollectionProperties, getHistogramStatistics, hasClasses, combineReducers } from '../utils/index.js';
2
+ import { head, isEmpty, find } from 'lodash';
3
+ import * as EE from './api.js';
6
4
 
7
- // async function importEEModule(): Promise<any> {
8
- // // @ts-ignore
9
- // if (import.meta.env.STORYBOOK_BUILD === "true") {
10
- // return await import("@google/earthengine");
11
- // }
12
- // return await import("./api");
13
- // }
14
- // const EE = await importEEModule();
15
- //@ts-ignore
16
- import EE from "./api";
17
- // @ts-ignore
18
5
  const ee = EE;
19
- // @ts-ignore
20
6
  window.ee = ee;
21
- const FEATURE_STYLE = {
22
- color: "FFA500",
23
- strokeWidth: 2
24
- };
7
+ const FEATURE_STYLE = { color: "FFA500", strokeWidth: 2 };
25
8
  const DEFAULT_TILE_SCALE = 1;
26
- export class EarthEngine {
27
- constructor(_ref) {
28
- let {
29
- options
30
- } = _ref;
31
- _defineProperty(this, "token", void 0);
32
- _defineProperty(this, "options", void 0);
33
- _defineProperty(this, "refresh", void 0);
34
- _defineProperty(this, "orgUnits", void 0);
35
- _defineProperty(this, "initialized", false);
36
- _defineProperty(this, "period", void 0);
37
- _defineProperty(this, "instance", void 0);
38
- _defineProperty(this, "scale", void 0);
39
- _defineProperty(this, "image", void 0);
40
- _defineProperty(this, "aggregationData", void 0);
9
+ class EarthEngine {
10
+ constructor({ options }) {
11
+ this.initialized = false;
41
12
  this.options = options;
42
13
  this.initialized = true;
43
14
  this.getInstance();
@@ -45,14 +16,11 @@ export class EarthEngine {
45
16
  static async setToken(token, refresh) {
46
17
  const tokenType = "Bearer";
47
18
  function refreshToken(authArgs, callback) {
48
- refresh().then(_ref2 => {
49
- let {
50
- token
51
- } = _ref2;
19
+ refresh().then(({ token: token2 }) => {
52
20
  callback({
53
- ...token,
54
- token_type: tokenType !== null && tokenType !== void 0 ? tokenType : "Bearer",
55
- state: authArgs === null || authArgs === void 0 ? void 0 : authArgs.scope
21
+ ...token2,
22
+ token_type: tokenType ,
23
+ state: authArgs?.scope
56
24
  });
57
25
  });
58
26
  }
@@ -61,14 +29,18 @@ export class EarthEngine {
61
29
  ee.initialize(null, null, resolve, reject);
62
30
  }
63
31
  if (token) {
64
- const {
65
- access_token,
32
+ const { access_token, client_id, expires_in } = token;
33
+ ee.data.setAuthToken(
66
34
  client_id,
67
- expires_in
68
- } = token;
69
- ee.data.setAuthToken(client_id, tokenType !== null && tokenType !== void 0 ? tokenType : "Bearer", access_token, expires_in, null, () => {
70
- ee.initialize(null, null, resolve, reject);
71
- }, false);
35
+ tokenType ,
36
+ access_token,
37
+ expires_in,
38
+ null,
39
+ () => {
40
+ ee.initialize(null, null, resolve, reject);
41
+ },
42
+ false
43
+ );
72
44
  ee.data.setAuthTokenRefresher(refreshToken);
73
45
  }
74
46
  resolve("Token not found");
@@ -97,9 +69,7 @@ export class EarthEngine {
97
69
  });
98
70
  }
99
71
  async getPeriod() {
100
- const {
101
- type
102
- } = this.options;
72
+ const { type } = this.options;
103
73
  if (type !== "ImageCollection") {
104
74
  return;
105
75
  }
@@ -108,15 +78,13 @@ export class EarthEngine {
108
78
  return getInfo(featureCollection);
109
79
  }
110
80
  async info() {
111
- return new Promise(resolve => {
81
+ return new Promise((resolve) => {
112
82
  this.instance.getInfo(resolve);
113
83
  });
114
84
  }
115
85
  async getScale() {
116
86
  try {
117
- const {
118
- type
119
- } = this.options;
87
+ const { type } = this.options;
120
88
  switch (type) {
121
89
  case "ImageCollection":
122
90
  this.scale = await getScale(this.instance.first());
@@ -124,15 +92,14 @@ export class EarthEngine {
124
92
  default:
125
93
  this.scale = await getScale(this.getImage());
126
94
  }
127
- } catch (e) {}
95
+ } catch (e) {
96
+ }
128
97
  }
129
98
  async getFeatureCollectionAggregation() {
130
- const {
131
- datasetId
132
- } = this.options;
99
+ const { datasetId } = this.options;
133
100
  const dataset = ee.FeatureCollection(datasetId);
134
101
  const collection = this.getFeatureCollection();
135
- const aggFeatures = collection === null || collection === void 0 ? void 0 : collection.map(feature => {
102
+ const aggFeatures = collection?.map((feature) => {
136
103
  feature = ee.Feature(feature);
137
104
  const count = dataset.filterBounds(feature.geometry()).size();
138
105
  return feature.set("count", count);
@@ -141,30 +108,34 @@ export class EarthEngine {
141
108
  }
142
109
  async getHistogramAggregations() {
143
110
  try {
144
- var _head, _this$options$legend, _this$options$tileSca;
145
- const aggregation = (_head = head(this.options.aggregations)) !== null && _head !== void 0 ? _head : "";
111
+ const aggregation = head(this.options.aggregations) ?? "";
146
112
  const reducer = ee.Reducer.frequencyHistogram();
147
113
  const collection = this.getFeatureCollection();
148
- const legend = (_this$options$legend = this.options.legend) === null || _this$options$legend === void 0 ? void 0 : _this$options$legend.items;
114
+ const legend = this.options.legend?.items;
149
115
  const scale = this.scale;
150
- const tileScale = (_this$options$tileSca = this.options.tileScale) !== null && _this$options$tileSca !== void 0 ? _this$options$tileSca : DEFAULT_TILE_SCALE;
116
+ const tileScale = this.options.tileScale ?? DEFAULT_TILE_SCALE;
151
117
  const scaleValue = await getInfo(scale);
152
118
  const image = this.getImage();
153
- const features = Object.values(await getInfo(image.reduceRegions({
154
- collection,
155
- reducer,
156
- scale,
157
- tileScale
158
- }).select(["histogram"], null, false)).then(data => getHistogramStatistics({
159
- data,
160
- scale: scaleValue,
161
- aggregationType: aggregation,
162
- legend
163
- })));
119
+ const features = Object.values(
120
+ await getInfo(
121
+ image.reduceRegions({
122
+ collection,
123
+ reducer,
124
+ scale,
125
+ tileScale
126
+ }).select(["histogram"], null, false)
127
+ ).then(
128
+ (data) => getHistogramStatistics({
129
+ data,
130
+ scale: scaleValue,
131
+ aggregationType: aggregation,
132
+ legend
133
+ })
134
+ )
135
+ );
164
136
  return features.map((feature, index) => {
165
- var _this$orgUnits;
166
137
  return {
167
- orgUnit: (_this$orgUnits = this.orgUnits) === null || _this$orgUnits === void 0 ? void 0 : _this$orgUnits[index],
138
+ orgUnit: this.orgUnits?.[index],
168
139
  data: feature
169
140
  };
170
141
  });
@@ -175,18 +146,16 @@ export class EarthEngine {
175
146
  }
176
147
  }
177
148
  async getAggregations() {
178
- var _head2, _this$options$tileSca2, _this$orgUnits2;
179
149
  await this.getScale();
180
- const {
181
- type
182
- } = this.options;
150
+ const { type } = this.options;
183
151
  if (type === "FeatureCollection") {
184
152
  this.aggregationData = await this.getFeatureCollectionAggregation();
185
153
  return;
186
154
  }
187
155
  const aggregations = this.options.aggregations;
188
- if (!aggregations) return;
189
- if (hasClasses((_head2 = head(aggregations)) !== null && _head2 !== void 0 ? _head2 : "")) {
156
+ if (!aggregations)
157
+ return;
158
+ if (hasClasses(head(aggregations) ?? "")) {
190
159
  this.aggregationData = await this.getHistogramAggregations();
191
160
  return;
192
161
  }
@@ -194,33 +163,39 @@ export class EarthEngine {
194
163
  const collection = this.getFeatureCollection();
195
164
  const image = this.getImage();
196
165
  const scale = this.scale;
197
- const tileScale = (_this$options$tileSca2 = this.options.tileScale) !== null && _this$options$tileSca2 !== void 0 ? _this$options$tileSca2 : DEFAULT_TILE_SCALE;
166
+ const tileScale = this.options.tileScale ?? DEFAULT_TILE_SCALE;
198
167
  const aggregatedFeatures = image.reduceRegions({
199
168
  collection,
200
169
  reducer,
201
170
  scale,
202
171
  tileScale
203
172
  }).select(aggregations, null, false);
204
- const features = Object.values(getFeatureCollectionProperties(await getInfo(aggregatedFeatures)));
205
- if (!isEmpty(features) && features.length === ((_this$orgUnits2 = this.orgUnits) === null || _this$orgUnits2 === void 0 ? void 0 : _this$orgUnits2.length)) {
206
- //Mapping features to orgUnits using index.
207
- this.aggregationData = features.map((feature, index) => {
208
- var _this$orgUnits3;
209
- return {
210
- orgUnit: (_this$orgUnits3 = this.orgUnits) === null || _this$orgUnits3 === void 0 ? void 0 : _this$orgUnits3[index],
211
- data: feature
212
- };
213
- });
173
+ const features = Object.values(
174
+ getFeatureCollectionProperties(await getInfo(aggregatedFeatures))
175
+ );
176
+ if (!isEmpty(features) && features.length === this.orgUnits?.length) {
177
+ this.aggregationData = features.map(
178
+ (feature, index) => {
179
+ return {
180
+ orgUnit: this.orgUnits?.[index],
181
+ data: feature
182
+ };
183
+ }
184
+ );
214
185
  }
215
186
  }
216
187
  getAggregation(orgUnit) {
217
188
  if (isEmpty(this.aggregationData)) {
218
189
  return;
219
190
  }
220
- return find(this.aggregationData, aggregation => aggregation.orgUnit.id === orgUnit.id);
191
+ return find(
192
+ this.aggregationData,
193
+ (aggregation) => aggregation.orgUnit.id === orgUnit.id
194
+ );
221
195
  }
222
196
  async url() {
223
- if (!this.initialized) throw "You need to call init() first";
197
+ if (!this.initialized)
198
+ throw "You need to call init() first";
224
199
  return this.visualize(this.getImage());
225
200
  }
226
201
  applyPeriod(imageCollection) {
@@ -247,63 +222,56 @@ export class EarthEngine {
247
222
  return ee.Reducer[type].call();
248
223
  }
249
224
  getGeometryByType(geoJSON) {
250
- return ee.Geometry(geoJSON === null || geoJSON === void 0 ? void 0 : geoJSON.geometry);
225
+ return ee.Geometry(geoJSON?.geometry);
251
226
  }
252
227
  getFeatureByType(geoJSON) {
253
- var _geoJSON$features;
254
228
  const featureType = geoJSON.type;
255
- const features = (_geoJSON$features = geoJSON.features) !== null && _geoJSON$features !== void 0 ? _geoJSON$features : [];
229
+ const features = geoJSON.features ?? [];
256
230
  const geometry = this.getGeometryByType(geoJSON);
257
231
  switch (featureType) {
258
232
  case "Feature":
259
233
  return ee.Feature(geometry);
260
234
  case "FeatureCollection":
261
- return ee.FeatureCollection([...features.map(feature => ee.Feature(this.getGeometryByType(feature)))]);
235
+ return ee.FeatureCollection([
236
+ ...features.map(
237
+ (feature) => ee.Feature(this.getGeometryByType(feature))
238
+ )
239
+ ]);
262
240
  }
263
241
  }
264
242
  getFeatureCollection() {
265
243
  if (this.orgUnits) {
266
- return ee.FeatureCollection(this.orgUnits.map(orgUnit => this.getFeatureByType(orgUnit.geoJSON)));
244
+ return ee.FeatureCollection(
245
+ this.orgUnits.map(
246
+ (orgUnit) => this.getFeatureByType(orgUnit.geoJSON)
247
+ )
248
+ );
267
249
  } else {
268
250
  throw "You need to set org units first";
269
251
  }
270
252
  }
271
253
  getParamsFromLegend() {
272
- if (!this.options.legend) return;
254
+ if (!this.options.legend)
255
+ return;
273
256
  const legend = this.options.legend.items;
274
- const keys = legend.map(l => l.id);
257
+ const keys = legend.map((l) => l.id);
275
258
  const min = Math.min(...keys);
276
259
  const max = Math.max(...keys);
277
- const palette = legend.map(l => l.color).join(",");
278
- return {
279
- min,
280
- max,
281
- palette
282
- };
260
+ const palette = legend.map((l) => l.color).join(",");
261
+ return { min, max, palette };
283
262
  }
284
263
  async visualize(image) {
285
- var _ref3, _this$getParamsFromLe, _await$Promise;
286
- const {
287
- min,
288
- max,
289
- palette
290
- } = (_ref3 = (_this$getParamsFromLe = this.getParamsFromLegend()) !== null && _this$getParamsFromLe !== void 0 ? _this$getParamsFromLe : this.options.params) !== null && _ref3 !== void 0 ? _ref3 : {
264
+ const { min, max, palette } = this.getParamsFromLegend() ?? this.options.params ?? {
291
265
  min: null,
292
266
  max: null,
293
267
  palette: null
294
268
  };
295
- return (_await$Promise = await new Promise((resolve, reject) => {
296
- image.getMap({
297
- min,
298
- max,
299
- palette
300
- }, resolve);
301
- })) === null || _await$Promise === void 0 ? void 0 : _await$Promise.urlFormat;
269
+ return (await new Promise((resolve, reject) => {
270
+ image.getMap({ min, max, palette }, resolve);
271
+ }))?.urlFormat;
302
272
  }
303
273
  getImageCollectionInstance() {
304
- const {
305
- datasetId
306
- } = this.options;
274
+ const { datasetId } = this.options;
307
275
  let imageCollection = ee.ImageCollection(datasetId);
308
276
  if (this.period) {
309
277
  imageCollection = this.applyPeriod(imageCollection);
@@ -312,25 +280,19 @@ export class EarthEngine {
312
280
  return imageCollection;
313
281
  }
314
282
  getImageFromImageCollection() {
315
- const {
316
- mosaic
317
- } = this.options;
283
+ const { mosaic } = this.options;
318
284
  const imageCollection = this.instance;
319
285
  return mosaic ? imageCollection.mosaic().clipToCollection(this.getFeatureCollection()) : ee.Image(imageCollection.first()).clipToCollection(this.getFeatureCollection());
320
286
  }
321
287
  getImageInstance() {
322
- const {
323
- datasetId
324
- } = this.options;
288
+ const { datasetId } = this.options;
325
289
  return ee.Image(datasetId).clipToCollection(this.getFeatureCollection());
326
290
  }
327
291
  getImageFromImage() {
328
292
  return this.instance;
329
293
  }
330
294
  getFeatureInstance() {
331
- const {
332
- datasetId
333
- } = this.options;
295
+ const { datasetId } = this.options;
334
296
  const feature = ee.Feature(datasetId);
335
297
  this.instance = feature;
336
298
  return feature;
@@ -339,9 +301,7 @@ export class EarthEngine {
339
301
  return this.instance;
340
302
  }
341
303
  getFeatureCollectionInstance() {
342
- const {
343
- datasetId
344
- } = this.options;
304
+ const { datasetId } = this.options;
345
305
  let featureCollection = ee.FeatureCollection(datasetId);
346
306
  if (this.period) {
347
307
  featureCollection = this.applyPeriod(featureCollection);
@@ -353,9 +313,7 @@ export class EarthEngine {
353
313
  return featureCollection.draw(FEATURE_STYLE).clipToCollection(this.getFeatureCollection());
354
314
  }
355
315
  getInstance() {
356
- const {
357
- type
358
- } = this.options;
316
+ const { type } = this.options;
359
317
  switch (type) {
360
318
  case "Feature":
361
319
  this.instance = this.getFeatureInstance();
@@ -377,9 +335,7 @@ export class EarthEngine {
377
335
  if (this.image) {
378
336
  return this.image;
379
337
  }
380
- const {
381
- type
382
- } = this.options;
338
+ const { type } = this.options;
383
339
  let image;
384
340
  switch (type) {
385
341
  case "Feature":
@@ -402,4 +358,8 @@ export class EarthEngine {
402
358
  this.image = image;
403
359
  return image;
404
360
  }
405
- }
361
+ }
362
+
363
+ export { EarthEngine };
364
+ //# sourceMappingURL=out.js.map
365
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
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,YAAY,QAAQ;AAEpB,MAAM,KAAK;AAEX,OAAO,KAAK;AAEZ,MAAM,gBAAgB,EAAE,OAAO,UAAU,aAAa,EAAE;AACxD,MAAM,qBAAqB;AAEpB,MAAM,YAAY;AAAA,EAYxB,YAAY,EAAE,QAAQ,GAAoC;AAP1D,uBAAc;AAQb,SAAK,UAAU;AACf,SAAK,cAAc;AACnB,SAAK,YAAY;AAAA,EAClB;AAAA,EAEA,aAAa,SACZ,OACA,SACgB;AAChB,UAAM,YAAY;AAElB,aAAS,aACR,UACA,UACC;AACD,cAAQ,EAAE,KAAK,CAAC,EAAE,OAAAA,OAAM,MAAmC;AAC1D,iBAAS;AAAA,UACR,GAAGA;AAAA,UACH,YAAY,aAAa;AAAA,UACzB,OAAO,UAAU;AAAA,QAClB,CA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,IAAI,KAAK;AACtB,YAAQ,MAAM;AAAA,MACb,KAAK;AACJ,aAAK,WAAW,KAAK,mBAAmB;AACxC;AAAA,MACD,KAAK;AACJ,aAAK,WAAW,KAAK,6BAA6B;AAClD;AAAA,MACD,KAAK;AACJ,aAAK,WAAW,KAAK,iBAAiB;AACtC;AAAA,MACD,KAAK;AACJ,aAAK,WAAW,KAAK,2BAA2B;AAChD;AAAA,MACD;AACC,aAAK,WAAW,KAAK,kBAAkB;AAAA,IACzC;AAAA,EACD;AAAA,EAEU,WAAgB;AACzB,QAAI,KAAK,OAAO;AACf,aAAO,KAAK;AAAA,IACb;AACA,UAAM,EAAE,KAAK,IAAI,KAAK;AACtB,QAAI;AACJ,YAAQ,MAAM;AAAA,MACb,KAAK;AACJ,gBAAQ,KAAK,oBAAoB;AACjC;AAAA,MACD,KAAK;AACJ,gBAAQ,KAAK,8BAA8B;AAC3C;AAAA,MACD,KAAK;AACJ,gBAAQ,KAAK,kBAAkB;AAC/B;AAAA,MACD,KAAK;AACJ,gBAAQ,KAAK,4BAA4B;AACzC;AAAA,MACD;AACC,gBAAQ,KAAK,kBAAkB;AAAA,IACjC;AACA,YAAQ,KAAK,UAAU,KAAK;AAC5B,YAAQ,KAAK,UAAU,KAAK;AAC5B,SAAK,QAAQ;AACb,WAAO;AAAA,EACR;AACD","sourcesContent":["import { MapOrgUnit } from \"../../../../../interfaces/index.js\";\nimport {\n\tEarthEngineOptions,\n\tEarthEngineToken,\n\tRefreshToken,\n} from \"../interfaces/index.js\";\nimport {\n\tcombineReducers,\n\tgetFeatureCollectionProperties,\n\tgetHistogramStatistics,\n\tgetInfo,\n\tgetScale,\n\thasClasses,\n} from \"../utils/index.js\";\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 * as EE from \"./api.js\";\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\ttoken?: EarthEngineToken;\n\toptions: EarthEngineOptions;\n\trefresh?: RefreshToken;\n\torgUnits?: MapOrgUnit[];\n\tinitialized = false;\n\tperiod?: string | string[];\n\tinstance: any;\n\tscale?: any;\n\timage: any;\n\taggregationData: any;\n\n\tconstructor({ options }: { options: EarthEngineOptions }) {\n\t\tthis.options = options;\n\t\tthis.initialized = true;\n\t\tthis.getInstance();\n\t}\n\n\tstatic async setToken(\n\t\ttoken: EarthEngineToken,\n\t\trefresh: RefreshToken,\n\t): Promise<void> {\n\t\tconst tokenType = \"Bearer\";\n\n\t\tfunction refreshToken(\n\t\t\tauthArgs: { scope: any },\n\t\t\tcallback: (props: any) => void,\n\t\t) {\n\t\t\trefresh().then(({ token }: { token: EarthEngineToken }) => {\n\t\t\t\tcallback({\n\t\t\t\t\t...token,\n\t\t\t\t\ttoken_type: tokenType ?? \"Bearer\",\n\t\t\t\t\tstate: authArgs?.scope,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tawait new Promise((resolve, reject) => {\n\t\t\tif (ee.data.getAuthToken()) {\n\t\t\t\tee.initialize(null, null, resolve, reject);\n\t\t\t}\n\t\t\tif (token) {\n\t\t\t\tconst { access_token, client_id, expires_in } = token;\n\t\t\t\tee.data.setAuthToken(\n\t\t\t\t\tclient_id,\n\t\t\t\t\ttokenType ?? \"Bearer\",\n\t\t\t\t\taccess_token,\n\t\t\t\t\texpires_in,\n\t\t\t\t\tnull,\n\t\t\t\t\t() => {\n\t\t\t\t\t\tee.initialize(null, null, resolve, reject);\n\t\t\t\t\t},\n\t\t\t\t\tfalse,\n\t\t\t\t);\n\t\t\t\tee.data.setAuthTokenRefresher(refreshToken);\n\t\t\t}\n\t\t\tresolve(\"Token not found\");\n\t\t});\n\t}\n\n\tsetOrgUnits(orgUnits: MapOrgUnit[]): EarthEngine {\n\t\tthis.orgUnits = orgUnits;\n\t\treturn this;\n\t}\n\n\tsetPeriod(period: string) {\n\t\tthis.period = period;\n\t}\n\n\tasync getValue(geoJSON: any, type: string) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst point = this.getGeometryByType(geoJSON);\n\t\t\tconst reducer = this.getReducerByType(type);\n\t\t\tconst image = this.getImage();\n\n\t\t\tconst reducedImage = image.reduceRegion(reducer, point, 1);\n\n\t\t\treducedImage.evaluate((data: unknown, error: any) => {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(data);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tasync getPeriod() {\n\t\tconst { type } = this.options;\n\t\tif (type !== \"ImageCollection\") {\n\t\t\treturn;\n\t\t}\n\n\t\tconst imageCollection = this.instance\n\t\t\t.distinct(\"system:time_start\")\n\t\t\t.sort(\"system:time_start\", false);\n\t\tconst featureCollection = ee\n\t\t\t.FeatureCollection(imageCollection)\n\t\t\t.select([\"system:time_start\", \"system:time_end\"], null, false);\n\n\t\treturn getInfo(featureCollection);\n\t}\n\n\tasync info() {\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.instance.getInfo(resolve);\n\t\t});\n\t}\n\n\tasync getScale() {\n\t\ttry {\n\t\t\tconst { type } = this.options;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"ImageCollection\":\n\t\t\t\t\tthis.scale = await getScale(this.instance.first());\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.scale = await getScale(this.getImage());\n\t\t\t}\n\t\t} catch (e) {}\n\t}\n\n\tasync getFeatureCollectionAggregation() {\n\t\tconst { datasetId } = this.options;\n\t\tconst dataset = ee.FeatureCollection(datasetId);\n\t\tconst collection = this.getFeatureCollection() as any;\n\t\tconst aggFeatures = collection\n\t\t\t?.map((feature: any) => {\n\t\t\t\tfeature = ee.Feature(feature);\n\t\t\t\tconst count = dataset.filterBounds(feature.geometry()).size();\n\n\t\t\t\treturn feature.set(\"count\", count);\n\t\t\t})\n\t\t\t.select([\"count\"], null, false);\n\n\t\treturn getInfo(aggFeatures).then(getFeatureCollectionProperties);\n\t}\n\n\tasync getHistogramAggregations() {\n\t\ttry {\n\t\t\tconst aggregation = head(this.options.aggregations) ?? \"\";\n\t\t\tconst reducer = ee.Reducer.frequencyHistogram();\n\t\t\tconst collection = this.getFeatureCollection();\n\t\t\tconst legend = this.options.legend?.items;\n\t\t\tconst scale = this.scale;\n\t\t\tconst tileScale = this.options.tileScale ?? DEFAULT_TILE_SCALE;\n\t\t\tconst scaleValue = await getInfo(scale);\n\n\t\t\tconst image = this.getImage();\n\t\t\tconst features = Object.values(\n\t\t\t\tawait getInfo(\n\t\t\t\t\timage\n\t\t\t\t\t\t.reduceRegions({\n\t\t\t\t\t\t\tcollection,\n\t\t\t\t\t\t\treducer,\n\t\t\t\t\t\t\tscale,\n\t\t\t\t\t\t\ttileScale,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.select([\"histogram\"], null, false),\n\t\t\t\t).then((data) =>\n\t\t\t\t\tgetHistogramStatistics({\n\t\t\t\t\t\tdata,\n\t\t\t\t\t\tscale: scaleValue,\n\t\t\t\t\t\taggregationType: aggregation,\n\t\t\t\t\t\tlegend,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn features.map((feature: any, index: number) => {\n\t\t\t\treturn {\n\t\t\t\t\torgUnit: this.orgUnits?.[index],\n\t\t\t\t\tdata: feature,\n\t\t\t\t};\n\t\t\t});\n\t\t} catch (e: any) {\n\t\t\tthrow Error(\"Could not get histogram\", {\n\t\t\t\tcause: e,\n\t\t\t});\n\t\t}\n\t}\n\n\tasync getAggregations() {\n\t\tawait this.getScale();\n\t\tconst { type } = this.options;\n\t\tif (type === \"FeatureCollection\") {\n\t\t\tthis.aggregationData = await this.getFeatureCollectionAggregation();\n\t\t\treturn;\n\t\t}\n\t\tconst aggregations = this.options.aggregations;\n\t\tif (!aggregations) return;\n\n\t\tif (hasClasses(head(aggregations) ?? \"\")) {\n\t\t\tthis.aggregationData = await this.getHistogramAggregations();\n\t\t\treturn;\n\t\t}\n\n\t\tconst reducer = combineReducers(ee)(aggregations);\n\t\tconst collection = this.getFeatureCollection();\n\t\tconst image = this.getImage();\n\t\tconst scale = this.scale;\n\t\tconst tileScale = this.options.tileScale ?? DEFAULT_TILE_SCALE;\n\t\tconst aggregatedFeatures = image\n\t\t\t.reduceRegions({\n\t\t\t\tcollection,\n\t\t\t\treducer,\n\t\t\t\tscale,\n\t\t\t\ttileScale,\n\t\t\t})\n\t\t\t.select(aggregations, null, false);\n\n\t\tconst features = Object.values(\n\t\t\tgetFeatureCollectionProperties(await getInfo(aggregatedFeatures)),\n\t\t) as any[];\n\t\tif (!isEmpty(features) && features.length === this.orgUnits?.length) {\n\t\t\t//Mapping features to orgUnits using index.\n\t\t\tthis.aggregationData = features.map(\n\t\t\t\t(feature: any, index: number) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\torgUnit: this.orgUnits?.[index],\n\t\t\t\t\t\tdata: feature,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tgetAggregation(orgUnit: MapOrgUnit) {\n\t\tif (isEmpty(this.aggregationData)) {\n\t\t\treturn;\n\t\t}\n\t\treturn find(\n\t\t\tthis.aggregationData,\n\t\t\t(aggregation) => aggregation.orgUnit.id === orgUnit.id,\n\t\t);\n\t}\n\n\tasync url(): Promise<string> {\n\t\tif (!this.initialized) throw \"You need to call init() first\";\n\t\treturn this.visualize(this.getImage());\n\t}\n\n\tprotected applyPeriod(imageCollection: any) {\n\t\tconst period = this.period;\n\t\tif (period) {\n\t\t\treturn imageCollection.filterDate(period);\n\t\t}\n\t}\n\n\tprotected applyMask(image: any) {\n\t\tif (this.options.mask) {\n\t\t\treturn image.updateMask(image.gt(0));\n\t\t} else {\n\t\t\treturn image;\n\t\t}\n\t}\n\n\tprotected applyBand(imageCollection: any) {\n\t\tif (this.options.selectedBands) {\n\t\t\treturn imageCollection.select(this.options.selectedBands);\n\t\t} else {\n\t\t\treturn imageCollection;\n\t\t}\n\t}\n\n\tprotected getReducerByType(type: string) {\n\t\treturn ee.Reducer[type].call();\n\t}\n\n\tprotected getGeometryByType(geoJSON: any) {\n\t\treturn ee.Geometry(geoJSON?.geometry);\n\t}\n\n\tprotected getFeatureByType(geoJSON: any) {\n\t\tconst featureType = geoJSON.type;\n\t\tconst features = geoJSON.features ?? [];\n\t\tconst geometry = this.getGeometryByType(geoJSON);\n\t\tswitch (featureType) {\n\t\t\tcase \"Feature\":\n\t\t\t\treturn ee.Feature(geometry);\n\t\t\tcase \"FeatureCollection\":\n\t\t\t\treturn ee.FeatureCollection([\n\t\t\t\t\t...features.map((feature: any) =>\n\t\t\t\t\t\tee.Feature(this.getGeometryByType(feature)),\n\t\t\t\t\t),\n\t\t\t\t]);\n\t\t}\n\t}\n\n\tprotected getFeatureCollection(): unknown {\n\t\tif (this.orgUnits) {\n\t\t\treturn ee.FeatureCollection(\n\t\t\t\tthis.orgUnits.map((orgUnit: MapOrgUnit) =>\n\t\t\t\t\tthis.getFeatureByType(orgUnit.geoJSON),\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\tthrow \"You need to set org units first\";\n\t\t}\n\t}\n\n\tprotected getParamsFromLegend() {\n\t\tif (!this.options.legend) return;\n\t\tconst legend = this.options.legend.items;\n\t\tconst keys = legend.map((l) => l.id);\n\t\tconst min = Math.min(...keys);\n\t\tconst max = Math.max(...keys);\n\t\tconst palette = legend.map((l) => l.color).join(\",\");\n\t\treturn { min, max, palette };\n\t}\n\n\tprotected async visualize(image: any): Promise<string> {\n\t\tconst { min, max, palette } = this.getParamsFromLegend() ??\n\t\t\tthis.options.params ?? {\n\t\t\t\tmin: null,\n\t\t\t\tmax: null,\n\t\t\t\tpalette: null,\n\t\t\t};\n\t\treturn (\n\t\t\t(await new Promise((resolve, reject) => {\n\t\t\t\timage.getMap({ min, max, palette }, resolve);\n\t\t\t})) as any\n\t\t)?.urlFormat;\n\t}\n\n\tprotected getImageCollectionInstance() {\n\t\tconst { datasetId } = this.options;\n\t\tlet imageCollection = ee.ImageCollection(datasetId);\n\t\tif (this.period) {\n\t\t\timageCollection = this.applyPeriod(imageCollection);\n\t\t}\n\t\timageCollection = this.applyBand(imageCollection);\n\t\treturn imageCollection;\n\t}\n\n\tprotected getImageFromImageCollection() {\n\t\tconst { mosaic } = this.options;\n\t\tconst imageCollection = this.instance;\n\t\treturn mosaic\n\t\t\t? imageCollection\n\t\t\t\t\t.mosaic()\n\t\t\t\t\t.clipToCollection(this.getFeatureCollection())\n\t\t\t: ee\n\t\t\t\t\t.Image(imageCollection.first())\n\t\t\t\t\t.clipToCollection(this.getFeatureCollection());\n\t}\n\n\tprotected getImageInstance() {\n\t\tconst { datasetId } = this.options;\n\t\treturn ee\n\t\t\t.Image(datasetId)\n\t\t\t.clipToCollection(this.getFeatureCollection());\n\t}\n\n\tprotected getImageFromImage() {\n\t\treturn this.instance;\n\t}\n\n\tprotected getFeatureInstance() {\n\t\tconst { datasetId } = this.options;\n\t\tconst feature = ee.Feature(datasetId);\n\t\tthis.instance = feature;\n\t\treturn feature;\n\t}\n\n\tprotected getImageFromFeature() {\n\t\treturn this.instance;\n\t}\n\n\tprotected getFeatureCollectionInstance() {\n\t\tconst { datasetId } = this.options;\n\t\tlet featureCollection = ee.FeatureCollection(datasetId);\n\t\tif (this.period) {\n\t\t\tfeatureCollection = this.applyPeriod(featureCollection);\n\t\t}\n\t\treturn featureCollection;\n\t}\n\n\tprotected getImageFromFeatureCollection() {\n\t\tlet featureCollection = this.instance;\n\t\treturn featureCollection\n\t\t\t.draw(FEATURE_STYLE)\n\t\t\t.clipToCollection(this.getFeatureCollection());\n\t}\n\n\tprotected getInstance() {\n\t\tconst { type } = this.options;\n\t\tswitch (type) {\n\t\t\tcase \"Feature\":\n\t\t\t\tthis.instance = this.getFeatureInstance();\n\t\t\t\tbreak;\n\t\t\tcase \"FeatureCollection\":\n\t\t\t\tthis.instance = this.getFeatureCollectionInstance();\n\t\t\t\tbreak;\n\t\t\tcase \"Image\":\n\t\t\t\tthis.instance = this.getImageInstance();\n\t\t\t\tbreak;\n\t\t\tcase \"ImageCollection\":\n\t\t\t\tthis.instance = this.getImageCollectionInstance();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.instance = this.getImageFromImage();\n\t\t}\n\t}\n\n\tprotected getImage(): any {\n\t\tif (this.image) {\n\t\t\treturn this.image;\n\t\t}\n\t\tconst { type } = this.options;\n\t\tlet image;\n\t\tswitch (type) {\n\t\t\tcase \"Feature\":\n\t\t\t\timage = this.getImageFromFeature();\n\t\t\t\tbreak;\n\t\t\tcase \"FeatureCollection\":\n\t\t\t\timage = this.getImageFromFeatureCollection();\n\t\t\t\tbreak;\n\t\t\tcase \"Image\":\n\t\t\t\timage = this.getImageFromImage();\n\t\t\t\tbreak;\n\t\t\tcase \"ImageCollection\":\n\t\t\t\timage = this.getImageFromImageCollection();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\timage = this.getImageFromImage();\n\t\t}\n\t\timage = this.applyMask(image);\n\t\timage = this.applyBand(image);\n\t\tthis.image = image;\n\t\treturn image;\n\t}\n}\n"]}
@@ -0,0 +1,93 @@
1
+ const combineReducers = (ee) => (types) => types.reduce(
2
+ (r, t, i) => i === 0 ? r[t]() : r.combine({
3
+ reducer2: ee.Reducer[t](),
4
+ sharedInputs: true
5
+ }),
6
+ ee.Reducer
7
+ );
8
+ const getInfo = (instance) => new Promise(
9
+ (resolve, reject) => instance.evaluate((data, error) => {
10
+ if (error) {
11
+ reject(error);
12
+ } else {
13
+ resolve(data);
14
+ }
15
+ })
16
+ );
17
+ const getFeatureCollectionProperties = (data) => data.features.reduce(
18
+ (obj, f) => ({
19
+ ...obj,
20
+ [f.id]: f.properties
21
+ }),
22
+ {}
23
+ );
24
+ const getScale = async (image) => {
25
+ return image.select(0).projection().nominalScale();
26
+ };
27
+ const getParamsFromLegend = (legend) => {
28
+ const keys = legend.map((l) => l.id);
29
+ const min = Math.min(...keys);
30
+ const max = Math.max(...keys);
31
+ const palette = legend.map((l) => l.color).join(",");
32
+ return { min, max, palette };
33
+ };
34
+ const getClassifiedImage = (eeImage, { legend: legends, params }) => {
35
+ const legend = legends?.items ?? [];
36
+ if (!params) {
37
+ return { eeImage, params: getParamsFromLegend(legend) };
38
+ }
39
+ const min = 0;
40
+ const max = legend.length - 1;
41
+ const { palette } = params;
42
+ let zones;
43
+ for (let i = min, item; i < max; i++) {
44
+ item = legend[i];
45
+ if (!zones) {
46
+ zones = eeImage.gt(item.to);
47
+ } else {
48
+ zones = zones.add(eeImage.gt(item.to));
49
+ }
50
+ }
51
+ return { eeImage: zones, params: { min, max, palette } };
52
+ };
53
+ const squareMetersToHectares = (value) => value / 1e4;
54
+ const squareMetersToAcres = (value) => value / 4046.8564224;
55
+ const classAggregation = ["percentage", "hectares", "acres"];
56
+ const hasClasses = (type) => classAggregation.includes(type);
57
+ const getHistogramStatistics = ({
58
+ data,
59
+ scale,
60
+ aggregationType,
61
+ legend
62
+ }) => data.features.reduce(
63
+ (obj, { id, properties }) => {
64
+ const { histogram } = properties;
65
+ const sum = Object.values(histogram).reduce(
66
+ (a, b) => a + b,
67
+ 0
68
+ );
69
+ obj[id] = legend.reduce((values, { id: id2 }) => {
70
+ const count = histogram[id2] || 0;
71
+ const sqMeters = count * (scale * scale);
72
+ let value;
73
+ switch (aggregationType) {
74
+ case "hectares":
75
+ value = Math.round(squareMetersToHectares(sqMeters));
76
+ break;
77
+ case "acres":
78
+ value = Math.round(squareMetersToAcres(sqMeters));
79
+ break;
80
+ default:
81
+ value = count / sum * 100;
82
+ }
83
+ values[id2] = value;
84
+ return values;
85
+ }, {});
86
+ return obj;
87
+ },
88
+ {}
89
+ );
90
+
91
+ export { combineReducers, getClassifiedImage, getFeatureCollectionProperties, getHistogramStatistics, getInfo, getScale, hasClasses };
92
+ //# sourceMappingURL=out.js.map
93
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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,aACvB,IAAI;AAAA,EAAQ,CAAC,SAAS,WACrB,SAAS,SAAS,CAAC,MAAW,UAAiB;AAC9C,QAAI,OAAO;AACV,aAAO,KAAK;AAAA,IACb,OAAO;AACN,cAAQ,IAAI;AAAA,IACb;AAAA,EACD,CAAC;AACF;AAEM,MAAM,iCAAiC,CAAC,SAC9C,KAAK,SAAS;AAAA,EACb,CAAC,KAAU,OAAY;AAAA,IACtB,GAAG;AAAA,IACH,CAAC,EAAE,EAAE,GAAG,EAAE;AAAA,EACX;AAAA,EACA,CAAC;AACF;AAEM,MAAM,WAAW,OAAO,UAAe;AAC7C,SAAO,MAAM,OAAO,CAAC,EAAE,WAAW,EAAE,aAAa;AAClD;AAEA,MAAM,sBAAsB,CAAC,WAAkB;AAC9C,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;AAC5B;AAEO,MAAM,qB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AAQ,KAAK,MAAM,uBAAuB,QAAQ,CAAC;AACnD;AAAA,QACD,KAAK;AACJ,kBAAQ,KAAK,MAAM,oBAAoB,QAAQ,CAAC;AAChD;AAAA,QACD;AACC,kBAAS,QAAQ,MAAO;AAAA,MAC1B;AAEA,aAAOA,GAAE,IAAI;AAEb,aAAO;AAAA,IACR,GAAG,CAAC,CAAC;AACL,WAAO;AAAA,EACR;AAAA,EACA,CAAC;AACF","sourcesContent":["import { EarthEngineOptions } from \"../interfaces/index.js\";\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\tnew Promise((resolve, reject) =>\n\t\tinstance.evaluate((data: any, error: Error) => {\n\t\t\tif (error) {\n\t\t\t\treject(error);\n\t\t\t} else {\n\t\t\t\tresolve(data);\n\t\t\t}\n\t\t}),\n\t);\n\nexport const getFeatureCollectionProperties = (data: any) =>\n\tdata.features.reduce(\n\t\t(obj: any, f: any) => ({\n\t\t\t...obj,\n\t\t\t[f.id]: f.properties,\n\t\t}),\n\t\t{},\n\t);\n\nexport const getScale = async (image: any) => {\n\treturn image.select(0).projection().nominalScale();\n};\n\nconst getParamsFromLegend = (legend: any[]) => {\n\tconst keys = legend.map((l) => l.id);\n\tconst min = Math.min(...keys);\n\tconst max = Math.max(...keys);\n\tconst palette = legend.map((l) => l.color).join(\",\");\n\n\treturn { min, max, palette };\n};\n\nexport const getClassifiedImage = (\n\teeImage: any,\n\t{ legend: legends, params }: EarthEngineOptions,\n) => {\n\tconst legend = legends?.items ?? [];\n\tif (!params) {\n\t\t// Image has classes (e.g. landcover)\n\t\treturn { eeImage, params: getParamsFromLegend(legend) };\n\t}\n\n\tconst min = 0;\n\tconst max = legend.length - 1;\n\tconst { palette } = params;\n\tlet zones;\n\n\tfor (let i = min, item; i < max; i++) {\n\t\titem = legend[i] as any;\n\n\t\tif (!zones) {\n\t\t\tzones = eeImage.gt(item.to);\n\t\t} else {\n\t\t\tzones = zones.add(eeImage.gt(item.to));\n\t\t}\n\t}\n\n\treturn { 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 = ({\n\tdata,\n\tscale,\n\taggregationType,\n\tlegend,\n}: {\n\tdata: any;\n\tscale: any;\n\taggregationType: string;\n\tlegend: any;\n}) =>\n\tdata.features.reduce(\n\t\t(\n\t\t\tobj: Record<any, any>,\n\t\t\t{ id, properties }: { id: string; properties: any },\n\t\t) => {\n\t\t\tconst { histogram } = properties;\n\t\t\tconst sum: number = Object.values(histogram).reduce(\n\t\t\t\t(a: any, b: any) => a + b,\n\t\t\t\t0,\n\t\t\t) as number;\n\t\t\tobj[id] = legend.reduce((values: any, { id }: { id: string }) => {\n\t\t\t\tconst count = histogram[id] || 0;\n\t\t\t\tconst sqMeters = count * (scale * scale);\n\t\t\t\tlet value;\n\t\t\t\tswitch (aggregationType) {\n\t\t\t\t\tcase \"hectares\":\n\t\t\t\t\t\tvalue = Math.round(squareMetersToHectares(sqMeters));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"acres\":\n\t\t\t\t\t\tvalue = Math.round(squareMetersToAcres(sqMeters));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvalue = (count / sum) * 100; // percentage\n\t\t\t\t}\n\n\t\t\t\tvalues[id] = value;\n\n\t\t\t\treturn values;\n\t\t\t}, {});\n\t\t\treturn obj;\n\t\t},\n\t\t{},\n\t);\n"]}
@@ -0,0 +1,10 @@
1
+ .map-tooltip {
2
+ padding: 4px 6px;
3
+ border-radius: 3px;
4
+ font-size: 13px;
5
+ line-height: 17px;
6
+ z-index: 1000000 !important;
7
+ }
8
+ [data-test=dhi2-uicore-popper] {
9
+ }
10
+ /*# sourceMappingURL=LegendArea.module.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../src/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css"],"sourcesContent":[".map-tooltip {\n padding: 4px 6px;\n border-radius: 3px;\n font-size: 13px;\n line-height: 17px;\n z-index: 1000000 !important;\n}\n\n[data-test=\"dhi2-uicore-popper\"] {\n\n}\n\n"],"mappings":"AAAA,CAAC;AACG,WAAS,IAAI;AACb,iBAAe;AACf,aAAW;AACX,eAAa;AACb,WAAS;AACb;AAEA,CAAC;AAED;","names":[]}
@@ -0,0 +1,17 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { IconLaunch16 } from '@dhis2/ui';
3
+
4
+ function LegendCardHeader({
5
+ title,
6
+ collapsible,
7
+ onCollapse
8
+ }) {
9
+ return /* @__PURE__ */ jsxs("div", { className: "row w-100 space-between align-items-center", children: [
10
+ /* @__PURE__ */ jsx("h4", { style: { margin: 0 }, className: "legend-header", children: title }),
11
+ collapsible && /* @__PURE__ */ jsx("div", { onClick: onCollapse, children: /* @__PURE__ */ jsx(IconLaunch16, {}) })
12
+ ] });
13
+ }
14
+
15
+ export { LegendCardHeader as default };
16
+ //# sourceMappingURL=out.js.map
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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"]}