@sis-cc/dotstatsuite-components 15.0.21 → 16.1.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 (165) hide show
  1. package/lib/rules/src/index.js +1 -145
  2. package/lib/rules/src/table/index.js +0 -42
  3. package/lib/rules2/src/constants.js +4 -1
  4. package/lib/rules2/src/enhanceObservations.js +98 -0
  5. package/lib/rules2/src/getAttributesSeries.js +33 -0
  6. package/lib/rules2/src/getCombinationDefinitions.js +48 -0
  7. package/lib/rules2/src/getHeaderCombinations.js +42 -0
  8. package/lib/rules2/src/getHeaderSubtitle.js +41 -0
  9. package/lib/rules2/src/getManyValuesDimensions.js +39 -0
  10. package/lib/rules2/src/getOneValueDimensions.js +46 -0
  11. package/lib/rules2/src/hasCellMetadata.js +1 -1
  12. package/lib/rules2/src/index.js +186 -18
  13. package/lib/rules2/src/parseAttributes.js +50 -0
  14. package/lib/rules2/src/parseCombinations.js +54 -0
  15. package/lib/rules2/src/parseMetadataSeries.js +4 -2
  16. package/lib/rules2/src/prepareData.js +74 -0
  17. package/lib/{rules/src/table/preparators/getAttributeValue.js → rules2/src/refineAttributes.js} +13 -11
  18. package/lib/rules2/src/table/getCells.js +74 -0
  19. package/lib/rules2/src/table/getCellsAttributesIds.js +63 -0
  20. package/lib/rules2/src/table/getCombinationDimensionsData.js +47 -0
  21. package/lib/rules2/src/table/getCuratedCells.js +28 -0
  22. package/lib/rules2/src/table/getFlagsAndNotes.js +28 -0
  23. package/lib/rules2/src/table/getIndexedCombinationsByDisplay.js +31 -0
  24. package/lib/rules2/src/table/getLayout.js +93 -0
  25. package/lib/rules2/src/table/getLayoutData.js +202 -0
  26. package/lib/{rules/src/table/factories → rules2/src/table}/getSortedLayoutIndexes.js +55 -40
  27. package/lib/rules2/src/table/getTableProps.js +64 -0
  28. package/lib/rules2/src/table/parseValueHierarchy.js +55 -0
  29. package/lib/{rules/src/table/factories → rules2/src/table}/refineLayoutSize.js +17 -8
  30. package/lib/rules2/src/{hasLayoutEntryMetadata.js → utils.js} +9 -6
  31. package/package.json +1 -1
  32. package/src/rules/src/index.js +1 -19
  33. package/src/rules/src/table/index.js +0 -4
  34. package/src/rules2/src/constants.js +3 -0
  35. package/src/rules2/src/enhanceObservations.js +88 -0
  36. package/src/rules2/src/getAttributesSeries.js +29 -0
  37. package/src/rules2/src/getCombinationDefinitions.js +29 -0
  38. package/src/rules2/src/getHeaderCombinations.js +39 -0
  39. package/src/rules2/src/getHeaderSubtitle.js +34 -0
  40. package/src/rules2/src/getManyValuesDimensions.js +34 -0
  41. package/src/rules2/src/getOneValueDimensions.js +33 -0
  42. package/src/rules2/src/hasCellMetadata.js +1 -1
  43. package/src/rules2/src/index.js +21 -6
  44. package/src/rules2/src/parseAttributes.js +36 -0
  45. package/src/rules2/src/parseCombinations.js +36 -0
  46. package/src/rules2/src/parseMetadataSeries.js +3 -2
  47. package/src/rules2/src/prepareData.js +50 -0
  48. package/src/rules2/src/refineAttributes.js +16 -0
  49. package/src/rules2/src/table/getCells.js +72 -0
  50. package/src/rules2/src/table/getCellsAttributesIds.js +38 -0
  51. package/src/rules2/src/table/getCombinationDimensionsData.js +38 -0
  52. package/src/rules2/src/table/getCuratedCells.js +33 -0
  53. package/src/rules2/src/table/getFlagsAndNotes.js +21 -0
  54. package/src/rules2/src/table/getIndexedCombinationsByDisplay.js +16 -0
  55. package/src/rules2/src/table/getLayout.js +80 -0
  56. package/src/rules2/src/table/getLayoutData.js +183 -0
  57. package/src/rules2/src/table/getSortedLayoutIndexes.js +119 -0
  58. package/src/rules2/src/table/getTableProps.js +36 -0
  59. package/src/rules2/src/table/parseValueHierarchy.js +27 -0
  60. package/src/{rules/src/table/factories → rules2/src/table}/refineLayoutSize.js +24 -8
  61. package/src/rules2/src/utils.js +12 -0
  62. package/test/enhanceObservations2.test.js +219 -0
  63. package/test/getAttributesSeries.test.js +58 -0
  64. package/test/getCells.test.js +6 -40
  65. package/test/getCombinationDimensionsData.test.js +48 -0
  66. package/test/getSortedLayoutIndexes.test.js +1025 -3
  67. package/test/mocks/OECD_SNA_TABLE1_1.0_-_AUS_V_metadata.json +2 -2
  68. package/test/parseAttributes.test.js +17 -62
  69. package/test/parseMetadataSeries.test.js +1 -1
  70. package/test/parseValueHierarchy.test.js +88 -0
  71. package/test/refineLayoutSize.test.js +2621 -1
  72. package/lib/rules/src/table/factories/getCells.js +0 -97
  73. package/lib/rules/src/table/factories/getConfirmedSeriesAttributesIds.js +0 -26
  74. package/lib/rules/src/table/factories/getCuratedCells.js +0 -45
  75. package/lib/rules/src/table/factories/getLayoutData.js +0 -168
  76. package/lib/rules/src/table/factories/getLayoutWithFlags.js +0 -133
  77. package/lib/rules/src/table/factories/getTableCells.js +0 -24
  78. package/lib/rules/src/table/factories/getTableData.js +0 -98
  79. package/lib/rules/src/table/preparators/getDimensionsAttributesRegisters.js +0 -43
  80. package/lib/rules/src/table/preparators/getManyValuesDimensions.js +0 -33
  81. package/lib/rules/src/table/preparators/getOneValueDimensions.js +0 -24
  82. package/lib/rules/src/table/preparators/getUniqValuesAttributes.js +0 -36
  83. package/lib/rules/src/table/preparators/parseAttributes.js +0 -84
  84. package/lib/rules/src/table/preparators/parseAttributesValuesFromObservations.js +0 -22
  85. package/lib/rules/src/table/preparators/parseDimensionsIds.js +0 -22
  86. package/lib/rules/src/table/preparators/prepareData.js +0 -191
  87. package/lib/rules/src/table/preparators/refineObservationsAttributesValues.js +0 -31
  88. package/lib/rules/src/table/preparators/refineSeriesAttributesValues.js +0 -23
  89. package/lib/rules/src/table/units/appendUnitsInLayoutData.js +0 -82
  90. package/lib/rules/src/table/units/appendUnitsInLayoutDataEntry.js +0 -45
  91. package/lib/rules/src/table/units/cleanUnitsInLayoutData.js +0 -66
  92. package/lib/rules/src/table/units/getAttachmentSeriesIndexes.js +0 -25
  93. package/lib/rules/src/table/units/getHeaderUnits.js +0 -35
  94. package/lib/rules/src/table/units/getUnitsArtefacts.js +0 -85
  95. package/lib/rules/src/table/units/getUnitsCodes.js +0 -23
  96. package/lib/rules/src/table/units/getUnitsDefinition.js +0 -33
  97. package/lib/rules/src/table/units/getUnitsDisplay.js +0 -33
  98. package/lib/rules/src/table/units/getUnitsSerieIndexes.js +0 -23
  99. package/lib/rules/src/table/units/getUnitsSeries.js +0 -49
  100. package/lib/rules/src/table/units/getUnitsinLayout.js +0 -74
  101. package/lib/rules/src/table/units/refineDimSeriesUnits.js +0 -44
  102. package/lib/rules2/src/getAdvancedAttributes.js +0 -124
  103. package/lib/rules2/src/invertTime.js +0 -33
  104. package/src/rules/src/table/factories/getCells.js +0 -102
  105. package/src/rules/src/table/factories/getConfirmedSeriesAttributesIds.js +0 -27
  106. package/src/rules/src/table/factories/getCuratedCells.js +0 -40
  107. package/src/rules/src/table/factories/getLayoutData.js +0 -171
  108. package/src/rules/src/table/factories/getLayoutWithFlags.js +0 -137
  109. package/src/rules/src/table/factories/getSortedLayoutIndexes.js +0 -108
  110. package/src/rules/src/table/factories/getTableCells.js +0 -16
  111. package/src/rules/src/table/factories/getTableData.js +0 -86
  112. package/src/rules/src/table/preparators/getAttributeValue.js +0 -17
  113. package/src/rules/src/table/preparators/getDimensionsAttributesRegisters.js +0 -51
  114. package/src/rules/src/table/preparators/getManyValuesDimensions.js +0 -19
  115. package/src/rules/src/table/preparators/getOneValueDimensions.js +0 -17
  116. package/src/rules/src/table/preparators/getUniqValuesAttributes.js +0 -24
  117. package/src/rules/src/table/preparators/parseAttributes.js +0 -113
  118. package/src/rules/src/table/preparators/parseAttributesValuesFromObservations.js +0 -16
  119. package/src/rules/src/table/preparators/parseDimensionsIds.js +0 -17
  120. package/src/rules/src/table/preparators/prepareData.js +0 -197
  121. package/src/rules/src/table/preparators/refineObservationsAttributesValues.js +0 -22
  122. package/src/rules/src/table/preparators/refineSeriesAttributesValues.js +0 -11
  123. package/src/rules/src/table/units/appendUnitsInLayoutData.js +0 -56
  124. package/src/rules/src/table/units/appendUnitsInLayoutDataEntry.js +0 -38
  125. package/src/rules/src/table/units/cleanUnitsInLayoutData.js +0 -65
  126. package/src/rules/src/table/units/getAttachmentSeriesIndexes.js +0 -27
  127. package/src/rules/src/table/units/getHeaderUnits.js +0 -32
  128. package/src/rules/src/table/units/getUnitsArtefacts.js +0 -90
  129. package/src/rules/src/table/units/getUnitsCodes.js +0 -22
  130. package/src/rules/src/table/units/getUnitsDefinition.js +0 -34
  131. package/src/rules/src/table/units/getUnitsDisplay.js +0 -19
  132. package/src/rules/src/table/units/getUnitsSerieIndexes.js +0 -12
  133. package/src/rules/src/table/units/getUnitsSeries.js +0 -41
  134. package/src/rules/src/table/units/getUnitsinLayout.js +0 -71
  135. package/src/rules/src/table/units/refineDimSeriesUnits.js +0 -26
  136. package/src/rules2/src/getAdvancedAttributes.js +0 -111
  137. package/src/rules2/src/hasLayoutEntryMetadata.js +0 -9
  138. package/src/rules2/src/invertTime.js +0 -22
  139. package/test/advanced-attributes-parsing-perf.test.js +0 -16
  140. package/test/appendUnitsInLayoutDataEntry.test.js +0 -65
  141. package/test/cleanUnitsInLayoutData.test.js +0 -85
  142. package/test/enhanceObservations.test.js +0 -340
  143. package/test/getAttachmentSeriesIndexes.test.js +0 -35
  144. package/test/getConfirmedSeriesAttributesIds.test.js +0 -27
  145. package/test/getDataflowAdvancedAttributes.test.js +0 -32
  146. package/test/getHeaderUnits.test.js +0 -51
  147. package/test/getLayoutData.test.js +0 -206
  148. package/test/getLayoutDataWithFlags.test.js +0 -142
  149. package/test/getOneValueDimensions.test.js +0 -26
  150. package/test/getSeriesAdvancedAttributes.test.js +0 -32
  151. package/test/getSubtitleFlags.test.js +0 -42
  152. package/test/getTableData.test.js +0 -1317
  153. package/test/getUnitsArtefacts.test.js +0 -117
  154. package/test/getUnitsDefinition.test.js +0 -37
  155. package/test/getUnitsInLayout.test.js +0 -77
  156. package/test/getUnitsSeries.test.js +0 -154
  157. package/test/invertTime.test.js +0 -77
  158. package/test/parseAttributesValuesFromObservations.test.js +0 -45
  159. package/test/parseDimensionsIds.test.js +0 -20
  160. package/test/prepareData.test.js +0 -29
  161. package/test/refineObservationsAttributesValues.test.js +0 -33
  162. package/test/table-invert-time-perf.test.js +0 -11
  163. package/test/table-layout-perf.test.js +0 -74
  164. package/test/table-prep-duplicate-perf.test.js +0 -15
  165. package/test/table-prep-perf.test.js +0 -61
@@ -1,1317 +0,0 @@
1
- import { expect } from 'chai';
2
- import { getTableProps } from '../src/rules/src/table/factories/getTableData';
3
-
4
- const data = {
5
- dimensions: { one: {}, many: {}, length: 0 },
6
- units: {
7
- headerUnits: [],
8
- unitsDefinitionCodes: [],
9
- unitsAttachmentSeriesIds: ['UNIT_MEASURE', 'UNIT_MULT', 'BASE_PER'],
10
- unitsSeries: {},
11
- unitDimension: { id: 'UNIT', name: 'units' }
12
- },
13
- observations: {},
14
- dataflowAttributes: {},
15
- dataflowName: undefined,
16
- seriesAttributes: [],
17
- seriesAttributesValues: {},
18
- metadataCoordinates: []
19
- };
20
-
21
- const data1 = {
22
- "dimensions": {
23
- "one": {
24
- "FREQ": {
25
- "id": "FREQ",
26
- "name": "Frequency of observation",
27
- "names": {
28
- "en": "Frequency of observation"
29
- },
30
- "keyPosition": 1,
31
- "roles": [
32
- "FREQ"
33
- ],
34
- "values": [
35
- {
36
- "id": "A",
37
- "order": 0,
38
- "name": "Annual",
39
- "names": {
40
- "en": "Annual"
41
- },
42
- "__indexPosition": 0,
43
- "attributes": {},
44
- "display": true
45
- }
46
- ],
47
- "role": "FREQ",
48
- "__index": 1,
49
- "display": true
50
- },
51
- "MEASURE": {
52
- "id": "MEASURE",
53
- "name": "Measure",
54
- "names": {
55
- "en": "Measure"
56
- },
57
- "keyPosition": 2,
58
- "roles": [
59
- "MEASURE"
60
- ],
61
- "values": [
62
- {
63
- "id": "GDP",
64
- "order": 0,
65
- "name": "GDP",
66
- "names": {
67
- "en": "GDP"
68
- },
69
- "__indexPosition": 0,
70
- "attributes": {},
71
- "display": true
72
- }
73
- ],
74
- "role": "MEASURE",
75
- "__index": 2,
76
- "display": true
77
- },
78
- "PRICE_BASE": {
79
- "id": "PRICE_BASE",
80
- "name": "Price Base",
81
- "names": {
82
- "en": "Price Base"
83
- },
84
- "keyPosition": 4,
85
- "roles": [
86
- "PRICE_BASE"
87
- ],
88
- "values": [
89
- {
90
- "id": "V",
91
- "order": 1,
92
- "name": "Current (V)",
93
- "names": {
94
- "en": "Current (V)"
95
- },
96
- "__indexPosition": 1,
97
- "attributes": {},
98
- "display": true
99
- }
100
- ],
101
- "role": "PRICE_BASE",
102
- "__index": 4,
103
- "display": true
104
- },
105
- "ADJUSTMENT": {
106
- "id": "ADJUSTMENT",
107
- "name": "Adjustment",
108
- "names": {
109
- "en": "Adjustment"
110
- },
111
- "keyPosition": 5,
112
- "roles": [
113
- "ADJUSTMENT"
114
- ],
115
- "values": [
116
- {
117
- "id": "SA",
118
- "order": 1,
119
- "name": "Seasonally adjusted",
120
- "names": {
121
- "en": "Seasonally adjusted"
122
- },
123
- "__indexPosition": 1,
124
- "attributes": {},
125
- "display": true
126
- }
127
- ],
128
- "role": "ADJUSTMENT",
129
- "__index": 5,
130
- "display": true
131
- },
132
- "TRANSFORMATION": {
133
- "id": "TRANSFORMATION",
134
- "name": "Transformation",
135
- "names": {
136
- "en": "Transformation"
137
- },
138
- "keyPosition": 6,
139
- "roles": [
140
- "TRANSFORMATION"
141
- ],
142
- "values": [
143
- {
144
- "id": "NT",
145
- "order": 0,
146
- "name": "Non-transformed",
147
- "names": {
148
- "en": "Non-transformed"
149
- },
150
- "__indexPosition": 0,
151
- "attributes": {},
152
- "display": true
153
- }
154
- ],
155
- "role": "TRANSFORMATION",
156
- "__index": 6,
157
- "display": true
158
- }
159
- },
160
- "many": {
161
- "REF_AREA": {
162
- "id": "REF_AREA",
163
- "name": "Reference area",
164
- "names": {
165
- "en": "Reference area"
166
- },
167
- "keyPosition": 0,
168
- "roles": [
169
- "REF_AREA"
170
- ],
171
- "values": [
172
- {
173
- "id": "AU",
174
- "name": "Australia",
175
- "__indexPosition": 12,
176
- "attributes": {},
177
- "__index": 0
178
- },
179
- {
180
- "id": "CA",
181
- "name": "Canada",
182
- "__indexPosition": 37,
183
- "attributes": {},
184
- "__index": 1
185
- },
186
- {
187
- "id": "_T",
188
- "name": "Total",
189
- "__indexPosition": 249,
190
- "attributes": {},
191
- "__index": 2
192
- },
193
- {
194
- "id": "BE",
195
- "name": "Belgium",
196
- "__indexPosition": 19,
197
- "attributes": {},
198
- "__index": 3
199
- }
200
- ],
201
- "role": "REF_AREA",
202
- "__index": 0
203
- },
204
- "UNIT_MEASURE": {
205
- "id": "UNIT_MEASURE",
206
- "name": "Unit of measure",
207
- "names": {
208
- "en": "Unit of measure"
209
- },
210
- "keyPosition": 3,
211
- "roles": [
212
- "UNIT_MEASURE"
213
- ],
214
- "values": [
215
- {
216
- "id": "AUD",
217
- "name": "Australien Dollar",
218
- "__indexPosition": 1,
219
- "attributes": {},
220
- "__index": 0
221
- },
222
- {
223
- "id": "CAD",
224
- "name": "Canadian Dollar",
225
- "__indexPosition": 3,
226
- "attributes": {},
227
- "__index": 1
228
- },
229
- {
230
- "id": "USDPPP",
231
- "name": "USD equivalent, PPP",
232
- "__indexPosition": 4,
233
- "attributes": {},
234
- "__index": 2
235
- },
236
- {
237
- "id": "EUR",
238
- "name": "Euro",
239
- "__indexPosition": 2,
240
- "attributes": {},
241
- "__index": 3
242
- }
243
- ],
244
- "role": "UNIT_MEASURE",
245
- "__index": 3
246
- },
247
- "TIME_PERIOD": {
248
- "id": "TIME_PERIOD",
249
- "name": "Time period",
250
- "names": {
251
- "en": "Time period"
252
- },
253
- "keyPosition": 7,
254
- "roles": [
255
- "TIME_PERIOD"
256
- ],
257
- "values": [
258
- {
259
- "id": "2000",
260
- "name": "2000",
261
- "__indexPosition": 946684800000,
262
- "attributes": {},
263
- "__index": 0
264
- },
265
- {
266
- "id": "2001",
267
- "name": "2001",
268
- "__indexPosition": 978307200000,
269
- "attributes": {},
270
- "__index": 1
271
- },
272
- {
273
- "id": "2002",
274
- "name": "2002",
275
- "__indexPosition": 1009843200000,
276
- "attributes": {},
277
- "__index": 2
278
- }
279
- ],
280
- "role": "TIME_PERIOD",
281
- "__index": 7
282
- }
283
- },
284
- "length": 8
285
- },
286
- "units": {
287
- "headerUnits": [],
288
- "unitDimension": { "id": "UNIT", "name": "units" },
289
- "unitsDefinitionCodes": [
290
- "UNIT_MEASURE",
291
- "PRICE_BASE",
292
- "ADJUSTMENT",
293
- "TRANSFORMATION",
294
- "UNIT_MULT",
295
- "BASE_YEAR"
296
- ],
297
- "unitsAttachmentSeriesIds": [
298
- "UNIT_MEASURE",
299
- "REF_AREA"
300
- ],
301
- "unitsSeries": {
302
- "0:x:x:0:x:x:x:x": {
303
- "UNIT_MEASURE": {
304
- "id": "UNIT_MEASURE",
305
- "name": "Unit of measure",
306
- "value": {
307
- "id": "AUD",
308
- "order": 1,
309
- "name": "Australien Dollar",
310
- "names": {
311
- "en": "Australien Dollar"
312
- },
313
- "__indexPosition": 1
314
- }
315
- },
316
- "UNIT_MULT": {
317
- "id": "UNIT_MULT",
318
- "name": "Unit multiplier",
319
- "value": {
320
- "id": "0",
321
- "order": 0,
322
- "name": "Units",
323
- "names": {
324
- "en": "Units"
325
- }
326
- }
327
- },
328
- "BASE_YEAR": {
329
- "id": "BASE_YEAR",
330
- "name": "Base Year",
331
- "value": {
332
- "id": "_Z",
333
- "order": 0,
334
- "name": "Not applicable",
335
- "names": {
336
- "en": "Not applicable"
337
- }
338
- }
339
- }
340
- },
341
- "1:x:x:1:x:x:x:x": {
342
- "UNIT_MEASURE": {
343
- "id": "UNIT_MEASURE",
344
- "name": "Unit of measure",
345
- "value": {
346
- "id": "CAD",
347
- "order": 3,
348
- "name": "Canadian Dollar",
349
- "names": {
350
- "en": "Canadian Dollar"
351
- },
352
- "__indexPosition": 3
353
- }
354
- },
355
- "UNIT_MULT": {
356
- "id": "UNIT_MULT",
357
- "name": "Unit multiplier",
358
- "value": {
359
- "id": "0",
360
- "order": 0,
361
- "name": "Units",
362
- "names": {
363
- "en": "Units"
364
- }
365
- }
366
- },
367
- "BASE_YEAR": {
368
- "id": "BASE_YEAR",
369
- "name": "Base Year",
370
- "value": {
371
- "id": "_Z",
372
- "order": 0,
373
- "name": "Not applicable",
374
- "names": {
375
- "en": "Not applicable"
376
- }
377
- }
378
- }
379
- },
380
- "2:x:x:2:x:x:x:x": {
381
- "UNIT_MEASURE": {
382
- "id": "UNIT_MEASURE",
383
- "name": "Unit of measure",
384
- "value": {
385
- "id": "USDPPP",
386
- "order": 4,
387
- "name": "USD equivalent, PPP",
388
- "names": {
389
- "en": "USD equivalent, PPP"
390
- },
391
- "__indexPosition": 4
392
- }
393
- },
394
- "UNIT_MULT": {
395
- "id": "UNIT_MULT",
396
- "name": "Unit multiplier",
397
- "value": {
398
- "id": "0",
399
- "order": 0,
400
- "name": "Units",
401
- "names": {
402
- "en": "Units"
403
- }
404
- }
405
- },
406
- "BASE_YEAR": {
407
- "id": "BASE_YEAR",
408
- "name": "Base Year",
409
- "value": {
410
- "id": "_Z",
411
- "order": 0,
412
- "name": "Not applicable",
413
- "names": {
414
- "en": "Not applicable"
415
- }
416
- }
417
- }
418
- },
419
- "3:x:x:3:x:x:x:x": {
420
- "UNIT_MEASURE": {
421
- "id": "UNIT_MEASURE",
422
- "name": "Unit of measure",
423
- "value": {
424
- "id": "EUR",
425
- "order": 2,
426
- "name": "Euro",
427
- "names": {
428
- "en": "Euro"
429
- },
430
- "__indexPosition": 2
431
- }
432
- },
433
- "UNIT_MULT": {
434
- "id": "UNIT_MULT",
435
- "name": "Unit multiplier",
436
- "value": {
437
- "id": "0",
438
- "order": 0,
439
- "name": "Units",
440
- "names": {
441
- "en": "Units"
442
- }
443
- }
444
- },
445
- "BASE_YEAR": {
446
- "id": "BASE_YEAR",
447
- "name": "Base Year",
448
- "value": {
449
- "id": "_Z",
450
- "order": 0,
451
- "name": "Not applicable",
452
- "names": {
453
- "en": "Not applicable"
454
- }
455
- }
456
- }
457
- }
458
- }
459
- },
460
- "observations": {
461
- "0:0:0:0:0:0:0:0": {
462
- "value": 162.06,
463
- "dimValuesIndexes": [
464
- "0",
465
- "0",
466
- "0",
467
- "0",
468
- "0",
469
- "0",
470
- "0",
471
- "0"
472
- ],
473
- "attrValuesIndexes": [
474
- 0,
475
- 0,
476
- 0,
477
- 0
478
- ],
479
- "attributes": {
480
- "OBS_STATUS": {
481
- "id": "OBS_STATUS",
482
- "name": "Observation status",
483
- "value": {
484
- "id": "A",
485
- "name": "Normal value"
486
- }
487
- }
488
- },
489
- "units": {
490
- "UNIT_MEASURE": {
491
- "id": "UNIT_MEASURE",
492
- "name": "Unit of measure",
493
- "value": {
494
- "id": "AUD",
495
- "order": 1,
496
- "name": "Australien Dollar",
497
- "names": {
498
- "en": "Australien Dollar"
499
- },
500
- "__indexPosition": 1
501
- }
502
- },
503
- "UNIT_MULT": {
504
- "id": "UNIT_MULT",
505
- "name": "Unit multiplier",
506
- "value": {
507
- "id": "0",
508
- "order": 0,
509
- "name": "Units",
510
- "names": {
511
- "en": "Units"
512
- }
513
- }
514
- },
515
- "BASE_YEAR": {
516
- "id": "BASE_YEAR",
517
- "name": "Base Year",
518
- "value": {
519
- "id": "_Z",
520
- "order": 0,
521
- "name": "Not applicable",
522
- "names": {
523
- "en": "Not applicable"
524
- }
525
- }
526
- }
527
- }
528
- },
529
- "0:0:0:0:0:0:0:1": {
530
- "value": 166.5,
531
- "dimValuesIndexes": [
532
- "0",
533
- "0",
534
- "0",
535
- "0",
536
- "0",
537
- "0",
538
- "0",
539
- "1"
540
- ],
541
- "attrValuesIndexes": [
542
- 0,
543
- 0,
544
- 0,
545
- 0
546
- ],
547
- "attributes": {
548
- "OBS_STATUS": {
549
- "id": "OBS_STATUS",
550
- "name": "Observation status",
551
- "value": {
552
- "id": "A",
553
- "name": "Normal value"
554
- }
555
- }
556
- },
557
- "units": {
558
- "UNIT_MEASURE": {
559
- "id": "UNIT_MEASURE",
560
- "name": "Unit of measure",
561
- "value": {
562
- "id": "AUD",
563
- "order": 1,
564
- "name": "Australien Dollar",
565
- "names": {
566
- "en": "Australien Dollar"
567
- },
568
- "__indexPosition": 1
569
- }
570
- },
571
- "UNIT_MULT": {
572
- "id": "UNIT_MULT",
573
- "name": "Unit multiplier",
574
- "value": {
575
- "id": "0",
576
- "order": 0,
577
- "name": "Units",
578
- "names": {
579
- "en": "Units"
580
- }
581
- }
582
- },
583
- "BASE_YEAR": {
584
- "id": "BASE_YEAR",
585
- "name": "Base Year",
586
- "value": {
587
- "id": "_Z",
588
- "order": 0,
589
- "name": "Not applicable",
590
- "names": {
591
- "en": "Not applicable"
592
- }
593
- }
594
- }
595
- }
596
- },
597
- "0:0:0:0:0:0:0:2": {
598
- "value": 170.94,
599
- "dimValuesIndexes": [
600
- "0",
601
- "0",
602
- "0",
603
- "0",
604
- "0",
605
- "0",
606
- "0",
607
- "2"
608
- ],
609
- "attrValuesIndexes": [
610
- 0,
611
- 0,
612
- 0,
613
- 0
614
- ],
615
- "attributes": {
616
- "OBS_STATUS": {
617
- "id": "OBS_STATUS",
618
- "name": "Observation status",
619
- "value": {
620
- "id": "A",
621
- "name": "Normal value"
622
- }
623
- }
624
- },
625
- "units": {
626
- "UNIT_MEASURE": {
627
- "id": "UNIT_MEASURE",
628
- "name": "Unit of measure",
629
- "value": {
630
- "id": "AUD",
631
- "order": 1,
632
- "name": "Australien Dollar",
633
- "names": {
634
- "en": "Australien Dollar"
635
- },
636
- "__indexPosition": 1
637
- }
638
- },
639
- "UNIT_MULT": {
640
- "id": "UNIT_MULT",
641
- "name": "Unit multiplier",
642
- "value": {
643
- "id": "0",
644
- "order": 0,
645
- "name": "Units",
646
- "names": {
647
- "en": "Units"
648
- }
649
- }
650
- },
651
- "BASE_YEAR": {
652
- "id": "BASE_YEAR",
653
- "name": "Base Year",
654
- "value": {
655
- "id": "_Z",
656
- "order": 0,
657
- "name": "Not applicable",
658
- "names": {
659
- "en": "Not applicable"
660
- }
661
- }
662
- }
663
- }
664
- },
665
- "1:0:0:1:0:0:0:0": {
666
- "value": 164.28,
667
- "dimValuesIndexes": [
668
- "1",
669
- "0",
670
- "0",
671
- "1",
672
- "0",
673
- "0",
674
- "0",
675
- "0"
676
- ],
677
- "attrValuesIndexes": [
678
- 0,
679
- 0,
680
- 0,
681
- 1
682
- ],
683
- "attributes": {
684
- "OBS_STATUS": {
685
- "id": "OBS_STATUS",
686
- "name": "Observation status",
687
- "value": {
688
- "id": "A",
689
- "name": "Normal value"
690
- }
691
- }
692
- },
693
- "units": {
694
- "UNIT_MEASURE": {
695
- "id": "UNIT_MEASURE",
696
- "name": "Unit of measure",
697
- "value": {
698
- "id": "CAD",
699
- "order": 3,
700
- "name": "Canadian Dollar",
701
- "names": {
702
- "en": "Canadian Dollar"
703
- },
704
- "__indexPosition": 3
705
- }
706
- },
707
- "UNIT_MULT": {
708
- "id": "UNIT_MULT",
709
- "name": "Unit multiplier",
710
- "value": {
711
- "id": "0",
712
- "order": 0,
713
- "name": "Units",
714
- "names": {
715
- "en": "Units"
716
- }
717
- }
718
- },
719
- "BASE_YEAR": {
720
- "id": "BASE_YEAR",
721
- "name": "Base Year",
722
- "value": {
723
- "id": "_Z",
724
- "order": 0,
725
- "name": "Not applicable",
726
- "names": {
727
- "en": "Not applicable"
728
- }
729
- }
730
- }
731
- }
732
- },
733
- "1:0:0:1:0:0:0:1": {
734
- "value": 168.72,
735
- "dimValuesIndexes": [
736
- "1",
737
- "0",
738
- "0",
739
- "1",
740
- "0",
741
- "0",
742
- "0",
743
- "1"
744
- ],
745
- "attrValuesIndexes": [
746
- 0,
747
- 0,
748
- 0,
749
- 1
750
- ],
751
- "attributes": {
752
- "OBS_STATUS": {
753
- "id": "OBS_STATUS",
754
- "name": "Observation status",
755
- "value": {
756
- "id": "A",
757
- "name": "Normal value"
758
- }
759
- }
760
- },
761
- "units": {
762
- "UNIT_MEASURE": {
763
- "id": "UNIT_MEASURE",
764
- "name": "Unit of measure",
765
- "value": {
766
- "id": "CAD",
767
- "order": 3,
768
- "name": "Canadian Dollar",
769
- "names": {
770
- "en": "Canadian Dollar"
771
- },
772
- "__indexPosition": 3
773
- }
774
- },
775
- "UNIT_MULT": {
776
- "id": "UNIT_MULT",
777
- "name": "Unit multiplier",
778
- "value": {
779
- "id": "0",
780
- "order": 0,
781
- "name": "Units",
782
- "names": {
783
- "en": "Units"
784
- }
785
- }
786
- },
787
- "BASE_YEAR": {
788
- "id": "BASE_YEAR",
789
- "name": "Base Year",
790
- "value": {
791
- "id": "_Z",
792
- "order": 0,
793
- "name": "Not applicable",
794
- "names": {
795
- "en": "Not applicable"
796
- }
797
- }
798
- }
799
- }
800
- },
801
- "1:0:0:1:0:0:0:2": {
802
- "value": 173.16,
803
- "dimValuesIndexes": [
804
- "1",
805
- "0",
806
- "0",
807
- "1",
808
- "0",
809
- "0",
810
- "0",
811
- "2"
812
- ],
813
- "attrValuesIndexes": [
814
- 0,
815
- 0,
816
- 0,
817
- 1
818
- ],
819
- "attributes": {
820
- "OBS_STATUS": {
821
- "id": "OBS_STATUS",
822
- "name": "Observation status",
823
- "value": {
824
- "id": "A",
825
- "name": "Normal value"
826
- }
827
- }
828
- },
829
- "units": {
830
- "UNIT_MEASURE": {
831
- "id": "UNIT_MEASURE",
832
- "name": "Unit of measure",
833
- "value": {
834
- "id": "CAD",
835
- "order": 3,
836
- "name": "Canadian Dollar",
837
- "names": {
838
- "en": "Canadian Dollar"
839
- },
840
- "__indexPosition": 3
841
- }
842
- },
843
- "UNIT_MULT": {
844
- "id": "UNIT_MULT",
845
- "name": "Unit multiplier",
846
- "value": {
847
- "id": "0",
848
- "order": 0,
849
- "name": "Units",
850
- "names": {
851
- "en": "Units"
852
- }
853
- }
854
- },
855
- "BASE_YEAR": {
856
- "id": "BASE_YEAR",
857
- "name": "Base Year",
858
- "value": {
859
- "id": "_Z",
860
- "order": 0,
861
- "name": "Not applicable",
862
- "names": {
863
- "en": "Not applicable"
864
- }
865
- }
866
- }
867
- }
868
- },
869
- "2:0:0:2:0:0:0:0": {
870
- "value": 160.95,
871
- "dimValuesIndexes": [
872
- "2",
873
- "0",
874
- "0",
875
- "2",
876
- "0",
877
- "0",
878
- "0",
879
- "0"
880
- ],
881
- "attrValuesIndexes": [
882
- 0,
883
- 0,
884
- 0,
885
- 2
886
- ],
887
- "attributes": {
888
- "OBS_STATUS": {
889
- "id": "OBS_STATUS",
890
- "name": "Observation status",
891
- "value": {
892
- "id": "A",
893
- "name": "Normal value"
894
- }
895
- }
896
- },
897
- "units": {
898
- "UNIT_MEASURE": {
899
- "id": "UNIT_MEASURE",
900
- "name": "Unit of measure",
901
- "value": {
902
- "id": "USDPPP",
903
- "order": 4,
904
- "name": "USD equivalent, PPP",
905
- "names": {
906
- "en": "USD equivalent, PPP"
907
- },
908
- "__indexPosition": 4
909
- }
910
- },
911
- "UNIT_MULT": {
912
- "id": "UNIT_MULT",
913
- "name": "Unit multiplier",
914
- "value": {
915
- "id": "0",
916
- "order": 0,
917
- "name": "Units",
918
- "names": {
919
- "en": "Units"
920
- }
921
- }
922
- },
923
- "BASE_YEAR": {
924
- "id": "BASE_YEAR",
925
- "name": "Base Year",
926
- "value": {
927
- "id": "_Z",
928
- "order": 0,
929
- "name": "Not applicable",
930
- "names": {
931
- "en": "Not applicable"
932
- }
933
- }
934
- }
935
- }
936
- },
937
- "2:0:0:2:0:0:0:1": {
938
- "value": 165.39,
939
- "dimValuesIndexes": [
940
- "2",
941
- "0",
942
- "0",
943
- "2",
944
- "0",
945
- "0",
946
- "0",
947
- "1"
948
- ],
949
- "attrValuesIndexes": [
950
- 0,
951
- 0,
952
- 0,
953
- 2
954
- ],
955
- "attributes": {
956
- "OBS_STATUS": {
957
- "id": "OBS_STATUS",
958
- "name": "Observation status",
959
- "value": {
960
- "id": "A",
961
- "name": "Normal value"
962
- }
963
- }
964
- },
965
- "units": {
966
- "UNIT_MEASURE": {
967
- "id": "UNIT_MEASURE",
968
- "name": "Unit of measure",
969
- "value": {
970
- "id": "USDPPP",
971
- "order": 4,
972
- "name": "USD equivalent, PPP",
973
- "names": {
974
- "en": "USD equivalent, PPP"
975
- },
976
- "__indexPosition": 4
977
- }
978
- },
979
- "UNIT_MULT": {
980
- "id": "UNIT_MULT",
981
- "name": "Unit multiplier",
982
- "value": {
983
- "id": "0",
984
- "order": 0,
985
- "name": "Units",
986
- "names": {
987
- "en": "Units"
988
- }
989
- }
990
- },
991
- "BASE_YEAR": {
992
- "id": "BASE_YEAR",
993
- "name": "Base Year",
994
- "value": {
995
- "id": "_Z",
996
- "order": 0,
997
- "name": "Not applicable",
998
- "names": {
999
- "en": "Not applicable"
1000
- }
1001
- }
1002
- }
1003
- }
1004
- },
1005
- "2:0:0:2:0:0:0:2": {
1006
- "value": 169.83,
1007
- "dimValuesIndexes": [
1008
- "2",
1009
- "0",
1010
- "0",
1011
- "2",
1012
- "0",
1013
- "0",
1014
- "0",
1015
- "2"
1016
- ],
1017
- "attrValuesIndexes": [
1018
- 0,
1019
- 0,
1020
- 0,
1021
- 2
1022
- ],
1023
- "attributes": {
1024
- "OBS_STATUS": {
1025
- "id": "OBS_STATUS",
1026
- "name": "Observation status",
1027
- "value": {
1028
- "id": "A",
1029
- "name": "Normal value"
1030
- }
1031
- }
1032
- },
1033
- "units": {
1034
- "UNIT_MEASURE": {
1035
- "id": "UNIT_MEASURE",
1036
- "name": "Unit of measure",
1037
- "value": {
1038
- "id": "USDPPP",
1039
- "order": 4,
1040
- "name": "USD equivalent, PPP",
1041
- "names": {
1042
- "en": "USD equivalent, PPP"
1043
- },
1044
- "__indexPosition": 4
1045
- }
1046
- },
1047
- "UNIT_MULT": {
1048
- "id": "UNIT_MULT",
1049
- "name": "Unit multiplier",
1050
- "value": {
1051
- "id": "0",
1052
- "order": 0,
1053
- "name": "Units",
1054
- "names": {
1055
- "en": "Units"
1056
- }
1057
- }
1058
- },
1059
- "BASE_YEAR": {
1060
- "id": "BASE_YEAR",
1061
- "name": "Base Year",
1062
- "value": {
1063
- "id": "_Z",
1064
- "order": 0,
1065
- "name": "Not applicable",
1066
- "names": {
1067
- "en": "Not applicable"
1068
- }
1069
- }
1070
- }
1071
- }
1072
- },
1073
- "3:0:0:3:0:0:0:0": {
1074
- "value": 163.17,
1075
- "dimValuesIndexes": [
1076
- "3",
1077
- "0",
1078
- "0",
1079
- "3",
1080
- "0",
1081
- "0",
1082
- "0",
1083
- "0"
1084
- ],
1085
- "attrValuesIndexes": [
1086
- 0,
1087
- 0,
1088
- 0,
1089
- 3
1090
- ],
1091
- "attributes": {
1092
- "OBS_STATUS": {
1093
- "id": "OBS_STATUS",
1094
- "name": "Observation status",
1095
- "value": {
1096
- "id": "A",
1097
- "name": "Normal value"
1098
- }
1099
- }
1100
- },
1101
- "units": {
1102
- "UNIT_MEASURE": {
1103
- "id": "UNIT_MEASURE",
1104
- "name": "Unit of measure",
1105
- "value": {
1106
- "id": "EUR",
1107
- "order": 2,
1108
- "name": "Euro",
1109
- "names": {
1110
- "en": "Euro"
1111
- },
1112
- "__indexPosition": 2
1113
- }
1114
- },
1115
- "UNIT_MULT": {
1116
- "id": "UNIT_MULT",
1117
- "name": "Unit multiplier",
1118
- "value": {
1119
- "id": "0",
1120
- "order": 0,
1121
- "name": "Units",
1122
- "names": {
1123
- "en": "Units"
1124
- }
1125
- }
1126
- },
1127
- "BASE_YEAR": {
1128
- "id": "BASE_YEAR",
1129
- "name": "Base Year",
1130
- "value": {
1131
- "id": "_Z",
1132
- "order": 0,
1133
- "name": "Not applicable",
1134
- "names": {
1135
- "en": "Not applicable"
1136
- }
1137
- }
1138
- }
1139
- }
1140
- },
1141
- "3:0:0:3:0:0:0:1": {
1142
- "value": 167.61,
1143
- "dimValuesIndexes": [
1144
- "3",
1145
- "0",
1146
- "0",
1147
- "3",
1148
- "0",
1149
- "0",
1150
- "0",
1151
- "1"
1152
- ],
1153
- "attrValuesIndexes": [
1154
- 0,
1155
- 0,
1156
- 0,
1157
- 3
1158
- ],
1159
- "attributes": {
1160
- "OBS_STATUS": {
1161
- "id": "OBS_STATUS",
1162
- "name": "Observation status",
1163
- "value": {
1164
- "id": "A",
1165
- "name": "Normal value"
1166
- }
1167
- }
1168
- },
1169
- "units": {
1170
- "UNIT_MEASURE": {
1171
- "id": "UNIT_MEASURE",
1172
- "name": "Unit of measure",
1173
- "value": {
1174
- "id": "EUR",
1175
- "order": 2,
1176
- "name": "Euro",
1177
- "names": {
1178
- "en": "Euro"
1179
- },
1180
- "__indexPosition": 2
1181
- }
1182
- },
1183
- "UNIT_MULT": {
1184
- "id": "UNIT_MULT",
1185
- "name": "Unit multiplier",
1186
- "value": {
1187
- "id": "0",
1188
- "order": 0,
1189
- "name": "Units",
1190
- "names": {
1191
- "en": "Units"
1192
- }
1193
- }
1194
- },
1195
- "BASE_YEAR": {
1196
- "id": "BASE_YEAR",
1197
- "name": "Base Year",
1198
- "value": {
1199
- "id": "_Z",
1200
- "order": 0,
1201
- "name": "Not applicable",
1202
- "names": {
1203
- "en": "Not applicable"
1204
- }
1205
- }
1206
- }
1207
- }
1208
- },
1209
- "3:0:0:3:0:0:0:2": {
1210
- "value": 172.05,
1211
- "dimValuesIndexes": [
1212
- "3",
1213
- "0",
1214
- "0",
1215
- "3",
1216
- "0",
1217
- "0",
1218
- "0",
1219
- "2"
1220
- ],
1221
- "attrValuesIndexes": [
1222
- 0,
1223
- 0,
1224
- 0,
1225
- 3
1226
- ],
1227
- "attributes": {
1228
- "OBS_STATUS": {
1229
- "id": "OBS_STATUS",
1230
- "name": "Observation status",
1231
- "value": {
1232
- "id": "A",
1233
- "name": "Normal value"
1234
- }
1235
- }
1236
- },
1237
- "units": {
1238
- "UNIT_MEASURE": {
1239
- "id": "UNIT_MEASURE",
1240
- "name": "Unit of measure",
1241
- "value": {
1242
- "id": "EUR",
1243
- "order": 2,
1244
- "name": "Euro",
1245
- "names": {
1246
- "en": "Euro"
1247
- },
1248
- "__indexPosition": 2
1249
- }
1250
- },
1251
- "UNIT_MULT": {
1252
- "id": "UNIT_MULT",
1253
- "name": "Unit multiplier",
1254
- "value": {
1255
- "id": "0",
1256
- "order": 0,
1257
- "name": "Units",
1258
- "names": {
1259
- "en": "Units"
1260
- }
1261
- }
1262
- },
1263
- "BASE_YEAR": {
1264
- "id": "BASE_YEAR",
1265
- "name": "Base Year",
1266
- "value": {
1267
- "id": "_Z",
1268
- "order": 0,
1269
- "name": "Not applicable",
1270
- "names": {
1271
- "en": "Not applicable"
1272
- }
1273
- }
1274
- }
1275
- }
1276
- }
1277
- },
1278
- "dataflowAttributes": {},
1279
- "dataflowName": "National Accounts (UoM)",
1280
- "seriesAttributes": [],
1281
- "seriesAttributesValues": {}
1282
- }
1283
-
1284
- const layout = {
1285
- "sections": [],
1286
- "rows": [
1287
- "REF_AREA",
1288
- "UNIT_MEASURE"
1289
- ],
1290
- "header": [
1291
- "TIME_PERIOD"
1292
- ]
1293
- };
1294
-
1295
- describe('getTableData tests', () => {
1296
- it('blank test', () => {
1297
- expect(getTableProps({
1298
- data,
1299
- layoutIds: { header: [], rows: [], sections: [] },
1300
- display: 'label',
1301
- customAttributes: {
1302
- "flags": [],
1303
- "footnotes": [],
1304
- },
1305
- limit: 0,
1306
- isTimeInverted: false,
1307
- observationsType: null
1308
- })).to.deep.equal({
1309
- truncated: false,
1310
- totalCells: null,
1311
- cells: {},
1312
- headerData: [],
1313
- sectionsData: [],
1314
- layout: { header: [], rows: [], sections: [] }
1315
- });
1316
- });
1317
- });