@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.
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.js +254 -0
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.js.map +1 -0
- package/dist/components/ChartAnalytics/DHIS2Chart.js +36 -0
- package/dist/components/ChartAnalytics/DHIS2Chart.js.map +1 -0
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +52 -0
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -0
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +42 -0
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.js.map +1 -0
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.js +65 -0
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -0
- package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +3 -0
- package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js.map +1 -0
- package/dist/components/ChartAnalytics/hooks/useChart.js +43 -0
- package/dist/components/ChartAnalytics/hooks/useChart.js.map +1 -0
- package/dist/components/ChartAnalytics/index.js +3 -0
- package/dist/components/ChartAnalytics/index.js.map +1 -0
- package/dist/components/ChartAnalytics/models/bar.js +21 -0
- package/dist/components/ChartAnalytics/models/bar.js.map +1 -0
- package/{build/es → dist}/components/ChartAnalytics/models/column.js +12 -9
- package/dist/components/ChartAnalytics/models/column.js.map +1 -0
- package/dist/components/ChartAnalytics/models/index.js +114 -0
- package/dist/components/ChartAnalytics/models/index.js.map +1 -0
- package/{build/es → dist}/components/ChartAnalytics/models/line.js +10 -7
- package/dist/components/ChartAnalytics/models/line.js.map +1 -0
- package/dist/components/ChartAnalytics/models/multi-series.js +112 -0
- package/dist/components/ChartAnalytics/models/multi-series.js.map +1 -0
- package/dist/components/ChartAnalytics/models/pie.js +53 -0
- package/dist/components/ChartAnalytics/models/pie.js.map +1 -0
- package/dist/components/ChartAnalytics/services/export.js +35 -0
- package/dist/components/ChartAnalytics/services/export.js.map +1 -0
- package/dist/components/ChartAnalytics/styles/custom-highchart.css +40 -0
- package/dist/components/ChartAnalytics/styles/custom-highchart.css.map +1 -0
- package/dist/components/ChartAnalytics/types/props.js +3 -0
- package/dist/components/ChartAnalytics/types/props.js.map +1 -0
- package/dist/components/ChartAnalytics/utils/chart.js +130 -0
- package/dist/components/ChartAnalytics/utils/chart.js.map +1 -0
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js +66 -0
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -0
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +42 -0
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.js.map +1 -0
- package/dist/components/CircularProgressDashboard/index.js +4 -0
- package/dist/components/CircularProgressDashboard/index.js.map +1 -0
- package/dist/components/CircularProgressDashboard/types/props.js +3 -0
- package/dist/components/CircularProgressDashboard/types/props.js.map +1 -0
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js +26 -0
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -0
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.js +30 -0
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.js.map +1 -0
- package/dist/components/DHIS2PivotTable/components/Table/index.js +10 -0
- package/dist/components/DHIS2PivotTable/components/Table/index.js.map +1 -0
- package/dist/components/DHIS2PivotTable/components/TableBody/TableBody.module.css +11 -0
- package/dist/components/DHIS2PivotTable/components/TableBody/TableBody.module.css.map +1 -0
- package/dist/components/DHIS2PivotTable/components/TableBody/index.js +106 -0
- package/dist/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -0
- package/dist/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css +10 -0
- package/dist/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css.map +1 -0
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js +94 -0
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -0
- package/dist/components/DHIS2PivotTable/index.js +4 -0
- package/dist/components/DHIS2PivotTable/index.js.map +1 -0
- package/dist/components/DHIS2PivotTable/interfaces/index.js +3 -0
- package/dist/components/DHIS2PivotTable/interfaces/index.js.map +1 -0
- package/dist/components/DHIS2PivotTable/services/engine.js +87 -0
- package/dist/components/DHIS2PivotTable/services/engine.js.map +1 -0
- package/dist/components/DHIS2PivotTable/state/engine.js +17 -0
- package/dist/components/DHIS2PivotTable/state/engine.js.map +1 -0
- package/dist/components/Map/DHIS2Map.js +65 -0
- package/dist/components/Map/DHIS2Map.js.map +1 -0
- package/dist/components/Map/DHIS2Map.stories.js +366 -0
- package/dist/components/Map/DHIS2Map.stories.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js +41 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +34 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js +26 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +21 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js +67 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js +134 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js +44 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js +67 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js +24 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js +67 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +45 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js +4 -0
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -0
- package/dist/components/Map/components/MapArea/index.js +100 -0
- package/dist/components/Map/components/MapArea/index.js.map +1 -0
- package/dist/components/Map/components/MapArea/interfaces/index.js +3 -0
- package/dist/components/Map/components/MapArea/interfaces/index.js.map +1 -0
- package/dist/components/Map/components/MapControls/components/CustomControl/index.js +16 -0
- package/dist/components/Map/components/MapControls/components/CustomControl/index.js.map +1 -0
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.js +15 -0
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.js.map +1 -0
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.js +13 -0
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.js.map +1 -0
- package/dist/components/Map/components/MapControls/index.js +35 -0
- package/dist/components/Map/components/MapControls/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +10 -0
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js +52 -0
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +100 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +457 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +32 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +197 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +3 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31466 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
- package/{build/es → dist}/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +106 -146
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +93 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +10 -0
- package/dist/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css.map +1 -0
- package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +17 -0
- package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.js +179 -0
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +92 -0
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +11 -0
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.js +48 -0
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +64 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +130 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +41 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +50 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +56 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +40 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +40 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +12 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js +55 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +56 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css.map +1 -0
- package/dist/components/Map/components/MapLayer/index.js +32 -0
- package/dist/components/Map/components/MapLayer/index.js.map +1 -0
- package/dist/components/Map/components/MapLayer/interfaces/index.js +10 -0
- package/dist/components/Map/components/MapLayer/interfaces/index.js.map +1 -0
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +405 -0
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -0
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js +115 -0
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -0
- package/dist/components/Map/components/MapProvider/hooks/index.js +16 -0
- package/dist/components/Map/components/MapProvider/hooks/index.js.map +1 -0
- package/dist/components/Map/components/MapProvider/index.js +95 -0
- package/dist/components/Map/components/MapProvider/index.js.map +1 -0
- package/dist/components/Map/components/MapUpdater/index.js +11 -0
- package/dist/components/Map/components/MapUpdater/index.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js +41 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +24 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js +174 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +21 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +36 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -0
- package/{build/es/components/Map → dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect}/constants/colors.js +18 -3
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +71 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +15 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +12 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +82 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +57 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +44 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +60 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js +54 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.js +63 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/index.js +5 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/types/index.js +3 -0
- package/dist/components/Map/components/ThematicLayerConfiguration/types/index.js.map +1 -0
- package/{build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect → dist/components/Map}/constants/colors.js +19 -3
- package/dist/components/Map/constants/colors.js.map +1 -0
- package/dist/components/Map/constants/legendSet.js +23 -0
- package/dist/components/Map/constants/legendSet.js.map +1 -0
- package/dist/components/Map/hooks/map.js +44 -0
- package/dist/components/Map/hooks/map.js.map +1 -0
- package/dist/components/Map/index.js +7 -0
- package/dist/components/Map/index.js.map +1 -0
- package/dist/components/Map/interfaces/index.js +3 -0
- package/dist/components/Map/interfaces/index.js.map +1 -0
- package/dist/components/Map/state/index.js +18 -0
- package/dist/components/Map/state/index.js.map +1 -0
- package/dist/components/Map/utils/colors.js +85 -0
- package/dist/components/Map/utils/colors.js.map +1 -0
- package/dist/components/Map/utils/helpers.js +18 -0
- package/dist/components/Map/utils/helpers.js.map +1 -0
- package/dist/components/Map/utils/map.js +138 -0
- package/dist/components/Map/utils/map.js.map +1 -0
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.js +145 -0
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.js.map +1 -0
- package/dist/components/SingleValueContainer/SingleValueVisualizer.js +44 -0
- package/dist/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -0
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +49 -0
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -0
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +22 -0
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js.map +1 -0
- package/dist/components/SingleValueContainer/index.js +5 -0
- package/dist/components/SingleValueContainer/index.js.map +1 -0
- package/dist/components/SingleValueContainer/styles/SingleValueContainer.module.css +32 -0
- package/dist/components/SingleValueContainer/styles/SingleValueContainer.module.css.map +1 -0
- package/dist/components/SingleValueContainer/types/props.js +3 -0
- package/dist/components/SingleValueContainer/types/props.js.map +1 -0
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.js +94 -0
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -0
- package/dist/components/Visualization/components/DimensionsProvider/index.js +35 -0
- package/dist/components/Visualization/components/DimensionsProvider/index.js.map +1 -0
- package/dist/components/Visualization/components/LayoutProvider/index.js +18 -0
- package/dist/components/Visualization/components/LayoutProvider/index.js.map +1 -0
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js +85 -0
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -0
- package/dist/components/Visualization/components/VisualizationProvider/index.js +19 -0
- package/dist/components/Visualization/components/VisualizationProvider/index.js.map +1 -0
- package/dist/components/Visualization/components/VisualizationSelector/index.js +167 -0
- package/dist/components/Visualization/components/VisualizationSelector/index.js.map +1 -0
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.js +27 -0
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -0
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.js +55 -0
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -0
- package/dist/components/Visualization/index.js +113 -0
- package/dist/components/Visualization/index.js.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts +26 -0
- package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +3 -3
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts +1 -0
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts +3 -2
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts +1 -0
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/hooks/useChart.d.ts +3 -2
- package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts.map +1 -0
- package/dist/types/components/ChartAnalytics/index.d.ts +2 -0
- package/dist/types/components/ChartAnalytics/index.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/models/bar.d.ts +2 -1
- package/dist/types/components/ChartAnalytics/models/bar.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/models/column.d.ts +2 -1
- package/dist/types/components/ChartAnalytics/models/column.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/models/index.d.ts +2 -1
- package/dist/types/components/ChartAnalytics/models/index.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/models/line.d.ts +2 -1
- package/dist/types/components/ChartAnalytics/models/line.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/models/multi-series.d.ts +2 -1
- package/dist/types/components/ChartAnalytics/models/multi-series.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/models/pie.d.ts +2 -1
- package/dist/types/components/ChartAnalytics/models/pie.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/services/export.d.ts +1 -0
- package/dist/types/components/ChartAnalytics/services/export.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/types/props.d.ts +1 -0
- package/dist/types/components/ChartAnalytics/types/props.d.ts.map +1 -0
- package/{build → dist}/types/components/ChartAnalytics/utils/chart.d.ts +3 -2
- package/dist/types/components/ChartAnalytics/utils/chart.d.ts.map +1 -0
- package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts +6 -0
- package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts.map +1 -0
- package/dist/types/components/CircularProgressDashboard/index.d.ts +3 -0
- package/dist/types/components/CircularProgressDashboard/index.d.ts.map +1 -0
- package/{build → dist}/types/components/CircularProgressDashboard/types/props.d.ts +1 -0
- package/dist/types/components/CircularProgressDashboard/types/props.d.ts.map +1 -0
- package/{build/types/components/CustomPivotTable/index.d.ts → dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts} +8 -12
- package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts.map +1 -0
- package/dist/types/components/DHIS2PivotTable/components/Table/index.d.ts +9 -0
- package/dist/types/components/DHIS2PivotTable/components/Table/index.d.ts.map +1 -0
- package/dist/types/components/DHIS2PivotTable/components/TableBody/index.d.ts +2 -0
- package/dist/types/components/DHIS2PivotTable/components/TableBody/index.d.ts.map +1 -0
- package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts +2 -0
- package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts.map +1 -0
- package/dist/types/components/DHIS2PivotTable/index.d.ts +3 -0
- package/dist/types/components/DHIS2PivotTable/index.d.ts.map +1 -0
- package/{build/types/components/CustomPivotTable → dist/types/components/DHIS2PivotTable}/interfaces/index.d.ts +1 -0
- package/dist/types/components/DHIS2PivotTable/interfaces/index.d.ts.map +1 -0
- package/{build/types/components/CustomPivotTable → dist/types/components/DHIS2PivotTable}/services/engine.d.ts +4 -3
- package/dist/types/components/DHIS2PivotTable/services/engine.d.ts.map +1 -0
- package/dist/types/components/DHIS2PivotTable/state/engine.d.ts +8 -0
- package/dist/types/components/DHIS2PivotTable/state/engine.d.ts.map +1 -0
- package/dist/types/components/Map/DHIS2Map.d.ts +9 -0
- package/dist/types/components/Map/DHIS2Map.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts +10 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.d.ts +9 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts +2 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts +2 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts +2 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts +2 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts +2 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts +4 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts +8 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts.map +1 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +3 -0
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapArea/index.d.ts +2 -1
- package/dist/types/components/Map/components/MapArea/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapArea/interfaces/index.d.ts +1 -0
- package/dist/types/components/Map/components/MapArea/interfaces/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapControls/components/CustomControl/index.d.ts +2 -1
- package/dist/types/components/Map/components/MapControls/components/CustomControl/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapControls/components/DownloadControl/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapControls/components/DownloadControl/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapControls/components/FullscreenControl/index.d.ts +1 -0
- package/dist/types/components/Map/components/MapControls/components/FullscreenControl/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapControls/index.d.ts +6 -0
- package/dist/types/components/Map/components/MapControls/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +2 -0
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +6 -6
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +4 -3
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +2 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +3 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +4 -0
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +2 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +3 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +3 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts +3 -3
- package/dist/types/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts +4 -4
- package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts +1 -0
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +3 -0
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +2 -0
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +3 -2
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +2 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +3 -3
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +4 -3
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +12 -0
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +5 -0
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +3 -0
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +5 -0
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/index.d.ts +3 -3
- package/dist/types/components/Map/components/MapLayer/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapLayer/interfaces/index.d.ts +5 -4
- package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts +1 -0
- package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +7 -0
- package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapProvider/hooks/index.d.ts +4 -3
- package/dist/types/components/Map/components/MapProvider/hooks/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/MapProvider/index.d.ts +3 -0
- package/dist/types/components/Map/components/MapProvider/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/MapUpdater/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapUpdater/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.d.ts +3 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.d.ts.map +1 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts +3 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts.map +1 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +8 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts +1 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +2 -2
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +2 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts.map +1 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +2 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts +2 -2
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts +2 -2
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/RadiusField.d.ts +2 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/RadiusField.d.ts.map +1 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/TypeField.d.ts +2 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/TypeField.d.ts.map +1 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +4 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts.map +1 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/types/index.d.ts +15 -0
- package/dist/types/components/Map/components/ThematicLayerConfiguration/types/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/constants/colors.d.ts +1 -0
- package/dist/types/components/Map/constants/colors.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/constants/legendSet.d.ts +1 -0
- package/dist/types/components/Map/constants/legendSet.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/hooks/map.d.ts +1 -0
- package/dist/types/components/Map/hooks/map.d.ts.map +1 -0
- package/dist/types/components/Map/index.d.ts +6 -0
- package/dist/types/components/Map/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/interfaces/index.d.ts +3 -2
- package/dist/types/components/Map/interfaces/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/state/index.d.ts +3 -2
- package/dist/types/components/Map/state/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/utils/colors.d.ts +2 -1
- package/dist/types/components/Map/utils/colors.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/utils/helpers.d.ts +1 -0
- package/dist/types/components/Map/utils/helpers.d.ts.map +1 -0
- package/{build → dist}/types/components/Map/utils/map.d.ts +1 -0
- package/dist/types/components/Map/utils/map.d.ts.map +1 -0
- package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts +11 -0
- package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts.map +1 -0
- package/{build → dist}/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +2 -1
- package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts.map +1 -0
- package/{build → dist}/types/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts +2 -1
- package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts.map +1 -0
- package/dist/types/components/SingleValueContainer/index.d.ts +4 -0
- package/dist/types/components/SingleValueContainer/index.d.ts.map +1 -0
- package/{build → dist}/types/components/SingleValueContainer/types/props.d.ts +3 -1
- package/dist/types/components/SingleValueContainer/types/props.d.ts.map +1 -0
- package/{build → dist}/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts +2 -1
- package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Visualization/components/DimensionsProvider/index.d.ts +2 -1
- package/dist/types/components/Visualization/components/DimensionsProvider/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Visualization/components/LayoutProvider/index.d.ts +3 -2
- package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts +3 -3
- package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Visualization/components/VisualizationProvider/index.d.ts +5 -4
- package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts.map +1 -0
- package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts +23 -0
- package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts +3 -2
- package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts.map +1 -0
- package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts +2 -0
- package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts.map +1 -0
- package/{build → dist}/types/components/Visualization/index.d.ts +8 -8
- package/dist/types/components/Visualization/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +59 -63
- package/README.md +0 -45
- package/build/cjs/components/ChartAnalytics/ChartAnalytics.test.js +0 -51
- package/build/cjs/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +0 -48
- package/build/cjs/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +0 -34
- package/build/cjs/components/ChartAnalytics/components/DownloadMenu/index.js +0 -65
- package/build/cjs/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +0 -1
- package/build/cjs/components/ChartAnalytics/hooks/useChart.js +0 -38
- package/build/cjs/components/ChartAnalytics/index.js +0 -86
- package/build/cjs/components/ChartAnalytics/models/bar.js +0 -24
- package/build/cjs/components/ChartAnalytics/models/column.js +0 -53
- package/build/cjs/components/ChartAnalytics/models/index.js +0 -112
- package/build/cjs/components/ChartAnalytics/models/line.js +0 -35
- package/build/cjs/components/ChartAnalytics/models/multi-series.js +0 -111
- package/build/cjs/components/ChartAnalytics/models/pie.js +0 -53
- package/build/cjs/components/ChartAnalytics/services/export.js +0 -50
- package/build/cjs/components/ChartAnalytics/styles/custom-highchart.css +0 -48
- package/build/cjs/components/ChartAnalytics/types/props.js +0 -1
- package/build/cjs/components/ChartAnalytics/utils/chart.js +0 -138
- package/build/cjs/components/CircularProgressDashboard/CircularProgressIndicator.test.js +0 -13
- package/build/cjs/components/CircularProgressDashboard/index.js +0 -64
- package/build/cjs/components/CircularProgressDashboard/types/props.js +0 -1
- package/build/cjs/components/CustomPivotTable/components/Table/index.js +0 -16
- package/build/cjs/components/CustomPivotTable/components/TableBody/TableBody.module.css +0 -12
- package/build/cjs/components/CustomPivotTable/components/TableBody/index.js +0 -109
- package/build/cjs/components/CustomPivotTable/components/TableHeaders/TableHeaders.module.css +0 -10
- package/build/cjs/components/CustomPivotTable/components/TableHeaders/index.js +0 -89
- package/build/cjs/components/CustomPivotTable/index.js +0 -30
- package/build/cjs/components/CustomPivotTable/interfaces/index.js +0 -1
- package/build/cjs/components/CustomPivotTable/services/engine.js +0 -89
- package/build/cjs/components/CustomPivotTable/state/engine.js +0 -23
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +0 -32
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +0 -40
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/index.js +0 -458
- package/build/cjs/components/Map/components/MapArea/index.js +0 -101
- package/build/cjs/components/Map/components/MapArea/interfaces/index.js +0 -1
- package/build/cjs/components/Map/components/MapControls/components/CustomControl/index.js +0 -32
- package/build/cjs/components/Map/components/MapControls/components/DownloadControl/index.js +0 -25
- package/build/cjs/components/Map/components/MapControls/components/FullscreenControl/index.js +0 -13
- package/build/cjs/components/Map/components/MapControls/index.js +0 -42
- package/build/cjs/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +0 -13
- package/build/cjs/components/Map/components/MapLayer/components/BoundaryLayer/index.js +0 -51
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +0 -104
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +0 -379
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +0 -36
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +0 -200
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +0 -1
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +0 -15
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +0 -403
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +0 -124
- package/build/cjs/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +0 -12
- package/build/cjs/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +0 -26
- package/build/cjs/components/Map/components/MapLayer/components/LegendArea/index.js +0 -180
- package/build/cjs/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +0 -86
- package/build/cjs/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +0 -14
- package/build/cjs/components/Map/components/MapLayer/components/PointLayer/index.js +0 -46
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +0 -57
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +0 -145
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +0 -43
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +0 -56
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +0 -61
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +0 -43
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +0 -35
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +0 -15
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/index.js +0 -57
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +0 -62
- package/build/cjs/components/Map/components/MapLayer/index.js +0 -40
- package/build/cjs/components/Map/components/MapLayer/interfaces/index.js +0 -8
- package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +0 -399
- package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/index.js +0 -116
- package/build/cjs/components/Map/components/MapProvider/hooks/index.js +0 -19
- package/build/cjs/components/Map/components/MapProvider/index.js +0 -121
- package/build/cjs/components/Map/components/MapUpdater/index.js +0 -24
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +0 -32
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +0 -40
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +0 -40
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js +0 -428
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +0 -63
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +0 -15
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +0 -12
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +0 -72
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +0 -71
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +0 -47
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +0 -79
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/index.js +0 -265
- package/build/cjs/components/Map/constants/colors.js +0 -429
- package/build/cjs/components/Map/constants/legendSet.js +0 -22
- package/build/cjs/components/Map/hooks/map.js +0 -52
- package/build/cjs/components/Map/index.js +0 -108
- package/build/cjs/components/Map/interfaces/index.js +0 -1
- package/build/cjs/components/Map/state/index.js +0 -23
- package/build/cjs/components/Map/utils/colors.js +0 -78
- package/build/cjs/components/Map/utils/helpers.js +0 -25
- package/build/cjs/components/Map/utils/map.js +0 -161
- package/build/cjs/components/SingleValueContainer/SingleValueContainer.test.js +0 -23
- package/build/cjs/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +0 -54
- package/build/cjs/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +0 -24
- package/build/cjs/components/SingleValueContainer/index.js +0 -59
- package/build/cjs/components/SingleValueContainer/styles/SingleValueContainer.module.css +0 -39
- package/build/cjs/components/SingleValueContainer/types/props.js +0 -1
- package/build/cjs/components/Visualization/components/AnalyticsDataProvider/index.js +0 -102
- package/build/cjs/components/Visualization/components/DimensionsProvider/index.js +0 -56
- package/build/cjs/components/Visualization/components/LayoutProvider/index.js +0 -31
- package/build/cjs/components/Visualization/components/VisualizationDimensionSelector/index.js +0 -77
- package/build/cjs/components/Visualization/components/VisualizationProvider/index.js +0 -29
- package/build/cjs/components/Visualization/components/VisualizationSelector/index.js +0 -180
- package/build/cjs/components/Visualization/components/VisualizationTypeProvider/index.js +0 -40
- package/build/cjs/components/Visualization/components/VisualizationTypeSelector/index.js +0 -54
- package/build/cjs/components/Visualization/index.js +0 -96
- package/build/cjs/index.js +0 -71
- package/build/cjs/locales/en/translations.json +0 -138
- package/build/cjs/locales/index.js +0 -22
- package/build/es/components/ChartAnalytics/ChartAnalytics.test.js +0 -46
- package/build/es/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +0 -41
- package/build/es/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +0 -26
- package/build/es/components/ChartAnalytics/components/DownloadMenu/index.js +0 -57
- package/build/es/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +0 -1
- package/build/es/components/ChartAnalytics/hooks/useChart.js +0 -32
- package/build/es/components/ChartAnalytics/index.js +0 -40
- package/build/es/components/ChartAnalytics/models/bar.js +0 -16
- package/build/es/components/ChartAnalytics/models/index.js +0 -105
- package/build/es/components/ChartAnalytics/models/multi-series.js +0 -104
- package/build/es/components/ChartAnalytics/models/pie.js +0 -46
- package/build/es/components/ChartAnalytics/services/export.js +0 -36
- package/build/es/components/ChartAnalytics/styles/custom-highchart.css +0 -48
- package/build/es/components/ChartAnalytics/types/props.js +0 -1
- package/build/es/components/ChartAnalytics/utils/chart.js +0 -127
- package/build/es/components/CircularProgressDashboard/CircularProgressIndicator.test.js +0 -10
- package/build/es/components/CircularProgressDashboard/index.js +0 -42
- package/build/es/components/CircularProgressDashboard/types/props.js +0 -1
- package/build/es/components/CustomPivotTable/components/Table/index.js +0 -9
- package/build/es/components/CustomPivotTable/components/TableBody/TableBody.module.css +0 -12
- package/build/es/components/CustomPivotTable/components/TableBody/index.js +0 -100
- package/build/es/components/CustomPivotTable/components/TableHeaders/TableHeaders.module.css +0 -10
- package/build/es/components/CustomPivotTable/components/TableHeaders/index.js +0 -82
- package/build/es/components/CustomPivotTable/index.js +0 -22
- package/build/es/components/CustomPivotTable/interfaces/index.js +0 -1
- package/build/es/components/CustomPivotTable/services/engine.js +0 -82
- package/build/es/components/CustomPivotTable/state/engine.js +0 -14
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +0 -23
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +0 -31
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/index.js +0 -448
- package/build/es/components/Map/components/MapArea/index.js +0 -91
- package/build/es/components/Map/components/MapArea/interfaces/index.js +0 -1
- package/build/es/components/Map/components/MapControls/components/CustomControl/index.js +0 -25
- package/build/es/components/Map/components/MapControls/components/DownloadControl/index.js +0 -18
- package/build/es/components/Map/components/MapControls/components/FullscreenControl/index.js +0 -6
- package/build/es/components/Map/components/MapControls/index.js +0 -35
- package/build/es/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +0 -7
- package/build/es/components/Map/components/MapLayer/components/BoundaryLayer/index.js +0 -41
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +0 -93
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +0 -369
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +0 -29
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +0 -191
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +0 -1
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +0 -15
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +0 -111
- package/build/es/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +0 -12
- package/build/es/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +0 -19
- package/build/es/components/Map/components/MapLayer/components/LegendArea/index.js +0 -171
- package/build/es/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +0 -76
- package/build/es/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +0 -8
- package/build/es/components/Map/components/MapLayer/components/PointLayer/index.js +0 -39
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +0 -49
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +0 -133
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +0 -33
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +0 -47
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +0 -50
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +0 -36
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +0 -28
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +0 -9
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/index.js +0 -50
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +0 -62
- package/build/es/components/Map/components/MapLayer/index.js +0 -33
- package/build/es/components/Map/components/MapLayer/interfaces/index.js +0 -1
- package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +0 -391
- package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/index.js +0 -107
- package/build/es/components/Map/components/MapProvider/hooks/index.js +0 -11
- package/build/es/components/Map/components/MapProvider/index.js +0 -112
- package/build/es/components/Map/components/MapUpdater/index.js +0 -17
- package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +0 -23
- package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +0 -31
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +0 -33
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +0 -53
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +0 -15
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +0 -12
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +0 -56
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +0 -64
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +0 -38
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +0 -70
- package/build/es/components/Map/components/ThematicLayerConfiguration/index.js +0 -254
- package/build/es/components/Map/constants/legendSet.js +0 -15
- package/build/es/components/Map/hooks/map.js +0 -44
- package/build/es/components/Map/index.js +0 -51
- package/build/es/components/Map/interfaces/index.js +0 -1
- package/build/es/components/Map/state/index.js +0 -14
- package/build/es/components/Map/utils/colors.js +0 -61
- package/build/es/components/Map/utils/helpers.js +0 -14
- package/build/es/components/Map/utils/map.js +0 -147
- package/build/es/components/SingleValueContainer/SingleValueContainer.test.js +0 -20
- package/build/es/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +0 -47
- package/build/es/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +0 -17
- package/build/es/components/SingleValueContainer/index.js +0 -30
- package/build/es/components/SingleValueContainer/styles/SingleValueContainer.module.css +0 -39
- package/build/es/components/SingleValueContainer/types/props.js +0 -1
- package/build/es/components/Visualization/components/AnalyticsDataProvider/index.js +0 -93
- package/build/es/components/Visualization/components/DimensionsProvider/index.js +0 -44
- package/build/es/components/Visualization/components/LayoutProvider/index.js +0 -20
- package/build/es/components/Visualization/components/VisualizationDimensionSelector/index.js +0 -68
- package/build/es/components/Visualization/components/VisualizationProvider/index.js +0 -22
- package/build/es/components/Visualization/components/VisualizationSelector/index.js +0 -166
- package/build/es/components/Visualization/components/VisualizationTypeProvider/index.js +0 -25
- package/build/es/components/Visualization/components/VisualizationTypeSelector/index.js +0 -45
- package/build/es/components/Visualization/index.js +0 -89
- package/build/es/index.js +0 -7
- package/build/es/locales/en/translations.json +0 -138
- package/build/es/locales/index.js +0 -13
- package/build/types/components/ChartAnalytics/index.d.ts +0 -7
- package/build/types/components/CircularProgressDashboard/index.d.ts +0 -4
- package/build/types/components/CustomPivotTable/components/Table/index.d.ts +0 -12
- package/build/types/components/CustomPivotTable/components/TableBody/index.d.ts +0 -2
- package/build/types/components/CustomPivotTable/components/TableHeaders/index.d.ts +0 -2
- package/build/types/components/CustomPivotTable/state/engine.d.ts +0 -7
- package/build/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +0 -17
- package/build/types/components/Map/components/MapControls/index.d.ts +0 -6
- package/build/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +0 -1
- package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +0 -4
- package/build/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +0 -2
- package/build/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +0 -2
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +0 -12
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +0 -5
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +0 -2
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +0 -5
- package/build/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +0 -6
- package/build/types/components/Map/components/MapProvider/index.d.ts +0 -3
- package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +0 -8
- package/build/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +0 -2
- package/build/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +0 -18
- package/build/types/components/Map/index.d.ts +0 -8
- package/build/types/components/SingleValueContainer/index.d.ts +0 -6
- package/build/types/components/Visualization/components/VisualizationSelector/index.d.ts +0 -23
- package/build/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts +0 -2
- package/build/types/index.d.ts +0 -6
- /package/{LICENSE → LICENCE} +0 -0
|
@@ -1,43 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
27
|
-
constructor(
|
|
28
|
-
|
|
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(
|
|
49
|
-
let {
|
|
50
|
-
token
|
|
51
|
-
} = _ref2;
|
|
19
|
+
refresh().then(({ token: token2 }) => {
|
|
52
20
|
callback({
|
|
53
|
-
...
|
|
54
|
-
token_type: tokenType
|
|
55
|
-
state: authArgs
|
|
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
|
-
|
|
32
|
+
const { access_token, client_id, expires_in } = token;
|
|
33
|
+
ee.data.setAuthToken(
|
|
66
34
|
client_id,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
|
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
|
-
|
|
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 =
|
|
114
|
+
const legend = this.options.legend?.items;
|
|
149
115
|
const scale = this.scale;
|
|
150
|
-
const tileScale =
|
|
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(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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:
|
|
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)
|
|
189
|
-
|
|
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 =
|
|
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(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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(
|
|
191
|
+
return find(
|
|
192
|
+
this.aggregationData,
|
|
193
|
+
(aggregation) => aggregation.orgUnit.id === orgUnit.id
|
|
194
|
+
);
|
|
221
195
|
}
|
|
222
196
|
async url() {
|
|
223
|
-
if (!this.initialized)
|
|
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
|
|
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 =
|
|
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([
|
|
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(
|
|
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)
|
|
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
|
-
|
|
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 (
|
|
296
|
-
image.getMap({
|
|
297
|
-
|
|
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
|
package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map
ADDED
|
@@ -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,CAAC;AAAA,MACF,CAAC;AAAA,IACF;AAEA,UAAM,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAI,GAAG,KAAK,aAAa,GAAG;AAC3B,WAAG,WAAW,MAAM,MAAM,SAAS,MAAM;AAAA,MAC1C;AACA,UAAI,OAAO;AACV,cAAM,EAAE,cAAc,WAAW,WAAW,IAAI;AAChD,WAAG,KAAK;AAAA,UACP;AAAA,UACA,a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ACC,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
|
package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map
ADDED
|
@@ -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,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I;AAEnE,MAAM,yBAAyB,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAMC,KAAK,SAAS;AAAA,EACb,CACC,KACA,EAAE,IAAI,WAAW,MACb;AACJ,UAAM,EAAE,UAAU,IAAI;AACtB,UAAM,MAAc,OAAO,OAAO,SAAS,EAAE;AAAA,MAC5C,CAAC,GAAQ,MAAW,IAAI;AAAA,MACxB;AAAA,IACD;AACA,QAAI,EAAE,IAAI,OAAO,OAAO,CAAC,QAAa,EAAE,IAAAA,IAAG,MAAsB;AAChE,YAAM,QAAQ,UAAUA,GAAE,KAAK;AAC/B,YAAM,WAAW,SAAS,QAAQ;AAClC,UAAI;AACJ,cAAQ,iBAAiB;AAAA,QACxB,KAAK;AACJ,kBAAQ,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"]}
|
package/dist/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css.map
ADDED
|
@@ -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"]}
|