@sis-cc/dotstatsuite-components 17.17.0 → 17.19.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.
@@ -403,7 +403,7 @@ var _extractSdmxArtefacts = function _extractSdmxArtefacts(data) {
403
403
  name: extractDataName(data),
404
404
  observations: R.pipe(R.pathOr({}, ['dataSets', 0, 'observations']), R.mapObjIndexed(function (obs) {
405
405
  return R.over(R.lensIndex(0), function (val) {
406
- return Number(val);
406
+ return R.isNil(val) ? null : Number(val);
407
407
  })(obs);
408
408
  }), R.reject(R.pipe(R.head, R.anyPass([R.isNil, isNaN]))))(data),
409
409
  source: (0, _get3.default)(data, 'header.links[0].href', null)
@@ -62,7 +62,6 @@ var addValueToSerieData = function addValueToSerieData(dataSetter) {
62
62
  var valueId = R.path(['value', 'id'], valueData);
63
63
  return (0, _extends3.default)({}, serieData, {
64
64
  data: dataSetter(valueData, R.prop('data', serieData)),
65
- coordinates: R.assoc(dimension.id, valueId, R.prop('coordinates', serieData)),
66
65
  key: addCoordinatesToKey(R.prop('key', serieData), R.prop('id', dimension), valueId)
67
66
  });
68
67
  };
@@ -193,7 +192,7 @@ var getSerieDataWithMissingLines = function getSerieDataWithMissingLines(serie,
193
192
  flags = _getSerieFlagsAndSide.flags,
194
193
  sideProps = _getSerieFlagsAndSide.sideProps;
195
194
 
196
- return R.append((0, _extends3.default)({}, serieData, { flags: flags, sideProps: sideProps }), lines);
195
+ return R.append((0, _extends3.default)({}, serieData, { flags: flags, sideProps: sideProps, coordinates: serieCoordinates }), lines);
197
196
  };
198
197
 
199
198
  exports.getSerieDataWithMissingLines = getSerieDataWithMissingLines;
@@ -221,7 +220,7 @@ var getSerieDataWithoutMissingLines = function getSerieDataWithoutMissingLines(s
221
220
  flags = _getSerieFlagsAndSide2.flags,
222
221
  sideProps = _getSerieFlagsAndSide2.sideProps;
223
222
 
224
- return (0, _extends3.default)({}, serieData, { flags: flags, sideProps: sideProps });
223
+ return (0, _extends3.default)({}, serieData, { flags: flags, sideProps: sideProps, coordinates: serieCoordinates });
225
224
  };
226
225
 
227
226
  exports.getSerieDataWithoutMissingLines = getSerieDataWithoutMissingLines;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-components",
3
3
  "description": "Set components based on React.",
4
- "version": "17.17.0",
4
+ "version": "17.19.0",
5
5
  "main": "lib/index.js",
6
6
  "author": "OECD",
7
7
  "license": "MIT",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@react-hook/size": "^2.1.1",
27
- "@sis-cc/dotstatsuite-d3-charts": "^8.2.0",
27
+ "@sis-cc/dotstatsuite-d3-charts": "^8.3.0",
28
28
  "date-fns": "^1.30.1",
29
29
  "lodash": "^4.17.2",
30
30
  "lodash.compose": "^2.4.1",
@@ -64,7 +64,7 @@ const _extractSdmxArtefacts = (data) => {
64
64
  name: extractDataName(data),
65
65
  observations: R.pipe(
66
66
  R.pathOr({}, ['dataSets', 0, 'observations']),
67
- R.mapObjIndexed(obs => R.over(R.lensIndex(0), val => Number(val))(obs)),
67
+ R.mapObjIndexed(obs => R.over(R.lensIndex(0), val => R.isNil(val) ? null : Number(val))(obs)),
68
68
  R.reject(R.pipe(R.head, R.anyPass([R.isNil, isNaN]))),
69
69
  )(data),
70
70
  source: get(data, 'header.links[0].href', null),
@@ -25,7 +25,6 @@ const addValueToSerieData = (dataSetter) => (index, parentsIndexes, dimension, s
25
25
  return ({
26
26
  ...serieData,
27
27
  data: dataSetter(valueData, R.prop('data', serieData)),
28
- coordinates: R.assoc(dimension.id, valueId, R.prop('coordinates', serieData)),
29
28
  key: addCoordinatesToKey(R.prop('key', serieData), R.prop('id', dimension), valueId)
30
29
  });
31
30
  };
@@ -144,7 +143,7 @@ export const getSerieDataWithMissingLines = (serie, definition, topCoordinates,
144
143
 
145
144
  const { attributes, ...serieData } = getSerieDimensionsData(serie, definition, attributesValues, getMissingParents);
146
145
  const { flags, sideProps } = getSerieFlagsAndSideProps(serieCoordinates, coordinatesValidator, attributes, customAttributes, metadataCoordinates);
147
- return R.append({ ...serieData, flags, sideProps }, lines);
146
+ return R.append({ ...serieData, flags, sideProps, coordinates: serieCoordinates }, lines);
148
147
  };
149
148
 
150
149
  export const getSerieDataWithoutMissingLines = (serie, definition, topCoordinates, attributesSeries, customAttributes, metadataCoordinates) => {
@@ -161,7 +160,7 @@ export const getSerieDataWithoutMissingLines = (serie, definition, topCoordinate
161
160
 
162
161
  const { attributes, ...serieData } = getSerieDimensionsData(serie, definition, attributesValues, getMissingParents);
163
162
  const { flags, sideProps } = getSerieFlagsAndSideProps(serieCoordinates, coordinatesValidator, attributes, customAttributes, metadataCoordinates);
164
- return ({ ...serieData, flags, sideProps });
163
+ return ({ ...serieData, flags, sideProps, coordinates: serieCoordinates });
165
164
  };
166
165
 
167
166
  export const getLayoutData = (layoutIndexes, layout, { metadataCoordinates, attributesSeries, customAttributes, topCoordinates={} }) => {
@@ -31,7 +31,6 @@ describe('getLayoutData 2 tests', () => {
31
31
  expect(getSerieDataWithMissingLines(serie, dimensions, {}, {}, {}, {})).to.deep.equal([
32
32
  {
33
33
  data: [{ dimension: { id: 'D0' }, value: { id: 'v0', parents: [], missingParents: [] } }, { dimension: { id: 'D1' }, value: { id: 'W', parents: [], missingParents: [] } }],
34
- coordinates: { D0: 'v0', D1: 'W' },
35
34
  key: 'D0=v0:D1=W',
36
35
  flags: [],
37
36
  sideProps: null,
@@ -39,7 +38,6 @@ describe('getLayoutData 2 tests', () => {
39
38
  },
40
39
  {
41
40
  data: [{ dimension: { id: 'D0' }, value: { id: 'v0', parents: [], missingParents: [] } }, { dimension: { id: 'D1' }, value: { id: 'A', parents: [0], missingParents: [] } }],
42
- coordinates: { D0: 'v0', D1: 'A' },
43
41
  key: 'D0=v0:D1=A',
44
42
  flags: [],
45
43
  sideProps: null,
@@ -133,7 +131,6 @@ describe('getLayoutData 2 tests', () => {
133
131
  data: [
134
132
  { dimension: { id: 'D0' }, value: { id: 'W', parents: [], missingParents: [] } }
135
133
  ],
136
- coordinates: { D0: 'W' },
137
134
  key: 'D0=W',
138
135
  flags: [],
139
136
  sideProps: null,
@@ -143,7 +140,6 @@ describe('getLayoutData 2 tests', () => {
143
140
  data: [
144
141
  { dimension: { id: 'D0' }, value: { id: 'A', parents: [0], missingParents: [] } }
145
142
  ],
146
- coordinates: { D0: 'A' },
147
143
  key: 'D0=A',
148
144
  flags: [],
149
145
  sideProps: null,
@@ -154,7 +150,6 @@ describe('getLayoutData 2 tests', () => {
154
150
  { dimension: { id: 'D0' }, value: { id: 'USA', parents: [0, 2], missingParents: [] } },
155
151
  { dimension: { id: 'COMB0' }, values: [{ id: 'D1ROOT', parents: [], missingParents: [] }] }
156
152
  ],
157
- coordinates: { D0: 'USA', D1: 'D1ROOT' },
158
153
  key: 'D0=USA:D1=D1ROOT',
159
154
  flags: [],
160
155
  sideProps: null,
@@ -165,7 +160,6 @@ describe('getLayoutData 2 tests', () => {
165
160
  { dimension: { id: 'D0' }, value: { id: 'USA', parents: [0, 2], missingParents: [] } },
166
161
  { dimension: { id: 'COMB0' }, values: [{ id: 'D1ROOT>CHILD', parents: [0], missingParents: [] }] }
167
162
  ],
168
- coordinates: { D0: 'USA', D1: 'D1ROOT>CHILD' },
169
163
  key: 'D0=USA:D1=D1ROOT>CHILD',
170
164
  flags: [],
171
165
  sideProps: null,
@@ -176,7 +170,6 @@ describe('getLayoutData 2 tests', () => {
176
170
  { dimension: { id: 'D0' }, value: { id: 'USA', parents: [0, 2], missingParents: [] } },
177
171
  { dimension: { id: 'COMB0' }, values: [{ id: 'D1ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }, { id: 'D2ROOT', parents: [], missingParents: [] }] }
178
172
  ],
179
- coordinates: { D0: 'USA', D1: 'D1ROOT>CHILD>CHILD', D2: 'D2ROOT' },
180
173
  key: 'D0=USA:D1=D1ROOT>CHILD>CHILD:D2=D2ROOT',
181
174
  flags: [],
182
175
  sideProps: null,
@@ -187,7 +180,6 @@ describe('getLayoutData 2 tests', () => {
187
180
  { dimension: { id: 'D0' }, value: { id: 'USA', parents: [0, 2], missingParents: [] } },
188
181
  { dimension: { id: 'COMB0' }, values: [{ id: 'D1ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }, { id: 'D2ROOT>CHILD', parents: [0], missingParents: [] }] }
189
182
  ],
190
- coordinates: { D0: 'USA', D1: 'D1ROOT>CHILD>CHILD', D2: 'D2ROOT>CHILD' },
191
183
  key: 'D0=USA:D1=D1ROOT>CHILD>CHILD:D2=D2ROOT>CHILD',
192
184
  flags: [],
193
185
  sideProps: null,
@@ -199,7 +191,6 @@ describe('getLayoutData 2 tests', () => {
199
191
  { dimension: { id: 'COMB0' }, values: [{ id: 'D1ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }, { id: 'A0VAL' }, { id: 'D2ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }] },
200
192
  { dimension: { id: 'COMB1' }, values: [{ id: 'D3ROOT', parents: [], missingParents: [] }] }
201
193
  ],
202
- coordinates: { D0: 'USA', D1: 'D1ROOT>CHILD>CHILD', D2: 'D2ROOT>CHILD>CHILD', D3: 'D3ROOT' },
203
194
  key: 'D0=USA:D1=D1ROOT>CHILD>CHILD:D2=D2ROOT>CHILD>CHILD:D3=D3ROOT',
204
195
  flags: [],
205
196
  sideProps: null,
@@ -211,7 +202,6 @@ describe('getLayoutData 2 tests', () => {
211
202
  { dimension: { id: 'COMB0' }, values: [{ id: 'D1ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }, { id: 'A0VAL' }, { id: 'D2ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }] },
212
203
  { dimension: { id: 'COMB1' }, values: [{ id: 'D3ROOT>CHILD', parents: [0], missingParents: [] }] }
213
204
  ],
214
- coordinates: { D0: 'USA', D1: 'D1ROOT>CHILD>CHILD', D2: 'D2ROOT>CHILD>CHILD', D3: 'D3ROOT>CHILD' },
215
205
  key: 'D0=USA:D1=D1ROOT>CHILD>CHILD:D2=D2ROOT>CHILD>CHILD:D3=D3ROOT>CHILD',
216
206
  flags: [],
217
207
  sideProps: null,
@@ -223,7 +213,6 @@ describe('getLayoutData 2 tests', () => {
223
213
  { dimension: { id: 'COMB0' }, values: [{ id: 'D1ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }, { id: 'A0VAL' }, { id: 'D2ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }] },
224
214
  { dimension: { id: 'COMB1' }, values: [{ id: 'D3ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }, { id: 'D4ROOT', parents: [], missingParents: [] }] }
225
215
  ],
226
- coordinates: { D0: 'USA', D1: 'D1ROOT>CHILD>CHILD', D2: 'D2ROOT>CHILD>CHILD', D3: 'D3ROOT>CHILD>CHILD', D4: 'D4ROOT' },
227
216
  key: 'D0=USA:D1=D1ROOT>CHILD>CHILD:D2=D2ROOT>CHILD>CHILD:D3=D3ROOT>CHILD>CHILD:D4=D4ROOT',
228
217
  flags: [],
229
218
  sideProps: null,
@@ -236,7 +225,6 @@ describe('getLayoutData 2 tests', () => {
236
225
  { dimension: { id: 'COMB0' }, values: [{ id: 'D1ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }, { id: 'A0VAL' }, { id: 'D2ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }] },
237
226
  { dimension: { id: 'COMB1' }, values: [{ id: 'D3ROOT>CHILD>CHILD', parents: [0, 1], missingParents: [] }, { id: 'D4ROOT>CHILD', parents: [0], missingParents: [] }] }
238
227
  ],
239
- coordinates: { D0: 'USA', D1: 'D1ROOT>CHILD>CHILD', D2: 'D2ROOT>CHILD>CHILD', D3: 'D3ROOT>CHILD>CHILD', D4: 'D4ROOT>CHILD' },
240
228
  key: 'D0=USA:D1=D1ROOT>CHILD>CHILD:D2=D2ROOT>CHILD>CHILD:D3=D3ROOT>CHILD>CHILD:D4=D4ROOT>CHILD',
241
229
  flags: [],
242
230
  sideProps: null,