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