@hisptz/dhis2-analytics 1.0.11 → 1.0.13

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 (239) hide show
  1. package/build/cjs/components/CustomPivotTable/CustomPivotTable.stories.js +69 -0
  2. package/build/cjs/components/CustomPivotTable/components/Table/index.js +16 -0
  3. package/build/cjs/components/CustomPivotTable/components/TableBody/TableBody.module.css +12 -0
  4. package/build/cjs/components/CustomPivotTable/components/TableBody/index.js +109 -0
  5. package/build/cjs/components/CustomPivotTable/components/TableHeaders/TableHeaders.module.css +10 -0
  6. package/build/cjs/components/CustomPivotTable/components/TableHeaders/index.js +89 -0
  7. package/build/cjs/components/CustomPivotTable/index.js +30 -0
  8. package/build/cjs/components/{PivotTable → CustomPivotTable}/interfaces/index.js +0 -0
  9. package/build/cjs/components/CustomPivotTable/services/engine.js +89 -0
  10. package/build/cjs/components/{PivotTable/components/PivotTableEngineContext.js → CustomPivotTable/state/engine.js} +11 -13
  11. package/build/cjs/dataProviders/map.js +1 -1
  12. package/build/cjs/index.js +4 -4
  13. package/build/cjs/locales/en/translations.json +0 -33
  14. package/build/es/components/CustomPivotTable/CustomPivotTable.stories.js +59 -0
  15. package/build/es/components/CustomPivotTable/components/Table/index.js +9 -0
  16. package/build/es/components/CustomPivotTable/components/TableBody/TableBody.module.css +12 -0
  17. package/build/es/components/CustomPivotTable/components/TableBody/index.js +100 -0
  18. package/build/es/components/CustomPivotTable/components/TableHeaders/TableHeaders.module.css +10 -0
  19. package/build/es/components/CustomPivotTable/components/TableHeaders/index.js +82 -0
  20. package/build/es/components/CustomPivotTable/index.js +22 -0
  21. package/build/es/components/{PivotTable → CustomPivotTable}/interfaces/index.js +0 -0
  22. package/build/es/components/CustomPivotTable/services/engine.js +82 -0
  23. package/build/es/components/CustomPivotTable/state/engine.js +14 -0
  24. package/build/es/dataProviders/map.js +1 -1
  25. package/build/es/index.js +1 -1
  26. package/build/es/locales/en/translations.json +0 -33
  27. package/build/types/{components → src/components}/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +0 -0
  28. package/build/types/{components → src/components}/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts +0 -0
  29. package/build/types/{components → src/components}/ChartAnalytics/components/DownloadMenu/index.d.ts +0 -0
  30. package/build/types/{components → src/components}/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts +0 -0
  31. package/build/types/{components → src/components}/ChartAnalytics/hooks/useChart.d.ts +0 -0
  32. package/build/types/{components → src/components}/ChartAnalytics/index.d.ts +0 -0
  33. package/build/types/{components → src/components}/ChartAnalytics/models/column.d.ts +0 -0
  34. package/build/types/{components → src/components}/ChartAnalytics/models/index.d.ts +0 -0
  35. package/build/types/{components → src/components}/ChartAnalytics/models/line.d.ts +0 -0
  36. package/build/types/{components → src/components}/ChartAnalytics/models/multi-series.d.ts +0 -0
  37. package/build/types/{components → src/components}/ChartAnalytics/models/pie.d.ts +0 -0
  38. package/build/types/{components → src/components}/ChartAnalytics/services/export.d.ts +0 -0
  39. package/build/types/{components → src/components}/ChartAnalytics/types/props.d.ts +0 -0
  40. package/build/types/{components → src/components}/ChartAnalytics/utils/chart.d.ts +0 -0
  41. package/build/types/{components → src/components}/CircularProgressDashboard/index.d.ts +0 -0
  42. package/build/types/{components → src/components}/CircularProgressDashboard/types/props.d.ts +0 -0
  43. package/build/types/src/components/CustomPivotTable/components/Table/index.d.ts +11 -0
  44. package/build/types/src/components/CustomPivotTable/components/TableBody/index.d.ts +2 -0
  45. package/build/types/src/components/CustomPivotTable/components/TableHeaders/index.d.ts +2 -0
  46. package/build/types/{components/PivotTable → src/components/CustomPivotTable}/index.d.ts +19 -5
  47. package/build/types/src/components/CustomPivotTable/interfaces/index.d.ts +1 -0
  48. package/build/types/src/components/CustomPivotTable/services/engine.d.ts +58 -0
  49. package/build/types/src/components/CustomPivotTable/state/engine.d.ts +7 -0
  50. package/build/types/{components → src/components}/Map/components/EarthEngineLayerConfiguration/index.d.ts +0 -0
  51. package/build/types/{components → src/components}/Map/components/MapArea/index.d.ts +0 -0
  52. package/build/types/{components → src/components}/Map/components/MapArea/interfaces/index.d.ts +0 -0
  53. package/build/types/{components → src/components}/Map/components/MapControls/components/CustomControl/index.d.ts +0 -0
  54. package/build/types/{components → src/components}/Map/components/MapControls/components/DownloadControl/index.d.ts +0 -0
  55. package/build/types/{components → src/components}/Map/components/MapControls/components/FullscreenControl/index.d.ts +0 -0
  56. package/build/types/{components → src/components}/Map/components/MapControls/index.d.ts +0 -0
  57. package/build/types/{components → src/components}/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +0 -0
  58. package/build/types/{components → src/components}/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +0 -0
  59. package/build/types/{components → src/components}/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +0 -0
  60. package/build/types/{components → src/components}/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +0 -0
  61. package/build/types/{components → src/components}/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +0 -0
  62. package/build/types/{components → src/components}/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +0 -0
  63. package/build/types/{components → src/components}/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +0 -0
  64. package/build/types/{components → src/components}/Map/components/MapLayer/components/GoogleEngineLayer/services/api.d.ts +0 -0
  65. package/build/types/{components → src/components}/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +0 -0
  66. package/build/types/{components → src/components}/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +0 -0
  67. package/build/types/{components → src/components}/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts +0 -0
  68. package/build/types/{components → src/components}/Map/components/MapLayer/components/LegendArea/index.d.ts +0 -0
  69. package/build/types/{components → src/components}/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts +0 -0
  70. package/build/types/{components → src/components}/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +0 -0
  71. package/build/types/{components → src/components}/Map/components/MapLayer/components/PointLayer/index.d.ts +0 -0
  72. package/build/types/{components → src/components}/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +0 -0
  73. package/build/types/{components → src/components}/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +0 -0
  74. package/build/types/{components → src/components}/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +0 -0
  75. package/build/types/{components → src/components}/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +0 -0
  76. package/build/types/{components → src/components}/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +0 -0
  77. package/build/types/{components → src/components}/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +0 -0
  78. package/build/types/{components → src/components}/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +0 -0
  79. package/build/types/{components → src/components}/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +0 -0
  80. package/build/types/{components → src/components}/Map/components/MapLayer/components/ThematicLayer/index.d.ts +0 -0
  81. package/build/types/{components → src/components}/Map/components/MapLayer/index.d.ts +0 -0
  82. package/build/types/{components → src/components}/Map/components/MapLayer/interfaces/index.d.ts +0 -0
  83. package/build/types/{components → src/components}/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts +0 -0
  84. package/build/types/{components → src/components}/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +0 -0
  85. package/build/types/{components → src/components}/Map/components/MapProvider/hooks/index.d.ts +0 -0
  86. package/build/types/{components → src/components}/Map/components/MapProvider/index.d.ts +0 -0
  87. package/build/types/{components → src/components}/Map/components/MapUpdater/index.d.ts +0 -0
  88. package/build/types/{components → src/components}/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +0 -0
  89. package/build/types/{components → src/components}/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts +0 -0
  90. package/build/types/{components → src/components}/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +0 -0
  91. package/build/types/{components → src/components}/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +0 -0
  92. package/build/types/{components → src/components}/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +0 -0
  93. package/build/types/{components → src/components}/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts +0 -0
  94. package/build/types/{components → src/components}/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts +0 -0
  95. package/build/types/{components → src/components}/Map/components/ThematicLayerConfiguration/index.d.ts +0 -0
  96. package/build/types/{components → src/components}/Map/constants/colors.d.ts +0 -0
  97. package/build/types/{components → src/components}/Map/constants/legendSet.d.ts +0 -0
  98. package/build/types/{components → src/components}/Map/hooks/map.d.ts +0 -0
  99. package/build/types/{components → src/components}/Map/index.d.ts +0 -0
  100. package/build/types/{components → src/components}/Map/interfaces/index.d.ts +0 -0
  101. package/build/types/{components → src/components}/Map/state/index.d.ts +0 -0
  102. package/build/types/{components → src/components}/Map/utils/colors.d.ts +0 -0
  103. package/build/types/{components → src/components}/Map/utils/helpers.d.ts +0 -0
  104. package/build/types/{components → src/components}/Map/utils/map.d.ts +0 -0
  105. package/build/types/{components → src/components}/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +0 -0
  106. package/build/types/{components → src/components}/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts +0 -0
  107. package/build/types/{components → src/components}/SingleValueContainer/index.d.ts +0 -0
  108. package/build/types/{components → src/components}/SingleValueContainer/types/props.d.ts +0 -0
  109. package/build/types/{dataProviders → src/dataProviders}/map.d.ts +0 -0
  110. package/build/types/{index.d.ts → src/index.d.ts} +1 -1
  111. package/package.json +4 -4
  112. package/build/cjs/components/PivotTable/PivotTable.stories.js +0 -277
  113. package/build/cjs/components/PivotTable/components/AssignedCategoriesIcon/index.js +0 -32
  114. package/build/cjs/components/PivotTable/components/PivotTable.js +0 -60
  115. package/build/cjs/components/PivotTable/components/PivotTableBody.js +0 -41
  116. package/build/cjs/components/PivotTable/components/PivotTableCell.js +0 -40
  117. package/build/cjs/components/PivotTable/components/PivotTableClippedAxis.js +0 -26
  118. package/build/cjs/components/PivotTable/components/PivotTableColumnHeaderCell.js +0 -71
  119. package/build/cjs/components/PivotTable/components/PivotTableColumnHeaders.js +0 -60
  120. package/build/cjs/components/PivotTable/components/PivotTableContainer.js +0 -33
  121. package/build/cjs/components/PivotTable/components/PivotTableDimensionLabelCell.js +0 -77
  122. package/build/cjs/components/PivotTable/components/PivotTableEmptyCell.js +0 -22
  123. package/build/cjs/components/PivotTable/components/PivotTableEmptyRow.js +0 -33
  124. package/build/cjs/components/PivotTable/components/PivotTableHead.js +0 -35
  125. package/build/cjs/components/PivotTable/components/PivotTableHeaderCell.js +0 -37
  126. package/build/cjs/components/PivotTable/components/PivotTableRow.js +0 -65
  127. package/build/cjs/components/PivotTable/components/PivotTableRowHeaderCell.js +0 -49
  128. package/build/cjs/components/PivotTable/components/PivotTableTitleRow.js +0 -52
  129. package/build/cjs/components/PivotTable/components/PivotTableTitleRows.js +0 -46
  130. package/build/cjs/components/PivotTable/components/PivotTableValueCell.js +0 -69
  131. package/build/cjs/components/PivotTable/constants/dataTypes.js +0 -129
  132. package/build/cjs/components/PivotTable/constants/pivotTable.js +0 -64
  133. package/build/cjs/components/PivotTable/constants/predefinedDimensions.js +0 -62
  134. package/build/cjs/components/PivotTable/constants/valueTypes.js +0 -55
  135. package/build/cjs/components/PivotTable/data/column-data.json +0 -210
  136. package/build/cjs/components/PivotTable/hooks/useParentSize.js +0 -41
  137. package/build/cjs/components/PivotTable/hooks/useScrollPosition.js +0 -38
  138. package/build/cjs/components/PivotTable/hooks/useSortableColumns.js +0 -34
  139. package/build/cjs/components/PivotTable/hooks/useTableClipping.js +0 -53
  140. package/build/cjs/components/PivotTable/index.js +0 -47
  141. package/build/cjs/components/PivotTable/services/adaptiveClippingController.js +0 -197
  142. package/build/cjs/components/PivotTable/services/engine.js +0 -901
  143. package/build/cjs/components/PivotTable/utils/getOuLevelAndGroupText.js +0 -71
  144. package/build/cjs/components/PivotTable/utils/index.js +0 -322
  145. package/build/cjs/components/PivotTable/utils/isColorBright.js +0 -29
  146. package/build/cjs/components/PivotTable/utils/layout/dimension.js +0 -61
  147. package/build/cjs/components/PivotTable/utils/layout/dimensionGetId.js +0 -12
  148. package/build/cjs/components/PivotTable/utils/layout/dimensionGetItems.js +0 -12
  149. package/build/cjs/components/PivotTable/utils/layout/dimensionIs.js +0 -9
  150. package/build/cjs/components/PivotTable/utils/layout/dimensionIsEmpty.js +0 -9
  151. package/build/cjs/components/PivotTable/utils/layout/dimensionIsValid.js +0 -25
  152. package/build/cjs/components/PivotTable/utils/legend.js +0 -40
  153. package/build/cjs/components/PivotTable/utils/ouIdHelper/index.js +0 -27
  154. package/build/cjs/data/map.json +0 -5984
  155. package/build/es/components/PivotTable/PivotTable.stories.js +0 -268
  156. package/build/es/components/PivotTable/components/AssignedCategoriesIcon/index.js +0 -24
  157. package/build/es/components/PivotTable/components/PivotTable.js +0 -51
  158. package/build/es/components/PivotTable/components/PivotTableBody.js +0 -33
  159. package/build/es/components/PivotTable/components/PivotTableCell.js +0 -32
  160. package/build/es/components/PivotTable/components/PivotTableClippedAxis.js +0 -18
  161. package/build/es/components/PivotTable/components/PivotTableColumnHeaderCell.js +0 -62
  162. package/build/es/components/PivotTable/components/PivotTableColumnHeaders.js +0 -52
  163. package/build/es/components/PivotTable/components/PivotTableContainer.js +0 -25
  164. package/build/es/components/PivotTable/components/PivotTableDimensionLabelCell.js +0 -68
  165. package/build/es/components/PivotTable/components/PivotTableEmptyCell.js +0 -14
  166. package/build/es/components/PivotTable/components/PivotTableEmptyRow.js +0 -25
  167. package/build/es/components/PivotTable/components/PivotTableEngineContext.js +0 -14
  168. package/build/es/components/PivotTable/components/PivotTableHead.js +0 -27
  169. package/build/es/components/PivotTable/components/PivotTableHeaderCell.js +0 -29
  170. package/build/es/components/PivotTable/components/PivotTableRow.js +0 -57
  171. package/build/es/components/PivotTable/components/PivotTableRowHeaderCell.js +0 -41
  172. package/build/es/components/PivotTable/components/PivotTableTitleRow.js +0 -42
  173. package/build/es/components/PivotTable/components/PivotTableTitleRows.js +0 -37
  174. package/build/es/components/PivotTable/components/PivotTableValueCell.js +0 -60
  175. package/build/es/components/PivotTable/constants/dataTypes.js +0 -98
  176. package/build/es/components/PivotTable/constants/pivotTable.js +0 -29
  177. package/build/es/components/PivotTable/constants/predefinedDimensions.js +0 -44
  178. package/build/es/components/PivotTable/constants/valueTypes.js +0 -27
  179. package/build/es/components/PivotTable/data/column-data.json +0 -210
  180. package/build/es/components/PivotTable/hooks/useParentSize.js +0 -33
  181. package/build/es/components/PivotTable/hooks/useScrollPosition.js +0 -30
  182. package/build/es/components/PivotTable/hooks/useSortableColumns.js +0 -27
  183. package/build/es/components/PivotTable/hooks/useTableClipping.js +0 -46
  184. package/build/es/components/PivotTable/index.js +0 -26
  185. package/build/es/components/PivotTable/services/adaptiveClippingController.js +0 -191
  186. package/build/es/components/PivotTable/services/engine.js +0 -894
  187. package/build/es/components/PivotTable/utils/getOuLevelAndGroupText.js +0 -63
  188. package/build/es/components/PivotTable/utils/index.js +0 -309
  189. package/build/es/components/PivotTable/utils/isColorBright.js +0 -22
  190. package/build/es/components/PivotTable/utils/layout/dimension.js +0 -48
  191. package/build/es/components/PivotTable/utils/layout/dimensionGetId.js +0 -5
  192. package/build/es/components/PivotTable/utils/layout/dimensionGetItems.js +0 -5
  193. package/build/es/components/PivotTable/utils/layout/dimensionIs.js +0 -2
  194. package/build/es/components/PivotTable/utils/layout/dimensionIsEmpty.js +0 -2
  195. package/build/es/components/PivotTable/utils/layout/dimensionIsValid.js +0 -18
  196. package/build/es/components/PivotTable/utils/legend.js +0 -27
  197. package/build/es/components/PivotTable/utils/ouIdHelper/index.js +0 -17
  198. package/build/es/data/map.json +0 -5984
  199. package/build/types/components/PivotTable/components/AssignedCategoriesIcon/index.d.ts +0 -3
  200. package/build/types/components/PivotTable/components/PivotTable.d.ts +0 -12
  201. package/build/types/components/PivotTable/components/PivotTableBody.d.ts +0 -7
  202. package/build/types/components/PivotTable/components/PivotTableCell.d.ts +0 -17
  203. package/build/types/components/PivotTable/components/PivotTableClippedAxis.d.ts +0 -7
  204. package/build/types/components/PivotTable/components/PivotTableColumnHeaderCell.d.ts +0 -13
  205. package/build/types/components/PivotTable/components/PivotTableColumnHeaders.d.ts +0 -11
  206. package/build/types/components/PivotTable/components/PivotTableContainer.d.ts +0 -8
  207. package/build/types/components/PivotTable/components/PivotTableDimensionLabelCell.d.ts +0 -13
  208. package/build/types/components/PivotTable/components/PivotTableEmptyCell.d.ts +0 -7
  209. package/build/types/components/PivotTable/components/PivotTableEmptyRow.d.ts +0 -5
  210. package/build/types/components/PivotTable/components/PivotTableEngineContext.d.ts +0 -8
  211. package/build/types/components/PivotTable/components/PivotTableHead.d.ts +0 -21
  212. package/build/types/components/PivotTable/components/PivotTableHeaderCell.d.ts +0 -22
  213. package/build/types/components/PivotTable/components/PivotTableRow.d.ts +0 -19
  214. package/build/types/components/PivotTable/components/PivotTableRowHeaderCell.d.ts +0 -8
  215. package/build/types/components/PivotTable/components/PivotTableTitleRow.d.ts +0 -21
  216. package/build/types/components/PivotTable/components/PivotTableTitleRows.d.ts +0 -12
  217. package/build/types/components/PivotTable/components/PivotTableValueCell.d.ts +0 -8
  218. package/build/types/components/PivotTable/constants/dataTypes.d.ts +0 -90
  219. package/build/types/components/PivotTable/constants/pivotTable.d.ts +0 -29
  220. package/build/types/components/PivotTable/constants/predefinedDimensions.d.ts +0 -80
  221. package/build/types/components/PivotTable/constants/valueTypes.d.ts +0 -22
  222. package/build/types/components/PivotTable/hooks/useParentSize.d.ts +0 -8
  223. package/build/types/components/PivotTable/hooks/useScrollPosition.d.ts +0 -5
  224. package/build/types/components/PivotTable/hooks/useSortableColumns.d.ts +0 -8
  225. package/build/types/components/PivotTable/hooks/useTableClipping.d.ts +0 -24
  226. package/build/types/components/PivotTable/interfaces/index.d.ts +0 -72
  227. package/build/types/components/PivotTable/services/adaptiveClippingController.d.ts +0 -44
  228. package/build/types/components/PivotTable/services/engine.d.ts +0 -252
  229. package/build/types/components/PivotTable/utils/getOuLevelAndGroupText.d.ts +0 -1
  230. package/build/types/components/PivotTable/utils/index.d.ts +0 -38
  231. package/build/types/components/PivotTable/utils/isColorBright.d.ts +0 -1
  232. package/build/types/components/PivotTable/utils/layout/dimension.d.ts +0 -35
  233. package/build/types/components/PivotTable/utils/layout/dimensionGetId.d.ts +0 -3
  234. package/build/types/components/PivotTable/utils/layout/dimensionGetItems.d.ts +0 -3
  235. package/build/types/components/PivotTable/utils/layout/dimensionIs.d.ts +0 -1
  236. package/build/types/components/PivotTable/utils/layout/dimensionIsEmpty.d.ts +0 -3
  237. package/build/types/components/PivotTable/utils/layout/dimensionIsValid.d.ts +0 -5
  238. package/build/types/components/PivotTable/utils/legend.d.ts +0 -11
  239. package/build/types/components/PivotTable/utils/ouIdHelper/index.d.ts +0 -10
@@ -1,210 +0,0 @@
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
- }
@@ -1,33 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import ResizeObserver from 'resize-observer-polyfill';
3
- const initialState = {
4
- width: 0,
5
- height: 0
6
- };
7
- export const useParentSize = function (elementRef, renderCounter) {
8
- let initialSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : initialState;
9
- const [size, setSize] = useState({
10
- width: initialSize.width || 0,
11
- height: initialSize.height || 0
12
- });
13
- useEffect(() => {
14
- const el = elementRef.current && elementRef.current.parentElement;
15
- if (!el) {
16
- return;
17
- }
18
- const onResize = () => {
19
- setSize({
20
- width: el.clientWidth,
21
- height: el.clientHeight
22
- });
23
- };
24
- onResize();
25
- if (renderCounter) {
26
- setSize(initialState);
27
- }
28
- const observer = new ResizeObserver(onResize);
29
- observer.observe(el);
30
- return () => observer.disconnect();
31
- }, [elementRef, renderCounter]);
32
- return size;
33
- };
@@ -1,30 +0,0 @@
1
- import debounce from 'lodash/debounce';
2
- import { useCallback, useEffect, useState } from 'react';
3
- export const useScrollPosition = function (containerRef) {
4
- let debounceWait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
5
- const [scrollPosition, setScrollPosition] = useState({
6
- x: 0,
7
- y: 0
8
- });
9
- const onScroll = useCallback(debounce(() => {
10
- if (!containerRef.current) {
11
- return;
12
- }
13
- const scroll = {
14
- x: containerRef.current.scrollLeft,
15
- y: containerRef.current.scrollTop
16
- };
17
- setScrollPosition(scroll);
18
- }, debounceWait), [containerRef, debounceWait]);
19
- useEffect(() => {
20
- const currentRef = containerRef.current;
21
- if (!currentRef) {
22
- return;
23
- }
24
- currentRef.addEventListener('scroll', onScroll);
25
- return () => {
26
- currentRef.removeEventListener('scroll', onScroll);
27
- };
28
- }, [containerRef, onScroll]);
29
- return scrollPosition;
30
- };
@@ -1,27 +0,0 @@
1
- import { useState } from 'react';
2
- import { SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING } from '../constants/pivotTable';
3
- export const useSortableColumns = engine => {
4
- const [sortBy, setSortBy] = useState(null);
5
- const onSortByColumn = column => {
6
- let order = SORT_ORDER_ASCENDING;
7
- if (sortBy && sortBy.column === column) {
8
- if (sortBy.order === SORT_ORDER_ASCENDING) {
9
- order = SORT_ORDER_DESCENDING;
10
- } else if (sortBy.order === SORT_ORDER_DESCENDING) {
11
- engine.clearSort();
12
- setSortBy(null);
13
- return;
14
- }
15
- }
16
- engine.sort(column, order);
17
- setSortBy({
18
- column,
19
- order
20
- }); // Force a re-render
21
- };
22
-
23
- return {
24
- sortBy,
25
- onSortByColumn
26
- };
27
- };
@@ -1,46 +0,0 @@
1
- import { useMemo } from 'react';
2
- import { clipPartitionedAxis } from '../utils';
3
- import { CLIPPED_AXIS_PARTITION_SIZE_PX } from '../constants/pivotTable';
4
- import { useScrollPosition } from './useScrollPosition.js';
5
- export const useTableClipping = _ref => {
6
- let {
7
- containerRef,
8
- width,
9
- height,
10
- engine
11
- } = _ref;
12
- const scrollPosition = useScrollPosition(containerRef);
13
- const lineHeight = engine.fontSize + engine.cellPadding * 2 + 2;
14
- const rows = useMemo(() => {
15
- const headerSize = engine.adaptiveClippingController.rows.headerSize + (engine.options.title ? lineHeight : 0) + (engine.options.subtitle ? lineHeight : 0);
16
- const viewportPosition = engine.options.fixColumnHeaders ? scrollPosition.y : Math.max(0, scrollPosition.y - headerSize);
17
- const viewportWidth = height - (engine.options.fixColumnHeaders ? engine.adaptiveClippingController.rows.headerSize : Math.max(headerSize - scrollPosition.y, 0));
18
- return clipPartitionedAxis({
19
- partitionSize: CLIPPED_AXIS_PARTITION_SIZE_PX,
20
- partitions: engine.adaptiveClippingController.rows.partitions,
21
- axisMap: engine.rowMap,
22
- widthMap: engine.adaptiveClippingController.rows.sizes,
23
- viewportWidth,
24
- viewportPosition,
25
- totalWidth: engine.adaptiveClippingController.rows.totalSize
26
- });
27
- }, [scrollPosition.y, height, lineHeight, engine.adaptiveClippingController.rows.headerSize, engine.adaptiveClippingController.rows.partitions, engine.adaptiveClippingController.rows.sizes, engine.adaptiveClippingController.rows.totalSize, engine.options.fixColumnHeaders, engine.rowMap, engine.options.title, engine.options.subtitle]);
28
- const columns = useMemo(() => {
29
- const viewportPosition = Math.max(0, engine.options.fixRowHeaders ? scrollPosition.x : scrollPosition.x - engine.adaptiveClippingController.columns.headerSize);
30
- const viewportWidth = width - (engine.options.fixRowHeaders ? engine.adaptiveClippingController.columns.headerSize : Math.max(engine.adaptiveClippingController.columns.headerSize - scrollPosition.x, 0));
31
- return clipPartitionedAxis({
32
- partitionSize: CLIPPED_AXIS_PARTITION_SIZE_PX,
33
- partitions: engine.adaptiveClippingController.columns.partitions,
34
- axisMap: engine.columnMap,
35
- widthMap: engine.adaptiveClippingController.columns.sizes,
36
- viewportWidth,
37
- viewportPosition,
38
- totalWidth: engine.adaptiveClippingController.columns.totalSize
39
- });
40
- }, [scrollPosition.x, width, engine.adaptiveClippingController.columns.headerSize, engine.adaptiveClippingController.columns.partitions, engine.adaptiveClippingController.columns.sizes, engine.adaptiveClippingController.columns.totalSize, engine.options.fixRowHeaders, engine.columnMap]);
41
- return {
42
- rows,
43
- columns,
44
- scrollPosition
45
- };
46
- };
@@ -1,26 +0,0 @@
1
- import React from "react";
2
- import { PivotTable } from "./components/PivotTable";
3
- export * from "./interfaces";
4
- export function CustomPivotTable(_ref) {
5
- var _config$options, _config$layout$column, _config$layout$rows$m, _config$layout$filter, _config$layout$filter2, _config$options2;
6
- let {
7
- analytics,
8
- config
9
- } = _ref;
10
- return /*#__PURE__*/React.createElement(PivotTable, {
11
- data: analytics,
12
- legendSets: (_config$options = config.options) === null || _config$options === void 0 ? void 0 : _config$options.legendSets,
13
- visualization: {
14
- columns: (_config$layout$column = config.layout.columns.map(column => ({
15
- dimension: column
16
- }))) !== null && _config$layout$column !== void 0 ? _config$layout$column : [],
17
- rows: (_config$layout$rows$m = config.layout.rows.map(column => ({
18
- dimension: column
19
- }))) !== null && _config$layout$rows$m !== void 0 ? _config$layout$rows$m : [],
20
- filter: (_config$layout$filter = (_config$layout$filter2 = config.layout.filter) === null || _config$layout$filter2 === void 0 ? void 0 : _config$layout$filter2.map(column => ({
21
- dimension: column
22
- }))) !== null && _config$layout$filter !== void 0 ? _config$layout$filter : [],
23
- ...((_config$options2 = config.options) !== null && _config$options2 !== void 0 ? _config$options2 : {})
24
- }
25
- });
26
- }
@@ -1,191 +0,0 @@
1
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
- // @ts-nocheck
5
- import { measureTextWithWrapping } from '../utils';
6
- import { CLIPPED_AXIS_PARTITION_SIZE_PX, CLIPPED_CELL_MIN_SIZE } from '../constants/pivotTable';
7
- export class AdaptiveClippingController {
8
- constructor(engine) {
9
- _defineProperty(this, "columns", {
10
- orientation: "column",
11
- sizes: [],
12
- headerSize: 0,
13
- partitions: [],
14
- totalSize: 0
15
- });
16
- _defineProperty(this, "rows", {
17
- orientation: "row",
18
- sizes: [],
19
- headerSize: 0,
20
- partitions: [],
21
- totalSize: 0
22
- });
23
- _defineProperty(this, "engine", void 0);
24
- this.engine = engine;
25
- this.reset();
26
- }
27
- addSize(_ref, _ref2) {
28
- let {
29
- row,
30
- column
31
- } = _ref;
32
- let {
33
- width,
34
- height
35
- } = _ref2;
36
- if (column >= 0) {
37
- const columnSize = this.columns.sizes[column] || {
38
- pre: 0,
39
- size: 0
40
- };
41
- columnSize.size = Math.max(columnSize.size, width);
42
- this.columns.sizes[column] = columnSize;
43
- } else {
44
- const index = this.engine.rowDepth + column;
45
- this.columns.headerSizes[index] = Math.max(this.columns.headerSizes[index] || 0, width);
46
- }
47
- if (row >= 0) {
48
- const rowSize = this.rows.sizes[row] || {
49
- pre: 0,
50
- size: 0
51
- };
52
- rowSize.size = Math.max(rowSize.size, height);
53
- this.rows.sizes[row] = rowSize;
54
- } else {
55
- const index = this.engine.columnDepth + row;
56
- this.rows.headerSizes[index] = Math.max(this.rows.headerSizes[index] || 0, height);
57
- }
58
- }
59
- add(_ref3, renderedValue) {
60
- let {
61
- row,
62
- column
63
- } = _ref3;
64
- this.addSize({
65
- row,
66
- column
67
- }, this.measureText(renderedValue));
68
- }
69
- measureText(renderedValue) {
70
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
71
- return measureTextWithWrapping(renderedValue, {
72
- fontSize: this.engine.fontSize,
73
- ...options
74
- });
75
- }
76
- getCellSize(contentSize) {
77
- return Math.ceil(contentSize) + this.engine.cellPadding * 2 + /*border*/2;
78
- }
79
- finalizeAxis(axis) {
80
- axis.headerSize = 0;
81
- const isColumn = axis.orientation === 'column';
82
- const map = isColumn ? this.engine.columnMap : this.engine.rowMap;
83
- const getHeader = index => isColumn ? this.engine.getRawColumnHeader(index) : this.engine.getRawRowHeader(index);
84
- map.forEach((index, mapIndex) => {
85
- var _axis$sizes$index2;
86
- const headerStack = getHeader(index);
87
- headerStack === null || headerStack === void 0 ? void 0 : headerStack.forEach((header, level) => {
88
- const label = this.engine.visualization.showHierarchy && header !== null && header !== void 0 && header.hierarchy ? header.hierarchy.join(' / ') : header === null || header === void 0 ? void 0 : header.name;
89
- if (label) {
90
- const isLeafHeader = level === headerStack.length - 1;
91
- if (isColumn) {
92
- var _axis$sizes$index;
93
- const headerSize = this.measureText(label, {
94
- maxWidth: isLeafHeader ? Math.max(CLIPPED_CELL_MIN_SIZE, ((_axis$sizes$index = axis.sizes[index]) === null || _axis$sizes$index === void 0 ? void 0 : _axis$sizes$index.size) || 0) : 0
95
- });
96
- this.addSize({
97
- row: -headerStack.length + level,
98
- column: index
99
- }, {
100
- height: headerSize.height,
101
- width: isLeafHeader ? headerSize.width + (this.engine.isSortable(mapIndex) ? this.engine.scrollIconBuffer : 0) : 0
102
- });
103
- } else {
104
- const headerSize = this.measureText(label, {});
105
- this.addSize({
106
- row: index,
107
- column: -headerStack.length + level
108
- }, {
109
- height: isLeafHeader ? headerSize.height : 0,
110
- width: headerSize.width
111
- });
112
- }
113
- }
114
- });
115
- axis.sizes[index] = {
116
- pre: 0,
117
- size: this.getCellSize((_axis$sizes$index2 = axis.sizes[index]) === null || _axis$sizes$index2 === void 0 ? void 0 : _axis$sizes$index2.size)
118
- };
119
- });
120
- this.populateAxisPartitions(axis);
121
- }
122
- populateAxisPartitions(axis) {
123
- axis.totalSize = 0;
124
- axis.partitions = [];
125
- let nextPartitionPx = 0;
126
- const isColumn = axis.orientation === 'column';
127
- const map = isColumn ? this.engine.columnMap : this.engine.rowMap;
128
- map.forEach((index, mapIndex) => {
129
- if (axis.totalSize >= nextPartitionPx) {
130
- axis.partitions.push(mapIndex);
131
- nextPartitionPx += CLIPPED_AXIS_PARTITION_SIZE_PX;
132
- }
133
- axis.sizes[index].pre = axis.totalSize;
134
- axis.totalSize += axis.sizes[index].size;
135
- });
136
- }
137
- resetRowPartitions() {
138
- this.populateAxisPartitions(this.rows);
139
- }
140
- finalize() {
141
- if (this.engine.visualization.showDimensionLabels) {
142
- var _this$engine$dimensio, _this$engine$dimensio2, _this$engine$dimensio3, _this$engine$dimensio4, _this$engine$dimensio5, _this$engine$dimensio6;
143
- const columnDimensionCount = (_this$engine$dimensio = (_this$engine$dimensio2 = this.engine.dimensionLookup) === null || _this$engine$dimensio2 === void 0 ? void 0 : _this$engine$dimensio2.columnHeaders.length) !== null && _this$engine$dimensio !== void 0 ? _this$engine$dimensio : 0;
144
- const rowDimensionCount = (_this$engine$dimensio3 = (_this$engine$dimensio4 = this.engine.dimensionLookup) === null || _this$engine$dimensio4 === void 0 ? void 0 : _this$engine$dimensio4.rowHeaders.length) !== null && _this$engine$dimensio3 !== void 0 ? _this$engine$dimensio3 : 0;
145
- (_this$engine$dimensio5 = this.engine.dimensionLookup) === null || _this$engine$dimensio5 === void 0 ? void 0 : (_this$engine$dimensio6 = _this$engine$dimensio5.columnHeaders) === null || _this$engine$dimensio6 === void 0 ? void 0 : _this$engine$dimensio6.forEach((_, columnLevel) => {
146
- var _this$engine$dimensio7, _this$engine$dimensio8;
147
- (_this$engine$dimensio7 = this.engine.dimensionLookup) === null || _this$engine$dimensio7 === void 0 ? void 0 : (_this$engine$dimensio8 = _this$engine$dimensio7.rowHeaders) === null || _this$engine$dimensio8 === void 0 ? void 0 : _this$engine$dimensio8.forEach((_, rowLevel) => {
148
- const label = this.engine.getDimensionLabel(rowLevel, columnLevel);
149
- if (label) {
150
- this.add({
151
- row: -rowDimensionCount + rowLevel,
152
- column: -columnDimensionCount + columnLevel
153
- }, label);
154
- }
155
- });
156
- });
157
- }
158
- this.finalizeAxis(this.columns);
159
- this.finalizeAxis(this.rows);
160
- this.columns.headerSize = 0;
161
- this.columns.headerSizes = this.columns.headerSizes.map(size => {
162
- const paddedSize = this.getCellSize(size);
163
- this.columns.headerSize += paddedSize;
164
- return paddedSize;
165
- });
166
- this.rows.headerSize = 0;
167
- this.rows.headerSizes = this.rows.headerSizes.map(size => {
168
- const paddedSize = this.getCellSize(size);
169
- this.rows.headerSize += paddedSize;
170
- return paddedSize;
171
- });
172
- }
173
- reset() {
174
- this.columns = {
175
- orientation: 'column',
176
- totalSize: 0,
177
- headerSize: 0,
178
- sizes: [],
179
- partitions: [],
180
- headerSizes: []
181
- };
182
- this.rows = {
183
- orientation: 'row',
184
- totalSize: 0,
185
- headerSize: 0,
186
- sizes: [],
187
- partitions: [],
188
- headerSizes: []
189
- };
190
- }
191
- }