@hisptz/dhis2-analytics 2.0.0-alpha.0 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.js +20 -43
- package/dist/components/ChartAnalytics/DHIS2Chart.js +17 -43
- package/dist/components/ChartAnalytics/DHIS2Chart.js.map +1 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +14 -16
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +8 -14
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.js +19 -21
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +0 -1
- package/dist/components/ChartAnalytics/hooks/useChart.js +11 -13
- package/dist/components/ChartAnalytics/hooks/useChart.js.map +1 -1
- package/dist/components/ChartAnalytics/index.js +1 -12
- package/dist/components/ChartAnalytics/index.js.map +1 -1
- package/dist/components/ChartAnalytics/models/bar.js +3 -6
- package/dist/components/ChartAnalytics/models/bar.js.map +1 -1
- package/dist/components/ChartAnalytics/models/column.js +6 -9
- package/dist/components/ChartAnalytics/models/column.js.map +1 -1
- package/dist/components/ChartAnalytics/models/index.js +1 -6
- package/dist/components/ChartAnalytics/models/index.js.map +1 -1
- package/dist/components/ChartAnalytics/models/line.js +6 -8
- package/dist/components/ChartAnalytics/models/line.js.map +1 -1
- package/dist/components/ChartAnalytics/models/multi-series.js +26 -15
- package/dist/components/ChartAnalytics/models/multi-series.js.map +1 -1
- package/dist/components/ChartAnalytics/models/pie.js +8 -8
- package/dist/components/ChartAnalytics/models/pie.js.map +1 -1
- package/dist/components/ChartAnalytics/services/export.js +7 -20
- 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/types/props.js +0 -1
- package/dist/components/ChartAnalytics/utils/chart.js +24 -31
- package/dist/components/ChartAnalytics/utils/chart.js.map +1 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js +14 -23
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +3 -10
- package/dist/components/CircularProgressDashboard/index.js +2 -19
- package/dist/components/CircularProgressDashboard/index.js.map +1 -1
- package/dist/components/CircularProgressDashboard/types/props.js +0 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js +13 -15
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.js +5 -14
- package/dist/components/DHIS2PivotTable/components/Table/index.js +4 -6
- package/dist/components/DHIS2PivotTable/components/TableBody/index.js +30 -36
- package/dist/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js +27 -33
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/index.js +2 -19
- package/dist/components/DHIS2PivotTable/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/interfaces/index.js +0 -1
- package/dist/components/DHIS2PivotTable/services/engine.js +10 -18
- package/dist/components/DHIS2PivotTable/services/engine.js.map +1 -1
- package/dist/components/DHIS2PivotTable/state/engine.js +6 -9
- package/dist/components/DHIS2PivotTable/state/engine.js.map +1 -1
- package/dist/components/Map/DHIS2Map.js +13 -20
- package/dist/components/Map/DHIS2Map.js.map +1 -1
- package/dist/components/Map/DHIS2Map.stories.js +3 -17
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js +15 -21
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +10 -15
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js +16 -18
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +7 -12
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js +24 -30
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js +42 -49
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js +16 -22
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js +26 -32
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js +10 -16
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js +21 -27
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +16 -19
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js +2 -19
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -1
- package/dist/components/Map/components/MapArea/index.js +60 -54
- package/dist/components/Map/components/MapArea/index.js.map +1 -1
- package/dist/components/Map/components/MapArea/interfaces/index.js +0 -1
- package/dist/components/Map/components/MapControls/components/CustomControl/index.js +3 -5
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.js +8 -14
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.js +7 -9
- package/dist/components/Map/components/MapControls/index.js +22 -17
- package/dist/components/Map/components/MapControls/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +3 -5
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js +21 -31
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +59 -34
- 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 +99 -89
- 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 +9 -14
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +62 -69
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31466 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +43 -43
- 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 +34 -31
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +6 -8
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.js +46 -57
- 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 +38 -30
- 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 +5 -7
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.js +21 -28
- 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 +39 -13
- 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 +40 -32
- 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 +13 -20
- 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 +17 -23
- 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 +30 -25
- 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 +17 -20
- 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 +15 -21
- 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 +6 -8
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js +16 -24
- 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 +10 -18
- package/dist/components/Map/components/MapLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/interfaces/index.js +7 -4
- package/dist/components/Map/components/MapLayer/interfaces/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +59 -63
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js +30 -36
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/hooks/index.js +6 -10
- package/dist/components/Map/components/MapProvider/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/index.js +25 -31
- package/dist/components/Map/components/MapProvider/index.js.map +1 -1
- package/dist/components/Map/components/MapUpdater/index.js +5 -7
- package/dist/components/Map/components/MapUpdater/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js +15 -21
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +5 -10
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js +53 -60
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +7 -12
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +21 -15
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js +1 -4
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +22 -30
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +18 -21
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +23 -30
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +16 -22
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +16 -22
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js +16 -22
- package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.js +18 -24
- package/dist/components/Map/components/ThematicLayerConfiguration/index.js +3 -26
- package/dist/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/types/index.js +0 -1
- package/dist/components/Map/constants/colors.js +1 -4
- package/dist/components/Map/constants/legendSet.js +1 -3
- package/dist/components/Map/hooks/map.js +17 -21
- package/dist/components/Map/hooks/map.js.map +1 -1
- package/dist/components/Map/index.js +5 -40
- package/dist/components/Map/index.js.map +1 -1
- package/dist/components/Map/interfaces/index.js +0 -1
- package/dist/components/Map/state/index.js +5 -9
- package/dist/components/Map/state/index.js.map +1 -1
- package/dist/components/Map/utils/colors.js +18 -22
- package/dist/components/Map/utils/colors.js.map +1 -1
- package/dist/components/Map/utils/helpers.js +3 -11
- package/dist/components/Map/utils/map.js +25 -24
- package/dist/components/Map/utils/map.js.map +1 -1
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.js +3 -11
- package/dist/components/SingleValueContainer/SingleValueVisualizer.js +17 -35
- package/dist/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +14 -21
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +7 -13
- package/dist/components/SingleValueContainer/index.js +3 -19
- package/dist/components/SingleValueContainer/index.js.map +1 -1
- package/dist/components/SingleValueContainer/types/props.js +0 -1
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.js +50 -26
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/DimensionsProvider/index.js +13 -18
- package/dist/components/Visualization/components/LayoutProvider/index.js +11 -14
- package/dist/components/Visualization/components/LayoutProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js +30 -36
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationProvider/index.js +14 -10
- package/dist/components/Visualization/components/VisualizationProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationSelector/index.js +46 -57
- package/dist/components/Visualization/components/VisualizationSelector/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.js +16 -19
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.js +37 -27
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -1
- package/dist/components/Visualization/index.js +27 -33
- package/dist/components/Visualization/index.js.map +1 -1
- package/dist/index.js +6 -47
- 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 -4
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.mjs +0 -254
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.mjs.map +0 -1
- package/dist/components/ChartAnalytics/DHIS2Chart.mjs +0 -36
- package/dist/components/ChartAnalytics/DHIS2Chart.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs +0 -52
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs +0 -42
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.mjs +0 -65
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs +0 -3
- package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs.map +0 -1
- package/dist/components/ChartAnalytics/hooks/useChart.mjs +0 -43
- 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 +0 -21
- package/dist/components/ChartAnalytics/models/bar.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/column.mjs +0 -48
- package/dist/components/ChartAnalytics/models/column.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/index.mjs +0 -117
- package/dist/components/ChartAnalytics/models/index.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/line.mjs +0 -31
- package/dist/components/ChartAnalytics/models/line.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/multi-series.mjs +0 -99
- package/dist/components/ChartAnalytics/models/multi-series.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/pie.mjs +0 -51
- package/dist/components/ChartAnalytics/models/pie.mjs.map +0 -1
- package/dist/components/ChartAnalytics/services/export.mjs +0 -35
- package/dist/components/ChartAnalytics/services/export.mjs.map +0 -1
- package/dist/components/ChartAnalytics/types/props.mjs +0 -3
- package/dist/components/ChartAnalytics/types/props.mjs.map +0 -1
- package/dist/components/ChartAnalytics/utils/chart.mjs +0 -130
- package/dist/components/ChartAnalytics/utils/chart.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.mjs +0 -66
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.mjs +0 -42
- 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/CircularProgressDashboard/types/props.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.mjs +0 -26
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs +0 -30
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/components/Table/index.mjs +0 -10
- package/dist/components/DHIS2PivotTable/components/Table/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/components/TableBody/index.mjs +0 -106
- package/dist/components/DHIS2PivotTable/components/TableBody/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.mjs +0 -94
- 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/interfaces/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/services/engine.mjs +0 -93
- package/dist/components/DHIS2PivotTable/services/engine.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/state/engine.mjs +0 -17
- package/dist/components/DHIS2PivotTable/state/engine.mjs.map +0 -1
- package/dist/components/Map/DHIS2Map.mjs +0 -65
- package/dist/components/Map/DHIS2Map.mjs.map +0 -1
- package/dist/components/Map/DHIS2Map.stories.mjs +0 -366
- package/dist/components/Map/DHIS2Map.stories.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs +0 -41
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs +0 -34
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs +0 -26
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs +0 -21
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs +0 -67
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs +0 -134
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs +0 -44
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs +0 -67
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs +0 -24
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs +0 -67
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.mjs +0 -45
- 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 +0 -85
- 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/MapArea/interfaces/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/components/CustomControl/index.mjs +0 -16
- package/dist/components/Map/components/MapControls/components/CustomControl/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.mjs +0 -15
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.mjs +0 -13
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/index.mjs +0 -23
- package/dist/components/Map/components/MapControls/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs +0 -10
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.mjs +0 -52
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.mjs +0 -65
- 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 +0 -439
- 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 +0 -32
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.mjs +0 -197
- 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/interfaces/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.mjs +0 -359
- 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 +0 -82
- 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 +0 -17
- 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 +0 -179
- 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 +0 -78
- 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 +0 -11
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.mjs +0 -48
- 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 +0 -36
- 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 +0 -111
- 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 +0 -41
- 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 +0 -50
- 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 +0 -42
- 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 +0 -37
- 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 +0 -40
- 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 +0 -12
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.mjs +0 -55
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/index.mjs +0 -32
- 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 +0 -405
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.mjs +0 -115
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/hooks/index.mjs +0 -16
- package/dist/components/Map/components/MapProvider/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/index.mjs +0 -95
- package/dist/components/Map/components/MapProvider/index.mjs.map +0 -1
- package/dist/components/Map/components/MapUpdater/index.mjs +0 -11
- package/dist/components/Map/components/MapUpdater/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs +0 -41
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs +0 -24
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs +0 -174
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs +0 -21
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.mjs +0 -24
- 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 +0 -436
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs +0 -71
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs +0 -74
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs +0 -57
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs +0 -44
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs +0 -60
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs +0 -54
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.mjs +0 -63
- 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/components/ThematicLayerConfiguration/types/index.mjs.map +0 -1
- package/dist/components/Map/constants/colors.mjs +0 -436
- package/dist/components/Map/constants/colors.mjs.map +0 -1
- package/dist/components/Map/constants/legendSet.mjs +0 -23
- package/dist/components/Map/constants/legendSet.mjs.map +0 -1
- package/dist/components/Map/hooks/map.mjs +0 -44
- 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/interfaces/index.mjs.map +0 -1
- package/dist/components/Map/state/index.mjs +0 -18
- package/dist/components/Map/state/index.mjs.map +0 -1
- package/dist/components/Map/utils/colors.mjs +0 -77
- package/dist/components/Map/utils/colors.mjs.map +0 -1
- package/dist/components/Map/utils/helpers.mjs +0 -18
- package/dist/components/Map/utils/helpers.mjs.map +0 -1
- package/dist/components/Map/utils/map.mjs +0 -127
- package/dist/components/Map/utils/map.mjs.map +0 -1
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.mjs +0 -145
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.mjs.map +0 -1
- package/dist/components/SingleValueContainer/SingleValueVisualizer.mjs +0 -44
- package/dist/components/SingleValueContainer/SingleValueVisualizer.mjs.map +0 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs +0 -49
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs.map +0 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.mjs +0 -22
- 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/SingleValueContainer/types/props.mjs.map +0 -1
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.mjs +0 -67
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/DimensionsProvider/index.mjs +0 -35
- package/dist/components/Visualization/components/DimensionsProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/LayoutProvider/index.mjs +0 -17
- package/dist/components/Visualization/components/LayoutProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.mjs +0 -85
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationProvider/index.mjs +0 -13
- package/dist/components/Visualization/components/VisualizationProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationSelector/index.mjs +0 -167
- package/dist/components/Visualization/components/VisualizationSelector/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.mjs +0 -23
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.mjs +0 -39
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.mjs.map +0 -1
- package/dist/components/Visualization/index.mjs +0 -113
- package/dist/components/Visualization/index.mjs.map +0 -1
- package/dist/index.mjs +0 -8
- package/dist/index.mjs.map +0 -1
|
@@ -1 +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;AAAA,OACM;AACP,OAAO,iBAAiB;AACxB,OAAO,kBAAkB;AACzB,OAAO,sBAAsB;AAC7B,OAAO,uBAAuB;AAC9B,OAAO,aAAa;AACpB,SAAS,qBAAqB;AAE9B,MAAM,iBAAiB;AAEvB,SAAS,mBACR,OACC;AACD,MAAI,MAAM,SAAS,SAAS;AAC3B,WAAO,oBAAC,eAAY,MAAM,MAAM,OAAO;AAAA,EACxC;AAEA,MAAI,8BAA8B,SAAS,MAAM,IAAI,GAAG;AACvD,WACC;AAAA,MAAC;AAAA;AAAA,QACA,MAAM,MAAM,QAAQ;AAAA,QACpB;AAAA;AAAA,IACD;AAAA,EAEF;AAEA,QAAM,EAAE,MAAM,SAAS,SAAS,UAAU,MAAM,MAAM,QAAQ,IAC5D,SAAiC,CAAC;AAEpC,MAAI,CAAC,WAAW,CAAC,SAAS;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AAa,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\";\nimport { CustomControl } from \"../../../MapControls/components/CustomControl\";\nimport {\n\tCustomBubbleLayer,\n\tCustomGoogleEngineLayer,\n\tCustomPointLayer,\n\tCustomThematicLayer,\n\tSUPPORTED_EARTH_ENGINE_LAYERS,\n} from \"../../interfaces\";\nimport PointLegend from \"../PointLayer/components/PointLegend\";\nimport BubbleLegend from \"../ThematicLayer/components/Bubble/components/BubbleLegend\";\nimport ChoroplethLegend from \"../ThematicLayer/components/Choropleth/components/ChoroplethLegend\";\nimport EarthEngineLegend from \"../GoogleEngineLayer/components/EarthEngineLegend\";\nimport classes from \"./LegendArea.module.css\";\nimport { usePrintMedia } from \"../../../../hooks/map\";\n\nconst TOOLTIP_OFFSET = 4;\n\nfunction getLegendComponent(\n\tlayer: CustomThematicLayer | CustomPointLayer | CustomGoogleEngineLayer,\n) {\n\tif (layer.type === \"point\") {\n\t\treturn <PointLegend name={layer.label} />;\n\t}\n\n\tif (SUPPORTED_EARTH_ENGINE_LAYERS.includes(layer.type)) {\n\t\treturn (\n\t\t\t<EarthEngineLegend\n\t\t\t\tname={layer.name ?? \"\"}\n\t\t\t\tlayer={layer as CustomGoogleEngineLayer}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst { type, enabled, control, dataItem, name, data, legends } =\n\t\t(layer as CustomThematicLayer) ?? {};\n\n\tif (!enabled || !control) {\n\t\treturn null;\n\t}\n\tswitch (type) {\n\t\tcase \"bubble\":\n\t\t\treturn (\n\t\t\t\t<BubbleLegend\n\t\t\t\t\tradius={\n\t\t\t\t\t\t(layer as CustomBubbleLayer)?.radius ?? {\n\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\tmax: 50,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlegends={legends ?? []}\n\t\t\t\t\tname={name ?? dataItem.displayName}\n\t\t\t\t\tdata={data}\n\t\t\t\t\tdataItem={head(data)?.dataItem ?? dataItem}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"choropleth\":\n\t\t\treturn (\n\t\t\t\t<ChoroplethLegend\n\t\t\t\t\tlegends={legends ?? []}\n\t\t\t\t\tname={name ?? dataItem.displayName}\n\t\t\t\t\tdata={data}\n\t\t\t\t\tdataItem={head(data)?.dataItem ?? dataItem}\n\t\t\t\t/>\n\t\t\t);\n\t}\n}\n\nfunction CollapsedLegendIcon({\n\tonCollapse,\n\tname,\n}: {\n\tname: string;\n\tonCollapse: () => void;\n}) {\n\tconst openDelay = 200;\n\tconst closeDelay = 200;\n\tconst [openTooltip, setOpenTooltip] = useState(false);\n\tconst openTimerRef = useRef<any>(null);\n\tconst closeTimerRef = useRef<any>(null);\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst hideModifier = { name: \"hide\" };\n\tconst offsetModifier = {\n\t\tname: \"offset\",\n\t\toptions: {\n\t\t\toffset: [0, TOOLTIP_OFFSET],\n\t\t},\n\t};\n\n\tconst flipModifier = {\n\t\tname: \"flip\",\n\t\toptions: { altBoundary: true },\n\t};\n\n\tconst onMouseOver = () => {\n\t\tclearTimeout(closeTimerRef.current);\n\n\t\topenTimerRef.current = setTimeout(() => {\n\t\t\tsetOpenTooltip(true);\n\t\t}, openDelay);\n\t};\n\n\tconst onMouseOut = () => {\n\t\tclearTimeout(openTimerRef.current);\n\n\t\tcloseTimerRef.current = setTimeout(() => {\n\t\t\tsetOpenTooltip(false);\n\t\t}, closeDelay);\n\t};\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tclearTimeout(openTimerRef.current);\n\t\t\tclearTimeout(closeTimerRef.current);\n\t\t},\n\t\t[],\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tonMouseOver={onMouseOver}\n\t\t\tonMouseOut={onMouseOut}\n\t\t\tonClick={onCollapse}\n\t\t\tstyle={{ width: 28, height: 28 }}\n\t\t\tclassName=\"legend-card collapsed\"\n\t\t>\n\t\t\t<IconLegend24 />\n\t\t\t{openTooltip && (\n\t\t\t\t<Portal\n\t\t\t\t\t/*\n\t\t\t // @ts-ignore */\n\t\t\t\t\tclassName={classes[\"map-tooltip\"]}\n\t\t\t\t>\n\t\t\t\t\t<Popper\n\t\t\t\t\t\tclassName={classes[\"map-tooltip\"]}\n\t\t\t\t\t\treference={ref}\n\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\tmodifiers={[offsetModifier, flipModifier, hideModifier]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tbackgroundColor: `${colors.grey900}`,\n\t\t\t\t\t\t\t\tborderRadius: 3,\n\t\t\t\t\t\t\t\tcolor: `${colors.white}`,\n\t\t\t\t\t\t\t\tpadding: \"4px 6px\",\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdata-test={`content`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{name}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popper>\n\t\t\t\t</Portal>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction Legend({\n\tchildren,\n\tcollapsible,\n}: {\n\tchildren: React.ReactElement;\n\tcollapsible: boolean;\n}) {\n\tconst [collapsed, setCollapsed] = useState(collapsible);\n\tconst inPrintMode = usePrintMedia();\n\tconst onCollapse = () => {\n\t\tif (collapsible) {\n\t\t\tsetCollapsed((prevState) => !prevState);\n\t\t}\n\t};\n\n\tconst name = head(React.Children.toArray(children) as React.ReactElement[])\n\t\t?.props.name;\n\n\tconst shouldCollapse = collapsed && !inPrintMode;\n\n\treturn (\n\t\t<div className=\"w-100\">\n\t\t\t{shouldCollapse ? (\n\t\t\t\t<CollapsedLegendIcon name={name} onCollapse={onCollapse} />\n\t\t\t) : (\n\t\t\t\tReact.Children.map(children, (child) =>\n\t\t\t\t\tReact.cloneElement(child, { collapsible, onCollapse }),\n\t\t\t\t)\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport default function LegendArea({\n\tlayers,\n\tlegends: legendConfig,\n}: {\n\tlayers: Array<\n\t\tCustomThematicLayer | CustomPointLayer | CustomGoogleEngineLayer\n\t>;\n\tposition: ControlPosition;\n\tlegends?: MapLegendConfig;\n}) {\n\tconst legends: JSX.Element[] = compact(\n\t\tlayers.filter((layer) => layer.enabled).map(getLegendComponent),\n\t);\n\tconst { position, collapsible } = legendConfig ?? {};\n\n\treturn (\n\t\t<CustomControl position={position}>\n\t\t\t<div className=\"column gap-16 align-items-end\">\n\t\t\t\t{legends?.map((legend: any, index) => (\n\t\t\t\t\t<Legend\n\t\t\t\t\t\tcollapsible={collapsible ?? true}\n\t\t\t\t\t\tkey={`${index}-map-legend`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{legend}\n\t\t\t\t\t</Legend>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</CustomControl>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/components/Map/components/MapLayer/components/LegendArea/index.tsx"],"names":[],"mappings":"AA0BS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ACN,iBAAiB,GAAG,OAAO,OAAO;AAAA,sBAClC,cAAc;AAAA,sBACd,OAAO,GAAG,OAAO,KAAK;AAAA,sBACtB,SAAS;AAAA,oBACV;AAAA,oBACA,aAAW;AAAA,oBAEV;AAAA;AAAA,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"]}
|
|
@@ -1,64 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var LegendCardHeader = require('../../../LegendArea/components/LegendCardHeader');
|
|
9
|
-
var hooks = require('../../hooks');
|
|
10
|
-
|
|
11
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
|
|
13
|
-
var LegendCardHeader__default = /*#__PURE__*/_interopDefault(LegendCardHeader);
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useConfig } from '@dhis2/app-runtime';
|
|
3
|
+
import { Divider } from '@dhis2/ui';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { getIconUrl } from '../../../../../../utils/helpers.js';
|
|
6
|
+
import LegendCardHeader from '../../../LegendArea/components/LegendCardHeader/index.js';
|
|
7
|
+
import { usePointLayer } from '../../hooks/index.js';
|
|
14
8
|
|
|
15
9
|
function PointLegends({
|
|
16
10
|
orgUnitGroups,
|
|
17
11
|
icon,
|
|
18
12
|
label
|
|
19
13
|
}) {
|
|
20
|
-
const { baseUrl } =
|
|
21
|
-
return /* @__PURE__ */
|
|
14
|
+
const { baseUrl } = useConfig();
|
|
15
|
+
return /* @__PURE__ */ jsxs(
|
|
22
16
|
"div",
|
|
23
17
|
{
|
|
24
18
|
style: { minWidth: 100, alignItems: "flex-start" },
|
|
25
19
|
className: "w-100 p-8 legend-list column",
|
|
26
20
|
children: [
|
|
27
|
-
icon && /* @__PURE__ */
|
|
21
|
+
icon && /* @__PURE__ */ jsxs(
|
|
28
22
|
"div",
|
|
29
23
|
{
|
|
30
24
|
className: "row gap-16 align-items-center",
|
|
31
25
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
33
27
|
"img",
|
|
34
28
|
{
|
|
35
29
|
height: 20,
|
|
36
30
|
width: 20,
|
|
37
31
|
alt: `${name}-icon`,
|
|
38
|
-
src:
|
|
32
|
+
src: getIconUrl(icon, { baseUrl })
|
|
39
33
|
}
|
|
40
34
|
),
|
|
41
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ jsx("p", { children: label })
|
|
42
36
|
]
|
|
43
37
|
},
|
|
44
38
|
`${icon}-legend`
|
|
45
39
|
),
|
|
46
40
|
orgUnitGroups.map(({ name: name2, symbol }) => {
|
|
47
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ jsxs(
|
|
48
42
|
"div",
|
|
49
43
|
{
|
|
50
44
|
className: "row gap-16 align-items-center",
|
|
51
45
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
53
47
|
"img",
|
|
54
48
|
{
|
|
55
49
|
height: 20,
|
|
56
50
|
width: 20,
|
|
57
51
|
alt: `${name2}-icon`,
|
|
58
|
-
src:
|
|
52
|
+
src: getIconUrl(symbol ?? "", { baseUrl })
|
|
59
53
|
}
|
|
60
54
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ jsx("p", { children: name2 })
|
|
62
56
|
]
|
|
63
57
|
},
|
|
64
58
|
`${name2}-legend`
|
|
@@ -69,16 +63,30 @@ function PointLegends({
|
|
|
69
63
|
);
|
|
70
64
|
}
|
|
71
65
|
function PointLegend({ collapsible, onCollapse }, ref) {
|
|
72
|
-
const pointLayer =
|
|
66
|
+
const pointLayer = usePointLayer();
|
|
73
67
|
const { label, style } = pointLayer ?? {};
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: "legend-card", children: [
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
LegendCardHeader,
|
|
71
|
+
{
|
|
72
|
+
collapsible,
|
|
73
|
+
onCollapse,
|
|
74
|
+
title: label ?? "Points"
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsx(Divider, { margin: "0" }),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
PointLegends,
|
|
80
|
+
{
|
|
81
|
+
label,
|
|
82
|
+
orgUnitGroups: style?.orgUnitGroups ?? [],
|
|
83
|
+
icon: style?.icon
|
|
84
|
+
}
|
|
85
|
+
)
|
|
78
86
|
] });
|
|
79
87
|
}
|
|
80
|
-
var PointLegend_default =
|
|
88
|
+
var PointLegend_default = forwardRef(PointLegend);
|
|
81
89
|
|
|
82
|
-
|
|
90
|
+
export { PointLegend_default as default };
|
|
83
91
|
//# sourceMappingURL=out.js.map
|
|
84
92
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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,
|
|
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;AAC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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,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var lodash = require('lodash');
|
|
4
|
-
var hooks = require('../../../../MapProvider/hooks');
|
|
1
|
+
import { find } from 'lodash';
|
|
2
|
+
import { useMapLayers } from '../../../../MapProvider/hooks/index.js';
|
|
5
3
|
|
|
6
4
|
function usePointLayer() {
|
|
7
|
-
const { layers } =
|
|
8
|
-
return
|
|
5
|
+
const { layers } = useMapLayers();
|
|
6
|
+
return find(layers, ["type", "point"]);
|
|
9
7
|
}
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
export { usePointLayer };
|
|
12
10
|
//# sourceMappingURL=out.js.map
|
|
13
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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\";\nimport { CustomPointLayer } from \"../../../interfaces\";\n\nexport function usePointLayer() {\n\tconst { layers } = useMapLayers();\n\treturn find(layers, [\"type\", \"point\"]) as CustomPointLayer;\n}\n"]}
|
|
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"]}
|
|
@@ -1,35 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var helpers = require('../../../../utils/helpers');
|
|
9
|
-
var hooks = require('./hooks');
|
|
10
|
-
|
|
11
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
|
|
13
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
14
|
-
var L__default = /*#__PURE__*/_interopDefault(L);
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useConfig } from '@dhis2/app-runtime';
|
|
3
|
+
import i18n from '@dhis2/d2-i18n';
|
|
4
|
+
import L from 'leaflet';
|
|
5
|
+
import { LayersControl, LayerGroup, GeoJSON, Tooltip, Popup } from 'react-leaflet';
|
|
6
|
+
import { getIcon, getIconUrl } from '../../../../utils/helpers.js';
|
|
7
|
+
import { usePointLayer } from './hooks/index.js';
|
|
15
8
|
|
|
16
9
|
function PointLayer() {
|
|
17
|
-
const pointLayer =
|
|
10
|
+
const pointLayer = usePointLayer();
|
|
18
11
|
const { enabled, label, points: orgUnits, style } = pointLayer ?? {};
|
|
19
|
-
const { baseUrl } =
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
12
|
+
const { baseUrl } = useConfig();
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
LayersControl.Overlay,
|
|
22
15
|
{
|
|
23
16
|
checked: enabled,
|
|
24
|
-
name: label ??
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
17
|
+
name: label ?? i18n.t("Points"),
|
|
18
|
+
children: /* @__PURE__ */ jsx(LayerGroup, { children: orgUnits?.map((area) => {
|
|
19
|
+
return /* @__PURE__ */ jsxs(
|
|
20
|
+
GeoJSON,
|
|
28
21
|
{
|
|
29
22
|
pointToLayer: (_, coordinates) => {
|
|
30
|
-
return
|
|
31
|
-
icon:
|
|
32
|
-
|
|
23
|
+
return L.marker(coordinates, {
|
|
24
|
+
icon: getIcon(
|
|
25
|
+
getIconUrl(
|
|
33
26
|
area.icon.icon ?? style?.icon,
|
|
34
27
|
{ baseUrl }
|
|
35
28
|
)
|
|
@@ -39,8 +32,8 @@ function PointLayer() {
|
|
|
39
32
|
data: area.geoJSON,
|
|
40
33
|
interactive: true,
|
|
41
34
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ jsx(Tooltip, { children: area.name }),
|
|
36
|
+
/* @__PURE__ */ jsx(Popup, { minWidth: 80, children: /* @__PURE__ */ jsx("h3", { children: area.name }) })
|
|
44
37
|
]
|
|
45
38
|
},
|
|
46
39
|
`${area.id}-polygon`
|
|
@@ -50,6 +43,6 @@ function PointLayer() {
|
|
|
50
43
|
);
|
|
51
44
|
}
|
|
52
45
|
|
|
53
|
-
|
|
46
|
+
export { PointLayer };
|
|
54
47
|
//# sourceMappingURL=out.js.map
|
|
55
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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\";\nimport { getIcon, getIconUrl } from \"../../../../utils/helpers\";\nimport { usePointLayer } from \"./hooks\";\n\nexport function PointLayer() {\n\tconst pointLayer = usePointLayer();\n\tconst { enabled, label, points: orgUnits, style } = pointLayer ?? {};\n\tconst { baseUrl } = useConfig();\n\treturn (\n\t\t<LayersControl.Overlay\n\t\t\tchecked={enabled}\n\t\t\tname={label ?? i18n.t(\"Points\")}\n\t\t>\n\t\t\t<LayerGroup>\n\t\t\t\t{orgUnits?.map((area: PointOrgUnit) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<GeoJSON\n\t\t\t\t\t\t\tpointToLayer={(_, coordinates) => {\n\t\t\t\t\t\t\t\treturn L.marker(coordinates, {\n\t\t\t\t\t\t\t\t\ticon: getIcon(\n\t\t\t\t\t\t\t\t\t\tgetIconUrl(\n\t\t\t\t\t\t\t\t\t\t\tarea.icon.icon ?? style?.icon,\n\t\t\t\t\t\t\t\t\t\t\t{ baseUrl },\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdata={area.geoJSON}\n\t\t\t\t\t\t\tinteractive\n\t\t\t\t\t\t\tkey={`${area.id}-polygon`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Tooltip>{area.name}</Tooltip>\n\t\t\t\t\t\t\t<Popup minWidth={80}>\n\t\t\t\t\t\t\t\t<h3>{area.name}</h3>\n\t\t\t\t\t\t\t</Popup>\n\t\t\t\t\t\t</GeoJSON>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</LayerGroup>\n\t\t</LayersControl.Overlay>\n\t);\n}\n"]}
|
|
1
|
+
{"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,18 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { guideLength, textPadding } from './Bubbles.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const Bubble = ({
|
|
5
|
+
radius,
|
|
6
|
+
maxRadius,
|
|
7
|
+
text,
|
|
8
|
+
textAlign,
|
|
9
|
+
color,
|
|
10
|
+
stroke,
|
|
11
|
+
pattern
|
|
12
|
+
}) => {
|
|
7
13
|
const leftAlign = textAlign === "left";
|
|
8
14
|
const x = maxRadius;
|
|
9
15
|
const y = maxRadius * 2 - radius;
|
|
10
|
-
const x2 = leftAlign ? x - maxRadius -
|
|
16
|
+
const x2 = leftAlign ? x - maxRadius - guideLength : x + maxRadius + guideLength;
|
|
11
17
|
const y2 = maxRadius * 2 - radius * 2;
|
|
12
|
-
const textX = x2 + (leftAlign ? -
|
|
18
|
+
const textX = x2 + (leftAlign ? -textPadding : textPadding);
|
|
13
19
|
const textAnchor = leftAlign ? "end" : "start";
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
16
22
|
"circle",
|
|
17
23
|
{
|
|
18
24
|
cx: x,
|
|
@@ -25,14 +31,34 @@ const Bubble = ({ radius, maxRadius, text, textAlign, color, stroke, pattern })
|
|
|
25
31
|
}
|
|
26
32
|
}
|
|
27
33
|
),
|
|
28
|
-
text && /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
34
|
+
text && /* @__PURE__ */ jsxs("g", { children: [
|
|
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
|
+
)
|
|
31
57
|
] })
|
|
32
58
|
] });
|
|
33
59
|
};
|
|
34
60
|
var Bubble_default = Bubble;
|
|
35
61
|
|
|
36
|
-
|
|
62
|
+
export { Bubble_default as default };
|
|
37
63
|
//# sourceMappingURL=out.js.map
|
|
38
64
|
//# sourceMappingURL=Bubble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.tsx"],"names":[],"mappings":"
|
|
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"]}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var react = require('react');
|
|
10
|
-
var colors = require('../../../../../../../../../utils/colors');
|
|
11
|
-
var helpers = require('../../../../../../../../../utils/helpers');
|
|
12
|
-
var Bubble = require('./Bubble');
|
|
13
|
-
|
|
14
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
|
|
16
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
17
|
-
var Bubble__default = /*#__PURE__*/_interopDefault(Bubble);
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import i18n from '@dhis2/d2-i18n';
|
|
3
|
+
import { scaleSqrt } from 'd3-scale';
|
|
4
|
+
import { reduce } from 'lodash';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { getContrastColor } from '../../../../../../../../../utils/colors.js';
|
|
7
|
+
import { getLongestTextLength } from '../../../../../../../../../utils/helpers.js';
|
|
8
|
+
import Bubble from './Bubble.js';
|
|
18
9
|
|
|
19
10
|
const style = {
|
|
20
11
|
paddingTop: 10,
|
|
@@ -26,9 +17,14 @@ const legendWidth = 200;
|
|
|
26
17
|
const digitWidth = 6.8;
|
|
27
18
|
const guideLength = 16;
|
|
28
19
|
const textPadding = 4;
|
|
29
|
-
const Bubbles = ({
|
|
20
|
+
const Bubbles = ({
|
|
21
|
+
radiusLow,
|
|
22
|
+
radiusHigh,
|
|
23
|
+
color,
|
|
24
|
+
classes
|
|
25
|
+
}) => {
|
|
30
26
|
const height = radiusHigh * 2 + 4;
|
|
31
|
-
const scale =
|
|
27
|
+
const scale = scaleSqrt().range([radiusLow, radiusHigh]);
|
|
32
28
|
const radiusMid = scale(0.5);
|
|
33
29
|
if (isNaN(radiusLow) || isNaN(radiusHigh)) {
|
|
34
30
|
return null;
|
|
@@ -50,34 +46,39 @@ const Bubbles = ({ radiusLow, radiusHigh, color, classes }) => {
|
|
|
50
46
|
text: String(startValue)
|
|
51
47
|
});
|
|
52
48
|
} else {
|
|
53
|
-
const stroke = color &&
|
|
49
|
+
const stroke = color && getContrastColor(color);
|
|
54
50
|
bubbles = [
|
|
55
51
|
{
|
|
56
52
|
radius: radiusHigh,
|
|
57
53
|
maxRadius: radiusHigh,
|
|
58
54
|
color,
|
|
59
55
|
stroke,
|
|
60
|
-
text:
|
|
56
|
+
text: i18n.t("Max")
|
|
61
57
|
},
|
|
62
58
|
{
|
|
63
59
|
radius: radiusMid,
|
|
64
60
|
maxRadius: radiusHigh,
|
|
65
61
|
color,
|
|
66
62
|
stroke,
|
|
67
|
-
text:
|
|
63
|
+
text: i18n.t("Mid")
|
|
68
64
|
},
|
|
69
65
|
{
|
|
70
66
|
radius: radiusLow,
|
|
71
67
|
maxRadius: radiusHigh,
|
|
72
68
|
color,
|
|
73
69
|
stroke,
|
|
74
|
-
text:
|
|
70
|
+
text: i18n.t("Min")
|
|
75
71
|
}
|
|
76
72
|
];
|
|
77
73
|
}
|
|
78
|
-
let textLength = Math.ceil(
|
|
74
|
+
let textLength = Math.ceil(
|
|
75
|
+
Math.max(
|
|
76
|
+
getLongestTextLength(classes, "startValue"),
|
|
77
|
+
getLongestTextLength(classes, "endValue")
|
|
78
|
+
) * digitWidth
|
|
79
|
+
);
|
|
79
80
|
const alternateLength = (radiusHigh + guideLength + textPadding + textLength) * 2;
|
|
80
|
-
let smallestGap =
|
|
81
|
+
let smallestGap = reduce(bubbles, (prev, curr, i) => {
|
|
81
82
|
const gap = prev.radius - curr.radius;
|
|
82
83
|
const smallestGap2 = prev.gap === void 0 || gap < prev.gap ? gap : prev.gap;
|
|
83
84
|
return i === bubbles.length - 1 ? Math.round(smallestGap2 * 2) : {
|
|
@@ -100,7 +101,9 @@ const Bubbles = ({ radiusLow, radiusHigh, color, classes }) => {
|
|
|
100
101
|
}
|
|
101
102
|
if (gap > 15) {
|
|
102
103
|
const midRadius = minBubble.radius + gap / 2;
|
|
103
|
-
const midBubble = bubbles.reduce(
|
|
104
|
+
const midBubble = bubbles.reduce(
|
|
105
|
+
(prev, curr) => curr.radius >= midRadius && curr.radius - midRadius < prev.radius - midRadius ? curr : prev
|
|
106
|
+
);
|
|
104
107
|
showNumbers.push(bubbles.indexOf(midBubble));
|
|
105
108
|
}
|
|
106
109
|
bubbles.forEach((b, i) => {
|
|
@@ -109,14 +112,19 @@ const Bubbles = ({ radiusLow, radiusHigh, color, classes }) => {
|
|
|
109
112
|
}
|
|
110
113
|
});
|
|
111
114
|
}
|
|
112
|
-
textLength = Math.ceil(
|
|
115
|
+
textLength = Math.ceil(getLongestTextLength(bubbles, "text") * digitWidth);
|
|
113
116
|
const offset = textLength + guideLength + textPadding;
|
|
114
|
-
return /* @__PURE__ */
|
|
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
|
+
)) }) }) });
|
|
115
125
|
};
|
|
116
|
-
var Bubbles_default =
|
|
126
|
+
var Bubbles_default = memo(Bubbles);
|
|
117
127
|
|
|
118
|
-
|
|
119
|
-
exports.guideLength = guideLength;
|
|
120
|
-
exports.textPadding = textPadding;
|
|
128
|
+
export { Bubbles_default as default, guideLength, textPadding };
|
|
121
129
|
//# sourceMappingURL=out.js.map
|
|
122
130
|
//# sourceMappingURL=Bubbles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../../../../src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.tsx"],"names":["smallestGap"],"mappings":"
|
|
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,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a,cAAc;AAE1C,SACC,oBAAC,SAAI,OACJ,8BAAC,SAAI,OAAO,aAAa,QAAQ,SAAS,IACzC,8BAAC,OAAE,WAAW,aAAa,YAAY,SAAS,IAAI,QAClD,kBAAQ,IAAI,CAAC,QAAQ,MACrB;AAAA,IAAC;AAAA;AAAA,MAEC,GAAG;AAAA,MACJ,WACC,aAAa,IAAI,KAAK,IAAI,SAAS;AAAA;AAAA,IAH/B;AAAA,EAKN,CACA,GACF,GACD,GACD;AAEF;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"]}
|