@hisptz/dhis2-analytics 2.0.0-alpha.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.js +43 -20
- package/dist/components/ChartAnalytics/DHIS2Chart.js +43 -17
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +16 -14
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +14 -8
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.js +21 -19
- package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +1 -0
- package/dist/components/ChartAnalytics/hooks/useChart.js +12 -10
- package/dist/components/ChartAnalytics/index.js +12 -1
- package/dist/components/ChartAnalytics/models/bar.js +6 -3
- package/dist/components/ChartAnalytics/models/column.js +9 -6
- package/dist/components/ChartAnalytics/models/index.js +3 -1
- package/dist/components/ChartAnalytics/models/line.js +8 -6
- package/dist/components/ChartAnalytics/models/multi-series.js +14 -12
- package/dist/components/ChartAnalytics/models/pie.js +7 -5
- package/dist/components/ChartAnalytics/services/export.js +20 -7
- package/dist/components/ChartAnalytics/types/props.js +1 -0
- package/dist/components/ChartAnalytics/utils/chart.js +31 -24
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js +23 -14
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +10 -3
- package/dist/components/CircularProgressDashboard/index.js +19 -2
- package/dist/components/CircularProgressDashboard/types/props.js +1 -0
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js +15 -13
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.js +14 -5
- package/dist/components/DHIS2PivotTable/components/Table/index.js +6 -4
- package/dist/components/DHIS2PivotTable/components/TableBody/index.js +31 -25
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js +30 -24
- package/dist/components/DHIS2PivotTable/index.js +19 -2
- package/dist/components/DHIS2PivotTable/interfaces/index.js +1 -0
- package/dist/components/DHIS2PivotTable/services/engine.js +12 -10
- package/dist/components/DHIS2PivotTable/state/engine.js +9 -6
- package/dist/components/Map/DHIS2Map.js +20 -13
- package/dist/components/Map/DHIS2Map.stories.js +17 -3
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js +21 -15
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +15 -10
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js +18 -16
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +12 -7
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js +30 -24
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js +49 -42
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js +22 -16
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js +32 -26
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js +16 -10
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js +27 -21
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +18 -15
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js +19 -2
- package/dist/components/Map/components/MapArea/index.js +41 -32
- package/dist/components/Map/components/MapArea/interfaces/index.js +1 -0
- package/dist/components/Map/components/MapControls/components/CustomControl/index.js +5 -3
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.js +14 -8
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.js +9 -7
- package/dist/components/Map/components/MapControls/index.js +17 -10
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +5 -3
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js +31 -21
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +31 -21
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +88 -80
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +14 -9
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +69 -62
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +3 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +41 -19
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +9 -1
- package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +8 -6
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.js +57 -46
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +31 -25
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +7 -5
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.js +28 -21
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +12 -10
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +32 -21
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +20 -13
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +23 -17
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +27 -18
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +19 -13
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +21 -15
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +8 -6
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js +24 -16
- package/dist/components/Map/components/MapLayer/index.js +18 -10
- package/dist/components/Map/components/MapLayer/interfaces/index.js +3 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +63 -59
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js +36 -30
- package/dist/components/Map/components/MapProvider/hooks/index.js +10 -6
- package/dist/components/Map/components/MapProvider/index.js +31 -25
- package/dist/components/Map/components/MapUpdater/index.js +7 -5
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js +21 -15
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +10 -5
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js +60 -53
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +12 -7
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +15 -9
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js +4 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +30 -22
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +18 -7
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +30 -23
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +22 -16
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +22 -16
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js +22 -16
- package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.js +24 -18
- package/dist/components/Map/components/ThematicLayerConfiguration/index.js +26 -3
- package/dist/components/Map/components/ThematicLayerConfiguration/types/index.js +1 -0
- package/dist/components/Map/constants/colors.js +4 -1
- package/dist/components/Map/constants/legendSet.js +3 -1
- package/dist/components/Map/hooks/map.js +21 -17
- package/dist/components/Map/index.js +40 -5
- package/dist/components/Map/interfaces/index.js +1 -0
- package/dist/components/Map/state/index.js +9 -5
- package/dist/components/Map/utils/colors.js +19 -7
- package/dist/components/Map/utils/helpers.js +11 -3
- package/dist/components/Map/utils/map.js +23 -13
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.js +11 -3
- package/dist/components/SingleValueContainer/SingleValueVisualizer.js +35 -17
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +21 -14
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +13 -7
- package/dist/components/SingleValueContainer/index.js +26 -3
- package/dist/components/SingleValueContainer/types/props.js +1 -0
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.js +23 -20
- package/dist/components/Visualization/components/DimensionsProvider/index.js +18 -13
- package/dist/components/Visualization/components/LayoutProvider/index.js +11 -7
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js +36 -30
- package/dist/components/Visualization/components/VisualizationProvider/index.js +9 -7
- package/dist/components/Visualization/components/VisualizationSelector/index.js +57 -46
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.js +18 -11
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.js +27 -21
- package/dist/components/Visualization/index.js +33 -27
- package/dist/esm/components/ChartAnalytics/ChartAnalytics.stories.js +254 -0
- package/dist/esm/components/ChartAnalytics/ChartAnalytics.stories.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/DHIS2Chart.js +36 -0
- package/dist/esm/components/ChartAnalytics/DHIS2Chart.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +52 -0
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +42 -0
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/constants/menu.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/index.js +65 -0
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +3 -0
- package/dist/esm/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/hooks/useChart.js +43 -0
- package/dist/esm/components/ChartAnalytics/hooks/useChart.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/index.js +3 -0
- package/dist/esm/components/ChartAnalytics/index.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/models/bar.js +21 -0
- package/dist/esm/components/ChartAnalytics/models/bar.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/models/column.js +48 -0
- package/dist/esm/components/ChartAnalytics/models/column.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/models/index.js +114 -0
- package/dist/esm/components/ChartAnalytics/models/index.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/models/line.js +31 -0
- package/dist/esm/components/ChartAnalytics/models/line.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/models/multi-series.js +112 -0
- package/dist/esm/components/ChartAnalytics/models/multi-series.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/models/pie.js +53 -0
- package/dist/esm/components/ChartAnalytics/models/pie.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/services/export.js +35 -0
- package/dist/esm/components/ChartAnalytics/services/export.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/styles/custom-highchart.css +40 -0
- package/dist/esm/components/ChartAnalytics/styles/custom-highchart.css.map +1 -0
- package/dist/esm/components/ChartAnalytics/types/props.js +3 -0
- package/dist/esm/components/ChartAnalytics/types/props.js.map +1 -0
- package/dist/esm/components/ChartAnalytics/utils/chart.js +130 -0
- package/dist/esm/components/ChartAnalytics/utils/chart.js.map +1 -0
- package/dist/esm/components/CircularProgressDashboard/CircularProgressIndicator.js +66 -0
- package/dist/esm/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -0
- package/dist/esm/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +42 -0
- package/dist/esm/components/CircularProgressDashboard/CircularProgressIndicator.stories.js.map +1 -0
- package/dist/esm/components/CircularProgressDashboard/index.js +4 -0
- package/dist/esm/components/CircularProgressDashboard/index.js.map +1 -0
- package/dist/esm/components/CircularProgressDashboard/types/props.js +3 -0
- package/dist/esm/components/CircularProgressDashboard/types/props.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/DHIS2PivotTable.js +26 -0
- package/dist/esm/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/DHIS2PivotTable.stories.js +30 -0
- package/dist/esm/components/DHIS2PivotTable/DHIS2PivotTable.stories.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/components/Table/index.js +10 -0
- package/dist/esm/components/DHIS2PivotTable/components/Table/index.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableBody/TableBody.module.css +11 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableBody/TableBody.module.css.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableBody/index.js +106 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css +10 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/TableHeaders.module.css.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/index.js +94 -0
- package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/index.js +4 -0
- package/dist/esm/components/DHIS2PivotTable/index.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/interfaces/index.js +3 -0
- package/dist/esm/components/DHIS2PivotTable/interfaces/index.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/services/engine.js +87 -0
- package/dist/esm/components/DHIS2PivotTable/services/engine.js.map +1 -0
- package/dist/esm/components/DHIS2PivotTable/state/engine.js +17 -0
- package/dist/esm/components/DHIS2PivotTable/state/engine.js.map +1 -0
- package/dist/esm/components/Map/DHIS2Map.js +65 -0
- package/dist/esm/components/Map/DHIS2Map.js.map +1 -0
- package/dist/esm/components/Map/DHIS2Map.stories.js +366 -0
- package/dist/esm/components/Map/DHIS2Map.stories.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js +41 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +34 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js +26 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +21 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js +67 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js +134 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/Name.js +44 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js +67 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js +24 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js +67 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +45 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/index.js +4 -0
- package/dist/esm/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapArea/index.js +100 -0
- package/dist/esm/components/Map/components/MapArea/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapArea/interfaces/index.js +3 -0
- package/dist/esm/components/Map/components/MapArea/interfaces/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapControls/components/CustomControl/index.js +16 -0
- package/dist/esm/components/Map/components/MapControls/components/CustomControl/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapControls/components/DownloadControl/index.js +15 -0
- package/dist/esm/components/Map/components/MapControls/components/DownloadControl/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapControls/components/FullscreenControl/index.js +13 -0
- package/dist/esm/components/Map/components/MapControls/components/FullscreenControl/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapControls/index.js +35 -0
- package/dist/esm/components/Map/components/MapControls/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +10 -0
- package/dist/esm/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/BoundaryLayer/index.js +52 -0
- package/dist/esm/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +100 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +457 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +32 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +197 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +3 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31466 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +365 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +93 -0
- package/dist/esm/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +10 -0
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +17 -0
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/index.js +179 -0
- package/dist/esm/components/Map/components/MapLayer/components/LegendArea/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +92 -0
- package/dist/esm/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +11 -0
- package/dist/esm/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/PointLayer/index.js +48 -0
- package/dist/esm/components/Map/components/MapLayer/components/PointLayer/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +64 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +130 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +41 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +50 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +56 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +40 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +40 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +12 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/index.js +55 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +56 -0
- package/dist/esm/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/index.js +32 -0
- package/dist/esm/components/Map/components/MapLayer/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapLayer/interfaces/index.js +10 -0
- package/dist/esm/components/Map/components/MapLayer/interfaces/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +405 -0
- package/dist/esm/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapProvider/components/MapLayerProvider/index.js +115 -0
- package/dist/esm/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapProvider/hooks/index.js +16 -0
- package/dist/esm/components/Map/components/MapProvider/hooks/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapProvider/index.js +95 -0
- package/dist/esm/components/Map/components/MapProvider/index.js.map +1 -0
- package/dist/esm/components/Map/components/MapUpdater/index.js +11 -0
- package/dist/esm/components/Map/components/MapUpdater/index.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js +41 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +24 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js +174 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +21 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +36 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js +436 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +71 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +15 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +12 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +82 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +57 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +44 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +60 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js +54 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/TypeField.js +63 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/components/TypeField.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/index.js +5 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/types/index.js +3 -0
- package/dist/esm/components/Map/components/ThematicLayerConfiguration/types/index.js.map +1 -0
- package/dist/esm/components/Map/constants/colors.js +436 -0
- package/dist/esm/components/Map/constants/colors.js.map +1 -0
- package/dist/esm/components/Map/constants/legendSet.js +23 -0
- package/dist/esm/components/Map/constants/legendSet.js.map +1 -0
- package/dist/esm/components/Map/hooks/map.js +44 -0
- package/dist/esm/components/Map/hooks/map.js.map +1 -0
- package/dist/esm/components/Map/index.js +7 -0
- package/dist/esm/components/Map/index.js.map +1 -0
- package/dist/esm/components/Map/interfaces/index.js +3 -0
- package/dist/esm/components/Map/interfaces/index.js.map +1 -0
- package/dist/esm/components/Map/state/index.js +18 -0
- package/dist/esm/components/Map/state/index.js.map +1 -0
- package/dist/esm/components/Map/utils/colors.js +85 -0
- package/dist/esm/components/Map/utils/colors.js.map +1 -0
- package/dist/esm/components/Map/utils/helpers.js +18 -0
- package/dist/esm/components/Map/utils/helpers.js.map +1 -0
- package/dist/esm/components/Map/utils/map.js +138 -0
- package/dist/esm/components/Map/utils/map.js.map +1 -0
- package/dist/esm/components/SingleValueContainer/SingleValueContainer.stories.js +145 -0
- package/dist/esm/components/SingleValueContainer/SingleValueContainer.stories.js.map +1 -0
- package/dist/esm/components/SingleValueContainer/SingleValueVisualizer.js +44 -0
- package/dist/esm/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -0
- package/dist/esm/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +49 -0
- package/dist/esm/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -0
- package/dist/esm/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +22 -0
- package/dist/esm/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js.map +1 -0
- package/dist/esm/components/SingleValueContainer/index.js +5 -0
- package/dist/esm/components/SingleValueContainer/index.js.map +1 -0
- package/dist/esm/components/SingleValueContainer/styles/SingleValueContainer.module.css +32 -0
- package/dist/esm/components/SingleValueContainer/styles/SingleValueContainer.module.css.map +1 -0
- package/dist/esm/components/SingleValueContainer/types/props.js +3 -0
- package/dist/esm/components/SingleValueContainer/types/props.js.map +1 -0
- package/dist/esm/components/Visualization/components/AnalyticsDataProvider/index.js +94 -0
- package/dist/esm/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -0
- package/dist/esm/components/Visualization/components/DimensionsProvider/index.js +35 -0
- package/dist/esm/components/Visualization/components/DimensionsProvider/index.js.map +1 -0
- package/dist/esm/components/Visualization/components/LayoutProvider/index.js +18 -0
- package/dist/esm/components/Visualization/components/LayoutProvider/index.js.map +1 -0
- package/dist/esm/components/Visualization/components/VisualizationDimensionSelector/index.js +85 -0
- package/dist/esm/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -0
- package/dist/esm/components/Visualization/components/VisualizationProvider/index.js +19 -0
- package/dist/esm/components/Visualization/components/VisualizationProvider/index.js.map +1 -0
- package/dist/esm/components/Visualization/components/VisualizationSelector/index.js +167 -0
- package/dist/esm/components/Visualization/components/VisualizationSelector/index.js.map +1 -0
- package/dist/esm/components/Visualization/components/VisualizationTypeProvider/index.js +27 -0
- package/dist/esm/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -0
- package/dist/esm/components/Visualization/components/VisualizationTypeSelector/index.js +55 -0
- package/dist/esm/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -0
- package/dist/esm/components/Visualization/index.js +113 -0
- package/dist/esm/components/Visualization/index.js.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.js +47 -6
- package/package.json +5 -6
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var ui = require('@dhis2/ui');
|
|
6
|
+
var i18n = require('@dhis2/d2-i18n');
|
|
7
|
+
var index_js = require('../DimensionsProvider/index.js');
|
|
8
|
+
var dhis2Ui = require('@hisptz/dhis2-ui');
|
|
9
|
+
var index_js$1 = require('../VisualizationSelector/index.js');
|
|
10
|
+
var map_js = require('../../../Map/utils/map.js');
|
|
11
|
+
|
|
12
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
9
15
|
|
|
10
16
|
function VisualizationDimensionSelector({
|
|
11
17
|
showPeriodSelector,
|
|
12
18
|
showOrgUnitSelector
|
|
13
19
|
}) {
|
|
14
|
-
const [dimensions, setDimensions] = useDimensions();
|
|
15
|
-
const periods = useMemo(() => dimensions.pe, [dimensions.pe]);
|
|
16
|
-
const orgUnitSelection = useMemo(
|
|
17
|
-
() => getOrgUnitSelectionFromIds(dimensions.ou ?? []),
|
|
20
|
+
const [dimensions, setDimensions] = index_js.useDimensions();
|
|
21
|
+
const periods = react.useMemo(() => dimensions.pe, [dimensions.pe]);
|
|
22
|
+
const orgUnitSelection = react.useMemo(
|
|
23
|
+
() => index_js$1.getOrgUnitSelectionFromIds(dimensions.ou ?? []),
|
|
18
24
|
[dimensions.ou]
|
|
19
25
|
);
|
|
20
|
-
const [openFilter, setOpenFilter] = useState();
|
|
21
|
-
const onFilterUpdate = useCallback(
|
|
26
|
+
const [openFilter, setOpenFilter] = react.useState();
|
|
27
|
+
const onFilterUpdate = react.useCallback(
|
|
22
28
|
(type) => (data) => {
|
|
23
29
|
setOpenFilter(void 0);
|
|
24
30
|
if (type === "ou") {
|
|
25
31
|
setDimensions({
|
|
26
32
|
dimension: "ou",
|
|
27
|
-
value: getOrgUnitsSelection(data)
|
|
33
|
+
value: map_js.getOrgUnitsSelection(data)
|
|
28
34
|
});
|
|
29
35
|
return;
|
|
30
36
|
}
|
|
@@ -35,10 +41,10 @@ function VisualizationDimensionSelector({
|
|
|
35
41
|
},
|
|
36
42
|
[setDimensions]
|
|
37
43
|
);
|
|
38
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
39
|
-
showPeriodSelector && /* @__PURE__ */ jsx(Tooltip, { content:
|
|
40
|
-
/* @__PURE__ */ jsx(
|
|
41
|
-
PeriodSelectorModal,
|
|
44
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
45
|
+
showPeriodSelector && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { content: i18n__default.default.t("Period"), children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
47
|
+
dhis2Ui.PeriodSelectorModal,
|
|
42
48
|
{
|
|
43
49
|
position: "middle",
|
|
44
50
|
enablePeriodSelector: true,
|
|
@@ -48,38 +54,38 @@ function VisualizationDimensionSelector({
|
|
|
48
54
|
onUpdate: onFilterUpdate("pe")
|
|
49
55
|
}
|
|
50
56
|
),
|
|
51
|
-
/* @__PURE__ */ jsx(
|
|
52
|
-
Button,
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
+
ui.Button,
|
|
53
59
|
{
|
|
54
60
|
onClick: () => setOpenFilter("pe"),
|
|
55
|
-
icon: /* @__PURE__ */ jsx(IconClock24, {})
|
|
61
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.IconClock24, {})
|
|
56
62
|
}
|
|
57
63
|
)
|
|
58
64
|
] }) }),
|
|
59
|
-
showOrgUnitSelector && /* @__PURE__ */ jsx(Tooltip, { content:
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
61
|
-
OrgUnitSelectorModal,
|
|
65
|
+
showOrgUnitSelector && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { content: i18n__default.default.t("Location"), children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
66
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
67
|
+
dhis2Ui.OrgUnitSelectorModal,
|
|
62
68
|
{
|
|
63
69
|
showUserOptions: true,
|
|
64
70
|
searchable: true,
|
|
65
|
-
title:
|
|
71
|
+
title: i18n__default.default.t("Select location(s)"),
|
|
66
72
|
value: orgUnitSelection,
|
|
67
73
|
onClose: () => setOpenFilter(void 0),
|
|
68
74
|
hide: openFilter !== "ou",
|
|
69
75
|
onUpdate: onFilterUpdate("ou")
|
|
70
76
|
}
|
|
71
77
|
),
|
|
72
|
-
/* @__PURE__ */ jsx(
|
|
73
|
-
Button,
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
ui.Button,
|
|
74
80
|
{
|
|
75
81
|
onClick: () => setOpenFilter("ou"),
|
|
76
|
-
icon: /* @__PURE__ */ jsx(IconLocation24, {})
|
|
82
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.IconLocation24, {})
|
|
77
83
|
}
|
|
78
84
|
)
|
|
79
85
|
] }) })
|
|
80
86
|
] }) });
|
|
81
87
|
}
|
|
82
88
|
|
|
83
|
-
|
|
89
|
+
exports.VisualizationDimensionSelector = VisualizationDimensionSelector;
|
|
84
90
|
//# sourceMappingURL=out.js.map
|
|
85
91
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var index_js$2 = require('../LayoutProvider/index.js');
|
|
5
|
+
var index_js = require('../DimensionsProvider/index.js');
|
|
6
|
+
var index_js$3 = require('../AnalyticsDataProvider/index.js');
|
|
7
|
+
var index_js$1 = require('../VisualizationTypeProvider/index.js');
|
|
6
8
|
|
|
7
9
|
function VisualizationProvider({
|
|
8
10
|
layout,
|
|
@@ -11,9 +13,9 @@ function VisualizationProvider({
|
|
|
11
13
|
type,
|
|
12
14
|
config
|
|
13
15
|
}) {
|
|
14
|
-
return /* @__PURE__ */ jsx(DimensionsProvider, { dimensions, children: /* @__PURE__ */ jsx(VisualizationTypeProvider, { config, defaultType: type, children: /* @__PURE__ */ jsx(LayoutProvider, { defaultLayout: layout, children: /* @__PURE__ */ jsx(AnalyticsDataProvider, { children }) }) }) });
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index_js.DimensionsProvider, { dimensions, children: /* @__PURE__ */ jsxRuntime.jsx(index_js$1.VisualizationTypeProvider, { config, defaultType: type, children: /* @__PURE__ */ jsxRuntime.jsx(index_js$2.LayoutProvider, { defaultLayout: layout, children: /* @__PURE__ */ jsxRuntime.jsx(index_js$3.AnalyticsDataProvider, { children }) }) }) });
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
exports.VisualizationProvider = VisualizationProvider;
|
|
18
20
|
//# sourceMappingURL=out.js.map
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var index_js$6 = require('../VisualizationTypeProvider/index.js');
|
|
6
|
+
var index_js$1 = require('../AnalyticsDataProvider/index.js');
|
|
7
|
+
var ui = require('@dhis2/ui');
|
|
8
|
+
var index_js$2 = require('../../../DHIS2PivotTable/index.js');
|
|
9
|
+
var index_js = require('../LayoutProvider/index.js');
|
|
10
|
+
var lodash = require('lodash');
|
|
11
|
+
var index_js$4 = require('../DimensionsProvider/index.js');
|
|
12
|
+
var i18n = require('@dhis2/d2-i18n');
|
|
13
|
+
var index_js$3 = require('../../../ChartAnalytics/index.js');
|
|
14
|
+
var index_js$5 = require('../../../Map/index.js');
|
|
15
|
+
|
|
16
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
|
|
18
|
+
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
13
19
|
|
|
14
20
|
function getDimensionLabel(dimension) {
|
|
15
21
|
switch (dimension) {
|
|
16
22
|
case "pe":
|
|
17
|
-
return
|
|
23
|
+
return i18n__default.default.t("Period");
|
|
18
24
|
case "ou":
|
|
19
|
-
return
|
|
25
|
+
return i18n__default.default.t("Organisation unit");
|
|
20
26
|
case "dx":
|
|
21
|
-
return
|
|
27
|
+
return i18n__default.default.t("Data");
|
|
22
28
|
default:
|
|
23
29
|
return "";
|
|
24
30
|
}
|
|
@@ -27,13 +33,13 @@ function getOrgUnitSelectionFromIds(ous) {
|
|
|
27
33
|
const orgUnitSelection = {
|
|
28
34
|
orgUnits: []
|
|
29
35
|
};
|
|
30
|
-
forEach(ous, (ou) => {
|
|
36
|
+
lodash.forEach(ous, (ou) => {
|
|
31
37
|
if (ou === "USER_ORGUNIT") {
|
|
32
|
-
set(orgUnitSelection, ["userOrgUnit"], true);
|
|
38
|
+
lodash.set(orgUnitSelection, ["userOrgUnit"], true);
|
|
33
39
|
} else if (ou === "USER_ORGUNIT_CHILDREN") {
|
|
34
|
-
set(orgUnitSelection, ["userSubUnit"], true);
|
|
40
|
+
lodash.set(orgUnitSelection, ["userSubUnit"], true);
|
|
35
41
|
} else if (ou === "USER_ORGUNIT_GRANDCHILDREN") {
|
|
36
|
-
set(orgUnitSelection, ["userSubX2Unit"], true);
|
|
42
|
+
lodash.set(orgUnitSelection, ["userSubX2Unit"], true);
|
|
37
43
|
} else {
|
|
38
44
|
const orgUnits = [...orgUnitSelection.orgUnits ?? []];
|
|
39
45
|
orgUnits.push({
|
|
@@ -41,7 +47,7 @@ function getOrgUnitSelectionFromIds(ous) {
|
|
|
41
47
|
children: [],
|
|
42
48
|
path: ""
|
|
43
49
|
});
|
|
44
|
-
set(orgUnitSelection, ["orgUnits"], orgUnits);
|
|
50
|
+
lodash.set(orgUnitSelection, ["orgUnits"], orgUnits);
|
|
45
51
|
}
|
|
46
52
|
});
|
|
47
53
|
return orgUnitSelection;
|
|
@@ -49,10 +55,10 @@ function getOrgUnitSelectionFromIds(ous) {
|
|
|
49
55
|
function PivotTableRenderer({
|
|
50
56
|
options
|
|
51
57
|
}) {
|
|
52
|
-
const [layout] = useLayout();
|
|
53
|
-
const { analytics } = useAnalyticsData();
|
|
54
|
-
const sanitizedLayout = useMemo(() => {
|
|
55
|
-
return mapValues(
|
|
58
|
+
const [layout] = index_js.useLayout();
|
|
59
|
+
const { analytics } = index_js$1.useAnalyticsData();
|
|
60
|
+
const sanitizedLayout = react.useMemo(() => {
|
|
61
|
+
return lodash.mapValues(
|
|
56
62
|
layout,
|
|
57
63
|
(dimension) => dimension.map((dimension2) => ({
|
|
58
64
|
dimension: dimension2,
|
|
@@ -63,8 +69,8 @@ function PivotTableRenderer({
|
|
|
63
69
|
if (!analytics) {
|
|
64
70
|
return null;
|
|
65
71
|
}
|
|
66
|
-
return /* @__PURE__ */ jsx(
|
|
67
|
-
DHIS2PivotTable,
|
|
72
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
+
index_js$2.DHIS2PivotTable,
|
|
68
74
|
{
|
|
69
75
|
tableProps: {
|
|
70
76
|
scrollHeight: options.scrollHeight ?? "100%",
|
|
@@ -77,26 +83,26 @@ function PivotTableRenderer({
|
|
|
77
83
|
);
|
|
78
84
|
}
|
|
79
85
|
function ChartRenderer({ options }) {
|
|
80
|
-
const { analytics } = useAnalyticsData();
|
|
86
|
+
const { analytics } = index_js$1.useAnalyticsData();
|
|
81
87
|
if (!analytics) {
|
|
82
88
|
return null;
|
|
83
89
|
}
|
|
84
|
-
return /* @__PURE__ */ jsx(DHIS2Chart, { analytics, config: { ...options } });
|
|
90
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index_js$3.DHIS2Chart, { analytics, config: { ...options } });
|
|
85
91
|
}
|
|
86
92
|
function MapRenderer({
|
|
87
93
|
options
|
|
88
94
|
}) {
|
|
89
|
-
const [dimensions] = useDimensions();
|
|
90
|
-
const { analytics } = useAnalyticsData();
|
|
91
|
-
const orgUnitSelection = useMemo(() => {
|
|
95
|
+
const [dimensions] = index_js$4.useDimensions();
|
|
96
|
+
const { analytics } = index_js$1.useAnalyticsData();
|
|
97
|
+
const orgUnitSelection = react.useMemo(() => {
|
|
92
98
|
return getOrgUnitSelectionFromIds(dimensions.ou ?? []);
|
|
93
99
|
}, [dimensions.ou]);
|
|
94
|
-
const thematicLayers = useMemo(() => {
|
|
95
|
-
const valueIndex = findIndex(analytics.headers, ["name", "value"]) ?? -1;
|
|
100
|
+
const thematicLayers = react.useMemo(() => {
|
|
101
|
+
const valueIndex = lodash.findIndex(analytics.headers, ["name", "value"]) ?? -1;
|
|
96
102
|
return analytics.metaData?.dimensions["dx"]?.map((dataId) => {
|
|
97
|
-
const config = find(options.thematicLayers, ["id", dataId]);
|
|
103
|
+
const config = lodash.find(options.thematicLayers, ["id", dataId]);
|
|
98
104
|
const data = analytics.metaData?.dimensions?.ou?.map((ouId) => {
|
|
99
|
-
const values = filter(
|
|
105
|
+
const values = lodash.filter(
|
|
100
106
|
analytics.rows,
|
|
101
107
|
(row) => row.includes(dataId) && row.includes(ouId)
|
|
102
108
|
);
|
|
@@ -116,8 +122,8 @@ function MapRenderer({
|
|
|
116
122
|
};
|
|
117
123
|
}) ?? [];
|
|
118
124
|
}, [analytics]);
|
|
119
|
-
return /* @__PURE__ */ jsx(
|
|
120
|
-
DHIS2Map,
|
|
125
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
126
|
+
index_js$5.DHIS2Map,
|
|
121
127
|
{
|
|
122
128
|
orgUnitSelection,
|
|
123
129
|
thematicLayers
|
|
@@ -125,10 +131,10 @@ function MapRenderer({
|
|
|
125
131
|
);
|
|
126
132
|
}
|
|
127
133
|
function VisualizationSelector({ config }) {
|
|
128
|
-
const [type] = useVisualizationType();
|
|
129
|
-
const { analytics, loading } = useAnalyticsData();
|
|
134
|
+
const [type] = index_js$6.useVisualizationType();
|
|
135
|
+
const { analytics, loading } = index_js$1.useAnalyticsData();
|
|
130
136
|
if (loading) {
|
|
131
|
-
return /* @__PURE__ */ jsx(
|
|
137
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
132
138
|
"div",
|
|
133
139
|
{
|
|
134
140
|
style: {
|
|
@@ -138,22 +144,22 @@ function VisualizationSelector({ config }) {
|
|
|
138
144
|
justifyContent: "center",
|
|
139
145
|
alignItems: "center"
|
|
140
146
|
},
|
|
141
|
-
children: /* @__PURE__ */ jsx(CircularLoader, { small: true })
|
|
147
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ui.CircularLoader, { small: true })
|
|
142
148
|
}
|
|
143
149
|
);
|
|
144
150
|
}
|
|
145
151
|
if (!analytics) {
|
|
146
152
|
return null;
|
|
147
153
|
}
|
|
148
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
149
|
-
type === "pivotTable" && /* @__PURE__ */ jsx(
|
|
154
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
155
|
+
type === "pivotTable" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
150
156
|
PivotTableRenderer,
|
|
151
157
|
{
|
|
152
158
|
options: config?.pivotTable
|
|
153
159
|
}
|
|
154
160
|
),
|
|
155
|
-
type === "chart" && /* @__PURE__ */ jsx(ChartRenderer, { options: config?.chart }),
|
|
156
|
-
type === "map" && /* @__PURE__ */ jsx(
|
|
161
|
+
type === "chart" && /* @__PURE__ */ jsxRuntime.jsx(ChartRenderer, { options: config?.chart }),
|
|
162
|
+
type === "map" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
157
163
|
MapRenderer,
|
|
158
164
|
{
|
|
159
165
|
options: config?.map
|
|
@@ -162,6 +168,11 @@ function VisualizationSelector({ config }) {
|
|
|
162
168
|
] });
|
|
163
169
|
}
|
|
164
170
|
|
|
165
|
-
|
|
171
|
+
exports.ChartRenderer = ChartRenderer;
|
|
172
|
+
exports.MapRenderer = MapRenderer;
|
|
173
|
+
exports.PivotTableRenderer = PivotTableRenderer;
|
|
174
|
+
exports.VisualizationSelector = VisualizationSelector;
|
|
175
|
+
exports.getDimensionLabel = getDimensionLabel;
|
|
176
|
+
exports.getOrgUnitSelectionFromIds = getOrgUnitSelectionFromIds;
|
|
166
177
|
//# sourceMappingURL=out.js.map
|
|
167
178
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
import { createContext, useContext, useState } from 'react';
|
|
1
|
+
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
|
|
6
|
+
const VisualizationTypeContext = react.createContext("pivotTable");
|
|
7
|
+
const VisualizationConfigContext = react.createContext(void 0);
|
|
8
|
+
const VisualizationTypeSetter = react.createContext(void 0);
|
|
7
9
|
function useVisualizationType() {
|
|
8
10
|
return [
|
|
9
|
-
useContext(VisualizationTypeContext),
|
|
10
|
-
useContext(VisualizationTypeSetter)
|
|
11
|
+
react.useContext(VisualizationTypeContext),
|
|
12
|
+
react.useContext(VisualizationTypeSetter)
|
|
11
13
|
];
|
|
12
14
|
}
|
|
13
15
|
function useVisualizationConfig() {
|
|
14
|
-
return useContext(VisualizationConfigContext);
|
|
16
|
+
return react.useContext(VisualizationConfigContext);
|
|
15
17
|
}
|
|
16
18
|
function VisualizationTypeProvider({
|
|
17
19
|
children,
|
|
18
20
|
defaultType,
|
|
19
21
|
config
|
|
20
22
|
}) {
|
|
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 }) }) });
|
|
23
|
+
const [type, setType] = react.useState(defaultType);
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsx(VisualizationTypeContext.Provider, { value: type, children: /* @__PURE__ */ jsxRuntime.jsx(VisualizationConfigContext.Provider, { value: config, children: /* @__PURE__ */ jsxRuntime.jsx(VisualizationTypeSetter.Provider, { value: setType, children }) }) });
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
exports.VisualizationConfigContext = VisualizationConfigContext;
|
|
28
|
+
exports.VisualizationTypeContext = VisualizationTypeContext;
|
|
29
|
+
exports.VisualizationTypeProvider = VisualizationTypeProvider;
|
|
30
|
+
exports.VisualizationTypeSetter = VisualizationTypeSetter;
|
|
31
|
+
exports.useVisualizationConfig = useVisualizationConfig;
|
|
32
|
+
exports.useVisualizationType = useVisualizationType;
|
|
26
33
|
//# sourceMappingURL=out.js.map
|
|
27
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,44 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var index_js = require('../VisualizationTypeProvider/index.js');
|
|
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);
|
|
6
12
|
|
|
7
13
|
const supportedVisualizationTypes = [
|
|
8
14
|
{
|
|
9
15
|
id: "pivotTable",
|
|
10
|
-
icon: /* @__PURE__ */ jsx(IconTable24, {}),
|
|
11
|
-
label:
|
|
16
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.IconTable24, {}),
|
|
17
|
+
label: i18n__default.default.t("Pivot table")
|
|
12
18
|
},
|
|
13
19
|
{
|
|
14
20
|
id: "chart",
|
|
15
|
-
icon: /* @__PURE__ */ jsx(IconVisualizationColumn24, {}),
|
|
16
|
-
label:
|
|
21
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.IconVisualizationColumn24, {}),
|
|
22
|
+
label: i18n__default.default.t("Chart")
|
|
17
23
|
},
|
|
18
24
|
{
|
|
19
25
|
id: "map",
|
|
20
|
-
icon: /* @__PURE__ */ jsx(IconWorld24, {}),
|
|
21
|
-
label:
|
|
26
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.IconWorld24, {}),
|
|
27
|
+
label: i18n__default.default.t("Map")
|
|
22
28
|
}
|
|
23
29
|
];
|
|
24
30
|
function VisualizationTypeSelector() {
|
|
25
|
-
const [type, setType] = useVisualizationType();
|
|
26
|
-
const config = useVisualizationConfig();
|
|
27
|
-
const types = useMemo(
|
|
31
|
+
const [type, setType] = index_js.useVisualizationType();
|
|
32
|
+
const config = index_js.useVisualizationConfig();
|
|
33
|
+
const types = react.useMemo(
|
|
28
34
|
() => supportedVisualizationTypes.filter((supportedType) => {
|
|
29
35
|
return Object.keys(config ?? {}).includes(supportedType.id) && supportedType.id !== type;
|
|
30
36
|
}),
|
|
31
37
|
[type, config]
|
|
32
38
|
);
|
|
33
|
-
return /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 8 }, children: types.map(({ icon, label, id }) => {
|
|
34
|
-
return /* @__PURE__ */ jsx(
|
|
35
|
-
Tooltip,
|
|
39
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", gap: 8 }, children: types.map(({ icon, label, id }) => {
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
ui.Tooltip,
|
|
36
42
|
{
|
|
37
|
-
content:
|
|
43
|
+
content: i18n__default.default.t("View as {{type}}", {
|
|
38
44
|
type: label.toLowerCase()
|
|
39
45
|
}),
|
|
40
|
-
children: /* @__PURE__ */ jsx(
|
|
41
|
-
Button,
|
|
46
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
47
|
+
ui.Button,
|
|
42
48
|
{
|
|
43
49
|
onClick: () => setType(id),
|
|
44
50
|
icon
|
|
@@ -50,6 +56,6 @@ function VisualizationTypeSelector() {
|
|
|
50
56
|
}) });
|
|
51
57
|
}
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
exports.VisualizationTypeSelector = VisualizationTypeSelector;
|
|
54
60
|
//# sourceMappingURL=out.js.map
|
|
55
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var index_js = require('./components/VisualizationProvider/index.js');
|
|
5
|
+
var index_js$1 = require('./components/VisualizationTypeSelector/index.js');
|
|
6
|
+
var index_js$2 = require('./components/VisualizationDimensionSelector/index.js');
|
|
7
|
+
var index_js$3 = require('./components/VisualizationSelector/index.js');
|
|
8
|
+
var reactErrorBoundary = require('react-error-boundary');
|
|
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);
|
|
9
15
|
|
|
10
16
|
function ErrorFallback({
|
|
11
17
|
error,
|
|
12
18
|
resetErrorBoundary,
|
|
13
19
|
height
|
|
14
20
|
}) {
|
|
15
|
-
return /* @__PURE__ */ jsxs(
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16
22
|
"div",
|
|
17
23
|
{
|
|
18
24
|
style: {
|
|
@@ -27,19 +33,19 @@ function ErrorFallback({
|
|
|
27
33
|
padding: 16
|
|
28
34
|
},
|
|
29
35
|
children: [
|
|
30
|
-
/* @__PURE__ */ jsx(IconError24, {}),
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.IconError24, {}),
|
|
37
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
32
38
|
"h3",
|
|
33
39
|
{
|
|
34
40
|
style: {
|
|
35
|
-
color: colors.grey800,
|
|
41
|
+
color: ui.colors.grey800,
|
|
36
42
|
margin: 0
|
|
37
43
|
},
|
|
38
|
-
children:
|
|
44
|
+
children: i18n__default.default.t("Could not load visualization")
|
|
39
45
|
}
|
|
40
46
|
),
|
|
41
|
-
/* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: error.message }),
|
|
42
|
-
resetErrorBoundary && /* @__PURE__ */ jsx(Button, { onClick: resetErrorBoundary, small: true, children:
|
|
47
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: 0 }, children: error.message }),
|
|
48
|
+
resetErrorBoundary && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: resetErrorBoundary, small: true, children: i18n__default.default.t("Try again") })
|
|
43
49
|
]
|
|
44
50
|
}
|
|
45
51
|
);
|
|
@@ -54,19 +60,19 @@ function Visualization({
|
|
|
54
60
|
showOrgUnitSelector,
|
|
55
61
|
showPeriodSelector
|
|
56
62
|
}) {
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
58
|
-
ErrorBoundary,
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
64
|
+
reactErrorBoundary.ErrorBoundary,
|
|
59
65
|
{
|
|
60
66
|
resetKeys: [dimensions, layout, defaultVisualizationType, config],
|
|
61
|
-
fallbackRender: (props) => /* @__PURE__ */ jsx(ErrorFallback, { height, ...props }),
|
|
62
|
-
children: /* @__PURE__ */ jsx(
|
|
63
|
-
VisualizationProvider,
|
|
67
|
+
fallbackRender: (props) => /* @__PURE__ */ jsxRuntime.jsx(ErrorFallback, { height, ...props }),
|
|
68
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
69
|
+
index_js.VisualizationProvider,
|
|
64
70
|
{
|
|
65
71
|
config,
|
|
66
72
|
type: defaultVisualizationType,
|
|
67
73
|
layout,
|
|
68
74
|
dimensions,
|
|
69
|
-
children: /* @__PURE__ */ jsxs(
|
|
75
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
70
76
|
"div",
|
|
71
77
|
{
|
|
72
78
|
style: {
|
|
@@ -77,7 +83,7 @@ function Visualization({
|
|
|
77
83
|
gap: 16
|
|
78
84
|
},
|
|
79
85
|
children: [
|
|
80
|
-
showToolbar && /* @__PURE__ */ jsxs(
|
|
86
|
+
showToolbar && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
81
87
|
"div",
|
|
82
88
|
{
|
|
83
89
|
style: {
|
|
@@ -87,9 +93,9 @@ function Visualization({
|
|
|
87
93
|
justifyContent: "space-between"
|
|
88
94
|
},
|
|
89
95
|
children: [
|
|
90
|
-
/* @__PURE__ */ jsx(VisualizationTypeSelector, {}),
|
|
91
|
-
/* @__PURE__ */ jsx(
|
|
92
|
-
VisualizationDimensionSelector,
|
|
96
|
+
/* @__PURE__ */ jsxRuntime.jsx(index_js$1.VisualizationTypeSelector, {}),
|
|
97
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
98
|
+
index_js$2.VisualizationDimensionSelector,
|
|
93
99
|
{
|
|
94
100
|
showPeriodSelector,
|
|
95
101
|
showOrgUnitSelector
|
|
@@ -98,7 +104,7 @@ function Visualization({
|
|
|
98
104
|
]
|
|
99
105
|
}
|
|
100
106
|
),
|
|
101
|
-
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(VisualizationSelector, { config }) })
|
|
107
|
+
/* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(index_js$3.VisualizationSelector, { config }) })
|
|
102
108
|
]
|
|
103
109
|
}
|
|
104
110
|
)
|
|
@@ -108,6 +114,6 @@ function Visualization({
|
|
|
108
114
|
);
|
|
109
115
|
}
|
|
110
116
|
|
|
111
|
-
|
|
117
|
+
exports.Visualization = Visualization;
|
|
112
118
|
//# sourceMappingURL=out.js.map
|
|
113
119
|
//# sourceMappingURL=index.js.map
|