@sis-cc/dotstatsuite-components 13.4.1 → 13.4.2
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.
|
@@ -116,11 +116,9 @@ var getSeriesAdvancedAttributes = exports.getSeriesAdvancedAttributes = function
|
|
|
116
116
|
var dim = R.nth(Number(dInd), dimensions);
|
|
117
117
|
var valId = R.path(['values', Number(vInd), 'id'], dim);
|
|
118
118
|
var coordinates = (0, _defineProperty3.default)({}, dim.id, valId);
|
|
119
|
-
var refinedKey = keyTemplate;
|
|
120
|
-
refinedKey[Number(dInd)] = vInd;
|
|
119
|
+
var refinedKey = R.set(R.lensIndex(Number(dInd)), vInd)(keyTemplate);
|
|
121
120
|
return R.assoc(R.join(':', refinedKey), { attributes: advancedAttributes, coordinates: coordinates }, acc);
|
|
122
121
|
}, {}, R.keys(series));
|
|
123
122
|
})(seriesAttributes);
|
|
124
|
-
|
|
125
123
|
return R.merge(seriesAdvancedAttributes, dimensionsAdvancedAttributes);
|
|
126
124
|
};
|
package/package.json
CHANGED
|
@@ -100,14 +100,12 @@ export const getSeriesAdvancedAttributes = (seriesAttributes, dimensions, advanc
|
|
|
100
100
|
const dim = R.nth(Number(dInd), dimensions);
|
|
101
101
|
const valId = R.path(['values', Number(vInd), 'id'], dim);
|
|
102
102
|
const coordinates = { [dim.id]: valId };
|
|
103
|
-
|
|
104
|
-
refinedKey[Number(dInd)] = vInd;
|
|
103
|
+
const refinedKey = R.set(R.lensIndex(Number(dInd)), vInd)(keyTemplate);
|
|
105
104
|
return R.assoc(R.join(':', refinedKey), { attributes: advancedAttributes, coordinates }, acc);
|
|
106
105
|
},
|
|
107
106
|
{},
|
|
108
107
|
R.keys(series)
|
|
109
108
|
)
|
|
110
109
|
)(seriesAttributes);
|
|
111
|
-
|
|
112
110
|
return R.merge(seriesAdvancedAttributes, dimensionsAdvancedAttributes);
|
|
113
111
|
};
|
|
@@ -9,6 +9,7 @@ describe('getSeriesAdvancedAttributes tests', () => {
|
|
|
9
9
|
'0:1:0:x:x': { attributes: { a0: { id: 'a0' }, a1: { id: 'a1' } } },
|
|
10
10
|
},
|
|
11
11
|
dimensions: {
|
|
12
|
+
'2:0': { attributes: { a1: { id: 'a1' } } },
|
|
12
13
|
'3:0': { attributes: { a0: { id: 'a0' } } },
|
|
13
14
|
'4:1': { attributes: { a0: { id: 'a0' }, a1: { id: 'a1' } } },
|
|
14
15
|
}
|
|
@@ -24,6 +25,7 @@ describe('getSeriesAdvancedAttributes tests', () => {
|
|
|
24
25
|
|
|
25
26
|
expect(getSeriesAdvancedAttributes(seriesAttributes, dimensions, advancedAttributesIds)).to.deep.equal({
|
|
26
27
|
'0:1:0::': { attributes: { a1: { id: 'a1' } }, coordinates: { d0: 'v0', d1: 'v1', d2: 'v0' } },
|
|
28
|
+
'::0::': { attributes: { a1: { id: 'a1' } }, coordinates: { d2: 'v0' } },
|
|
27
29
|
'::::1': { attributes: { a1: { id: 'a1' } }, coordinates: { d4: 'v1' } }
|
|
28
30
|
});
|
|
29
31
|
});
|