@hisptz/dhis2-analytics 1.0.6 → 1.0.8

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 (86) hide show
  1. package/build/cjs/components/ChartAnalytics/index.js +14 -5
  2. package/build/cjs/components/Map/components/MapControls/components/DownloadControl/index.js +1 -1
  3. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +6 -2
  4. package/build/es/components/ChartAnalytics/index.js +4 -3
  5. package/build/es/components/Map/components/MapControls/components/DownloadControl/index.js +1 -1
  6. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +5 -1
  7. package/build/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +8 -0
  8. package/build/types/components/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts +7 -0
  9. package/build/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts +9 -0
  10. package/build/types/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts +1 -0
  11. package/build/types/components/ChartAnalytics/hooks/useChart.d.ts +11 -0
  12. package/build/types/components/ChartAnalytics/index.d.ts +7 -0
  13. package/build/types/components/ChartAnalytics/models/column.d.ts +12 -0
  14. package/build/types/components/ChartAnalytics/models/index.d.ts +17 -0
  15. package/build/types/components/ChartAnalytics/models/line.d.ts +8 -0
  16. package/build/types/components/ChartAnalytics/models/multi-series.d.ts +9 -0
  17. package/build/types/components/ChartAnalytics/models/pie.d.ts +8 -0
  18. package/build/types/components/ChartAnalytics/services/export.d.ts +8 -0
  19. package/build/types/components/ChartAnalytics/types/props.d.ts +43 -0
  20. package/build/types/components/ChartAnalytics/utils/chart.d.ts +15 -0
  21. package/build/types/components/CircularProgressDashboard/index.d.ts +3 -0
  22. package/build/types/components/CircularProgressDashboard/types/props.d.ts +17 -0
  23. package/build/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +17 -0
  24. package/build/types/components/Map/components/MapArea/index.d.ts +5 -0
  25. package/build/types/components/Map/components/MapArea/interfaces/index.d.ts +30 -0
  26. package/build/types/components/Map/components/MapControls/components/CustomControl/index.d.ts +7 -0
  27. package/build/types/components/Map/components/MapControls/components/DownloadControl/index.d.ts +8 -0
  28. package/build/types/components/Map/components/MapControls/components/FullscreenControl/index.d.ts +5 -0
  29. package/build/types/components/Map/components/MapControls/index.d.ts +6 -0
  30. package/build/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +1 -0
  31. package/build/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +15 -0
  32. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +17 -0
  33. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +4 -0
  34. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +9 -0
  35. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +4 -0
  36. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +58 -0
  37. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.d.ts +1 -0
  38. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +55 -0
  39. package/build/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +20 -0
  40. package/build/types/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts +6 -0
  41. package/build/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts +9 -0
  42. package/build/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts +3 -0
  43. package/build/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +2 -0
  44. package/build/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +2 -0
  45. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +13 -0
  46. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +10 -0
  47. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +16 -0
  48. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +12 -0
  49. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +21 -0
  50. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +12 -0
  51. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +5 -0
  52. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +2 -0
  53. package/build/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +5 -0
  54. package/build/types/components/Map/components/MapLayer/index.d.ts +6 -0
  55. package/build/types/components/Map/components/MapLayer/interfaces/index.d.ts +123 -0
  56. package/build/types/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts +9 -0
  57. package/build/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +6 -0
  58. package/build/types/components/Map/components/MapProvider/hooks/index.d.ts +15 -0
  59. package/build/types/components/Map/components/MapProvider/index.d.ts +3 -0
  60. package/build/types/components/Map/components/MapUpdater/index.d.ts +5 -0
  61. package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +8 -0
  62. package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts +419 -0
  63. package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +9 -0
  64. package/build/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +11 -0
  65. package/build/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +2 -0
  66. package/build/types/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts +8 -0
  67. package/build/types/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts +9 -0
  68. package/build/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +18 -0
  69. package/build/types/components/Map/constants/colors.d.ts +419 -0
  70. package/build/types/components/Map/constants/legendSet.d.ts +7 -0
  71. package/build/types/components/Map/hooks/map.d.ts +9 -0
  72. package/build/types/components/Map/index.d.ts +8 -0
  73. package/build/types/components/Map/interfaces/index.d.ts +65 -0
  74. package/build/types/components/Map/state/index.d.ts +20 -0
  75. package/build/types/components/Map/utils/colors.d.ts +12 -0
  76. package/build/types/components/Map/utils/helpers.d.ts +6 -0
  77. package/build/types/components/Map/utils/map.d.ts +40 -0
  78. package/build/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +8 -0
  79. package/build/types/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts +2 -0
  80. package/build/types/components/SingleValueContainer/index.d.ts +5 -0
  81. package/build/types/components/SingleValueContainer/types/props.d.ts +15 -0
  82. package/build/types/dataProviders/map.d.ts +4 -0
  83. package/build/types/index.d.ts +4 -0
  84. package/package.json +7 -3
  85. package/build/cjs/index.test.js +0 -7
  86. package/build/es/index.test.js +0 -6
@@ -0,0 +1,419 @@
1
+ export declare const COLOR_PALETTES: {
2
+ YlGn: {
3
+ 3: string[];
4
+ 4: string[];
5
+ 5: string[];
6
+ 6: string[];
7
+ 7: string[];
8
+ 8: string[];
9
+ 9: string[];
10
+ };
11
+ YlGnBu: {
12
+ 3: string[];
13
+ 4: string[];
14
+ 5: string[];
15
+ 6: string[];
16
+ 7: string[];
17
+ 8: string[];
18
+ 9: string[];
19
+ };
20
+ GnBu: {
21
+ 3: string[];
22
+ 4: string[];
23
+ 5: string[];
24
+ 6: string[];
25
+ 7: string[];
26
+ 8: string[];
27
+ 9: string[];
28
+ };
29
+ BuGn: {
30
+ 3: string[];
31
+ 4: string[];
32
+ 5: string[];
33
+ 6: string[];
34
+ 7: string[];
35
+ 8: string[];
36
+ 9: string[];
37
+ };
38
+ PuBuGn: {
39
+ 3: string[];
40
+ 4: string[];
41
+ 5: string[];
42
+ 6: string[];
43
+ 7: string[];
44
+ 8: string[];
45
+ 9: string[];
46
+ };
47
+ PuBu: {
48
+ 3: string[];
49
+ 4: string[];
50
+ 5: string[];
51
+ 6: string[];
52
+ 7: string[];
53
+ 8: string[];
54
+ 9: string[];
55
+ };
56
+ BuPu: {
57
+ 3: string[];
58
+ 4: string[];
59
+ 5: string[];
60
+ 6: string[];
61
+ 7: string[];
62
+ 8: string[];
63
+ 9: string[];
64
+ };
65
+ RdPu: {
66
+ 3: string[];
67
+ 4: string[];
68
+ 5: string[];
69
+ 6: string[];
70
+ 7: string[];
71
+ 8: string[];
72
+ 9: string[];
73
+ };
74
+ PuRd: {
75
+ 3: string[];
76
+ 4: string[];
77
+ 5: string[];
78
+ 6: string[];
79
+ 7: string[];
80
+ 8: string[];
81
+ 9: string[];
82
+ };
83
+ OrRd: {
84
+ 3: string[];
85
+ 4: string[];
86
+ 5: string[];
87
+ 6: string[];
88
+ 7: string[];
89
+ 8: string[];
90
+ 9: string[];
91
+ };
92
+ YlOrRd: {
93
+ 3: string[];
94
+ 4: string[];
95
+ 5: string[];
96
+ 6: string[];
97
+ 7: string[];
98
+ 8: string[];
99
+ 9: string[];
100
+ };
101
+ YlOrBr: {
102
+ 3: string[];
103
+ 4: string[];
104
+ 5: string[];
105
+ 6: string[];
106
+ 7: string[];
107
+ 8: string[];
108
+ 9: string[];
109
+ };
110
+ Purples: {
111
+ 3: string[];
112
+ 4: string[];
113
+ 5: string[];
114
+ 6: string[];
115
+ 7: string[];
116
+ 8: string[];
117
+ 9: string[];
118
+ };
119
+ Blues: {
120
+ 3: string[];
121
+ 4: string[];
122
+ 5: string[];
123
+ 6: string[];
124
+ 7: string[];
125
+ 8: string[];
126
+ 9: string[];
127
+ };
128
+ Greens: {
129
+ 3: string[];
130
+ 4: string[];
131
+ 5: string[];
132
+ 6: string[];
133
+ 7: string[];
134
+ 8: string[];
135
+ 9: string[];
136
+ };
137
+ Oranges: {
138
+ 3: string[];
139
+ 4: string[];
140
+ 5: string[];
141
+ 6: string[];
142
+ 7: string[];
143
+ 8: string[];
144
+ 9: string[];
145
+ };
146
+ Reds: {
147
+ 3: string[];
148
+ 4: string[];
149
+ 5: string[];
150
+ 6: string[];
151
+ 7: string[];
152
+ 8: string[];
153
+ 9: string[];
154
+ };
155
+ Greys: {
156
+ 3: string[];
157
+ 4: string[];
158
+ 5: string[];
159
+ 6: string[];
160
+ 7: string[];
161
+ 8: string[];
162
+ 9: string[];
163
+ };
164
+ PuOr: {
165
+ 3: string[];
166
+ 4: string[];
167
+ 5: string[];
168
+ 6: string[];
169
+ 7: string[];
170
+ 8: string[];
171
+ 9: string[];
172
+ 10: string[];
173
+ 11: string[];
174
+ };
175
+ BrBG: {
176
+ 3: string[];
177
+ 4: string[];
178
+ 5: string[];
179
+ 6: string[];
180
+ 7: string[];
181
+ 8: string[];
182
+ 9: string[];
183
+ 10: string[];
184
+ 11: string[];
185
+ };
186
+ PRGn: {
187
+ 3: string[];
188
+ 4: string[];
189
+ 5: string[];
190
+ 6: string[];
191
+ 7: string[];
192
+ 8: string[];
193
+ 9: string[];
194
+ 10: string[];
195
+ 11: string[];
196
+ };
197
+ PiYG: {
198
+ 3: string[];
199
+ 4: string[];
200
+ 5: string[];
201
+ 6: string[];
202
+ 7: string[];
203
+ 8: string[];
204
+ 9: string[];
205
+ 10: string[];
206
+ 11: string[];
207
+ };
208
+ RdBu: {
209
+ 3: string[];
210
+ 4: string[];
211
+ 5: string[];
212
+ 6: string[];
213
+ 7: string[];
214
+ 8: string[];
215
+ 9: string[];
216
+ 10: string[];
217
+ 11: string[];
218
+ };
219
+ RdGy: {
220
+ 3: string[];
221
+ 4: string[];
222
+ 5: string[];
223
+ 6: string[];
224
+ 7: string[];
225
+ 8: string[];
226
+ 9: string[];
227
+ 10: string[];
228
+ 11: string[];
229
+ };
230
+ RdYlBu: {
231
+ 3: string[];
232
+ 4: string[];
233
+ 5: string[];
234
+ 6: string[];
235
+ 7: string[];
236
+ 8: string[];
237
+ 9: string[];
238
+ 10: string[];
239
+ 11: string[];
240
+ };
241
+ Spectral: {
242
+ 3: string[];
243
+ 4: string[];
244
+ 5: string[];
245
+ 6: string[];
246
+ 7: string[];
247
+ 8: string[];
248
+ 9: string[];
249
+ 10: string[];
250
+ 11: string[];
251
+ };
252
+ RdYlGn: {
253
+ 3: string[];
254
+ 4: string[];
255
+ 5: string[];
256
+ 6: string[];
257
+ 7: string[];
258
+ 8: string[];
259
+ 9: string[];
260
+ 10: string[];
261
+ 11: string[];
262
+ };
263
+ Accent: {
264
+ 3: string[];
265
+ 4: string[];
266
+ 5: string[];
267
+ 6: string[];
268
+ 7: string[];
269
+ 8: string[];
270
+ };
271
+ Dark2: {
272
+ 3: string[];
273
+ 4: string[];
274
+ 5: string[];
275
+ 6: string[];
276
+ 7: string[];
277
+ 8: string[];
278
+ };
279
+ Paired: {
280
+ 3: string[];
281
+ 4: string[];
282
+ 5: string[];
283
+ 6: string[];
284
+ 7: string[];
285
+ 8: string[];
286
+ 9: string[];
287
+ 10: string[];
288
+ 11: string[];
289
+ 12: string[];
290
+ };
291
+ Pastel1: {
292
+ 3: string[];
293
+ 4: string[];
294
+ 5: string[];
295
+ 6: string[];
296
+ 7: string[];
297
+ 8: string[];
298
+ 9: string[];
299
+ };
300
+ Pastel2: {
301
+ 3: string[];
302
+ 4: string[];
303
+ 5: string[];
304
+ 6: string[];
305
+ 7: string[];
306
+ 8: string[];
307
+ };
308
+ Set1: {
309
+ 3: string[];
310
+ 4: string[];
311
+ 5: string[];
312
+ 6: string[];
313
+ 7: string[];
314
+ 8: string[];
315
+ 9: string[];
316
+ };
317
+ Set2: {
318
+ 3: string[];
319
+ 4: string[];
320
+ 5: string[];
321
+ 6: string[];
322
+ 7: string[];
323
+ 8: string[];
324
+ };
325
+ Set3: {
326
+ 3: string[];
327
+ 4: string[];
328
+ 5: string[];
329
+ 6: string[];
330
+ 7: string[];
331
+ 8: string[];
332
+ 9: string[];
333
+ 10: string[];
334
+ 11: string[];
335
+ 12: string[];
336
+ };
337
+ YlOrBr_reverse: {
338
+ 3: string[];
339
+ 4: string[];
340
+ 5: string[];
341
+ 6: string[];
342
+ 7: string[];
343
+ 8: string[];
344
+ 9: string[];
345
+ };
346
+ Reds_reverse: {
347
+ 3: string[];
348
+ 4: string[];
349
+ 5: string[];
350
+ 6: string[];
351
+ 7: string[];
352
+ 8: string[];
353
+ 9: string[];
354
+ };
355
+ YlGn_reverse: {
356
+ 3: string[];
357
+ 4: string[];
358
+ 5: string[];
359
+ 6: string[];
360
+ 7: string[];
361
+ 8: string[];
362
+ 9: string[];
363
+ };
364
+ Greens_reverse: {
365
+ 3: string[];
366
+ 4: string[];
367
+ 5: string[];
368
+ 6: string[];
369
+ 7: string[];
370
+ 8: string[];
371
+ 9: string[];
372
+ };
373
+ Blues_reverse: {
374
+ 3: string[];
375
+ 4: string[];
376
+ 5: string[];
377
+ 6: string[];
378
+ 7: string[];
379
+ 8: string[];
380
+ 9: string[];
381
+ };
382
+ BuPu_reverse: {
383
+ 3: string[];
384
+ 4: string[];
385
+ 5: string[];
386
+ 6: string[];
387
+ 7: string[];
388
+ 8: string[];
389
+ 9: string[];
390
+ };
391
+ RdPu_reverse: {
392
+ 3: string[];
393
+ 4: string[];
394
+ 5: string[];
395
+ 6: string[];
396
+ 7: string[];
397
+ 8: string[];
398
+ 9: string[];
399
+ };
400
+ PuRd_reverse: {
401
+ 3: string[];
402
+ 4: string[];
403
+ 5: string[];
404
+ 6: string[];
405
+ 7: string[];
406
+ 8: string[];
407
+ 9: string[];
408
+ };
409
+ Greys_reverse: {
410
+ 3: string[];
411
+ 4: string[];
412
+ 5: string[];
413
+ 6: string[];
414
+ 7: string[];
415
+ 8: string[];
416
+ 9: string[];
417
+ };
418
+ };
419
+ export declare const qualitativeColors: string[];
@@ -0,0 +1,7 @@
1
+ export declare const defaultLegendSet: {
2
+ legends: {
3
+ startValue: number;
4
+ endValue: number;
5
+ color: string;
6
+ }[];
7
+ };
@@ -0,0 +1,9 @@
1
+ import { LatLngTuple } from "leaflet";
2
+ export declare function useMapBounds(): {
3
+ center: import("leaflet").LatLng;
4
+ bounds: any;
5
+ };
6
+ export declare function useCenterMap({ bounds }: {
7
+ bounds: LatLngTuple[];
8
+ }): (node: HTMLDivElement | null) => void;
9
+ export declare function usePrintMedia(): boolean;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { MapProps } from "./interfaces";
3
+ import "leaflet/dist/leaflet.css";
4
+ export declare const Map: React.FC<MapProps>;
5
+ export * from "./components/EarthEngineLayerConfiguration";
6
+ export * from "./components/ThematicLayerConfiguration";
7
+ export * from "./interfaces";
8
+ export * from "./constants/colors";
@@ -0,0 +1,65 @@
1
+ import type { OrgUnitSelection } from "@hisptz/dhis2-utils";
2
+ import React from "react";
3
+ import type { MapContainerProps } from "react-leaflet";
4
+ import { MapControls, MapLegendConfig } from "../components/MapArea/interfaces";
5
+ import { EarthEngineLayerConfig, ThematicLayerConfig } from "../components/MapLayer/interfaces";
6
+ export interface MapProviderProps {
7
+ children: React.ReactNode;
8
+ orgUnitSelection: OrgUnitSelection;
9
+ periodSelection?: {
10
+ periods?: string[];
11
+ range?: {
12
+ start: Date;
13
+ end: Date;
14
+ };
15
+ };
16
+ }
17
+ export interface MapProps {
18
+ key?: string;
19
+ orgUnitSelection: OrgUnitSelection;
20
+ pointLayer?: {
21
+ enabled: boolean;
22
+ label?: string;
23
+ level?: number | string;
24
+ group?: string;
25
+ style?: {
26
+ icon?: string;
27
+ groupSet?: string;
28
+ };
29
+ };
30
+ boundaryLayer?: {
31
+ enabled: boolean;
32
+ };
33
+ controls?: MapControls[];
34
+ legends?: MapLegendConfig;
35
+ thematicLayers?: ThematicLayerConfig[];
36
+ earthEngineLayers?: EarthEngineLayerConfig[];
37
+ periodSelection?: {
38
+ periods?: string[];
39
+ range?: {
40
+ start: Date;
41
+ end: Date;
42
+ };
43
+ };
44
+ mapOptions?: MapContainerProps;
45
+ }
46
+ export interface MapOrgUnit {
47
+ id: string;
48
+ path: string;
49
+ name: string;
50
+ bounds: any[];
51
+ geoJSON: any;
52
+ children?: MapOrgUnit[];
53
+ level?: number;
54
+ }
55
+ export interface PointOrgUnit {
56
+ id: string;
57
+ path: string;
58
+ name: string;
59
+ bounds: any[];
60
+ geoJSON: any;
61
+ icon: {
62
+ type: "custom" | "groupIcon";
63
+ icon: string;
64
+ };
65
+ }
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import type { OrgUnitSelection } from "@hisptz/dhis2-utils";
3
+ import { BasePeriod } from "@hisptz/dhis2-utils";
4
+ import { CustomMapLayer } from "../components/MapLayer/interfaces";
5
+ import { MapOrgUnit } from "../interfaces";
6
+ export declare const MapOrgUnitContext: import("react").Context<{
7
+ orgUnitSelection: OrgUnitSelection;
8
+ orgUnits?: MapOrgUnit[] | undefined;
9
+ }>;
10
+ export declare const MapPeriodContext: import("react").Context<{
11
+ periods?: BasePeriod[] | undefined;
12
+ range?: {
13
+ start: Date;
14
+ end: Date;
15
+ } | undefined;
16
+ } | undefined>;
17
+ export declare const MapLayersContext: import("react").Context<{
18
+ layers: CustomMapLayer[];
19
+ updateLayer: (id: string, updatedLayer: CustomMapLayer) => void;
20
+ }>;
@@ -0,0 +1,12 @@
1
+ export declare const getColorPalette: (scale: string, classes: number) => any;
2
+ export declare const getColorClasses: (palette: string) => number;
3
+ export declare const getColorScale: (palette: string) => string | undefined;
4
+ export declare const defaultColorScaleName = "YlOrBr";
5
+ export declare const defaultClasses = 5;
6
+ export declare const defaultColorScale: any;
7
+ export declare const cssColor: (color: any) => any;
8
+ export declare const getUniqueColor: (defaultColors: any) => (index: number) => any;
9
+ export declare const isDarkColor: (color: string) => boolean;
10
+ export declare const getContrastColor: (color: string) => "#fff" | "#000";
11
+ export type LegendColorScale = typeof colorScales[number];
12
+ export declare const colorScales: string[];
@@ -0,0 +1,6 @@
1
+ import L from "leaflet";
2
+ export declare const getLongestTextLength: (array: Array<any>, key: string | number) => any;
3
+ export declare function getIconUrl(icon: string, { baseUrl }: {
4
+ baseUrl: string;
5
+ }): string;
6
+ export declare function getIcon(url: string): L.Icon | undefined;
@@ -0,0 +1,40 @@
1
+ import type { Legend, OrgUnitSelection } from "@hisptz/dhis2-utils";
2
+ import { LeafletMouseEvent } from "leaflet";
3
+ export declare function highlightFeature(e: LeafletMouseEvent, style: any): void;
4
+ export declare function resetHighlight(e: LeafletMouseEvent, defaultStyle: any): void;
5
+ export declare function getColorFromLegendSet(legends: Legend[], value?: number): string;
6
+ export declare function getLegendCount(legend: any, data: any): number;
7
+ export declare function getOrgUnitsSelection(orgUnitSelection: OrgUnitSelection): string[];
8
+ export declare function sanitizeOrgUnits(metaData: any): any;
9
+ export declare function toGeoJson(organisationUnits: any): ({
10
+ type: string;
11
+ id: any;
12
+ geometry: {
13
+ type: string;
14
+ coordinates: any;
15
+ };
16
+ properties: {
17
+ type: string;
18
+ id: any;
19
+ name: any;
20
+ hasCoordinatesDown: any;
21
+ hasCoordinatesUp: any;
22
+ level: any;
23
+ grandParentParentGraph: string;
24
+ grandParentId: string;
25
+ parentGraph: any;
26
+ parentId: any;
27
+ parentName: any;
28
+ dimensions: any;
29
+ };
30
+ } | {
31
+ type?: undefined;
32
+ id?: undefined;
33
+ geometry?: undefined;
34
+ properties?: undefined;
35
+ })[];
36
+ export declare function sanitizeDate(startDate: string): string;
37
+ export declare function generateLegends(maxValue: number, minValue: number, { classesCount, colorClass }: {
38
+ classesCount: number;
39
+ colorClass: string;
40
+ }): Array<Legend>;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { SingleValue } from "../../types/props";
3
+ interface SingleValueProps extends SingleValue {
4
+ globalAnimationDelay?: number;
5
+ globalAnimationDuration?: number;
6
+ }
7
+ export default function SingleValueItem({ label, value, color, percentage, animationDuration, animationDelay, globalAnimationDelay, decimalPlaces, globalAnimationDuration, }: SingleValueProps): React.ReactElement;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export default function SingleValuePercentage({ percentage, color }: any): React.ReactElement;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import SingleValueItem from "./components/SingleValueItem/SingleValueItem";
3
+ import { SingleValueContainerProps } from "./types/props";
4
+ export declare function SingleValueContainer({ title, singleValueItems, animationDuration, animationDelay }: SingleValueContainerProps): React.ReactElement;
5
+ export { SingleValueItem };
@@ -0,0 +1,15 @@
1
+ export type SingleValueContainerProps = {
2
+ title: string;
3
+ singleValueItems: Array<SingleValue>;
4
+ animationDuration?: number;
5
+ animationDelay?: number;
6
+ };
7
+ export type SingleValue = {
8
+ label: string;
9
+ value: number;
10
+ percentage?: number;
11
+ decimalPlaces?: number;
12
+ color?: string;
13
+ animationDuration?: number;
14
+ animationDelay?: number;
15
+ };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ export default function MapDataProvider({ children }: {
3
+ children: React.ReactNode;
4
+ }): React.ReactElement;
@@ -0,0 +1,4 @@
1
+ export * from "./components/Map";
2
+ export * from "./components/CircularProgressDashboard";
3
+ export * from "./components/ChartAnalytics";
4
+ export * from "./components/SingleValueContainer";
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@hisptz/dhis2-analytics",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
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",
8
+ "build:types": "tsc --project tsconfig.build.json",
9
+ "postbuild": "yarn build:types",
8
10
  "start": "d2-app-scripts start",
9
11
  "test": "d2-app-scripts test --passWithNoTests",
10
12
  "deploy": "d2-app-scripts deploy",
@@ -16,13 +18,15 @@
16
18
  "@dhis2/cypress-commands": "^9.0.2",
17
19
  "@dhis2/cypress-plugins": "^9.0.2",
18
20
  "@google/earthengine": "^0.1.336",
21
+ "@types/d3-color": "^3.1.0",
19
22
  "@types/d3-scale": "^4.0.3",
20
23
  "@types/leaflet": "^1.9.0",
21
24
  "@types/lodash": "^4.14.191",
22
25
  "@types/react-helmet": "^6.1.6",
23
26
  "cypress": "^12.3.0",
24
27
  "lodash": "^4.17.21",
25
- "react-hook-form": "^7.42.1"
28
+ "react-hook-form": "^7.42.1",
29
+ "typescript": "^4.9.5"
26
30
  },
27
31
  "dependencies": {
28
32
  "@dhis2/app-runtime": "^3.7.0",
@@ -70,5 +74,5 @@
70
74
  "lodash": "^4",
71
75
  "react-hook-form": "^7"
72
76
  },
73
- "gitHead": "bce569dcf7dc7d6a78e2d25842fa2cb5a16c8787"
77
+ "gitHead": "2ff4382b1fcdd413c878a6a2e2042cd05a8b5efb"
74
78
  }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- describe('Just a test', function () {
4
- test("", () => {
5
- expect(true).toBe(true);
6
- });
7
- });
@@ -1,6 +0,0 @@
1
- describe('Just a test', function () {
2
- test("", () => {
3
- expect(true).toBe(true);
4
- });
5
- });
6
- export {};