@hisptz/dhis2-analytics 1.0.51 → 1.0.52

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 (117) hide show
  1. package/LICENSE +29 -0
  2. package/package.json +4 -4
  3. package/.gitignore +0 -5
  4. package/d2.config.js +0 -8
  5. package/i18n/en.pot +0 -439
  6. package/src/components/ChartAnalytics/ChartAnalytics.test.tsx +0 -51
  7. package/src/components/ChartAnalytics/components/DownloadMenu/components/Menu.tsx +0 -48
  8. package/src/components/ChartAnalytics/components/DownloadMenu/constants/menu.ts +0 -38
  9. package/src/components/ChartAnalytics/components/DownloadMenu/index.tsx +0 -65
  10. package/src/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.ts +0 -1
  11. package/src/components/ChartAnalytics/hooks/useChart.ts +0 -35
  12. package/src/components/ChartAnalytics/index.tsx +0 -28
  13. package/src/components/ChartAnalytics/models/bar.ts +0 -20
  14. package/src/components/ChartAnalytics/models/column.ts +0 -52
  15. package/src/components/ChartAnalytics/models/index.ts +0 -111
  16. package/src/components/ChartAnalytics/models/line.ts +0 -31
  17. package/src/components/ChartAnalytics/models/multi-series.ts +0 -115
  18. package/src/components/ChartAnalytics/models/pie.ts +0 -54
  19. package/src/components/ChartAnalytics/services/export.ts +0 -38
  20. package/src/components/ChartAnalytics/styles/custom-highchart.css +0 -48
  21. package/src/components/ChartAnalytics/types/props.tsx +0 -48
  22. package/src/components/ChartAnalytics/utils/chart.ts +0 -128
  23. package/src/components/CircularProgressDashboard/CircularProgressIndicator.test.tsx +0 -9
  24. package/src/components/CircularProgressDashboard/index.tsx +0 -36
  25. package/src/components/CircularProgressDashboard/types/props.tsx +0 -17
  26. package/src/components/CustomPivotTable/components/Table/index.tsx +0 -23
  27. package/src/components/CustomPivotTable/components/TableBody/TableBody.module.css +0 -12
  28. package/src/components/CustomPivotTable/components/TableBody/index.tsx +0 -96
  29. package/src/components/CustomPivotTable/components/TableHeaders/TableHeaders.module.css +0 -10
  30. package/src/components/CustomPivotTable/components/TableHeaders/index.tsx +0 -94
  31. package/src/components/CustomPivotTable/index.tsx +0 -63
  32. package/src/components/CustomPivotTable/interfaces/index.ts +0 -1
  33. package/src/components/CustomPivotTable/services/engine.ts +0 -102
  34. package/src/components/CustomPivotTable/state/engine.tsx +0 -22
  35. package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.tsx +0 -28
  36. package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.tsx +0 -34
  37. package/src/components/Map/components/EarthEngineLayerConfiguration/index.tsx +0 -412
  38. package/src/components/Map/components/MapArea/index.tsx +0 -83
  39. package/src/components/Map/components/MapArea/interfaces/index.ts +0 -39
  40. package/src/components/Map/components/MapControls/components/CustomControl/index.tsx +0 -24
  41. package/src/components/Map/components/MapControls/components/DownloadControl/index.tsx +0 -11
  42. package/src/components/Map/components/MapControls/components/FullscreenControl/index.tsx +0 -7
  43. package/src/components/Map/components/MapControls/index.tsx +0 -24
  44. package/src/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.ts +0 -7
  45. package/src/components/Map/components/MapLayer/components/BoundaryLayer/index.tsx +0 -55
  46. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.tsx +0 -74
  47. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.ts +0 -430
  48. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.ts +0 -34
  49. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/index.tsx +0 -185
  50. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.ts +0 -56
  51. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +0 -34241
  52. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.ts +0 -431
  53. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.ts +0 -105
  54. package/src/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +0 -12
  55. package/src/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.tsx +0 -17
  56. package/src/components/Map/components/MapLayer/components/LegendArea/index.tsx +0 -167
  57. package/src/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.tsx +0 -44
  58. package/src/components/Map/components/MapLayer/components/PointLayer/hooks/index.ts +0 -8
  59. package/src/components/Map/components/MapLayer/components/PointLayer/index.tsx +0 -36
  60. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.tsx +0 -48
  61. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.tsx +0 -150
  62. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.tsx +0 -39
  63. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.tsx +0 -57
  64. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.tsx +0 -43
  65. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.tsx +0 -38
  66. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.tsx +0 -26
  67. package/src/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.ts +0 -10
  68. package/src/components/Map/components/MapLayer/components/ThematicLayer/index.tsx +0 -46
  69. package/src/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +0 -62
  70. package/src/components/Map/components/MapLayer/index.tsx +0 -32
  71. package/src/components/Map/components/MapLayer/interfaces/index.ts +0 -139
  72. package/src/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.tsx +0 -368
  73. package/src/components/Map/components/MapProvider/components/MapLayerProvider/index.tsx +0 -105
  74. package/src/components/Map/components/MapProvider/hooks/index.ts +0 -14
  75. package/src/components/Map/components/MapProvider/index.tsx +0 -93
  76. package/src/components/Map/components/MapUpdater/index.tsx +0 -8
  77. package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.tsx +0 -28
  78. package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.tsx +0 -34
  79. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.tsx +0 -24
  80. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.ts +0 -433
  81. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.tsx +0 -50
  82. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +0 -15
  83. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +0 -12
  84. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.ts +0 -91
  85. package/src/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.tsx +0 -45
  86. package/src/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.tsx +0 -47
  87. package/src/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.tsx +0 -57
  88. package/src/components/Map/components/ThematicLayerConfiguration/index.tsx +0 -248
  89. package/src/components/Map/constants/colors.ts +0 -434
  90. package/src/components/Map/constants/legendSet.ts +0 -19
  91. package/src/components/Map/hooks/map.ts +0 -47
  92. package/src/components/Map/index.tsx +0 -65
  93. package/src/components/Map/interfaces/index.ts +0 -57
  94. package/src/components/Map/state/index.tsx +0 -31
  95. package/src/components/Map/utils/colors.ts +0 -95
  96. package/src/components/Map/utils/helpers.ts +0 -15
  97. package/src/components/Map/utils/map.ts +0 -150
  98. package/src/components/SingleValueContainer/SingleValueContainer.test.tsx +0 -24
  99. package/src/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.tsx +0 -46
  100. package/src/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.tsx +0 -12
  101. package/src/components/SingleValueContainer/index.tsx +0 -37
  102. package/src/components/SingleValueContainer/styles/SingleValueContainer.module.css +0 -39
  103. package/src/components/SingleValueContainer/types/props.tsx +0 -16
  104. package/src/components/Visualization/components/AnalyticsDataProvider/index.tsx +0 -76
  105. package/src/components/Visualization/components/DimensionsProvider/index.tsx +0 -51
  106. package/src/components/Visualization/components/LayoutProvider/index.tsx +0 -34
  107. package/src/components/Visualization/components/VisualizationDimensionSelector/index.tsx +0 -59
  108. package/src/components/Visualization/components/VisualizationProvider/index.tsx +0 -31
  109. package/src/components/Visualization/components/VisualizationSelector/index.tsx +0 -157
  110. package/src/components/Visualization/components/VisualizationTypeProvider/index.tsx +0 -40
  111. package/src/components/Visualization/components/VisualizationTypeSelector/index.tsx +0 -46
  112. package/src/components/Visualization/index.tsx +0 -103
  113. package/src/index.ts +0 -6
  114. package/src/locales/en/translations.json +0 -138
  115. package/src/locales/index.js +0 -16
  116. package/tsconfig.build.json +0 -46
  117. package/tsconfig.json +0 -51
package/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2022, HISP Tanzania
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hisptz/dhis2-analytics",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "A collection of reusable react components for visualizing analytics data from DHIS2",
5
5
  "license": "BSD-3-Clause",
6
6
  "scripts": {
@@ -31,8 +31,8 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@dhis2/app-runtime": "^3.7.0",
34
- "@hisptz/dhis2-ui": "^1.0.51",
35
- "@hisptz/dhis2-utils": "^1.0.51",
34
+ "@hisptz/dhis2-ui": "^1.0.52",
35
+ "@hisptz/dhis2-utils": "^1.0.52",
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": "c11c14562cbb2228c2d3f9a917bf0cdbb4d25b29"
90
+ "gitHead": "4212ece071c05d22b32b49fecae2a26a431ebb4c"
91
91
  }
package/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- # DHIS2 Platform
2
- node_modules
3
- .d2
4
- src/locales
5
- build
package/d2.config.js DELETED
@@ -1,8 +0,0 @@
1
- const config = {
2
- type: 'lib',
3
- entryPoints: {
4
- lib: './src/index.ts',
5
- },
6
- }
7
-
8
- module.exports = config
package/i18n/en.pot DELETED
@@ -1,439 +0,0 @@
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"
@@ -1,51 +0,0 @@
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
- });
@@ -1,48 +0,0 @@
1
- import {FlyoutMenu, Menu, MenuDivider, MenuItem, Popover} from "@dhis2/ui";
2
- import {isEmpty, map} from "lodash";
3
- import React from "react";
4
- import {chartMenuSections} from "../constants/menu";
5
- import {ChartExportMenuItem} from "../interfaces/menu";
6
-
7
- export function ChartMenu({
8
- menuRef,
9
- onClick,
10
- onClose,
11
- exclude = [],
12
- }: {
13
- menuRef: HTMLDivElement;
14
- onClick: (action: string) => void;
15
- onClose: () => void;
16
- exclude?: ChartExportMenuItem[];
17
- }) {
18
- const onMenuClick = (action: string) => () => {
19
- onClick(action);
20
- onClose();
21
- };
22
-
23
- const menuSections = map(chartMenuSections, (section) => {
24
- return {
25
- ...section,
26
- menuItems: section.menuItems.filter((item: any) => !exclude.includes(item.name)),
27
- };
28
- }).filter((section) => !isEmpty(section.menuItems));
29
-
30
- return (
31
- <Popover onClickOutside={onClose} onClose={onClose} reference={menuRef}>
32
- <FlyoutMenu>
33
- <Menu>
34
- {menuSections?.map((section, index) => {
35
- return (
36
- <>
37
- {section.menuItems?.map(({ name, label }) => {
38
- return <MenuItem key={`${name}-menu-item`} dataTest={`download-${name}`} label={label} onClick={onMenuClick(name)} />;
39
- })}
40
- {index !== menuSections.length - 1 && <MenuDivider />}
41
- </>
42
- );
43
- })}
44
- </Menu>
45
- </FlyoutMenu>
46
- </Popover>
47
- );
48
- }
@@ -1,38 +0,0 @@
1
- import i18n from "@dhis2/d2-i18n";
2
-
3
- export const chartMenuSections = [
4
- {
5
- name: "download",
6
- menuItems: [
7
- {
8
- name: "png",
9
- label: i18n.t("Download PNG"),
10
- },
11
- {
12
- name: "jpeg",
13
- label: i18n.t("Download JPEG"),
14
- },
15
- {
16
- name: "svg",
17
- label: i18n.t("Download SVG"),
18
- },
19
- {
20
- name: "pdf",
21
- label: i18n.t("Download PDF"),
22
- },
23
- ],
24
- },
25
- {
26
- name: "view",
27
- menuItems: [
28
- {
29
- name: "table",
30
- label: i18n.t("View as table"),
31
- },
32
- {
33
- name: "full-screen",
34
- label: i18n.t("View full screen"),
35
- },
36
- ],
37
- },
38
- ];