@dhis2/analytics 23.8.4 → 23.8.7

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 (327) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/build/cjs/__demo__/FileMenu.stories.js +4 -2
  3. package/build/cjs/__demo__/Filter.stories.js +2 -2
  4. package/build/cjs/__demo__/FixedPeriodSelect.stories.js +2 -2
  5. package/build/cjs/__demo__/OpenFileDialog.stories.js +4 -2
  6. package/build/cjs/__demo__/OrgUnitDimension.stories.js +2 -2
  7. package/build/cjs/__demo__/PivotTable.stories.js +206 -153
  8. package/build/cjs/api/__tests__/dimensions.spec.js +2 -1
  9. package/build/cjs/api/analytics/Analytics.js +8 -7
  10. package/build/cjs/api/analytics/AnalyticsBase.js +58 -43
  11. package/build/cjs/api/analytics/AnalyticsRequest.js +2 -1
  12. package/build/cjs/api/analytics/AnalyticsRequestBase.js +22 -17
  13. package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +38 -19
  14. package/build/cjs/api/analytics/AnalyticsResponseHeader.js +7 -5
  15. package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +2 -1
  16. package/build/cjs/api/dimensions.js +150 -120
  17. package/build/cjs/api/organisationUnits.js +36 -24
  18. package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +22 -13
  19. package/build/cjs/components/AboutAOUnit/styles/AboutAOUnit.style.js +2 -2
  20. package/build/cjs/components/CachedDataQueryProvider.js +8 -7
  21. package/build/cjs/components/DataDimension/DataDimension.js +8 -6
  22. package/build/cjs/components/DataDimension/DataTypeSelector.js +6 -5
  23. package/build/cjs/components/DataDimension/DetailSelector.js +6 -5
  24. package/build/cjs/components/DataDimension/GroupSelector.js +12 -11
  25. package/build/cjs/components/DataDimension/ItemSelector.js +87 -73
  26. package/build/cjs/components/DataDimension/MetricSelector.js +6 -5
  27. package/build/cjs/components/DimensionMenu.js +14 -13
  28. package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +4 -4
  29. package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +4 -4
  30. package/build/cjs/components/DimensionsPanel/List/DimensionLabel.js +4 -4
  31. package/build/cjs/components/DimensionsPanel/List/DimensionList.js +4 -4
  32. package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +10 -7
  33. package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +14 -11
  34. package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -8
  35. package/build/cjs/components/DynamicDimension/ItemSelector.js +58 -44
  36. package/build/cjs/components/FileMenu/DeleteDialog.js +16 -12
  37. package/build/cjs/components/FileMenu/FileMenu.js +19 -18
  38. package/build/cjs/components/FileMenu/GetLinkDialog.js +6 -5
  39. package/build/cjs/components/FileMenu/RenameDialog.js +38 -25
  40. package/build/cjs/components/FileMenu/SaveAsDialog.js +21 -14
  41. package/build/cjs/components/FileMenu/utils.js +1 -1
  42. package/build/cjs/components/Filter/Filter.js +22 -19
  43. package/build/cjs/components/LegendKey/LegendKey.js +4 -3
  44. package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +26 -20
  45. package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +26 -23
  46. package/build/cjs/components/OpenFileDialog/DateField.js +4 -3
  47. package/build/cjs/components/OpenFileDialog/FileList.js +22 -19
  48. package/build/cjs/components/OpenFileDialog/NameFilter.js +21 -15
  49. package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +43 -35
  50. package/build/cjs/components/OpenFileDialog/PaginationControls.js +28 -22
  51. package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +37 -28
  52. package/build/cjs/components/OpenFileDialog/utils.js +1 -1
  53. package/build/cjs/components/Options/VisualizationOptions.js +46 -36
  54. package/build/cjs/components/Options/styles/VisualizationOptions.style.js +1 -1
  55. package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +50 -34
  56. package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +22 -15
  57. package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +19 -14
  58. package/build/cjs/components/PeriodDimension/PeriodDimension.js +8 -6
  59. package/build/cjs/components/PeriodDimension/PeriodTransfer.js +24 -19
  60. package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +30 -24
  61. package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +1 -1
  62. package/build/cjs/components/PeriodDimension/utils/index.js +6 -2
  63. package/build/cjs/components/PeriodDimension/utils/relativePeriods.js +1 -1
  64. package/build/cjs/components/PivotTable/PivotTable.js +10 -9
  65. package/build/cjs/components/PivotTable/PivotTableBody.js +29 -20
  66. package/build/cjs/components/PivotTable/PivotTableCell.js +9 -8
  67. package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +17 -14
  68. package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +8 -7
  69. package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +29 -22
  70. package/build/cjs/components/PivotTable/PivotTableContainer.js +6 -5
  71. package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +5 -4
  72. package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -2
  73. package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +5 -4
  74. package/build/cjs/components/PivotTable/PivotTableEngineContext.js +7 -6
  75. package/build/cjs/components/PivotTable/PivotTableHead.js +16 -13
  76. package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +9 -8
  77. package/build/cjs/components/PivotTable/PivotTableRow.js +27 -20
  78. package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +6 -5
  79. package/build/cjs/components/PivotTable/PivotTableSortIcon.js +5 -4
  80. package/build/cjs/components/PivotTable/PivotTableTitleRow.js +9 -8
  81. package/build/cjs/components/PivotTable/PivotTableTitleRows.js +5 -4
  82. package/build/cjs/components/PivotTable/PivotTableValueCell.js +8 -7
  83. package/build/cjs/components/PivotTable/styles/PivotTable.style.js +1 -1
  84. package/build/cjs/components/TransferOption.js +15 -13
  85. package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +28 -19
  86. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +25 -18
  87. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +9 -8
  88. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +17 -14
  89. package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +4 -3
  90. package/build/cjs/components/VisTypeIcon.js +6 -5
  91. package/build/cjs/index.js +464 -464
  92. package/build/cjs/locales/ar/translations.json +1 -1
  93. package/build/cjs/locales/ar_EG/translations.json +1 -1
  94. package/build/cjs/locales/ar_IQ/translations.json +1 -1
  95. package/build/cjs/locales/ckb/translations.json +1 -1
  96. package/build/cjs/locales/cs/translations.json +1 -1
  97. package/build/cjs/locales/da/translations.json +1 -1
  98. package/build/cjs/locales/en/translations.json +1 -1
  99. package/build/cjs/locales/es/translations.json +1 -1
  100. package/build/cjs/locales/fr/translations.json +1 -1
  101. package/build/cjs/locales/id/translations.json +1 -1
  102. package/build/cjs/locales/km/translations.json +1 -1
  103. package/build/cjs/locales/lo/translations.json +1 -1
  104. package/build/cjs/locales/my/translations.json +1 -1
  105. package/build/cjs/locales/nb/translations.json +1 -1
  106. package/build/cjs/locales/nl/translations.json +30 -30
  107. package/build/cjs/locales/prs/translations.json +1 -1
  108. package/build/cjs/locales/ps/translations.json +1 -1
  109. package/build/cjs/locales/pt/translations.json +1 -1
  110. package/build/cjs/locales/pt_BR/translations.json +1 -1
  111. package/build/cjs/locales/ru/translations.json +1 -1
  112. package/build/cjs/locales/sv/translations.json +1 -1
  113. package/build/cjs/locales/tet/translations.json +1 -1
  114. package/build/cjs/locales/tg/translations.json +1 -1
  115. package/build/cjs/locales/uk/translations.json +1 -1
  116. package/build/cjs/locales/ur/translations.json +1 -1
  117. package/build/cjs/locales/uz/translations.json +1 -1
  118. package/build/cjs/locales/uz_Latn/translations.json +1 -1
  119. package/build/cjs/locales/vi/translations.json +1 -1
  120. package/build/cjs/locales/zh/translations.json +1 -1
  121. package/build/cjs/locales/zh_CN/translations.json +1 -1
  122. package/build/cjs/modules/axis.js +1 -1
  123. package/build/cjs/modules/dataSets.js +1 -1
  124. package/build/cjs/modules/dataTypes.js +2 -2
  125. package/build/cjs/modules/dimensionSelectorHelper.js +1 -1
  126. package/build/cjs/modules/fontStyle.js +1 -1
  127. package/build/cjs/modules/layout/axis.js +1 -1
  128. package/build/cjs/modules/layout/dimension.js +1 -1
  129. package/build/cjs/modules/layout/dimensionCreate.js +3 -1
  130. package/build/cjs/modules/layout/dimensionIsValid.js +5 -3
  131. package/build/cjs/modules/layout/item.js +1 -1
  132. package/build/cjs/modules/layout/testResources.js +1 -1
  133. package/build/cjs/modules/layoutTypes.js +1 -1
  134. package/build/cjs/modules/layoutUiRules/index.js +20 -20
  135. package/build/cjs/modules/layoutUiRules/rules.js +1 -1
  136. package/build/cjs/modules/layoutUiRules/rulesHelper.js +2 -1
  137. package/build/cjs/modules/layoutUiRules/rulesUtils.js +1 -1
  138. package/build/cjs/modules/legends.js +1 -1
  139. package/build/cjs/modules/outliers/index.js +4 -2
  140. package/build/cjs/modules/outliers/iqr.js +8 -5
  141. package/build/cjs/modules/outliers/modZScore.js +15 -7
  142. package/build/cjs/modules/outliers/zScore.js +5 -4
  143. package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +17 -12
  144. package/build/cjs/modules/pivotTable/PivotTableEngine.js +57 -44
  145. package/build/cjs/modules/pivotTable/clipAxis.js +8 -7
  146. package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +10 -9
  147. package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +9 -8
  148. package/build/cjs/modules/pivotTable/measureText.js +10 -7
  149. package/build/cjs/modules/pivotTable/pivotTableConstants.js +1 -1
  150. package/build/cjs/modules/pivotTable/useParentSize.js +2 -1
  151. package/build/cjs/modules/pivotTable/useScrollPosition.js +2 -1
  152. package/build/cjs/modules/pivotTable/useTableClipping.js +7 -6
  153. package/build/cjs/modules/predefinedDimensions.js +2 -2
  154. package/build/cjs/modules/relativeItems/index.js +4 -1
  155. package/build/cjs/modules/valueTypes.js +1 -1
  156. package/build/cjs/modules/visTypes.js +1 -1
  157. package/build/cjs/visualizations/config/adapters/dhis_dhis/index.js +7 -6
  158. package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +9 -4
  159. package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +5 -2
  160. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +9 -5
  161. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -3
  162. package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +11 -9
  163. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +32 -28
  164. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +24 -20
  165. package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +9 -8
  166. package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
  167. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -1
  168. package/build/cjs/visualizations/config/generators/dhis/singleValue.js +28 -24
  169. package/build/cjs/visualizations/config/generators/highcharts/index.js +5 -1
  170. package/build/cjs/visualizations/config/index.js +13 -11
  171. package/build/cjs/visualizations/config/validators/dhis/index.js +4 -3
  172. package/build/cjs/visualizations/index.js +6 -2
  173. package/build/cjs/visualizations/store/adapters/dhis_dhis/index.js +7 -6
  174. package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +8 -7
  175. package/build/cjs/visualizations/store/index.js +18 -15
  176. package/build/cjs/visualizations/store/validators/dhis/index.js +7 -5
  177. package/build/cjs/visualizations/util/colors/colorSets.js +1 -1
  178. package/build/cjs/visualizations/util/colors/themes.js +1 -1
  179. package/build/cjs/visualizations/util/getFilterText.js +9 -6
  180. package/build/es/__demo__/FileMenu.stories.js +4 -2
  181. package/build/es/__demo__/OpenFileDialog.stories.js +4 -2
  182. package/build/es/__demo__/PivotTable.stories.js +204 -151
  183. package/build/es/api/__tests__/dimensions.spec.js +2 -1
  184. package/build/es/api/analytics/Analytics.js +8 -7
  185. package/build/es/api/analytics/AnalyticsBase.js +58 -43
  186. package/build/es/api/analytics/AnalyticsRequest.js +2 -1
  187. package/build/es/api/analytics/AnalyticsRequestBase.js +22 -17
  188. package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +38 -19
  189. package/build/es/api/analytics/AnalyticsResponseHeader.js +7 -5
  190. package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +2 -1
  191. package/build/es/api/dimensions.js +149 -119
  192. package/build/es/api/organisationUnits.js +35 -23
  193. package/build/es/components/AboutAOUnit/AboutAOUnit.js +20 -11
  194. package/build/es/components/AboutAOUnit/styles/AboutAOUnit.style.js +2 -2
  195. package/build/es/components/CachedDataQueryProvider.js +6 -5
  196. package/build/es/components/DataDimension/DataDimension.js +8 -6
  197. package/build/es/components/DataDimension/DataTypeSelector.js +6 -5
  198. package/build/es/components/DataDimension/DetailSelector.js +6 -5
  199. package/build/es/components/DataDimension/GroupSelector.js +10 -9
  200. package/build/es/components/DataDimension/ItemSelector.js +85 -71
  201. package/build/es/components/DataDimension/MetricSelector.js +6 -5
  202. package/build/es/components/DimensionMenu.js +14 -13
  203. package/build/es/components/DimensionsPanel/DimensionsPanel.js +2 -2
  204. package/build/es/components/DimensionsPanel/List/DimensionItem.js +2 -2
  205. package/build/es/components/DimensionsPanel/List/DimensionLabel.js +2 -2
  206. package/build/es/components/DimensionsPanel/List/DimensionList.js +2 -2
  207. package/build/es/components/DimensionsPanel/List/OptionsButton.js +10 -7
  208. package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +14 -11
  209. package/build/es/components/DynamicDimension/DynamicDimension.js +9 -8
  210. package/build/es/components/DynamicDimension/ItemSelector.js +56 -42
  211. package/build/es/components/FileMenu/DeleteDialog.js +14 -10
  212. package/build/es/components/FileMenu/FileMenu.js +17 -16
  213. package/build/es/components/FileMenu/GetLinkDialog.js +6 -5
  214. package/build/es/components/FileMenu/RenameDialog.js +36 -23
  215. package/build/es/components/FileMenu/SaveAsDialog.js +19 -12
  216. package/build/es/components/Filter/Filter.js +22 -19
  217. package/build/es/components/LegendKey/LegendKey.js +4 -3
  218. package/build/es/components/OpenFileDialog/CreatedByFilter.js +26 -20
  219. package/build/es/components/OpenFileDialog/CustomSelectOption.js +26 -23
  220. package/build/es/components/OpenFileDialog/DateField.js +4 -3
  221. package/build/es/components/OpenFileDialog/FileList.js +22 -19
  222. package/build/es/components/OpenFileDialog/NameFilter.js +21 -15
  223. package/build/es/components/OpenFileDialog/OpenFileDialog.js +41 -33
  224. package/build/es/components/OpenFileDialog/PaginationControls.js +28 -22
  225. package/build/es/components/OpenFileDialog/VisTypeFilter.js +37 -28
  226. package/build/es/components/Options/VisualizationOptions.js +43 -33
  227. package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +48 -32
  228. package/build/es/components/PeriodDimension/FixedPeriodFilter.js +22 -15
  229. package/build/es/components/PeriodDimension/FixedPeriodSelect.js +17 -12
  230. package/build/es/components/PeriodDimension/PeriodDimension.js +8 -6
  231. package/build/es/components/PeriodDimension/PeriodTransfer.js +22 -17
  232. package/build/es/components/PeriodDimension/RelativePeriodFilter.js +30 -24
  233. package/build/es/components/PeriodDimension/utils/index.js +5 -1
  234. package/build/es/components/PivotTable/PivotTable.js +8 -7
  235. package/build/es/components/PivotTable/PivotTableBody.js +29 -20
  236. package/build/es/components/PivotTable/PivotTableCell.js +9 -8
  237. package/build/es/components/PivotTable/PivotTableClippedAxis.js +17 -14
  238. package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +8 -7
  239. package/build/es/components/PivotTable/PivotTableColumnHeaders.js +29 -22
  240. package/build/es/components/PivotTable/PivotTableContainer.js +6 -5
  241. package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +5 -4
  242. package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -2
  243. package/build/es/components/PivotTable/PivotTableEmptyRow.js +5 -4
  244. package/build/es/components/PivotTable/PivotTableEngineContext.js +5 -4
  245. package/build/es/components/PivotTable/PivotTableHead.js +16 -13
  246. package/build/es/components/PivotTable/PivotTableHeaderCell.js +9 -8
  247. package/build/es/components/PivotTable/PivotTableRow.js +27 -20
  248. package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +6 -5
  249. package/build/es/components/PivotTable/PivotTableSortIcon.js +5 -4
  250. package/build/es/components/PivotTable/PivotTableTitleRow.js +7 -6
  251. package/build/es/components/PivotTable/PivotTableTitleRows.js +5 -4
  252. package/build/es/components/PivotTable/PivotTableValueCell.js +6 -5
  253. package/build/es/components/TransferOption.js +15 -13
  254. package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +28 -19
  255. package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +23 -16
  256. package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -6
  257. package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +17 -14
  258. package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +4 -3
  259. package/build/es/components/VisTypeIcon.js +6 -5
  260. package/build/es/locales/ar/translations.json +1 -1
  261. package/build/es/locales/ar_EG/translations.json +1 -1
  262. package/build/es/locales/ar_IQ/translations.json +1 -1
  263. package/build/es/locales/ckb/translations.json +1 -1
  264. package/build/es/locales/cs/translations.json +1 -1
  265. package/build/es/locales/da/translations.json +1 -1
  266. package/build/es/locales/en/translations.json +1 -1
  267. package/build/es/locales/es/translations.json +1 -1
  268. package/build/es/locales/fr/translations.json +1 -1
  269. package/build/es/locales/id/translations.json +1 -1
  270. package/build/es/locales/km/translations.json +1 -1
  271. package/build/es/locales/lo/translations.json +1 -1
  272. package/build/es/locales/my/translations.json +1 -1
  273. package/build/es/locales/nb/translations.json +1 -1
  274. package/build/es/locales/nl/translations.json +30 -30
  275. package/build/es/locales/prs/translations.json +1 -1
  276. package/build/es/locales/ps/translations.json +1 -1
  277. package/build/es/locales/pt/translations.json +1 -1
  278. package/build/es/locales/pt_BR/translations.json +1 -1
  279. package/build/es/locales/ru/translations.json +1 -1
  280. package/build/es/locales/sv/translations.json +1 -1
  281. package/build/es/locales/tet/translations.json +1 -1
  282. package/build/es/locales/tg/translations.json +1 -1
  283. package/build/es/locales/uk/translations.json +1 -1
  284. package/build/es/locales/ur/translations.json +1 -1
  285. package/build/es/locales/uz/translations.json +1 -1
  286. package/build/es/locales/uz_Latn/translations.json +1 -1
  287. package/build/es/locales/vi/translations.json +1 -1
  288. package/build/es/locales/zh/translations.json +1 -1
  289. package/build/es/locales/zh_CN/translations.json +1 -1
  290. package/build/es/modules/layout/dimensionCreate.js +3 -1
  291. package/build/es/modules/layout/dimensionIsValid.js +5 -3
  292. package/build/es/modules/outliers/index.js +3 -1
  293. package/build/es/modules/outliers/iqr.js +7 -4
  294. package/build/es/modules/outliers/modZScore.js +14 -6
  295. package/build/es/modules/outliers/zScore.js +4 -3
  296. package/build/es/modules/pivotTable/AdaptiveClippingController.js +17 -12
  297. package/build/es/modules/pivotTable/PivotTableEngine.js +57 -44
  298. package/build/es/modules/pivotTable/clipAxis.js +8 -7
  299. package/build/es/modules/pivotTable/clipPartitionedAxis.js +10 -9
  300. package/build/es/modules/pivotTable/getHeaderForDisplay.js +9 -8
  301. package/build/es/modules/pivotTable/measureText.js +10 -7
  302. package/build/es/modules/pivotTable/useParentSize.js +2 -1
  303. package/build/es/modules/pivotTable/useScrollPosition.js +2 -1
  304. package/build/es/modules/pivotTable/useTableClipping.js +7 -6
  305. package/build/es/modules/predefinedDimensions.js +1 -1
  306. package/build/es/modules/relativeItems/index.js +4 -1
  307. package/build/es/visualizations/config/adapters/dhis_dhis/index.js +6 -5
  308. package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +8 -3
  309. package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +4 -1
  310. package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +6 -2
  311. package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -3
  312. package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +9 -7
  313. package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +32 -28
  314. package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +23 -19
  315. package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +9 -8
  316. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -1
  317. package/build/es/visualizations/config/generators/dhis/singleValue.js +28 -24
  318. package/build/es/visualizations/config/generators/highcharts/index.js +5 -1
  319. package/build/es/visualizations/config/index.js +13 -11
  320. package/build/es/visualizations/config/validators/dhis/index.js +4 -3
  321. package/build/es/visualizations/index.js +5 -1
  322. package/build/es/visualizations/store/adapters/dhis_dhis/index.js +7 -6
  323. package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +8 -7
  324. package/build/es/visualizations/store/index.js +18 -15
  325. package/build/es/visualizations/store/validators/dhis/index.js +7 -5
  326. package/build/es/visualizations/util/getFilterText.js +9 -6
  327. package/package.json +11 -11
@@ -114,10 +114,11 @@ const buildDimensionLookup = (visualization, metadata, headers) => {
114
114
  };
115
115
  };
116
116
 
117
- const lookup = (dataRow, dimensionLookup, {
118
- doColumnSubtotals,
119
- doRowSubtotals
120
- }) => {
117
+ const lookup = (dataRow, dimensionLookup, _ref) => {
118
+ let {
119
+ doColumnSubtotals,
120
+ doRowSubtotals
121
+ } = _ref;
121
122
  let row = 0;
122
123
 
123
124
  for (const headerIndex of dimensionLookup.rowHeaders) {
@@ -158,14 +159,16 @@ const lookup = (dataRow, dimensionLookup, {
158
159
  };
159
160
  };
160
161
 
161
- const applyTotalAggregationType = ({
162
- totalAggregationType,
163
- value,
164
- numerator,
165
- denominator,
166
- multiplier,
167
- divisor
168
- }, overrideTotalAggregationType) => {
162
+ const applyTotalAggregationType = (_ref2, overrideTotalAggregationType) => {
163
+ let {
164
+ totalAggregationType,
165
+ value,
166
+ numerator,
167
+ denominator,
168
+ multiplier,
169
+ divisor
170
+ } = _ref2;
171
+
169
172
  switch (overrideTotalAggregationType || totalAggregationType) {
170
173
  case AGGREGATE_TYPE_NA:
171
174
  return 'N/A';
@@ -236,12 +239,13 @@ export class PivotTableEngine {
236
239
  this.buildMatrix();
237
240
  }
238
241
 
239
- getRaw({
240
- row,
241
- column
242
- }) {
242
+ getRaw(_ref3) {
243
243
  var _headers$find, _headers$find2;
244
244
 
245
+ let {
246
+ row,
247
+ column
248
+ } = _ref3;
245
249
  const cellType = this.getRawCellType({
246
250
  row,
247
251
  column
@@ -298,10 +302,11 @@ export class PivotTableEngine {
298
302
  };
299
303
  }
300
304
 
301
- get({
302
- row,
303
- column
304
- }) {
305
+ get(_ref4) {
306
+ let {
307
+ row,
308
+ column
309
+ } = _ref4;
305
310
  const mappedRow = this.rowMap[row],
306
311
  mappedColumn = this.columnMap[column];
307
312
 
@@ -315,10 +320,11 @@ export class PivotTableEngine {
315
320
  });
316
321
  }
317
322
 
318
- getRawCellType({
319
- row,
320
- column
321
- }) {
323
+ getRawCellType(_ref5) {
324
+ let {
325
+ row,
326
+ column
327
+ } = _ref5;
322
328
  const isRowTotal = this.doRowTotals && column === this.dataWidth - 1;
323
329
  const isColumnTotal = this.doColumnTotals && row === this.dataHeight - 1;
324
330
 
@@ -336,10 +342,11 @@ export class PivotTableEngine {
336
342
  return CELL_TYPE_VALUE;
337
343
  }
338
344
 
339
- getCellType({
340
- row,
341
- column
342
- }) {
345
+ getCellType(_ref6) {
346
+ let {
347
+ row,
348
+ column
349
+ } = _ref6;
343
350
  row = this.rowMap[row];
344
351
  column = this.columnMap[column];
345
352
  return this.getRawCellType({
@@ -377,20 +384,23 @@ export class PivotTableEngine {
377
384
  }
378
385
  }
379
386
 
380
- getCellDxDimension({
381
- row,
382
- column
383
- }) {
387
+ getCellDxDimension(_ref7) {
388
+ let {
389
+ row,
390
+ column
391
+ } = _ref7;
384
392
  return this.getRawCellDxDimension({
385
393
  row: this.rowMap[row],
386
394
  column: this.columnMap[column]
387
395
  });
388
396
  }
389
397
 
390
- getRawCellDxDimension({
391
- row,
392
- column
393
- }) {
398
+ getRawCellDxDimension(_ref8) {
399
+ let {
400
+ row,
401
+ column
402
+ } = _ref8;
403
+
394
404
  if (!this.data[row]) {
395
405
  return undefined;
396
406
  }
@@ -502,12 +512,13 @@ export class PivotTableEngine {
502
512
  return this.getRawRowHeader(this.rowMap[row]);
503
513
  }
504
514
 
505
- getDependantTotalCells({
506
- row,
507
- column
508
- }) {
515
+ getDependantTotalCells(_ref9) {
509
516
  var _this$dimensionLookup, _this$dimensionLookup2;
510
517
 
518
+ let {
519
+ row,
520
+ column
521
+ } = _ref9;
511
522
  const rowSubtotalSize = ((_this$dimensionLookup = this.dimensionLookup.columns[0]) === null || _this$dimensionLookup === void 0 ? void 0 : _this$dimensionLookup.size) + 1;
512
523
  const rowSubtotal = rowSubtotalSize && this.doRowSubtotals && {
513
524
  row,
@@ -723,10 +734,12 @@ export class PivotTableEngine {
723
734
  }
724
735
  }
725
736
 
726
- finalizeTotal({
727
- row,
728
- column
729
- }) {
737
+ finalizeTotal(_ref10) {
738
+ let {
739
+ row,
740
+ column
741
+ } = _ref10;
742
+
730
743
  if (!this.data[row]) {
731
744
  return;
732
745
  }
@@ -1,11 +1,12 @@
1
1
  import times from 'lodash/times';
2
- export const clipAxis = ({
3
- position,
4
- size,
5
- step,
6
- totalCount,
7
- headerCount
8
- }) => {
2
+ export const clipAxis = _ref => {
3
+ let {
4
+ position,
5
+ size,
6
+ step,
7
+ totalCount,
8
+ headerCount
9
+ } = _ref;
9
10
  // position: scroll Y position
10
11
  // size: height of table container
11
12
  // step: height of cell in px
@@ -1,12 +1,13 @@
1
- export const clipPartitionedAxis = ({
2
- partitionSize,
3
- partitions,
4
- axisMap,
5
- widthMap,
6
- viewportWidth,
7
- viewportPosition,
8
- totalWidth
9
- }) => {
1
+ export const clipPartitionedAxis = _ref => {
2
+ let {
3
+ partitionSize,
4
+ partitions,
5
+ axisMap,
6
+ widthMap,
7
+ viewportWidth,
8
+ viewportPosition,
9
+ totalWidth
10
+ } = _ref;
10
11
  const partition = Math.floor(viewportPosition / partitionSize);
11
12
 
12
13
  if (partitions[partition] === undefined) {
@@ -8,14 +8,15 @@ const headerStacksAreEqual = (a, b, limit) => {
8
8
  return true;
9
9
  };
10
10
 
11
- export const getHeaderForDisplay = ({
12
- start,
13
- count,
14
- index,
15
- dimensionLevel,
16
- getHeader,
17
- showHierarchy
18
- }) => {
11
+ export const getHeaderForDisplay = _ref => {
12
+ let {
13
+ start,
14
+ count,
15
+ index,
16
+ dimensionLevel,
17
+ getHeader,
18
+ showHierarchy
19
+ } = _ref;
19
20
  const header = getHeader(index);
20
21
  const showHeader = index === start || !headerStacksAreEqual(header, getHeader(index - 1), dimensionLevel);
21
22
 
@@ -11,18 +11,21 @@ const getContext = fontSize => {
11
11
  return ctx;
12
12
  };
13
13
 
14
- const measureText = (text, fontSize = 11) => {
14
+ const measureText = function (text) {
15
+ let fontSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 11;
15
16
  const ctx = getContext(fontSize);
16
17
  const textMetrics = ctx.measureText(text);
17
18
  return textMetrics.width;
18
19
  };
19
20
 
20
- export const measureTextWithWrapping = (text, {
21
- fontSize = 11,
22
- maxWidth = CLIPPED_CELL_MAX_SIZE,
23
- justifyBuffer = WRAPPED_TEXT_JUSTIFY_BUFFER,
24
- lineHeight = WRAPPED_TEXT_LINE_HEIGHT
25
- }) => {
21
+ export const measureTextWithWrapping = (text, _ref) => {
22
+ let {
23
+ fontSize = 11,
24
+ maxWidth = CLIPPED_CELL_MAX_SIZE,
25
+ justifyBuffer = WRAPPED_TEXT_JUSTIFY_BUFFER,
26
+ lineHeight = WRAPPED_TEXT_LINE_HEIGHT
27
+ } = _ref;
28
+
26
29
  if (!text) {
27
30
  return {
28
31
  width: 0,
@@ -4,7 +4,8 @@ const initialState = {
4
4
  width: 0,
5
5
  height: 0
6
6
  };
7
- export const useParentSize = (elementRef, renderCounter, initialSize = initialState) => {
7
+ export const useParentSize = function (elementRef, renderCounter) {
8
+ let initialSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : initialState;
8
9
  const [size, setSize] = useState({
9
10
  width: initialSize.width || 0,
10
11
  height: initialSize.height || 0
@@ -1,6 +1,7 @@
1
1
  import debounce from 'lodash/debounce';
2
2
  import { useState, useCallback, useEffect } from 'react';
3
- export const useScrollPosition = (containerRef, debounceWait = 10) => {
3
+ export const useScrollPosition = function (containerRef) {
4
+ let debounceWait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
4
5
  const [scrollPosition, setScrollPosition] = useState({
5
6
  x: 0,
6
7
  y: 0
@@ -2,12 +2,13 @@ import { useMemo } from 'react';
2
2
  import { clipPartitionedAxis } from './clipPartitionedAxis.js';
3
3
  import { CLIPPED_AXIS_PARTITION_SIZE_PX } from './pivotTableConstants.js';
4
4
  import { useScrollPosition } from './useScrollPosition.js';
5
- export const useTableClipping = ({
6
- containerRef,
7
- width,
8
- height,
9
- engine
10
- }) => {
5
+ export const useTableClipping = _ref => {
6
+ let {
7
+ containerRef,
8
+ width,
9
+ height,
10
+ engine
11
+ } = _ref;
11
12
  const scrollPosition = useScrollPosition(containerRef);
12
13
  const lineHeight = engine.fontSize + engine.cellPadding * 2 + 2;
13
14
  const rows = useMemo(() => {
@@ -21,7 +21,7 @@ export const getFixedDimensions = () => ({
21
21
  },
22
22
  [DIMENSION_ID_ORGUNIT]: {
23
23
  id: DIMENSION_ID_ORGUNIT,
24
- name: i18n.t('Organisation Unit'),
24
+ name: i18n.t('Organisation unit'),
25
25
  iconName: 'OrgUnitIcon',
26
26
  icon: IconDimensionOrgUnit16
27
27
  }
@@ -1,4 +1,7 @@
1
1
  import { getRelativePeriodIds } from '../../components/PeriodDimension/utils/relativePeriods.js';
2
2
  import { ouIdHelper, USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN } from '../ouIdHelper/index.js';
3
3
  import { DIMENSION_ID_ASSIGNED_CATEGORIES, DIMENSION_ID_ORGUNIT, DIMENSION_ID_PERIOD } from '../predefinedDimensions.js';
4
- export const hasRelativeItems = (dimension, itemIds = []) => dimension === DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => ouIdHelper.hasLevelPrefix(id) || ouIdHelper.hasGroupPrefix(id) || [USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN].includes(id)) || dimension === DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => getRelativePeriodIds().includes(id));
4
+ export const hasRelativeItems = function (dimension) {
5
+ let itemIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
6
+ return dimension === DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => ouIdHelper.hasLevelPrefix(id) || ouIdHelper.hasGroupPrefix(id) || [USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN].includes(id)) || dimension === DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => getRelativePeriodIds().includes(id));
7
+ };
@@ -2,11 +2,12 @@ import getSubtitle from './subtitle/index.js';
2
2
  import getTitle from './title/index.js';
3
3
  import getValue from './value/index.js';
4
4
  export const INDICATOR_FACTOR_100 = 100;
5
- export default function ({
6
- store,
7
- layout,
8
- extraOptions
9
- }) {
5
+ export default function (_ref) {
6
+ let {
7
+ store,
8
+ layout,
9
+ extraOptions
10
+ } = _ref;
10
11
  const data = store.generateData({
11
12
  type: layout.type,
12
13
  seriesId: layout.columns && layout.columns.length ? layout.columns[0].dimension : null,
@@ -212,7 +212,8 @@ function gaussianElimination(a, o) {
212
212
  // correlation = N * Σ(XY) - Σ(X) * Σ (Y) / √ ( N * Σ(X^2) - Σ(X) ) * ( N * Σ(Y^2) - Σ(Y)^2 ) ) )
213
213
 
214
214
 
215
- export function linear(data, decimalPlaces = 2) {
215
+ export function linear(data) {
216
+ let decimalPlaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
216
217
  const sum = [0, 0, 0, 0, 0],
217
218
  results = [];
218
219
  let N = data.length;
@@ -271,7 +272,10 @@ export function linear(data, decimalPlaces = 2) {
271
272
  };
272
273
  } // Code extracted from https://github.com/Tom-Alexander/regression-js/
273
274
 
274
- function polynomial(data, order = 2, extrapolate = 0, decimalPlaces = 2) {
275
+ function polynomial(data) {
276
+ let order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
277
+ let extrapolate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
278
+ let decimalPlaces = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;
275
279
  const lhs = [],
276
280
  rhs = [],
277
281
  results = [],
@@ -369,7 +373,8 @@ function polynomial(data, order = 2, extrapolate = 0, decimalPlaces = 2) {
369
373
  // - https://gist.github.com/avibryant/1151823
370
374
 
371
375
 
372
- function loess(data, bandwidth = 0.25) {
376
+ function loess(data) {
377
+ let bandwidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.25;
373
378
  const xval = data.map(pair => {
374
379
  return pair[0];
375
380
  });
@@ -79,9 +79,12 @@ export const getMaxValue = (maxValue, dataValues, outlierLineMax) => {
79
79
 
80
80
  return dataValues !== null && dataValues !== void 0 && dataValues.every(value => value < DEFAULT_MIN_VALUE) ? DEFAULT_MIN_VALUE : undefined;
81
81
  };
82
- export const getRegressionLine = (regressionLine = {}, visType, isVertical) => {
82
+ export const getRegressionLine = function () {
83
83
  var _regressionLine$title, _regressionLine$title2;
84
84
 
85
+ let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
86
+ let visType = arguments.length > 1 ? arguments[1] : undefined;
87
+ let isVertical = arguments.length > 2 ? arguments[2] : undefined;
85
88
  const fontStyle = mergeFontStyleWithDefault((_regressionLine$title = regressionLine.title) === null || _regressionLine$title === void 0 ? void 0 : _regressionLine$title.fontStyle, FONT_STYLE_REGRESSION_LINE_LABEL);
86
89
  const plotLineStyle = getPlotLineStyle(fontStyle);
87
90
  const plotLineLabelStyle = getPlotLineLabelStyle(fontStyle);
@@ -11,7 +11,9 @@ export function getIdAxisMap(customAxes) {
11
11
  return map;
12
12
  }, {});
13
13
  }
14
- export function getFullIdAxisMap(customAxes = [], series = []) {
14
+ export function getFullIdAxisMap() {
15
+ let customAxes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
16
+ let series = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
15
17
  const idAxisMap = getIdAxisMap(customAxes.filter(axisItem => series.find(seriesItem => seriesItem.id === axisItem.dimensionItem))); // adds first axis ids to seriesAxisMap
16
18
 
17
19
  series.forEach(s => {
@@ -28,7 +30,9 @@ export function getFullIdAxisMap(customAxes = [], series = []) {
28
30
 
29
31
  export function getAxisIdsMap(customAxes, series) {
30
32
  const fullIdAxisMap = getFullIdAxisMap(customAxes, series);
31
- return Object.entries(fullIdAxisMap).reduce((map, [id, axis]) => {
33
+ return Object.entries(fullIdAxisMap).reduce((map, _ref) => {
34
+ let [id, axis] = _ref;
35
+
32
36
  if (!(axis in map)) {
33
37
  map[axis] = [];
34
38
  }
@@ -16,9 +16,10 @@ function getEmptySeriesIndexes(series) {
16
16
  let seriesValues;
17
17
  series[0].data.forEach((value, index) => {
18
18
  seriesValues = [];
19
- series.forEach(({
20
- data
21
- }) => {
19
+ series.forEach(_ref => {
20
+ let {
21
+ data
22
+ } = _ref;
22
23
  // handle undefined values due to empty (or shorter) serie data
23
24
  // preserve 0 as valid value
24
25
  seriesValues.push(data[index] === undefined ? null : data[index]);
@@ -30,15 +30,17 @@ const getTransformedExtraOptions = extraOptions => ({ ...extraOptions,
30
30
  multiAxisTheme: extraOptions.multiAxisTheme || defaultMultiAxisTheme1
31
31
  });
32
32
 
33
- export default function ({
34
- store,
35
- layout,
36
- el,
37
- extraConfig,
38
- extraOptions
39
- }) {
33
+ export default function (_ref) {
40
34
  var _layout$seriesKey, _layout$seriesKey2, _layout$seriesKey2$la, _layout$legend, _config$xAxis;
41
35
 
36
+ let {
37
+ store,
38
+ layout,
39
+ el,
40
+ extraConfig,
41
+ extraOptions
42
+ } = _ref;
43
+
42
44
  const _layout = getTransformedLayout(layout);
43
45
 
44
46
  const _extraOptions = getTransformedExtraOptions(extraOptions);
@@ -33,11 +33,13 @@ function getLegend(fontStyle, dashboard, visType) {
33
33
  });
34
34
  }
35
35
 
36
- const getLegendSetByDisplayStrategy = ({
37
- displayStrategy,
38
- legendSets,
39
- legendSetId
40
- }) => {
36
+ const getLegendSetByDisplayStrategy = _ref => {
37
+ let {
38
+ displayStrategy,
39
+ legendSets,
40
+ legendSetId
41
+ } = _ref;
42
+
41
43
  if (displayStrategy === LEGEND_DISPLAY_STRATEGY_FIXED && legendSets.length) {
42
44
  return legendSets[0];
43
45
  } else if (displayStrategy === LEGEND_DISPLAY_STRATEGY_BY_DATA_ITEM) {
@@ -47,19 +49,20 @@ const getLegendSetByDisplayStrategy = ({
47
49
  }
48
50
  };
49
51
 
50
- const formatLabel = ({
51
- seriesId,
52
- seriesColor,
53
- seriesName,
54
- seriesType,
55
- metaData,
56
- displayStrategy,
57
- legendSets,
58
- fontStyle,
59
- visType
60
- }) => {
52
+ const formatLabel = _ref2 => {
61
53
  var _metaData$seriesId, _legendSet$legends;
62
54
 
55
+ let {
56
+ seriesId,
57
+ seriesColor,
58
+ seriesName,
59
+ seriesType,
60
+ metaData,
61
+ displayStrategy,
62
+ legendSets,
63
+ fontStyle,
64
+ visType
65
+ } = _ref2;
63
66
  const legendSet = getLegendSetByDisplayStrategy({
64
67
  displayStrategy,
65
68
  legendSets,
@@ -75,15 +78,15 @@ const formatLabel = ({
75
78
  result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
76
79
  } else if (legendSet !== null && legendSet !== void 0 && (_legendSet$legends = legendSet.legends) !== null && _legendSet$legends !== void 0 && _legendSet$legends.length && isLegendSetType(visType) && seriesType !== getType(VIS_TYPE_LINE).type) {
77
80
  // item with legend set
78
- legendSet.legends.sort((a, b) => a.startValue - b.startValue).forEach((legend, index) => result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" version=\"1.1\" style=\"margin-right:-5px; z-index: ").concat(legendSet.legends.length - index, "\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(legend.color, "\"></circle>\n </svg>")));
81
+ legendSet.legends.sort((a, b) => a.startValue - b.startValue).forEach((legend, index) => result.push("<svg width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" style=\"margin-right:-5px; z-index: ").concat(legendSet.legends.length - index, "\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(legend.color, "\"></circle>\n </svg>")));
79
82
  result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
80
83
  } else {
81
84
  // regular item (not a trendline, no applied legend set)
82
85
  if ((seriesColor === null || seriesColor === void 0 ? void 0 : seriesColor.patternIndex) !== undefined) {
83
86
  const pattern = colorSets[COLOR_SET_PATTERNS].patterns[seriesColor.patternIndex];
84
- result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"height: ".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; width: ").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; display: inline-block; margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <defs>\n <pattern id=\"pattern").concat(seriesColor.patternIndex, "\" patternUnits=\"userSpaceOnUse\" width=\"").concat(pattern.width, "\" height=\"").concat(pattern.height, "\">\n <path stroke=\"").concat(pattern.color, "\" d=\"").concat(pattern.path, "\"/>\n </pattern>\n </defs>\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"url(#pattern").concat(seriesColor.patternIndex, ")\"/>\n </svg>"));
87
+ result.push("<svg style=\"height: ".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; width: ").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; display: inline-block; margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <defs>\n <pattern id=\"pattern").concat(seriesColor.patternIndex, "\" patternUnits=\"userSpaceOnUse\" width=\"").concat(pattern.width, "\" height=\"").concat(pattern.height, "\">\n <path stroke=\"").concat(pattern.color, "\" d=\"").concat(pattern.path, "\"/>\n </pattern>\n </defs>\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"url(#pattern").concat(seriesColor.patternIndex, ")\"/>\n </svg>"));
85
88
  } else {
86
- result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" version=\"1.1\" style=\"margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(seriesColor, "\"></circle>\n </svg>"));
89
+ result.push("<svg width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" style=\"margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(seriesColor, "\"></circle>\n </svg>"));
87
90
  }
88
91
 
89
92
  result.push("<span class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
@@ -93,15 +96,16 @@ const formatLabel = ({
93
96
  return result.join('');
94
97
  };
95
98
 
96
- export default function ({
97
- isHidden,
98
- fontStyle,
99
- visType,
100
- dashboard,
101
- legendSets = [],
102
- metaData,
103
- displayStrategy
104
- }) {
99
+ export default function (_ref3) {
100
+ let {
101
+ isHidden,
102
+ fontStyle,
103
+ visType,
104
+ dashboard,
105
+ legendSets = [],
106
+ metaData,
107
+ displayStrategy
108
+ } = _ref3;
105
109
  const mergedFontStyle = mergeFontStyleWithDefault(fontStyle, FONT_STYLE_LEGEND);
106
110
  return isHidden || visType === VIS_TYPE_SCATTER ? {
107
111
  enabled: false
@@ -5,26 +5,30 @@ const OUT_OF_BOUNDS_COLOR = '#CCCCCC';
5
5
 
6
6
  const getLegend = (value, legendSet) => value && legendSet ? getLegendByValueFromLegendSet(legendSet, value) : {};
7
7
 
8
- export const applyLegendSet = (seriesObj = {}, legendSet) => !seriesObj.type ? { ...seriesObj,
9
- data: seriesObj.data.map(value => {
10
- var _getLegend, _getLegend2, _getLegend3, _getLegend4;
8
+ export const applyLegendSet = function () {
9
+ let seriesObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10
+ let legendSet = arguments.length > 1 ? arguments[1] : undefined;
11
+ return !seriesObj.type ? { ...seriesObj,
12
+ data: seriesObj.data.map(value => {
13
+ var _getLegend, _getLegend2, _getLegend3, _getLegend4;
11
14
 
12
- return isNumeric(value) // Single category pass data as [value1, value2]
13
- ? {
14
- y: value,
15
- color: ((_getLegend = getLegend(value, legendSet)) === null || _getLegend === void 0 ? void 0 : _getLegend.color) || OUT_OF_BOUNDS_COLOR,
16
- legend: ((_getLegend2 = getLegend(value, legendSet)) === null || _getLegend2 === void 0 ? void 0 : _getLegend2.name) || '-',
17
- legendSet: legendSet.name
18
- } : Array.isArray(value) // Dual category pass data as [[position1, value1], [position2, value2]]
19
- ? {
20
- x: value[0],
21
- y: value[1],
22
- color: ((_getLegend3 = getLegend(value[1], legendSet)) === null || _getLegend3 === void 0 ? void 0 : _getLegend3.color) || OUT_OF_BOUNDS_COLOR,
23
- legend: ((_getLegend4 = getLegend(value[1], legendSet)) === null || _getLegend4 === void 0 ? void 0 : _getLegend4.name) || '-',
24
- legendSet: legendSet.name
25
- } : value;
26
- })
27
- } : { ...seriesObj
15
+ return isNumeric(value) // Single category pass data as [value1, value2]
16
+ ? {
17
+ y: value,
18
+ color: ((_getLegend = getLegend(value, legendSet)) === null || _getLegend === void 0 ? void 0 : _getLegend.color) || OUT_OF_BOUNDS_COLOR,
19
+ legend: ((_getLegend2 = getLegend(value, legendSet)) === null || _getLegend2 === void 0 ? void 0 : _getLegend2.name) || '-',
20
+ legendSet: legendSet.name
21
+ } : Array.isArray(value) // Dual category pass data as [[position1, value1], [position2, value2]]
22
+ ? {
23
+ x: value[0],
24
+ y: value[1],
25
+ color: ((_getLegend3 = getLegend(value[1], legendSet)) === null || _getLegend3 === void 0 ? void 0 : _getLegend3.color) || OUT_OF_BOUNDS_COLOR,
26
+ legend: ((_getLegend4 = getLegend(value[1], legendSet)) === null || _getLegend4 === void 0 ? void 0 : _getLegend4.name) || '-',
27
+ legendSet: legendSet.name
28
+ } : value;
29
+ })
30
+ } : { ...seriesObj
31
+ };
28
32
  };
29
33
  export const getLegendSetTooltip = () => ({
30
34
  pointFormatter: function () {
@@ -1,14 +1,15 @@
1
1
  import i18n from '../../../../locales/index.js';
2
2
  import { VIS_TYPE_COLUMN, VIS_TYPE_SCATTER, VIS_TYPE_STACKED_COLUMN, VIS_TYPE_BAR, VIS_TYPE_STACKED_BAR } from '../../../../modules/visTypes.js';
3
3
  const MAX_LABELS = 10;
4
- export default (({
5
- visType,
6
- xAxisName,
7
- yAxisName,
8
- showLabels,
9
- tooltipData,
10
- onClick
11
- }) => {
4
+ export default (_ref => {
5
+ let {
6
+ visType,
7
+ xAxisName,
8
+ yAxisName,
9
+ showLabels,
10
+ tooltipData,
11
+ onClick
12
+ } = _ref;
12
13
  const series = {
13
14
  dataLabels: {
14
15
  enabled: showLabels,
@@ -27,9 +27,11 @@ const getLabelOffsetFromTextAlign = textAlign => {
27
27
  }
28
28
  };
29
29
 
30
- function getPlotLine(regressionLine = {}, defaultLabel) {
30
+ function getPlotLine() {
31
31
  var _regressionLine$title, _regressionLine$title2;
32
32
 
33
+ let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
34
+ let defaultLabel = arguments.length > 1 ? arguments[1] : undefined;
33
35
  const value = regressionLine.value;
34
36
 
35
37
  if (!isNumber(value)) {