@hisptz/dhis2-analytics 1.0.49 → 1.0.51
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/.gitignore +5 -0
- package/build/cjs/components/ChartAnalytics/ChartAnalytics.test.js +1 -1
- package/build/cjs/components/ChartAnalytics/models/bar.js +24 -0
- package/build/cjs/components/ChartAnalytics/utils/chart.js +5 -0
- package/build/es/components/ChartAnalytics/ChartAnalytics.test.js +1 -1
- package/build/es/components/ChartAnalytics/models/bar.js +16 -0
- package/build/es/components/ChartAnalytics/utils/chart.js +5 -0
- package/build/types/components/ChartAnalytics/models/bar.d.ts +8 -0
- package/build/types/components/ChartAnalytics/types/props.d.ts +1 -1
- package/d2.config.js +8 -0
- package/i18n/en.pot +439 -0
- package/package.json +5 -5
- package/src/components/ChartAnalytics/ChartAnalytics.test.tsx +51 -0
- package/src/components/ChartAnalytics/components/DownloadMenu/components/Menu.tsx +48 -0
- package/src/components/ChartAnalytics/components/DownloadMenu/constants/menu.ts +38 -0
- package/src/components/ChartAnalytics/components/DownloadMenu/index.tsx +65 -0
- package/src/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.ts +1 -0
- package/src/components/ChartAnalytics/hooks/useChart.ts +35 -0
- package/src/components/ChartAnalytics/index.tsx +28 -0
- package/src/components/ChartAnalytics/models/bar.ts +20 -0
- package/src/components/ChartAnalytics/models/column.ts +52 -0
- package/src/components/ChartAnalytics/models/index.ts +111 -0
- package/src/components/ChartAnalytics/models/line.ts +31 -0
- package/src/components/ChartAnalytics/models/multi-series.ts +115 -0
- package/src/components/ChartAnalytics/models/pie.ts +54 -0
- package/src/components/ChartAnalytics/services/export.ts +38 -0
- package/src/components/ChartAnalytics/styles/custom-highchart.css +48 -0
- package/src/components/ChartAnalytics/types/props.tsx +48 -0
- package/src/components/ChartAnalytics/utils/chart.ts +128 -0
- package/src/components/CircularProgressDashboard/CircularProgressIndicator.test.tsx +9 -0
- package/src/components/CircularProgressDashboard/index.tsx +36 -0
- package/src/components/CircularProgressDashboard/types/props.tsx +17 -0
- package/src/components/CustomPivotTable/components/Table/index.tsx +23 -0
- package/src/components/CustomPivotTable/components/TableBody/TableBody.module.css +12 -0
- package/src/components/CustomPivotTable/components/TableBody/index.tsx +96 -0
- package/src/components/CustomPivotTable/components/TableHeaders/TableHeaders.module.css +10 -0
- package/src/components/CustomPivotTable/components/TableHeaders/index.tsx +94 -0
- package/src/components/CustomPivotTable/index.tsx +63 -0
- package/src/components/CustomPivotTable/interfaces/index.ts +1 -0
- package/src/components/CustomPivotTable/services/engine.ts +102 -0
- package/src/components/CustomPivotTable/state/engine.tsx +22 -0
- package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.tsx +28 -0
- package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.tsx +34 -0
- package/src/components/Map/components/EarthEngineLayerConfiguration/index.tsx +412 -0
- package/src/components/Map/components/MapArea/index.tsx +83 -0
- package/src/components/Map/components/MapArea/interfaces/index.ts +39 -0
- package/src/components/Map/components/MapControls/components/CustomControl/index.tsx +24 -0
- package/src/components/Map/components/MapControls/components/DownloadControl/index.tsx +11 -0
- package/src/components/Map/components/MapControls/components/FullscreenControl/index.tsx +7 -0
- package/src/components/Map/components/MapControls/index.tsx +24 -0
- package/src/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.ts +7 -0
- package/src/components/Map/components/MapLayer/components/BoundaryLayer/index.tsx +55 -0
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.tsx +74 -0
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.ts +430 -0
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.ts +34 -0
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/index.tsx +185 -0
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.ts +56 -0
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +34241 -0
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.ts +431 -0
- package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.ts +105 -0
- package/src/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +12 -0
- package/src/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.tsx +17 -0
- package/src/components/Map/components/MapLayer/components/LegendArea/index.tsx +167 -0
- package/src/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.tsx +44 -0
- package/src/components/Map/components/MapLayer/components/PointLayer/hooks/index.ts +8 -0
- package/src/components/Map/components/MapLayer/components/PointLayer/index.tsx +36 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.tsx +48 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.tsx +150 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.tsx +39 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.tsx +57 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.tsx +43 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.tsx +38 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.tsx +26 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.ts +10 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/index.tsx +46 -0
- package/src/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +62 -0
- package/src/components/Map/components/MapLayer/index.tsx +32 -0
- package/src/components/Map/components/MapLayer/interfaces/index.ts +139 -0
- package/src/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.tsx +368 -0
- package/src/components/Map/components/MapProvider/components/MapLayerProvider/index.tsx +105 -0
- package/src/components/Map/components/MapProvider/hooks/index.ts +14 -0
- package/src/components/Map/components/MapProvider/index.tsx +93 -0
- package/src/components/Map/components/MapUpdater/index.tsx +8 -0
- package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.tsx +28 -0
- package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.tsx +34 -0
- package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.tsx +24 -0
- package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.ts +433 -0
- package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.tsx +50 -0
- package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +15 -0
- package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +12 -0
- package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.ts +91 -0
- package/src/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.tsx +45 -0
- package/src/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.tsx +47 -0
- package/src/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.tsx +57 -0
- package/src/components/Map/components/ThematicLayerConfiguration/index.tsx +248 -0
- package/src/components/Map/constants/colors.ts +434 -0
- package/src/components/Map/constants/legendSet.ts +19 -0
- package/src/components/Map/hooks/map.ts +47 -0
- package/src/components/Map/index.tsx +65 -0
- package/src/components/Map/interfaces/index.ts +57 -0
- package/src/components/Map/state/index.tsx +31 -0
- package/src/components/Map/utils/colors.ts +95 -0
- package/src/components/Map/utils/helpers.ts +15 -0
- package/src/components/Map/utils/map.ts +150 -0
- package/src/components/SingleValueContainer/SingleValueContainer.test.tsx +24 -0
- package/src/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.tsx +46 -0
- package/src/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.tsx +12 -0
- package/src/components/SingleValueContainer/index.tsx +37 -0
- package/src/components/SingleValueContainer/styles/SingleValueContainer.module.css +39 -0
- package/src/components/SingleValueContainer/types/props.tsx +16 -0
- package/src/components/Visualization/components/AnalyticsDataProvider/index.tsx +76 -0
- package/src/components/Visualization/components/DimensionsProvider/index.tsx +51 -0
- package/src/components/Visualization/components/LayoutProvider/index.tsx +34 -0
- package/src/components/Visualization/components/VisualizationDimensionSelector/index.tsx +59 -0
- package/src/components/Visualization/components/VisualizationProvider/index.tsx +31 -0
- package/src/components/Visualization/components/VisualizationSelector/index.tsx +157 -0
- package/src/components/Visualization/components/VisualizationTypeProvider/index.tsx +40 -0
- package/src/components/Visualization/components/VisualizationTypeSelector/index.tsx +46 -0
- package/src/components/Visualization/index.tsx +103 -0
- package/src/index.ts +6 -0
- package/src/locales/en/translations.json +138 -0
- package/src/locales/index.js +16 -0
- package/tsconfig.build.json +46 -0
- package/tsconfig.json +51 -0
- package/LICENSE +0 -29
package/.gitignore
ADDED
|
@@ -4,7 +4,7 @@ var _react = require("@cypress/react");
|
|
|
4
4
|
var _highcharts = _interopRequireDefault(require("highcharts"));
|
|
5
5
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
6
6
|
var _DownloadMenu = require("./components/DownloadMenu");
|
|
7
|
-
var _columnData = _interopRequireDefault(require("
|
|
7
|
+
var _columnData = _interopRequireDefault(require("../../../../../resources/analytics/column-data.json"));
|
|
8
8
|
var _export = require("./services/export");
|
|
9
9
|
var _ = require(".");
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DHIS2StackedBarChart = exports.DHIS2BarChart = void 0;
|
|
7
|
+
var _column = require("./column");
|
|
8
|
+
class DHIS2BarChart extends _column.DHIS2ColumnChart {
|
|
9
|
+
getHighchartsType() {
|
|
10
|
+
return "bar";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.DHIS2BarChart = DHIS2BarChart;
|
|
14
|
+
class DHIS2StackedBarChart extends DHIS2BarChart {
|
|
15
|
+
getPlotOptions() {
|
|
16
|
+
return {
|
|
17
|
+
column: {
|
|
18
|
+
stacking: "normal",
|
|
19
|
+
...super.getPlotOptions().column
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.DHIS2StackedBarChart = DHIS2StackedBarChart;
|
|
@@ -14,6 +14,7 @@ var _column = require("../models/column");
|
|
|
14
14
|
var _line = require("../models/line");
|
|
15
15
|
var _multiSeries = require("../models/multi-series");
|
|
16
16
|
var _pie = require("../models/pie");
|
|
17
|
+
var _bar = require("../models/bar");
|
|
17
18
|
function getDimensionHeaderIndex(headers, name) {
|
|
18
19
|
return (0, _lodash.findIndex)(headers, {
|
|
19
20
|
name
|
|
@@ -119,6 +120,10 @@ function getChartInstance(id, analytics, config) {
|
|
|
119
120
|
switch (config.type) {
|
|
120
121
|
case "column":
|
|
121
122
|
return new _column.DHIS2ColumnChart(id, analytics, config);
|
|
123
|
+
case "bar":
|
|
124
|
+
return new _bar.DHIS2BarChart(id, analytics, config);
|
|
125
|
+
case "stacked-bar":
|
|
126
|
+
return new _bar.DHIS2StackedBarChart(id, analytics, config);
|
|
122
127
|
case "stacked-column":
|
|
123
128
|
return new _column.DHIS2StackedColumnChart(id, analytics, config);
|
|
124
129
|
case "pie":
|
|
@@ -3,7 +3,7 @@ import { mount } from "@cypress/react";
|
|
|
3
3
|
import HighCharts from "highcharts";
|
|
4
4
|
import React, { useState } from "react";
|
|
5
5
|
import { ChartDownloadMenu } from "./components/DownloadMenu";
|
|
6
|
-
import columnData from "
|
|
6
|
+
import columnData from "../../../../../resources/analytics/column-data.json";
|
|
7
7
|
import { setupHighchartsModules } from "./services/export";
|
|
8
8
|
import { ChartAnalytics } from ".";
|
|
9
9
|
const props = {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DHIS2ColumnChart } from "./column";
|
|
2
|
+
export class DHIS2BarChart extends DHIS2ColumnChart {
|
|
3
|
+
getHighchartsType() {
|
|
4
|
+
return "bar";
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class DHIS2StackedBarChart extends DHIS2BarChart {
|
|
8
|
+
getPlotOptions() {
|
|
9
|
+
return {
|
|
10
|
+
column: {
|
|
11
|
+
stacking: "normal",
|
|
12
|
+
...super.getPlotOptions().column
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -3,6 +3,7 @@ import { DHIS2ColumnChart, DHIS2StackedColumnChart } from "../models/column";
|
|
|
3
3
|
import { DHIS2LineChart } from "../models/line";
|
|
4
4
|
import { DHIS2MultiSeriesChart } from "../models/multi-series";
|
|
5
5
|
import { DHIS2PieChart } from "../models/pie";
|
|
6
|
+
import { DHIS2BarChart, DHIS2StackedBarChart } from "../models/bar";
|
|
6
7
|
export function getDimensionHeaderIndex(headers, name) {
|
|
7
8
|
return findIndex(headers, {
|
|
8
9
|
name
|
|
@@ -108,6 +109,10 @@ export function getChartInstance(id, analytics, config) {
|
|
|
108
109
|
switch (config.type) {
|
|
109
110
|
case "column":
|
|
110
111
|
return new DHIS2ColumnChart(id, analytics, config);
|
|
112
|
+
case "bar":
|
|
113
|
+
return new DHIS2BarChart(id, analytics, config);
|
|
114
|
+
case "stacked-bar":
|
|
115
|
+
return new DHIS2StackedBarChart(id, analytics, config);
|
|
111
116
|
case "stacked-column":
|
|
112
117
|
return new DHIS2StackedColumnChart(id, analytics, config);
|
|
113
118
|
case "pie":
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PlotOptions } from "highcharts";
|
|
2
|
+
import { DHIS2ColumnChart } from "./column";
|
|
3
|
+
export declare class DHIS2BarChart extends DHIS2ColumnChart {
|
|
4
|
+
getHighchartsType(): string;
|
|
5
|
+
}
|
|
6
|
+
export declare class DHIS2StackedBarChart extends DHIS2BarChart {
|
|
7
|
+
getPlotOptions(): PlotOptions;
|
|
8
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Analytics } from "@hisptz/dhis2-utils";
|
|
2
2
|
import HighCharts, { DashStyleValue, YAxisOptions, YAxisPlotLinesLabelOptions } from "highcharts";
|
|
3
|
-
export type ChartType = "column" | "pie" | "stacked-column" | "line" | "multi-series";
|
|
3
|
+
export type ChartType = "column" | "pie" | "stacked-column" | "line" | "multi-series" | "bar" | "stacked-bar";
|
|
4
4
|
export interface MultiSeriesConfig {
|
|
5
5
|
series?: Array<{
|
|
6
6
|
id: string;
|
package/d2.config.js
ADDED
package/i18n/en.pot
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: i18next-conv\n"
|
|
4
|
+
"MIME-Version: 1.0\n"
|
|
5
|
+
"Content-Type: text/plain; charset=utf-8\n"
|
|
6
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
7
|
+
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
|
8
|
+
"POT-Creation-Date: 2023-05-05T07:58:47.325Z\n"
|
|
9
|
+
"PO-Revision-Date: 2023-05-05T07:58:47.325Z\n"
|
|
10
|
+
|
|
11
|
+
msgid "Download PNG"
|
|
12
|
+
msgstr "Download PNG"
|
|
13
|
+
|
|
14
|
+
msgid "Download JPEG"
|
|
15
|
+
msgstr "Download JPEG"
|
|
16
|
+
|
|
17
|
+
msgid "Download SVG"
|
|
18
|
+
msgstr "Download SVG"
|
|
19
|
+
|
|
20
|
+
msgid "Download PDF"
|
|
21
|
+
msgstr "Download PDF"
|
|
22
|
+
|
|
23
|
+
msgid "View as table"
|
|
24
|
+
msgstr "View as table"
|
|
25
|
+
|
|
26
|
+
msgid "View full screen"
|
|
27
|
+
msgstr "View full screen"
|
|
28
|
+
|
|
29
|
+
msgid "Submit"
|
|
30
|
+
msgstr "Submit"
|
|
31
|
+
|
|
32
|
+
msgid "Aggregation"
|
|
33
|
+
msgstr "Aggregation"
|
|
34
|
+
|
|
35
|
+
msgid "Aggregations"
|
|
36
|
+
msgstr "Aggregations"
|
|
37
|
+
|
|
38
|
+
msgid "Period is required"
|
|
39
|
+
msgstr "Period is required"
|
|
40
|
+
|
|
41
|
+
msgid "Available periods are set by the source data"
|
|
42
|
+
msgstr "Available periods are set by the source data"
|
|
43
|
+
|
|
44
|
+
msgid "Period"
|
|
45
|
+
msgstr "Period"
|
|
46
|
+
|
|
47
|
+
msgid "Min"
|
|
48
|
+
msgstr "Min"
|
|
49
|
+
|
|
50
|
+
msgid "Max"
|
|
51
|
+
msgstr "Max"
|
|
52
|
+
|
|
53
|
+
msgid "Steps"
|
|
54
|
+
msgstr "Steps"
|
|
55
|
+
|
|
56
|
+
msgid "Colors"
|
|
57
|
+
msgstr "Colors"
|
|
58
|
+
|
|
59
|
+
msgid "Unit"
|
|
60
|
+
msgstr "Unit"
|
|
61
|
+
|
|
62
|
+
msgid "Name is required"
|
|
63
|
+
msgstr "Name is required"
|
|
64
|
+
|
|
65
|
+
msgid "Layer name"
|
|
66
|
+
msgstr "Layer name"
|
|
67
|
+
|
|
68
|
+
msgid "Type is required"
|
|
69
|
+
msgstr "Type is required"
|
|
70
|
+
|
|
71
|
+
msgid "Layer type"
|
|
72
|
+
msgstr "Layer type"
|
|
73
|
+
|
|
74
|
+
msgid "Configure Earth Engine Layer"
|
|
75
|
+
msgstr "Configure Earth Engine Layer"
|
|
76
|
+
|
|
77
|
+
msgid "Cancel"
|
|
78
|
+
msgstr "Cancel"
|
|
79
|
+
|
|
80
|
+
msgid "Save"
|
|
81
|
+
msgstr "Save"
|
|
82
|
+
|
|
83
|
+
msgid "Boundaries"
|
|
84
|
+
msgstr "Boundaries"
|
|
85
|
+
|
|
86
|
+
msgid "Source"
|
|
87
|
+
msgstr "Source"
|
|
88
|
+
|
|
89
|
+
msgid "Population"
|
|
90
|
+
msgstr "Population"
|
|
91
|
+
|
|
92
|
+
msgid "people per hectare"
|
|
93
|
+
msgstr "people per hectare"
|
|
94
|
+
|
|
95
|
+
msgid "Estimated number of people living in an area."
|
|
96
|
+
msgstr "Estimated number of people living in an area."
|
|
97
|
+
|
|
98
|
+
msgid "Population age groups"
|
|
99
|
+
msgstr "Population age groups"
|
|
100
|
+
|
|
101
|
+
msgid "Estimated number of people living in an area, grouped by age and gender."
|
|
102
|
+
msgstr "Estimated number of people living in an area, grouped by age and gender."
|
|
103
|
+
|
|
104
|
+
msgid "Male 0 - 1 years"
|
|
105
|
+
msgstr "Male 0 - 1 years"
|
|
106
|
+
|
|
107
|
+
msgid "Male 1 - 4 years"
|
|
108
|
+
msgstr "Male 1 - 4 years"
|
|
109
|
+
|
|
110
|
+
msgid "Male 5 - 9 years"
|
|
111
|
+
msgstr "Male 5 - 9 years"
|
|
112
|
+
|
|
113
|
+
msgid "Male 10 - 14 years"
|
|
114
|
+
msgstr "Male 10 - 14 years"
|
|
115
|
+
|
|
116
|
+
msgid "Male 15 - 19 years"
|
|
117
|
+
msgstr "Male 15 - 19 years"
|
|
118
|
+
|
|
119
|
+
msgid "Male 20 - 24 years"
|
|
120
|
+
msgstr "Male 20 - 24 years"
|
|
121
|
+
|
|
122
|
+
msgid "Male 25 - 29 years"
|
|
123
|
+
msgstr "Male 25 - 29 years"
|
|
124
|
+
|
|
125
|
+
msgid "Male 30 - 34 years"
|
|
126
|
+
msgstr "Male 30 - 34 years"
|
|
127
|
+
|
|
128
|
+
msgid "Male 35 - 39 years"
|
|
129
|
+
msgstr "Male 35 - 39 years"
|
|
130
|
+
|
|
131
|
+
msgid "Male 40 - 44 years"
|
|
132
|
+
msgstr "Male 40 - 44 years"
|
|
133
|
+
|
|
134
|
+
msgid "Male 45 - 49 years"
|
|
135
|
+
msgstr "Male 45 - 49 years"
|
|
136
|
+
|
|
137
|
+
msgid "Male 50 - 54 years"
|
|
138
|
+
msgstr "Male 50 - 54 years"
|
|
139
|
+
|
|
140
|
+
msgid "Male 55 - 59 years"
|
|
141
|
+
msgstr "Male 55 - 59 years"
|
|
142
|
+
|
|
143
|
+
msgid "Male 60 - 64 years"
|
|
144
|
+
msgstr "Male 60 - 64 years"
|
|
145
|
+
|
|
146
|
+
msgid "Male 65 - 69 years"
|
|
147
|
+
msgstr "Male 65 - 69 years"
|
|
148
|
+
|
|
149
|
+
msgid "Male 70 - 74 years"
|
|
150
|
+
msgstr "Male 70 - 74 years"
|
|
151
|
+
|
|
152
|
+
msgid "Male 75 - 79 years"
|
|
153
|
+
msgstr "Male 75 - 79 years"
|
|
154
|
+
|
|
155
|
+
msgid "Male 80 years and above"
|
|
156
|
+
msgstr "Male 80 years and above"
|
|
157
|
+
|
|
158
|
+
msgid "Female 0 - 1 years"
|
|
159
|
+
msgstr "Female 0 - 1 years"
|
|
160
|
+
|
|
161
|
+
msgid "Female 1 - 4 years"
|
|
162
|
+
msgstr "Female 1 - 4 years"
|
|
163
|
+
|
|
164
|
+
msgid "Female 5 - 9 years"
|
|
165
|
+
msgstr "Female 5 - 9 years"
|
|
166
|
+
|
|
167
|
+
msgid "Female 10 - 14 years"
|
|
168
|
+
msgstr "Female 10 - 14 years"
|
|
169
|
+
|
|
170
|
+
msgid "Female 15 - 19 years"
|
|
171
|
+
msgstr "Female 15 - 19 years"
|
|
172
|
+
|
|
173
|
+
msgid "Female 20 - 24 years"
|
|
174
|
+
msgstr "Female 20 - 24 years"
|
|
175
|
+
|
|
176
|
+
msgid "Female 25 - 29 years"
|
|
177
|
+
msgstr "Female 25 - 29 years"
|
|
178
|
+
|
|
179
|
+
msgid "Female 30 - 34 years"
|
|
180
|
+
msgstr "Female 30 - 34 years"
|
|
181
|
+
|
|
182
|
+
msgid "Female 35 - 39 years"
|
|
183
|
+
msgstr "Female 35 - 39 years"
|
|
184
|
+
|
|
185
|
+
msgid "Female 40 - 44 years"
|
|
186
|
+
msgstr "Female 40 - 44 years"
|
|
187
|
+
|
|
188
|
+
msgid "Female 45 - 49 years"
|
|
189
|
+
msgstr "Female 45 - 49 years"
|
|
190
|
+
|
|
191
|
+
msgid "Female 50 - 54 years"
|
|
192
|
+
msgstr "Female 50 - 54 years"
|
|
193
|
+
|
|
194
|
+
msgid "Female 55 - 59 years"
|
|
195
|
+
msgstr "Female 55 - 59 years"
|
|
196
|
+
|
|
197
|
+
msgid "Female 60 - 64 years"
|
|
198
|
+
msgstr "Female 60 - 64 years"
|
|
199
|
+
|
|
200
|
+
msgid "Female 65 - 69 years"
|
|
201
|
+
msgstr "Female 65 - 69 years"
|
|
202
|
+
|
|
203
|
+
msgid "Female 70 - 74 years"
|
|
204
|
+
msgstr "Female 70 - 74 years"
|
|
205
|
+
|
|
206
|
+
msgid "Female 75 - 79 years"
|
|
207
|
+
msgstr "Female 75 - 79 years"
|
|
208
|
+
|
|
209
|
+
msgid "Female 80 years and above"
|
|
210
|
+
msgstr "Female 80 years and above"
|
|
211
|
+
|
|
212
|
+
msgid "Building footprints"
|
|
213
|
+
msgstr "Building footprints"
|
|
214
|
+
|
|
215
|
+
msgid "Number of buildings"
|
|
216
|
+
msgstr "Number of buildings"
|
|
217
|
+
|
|
218
|
+
msgid ""
|
|
219
|
+
"The outlines of buildings derived from high-resolution satellite imagery. "
|
|
220
|
+
"Only for the continent of Africa."
|
|
221
|
+
msgstr ""
|
|
222
|
+
"The outlines of buildings derived from high-resolution satellite imagery. "
|
|
223
|
+
"Only for the continent of Africa."
|
|
224
|
+
|
|
225
|
+
msgid "Building counts are only available for smaller organisation unit areas."
|
|
226
|
+
msgstr "Building counts are only available for smaller organisation unit areas."
|
|
227
|
+
|
|
228
|
+
msgid ""
|
|
229
|
+
"Select a smaller area or single organization unit to see the count of "
|
|
230
|
+
"buildings."
|
|
231
|
+
msgstr ""
|
|
232
|
+
"Select a smaller area or single organization unit to see the count of "
|
|
233
|
+
"buildings."
|
|
234
|
+
|
|
235
|
+
msgid "Elevation"
|
|
236
|
+
msgstr "Elevation"
|
|
237
|
+
|
|
238
|
+
msgid "meters"
|
|
239
|
+
msgstr "meters"
|
|
240
|
+
|
|
241
|
+
msgid "Elevation above sea-level."
|
|
242
|
+
msgstr "Elevation above sea-level."
|
|
243
|
+
|
|
244
|
+
msgid "Precipitation"
|
|
245
|
+
msgstr "Precipitation"
|
|
246
|
+
|
|
247
|
+
msgid "millimeter"
|
|
248
|
+
msgstr "millimeter"
|
|
249
|
+
|
|
250
|
+
msgid ""
|
|
251
|
+
"Precipitation collected from satellite and weather stations on the ground. "
|
|
252
|
+
"The values are in millimeters within 5 days periods. Updated monthly, "
|
|
253
|
+
"during the 3rd week of the following month."
|
|
254
|
+
msgstr ""
|
|
255
|
+
"Precipitation collected from satellite and weather stations on the ground. "
|
|
256
|
+
"The values are in millimeters within 5 days periods. Updated monthly, "
|
|
257
|
+
"during the 3rd week of the following month."
|
|
258
|
+
|
|
259
|
+
msgid "Temperature"
|
|
260
|
+
msgstr "Temperature"
|
|
261
|
+
|
|
262
|
+
msgid "°C during daytime"
|
|
263
|
+
msgstr "°C during daytime"
|
|
264
|
+
|
|
265
|
+
msgid ""
|
|
266
|
+
"Land surface temperatures collected from satellite. Blank spots will appear "
|
|
267
|
+
"in areas with a persistent cloud cover."
|
|
268
|
+
msgstr ""
|
|
269
|
+
"Land surface temperatures collected from satellite. Blank spots will appear "
|
|
270
|
+
"in areas with a persistent cloud cover."
|
|
271
|
+
|
|
272
|
+
msgid "Landcover"
|
|
273
|
+
msgstr "Landcover"
|
|
274
|
+
|
|
275
|
+
msgid "Distinct landcover types collected from satellites."
|
|
276
|
+
msgstr "Distinct landcover types collected from satellites."
|
|
277
|
+
|
|
278
|
+
msgid "Evergreen Needleleaf forest"
|
|
279
|
+
msgstr "Evergreen Needleleaf forest"
|
|
280
|
+
|
|
281
|
+
msgid "Evergreen Broadleaf forest"
|
|
282
|
+
msgstr "Evergreen Broadleaf forest"
|
|
283
|
+
|
|
284
|
+
msgid "Deciduous Needleleaf forest"
|
|
285
|
+
msgstr "Deciduous Needleleaf forest"
|
|
286
|
+
|
|
287
|
+
msgid "Deciduous Broadleaf forest"
|
|
288
|
+
msgstr "Deciduous Broadleaf forest"
|
|
289
|
+
|
|
290
|
+
msgid "Mixed forest"
|
|
291
|
+
msgstr "Mixed forest"
|
|
292
|
+
|
|
293
|
+
msgid "Closed shrublands"
|
|
294
|
+
msgstr "Closed shrublands"
|
|
295
|
+
|
|
296
|
+
msgid "Open shrublands"
|
|
297
|
+
msgstr "Open shrublands"
|
|
298
|
+
|
|
299
|
+
msgid "Woody savannas"
|
|
300
|
+
msgstr "Woody savannas"
|
|
301
|
+
|
|
302
|
+
msgid "Savannas"
|
|
303
|
+
msgstr "Savannas"
|
|
304
|
+
|
|
305
|
+
msgid "Grasslands"
|
|
306
|
+
msgstr "Grasslands"
|
|
307
|
+
|
|
308
|
+
msgid "Permanent wetlands"
|
|
309
|
+
msgstr "Permanent wetlands"
|
|
310
|
+
|
|
311
|
+
msgid "Croplands"
|
|
312
|
+
msgstr "Croplands"
|
|
313
|
+
|
|
314
|
+
msgid "Urban and built-up"
|
|
315
|
+
msgstr "Urban and built-up"
|
|
316
|
+
|
|
317
|
+
msgid "Cropland/Natural vegetation mosaic"
|
|
318
|
+
msgstr "Cropland/Natural vegetation mosaic"
|
|
319
|
+
|
|
320
|
+
msgid "Snow and ice"
|
|
321
|
+
msgstr "Snow and ice"
|
|
322
|
+
|
|
323
|
+
msgid "Barren or sparsely vegetated"
|
|
324
|
+
msgstr "Barren or sparsely vegetated"
|
|
325
|
+
|
|
326
|
+
msgid "Water"
|
|
327
|
+
msgstr "Water"
|
|
328
|
+
|
|
329
|
+
msgid "Nighttime lights"
|
|
330
|
+
msgstr "Nighttime lights"
|
|
331
|
+
|
|
332
|
+
msgid "light intensity"
|
|
333
|
+
msgstr "light intensity"
|
|
334
|
+
|
|
335
|
+
msgid ""
|
|
336
|
+
"Light intensity from cities, towns, and other sites with persistent "
|
|
337
|
+
"lighting, including gas flares."
|
|
338
|
+
msgstr ""
|
|
339
|
+
"Light intensity from cities, towns, and other sites with persistent "
|
|
340
|
+
"lighting, including gas flares."
|
|
341
|
+
|
|
342
|
+
msgid "Could not get aggregate data"
|
|
343
|
+
msgstr "Could not get aggregate data"
|
|
344
|
+
|
|
345
|
+
msgid "Points"
|
|
346
|
+
msgstr "Points"
|
|
347
|
+
|
|
348
|
+
msgid "Mid"
|
|
349
|
+
msgstr "Mid"
|
|
350
|
+
|
|
351
|
+
msgid "Value"
|
|
352
|
+
msgstr "Value"
|
|
353
|
+
|
|
354
|
+
msgid "Error"
|
|
355
|
+
msgstr "Error"
|
|
356
|
+
|
|
357
|
+
msgid "Classes"
|
|
358
|
+
msgstr "Classes"
|
|
359
|
+
|
|
360
|
+
msgid "Select Data Item"
|
|
361
|
+
msgstr "Select Data Item"
|
|
362
|
+
|
|
363
|
+
msgid "Update"
|
|
364
|
+
msgstr "Update"
|
|
365
|
+
|
|
366
|
+
msgid "Legend set"
|
|
367
|
+
msgstr "Legend set"
|
|
368
|
+
|
|
369
|
+
msgid "Please wait..."
|
|
370
|
+
msgstr "Please wait..."
|
|
371
|
+
|
|
372
|
+
msgid "Layer type is required"
|
|
373
|
+
msgstr "Layer type is required"
|
|
374
|
+
|
|
375
|
+
msgid "Choropleth"
|
|
376
|
+
msgstr "Choropleth"
|
|
377
|
+
|
|
378
|
+
msgid "Bubble"
|
|
379
|
+
msgstr "Bubble"
|
|
380
|
+
|
|
381
|
+
msgid "A data item is required"
|
|
382
|
+
msgstr "A data item is required"
|
|
383
|
+
|
|
384
|
+
msgid "Data Item"
|
|
385
|
+
msgstr "Data Item"
|
|
386
|
+
|
|
387
|
+
msgid "Change"
|
|
388
|
+
msgstr "Change"
|
|
389
|
+
|
|
390
|
+
msgid "Select"
|
|
391
|
+
msgstr "Select"
|
|
392
|
+
|
|
393
|
+
msgid "Legend"
|
|
394
|
+
msgstr "Legend"
|
|
395
|
+
|
|
396
|
+
msgid "Custom legend"
|
|
397
|
+
msgstr "Custom legend"
|
|
398
|
+
|
|
399
|
+
msgid "Legend set is required"
|
|
400
|
+
msgstr "Legend set is required"
|
|
401
|
+
|
|
402
|
+
msgid "Radius"
|
|
403
|
+
msgstr "Radius"
|
|
404
|
+
|
|
405
|
+
msgid "Configure Thematic Layer"
|
|
406
|
+
msgstr "Configure Thematic Layer"
|
|
407
|
+
|
|
408
|
+
msgid "Loading ..."
|
|
409
|
+
msgstr "Loading ..."
|
|
410
|
+
|
|
411
|
+
msgid "Select location(s)"
|
|
412
|
+
msgstr "Select location(s)"
|
|
413
|
+
|
|
414
|
+
msgid "Location"
|
|
415
|
+
msgstr "Location"
|
|
416
|
+
|
|
417
|
+
msgid "Organisation unit"
|
|
418
|
+
msgstr "Organisation unit"
|
|
419
|
+
|
|
420
|
+
msgid "Data"
|
|
421
|
+
msgstr "Data"
|
|
422
|
+
|
|
423
|
+
msgid "Pivot table"
|
|
424
|
+
msgstr "Pivot table"
|
|
425
|
+
|
|
426
|
+
msgid "Chart"
|
|
427
|
+
msgstr "Chart"
|
|
428
|
+
|
|
429
|
+
msgid "Map"
|
|
430
|
+
msgstr "Map"
|
|
431
|
+
|
|
432
|
+
msgid "View as {{type}}"
|
|
433
|
+
msgstr "View as {{type}}"
|
|
434
|
+
|
|
435
|
+
msgid "Could not load visualization"
|
|
436
|
+
msgstr "Could not load visualization"
|
|
437
|
+
|
|
438
|
+
msgid "Try again"
|
|
439
|
+
msgstr "Try again"
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hisptz/dhis2-analytics",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.51",
|
|
4
4
|
"description": "A collection of reusable react components for visualizing analytics data from DHIS2",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "d2-app-scripts build --no-verify --mode production",
|
|
8
|
+
"start": "d2-app-scripts build --no-verify --mode development --watch",
|
|
8
9
|
"build:types": "tsc --project tsconfig.build.json",
|
|
9
10
|
"postbuild": "yarn build:types",
|
|
10
|
-
"start": "d2-app-scripts start",
|
|
11
11
|
"test": "d2-app-scripts test --passWithNoTests",
|
|
12
12
|
"deploy": "d2-app-scripts deploy",
|
|
13
13
|
"publish:analytics": "yarn publish --access public"
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@dhis2/app-runtime": "^3.7.0",
|
|
34
|
-
"@hisptz/dhis2-ui": "^1.0.
|
|
35
|
-
"@hisptz/dhis2-utils": "
|
|
34
|
+
"@hisptz/dhis2-ui": "^1.0.51",
|
|
35
|
+
"@hisptz/dhis2-utils": "^1.0.51",
|
|
36
36
|
"@react-leaflet/core": "^2.1.0",
|
|
37
37
|
"async-es": "^3.2.4",
|
|
38
38
|
"d3-color": "^3.1.0",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"react-hook-form": "^7.43",
|
|
88
88
|
"recoil": "*"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "c11c14562cbb2228c2d3f9a917bf0cdbb4d25b29"
|
|
91
91
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {mount} from "@cypress/react";
|
|
2
|
+
import HighCharts from "highcharts";
|
|
3
|
+
import HighchartsReact from "highcharts-react-official";
|
|
4
|
+
import React, {useState} from "react";
|
|
5
|
+
import {ChartDownloadMenu} from "./components/DownloadMenu";
|
|
6
|
+
import columnData from "../../../../../resources/analytics/column-data.json";
|
|
7
|
+
import {setupHighchartsModules} from "./services/export";
|
|
8
|
+
import {ChartAnalytics} from ".";
|
|
9
|
+
|
|
10
|
+
const props: any = {
|
|
11
|
+
analytics: columnData as any,
|
|
12
|
+
config: {
|
|
13
|
+
layout: {
|
|
14
|
+
series: ["dx"],
|
|
15
|
+
category: ["ou"],
|
|
16
|
+
filter: ["pe"],
|
|
17
|
+
},
|
|
18
|
+
type: "column",
|
|
19
|
+
height: 500,
|
|
20
|
+
colors: ["#2f7ed8", "#0d233a", "#8bbc21", "#910000", "#1aadce", "#492970", "#f28f43", "#77a1e5", "#c42525", "#a6c96a"],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function TestComponent() {
|
|
25
|
+
return <ChartAnalytics {...props} />;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function ExportTestComponent() {
|
|
29
|
+
const [chartRef, setChartRef] = useState<HighchartsReact.RefObject | null>(null);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div style={{ display: "flex", flexDirection: "column" }}>
|
|
33
|
+
<div>
|
|
34
|
+
<ChartDownloadMenu chartRef={chartRef} />
|
|
35
|
+
</div>
|
|
36
|
+
<ChartAnalytics {...props} ref={setChartRef} />
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
describe("Chart Component Tests", () => {
|
|
42
|
+
setupHighchartsModules(HighCharts);
|
|
43
|
+
|
|
44
|
+
it("Mounts without errors", () => {
|
|
45
|
+
mount(<TestComponent />);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("Can be exported as PDF", () => {
|
|
49
|
+
mount(<ExportTestComponent />);
|
|
50
|
+
});
|
|
51
|
+
});
|