@hisptz/dhis2-analytics 1.0.5 → 1.0.6
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 +10 -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/index.test.js +7 -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 +10 -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/{src/index.ts → build/es/index.js} +1 -0
- package/build/es/index.test.js +6 -0
- package/build/es/locales/en/translations.json +128 -0
- package/build/es/locales/index.js +13 -0
- package/package.json +21 -4
- 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/components/DownloadMenu/interfaces/menu.ts +0 -1
- 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
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
{
|
|
2
|
+
"headers": [
|
|
3
|
+
{
|
|
4
|
+
"name": "ou",
|
|
5
|
+
"column": "Organisation unit",
|
|
6
|
+
"valueType": "TEXT",
|
|
7
|
+
"type": "java.lang.String",
|
|
8
|
+
"hidden": false,
|
|
9
|
+
"meta": true
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "pe",
|
|
13
|
+
"column": "Period",
|
|
14
|
+
"valueType": "TEXT",
|
|
15
|
+
"type": "java.lang.String",
|
|
16
|
+
"hidden": false,
|
|
17
|
+
"meta": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "value",
|
|
21
|
+
"column": "Value",
|
|
22
|
+
"valueType": "NUMBER",
|
|
23
|
+
"type": "java.lang.Double",
|
|
24
|
+
"hidden": false,
|
|
25
|
+
"meta": false
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"metaData": {
|
|
29
|
+
"items": {
|
|
30
|
+
"202107": {
|
|
31
|
+
"name": "July 2021"
|
|
32
|
+
},
|
|
33
|
+
"202108": {
|
|
34
|
+
"name": "August 2021"
|
|
35
|
+
},
|
|
36
|
+
"202109": {
|
|
37
|
+
"name": "September 2021"
|
|
38
|
+
},
|
|
39
|
+
"202110": {
|
|
40
|
+
"name": "October 2021"
|
|
41
|
+
},
|
|
42
|
+
"202111": {
|
|
43
|
+
"name": "November 2021"
|
|
44
|
+
},
|
|
45
|
+
"202112": {
|
|
46
|
+
"name": "December 2021"
|
|
47
|
+
},
|
|
48
|
+
"202201": {
|
|
49
|
+
"name": "January 2022"
|
|
50
|
+
},
|
|
51
|
+
"202202": {
|
|
52
|
+
"name": "February 2022"
|
|
53
|
+
},
|
|
54
|
+
"202203": {
|
|
55
|
+
"name": "March 2022"
|
|
56
|
+
},
|
|
57
|
+
"202204": {
|
|
58
|
+
"name": "April 2022"
|
|
59
|
+
},
|
|
60
|
+
"202205": {
|
|
61
|
+
"name": "May 2022"
|
|
62
|
+
},
|
|
63
|
+
"202206": {
|
|
64
|
+
"name": "June 2022"
|
|
65
|
+
},
|
|
66
|
+
"jUb8gELQApl": {
|
|
67
|
+
"name": "Kailahun"
|
|
68
|
+
},
|
|
69
|
+
"PMa2VCrupOd": {
|
|
70
|
+
"name": "Kambia"
|
|
71
|
+
},
|
|
72
|
+
"ou": {
|
|
73
|
+
"name": "Organisation unit"
|
|
74
|
+
},
|
|
75
|
+
"O6uvpzGd5pu": {
|
|
76
|
+
"name": "Bo"
|
|
77
|
+
},
|
|
78
|
+
"eTDtyyaSA7f": {
|
|
79
|
+
"name": "FIC <1y"
|
|
80
|
+
},
|
|
81
|
+
"fdc6uOvgoji": {
|
|
82
|
+
"name": "Bombali"
|
|
83
|
+
},
|
|
84
|
+
"LAST_12_MONTHS": {
|
|
85
|
+
"name": "Last 12 months"
|
|
86
|
+
},
|
|
87
|
+
"dx": {
|
|
88
|
+
"name": "Data"
|
|
89
|
+
},
|
|
90
|
+
"pe": {
|
|
91
|
+
"name": "Period"
|
|
92
|
+
},
|
|
93
|
+
"lc3eMKXaEfw": {
|
|
94
|
+
"name": "Bonthe"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"dimensions": {
|
|
98
|
+
"dx": [
|
|
99
|
+
"eTDtyyaSA7f"
|
|
100
|
+
],
|
|
101
|
+
"pe": [
|
|
102
|
+
"202107",
|
|
103
|
+
"202108",
|
|
104
|
+
"202109",
|
|
105
|
+
"202110",
|
|
106
|
+
"202111",
|
|
107
|
+
"202112",
|
|
108
|
+
"202201",
|
|
109
|
+
"202202",
|
|
110
|
+
"202203",
|
|
111
|
+
"202204",
|
|
112
|
+
"202205",
|
|
113
|
+
"202206"
|
|
114
|
+
],
|
|
115
|
+
"ou": [
|
|
116
|
+
"jUb8gELQApl",
|
|
117
|
+
"PMa2VCrupOd",
|
|
118
|
+
"O6uvpzGd5pu",
|
|
119
|
+
"lc3eMKXaEfw",
|
|
120
|
+
"fdc6uOvgoji"
|
|
121
|
+
],
|
|
122
|
+
"co": []
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"rows": [
|
|
126
|
+
[
|
|
127
|
+
"jUb8gELQApl",
|
|
128
|
+
"202107",
|
|
129
|
+
"66.0"
|
|
130
|
+
],
|
|
131
|
+
[
|
|
132
|
+
"jUb8gELQApl",
|
|
133
|
+
"202108",
|
|
134
|
+
"80.6"
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
"jUb8gELQApl",
|
|
138
|
+
"202109",
|
|
139
|
+
"83.2"
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
"jUb8gELQApl",
|
|
143
|
+
"202110",
|
|
144
|
+
"60.1"
|
|
145
|
+
],
|
|
146
|
+
[
|
|
147
|
+
"jUb8gELQApl",
|
|
148
|
+
"202111",
|
|
149
|
+
"78.8"
|
|
150
|
+
],
|
|
151
|
+
[
|
|
152
|
+
"jUb8gELQApl",
|
|
153
|
+
"202112",
|
|
154
|
+
"52.2"
|
|
155
|
+
],
|
|
156
|
+
[
|
|
157
|
+
"jUb8gELQApl",
|
|
158
|
+
"202201",
|
|
159
|
+
"72.7"
|
|
160
|
+
],
|
|
161
|
+
[
|
|
162
|
+
"jUb8gELQApl",
|
|
163
|
+
"202202",
|
|
164
|
+
"85.8"
|
|
165
|
+
],
|
|
166
|
+
[
|
|
167
|
+
"jUb8gELQApl",
|
|
168
|
+
"202203",
|
|
169
|
+
"78.7"
|
|
170
|
+
],
|
|
171
|
+
[
|
|
172
|
+
"jUb8gELQApl",
|
|
173
|
+
"202204",
|
|
174
|
+
"82.9"
|
|
175
|
+
],
|
|
176
|
+
[
|
|
177
|
+
"jUb8gELQApl",
|
|
178
|
+
"202205",
|
|
179
|
+
"82.2"
|
|
180
|
+
],
|
|
181
|
+
[
|
|
182
|
+
"jUb8gELQApl",
|
|
183
|
+
"202206",
|
|
184
|
+
"78.5"
|
|
185
|
+
],
|
|
186
|
+
[
|
|
187
|
+
"PMa2VCrupOd",
|
|
188
|
+
"202107",
|
|
189
|
+
"57.5"
|
|
190
|
+
],
|
|
191
|
+
[
|
|
192
|
+
"PMa2VCrupOd",
|
|
193
|
+
"202108",
|
|
194
|
+
"59.2"
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
"PMa2VCrupOd",
|
|
198
|
+
"202109",
|
|
199
|
+
"73.4"
|
|
200
|
+
],
|
|
201
|
+
[
|
|
202
|
+
"PMa2VCrupOd",
|
|
203
|
+
"202110",
|
|
204
|
+
"63.9"
|
|
205
|
+
],
|
|
206
|
+
[
|
|
207
|
+
"PMa2VCrupOd",
|
|
208
|
+
"202111",
|
|
209
|
+
"72.2"
|
|
210
|
+
],
|
|
211
|
+
[
|
|
212
|
+
"PMa2VCrupOd",
|
|
213
|
+
"202112",
|
|
214
|
+
"51.5"
|
|
215
|
+
],
|
|
216
|
+
[
|
|
217
|
+
"PMa2VCrupOd",
|
|
218
|
+
"202201",
|
|
219
|
+
"59.7"
|
|
220
|
+
],
|
|
221
|
+
[
|
|
222
|
+
"PMa2VCrupOd",
|
|
223
|
+
"202202",
|
|
224
|
+
"69.6"
|
|
225
|
+
],
|
|
226
|
+
[
|
|
227
|
+
"PMa2VCrupOd",
|
|
228
|
+
"202203",
|
|
229
|
+
"59.0"
|
|
230
|
+
],
|
|
231
|
+
[
|
|
232
|
+
"PMa2VCrupOd",
|
|
233
|
+
"202204",
|
|
234
|
+
"63.0"
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
"PMa2VCrupOd",
|
|
238
|
+
"202205",
|
|
239
|
+
"53.5"
|
|
240
|
+
],
|
|
241
|
+
[
|
|
242
|
+
"PMa2VCrupOd",
|
|
243
|
+
"202206",
|
|
244
|
+
"64.6"
|
|
245
|
+
],
|
|
246
|
+
[
|
|
247
|
+
"O6uvpzGd5pu",
|
|
248
|
+
"202107",
|
|
249
|
+
"70.7"
|
|
250
|
+
],
|
|
251
|
+
[
|
|
252
|
+
"O6uvpzGd5pu",
|
|
253
|
+
"202108",
|
|
254
|
+
"105.6"
|
|
255
|
+
],
|
|
256
|
+
[
|
|
257
|
+
"O6uvpzGd5pu",
|
|
258
|
+
"202109",
|
|
259
|
+
"81.0"
|
|
260
|
+
],
|
|
261
|
+
[
|
|
262
|
+
"O6uvpzGd5pu",
|
|
263
|
+
"202110",
|
|
264
|
+
"104.7"
|
|
265
|
+
],
|
|
266
|
+
[
|
|
267
|
+
"O6uvpzGd5pu",
|
|
268
|
+
"202111",
|
|
269
|
+
"117.0"
|
|
270
|
+
],
|
|
271
|
+
[
|
|
272
|
+
"O6uvpzGd5pu",
|
|
273
|
+
"202112",
|
|
274
|
+
"59.9"
|
|
275
|
+
],
|
|
276
|
+
[
|
|
277
|
+
"O6uvpzGd5pu",
|
|
278
|
+
"202201",
|
|
279
|
+
"58.6"
|
|
280
|
+
],
|
|
281
|
+
[
|
|
282
|
+
"O6uvpzGd5pu",
|
|
283
|
+
"202202",
|
|
284
|
+
"72.0"
|
|
285
|
+
],
|
|
286
|
+
[
|
|
287
|
+
"O6uvpzGd5pu",
|
|
288
|
+
"202203",
|
|
289
|
+
"66.5"
|
|
290
|
+
],
|
|
291
|
+
[
|
|
292
|
+
"O6uvpzGd5pu",
|
|
293
|
+
"202204",
|
|
294
|
+
"71.2"
|
|
295
|
+
],
|
|
296
|
+
[
|
|
297
|
+
"O6uvpzGd5pu",
|
|
298
|
+
"202205",
|
|
299
|
+
"77.9"
|
|
300
|
+
],
|
|
301
|
+
[
|
|
302
|
+
"O6uvpzGd5pu",
|
|
303
|
+
"202206",
|
|
304
|
+
"74.3"
|
|
305
|
+
],
|
|
306
|
+
[
|
|
307
|
+
"lc3eMKXaEfw",
|
|
308
|
+
"202107",
|
|
309
|
+
"88.2"
|
|
310
|
+
],
|
|
311
|
+
[
|
|
312
|
+
"lc3eMKXaEfw",
|
|
313
|
+
"202108",
|
|
314
|
+
"98.1"
|
|
315
|
+
],
|
|
316
|
+
[
|
|
317
|
+
"lc3eMKXaEfw",
|
|
318
|
+
"202109",
|
|
319
|
+
"112.7"
|
|
320
|
+
],
|
|
321
|
+
[
|
|
322
|
+
"lc3eMKXaEfw",
|
|
323
|
+
"202111",
|
|
324
|
+
"96.2"
|
|
325
|
+
],
|
|
326
|
+
[
|
|
327
|
+
"lc3eMKXaEfw",
|
|
328
|
+
"202201",
|
|
329
|
+
"58.5"
|
|
330
|
+
],
|
|
331
|
+
[
|
|
332
|
+
"lc3eMKXaEfw",
|
|
333
|
+
"202202",
|
|
334
|
+
"71.5"
|
|
335
|
+
],
|
|
336
|
+
[
|
|
337
|
+
"lc3eMKXaEfw",
|
|
338
|
+
"202203",
|
|
339
|
+
"65.8"
|
|
340
|
+
],
|
|
341
|
+
[
|
|
342
|
+
"lc3eMKXaEfw",
|
|
343
|
+
"202204",
|
|
344
|
+
"71.5"
|
|
345
|
+
],
|
|
346
|
+
[
|
|
347
|
+
"lc3eMKXaEfw",
|
|
348
|
+
"202205",
|
|
349
|
+
"70.8"
|
|
350
|
+
],
|
|
351
|
+
[
|
|
352
|
+
"lc3eMKXaEfw",
|
|
353
|
+
"202206",
|
|
354
|
+
"72.6"
|
|
355
|
+
],
|
|
356
|
+
[
|
|
357
|
+
"fdc6uOvgoji",
|
|
358
|
+
"202107",
|
|
359
|
+
"75.7"
|
|
360
|
+
],
|
|
361
|
+
[
|
|
362
|
+
"fdc6uOvgoji",
|
|
363
|
+
"202108",
|
|
364
|
+
"76.6"
|
|
365
|
+
],
|
|
366
|
+
[
|
|
367
|
+
"fdc6uOvgoji",
|
|
368
|
+
"202109",
|
|
369
|
+
"83.2"
|
|
370
|
+
],
|
|
371
|
+
[
|
|
372
|
+
"fdc6uOvgoji",
|
|
373
|
+
"202110",
|
|
374
|
+
"69.8"
|
|
375
|
+
],
|
|
376
|
+
[
|
|
377
|
+
"fdc6uOvgoji",
|
|
378
|
+
"202112",
|
|
379
|
+
"119.6"
|
|
380
|
+
],
|
|
381
|
+
[
|
|
382
|
+
"fdc6uOvgoji",
|
|
383
|
+
"202201",
|
|
384
|
+
"75.4"
|
|
385
|
+
],
|
|
386
|
+
[
|
|
387
|
+
"fdc6uOvgoji",
|
|
388
|
+
"202202",
|
|
389
|
+
"80.3"
|
|
390
|
+
],
|
|
391
|
+
[
|
|
392
|
+
"fdc6uOvgoji",
|
|
393
|
+
"202203",
|
|
394
|
+
"71.7"
|
|
395
|
+
],
|
|
396
|
+
[
|
|
397
|
+
"fdc6uOvgoji",
|
|
398
|
+
"202204",
|
|
399
|
+
"77.9"
|
|
400
|
+
],
|
|
401
|
+
[
|
|
402
|
+
"fdc6uOvgoji",
|
|
403
|
+
"202205",
|
|
404
|
+
"76.5"
|
|
405
|
+
],
|
|
406
|
+
[
|
|
407
|
+
"fdc6uOvgoji",
|
|
408
|
+
"202206",
|
|
409
|
+
"76.1"
|
|
410
|
+
]
|
|
411
|
+
],
|
|
412
|
+
"height": 57,
|
|
413
|
+
"width": 3,
|
|
414
|
+
"headerWidth": 3
|
|
415
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { getChartInstance, updateLayout } from "../utils/chart";
|
|
3
|
+
export function useChart(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
id,
|
|
6
|
+
analytics,
|
|
7
|
+
config
|
|
8
|
+
} = _ref;
|
|
9
|
+
const [chart, setChart] = useState(getChartInstance(id, analytics, config).getOptions());
|
|
10
|
+
const changeChartType = useCallback(type => {
|
|
11
|
+
const updatedLayout = updateLayout(config, {
|
|
12
|
+
type
|
|
13
|
+
});
|
|
14
|
+
const updatedConfig = {
|
|
15
|
+
...config,
|
|
16
|
+
layout: updatedLayout,
|
|
17
|
+
type
|
|
18
|
+
};
|
|
19
|
+
const chartInstance = getChartInstance(id, analytics, updatedConfig);
|
|
20
|
+
setChart(chartInstance.getOptions());
|
|
21
|
+
}, [config, id, analytics]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (analytics && config) {
|
|
24
|
+
const chartInstance = getChartInstance(id, analytics, config);
|
|
25
|
+
setChart(chartInstance.getOptions());
|
|
26
|
+
}
|
|
27
|
+
}, [analytics, config, id]);
|
|
28
|
+
return {
|
|
29
|
+
chart,
|
|
30
|
+
changeChartType
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { uid } from "@hisptz/dhis2-utils";
|
|
2
|
+
import HighCharts from "highcharts";
|
|
3
|
+
import HighchartsReact from "highcharts-react-official";
|
|
4
|
+
import React, { forwardRef, useRef } from "react";
|
|
5
|
+
import ChartDownloadMenu from "./components/DownloadMenu";
|
|
6
|
+
import { useChart } from "./hooks/useChart";
|
|
7
|
+
import "./styles/custom-highchart.css";
|
|
8
|
+
export * from "./services/export";
|
|
9
|
+
export { ChartDownloadMenu };
|
|
10
|
+
function ChartAnalytics(_ref, ref) {
|
|
11
|
+
let {
|
|
12
|
+
analytics,
|
|
13
|
+
config,
|
|
14
|
+
containerProps
|
|
15
|
+
} = _ref;
|
|
16
|
+
const id = useRef(`${uid()}-chart-item`);
|
|
17
|
+
const {
|
|
18
|
+
chart
|
|
19
|
+
} = useChart({
|
|
20
|
+
id: id.current,
|
|
21
|
+
analytics,
|
|
22
|
+
config
|
|
23
|
+
});
|
|
24
|
+
if (!chart) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return /*#__PURE__*/React.createElement(HighchartsReact, {
|
|
28
|
+
immutable: true,
|
|
29
|
+
ref: ref,
|
|
30
|
+
containerProps: {
|
|
31
|
+
id: id.current,
|
|
32
|
+
...(containerProps !== null && containerProps !== void 0 ? containerProps : {})
|
|
33
|
+
},
|
|
34
|
+
highcharts: HighCharts,
|
|
35
|
+
options: {
|
|
36
|
+
...chart
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export default /*#__PURE__*/forwardRef(ChartAnalytics);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getAllCategories, getPointSeries } from "../utils/chart";
|
|
2
|
+
import { DHIS2Chart } from "./index";
|
|
3
|
+
export class DHIS2ColumnChart extends DHIS2Chart {
|
|
4
|
+
getCategories() {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
getHighchartsType() {
|
|
8
|
+
return "column";
|
|
9
|
+
}
|
|
10
|
+
getPlotOptions() {
|
|
11
|
+
return {
|
|
12
|
+
column: {
|
|
13
|
+
dataLabels: {
|
|
14
|
+
enabled: true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
getSeries() {
|
|
20
|
+
return getPointSeries(this.analytics, this.config, "column");
|
|
21
|
+
}
|
|
22
|
+
getXAxis() {
|
|
23
|
+
return {
|
|
24
|
+
type: "category",
|
|
25
|
+
categories: getAllCategories(this.analytics, this.config),
|
|
26
|
+
crosshair: true,
|
|
27
|
+
labels: {
|
|
28
|
+
enabled: true
|
|
29
|
+
},
|
|
30
|
+
title: {
|
|
31
|
+
text: ""
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class DHIS2StackedColumnChart extends DHIS2ColumnChart {
|
|
37
|
+
getPlotOptions() {
|
|
38
|
+
return {
|
|
39
|
+
column: {
|
|
40
|
+
stacking: "normal",
|
|
41
|
+
...super.getPlotOptions().column
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
export class DHIS2Chart {
|
|
5
|
+
constructor(id, analytics, config) {
|
|
6
|
+
_defineProperty(this, "id", void 0);
|
|
7
|
+
_defineProperty(this, "analytics", void 0);
|
|
8
|
+
_defineProperty(this, "config", void 0);
|
|
9
|
+
this.id = id;
|
|
10
|
+
this.analytics = analytics;
|
|
11
|
+
this.config = config;
|
|
12
|
+
}
|
|
13
|
+
getChartConfig() {
|
|
14
|
+
var _this$config;
|
|
15
|
+
return {
|
|
16
|
+
renderTo: this.id,
|
|
17
|
+
zoomType: "xy",
|
|
18
|
+
type: this.getHighchartsType(),
|
|
19
|
+
height: (_this$config = this.config) === null || _this$config === void 0 ? void 0 : _this$config.height,
|
|
20
|
+
styledMode: false
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
getOptions() {
|
|
24
|
+
var _this$config$colors, _this$config2, _this$config$highChar, _this$config3;
|
|
25
|
+
return {
|
|
26
|
+
yAxis: this.getYAxis(),
|
|
27
|
+
chart: this.getChartConfig(),
|
|
28
|
+
colors: (_this$config$colors = (_this$config2 = this.config) === null || _this$config2 === void 0 ? void 0 : _this$config2.colors) !== null && _this$config$colors !== void 0 ? _this$config$colors : ["#2f7ed8", "#0d233a", "#8bbc21", "#910000", "#1aadce", "#492970", "#f28f43", "#77a1e5", "#c42525", "#a6c96a"],
|
|
29
|
+
series: this.getSeries(),
|
|
30
|
+
plotOptions: this.getPlotOptions(),
|
|
31
|
+
title: {
|
|
32
|
+
text: ""
|
|
33
|
+
},
|
|
34
|
+
xAxis: this.getXAxis(),
|
|
35
|
+
exporting: this.getExporting(),
|
|
36
|
+
legend: {
|
|
37
|
+
enabled: true
|
|
38
|
+
},
|
|
39
|
+
credits: {
|
|
40
|
+
enabled: false
|
|
41
|
+
},
|
|
42
|
+
...((_this$config$highChar = (_this$config3 = this.config) === null || _this$config3 === void 0 ? void 0 : _this$config3.highChartOverrides) !== null && _this$config$highChar !== void 0 ? _this$config$highChar : {})
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
getYAxis() {
|
|
46
|
+
return [{
|
|
47
|
+
title: {
|
|
48
|
+
text: "",
|
|
49
|
+
style: {
|
|
50
|
+
color: "#000000",
|
|
51
|
+
fontWeight: "normal",
|
|
52
|
+
fontSize: "14px"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
labels: {
|
|
56
|
+
enabled: true,
|
|
57
|
+
style: {
|
|
58
|
+
color: "#000000",
|
|
59
|
+
fontWeight: "normal",
|
|
60
|
+
fontSize: "14px"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
plotLines: [{
|
|
64
|
+
color: "#000000",
|
|
65
|
+
dashStyle: "Solid",
|
|
66
|
+
width: 2,
|
|
67
|
+
zIndex: 1000,
|
|
68
|
+
label: {
|
|
69
|
+
text: ""
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
color: "#bbbbbb",
|
|
73
|
+
dashStyle: "Solid",
|
|
74
|
+
zIndex: 1000,
|
|
75
|
+
width: 2,
|
|
76
|
+
label: {
|
|
77
|
+
text: ""
|
|
78
|
+
}
|
|
79
|
+
}]
|
|
80
|
+
}];
|
|
81
|
+
}
|
|
82
|
+
getExporting() {
|
|
83
|
+
var _this$config$name, _this$config4;
|
|
84
|
+
const name = (_this$config$name = (_this$config4 = this.config) === null || _this$config4 === void 0 ? void 0 : _this$config4.name) !== null && _this$config$name !== void 0 ? _this$config$name : "chart";
|
|
85
|
+
return {
|
|
86
|
+
filename: `${name}`,
|
|
87
|
+
sourceWidth: 1200,
|
|
88
|
+
buttons: {
|
|
89
|
+
contextButton: {
|
|
90
|
+
enabled: false
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getAllCategories, getPointSeries } from "../utils/chart";
|
|
2
|
+
import { DHIS2Chart } from "./index";
|
|
3
|
+
export class DHIS2LineChart extends DHIS2Chart {
|
|
4
|
+
getHighchartsType() {
|
|
5
|
+
return "line";
|
|
6
|
+
}
|
|
7
|
+
getPlotOptions() {
|
|
8
|
+
return {
|
|
9
|
+
line: {}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
getSeries() {
|
|
13
|
+
return getPointSeries(this.analytics, this.config, "line");
|
|
14
|
+
}
|
|
15
|
+
getXAxis() {
|
|
16
|
+
return {
|
|
17
|
+
type: "category",
|
|
18
|
+
categories: getAllCategories(this.analytics, this.config),
|
|
19
|
+
crosshair: true,
|
|
20
|
+
labels: {
|
|
21
|
+
enabled: true
|
|
22
|
+
},
|
|
23
|
+
title: {
|
|
24
|
+
text: ""
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|