@sis-cc/dotstatsuite-components 22.5.0 → 23.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/dist/_virtual/index.js +4 -5
  2. package/dist/_virtual/index.js.map +1 -1
  3. package/dist/_virtual/index2.js +4 -5
  4. package/dist/_virtual/index2.js.map +1 -1
  5. package/dist/_virtual/index3.js +4 -4
  6. package/dist/_virtual/index4.js +2 -6
  7. package/dist/_virtual/index4.js.map +1 -1
  8. package/dist/_virtual/index5.js +3 -5
  9. package/dist/_virtual/index5.js.map +1 -1
  10. package/dist/_virtual/index6.js +2 -6
  11. package/dist/_virtual/index6.js.map +1 -1
  12. package/dist/_virtual/index7.js +2 -6
  13. package/dist/_virtual/index7.js.map +1 -1
  14. package/dist/bridge-d3-react/src/index.js +1 -2
  15. package/dist/bridge-d3-react/src/index.js.map +1 -1
  16. package/dist/node_modules/@mui/styles/StylesProvider/StylesProvider.js +1 -1
  17. package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
  18. package/dist/node_modules/@mui/system/esm/responsivePropType.js +1 -1
  19. package/dist/node_modules/@mui/utils/esm/getDisplayName/getDisplayName.js +1 -1
  20. package/dist/node_modules/@mui/utils/node_modules/react-is/index.js +1 -1
  21. package/dist/node_modules/date-fns/esm/_lib/defaultOptions/index.js +7 -0
  22. package/dist/node_modules/date-fns/esm/_lib/defaultOptions/index.js.map +1 -0
  23. package/dist/node_modules/date-fns/esm/_lib/isSameUTCWeek/index.js +12 -0
  24. package/dist/node_modules/date-fns/esm/_lib/isSameUTCWeek/index.js.map +1 -0
  25. package/dist/node_modules/date-fns/esm/_lib/requiredArgs/index.js +8 -0
  26. package/dist/node_modules/date-fns/esm/_lib/requiredArgs/index.js.map +1 -0
  27. package/dist/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +25 -0
  28. package/dist/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js.map +1 -0
  29. package/dist/node_modules/date-fns/esm/_lib/toInteger/index.js +13 -0
  30. package/dist/node_modules/date-fns/esm/_lib/toInteger/index.js.map +1 -0
  31. package/dist/node_modules/date-fns/esm/getISOWeek/index.js +39 -0
  32. package/dist/node_modules/date-fns/esm/getISOWeek/index.js.map +1 -0
  33. package/dist/node_modules/date-fns/esm/getISOWeekYear/index.js +47 -0
  34. package/dist/node_modules/date-fns/esm/getISOWeekYear/index.js.map +1 -0
  35. package/dist/node_modules/date-fns/esm/getTime/index.js +29 -0
  36. package/dist/node_modules/date-fns/esm/getTime/index.js.map +1 -0
  37. package/dist/node_modules/date-fns/esm/isFriday/index.js +27 -0
  38. package/dist/node_modules/date-fns/esm/isFriday/index.js.map +1 -0
  39. package/dist/node_modules/date-fns/esm/isMonday/index.js +27 -0
  40. package/dist/node_modules/date-fns/esm/isMonday/index.js.map +1 -0
  41. package/dist/node_modules/date-fns/esm/isSaturday/index.js +27 -0
  42. package/dist/node_modules/date-fns/esm/isSaturday/index.js.map +1 -0
  43. package/dist/node_modules/date-fns/esm/isSunday/index.js +27 -0
  44. package/dist/node_modules/date-fns/esm/isSunday/index.js.map +1 -0
  45. package/dist/node_modules/date-fns/esm/isThursday/index.js +27 -0
  46. package/dist/node_modules/date-fns/esm/isThursday/index.js.map +1 -0
  47. package/dist/node_modules/date-fns/esm/isTuesday/index.js +27 -0
  48. package/dist/node_modules/date-fns/esm/isTuesday/index.js.map +1 -0
  49. package/dist/node_modules/date-fns/esm/isWednesday/index.js +27 -0
  50. package/dist/node_modules/date-fns/esm/isWednesday/index.js.map +1 -0
  51. package/dist/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js +12 -0
  52. package/dist/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js.map +1 -0
  53. package/dist/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js +21 -0
  54. package/dist/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js.map +1 -0
  55. package/dist/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js +45 -0
  56. package/dist/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js.map +1 -0
  57. package/dist/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js +20 -0
  58. package/dist/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js.map +1 -0
  59. package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatDistance/index.js +119 -0
  60. package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatDistance/index.js.map +1 -0
  61. package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatLong/index.js +37 -0
  62. package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatLong/index.js.map +1 -0
  63. package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatRelative/index.js +14 -0
  64. package/dist/node_modules/date-fns/esm/locale/ar/_lib/formatRelative/index.js.map +1 -0
  65. package/dist/node_modules/date-fns/esm/locale/ar/_lib/localize/index.js +121 -0
  66. package/dist/node_modules/date-fns/esm/locale/ar/_lib/localize/index.js.map +1 -0
  67. package/dist/node_modules/date-fns/esm/locale/ar/_lib/match/index.js +102 -0
  68. package/dist/node_modules/date-fns/esm/locale/ar/_lib/match/index.js.map +1 -0
  69. package/dist/node_modules/date-fns/esm/locale/ar/index.js +30 -0
  70. package/dist/node_modules/date-fns/esm/locale/ar/index.js.map +1 -0
  71. package/dist/node_modules/date-fns/esm/locale/de/_lib/formatDistance/index.js +178 -0
  72. package/dist/node_modules/date-fns/esm/locale/de/_lib/formatDistance/index.js.map +1 -0
  73. package/dist/node_modules/date-fns/esm/locale/de/_lib/formatLong/index.js +42 -0
  74. package/dist/node_modules/date-fns/esm/locale/de/_lib/formatLong/index.js.map +1 -0
  75. package/dist/node_modules/date-fns/esm/locale/de/_lib/formatRelative/index.js +14 -0
  76. package/dist/node_modules/date-fns/esm/locale/de/_lib/formatRelative/index.js.map +1 -0
  77. package/dist/node_modules/date-fns/esm/locale/de/_lib/localize/index.js +137 -0
  78. package/dist/node_modules/date-fns/esm/locale/de/_lib/localize/index.js.map +1 -0
  79. package/dist/node_modules/date-fns/esm/locale/de/_lib/match/index.js +103 -0
  80. package/dist/node_modules/date-fns/esm/locale/de/_lib/match/index.js.map +1 -0
  81. package/dist/node_modules/date-fns/esm/locale/de/index.js +33 -0
  82. package/dist/node_modules/date-fns/esm/locale/de/index.js.map +1 -0
  83. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js +85 -0
  84. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js.map +1 -0
  85. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js +37 -0
  86. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js.map +1 -0
  87. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js +14 -0
  88. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js.map +1 -0
  89. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js +146 -0
  90. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js.map +1 -0
  91. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js +101 -0
  92. package/dist/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js.map +1 -0
  93. package/dist/node_modules/date-fns/esm/locale/en-US/index.js +30 -0
  94. package/dist/node_modules/date-fns/esm/locale/en-US/index.js.map +1 -0
  95. package/dist/node_modules/date-fns/esm/locale/es/_lib/formatDistance/index.js +85 -0
  96. package/dist/node_modules/date-fns/esm/locale/es/_lib/formatDistance/index.js.map +1 -0
  97. package/dist/node_modules/date-fns/esm/locale/es/_lib/formatLong/index.js +37 -0
  98. package/dist/node_modules/date-fns/esm/locale/es/_lib/formatLong/index.js.map +1 -0
  99. package/dist/node_modules/date-fns/esm/locale/es/_lib/formatRelative/index.js +26 -0
  100. package/dist/node_modules/date-fns/esm/locale/es/_lib/formatRelative/index.js.map +1 -0
  101. package/dist/node_modules/date-fns/esm/locale/es/_lib/localize/index.js +122 -0
  102. package/dist/node_modules/date-fns/esm/locale/es/_lib/localize/index.js.map +1 -0
  103. package/dist/node_modules/date-fns/esm/locale/es/_lib/match/index.js +102 -0
  104. package/dist/node_modules/date-fns/esm/locale/es/_lib/match/index.js.map +1 -0
  105. package/dist/node_modules/date-fns/esm/locale/es/index.js +33 -0
  106. package/dist/node_modules/date-fns/esm/locale/es/index.js.map +1 -0
  107. package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatDistance/index.js +85 -0
  108. package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatDistance/index.js.map +1 -0
  109. package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatLong/index.js +37 -0
  110. package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatLong/index.js.map +1 -0
  111. package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatRelative/index.js +14 -0
  112. package/dist/node_modules/date-fns/esm/locale/fr/_lib/formatRelative/index.js.map +1 -0
  113. package/dist/node_modules/date-fns/esm/locale/fr/_lib/localize/index.js +97 -0
  114. package/dist/node_modules/date-fns/esm/locale/fr/_lib/localize/index.js.map +1 -0
  115. package/dist/node_modules/date-fns/esm/locale/fr/_lib/match/index.js +101 -0
  116. package/dist/node_modules/date-fns/esm/locale/fr/_lib/match/index.js.map +1 -0
  117. package/dist/node_modules/date-fns/esm/locale/fr/index.js +30 -0
  118. package/dist/node_modules/date-fns/esm/locale/fr/index.js.map +1 -0
  119. package/dist/node_modules/date-fns/esm/locale/it/_lib/formatDistance/index.js +85 -0
  120. package/dist/node_modules/date-fns/esm/locale/it/_lib/formatDistance/index.js.map +1 -0
  121. package/dist/node_modules/date-fns/esm/locale/it/_lib/formatLong/index.js +37 -0
  122. package/dist/node_modules/date-fns/esm/locale/it/_lib/formatLong/index.js.map +1 -0
  123. package/dist/node_modules/date-fns/esm/locale/it/_lib/formatRelative/index.js +54 -0
  124. package/dist/node_modules/date-fns/esm/locale/it/_lib/formatRelative/index.js.map +1 -0
  125. package/dist/node_modules/date-fns/esm/locale/it/_lib/localize/index.js +122 -0
  126. package/dist/node_modules/date-fns/esm/locale/it/_lib/localize/index.js.map +1 -0
  127. package/dist/node_modules/date-fns/esm/locale/it/_lib/match/index.js +101 -0
  128. package/dist/node_modules/date-fns/esm/locale/it/_lib/match/index.js.map +1 -0
  129. package/dist/node_modules/date-fns/esm/locale/it/index.js +31 -0
  130. package/dist/node_modules/date-fns/esm/locale/it/index.js.map +1 -0
  131. package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatDistance/index.js +85 -0
  132. package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatDistance/index.js.map +1 -0
  133. package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatLong/index.js +37 -0
  134. package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatLong/index.js.map +1 -0
  135. package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatRelative/index.js +14 -0
  136. package/dist/node_modules/date-fns/esm/locale/nl/_lib/formatRelative/index.js.map +1 -0
  137. package/dist/node_modules/date-fns/esm/locale/nl/_lib/localize/index.js +88 -0
  138. package/dist/node_modules/date-fns/esm/locale/nl/_lib/localize/index.js.map +1 -0
  139. package/dist/node_modules/date-fns/esm/locale/nl/_lib/match/index.js +100 -0
  140. package/dist/node_modules/date-fns/esm/locale/nl/_lib/match/index.js.map +1 -0
  141. package/dist/node_modules/date-fns/esm/locale/nl/index.js +34 -0
  142. package/dist/node_modules/date-fns/esm/locale/nl/index.js.map +1 -0
  143. package/dist/node_modules/date-fns/esm/locale/th/_lib/formatDistance/index.js +89 -0
  144. package/dist/node_modules/date-fns/esm/locale/th/_lib/formatDistance/index.js.map +1 -0
  145. package/dist/node_modules/date-fns/esm/locale/th/_lib/formatLong/index.js +37 -0
  146. package/dist/node_modules/date-fns/esm/locale/th/_lib/formatLong/index.js.map +1 -0
  147. package/dist/node_modules/date-fns/esm/locale/th/_lib/formatRelative/index.js +14 -0
  148. package/dist/node_modules/date-fns/esm/locale/th/_lib/formatRelative/index.js.map +1 -0
  149. package/dist/node_modules/date-fns/esm/locale/th/_lib/localize/index.js +121 -0
  150. package/dist/node_modules/date-fns/esm/locale/th/_lib/localize/index.js.map +1 -0
  151. package/dist/node_modules/date-fns/esm/locale/th/_lib/match/index.js +100 -0
  152. package/dist/node_modules/date-fns/esm/locale/th/_lib/match/index.js.map +1 -0
  153. package/dist/node_modules/date-fns/esm/locale/th/index.js +31 -0
  154. package/dist/node_modules/date-fns/esm/locale/th/index.js.map +1 -0
  155. package/dist/node_modules/date-fns/esm/startOfISOWeek/index.js +32 -0
  156. package/dist/node_modules/date-fns/esm/startOfISOWeek/index.js.map +1 -0
  157. package/dist/node_modules/date-fns/esm/startOfISOWeekYear/index.js +37 -0
  158. package/dist/node_modules/date-fns/esm/startOfISOWeekYear/index.js.map +1 -0
  159. package/dist/node_modules/date-fns/esm/startOfWeek/index.js +52 -0
  160. package/dist/node_modules/date-fns/esm/startOfWeek/index.js.map +1 -0
  161. package/dist/node_modules/date-fns/esm/toDate/index.js +56 -0
  162. package/dist/node_modules/date-fns/esm/toDate/index.js.map +1 -0
  163. package/dist/node_modules/prop-types/index.js +1 -1
  164. package/dist/node_modules/react-is/index.js +1 -1
  165. package/dist/rules/src/chart/getAxisOptions.js +22 -22
  166. package/dist/rules/src/chart/getAxisOptions.js.map +1 -1
  167. package/dist/rules/src/chart/getChartOptions.js +1 -1
  168. package/dist/rules/src/chart/getChartOptions.js.map +1 -1
  169. package/dist/rules/src/constants.js +1 -35
  170. package/dist/rules/src/constants.js.map +1 -1
  171. package/dist/rules/src/date.js +40 -40
  172. package/dist/rules/src/date.js.map +1 -1
  173. package/dist/rules/src/dimension-utils.js +26 -24
  174. package/dist/rules/src/dimension-utils.js.map +1 -1
  175. package/dist/rules/src/factories/choro-series.js +43 -32
  176. package/dist/rules/src/factories/choro-series.js.map +1 -1
  177. package/dist/rules/src/factories/focus.js +20 -0
  178. package/dist/rules/src/factories/focus.js.map +1 -0
  179. package/dist/rules/src/factories/getChartSeries.js +11 -0
  180. package/dist/rules/src/factories/getChartSeries.js.map +1 -0
  181. package/dist/rules/src/factories/sample-focus.js +14 -18
  182. package/dist/rules/src/factories/sample-focus.js.map +1 -1
  183. package/dist/rules/src/factories/sample-series.js +20 -20
  184. package/dist/rules/src/factories/sample-series.js.map +1 -1
  185. package/dist/rules/src/factories/scatter-focus.js +21 -35
  186. package/dist/rules/src/factories/scatter-focus.js.map +1 -1
  187. package/dist/rules/src/factories/scatter-series.js +5 -5
  188. package/dist/rules/src/factories/scatter-series.js.map +1 -1
  189. package/dist/rules/src/factories/series.js +48 -0
  190. package/dist/rules/src/factories/series.js.map +1 -0
  191. package/dist/rules/src/factories/stacked-series.js +6 -7
  192. package/dist/rules/src/factories/stacked-series.js.map +1 -1
  193. package/dist/rules/src/factories/symbol-series.js +39 -46
  194. package/dist/rules/src/factories/symbol-series.js.map +1 -1
  195. package/dist/rules/src/factories/timeline-focus.js +10 -14
  196. package/dist/rules/src/factories/timeline-focus.js.map +1 -1
  197. package/dist/rules/src/factories/timeline-series.js +37 -41
  198. package/dist/rules/src/factories/timeline-series.js.map +1 -1
  199. package/dist/rules/src/get-values-enhanced.js +8 -2
  200. package/dist/rules/src/get-values-enhanced.js.map +1 -1
  201. package/dist/rules/src/index.js +6 -371
  202. package/dist/rules/src/index.js.map +1 -1
  203. package/dist/rules/src/layout.js +4 -2
  204. package/dist/rules/src/layout.js.map +1 -1
  205. package/dist/rules/src/observation-formater.js +8 -14
  206. package/dist/rules/src/observation-formater.js.map +1 -1
  207. package/dist/rules/src/properties/focus.js +51 -3
  208. package/dist/rules/src/properties/focus.js.map +1 -1
  209. package/dist/rules/src/properties/getHeaderProps.js +2 -53
  210. package/dist/rules/src/properties/getHeaderProps.js.map +1 -1
  211. package/dist/rules/src/properties/index.js +3 -94
  212. package/dist/rules/src/properties/index.js.map +1 -1
  213. package/dist/rules/src/properties/linear.js +4 -4
  214. package/dist/rules/src/properties/linear.js.map +1 -1
  215. package/dist/rules/src/properties/scatter.js +4 -4
  216. package/dist/rules/src/properties/scatter.js.map +1 -1
  217. package/dist/rules/src/properties/stacked.js +5 -7
  218. package/dist/rules/src/properties/stacked.js.map +1 -1
  219. package/dist/rules/src/properties/symbol.js.map +1 -1
  220. package/dist/rules/src/properties/utils.js +11 -12
  221. package/dist/rules/src/properties/utils.js.map +1 -1
  222. package/dist/rules/src/sdmx-data/index.js +2 -27
  223. package/dist/rules/src/sdmx-data/index.js.map +1 -1
  224. package/dist/rules2/src/combinedValuesDisplay.js +2 -2
  225. package/dist/rules2/src/combinedValuesDisplay.js.map +1 -1
  226. package/dist/rules2/src/getAttributes.js +37 -0
  227. package/dist/rules2/src/getAttributes.js.map +1 -0
  228. package/dist/rules2/src/getDataflowTooltipAttributesIds.js +2 -2
  229. package/dist/rules2/src/getDataflowTooltipAttributesIds.js.map +1 -1
  230. package/dist/rules2/src/getHeaderCombinations.js +1 -1
  231. package/dist/rules2/src/getHeaderCombinations.js.map +1 -1
  232. package/dist/rules2/src/getHeaderSubtitle.js +1 -1
  233. package/dist/rules2/src/getHeaderSubtitle.js.map +1 -1
  234. package/dist/rules2/src/getHeaderTitle.js +1 -1
  235. package/dist/rules2/src/getHeaderTitle.js.map +1 -1
  236. package/dist/rules2/src/getMetadataCoordinates.js +1 -1
  237. package/dist/rules2/src/getMetadataCoordinates.js.map +1 -1
  238. package/dist/rules2/src/getNotDisplayedIds.js +1 -1
  239. package/dist/rules2/src/getNotDisplayedIds.js.map +1 -1
  240. package/dist/rules2/src/index.js +1 -0
  241. package/dist/rules2/src/index.js.map +1 -1
  242. package/dist/rules2/src/parseAttributes.js +2 -2
  243. package/dist/rules2/src/parseAttributes.js.map +1 -1
  244. package/dist/rules2/src/parseHierarchicalCodelist.js +1 -1
  245. package/dist/rules2/src/parseHierarchicalCodelist.js.map +1 -1
  246. package/dist/rules2/src/parseMetadataSeries.js +1 -1
  247. package/dist/rules2/src/parseMetadataSeries.js.map +1 -1
  248. package/dist/rules2/src/prepareData.js +10 -3
  249. package/dist/rules2/src/prepareData.js.map +1 -1
  250. package/dist/rules2/src/refineDimensions.js +53 -8
  251. package/dist/rules2/src/refineDimensions.js.map +1 -1
  252. package/dist/rules2/src/refineTimePeriod.js +12 -16
  253. package/dist/rules2/src/refineTimePeriod.js.map +1 -1
  254. package/dist/rules2/src/table/getCells.js +1 -1
  255. package/dist/rules2/src/table/getCells.js.map +1 -1
  256. package/dist/rules2/src/table/getLayout.js +1 -1
  257. package/dist/rules2/src/table/getLayout.js.map +1 -1
  258. package/dist/rules2/src/table/getTableLayoutIds.js +1 -1
  259. package/dist/rules2/src/table/getTableLayoutIds.js.map +1 -1
  260. package/dist/rules2/src/table/getTableProps.js +0 -1
  261. package/dist/rules2/src/table/getTableProps.js.map +1 -1
  262. package/dist/rules2/src/table/parseValueHierarchy.js.map +1 -1
  263. package/dist/rules2/src/table/refineLayoutSize2.js +1 -1
  264. package/dist/rules2/src/table/refineLayoutSize2.js.map +1 -1
  265. package/dist/rules2/src/utils.js.map +1 -1
  266. package/dist/viewer/src/chart.js +13 -2
  267. package/dist/viewer/src/chart.js.map +1 -1
  268. package/dist/viewer/src/legends/FocusLegend.js +1 -1
  269. package/dist/viewer/src/legends/FocusLegend.js.map +1 -1
  270. package/package.json +7 -6
  271. package/src/bridge-d3-react/src/index.js +0 -1
  272. package/src/rules/src/chart/getAxisOptions.js +33 -21
  273. package/src/rules/src/chart/getChartOptions.js +2 -2
  274. package/src/rules/src/constants.js +0 -35
  275. package/src/rules/src/date.js +6 -12
  276. package/src/rules/src/dimension-utils.js +25 -23
  277. package/src/rules/src/factories/choro-series.js +41 -30
  278. package/src/rules/src/factories/focus.js +17 -0
  279. package/src/rules/src/factories/getChartSeries.js +8 -0
  280. package/src/rules/src/factories/sample-focus.js +14 -18
  281. package/src/rules/src/factories/sample-series.js +20 -20
  282. package/src/rules/src/factories/scatter-focus.js +22 -36
  283. package/src/rules/src/factories/scatter-series.js +8 -8
  284. package/src/rules/src/factories/series.js +45 -0
  285. package/src/rules/src/factories/stacked-series.js +4 -5
  286. package/src/rules/src/factories/symbol-series.js +37 -44
  287. package/src/rules/src/factories/timeline-focus.js +10 -14
  288. package/src/rules/src/factories/timeline-series.js +35 -39
  289. package/src/rules/src/get-values-enhanced.js +8 -2
  290. package/src/rules/src/index.js +7 -384
  291. package/src/rules/src/layout.js +4 -2
  292. package/src/rules/src/observation-formater.js +14 -20
  293. package/src/rules/src/properties/focus.js +50 -2
  294. package/src/rules/src/properties/getHeaderProps.js +1 -53
  295. package/src/rules/src/properties/index.js +2 -93
  296. package/src/rules/src/properties/linear.js +2 -2
  297. package/src/rules/src/properties/scatter.js +4 -4
  298. package/src/rules/src/properties/stacked.js +4 -6
  299. package/src/rules/src/properties/symbol.js +0 -1
  300. package/src/rules/src/properties/utils.js +11 -22
  301. package/src/rules/src/sdmx-data/index.js +2 -31
  302. package/src/rules2/src/combinedValuesDisplay.js +2 -2
  303. package/src/rules2/src/getAttributes.js +34 -0
  304. package/src/rules2/src/getDataflowTooltipAttributesIds.js +2 -2
  305. package/src/rules2/src/getHeaderCombinations.js +1 -1
  306. package/src/rules2/src/getHeaderSubtitle.js +2 -2
  307. package/src/rules2/src/getHeaderTitle.js +1 -1
  308. package/src/rules2/src/getMetadataCoordinates.js +1 -1
  309. package/src/rules2/src/getNotDisplayedIds.js +1 -1
  310. package/src/rules2/src/index.js +1 -0
  311. package/src/rules2/src/parseAttributes.js +2 -2
  312. package/src/rules2/src/parseHierarchicalCodelist.js +1 -1
  313. package/src/rules2/src/parseMetadataSeries.js +1 -1
  314. package/src/rules2/src/prepareData.js +10 -3
  315. package/src/rules2/src/refineDimensions.js +53 -8
  316. package/src/rules2/src/refineTimePeriod.js +12 -16
  317. package/src/rules2/src/table/getCells.js +2 -2
  318. package/src/rules2/src/table/getLayout.js +2 -2
  319. package/src/rules2/src/table/getTableLayoutIds.js +9 -9
  320. package/src/rules2/src/table/getTableProps.js +0 -1
  321. package/src/rules2/src/table/parseValueHierarchy.js +0 -7
  322. package/src/rules2/src/table/refineLayoutSize2.js +5 -5
  323. package/src/rules2/src/utils.js +0 -11
  324. package/src/viewer/src/app/leg.js +0 -1
  325. package/src/viewer/src/chart.jsx +23 -1
  326. package/src/viewer/src/legends/FocusLegend.jsx +1 -1
  327. package/dist/_virtual/index10.js +0 -8
  328. package/dist/_virtual/index10.js.map +0 -1
  329. package/dist/_virtual/index11.js +0 -8
  330. package/dist/_virtual/index11.js.map +0 -1
  331. package/dist/_virtual/index12.js +0 -8
  332. package/dist/_virtual/index12.js.map +0 -1
  333. package/dist/_virtual/index13.js +0 -8
  334. package/dist/_virtual/index13.js.map +0 -1
  335. package/dist/_virtual/index14.js +0 -8
  336. package/dist/_virtual/index14.js.map +0 -1
  337. package/dist/_virtual/index15.js +0 -8
  338. package/dist/_virtual/index15.js.map +0 -1
  339. package/dist/_virtual/index16.js +0 -8
  340. package/dist/_virtual/index16.js.map +0 -1
  341. package/dist/_virtual/index17.js +0 -7
  342. package/dist/_virtual/index17.js.map +0 -1
  343. package/dist/_virtual/index18.js +0 -7
  344. package/dist/_virtual/index18.js.map +0 -1
  345. package/dist/_virtual/index19.js +0 -8
  346. package/dist/_virtual/index19.js.map +0 -1
  347. package/dist/_virtual/index20.js +0 -4
  348. package/dist/_virtual/index20.js.map +0 -1
  349. package/dist/_virtual/index21.js +0 -6
  350. package/dist/_virtual/index21.js.map +0 -1
  351. package/dist/_virtual/index22.js +0 -4
  352. package/dist/_virtual/index22.js.map +0 -1
  353. package/dist/_virtual/index23.js +0 -4
  354. package/dist/_virtual/index23.js.map +0 -1
  355. package/dist/_virtual/index8.js +0 -8
  356. package/dist/_virtual/index8.js.map +0 -1
  357. package/dist/_virtual/index9.js +0 -8
  358. package/dist/_virtual/index9.js.map +0 -1
  359. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js +0 -32
  360. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js.map +0 -1
  361. package/dist/node_modules/date-fns/get_iso_week/index.js +0 -49
  362. package/dist/node_modules/date-fns/get_iso_week/index.js.map +0 -1
  363. package/dist/node_modules/date-fns/get_iso_year/index.js +0 -59
  364. package/dist/node_modules/date-fns/get_iso_year/index.js.map +0 -1
  365. package/dist/node_modules/date-fns/is_date/index.js +0 -32
  366. package/dist/node_modules/date-fns/is_date/index.js.map +0 -1
  367. package/dist/node_modules/date-fns/is_friday/index.js +0 -35
  368. package/dist/node_modules/date-fns/is_friday/index.js.map +0 -1
  369. package/dist/node_modules/date-fns/is_monday/index.js +0 -35
  370. package/dist/node_modules/date-fns/is_monday/index.js.map +0 -1
  371. package/dist/node_modules/date-fns/is_saturday/index.js +0 -35
  372. package/dist/node_modules/date-fns/is_saturday/index.js.map +0 -1
  373. package/dist/node_modules/date-fns/is_sunday/index.js +0 -35
  374. package/dist/node_modules/date-fns/is_sunday/index.js.map +0 -1
  375. package/dist/node_modules/date-fns/is_thursday/index.js +0 -35
  376. package/dist/node_modules/date-fns/is_thursday/index.js.map +0 -1
  377. package/dist/node_modules/date-fns/is_tuesday/index.js +0 -35
  378. package/dist/node_modules/date-fns/is_tuesday/index.js.map +0 -1
  379. package/dist/node_modules/date-fns/is_wednesday/index.js +0 -35
  380. package/dist/node_modules/date-fns/is_wednesday/index.js.map +0 -1
  381. package/dist/node_modules/date-fns/locale/_lib/build_formatting_tokens_reg_exp/index.js +0 -39
  382. package/dist/node_modules/date-fns/locale/_lib/build_formatting_tokens_reg_exp/index.js.map +0 -1
  383. package/dist/node_modules/date-fns/locale/ar/build_distance_in_words_locale/index.js +0 -110
  384. package/dist/node_modules/date-fns/locale/ar/build_distance_in_words_locale/index.js.map +0 -1
  385. package/dist/node_modules/date-fns/locale/ar/build_format_locale/index.js +0 -86
  386. package/dist/node_modules/date-fns/locale/ar/build_format_locale/index.js.map +0 -1
  387. package/dist/node_modules/date-fns/locale/ar/index.js +0 -26
  388. package/dist/node_modules/date-fns/locale/ar/index.js.map +0 -1
  389. package/dist/node_modules/date-fns/locale/de/build_distance_in_words_locale/index.js +0 -196
  390. package/dist/node_modules/date-fns/locale/de/build_distance_in_words_locale/index.js.map +0 -1
  391. package/dist/node_modules/date-fns/locale/de/build_format_locale/index.js +0 -90
  392. package/dist/node_modules/date-fns/locale/de/build_format_locale/index.js.map +0 -1
  393. package/dist/node_modules/date-fns/locale/de/index.js +0 -27
  394. package/dist/node_modules/date-fns/locale/de/index.js.map +0 -1
  395. package/dist/node_modules/date-fns/locale/en/build_distance_in_words_locale/index.js +0 -110
  396. package/dist/node_modules/date-fns/locale/en/build_distance_in_words_locale/index.js.map +0 -1
  397. package/dist/node_modules/date-fns/locale/en/build_format_locale/index.js +0 -101
  398. package/dist/node_modules/date-fns/locale/en/build_format_locale/index.js.map +0 -1
  399. package/dist/node_modules/date-fns/locale/en/index.js +0 -25
  400. package/dist/node_modules/date-fns/locale/en/index.js.map +0 -1
  401. package/dist/node_modules/date-fns/locale/es/build_distance_in_words_locale/index.js +0 -110
  402. package/dist/node_modules/date-fns/locale/es/build_distance_in_words_locale/index.js.map +0 -1
  403. package/dist/node_modules/date-fns/locale/es/build_format_locale/index.js +0 -86
  404. package/dist/node_modules/date-fns/locale/es/build_format_locale/index.js.map +0 -1
  405. package/dist/node_modules/date-fns/locale/es/index.js +0 -28
  406. package/dist/node_modules/date-fns/locale/es/index.js.map +0 -1
  407. package/dist/node_modules/date-fns/locale/fr/build_distance_in_words_locale/index.js +0 -110
  408. package/dist/node_modules/date-fns/locale/fr/build_distance_in_words_locale/index.js.map +0 -1
  409. package/dist/node_modules/date-fns/locale/fr/build_format_locale/index.js +0 -135
  410. package/dist/node_modules/date-fns/locale/fr/build_format_locale/index.js.map +0 -1
  411. package/dist/node_modules/date-fns/locale/fr/index.js +0 -27
  412. package/dist/node_modules/date-fns/locale/fr/index.js.map +0 -1
  413. package/dist/node_modules/date-fns/locale/it/build_distance_in_words_locale/index.js +0 -110
  414. package/dist/node_modules/date-fns/locale/it/build_distance_in_words_locale/index.js.map +0 -1
  415. package/dist/node_modules/date-fns/locale/it/build_format_locale/index.js +0 -86
  416. package/dist/node_modules/date-fns/locale/it/build_format_locale/index.js.map +0 -1
  417. package/dist/node_modules/date-fns/locale/it/index.js +0 -26
  418. package/dist/node_modules/date-fns/locale/it/index.js.map +0 -1
  419. package/dist/node_modules/date-fns/locale/nl/build_distance_in_words_locale/index.js +0 -110
  420. package/dist/node_modules/date-fns/locale/nl/build_distance_in_words_locale/index.js.map +0 -1
  421. package/dist/node_modules/date-fns/locale/nl/build_format_locale/index.js +0 -86
  422. package/dist/node_modules/date-fns/locale/nl/build_format_locale/index.js.map +0 -1
  423. package/dist/node_modules/date-fns/locale/nl/index.js +0 -27
  424. package/dist/node_modules/date-fns/locale/nl/index.js.map +0 -1
  425. package/dist/node_modules/date-fns/locale/th/build_distance_in_words_locale/index.js +0 -114
  426. package/dist/node_modules/date-fns/locale/th/build_distance_in_words_locale/index.js.map +0 -1
  427. package/dist/node_modules/date-fns/locale/th/build_format_locale/index.js +0 -74
  428. package/dist/node_modules/date-fns/locale/th/build_format_locale/index.js.map +0 -1
  429. package/dist/node_modules/date-fns/locale/th/index.js +0 -26
  430. package/dist/node_modules/date-fns/locale/th/index.js.map +0 -1
  431. package/dist/node_modules/date-fns/parse/index.js +0 -346
  432. package/dist/node_modules/date-fns/parse/index.js.map +0 -1
  433. package/dist/node_modules/date-fns/start_of_iso_week/index.js +0 -38
  434. package/dist/node_modules/date-fns/start_of_iso_week/index.js.map +0 -1
  435. package/dist/node_modules/date-fns/start_of_iso_year/index.js +0 -46
  436. package/dist/node_modules/date-fns/start_of_iso_year/index.js.map +0 -1
  437. package/dist/node_modules/date-fns/start_of_week/index.js +0 -51
  438. package/dist/node_modules/date-fns/start_of_week/index.js.map +0 -1
  439. package/dist/rules/src/factories/scatter-dimension.js +0 -35
  440. package/dist/rules/src/factories/scatter-dimension.js.map +0 -1
  441. package/dist/rules/src/factories/stacked-dimension.js +0 -32
  442. package/dist/rules/src/factories/stacked-dimension.js.map +0 -1
  443. package/dist/rules/src/factories/symbol-dimension.js +0 -32
  444. package/dist/rules/src/factories/symbol-dimension.js.map +0 -1
  445. package/dist/rules/src/header/getDefaultSubtitle.js +0 -44
  446. package/dist/rules/src/header/getDefaultSubtitle.js.map +0 -1
  447. package/dist/rules/src/header/getHeaderUnits.js +0 -21
  448. package/dist/rules/src/header/getHeaderUnits.js.map +0 -1
  449. package/dist/rules/src/header/getSubtitleFlags.js +0 -47
  450. package/dist/rules/src/header/getSubtitleFlags.js.map +0 -1
  451. package/dist/rules/src/header/getTitleFlags.js +0 -12
  452. package/dist/rules/src/header/getTitleFlags.js.map +0 -1
  453. package/dist/rules/src/properties/errors.js +0 -22
  454. package/dist/rules/src/properties/errors.js.map +0 -1
  455. package/dist/rules/src/properties/getInformationsStateFromNewProps.js +0 -50
  456. package/dist/rules/src/properties/getInformationsStateFromNewProps.js.map +0 -1
  457. package/dist/rules/src/v8-transformer.js +0 -174
  458. package/dist/rules/src/v8-transformer.js.map +0 -1
  459. package/src/bridge-d3-react/src/app.js +0 -64
  460. package/src/bridge-d3-react/src/mock-choro.js +0 -394
  461. package/src/rules/src/factories/scatter-dimension.js +0 -32
  462. package/src/rules/src/factories/stacked-dimension.js +0 -29
  463. package/src/rules/src/factories/symbol-dimension.js +0 -29
  464. package/src/rules/src/header/getDefaultSubtitle.js +0 -40
  465. package/src/rules/src/header/getHeaderUnits.js +0 -17
  466. package/src/rules/src/header/getSubtitleFlags.js +0 -43
  467. package/src/rules/src/header/getTitleFlags.js +0 -8
  468. package/src/rules/src/header/index.js +0 -4
  469. package/src/rules/src/preparators/enhanceObservations.js +0 -152
  470. package/src/rules/src/properties/errors.js +0 -19
  471. package/src/rules/src/properties/getInformationsStateFromNewProps.js +0 -47
  472. package/src/rules/src/properties/information.js +0 -84
  473. package/src/rules/src/v8-transformer.js +0 -177
  474. package/src/rules2/src/getAdvAttrSeriesAtCoordinates.js +0 -29
  475. package/src/rules2/src/getMetadataStructureFromData.js +0 -17
  476. package/src/rules2/src/refineMetadataCoordinates.js +0 -28
  477. package/src/rules2/src/table/getCombinationDimensionsData.js +0 -39
@@ -1,12 +1,61 @@
1
1
  import * as R from 'ramda';
2
- import { extractSdmxArtefacts, focus } from '../';
2
+ import getSeries from '../factories/series';
3
3
  import { BAR, ROW, TIMELINE } from '../constants';
4
4
  import { hasFocus } from './utils';
5
+ import { dimensionValueDisplay, parseDisplay } from '../dimension-utils';
5
6
 
6
7
  const sampleFocusTypes = { [BAR]: BAR, [ROW]: ROW, [TIMELINE]: TIMELINE };
7
8
 
8
9
  const focusComparator = (op1, op2) => op1.value === op2.value;
9
10
 
11
+ const focus = (data, type, dimension, _display) => {
12
+ const display = parseDisplay(_display);
13
+ switch(type) {
14
+ case 'RowChart': case 'BarChart':
15
+ case 'HorizontalSymbolChart': case 'VerticalSymbolChart':
16
+ case 'StackedBarChart': case 'StackedRowChart':
17
+ return R.pipe(
18
+ getSeries,
19
+ R.pathOr([], [0, 'datapoints']),
20
+ R.map(dp => ({ label: dp.category, value: dp.key })),
21
+ )({ data, type, options: { display }, singularity: dimension });
22
+ case 'TimelineChart':
23
+ return R.pipe(
24
+ getSeries,
25
+ R.map(serie => ({ label: serie.category, value: serie.key })),
26
+ )({ data, type, options: { display }, singularity: dimension });
27
+ case 'ScatterChart':
28
+ const id = R.prop('id', dimension);
29
+ if (R.isNil(id))
30
+ return [];
31
+ return R.pipe(
32
+ R.propOr([], 'dimensions'),
33
+ R.reduce((acc, dim) => {
34
+ if (dim.header || dim.id === id) {
35
+ return acc;
36
+ }
37
+ const dimOptions = R.map(val => ({
38
+ label: `${dimensionValueDisplay(display)(dim)} - ${dimensionValueDisplay(display)(val)}`,
39
+ options: { dimensionId: dim.id, dimensionValueId: val.id },
40
+ value: `${dim.id}-${val.id}`
41
+ }), R.propOr([], 'values', dim));
42
+ return R.concat(acc, dimOptions);
43
+ }, []),
44
+ )(data);
45
+ default:
46
+ return [];
47
+ }
48
+ };
49
+
50
+ export const parseFocus = (data, type, dimension, display, { baseline, highlight }) => {
51
+ const options = focus(data, type, dimension, display);
52
+ const optionsSet = new Set(R.pluck('value', options));
53
+
54
+ const parseSelection = R.reject(({ value }) => !optionsSet.has(value));
55
+
56
+ return ({ baseline: parseSelection(baseline), highlight: parseSelection(highlight) });
57
+ };
58
+
10
59
  export const focusOptions = (props, state, otherFocus, singularity) => {
11
60
  if (!hasFocus(props.type)) {
12
61
  return [];
@@ -44,7 +93,6 @@ const filterFocus = (focus, keyedOptions, type) => R.reduce(
44
93
  )
45
94
 
46
95
  export const focusStateFromNewProps = ({ data, display, type }, singularity, state) => {
47
- const { id } = extractSdmxArtefacts(data);
48
96
  const highlightState = R.propOr([], 'highlight', state);
49
97
  const baselineState = R.propOr([], 'baseline', state);
50
98
  const options = focus(data, type, singularity, display);
@@ -1,11 +1,5 @@
1
1
  import * as R from 'ramda';
2
- import {
3
- getDefaultSubtitle,
4
- getHeaderUnits,
5
- getSubtitleFlags,
6
- getTitleFlags
7
- } from '../header';
8
- import { dimensionValueDisplay, parseDisplay } from '../';
2
+ import { dimensionValueDisplay, parseDisplay } from '../dimension-utils';
9
3
  import { isChart } from './utils';
10
4
 
11
5
  const isCustomInvalid = ({ type }) => (value) => R.isNil(value) || !isChart(type);
@@ -16,57 +10,11 @@ const getDataflowName = (props) => {
16
10
  return dimensionValueDisplay(display)(dataflow);
17
11
  };
18
12
 
19
- export const getTitleLabel = (props, state) => R.when(
20
- isCustomInvalid({ type: props.type }),
21
- R.always(getDataflowName(props))
22
- )(state.title);
23
-
24
- export const getSubtitle = (props, state) => R.ifElse(
25
- isCustomInvalid({type: props.type }),
26
- R.always(getDefaultSubtitle({
27
- customAttributes: props.customAttributes,
28
- dimensions: state.dimensions,
29
- display: props.display,
30
- units: state.units
31
- })),
32
- (label) => {
33
- const flags = getSubtitleFlags({
34
- customAttributes: props.customAttributes,
35
- dimensions: state.dimensions,
36
- display: props.display,
37
- units: state.units
38
- });
39
- return ([{ label, flags }]);
40
- }
41
- )(state.subtitle);
42
-
43
13
  export const getSourceLabel = (props, state) => R.when(
44
14
  isCustomInvalid({ type: props.type }),
45
15
  R.always(getDataflowName(props))
46
16
  )(state.sourceLabel);
47
17
 
48
- export const getHeaderProps = (props, state) => {
49
- const title = {
50
- label: getTitleLabel(props, state),
51
- flags: getTitleFlags({
52
- customAttributes: props.customAttributes,
53
- dataflowAttributes: state.dataflowAttributes,
54
- display: props.display,
55
- })
56
- };
57
-
58
- const subtitle = getSubtitle(props, state);
59
-
60
- const uprs = getHeaderUnits({
61
- display: props.display,
62
- units: R.assoc(
63
- 'values',
64
- R.pathOr([], ['units', 'headerUnits'], state)
65
- )(R.pathOr({}, ['units', 'unitDimension'], props))
66
- });
67
- return ({ subtitle, title, uprs });
68
- };
69
-
70
18
  export const getFooterProps = (props, state) => ({
71
19
  withCopyright: isChart(props.type) ? state.withCopyright : true,
72
20
  withLogo: isChart(props.type) ? state.withLogo : true,
@@ -1,6 +1,4 @@
1
1
  import * as R from 'ramda';
2
- import { getDataFrequency } from '@sis-cc/dotstatsuite-sdmxjs';
3
- import { series } from '../';
4
2
  import {
5
3
  H_SYMBOL,
6
4
  SCATTER,
@@ -49,12 +47,11 @@ import {
49
47
  hasFocus,
50
48
  isChart,
51
49
  isNaturalInt,
52
- isNumber,
53
50
  optionParser,
54
51
  } from './utils';
55
- import { getTitleLabel, getSubtitle, getSourceLabel } from './getHeaderProps';
52
+ import { getSourceLabel } from './getHeaderProps';
56
53
  import { stringifySubtitle } from './getStringifiedSubtitle';
57
- import { getHasNoTimePeriodError } from './errors';
54
+
58
55
  /*
59
56
  - width/height -> initial undefined, if undefined or blank, replaced by options.base
60
57
  */
@@ -72,32 +69,6 @@ export const toSingularity = ({ data, type }, state) => {
72
69
  }
73
70
  };
74
71
 
75
- export const toChartData = (props, state) => {
76
- const dimensions = R.pathOr([], ['data', 'structure', 'dimensions', 'observation'], props);
77
- const attributes = R.pathOr([], ['data', 'structure', 'attributes', 'observation'], props);
78
- const frequency = props.type === TIMELINE ? getDataFrequency({ dimensions, attributes }) : null;
79
- return ({
80
- frequency,
81
- series: series(
82
- props.data,
83
- props.type,
84
- R.pick(['highlight', 'baseline'], state),
85
- toSingularity(props, state),
86
- props.map,
87
- props.display,
88
- props.formaterIds
89
- ),
90
- share: {
91
- focused: R.pick(['highlight', 'baseline'], state),
92
- chartDimension: toSingularity(props, state),
93
- }
94
- });
95
- };
96
-
97
- export const getErrors = (props, state) => ({
98
- noTime: getHasNoTimePeriodError(props),
99
- });
100
-
101
72
  const toFloat = (value) => {
102
73
  const float = parseFloat(value);
103
74
  return isNaN(float) ? undefined : float;
@@ -171,25 +142,6 @@ export const toChartOptions = (props, state) => {
171
142
  });
172
143
  };
173
144
 
174
- export const initialState = {
175
- highlight: [],
176
- baseline: [],
177
- fixedWidth: undefined,
178
- fixedHeight: undefined,
179
- freqStep: undefined,
180
- responsiveWidth: undefined,
181
- responsiveHeight: undefined,
182
- scatterDimension: undefined,
183
- scatterX: undefined,
184
- scatterY: undefined,
185
- symbolDimension: undefined,
186
- stackedDimension: undefined,
187
- stackedMode: undefined,
188
- id: undefined,
189
- type: undefined,
190
- ...linearInitialState,
191
- };
192
-
193
145
  export const stateFromNewProps = (props, state) => {
194
146
  const focusState = sampleFocusStateFromNewProps(props, state);
195
147
  const scatterState = scatterStateFromNewProps(props, state);
@@ -212,49 +164,6 @@ export const stateFromNewProps = (props, state) => {
212
164
  });
213
165
  };
214
166
 
215
- const propertiesParsers = {
216
- highlight: onChangeFocusSelection,
217
- baseline: onChangeFocusSelection,
218
- fixedWidth: (value) => isNaturalInt(value) ? value : undefined,
219
- fixedHeight: (value) => isNaturalInt(value) ? value : undefined,
220
- responsiveWidth: (value) => isNumber(value) ? value : undefined,
221
- responsiveHeight: (value) => isNumber(value) ? value : undefined,
222
- freqStep: (value) => isNaturalInt(value) ? value : undefined,
223
- title: R.identity,
224
- subtitle: R.identity,
225
- sourceLabel: R.identity,
226
- scatterDimension: optionParser,
227
- scatterX: optionParser,
228
- scatterY: optionParser,
229
- symbolDimension: optionParser,
230
- stackedDimension: optionParser,
231
- stackedMode: optionParser,
232
- maxX: (value) => isNumber(value) ? value : undefined,
233
- maxY: (value) => isNumber(value) ? value : undefined,
234
- minX: (value) => isNumber(value) ? value : undefined,
235
- minY: (value) => isNumber(value) ? value : undefined,
236
- pivotX: (value) => isNumber(value) ? value : undefined,
237
- pivotY: (value) => isNumber(value) ? value : undefined,
238
- stepX: (value) => isNaturalInt(value) ? value : undefined,
239
- stepY: (value) => isNaturalInt(value) ? value : undefined,
240
- };
241
-
242
- export const onChangeProperties = (state, onChange) => (newProperties) => {
243
- const apply = R.is(Function, onChange) ? onChange : R.identity;
244
- const refined = R.pipe(
245
- R.mapObjIndexed((value, key) => {
246
- const _parser = R.prop(key, propertiesParsers);
247
- const parser = R.is(Function, _parser) ? _parser : R.identity;
248
- return parser(value);
249
- }),
250
- R.pickBy((value, key) => value !== R.prop(key, state))
251
- )(newProperties);
252
- if (R.isEmpty(refined)) {
253
- return ;
254
- }
255
- apply(refined);
256
- };
257
-
258
167
  export const toProperties = (props, state, onChange) => ({
259
168
  ...toLinearProperties(props, state, onChange),
260
169
  highlight: {
@@ -95,7 +95,7 @@ export const toProperties = (props, state, onChange) => ({
95
95
  pivotX: isNumber(value) ? value : undefined
96
96
  }),
97
97
  value: R.when(
98
- v => R.isNil(v) && (R.propEq('type', ROW)(props) || R.propEq('type', STACKED_ROW)(props)),
98
+ v => R.isNil(v) && (R.propEq(ROW, 'type')(props) || R.propEq(STACKED_ROW, 'type')(props)),
99
99
  R.always(0)
100
100
  )(R.isNil(state.pivotX) ? String(state.computedPivotX) : state.pivotX)
101
101
  },
@@ -106,7 +106,7 @@ export const toProperties = (props, state, onChange) => ({
106
106
  pivotY: isNumber(value) ? value : undefined
107
107
  }),
108
108
  value: R.when(
109
- v => R.isNil(v) && (R.propEq('type', BAR)(props) || R.propEq('type', STACKED_BAR)(props)),
109
+ v => R.isNil(v) && (R.propEq(BAR, 'type')(props) || R.propEq(STACKED_BAR, 'type')(props)),
110
110
  R.always(0)
111
111
  )(R.isNil(state.pivotY) ? String(state.computedPivotY) : state.pivotY)
112
112
  },
@@ -66,7 +66,7 @@ export const scatterStateValueToOption = (property, props, state) => {
66
66
  return undefined;
67
67
  }
68
68
  const value = R.find(
69
- R.propEq('id', R.prop(property, state)),
69
+ R.propEq(R.prop(property, state), 'id'),
70
70
  R.prop('values', dimension)
71
71
  );
72
72
  return artefactToOption(props.display)(value);
@@ -74,7 +74,7 @@ export const scatterStateValueToOption = (property, props, state) => {
74
74
 
75
75
  export const onChangeScatterVal = ({ data, type }, state, valKey, otherValKey) => (value) => {
76
76
  const options = scatterValueOptions({ data, type }, state);
77
- const [matching, otherOptions] = R.partition(R.propEq('value', value), options);
77
+ const [matching, otherOptions] = R.partition(R.propEq(value, 'value'), options);
78
78
  if (R.isEmpty(matching)) {
79
79
  return ({});
80
80
  }
@@ -135,10 +135,10 @@ export const scatterStateFromNewProps = (props, state) => {
135
135
 
136
136
  //dirty as f
137
137
  const scatterX = R.isNil(_scatterX)
138
- ? R.head(R.reject(R.propEq('id', R.prop('id', _scatterY)), values))
138
+ ? R.head(R.reject(R.propEq(R.prop('id', _scatterY), 'id'), values))
139
139
  : _scatterX;
140
140
  const scatterY = R.isNil(_scatterY)
141
- ? R.head(R.reject(R.propEq('id', R.prop('id', scatterX)), values))
141
+ ? R.head(R.reject(R.propEq(R.prop('id', scatterX),'id'), values))
142
142
  : _scatterY;
143
143
 
144
144
  const scatterState = toScatterState(
@@ -6,7 +6,6 @@ import {
6
6
  getPropertyDimension,
7
7
  toState
8
8
  } from './utils';
9
- import { splitDimensions } from '../';
10
9
  import { focusStateFromNewProps } from './focus';
11
10
 
12
11
  const getStackedDimension = getPropertyDimension('stackedDimension');
@@ -41,8 +40,8 @@ export const onChangeStackedDimension = ({ data }, state) => (value) => {
41
40
  export const stackedModeOptions = [{ value: VALUES }, { value: PERCENT }];
42
41
 
43
42
  export const isStackedDimActive = ({ data, type }) => {
44
- const { values } = splitDimensions(data);
45
- if (R.length(values) < 2) {
43
+ const dimensions = getDimensionsWithValues(data);
44
+ if (R.length(dimensions) < 2) {
46
45
  return false;
47
46
  }
48
47
  return isStacked(type);
@@ -67,9 +66,8 @@ export const stackedStateFromNewProps = (props, state) => {
67
66
 
68
67
  let dimension = getStackedDimension(data, state);
69
68
  if (R.isNil(dimension)) {
70
- const { value, values } = splitDimensions(data);
71
- if (R.length(values) === 1) {
72
- dimension = R.head(value);
69
+ if (R.length(dimensions) === 1) {
70
+ dimension = R.find(R.prop('header'), data.dimensions);
73
71
  }
74
72
  else {
75
73
  const { area, time, other } = getGroupedDimensions(data);
@@ -1,5 +1,4 @@
1
1
  import * as R from 'ramda';
2
- import { extractSdmxArtefacts } from '../';
3
2
  import { H_SYMBOL, V_SYMBOL } from '../constants';
4
3
  import {
5
4
  getDimensionsWithValues,
@@ -3,8 +3,7 @@ import {
3
3
  find,
4
4
  groupBy,
5
5
  has,
6
- head,
7
- is,
6
+ isEmpty,
8
7
  isNil,
9
8
  length,
10
9
  map,
@@ -13,9 +12,11 @@ import {
13
12
  pipe,
14
13
  prop,
15
14
  propEq,
15
+ propOr,
16
+ reject
16
17
  } from 'ramda';
17
18
  import { isRefAreaDimension, isTimePeriodDimension } from '@sis-cc/dotstatsuite-sdmxjs';
18
- import { extractSdmxArtefacts, parseDisplay, splitDimensions } from '../';
19
+ import { parseDisplay } from '../dimension-utils';
19
20
  import { CHORO, STACKED_BAR, STACKED_ROW, TYPES } from '../constants';
20
21
  import { dimensionValueDisplay } from '../dimension-utils';
21
22
 
@@ -30,26 +31,23 @@ export const isPositiveNumber = (input) => {
30
31
 
31
32
  export const isNaturalInt = value => isNil(value) || /^\d+$/.test(String(value));
32
33
 
33
- export const isInt = value => isNil(value) || /^-?\d+$/.test(String(value));
34
34
 
35
35
  export const isChart = (type) => has(type, TYPES);
36
36
 
37
37
  export const hasFocus = (type) => has(type, omit([CHORO], TYPES));
38
38
 
39
39
  export const getDimensionsWithValues = (data) => pipe(
40
- splitDimensions,
41
- prop('values'),
40
+ propOr([], 'dimensions'),
41
+ reject(d => d.header || isEmpty(d.values || []))
42
42
  )(data);
43
43
 
44
44
  export const toState = (artefact) => prop('id', artefact);
45
45
 
46
46
  export const getPropertyDimension = (property) => (data, state) => {
47
- const statePropertyDimensionId = prop(property, state);
48
- const { dimensions } = extractSdmxArtefacts(data);
49
- return find(
50
- propEq('id', statePropertyDimensionId),
51
- dimensions
52
- );
47
+ const dimensionId = prop(property, state);
48
+ const { dimensions = [] } = data || {};
49
+
50
+ return find(propEq(dimensionId, 'id'), dimensions);
53
51
  };
54
52
 
55
53
  export const getGroupedDimensions = pipe(
@@ -73,10 +71,6 @@ export const optionParser = option => pipe(
73
71
  option => is(String, option) ? option : undefined
74
72
  )(option);
75
73
 
76
- export const optionsParser = selection => pipe(
77
- selection => is(Array, selection) ? selection : [selection],
78
- selection => map(optionParser, selection)
79
- )(selection);
80
74
 
81
75
  export const artefactToOption = (display) => (artefact) => isNil(artefact)
82
76
  ? undefined
@@ -85,11 +79,6 @@ export const artefactToOption = (display) => (artefact) => isNil(artefact)
85
79
  value: prop('id', artefact)
86
80
  };
87
81
 
88
- export const dimensionWithValuesToOptions = ({ data, display }) => pipe(
89
- getDimensionsWithValues,
90
- map(artefactToOption(display))
91
- )(data);
92
-
93
82
  export const chartDimensionToOption = (property) => ({ data, display }, state) => pipe(
94
83
  getPropertyDimension(property),
95
84
  artefactToOption(display)
@@ -99,7 +88,7 @@ export const chartDimensionOptions = ({ data, type, display }, typeValidator) =>
99
88
  if (!typeValidator(type)) {
100
89
  return [];
101
90
  }
102
- const dimensions = prop('values', splitDimensions(data));
91
+ const dimensions = getDimensionsWithValues(data);
103
92
  if ((equals(type, STACKED_BAR) || equals(type, STACKED_ROW)) && length(dimensions) === 1) {
104
93
  return [];
105
94
  }
@@ -1,39 +1,10 @@
1
1
  import * as R from 'ramda';
2
2
 
3
- export const LAYOUT_ROW = 'LAYOUT_ROW';
4
- export const LAYOUT_COLUMN = 'LAYOUT_COLUMN';
5
- export const LAYOUT_ROW_SECTION = 'LAYOUT_ROW_SECTION';
6
-
7
- const ROWS = 'rows';
8
- const HEADER = 'header';
9
- const SECTIONS = 'sections';
10
-
11
- const ORDER = 'ORDER';
12
3
  const NOT_DISPLAYED = 'NOT_DISPLAYED';
13
4
 
14
- const getType = R.propOr({}, 'type');
15
- const getIds = (stringIds = '') => R.pipe(
16
- R.append(R.split(',', stringIds)),
17
- R.flatten
18
- );
19
- const getPivot = (key, stringIds) => R.over(R.lensProp(key), getIds(stringIds));
20
-
21
- export const setAnnotationsLayout = (stringIds, layout) => R.reduce((acc, annotation) => {
22
- if (R.equals(getType(annotation), LAYOUT_ROW)) return getPivot(ROWS, stringIds)(acc);
23
- if (R.equals(getType(annotation), LAYOUT_COLUMN)) return getPivot(HEADER, stringIds)(acc);
24
- if (R.equals(getType(annotation), LAYOUT_ROW_SECTION)) return getPivot(SECTIONS, stringIds)(acc);
25
- return acc;
26
- }, layout);
27
-
28
- export const getRelationnalAnnotations = annotationIndexes => annotations => R.map(annotationIndex =>
29
- R.propOr({}, annotationIndex)(annotations)
30
- )(annotationIndexes);
31
-
32
- export const hiddenFormat = { isHidden: true }
33
-
34
5
  export const getIsHidden = annotations => R.pipe(
35
- R.find(R.propEq('type', NOT_DISPLAYED)),
6
+ R.find(R.propEq(NOT_DISPLAYED, 'type')),
36
7
  R.complement(R.isNil)
37
8
  )(annotations);
38
9
 
39
- export const getFullName = R.identity;
10
+ export const getFullName = R.identity;
@@ -1,5 +1,5 @@
1
1
  import * as R from 'ramda';
2
- import { dimensionValueDisplay } from '../../rules/src';
2
+ import { dimensionValueDisplay } from '../../rules/src/dimension-utils';
3
3
  import { REJECTED_VALUE_IDS } from './constants';
4
4
 
5
5
  const getRefinedMissinParentsLabels = R.pipe(
@@ -46,7 +46,7 @@ const _combinedValuesDisplay = (_display) => (values) =>
46
46
  if (!R.isEmpty(labels) || _display !== 'label') {
47
47
  return R.join(', ', labels);
48
48
  }
49
- const totalValue = R.find(R.propEq('id', '_T'), values);
49
+ const totalValue = R.find(R.propEq('_T', 'id'), values);
50
50
  if (!R.isNil(totalValue)) {
51
51
  return dimensionValueDisplay('label')(totalValue);
52
52
  }
@@ -0,0 +1,34 @@
1
+ import * as R from 'ramda';
2
+ import { getIsHidden } from '../../rules/src/sdmx-data';
3
+ import { getValuesEnhanced } from '../../rules/src/get-values-enhanced';
4
+
5
+ export const getAttributes = ({ attributes, annotations, options }) => {
6
+ const {
7
+ hiddenCombinations = {},
8
+ hiddenValues = {},
9
+ locale = '',
10
+ ...restOptions
11
+ } = options;
12
+
13
+ const datasetAttributes = R.propOr([], 'dataSet', attributes);
14
+ const obsAttributes = R.propOr([], 'observation', attributes);
15
+
16
+ return R.pipe(
17
+ R.concat,
18
+ R.addIndex(R.map)((attr, index) => {
19
+ const attrAnnotations = R.props(attr.annotations || [], annotations);
20
+ return ({
21
+ ...attr,
22
+ __index: index,
23
+ display: !R.has(attr.id, hiddenValues) && !getIsHidden(attrAnnotations),
24
+ values: getValuesEnhanced({
25
+ locale,
26
+ annotations,
27
+ parent: attr.id,
28
+ hiddenIds: hiddenValues,
29
+ options: restOptions,
30
+ })(attr.values || [])
31
+ })
32
+ })
33
+ )(obsAttributes, datasetAttributes);
34
+ };
@@ -4,8 +4,8 @@ export const getDataflowTooltipAttributesIds = (sdmxJson, defaults = {}) => {
4
4
  const dataflowAnnotationsIndexes = R.pathOr([], ['data', 'dataSets', 0, 'annotations'], sdmxJson);
5
5
  const dataflowAnnotations = R.props(dataflowAnnotationsIndexes, R.pathOr([], ['data', 'structure', 'annotations'], sdmxJson));
6
6
 
7
- const flagsAttrAnnotation = R.find(R.propEq('type', 'LAYOUT_FLAG'), dataflowAnnotations);
8
- const footnotesAttrAnnotation = R.find(R.propEq('type', 'LAYOUT_NOTE'), dataflowAnnotations);
7
+ const flagsAttrAnnotation = R.find(R.propEq('LAYOUT_FLAG', 'type'), dataflowAnnotations);
8
+ const footnotesAttrAnnotation = R.find(R.propEq('LAYOUT_NOTE', 'type'), dataflowAnnotations);
9
9
 
10
10
  const customFlags = R.pipe(
11
11
  R.propOr('', 'title'),
@@ -1,5 +1,5 @@
1
1
  import * as R from 'ramda';
2
- import { dimensionValueDisplay } from '../../rules/src';
2
+ import { dimensionValueDisplay } from '../../rules/src/dimension-utils';
3
3
  import { combinedValuesDisplay } from './combinedValuesDisplay';
4
4
  import { REJECTED_VALUE_IDS } from './constants';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import * as R from 'ramda';
2
2
  import { getFlagsAndNotes } from './table/getFlagsAndNotes';
3
- import { dimensionValueDisplay } from '../../rules/src/';
3
+ import { dimensionValueDisplay } from '../../rules/src/dimension-utils';
4
4
 
5
5
  export const getHeaderSubtitle = (dimensions, combinations, customAttributes, display, microdataDimension) => {
6
6
  const combinationsConepts = R.pipe(R.pluck('concepts'), R.unnest)(combinations);
@@ -8,7 +8,7 @@ export const getHeaderSubtitle = (dimensions, combinations, customAttributes, di
8
8
 
9
9
  return R.reduce(
10
10
  (acc, dim) => {
11
- if (!R.propOr(true, 'display', dim) || R.propEq('id', microdataDimension, dim)
11
+ if (!R.propOr(true, 'display', dim) || R.propEq(microdataDimension, 'id', dim)
12
12
  || R.includes(dim.id, combinationsConepts)) {
13
13
  return acc;
14
14
  }
@@ -1,5 +1,5 @@
1
1
  import * as R from 'ramda';
2
- import { dimensionValueDisplay } from '../../rules/src';
2
+ import { dimensionValueDisplay } from '../../rules/src/dimension-utils';
3
3
  import { getFlagsAndNotes } from './table/getFlagsAndNotes';
4
4
 
5
5
  export const getHeaderTitle = (dataflow, attributes, display, customAttributes) => ({
@@ -6,7 +6,7 @@ export const getMetadataCoordinates = (sdmxJson) => {
6
6
  const metadataAvailKeys = R.pipe(
7
7
  R.pathOr([], ['data', 'dataSets', 0, 'dimensionGroupAttributes']),
8
8
  R.map(indexes => R.props(indexes, annotations)),
9
- R.filter(R.find(a => a && R.propEq('type', 'HAS_METADATA', a))),
9
+ R.filter(R.find(a => a && R.propEq('HAS_METADATA', 'type', a))),
10
10
  R.keys
11
11
  )(sdmxJson);
12
12
 
@@ -42,7 +42,7 @@ const getNotDisplayedValues = annot => {
42
42
  };
43
43
 
44
44
  export const getNotDisplayedIds = (annotations) => R.pipe(
45
- R.find(R.propEq('type', 'NOT_DISPLAYED')),
45
+ R.find(R.propEq('NOT_DISPLAYED', 'type')),
46
46
  R.converge((hiddenValues, hiddenCombinations) => ({
47
47
  hiddenValues,
48
48
  hiddenCombinations
@@ -16,6 +16,7 @@ export { refinePartialHierarchy } from './hierarchiseDimensionWithAdvancedHierar
16
16
  export { hierarchiseDimensionWithNativeHierarchy } from './hierarchiseDimensionWithNativeHierarchy2';
17
17
  export { getDimensionValuesIndexes } from './getDimensionValuesIndexes';
18
18
  export { getCombinationDefinitions, parseCombinationDefinition } from './getCombinationDefinitions';
19
+ export { getAttributes } from './getAttributes';
19
20
  export { refineDimensions } from './refineDimensions';
20
21
  export { parseAttributes } from './parseAttributes';
21
22
  export { parseCombinations } from './parseCombinations';
@@ -14,10 +14,10 @@ export const parseAttributes = (attributes, dimensions, customAttributes) => {
14
14
  || attr.id === REPYEARSTART) {
15
15
  return R.assoc('display', false, res);
16
16
  }
17
- if (R.propEq('id', customAttributes.prefscale, attr)) {
17
+ if (R.propEq(customAttributes.prefscale, 'id', attr)) {
18
18
  return R.assoc('prefscale', true, res);
19
19
  }
20
- if (R.propEq('id', customAttributes.decimals, attr)) {
20
+ if (R.propEq(customAttributes.decimals, 'id', attr)) {
21
21
  return R.assoc('decimals', true, res);
22
22
  }
23
23
  if (R.hasPath(['relationship', 'none'], attr) || R.hasPath(['relationship', 'dataflow'], attr)) {
@@ -2,7 +2,7 @@ import * as R from 'ramda';
2
2
 
3
3
  export const parseHierarchicalCodelist = (sdmxJson, hierarchyId) => {
4
4
  const hCodelist = R.pathOr({}, ['data', 'hierarchicalCodelists', 0], sdmxJson);
5
- const hierarchy = R.find(R.propEq('id', hierarchyId), hCodelist.hierarchies || []);
5
+ const hierarchy = R.find(R.propEq(hierarchyId, 'id'), hCodelist.hierarchies || []);
6
6
 
7
7
  const getParentedCodes = (codes, parent) => {
8
8
  const ids = R.pluck('codeID', codes);
@@ -47,7 +47,7 @@ export const parseMetadataSeries = (metadataJson, options) => {
47
47
  const val = R.nth(Number(vInd), dim.values || []);
48
48
 
49
49
  const originalVal = R.find(
50
- R.propEq('id', val.id),
50
+ R.propEq(val.id, 'id'),
51
51
  )(R.propOr([], 'values', R.nth(dInd, options.dimensions)));
52
52
  return R.propOr('', '__index', originalVal);
53
53
  }),