@sis-cc/dotstatsuite-components 15.0.20 → 16.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.
- package/LICENSE +1 -1
- package/lib/rules/src/index.js +1 -145
- package/lib/rules/src/table/index.js +0 -42
- package/lib/rules/src/v8-transformer.js +6 -5
- package/lib/rules2/src/constants.js +3 -1
- package/lib/rules2/src/enhanceObservations.js +98 -0
- package/lib/rules2/src/getAttributesSeries.js +33 -0
- package/lib/rules2/src/getCombinationDefinitions.js +48 -0
- package/lib/rules2/src/getHeaderCombinations.js +42 -0
- package/lib/rules2/src/getHeaderSubtitle.js +41 -0
- package/lib/rules2/src/getManyValuesDimensions.js +39 -0
- package/lib/rules2/src/getNotDisplayedIds.js +5 -1
- package/lib/rules2/src/getOneValueDimensions.js +46 -0
- package/lib/rules2/src/hasCellMetadata.js +1 -1
- package/lib/rules2/src/index.js +186 -18
- package/lib/rules2/src/parseAttributes.js +50 -0
- package/lib/rules2/src/parseCombinations.js +54 -0
- package/lib/rules2/src/prepareData.js +74 -0
- package/lib/{rules/src/table/preparators/getAttributeValue.js → rules2/src/refineAttributes.js} +13 -11
- package/lib/rules2/src/table/getCells.js +74 -0
- package/lib/rules2/src/table/getCellsAttributesIds.js +63 -0
- package/lib/rules2/src/table/getCombinationDimensionsData.js +47 -0
- package/lib/rules2/src/table/getCuratedCells.js +28 -0
- package/lib/rules2/src/table/getFlagsAndNotes.js +28 -0
- package/lib/rules2/src/table/getIndexedCombinationsByDisplay.js +31 -0
- package/lib/rules2/src/table/getLayout.js +93 -0
- package/lib/rules2/src/table/getLayoutData.js +202 -0
- package/lib/{rules/src/table/factories → rules2/src/table}/getSortedLayoutIndexes.js +55 -40
- package/lib/rules2/src/table/getTableProps.js +64 -0
- package/lib/rules2/src/table/parseValueHierarchy.js +55 -0
- package/lib/{rules/src/table/factories → rules2/src/table}/refineLayoutSize.js +17 -8
- package/lib/rules2/src/{hasLayoutEntryMetadata.js → utils.js} +9 -6
- package/package.json +1 -1
- package/src/rules/src/index.js +1 -19
- package/src/rules/src/table/index.js +0 -4
- package/src/rules/src/v8-transformer.js +75 -74
- package/src/rules2/src/constants.js +2 -0
- package/src/rules2/src/enhanceObservations.js +88 -0
- package/src/rules2/src/getAttributesSeries.js +29 -0
- package/src/rules2/src/getCombinationDefinitions.js +29 -0
- package/src/rules2/src/getHeaderCombinations.js +39 -0
- package/src/rules2/src/getHeaderSubtitle.js +34 -0
- package/src/rules2/src/getManyValuesDimensions.js +34 -0
- package/src/rules2/src/getNotDisplayedIds.js +5 -1
- package/src/rules2/src/getOneValueDimensions.js +33 -0
- package/src/rules2/src/hasCellMetadata.js +1 -1
- package/src/rules2/src/index.js +21 -6
- package/src/rules2/src/parseAttributes.js +36 -0
- package/src/rules2/src/parseCombinations.js +36 -0
- package/src/rules2/src/prepareData.js +50 -0
- package/src/rules2/src/refineAttributes.js +16 -0
- package/src/rules2/src/table/getCells.js +72 -0
- package/src/rules2/src/table/getCellsAttributesIds.js +38 -0
- package/src/rules2/src/table/getCombinationDimensionsData.js +38 -0
- package/src/rules2/src/table/getCuratedCells.js +33 -0
- package/src/rules2/src/table/getFlagsAndNotes.js +21 -0
- package/src/rules2/src/table/getIndexedCombinationsByDisplay.js +16 -0
- package/src/rules2/src/table/getLayout.js +80 -0
- package/src/rules2/src/table/getLayoutData.js +183 -0
- package/src/rules2/src/table/getSortedLayoutIndexes.js +119 -0
- package/src/rules2/src/table/getTableProps.js +36 -0
- package/src/rules2/src/table/parseValueHierarchy.js +27 -0
- package/src/{rules/src/table/factories → rules2/src/table}/refineLayoutSize.js +24 -8
- package/src/rules2/src/utils.js +12 -0
- package/test/enhanceObservations2.test.js +219 -0
- package/test/getAttributesSeries.test.js +58 -0
- package/test/getCells.test.js +6 -40
- package/test/getCombinationDimensionsData.test.js +48 -0
- package/test/getNotDisplayedIds.test.js +15 -2
- package/test/getSortedLayoutIndexes.test.js +1025 -3
- package/test/parseAttributes.test.js +17 -62
- package/test/parseValueHierarchy.test.js +88 -0
- package/test/refineLayoutSize.test.js +2621 -1
- package/lib/rules/src/table/factories/getCells.js +0 -97
- package/lib/rules/src/table/factories/getConfirmedSeriesAttributesIds.js +0 -26
- package/lib/rules/src/table/factories/getCuratedCells.js +0 -45
- package/lib/rules/src/table/factories/getLayoutData.js +0 -168
- package/lib/rules/src/table/factories/getLayoutWithFlags.js +0 -133
- package/lib/rules/src/table/factories/getTableCells.js +0 -24
- package/lib/rules/src/table/factories/getTableData.js +0 -98
- package/lib/rules/src/table/preparators/getDimensionsAttributesRegisters.js +0 -43
- package/lib/rules/src/table/preparators/getManyValuesDimensions.js +0 -33
- package/lib/rules/src/table/preparators/getOneValueDimensions.js +0 -24
- package/lib/rules/src/table/preparators/getUniqValuesAttributes.js +0 -36
- package/lib/rules/src/table/preparators/parseAttributes.js +0 -84
- package/lib/rules/src/table/preparators/parseAttributesValuesFromObservations.js +0 -22
- package/lib/rules/src/table/preparators/parseDimensionsIds.js +0 -22
- package/lib/rules/src/table/preparators/prepareData.js +0 -191
- package/lib/rules/src/table/preparators/refineObservationsAttributesValues.js +0 -31
- package/lib/rules/src/table/preparators/refineSeriesAttributesValues.js +0 -23
- package/lib/rules/src/table/units/appendUnitsInLayoutData.js +0 -82
- package/lib/rules/src/table/units/appendUnitsInLayoutDataEntry.js +0 -45
- package/lib/rules/src/table/units/cleanUnitsInLayoutData.js +0 -66
- package/lib/rules/src/table/units/getAttachmentSeriesIndexes.js +0 -25
- package/lib/rules/src/table/units/getHeaderUnits.js +0 -35
- package/lib/rules/src/table/units/getUnitsArtefacts.js +0 -85
- package/lib/rules/src/table/units/getUnitsCodes.js +0 -23
- package/lib/rules/src/table/units/getUnitsDefinition.js +0 -33
- package/lib/rules/src/table/units/getUnitsDisplay.js +0 -33
- package/lib/rules/src/table/units/getUnitsSerieIndexes.js +0 -23
- package/lib/rules/src/table/units/getUnitsSeries.js +0 -49
- package/lib/rules/src/table/units/getUnitsinLayout.js +0 -74
- package/lib/rules/src/table/units/refineDimSeriesUnits.js +0 -44
- package/lib/rules2/src/getAdvancedAttributes.js +0 -124
- package/lib/rules2/src/invertTime.js +0 -33
- package/src/rules/src/table/factories/getCells.js +0 -102
- package/src/rules/src/table/factories/getConfirmedSeriesAttributesIds.js +0 -27
- package/src/rules/src/table/factories/getCuratedCells.js +0 -40
- package/src/rules/src/table/factories/getLayoutData.js +0 -171
- package/src/rules/src/table/factories/getLayoutWithFlags.js +0 -137
- package/src/rules/src/table/factories/getSortedLayoutIndexes.js +0 -108
- package/src/rules/src/table/factories/getTableCells.js +0 -16
- package/src/rules/src/table/factories/getTableData.js +0 -86
- package/src/rules/src/table/preparators/getAttributeValue.js +0 -17
- package/src/rules/src/table/preparators/getDimensionsAttributesRegisters.js +0 -51
- package/src/rules/src/table/preparators/getManyValuesDimensions.js +0 -19
- package/src/rules/src/table/preparators/getOneValueDimensions.js +0 -17
- package/src/rules/src/table/preparators/getUniqValuesAttributes.js +0 -24
- package/src/rules/src/table/preparators/parseAttributes.js +0 -113
- package/src/rules/src/table/preparators/parseAttributesValuesFromObservations.js +0 -16
- package/src/rules/src/table/preparators/parseDimensionsIds.js +0 -17
- package/src/rules/src/table/preparators/prepareData.js +0 -197
- package/src/rules/src/table/preparators/refineObservationsAttributesValues.js +0 -22
- package/src/rules/src/table/preparators/refineSeriesAttributesValues.js +0 -11
- package/src/rules/src/table/units/appendUnitsInLayoutData.js +0 -56
- package/src/rules/src/table/units/appendUnitsInLayoutDataEntry.js +0 -38
- package/src/rules/src/table/units/cleanUnitsInLayoutData.js +0 -65
- package/src/rules/src/table/units/getAttachmentSeriesIndexes.js +0 -27
- package/src/rules/src/table/units/getHeaderUnits.js +0 -32
- package/src/rules/src/table/units/getUnitsArtefacts.js +0 -90
- package/src/rules/src/table/units/getUnitsCodes.js +0 -22
- package/src/rules/src/table/units/getUnitsDefinition.js +0 -34
- package/src/rules/src/table/units/getUnitsDisplay.js +0 -19
- package/src/rules/src/table/units/getUnitsSerieIndexes.js +0 -12
- package/src/rules/src/table/units/getUnitsSeries.js +0 -41
- package/src/rules/src/table/units/getUnitsinLayout.js +0 -71
- package/src/rules/src/table/units/refineDimSeriesUnits.js +0 -26
- package/src/rules2/src/getAdvancedAttributes.js +0 -111
- package/src/rules2/src/hasLayoutEntryMetadata.js +0 -9
- package/src/rules2/src/invertTime.js +0 -22
- package/test/advanced-attributes-parsing-perf.test.js +0 -16
- package/test/appendUnitsInLayoutDataEntry.test.js +0 -65
- package/test/cleanUnitsInLayoutData.test.js +0 -85
- package/test/enhanceObservations.test.js +0 -340
- package/test/getAttachmentSeriesIndexes.test.js +0 -35
- package/test/getConfirmedSeriesAttributesIds.test.js +0 -27
- package/test/getDataflowAdvancedAttributes.test.js +0 -32
- package/test/getHeaderUnits.test.js +0 -51
- package/test/getLayoutData.test.js +0 -206
- package/test/getLayoutDataWithFlags.test.js +0 -142
- package/test/getOneValueDimensions.test.js +0 -26
- package/test/getSeriesAdvancedAttributes.test.js +0 -32
- package/test/getSubtitleFlags.test.js +0 -42
- package/test/getTableData.test.js +0 -1317
- package/test/getUnitsArtefacts.test.js +0 -117
- package/test/getUnitsDefinition.test.js +0 -37
- package/test/getUnitsInLayout.test.js +0 -77
- package/test/getUnitsSeries.test.js +0 -154
- package/test/invertTime.test.js +0 -77
- package/test/parseAttributesValuesFromObservations.test.js +0 -45
- package/test/parseDimensionsIds.test.js +0 -20
- package/test/prepareData.test.js +0 -29
- package/test/refineObservationsAttributesValues.test.js +0 -33
- package/test/table-invert-time-perf.test.js +0 -11
- package/test/table-layout-perf.test.js +0 -74
- package/test/table-prep-duplicate-perf.test.js +0 -15
- package/test/table-prep-perf.test.js +0 -61
package/lib/rules2/src/index.js
CHANGED
|
@@ -115,56 +115,224 @@ Object.defineProperty(exports, 'getMetadataCoordinates', {
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
-
var
|
|
118
|
+
var _duplicateObservations = require('./duplicateObservations');
|
|
119
119
|
|
|
120
|
-
Object.defineProperty(exports, '
|
|
120
|
+
Object.defineProperty(exports, 'duplicateObs', {
|
|
121
121
|
enumerable: true,
|
|
122
122
|
get: function get() {
|
|
123
|
-
return
|
|
123
|
+
return _duplicateObservations.duplicateObs;
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
|
-
Object.defineProperty(exports, '
|
|
126
|
+
Object.defineProperty(exports, 'hierarchiseDimensionWithAdvancedHierarchy', {
|
|
127
127
|
enumerable: true,
|
|
128
128
|
get: function get() {
|
|
129
|
-
return
|
|
129
|
+
return _hierarchiseDimensionWithAdvancedHierarchy.hierarchiseDimensionWithAdvancedHierarchy;
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
-
|
|
132
|
+
|
|
133
|
+
var _hierarchiseDimensionWithNativeHierarchy = require('./hierarchiseDimensionWithNativeHierarchy');
|
|
134
|
+
|
|
135
|
+
Object.defineProperty(exports, 'hierarchiseDimensionWithNativeHierarchy', {
|
|
133
136
|
enumerable: true,
|
|
134
137
|
get: function get() {
|
|
135
|
-
return
|
|
138
|
+
return _hierarchiseDimensionWithNativeHierarchy.hierarchiseDimensionWithNativeHierarchy;
|
|
136
139
|
}
|
|
137
140
|
});
|
|
138
141
|
|
|
139
|
-
var
|
|
142
|
+
var _getDimensionValuesIndexes = require('./getDimensionValuesIndexes');
|
|
140
143
|
|
|
141
|
-
Object.defineProperty(exports, '
|
|
144
|
+
Object.defineProperty(exports, 'getDimensionValuesIndexes', {
|
|
142
145
|
enumerable: true,
|
|
143
146
|
get: function get() {
|
|
144
|
-
return
|
|
147
|
+
return _getDimensionValuesIndexes.getDimensionValuesIndexes;
|
|
145
148
|
}
|
|
146
149
|
});
|
|
147
|
-
|
|
150
|
+
|
|
151
|
+
var _getCombinationDefinitions = require('./getCombinationDefinitions');
|
|
152
|
+
|
|
153
|
+
Object.defineProperty(exports, 'getCombinationDefinitions', {
|
|
148
154
|
enumerable: true,
|
|
149
155
|
get: function get() {
|
|
150
|
-
return
|
|
156
|
+
return _getCombinationDefinitions.getCombinationDefinitions;
|
|
151
157
|
}
|
|
152
158
|
});
|
|
153
159
|
|
|
154
|
-
var
|
|
160
|
+
var _parseAttributes = require('./parseAttributes');
|
|
155
161
|
|
|
156
|
-
Object.defineProperty(exports, '
|
|
162
|
+
Object.defineProperty(exports, 'parseAttributes', {
|
|
157
163
|
enumerable: true,
|
|
158
164
|
get: function get() {
|
|
159
|
-
return
|
|
165
|
+
return _parseAttributes.parseAttributes;
|
|
160
166
|
}
|
|
161
167
|
});
|
|
162
168
|
|
|
163
|
-
var
|
|
169
|
+
var _parseCombinations = require('./parseCombinations');
|
|
164
170
|
|
|
165
|
-
Object.defineProperty(exports, '
|
|
171
|
+
Object.defineProperty(exports, 'parseCombinations', {
|
|
166
172
|
enumerable: true,
|
|
167
173
|
get: function get() {
|
|
168
|
-
return
|
|
174
|
+
return _parseCombinations.parseCombinations;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
var _refineAttributes = require('./refineAttributes');
|
|
179
|
+
|
|
180
|
+
Object.defineProperty(exports, 'refineAttributes', {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function get() {
|
|
183
|
+
return _refineAttributes.refineAttributes;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
var _enhanceObservations = require('./enhanceObservations');
|
|
188
|
+
|
|
189
|
+
Object.defineProperty(exports, 'enhanceObservations', {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function get() {
|
|
192
|
+
return _enhanceObservations.enhanceObservations;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
var _getAttributesSeries = require('./getAttributesSeries');
|
|
197
|
+
|
|
198
|
+
Object.defineProperty(exports, 'getAttributesSeries', {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function get() {
|
|
201
|
+
return _getAttributesSeries.getAttributesSeries;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
var _getManyValuesDimensions = require('./getManyValuesDimensions');
|
|
206
|
+
|
|
207
|
+
Object.defineProperty(exports, 'getManyValuesDimensions', {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function get() {
|
|
210
|
+
return _getManyValuesDimensions.getManyValuesDimensions;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
var _getOneValueDimensions = require('./getOneValueDimensions');
|
|
215
|
+
|
|
216
|
+
Object.defineProperty(exports, 'getOneValueDimensions', {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function get() {
|
|
219
|
+
return _getOneValueDimensions.getOneValueDimensions;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
var _getHeaderSubtitle = require('./getHeaderSubtitle');
|
|
224
|
+
|
|
225
|
+
Object.defineProperty(exports, 'getHeaderSubtitle', {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function get() {
|
|
228
|
+
return _getHeaderSubtitle.getHeaderSubtitle;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
var _getHeaderCombinations = require('./getHeaderCombinations');
|
|
233
|
+
|
|
234
|
+
Object.defineProperty(exports, 'getHeaderCombinations', {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function get() {
|
|
237
|
+
return _getHeaderCombinations.getHeaderCombinations;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
var _getLayout = require('./table/getLayout');
|
|
242
|
+
|
|
243
|
+
Object.defineProperty(exports, 'getLayout', {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
get: function get() {
|
|
246
|
+
return _getLayout.getLayout;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
var _getSortedLayoutIndexes = require('./table/getSortedLayoutIndexes');
|
|
251
|
+
|
|
252
|
+
Object.defineProperty(exports, 'getSortedLayoutIndexes', {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function get() {
|
|
255
|
+
return _getSortedLayoutIndexes.getSortedLayoutIndexes;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
var _refineLayoutSize = require('./table/refineLayoutSize');
|
|
260
|
+
|
|
261
|
+
Object.defineProperty(exports, 'refineLayoutSize', {
|
|
262
|
+
enumerable: true,
|
|
263
|
+
get: function get() {
|
|
264
|
+
return _refineLayoutSize.refineLayoutSize;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
var _getFlagsAndNotes = require('./table/getFlagsAndNotes');
|
|
269
|
+
|
|
270
|
+
Object.defineProperty(exports, 'getFlagsAndNotes', {
|
|
271
|
+
enumerable: true,
|
|
272
|
+
get: function get() {
|
|
273
|
+
return _getFlagsAndNotes.getFlagsAndNotes;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
var _getLayoutData = require('./table/getLayoutData');
|
|
278
|
+
|
|
279
|
+
Object.defineProperty(exports, 'getLayoutData', {
|
|
280
|
+
enumerable: true,
|
|
281
|
+
get: function get() {
|
|
282
|
+
return _getLayoutData.getLayoutData;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
var _getCellsAttributesIds = require('./table/getCellsAttributesIds');
|
|
287
|
+
|
|
288
|
+
Object.defineProperty(exports, 'getCellsAttributesIds', {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function get() {
|
|
291
|
+
return _getCellsAttributesIds.getCellsAttributesIds;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
var _getIndexedCombinationsByDisplay = require('./table/getIndexedCombinationsByDisplay');
|
|
296
|
+
|
|
297
|
+
Object.defineProperty(exports, 'getIndexedCombinationsByDisplay', {
|
|
298
|
+
enumerable: true,
|
|
299
|
+
get: function get() {
|
|
300
|
+
return _getIndexedCombinationsByDisplay.getIndexedCombinationsByDisplay;
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
var _getCells = require('./table/getCells');
|
|
305
|
+
|
|
306
|
+
Object.defineProperty(exports, 'getCells', {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function get() {
|
|
309
|
+
return _getCells.getCells;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
var _getCuratedCells = require('./table/getCuratedCells');
|
|
314
|
+
|
|
315
|
+
Object.defineProperty(exports, 'getCuratedCells', {
|
|
316
|
+
enumerable: true,
|
|
317
|
+
get: function get() {
|
|
318
|
+
return _getCuratedCells.getCuratedCells;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
var _prepareData = require('./prepareData');
|
|
323
|
+
|
|
324
|
+
Object.defineProperty(exports, 'prepareData', {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
get: function get() {
|
|
327
|
+
return _prepareData.prepareData;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
var _getTableProps = require('./table/getTableProps');
|
|
332
|
+
|
|
333
|
+
Object.defineProperty(exports, 'getTableProps', {
|
|
334
|
+
enumerable: true,
|
|
335
|
+
get: function get() {
|
|
336
|
+
return _getTableProps.getTableProps;
|
|
169
337
|
}
|
|
170
338
|
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseAttributes = undefined;
|
|
7
|
+
|
|
8
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
9
|
+
|
|
10
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
11
|
+
|
|
12
|
+
var _ramda = require('ramda');
|
|
13
|
+
|
|
14
|
+
var R = _interopRequireWildcard(_ramda);
|
|
15
|
+
|
|
16
|
+
var _constants = require('./constants');
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
var parseAttributes = exports.parseAttributes = function parseAttributes(attributes, dimensions, customAttributes) {
|
|
23
|
+
var indexedDimensions = R.indexBy(R.prop('id'), dimensions);
|
|
24
|
+
return R.addIndex(R.map)(function (attr, index) {
|
|
25
|
+
var res = R.assoc('index', index, attr);
|
|
26
|
+
if (R.isEmpty(attr.values || []) || !R.propOr(true, 'display', attr) || attr.id === _constants.REPORTING_YEAR_START_DAY || attr.id === _constants.REPYEARSTART) {
|
|
27
|
+
return R.assoc('display', false, res);
|
|
28
|
+
}
|
|
29
|
+
if (R.propEq('id', customAttributes.prefscale, attr)) {
|
|
30
|
+
return R.assoc('prefscale', true, res);
|
|
31
|
+
}
|
|
32
|
+
if (R.propEq('id', customAttributes.decimals, attr)) {
|
|
33
|
+
return R.assoc('decimals', true, res);
|
|
34
|
+
}
|
|
35
|
+
if (R.hasPath(['relationship', 'none'], attr) || R.hasPath(['relationship', 'dataflow'], attr)) {
|
|
36
|
+
return (0, _extends3.default)({}, res, { header: true, relationship: [] });
|
|
37
|
+
}
|
|
38
|
+
if (R.hasPath(['relationship', 'primaryMeasure'], attr) || R.hasPath(['relationship', 'observation'], attr)) {
|
|
39
|
+
return (0, _extends3.default)({}, res, { series: true, relationship: [] });
|
|
40
|
+
}
|
|
41
|
+
var seriesDimensions = R.pipe(R.pathOr([], ['relationship', 'dimensions']), R.filter(function (id) {
|
|
42
|
+
var values = R.path([id, 'values'], indexedDimensions);
|
|
43
|
+
return R.length(values) > 1;
|
|
44
|
+
}))(attr);
|
|
45
|
+
if (R.length(seriesDimensions) > 0) {
|
|
46
|
+
return (0, _extends3.default)({}, res, { series: true, relationship: seriesDimensions });
|
|
47
|
+
}
|
|
48
|
+
return (0, _extends3.default)({}, res, { header: true, relationship: R.prop('dimensions', attr.relationship || []) });
|
|
49
|
+
}, attributes);
|
|
50
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseCombinations = undefined;
|
|
7
|
+
|
|
8
|
+
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
|
9
|
+
|
|
10
|
+
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
|
11
|
+
|
|
12
|
+
var _extends3 = require('babel-runtime/helpers/extends');
|
|
13
|
+
|
|
14
|
+
var _extends4 = _interopRequireDefault(_extends3);
|
|
15
|
+
|
|
16
|
+
var _ramda = require('ramda');
|
|
17
|
+
|
|
18
|
+
var R = _interopRequireWildcard(_ramda);
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
var parseCombinations = exports.parseCombinations = function parseCombinations(combinations, parsedAttributes, dimensions) {
|
|
25
|
+
var indexedDimensions = R.indexBy(R.prop('id'), dimensions);
|
|
26
|
+
var indexedAttributes = R.indexBy(R.prop('id'), parsedAttributes);
|
|
27
|
+
|
|
28
|
+
return R.map(function (comb) {
|
|
29
|
+
var relationship = [];
|
|
30
|
+
var ids = {};
|
|
31
|
+
var seriesConcepts = R.filter(function (concept) {
|
|
32
|
+
if (R.has(concept, ids)) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
if (R.has(concept, indexedDimensions)) {
|
|
36
|
+
var values = R.path([concept, 'values'], indexedDimensions);
|
|
37
|
+
relationship = R.length(values) > 1 ? R.append(concept, relationship) : relationship;
|
|
38
|
+
ids = (0, _extends4.default)({}, ids, (0, _defineProperty3.default)({}, concept, concept));
|
|
39
|
+
return R.length(values) > 1;
|
|
40
|
+
}
|
|
41
|
+
var attribute = R.prop(concept, indexedAttributes);
|
|
42
|
+
relationship = attribute.series ? R.pipe(R.reject(function (id) {
|
|
43
|
+
return R.has(id, ids);
|
|
44
|
+
}), R.concat(relationship))(attribute.relationship) : relationship;
|
|
45
|
+
ids = attribute.series ? (0, _extends4.default)({}, ids, R.indexBy(R.identity, attribute.relationship)) : ids;
|
|
46
|
+
return true;
|
|
47
|
+
}, comb.concepts);
|
|
48
|
+
|
|
49
|
+
if (R.isEmpty(seriesConcepts) || R.isEmpty(relationship)) {
|
|
50
|
+
return (0, _extends4.default)({}, comb, { header: true });
|
|
51
|
+
}
|
|
52
|
+
return (0, _extends4.default)({}, comb, { series: true, relationship: relationship });
|
|
53
|
+
}, combinations);
|
|
54
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.prepareData = undefined;
|
|
7
|
+
|
|
8
|
+
var _ramda = require('ramda');
|
|
9
|
+
|
|
10
|
+
var R = _interopRequireWildcard(_ramda);
|
|
11
|
+
|
|
12
|
+
var _src = require('../../rules/src');
|
|
13
|
+
|
|
14
|
+
var _enhanceObservations = require('./enhanceObservations');
|
|
15
|
+
|
|
16
|
+
var _parseAttributes = require('./parseAttributes');
|
|
17
|
+
|
|
18
|
+
var _getCombinationDefinitions = require('./getCombinationDefinitions');
|
|
19
|
+
|
|
20
|
+
var _parseCombinations = require('./parseCombinations');
|
|
21
|
+
|
|
22
|
+
var _refineAttributes = require('./refineAttributes');
|
|
23
|
+
|
|
24
|
+
var _duplicateObservations = require('./duplicateObservations');
|
|
25
|
+
|
|
26
|
+
var _getMetadataCoordinates = require('./getMetadataCoordinates');
|
|
27
|
+
|
|
28
|
+
var _getAttributesSeries = require('./getAttributesSeries');
|
|
29
|
+
|
|
30
|
+
var _getManyValuesDimensions = require('./getManyValuesDimensions');
|
|
31
|
+
|
|
32
|
+
var _getOneValueDimensions = require('./getOneValueDimensions');
|
|
33
|
+
|
|
34
|
+
var _hierarchiseDimensionWithNativeHierarchy = require('./hierarchiseDimensionWithNativeHierarchy');
|
|
35
|
+
|
|
36
|
+
var _hierarchiseDimensionWithAdvancedHierarchy = require('./hierarchiseDimensionWithAdvancedHierarchy');
|
|
37
|
+
|
|
38
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
39
|
+
|
|
40
|
+
var prepareData = exports.prepareData = function prepareData(sdmxJson, customAttributes, locale, hierarchies) {
|
|
41
|
+
var dimensions = R.pathOr([], ['data', 'structure', 'dimensions', 'observation'], sdmxJson);
|
|
42
|
+
var attributes = R.pathOr([], ['data', 'structure', 'attributes', 'observation'], sdmxJson);
|
|
43
|
+
var annotations = R.pathOr([], ['data', 'structure', 'annotations'], sdmxJson);
|
|
44
|
+
var observations = (0, _src.getObservations)(sdmxJson);
|
|
45
|
+
var combinations = (0, _getCombinationDefinitions.getCombinationDefinitions)(annotations, locale);
|
|
46
|
+
var metadataCoordinates = (0, _getMetadataCoordinates.getMetadataCoordinates)(sdmxJson);
|
|
47
|
+
|
|
48
|
+
var parsedAttributes = (0, _parseAttributes.parseAttributes)(attributes, dimensions, customAttributes);
|
|
49
|
+
var parsedCombinations = (0, _parseCombinations.parseCombinations)(combinations, parsedAttributes, dimensions);
|
|
50
|
+
var seriesCombinations = R.filter(R.prop('series'), parsedCombinations);
|
|
51
|
+
var refinedAttributes = (0, _refineAttributes.refineAttributes)(parsedAttributes, seriesCombinations);
|
|
52
|
+
|
|
53
|
+
var enhancedObservations = (0, _enhanceObservations.enhanceObservations)(dimensions, observations, refinedAttributes, { customAttributes: customAttributes });
|
|
54
|
+
var attributesSeries = (0, _getAttributesSeries.getAttributesSeries)(enhancedObservations);
|
|
55
|
+
var manyValuesDimensions = (0, _getManyValuesDimensions.getManyValuesDimensions)(dimensions, attributesSeries, customAttributes, seriesCombinations);
|
|
56
|
+
var oneValueDimensions = (0, _getOneValueDimensions.getOneValueDimensions)(dimensions, parsedAttributes);
|
|
57
|
+
var hierarchisedDimensions = R.map(function (dim) {
|
|
58
|
+
if (R.isEmpty(R.propOr({}, dim.id, hierarchies))) {
|
|
59
|
+
return (0, _hierarchiseDimensionWithNativeHierarchy.hierarchiseDimensionWithNativeHierarchy)(dim);
|
|
60
|
+
}
|
|
61
|
+
return (0, _hierarchiseDimensionWithAdvancedHierarchy.hierarchiseDimensionWithAdvancedHierarchy)(dim, R.prop(dim.id, hierarchies));
|
|
62
|
+
}, manyValuesDimensions);
|
|
63
|
+
var duplicatedObservations = (0, _duplicateObservations.duplicateObs)(R.values(hierarchisedDimensions), enhancedObservations);
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
observations: duplicatedObservations,
|
|
67
|
+
dimensions: hierarchisedDimensions,
|
|
68
|
+
combinations: parsedCombinations,
|
|
69
|
+
oneValueDimensions: oneValueDimensions,
|
|
70
|
+
attributesSeries: attributesSeries,
|
|
71
|
+
metadataCoordinates: metadataCoordinates,
|
|
72
|
+
attributes: refinedAttributes
|
|
73
|
+
};
|
|
74
|
+
};
|
package/lib/{rules/src/table/preparators/getAttributeValue.js → rules2/src/refineAttributes.js}
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.refineAttributes = undefined;
|
|
7
7
|
|
|
8
8
|
var _extends2 = require('babel-runtime/helpers/extends');
|
|
9
9
|
|
|
@@ -17,14 +17,16 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
var refineAttributes = exports.refineAttributes = function refineAttributes(parsedAttributes, seriesCombinations) {
|
|
21
|
+
var indexedRelationships = R.reduce(function (acc, comb) {
|
|
22
|
+
return R.reduce(function (_acc, concept) {
|
|
23
|
+
return R.assoc(concept, comb.relationship, _acc);
|
|
24
|
+
}, acc, comb.concepts);
|
|
25
|
+
}, {}, seriesCombinations);
|
|
26
|
+
return R.map(function (attr) {
|
|
27
|
+
if (R.has(attr.id, indexedRelationships)) {
|
|
28
|
+
return (0, _extends3.default)({}, attr, { series: true, relationship: R.prop(attr.id, indexedRelationships) });
|
|
29
|
+
}
|
|
30
|
+
return attr;
|
|
31
|
+
}, parsedAttributes);
|
|
30
32
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCells = exports.getCellCombinedAttributes = exports.getCellRelevantAttributes = undefined;
|
|
7
|
+
|
|
8
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
9
|
+
|
|
10
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
11
|
+
|
|
12
|
+
var _ramda = require('ramda');
|
|
13
|
+
|
|
14
|
+
var R = _interopRequireWildcard(_ramda);
|
|
15
|
+
|
|
16
|
+
var _getFlagsAndNotes = require('./getFlagsAndNotes');
|
|
17
|
+
|
|
18
|
+
var _hasCellMetadata = require('../hasCellMetadata');
|
|
19
|
+
|
|
20
|
+
var _utils = require('../utils');
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
var getCellRelevantAttributes = exports.getCellRelevantAttributes = function getCellRelevantAttributes(attributes, attributesSeries, cellAttributeIds) {
|
|
27
|
+
return R.filter(function (attr) {
|
|
28
|
+
if (R.has(attr.id, cellAttributeIds)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
var attrInSerie = R.path([attr.serieKey, attr.id], attributesSeries);
|
|
32
|
+
return R.isNil(attrInSerie);
|
|
33
|
+
}, attributes);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var getCellCombinedAttributes = exports.getCellCombinedAttributes = function getCellCombinedAttributes(attributes, combinations) {
|
|
37
|
+
return R.reduce(function (acc, comb) {
|
|
38
|
+
var values = (0, _utils.trimedProps)(comb.concepts, attributes);
|
|
39
|
+
if (R.isEmpty(values)) {
|
|
40
|
+
return acc;
|
|
41
|
+
}
|
|
42
|
+
return R.append((0, _extends3.default)({}, R.pick(['id', 'name'], comb), { values: R.pluck('value', values) }), acc);
|
|
43
|
+
}, [], combinations);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// combinations = { cells, layout };
|
|
47
|
+
var getCells = exports.getCells = function getCells(customAttributes, cellsAttributesId, combinations, attributesSeries, metadataCoordinates) {
|
|
48
|
+
return function (observations) {
|
|
49
|
+
var attributesInLayoutCombination = R.pipe(R.propOr([], 'layout'), R.pluck('concepts'), R.unnest)(combinations);
|
|
50
|
+
|
|
51
|
+
var attributesInCellsCombination = R.pipe(R.propOr([], 'cells'), R.pluck('concepts'), R.unnest)(combinations);
|
|
52
|
+
|
|
53
|
+
var _customAttributes = R.over(R.lensProp('notes'), function (notes) {
|
|
54
|
+
return R.concat(notes || [], attributesInLayoutCombination);
|
|
55
|
+
})(customAttributes);
|
|
56
|
+
|
|
57
|
+
return R.mapObjIndexed(function (obs) {
|
|
58
|
+
var relevantAttributes = getCellRelevantAttributes(obs.attributes, attributesSeries, cellsAttributesId);
|
|
59
|
+
var flagsAndNotes = (0, _getFlagsAndNotes.getFlagsAndNotes)(relevantAttributes, _customAttributes);
|
|
60
|
+
var combinedAttributes = getCellCombinedAttributes(relevantAttributes, combinations.cells || []);
|
|
61
|
+
|
|
62
|
+
var hasAdvancedAttributes = R.pipe(R.omit(R.unnest([_customAttributes.flags || [], _customAttributes.notes || [], attributesInCellsCombination])), R.isEmpty, R.not)(relevantAttributes);
|
|
63
|
+
|
|
64
|
+
var hasMetadata = (0, _hasCellMetadata.hasCellMetadata)(metadataCoordinates, obs.indexedDimValIds);
|
|
65
|
+
|
|
66
|
+
return (0, _extends3.default)({}, R.pick(['indexedDimValIds', 'key'], obs), {
|
|
67
|
+
flags: R.concat(flagsAndNotes, combinedAttributes),
|
|
68
|
+
sideProps: hasAdvancedAttributes || hasMetadata ? { hasAdvancedAttributes: hasAdvancedAttributes, hasMetadata: hasMetadata, coordinates: obs.indexedDimValIds } : null,
|
|
69
|
+
intValue: R.is(Number, obs.value) ? obs.value : null,
|
|
70
|
+
value: obs.formattedValue
|
|
71
|
+
});
|
|
72
|
+
}, observations);
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCellsAttributesIds = undefined;
|
|
7
|
+
|
|
8
|
+
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray');
|
|
9
|
+
|
|
10
|
+
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
|
|
11
|
+
|
|
12
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
13
|
+
|
|
14
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
15
|
+
|
|
16
|
+
var _ramda = require('ramda');
|
|
17
|
+
|
|
18
|
+
var R = _interopRequireWildcard(_ramda);
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
var getCellsAttributesIds = exports.getCellsAttributesIds = function getCellsAttributesIds(layoutIds, attributes) {
|
|
25
|
+
return R.reduce(function (acc, attr) {
|
|
26
|
+
if (!attr.series) {
|
|
27
|
+
return acc;
|
|
28
|
+
}
|
|
29
|
+
if (R.isEmpty(attr.relationship || [])) {
|
|
30
|
+
return R.assoc(attr.id, attr.id, acc);
|
|
31
|
+
}
|
|
32
|
+
var indexedHeaderIds = R.indexBy(R.identity, layoutIds.header);
|
|
33
|
+
var indexedSectionsIds = R.indexBy(R.identity, layoutIds.sections);
|
|
34
|
+
var indexedRowsIds = (0, _extends3.default)({}, indexedSectionsIds, R.indexBy(R.identity, layoutIds.rows));
|
|
35
|
+
|
|
36
|
+
var _R$partition = R.partition(function (id) {
|
|
37
|
+
return R.has(id, indexedHeaderIds);
|
|
38
|
+
}, attr.relationship),
|
|
39
|
+
_R$partition2 = (0, _slicedToArray3.default)(_R$partition, 2),
|
|
40
|
+
idsInHeader = _R$partition2[0],
|
|
41
|
+
rest = _R$partition2[1];
|
|
42
|
+
|
|
43
|
+
if (R.isEmpty(rest)) {
|
|
44
|
+
return acc;
|
|
45
|
+
} else if (!R.isEmpty(idsInHeader)) {
|
|
46
|
+
return R.assoc(attr.id, attr.id, acc);
|
|
47
|
+
} else {
|
|
48
|
+
var idsNotInSections = R.reject(function (id) {
|
|
49
|
+
return R.has(id, indexedSectionsIds);
|
|
50
|
+
}, attr.relationship);
|
|
51
|
+
if (R.isEmpty(idsNotInSections)) {
|
|
52
|
+
return acc;
|
|
53
|
+
}
|
|
54
|
+
var idsNotInRows = R.reject(function (id) {
|
|
55
|
+
return R.has(id, indexedRowsIds);
|
|
56
|
+
}, idsNotInSections);
|
|
57
|
+
if (R.isEmpty(idsNotInRows)) {
|
|
58
|
+
return acc;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return R.assoc(attr.id, attr.id, acc);
|
|
62
|
+
}, {}, attributes);
|
|
63
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCombinationDimensionsData = undefined;
|
|
7
|
+
|
|
8
|
+
var _ramda = require('ramda');
|
|
9
|
+
|
|
10
|
+
var R = _interopRequireWildcard(_ramda);
|
|
11
|
+
|
|
12
|
+
var _parseValueHierarchy = require('./parseValueHierarchy');
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
15
|
+
|
|
16
|
+
var getCombinationDimensionsData = exports.getCombinationDimensionsData = function getCombinationDimensionsData(indexes, combination, previous, sameSerie) {
|
|
17
|
+
var coordinates = {};
|
|
18
|
+
var ids = [];
|
|
19
|
+
var _sameSerie = sameSerie;
|
|
20
|
+
var hasAdvancedAttributes = false;
|
|
21
|
+
|
|
22
|
+
var _combination$dimensio = combination.dimensions,
|
|
23
|
+
dimensions = _combination$dimensio === undefined ? [] : _combination$dimensio;
|
|
24
|
+
|
|
25
|
+
var dimValues = R.addIndex(R.reduce)(function (acc, valIndex, dimIndex) {
|
|
26
|
+
var dimension = R.nth(dimIndex, dimensions);
|
|
27
|
+
var value = R.nth(Math.abs(valIndex), R.propOr([], 'values', dimension));
|
|
28
|
+
hasAdvancedAttributes = !hasAdvancedAttributes ? value.hasAdvancedAttributes : true;
|
|
29
|
+
if (!value) {
|
|
30
|
+
return acc;
|
|
31
|
+
}
|
|
32
|
+
coordinates = R.assoc(dimension.id, value.id, coordinates);
|
|
33
|
+
ids = R.append(dimension.id + '=' + value.id, ids);
|
|
34
|
+
var previousValue = R.propOr({}, dimension.id, previous);
|
|
35
|
+
if (value.id === R.prop('id', previousValue || {}) && _sameSerie) {
|
|
36
|
+
return R.assoc(dimension.id, previousValue, acc);
|
|
37
|
+
} else {
|
|
38
|
+
var parsedValue = (0, _parseValueHierarchy.parseValueHierarchy)(value, _sameSerie ? previousValue || {} : {}, dimension.indexedValues);
|
|
39
|
+
if (!R.isNil(previous)) {
|
|
40
|
+
_sameSerie = false;
|
|
41
|
+
}
|
|
42
|
+
return R.assoc(dimension.id, parsedValue, acc);
|
|
43
|
+
}
|
|
44
|
+
}, {}, indexes);
|
|
45
|
+
|
|
46
|
+
return { dimValues: dimValues, coordinates: coordinates, ids: ids, sameSerie: _sameSerie, hasAdvancedAttributes: hasAdvancedAttributes };
|
|
47
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCuratedCells = undefined;
|
|
7
|
+
|
|
8
|
+
var _ramda = require('ramda');
|
|
9
|
+
|
|
10
|
+
var R = _interopRequireWildcard(_ramda);
|
|
11
|
+
|
|
12
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
13
|
+
|
|
14
|
+
var getCuratedCells = exports.getCuratedCells = function getCuratedCells(cells, layout) {
|
|
15
|
+
var layoutIds = R.map(R.pipe(R.map(function (entry) {
|
|
16
|
+
return R.has('dimensions', entry) ? R.pluck('id', entry.dimensions || []) : entry.id;
|
|
17
|
+
}), R.unnest))(layout);
|
|
18
|
+
return R.pipe(R.values, R.reduce(function (acc, cell) {
|
|
19
|
+
var keys = R.map(R.pipe(R.map(function (dim) {
|
|
20
|
+
var val = R.prop(dim, cell.indexedDimValIds);
|
|
21
|
+
return dim + '=' + val;
|
|
22
|
+
}), R.join(':')), layoutIds);
|
|
23
|
+
|
|
24
|
+
return R.over(R.lensPath(R.props(['header', 'sections', 'rows'], keys)), function (cells) {
|
|
25
|
+
return R.isNil(cells) ? [cell] : R.append(cell, cells);
|
|
26
|
+
}, acc);
|
|
27
|
+
}, {}))(cells);
|
|
28
|
+
};
|