@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
package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationDimensionSelector/index.tsx"],"names":[],"mappings":"AA+CM,mBACC,KADD;AA/CN,SAAgB,aAAa,SAAS,gBAAgB;AACtD,SAAS,QAAQ,aAAa,gBAAgB,eAAe;AAC7D,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB,2BAA2B;AAE1D,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AAE9B,SAAS,+BAA+B;AAAA,EAC9C;AAAA,EACA;AACD,GAGG;AACF,QAAM,CAAC,YAAY,aAAa,IAAI,cAAc;AAClD,QAAM,UAAU,QAAQ,MAAM,WAAW,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5D,QAAM,mBAAmB;AAAA,IACxB,MAAM,2BAA2B,WAAW,MAAM,CAAC,CAAC;AAAA,IACpD,CAAC,WAAW,EAAE;AAAA,EACf;AACA,QAAM,CAAC,YAAY,aAAa,IAAI,SAAkC;AAEtE,QAAM,iBAAiB;AAAA,IACtB,CAAC,SAAsB,CAAC,SAAiC;AACxD,oBAAc,MAAS;AACvB,UAAI,SAAS,MAAM;AAClB,sBAAc;AAAA,UACb,WAAW;AAAA,UACX,OAAO,qBAAqB,IAAI;AAAA,QACjC,CAAC;AACD;AAAA,MACD;AACA,UAAI,SAAS,MAAM;AAClB,sBAAc,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAC9C;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC,aAAa;AAAA,EACf;AAEA,SACC,gCACC,+BAAC,SAAI,OAAO,EAAE,SAAS,QAAQ,KAAK,EAAE,GACpC;AAAA,0BACA,oBAAC,WAAQ,SAAS,KAAK,EAAE,QAAQ,GAChC,2CACC;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,UAAS;AAAA,UACT,sBAAoB;AAAA,UACpB,iBAAiB;AAAA,UACjB,SAAS,MAAM,cAAc,MAAS;AAAA,UACtC,MAAM,eAAe;AAAA,UACrB,UAAU,eAAe,IAAI;AAAA;AAAA,MAC9B;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,SAAS,MAAM,cAAc,IAAI;AAAA,UACjC,MAAM,oBAAC,eAAY;AAAA;AAAA,MACpB;AAAA,OACD,GACD;AAAA,IAEA,uBACA,oBAAC,WAAQ,SAAS,KAAK,EAAE,UAAU,GAClC,2CACC;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,iBAAe;AAAA,UACf,YAAU;AAAA,UACV,OAAO,KAAK,EAAE,oBAAoB;AAAA,UAClC,OAAO;AAAA,UACP,SAAS,MAAM,cAAc,MAAS;AAAA,UACtC,MAAM,eAAe;AAAA,UACrB,UAAU,eAAe,IAAI;AAAA;AAAA,MAC9B;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,SAAS,MAAM,cAAc,IAAI;AAAA,UACjC,MAAM,oBAAC,kBAAe;AAAA;AAAA,MACvB;AAAA,OACD,GACD;AAAA,KAEF,GACD;AAEF","sourcesContent":["import React, { useCallback, useMemo, useState } from \"react\";\nimport { Button, IconClock24, IconLocation24, Tooltip } from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { useDimensions } from \"../DimensionsProvider\";\nimport { OrgUnitSelectorModal, PeriodSelectorModal } from \"@hisptz/dhis2-ui\";\nimport { OrgUnitSelection } from \"@hisptz/dhis2-utils\";\nimport { getOrgUnitSelectionFromIds } from \"../VisualizationSelector\";\nimport { getOrgUnitsSelection } from \"../../../Map/utils/map\";\n\nexport function VisualizationDimensionSelector({\n\tshowPeriodSelector,\n\tshowOrgUnitSelector,\n}: {\n\tshowPeriodSelector?: boolean;\n\tshowOrgUnitSelector?: boolean;\n}) {\n\tconst [dimensions, setDimensions] = useDimensions();\n\tconst periods = useMemo(() => dimensions.pe, [dimensions.pe]);\n\tconst orgUnitSelection = useMemo(\n\t\t() => getOrgUnitSelectionFromIds(dimensions.ou ?? []),\n\t\t[dimensions.ou],\n\t);\n\tconst [openFilter, setOpenFilter] = useState<\"pe\" | \"ou\" | undefined>();\n\n\tconst onFilterUpdate = useCallback(\n\t\t(type: \"ou\" | \"pe\") => (data: OrgUnitSelection | any) => {\n\t\t\tsetOpenFilter(undefined);\n\t\t\tif (type === \"ou\") {\n\t\t\t\tsetDimensions({\n\t\t\t\t\tdimension: \"ou\",\n\t\t\t\t\tvalue: getOrgUnitsSelection(data),\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (type === \"pe\") {\n\t\t\t\tsetDimensions({ dimension: \"pe\", value: data });\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t\t[setDimensions],\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div style={{ display: \"flex\", gap: 8 }}>\n\t\t\t\t{showPeriodSelector && (\n\t\t\t\t\t<Tooltip content={i18n.t(\"Period\")}>\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PeriodSelectorModal\n\t\t\t\t\t\t\t\tposition=\"middle\"\n\t\t\t\t\t\t\t\tenablePeriodSelector\n\t\t\t\t\t\t\t\tselectedPeriods={periods}\n\t\t\t\t\t\t\t\tonClose={() => setOpenFilter(undefined)}\n\t\t\t\t\t\t\t\thide={openFilter !== \"pe\"}\n\t\t\t\t\t\t\t\tonUpdate={onFilterUpdate(\"pe\")}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tonClick={() => setOpenFilter(\"pe\")}\n\t\t\t\t\t\t\t\ticon={<IconClock24 />}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\t\t\t\t{showOrgUnitSelector && (\n\t\t\t\t\t<Tooltip content={i18n.t(\"Location\")}>\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<OrgUnitSelectorModal\n\t\t\t\t\t\t\t\tshowUserOptions\n\t\t\t\t\t\t\t\tsearchable\n\t\t\t\t\t\t\t\ttitle={i18n.t(\"Select location(s)\")}\n\t\t\t\t\t\t\t\tvalue={orgUnitSelection}\n\t\t\t\t\t\t\t\tonClose={() => setOpenFilter(undefined)}\n\t\t\t\t\t\t\t\thide={openFilter !== \"ou\"}\n\t\t\t\t\t\t\t\tonUpdate={onFilterUpdate(\"ou\")}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tonClick={() => setOpenFilter(\"ou\")}\n\t\t\t\t\t\t\t\ticon={<IconLocation24 />}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationDimensionSelector/index.tsx"],"names":[],"mappings":"AA+CM,mBACC,KADD;AA/CN,SAAgB,aAAa,SAAS,gBAAgB;AACtD,SAAS,QAAQ,aAAa,gBAAgB,eAAe;AAC7D,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB,2BAA2B;AAE1D,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AAE9B,SAAS,+BAA+B;AAAA,EAC9C;AAAA,EACA;AACD,GAGG;AACF,QAAM,CAAC,YAAY,aAAa,IAAI,cAAc;AAClD,QAAM,UAAU,QAAQ,MAAM,WAAW,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5D,QAAM,mBAAmB;AAAA,IACxB,MAAM,2BAA2B,WAAW,MAAM,CAAC,CAAC;AAAA,IACpD,CAAC,WAAW,EAAE;AAAA,EACf;AACA,QAAM,CAAC,YAAY,aAAa,IAAI,SAAkC;AAEtE,QAAM,iBAAiB;AAAA,IACtB,CAAC,SAAsB,CAAC,SAAiC;AACxD,oBAAc,MAAS;AACvB,UAAI,SAAS,MAAM;AAClB,sBAAc;AAAA,UACb,WAAW;AAAA,UACX,OAAO,qBAAqB,IAAI;AAAA,QACjC,CAAC;AACD;AAAA,MACD;AACA,UAAI,SAAS,MAAM;AAClB,sBAAc,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAC9C;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC,aAAa;AAAA,EACf;AAEA,SACC,gCACC,+BAAC,SAAI,OAAO,EAAE,SAAS,QAAQ,KAAK,EAAE,GACpC;AAAA,0BACA,oBAAC,WAAQ,SAAS,KAAK,EAAE,QAAQ,GAChC,2CACC;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,UAAS;AAAA,UACT,sBAAoB;AAAA,UACpB,iBAAiB;AAAA,UACjB,SAAS,MAAM,cAAc,MAAS;AAAA,UACtC,MAAM,eAAe;AAAA,UACrB,UAAU,eAAe,IAAI;AAAA;AAAA,MAC9B;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,SAAS,MAAM,cAAc,IAAI;AAAA,UACjC,MAAM,oBAAC,eAAY;AAAA;AAAA,MACpB;AAAA,OACD,GACD;AAAA,IAEA,uBACA,oBAAC,WAAQ,SAAS,KAAK,EAAE,UAAU,GAClC,2CACC;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,iBAAe;AAAA,UACf,YAAU;AAAA,UACV,OAAO,KAAK,EAAE,oBAAoB;AAAA,UAClC,OAAO;AAAA,UACP,SAAS,MAAM,cAAc,MAAS;AAAA,UACtC,MAAM,eAAe;AAAA,UACrB,UAAU,eAAe,IAAI;AAAA;AAAA,MAC9B;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,SAAS,MAAM,cAAc,IAAI;AAAA,UACjC,MAAM,oBAAC,kBAAe;AAAA;AAAA,MACvB;AAAA,OACD,GACD;AAAA,KAEF,GACD;AAEF","sourcesContent":["import React, { useCallback, useMemo, useState } from \"react\";\nimport { Button, IconClock24, IconLocation24, Tooltip } from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { useDimensions } from \"../DimensionsProvider/index.js\";\nimport { OrgUnitSelectorModal, PeriodSelectorModal } from \"@hisptz/dhis2-ui\";\nimport { OrgUnitSelection } from \"@hisptz/dhis2-utils\";\nimport { getOrgUnitSelectionFromIds } from \"../VisualizationSelector/index.js\";\nimport { getOrgUnitsSelection } from \"../../../Map/utils/map.js\";\n\nexport function VisualizationDimensionSelector({\n\tshowPeriodSelector,\n\tshowOrgUnitSelector,\n}: {\n\tshowPeriodSelector?: boolean;\n\tshowOrgUnitSelector?: boolean;\n}) {\n\tconst [dimensions, setDimensions] = useDimensions();\n\tconst periods = useMemo(() => dimensions.pe, [dimensions.pe]);\n\tconst orgUnitSelection = useMemo(\n\t\t() => getOrgUnitSelectionFromIds(dimensions.ou ?? []),\n\t\t[dimensions.ou],\n\t);\n\tconst [openFilter, setOpenFilter] = useState<\"pe\" | \"ou\" | undefined>();\n\n\tconst onFilterUpdate = useCallback(\n\t\t(type: \"ou\" | \"pe\") => (data: OrgUnitSelection | any) => {\n\t\t\tsetOpenFilter(undefined);\n\t\t\tif (type === \"ou\") {\n\t\t\t\tsetDimensions({\n\t\t\t\t\tdimension: \"ou\",\n\t\t\t\t\tvalue: getOrgUnitsSelection(data),\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (type === \"pe\") {\n\t\t\t\tsetDimensions({ dimension: \"pe\", value: data });\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t\t[setDimensions],\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div style={{ display: \"flex\", gap: 8 }}>\n\t\t\t\t{showPeriodSelector && (\n\t\t\t\t\t<Tooltip content={i18n.t(\"Period\")}>\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PeriodSelectorModal\n\t\t\t\t\t\t\t\tposition=\"middle\"\n\t\t\t\t\t\t\t\tenablePeriodSelector\n\t\t\t\t\t\t\t\tselectedPeriods={periods}\n\t\t\t\t\t\t\t\tonClose={() => setOpenFilter(undefined)}\n\t\t\t\t\t\t\t\thide={openFilter !== \"pe\"}\n\t\t\t\t\t\t\t\tonUpdate={onFilterUpdate(\"pe\")}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tonClick={() => setOpenFilter(\"pe\")}\n\t\t\t\t\t\t\t\ticon={<IconClock24 />}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\t\t\t\t{showOrgUnitSelector && (\n\t\t\t\t\t<Tooltip content={i18n.t(\"Location\")}>\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<OrgUnitSelectorModal\n\t\t\t\t\t\t\t\tshowUserOptions\n\t\t\t\t\t\t\t\tsearchable\n\t\t\t\t\t\t\t\ttitle={i18n.t(\"Select location(s)\")}\n\t\t\t\t\t\t\t\tvalue={orgUnitSelection}\n\t\t\t\t\t\t\t\tonClose={() => setOpenFilter(undefined)}\n\t\t\t\t\t\t\t\thide={openFilter !== \"ou\"}\n\t\t\t\t\t\t\t\tonUpdate={onFilterUpdate(\"ou\")}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tonClick={() => setOpenFilter(\"ou\")}\n\t\t\t\t\t\t\t\ticon={<IconLocation24 />}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { LayoutProvider } from '../LayoutProvider/index.js';
|
|
3
|
+
import { DimensionsProvider } from '../DimensionsProvider/index.js';
|
|
4
|
+
import { AnalyticsDataProvider } from '../AnalyticsDataProvider/index.js';
|
|
5
|
+
import { VisualizationTypeProvider } from '../VisualizationTypeProvider/index.js';
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return /* @__PURE__ */
|
|
7
|
+
function VisualizationProvider({
|
|
8
|
+
layout,
|
|
9
|
+
dimensions,
|
|
10
|
+
children,
|
|
11
|
+
type,
|
|
12
|
+
config
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsx(DimensionsProvider, { dimensions, children: /* @__PURE__ */ jsx(VisualizationTypeProvider, { config, defaultType: type, children: /* @__PURE__ */ jsx(LayoutProvider, { defaultLayout: layout, children: /* @__PURE__ */ jsx(AnalyticsDataProvider, { children }) }) }) });
|
|
11
15
|
}
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
export { VisualizationProvider };
|
|
14
18
|
//# sourceMappingURL=out.js.map
|
|
15
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationProvider/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationProvider/index.tsx"],"names":[],"mappings":"AA8BK;AA7BL,SAAiB,sBAAsB;AAEvC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC;AAAA,EAEC;AAAA,OACM;AAWA,SAAS,sBAAsB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAA+B;AAC9B,SACC,oBAAC,sBAAmB,YACnB,8BAAC,6BAA0B,QAAgB,aAAa,MACvD,8BAAC,kBAAe,eAAe,QAC9B,8BAAC,yBAAuB,UAAS,GAClC,GACD,GACD;AAEF","sourcesContent":["import React from \"react\";\nimport { Layout, LayoutProvider } from \"../LayoutProvider/index.js\";\nimport { AnalyticsDimension } from \"@hisptz/dhis2-utils\";\nimport { DimensionsProvider } from \"../DimensionsProvider/index.js\";\nimport { AnalyticsDataProvider } from \"../AnalyticsDataProvider/index.js\";\nimport {\n\tVisualizationType,\n\tVisualizationTypeProvider,\n} from \"../VisualizationTypeProvider/index.js\";\nimport { VisualizationConfig } from \"../../index.js\";\n\nexport interface VisualizationProviderProps {\n\tchildren: React.ReactNode;\n\tlayout: Layout;\n\tdimensions: AnalyticsDimension;\n\ttype: VisualizationType;\n\tconfig: VisualizationConfig;\n}\n\nexport function VisualizationProvider({\n\tlayout,\n\tdimensions,\n\tchildren,\n\ttype,\n\tconfig,\n}: VisualizationProviderProps) {\n\treturn (\n\t\t<DimensionsProvider dimensions={dimensions}>\n\t\t\t<VisualizationTypeProvider config={config} defaultType={type}>\n\t\t\t\t<LayoutProvider defaultLayout={layout}>\n\t\t\t\t\t<AnalyticsDataProvider>{children}</AnalyticsDataProvider>\n\t\t\t\t</LayoutProvider>\n\t\t\t</VisualizationTypeProvider>\n\t\t</DimensionsProvider>\n\t);\n}\n"]}
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var ChartAnalytics = require('../../../ChartAnalytics');
|
|
14
|
-
var Map = require('../../../Map');
|
|
15
|
-
|
|
16
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
|
|
18
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useVisualizationType } from '../VisualizationTypeProvider/index.js';
|
|
4
|
+
import { useAnalyticsData } from '../AnalyticsDataProvider/index.js';
|
|
5
|
+
import { CircularLoader } from '@dhis2/ui';
|
|
6
|
+
import { DHIS2PivotTable } from '../../../DHIS2PivotTable/index.js';
|
|
7
|
+
import { useLayout } from '../LayoutProvider/index.js';
|
|
8
|
+
import { forEach, set, mapValues, findIndex, find, filter } from 'lodash';
|
|
9
|
+
import { useDimensions } from '../DimensionsProvider/index.js';
|
|
10
|
+
import i18n from '@dhis2/d2-i18n';
|
|
11
|
+
import { DHIS2Chart } from '../../../ChartAnalytics/index.js';
|
|
12
|
+
import { DHIS2Map } from '../../../Map/index.js';
|
|
19
13
|
|
|
20
14
|
function getDimensionLabel(dimension) {
|
|
21
15
|
switch (dimension) {
|
|
22
16
|
case "pe":
|
|
23
|
-
return
|
|
17
|
+
return i18n.t("Period");
|
|
24
18
|
case "ou":
|
|
25
|
-
return
|
|
19
|
+
return i18n.t("Organisation unit");
|
|
26
20
|
case "dx":
|
|
27
|
-
return
|
|
21
|
+
return i18n.t("Data");
|
|
28
22
|
default:
|
|
29
23
|
return "";
|
|
30
24
|
}
|
|
@@ -33,13 +27,13 @@ function getOrgUnitSelectionFromIds(ous) {
|
|
|
33
27
|
const orgUnitSelection = {
|
|
34
28
|
orgUnits: []
|
|
35
29
|
};
|
|
36
|
-
|
|
30
|
+
forEach(ous, (ou) => {
|
|
37
31
|
if (ou === "USER_ORGUNIT") {
|
|
38
|
-
|
|
32
|
+
set(orgUnitSelection, ["userOrgUnit"], true);
|
|
39
33
|
} else if (ou === "USER_ORGUNIT_CHILDREN") {
|
|
40
|
-
|
|
34
|
+
set(orgUnitSelection, ["userSubUnit"], true);
|
|
41
35
|
} else if (ou === "USER_ORGUNIT_GRANDCHILDREN") {
|
|
42
|
-
|
|
36
|
+
set(orgUnitSelection, ["userSubX2Unit"], true);
|
|
43
37
|
} else {
|
|
44
38
|
const orgUnits = [...orgUnitSelection.orgUnits ?? []];
|
|
45
39
|
orgUnits.push({
|
|
@@ -47,7 +41,7 @@ function getOrgUnitSelectionFromIds(ous) {
|
|
|
47
41
|
children: [],
|
|
48
42
|
path: ""
|
|
49
43
|
});
|
|
50
|
-
|
|
44
|
+
set(orgUnitSelection, ["orgUnits"], orgUnits);
|
|
51
45
|
}
|
|
52
46
|
});
|
|
53
47
|
return orgUnitSelection;
|
|
@@ -55,10 +49,10 @@ function getOrgUnitSelectionFromIds(ous) {
|
|
|
55
49
|
function PivotTableRenderer({
|
|
56
50
|
options
|
|
57
51
|
}) {
|
|
58
|
-
const [layout] =
|
|
59
|
-
const { analytics } =
|
|
60
|
-
const sanitizedLayout =
|
|
61
|
-
return
|
|
52
|
+
const [layout] = useLayout();
|
|
53
|
+
const { analytics } = useAnalyticsData();
|
|
54
|
+
const sanitizedLayout = useMemo(() => {
|
|
55
|
+
return mapValues(
|
|
62
56
|
layout,
|
|
63
57
|
(dimension) => dimension.map((dimension2) => ({
|
|
64
58
|
dimension: dimension2,
|
|
@@ -69,8 +63,8 @@ function PivotTableRenderer({
|
|
|
69
63
|
if (!analytics) {
|
|
70
64
|
return null;
|
|
71
65
|
}
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
DHIS2PivotTable
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
DHIS2PivotTable,
|
|
74
68
|
{
|
|
75
69
|
tableProps: {
|
|
76
70
|
scrollHeight: options.scrollHeight ?? "100%",
|
|
@@ -83,26 +77,26 @@ function PivotTableRenderer({
|
|
|
83
77
|
);
|
|
84
78
|
}
|
|
85
79
|
function ChartRenderer({ options }) {
|
|
86
|
-
const { analytics } =
|
|
80
|
+
const { analytics } = useAnalyticsData();
|
|
87
81
|
if (!analytics) {
|
|
88
82
|
return null;
|
|
89
83
|
}
|
|
90
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ jsx(DHIS2Chart, { analytics, config: { ...options } });
|
|
91
85
|
}
|
|
92
86
|
function MapRenderer({
|
|
93
87
|
options
|
|
94
88
|
}) {
|
|
95
|
-
const [dimensions] =
|
|
96
|
-
const { analytics } =
|
|
97
|
-
const orgUnitSelection =
|
|
89
|
+
const [dimensions] = useDimensions();
|
|
90
|
+
const { analytics } = useAnalyticsData();
|
|
91
|
+
const orgUnitSelection = useMemo(() => {
|
|
98
92
|
return getOrgUnitSelectionFromIds(dimensions.ou ?? []);
|
|
99
93
|
}, [dimensions.ou]);
|
|
100
|
-
const thematicLayers =
|
|
101
|
-
const valueIndex =
|
|
94
|
+
const thematicLayers = useMemo(() => {
|
|
95
|
+
const valueIndex = findIndex(analytics.headers, ["name", "value"]) ?? -1;
|
|
102
96
|
return analytics.metaData?.dimensions["dx"]?.map((dataId) => {
|
|
103
|
-
const config =
|
|
97
|
+
const config = find(options.thematicLayers, ["id", dataId]);
|
|
104
98
|
const data = analytics.metaData?.dimensions?.ou?.map((ouId) => {
|
|
105
|
-
const values =
|
|
99
|
+
const values = filter(
|
|
106
100
|
analytics.rows,
|
|
107
101
|
(row) => row.includes(dataId) && row.includes(ouId)
|
|
108
102
|
);
|
|
@@ -122,8 +116,8 @@ function MapRenderer({
|
|
|
122
116
|
};
|
|
123
117
|
}) ?? [];
|
|
124
118
|
}, [analytics]);
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
DHIS2Map,
|
|
127
121
|
{
|
|
128
122
|
orgUnitSelection,
|
|
129
123
|
thematicLayers
|
|
@@ -131,10 +125,10 @@ function MapRenderer({
|
|
|
131
125
|
);
|
|
132
126
|
}
|
|
133
127
|
function VisualizationSelector({ config }) {
|
|
134
|
-
const [type] =
|
|
135
|
-
const { analytics, loading } =
|
|
128
|
+
const [type] = useVisualizationType();
|
|
129
|
+
const { analytics, loading } = useAnalyticsData();
|
|
136
130
|
if (loading) {
|
|
137
|
-
return /* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ jsx(
|
|
138
132
|
"div",
|
|
139
133
|
{
|
|
140
134
|
style: {
|
|
@@ -144,22 +138,22 @@ function VisualizationSelector({ config }) {
|
|
|
144
138
|
justifyContent: "center",
|
|
145
139
|
alignItems: "center"
|
|
146
140
|
},
|
|
147
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ jsx(CircularLoader, { small: true })
|
|
148
142
|
}
|
|
149
143
|
);
|
|
150
144
|
}
|
|
151
145
|
if (!analytics) {
|
|
152
146
|
return null;
|
|
153
147
|
}
|
|
154
|
-
return /* @__PURE__ */
|
|
155
|
-
type === "pivotTable" && /* @__PURE__ */
|
|
148
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
149
|
+
type === "pivotTable" && /* @__PURE__ */ jsx(
|
|
156
150
|
PivotTableRenderer,
|
|
157
151
|
{
|
|
158
152
|
options: config?.pivotTable
|
|
159
153
|
}
|
|
160
154
|
),
|
|
161
|
-
type === "chart" && /* @__PURE__ */
|
|
162
|
-
type === "map" && /* @__PURE__ */
|
|
155
|
+
type === "chart" && /* @__PURE__ */ jsx(ChartRenderer, { options: config?.chart }),
|
|
156
|
+
type === "map" && /* @__PURE__ */ jsx(
|
|
163
157
|
MapRenderer,
|
|
164
158
|
{
|
|
165
159
|
options: config?.map
|
|
@@ -168,11 +162,6 @@ function VisualizationSelector({ config }) {
|
|
|
168
162
|
] });
|
|
169
163
|
}
|
|
170
164
|
|
|
171
|
-
|
|
172
|
-
exports.MapRenderer = MapRenderer;
|
|
173
|
-
exports.PivotTableRenderer = PivotTableRenderer;
|
|
174
|
-
exports.VisualizationSelector = VisualizationSelector;
|
|
175
|
-
exports.getDimensionLabel = getDimensionLabel;
|
|
176
|
-
exports.getOrgUnitSelectionFromIds = getOrgUnitSelectionFromIds;
|
|
165
|
+
export { ChartRenderer, MapRenderer, PivotTableRenderer, VisualizationSelector, getDimensionLabel, getOrgUnitSelectionFromIds };
|
|
177
166
|
//# sourceMappingURL=out.js.map
|
|
178
167
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationSelector/index.tsx"],"names":["dimension","value"],"mappings":"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","sourcesContent":["import React, { useMemo } from \"react\";\nimport { useVisualizationType } from \"../VisualizationTypeProvider\";\nimport { useAnalyticsData } from \"../AnalyticsDataProvider\";\nimport { CircularLoader } from \"@dhis2/ui\";\nimport {\n\tDHIS2PivotTable,\n\tDHIS2PivotTableOptions,\n} from \"../../../DHIS2PivotTable\";\nimport { useLayout } from \"../LayoutProvider\";\nimport { filter, find, findIndex, forEach, mapValues, set } from \"lodash\";\nimport { Dimension, useDimensions } from \"../DimensionsProvider\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { ChartConfig, DHIS2Chart } from \"../../../ChartAnalytics\";\nimport { VisualizationConfig } from \"../../index\";\nimport { DHIS2Map, MapProps } from \"../../../Map\";\nimport { OrgUnitSelection } from \"@hisptz/dhis2-utils\";\nimport {\n\tThematicLayerConfig,\n\tThematicLayerRawData,\n} from \"../../../Map/components/MapLayer/interfaces\";\nimport { PivotTableLayoutProps } from \"../../../DHIS2PivotTable/components/Table\";\n\nexport interface VisualizationSelectorProps {\n\tconfig: VisualizationConfig;\n}\n\nexport function getDimensionLabel(dimension: Dimension) {\n\tswitch (dimension) {\n\t\tcase \"pe\":\n\t\t\treturn i18n.t(\"Period\");\n\t\tcase \"ou\":\n\t\t\treturn i18n.t(\"Organisation unit\");\n\t\tcase \"dx\":\n\t\t\treturn i18n.t(\"Data\");\n\t\tdefault:\n\t\t\treturn \"\";\n\t}\n}\n\nexport function getOrgUnitSelectionFromIds(ous: string[]) {\n\tconst orgUnitSelection: OrgUnitSelection = {\n\t\torgUnits: [],\n\t};\n\tforEach(ous, (ou) => {\n\t\tif (ou === \"USER_ORGUNIT\") {\n\t\t\tset(orgUnitSelection, [\"userOrgUnit\"], true);\n\t\t} else if (ou === \"USER_ORGUNIT_CHILDREN\") {\n\t\t\tset(orgUnitSelection, [\"userSubUnit\"], true);\n\t\t} else if (ou === \"USER_ORGUNIT_GRANDCHILDREN\") {\n\t\t\tset(orgUnitSelection, [\"userSubX2Unit\"], true);\n\t\t} else {\n\t\t\tconst orgUnits = [...(orgUnitSelection.orgUnits ?? [])];\n\t\t\torgUnits.push({\n\t\t\t\tid: ou,\n\t\t\t\tchildren: [],\n\t\t\t\tpath: \"\",\n\t\t\t});\n\t\t\tset(orgUnitSelection, [\"orgUnits\"], orgUnits);\n\t\t}\n\t});\n\treturn orgUnitSelection;\n}\n\nexport function PivotTableRenderer({\n\toptions,\n}: {\n\toptions: DHIS2PivotTableOptions & PivotTableLayoutProps;\n}) {\n\tconst [layout] = useLayout();\n\tconst { analytics } = useAnalyticsData();\n\n\tconst sanitizedLayout = useMemo(() => {\n\t\treturn mapValues(layout, (dimension) =>\n\t\t\tdimension.map((dimension) => ({\n\t\t\t\tdimension,\n\t\t\t\tlabel: getDimensionLabel(dimension),\n\t\t\t})),\n\t\t);\n\t}, [layout]);\n\n\tif (!analytics) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<DHIS2PivotTable\n\t\t\ttableProps={{\n\t\t\t\tscrollHeight: options.scrollHeight ?? \"100%\",\n\t\t\t\tscrollWidth: options.scrollWidth ?? \"100%\",\n\t\t\t\twidth: options.width ?? \"100%\",\n\t\t\t}}\n\t\t\tanalytics={analytics}\n\t\t\tconfig={{ layout: sanitizedLayout, options }}\n\t\t/>\n\t);\n}\n\nexport function ChartRenderer({ options }: { options: ChartConfig }) {\n\tconst { analytics } = useAnalyticsData();\n\tif (!analytics) {\n\t\treturn null;\n\t}\n\treturn <DHIS2Chart analytics={analytics} config={{ ...options }} />;\n}\n\nexport function MapRenderer({\n\toptions,\n}: {\n\toptions: Omit<MapProps, \"orgUnitSelection\" | \"periodSelection\">;\n}) {\n\tconst [dimensions] = useDimensions();\n\tconst { analytics } = useAnalyticsData();\n\tconst orgUnitSelection: OrgUnitSelection = useMemo(() => {\n\t\treturn getOrgUnitSelectionFromIds(dimensions.ou ?? []);\n\t}, [dimensions.ou]);\n\n\tconst thematicLayers: ThematicLayerConfig[] = useMemo(() => {\n\t\tconst valueIndex =\n\t\t\tfindIndex(analytics.headers, [\"name\", \"value\"]) ?? -1;\n\t\treturn (\n\t\t\tanalytics.metaData?.dimensions[\"dx\"]?.map((dataId) => {\n\t\t\t\tconst config = find(options.thematicLayers, [\"id\", dataId]);\n\t\t\t\tconst data: ThematicLayerRawData[] =\n\t\t\t\t\tanalytics.metaData?.dimensions?.ou?.map((ouId) => {\n\t\t\t\t\t\tconst values = filter(\n\t\t\t\t\t\t\tanalytics.rows,\n\t\t\t\t\t\t\t(row) => row.includes(dataId) && row.includes(ouId),\n\t\t\t\t\t\t) as unknown as string[];\n\t\t\t\t\t\tconst value = values.reduce(\n\t\t\t\t\t\t\t(acc, value) => acc + parseFloat(value[valueIndex]),\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tdata: value,\n\t\t\t\t\t\t\tdataItem: dataId,\n\t\t\t\t\t\t\torgUnit: ouId,\n\t\t\t\t\t\t};\n\t\t\t\t\t}) ?? [];\n\t\t\t\treturn {\n\t\t\t\t\t...config,\n\t\t\t\t\tdata,\n\t\t\t\t} as ThematicLayerConfig;\n\t\t\t}) ?? []\n\t\t);\n\t}, [analytics]);\n\n\treturn (\n\t\t<DHIS2Map\n\t\t\torgUnitSelection={orgUnitSelection}\n\t\t\tthematicLayers={thematicLayers}\n\t\t/>\n\t);\n}\n\nexport function VisualizationSelector({ config }: VisualizationSelectorProps) {\n\tconst [type] = useVisualizationType();\n\tconst { analytics, loading } = useAnalyticsData();\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\theight: \"100%\",\n\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\tjustifyContent: \"center\",\n\t\t\t\t\talignItems: \"center\",\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<CircularLoader small />\n\t\t\t</div>\n\t\t);\n\t}\n\tif (!analytics) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{type === \"pivotTable\" && (\n\t\t\t\t<PivotTableRenderer\n\t\t\t\t\toptions={config?.pivotTable as DHIS2PivotTableOptions}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{type === \"chart\" && (\n\t\t\t\t<ChartRenderer options={config?.chart as ChartConfig} />\n\t\t\t)}\n\t\t\t{type === \"map\" && (\n\t\t\t\t<MapRenderer\n\t\t\t\t\toptions={\n\t\t\t\t\t\tconfig?.map as Omit<\n\t\t\t\t\t\t\tMapProps,\n\t\t\t\t\t\t\t\"orgUnitSelection\" | \"periodSelection\"\n\t\t\t\t\t\t>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationSelector/index.tsx"],"names":["dimension","value"],"mappings":"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","sourcesContent":["import React, { useMemo } from \"react\";\nimport { useVisualizationType } from \"../VisualizationTypeProvider/index.js\";\nimport { useAnalyticsData } from \"../AnalyticsDataProvider/index.js\";\nimport { CircularLoader } from \"@dhis2/ui\";\nimport {\n\tDHIS2PivotTable,\n\tDHIS2PivotTableOptions,\n} from \"../../../DHIS2PivotTable/index.js\";\nimport { useLayout } from \"../LayoutProvider/index.js\";\nimport { filter, find, findIndex, forEach, mapValues, set } from \"lodash\";\nimport { Dimension, useDimensions } from \"../DimensionsProvider/index.js\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { ChartConfig, DHIS2Chart } from \"../../../ChartAnalytics/index.js\";\nimport { VisualizationConfig } from \"../../index.js\";\nimport { DHIS2Map, MapProps } from \"../../../Map/index.js\";\nimport { OrgUnitSelection } from \"@hisptz/dhis2-utils\";\nimport {\n\tThematicLayerConfig,\n\tThematicLayerRawData,\n} from \"../../../Map/components/MapLayer/interfaces/index.js\";\nimport type { PivotTableLayoutProps } from \"../../../DHIS2PivotTable/components/Table/index.js\";\n\nexport interface VisualizationSelectorProps {\n\tconfig: VisualizationConfig;\n}\n\nexport function getDimensionLabel(dimension: Dimension) {\n\tswitch (dimension) {\n\t\tcase \"pe\":\n\t\t\treturn i18n.t(\"Period\");\n\t\tcase \"ou\":\n\t\t\treturn i18n.t(\"Organisation unit\");\n\t\tcase \"dx\":\n\t\t\treturn i18n.t(\"Data\");\n\t\tdefault:\n\t\t\treturn \"\";\n\t}\n}\n\nexport function getOrgUnitSelectionFromIds(ous: string[]) {\n\tconst orgUnitSelection: OrgUnitSelection = {\n\t\torgUnits: [],\n\t};\n\tforEach(ous, (ou) => {\n\t\tif (ou === \"USER_ORGUNIT\") {\n\t\t\tset(orgUnitSelection, [\"userOrgUnit\"], true);\n\t\t} else if (ou === \"USER_ORGUNIT_CHILDREN\") {\n\t\t\tset(orgUnitSelection, [\"userSubUnit\"], true);\n\t\t} else if (ou === \"USER_ORGUNIT_GRANDCHILDREN\") {\n\t\t\tset(orgUnitSelection, [\"userSubX2Unit\"], true);\n\t\t} else {\n\t\t\tconst orgUnits = [...(orgUnitSelection.orgUnits ?? [])];\n\t\t\torgUnits.push({\n\t\t\t\tid: ou,\n\t\t\t\tchildren: [],\n\t\t\t\tpath: \"\",\n\t\t\t});\n\t\t\tset(orgUnitSelection, [\"orgUnits\"], orgUnits);\n\t\t}\n\t});\n\treturn orgUnitSelection;\n}\n\nexport function PivotTableRenderer({\n\toptions,\n}: {\n\toptions: DHIS2PivotTableOptions & PivotTableLayoutProps;\n}) {\n\tconst [layout] = useLayout();\n\tconst { analytics } = useAnalyticsData();\n\n\tconst sanitizedLayout = useMemo(() => {\n\t\treturn mapValues(layout, (dimension) =>\n\t\t\tdimension.map((dimension) => ({\n\t\t\t\tdimension,\n\t\t\t\tlabel: getDimensionLabel(dimension),\n\t\t\t})),\n\t\t);\n\t}, [layout]);\n\n\tif (!analytics) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<DHIS2PivotTable\n\t\t\ttableProps={{\n\t\t\t\tscrollHeight: options.scrollHeight ?? \"100%\",\n\t\t\t\tscrollWidth: options.scrollWidth ?? \"100%\",\n\t\t\t\twidth: options.width ?? \"100%\",\n\t\t\t}}\n\t\t\tanalytics={analytics}\n\t\t\tconfig={{ layout: sanitizedLayout, options }}\n\t\t/>\n\t);\n}\n\nexport function ChartRenderer({ options }: { options: ChartConfig }) {\n\tconst { analytics } = useAnalyticsData();\n\tif (!analytics) {\n\t\treturn null;\n\t}\n\treturn <DHIS2Chart analytics={analytics} config={{ ...options }} />;\n}\n\nexport function MapRenderer({\n\toptions,\n}: {\n\toptions: Omit<MapProps, \"orgUnitSelection\" | \"periodSelection\">;\n}) {\n\tconst [dimensions] = useDimensions();\n\tconst { analytics } = useAnalyticsData();\n\tconst orgUnitSelection: OrgUnitSelection = useMemo(() => {\n\t\treturn getOrgUnitSelectionFromIds(dimensions.ou ?? []);\n\t}, [dimensions.ou]);\n\n\tconst thematicLayers: ThematicLayerConfig[] = useMemo(() => {\n\t\tconst valueIndex =\n\t\t\tfindIndex(analytics.headers, [\"name\", \"value\"]) ?? -1;\n\t\treturn (\n\t\t\tanalytics.metaData?.dimensions[\"dx\"]?.map((dataId) => {\n\t\t\t\tconst config = find(options.thematicLayers, [\"id\", dataId]);\n\t\t\t\tconst data: ThematicLayerRawData[] =\n\t\t\t\t\tanalytics.metaData?.dimensions?.ou?.map((ouId) => {\n\t\t\t\t\t\tconst values = filter(\n\t\t\t\t\t\t\tanalytics.rows,\n\t\t\t\t\t\t\t(row) => row.includes(dataId) && row.includes(ouId),\n\t\t\t\t\t\t) as unknown as string[];\n\t\t\t\t\t\tconst value = values.reduce(\n\t\t\t\t\t\t\t(acc, value) => acc + parseFloat(value[valueIndex]),\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tdata: value,\n\t\t\t\t\t\t\tdataItem: dataId,\n\t\t\t\t\t\t\torgUnit: ouId,\n\t\t\t\t\t\t};\n\t\t\t\t\t}) ?? [];\n\t\t\t\treturn {\n\t\t\t\t\t...config,\n\t\t\t\t\tdata,\n\t\t\t\t} as ThematicLayerConfig;\n\t\t\t}) ?? []\n\t\t);\n\t}, [analytics]);\n\n\treturn (\n\t\t<DHIS2Map\n\t\t\torgUnitSelection={orgUnitSelection}\n\t\t\tthematicLayers={thematicLayers}\n\t\t/>\n\t);\n}\n\nexport function VisualizationSelector({ config }: VisualizationSelectorProps) {\n\tconst [type] = useVisualizationType();\n\tconst { analytics, loading } = useAnalyticsData();\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\theight: \"100%\",\n\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\tjustifyContent: \"center\",\n\t\t\t\t\talignItems: \"center\",\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<CircularLoader small />\n\t\t\t</div>\n\t\t);\n\t}\n\tif (!analytics) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{type === \"pivotTable\" && (\n\t\t\t\t<PivotTableRenderer\n\t\t\t\t\toptions={config?.pivotTable as DHIS2PivotTableOptions}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{type === \"chart\" && (\n\t\t\t\t<ChartRenderer options={config?.chart as ChartConfig} />\n\t\t\t)}\n\t\t\t{type === \"map\" && (\n\t\t\t\t<MapRenderer\n\t\t\t\t\toptions={\n\t\t\t\t\t\tconfig?.map as Omit<\n\t\t\t\t\t\t\tMapProps,\n\t\t\t\t\t\t\t\"orgUnitSelection\" | \"periodSelection\"\n\t\t\t\t\t\t>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, useState } from 'react';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const VisualizationTypeContext = react.createContext("pivotTable");
|
|
7
|
-
const VisualizationConfigContext = react.createContext(void 0);
|
|
8
|
-
const VisualizationTypeSetter = react.createContext(void 0);
|
|
4
|
+
const VisualizationTypeContext = createContext("pivotTable");
|
|
5
|
+
const VisualizationConfigContext = createContext(void 0);
|
|
6
|
+
const VisualizationTypeSetter = createContext(void 0);
|
|
9
7
|
function useVisualizationType() {
|
|
10
8
|
return [
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
useContext(VisualizationTypeContext),
|
|
10
|
+
useContext(VisualizationTypeSetter)
|
|
13
11
|
];
|
|
14
12
|
}
|
|
15
13
|
function useVisualizationConfig() {
|
|
16
|
-
return
|
|
14
|
+
return useContext(VisualizationConfigContext);
|
|
17
15
|
}
|
|
18
|
-
function VisualizationTypeProvider({
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
function VisualizationTypeProvider({
|
|
17
|
+
children,
|
|
18
|
+
defaultType,
|
|
19
|
+
config
|
|
20
|
+
}) {
|
|
21
|
+
const [type, setType] = useState(defaultType);
|
|
22
|
+
return /* @__PURE__ */ jsx(VisualizationTypeContext.Provider, { value: type, children: /* @__PURE__ */ jsx(VisualizationConfigContext.Provider, { value: config, children: /* @__PURE__ */ jsx(VisualizationTypeSetter.Provider, { value: setType, children }) }) });
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
exports.VisualizationTypeContext = VisualizationTypeContext;
|
|
25
|
-
exports.VisualizationTypeProvider = VisualizationTypeProvider;
|
|
26
|
-
exports.VisualizationTypeSetter = VisualizationTypeSetter;
|
|
27
|
-
exports.useVisualizationConfig = useVisualizationConfig;
|
|
28
|
-
exports.useVisualizationType = useVisualizationType;
|
|
25
|
+
export { VisualizationConfigContext, VisualizationTypeContext, VisualizationTypeProvider, VisualizationTypeSetter, useVisualizationConfig, useVisualizationType };
|
|
29
26
|
//# sourceMappingURL=out.js.map
|
|
30
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationTypeProvider/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationTypeProvider/index.tsx"],"names":[],"mappings":"AA4CI;AA5CJ,SAAgB,eAAe,YAAY,gBAAgB;AAKpD,MAAM,2BACZ,cAAiC,YAAY;AACvC,MAAM,6BAA6B,cAExC,MAAS;AACJ,MAAM,0BAA0B,cAErC,MAAS;AAQJ,SAAS,uBAAuB;AACtC,SAAO;AAAA,IACN,WAAW,wBAAwB;AAAA,IACnC,WAAW,uBAAuB;AAAA,EACnC;AAID;AAEO,SAAS,yBAAyB;AACxC,SAAO,WAAW,0BAA0B;AAC7C;AAEO,SAAS,0BAA0B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AACD,GAAmC;AAClC,QAAM,CAAC,MAAM,OAAO,IAAI,SAA4B,WAAW;AAE/D,SACC,oBAAC,yBAAyB,UAAzB,EAAkC,OAAO,MACzC,8BAAC,2BAA2B,UAA3B,EAAoC,OAAO,QAC3C,8BAAC,wBAAwB,UAAxB,EAAiC,OAAO,SACvC,UACF,GACD,GACD;AAEF","sourcesContent":["import React, { createContext, useContext, useState } from \"react\";\nimport { VisualizationConfig } from \"../../index.js\";\n\nexport type VisualizationType = \"pivotTable\" | \"chart\" | \"map\";\n\nexport const VisualizationTypeContext =\n\tcreateContext<VisualizationType>(\"pivotTable\");\nexport const VisualizationConfigContext = createContext<\n\tVisualizationConfig | undefined\n>(undefined);\nexport const VisualizationTypeSetter = createContext<\n\tReact.Dispatch<React.SetStateAction<VisualizationType>> | undefined\n>(undefined);\n\nexport interface VisualizationTypeProviderProps {\n\tchildren: React.ReactNode;\n\tdefaultType: VisualizationType;\n\tconfig: VisualizationConfig;\n}\n\nexport function useVisualizationType() {\n\treturn [\n\t\tuseContext(VisualizationTypeContext),\n\t\tuseContext(VisualizationTypeSetter),\n\t] as [\n\t\tVisualizationType,\n\t\tReact.Dispatch<React.SetStateAction<VisualizationType>>,\n\t];\n}\n\nexport function useVisualizationConfig() {\n\treturn useContext(VisualizationConfigContext);\n}\n\nexport function VisualizationTypeProvider({\n\tchildren,\n\tdefaultType,\n\tconfig,\n}: VisualizationTypeProviderProps) {\n\tconst [type, setType] = useState<VisualizationType>(defaultType);\n\n\treturn (\n\t\t<VisualizationTypeContext.Provider value={type}>\n\t\t\t<VisualizationConfigContext.Provider value={config}>\n\t\t\t\t<VisualizationTypeSetter.Provider value={setType}>\n\t\t\t\t\t{children}\n\t\t\t\t</VisualizationTypeSetter.Provider>\n\t\t\t</VisualizationConfigContext.Provider>\n\t\t</VisualizationTypeContext.Provider>\n\t);\n}\n"]}
|
|
@@ -1,45 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var ui = require('@dhis2/ui');
|
|
7
|
-
var i18n = require('@dhis2/d2-i18n');
|
|
8
|
-
|
|
9
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useVisualizationType, useVisualizationConfig } from '../VisualizationTypeProvider/index.js';
|
|
4
|
+
import { IconTable24, IconVisualizationColumn24, IconWorld24, Tooltip, Button } from '@dhis2/ui';
|
|
5
|
+
import i18n from '@dhis2/d2-i18n';
|
|
12
6
|
|
|
13
7
|
const supportedVisualizationTypes = [
|
|
14
8
|
{
|
|
15
9
|
id: "pivotTable",
|
|
16
|
-
icon: /* @__PURE__ */
|
|
17
|
-
label:
|
|
10
|
+
icon: /* @__PURE__ */ jsx(IconTable24, {}),
|
|
11
|
+
label: i18n.t("Pivot table")
|
|
18
12
|
},
|
|
19
13
|
{
|
|
20
14
|
id: "chart",
|
|
21
|
-
icon: /* @__PURE__ */
|
|
22
|
-
label:
|
|
15
|
+
icon: /* @__PURE__ */ jsx(IconVisualizationColumn24, {}),
|
|
16
|
+
label: i18n.t("Chart")
|
|
23
17
|
},
|
|
24
18
|
{
|
|
25
19
|
id: "map",
|
|
26
|
-
icon: /* @__PURE__ */
|
|
27
|
-
label:
|
|
20
|
+
icon: /* @__PURE__ */ jsx(IconWorld24, {}),
|
|
21
|
+
label: i18n.t("Map")
|
|
28
22
|
}
|
|
29
23
|
];
|
|
30
24
|
function VisualizationTypeSelector() {
|
|
31
|
-
const [type, setType] =
|
|
32
|
-
const config =
|
|
33
|
-
const types =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
const [type, setType] = useVisualizationType();
|
|
26
|
+
const config = useVisualizationConfig();
|
|
27
|
+
const types = useMemo(
|
|
28
|
+
() => supportedVisualizationTypes.filter((supportedType) => {
|
|
29
|
+
return Object.keys(config ?? {}).includes(supportedType.id) && supportedType.id !== type;
|
|
30
|
+
}),
|
|
31
|
+
[type, config]
|
|
32
|
+
);
|
|
33
|
+
return /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 8 }, children: types.map(({ icon, label, id }) => {
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
Tooltip,
|
|
36
|
+
{
|
|
37
|
+
content: i18n.t("View as {{type}}", {
|
|
38
|
+
type: label.toLowerCase()
|
|
39
|
+
}),
|
|
40
|
+
children: /* @__PURE__ */ jsx(
|
|
41
|
+
Button,
|
|
42
|
+
{
|
|
43
|
+
onClick: () => setType(id),
|
|
44
|
+
icon
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
},
|
|
48
|
+
`${label}-tooltip`
|
|
49
|
+
);
|
|
40
50
|
}) });
|
|
41
51
|
}
|
|
42
52
|
|
|
43
|
-
|
|
53
|
+
export { VisualizationTypeSelector };
|
|
44
54
|
//# sourceMappingURL=out.js.map
|
|
45
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationTypeSelector/index.tsx"],"names":[],"mappings":"AAkBQ;AAlBR,SAAgB,eAAe;AAC/B;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,UAAU;AAEjB,MAAM,8BAA8B;AAAA,EACnC;AAAA,IACC,IAAI;AAAA,IACJ,MAAM,oBAAC,eAAY;AAAA,IACnB,OAAO,KAAK,EAAE,aAAa;AAAA,EAC5B;AAAA,EACA;AAAA,IACC,IAAI;AAAA,IACJ,MAAM,oBAAC,6BAA0B;AAAA,IACjC,OAAO,KAAK,EAAE,OAAO;AAAA,EACtB;AAAA,EACA;AAAA,IACC,IAAI;AAAA,IACJ,MAAM,oBAAC,eAAY;AAAA,IACnB,OAAO,KAAK,EAAE,KAAK;AAAA,EACpB;AACD;AAEO,SAAS,4BAA4B;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Visualization/components/VisualizationTypeSelector/index.tsx"],"names":[],"mappings":"AAkBQ;AAlBR,SAAgB,eAAe;AAC/B;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,UAAU;AAEjB,MAAM,8BAA8B;AAAA,EACnC;AAAA,IACC,IAAI;AAAA,IACJ,MAAM,oBAAC,eAAY;AAAA,IACnB,OAAO,KAAK,EAAE,aAAa;AAAA,EAC5B;AAAA,EACA;AAAA,IACC,IAAI;AAAA,IACJ,MAAM,oBAAC,6BAA0B;AAAA,IACjC,OAAO,KAAK,EAAE,OAAO;AAAA,EACtB;AAAA,EACA;AAAA,IACC,IAAI;AAAA,IACJ,MAAM,oBAAC,eAAY;AAAA,IACnB,OAAO,KAAK,EAAE,KAAK;AAAA,EACpB;AACD;AAEO,SAAS,4BAA4B;AAC3C,QAAM,CAAC,MAAM,OAAO,IAAI,qBAAqB;AAC7C,QAAM,SAAS,uBAAuB;AAEtC,QAAM,QAAQ;AAAA,IACb,MACC,4BAA4B,OAAO,CAAC,kBAAkB;AACrD,aACC,OAAO,KAAK,UAAU,CAAC,CAAC,EAAE,SAAS,cAAc,EAAE,KACnD,cAAc,OAAO;AAAA,IAEvB,CAAC;AAAA,IACF,CAAC,MAAM,MAAM;AAAA,EACd;AAEA,SACC,oBAAC,SAAI,OAAO,EAAE,SAAS,QAAQ,KAAK,EAAE,GACpC,gBAAM,IAAI,CAAC,EAAE,MAAM,OAAO,GAAG,MAAM;AACnC,WACC;AAAA,MAAC;AAAA;AAAA,QAEA,SAAS,KAAK,EAAE,oBAAoB;AAAA,UACnC,MAAM,MAAM,YAAY;AAAA,QACzB,CAAC;AAAA,QAED;AAAA,UAAC;AAAA;AAAA,YACA,SAAS,MAAM,QAAQ,EAAuB;AAAA,YAC9C;AAAA;AAAA,QACD;AAAA;AAAA,MARK,GAAG,KAAK;AAAA,IASd;AAAA,EAEF,CAAC,GACF;AAEF","sourcesContent":["import React, { useMemo } from \"react\";\nimport {\n\tuseVisualizationConfig,\n\tuseVisualizationType,\n\tVisualizationType,\n} from \"../VisualizationTypeProvider/index.js\";\nimport {\n\tButton,\n\tIconTable24,\n\tIconVisualizationColumn24,\n\tIconWorld24,\n\tTooltip,\n} from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\n\nconst supportedVisualizationTypes = [\n\t{\n\t\tid: \"pivotTable\",\n\t\ticon: <IconTable24 />,\n\t\tlabel: i18n.t(\"Pivot table\"),\n\t},\n\t{\n\t\tid: \"chart\",\n\t\ticon: <IconVisualizationColumn24 />,\n\t\tlabel: i18n.t(\"Chart\"),\n\t},\n\t{\n\t\tid: \"map\",\n\t\ticon: <IconWorld24 />,\n\t\tlabel: i18n.t(\"Map\"),\n\t},\n];\n\nexport function VisualizationTypeSelector() {\n\tconst [type, setType] = useVisualizationType();\n\tconst config = useVisualizationConfig();\n\n\tconst types = useMemo(\n\t\t() =>\n\t\t\tsupportedVisualizationTypes.filter((supportedType) => {\n\t\t\t\treturn (\n\t\t\t\t\tObject.keys(config ?? {}).includes(supportedType.id) &&\n\t\t\t\t\tsupportedType.id !== type\n\t\t\t\t);\n\t\t\t}),\n\t\t[type, config],\n\t);\n\n\treturn (\n\t\t<div style={{ display: \"flex\", gap: 8 }}>\n\t\t\t{types.map(({ icon, label, id }) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tkey={`${label}-tooltip`}\n\t\t\t\t\t\tcontent={i18n.t(\"View as {{type}}\", {\n\t\t\t\t\t\t\ttype: label.toLowerCase(),\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tonClick={() => setType(id as VisualizationType)}\n\t\t\t\t\t\t\ticon={icon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var i18n = require('@dhis2/d2-i18n');
|
|
10
|
-
var ui = require('@dhis2/ui');
|
|
11
|
-
|
|
12
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
|
|
14
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { VisualizationProvider } from './components/VisualizationProvider/index.js';
|
|
3
|
+
import { VisualizationTypeSelector } from './components/VisualizationTypeSelector/index.js';
|
|
4
|
+
import { VisualizationDimensionSelector } from './components/VisualizationDimensionSelector/index.js';
|
|
5
|
+
import { VisualizationSelector } from './components/VisualizationSelector/index.js';
|
|
6
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
7
|
+
import i18n from '@dhis2/d2-i18n';
|
|
8
|
+
import { IconError24, colors, Button } from '@dhis2/ui';
|
|
15
9
|
|
|
16
10
|
function ErrorFallback({
|
|
17
11
|
error,
|
|
18
12
|
resetErrorBoundary,
|
|
19
13
|
height
|
|
20
14
|
}) {
|
|
21
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsxs(
|
|
22
16
|
"div",
|
|
23
17
|
{
|
|
24
18
|
style: {
|
|
@@ -33,19 +27,19 @@ function ErrorFallback({
|
|
|
33
27
|
padding: 16
|
|
34
28
|
},
|
|
35
29
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ jsx(IconError24, {}),
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
38
32
|
"h3",
|
|
39
33
|
{
|
|
40
34
|
style: {
|
|
41
|
-
color:
|
|
35
|
+
color: colors.grey800,
|
|
42
36
|
margin: 0
|
|
43
37
|
},
|
|
44
|
-
children:
|
|
38
|
+
children: i18n.t("Could not load visualization")
|
|
45
39
|
}
|
|
46
40
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
resetErrorBoundary && /* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: error.message }),
|
|
42
|
+
resetErrorBoundary && /* @__PURE__ */ jsx(Button, { onClick: resetErrorBoundary, small: true, children: i18n.t("Try again") })
|
|
49
43
|
]
|
|
50
44
|
}
|
|
51
45
|
);
|
|
@@ -60,19 +54,19 @@ function Visualization({
|
|
|
60
54
|
showOrgUnitSelector,
|
|
61
55
|
showPeriodSelector
|
|
62
56
|
}) {
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
57
|
+
return /* @__PURE__ */ jsx(
|
|
58
|
+
ErrorBoundary,
|
|
65
59
|
{
|
|
66
60
|
resetKeys: [dimensions, layout, defaultVisualizationType, config],
|
|
67
|
-
fallbackRender: (props) => /* @__PURE__ */
|
|
68
|
-
children: /* @__PURE__ */
|
|
69
|
-
VisualizationProvider
|
|
61
|
+
fallbackRender: (props) => /* @__PURE__ */ jsx(ErrorFallback, { height, ...props }),
|
|
62
|
+
children: /* @__PURE__ */ jsx(
|
|
63
|
+
VisualizationProvider,
|
|
70
64
|
{
|
|
71
65
|
config,
|
|
72
66
|
type: defaultVisualizationType,
|
|
73
67
|
layout,
|
|
74
68
|
dimensions,
|
|
75
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ jsxs(
|
|
76
70
|
"div",
|
|
77
71
|
{
|
|
78
72
|
style: {
|
|
@@ -83,7 +77,7 @@ function Visualization({
|
|
|
83
77
|
gap: 16
|
|
84
78
|
},
|
|
85
79
|
children: [
|
|
86
|
-
showToolbar && /* @__PURE__ */
|
|
80
|
+
showToolbar && /* @__PURE__ */ jsxs(
|
|
87
81
|
"div",
|
|
88
82
|
{
|
|
89
83
|
style: {
|
|
@@ -93,9 +87,9 @@ function Visualization({
|
|
|
93
87
|
justifyContent: "space-between"
|
|
94
88
|
},
|
|
95
89
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
VisualizationDimensionSelector
|
|
90
|
+
/* @__PURE__ */ jsx(VisualizationTypeSelector, {}),
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
VisualizationDimensionSelector,
|
|
99
93
|
{
|
|
100
94
|
showPeriodSelector,
|
|
101
95
|
showOrgUnitSelector
|
|
@@ -104,7 +98,7 @@ function Visualization({
|
|
|
104
98
|
]
|
|
105
99
|
}
|
|
106
100
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(VisualizationSelector, { config }) })
|
|
108
102
|
]
|
|
109
103
|
}
|
|
110
104
|
)
|
|
@@ -114,6 +108,6 @@ function Visualization({
|
|
|
114
108
|
);
|
|
115
109
|
}
|
|
116
110
|
|
|
117
|
-
|
|
111
|
+
export { Visualization };
|
|
118
112
|
//# sourceMappingURL=out.js.map
|
|
119
113
|
//# sourceMappingURL=index.js.map
|