@hisptz/dhis2-analytics 1.0.4 → 1.0.6

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 (293) hide show
  1. package/build/cjs/components/ChartAnalytics/ChartAnalytics.stories.js +253 -0
  2. package/build/cjs/components/ChartAnalytics/ChartAnalytics.test.js +51 -0
  3. package/build/cjs/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +48 -0
  4. package/build/cjs/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +34 -0
  5. package/build/cjs/components/ChartAnalytics/components/DownloadMenu/index.js +67 -0
  6. package/build/cjs/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +1 -0
  7. package/{src → build/cjs}/components/ChartAnalytics/data/column-data.json +0 -0
  8. package/{src → build/cjs}/components/ChartAnalytics/data/complex-multi-series-data.json +0 -0
  9. package/{src → build/cjs}/components/ChartAnalytics/data/multi-series-data.json +0 -0
  10. package/{src → build/cjs}/components/ChartAnalytics/data/pie-data.json +0 -0
  11. package/{src → build/cjs}/components/ChartAnalytics/data/stacked-chart-data.json +0 -0
  12. package/build/cjs/components/ChartAnalytics/hooks/useChart.js +38 -0
  13. package/build/cjs/components/ChartAnalytics/index.js +69 -0
  14. package/build/cjs/components/ChartAnalytics/models/column.js +53 -0
  15. package/build/cjs/components/ChartAnalytics/models/index.js +102 -0
  16. package/build/cjs/components/ChartAnalytics/models/line.js +35 -0
  17. package/build/cjs/components/ChartAnalytics/models/multi-series.js +111 -0
  18. package/build/cjs/components/ChartAnalytics/models/pie.js +53 -0
  19. package/build/cjs/components/ChartAnalytics/services/export.js +50 -0
  20. package/{src → build/cjs}/components/ChartAnalytics/styles/custom-highchart.css +0 -0
  21. package/build/cjs/components/ChartAnalytics/types/props.js +1 -0
  22. package/build/cjs/components/ChartAnalytics/utils/chart.js +133 -0
  23. package/build/cjs/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +45 -0
  24. package/build/cjs/components/CircularProgressDashboard/CircularProgressIndicator.test.js +13 -0
  25. package/build/cjs/components/CircularProgressDashboard/index.js +49 -0
  26. package/build/cjs/components/CircularProgressDashboard/types/props.js +1 -0
  27. package/build/cjs/components/Map/Map.stories.js +352 -0
  28. package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +32 -0
  29. package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +40 -0
  30. package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/index.js +458 -0
  31. package/build/cjs/components/Map/components/MapArea/index.js +101 -0
  32. package/build/cjs/components/Map/components/MapArea/interfaces/index.js +1 -0
  33. package/build/cjs/components/Map/components/MapControls/components/CustomControl/index.js +32 -0
  34. package/build/cjs/components/Map/components/MapControls/components/DownloadControl/index.js +25 -0
  35. package/build/cjs/components/Map/components/MapControls/components/FullscreenControl/index.js +13 -0
  36. package/build/cjs/components/Map/components/MapControls/index.js +42 -0
  37. package/build/cjs/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +13 -0
  38. package/build/cjs/components/Map/components/MapLayer/components/BoundaryLayer/index.js +51 -0
  39. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +106 -0
  40. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +379 -0
  41. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +36 -0
  42. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +200 -0
  43. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +1 -0
  44. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +10 -0
  45. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +412 -0
  46. package/build/cjs/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +124 -0
  47. package/{src → build/cjs}/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +0 -0
  48. package/build/cjs/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +26 -0
  49. package/build/cjs/components/Map/components/MapLayer/components/LegendArea/index.js +181 -0
  50. package/build/cjs/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +86 -0
  51. package/build/cjs/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +14 -0
  52. package/build/cjs/components/Map/components/MapLayer/components/PointLayer/index.js +46 -0
  53. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +57 -0
  54. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +145 -0
  55. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +43 -0
  56. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +56 -0
  57. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +61 -0
  58. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +43 -0
  59. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +35 -0
  60. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +15 -0
  61. package/build/cjs/components/Map/components/MapLayer/components/ThematicLayer/index.js +57 -0
  62. package/{src → build/cjs}/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +0 -0
  63. package/build/cjs/components/Map/components/MapLayer/index.js +40 -0
  64. package/build/cjs/components/Map/components/MapLayer/interfaces/index.js +8 -0
  65. package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +389 -0
  66. package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/index.js +116 -0
  67. package/build/cjs/components/Map/components/MapProvider/hooks/index.js +19 -0
  68. package/build/cjs/components/Map/components/MapProvider/index.js +121 -0
  69. package/build/cjs/components/Map/components/MapUpdater/index.js +24 -0
  70. package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +32 -0
  71. package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +40 -0
  72. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +40 -0
  73. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js +428 -0
  74. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +63 -0
  75. package/{src → build/cjs}/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +0 -0
  76. package/{src → build/cjs}/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +0 -0
  77. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +72 -0
  78. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +71 -0
  79. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +47 -0
  80. package/build/cjs/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +79 -0
  81. package/build/cjs/components/Map/components/ThematicLayerConfiguration/index.js +265 -0
  82. package/build/cjs/components/Map/constants/colors.js +428 -0
  83. package/build/cjs/components/Map/constants/legendSet.js +22 -0
  84. package/build/cjs/components/Map/hooks/map.js +52 -0
  85. package/build/cjs/components/Map/index.js +108 -0
  86. package/build/cjs/components/Map/interfaces/index.js +1 -0
  87. package/build/cjs/components/Map/state/index.js +23 -0
  88. package/build/cjs/components/Map/utils/colors.js +78 -0
  89. package/build/cjs/components/Map/utils/helpers.js +25 -0
  90. package/build/cjs/components/Map/utils/map.js +161 -0
  91. package/build/cjs/components/SingleValueContainer/SingleValueContainer.stories.js +127 -0
  92. package/build/cjs/components/SingleValueContainer/SingleValueContainer.test.js +23 -0
  93. package/build/cjs/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +54 -0
  94. package/build/cjs/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +24 -0
  95. package/build/cjs/components/SingleValueContainer/index.js +43 -0
  96. package/{src → build/cjs}/components/SingleValueContainer/styles/SingleValueContainer.module.css +0 -0
  97. package/build/cjs/components/SingleValueContainer/types/props.js +1 -0
  98. package/{src → build/cjs}/data/map.json +0 -0
  99. package/build/cjs/dataProviders/map.js +31 -0
  100. package/build/cjs/index.js +49 -0
  101. package/build/cjs/index.test.js +7 -0
  102. package/build/cjs/locales/en/translations.json +128 -0
  103. package/build/cjs/locales/index.js +22 -0
  104. package/build/es/components/ChartAnalytics/ChartAnalytics.stories.js +235 -0
  105. package/build/es/components/ChartAnalytics/ChartAnalytics.test.js +46 -0
  106. package/build/es/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +41 -0
  107. package/build/es/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +26 -0
  108. package/build/es/components/ChartAnalytics/components/DownloadMenu/index.js +58 -0
  109. package/build/es/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +1 -0
  110. package/build/es/components/ChartAnalytics/data/column-data.json +210 -0
  111. package/build/es/components/ChartAnalytics/data/complex-multi-series-data.json +124 -0
  112. package/build/es/components/ChartAnalytics/data/multi-series-data.json +536 -0
  113. package/build/es/components/ChartAnalytics/data/pie-data.json +115 -0
  114. package/build/es/components/ChartAnalytics/data/stacked-chart-data.json +415 -0
  115. package/build/es/components/ChartAnalytics/hooks/useChart.js +32 -0
  116. package/build/es/components/ChartAnalytics/index.js +40 -0
  117. package/build/es/components/ChartAnalytics/models/column.js +45 -0
  118. package/build/es/components/ChartAnalytics/models/index.js +95 -0
  119. package/build/es/components/ChartAnalytics/models/line.js +28 -0
  120. package/build/es/components/ChartAnalytics/models/multi-series.js +104 -0
  121. package/build/es/components/ChartAnalytics/models/pie.js +46 -0
  122. package/build/es/components/ChartAnalytics/services/export.js +36 -0
  123. package/build/es/components/ChartAnalytics/styles/custom-highchart.css +48 -0
  124. package/build/es/components/ChartAnalytics/types/props.js +1 -0
  125. package/build/es/components/ChartAnalytics/utils/chart.js +122 -0
  126. package/{src/components/CircularProgressDashboard/CircularProgressIndicator.stories.tsx → build/es/components/CircularProgressDashboard/CircularProgressIndicator.stories.js} +9 -16
  127. package/build/es/components/CircularProgressDashboard/CircularProgressIndicator.test.js +10 -0
  128. package/build/es/components/CircularProgressDashboard/index.js +41 -0
  129. package/build/es/components/CircularProgressDashboard/types/props.js +1 -0
  130. package/build/es/components/Map/Map.stories.js +334 -0
  131. package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +23 -0
  132. package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +31 -0
  133. package/build/es/components/Map/components/EarthEngineLayerConfiguration/index.js +448 -0
  134. package/build/es/components/Map/components/MapArea/index.js +91 -0
  135. package/build/es/components/Map/components/MapArea/interfaces/index.js +1 -0
  136. package/build/es/components/Map/components/MapControls/components/CustomControl/index.js +25 -0
  137. package/build/es/components/Map/components/MapControls/components/DownloadControl/index.js +18 -0
  138. package/build/es/components/Map/components/MapControls/components/FullscreenControl/index.js +6 -0
  139. package/build/es/components/Map/components/MapControls/index.js +35 -0
  140. package/build/es/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +7 -0
  141. package/build/es/components/Map/components/MapLayer/components/BoundaryLayer/index.js +41 -0
  142. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +95 -0
  143. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +369 -0
  144. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +29 -0
  145. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +191 -0
  146. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +1 -0
  147. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +10 -0
  148. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +403 -0
  149. package/build/es/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +111 -0
  150. package/build/es/components/Map/components/MapLayer/components/LegendArea/LegendArea.module.css +12 -0
  151. package/build/es/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +19 -0
  152. package/build/es/components/Map/components/MapLayer/components/LegendArea/index.js +172 -0
  153. package/build/es/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +76 -0
  154. package/build/es/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +8 -0
  155. package/build/es/components/Map/components/MapLayer/components/PointLayer/index.js +39 -0
  156. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +49 -0
  157. package/{src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.tsx → build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js} +57 -74
  158. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +33 -0
  159. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +47 -0
  160. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +50 -0
  161. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +36 -0
  162. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +28 -0
  163. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +9 -0
  164. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/index.js +50 -0
  165. package/build/es/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +62 -0
  166. package/build/es/components/Map/components/MapLayer/index.js +33 -0
  167. package/build/es/components/Map/components/MapLayer/interfaces/index.js +1 -0
  168. package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +381 -0
  169. package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/index.js +107 -0
  170. package/{src/components/Map/components/MapProvider/hooks/index.ts → build/es/components/Map/components/MapProvider/hooks/index.js} +3 -6
  171. package/build/es/components/Map/components/MapProvider/index.js +112 -0
  172. package/build/es/components/Map/components/MapUpdater/index.js +17 -0
  173. package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +23 -0
  174. package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +31 -0
  175. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +33 -0
  176. package/{src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.ts → build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js} +46 -59
  177. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +53 -0
  178. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScale.module.css +15 -0
  179. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/styles/ColorScaleSelect.module.css +12 -0
  180. package/build/es/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +56 -0
  181. package/build/es/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +64 -0
  182. package/build/es/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +38 -0
  183. package/build/es/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +70 -0
  184. package/build/es/components/Map/components/ThematicLayerConfiguration/index.js +254 -0
  185. package/{src/components/Map/constants/colors.ts → build/es/components/Map/constants/colors.js} +46 -59
  186. package/build/es/components/Map/constants/legendSet.js +15 -0
  187. package/build/es/components/Map/hooks/map.js +44 -0
  188. package/build/es/components/Map/index.js +51 -0
  189. package/build/es/components/Map/interfaces/index.js +1 -0
  190. package/build/es/components/Map/state/index.js +14 -0
  191. package/build/es/components/Map/utils/colors.js +61 -0
  192. package/build/es/components/Map/utils/helpers.js +14 -0
  193. package/build/es/components/Map/utils/map.js +147 -0
  194. package/build/es/components/SingleValueContainer/SingleValueContainer.stories.js +115 -0
  195. package/build/es/components/SingleValueContainer/SingleValueContainer.test.js +20 -0
  196. package/build/es/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +47 -0
  197. package/build/es/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +17 -0
  198. package/build/es/components/SingleValueContainer/index.js +29 -0
  199. package/build/es/components/SingleValueContainer/styles/SingleValueContainer.module.css +39 -0
  200. package/build/es/components/SingleValueContainer/types/props.js +1 -0
  201. package/build/es/data/map.json +5984 -0
  202. package/build/es/dataProviders/map.js +24 -0
  203. package/{src/index.ts → build/es/index.js} +1 -0
  204. package/build/es/index.test.js +6 -0
  205. package/build/es/locales/en/translations.json +128 -0
  206. package/build/es/locales/index.js +13 -0
  207. package/package.json +21 -4
  208. package/d2.config.js +0 -8
  209. package/i18n/en.pot +0 -409
  210. package/src/components/ChartAnalytics/ChartAnalytics.stories.tsx +0 -250
  211. package/src/components/ChartAnalytics/ChartAnalytics.test.tsx +0 -51
  212. package/src/components/ChartAnalytics/components/DownloadMenu/components/Menu.tsx +0 -48
  213. package/src/components/ChartAnalytics/components/DownloadMenu/constants/menu.ts +0 -38
  214. package/src/components/ChartAnalytics/components/DownloadMenu/index.tsx +0 -67
  215. package/src/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.ts +0 -1
  216. package/src/components/ChartAnalytics/hooks/useChart.ts +0 -35
  217. package/src/components/ChartAnalytics/index.tsx +0 -23
  218. package/src/components/ChartAnalytics/models/column.ts +0 -50
  219. package/src/components/ChartAnalytics/models/index.ts +0 -78
  220. package/src/components/ChartAnalytics/models/line.ts +0 -31
  221. package/src/components/ChartAnalytics/models/multi-series.ts +0 -115
  222. package/src/components/ChartAnalytics/models/pie.ts +0 -54
  223. package/src/components/ChartAnalytics/services/export.ts +0 -38
  224. package/src/components/ChartAnalytics/types/props.tsx +0 -48
  225. package/src/components/ChartAnalytics/utils/chart.ts +0 -123
  226. package/src/components/CircularProgressDashboard/CircularProgressIndicator.test.tsx +0 -9
  227. package/src/components/CircularProgressDashboard/index.tsx +0 -35
  228. package/src/components/CircularProgressDashboard/types/props.tsx +0 -17
  229. package/src/components/Map/Map.stories.tsx +0 -339
  230. package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.tsx +0 -28
  231. package/src/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.tsx +0 -34
  232. package/src/components/Map/components/EarthEngineLayerConfiguration/index.tsx +0 -412
  233. package/src/components/Map/components/MapArea/index.tsx +0 -83
  234. package/src/components/Map/components/MapArea/interfaces/index.ts +0 -39
  235. package/src/components/Map/components/MapControls/components/CustomControl/index.tsx +0 -24
  236. package/src/components/Map/components/MapControls/components/DownloadControl/index.tsx +0 -10
  237. package/src/components/Map/components/MapControls/components/FullscreenControl/index.tsx +0 -7
  238. package/src/components/Map/components/MapControls/index.tsx +0 -24
  239. package/src/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.ts +0 -7
  240. package/src/components/Map/components/MapLayer/components/BoundaryLayer/index.tsx +0 -55
  241. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.tsx +0 -76
  242. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.ts +0 -430
  243. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.ts +0 -34
  244. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/index.tsx +0 -185
  245. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.ts +0 -56
  246. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +0 -34233
  247. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.ts +0 -423
  248. package/src/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.ts +0 -105
  249. package/src/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.tsx +0 -17
  250. package/src/components/Map/components/MapLayer/components/LegendArea/index.tsx +0 -168
  251. package/src/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.tsx +0 -44
  252. package/src/components/Map/components/MapLayer/components/PointLayer/hooks/index.ts +0 -8
  253. package/src/components/Map/components/MapLayer/components/PointLayer/index.tsx +0 -36
  254. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.tsx +0 -48
  255. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.tsx +0 -39
  256. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.tsx +0 -57
  257. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.tsx +0 -43
  258. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.tsx +0 -38
  259. package/src/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.tsx +0 -26
  260. package/src/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.ts +0 -10
  261. package/src/components/Map/components/MapLayer/components/ThematicLayer/index.tsx +0 -46
  262. package/src/components/Map/components/MapLayer/index.tsx +0 -32
  263. package/src/components/Map/components/MapLayer/interfaces/index.ts +0 -139
  264. package/src/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.tsx +0 -359
  265. package/src/components/Map/components/MapProvider/components/MapLayerProvider/index.tsx +0 -105
  266. package/src/components/Map/components/MapProvider/index.tsx +0 -93
  267. package/src/components/Map/components/MapUpdater/index.tsx +0 -8
  268. package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.tsx +0 -28
  269. package/src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.tsx +0 -34
  270. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.tsx +0 -24
  271. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.tsx +0 -50
  272. package/src/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.ts +0 -91
  273. package/src/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.tsx +0 -45
  274. package/src/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.tsx +0 -47
  275. package/src/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.tsx +0 -57
  276. package/src/components/Map/components/ThematicLayerConfiguration/index.tsx +0 -248
  277. package/src/components/Map/constants/legendSet.ts +0 -19
  278. package/src/components/Map/hooks/map.ts +0 -47
  279. package/src/components/Map/index.tsx +0 -65
  280. package/src/components/Map/interfaces/index.ts +0 -57
  281. package/src/components/Map/state/index.tsx +0 -31
  282. package/src/components/Map/utils/colors.ts +0 -95
  283. package/src/components/Map/utils/helpers.ts +0 -15
  284. package/src/components/Map/utils/map.ts +0 -150
  285. package/src/components/SingleValueContainer/SingleValueContainer.stories.tsx +0 -146
  286. package/src/components/SingleValueContainer/SingleValueContainer.test.tsx +0 -24
  287. package/src/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.tsx +0 -46
  288. package/src/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.tsx +0 -12
  289. package/src/components/SingleValueContainer/index.tsx +0 -30
  290. package/src/components/SingleValueContainer/types/props.tsx +0 -16
  291. package/src/dataProviders/map.tsx +0 -24
  292. package/src/index.test.ts +0 -7
  293. package/tsconfig.json +0 -45
@@ -1,57 +0,0 @@
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
-
7
- export interface MapProviderProps {
8
- children: React.ReactNode;
9
- orgUnitSelection: OrgUnitSelection;
10
- periodSelection?: { periods?: string[]; range?: { start: Date; end: Date } };
11
- }
12
-
13
- export interface MapProps {
14
- key?: string;
15
- orgUnitSelection: OrgUnitSelection; //Organisation unit selection
16
- pointLayer?: {
17
- enabled: boolean;
18
- label?: string;
19
- level?: number | string;
20
- group?: string;
21
- style?: {
22
- icon?: string;
23
- groupSet?: string;
24
- };
25
- };
26
- boundaryLayer?: {
27
- enabled: boolean;
28
- };
29
- controls?: MapControls[];
30
- legends?: MapLegendConfig;
31
- thematicLayers?: ThematicLayerConfig[];
32
- earthEngineLayers?: EarthEngineLayerConfig[];
33
- periodSelection?: { periods?: string[]; range?: { start: Date; end: Date } };
34
- mapOptions?: MapContainerProps;
35
- }
36
-
37
- export interface MapOrgUnit {
38
- id: string;
39
- path: string;
40
- name: string;
41
- bounds: any[];
42
- geoJSON: any;
43
- children?: MapOrgUnit[];
44
- level?: number;
45
- }
46
-
47
- export interface PointOrgUnit {
48
- id: string;
49
- path: string;
50
- name: string;
51
- bounds: any[];
52
- geoJSON: any;
53
- icon: {
54
- type: "custom" | "groupIcon";
55
- icon: string;
56
- };
57
- }
@@ -1,31 +0,0 @@
1
- import type {OrgUnitSelection} from "@hisptz/dhis2-utils";
2
- import {PeriodInterface} from "@iapps/period-utilities";
3
- import {createContext} from "react";
4
- import {CustomMapLayer} from "../components/MapLayer/interfaces";
5
- import {MapOrgUnit} from "../interfaces";
6
-
7
- export const MapOrgUnitContext = createContext<{
8
- orgUnitSelection: OrgUnitSelection;
9
- orgUnits?: MapOrgUnit[];
10
- }>({
11
- orgUnitSelection: { orgUnits: [] },
12
- orgUnits: [],
13
- });
14
-
15
- export const MapPeriodContext = createContext<
16
- | {
17
- periods?: PeriodInterface[];
18
- range?: { start: Date; end: Date };
19
- }
20
- | undefined
21
- >({
22
- periods: [],
23
- });
24
-
25
- export const MapLayersContext = createContext<{
26
- layers: CustomMapLayer[];
27
- updateLayer: (id: string, updatedLayer: CustomMapLayer) => void;
28
- }>({
29
- layers: [],
30
- updateLayer: () => {},
31
- });
@@ -1,95 +0,0 @@
1
- import {hcl} from "d3-color";
2
- import {isString} from "lodash";
3
- import {COLOR_PALETTES} from "../constants/colors";
4
-
5
- const colorbrewer: Record<string, any> = COLOR_PALETTES;
6
-
7
- // Returns a color brewer scale for a number of classes
8
- export const getColorPalette = (scale: string, classes: number) => {
9
- return colorbrewer?.[scale]?.[classes];
10
- };
11
-
12
- export const getColorClasses = (palette: string) => {
13
- return palette?.split(",")?.length;
14
- };
15
-
16
- // Returns color scale name for a palette
17
- export const getColorScale = (palette: string) => {
18
- const classes = palette.split(",").length;
19
- return colorScales.find((name) => colorbrewer[name][classes]?.join(",") === palette);
20
- };
21
-
22
- export const defaultColorScaleName = "YlOrBr";
23
- export const defaultClasses = 5;
24
- export const defaultColorScale = getColorPalette(defaultColorScaleName, defaultClasses);
25
-
26
- // Correct colors not adhering to the css standard (add missing #)
27
- export const cssColor = (color: any) => {
28
- if (!isString(color)) {
29
- return color;
30
- } else if (color === "##normal") {
31
- // ##normal is used in old map favorites
32
- return null; // Will apply default color
33
- }
34
- return (/(^[0-9A-F]{6}$)|(^[0-9A-F]{3}$)/i.test(color) ? "#" : "") + color;
35
- };
36
-
37
- // Returns an unique color (first from an array, then random but still unique)
38
- export const getUniqueColor = (defaultColors: any) => {
39
- const colors = [...defaultColors];
40
-
41
- function randomColor(): string {
42
- const color = "#000000".replace(/0/g, () => (~~(Math.random() * 16)).toString(16));
43
-
44
- // Recursive until color is unique
45
- if (colors.includes(color)) {
46
- return randomColor();
47
- }
48
-
49
- colors.push(color);
50
-
51
- return color;
52
- }
53
-
54
- return (index: number) => colors[index] || randomColor();
55
- };
56
-
57
- // Returns true if a color is dark
58
- export const isDarkColor = (color: string) => hcl(color).l < 70;
59
-
60
- // Returns constrasting color
61
- export const getContrastColor = (color: string) => (isDarkColor(color) ? "#fff" : "#000");
62
- export type LegendColorScale = typeof colorScales[number];
63
- export const colorScales = [
64
- "YlOrBr",
65
- "Reds",
66
- "YlGn",
67
- "Greens",
68
- "Blues",
69
- "BuPu",
70
- "RdPu",
71
- "PuRd",
72
- "Greys",
73
- "YlOrBr_reverse",
74
- "Reds_reverse",
75
- "YlGn_reverse",
76
- "Greens_reverse",
77
- "Blues_reverse",
78
- "BuPu_reverse",
79
- "RdPu_reverse",
80
- "PuRd_reverse",
81
- "Greys_reverse",
82
- "PuOr",
83
- "BrBG",
84
- "PRGn",
85
- "PiYG",
86
- "RdBu",
87
- "RdGy",
88
- "RdYlBu",
89
- "Spectral",
90
- "RdYlGn",
91
- "Paired",
92
- "Pastel1",
93
- "Set1",
94
- "Set3",
95
- ];
@@ -1,15 +0,0 @@
1
- // Get the longest text length from an object property in an array
2
- import L from "leaflet";
3
-
4
- export const getLongestTextLength = (array: Array<any>, key: string | number) =>
5
- array.reduce((text, curr) => (curr[key] && String(curr[key]).length > text.length ? String(curr[key]) : text), "").length;
6
-
7
- export function getIconUrl(icon: string, { baseUrl }: { baseUrl: string }) {
8
- return `${baseUrl}/images/orgunitgroup/${icon ?? "01.png"}`;
9
- }
10
-
11
- export function getIcon(url: string): L.Icon | undefined {
12
- return new L.Icon({
13
- iconUrl: url,
14
- });
15
- }
@@ -1,150 +0,0 @@
1
- import type {Legend, OrganisationUnit, OrgUnitSelection} from "@hisptz/dhis2-utils";
2
- import {LeafletMouseEvent} from "leaflet";
3
- import {compact, filter, find, forEach, isEmpty, isString, sortBy} from "lodash";
4
- import {defaultClasses, defaultColorScaleName, getColorPalette} from "./colors";
5
-
6
- export function highlightFeature(e: LeafletMouseEvent, style: any) {
7
- const layer = e.target;
8
- layer.setStyle(style);
9
- // layer.bringToFront();
10
- }
11
-
12
- export function resetHighlight(e: LeafletMouseEvent, defaultStyle: any) {
13
- const layer = e.target;
14
- layer.setStyle(defaultStyle);
15
- // layer.bringToBack();
16
- }
17
-
18
- export function getColorFromLegendSet(legends: Legend[], value?: number): string {
19
- if (!value) {
20
- return "";
21
- }
22
- const legend: any = find(legends ?? [], (legend: any) => legend?.startValue <= value && legend?.endValue >= value) ?? {};
23
- return legend.color ? legend.color : "transparent";
24
- }
25
-
26
- export function getLegendCount(legend: any, data: any) {
27
- const { startValue, endValue } = legend;
28
- return filter(data, (d: any) => d.data >= startValue && d.data <= endValue).length;
29
- }
30
-
31
- export function getOrgUnitsSelection(orgUnitSelection: OrgUnitSelection) {
32
- const orgUnits = [];
33
- if (orgUnitSelection.userOrgUnit) {
34
- orgUnits.push("USER_ORGUNIT");
35
- }
36
-
37
- if (orgUnitSelection.userSubUnit) {
38
- orgUnits.push("USER_ORGUNIT_CHILDREN");
39
- }
40
-
41
- if (orgUnitSelection.userSubX2Unit) {
42
- orgUnits.push("USER_ORGUNIT_GRANDCHILDREN");
43
- }
44
- if (!isEmpty(orgUnitSelection.levels)) {
45
- forEach(orgUnitSelection.levels, (level) => orgUnits.push(`LEVEL-${level}`));
46
- }
47
-
48
- return [...orgUnits, ...(orgUnitSelection?.orgUnits?.map((ou: OrganisationUnit) => `${ou.id}`) ?? [])];
49
- }
50
-
51
- export function sanitizeOrgUnits(metaData: any) {
52
- if (metaData) {
53
- return metaData?.dimensions?.ou?.map((ouId: string) => ({
54
- id: ouId,
55
- name: metaData?.items[ouId]?.name,
56
- path: metaData?.ouHierarchy?.[ouId],
57
- }));
58
- }
59
- return [];
60
- }
61
-
62
- export function toGeoJson(organisationUnits: any) {
63
- return sortBy(organisationUnits, "le").map((ou: any) => {
64
- try {
65
- const coord = JSON.parse(ou.co);
66
- let gpid = "";
67
- let gppg = "";
68
- let type = "Point";
69
-
70
- if (ou.ty === 2) {
71
- type = "Polygon";
72
- if (ou.co.substring(0, 4) === "[[[[") {
73
- type = "MultiPolygon";
74
- }
75
- }
76
-
77
- // Grand parent
78
- if (isString(ou.pg) && ou.pg.length) {
79
- const ids = compact(ou.pg.split("/"));
80
-
81
- // Grand parent id
82
- if (ids.length >= 2) {
83
- gpid = ids[ids.length - 2] as string;
84
- }
85
-
86
- // Grand parent parent graph
87
- if (ids.length > 2) {
88
- gppg = "/" + ids.slice(0, ids.length - 2).join("/");
89
- }
90
- }
91
-
92
- return {
93
- type: "Feature",
94
- id: ou.id,
95
- geometry: {
96
- type,
97
- coordinates: coord,
98
- },
99
- properties: {
100
- type,
101
- id: ou.id,
102
- name: ou.na,
103
- hasCoordinatesDown: ou.hcd,
104
- hasCoordinatesUp: ou.hcu,
105
- level: ou.le,
106
- grandParentParentGraph: gppg,
107
- grandParentId: gpid,
108
- parentGraph: ou.pg,
109
- parentId: ou.pi,
110
- parentName: ou.pn,
111
- dimensions: ou.dimensions,
112
- },
113
- };
114
- } catch (e) {
115
- return {};
116
- }
117
- });
118
- }
119
-
120
- export function sanitizeDate(startDate: string): string {
121
- if (startDate?.split("-")?.[0]?.length < 4) {
122
- return startDate?.split("-")?.reverse()?.join("-");
123
- }
124
- return startDate;
125
- }
126
-
127
- export function generateLegends(maxValue: number, minValue: number, { classesCount, colorClass }: { classesCount: number; colorClass: string }): Array<Legend> {
128
- const count: number = classesCount ?? defaultClasses;
129
- const color = colorClass ?? defaultColorScaleName;
130
-
131
- const colorScale = [...getColorPalette(color, count)].reverse();
132
-
133
- const maxLegendValue = 5 * Math.ceil(maxValue / 5);
134
- const range = maxLegendValue / count;
135
-
136
- const values = [];
137
- let legendColorsIterator = colorScale.length - 1;
138
- for (let i = 0; i < maxLegendValue; i += range) {
139
- const id = colorScale[legendColorsIterator];
140
- values.push({
141
- startValue: Math.floor(i),
142
- endValue: Math.floor(i + range),
143
- id,
144
- color: id,
145
- });
146
- legendColorsIterator--;
147
- }
148
-
149
- return values.reverse();
150
- }
@@ -1,146 +0,0 @@
1
- import type {Story} from "@storybook/react";
2
- import React from "react";
3
- import {SingleValueContainerProps} from "./types/props";
4
- import {SingleValueContainer} from ".";
5
-
6
- const Template: Story<SingleValueContainerProps> = (args) => <SingleValueContainer {...args} />;
7
-
8
- export const Default = Template.bind({});
9
- Default.args = {
10
- title: "PRIORITY INDICATORS",
11
- singleValueItems: [
12
- {
13
- label: "Total Bookings",
14
- value: 136,
15
- },
16
- {
17
- label: "At least one dose",
18
- value: 45,
19
- percentage: 23,
20
- color: "#0D47A1",
21
- },
22
- {
23
- label: "Partially vaccinated",
24
- value: 13,
25
- percentage: 17,
26
- color: "#0D47A1",
27
- },
28
- {
29
- label: "Fully vaccinated",
30
- value: 126,
31
- percentage: 83,
32
- color: "#0D47A1",
33
- },
34
- {
35
- label: "Number of AEFI",
36
- value: 26,
37
- },
38
- ],
39
- };
40
-
41
- export const AnimatedAllValues = Template.bind({});
42
- AnimatedAllValues.args = {
43
- title: "PRIORITY INDICATORS",
44
- animationDuration: 1500,
45
- animationDelay: 500,
46
- singleValueItems: [
47
- {
48
- label: "Total Bookings",
49
- value: 136344,
50
- },
51
- {
52
- label: "At least one dose",
53
- value: 4423,
54
- percentage: 23,
55
- color: "#0D47A1",
56
- },
57
- {
58
- label: "Partially vaccinated",
59
- value: 1394,
60
- percentage: 17,
61
- color: "#0D47A1",
62
- },
63
- {
64
- label: "Fully vaccinated",
65
- value: 12432,
66
- percentage: 83,
67
- color: "#0D47A1",
68
- },
69
- {
70
- label: "Number of AEFI",
71
- value: 26423,
72
- },
73
- ],
74
- };
75
-
76
- export const AnimatedSingleValue = Template.bind({});
77
- AnimatedSingleValue.args = {
78
- title: "PRIORITY INDICATORS",
79
- singleValueItems: [
80
- {
81
- label: "Total Bookings",
82
- value: 13634244,
83
- animationDuration: 1000,
84
- animationDelay: 100,
85
- },
86
- {
87
- label: "At least one dose",
88
- value: 45423,
89
- percentage: 23,
90
- color: "#0D47A1",
91
- animationDuration: 1000,
92
- animationDelay: 600,
93
- },
94
- {
95
- label: "Partially vaccinated",
96
- value: 13434,
97
- percentage: 17,
98
- color: "#0D47A1",
99
- animationDuration: 1000,
100
- animationDelay: 1100,
101
- },
102
- {
103
- label: "Fully vaccinated",
104
- value: 126432,
105
- percentage: 83,
106
- color: "#0D47A1",
107
- animationDuration: 1000,
108
- animationDelay: 1600,
109
- },
110
- {
111
- label: "Number of AEFI",
112
- value: 268423,
113
- animationDuration: 1000,
114
- animationDelay: 2000,
115
- },
116
- ],
117
- };
118
-
119
- export const SingleValuesWithDecimalPlaces = Template.bind({});
120
- SingleValuesWithDecimalPlaces.args = {
121
- title: "ENROLLMENTS",
122
- animationDuration: 1500,
123
- animationDelay: 500,
124
- singleValueItems: [
125
- {
126
- label: "Number of Enrolled Clients",
127
- value: 268423,
128
- decimalPlaces: 3,
129
- },
130
- {
131
- label: "Number of Served Clients",
132
- value: 268423,
133
- decimalPlaces: 1,
134
- },
135
- ],
136
- };
137
-
138
- export default {
139
- title: "Components/Single Value Container",
140
- component: SingleValueContainer,
141
- decorators: [
142
- (SingleValueStory: any) => {
143
- return <SingleValueStory />;
144
- },
145
- ],
146
- };
@@ -1,24 +0,0 @@
1
- import {mount} from "@cypress/react";
2
- import React from "react";
3
- import {SingleValueContainer} from ".";
4
-
5
- describe("Single Value Container Tests", () => {
6
- it("should render", function () {
7
- const arg = {
8
- title: "PRIORITY INDICATORS",
9
- singleValueItems: [
10
- {
11
- label: "Total Bookings",
12
- value: 136,
13
- },
14
- {
15
- label: "At least one dose",
16
- value: 45,
17
- percentage: 23,
18
- color: "#0D47A1",
19
- },
20
- ],
21
- };
22
- mount(<SingleValueContainer {...arg} />);
23
- });
24
- });
@@ -1,46 +0,0 @@
1
- import {Tooltip} from "@dhis2/ui";
2
- import {capitalize} from "lodash";
3
- import React from "react";
4
- import {animated, useSpring} from "react-spring";
5
- import styles from "../../styles/SingleValueContainer.module.css";
6
- import {SingleValue} from "../../types/props";
7
- import SingleValuePercentage from "./SingleValuePercentage";
8
-
9
- interface SingleValueProps extends SingleValue {
10
- globalAnimationDelay?: number;
11
- globalAnimationDuration?: number;
12
- }
13
-
14
- export default function SingleValueItem({
15
- label,
16
- value,
17
- color,
18
- percentage,
19
- animationDuration,
20
- animationDelay,
21
- globalAnimationDelay,
22
- decimalPlaces,
23
- globalAnimationDuration,
24
- }: SingleValueProps): React.ReactElement {
25
- const numberFormatter = (value: number) => Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: decimalPlaces ?? 1 }).format(value);
26
-
27
- const sanitizedValue = useSpring({
28
- val: value,
29
- from: { val: 0 },
30
- config: { duration: animationDuration ?? globalAnimationDuration ?? 1000 },
31
- delay: animationDelay ?? globalAnimationDelay ?? 10,
32
- });
33
-
34
- const tooltipContent = `${label}: ${value}`;
35
- return (
36
- <div className={`${styles["single-value-item"]} text-center`}>
37
- <div className={styles["font-large"]}>{label}</div>
38
- <Tooltip content={capitalize(tooltipContent)}>
39
- <animated.div className={`${styles["font-bold"]} ${styles["font-xx-large"]} ${styles["padding-top"]}`}>
40
- {sanitizedValue.val.to((value) => numberFormatter(Math.floor(value)))}
41
- </animated.div>
42
- </Tooltip>
43
- {percentage ? <SingleValuePercentage color={color} percentage={percentage} /> : <span></span>}
44
- </div>
45
- );
46
- }
@@ -1,12 +0,0 @@
1
- import {LinearLoader} from "@dhis2/ui";
2
- import React from "react";
3
- import styles from "../../styles/SingleValueContainer.module.css";
4
-
5
- export default function SingleValuePercentage({ percentage, color }: any): React.ReactElement {
6
- const width = "100%";
7
- return (
8
- <div className="w-100">
9
- <LinearLoader className={styles["percent-value"]} width={width} amount={percentage} />
10
- </div>
11
- );
12
- }
@@ -1,30 +0,0 @@
1
- import i18n from "@dhis2/d2-i18n";
2
- import {CssReset} from "@dhis2/ui";
3
- import React, {Suspense} from "react";
4
- import SingleValueItem from "./components/SingleValueItem/SingleValueItem";
5
- import styles from "./styles/SingleValueContainer.module.css";
6
- import {SingleValue, SingleValueContainerProps} from "./types/props";
7
-
8
- export function SingleValueContainer({ title, singleValueItems, animationDuration, animationDelay }: SingleValueContainerProps): React.ReactElement {
9
- return (
10
- <div className="w-100 h-100">
11
- <CssReset />
12
- <Suspense fallback={<div>{i18n.t("Loading ...")}</div>}>
13
- <div>
14
- <span className={`${styles["font-x-large"]} ${styles["font-bold"]}`}>{title}</span>
15
- <div className={styles["single-value-list"]}>
16
- {singleValueItems.map((singleValueItem: SingleValue) => (
17
- <SingleValueItem
18
- key={`${singleValueItem.label}-${singleValueItem.value}`}
19
- {...singleValueItem}
20
- globalAnimationDuration={animationDuration}
21
- globalAnimationDelay={animationDelay}
22
- />
23
- ))}
24
- </div>
25
- </div>
26
- </Suspense>
27
- </div>
28
- );
29
- }
30
- export { SingleValueItem };
@@ -1,16 +0,0 @@
1
- export type SingleValueContainerProps = {
2
- title: string;
3
- singleValueItems: Array<SingleValue>;
4
- animationDuration?: number;
5
- animationDelay?: number;
6
- };
7
-
8
- export type SingleValue = {
9
- label: string;
10
- value: number;
11
- percentage?: number;
12
- decimalPlaces?: number;
13
- color?: string;
14
- animationDuration?: number;
15
- animationDelay?: number;
16
- };
@@ -1,24 +0,0 @@
1
- import {CustomDataProvider} from "@dhis2/app-runtime";
2
- import React from "react";
3
- import mapData from "../data/map.json";
4
-
5
- export default function MapDataProvider({ children }: { children: React.ReactNode }): React.ReactElement {
6
- return (
7
- <CustomDataProvider
8
- data={{
9
- ...mapData,
10
- geoFeatures: async (type, query) => {
11
- return mapData.geoFeatures;
12
- },
13
- analytics: async (type, query) => {
14
- if (query?.params?.skipData) {
15
- return mapData.analytics;
16
- } else {
17
- return mapData.analyticsWithData;
18
- }
19
- },
20
- }}>
21
- {children}
22
- </CustomDataProvider>
23
- );
24
- }
package/src/index.test.ts DELETED
@@ -1,7 +0,0 @@
1
- describe('Just a test', function () {
2
- test("", ()=>{
3
- expect(true).toBe(true)
4
- })
5
- });
6
-
7
-