@hisptz/dhis2-analytics 2.0.0-alpha.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChartAnalytics/DHIS2Chart.js +11 -11
- package/dist/components/ChartAnalytics/DHIS2Chart.js.map +1 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +2 -2
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.js +10 -10
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -1
- package/dist/components/ChartAnalytics/hooks/useChart.js +7 -7
- package/dist/components/ChartAnalytics/hooks/useChart.js.map +1 -1
- package/dist/components/ChartAnalytics/index.js +3 -3
- package/dist/components/ChartAnalytics/index.js.map +1 -1
- package/dist/components/ChartAnalytics/models/bar.js +2 -2
- package/dist/components/ChartAnalytics/models/bar.js.map +1 -1
- package/dist/components/ChartAnalytics/models/column.js +5 -5
- package/dist/components/ChartAnalytics/models/column.js.map +1 -1
- package/dist/components/ChartAnalytics/models/index.js +0 -3
- package/dist/components/ChartAnalytics/models/index.js.map +1 -1
- package/dist/components/ChartAnalytics/models/line.js +5 -5
- package/dist/components/ChartAnalytics/models/line.js.map +1 -1
- package/dist/components/ChartAnalytics/models/multi-series.js +22 -9
- package/dist/components/ChartAnalytics/models/multi-series.js.map +1 -1
- package/dist/components/ChartAnalytics/models/pie.js +5 -3
- package/dist/components/ChartAnalytics/models/pie.js.map +1 -1
- package/dist/components/ChartAnalytics/services/export.js +3 -3
- package/dist/components/ChartAnalytics/services/export.js.map +1 -1
- 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/utils/chart.js +12 -12
- package/dist/components/ChartAnalytics/utils/chart.js.map +1 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js +3 -3
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -1
- package/dist/components/CircularProgressDashboard/index.js +6 -6
- package/dist/components/CircularProgressDashboard/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js +10 -10
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -1
- package/dist/components/DHIS2PivotTable/components/TableBody/index.js +8 -8
- package/dist/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js +5 -5
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/index.js +6 -6
- package/dist/components/DHIS2PivotTable/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/services/engine.js +0 -6
- package/dist/components/DHIS2PivotTable/services/engine.js.map +1 -1
- package/dist/components/DHIS2PivotTable/state/engine.js.map +1 -1
- package/dist/components/Map/DHIS2Map.js +3 -3
- package/dist/components/Map/DHIS2Map.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js +2 -2
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js +10 -10
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js +2 -2
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js +11 -11
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js +2 -2
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js +3 -3
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js +4 -4
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js +3 -3
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +8 -8
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js +6 -6
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -1
- package/dist/components/Map/components/MapArea/index.js +42 -27
- package/dist/components/Map/components/MapArea/index.js.map +1 -1
- package/dist/components/Map/components/MapControls/index.js +16 -4
- package/dist/components/Map/components/MapControls/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +2 -2
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js +5 -5
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +49 -14
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +26 -8
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +2 -2
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +8 -8
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31468 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +56 -34
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +33 -22
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.js +10 -10
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +22 -8
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +2 -2
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.js +5 -5
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +34 -6
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +28 -9
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +2 -2
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +5 -5
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +18 -4
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +9 -6
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +2 -2
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +2 -2
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js +3 -3
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js.map +1 -1
- 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 +5 -5
- package/dist/components/Map/components/MapLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/interfaces/index.js +6 -1
- package/dist/components/Map/components/MapLayer/interfaces/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +24 -24
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js +9 -9
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/hooks/index.js +4 -4
- package/dist/components/Map/components/MapProvider/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/index.js +7 -7
- package/dist/components/Map/components/MapProvider/index.js.map +1 -1
- package/dist/components/Map/components/MapUpdater/index.js +2 -2
- package/dist/components/Map/components/MapUpdater/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js +2 -2
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js +12 -12
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +16 -4
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +6 -6
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +13 -5
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +5 -5
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/index.js +9 -9
- package/dist/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -1
- package/dist/components/Map/hooks/map.js +2 -2
- package/dist/components/Map/hooks/map.js.map +1 -1
- package/dist/components/Map/index.js +15 -15
- package/dist/components/Map/index.js.map +1 -1
- package/dist/components/Map/state/index.js.map +1 -1
- package/dist/components/Map/utils/colors.js +13 -5
- package/dist/components/Map/utils/colors.js.map +1 -1
- package/dist/components/Map/utils/map.js +18 -7
- package/dist/components/Map/utils/map.js.map +1 -1
- package/dist/components/SingleValueContainer/SingleValueVisualizer.js +4 -4
- package/dist/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +1 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -1
- package/dist/components/SingleValueContainer/index.js +13 -6
- package/dist/components/SingleValueContainer/index.js.map +1 -1
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.js +39 -12
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/LayoutProvider/index.js +5 -4
- package/dist/components/Visualization/components/LayoutProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js +6 -6
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationProvider/index.js +12 -6
- package/dist/components/Visualization/components/VisualizationProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationSelector/index.js +17 -17
- package/dist/components/Visualization/components/VisualizationSelector/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.js +5 -1
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.js +25 -9
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -1
- package/dist/components/Visualization/index.js +8 -8
- package/dist/components/Visualization/index.js.map +1 -1
- package/dist/{components/ChartAnalytics/ChartAnalytics.stories.mjs → esm/components/ChartAnalytics/ChartAnalytics.stories.js} +1 -1
- package/dist/esm/components/ChartAnalytics/ChartAnalytics.stories.js.map +1 -0
- package/dist/{components/ChartAnalytics/DHIS2Chart.mjs → esm/components/ChartAnalytics/DHIS2Chart.js} +5 -5
- package/dist/esm/components/ChartAnalytics/DHIS2Chart.js.map +1 -0
- package/dist/{components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs → esm/components/ChartAnalytics/components/DownloadMenu/components/Menu.js} +2 -2
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -0
- package/dist/{components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs → esm/components/ChartAnalytics/components/DownloadMenu/constants/menu.js} +1 -1
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/constants/menu.js.map +1 -0
- package/dist/{components/ChartAnalytics/components/DownloadMenu/index.mjs → esm/components/ChartAnalytics/components/DownloadMenu/index.js} +3 -3
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -0
- package/dist/{components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs → esm/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js} +1 -1
- package/dist/{components/ChartAnalytics/hooks/useChart.mjs → esm/components/ChartAnalytics/hooks/useChart.js} +2 -2
- package/dist/esm/components/ChartAnalytics/hooks/useChart.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/index.js +3 -0
- package/dist/esm/components/ChartAnalytics/index.js.map +1 -0
- package/dist/{components/ChartAnalytics/models/bar.mjs → esm/components/ChartAnalytics/models/bar.js} +2 -2
- package/dist/esm/components/ChartAnalytics/models/bar.js.map +1 -0
- package/dist/{components/ChartAnalytics/models/column.mjs → esm/components/ChartAnalytics/models/column.js} +3 -3
- package/dist/esm/components/ChartAnalytics/models/column.js.map +1 -0
- package/dist/{components/ChartAnalytics/models/index.mjs → esm/components/ChartAnalytics/models/index.js} +1 -4
- package/dist/esm/components/ChartAnalytics/models/index.js.map +1 -0
- package/dist/{components/ChartAnalytics/models/line.mjs → esm/components/ChartAnalytics/models/line.js} +3 -3
- package/dist/esm/components/ChartAnalytics/models/line.js.map +1 -0
- package/dist/{components/ChartAnalytics/models/multi-series.mjs → esm/components/ChartAnalytics/models/multi-series.js} +21 -8
- package/dist/esm/components/ChartAnalytics/models/multi-series.js.map +1 -0
- package/dist/{components/ChartAnalytics/models/pie.mjs → esm/components/ChartAnalytics/models/pie.js} +5 -3
- package/dist/esm/components/ChartAnalytics/models/pie.js.map +1 -0
- package/dist/{components/ChartAnalytics/services/export.mjs → esm/components/ChartAnalytics/services/export.js} +4 -4
- package/dist/esm/components/ChartAnalytics/services/export.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/styles/custom-highchart.css +40 -0
- package/dist/esm/components/ChartAnalytics/styles/custom-highchart.css.map +1 -0
- package/dist/esm/components/ChartAnalytics/types/props.js +3 -0
- package/dist/{components/ChartAnalytics/utils/chart.mjs → esm/components/ChartAnalytics/utils/chart.js} +6 -6
- package/dist/esm/components/ChartAnalytics/utils/chart.js.map +1 -0
- package/dist/{components/CircularProgressDashboard/CircularProgressIndicator.mjs → esm/components/CircularProgressDashboard/CircularProgressIndicator.js} +2 -2
- package/dist/esm/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -0
- package/dist/{components/CircularProgressDashboard/CircularProgressIndicator.stories.mjs → esm/components/CircularProgressDashboard/CircularProgressIndicator.stories.js} +1 -1
- package/dist/esm/components/CircularProgressDashboard/CircularProgressIndicator.stories.js.map +1 -0
- package/dist/esm/components/CircularProgressDashboard/index.js +4 -0
- package/dist/esm/components/CircularProgressDashboard/index.js.map +1 -0
- package/dist/esm/components/CircularProgressDashboard/types/props.js +3 -0
- package/dist/{components/DHIS2PivotTable/DHIS2PivotTable.mjs → esm/components/DHIS2PivotTable/DHIS2PivotTable.js} +6 -6
- package/dist/esm/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -0
- package/dist/{components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs → esm/components/DHIS2PivotTable/DHIS2PivotTable.stories.js} +1 -1
- package/dist/esm/components/DHIS2PivotTable/DHIS2PivotTable.stories.js.map +1 -0
- package/dist/{components/DHIS2PivotTable/components/Table/index.mjs → esm/components/DHIS2PivotTable/components/Table/index.js} +1 -1
- package/dist/esm/components/DHIS2PivotTable/components/Table/index.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableBody/TableBody.module.css +11 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableBody/TableBody.module.css.map +1 -0
- package/dist/{components/DHIS2PivotTable/components/TableBody/index.mjs → esm/components/DHIS2PivotTable/components/TableBody/index.js} +2 -2
- package/dist/esm/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css +10 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css.map +1 -0
- package/dist/{components/DHIS2PivotTable/components/TableHeaders/index.mjs → esm/components/DHIS2PivotTable/components/TableHeaders/index.js} +2 -2
- package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/index.js +4 -0
- package/dist/esm/components/DHIS2PivotTable/index.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/interfaces/index.js +3 -0
- package/dist/{components/DHIS2PivotTable/services/engine.mjs → esm/components/DHIS2PivotTable/services/engine.js} +1 -7
- package/dist/esm/components/DHIS2PivotTable/services/engine.js.map +1 -0
- package/dist/{components/DHIS2PivotTable/state/engine.mjs → esm/components/DHIS2PivotTable/state/engine.js} +1 -1
- package/dist/esm/components/DHIS2PivotTable/state/engine.js.map +1 -0
- package/dist/{components/Map/DHIS2Map.mjs → esm/components/Map/DHIS2Map.js} +3 -3
- package/dist/esm/components/Map/DHIS2Map.js.map +1 -0
- package/dist/{components/Map/DHIS2Map.stories.mjs → esm/components/Map/DHIS2Map.stories.js} +1 -1
- package/dist/esm/components/Map/DHIS2Map.stories.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js} +2 -2
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js} +1 -1
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js} +6 -6
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js} +1 -1
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js} +2 -2
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js} +3 -3
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/Name.js} +2 -2
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js} +2 -2
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js} +3 -3
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js} +2 -2
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -0
- package/dist/{components/Map/components/EarthEngineLayerConfiguration/hooks/data.mjs → esm/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js} +4 -4
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/index.js +4 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -0
- package/dist/{components/Map/components/MapArea/index.mjs → esm/components/Map/components/MapArea/index.js} +41 -26
- package/dist/esm/components/Map/components/MapArea/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapArea/interfaces/index.js +3 -0
- package/dist/{components/Map/components/MapControls/components/CustomControl/index.mjs → esm/components/Map/components/MapControls/components/CustomControl/index.js} +1 -1
- package/dist/esm/components/Map/components/MapControls/components/CustomControl/index.js.map +1 -0
- package/dist/{components/Map/components/MapControls/components/DownloadControl/index.mjs → esm/components/Map/components/MapControls/components/DownloadControl/index.js} +1 -1
- package/dist/esm/components/Map/components/MapControls/components/DownloadControl/index.js.map +1 -0
- package/dist/{components/Map/components/MapControls/components/FullscreenControl/index.mjs → esm/components/Map/components/MapControls/components/FullscreenControl/index.js} +1 -1
- package/dist/esm/components/Map/components/MapControls/components/FullscreenControl/index.js.map +1 -0
- package/dist/{components/Map/components/MapControls/index.mjs → esm/components/Map/components/MapControls/index.js} +17 -5
- package/dist/esm/components/Map/components/MapControls/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs → esm/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js} +2 -2
- package/dist/esm/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/BoundaryLayer/index.mjs → esm/components/Map/components/MapLayer/components/BoundaryLayer/index.js} +3 -3
- package/dist/esm/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js} +50 -15
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js} +27 -9
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js} +2 -2
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/index.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js} +5 -5
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +3 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31466 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js} +29 -23
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.mjs → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js} +34 -23
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +10 -0
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.mjs → esm/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js} +1 -1
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/LegendArea/index.mjs → esm/components/Map/components/MapLayer/components/LegendArea/index.js} +8 -8
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.mjs → esm/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js} +20 -6
- package/dist/esm/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/PointLayer/hooks/index.mjs → esm/components/Map/components/MapLayer/components/PointLayer/hooks/index.js} +2 -2
- package/dist/esm/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/PointLayer/index.mjs → esm/components/Map/components/MapLayer/components/PointLayer/index.js} +3 -3
- package/dist/esm/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.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js} +33 -5
- package/dist/esm/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.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js} +27 -8
- package/dist/esm/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.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js} +3 -3
- package/dist/esm/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.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js} +3 -3
- package/dist/esm/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.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js} +19 -5
- package/dist/esm/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.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js} +7 -4
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js} +2 -2
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/ThematicLayer/hooks/config.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js} +2 -2
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -0
- package/dist/{components/Map/components/MapLayer/components/ThematicLayer/index.mjs → esm/components/Map/components/MapLayer/components/ThematicLayer/index.js} +4 -4
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +56 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css.map +1 -0
- package/dist/{components/Map/components/MapLayer/index.mjs → esm/components/Map/components/MapLayer/index.js} +5 -5
- package/dist/esm/components/Map/components/MapLayer/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/interfaces/index.js +10 -0
- package/dist/esm/components/Map/components/MapLayer/interfaces/index.js.map +1 -0
- package/dist/{components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.mjs → esm/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js} +8 -8
- package/dist/esm/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -0
- package/dist/{components/Map/components/MapProvider/components/MapLayerProvider/index.mjs → esm/components/Map/components/MapProvider/components/MapLayerProvider/index.js} +4 -4
- package/dist/esm/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -0
- package/dist/{components/Map/components/MapProvider/hooks/index.mjs → esm/components/Map/components/MapProvider/hooks/index.js} +2 -2
- package/dist/esm/components/Map/components/MapProvider/hooks/index.js.map +1 -0
- package/dist/{components/Map/components/MapProvider/index.mjs → esm/components/Map/components/MapProvider/index.js} +3 -3
- package/dist/esm/components/Map/components/MapProvider/index.js.map +1 -0
- package/dist/{components/Map/components/MapUpdater/index.mjs → esm/components/Map/components/MapUpdater/index.js} +2 -2
- package/dist/esm/components/Map/components/MapUpdater/index.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs → esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js} +2 -2
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs → esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js} +1 -1
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs → esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js} +7 -7
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs → esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js} +1 -1
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js} +16 -4
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -0
- package/dist/{components/Map/constants/colors.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js} +1 -1
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js} +3 -3
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +15 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +12 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js} +13 -5
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js} +3 -3
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js} +1 -1
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js} +1 -1
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js} +1 -1
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js.map +1 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/components/TypeField.mjs → esm/components/Map/components/ThematicLayerConfiguration/components/TypeField.js} +1 -1
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/TypeField.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/index.js +5 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/types/index.js +3 -0
- package/dist/{components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.mjs → esm/components/Map/constants/colors.js} +1 -1
- package/dist/esm/components/Map/constants/colors.js.map +1 -0
- package/dist/{components/Map/constants/legendSet.mjs → esm/components/Map/constants/legendSet.js} +1 -1
- package/dist/esm/components/Map/constants/legendSet.js.map +1 -0
- package/dist/{components/Map/hooks/map.mjs → esm/components/Map/hooks/map.js} +2 -2
- package/dist/esm/components/Map/hooks/map.js.map +1 -0
- package/dist/esm/components/Map/index.js +7 -0
- package/dist/esm/components/Map/index.js.map +1 -0
- package/dist/esm/components/Map/interfaces/index.js +3 -0
- package/dist/{components/Map/state/index.mjs → esm/components/Map/state/index.js} +1 -1
- package/dist/esm/components/Map/state/index.js.map +1 -0
- package/dist/{components/Map/utils/colors.mjs → esm/components/Map/utils/colors.js} +13 -5
- package/dist/esm/components/Map/utils/colors.js.map +1 -0
- package/dist/{components/Map/utils/helpers.mjs → esm/components/Map/utils/helpers.js} +1 -1
- package/dist/esm/components/Map/utils/helpers.js.map +1 -0
- package/dist/{components/Map/utils/map.mjs → esm/components/Map/utils/map.js} +16 -5
- package/dist/esm/components/Map/utils/map.js.map +1 -0
- package/dist/{components/SingleValueContainer/SingleValueContainer.stories.mjs → esm/components/SingleValueContainer/SingleValueContainer.stories.js} +1 -1
- package/dist/esm/components/SingleValueContainer/SingleValueContainer.stories.js.map +1 -0
- package/dist/{components/SingleValueContainer/SingleValueVisualizer.mjs → esm/components/SingleValueContainer/SingleValueVisualizer.js} +4 -4
- package/dist/esm/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -0
- package/dist/{components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs → esm/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js} +2 -2
- package/dist/esm/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -0
- package/dist/{components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.mjs → esm/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js} +1 -1
- package/dist/esm/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js.map +1 -0
- package/dist/esm/components/SingleValueContainer/index.js +5 -0
- package/dist/esm/components/SingleValueContainer/index.js.map +1 -0
- package/dist/esm/components/SingleValueContainer/styles/SingleValueContainer.module.css +32 -0
- package/dist/esm/components/SingleValueContainer/styles/SingleValueContainer.module.css.map +1 -0
- package/dist/esm/components/SingleValueContainer/types/props.js +3 -0
- package/dist/{components/Visualization/components/AnalyticsDataProvider/index.mjs → esm/components/Visualization/components/AnalyticsDataProvider/index.js} +38 -11
- package/dist/esm/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -0
- package/dist/{components/Visualization/components/DimensionsProvider/index.mjs → esm/components/Visualization/components/DimensionsProvider/index.js} +1 -1
- package/dist/esm/components/Visualization/components/DimensionsProvider/index.js.map +1 -0
- package/dist/{components/Visualization/components/LayoutProvider/index.mjs → esm/components/Visualization/components/LayoutProvider/index.js} +6 -5
- package/dist/esm/components/Visualization/components/LayoutProvider/index.js.map +1 -0
- package/dist/{components/Visualization/components/VisualizationDimensionSelector/index.mjs → esm/components/Visualization/components/VisualizationDimensionSelector/index.js} +4 -4
- package/dist/esm/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -0
- package/dist/{components/Visualization/components/VisualizationProvider/index.mjs → esm/components/Visualization/components/VisualizationProvider/index.js} +12 -6
- package/dist/esm/components/Visualization/components/VisualizationProvider/index.js.map +1 -0
- package/dist/{components/Visualization/components/VisualizationSelector/index.mjs → esm/components/Visualization/components/VisualizationSelector/index.js} +8 -8
- package/dist/esm/components/Visualization/components/VisualizationSelector/index.js.map +1 -0
- package/dist/{components/Visualization/components/VisualizationTypeProvider/index.mjs → esm/components/Visualization/components/VisualizationTypeProvider/index.js} +6 -2
- package/dist/esm/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -0
- package/dist/{components/Visualization/components/VisualizationTypeSelector/index.mjs → esm/components/Visualization/components/VisualizationTypeSelector/index.js} +24 -8
- package/dist/esm/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -0
- package/dist/{components/Visualization/index.mjs → esm/components/Visualization/index.js} +5 -5
- package/dist/esm/components/Visualization/index.js.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts +4 -4
- package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +2 -2
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts +2 -2
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/index.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/index.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/bar.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/bar.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/column.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/column.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/index.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/index.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/line.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/line.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/multi-series.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/multi-series.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/pie.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/pie.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/services/export.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/utils/chart.d.ts +2 -2
- package/dist/types/components/ChartAnalytics/utils/chart.d.ts.map +1 -1
- package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts +2 -2
- package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts.map +1 -1
- package/dist/types/components/CircularProgressDashboard/index.d.ts +2 -2
- package/dist/types/components/CircularProgressDashboard/index.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts +2 -2
- package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts +1 -1
- package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/index.d.ts +2 -2
- package/dist/types/components/DHIS2PivotTable/index.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/services/engine.d.ts +1 -1
- package/dist/types/components/DHIS2PivotTable/services/engine.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/state/engine.d.ts +2 -2
- package/dist/types/components/DHIS2PivotTable/state/engine.d.ts.map +1 -1
- package/dist/types/components/Map/DHIS2Map.d.ts +1 -1
- package/dist/types/components/Map/DHIS2Map.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts +2 -2
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +2 -2
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapArea/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapArea/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapControls/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapControls/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts +3 -3
- package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +4 -4
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts +4 -4
- package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapProvider/hooks/index.d.ts +3 -3
- package/dist/types/components/Map/components/MapProvider/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapProvider/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapUpdater/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapUpdater/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts +2 -2
- package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +3 -3
- package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts.map +1 -1
- package/dist/types/components/Map/hooks/map.d.ts.map +1 -1
- package/dist/types/components/Map/index.d.ts +5 -5
- package/dist/types/components/Map/index.d.ts.map +1 -1
- package/dist/types/components/Map/interfaces/index.d.ts +2 -2
- package/dist/types/components/Map/interfaces/index.d.ts.map +1 -1
- package/dist/types/components/Map/state/index.d.ts +2 -2
- package/dist/types/components/Map/state/index.d.ts.map +1 -1
- package/dist/types/components/Map/utils/colors.d.ts +1 -1
- package/dist/types/components/Map/utils/colors.d.ts.map +1 -1
- package/dist/types/components/Map/utils/map.d.ts.map +1 -1
- package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts +3 -3
- package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts.map +1 -1
- package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +1 -1
- package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts.map +1 -1
- package/dist/types/components/SingleValueContainer/index.d.ts +3 -2
- package/dist/types/components/SingleValueContainer/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts +1 -1
- package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts +2 -2
- package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts +1 -1
- package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts +4 -4
- package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts +10 -10
- package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts +2 -2
- package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts +1 -1
- package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/index.d.ts +6 -6
- package/dist/types/components/Visualization/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.mjs.map +0 -1
- package/dist/components/ChartAnalytics/DHIS2Chart.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.mjs.map +0 -1
- package/dist/components/ChartAnalytics/hooks/useChart.mjs.map +0 -1
- package/dist/components/ChartAnalytics/index.mjs +0 -3
- package/dist/components/ChartAnalytics/index.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/bar.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/column.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/index.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/line.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/multi-series.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/pie.mjs.map +0 -1
- package/dist/components/ChartAnalytics/services/export.mjs.map +0 -1
- package/dist/components/ChartAnalytics/types/props.mjs +0 -3
- package/dist/components/ChartAnalytics/utils/chart.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/index.mjs +0 -4
- package/dist/components/CircularProgressDashboard/index.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/types/props.mjs +0 -3
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/components/Table/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/components/TableBody/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/index.mjs +0 -4
- package/dist/components/DHIS2PivotTable/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/interfaces/index.mjs +0 -3
- package/dist/components/DHIS2PivotTable/services/engine.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/state/engine.mjs.map +0 -1
- package/dist/components/Map/DHIS2Map.mjs.map +0 -1
- package/dist/components/Map/DHIS2Map.stories.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.mjs +0 -4
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.mjs.map +0 -1
- package/dist/components/Map/components/MapArea/index.mjs.map +0 -1
- package/dist/components/Map/components/MapArea/interfaces/index.mjs +0 -3
- package/dist/components/Map/components/MapControls/components/CustomControl/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.mjs +0 -3
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/interfaces/index.mjs +0 -5
- package/dist/components/Map/components/MapLayer/interfaces/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/index.mjs.map +0 -1
- package/dist/components/Map/components/MapUpdater/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/index.mjs +0 -5
- package/dist/components/Map/components/ThematicLayerConfiguration/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/types/index.mjs +0 -3
- package/dist/components/Map/constants/colors.mjs.map +0 -1
- package/dist/components/Map/constants/legendSet.mjs.map +0 -1
- package/dist/components/Map/hooks/map.mjs.map +0 -1
- package/dist/components/Map/index.mjs +0 -7
- package/dist/components/Map/index.mjs.map +0 -1
- package/dist/components/Map/interfaces/index.mjs +0 -3
- package/dist/components/Map/state/index.mjs.map +0 -1
- package/dist/components/Map/utils/colors.mjs.map +0 -1
- package/dist/components/Map/utils/helpers.mjs.map +0 -1
- package/dist/components/Map/utils/map.mjs.map +0 -1
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.mjs.map +0 -1
- package/dist/components/SingleValueContainer/SingleValueVisualizer.mjs.map +0 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs.map +0 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.mjs.map +0 -1
- package/dist/components/SingleValueContainer/index.mjs +0 -4
- package/dist/components/SingleValueContainer/index.mjs.map +0 -1
- package/dist/components/SingleValueContainer/types/props.mjs +0 -3
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/DimensionsProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/LayoutProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationSelector/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.mjs.map +0 -1
- package/dist/components/Visualization/index.mjs.map +0 -1
- package/dist/index.mjs +0 -8
- package/dist/index.mjs.map +0 -1
- /package/dist/{components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs.map → esm/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js.map} +0 -0
- /package/dist/{components/ChartAnalytics/types/props.mjs.map → esm/components/ChartAnalytics/types/props.js.map} +0 -0
- /package/dist/{components/CircularProgressDashboard/types/props.mjs.map → esm/components/CircularProgressDashboard/types/props.js.map} +0 -0
- /package/dist/{components/DHIS2PivotTable/interfaces/index.mjs.map → esm/components/DHIS2PivotTable/interfaces/index.js.map} +0 -0
- /package/dist/{components/Map/components/MapArea/interfaces/index.mjs.map → esm/components/Map/components/MapArea/interfaces/index.js.map} +0 -0
- /package/dist/{components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.mjs.map → esm/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js.map} +0 -0
- /package/dist/{components/Map/components/ThematicLayerConfiguration/types/index.mjs.map → esm/components/Map/components/ThematicLayerConfiguration/types/index.js.map} +0 -0
- /package/dist/{components/Map/interfaces/index.mjs.map → esm/components/Map/interfaces/index.js.map} +0 -0
- /package/dist/{components/SingleValueContainer/types/props.mjs.map → esm/components/SingleValueContainer/types/props.js.map} +0 -0
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
import { getInfo, getScale, getFeatureCollectionProperties, getHistogramStatistics, hasClasses, combineReducers } from '../utils';
|
|
1
|
+
import { getInfo, getScale, getFeatureCollectionProperties, getHistogramStatistics, hasClasses, combineReducers } from '../utils/index.js';
|
|
2
2
|
import { head, isEmpty, find } from 'lodash';
|
|
3
|
-
import EE from './api';
|
|
3
|
+
import * as EE from './api.js';
|
|
4
4
|
|
|
5
5
|
const ee = EE;
|
|
6
6
|
window.ee = ee;
|
|
7
7
|
const FEATURE_STYLE = { color: "FFA500", strokeWidth: 2 };
|
|
8
8
|
const DEFAULT_TILE_SCALE = 1;
|
|
9
9
|
class EarthEngine {
|
|
10
|
-
token;
|
|
11
|
-
options;
|
|
12
|
-
refresh;
|
|
13
|
-
orgUnits;
|
|
14
|
-
initialized = false;
|
|
15
|
-
period;
|
|
16
|
-
instance;
|
|
17
|
-
scale;
|
|
18
|
-
image;
|
|
19
|
-
aggregationData;
|
|
20
10
|
constructor({ options }) {
|
|
11
|
+
this.initialized = false;
|
|
21
12
|
this.options = options;
|
|
22
13
|
this.initialized = true;
|
|
23
14
|
this.getInstance();
|
|
@@ -179,21 +170,28 @@ class EarthEngine {
|
|
|
179
170
|
scale,
|
|
180
171
|
tileScale
|
|
181
172
|
}).select(aggregations, null, false);
|
|
182
|
-
const features = Object.values(
|
|
173
|
+
const features = Object.values(
|
|
174
|
+
getFeatureCollectionProperties(await getInfo(aggregatedFeatures))
|
|
175
|
+
);
|
|
183
176
|
if (!isEmpty(features) && features.length === this.orgUnits?.length) {
|
|
184
|
-
this.aggregationData = features.map(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
177
|
+
this.aggregationData = features.map(
|
|
178
|
+
(feature, index) => {
|
|
179
|
+
return {
|
|
180
|
+
orgUnit: this.orgUnits?.[index],
|
|
181
|
+
data: feature
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
);
|
|
190
185
|
}
|
|
191
186
|
}
|
|
192
187
|
getAggregation(orgUnit) {
|
|
193
188
|
if (isEmpty(this.aggregationData)) {
|
|
194
189
|
return;
|
|
195
190
|
}
|
|
196
|
-
return find(
|
|
191
|
+
return find(
|
|
192
|
+
this.aggregationData,
|
|
193
|
+
(aggregation) => aggregation.orgUnit.id === orgUnit.id
|
|
194
|
+
);
|
|
197
195
|
}
|
|
198
196
|
async url() {
|
|
199
197
|
if (!this.initialized)
|
|
@@ -234,12 +232,20 @@ class EarthEngine {
|
|
|
234
232
|
case "Feature":
|
|
235
233
|
return ee.Feature(geometry);
|
|
236
234
|
case "FeatureCollection":
|
|
237
|
-
return ee.FeatureCollection([
|
|
235
|
+
return ee.FeatureCollection([
|
|
236
|
+
...features.map(
|
|
237
|
+
(feature) => ee.Feature(this.getGeometryByType(feature))
|
|
238
|
+
)
|
|
239
|
+
]);
|
|
238
240
|
}
|
|
239
241
|
}
|
|
240
242
|
getFeatureCollection() {
|
|
241
243
|
if (this.orgUnits) {
|
|
242
|
-
return ee.FeatureCollection(
|
|
244
|
+
return ee.FeatureCollection(
|
|
245
|
+
this.orgUnits.map(
|
|
246
|
+
(orgUnit) => this.getFeatureByType(orgUnit.geoJSON)
|
|
247
|
+
)
|
|
248
|
+
);
|
|
243
249
|
} else {
|
|
244
250
|
throw "You need to set org units first";
|
|
245
251
|
}
|
|
@@ -356,4 +362,4 @@ class EarthEngine {
|
|
|
356
362
|
|
|
357
363
|
export { EarthEngine };
|
|
358
364
|
//# sourceMappingURL=out.js.map
|
|
359
|
-
//# sourceMappingURL=engine.
|
|
365
|
+
//# sourceMappingURL=engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.ts"],"names":["token"],"mappings":"AAMA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,MAAM,MAAM,eAAe;AAWpC,YAAY,QAAQ;AAEpB,MAAM,KAAK;AAEX,OAAO,KAAK;AAEZ,MAAM,gBAAgB,EAAE,OAAO,UAAU,aAAa,EAAE;AACxD,MAAM,qBAAqB;AAEpB,MAAM,YAAY;AAAA,EAYxB,YAAY,EAAE,QAAQ,GAAoC;AAP1D,uBAAc;AAQb,SAAK,UAAU;AACf,SAAK,cAAc;AACnB,SAAK,YAAY;AAAA,EAClB;AAAA,EAEA,aAAa,SACZ,OACA,SACgB;AAChB,UAAM,YAAY;AAElB,aAAS,aACR,UACA,UACC;AACD,cAAQ,EAAE,KAAK,CAAC,EAAE,OAAAA,OAAM,MAAmC;AAC1D,iBAAS;AAAA,UACR,GAAGA;AAAA,UACH,YAAY,aAAa;A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A,EAEU,cAAc;AACvB,UAAM,EAAE,KAAK,IAAI,KAAK;AACtB,YAAQ,MAAM;AAAA,MACb,KAAK;AACJ,aAAK,WAAW,KAAK,mBAAmB;AACxC;AAAA,MACD,KAAK;AACJ,aAAK,WAAW,KAAK,6BAA6B;AAClD;AAAA,MACD,KAAK;AACJ,aAAK,WAAW,KAAK,iBAAiB;AACtC;AAAA,MACD,KAAK;AACJ,aAAK,WAAW,KAAK,2BAA2B;AAChD;AAAA,MACD;AACC,aAAK,WAAW,KAAK,kBAAkB;AAAA,IACzC;AAAA,EACD;AAAA,EAEU,WAAgB;AACzB,QAAI,KAAK,OAAO;AACf,aAAO,KAAK;AAAA,IACb;AACA,UAAM,EAAE,KAAK,IAAI,KAAK;AACtB,QAAI;AACJ,YAAQ,MAAM;AAAA,MACb,KAAK;AACJ,gBAAQ,KAAK,oBAAoB;AACjC;AAAA,MACD,KAAK;AACJ,gBAAQ,KAAK,8BAA8B;AAC3C;AAAA,MACD,KAAK;AACJ,gBAAQ,KAAK,kBAAkB;AAC/B;AAAA,MACD,KAAK;AACJ,gBAAQ,KAAK,4BAA4B;AACzC;AAAA,MACD;AACC,gBAAQ,KAAK,kBAAkB;AAAA,IACjC;AACA,YAAQ,KAAK,UAAU,KAAK;AAC5B,YAAQ,KAAK,UAAU,KAAK;AAC5B,SAAK,QAAQ;AACb,WAAO;AAAA,EACR;AACD","sourcesContent":["import { MapOrgUnit } from \"../../../../../interfaces/index.js\";\nimport {\n\tEarthEngineOptions,\n\tEarthEngineToken,\n\tRefreshToken,\n} from \"../interfaces/index.js\";\nimport {\n\tcombineReducers,\n\tgetFeatureCollectionProperties,\n\tgetHistogramStatistics,\n\tgetInfo,\n\tgetScale,\n\thasClasses,\n} from \"../utils/index.js\";\nimport { find, head, isEmpty } from \"lodash\";\n\n// async function importEEModule(): Promise<any> {\n// // @ts-ignore\n// if (import.meta.env.STORYBOOK_BUILD === \"true\") {\n// return await import(\"@google/earthengine\");\n// }\n// return await import(\"./api\");\n// }\n// const EE = await importEEModule();\n//@ts-ignore\nimport * as EE from \"./api.js\";\n// @ts-ignore\nconst ee = EE as any;\n// @ts-ignore\nwindow.ee = ee;\n\nconst FEATURE_STYLE = { color: \"FFA500\", strokeWidth: 2 };\nconst DEFAULT_TILE_SCALE = 1;\n\nexport class EarthEngine {\n\ttoken?: EarthEngineToken;\n\toptions: EarthEngineOptions;\n\trefresh?: RefreshToken;\n\torgUnits?: MapOrgUnit[];\n\tinitialized = false;\n\tperiod?: string | string[];\n\tinstance: any;\n\tscale?: any;\n\timage: any;\n\taggregationData: any;\n\n\tconstructor({ options }: { options: EarthEngineOptions }) {\n\t\tthis.options = options;\n\t\tthis.initialized = true;\n\t\tthis.getInstance();\n\t}\n\n\tstatic async setToken(\n\t\ttoken: EarthEngineToken,\n\t\trefresh: RefreshToken,\n\t): Promise<void> {\n\t\tconst tokenType = \"Bearer\";\n\n\t\tfunction refreshToken(\n\t\t\tauthArgs: { scope: any },\n\t\t\tcallback: (props: any) => void,\n\t\t) {\n\t\t\trefresh().then(({ token }: { token: EarthEngineToken }) => {\n\t\t\t\tcallback({\n\t\t\t\t\t...token,\n\t\t\t\t\ttoken_type: tokenType ?? \"Bearer\",\n\t\t\t\t\tstate: authArgs?.scope,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tawait new Promise((resolve, reject) => {\n\t\t\tif (ee.data.getAuthToken()) {\n\t\t\t\tee.initialize(null, null, resolve, reject);\n\t\t\t}\n\t\t\tif (token) {\n\t\t\t\tconst { access_token, client_id, expires_in } = token;\n\t\t\t\tee.data.setAuthToken(\n\t\t\t\t\tclient_id,\n\t\t\t\t\ttokenType ?? \"Bearer\",\n\t\t\t\t\taccess_token,\n\t\t\t\t\texpires_in,\n\t\t\t\t\tnull,\n\t\t\t\t\t() => {\n\t\t\t\t\t\tee.initialize(null, null, resolve, reject);\n\t\t\t\t\t},\n\t\t\t\t\tfalse,\n\t\t\t\t);\n\t\t\t\tee.data.setAuthTokenRefresher(refreshToken);\n\t\t\t}\n\t\t\tresolve(\"Token not found\");\n\t\t});\n\t}\n\n\tsetOrgUnits(orgUnits: MapOrgUnit[]): EarthEngine {\n\t\tthis.orgUnits = orgUnits;\n\t\treturn this;\n\t}\n\n\tsetPeriod(period: string) {\n\t\tthis.period = period;\n\t}\n\n\tasync getValue(geoJSON: any, type: string) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst point = this.getGeometryByType(geoJSON);\n\t\t\tconst reducer = this.getReducerByType(type);\n\t\t\tconst image = this.getImage();\n\n\t\t\tconst reducedImage = image.reduceRegion(reducer, point, 1);\n\n\t\t\treducedImage.evaluate((data: unknown, error: any) => {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(data);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tasync getPeriod() {\n\t\tconst { type } = this.options;\n\t\tif (type !== \"ImageCollection\") {\n\t\t\treturn;\n\t\t}\n\n\t\tconst imageCollection = this.instance\n\t\t\t.distinct(\"system:time_start\")\n\t\t\t.sort(\"system:time_start\", false);\n\t\tconst featureCollection = ee\n\t\t\t.FeatureCollection(imageCollection)\n\t\t\t.select([\"system:time_start\", \"system:time_end\"], null, false);\n\n\t\treturn getInfo(featureCollection);\n\t}\n\n\tasync info() {\n\t\treturn new Promise((resolve) => {\n\t\t\tthis.instance.getInfo(resolve);\n\t\t});\n\t}\n\n\tasync getScale() {\n\t\ttry {\n\t\t\tconst { type } = this.options;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"ImageCollection\":\n\t\t\t\t\tthis.scale = await getScale(this.instance.first());\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.scale = await getScale(this.getImage());\n\t\t\t}\n\t\t} catch (e) {}\n\t}\n\n\tasync getFeatureCollectionAggregation() {\n\t\tconst { datasetId } = this.options;\n\t\tconst dataset = ee.FeatureCollection(datasetId);\n\t\tconst collection = this.getFeatureCollection() as any;\n\t\tconst aggFeatures = collection\n\t\t\t?.map((feature: any) => {\n\t\t\t\tfeature = ee.Feature(feature);\n\t\t\t\tconst count = dataset.filterBounds(feature.geometry()).size();\n\n\t\t\t\treturn feature.set(\"count\", count);\n\t\t\t})\n\t\t\t.select([\"count\"], null, false);\n\n\t\treturn getInfo(aggFeatures).then(getFeatureCollectionProperties);\n\t}\n\n\tasync getHistogramAggregations() {\n\t\ttry {\n\t\t\tconst aggregation = head(this.options.aggregations) ?? \"\";\n\t\t\tconst reducer = ee.Reducer.frequencyHistogram();\n\t\t\tconst collection = this.getFeatureCollection();\n\t\t\tconst legend = this.options.legend?.items;\n\t\t\tconst scale = this.scale;\n\t\t\tconst tileScale = this.options.tileScale ?? DEFAULT_TILE_SCALE;\n\t\t\tconst scaleValue = await getInfo(scale);\n\n\t\t\tconst image = this.getImage();\n\t\t\tconst features = Object.values(\n\t\t\t\tawait getInfo(\n\t\t\t\t\timage\n\t\t\t\t\t\t.reduceRegions({\n\t\t\t\t\t\t\tcollection,\n\t\t\t\t\t\t\treducer,\n\t\t\t\t\t\t\tscale,\n\t\t\t\t\t\t\ttileScale,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.select([\"histogram\"], null, false),\n\t\t\t\t).then((data) =>\n\t\t\t\t\tgetHistogramStatistics({\n\t\t\t\t\t\tdata,\n\t\t\t\t\t\tscale: scaleValue,\n\t\t\t\t\t\taggregationType: aggregation,\n\t\t\t\t\t\tlegend,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn features.map((feature: any, index: number) => {\n\t\t\t\treturn {\n\t\t\t\t\torgUnit: this.orgUnits?.[index],\n\t\t\t\t\tdata: feature,\n\t\t\t\t};\n\t\t\t});\n\t\t} catch (e: any) {\n\t\t\tthrow Error(\"Could not get histogram\", {\n\t\t\t\tcause: e,\n\t\t\t});\n\t\t}\n\t}\n\n\tasync getAggregations() {\n\t\tawait this.getScale();\n\t\tconst { type } = this.options;\n\t\tif (type === \"FeatureCollection\") {\n\t\t\tthis.aggregationData = await this.getFeatureCollectionAggregation();\n\t\t\treturn;\n\t\t}\n\t\tconst aggregations = this.options.aggregations;\n\t\tif (!aggregations) return;\n\n\t\tif (hasClasses(head(aggregations) ?? \"\")) {\n\t\t\tthis.aggregationData = await this.getHistogramAggregations();\n\t\t\treturn;\n\t\t}\n\n\t\tconst reducer = combineReducers(ee)(aggregations);\n\t\tconst collection = this.getFeatureCollection();\n\t\tconst image = this.getImage();\n\t\tconst scale = this.scale;\n\t\tconst tileScale = this.options.tileScale ?? DEFAULT_TILE_SCALE;\n\t\tconst aggregatedFeatures = image\n\t\t\t.reduceRegions({\n\t\t\t\tcollection,\n\t\t\t\treducer,\n\t\t\t\tscale,\n\t\t\t\ttileScale,\n\t\t\t})\n\t\t\t.select(aggregations, null, false);\n\n\t\tconst features = Object.values(\n\t\t\tgetFeatureCollectionProperties(await getInfo(aggregatedFeatures)),\n\t\t) as any[];\n\t\tif (!isEmpty(features) && features.length === this.orgUnits?.length) {\n\t\t\t//Mapping features to orgUnits using index.\n\t\t\tthis.aggregationData = features.map(\n\t\t\t\t(feature: any, index: number) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\torgUnit: this.orgUnits?.[index],\n\t\t\t\t\t\tdata: feature,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tgetAggregation(orgUnit: MapOrgUnit) {\n\t\tif (isEmpty(this.aggregationData)) {\n\t\t\treturn;\n\t\t}\n\t\treturn find(\n\t\t\tthis.aggregationData,\n\t\t\t(aggregation) => aggregation.orgUnit.id === orgUnit.id,\n\t\t);\n\t}\n\n\tasync url(): Promise<string> {\n\t\tif (!this.initialized) throw \"You need to call init() first\";\n\t\treturn this.visualize(this.getImage());\n\t}\n\n\tprotected applyPeriod(imageCollection: any) {\n\t\tconst period = this.period;\n\t\tif (period) {\n\t\t\treturn imageCollection.filterDate(period);\n\t\t}\n\t}\n\n\tprotected applyMask(image: any) {\n\t\tif (this.options.mask) {\n\t\t\treturn image.updateMask(image.gt(0));\n\t\t} else {\n\t\t\treturn image;\n\t\t}\n\t}\n\n\tprotected applyBand(imageCollection: any) {\n\t\tif (this.options.selectedBands) {\n\t\t\treturn imageCollection.select(this.options.selectedBands);\n\t\t} else {\n\t\t\treturn imageCollection;\n\t\t}\n\t}\n\n\tprotected getReducerByType(type: string) {\n\t\treturn ee.Reducer[type].call();\n\t}\n\n\tprotected getGeometryByType(geoJSON: any) {\n\t\treturn ee.Geometry(geoJSON?.geometry);\n\t}\n\n\tprotected getFeatureByType(geoJSON: any) {\n\t\tconst featureType = geoJSON.type;\n\t\tconst features = geoJSON.features ?? [];\n\t\tconst geometry = this.getGeometryByType(geoJSON);\n\t\tswitch (featureType) {\n\t\t\tcase \"Feature\":\n\t\t\t\treturn ee.Feature(geometry);\n\t\t\tcase \"FeatureCollection\":\n\t\t\t\treturn ee.FeatureCollection([\n\t\t\t\t\t...features.map((feature: any) =>\n\t\t\t\t\t\tee.Feature(this.getGeometryByType(feature)),\n\t\t\t\t\t),\n\t\t\t\t]);\n\t\t}\n\t}\n\n\tprotected getFeatureCollection(): unknown {\n\t\tif (this.orgUnits) {\n\t\t\treturn ee.FeatureCollection(\n\t\t\t\tthis.orgUnits.map((orgUnit: MapOrgUnit) =>\n\t\t\t\t\tthis.getFeatureByType(orgUnit.geoJSON),\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\tthrow \"You need to set org units first\";\n\t\t}\n\t}\n\n\tprotected getParamsFromLegend() {\n\t\tif (!this.options.legend) return;\n\t\tconst legend = this.options.legend.items;\n\t\tconst keys = legend.map((l) => l.id);\n\t\tconst min = Math.min(...keys);\n\t\tconst max = Math.max(...keys);\n\t\tconst palette = legend.map((l) => l.color).join(\",\");\n\t\treturn { min, max, palette };\n\t}\n\n\tprotected async visualize(image: any): Promise<string> {\n\t\tconst { min, max, palette } = this.getParamsFromLegend() ??\n\t\t\tthis.options.params ?? {\n\t\t\t\tmin: null,\n\t\t\t\tmax: null,\n\t\t\t\tpalette: null,\n\t\t\t};\n\t\treturn (\n\t\t\t(await new Promise((resolve, reject) => {\n\t\t\t\timage.getMap({ min, max, palette }, resolve);\n\t\t\t})) as any\n\t\t)?.urlFormat;\n\t}\n\n\tprotected getImageCollectionInstance() {\n\t\tconst { datasetId } = this.options;\n\t\tlet imageCollection = ee.ImageCollection(datasetId);\n\t\tif (this.period) {\n\t\t\timageCollection = this.applyPeriod(imageCollection);\n\t\t}\n\t\timageCollection = this.applyBand(imageCollection);\n\t\treturn imageCollection;\n\t}\n\n\tprotected getImageFromImageCollection() {\n\t\tconst { mosaic } = this.options;\n\t\tconst imageCollection = this.instance;\n\t\treturn mosaic\n\t\t\t? imageCollection\n\t\t\t\t\t.mosaic()\n\t\t\t\t\t.clipToCollection(this.getFeatureCollection())\n\t\t\t: ee\n\t\t\t\t\t.Image(imageCollection.first())\n\t\t\t\t\t.clipToCollection(this.getFeatureCollection());\n\t}\n\n\tprotected getImageInstance() {\n\t\tconst { datasetId } = this.options;\n\t\treturn ee\n\t\t\t.Image(datasetId)\n\t\t\t.clipToCollection(this.getFeatureCollection());\n\t}\n\n\tprotected getImageFromImage() {\n\t\treturn this.instance;\n\t}\n\n\tprotected getFeatureInstance() {\n\t\tconst { datasetId } = this.options;\n\t\tconst feature = ee.Feature(datasetId);\n\t\tthis.instance = feature;\n\t\treturn feature;\n\t}\n\n\tprotected getImageFromFeature() {\n\t\treturn this.instance;\n\t}\n\n\tprotected getFeatureCollectionInstance() {\n\t\tconst { datasetId } = this.options;\n\t\tlet featureCollection = ee.FeatureCollection(datasetId);\n\t\tif (this.period) {\n\t\t\tfeatureCollection = this.applyPeriod(featureCollection);\n\t\t}\n\t\treturn featureCollection;\n\t}\n\n\tprotected getImageFromFeatureCollection() {\n\t\tlet featureCollection = this.instance;\n\t\treturn featureCollection\n\t\t\t.draw(FEATURE_STYLE)\n\t\t\t.clipToCollection(this.getFeatureCollection());\n\t}\n\n\tprotected getInstance() {\n\t\tconst { type } = this.options;\n\t\tswitch (type) {\n\t\t\tcase \"Feature\":\n\t\t\t\tthis.instance = this.getFeatureInstance();\n\t\t\t\tbreak;\n\t\t\tcase \"FeatureCollection\":\n\t\t\t\tthis.instance = this.getFeatureCollectionInstance();\n\t\t\t\tbreak;\n\t\t\tcase \"Image\":\n\t\t\t\tthis.instance = this.getImageInstance();\n\t\t\t\tbreak;\n\t\t\tcase \"ImageCollection\":\n\t\t\t\tthis.instance = this.getImageCollectionInstance();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.instance = this.getImageFromImage();\n\t\t}\n\t}\n\n\tprotected getImage(): any {\n\t\tif (this.image) {\n\t\t\treturn this.image;\n\t\t}\n\t\tconst { type } = this.options;\n\t\tlet image;\n\t\tswitch (type) {\n\t\t\tcase \"Feature\":\n\t\t\t\timage = this.getImageFromFeature();\n\t\t\t\tbreak;\n\t\t\tcase \"FeatureCollection\":\n\t\t\t\timage = this.getImageFromFeatureCollection();\n\t\t\t\tbreak;\n\t\t\tcase \"Image\":\n\t\t\t\timage = this.getImageFromImage();\n\t\t\t\tbreak;\n\t\t\tcase \"ImageCollection\":\n\t\t\t\timage = this.getImageFromImageCollection();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\timage = this.getImageFromImage();\n\t\t}\n\t\timage = this.applyMask(image);\n\t\timage = this.applyBand(image);\n\t\tthis.image = image;\n\t\treturn image;\n\t}\n}\n"]}
|
|
@@ -54,29 +54,40 @@ const squareMetersToHectares = (value) => value / 1e4;
|
|
|
54
54
|
const squareMetersToAcres = (value) => value / 4046.8564224;
|
|
55
55
|
const classAggregation = ["percentage", "hectares", "acres"];
|
|
56
56
|
const hasClasses = (type) => classAggregation.includes(type);
|
|
57
|
-
const getHistogramStatistics = ({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
+
);
|
|
79
90
|
|
|
80
91
|
export { combineReducers, getClassifiedImage, getFeatureCollectionProperties, getHistogramStatistics, getInfo, getScale, hasClasses };
|
|
81
92
|
//# sourceMappingURL=out.js.map
|
|
82
|
-
//# sourceMappingURL=index.
|
|
93
|
+
//# sourceMappingURL=index.js.map
|
package/dist/esm/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"],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R,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/esm/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 @@
|
|
|
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"]}
|
|
@@ -2,14 +2,14 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { IconLegend24, Portal, Popper, colors } from '@dhis2/ui';
|
|
3
3
|
import { compact, head } from 'lodash';
|
|
4
4
|
import React, { useState, useRef, useEffect } from 'react';
|
|
5
|
-
import { CustomControl } from '../../../MapControls/components/CustomControl';
|
|
6
|
-
import { SUPPORTED_EARTH_ENGINE_LAYERS } from '../../interfaces';
|
|
7
|
-
import PointLegend from '../PointLayer/components/PointLegend';
|
|
8
|
-
import BubbleLegend from '../ThematicLayer/components/Bubble/components/BubbleLegend';
|
|
9
|
-
import ChoroplethLegend from '../ThematicLayer/components/Choropleth/components/ChoroplethLegend';
|
|
10
|
-
import EarthEngineLegend from '../GoogleEngineLayer/components/EarthEngineLegend';
|
|
5
|
+
import { CustomControl } from '../../../MapControls/components/CustomControl/index.js';
|
|
6
|
+
import { SUPPORTED_EARTH_ENGINE_LAYERS } from '../../interfaces/index.js';
|
|
7
|
+
import PointLegend from '../PointLayer/components/PointLegend/index.js';
|
|
8
|
+
import BubbleLegend from '../ThematicLayer/components/Bubble/components/BubbleLegend/index.js';
|
|
9
|
+
import ChoroplethLegend from '../ThematicLayer/components/Choropleth/components/ChoroplethLegend.js';
|
|
10
|
+
import EarthEngineLegend from '../GoogleEngineLayer/components/EarthEngineLegend.js';
|
|
11
11
|
import classes from './LegendArea.module.css';
|
|
12
|
-
import { usePrintMedia } from '../../../../hooks/map';
|
|
12
|
+
import { usePrintMedia } from '../../../../hooks/map.js';
|
|
13
13
|
|
|
14
14
|
const TOOLTIP_OFFSET = 4;
|
|
15
15
|
function getLegendComponent(layer) {
|
|
@@ -176,4 +176,4 @@ function LegendArea({
|
|
|
176
176
|
|
|
177
177
|
export { LegendArea as default };
|
|
178
178
|
//# sourceMappingURL=out.js.map
|
|
179
|
-
//# sourceMappingURL=index.
|
|
179
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/LegendArea/index.tsx"],"names":[],"mappings":"AA0BS,cAkGP,YAlGO;AA1BT,SAAS,QAAQ,cAAc,QAAQ,cAAc;AAErD,SAAS,SAAS,YAAY;AAC9B,OAAO,SAAS,WAAW,QAAQ,gBAAgB;AAEnD,SAAS,qBAAqB;AAC9B;AAAA,EAKC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gBACF;AAAA;AAAA,YACD;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,SAAS,OAAO;AAAA,EACf;AAAA,EACA;AACD,GAGG;AACF,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,WAAW;AACtD,QAAM,cAAc,cAAc;AAClC,QAAM,aAAa,MAAM;AACxB,QAAI,aAAa;AAChB,mBAAa,CAAC,cAAc,CAAC,SAAS;AAAA,IACvC;AAAA,EACD;AAEA,QAAM,OAAO,KAAK,MAAM,SAAS,QAAQ,QAAQ,CAAyB,GACvE,MAAM;AAET,QAAM,iBAAiB,aAAa,CAAC;AAErC,SACC,oBAAC,SAAI,WAAU,SACb,2BACA,oBAAC,uBAAoB,MAAY,YAAwB,IAEzD,MAAM,SAAS;AAAA,IAAI;AAAA,IAAU,CAAC,UAC7B,MAAM,aAAa,OAAO,EAAE,aAAa,WAAW,CAAC;AAAA,EACtD,GAEF;AAEF;AAEe,SAAR,WAA4B;AAAA,EAClC;AAAA,EACA,SAAS;AACV,GAMG;AACF,QAAM,UAAyB;AAAA,IAC9B,OAAO,OAAO,CAAC,UAAU,MAAM,OAAO,EAAE,IAAI,kBAAkB;AAAA,EAC/D;AACA,QAAM,EAAE,UAAU,YAAY,IAAI,gBAAgB,CAAC;AAEnD,SACC,oBAAC,iBAAc,UACd,8BAAC,SAAI,WAAU,iCACb,mBAAS,IAAI,CAAC,QAAa,UAC3B;AAAA,IAAC;AAAA;AAAA,MACA,aAAa,eAAe;AAAA,MAG3B;AAAA;AAAA,IAFI,GAAG,KAAK;AAAA,EAGd,CACA,GACF,GACD;AAEF","sourcesContent":["import { colors, IconLegend24, Popper, Portal } from \"@dhis2/ui\";\nimport { ControlPosition } from \"leaflet\";\nimport { compact, head } from \"lodash\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { MapLegendConfig } from \"../../../MapArea/interfaces/index.js\";\nimport { CustomControl } from \"../../../MapControls/components/CustomControl/index.js\";\nimport {\n\tCustomBubbleLayer,\n\tCustomGoogleEngineLayer,\n\tCustomPointLayer,\n\tCustomThematicLayer,\n\tSUPPORTED_EARTH_ENGINE_LAYERS,\n} from \"../../interfaces/index.js\";\nimport PointLegend from \"../PointLayer/components/PointLegend/index.js\";\nimport BubbleLegend from \"../ThematicLayer/components/Bubble/components/BubbleLegend/index.js\";\nimport ChoroplethLegend from \"../ThematicLayer/components/Choropleth/components/ChoroplethLegend.js\";\nimport EarthEngineLegend from \"../GoogleEngineLayer/components/EarthEngineLegend.js\";\nimport classes from \"./LegendArea.module.css\";\nimport { usePrintMedia } from \"../../../../hooks/map.js\";\n\nconst TOOLTIP_OFFSET = 4;\n\nfunction getLegendComponent(\n\tlayer: CustomThematicLayer | CustomPointLayer | CustomGoogleEngineLayer,\n) {\n\tif (layer.type === \"point\") {\n\t\treturn <PointLegend name={layer.label} />;\n\t}\n\n\tif (SUPPORTED_EARTH_ENGINE_LAYERS.includes(layer.type)) {\n\t\treturn (\n\t\t\t<EarthEngineLegend\n\t\t\t\tname={layer.name ?? \"\"}\n\t\t\t\tlayer={layer as CustomGoogleEngineLayer}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst { type, enabled, control, dataItem, name, data, legends } =\n\t\t(layer as CustomThematicLayer) ?? {};\n\n\tif (!enabled || !control) {\n\t\treturn null;\n\t}\n\tswitch (type) {\n\t\tcase \"bubble\":\n\t\t\treturn (\n\t\t\t\t<BubbleLegend\n\t\t\t\t\tradius={\n\t\t\t\t\t\t(layer as CustomBubbleLayer)?.radius ?? {\n\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\tmax: 50,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlegends={legends ?? []}\n\t\t\t\t\tname={name ?? dataItem.displayName}\n\t\t\t\t\tdata={data}\n\t\t\t\t\tdataItem={head(data)?.dataItem ?? dataItem}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"choropleth\":\n\t\t\treturn (\n\t\t\t\t<ChoroplethLegend\n\t\t\t\t\tlegends={legends ?? []}\n\t\t\t\t\tname={name ?? dataItem.displayName}\n\t\t\t\t\tdata={data}\n\t\t\t\t\tdataItem={head(data)?.dataItem ?? dataItem}\n\t\t\t\t/>\n\t\t\t);\n\t}\n}\n\nfunction CollapsedLegendIcon({\n\tonCollapse,\n\tname,\n}: {\n\tname: string;\n\tonCollapse: () => void;\n}) {\n\tconst openDelay = 200;\n\tconst closeDelay = 200;\n\tconst [openTooltip, setOpenTooltip] = useState(false);\n\tconst openTimerRef = useRef<any>(null);\n\tconst closeTimerRef = useRef<any>(null);\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst hideModifier = { name: \"hide\" };\n\tconst offsetModifier = {\n\t\tname: \"offset\",\n\t\toptions: {\n\t\t\toffset: [0, TOOLTIP_OFFSET],\n\t\t},\n\t};\n\n\tconst flipModifier = {\n\t\tname: \"flip\",\n\t\toptions: { altBoundary: true },\n\t};\n\n\tconst onMouseOver = () => {\n\t\tclearTimeout(closeTimerRef.current);\n\n\t\topenTimerRef.current = setTimeout(() => {\n\t\t\tsetOpenTooltip(true);\n\t\t}, openDelay);\n\t};\n\n\tconst onMouseOut = () => {\n\t\tclearTimeout(openTimerRef.current);\n\n\t\tcloseTimerRef.current = setTimeout(() => {\n\t\t\tsetOpenTooltip(false);\n\t\t}, closeDelay);\n\t};\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tclearTimeout(openTimerRef.current);\n\t\t\tclearTimeout(closeTimerRef.current);\n\t\t},\n\t\t[],\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tonMouseOver={onMouseOver}\n\t\t\tonMouseOut={onMouseOut}\n\t\t\tonClick={onCollapse}\n\t\t\tstyle={{ width: 28, height: 28 }}\n\t\t\tclassName=\"legend-card collapsed\"\n\t\t>\n\t\t\t<IconLegend24 />\n\t\t\t{openTooltip && (\n\t\t\t\t<Portal\n\t\t\t\t\t/*\n\t\t\t // @ts-ignore */\n\t\t\t\t\tclassName={classes[\"map-tooltip\"]}\n\t\t\t\t>\n\t\t\t\t\t<Popper\n\t\t\t\t\t\tclassName={classes[\"map-tooltip\"]}\n\t\t\t\t\t\treference={ref}\n\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\tmodifiers={[offsetModifier, flipModifier, hideModifier]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tbackgroundColor: `${colors.grey900}`,\n\t\t\t\t\t\t\t\tborderRadius: 3,\n\t\t\t\t\t\t\t\tcolor: `${colors.white}`,\n\t\t\t\t\t\t\t\tpadding: \"4px 6px\",\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdata-test={`content`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popper>\n\t\t\t\t</Portal>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction Legend({\n\tchildren,\n\tcollapsible,\n}: {\n\tchildren: React.ReactElement;\n\tcollapsible: boolean;\n}) {\n\tconst [collapsed, setCollapsed] = useState(collapsible);\n\tconst inPrintMode = usePrintMedia();\n\tconst onCollapse = () => {\n\t\tif (collapsible) {\n\t\t\tsetCollapsed((prevState) => !prevState);\n\t\t}\n\t};\n\n\tconst name = head(React.Children.toArray(children) as React.ReactElement[])\n\t\t?.props.name;\n\n\tconst shouldCollapse = collapsed && !inPrintMode;\n\n\treturn (\n\t\t<div className=\"w-100\">\n\t\t\t{shouldCollapse ? (\n\t\t\t\t<CollapsedLegendIcon name={name} onCollapse={onCollapse} />\n\t\t\t) : (\n\t\t\t\tReact.Children.map(children, (child) =>\n\t\t\t\t\tReact.cloneElement(child, { collapsible, onCollapse }),\n\t\t\t\t)\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport default function LegendArea({\n\tlayers,\n\tlegends: legendConfig,\n}: {\n\tlayers: Array<\n\t\tCustomThematicLayer | CustomPointLayer | CustomGoogleEngineLayer\n\t>;\n\tposition: ControlPosition;\n\tlegends?: MapLegendConfig;\n}) {\n\tconst legends: JSX.Element[] = compact(\n\t\tlayers.filter((layer) => layer.enabled).map(getLegendComponent),\n\t);\n\tconst { position, collapsible } = legendConfig ?? {};\n\n\treturn (\n\t\t<CustomControl position={position}>\n\t\t\t<div className=\"column gap-16 align-items-end\">\n\t\t\t\t{legends?.map((legend: any, index) => (\n\t\t\t\t\t<Legend\n\t\t\t\t\t\tcollapsible={collapsible ?? true}\n\t\t\t\t\t\tkey={`${index}-map-legend`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{legend}\n\t\t\t\t\t</Legend>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</CustomControl>\n\t);\n}\n"]}
|
|
@@ -2,9 +2,9 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useConfig } from '@dhis2/app-runtime';
|
|
3
3
|
import { Divider } from '@dhis2/ui';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import { getIconUrl } from '../../../../../../utils/helpers';
|
|
6
|
-
import LegendCardHeader from '../../../LegendArea/components/LegendCardHeader';
|
|
7
|
-
import { usePointLayer } from '../../hooks';
|
|
5
|
+
import { getIconUrl } from '../../../../../../utils/helpers.js';
|
|
6
|
+
import LegendCardHeader from '../../../LegendArea/components/LegendCardHeader/index.js';
|
|
7
|
+
import { usePointLayer } from '../../hooks/index.js';
|
|
8
8
|
|
|
9
9
|
function PointLegends({
|
|
10
10
|
orgUnitGroups,
|
|
@@ -66,13 +66,27 @@ function PointLegend({ collapsible, onCollapse }, ref) {
|
|
|
66
66
|
const pointLayer = usePointLayer();
|
|
67
67
|
const { label, style } = pointLayer ?? {};
|
|
68
68
|
return /* @__PURE__ */ jsxs("div", { ref, className: "legend-card", children: [
|
|
69
|
-
/* @__PURE__ */ jsx(
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
LegendCardHeader,
|
|
71
|
+
{
|
|
72
|
+
collapsible,
|
|
73
|
+
onCollapse,
|
|
74
|
+
title: label ?? "Points"
|
|
75
|
+
}
|
|
76
|
+
),
|
|
70
77
|
/* @__PURE__ */ jsx(Divider, { margin: "0" }),
|
|
71
|
-
/* @__PURE__ */ jsx(
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
PointLegends,
|
|
80
|
+
{
|
|
81
|
+
label,
|
|
82
|
+
orgUnitGroups: style?.orgUnitGroups ?? [],
|
|
83
|
+
icon: style?.icon
|
|
84
|
+
}
|
|
85
|
+
)
|
|
72
86
|
] });
|
|
73
87
|
}
|
|
74
88
|
var PointLegend_default = forwardRef(PointLegend);
|
|
75
89
|
|
|
76
90
|
export { PointLegend_default as default };
|
|
77
91
|
//# sourceMappingURL=out.js.map
|
|
78
|
-
//# sourceMappingURL=index.
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../src/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.tsx"],"names":["name"],"mappings":"AAwBI,SAIC,KAJD;AAxBJ,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAgB,kBAAkB;AAClC,SAAS,kBAAkB;AAC3B,OAAO,sBAAsB;AAC7B,SAAS,qBAAqB;AAE9B,SAAS,aAAa;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AACD,GAIG;AACF,QAAM,EAAE,QAAQ,IAAI,UAAU;AAE9B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAO,EAAE,UAAU,KAAK,YAAY,aAAa;AAAA,MACjD,WAAU;AAAA,MAET;AAAA,gBACA;AAAA,UAAC;AAAA;AAAA,YAEA,WAAU;AAAA,YAEV;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,QAAQ;AAAA,kBACR,OAAO;AAAA,kBACP,KAAK,GAAG,IAAI;AAAA,kBACZ,KAAK,WAAW,MAAM,EAAE,QAAQ,CAAC;AAAA;AAAA,cAClC;AAAA,cACA,oBAAC,OAAG,iBAAM;AAAA;AAAA;AAAA,UATL,GAAG,IAAI;AAAA,QAUb;AAAA,QAEA,cAAc,IAAI,CAAC,EAAE,MAAAA,OAAM,OAAO,MAAM;AACxC,iBACC;AAAA,YAAC;AAAA;AAAA,cAEA,WAAU;AAAA,cAEV;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACA,QAAQ;AAAA,oBACR,OAAO;AAAA,oBACP,KAAK,GAAGA,KAAI;AAAA,oBACZ,KAAK,WAAW,UAAU,IAAI,EAAE,QAAQ,CAAC;AAAA;AAAA,gBAC1C;AAAA,gBACA,oBAAC,OAAG,UAAAA,OAAK;AAAA;AAAA;AAAA,YATJ,GAAGA,KAAI;AAAA,UAUb;AAAA,QAEF,CAAC;AAAA;AAAA;AAAA,EACF;AAEF;AAEA,SAAS,YACR,EAAE,aAAa,WAAW,GAC1B,KACC;AACD,QAAM,aAAa,cAAc;AACjC,QAAM,EAAE,OAAO,MAAM,IAAI,cAAc,CAAC;AAExC,SACC,qBAAC,SAAI,KAAU,WAAU,eACxB;AAAA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO,SAAS;AAAA;AAAA,IACjB;AAAA,IACA,oBAAC,WAAQ,QAAQ,KAAK;AAAA,IACtB;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,eAAe,OAAO,iBAAiB,CAAC;AAAA,QACxC,MAAM,OAAO;AAAA;AAAA,IACd;AAAA,KACD;AAEF;AAEA,IAAO,sBAAQ,WAAW,WAAW","sourcesContent":["import { useConfig } from \"@dhis2/app-runtime\";\nimport { Divider } from \"@dhis2/ui\";\nimport React, { forwardRef } from \"react\";\nimport { getIconUrl } from \"../../../../../../utils/helpers.js\";\nimport LegendCardHeader from \"../../../LegendArea/components/LegendCardHeader/index.js\";\nimport { usePointLayer } from \"../../hooks/index.js\";\n\nfunction PointLegends({\n\torgUnitGroups,\n\ticon,\n\tlabel,\n}: {\n\torgUnitGroups: { name: string; symbol: string }[];\n\ticon?: string;\n\tlabel?: string;\n}) {\n\tconst { baseUrl } = useConfig();\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{ minWidth: 100, alignItems: \"flex-start\" }}\n\t\t\tclassName=\"w-100 p-8 legend-list column\"\n\t\t>\n\t\t\t{icon && (\n\t\t\t\t<div\n\t\t\t\t\tkey={`${icon}-legend`}\n\t\t\t\t\tclassName=\"row gap-16 align-items-center\"\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\theight={20}\n\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\talt={`${name}-icon`}\n\t\t\t\t\t\tsrc={getIconUrl(icon, { baseUrl })}\n\t\t\t\t\t/>\n\t\t\t\t\t<p>{label}</p>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{orgUnitGroups.map(({ name, symbol }) => {\n\t\t\t\treturn (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={`${name}-legend`}\n\t\t\t\t\t\tclassName=\"row gap-16 align-items-center\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\theight={20}\n\t\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\t\talt={`${name}-icon`}\n\t\t\t\t\t\t\tsrc={getIconUrl(symbol ?? \"\", { baseUrl })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<p>{name}</p>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n}\n\nfunction PointLegend(\n\t{ collapsible, onCollapse }: any,\n\tref: React.LegacyRef<HTMLDivElement>,\n) {\n\tconst pointLayer = usePointLayer();\n\tconst { label, style } = pointLayer ?? {};\n\n\treturn (\n\t\t<div ref={ref} className=\"legend-card\">\n\t\t\t<LegendCardHeader\n\t\t\t\tcollapsible={collapsible}\n\t\t\t\tonCollapse={onCollapse}\n\t\t\t\ttitle={label ?? \"Points\"}\n\t\t\t/>\n\t\t\t<Divider margin={\"0\"} />\n\t\t\t<PointLegends\n\t\t\t\tlabel={label}\n\t\t\t\torgUnitGroups={style?.orgUnitGroups ?? []}\n\t\t\t\ticon={style?.icon}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default forwardRef(PointLegend);\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { find } from 'lodash';
|
|
2
|
-
import { useMapLayers } from '../../../../MapProvider/hooks';
|
|
2
|
+
import { useMapLayers } from '../../../../MapProvider/hooks/index.js';
|
|
3
3
|
|
|
4
4
|
function usePointLayer() {
|
|
5
5
|
const { layers } = useMapLayers();
|
|
@@ -8,4 +8,4 @@ function usePointLayer() {
|
|
|
8
8
|
|
|
9
9
|
export { usePointLayer };
|
|
10
10
|
//# sourceMappingURL=out.js.map
|
|
11
|
-
//# sourceMappingURL=index.
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../src/components/Map/components/MapLayer/components/PointLayer/hooks/index.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY;AACrB,SAAS,oBAAoB;AAGtB,SAAS,gBAAgB;AAC/B,QAAM,EAAE,OAAO,IAAI,aAAa;AAChC,SAAO,KAAK,QAAQ,CAAC,QAAQ,OAAO,CAAC;AACtC","sourcesContent":["import { find } from \"lodash\";\nimport { useMapLayers } from \"../../../../MapProvider/hooks/index.js\";\nimport { CustomPointLayer } from \"../../../interfaces/index.js\";\n\nexport function usePointLayer() {\n\tconst { layers } = useMapLayers();\n\treturn find(layers, [\"type\", \"point\"]) as CustomPointLayer;\n}\n"]}
|
|
@@ -3,8 +3,8 @@ import { useConfig } from '@dhis2/app-runtime';
|
|
|
3
3
|
import i18n from '@dhis2/d2-i18n';
|
|
4
4
|
import L from 'leaflet';
|
|
5
5
|
import { LayersControl, LayerGroup, GeoJSON, Tooltip, Popup } from 'react-leaflet';
|
|
6
|
-
import { getIcon, getIconUrl } from '../../../../utils/helpers';
|
|
7
|
-
import { usePointLayer } from './hooks';
|
|
6
|
+
import { getIcon, getIconUrl } from '../../../../utils/helpers.js';
|
|
7
|
+
import { usePointLayer } from './hooks/index.js';
|
|
8
8
|
|
|
9
9
|
function PointLayer() {
|
|
10
10
|
const pointLayer = usePointLayer();
|
|
@@ -45,4 +45,4 @@ function PointLayer() {
|
|
|
45
45
|
|
|
46
46
|
export { PointLayer };
|
|
47
47
|
//# sourceMappingURL=out.js.map
|
|
48
|
-
//# sourceMappingURL=index.
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/components/Map/components/MapLayer/components/PointLayer/index.tsx"],"names":[],"mappings":"AA2BM,SAeC,KAfD;AA3BN,SAAS,iBAAiB;AAC1B,OAAO,UAAU;AACjB,OAAO,OAAO;AAEd;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,SAAS,SAAS,kBAAkB;AACpC,SAAS,qBAAqB;AAEvB,SAAS,aAAa;AAC5B,QAAM,aAAa,cAAc;AACjC,QAAM,EAAE,SAAS,OAAO,QAAQ,UAAU,MAAM,IAAI,cAAc,CAAC;AACnE,QAAM,EAAE,QAAQ,IAAI,UAAU;AAC9B,SACC;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACA,SAAS;AAAA,MACT,MAAM,SAAS,KAAK,EAAE,QAAQ;AAAA,MAE9B,8BAAC,cACC,oBAAU,IAAI,CAAC,SAAuB;AACtC,eACC;AAAA,UAAC;AAAA;AAAA,YACA,cAAc,CAAC,GAAG,gBAAgB;AACjC,qBAAO,EAAE,OAAO,aAAa;AAAA,gBAC5B,MAAM;AAAA,kBACL;AAAA,oBACC,KAAK,KAAK,QAAQ,OAAO;AAAA,oBACzB,EAAE,QAAQ;AAAA,kBACX;AAAA,gBACD;AAAA,cACD,CAAC;AAAA,YACF;AAAA,YACA,MAAM,KAAK;AAAA,YACX,aAAW;AAAA,YAGX;AAAA,kCAAC,WAAS,eAAK,MAAK;AAAA,cACpB,oBAAC,SAAM,UAAU,IAChB,8BAAC,QAAI,eAAK,MAAK,GAChB;AAAA;AAAA;AAAA,UALK,GAAG,KAAK,EAAE;AAAA,QAMhB;AAAA,MAEF,CAAC,GACF;AAAA;AAAA,EACD;AAEF","sourcesContent":["import { useConfig } from \"@dhis2/app-runtime\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport L from \"leaflet\";\nimport React from \"react\";\nimport {\n\tGeoJSON,\n\tLayerGroup,\n\tLayersControl,\n\tPopup,\n\tTooltip,\n} from \"react-leaflet\";\nimport { PointOrgUnit } from \"../../../../interfaces/index.js\";\nimport { getIcon, getIconUrl } from \"../../../../utils/helpers.js\";\nimport { usePointLayer } from \"./hooks/index.js\";\n\nexport function PointLayer() {\n\tconst pointLayer = usePointLayer();\n\tconst { enabled, label, points: orgUnits, style } = pointLayer ?? {};\n\tconst { baseUrl } = useConfig();\n\treturn (\n\t\t<LayersControl.Overlay\n\t\t\tchecked={enabled}\n\t\t\tname={label ?? i18n.t(\"Points\")}\n\t\t>\n\t\t\t<LayerGroup>\n\t\t\t\t{orgUnits?.map((area: PointOrgUnit) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<GeoJSON\n\t\t\t\t\t\t\tpointToLayer={(_, coordinates) => {\n\t\t\t\t\t\t\t\treturn L.marker(coordinates, {\n\t\t\t\t\t\t\t\t\ticon: getIcon(\n\t\t\t\t\t\t\t\t\t\tgetIconUrl(\n\t\t\t\t\t\t\t\t\t\t\tarea.icon.icon ?? style?.icon,\n\t\t\t\t\t\t\t\t\t\t\t{ baseUrl },\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdata={area.geoJSON}\n\t\t\t\t\t\t\tinteractive\n\t\t\t\t\t\t\tkey={`${area.id}-polygon`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Tooltip>{area.name}</Tooltip>\n\t\t\t\t\t\t\t<Popup minWidth={80}>\n\t\t\t\t\t\t\t\t<h3>{area.name}</h3>\n\t\t\t\t\t\t\t</Popup>\n\t\t\t\t\t\t</GeoJSON>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</LayerGroup>\n\t\t</LayersControl.Overlay>\n\t);\n}\n"]}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { guideLength, textPadding } from './Bubbles';
|
|
2
|
+
import { guideLength, textPadding } from './Bubbles.js';
|
|
3
3
|
|
|
4
|
-
const Bubble = ({
|
|
4
|
+
const Bubble = ({
|
|
5
|
+
radius,
|
|
6
|
+
maxRadius,
|
|
7
|
+
text,
|
|
8
|
+
textAlign,
|
|
9
|
+
color,
|
|
10
|
+
stroke,
|
|
11
|
+
pattern
|
|
12
|
+
}) => {
|
|
5
13
|
const leftAlign = textAlign === "left";
|
|
6
14
|
const x = maxRadius;
|
|
7
15
|
const y = maxRadius * 2 - radius;
|
|
@@ -24,8 +32,28 @@ const Bubble = ({ radius, maxRadius, text, textAlign, color, stroke, pattern })
|
|
|
24
32
|
}
|
|
25
33
|
),
|
|
26
34
|
text && /* @__PURE__ */ jsxs("g", { children: [
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
28
|
-
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
"line",
|
|
37
|
+
{
|
|
38
|
+
x1: x,
|
|
39
|
+
x2,
|
|
40
|
+
y1: y2,
|
|
41
|
+
y2,
|
|
42
|
+
stroke: "black",
|
|
43
|
+
style: { strokeDasharray: "2, 2", strokeWidth: 0.5 }
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
"text",
|
|
48
|
+
{
|
|
49
|
+
x: textX,
|
|
50
|
+
y: y2,
|
|
51
|
+
textAnchor,
|
|
52
|
+
alignmentBaseline: "middle",
|
|
53
|
+
style: { fontSize: 12 },
|
|
54
|
+
children: text
|
|
55
|
+
}
|
|
56
|
+
)
|
|
29
57
|
] })
|
|
30
58
|
] });
|
|
31
59
|
};
|
|
@@ -33,4 +61,4 @@ var Bubble_default = Bubble;
|
|
|
33
61
|
|
|
34
62
|
export { Bubble_default as default };
|
|
35
63
|
//# sourceMappingURL=out.js.map
|
|
36
|
-
//# sourceMappingURL=Bubble.
|
|
64
|
+
//# sourceMappingURL=Bubble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.tsx"],"names":[],"mappings":"AAmCG,cAWC,YAXD;AAlCH,SAAS,aAAa,mBAAmB;AAazC,MAAM,SAAS,CAAC;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAmB;AAClB,QAAM,YAAY,cAAc;AAChC,QAAM,IAAI;AACV,QAAM,IAAI,YAAY,IAAI;AAC1B,QAAM,KAAK,YACR,IAAI,YAAY,cAChB,IAAI,YAAY;AACnB,QAAM,KAAK,YAAY,IAAI,SAAS;AACpC,QAAM,QAAQ,MAAM,YAAY,CAAC,cAAc;AAC/C,QAAM,aAAa,YAAY,QAAQ;AAEvC,SACC,qBAAC,OACA;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,GAAG;AAAA,QACH,QAAQ,UAAU;AAAA,QAClB,OAAO;AAAA,UACN,MAAM,UAAU,QAAQ,OAAO,MAAM,SAAS;AAAA,UAC9C,aAAa;AAAA,QACd;AAAA;AAAA,IACD;AAAA,IACC,QACA,qBAAC,OACA;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,IAAI;AAAA,UACJ;AAAA,UACA,IAAI;AAAA,UACJ;AAAA,UACA,QAAO;AAAA,UACP,OAAO,EAAE,iBAAiB,QAAQ,aAAa,IAAI;AAAA;AAAA,MACpD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,GAAG;AAAA,UACH,GAAG;AAAA,UACH;AAAA,UACA,mBAAkB;AAAA,UAClB,OAAO,EAAE,UAAU,GAAG;AAAA,UAErB;AAAA;AAAA,MACF;AAAA,OACD;AAAA,KAEF;AAEF;AAEA,IAAO,iBAAQ","sourcesContent":["import React from \"react\";\nimport { guideLength, textPadding } from \"./Bubbles.js\";\n\nexport interface BubbleProps {\n\tradius: number;\n\tmaxRadius: number;\n\ttext?: string;\n\ttextAlign?: \"left\" | \"right\";\n\tcolor?: string;\n\tstroke?: string;\n\tpattern?: string;\n\tgap?: number;\n}\n\nconst Bubble = ({\n\tradius,\n\tmaxRadius,\n\ttext,\n\ttextAlign,\n\tcolor,\n\tstroke,\n\tpattern,\n}: BubbleProps) => {\n\tconst leftAlign = textAlign === \"left\";\n\tconst x = maxRadius;\n\tconst y = maxRadius * 2 - radius;\n\tconst x2 = leftAlign\n\t\t? x - maxRadius - guideLength\n\t\t: x + maxRadius + guideLength;\n\tconst y2 = maxRadius * 2 - radius * 2;\n\tconst textX = x2 + (leftAlign ? -textPadding : textPadding);\n\tconst textAnchor = leftAlign ? \"end\" : \"start\";\n\n\treturn (\n\t\t<g>\n\t\t\t<circle\n\t\t\t\tcx={x}\n\t\t\t\tcy={y}\n\t\t\t\tr={radius}\n\t\t\t\tstroke={stroke || \"#000\"}\n\t\t\t\tstyle={{\n\t\t\t\t\tfill: pattern ? `url(#${pattern})` : color || \"none\",\n\t\t\t\t\tstrokeWidth: 0.5,\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t{text && (\n\t\t\t\t<g>\n\t\t\t\t\t<line\n\t\t\t\t\t\tx1={x}\n\t\t\t\t\t\tx2={x2}\n\t\t\t\t\t\ty1={y2}\n\t\t\t\t\t\ty2={y2}\n\t\t\t\t\t\tstroke=\"black\"\n\t\t\t\t\t\tstyle={{ strokeDasharray: \"2, 2\", strokeWidth: 0.5 }}\n\t\t\t\t\t/>\n\t\t\t\t\t<text\n\t\t\t\t\t\tx={textX}\n\t\t\t\t\t\ty={y2}\n\t\t\t\t\t\ttextAnchor={textAnchor}\n\t\t\t\t\t\talignmentBaseline=\"middle\"\n\t\t\t\t\t\tstyle={{ fontSize: 12 }}\n\t\t\t\t\t>\n\t\t\t\t\t\t{text}\n\t\t\t\t\t</text>\n\t\t\t\t</g>\n\t\t\t)}\n\t\t</g>\n\t);\n};\n\nexport default Bubble;\n"]}
|
|
@@ -3,9 +3,9 @@ import i18n from '@dhis2/d2-i18n';
|
|
|
3
3
|
import { scaleSqrt } from 'd3-scale';
|
|
4
4
|
import { reduce } from 'lodash';
|
|
5
5
|
import { memo } from 'react';
|
|
6
|
-
import { getContrastColor } from '../../../../../../../../../utils/colors';
|
|
7
|
-
import { getLongestTextLength } from '../../../../../../../../../utils/helpers';
|
|
8
|
-
import Bubble from './Bubble';
|
|
6
|
+
import { getContrastColor } from '../../../../../../../../../utils/colors.js';
|
|
7
|
+
import { getLongestTextLength } from '../../../../../../../../../utils/helpers.js';
|
|
8
|
+
import Bubble from './Bubble.js';
|
|
9
9
|
|
|
10
10
|
const style = {
|
|
11
11
|
paddingTop: 10,
|
|
@@ -17,7 +17,12 @@ const legendWidth = 200;
|
|
|
17
17
|
const digitWidth = 6.8;
|
|
18
18
|
const guideLength = 16;
|
|
19
19
|
const textPadding = 4;
|
|
20
|
-
const Bubbles = ({
|
|
20
|
+
const Bubbles = ({
|
|
21
|
+
radiusLow,
|
|
22
|
+
radiusHigh,
|
|
23
|
+
color,
|
|
24
|
+
classes
|
|
25
|
+
}) => {
|
|
21
26
|
const height = radiusHigh * 2 + 4;
|
|
22
27
|
const scale = scaleSqrt().range([radiusLow, radiusHigh]);
|
|
23
28
|
const radiusMid = scale(0.5);
|
|
@@ -66,7 +71,12 @@ const Bubbles = ({ radiusLow, radiusHigh, color, classes }) => {
|
|
|
66
71
|
}
|
|
67
72
|
];
|
|
68
73
|
}
|
|
69
|
-
let textLength = Math.ceil(
|
|
74
|
+
let textLength = Math.ceil(
|
|
75
|
+
Math.max(
|
|
76
|
+
getLongestTextLength(classes, "startValue"),
|
|
77
|
+
getLongestTextLength(classes, "endValue")
|
|
78
|
+
) * digitWidth
|
|
79
|
+
);
|
|
70
80
|
const alternateLength = (radiusHigh + guideLength + textPadding + textLength) * 2;
|
|
71
81
|
let smallestGap = reduce(bubbles, (prev, curr, i) => {
|
|
72
82
|
const gap = prev.radius - curr.radius;
|
|
@@ -91,7 +101,9 @@ const Bubbles = ({ radiusLow, radiusHigh, color, classes }) => {
|
|
|
91
101
|
}
|
|
92
102
|
if (gap > 15) {
|
|
93
103
|
const midRadius = minBubble.radius + gap / 2;
|
|
94
|
-
const midBubble = bubbles.reduce(
|
|
104
|
+
const midBubble = bubbles.reduce(
|
|
105
|
+
(prev, curr) => curr.radius >= midRadius && curr.radius - midRadius < prev.radius - midRadius ? curr : prev
|
|
106
|
+
);
|
|
95
107
|
showNumbers.push(bubbles.indexOf(midBubble));
|
|
96
108
|
}
|
|
97
109
|
bubbles.forEach((b, i) => {
|
|
@@ -102,10 +114,17 @@ const Bubbles = ({ radiusLow, radiusHigh, color, classes }) => {
|
|
|
102
114
|
}
|
|
103
115
|
textLength = Math.ceil(getLongestTextLength(bubbles, "text") * digitWidth);
|
|
104
116
|
const offset = textLength + guideLength + textPadding;
|
|
105
|
-
return /* @__PURE__ */ jsx("div", { style, children: /* @__PURE__ */ jsx("svg", { width: legendWidth, height: height + 50, children: /* @__PURE__ */ jsx("g", { transform: `translate(${alternate ? offset : "16"} 24)`, children: bubbles.map((bubble, i) => /* @__PURE__ */ jsx(
|
|
117
|
+
return /* @__PURE__ */ jsx("div", { style, children: /* @__PURE__ */ jsx("svg", { width: legendWidth, height: height + 50, children: /* @__PURE__ */ jsx("g", { transform: `translate(${alternate ? offset : "16"} 24)`, children: bubbles.map((bubble, i) => /* @__PURE__ */ jsx(
|
|
118
|
+
Bubble,
|
|
119
|
+
{
|
|
120
|
+
...bubble,
|
|
121
|
+
textAlign: alternate && i % 2 == 0 ? "left" : "right"
|
|
122
|
+
},
|
|
123
|
+
i
|
|
124
|
+
)) }) }) });
|
|
106
125
|
};
|
|
107
126
|
var Bubbles_default = memo(Bubbles);
|
|
108
127
|
|
|
109
128
|
export { Bubbles_default as default, guideLength, textPadding };
|
|
110
129
|
//# sourceMappingURL=out.js.map
|
|
111
|
-
//# sourceMappingURL=Bubbles.
|
|
130
|
+
//# sourceMappingURL=Bubbles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.tsx"],"names":["smallestGap"],"mappings":"AAmKM;AAnKN,OAAO,UAAU;AACjB,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAgB,YAAY;AAC5B,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AACrC,OAAO,YAA6B;AAEpC,MAAM,QAAQ;AAAA,EACb,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,gBAAgB;AACjB;AAEA,MAAM,cAAc;AACpB,MAAM,aAAa;AACZ,MAAM,cAAc;AACpB,MAAM,cAAc;AAE3B,MAAM,UAAU,CAAC;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAKM;AACL,QAAM,SAAS,aAAa,IAAI;AAChC,QAAM,QAAQ,UAAU,EAAE,MAAM,CAAC,WAAW,UAAU,CAAC;AACvD,QAAM,YAAY,MAAM,GAAG;AAE3B,MAAI,MAAM,SAAS,KAAK,MAAM,UAAU,GAAG;AAC1C,WAAO;AAAA,EACR;AAEA,MAAI,UAA8B,CAAC;AAGnC,MAAI,MAAM,QAAQ,OAAO,KAAK,QAAQ,QAAQ;AAC7C,UAAM,aAAa,QAAQ,CAAC,EAAE;AAC9B,UAAM,WAA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F;AAEA,IAAO,kBAAQ,KAAK,OAAO","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { scaleSqrt } from \"d3-scale\";\nimport { reduce } from \"lodash\";\nimport React, { memo } from \"react\";\nimport { getContrastColor } from \"../../../../../../../../../utils/colors.js\";\nimport { getLongestTextLength } from \"../../../../../../../../../utils/helpers.js\";\nimport Bubble, { BubbleProps } from \"./Bubble.js\";\n\nconst style = {\n\tpaddingTop: 10,\n\tdisplay: \"flex\",\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n};\n\nconst legendWidth = 200;\nconst digitWidth = 6.8;\nexport const guideLength = 16;\nexport const textPadding = 4;\n\nconst Bubbles = ({\n\tradiusLow,\n\tradiusHigh,\n\tcolor,\n\tclasses,\n}: {\n\tradiusLow: number;\n\tradiusHigh: number;\n\tcolor?: string;\n\tclasses: Array<any>;\n}) => {\n\tconst height = radiusHigh * 2 + 4;\n\tconst scale = scaleSqrt().range([radiusLow, radiusHigh]);\n\tconst radiusMid = scale(0.5);\n\n\tif (isNaN(radiusLow) || isNaN(radiusHigh)) {\n\t\treturn null;\n\t}\n\n\tlet bubbles: Array<BubbleProps> = [];\n\n\t// If color legend\n\tif (Array.isArray(classes) && classes.length) {\n\t\tconst startValue = classes[0].startValue;\n\t\tconst endValue = classes[classes.length - 1].endValue;\n\t\tconst itemScale = scale.domain([startValue, endValue]);\n\n\t\tbubbles = [...classes].reverse().map((c) => ({\n\t\t\tradius: itemScale(c.endValue),\n\t\t\tmaxRadius: radiusHigh,\n\t\t\tcolor: c.color,\n\t\t\ttext: String(c.endValue),\n\t\t}));\n\n\t\t// Add the smallest bubble for the lowest value\n\t\tbubbles.push({\n\t\t\tradius: itemScale(startValue),\n\t\t\tmaxRadius: radiusHigh,\n\t\t\ttext: String(startValue),\n\t\t});\n\t} else {\n\t\t// If single color\n\t\tconst stroke = color && getContrastColor(color);\n\n\t\tbubbles = [\n\t\t\t{\n\t\t\t\tradius: radiusHigh,\n\t\t\t\tmaxRadius: radiusHigh,\n\t\t\t\tcolor,\n\t\t\t\tstroke,\n\t\t\t\ttext: i18n.t(\"Max\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tradius: radiusMid,\n\t\t\t\tmaxRadius: radiusHigh,\n\t\t\t\tcolor,\n\t\t\t\tstroke,\n\t\t\t\ttext: i18n.t(\"Mid\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tradius: radiusLow,\n\t\t\t\tmaxRadius: radiusHigh,\n\t\t\t\tcolor,\n\t\t\t\tstroke,\n\t\t\t\ttext: i18n.t(\"Min\"),\n\t\t\t},\n\t\t];\n\t}\n\n\t// Calculate the pixel length of the longest number\n\tlet textLength = Math.ceil(\n\t\tMath.max(\n\t\t\tgetLongestTextLength(classes, \"startValue\"),\n\t\t\tgetLongestTextLength(classes, \"endValue\"),\n\t\t) * digitWidth,\n\t);\n\n\t// Calculate the total length if numbers are alternate on each side\n\tconst alternateLength =\n\t\t(radiusHigh + guideLength + textPadding + textLength) * 2;\n\n\tlet smallestGap = reduce(bubbles, (prev, curr: any, i) => {\n\t\tconst gap = prev.radius - curr.radius;\n\t\tconst smallestGap =\n\t\t\tprev.gap === undefined || gap < prev.gap ? gap : prev.gap;\n\n\t\treturn i === bubbles.length - 1\n\t\t\t? Math.round(smallestGap * 2)\n\t\t\t: {\n\t\t\t\t\tradius: curr.radius,\n\t\t\t\t\tgap: smallestGap,\n\t\t\t\t};\n\t});\n\n\tconst alternateFit = alternateLength < legendWidth;\n\n\tconst alternate = alternateFit && smallestGap > 5 && smallestGap < 12;\n\n\tif (!alternateFit) {\n\t\tsmallestGap = smallestGap / 2;\n\t}\n\n\t// Too cramped to show number for each bubble\n\tif (smallestGap < 4) {\n\t\tconst [maxBubble] = bubbles;\n\t\tconst minBubble = bubbles[bubbles.length - 1];\n\t\tconst gap = maxBubble.radius - minBubble.radius;\n\t\tconst showNumbers = [0]; // Always show the largest number\n\n\t\tif (gap > 4) {\n\t\t\tshowNumbers.push(bubbles.length - 1);\n\t\t}\n\n\t\tif (gap > 15) {\n\t\t\tconst midRadius = minBubble.radius + gap / 2;\n\n\t\t\t// Find the closest bubble above the mid-radius\n\t\t\tconst midBubble = bubbles.reduce((prev, curr) =>\n\t\t\t\tcurr.radius >= midRadius &&\n\t\t\t\tcurr.radius - midRadius < prev.radius - midRadius\n\t\t\t\t\t? curr\n\t\t\t\t\t: prev,\n\t\t\t);\n\n\t\t\tshowNumbers.push(bubbles.indexOf(midBubble));\n\t\t}\n\n\t\tbubbles.forEach((b, i) => {\n\t\t\tif (!showNumbers.includes(i)) {\n\t\t\t\tdelete b.text;\n\t\t\t}\n\t\t});\n\t}\n\n\ttextLength = Math.ceil(getLongestTextLength(bubbles, \"text\") * digitWidth);\n\n\tconst offset = textLength + guideLength + textPadding;\n\n\treturn (\n\t\t<div style={style}>\n\t\t\t<svg width={legendWidth} height={height + 50}>\n\t\t\t\t<g transform={`translate(${alternate ? offset : \"16\"} 24)`}>\n\t\t\t\t\t{bubbles.map((bubble, i) => (\n\t\t\t\t\t\t<Bubble\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\t{...bubble}\n\t\t\t\t\t\t\ttextAlign={\n\t\t\t\t\t\t\t\talternate && i % 2 == 0 ? \"left\" : \"right\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</g>\n\t\t\t</svg>\n\t\t</div>\n\t);\n};\n\nexport default memo(Bubbles);\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Divider } from '@dhis2/ui';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import LegendCardHeader from '../../../../../LegendArea/components/LegendCardHeader';
|
|
5
|
-
import Bubbles from './components/Bubbles';
|
|
4
|
+
import LegendCardHeader from '../../../../../LegendArea/components/LegendCardHeader/index.js';
|
|
5
|
+
import Bubbles from './components/Bubbles.js';
|
|
6
6
|
|
|
7
7
|
function BubbleLegend({
|
|
8
8
|
radius,
|
|
@@ -38,4 +38,4 @@ var BubbleLegend_default = forwardRef(BubbleLegend);
|
|
|
38
38
|
|
|
39
39
|
export { BubbleLegend_default as default };
|
|
40
40
|
//# sourceMappingURL=out.js.map
|
|
41
|
-
//# sourceMappingURL=index.
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.tsx"],"names":[],"mappings":"AA+BE,SACC,KADD;AA/BF,SAAS,eAAe;AAExB,SAAgB,kBAAkB;AAKlC,OAAO,sBAAsB;AAC7B,OAAO,aAAa;AAEpB,SAAS,aACR;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GASA,KACC;AACD,SACC,qBAAC,SAAI,WAAU,eAAc,KAC5B;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAO,SAAS;AAAA,QAChB;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA,oBAAC,WAAQ,QAAQ,KAAK;AAAA,IACtB,oBAAC,SAAI,WAAU,oBACd;AAAA,MAAC;AAAA;AAAA,QACA,SAAS,QAAQ,QAAQ;AAAA,QACzB,YAAY,OAAO;AAAA,QACnB,WAAW,OAAO;AAAA,QAClB,OAAO;AAAA;AAAA,IACR,GACD;AAAA,KACD;AAEF;AAEA,IAAO,uBAAQ,WAAW,YAAY","sourcesContent":["import { Divider } from \"@dhis2/ui\";\nimport type { Legend } from \"@hisptz/dhis2-utils\";\nimport React, { forwardRef } from \"react\";\nimport {\n\tThematicLayerData,\n\tThematicLayerDataItem,\n} from \"../../../../../../interfaces/index.js\";\nimport LegendCardHeader from \"../../../../../LegendArea/components/LegendCardHeader/index.js\";\nimport Bubbles from \"./components/Bubbles.js\";\n\nfunction BubbleLegend(\n\t{\n\t\tradius,\n\t\tdataItem,\n\t\tdata,\n\t\tname,\n\t\tcollapsible,\n\t\tonCollapse,\n\t\tlegends,\n\t}: {\n\t\tradius: { min: number; max: number };\n\t\tdataItem: ThematicLayerDataItem;\n\t\tdata: ThematicLayerData[];\n\t\tname?: string;\n\t\tcollapsible?: boolean;\n\t\tonCollapse?: () => void;\n\t\tlegends: Legend[];\n\t},\n\tref: React.LegacyRef<HTMLDivElement> | undefined,\n) {\n\treturn (\n\t\t<div className=\"legend-card\" ref={ref}>\n\t\t\t<LegendCardHeader\n\t\t\t\ttitle={dataItem.displayName}\n\t\t\t\tonCollapse={onCollapse}\n\t\t\t\tcollapsible={collapsible}\n\t\t\t/>\n\t\t\t<Divider margin={\"0\"} />\n\t\t\t<div className=\"legend-list pt-8\">\n\t\t\t\t<Bubbles\n\t\t\t\t\tclasses={legends.reverse()}\n\t\t\t\t\tradiusHigh={radius.max}\n\t\t\t\t\tradiusLow={radius.min}\n\t\t\t\t\tcolor={\"#FF0000\"}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default forwardRef(BubbleLegend);\n"]}
|
|
@@ -3,8 +3,8 @@ import { colors } from '@dhis2/ui';
|
|
|
3
3
|
import { geoJSON } from 'leaflet';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { CircleMarker } from 'react-leaflet';
|
|
6
|
-
import { highlightFeature, resetHighlight, getColorFromLegendSet } from '../../../../../../utils/map';
|
|
7
|
-
import CustomTooltip from '../CustomTooltip';
|
|
6
|
+
import { highlightFeature, resetHighlight, getColorFromLegendSet } from '../../../../../../utils/map.js';
|
|
7
|
+
import CustomTooltip from '../CustomTooltip/index.js';
|
|
8
8
|
|
|
9
9
|
const defaultStyle = {
|
|
10
10
|
weight: 1
|
|
@@ -47,4 +47,4 @@ function Bubble({
|
|
|
47
47
|
|
|
48
48
|
export { Bubble as default };
|
|
49
49
|
//# sourceMappingURL=out.js.map
|
|
50
|
-
//# sourceMappingURL=index.
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.tsx"],"names":[],"mappings":"AAyCE,mBAgBE,WAhBF;AAzCF,SAAS,cAAc;AAEvB,SAAS,eAAe;AACxB,SAAgB,eAAe;AAC/B,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,OAAO,mBAAmB;AAE1B,MAAM,eAAe;AAAA,EACpB,QAAQ;AACT;AACA,MAAM,iBAAiB;AAAA,EACtB,QAAQ;AACT;AAEe,SAAR,OAAwB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAKG;AACF,QAAM,EAAE,SAAS,MAAM,MAAM,IAAI,QAAQ,CAAC;AAE1C,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,SAAS,QAAQ,aAAa,EAAE,UAAU,EAAE,UAAU;AAE5D,QAAM,eAAe,QAAQ,MAAM;AAClC,YAAS,SAAS,MAAM,QAAQ,OAAO,MAAO;AAAA,EAC/C,GAAG,CAAC,QAAQ,MAAM,WAAW,CAAC;AAE9B,SACC,gCACC;AAAA,IAAC;AAAA;AAAA,MACA,aAAW;AAAA,MACX,eAAe;AAAA,QACd,WAAW,CAAC,MAAM,iBAAiB,GAAG,cAAc;AAAA,QACpD,UAAU,CAAC,MAAM,eAAe,GAAG,YAAY;AAAA,MAChD;AAAA,MACA,aAAa;AAAA,QACZ,WAAW,sBAAsB,SAAS,KAAK,IAAI;AAAA,QACnD,aAAa;AAAA,QACb,OAAO,OAAO;AAAA,QACd,QAAQ;AAAA,MACT;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MAEA,8BAAC,iBAAc,MAAY;AAAA;AAAA,EAC5B,GACD;AAEF","sourcesContent":["import { colors } from \"@dhis2/ui\";\nimport type { Legend } from \"@hisptz/dhis2-utils\";\nimport { geoJSON } from \"leaflet\";\nimport React, { useMemo } from \"react\";\nimport { CircleMarker } from \"react-leaflet\";\nimport {\n\tgetColorFromLegendSet,\n\thighlightFeature,\n\tresetHighlight,\n} from \"../../../../../../utils/map.js\";\nimport { ThematicLayerData } from \"../../../../interfaces/index.js\";\nimport CustomTooltip from \"../CustomTooltip/index.js\";\n\nconst defaultStyle = {\n\tweight: 1,\n};\nconst highlightStyle = {\n\tweight: 2,\n};\n\nexport default function Bubble({\n\tdata,\n\thighestData,\n\tlegends,\n\tradius,\n}: {\n\tdata: ThematicLayerData;\n\thighestData: number;\n\tlegends: Legend[];\n\tradius?: { min: number; max: number };\n}) {\n\tconst { orgUnit, data: value } = data ?? {};\n\n\tconst geoJSONObject = orgUnit.geoJSON;\n\tconst center = geoJSON(geoJSONObject).getBounds().getCenter();\n\n\tconst circleRadius = useMemo(() => {\n\t\treturn ((value ?? 0) * (radius?.max ?? 50)) / highestData;\n\t}, [radius, data, highestData]);\n\n\treturn (\n\t\t<>\n\t\t\t<CircleMarker\n\t\t\t\tinteractive\n\t\t\t\teventHandlers={{\n\t\t\t\t\tmouseover: (e) => highlightFeature(e, highlightStyle),\n\t\t\t\t\tmouseout: (e) => resetHighlight(e, defaultStyle),\n\t\t\t\t}}\n\t\t\t\tpathOptions={{\n\t\t\t\t\tfillColor: getColorFromLegendSet(legends, data.data),\n\t\t\t\t\tfillOpacity: 1,\n\t\t\t\t\tcolor: colors.grey900,\n\t\t\t\t\tweight: 1,\n\t\t\t\t}}\n\t\t\t\tradius={circleRadius}\n\t\t\t\tcenter={center}\n\t\t\t>\n\t\t\t\t<CustomTooltip data={data} />\n\t\t\t</CircleMarker>\n\t\t</>\n\t);\n}\n"]}
|