@sis-cc/dotstatsuite-components 9.1.3 → 9.2.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 (78) hide show
  1. package/lib/rules/src/preparators/enhanceObservations.js +155 -0
  2. package/lib/rules/src/preparators/formatValue.js +77 -0
  3. package/lib/rules/src/preparators/getDimensions.js +55 -0
  4. package/lib/rules/src/preparators/getDisplay.js +32 -0
  5. package/lib/rules/src/preparators/getObservations.js +27 -0
  6. package/lib/rules/src/table/factories/getCells.js +1 -3
  7. package/lib/rules/src/table/factories/getLayoutData.js +102 -161
  8. package/lib/rules/src/table/factories/getSortedLayoutIndexes.js +118 -0
  9. package/lib/rules/src/table/factories/getTableData.js +12 -10
  10. package/lib/rules/src/table/factories/refineLayoutSize.js +210 -0
  11. package/lib/rules/src/table/preparators/prepareData.js +23 -23
  12. package/lib/rules/src/table/units/getAttachmentSeriesIndexes.js +1 -1
  13. package/lib/rules/src/table/units/getUnitsSeries.js +31 -0
  14. package/lib/rules/src/v8-transformer.js +2 -1
  15. package/package.json +1 -1
  16. package/src/rules/src/preparators/enhanceObservations.js +163 -0
  17. package/src/rules/src/preparators/formatValue.js +73 -0
  18. package/src/rules/src/preparators/getDimensions.js +49 -0
  19. package/src/rules/src/preparators/getDisplay.js +20 -0
  20. package/src/rules/src/preparators/getObservations.js +19 -0
  21. package/src/rules/src/table/factories/getCells.js +3 -7
  22. package/src/rules/src/table/factories/getLayoutData.js +135 -184
  23. package/src/rules/src/table/factories/getSortedLayoutIndexes.js +108 -0
  24. package/src/rules/src/table/factories/getTableData.js +10 -10
  25. package/src/rules/src/table/factories/refineLayoutSize.js +224 -0
  26. package/src/rules/src/table/preparators/prepareData.js +23 -32
  27. package/src/rules/src/table/units/getAttachmentSeriesIndexes.js +2 -1
  28. package/src/rules/src/table/units/getUnitsSeries.js +20 -0
  29. package/src/rules/src/v8-transformer.js +2 -1
  30. package/test/appendUnitsInLayoutDataEntry.test.js +3 -3
  31. package/test/enhanceObservations.test.js +270 -0
  32. package/test/getAttachmentSeriesIndexes.test.js +1 -1
  33. package/test/getCells.test.js +4 -39
  34. package/test/getLayoutData2.test.js +194 -0
  35. package/test/getOneValueDimensions.test.js +1 -1
  36. package/test/getSortedLayoutIndexes.test.js +80 -0
  37. package/test/getUnitsArtefacts.test.js +1 -1
  38. package/test/getUnitsSeries.test.js +64 -0
  39. package/test/mocks/table-layout-multi-hierarchies--layout.json +621 -0
  40. package/test/mocks/table-layout-multi-hierarchies--layoutData.json +32410 -0
  41. package/test/mocks/table-layout-multi-hierarchies--layoutIndexes.json +2760 -0
  42. package/test/mocks/table-layout-multi-hierarchies--observations.json +30688 -0
  43. package/test/mocks/table-layout-multi-hierarchies--sizedIndexes.json +2761 -0
  44. package/test/mocks/table-layout-truncation1--layout.json +27469 -0
  45. package/test/mocks/table-layout-truncation1--layoutData.json +19413 -0
  46. package/test/mocks/table-layout-truncation1--layoutIndexes.json +7512 -0
  47. package/test/mocks/table-layout-truncation1--observations.json +70002 -0
  48. package/test/mocks/table-layout-truncation1--sizedIndexes.json +3010 -0
  49. package/test/mocks/table-prep-multi-hierarchies--attributes.json +44 -0
  50. package/test/mocks/table-prep-multi-hierarchies--dimensions.json +688 -0
  51. package/test/mocks/table-prep-multi-hierarchies--enhancedObservations.json +19696 -0
  52. package/test/mocks/table-prep-multi-hierarchies--observations.json +8246 -0
  53. package/test/mocks/table-prep-multi-hierarchies--sdmxJson.json +2985 -0
  54. package/test/mocks/table-prep-truncation1--dimensions.json +35057 -0
  55. package/test/mocks/table-prep-truncation1--enhancedObservations.json +70002 -0
  56. package/test/mocks/table-prep-truncation1--observations.json +27502 -0
  57. package/test/mocks/table-prep-truncation1--sdmxJson.json +55103 -0
  58. package/test/mocks/table-prep-units--observations.json +284286 -0
  59. package/test/mocks/table-prep-units--unitsSeries.json +41042 -0
  60. package/test/parseAttributes.test.js +1 -1
  61. package/test/refineLayoutSize.test.js +415 -0
  62. package/test/table-layout-perf.test.js +74 -0
  63. package/test/table-prep-perf.test.js +65 -0
  64. package/lib/rules/src/table/factories/getSortedLayoutData.js +0 -145
  65. package/lib/rules/src/table/factories/refineLayoutHierarchy.js +0 -61
  66. package/lib/rules/src/table/preparators/parseObservations.js +0 -76
  67. package/lib/rules/src/table/units/getUnitsSeriesOccurences.js +0 -39
  68. package/src/rules/src/table/factories/getSortedLayoutData.js +0 -133
  69. package/src/rules/src/table/factories/refineLayoutHierarchy.js +0 -64
  70. package/src/rules/src/table/preparators/parseObservations.js +0 -81
  71. package/src/rules/src/table/units/getUnitsSeriesOccurences.js +0 -51
  72. package/test/appendUnitsInLayoutData.test.js +0 -248
  73. package/test/getLayoutData.test.js +0 -311
  74. package/test/getSortedLayoutData.test.js +0 -382
  75. package/test/getUnitsSeriesOccurences.test.js +0 -133
  76. package/test/parseObservations.test.js +0 -116
  77. package/test/refineDimSeriesUnits.test.js +0 -24
  78. package/test/refineLayoutHierarchy.test.js +0 -79
@@ -0,0 +1,621 @@
1
+ {
2
+ "header": [],
3
+ "sections": [],
4
+ "rows": [
5
+ {
6
+ "id": "MARITAL_STATUS",
7
+ "name": "Marital status",
8
+ "names": {
9
+ "en": "Marital status"
10
+ },
11
+ "keyPosition": 1,
12
+ "roles": [
13
+ "MARITAL_STATUS"
14
+ ],
15
+ "values": [
16
+ {
17
+ "id": "_T",
18
+ "name": "Total",
19
+ "__indexPosition": 0,
20
+ "__index": 0,
21
+ "attributes": {},
22
+ "parents": []
23
+ },
24
+ {
25
+ "id": "2",
26
+ "name": "Married",
27
+ "__indexPosition": 1,
28
+ "parent": "_T",
29
+ "__index": 1,
30
+ "attributes": {},
31
+ "parents": [
32
+ "_T"
33
+ ]
34
+ }
35
+ ],
36
+ "__index": 1,
37
+ "role": "MARITAL_STATUS"
38
+ },
39
+ {
40
+ "id": "SEX",
41
+ "name": "Sex",
42
+ "names": {
43
+ "en": "Sex"
44
+ },
45
+ "keyPosition": 4,
46
+ "roles": [
47
+ "SEX"
48
+ ],
49
+ "values": [
50
+ {
51
+ "id": "_T",
52
+ "name": "Total",
53
+ "__indexPosition": 0,
54
+ "__index": 0,
55
+ "attributes": {},
56
+ "parents": []
57
+ },
58
+ {
59
+ "id": "M",
60
+ "name": "Male",
61
+ "__indexPosition": 1,
62
+ "parent": "_T",
63
+ "__index": 1,
64
+ "attributes": {},
65
+ "parents": [
66
+ "_T"
67
+ ]
68
+ },
69
+ {
70
+ "id": "F",
71
+ "name": "Female",
72
+ "__indexPosition": 2,
73
+ "parent": "_T",
74
+ "__index": 2,
75
+ "attributes": {},
76
+ "parents": [
77
+ "_T"
78
+ ]
79
+ }
80
+ ],
81
+ "__index": 4,
82
+ "role": "SEX"
83
+ },
84
+ {
85
+ "id": "CITIZENSHIP",
86
+ "name": "Citizenship",
87
+ "names": {
88
+ "en": "Citizenship"
89
+ },
90
+ "keyPosition": 3,
91
+ "roles": [
92
+ "CITIZENSHIP"
93
+ ],
94
+ "values": [
95
+ {
96
+ "id": "_T",
97
+ "name": "Total",
98
+ "__indexPosition": 0,
99
+ "__index": 0,
100
+ "attributes": {},
101
+ "parents": []
102
+ },
103
+ {
104
+ "id": "CH",
105
+ "name": "Switzerland",
106
+ "__indexPosition": 1,
107
+ "parent": "_T",
108
+ "__index": 1,
109
+ "attributes": {},
110
+ "parents": [
111
+ "_T"
112
+ ]
113
+ },
114
+ {
115
+ "id": "_O",
116
+ "name": "Other countries",
117
+ "__indexPosition": 2,
118
+ "parent": "_T",
119
+ "__index": 2,
120
+ "attributes": {},
121
+ "parents": [
122
+ "_T"
123
+ ]
124
+ }
125
+ ],
126
+ "__index": 3,
127
+ "role": "CITIZENSHIP"
128
+ },
129
+ {
130
+ "id": "REF_AREA",
131
+ "name": "Reference area",
132
+ "names": {
133
+ "en": "Reference area"
134
+ },
135
+ "keyPosition": 0,
136
+ "roles": [
137
+ "REF_AREA"
138
+ ],
139
+ "values": [
140
+ {
141
+ "id": "BE",
142
+ "name": "Bern",
143
+ "__indexPosition": 0,
144
+ "parent": "_CH",
145
+ "__index": 7,
146
+ "attributes": {},
147
+ "parents": []
148
+ },
149
+ {
150
+ "id": "B_243",
151
+ "name": "Seeland",
152
+ "__indexPosition": 1,
153
+ "parent": "BE",
154
+ "__index": 24,
155
+ "attributes": {},
156
+ "parents": [
157
+ "BE"
158
+ ]
159
+ },
160
+ {
161
+ "id": "G_301",
162
+ "name": "Aarberg",
163
+ "__indexPosition": 2,
164
+ "parent": "B_243",
165
+ "__index": 0,
166
+ "attributes": {},
167
+ "parents": [
168
+ "BE",
169
+ "B_243"
170
+ ]
171
+ },
172
+ {
173
+ "id": "G_302",
174
+ "name": "Bargen (BE)",
175
+ "__indexPosition": 3,
176
+ "parent": "B_243",
177
+ "__index": 21,
178
+ "attributes": {},
179
+ "parents": [
180
+ "BE",
181
+ "B_243"
182
+ ]
183
+ },
184
+ {
185
+ "id": "G_303",
186
+ "name": "Grossaffoltern",
187
+ "__indexPosition": 4,
188
+ "parent": "B_243",
189
+ "__index": 12,
190
+ "attributes": {},
191
+ "parents": [
192
+ "BE",
193
+ "B_243"
194
+ ]
195
+ },
196
+ {
197
+ "id": "G_304",
198
+ "name": "Kallnach",
199
+ "__indexPosition": 5,
200
+ "parent": "B_243",
201
+ "__index": 18,
202
+ "attributes": {},
203
+ "parents": [
204
+ "BE",
205
+ "B_243"
206
+ ]
207
+ },
208
+ {
209
+ "id": "G_305",
210
+ "name": "Kappelen",
211
+ "__indexPosition": 6,
212
+ "parent": "B_243",
213
+ "__index": 9,
214
+ "attributes": {},
215
+ "parents": [
216
+ "BE",
217
+ "B_243"
218
+ ]
219
+ },
220
+ {
221
+ "id": "G_306",
222
+ "name": "Lyss",
223
+ "__indexPosition": 7,
224
+ "parent": "B_243",
225
+ "__index": 17,
226
+ "attributes": {},
227
+ "parents": [
228
+ "BE",
229
+ "B_243"
230
+ ]
231
+ },
232
+ {
233
+ "id": "G_309",
234
+ "name": "Radelfingen",
235
+ "__indexPosition": 8,
236
+ "parent": "B_243",
237
+ "__index": 32,
238
+ "attributes": {},
239
+ "parents": [
240
+ "BE",
241
+ "B_243"
242
+ ]
243
+ },
244
+ {
245
+ "id": "G_310",
246
+ "name": "Rapperswil (BE)",
247
+ "__indexPosition": 9,
248
+ "parent": "B_243",
249
+ "__index": 2,
250
+ "attributes": {},
251
+ "parents": [
252
+ "BE",
253
+ "B_243"
254
+ ]
255
+ },
256
+ {
257
+ "id": "G_311",
258
+ "name": "Schüpfen",
259
+ "__indexPosition": 10,
260
+ "parent": "B_243",
261
+ "__index": 3,
262
+ "attributes": {},
263
+ "parents": [
264
+ "BE",
265
+ "B_243"
266
+ ]
267
+ },
268
+ {
269
+ "id": "G_312",
270
+ "name": "Seedorf (BE)",
271
+ "__indexPosition": 11,
272
+ "parent": "B_243",
273
+ "__index": 36,
274
+ "attributes": {},
275
+ "parents": [
276
+ "BE",
277
+ "B_243"
278
+ ]
279
+ },
280
+ {
281
+ "id": "G_381",
282
+ "name": "Arch",
283
+ "__indexPosition": 12,
284
+ "parent": "B_243",
285
+ "__index": 19,
286
+ "attributes": {},
287
+ "parents": [
288
+ "BE",
289
+ "B_243"
290
+ ]
291
+ },
292
+ {
293
+ "id": "G_382",
294
+ "name": "Büetigen",
295
+ "__indexPosition": 13,
296
+ "parent": "B_243",
297
+ "__index": 31,
298
+ "attributes": {},
299
+ "parents": [
300
+ "BE",
301
+ "B_243"
302
+ ]
303
+ },
304
+ {
305
+ "id": "G_383",
306
+ "name": "Büren an der Aare",
307
+ "__indexPosition": 14,
308
+ "parent": "B_243",
309
+ "__index": 11,
310
+ "attributes": {},
311
+ "parents": [
312
+ "BE",
313
+ "B_243"
314
+ ]
315
+ },
316
+ {
317
+ "id": "G_385",
318
+ "name": "Diessbach bei Büren",
319
+ "__indexPosition": 15,
320
+ "parent": "B_243",
321
+ "__index": 34,
322
+ "attributes": {},
323
+ "parents": [
324
+ "BE",
325
+ "B_243"
326
+ ]
327
+ },
328
+ {
329
+ "id": "G_386",
330
+ "name": "Dotzigen",
331
+ "__indexPosition": 16,
332
+ "parent": "B_243",
333
+ "__index": 33,
334
+ "attributes": {},
335
+ "parents": [
336
+ "BE",
337
+ "B_243"
338
+ ]
339
+ },
340
+ {
341
+ "id": "G_388",
342
+ "name": "Leuzigen",
343
+ "__indexPosition": 17,
344
+ "parent": "B_243",
345
+ "__index": 22,
346
+ "attributes": {},
347
+ "parents": [
348
+ "BE",
349
+ "B_243"
350
+ ]
351
+ },
352
+ {
353
+ "id": "G_391",
354
+ "name": "Oberwil bei Büren",
355
+ "__indexPosition": 18,
356
+ "parent": "B_243",
357
+ "__index": 29,
358
+ "attributes": {},
359
+ "parents": [
360
+ "BE",
361
+ "B_243"
362
+ ]
363
+ },
364
+ {
365
+ "id": "G_393",
366
+ "name": "Rüti bei Büren",
367
+ "__indexPosition": 19,
368
+ "parent": "B_243",
369
+ "__index": 15,
370
+ "attributes": {},
371
+ "parents": [
372
+ "BE",
373
+ "B_243"
374
+ ]
375
+ },
376
+ {
377
+ "id": "G_394",
378
+ "name": "Wengi",
379
+ "__indexPosition": 20,
380
+ "parent": "B_243",
381
+ "__index": 16,
382
+ "attributes": {},
383
+ "parents": [
384
+ "BE",
385
+ "B_243"
386
+ ]
387
+ },
388
+ {
389
+ "id": "G_491",
390
+ "name": "Brüttelen",
391
+ "__indexPosition": 21,
392
+ "parent": "B_243",
393
+ "__index": 23,
394
+ "attributes": {},
395
+ "parents": [
396
+ "BE",
397
+ "B_243"
398
+ ]
399
+ },
400
+ {
401
+ "id": "G_492",
402
+ "name": "Erlach",
403
+ "__indexPosition": 22,
404
+ "parent": "B_243",
405
+ "__index": 8,
406
+ "attributes": {},
407
+ "parents": [
408
+ "BE",
409
+ "B_243"
410
+ ]
411
+ },
412
+ {
413
+ "id": "G_493",
414
+ "name": "Finsterhennen",
415
+ "__indexPosition": 23,
416
+ "parent": "B_243",
417
+ "__index": 27,
418
+ "attributes": {},
419
+ "parents": [
420
+ "BE",
421
+ "B_243"
422
+ ]
423
+ },
424
+ {
425
+ "id": "G_494",
426
+ "name": "Gals",
427
+ "__indexPosition": 24,
428
+ "parent": "B_243",
429
+ "__index": 35,
430
+ "attributes": {},
431
+ "parents": [
432
+ "BE",
433
+ "B_243"
434
+ ]
435
+ },
436
+ {
437
+ "id": "G_495",
438
+ "name": "Gampelen",
439
+ "__indexPosition": 25,
440
+ "parent": "B_243",
441
+ "__index": 20,
442
+ "attributes": {},
443
+ "parents": [
444
+ "BE",
445
+ "B_243"
446
+ ]
447
+ },
448
+ {
449
+ "id": "G_496",
450
+ "name": "Ins",
451
+ "__indexPosition": 26,
452
+ "parent": "B_243",
453
+ "__index": 6,
454
+ "attributes": {},
455
+ "parents": [
456
+ "BE",
457
+ "B_243"
458
+ ]
459
+ },
460
+ {
461
+ "id": "G_497",
462
+ "name": "Lüscherz",
463
+ "__indexPosition": 27,
464
+ "parent": "B_243",
465
+ "__index": 39,
466
+ "attributes": {},
467
+ "parents": [
468
+ "BE",
469
+ "B_243"
470
+ ]
471
+ },
472
+ {
473
+ "id": "G_498",
474
+ "name": "Müntschemier",
475
+ "__indexPosition": 28,
476
+ "parent": "B_243",
477
+ "__index": 38,
478
+ "attributes": {},
479
+ "parents": [
480
+ "BE",
481
+ "B_243"
482
+ ]
483
+ },
484
+ {
485
+ "id": "G_499",
486
+ "name": "Siselen",
487
+ "__indexPosition": 29,
488
+ "parent": "B_243",
489
+ "__index": 5,
490
+ "attributes": {},
491
+ "parents": [
492
+ "BE",
493
+ "B_243"
494
+ ]
495
+ },
496
+ {
497
+ "id": "G_500",
498
+ "name": "Treiten",
499
+ "__indexPosition": 30,
500
+ "parent": "B_243",
501
+ "__index": 26,
502
+ "attributes": {},
503
+ "parents": [
504
+ "BE",
505
+ "B_243"
506
+ ]
507
+ },
508
+ {
509
+ "id": "G_501",
510
+ "name": "Tschugg",
511
+ "__indexPosition": 31,
512
+ "parent": "B_243",
513
+ "__index": 13,
514
+ "attributes": {},
515
+ "parents": [
516
+ "BE",
517
+ "B_243"
518
+ ]
519
+ },
520
+ {
521
+ "id": "G_502",
522
+ "name": "Vinelz",
523
+ "__indexPosition": 32,
524
+ "parent": "B_243",
525
+ "__index": 1,
526
+ "attributes": {},
527
+ "parents": [
528
+ "BE",
529
+ "B_243"
530
+ ]
531
+ },
532
+ {
533
+ "id": "G_734",
534
+ "name": "Bühl",
535
+ "__indexPosition": 33,
536
+ "parent": "B_243",
537
+ "__index": 10,
538
+ "attributes": {},
539
+ "parents": [
540
+ "BE",
541
+ "B_243"
542
+ ]
543
+ },
544
+ {
545
+ "id": "G_735",
546
+ "name": "Epsach",
547
+ "__indexPosition": 34,
548
+ "parent": "B_243",
549
+ "__index": 30,
550
+ "attributes": {},
551
+ "parents": [
552
+ "BE",
553
+ "B_243"
554
+ ]
555
+ },
556
+ {
557
+ "id": "G_736",
558
+ "name": "Hagneck",
559
+ "__indexPosition": 35,
560
+ "parent": "B_243",
561
+ "__index": 37,
562
+ "attributes": {},
563
+ "parents": [
564
+ "BE",
565
+ "B_243"
566
+ ]
567
+ },
568
+ {
569
+ "id": "G_737",
570
+ "name": "Hermrigen",
571
+ "__indexPosition": 36,
572
+ "parent": "B_243",
573
+ "__index": 14,
574
+ "attributes": {},
575
+ "parents": [
576
+ "BE",
577
+ "B_243"
578
+ ]
579
+ },
580
+ {
581
+ "id": "G_738",
582
+ "name": "Jens",
583
+ "__indexPosition": 37,
584
+ "parent": "B_243",
585
+ "__index": 25,
586
+ "attributes": {},
587
+ "parents": [
588
+ "BE",
589
+ "B_243"
590
+ ]
591
+ },
592
+ {
593
+ "id": "G_741",
594
+ "name": "Merzligen",
595
+ "__indexPosition": 38,
596
+ "parent": "B_243",
597
+ "__index": 4,
598
+ "attributes": {},
599
+ "parents": [
600
+ "BE",
601
+ "B_243"
602
+ ]
603
+ },
604
+ {
605
+ "id": "G_749",
606
+ "name": "Studen (BE)",
607
+ "__indexPosition": 39,
608
+ "parent": "B_243",
609
+ "__index": 28,
610
+ "attributes": {},
611
+ "parents": [
612
+ "BE",
613
+ "B_243"
614
+ ]
615
+ }
616
+ ],
617
+ "__index": 0,
618
+ "role": "REF_AREA"
619
+ }
620
+ ]
621
+ }