@hisptz/dhis2-analytics 1.0.0

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 (105) hide show
  1. package/README.md +45 -0
  2. package/d2.config.js +8 -0
  3. package/package.json +55 -0
  4. package/src/components/ChartAnalytics/ChartAnalytics.stories.tsx +250 -0
  5. package/src/components/ChartAnalytics/ChartAnalytics.test.tsx +51 -0
  6. package/src/components/ChartAnalytics/components/DownloadMenu/components/Menu.tsx +48 -0
  7. package/src/components/ChartAnalytics/components/DownloadMenu/constants/menu.ts +38 -0
  8. package/src/components/ChartAnalytics/components/DownloadMenu/index.tsx +67 -0
  9. package/src/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.ts +1 -0
  10. package/src/components/ChartAnalytics/data/column-data.json +210 -0
  11. package/src/components/ChartAnalytics/data/complex-multi-series-data.json +124 -0
  12. package/src/components/ChartAnalytics/data/multi-series-data.json +536 -0
  13. package/src/components/ChartAnalytics/data/pie-data.json +115 -0
  14. package/src/components/ChartAnalytics/data/stacked-chart-data.json +415 -0
  15. package/src/components/ChartAnalytics/hooks/useChart.ts +35 -0
  16. package/src/components/ChartAnalytics/index.tsx +23 -0
  17. package/src/components/ChartAnalytics/models/column.ts +50 -0
  18. package/src/components/ChartAnalytics/models/index.ts +78 -0
  19. package/src/components/ChartAnalytics/models/line.ts +31 -0
  20. package/src/components/ChartAnalytics/models/multi-series.ts +115 -0
  21. package/src/components/ChartAnalytics/models/pie.ts +54 -0
  22. package/src/components/ChartAnalytics/services/export.ts +38 -0
  23. package/src/components/ChartAnalytics/styles/custom-highchart.css +48 -0
  24. package/src/components/ChartAnalytics/types/props.tsx +48 -0
  25. package/src/components/ChartAnalytics/utils/chart.ts +123 -0
  26. package/src/components/CircularProgressDashboard/CircularProgressIndicator.stories.tsx +41 -0
  27. package/src/components/CircularProgressDashboard/CircularProgressIndicator.test.tsx +9 -0
  28. package/src/components/CircularProgressDashboard/index.tsx +35 -0
  29. package/src/components/CircularProgressDashboard/types/props.tsx +17 -0
  30. package/src/components/Map/Map.stories.tsx +339 -0
  31. package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.tsx +28 -0
  32. package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.tsx +34 -0
  33. package/src/components/Map/components/EarthEngineLayerConfiguration/index.tsx +412 -0
  34. package/src/components/Map/components/MapArea/index.tsx +83 -0
  35. package/src/components/Map/components/MapArea/interfaces/index.ts +39 -0
  36. package/src/components/Map/components/MapControls/components/CustomControl/index.tsx +24 -0
  37. package/src/components/Map/components/MapControls/components/DownloadControl/index.tsx +10 -0
  38. package/src/components/Map/components/MapControls/components/FullscreenControl/index.tsx +7 -0
  39. package/src/components/Map/components/MapControls/index.tsx +24 -0
  40. package/src/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.ts +7 -0
  41. package/src/components/Map/components/MapLayer/components/BoundaryLayer/index.tsx +55 -0
  42. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.tsx +76 -0
  43. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.ts +430 -0
  44. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.ts +34 -0
  45. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/index.tsx +185 -0
  46. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.ts +56 -0
  47. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +34233 -0
  48. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.ts +423 -0
  49. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.ts +105 -0
  50. package/src/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +12 -0
  51. package/src/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.tsx +17 -0
  52. package/src/components/Map/components/MapLayer/components/LegendArea/index.tsx +168 -0
  53. package/src/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.tsx +44 -0
  54. package/src/components/Map/components/MapLayer/components/PointLayer/hooks/index.ts +8 -0
  55. package/src/components/Map/components/MapLayer/components/PointLayer/index.tsx +36 -0
  56. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.tsx +48 -0
  57. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.tsx +150 -0
  58. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.tsx +39 -0
  59. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.tsx +57 -0
  60. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.tsx +43 -0
  61. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.tsx +38 -0
  62. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.tsx +26 -0
  63. package/src/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.ts +10 -0
  64. package/src/components/Map/components/MapLayer/components/ThematicLayer/index.tsx +46 -0
  65. package/src/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +62 -0
  66. package/src/components/Map/components/MapLayer/index.tsx +32 -0
  67. package/src/components/Map/components/MapLayer/interfaces/index.ts +139 -0
  68. package/src/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.tsx +359 -0
  69. package/src/components/Map/components/MapProvider/components/MapLayerProvider/index.tsx +105 -0
  70. package/src/components/Map/components/MapProvider/hooks/index.ts +14 -0
  71. package/src/components/Map/components/MapProvider/index.tsx +93 -0
  72. package/src/components/Map/components/MapUpdater/index.tsx +8 -0
  73. package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.tsx +28 -0
  74. package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.tsx +34 -0
  75. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.tsx +24 -0
  76. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.ts +433 -0
  77. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.tsx +50 -0
  78. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +15 -0
  79. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +12 -0
  80. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.ts +91 -0
  81. package/src/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.tsx +45 -0
  82. package/src/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.tsx +47 -0
  83. package/src/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.tsx +57 -0
  84. package/src/components/Map/components/ThematicLayerConfiguration/index.tsx +248 -0
  85. package/src/components/Map/constants/colors.ts +433 -0
  86. package/src/components/Map/constants/legendSet.ts +19 -0
  87. package/src/components/Map/hooks/map.ts +47 -0
  88. package/src/components/Map/index.tsx +65 -0
  89. package/src/components/Map/interfaces/index.ts +57 -0
  90. package/src/components/Map/state/index.tsx +31 -0
  91. package/src/components/Map/utils/colors.ts +95 -0
  92. package/src/components/Map/utils/helpers.ts +15 -0
  93. package/src/components/Map/utils/map.ts +150 -0
  94. package/src/components/SingleValueContainer/SingleValueContainer.stories.tsx +146 -0
  95. package/src/components/SingleValueContainer/SingleValueContainer.test.tsx +24 -0
  96. package/src/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.tsx +46 -0
  97. package/src/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.tsx +12 -0
  98. package/src/components/SingleValueContainer/index.tsx +30 -0
  99. package/src/components/SingleValueContainer/styles/SingleValueContainer.module.css +39 -0
  100. package/src/components/SingleValueContainer/types/props.tsx +16 -0
  101. package/src/data/map.json +5984 -0
  102. package/src/dataProviders/map.tsx +24 -0
  103. package/src/index.test.ts +7 -0
  104. package/src/index.ts +4 -0
  105. package/tsconfig.json +45 -0
@@ -0,0 +1,210 @@
1
+ {
2
+ "headers": [
3
+ {
4
+ "name": "dx",
5
+ "column": "Data",
6
+ "valueType": "TEXT",
7
+ "type": "java.lang.String",
8
+ "hidden": false,
9
+ "meta": true
10
+ },
11
+ {
12
+ "name": "ou",
13
+ "column": "Organisation unit",
14
+ "valueType": "TEXT",
15
+ "type": "java.lang.String",
16
+ "hidden": false,
17
+ "meta": true
18
+ },
19
+ {
20
+ "name": "value",
21
+ "column": "Value",
22
+ "valueType": "NUMBER",
23
+ "type": "java.lang.Double",
24
+ "hidden": false,
25
+ "meta": false
26
+ }
27
+ ],
28
+ "metaData": {
29
+ "items": {
30
+ "2022": {
31
+ "name": "2022"
32
+ },
33
+ "KctpIIucige": {
34
+ "name": "Selenga"
35
+ },
36
+ "YmmeuGbqOwR": {
37
+ "name": "Gbo"
38
+ },
39
+ "daJPPxtIrQn": {
40
+ "name": "Jaiama Bongor"
41
+ },
42
+ "tTUf91fCytl": {
43
+ "uid": "tTUf91fCytl",
44
+ "name": "Chiefdom"
45
+ },
46
+ "ou": {
47
+ "name": "Organisation unit"
48
+ },
49
+ "sxRd2XOzFbz": {
50
+ "name": "Tikonko"
51
+ },
52
+ "THIS_YEAR": {
53
+ "name": "This year"
54
+ },
55
+ "O6uvpzGd5pu": {
56
+ "uid": "O6uvpzGd5pu",
57
+ "code": "OU_264",
58
+ "name": "Bo"
59
+ },
60
+ "U6Kr7Gtpidn": {
61
+ "name": "Kakua"
62
+ },
63
+ "YuQRtpLP10I": {
64
+ "name": "Badjia"
65
+ },
66
+ "zFDYIgyGmXG": {
67
+ "name": "Bargbo"
68
+ },
69
+ "I4jWcnFmgEC": {
70
+ "name": "Niawa Lenga"
71
+ },
72
+ "dx": {
73
+ "name": "Data"
74
+ },
75
+ "BGGmAwx33dj": {
76
+ "name": "Bumpe Ngao"
77
+ },
78
+ "pe": {
79
+ "name": "Period"
80
+ },
81
+ "Uvn6LCg7dVU": {
82
+ "name": "ANC 1 Coverage"
83
+ },
84
+ "ARZ4y5i4reU": {
85
+ "name": "Wonde"
86
+ },
87
+ "JdhagCUEMbj": {
88
+ "name": "Komboya"
89
+ },
90
+ "vWbkYPRmKyS": {
91
+ "name": "Baoma"
92
+ },
93
+ "dGheVylzol6": {
94
+ "name": "Bargbe"
95
+ },
96
+ "kU8vhUkAGaT": {
97
+ "name": "Lugbu"
98
+ },
99
+ "npWGUj37qDe": {
100
+ "name": "Valunia"
101
+ }
102
+ },
103
+ "dimensions": {
104
+ "dx": [
105
+ "Uvn6LCg7dVU"
106
+ ],
107
+ "pe": [
108
+ "2022"
109
+ ],
110
+ "ou": [
111
+ "YuQRtpLP10I",
112
+ "vWbkYPRmKyS",
113
+ "dGheVylzol6",
114
+ "zFDYIgyGmXG",
115
+ "BGGmAwx33dj",
116
+ "YmmeuGbqOwR",
117
+ "daJPPxtIrQn",
118
+ "U6Kr7Gtpidn",
119
+ "JdhagCUEMbj",
120
+ "kU8vhUkAGaT",
121
+ "I4jWcnFmgEC",
122
+ "KctpIIucige",
123
+ "sxRd2XOzFbz",
124
+ "npWGUj37qDe",
125
+ "ARZ4y5i4reU"
126
+ ],
127
+ "co": []
128
+ }
129
+ },
130
+ "rows": [
131
+ [
132
+ "Uvn6LCg7dVU",
133
+ "YuQRtpLP10I",
134
+ "304.1"
135
+ ],
136
+ [
137
+ "Uvn6LCg7dVU",
138
+ "vWbkYPRmKyS",
139
+ "213.7"
140
+ ],
141
+ [
142
+ "Uvn6LCg7dVU",
143
+ "dGheVylzol6",
144
+ "126.5"
145
+ ],
146
+ [
147
+ "Uvn6LCg7dVU",
148
+ "zFDYIgyGmXG",
149
+ "206.4"
150
+ ],
151
+ [
152
+ "Uvn6LCg7dVU",
153
+ "BGGmAwx33dj",
154
+ "120.9"
155
+ ],
156
+ [
157
+ "Uvn6LCg7dVU",
158
+ "YmmeuGbqOwR",
159
+ "203.1"
160
+ ],
161
+ [
162
+ "Uvn6LCg7dVU",
163
+ "daJPPxtIrQn",
164
+ "89.3"
165
+ ],
166
+ [
167
+ "Uvn6LCg7dVU",
168
+ "U6Kr7Gtpidn",
169
+ "104.4"
170
+ ],
171
+ [
172
+ "Uvn6LCg7dVU",
173
+ "JdhagCUEMbj",
174
+ "187.1"
175
+ ],
176
+ [
177
+ "Uvn6LCg7dVU",
178
+ "kU8vhUkAGaT",
179
+ "96.1"
180
+ ],
181
+ [
182
+ "Uvn6LCg7dVU",
183
+ "I4jWcnFmgEC",
184
+ "147.9"
185
+ ],
186
+ [
187
+ "Uvn6LCg7dVU",
188
+ "KctpIIucige",
189
+ "91.1"
190
+ ],
191
+ [
192
+ "Uvn6LCg7dVU",
193
+ "sxRd2XOzFbz",
194
+ "203.2"
195
+ ],
196
+ [
197
+ "Uvn6LCg7dVU",
198
+ "npWGUj37qDe",
199
+ "95.7"
200
+ ],
201
+ [
202
+ "Uvn6LCg7dVU",
203
+ "ARZ4y5i4reU",
204
+ "84.3"
205
+ ]
206
+ ],
207
+ "height": 15,
208
+ "width": 3,
209
+ "headerWidth": 3
210
+ }
@@ -0,0 +1,124 @@
1
+ {
2
+ "headers": [
3
+ {
4
+ "name": "dx",
5
+ "column": "Data",
6
+ "valueType": "TEXT",
7
+ "type": "java.lang.String",
8
+ "hidden": false,
9
+ "meta": true
10
+ },
11
+ {
12
+ "name": "pe",
13
+ "column": "Period",
14
+ "valueType": "TEXT",
15
+ "type": "java.lang.String",
16
+ "hidden": false,
17
+ "meta": true
18
+ },
19
+ {
20
+ "name": "value",
21
+ "column": "Value",
22
+ "valueType": "NUMBER",
23
+ "type": "java.lang.Double",
24
+ "hidden": false,
25
+ "meta": false
26
+ }
27
+ ],
28
+ "metaData": {
29
+ "items": {
30
+ "202108": {
31
+ "name": "August 2021"
32
+ },
33
+ "202109": {
34
+ "name": "September 2021"
35
+ },
36
+ "202110": {
37
+ "name": "October 2021"
38
+ },
39
+ "202111": {
40
+ "name": "November 2021"
41
+ },
42
+ "202112": {
43
+ "name": "December 2021"
44
+ },
45
+ "202201": {
46
+ "name": "January 2022"
47
+ },
48
+ "202202": {
49
+ "name": "February 2022"
50
+ },
51
+ "202203": {
52
+ "name": "March 2022"
53
+ },
54
+ "202204": {
55
+ "name": "April 2022"
56
+ },
57
+ "202205": {
58
+ "name": "May 2022"
59
+ },
60
+ "202206": {
61
+ "name": "June 2022"
62
+ },
63
+ "202207": {
64
+ "name": "July 2022"
65
+ },
66
+ "ou": {
67
+ "name": "Organisation unit"
68
+ },
69
+ "LAST_12_MONTHS": {
70
+ "name": "Last 12 months"
71
+ },
72
+ "QQkOAJFukyY": {
73
+ "name": "COV-C: Jumla ya Waliochanjwa (Fully vaccinated)"
74
+ },
75
+ "dx": {
76
+ "name": "Data"
77
+ },
78
+ "pe": {
79
+ "name": "Period"
80
+ },
81
+ "HllvX50cXC0": {
82
+ "name": "default"
83
+ },
84
+ "acZHYslyJLt": {
85
+ "name": "Dar Es Salaam Region"
86
+ }
87
+ },
88
+ "dimensions": {
89
+ "dx": [
90
+ "QQkOAJFukyY"
91
+ ],
92
+ "pe": [
93
+ "202108",
94
+ "202109",
95
+ "202110",
96
+ "202111",
97
+ "202112",
98
+ "202201",
99
+ "202202",
100
+ "202203",
101
+ "202204",
102
+ "202205",
103
+ "202206",
104
+ "202207"
105
+ ],
106
+ "ou": [
107
+ "acZHYslyJLt"
108
+ ],
109
+ "co": [
110
+ "HllvX50cXC0"
111
+ ]
112
+ }
113
+ },
114
+ "width": 3,
115
+ "height": 1,
116
+ "rows": [
117
+ [
118
+ "QQkOAJFukyY",
119
+ "202203",
120
+ "1820.0"
121
+ ]
122
+ ],
123
+ "headerWidth": 3
124
+ }