@hisptz/dhis2-analytics 1.0.5 → 1.0.7
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/build/cjs/components/ChartAnalytics/ChartAnalytics.stories.js +253 -0
- package/build/cjs/components/ChartAnalytics/ChartAnalytics.test.js +51 -0
- package/build/cjs/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +48 -0
- package/build/cjs/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +34 -0
- package/build/cjs/components/ChartAnalytics/components/DownloadMenu/index.js +67 -0
- package/build/cjs/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +1 -0
- package/{src → build/cjs}/components/ChartAnalytics/data/column-data.json +0 -0
- package/{src → build/cjs}/components/ChartAnalytics/data/complex-multi-series-data.json +0 -0
- package/{src → build/cjs}/components/ChartAnalytics/data/multi-series-data.json +0 -0
- package/{src → build/cjs}/components/ChartAnalytics/data/pie-data.json +0 -0
- package/{src → build/cjs}/components/ChartAnalytics/data/stacked-chart-data.json +0 -0
- package/build/cjs/components/ChartAnalytics/hooks/useChart.js +38 -0
- package/build/cjs/components/ChartAnalytics/index.js +69 -0
- package/build/cjs/components/ChartAnalytics/models/column.js +53 -0
- package/build/cjs/components/ChartAnalytics/models/index.js +102 -0
- package/build/cjs/components/ChartAnalytics/models/line.js +35 -0
- package/build/cjs/components/ChartAnalytics/models/multi-series.js +111 -0
- package/build/cjs/components/ChartAnalytics/models/pie.js +53 -0
- package/build/cjs/components/ChartAnalytics/services/export.js +50 -0
- package/{src → build/cjs}/components/ChartAnalytics/styles/custom-highchart.css +0 -0
- package/build/cjs/components/ChartAnalytics/types/props.js +1 -0
- package/build/cjs/components/ChartAnalytics/utils/chart.js +133 -0
- package/build/cjs/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +45 -0
- package/build/cjs/components/CircularProgressDashboard/CircularProgressIndicator.test.js +13 -0
- package/build/cjs/components/CircularProgressDashboard/index.js +49 -0
- package/build/cjs/components/CircularProgressDashboard/types/props.js +1 -0
- package/build/cjs/components/Map/Map.stories.js +352 -0
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +32 -0
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +40 -0
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/index.js +458 -0
- package/build/cjs/components/Map/components/MapArea/index.js +101 -0
- package/build/cjs/components/Map/components/MapArea/interfaces/index.js +1 -0
- package/build/cjs/components/Map/components/MapControls/components/CustomControl/index.js +32 -0
- package/build/cjs/components/Map/components/MapControls/components/DownloadControl/index.js +25 -0
- package/build/cjs/components/Map/components/MapControls/components/FullscreenControl/index.js +13 -0
- package/build/cjs/components/Map/components/MapControls/index.js +42 -0
- package/build/cjs/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +13 -0
- package/build/cjs/components/Map/components/MapLayer/components/BoundaryLayer/index.js +51 -0
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +106 -0
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +379 -0
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +36 -0
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +200 -0
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +1 -0
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +14 -0
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +412 -0
- package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +124 -0
- package/{src → build/cjs}/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +0 -0
- package/build/cjs/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +26 -0
- package/build/cjs/components/Map/components/MapLayer/components/LegendArea/index.js +181 -0
- package/build/cjs/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +86 -0
- package/build/cjs/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +14 -0
- package/build/cjs/components/Map/components/MapLayer/components/PointLayer/index.js +46 -0
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +57 -0
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +145 -0
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +43 -0
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +56 -0
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +61 -0
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +43 -0
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +35 -0
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +15 -0
- package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/index.js +57 -0
- package/{src → build/cjs}/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +0 -0
- package/build/cjs/components/Map/components/MapLayer/index.js +40 -0
- package/build/cjs/components/Map/components/MapLayer/interfaces/index.js +8 -0
- package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +389 -0
- package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/index.js +116 -0
- package/build/cjs/components/Map/components/MapProvider/hooks/index.js +19 -0
- package/build/cjs/components/Map/components/MapProvider/index.js +121 -0
- package/build/cjs/components/Map/components/MapUpdater/index.js +24 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +32 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +40 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +40 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js +428 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +63 -0
- package/{src → build/cjs}/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +0 -0
- package/{src → build/cjs}/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +0 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +72 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +71 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +47 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +79 -0
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/index.js +265 -0
- package/build/cjs/components/Map/constants/colors.js +428 -0
- package/build/cjs/components/Map/constants/legendSet.js +22 -0
- package/build/cjs/components/Map/hooks/map.js +52 -0
- package/build/cjs/components/Map/index.js +108 -0
- package/build/cjs/components/Map/interfaces/index.js +1 -0
- package/build/cjs/components/Map/state/index.js +23 -0
- package/build/cjs/components/Map/utils/colors.js +78 -0
- package/build/cjs/components/Map/utils/helpers.js +25 -0
- package/build/cjs/components/Map/utils/map.js +161 -0
- package/build/cjs/components/SingleValueContainer/SingleValueContainer.stories.js +127 -0
- package/build/cjs/components/SingleValueContainer/SingleValueContainer.test.js +23 -0
- package/build/cjs/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +54 -0
- package/build/cjs/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +24 -0
- package/build/cjs/components/SingleValueContainer/index.js +43 -0
- package/{src → build/cjs}/components/SingleValueContainer/styles/SingleValueContainer.module.css +0 -0
- package/build/cjs/components/SingleValueContainer/types/props.js +1 -0
- package/{src → build/cjs}/data/map.json +0 -0
- package/build/cjs/dataProviders/map.js +31 -0
- package/build/cjs/index.js +49 -0
- package/build/cjs/locales/en/translations.json +128 -0
- package/build/cjs/locales/index.js +22 -0
- package/build/es/components/ChartAnalytics/ChartAnalytics.stories.js +235 -0
- package/build/es/components/ChartAnalytics/ChartAnalytics.test.js +46 -0
- package/build/es/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +41 -0
- package/build/es/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +26 -0
- package/build/es/components/ChartAnalytics/components/DownloadMenu/index.js +58 -0
- package/build/es/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +1 -0
- package/build/es/components/ChartAnalytics/data/column-data.json +210 -0
- package/build/es/components/ChartAnalytics/data/complex-multi-series-data.json +124 -0
- package/build/es/components/ChartAnalytics/data/multi-series-data.json +536 -0
- package/build/es/components/ChartAnalytics/data/pie-data.json +115 -0
- package/build/es/components/ChartAnalytics/data/stacked-chart-data.json +415 -0
- package/build/es/components/ChartAnalytics/hooks/useChart.js +32 -0
- package/build/es/components/ChartAnalytics/index.js +40 -0
- package/build/es/components/ChartAnalytics/models/column.js +45 -0
- package/build/es/components/ChartAnalytics/models/index.js +95 -0
- package/build/es/components/ChartAnalytics/models/line.js +28 -0
- package/build/es/components/ChartAnalytics/models/multi-series.js +104 -0
- package/build/es/components/ChartAnalytics/models/pie.js +46 -0
- package/build/es/components/ChartAnalytics/services/export.js +36 -0
- package/build/es/components/ChartAnalytics/styles/custom-highchart.css +48 -0
- package/build/es/components/ChartAnalytics/types/props.js +1 -0
- package/build/es/components/ChartAnalytics/utils/chart.js +122 -0
- package/{src/components/CircularProgressDashboard/CircularProgressIndicator.stories.tsx → build/es/components/CircularProgressDashboard/CircularProgressIndicator.stories.js} +9 -16
- package/build/es/components/CircularProgressDashboard/CircularProgressIndicator.test.js +10 -0
- package/build/es/components/CircularProgressDashboard/index.js +41 -0
- package/build/es/components/CircularProgressDashboard/types/props.js +1 -0
- package/build/es/components/Map/Map.stories.js +334 -0
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +23 -0
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +31 -0
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/index.js +448 -0
- package/build/es/components/Map/components/MapArea/index.js +91 -0
- package/build/es/components/Map/components/MapArea/interfaces/index.js +1 -0
- package/build/es/components/Map/components/MapControls/components/CustomControl/index.js +25 -0
- package/build/es/components/Map/components/MapControls/components/DownloadControl/index.js +18 -0
- package/build/es/components/Map/components/MapControls/components/FullscreenControl/index.js +6 -0
- package/build/es/components/Map/components/MapControls/index.js +35 -0
- package/build/es/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +7 -0
- package/build/es/components/Map/components/MapLayer/components/BoundaryLayer/index.js +41 -0
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +95 -0
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +369 -0
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +29 -0
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +191 -0
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +1 -0
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +14 -0
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +403 -0
- package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +111 -0
- package/build/es/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +12 -0
- package/build/es/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +19 -0
- package/build/es/components/Map/components/MapLayer/components/LegendArea/index.js +172 -0
- package/build/es/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +76 -0
- package/build/es/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +8 -0
- package/build/es/components/Map/components/MapLayer/components/PointLayer/index.js +39 -0
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +49 -0
- package/{src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.tsx → build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js} +57 -74
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +33 -0
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +47 -0
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +50 -0
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +36 -0
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +28 -0
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +9 -0
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/index.js +50 -0
- package/build/es/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +62 -0
- package/build/es/components/Map/components/MapLayer/index.js +33 -0
- package/build/es/components/Map/components/MapLayer/interfaces/index.js +1 -0
- package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +381 -0
- package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/index.js +107 -0
- package/{src/components/Map/components/MapProvider/hooks/index.ts → build/es/components/Map/components/MapProvider/hooks/index.js} +3 -6
- package/build/es/components/Map/components/MapProvider/index.js +112 -0
- package/build/es/components/Map/components/MapUpdater/index.js +17 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +23 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +31 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +33 -0
- package/{src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.ts → build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js} +46 -59
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +53 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +15 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +12 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +56 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +64 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +38 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +70 -0
- package/build/es/components/Map/components/ThematicLayerConfiguration/index.js +254 -0
- package/{src/components/Map/constants/colors.ts → build/es/components/Map/constants/colors.js} +46 -59
- package/build/es/components/Map/constants/legendSet.js +15 -0
- package/build/es/components/Map/hooks/map.js +44 -0
- package/build/es/components/Map/index.js +51 -0
- package/build/es/components/Map/interfaces/index.js +1 -0
- package/build/es/components/Map/state/index.js +14 -0
- package/build/es/components/Map/utils/colors.js +61 -0
- package/build/es/components/Map/utils/helpers.js +14 -0
- package/build/es/components/Map/utils/map.js +147 -0
- package/build/es/components/SingleValueContainer/SingleValueContainer.stories.js +115 -0
- package/build/es/components/SingleValueContainer/SingleValueContainer.test.js +20 -0
- package/build/es/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +47 -0
- package/build/es/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +17 -0
- package/build/es/components/SingleValueContainer/index.js +29 -0
- package/build/es/components/SingleValueContainer/styles/SingleValueContainer.module.css +39 -0
- package/build/es/components/SingleValueContainer/types/props.js +1 -0
- package/build/es/data/map.json +5984 -0
- package/build/es/dataProviders/map.js +24 -0
- package/build/es/index.js +5 -0
- package/build/es/locales/en/translations.json +128 -0
- package/build/es/locales/index.js +13 -0
- package/build/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +8 -0
- package/build/types/components/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts +7 -0
- package/build/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts +9 -0
- package/{src/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.ts → build/types/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts} +0 -0
- package/build/types/components/ChartAnalytics/hooks/useChart.d.ts +11 -0
- package/build/types/components/ChartAnalytics/index.d.ts +9 -0
- package/build/types/components/ChartAnalytics/models/column.d.ts +12 -0
- package/build/types/components/ChartAnalytics/models/index.d.ts +17 -0
- package/build/types/components/ChartAnalytics/models/line.d.ts +8 -0
- package/build/types/components/ChartAnalytics/models/multi-series.d.ts +9 -0
- package/build/types/components/ChartAnalytics/models/pie.d.ts +8 -0
- package/build/types/components/ChartAnalytics/services/export.d.ts +8 -0
- package/build/types/components/ChartAnalytics/types/props.d.ts +43 -0
- package/build/types/components/ChartAnalytics/utils/chart.d.ts +15 -0
- package/build/types/components/CircularProgressDashboard/index.d.ts +3 -0
- package/build/types/components/CircularProgressDashboard/types/props.d.ts +17 -0
- package/build/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +17 -0
- package/build/types/components/Map/components/MapArea/index.d.ts +5 -0
- package/build/types/components/Map/components/MapArea/interfaces/index.d.ts +30 -0
- package/build/types/components/Map/components/MapControls/components/CustomControl/index.d.ts +7 -0
- package/build/types/components/Map/components/MapControls/components/DownloadControl/index.d.ts +8 -0
- package/build/types/components/Map/components/MapControls/components/FullscreenControl/index.d.ts +5 -0
- package/build/types/components/Map/components/MapControls/index.d.ts +6 -0
- package/build/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +1 -0
- package/build/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +15 -0
- package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +17 -0
- package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +4 -0
- package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +9 -0
- package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +4 -0
- package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +58 -0
- package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.d.ts +1 -0
- package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +55 -0
- package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +20 -0
- package/build/types/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts +6 -0
- package/build/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts +9 -0
- package/build/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts +3 -0
- package/build/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +2 -0
- package/build/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +2 -0
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +13 -0
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +10 -0
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +16 -0
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +12 -0
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +21 -0
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +12 -0
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +5 -0
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +2 -0
- package/build/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +5 -0
- package/build/types/components/Map/components/MapLayer/index.d.ts +6 -0
- package/build/types/components/Map/components/MapLayer/interfaces/index.d.ts +123 -0
- package/build/types/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts +9 -0
- package/build/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +6 -0
- package/build/types/components/Map/components/MapProvider/hooks/index.d.ts +15 -0
- package/build/types/components/Map/components/MapProvider/index.d.ts +3 -0
- package/build/types/components/Map/components/MapUpdater/index.d.ts +5 -0
- package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +8 -0
- package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts +419 -0
- package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +9 -0
- package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +11 -0
- package/build/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +2 -0
- package/build/types/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts +8 -0
- package/build/types/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts +9 -0
- package/build/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +18 -0
- package/build/types/components/Map/constants/colors.d.ts +419 -0
- package/build/types/components/Map/constants/legendSet.d.ts +7 -0
- package/build/types/components/Map/hooks/map.d.ts +9 -0
- package/build/types/components/Map/index.d.ts +8 -0
- package/build/types/components/Map/interfaces/index.d.ts +65 -0
- package/build/types/components/Map/state/index.d.ts +20 -0
- package/build/types/components/Map/utils/colors.d.ts +12 -0
- package/build/types/components/Map/utils/helpers.d.ts +6 -0
- package/build/types/components/Map/utils/map.d.ts +40 -0
- package/build/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +8 -0
- package/build/types/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts +2 -0
- package/build/types/components/SingleValueContainer/index.d.ts +5 -0
- package/build/types/components/SingleValueContainer/types/props.d.ts +15 -0
- package/build/types/dataProviders/map.d.ts +4 -0
- package/{src/index.ts → build/types/index.d.ts} +0 -0
- package/package.json +26 -5
- package/d2.config.js +0 -8
- package/i18n/en.pot +0 -409
- package/src/components/ChartAnalytics/ChartAnalytics.stories.tsx +0 -250
- package/src/components/ChartAnalytics/ChartAnalytics.test.tsx +0 -51
- package/src/components/ChartAnalytics/components/DownloadMenu/components/Menu.tsx +0 -48
- package/src/components/ChartAnalytics/components/DownloadMenu/constants/menu.ts +0 -38
- package/src/components/ChartAnalytics/components/DownloadMenu/index.tsx +0 -67
- package/src/components/ChartAnalytics/hooks/useChart.ts +0 -35
- package/src/components/ChartAnalytics/index.tsx +0 -23
- package/src/components/ChartAnalytics/models/column.ts +0 -50
- package/src/components/ChartAnalytics/models/index.ts +0 -78
- package/src/components/ChartAnalytics/models/line.ts +0 -31
- package/src/components/ChartAnalytics/models/multi-series.ts +0 -115
- package/src/components/ChartAnalytics/models/pie.ts +0 -54
- package/src/components/ChartAnalytics/services/export.ts +0 -38
- package/src/components/ChartAnalytics/types/props.tsx +0 -48
- package/src/components/ChartAnalytics/utils/chart.ts +0 -123
- package/src/components/CircularProgressDashboard/CircularProgressIndicator.test.tsx +0 -9
- package/src/components/CircularProgressDashboard/index.tsx +0 -35
- package/src/components/CircularProgressDashboard/types/props.tsx +0 -17
- package/src/components/Map/Map.stories.tsx +0 -339
- package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.tsx +0 -28
- package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.tsx +0 -34
- package/src/components/Map/components/EarthEngineLayerConfiguration/index.tsx +0 -412
- package/src/components/Map/components/MapArea/index.tsx +0 -83
- package/src/components/Map/components/MapArea/interfaces/index.ts +0 -39
- package/src/components/Map/components/MapControls/components/CustomControl/index.tsx +0 -24
- package/src/components/Map/components/MapControls/components/DownloadControl/index.tsx +0 -10
- package/src/components/Map/components/MapControls/components/FullscreenControl/index.tsx +0 -7
- package/src/components/Map/components/MapControls/index.tsx +0 -24
- package/src/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.ts +0 -7
- package/src/components/Map/components/MapLayer/components/BoundaryLayer/index.tsx +0 -55
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.tsx +0 -76
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.ts +0 -430
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.ts +0 -34
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/index.tsx +0 -185
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.ts +0 -56
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +0 -34233
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.ts +0 -431
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.ts +0 -105
- package/src/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.tsx +0 -17
- package/src/components/Map/components/MapLayer/components/LegendArea/index.tsx +0 -168
- package/src/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.tsx +0 -44
- package/src/components/Map/components/MapLayer/components/PointLayer/hooks/index.ts +0 -8
- package/src/components/Map/components/MapLayer/components/PointLayer/index.tsx +0 -36
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.tsx +0 -48
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.tsx +0 -39
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.tsx +0 -57
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.tsx +0 -43
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.tsx +0 -38
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.tsx +0 -26
- package/src/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.ts +0 -10
- package/src/components/Map/components/MapLayer/components/ThematicLayer/index.tsx +0 -46
- package/src/components/Map/components/MapLayer/index.tsx +0 -32
- package/src/components/Map/components/MapLayer/interfaces/index.ts +0 -139
- package/src/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.tsx +0 -359
- package/src/components/Map/components/MapProvider/components/MapLayerProvider/index.tsx +0 -105
- package/src/components/Map/components/MapProvider/index.tsx +0 -93
- package/src/components/Map/components/MapUpdater/index.tsx +0 -8
- package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.tsx +0 -28
- package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.tsx +0 -34
- package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.tsx +0 -24
- package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.tsx +0 -50
- package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.ts +0 -91
- package/src/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.tsx +0 -45
- package/src/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.tsx +0 -47
- package/src/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.tsx +0 -57
- package/src/components/Map/components/ThematicLayerConfiguration/index.tsx +0 -248
- package/src/components/Map/constants/legendSet.ts +0 -19
- package/src/components/Map/hooks/map.ts +0 -47
- package/src/components/Map/index.tsx +0 -65
- package/src/components/Map/interfaces/index.ts +0 -57
- package/src/components/Map/state/index.tsx +0 -31
- package/src/components/Map/utils/colors.ts +0 -95
- package/src/components/Map/utils/helpers.ts +0 -15
- package/src/components/Map/utils/map.ts +0 -150
- package/src/components/SingleValueContainer/SingleValueContainer.stories.tsx +0 -146
- package/src/components/SingleValueContainer/SingleValueContainer.test.tsx +0 -24
- package/src/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.tsx +0 -46
- package/src/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.tsx +0 -12
- package/src/components/SingleValueContainer/index.tsx +0 -30
- package/src/components/SingleValueContainer/types/props.tsx +0 -16
- package/src/dataProviders/map.tsx +0 -24
- package/src/index.test.ts +0 -7
- package/tsconfig.json +0 -45
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import type {Analytics, AnalyticsHeader, AnalyticsMetadata} from "@hisptz/dhis2-utils";
|
|
2
|
-
import {compact, find, findIndex, head, isEmpty, set} from "lodash";
|
|
3
|
-
import {DHIS2Chart} from "../models";
|
|
4
|
-
import {DHIS2ColumnChart, DHIS2StackedColumnChart} from "../models/column";
|
|
5
|
-
import {DHIS2LineChart} from "../models/line";
|
|
6
|
-
import {DHIS2MultiSeriesChart} from "../models/multi-series";
|
|
7
|
-
import {DHIS2PieChart} from "../models/pie";
|
|
8
|
-
import {ChartConfig, ChartType} from "../types/props";
|
|
9
|
-
|
|
10
|
-
export function getDimensionHeaderIndex(headers: AnalyticsHeader[], name: string): number {
|
|
11
|
-
return findIndex(headers, { name });
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function getPointSeries(analytics: Analytics, config: ChartConfig, highchartsType: string) {
|
|
15
|
-
const series: string[] = config.layout.series;
|
|
16
|
-
|
|
17
|
-
return series.map((seriesName: string) => {
|
|
18
|
-
const header = analytics?.headers?.find((header: any) => header.name === seriesName);
|
|
19
|
-
if (!header) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
if (analytics?.metaData) {
|
|
23
|
-
return getColumnSeries(analytics, header, config, highchartsType);
|
|
24
|
-
}
|
|
25
|
-
})[0];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function getColumnSeries(analytics: Analytics, header: AnalyticsHeader, config: ChartConfig, highchartsType: string): any {
|
|
29
|
-
const headerIndex = analytics?.headers?.findIndex((h) => header.name === h.name);
|
|
30
|
-
const valueIndex = analytics?.headers?.findIndex((h) => h.name === "value");
|
|
31
|
-
|
|
32
|
-
const colors = config.colors ?? [];
|
|
33
|
-
|
|
34
|
-
const { items, dimensions } = analytics?.metaData ?? {};
|
|
35
|
-
const categoriesDimension = config.layout.category;
|
|
36
|
-
|
|
37
|
-
const seriesDimensionValues: string[] = dimensions?.[header.name as "dx" | "ou" | "pe"] ?? [];
|
|
38
|
-
|
|
39
|
-
return head(
|
|
40
|
-
categoriesDimension?.map((categoryDimension: string) => {
|
|
41
|
-
const categories: string[] = dimensions?.[categoryDimension as "dx" | "ou" | "pe"] as any;
|
|
42
|
-
const categoryDimensionIndex = analytics?.headers?.findIndex((h) => h.name === categoryDimension);
|
|
43
|
-
return seriesDimensionValues?.map((seriesDimensionValue: string, index) => {
|
|
44
|
-
const data = categories?.map((category: string) => {
|
|
45
|
-
const row = find(analytics?.rows, (row: any) => row[headerIndex ?? -1] === seriesDimensionValue && row[categoryDimensionIndex ?? -1] === category);
|
|
46
|
-
return row?.[valueIndex ?? -1] ? parseFloat(row?.[valueIndex ?? -1]) : 0;
|
|
47
|
-
});
|
|
48
|
-
return {
|
|
49
|
-
name: items?.[seriesDimensionValue as any]?.name,
|
|
50
|
-
data,
|
|
51
|
-
type: highchartsType,
|
|
52
|
-
color: colors[index % colors.length],
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
})
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function getCategories({ name }: AnalyticsHeader, { items, dimensions }: AnalyticsMetadata): string[] {
|
|
60
|
-
const categories: string[] = dimensions?.[name as "dx" | "ou" | "pe"] as any;
|
|
61
|
-
|
|
62
|
-
return categories?.map((category: string) => {
|
|
63
|
-
return items[category as any]?.name ?? "";
|
|
64
|
-
}) as unknown as string[];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function getAllCategories(analytics: Analytics, config: ChartConfig): string[] {
|
|
68
|
-
const categories = config.layout.category;
|
|
69
|
-
|
|
70
|
-
return compact(
|
|
71
|
-
categories?.map((category: string) => {
|
|
72
|
-
const header = analytics?.headers?.find((header: any) => header.name === category);
|
|
73
|
-
if (!header) {
|
|
74
|
-
return undefined;
|
|
75
|
-
}
|
|
76
|
-
if (analytics?.metaData) {
|
|
77
|
-
return getCategories(header, analytics?.metaData);
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
)[0];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function updateLayout(config: ChartConfig, { type }: { type: ChartType }) {
|
|
84
|
-
if (type === config.type) {
|
|
85
|
-
return config.layout;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const updatedLayout = { ...config.layout };
|
|
89
|
-
|
|
90
|
-
switch (type) {
|
|
91
|
-
case "pie":
|
|
92
|
-
set(updatedLayout, "category", []);
|
|
93
|
-
if (isEmpty(updatedLayout.series)) {
|
|
94
|
-
if (!isEmpty(config.layout.category)) {
|
|
95
|
-
set(updatedLayout, "series", [head(config.layout.category)]);
|
|
96
|
-
} else {
|
|
97
|
-
throw new Error("Invalid layout for pie chart");
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (updatedLayout.series.length > 1) {
|
|
101
|
-
set(updatedLayout, "series", [head(updatedLayout.series)]);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return updatedLayout;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function getChartInstance(id: string, analytics: Analytics, config: ChartConfig): DHIS2Chart {
|
|
109
|
-
switch (config.type) {
|
|
110
|
-
case "column":
|
|
111
|
-
return new DHIS2ColumnChart(id, analytics, config);
|
|
112
|
-
case "stacked-column":
|
|
113
|
-
return new DHIS2StackedColumnChart(id, analytics, config);
|
|
114
|
-
case "pie":
|
|
115
|
-
return new DHIS2PieChart(id, analytics, config);
|
|
116
|
-
case "line":
|
|
117
|
-
return new DHIS2LineChart(id, analytics, config);
|
|
118
|
-
case "multi-series":
|
|
119
|
-
return new DHIS2MultiSeriesChart(id, analytics, config);
|
|
120
|
-
default:
|
|
121
|
-
throw new Error(`Unsupported chart type: ${config.type}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {colors} from "@dhis2/ui";
|
|
2
|
-
import React, {useMemo} from "react";
|
|
3
|
-
import {CircularProgressbarWithChildren} from "react-circular-progressbar";
|
|
4
|
-
import {CircularDashboardProps} from "./types/props";
|
|
5
|
-
|
|
6
|
-
export function CircularProgressDashboard({ numerator, size, denominator, value, textStyle, strokeStyle }: CircularDashboardProps): React.ReactElement {
|
|
7
|
-
const filledSectionFieldsPercentage = useMemo(() => {
|
|
8
|
-
return value !== undefined ? value : Math.floor(((numerator ?? 0) / (denominator ?? 1)) * 100);
|
|
9
|
-
}, [numerator, denominator, value]);
|
|
10
|
-
return (
|
|
11
|
-
<div
|
|
12
|
-
style={{
|
|
13
|
-
backgroundColor: "transparent",
|
|
14
|
-
width: size,
|
|
15
|
-
}}>
|
|
16
|
-
<CircularProgressbarWithChildren
|
|
17
|
-
styles={{
|
|
18
|
-
path: {
|
|
19
|
-
stroke: strokeStyle?.color ?? colors.blue700,
|
|
20
|
-
},
|
|
21
|
-
}}
|
|
22
|
-
strokeWidth={7}
|
|
23
|
-
value={filledSectionFieldsPercentage}>
|
|
24
|
-
<div
|
|
25
|
-
style={{
|
|
26
|
-
...(textStyle ?? {}),
|
|
27
|
-
fontSize: textStyle?.fontSize ?? typeof size === "number" ? 0.3 * (size as number) : "100%",
|
|
28
|
-
marginTop: -11,
|
|
29
|
-
}}>
|
|
30
|
-
<strong style={{ color: textStyle?.color ?? strokeStyle?.color ?? colors.blue700 }}>{filledSectionFieldsPercentage}%</strong>
|
|
31
|
-
</div>
|
|
32
|
-
</CircularProgressbarWithChildren>
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type CircularDashboardProps = {
|
|
2
|
-
strokeStyle?: {
|
|
3
|
-
width?: number | string;
|
|
4
|
-
color?: string;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
};
|
|
7
|
-
textStyle?: {
|
|
8
|
-
color?: string;
|
|
9
|
-
fontSize?: number | string;
|
|
10
|
-
fontWeight?: number | string;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
};
|
|
13
|
-
value?: number;
|
|
14
|
-
numerator?: number;
|
|
15
|
-
denominator?: number;
|
|
16
|
-
size: string | number;
|
|
17
|
-
};
|
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import type {Story} from "@storybook/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import {MapProps} from "./interfaces";
|
|
4
|
-
import {Map} from "./index";
|
|
5
|
-
|
|
6
|
-
const Template: Story<MapProps> = (args) => <Map {...args} />;
|
|
7
|
-
|
|
8
|
-
export const BaseMap = Template.bind({});
|
|
9
|
-
BaseMap.args = {
|
|
10
|
-
orgUnitSelection: { orgUnits: [], userOrgUnit: true, userSubUnit: true, userSubX2Unit: true },
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const Controls = Template.bind({});
|
|
14
|
-
Controls.args = {
|
|
15
|
-
orgUnitSelection: { orgUnits: [], userOrgUnit: true, userSubUnit: true, userSubX2Unit: true },
|
|
16
|
-
controls: [
|
|
17
|
-
{
|
|
18
|
-
type: "print",
|
|
19
|
-
position: "topleft",
|
|
20
|
-
options: {
|
|
21
|
-
hidden: false,
|
|
22
|
-
hideControlContainer: true,
|
|
23
|
-
sizeModes: ["A4Landscape", "A4Portrait", "Current"],
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const BoundaryLayer = Template.bind({});
|
|
30
|
-
BoundaryLayer.args = {
|
|
31
|
-
orgUnitSelection: { orgUnits: [], userOrgUnit: true, userSubUnit: true, userSubX2Unit: true },
|
|
32
|
-
boundaryLayer: {
|
|
33
|
-
enabled: true,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const BoundaryLayerWithLevels = Template.bind({});
|
|
38
|
-
BoundaryLayerWithLevels.args = {
|
|
39
|
-
orgUnitSelection: {
|
|
40
|
-
orgUnits: [
|
|
41
|
-
{
|
|
42
|
-
id: "ImspTQPwCqd",
|
|
43
|
-
displayName: "Sierra Leone",
|
|
44
|
-
name: "Sierra Leone",
|
|
45
|
-
path: "/ImspTQPwCqd",
|
|
46
|
-
children: [],
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
levels: ["2"],
|
|
50
|
-
},
|
|
51
|
-
boundaryLayer: {
|
|
52
|
-
enabled: true,
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const ChoroplethThematicLayer = Template.bind({});
|
|
57
|
-
ChoroplethThematicLayer.args = {
|
|
58
|
-
orgUnitSelection: { orgUnits: [], userOrgUnit: true, userSubUnit: true, userSubX2Unit: false },
|
|
59
|
-
boundaryLayer: {
|
|
60
|
-
enabled: true,
|
|
61
|
-
},
|
|
62
|
-
thematicLayers: [
|
|
63
|
-
{
|
|
64
|
-
type: "choropleth",
|
|
65
|
-
id: "choropleth",
|
|
66
|
-
enabled: true,
|
|
67
|
-
dataItem: {
|
|
68
|
-
id: "Uvn6LCg7dVU",
|
|
69
|
-
displayName: "ANC 1 Coverage",
|
|
70
|
-
type: "indicator",
|
|
71
|
-
},
|
|
72
|
-
control: {
|
|
73
|
-
enabled: true,
|
|
74
|
-
position: "topright",
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
periodSelection: {
|
|
79
|
-
periods: ["2022"],
|
|
80
|
-
},
|
|
81
|
-
legends: {
|
|
82
|
-
enabled: true,
|
|
83
|
-
position: "topright",
|
|
84
|
-
collapsible: true,
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const BubbleThematicLayer = Template.bind({});
|
|
89
|
-
BubbleThematicLayer.args = {
|
|
90
|
-
orgUnitSelection: { orgUnits: [], userOrgUnit: true, userSubUnit: true, userSubX2Unit: true },
|
|
91
|
-
boundaryLayer: {
|
|
92
|
-
enabled: true,
|
|
93
|
-
},
|
|
94
|
-
thematicLayers: [
|
|
95
|
-
{
|
|
96
|
-
type: "bubble",
|
|
97
|
-
id: "bubble",
|
|
98
|
-
enabled: true,
|
|
99
|
-
dataItem: {
|
|
100
|
-
id: "Uvn6LCg7dVU",
|
|
101
|
-
displayName: "ANC 1 Coverage",
|
|
102
|
-
type: "indicator",
|
|
103
|
-
},
|
|
104
|
-
control: {
|
|
105
|
-
enabled: true,
|
|
106
|
-
position: "topright",
|
|
107
|
-
},
|
|
108
|
-
radius: {
|
|
109
|
-
min: 0,
|
|
110
|
-
max: 40,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
legends: {
|
|
115
|
-
enabled: true,
|
|
116
|
-
position: "topright",
|
|
117
|
-
collapsible: true,
|
|
118
|
-
},
|
|
119
|
-
periodSelection: {
|
|
120
|
-
periods: ["2022"],
|
|
121
|
-
},
|
|
122
|
-
controls: [
|
|
123
|
-
{
|
|
124
|
-
type: "fullscreen",
|
|
125
|
-
position: "topleft",
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const AllThematicLayers = Template.bind({});
|
|
131
|
-
AllThematicLayers.args = {
|
|
132
|
-
orgUnitSelection: { orgUnits: [], userOrgUnit: true, userSubUnit: true, userSubX2Unit: true },
|
|
133
|
-
boundaryLayer: {
|
|
134
|
-
enabled: true,
|
|
135
|
-
},
|
|
136
|
-
thematicLayers: [
|
|
137
|
-
{
|
|
138
|
-
type: "choropleth",
|
|
139
|
-
id: "ReUHfIn0pTQ",
|
|
140
|
-
enabled: true,
|
|
141
|
-
dataItem: {
|
|
142
|
-
id: "ReUHfIn0pTQ",
|
|
143
|
-
displayName: "ANC 1-3 Dropout Rate",
|
|
144
|
-
type: "indicator",
|
|
145
|
-
legendSet: "fqs276KXCXi",
|
|
146
|
-
},
|
|
147
|
-
control: {
|
|
148
|
-
enabled: true,
|
|
149
|
-
position: "topright",
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
type: "choropleth",
|
|
154
|
-
id: "Uvn6LCg7dVU",
|
|
155
|
-
enabled: true,
|
|
156
|
-
dataItem: {
|
|
157
|
-
id: "Uvn6LCg7dVU",
|
|
158
|
-
displayName: "ANC 1 Coverage",
|
|
159
|
-
type: "indicator",
|
|
160
|
-
},
|
|
161
|
-
control: {
|
|
162
|
-
enabled: true,
|
|
163
|
-
position: "topright",
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
],
|
|
167
|
-
legends: {
|
|
168
|
-
enabled: true,
|
|
169
|
-
position: "topright",
|
|
170
|
-
collapsible: true,
|
|
171
|
-
},
|
|
172
|
-
periodSelection: {
|
|
173
|
-
periods: ["2022"],
|
|
174
|
-
},
|
|
175
|
-
controls: [
|
|
176
|
-
{
|
|
177
|
-
type: "scale",
|
|
178
|
-
position: "bottomleft",
|
|
179
|
-
options: {
|
|
180
|
-
imperial: false,
|
|
181
|
-
metric: true,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
type: "fullscreen",
|
|
186
|
-
position: "bottomleft",
|
|
187
|
-
},
|
|
188
|
-
],
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
export const ChoroplethThematicLayerWithLevels = Template.bind({});
|
|
192
|
-
ChoroplethThematicLayerWithLevels.args = {
|
|
193
|
-
orgUnitSelection: {
|
|
194
|
-
orgUnits: [
|
|
195
|
-
{
|
|
196
|
-
id: "ImspTQPwCqd",
|
|
197
|
-
displayName: "Sierra Leone",
|
|
198
|
-
name: "Sierra Leone",
|
|
199
|
-
path: "/ImspTQPwCqd",
|
|
200
|
-
children: [],
|
|
201
|
-
},
|
|
202
|
-
],
|
|
203
|
-
levels: ["3"],
|
|
204
|
-
},
|
|
205
|
-
boundaryLayer: {
|
|
206
|
-
enabled: true,
|
|
207
|
-
},
|
|
208
|
-
thematicLayers: [
|
|
209
|
-
{
|
|
210
|
-
type: "choropleth",
|
|
211
|
-
id: "choropleth",
|
|
212
|
-
enabled: true,
|
|
213
|
-
dataItem: {
|
|
214
|
-
id: "Uvn6LCg7dVU",
|
|
215
|
-
displayName: "ANC 1 Coverage",
|
|
216
|
-
type: "indicator",
|
|
217
|
-
},
|
|
218
|
-
control: {
|
|
219
|
-
enabled: true,
|
|
220
|
-
position: "topright",
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
legends: {
|
|
225
|
-
enabled: true,
|
|
226
|
-
position: "topright",
|
|
227
|
-
collapsible: true,
|
|
228
|
-
},
|
|
229
|
-
periodSelection: {
|
|
230
|
-
periods: ["2022"],
|
|
231
|
-
},
|
|
232
|
-
controls: [
|
|
233
|
-
{
|
|
234
|
-
type: "print",
|
|
235
|
-
position: "topleft",
|
|
236
|
-
options: {
|
|
237
|
-
hidden: false,
|
|
238
|
-
hideControlContainer: true,
|
|
239
|
-
sizeModes: ["A4Landscape", "A4Portrait", "Current"],
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
],
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
export const PointLayer = Template.bind({});
|
|
246
|
-
PointLayer.args = {
|
|
247
|
-
orgUnitSelection: { orgUnits: [], userOrgUnit: true, userSubUnit: true, userSubX2Unit: false },
|
|
248
|
-
thematicLayers: [
|
|
249
|
-
{
|
|
250
|
-
type: "choropleth",
|
|
251
|
-
id: "choropleth",
|
|
252
|
-
enabled: true,
|
|
253
|
-
dataItem: {
|
|
254
|
-
id: "Uvn6LCg7dVU",
|
|
255
|
-
displayName: "ANC 1 Coverage",
|
|
256
|
-
type: "indicator",
|
|
257
|
-
},
|
|
258
|
-
control: {
|
|
259
|
-
enabled: true,
|
|
260
|
-
position: "topright",
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
],
|
|
264
|
-
periodSelection: {
|
|
265
|
-
periods: ["2022"],
|
|
266
|
-
},
|
|
267
|
-
pointLayer: {
|
|
268
|
-
enabled: true,
|
|
269
|
-
label: "Facilities",
|
|
270
|
-
level: "m9lBJogzE95",
|
|
271
|
-
style: {
|
|
272
|
-
groupSet: "J5jldMd8OHv",
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
export const GoogleEarthEngineLayers = Template.bind({});
|
|
278
|
-
GoogleEarthEngineLayers.args = {
|
|
279
|
-
orgUnitSelection: { orgUnits: [], userOrgUnit: true, userSubUnit: true, userSubX2Unit: false },
|
|
280
|
-
thematicLayers: [],
|
|
281
|
-
periodSelection: {
|
|
282
|
-
periods: ["2022"],
|
|
283
|
-
},
|
|
284
|
-
earthEngineLayers: [
|
|
285
|
-
{
|
|
286
|
-
name: "Population",
|
|
287
|
-
type: "population",
|
|
288
|
-
id: "population",
|
|
289
|
-
enabled: false,
|
|
290
|
-
params: {
|
|
291
|
-
min: 0,
|
|
292
|
-
max: 10,
|
|
293
|
-
palette: "#f7fbff,#deebf7,#c6dbef,#9ecae1,#6baed6,#4292c6,#2171b5,#08519c,#08306b",
|
|
294
|
-
},
|
|
295
|
-
aggregations: ["sum", "mean"],
|
|
296
|
-
filters: {
|
|
297
|
-
period: "2020",
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
name: "Footprints",
|
|
302
|
-
type: "footprints",
|
|
303
|
-
id: "footprints",
|
|
304
|
-
aggregations: ["count"],
|
|
305
|
-
enabled: false,
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
name: "Land Cover",
|
|
309
|
-
type: "landCover",
|
|
310
|
-
id: "landCover",
|
|
311
|
-
enabled: true,
|
|
312
|
-
aggregations: ["percentage"],
|
|
313
|
-
},
|
|
314
|
-
],
|
|
315
|
-
pointLayer: {
|
|
316
|
-
enabled: false,
|
|
317
|
-
label: "Facilities",
|
|
318
|
-
level: "m9lBJogzE95",
|
|
319
|
-
style: {
|
|
320
|
-
groupSet: "J5jldMd8OHv",
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
export default {
|
|
326
|
-
title: "Components/Map",
|
|
327
|
-
component: Map,
|
|
328
|
-
decorators: [
|
|
329
|
-
(MapStory: any) => {
|
|
330
|
-
return (
|
|
331
|
-
<div style={{ width: "100%", height: "100%" }}>
|
|
332
|
-
{/*<MapDataProvider>*/}
|
|
333
|
-
<MapStory />
|
|
334
|
-
{/*</MapDataProvider>*/}
|
|
335
|
-
</div>
|
|
336
|
-
);
|
|
337
|
-
},
|
|
338
|
-
],
|
|
339
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {Story} from "@storybook/react";
|
|
2
|
-
import {EarthEngineLayerConfigModal, EarthEngineLayerConfigModalProps, EarthEngineLayerConfiguration} from "./index";
|
|
3
|
-
import React from "react";
|
|
4
|
-
|
|
5
|
-
const Template: Story<EarthEngineLayerConfigModalProps> = (args) => {
|
|
6
|
-
return <EarthEngineLayerConfigModal {...args} />;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const Basic = Template.bind({});
|
|
10
|
-
Basic.args = {
|
|
11
|
-
onClose: () => {},
|
|
12
|
-
onChange: console.info,
|
|
13
|
-
open: true,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
title: "Components/Map/Earth Engine Config Modal",
|
|
18
|
-
component: EarthEngineLayerConfiguration,
|
|
19
|
-
decorators: [
|
|
20
|
-
(MapStory: any) => {
|
|
21
|
-
return (
|
|
22
|
-
<div style={{ width: "50%", height: "50%" }}>
|
|
23
|
-
<MapStory />
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {Story} from "@storybook/react";
|
|
2
|
-
import {EarthEngineLayerConfiguration, EarthEngineLayerConfigurationProps} from "./index";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import {useForm} from "react-hook-form";
|
|
5
|
-
import {EarthEngineLayerConfig} from "../MapLayer/interfaces";
|
|
6
|
-
import i18n from "@dhis2/d2-i18n";
|
|
7
|
-
import {Button} from "@dhis2/ui";
|
|
8
|
-
|
|
9
|
-
const Template: Story<EarthEngineLayerConfigurationProps> = (args) => {
|
|
10
|
-
const form = useForm<EarthEngineLayerConfig>();
|
|
11
|
-
return (
|
|
12
|
-
<form className="column gap-16" onSubmit={form.handleSubmit(console.log)}>
|
|
13
|
-
<EarthEngineLayerConfiguration {...args} form={form} />
|
|
14
|
-
<Button type="submit">{i18n.t("Submit")}</Button>
|
|
15
|
-
</form>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const Basic = Template.bind({});
|
|
20
|
-
Basic.args = {};
|
|
21
|
-
|
|
22
|
-
export default {
|
|
23
|
-
title: "Components/Map/Earth Engine Configuration",
|
|
24
|
-
component: EarthEngineLayerConfiguration,
|
|
25
|
-
decorators: [
|
|
26
|
-
(MapStory: any) => {
|
|
27
|
-
return (
|
|
28
|
-
<div style={{ width: "50%", height: "50%" }}>
|
|
29
|
-
<MapStory />
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
};
|