@hisptz/dhis2-analytics 1.0.44 → 1.0.46

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.
Files changed (40) hide show
  1. package/build/cjs/components/CircularProgressDashboard/index.js +15 -0
  2. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +3 -2
  3. package/build/cjs/components/SingleValueContainer/index.js +16 -0
  4. package/build/cjs/components/Visualization/components/VisualizationSelector/index.js +4 -13
  5. package/build/cjs/components/Visualization/index.js +1 -11
  6. package/build/es/components/CircularProgressDashboard/index.js +1 -0
  7. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +2 -1
  8. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +1 -1
  9. package/build/es/components/SingleValueContainer/index.js +1 -0
  10. package/build/es/components/Visualization/components/VisualizationSelector/index.js +4 -13
  11. package/build/es/components/Visualization/index.js +1 -11
  12. package/build/types/components/CircularProgressDashboard/index.d.ts +1 -0
  13. package/build/types/components/SingleValueContainer/index.d.ts +1 -0
  14. package/build/types/components/Visualization/components/VisualizationSelector/index.d.ts +2 -4
  15. package/package.json +12 -8
  16. package/build/cjs/components/ChartAnalytics/ChartAnalytics.stories.js +0 -253
  17. package/build/cjs/components/ChartAnalytics/data/column-data.json +0 -210
  18. package/build/cjs/components/ChartAnalytics/data/complex-multi-series-data.json +0 -124
  19. package/build/cjs/components/ChartAnalytics/data/multi-series-data.json +0 -536
  20. package/build/cjs/components/ChartAnalytics/data/pie-data.json +0 -115
  21. package/build/cjs/components/ChartAnalytics/data/stacked-chart-data.json +0 -415
  22. package/build/cjs/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +0 -45
  23. package/build/cjs/components/CustomPivotTable/CustomPivotTable.stories.js +0 -69
  24. package/build/cjs/components/Map/Map.stories.js +0 -352
  25. package/build/cjs/components/SingleValueContainer/SingleValueContainer.stories.js +0 -127
  26. package/build/cjs/components/Visualization/Visualization.stories.js +0 -138
  27. package/build/cjs/dataProviders/map.js +0 -31
  28. package/build/es/components/ChartAnalytics/ChartAnalytics.stories.js +0 -235
  29. package/build/es/components/ChartAnalytics/data/column-data.json +0 -210
  30. package/build/es/components/ChartAnalytics/data/complex-multi-series-data.json +0 -124
  31. package/build/es/components/ChartAnalytics/data/multi-series-data.json +0 -536
  32. package/build/es/components/ChartAnalytics/data/pie-data.json +0 -115
  33. package/build/es/components/ChartAnalytics/data/stacked-chart-data.json +0 -415
  34. package/build/es/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +0 -34
  35. package/build/es/components/CustomPivotTable/CustomPivotTable.stories.js +0 -59
  36. package/build/es/components/Map/Map.stories.js +0 -334
  37. package/build/es/components/SingleValueContainer/SingleValueContainer.stories.js +0 -115
  38. package/build/es/components/Visualization/Visualization.stories.js +0 -129
  39. package/build/es/dataProviders/map.js +0 -24
  40. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.d.ts +0 -1
@@ -1,352 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.PointLayer = exports.GoogleEarthEngineLayers = exports.Controls = exports.ChoroplethThematicLayerWithLevels = exports.ChoroplethThematicLayer = exports.BubbleThematicLayer = exports.BoundaryLayerWithLevels = exports.BoundaryLayer = exports.BaseMap = exports.AllThematicLayers = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _index = require("./index");
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- const Template = args => /*#__PURE__*/_react.default.createElement(_index.Map, args);
11
- const BaseMap = Template.bind({});
12
- exports.BaseMap = BaseMap;
13
- BaseMap.args = {
14
- orgUnitSelection: {
15
- orgUnits: [],
16
- userOrgUnit: true,
17
- userSubUnit: true,
18
- userSubX2Unit: true
19
- }
20
- };
21
- const Controls = Template.bind({});
22
- exports.Controls = Controls;
23
- Controls.args = {
24
- orgUnitSelection: {
25
- orgUnits: [],
26
- userOrgUnit: true,
27
- userSubUnit: true,
28
- userSubX2Unit: true
29
- },
30
- controls: [{
31
- type: "print",
32
- position: "topleft",
33
- options: {
34
- hidden: false,
35
- hideControlContainer: true,
36
- sizeModes: ["A4Landscape", "A4Portrait", "Current"]
37
- }
38
- }]
39
- };
40
- const BoundaryLayer = Template.bind({});
41
- exports.BoundaryLayer = BoundaryLayer;
42
- BoundaryLayer.args = {
43
- orgUnitSelection: {
44
- orgUnits: [],
45
- userOrgUnit: true,
46
- userSubUnit: true,
47
- userSubX2Unit: true
48
- },
49
- boundaryLayer: {
50
- enabled: true
51
- }
52
- };
53
- const BoundaryLayerWithLevels = Template.bind({});
54
- exports.BoundaryLayerWithLevels = BoundaryLayerWithLevels;
55
- BoundaryLayerWithLevels.args = {
56
- orgUnitSelection: {
57
- orgUnits: [{
58
- id: "ImspTQPwCqd",
59
- displayName: "Sierra Leone",
60
- name: "Sierra Leone",
61
- path: "/ImspTQPwCqd",
62
- children: []
63
- }],
64
- levels: ["2"]
65
- },
66
- boundaryLayer: {
67
- enabled: true
68
- }
69
- };
70
- const ChoroplethThematicLayer = Template.bind({});
71
- exports.ChoroplethThematicLayer = ChoroplethThematicLayer;
72
- ChoroplethThematicLayer.args = {
73
- orgUnitSelection: {
74
- orgUnits: [],
75
- userOrgUnit: true,
76
- userSubUnit: true,
77
- userSubX2Unit: false
78
- },
79
- boundaryLayer: {
80
- enabled: true
81
- },
82
- thematicLayers: [{
83
- type: "choropleth",
84
- id: "choropleth",
85
- enabled: true,
86
- dataItem: {
87
- id: "Uvn6LCg7dVU",
88
- displayName: "ANC 1 Coverage",
89
- type: "indicator"
90
- },
91
- control: {
92
- enabled: true,
93
- position: "topright"
94
- }
95
- }],
96
- periodSelection: {
97
- periods: ["2022"]
98
- },
99
- legends: {
100
- enabled: true,
101
- position: "topright",
102
- collapsible: true
103
- }
104
- };
105
- const BubbleThematicLayer = Template.bind({});
106
- exports.BubbleThematicLayer = BubbleThematicLayer;
107
- BubbleThematicLayer.args = {
108
- orgUnitSelection: {
109
- orgUnits: [],
110
- userOrgUnit: true,
111
- userSubUnit: true,
112
- userSubX2Unit: true
113
- },
114
- boundaryLayer: {
115
- enabled: true
116
- },
117
- thematicLayers: [{
118
- type: "bubble",
119
- id: "bubble",
120
- enabled: true,
121
- dataItem: {
122
- id: "Uvn6LCg7dVU",
123
- displayName: "ANC 1 Coverage",
124
- type: "indicator"
125
- },
126
- control: {
127
- enabled: true,
128
- position: "topright"
129
- },
130
- radius: {
131
- min: 0,
132
- max: 40
133
- }
134
- }],
135
- legends: {
136
- enabled: true,
137
- position: "topright",
138
- collapsible: true
139
- },
140
- periodSelection: {
141
- periods: ["2022"]
142
- },
143
- controls: [{
144
- type: "fullscreen",
145
- position: "topleft"
146
- }]
147
- };
148
- const AllThematicLayers = Template.bind({});
149
- exports.AllThematicLayers = AllThematicLayers;
150
- AllThematicLayers.args = {
151
- orgUnitSelection: {
152
- orgUnits: [],
153
- userOrgUnit: true,
154
- userSubUnit: true,
155
- userSubX2Unit: true
156
- },
157
- boundaryLayer: {
158
- enabled: true
159
- },
160
- thematicLayers: [{
161
- type: "choropleth",
162
- id: "ReUHfIn0pTQ",
163
- enabled: true,
164
- dataItem: {
165
- id: "ReUHfIn0pTQ",
166
- displayName: "ANC 1-3 Dropout Rate",
167
- type: "indicator",
168
- legendSet: "fqs276KXCXi"
169
- },
170
- control: {
171
- enabled: true,
172
- position: "topright"
173
- }
174
- }, {
175
- type: "choropleth",
176
- id: "Uvn6LCg7dVU",
177
- enabled: true,
178
- dataItem: {
179
- id: "Uvn6LCg7dVU",
180
- displayName: "ANC 1 Coverage",
181
- type: "indicator"
182
- },
183
- control: {
184
- enabled: true,
185
- position: "topright"
186
- }
187
- }],
188
- legends: {
189
- enabled: true,
190
- position: "topright",
191
- collapsible: true
192
- },
193
- periodSelection: {
194
- periods: ["2022"]
195
- },
196
- controls: [{
197
- type: "scale",
198
- position: "bottomleft",
199
- options: {
200
- imperial: false,
201
- metric: true
202
- }
203
- }, {
204
- type: "fullscreen",
205
- position: "bottomleft"
206
- }]
207
- };
208
- const ChoroplethThematicLayerWithLevels = Template.bind({});
209
- exports.ChoroplethThematicLayerWithLevels = ChoroplethThematicLayerWithLevels;
210
- ChoroplethThematicLayerWithLevels.args = {
211
- orgUnitSelection: {
212
- orgUnits: [{
213
- id: "ImspTQPwCqd",
214
- displayName: "Sierra Leone",
215
- name: "Sierra Leone",
216
- path: "/ImspTQPwCqd",
217
- children: []
218
- }],
219
- levels: ["3"]
220
- },
221
- boundaryLayer: {
222
- enabled: true
223
- },
224
- thematicLayers: [{
225
- type: "choropleth",
226
- id: "choropleth",
227
- enabled: true,
228
- dataItem: {
229
- id: "Uvn6LCg7dVU",
230
- displayName: "ANC 1 Coverage",
231
- type: "indicator"
232
- },
233
- control: {
234
- enabled: true,
235
- position: "topright"
236
- }
237
- }],
238
- legends: {
239
- enabled: true,
240
- position: "topright",
241
- collapsible: true
242
- },
243
- periodSelection: {
244
- periods: ["2022"]
245
- },
246
- controls: [{
247
- type: "print",
248
- position: "topleft",
249
- options: {
250
- hidden: false,
251
- hideControlContainer: true,
252
- sizeModes: ["A4Landscape", "A4Portrait", "Current"]
253
- }
254
- }]
255
- };
256
- const PointLayer = Template.bind({});
257
- exports.PointLayer = PointLayer;
258
- PointLayer.args = {
259
- orgUnitSelection: {
260
- orgUnits: [],
261
- userOrgUnit: true,
262
- userSubUnit: true,
263
- userSubX2Unit: false
264
- },
265
- thematicLayers: [{
266
- type: "choropleth",
267
- id: "choropleth",
268
- enabled: true,
269
- dataItem: {
270
- id: "Uvn6LCg7dVU",
271
- displayName: "ANC 1 Coverage",
272
- type: "indicator"
273
- },
274
- control: {
275
- enabled: true,
276
- position: "topright"
277
- }
278
- }],
279
- periodSelection: {
280
- periods: ["2022"]
281
- },
282
- pointLayer: {
283
- enabled: true,
284
- label: "Facilities",
285
- level: "m9lBJogzE95",
286
- style: {
287
- groupSet: "J5jldMd8OHv"
288
- }
289
- }
290
- };
291
- const GoogleEarthEngineLayers = Template.bind({});
292
- exports.GoogleEarthEngineLayers = GoogleEarthEngineLayers;
293
- GoogleEarthEngineLayers.args = {
294
- orgUnitSelection: {
295
- orgUnits: [],
296
- userOrgUnit: true,
297
- userSubUnit: true,
298
- userSubX2Unit: false
299
- },
300
- thematicLayers: [],
301
- periodSelection: {
302
- periods: ["2022"]
303
- },
304
- earthEngineLayers: [{
305
- name: "Population",
306
- type: "population",
307
- id: "population",
308
- enabled: false,
309
- params: {
310
- min: 0,
311
- max: 10,
312
- palette: "#f7fbff,#deebf7,#c6dbef,#9ecae1,#6baed6,#4292c6,#2171b5,#08519c,#08306b"
313
- },
314
- aggregations: ["sum", "mean"],
315
- filters: {
316
- period: "2020"
317
- }
318
- }, {
319
- name: "Footprints",
320
- type: "footprints",
321
- id: "footprints",
322
- aggregations: ["count"],
323
- enabled: false
324
- }, {
325
- name: "Land Cover",
326
- type: "landCover",
327
- id: "landCover",
328
- enabled: true,
329
- aggregations: ["percentage"]
330
- }],
331
- pointLayer: {
332
- enabled: false,
333
- label: "Facilities",
334
- level: "m9lBJogzE95",
335
- style: {
336
- groupSet: "J5jldMd8OHv"
337
- }
338
- }
339
- };
340
- var _default = {
341
- title: "Analytics/Map",
342
- component: _index.Map,
343
- decorators: [MapStory => {
344
- return /*#__PURE__*/_react.default.createElement("div", {
345
- style: {
346
- width: "100%",
347
- height: "100%"
348
- }
349
- }, /*#__PURE__*/_react.default.createElement(MapStory, null));
350
- }]
351
- };
352
- exports.default = _default;
@@ -1,127 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.SingleValuesWithDecimalPlaces = exports.Default = exports.AnimatedSingleValue = exports.AnimatedAllValues = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _ = require(".");
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- const Template = args => /*#__PURE__*/_react.default.createElement(_.SingleValueContainer, args);
11
- const Default = Template.bind({});
12
- exports.Default = Default;
13
- Default.args = {
14
- title: "PRIORITY INDICATORS",
15
- singleValueItems: [{
16
- label: "Total Bookings",
17
- value: 136
18
- }, {
19
- label: "At least one dose",
20
- value: 45,
21
- percentage: 23,
22
- color: "#0D47A1"
23
- }, {
24
- label: "Partially vaccinated",
25
- value: 13,
26
- percentage: 17,
27
- color: "#0D47A1"
28
- }, {
29
- label: "Fully vaccinated",
30
- value: 126,
31
- percentage: 83,
32
- color: "#0D47A1"
33
- }, {
34
- label: "Number of AEFI",
35
- value: 26
36
- }]
37
- };
38
- const AnimatedAllValues = Template.bind({});
39
- exports.AnimatedAllValues = AnimatedAllValues;
40
- AnimatedAllValues.args = {
41
- title: "PRIORITY INDICATORS",
42
- animationDuration: 1500,
43
- animationDelay: 500,
44
- singleValueItems: [{
45
- label: "Total Bookings",
46
- value: 136344
47
- }, {
48
- label: "At least one dose",
49
- value: 4423,
50
- percentage: 23,
51
- color: "#0D47A1"
52
- }, {
53
- label: "Partially vaccinated",
54
- value: 1394,
55
- percentage: 17,
56
- color: "#0D47A1"
57
- }, {
58
- label: "Fully vaccinated",
59
- value: 12432,
60
- percentage: 83,
61
- color: "#0D47A1"
62
- }, {
63
- label: "Number of AEFI",
64
- value: 26423
65
- }]
66
- };
67
- const AnimatedSingleValue = Template.bind({});
68
- exports.AnimatedSingleValue = AnimatedSingleValue;
69
- AnimatedSingleValue.args = {
70
- title: "PRIORITY INDICATORS",
71
- singleValueItems: [{
72
- label: "Total Bookings",
73
- value: 13634244,
74
- animationDuration: 1000,
75
- animationDelay: 100
76
- }, {
77
- label: "At least one dose",
78
- value: 45423,
79
- percentage: 23,
80
- color: "#0D47A1",
81
- animationDuration: 1000,
82
- animationDelay: 600
83
- }, {
84
- label: "Partially vaccinated",
85
- value: 13434,
86
- percentage: 17,
87
- color: "#0D47A1",
88
- animationDuration: 1000,
89
- animationDelay: 1100
90
- }, {
91
- label: "Fully vaccinated",
92
- value: 126432,
93
- percentage: 83,
94
- color: "#0D47A1",
95
- animationDuration: 1000,
96
- animationDelay: 1600
97
- }, {
98
- label: "Number of AEFI",
99
- value: 268423,
100
- animationDuration: 1000,
101
- animationDelay: 2000
102
- }]
103
- };
104
- const SingleValuesWithDecimalPlaces = Template.bind({});
105
- exports.SingleValuesWithDecimalPlaces = SingleValuesWithDecimalPlaces;
106
- SingleValuesWithDecimalPlaces.args = {
107
- title: "ENROLLMENTS",
108
- animationDuration: 1500,
109
- animationDelay: 500,
110
- singleValueItems: [{
111
- label: "Number of Enrolled Clients",
112
- value: 268423,
113
- decimalPlaces: 3
114
- }, {
115
- label: "Number of Served Clients",
116
- value: 268423,
117
- decimalPlaces: 1
118
- }]
119
- };
120
- var _default = {
121
- title: "Analytics/Single Value Container",
122
- component: _.SingleValueContainer,
123
- decorators: [SingleValueStory => {
124
- return /*#__PURE__*/_react.default.createElement(SingleValueStory, null);
125
- }]
126
- };
127
- exports.default = _default;
@@ -1,138 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.Default = void 0;
7
- var _ChartAnalytics = require("../ChartAnalytics");
8
- var _index = require("./index");
9
- var _highcharts = _interopRequireDefault(require("highcharts"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _ui = require("@dhis2/ui");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- const Template = args => /*#__PURE__*/_react.default.createElement(_index.Visualization, args);
14
- (0, _ChartAnalytics.setupHighchartsModules)(_highcharts.default);
15
- const Default = Template.bind({});
16
- exports.Default = Default;
17
- Default.args = {
18
- dimensions: {
19
- dx: ["Uvn6LCg7dVU", "OdiHJayrsKo", "sB79w2hiLp8", "AUqdhY4mpvp"],
20
- pe: ["LAST_6_MONTHS"],
21
- ou: ["USER_ORGUNIT_CHILDREN"]
22
- },
23
- layout: {
24
- columns: ["dx"],
25
- filters: [],
26
- rows: ["ou", "pe"]
27
- },
28
- defaultVisualizationType: "pivot-table",
29
- config: {
30
- chart: {
31
- layout: {
32
- series: ["dx"],
33
- category: ["pe"],
34
- filter: ["ou"]
35
- },
36
- type: "column"
37
- },
38
- map: {
39
- thematicLayers: [{
40
- type: "choropleth",
41
- id: "Uvn6LCg7dVU",
42
- enabled: true,
43
- control: {
44
- enabled: true,
45
- position: "topright"
46
- },
47
- dataItem: {
48
- displayName: "Uvn6LCg7dVU",
49
- id: "Uvn6LCg7dVU",
50
- type: "indicator",
51
- legendConfig: {
52
- colorClass: "BrBG",
53
- scale: 7
54
- }
55
- }
56
- }, {
57
- type: "choropleth",
58
- id: "OdiHJayrsKo",
59
- enabled: true,
60
- control: {
61
- enabled: true,
62
- position: "topright"
63
- },
64
- dataItem: {
65
- displayName: "OdiHJayrsKo",
66
- id: "OdiHJayrsKo",
67
- type: "indicator",
68
- legendConfig: {
69
- colorClass: "BrBG",
70
- scale: 7
71
- }
72
- }
73
- }, {
74
- type: "choropleth",
75
- id: "sB79w2hiLp8",
76
- enabled: true,
77
- control: {
78
- enabled: true,
79
- position: "topright"
80
- },
81
- dataItem: {
82
- displayName: "sB79w2hiLp8",
83
- id: "sB79w2hiLp8",
84
- type: "indicator",
85
- legendConfig: {
86
- colorClass: "BrBG",
87
- scale: 7
88
- }
89
- }
90
- }, {
91
- type: "choropleth",
92
- id: "AUqdhY4mpvp",
93
- enabled: true,
94
- control: {
95
- enabled: true,
96
- position: "topright"
97
- },
98
- dataItem: {
99
- displayName: "AUqdhY4mpvp",
100
- id: "AUqdhY4mpvp",
101
- type: "indicator",
102
- legendConfig: {
103
- colorClass: "BrBG",
104
- scale: 7
105
- }
106
- }
107
- }],
108
- legends: {
109
- enabled: true,
110
- position: "topright",
111
- collapsible: true
112
- }
113
- },
114
- pivotTable: {
115
- fixColumnHeaders: true,
116
- fixRowHeaders: true
117
- }
118
- }
119
- };
120
- var _default = {
121
- title: "Analytics/Visualization",
122
- component: _index.Visualization,
123
- decorators: [ChartStory => {
124
- return /*#__PURE__*/_react.default.createElement(_ui.Box, {
125
- width: "600",
126
- height: "500"
127
- }, /*#__PURE__*/_react.default.createElement(_ui.Card, null, /*#__PURE__*/_react.default.createElement("div", {
128
- style: {
129
- width: 1000,
130
- height: "100%",
131
- display: "flex",
132
- gap: 8,
133
- flexDirection: "column"
134
- }
135
- }, /*#__PURE__*/_react.default.createElement(_ui.CssReset, null), /*#__PURE__*/_react.default.createElement(ChartStory, null))));
136
- }]
137
- };
138
- exports.default = _default;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = MapDataProvider;
7
- var _appRuntime = require("@dhis2/app-runtime");
8
- var _react = _interopRequireDefault(require("react"));
9
- var _map = _interopRequireDefault(require("../../data/map.json"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- function MapDataProvider(_ref) {
12
- let {
13
- children
14
- } = _ref;
15
- return /*#__PURE__*/_react.default.createElement(_appRuntime.CustomDataProvider, {
16
- data: {
17
- ..._map.default,
18
- geoFeatures: async (type, query) => {
19
- return _map.default.geoFeatures;
20
- },
21
- analytics: async (type, query) => {
22
- var _query$params;
23
- if (query !== null && query !== void 0 && (_query$params = query.params) !== null && _query$params !== void 0 && _query$params.skipData) {
24
- return _map.default.analytics;
25
- } else {
26
- return _map.default.analyticsWithData;
27
- }
28
- }
29
- }
30
- }, children);
31
- }