@sis-cc/dotstatsuite-components 9.1.0 → 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 (80) 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/appendUnitsInLayoutDataEntry.js +10 -10
  13. package/lib/rules/src/table/units/getAttachmentSeriesIndexes.js +1 -1
  14. package/lib/rules/src/table/units/getUnitsSeries.js +31 -0
  15. package/lib/rules/src/v8-transformer.js +3 -2
  16. package/package.json +2 -2
  17. package/src/rules/src/preparators/enhanceObservations.js +163 -0
  18. package/src/rules/src/preparators/formatValue.js +73 -0
  19. package/src/rules/src/preparators/getDimensions.js +49 -0
  20. package/src/rules/src/preparators/getDisplay.js +20 -0
  21. package/src/rules/src/preparators/getObservations.js +19 -0
  22. package/src/rules/src/table/factories/getCells.js +3 -7
  23. package/src/rules/src/table/factories/getLayoutData.js +135 -184
  24. package/src/rules/src/table/factories/getSortedLayoutIndexes.js +108 -0
  25. package/src/rules/src/table/factories/getTableData.js +10 -10
  26. package/src/rules/src/table/factories/refineLayoutSize.js +224 -0
  27. package/src/rules/src/table/preparators/prepareData.js +23 -32
  28. package/src/rules/src/table/units/appendUnitsInLayoutDataEntry.js +15 -18
  29. package/src/rules/src/table/units/getAttachmentSeriesIndexes.js +2 -1
  30. package/src/rules/src/table/units/getUnitsSeries.js +20 -0
  31. package/src/rules/src/v8-transformer.js +4 -2
  32. package/test/appendUnitsInLayoutDataEntry.test.js +3 -3
  33. package/test/enhanceObservations.test.js +270 -0
  34. package/test/getAttachmentSeriesIndexes.test.js +1 -1
  35. package/test/getCells.test.js +4 -39
  36. package/test/getLayoutData2.test.js +194 -0
  37. package/test/getOneValueDimensions.test.js +1 -1
  38. package/test/getSortedLayoutIndexes.test.js +80 -0
  39. package/test/getUnitsArtefacts.test.js +1 -1
  40. package/test/getUnitsSeries.test.js +64 -0
  41. package/test/mocks/table-layout-multi-hierarchies--layout.json +621 -0
  42. package/test/mocks/table-layout-multi-hierarchies--layoutData.json +32410 -0
  43. package/test/mocks/table-layout-multi-hierarchies--layoutIndexes.json +2760 -0
  44. package/test/mocks/table-layout-multi-hierarchies--observations.json +30688 -0
  45. package/test/mocks/table-layout-multi-hierarchies--sizedIndexes.json +2761 -0
  46. package/test/mocks/table-layout-truncation1--layout.json +27469 -0
  47. package/test/mocks/table-layout-truncation1--layoutData.json +19413 -0
  48. package/test/mocks/table-layout-truncation1--layoutIndexes.json +7512 -0
  49. package/test/mocks/table-layout-truncation1--observations.json +70002 -0
  50. package/test/mocks/table-layout-truncation1--sizedIndexes.json +3010 -0
  51. package/test/mocks/table-prep-multi-hierarchies--attributes.json +44 -0
  52. package/test/mocks/table-prep-multi-hierarchies--dimensions.json +688 -0
  53. package/test/mocks/table-prep-multi-hierarchies--enhancedObservations.json +19696 -0
  54. package/test/mocks/table-prep-multi-hierarchies--observations.json +8246 -0
  55. package/test/mocks/table-prep-multi-hierarchies--sdmxJson.json +2985 -0
  56. package/test/mocks/table-prep-truncation1--dimensions.json +35057 -0
  57. package/test/mocks/table-prep-truncation1--enhancedObservations.json +70002 -0
  58. package/test/mocks/table-prep-truncation1--observations.json +27502 -0
  59. package/test/mocks/table-prep-truncation1--sdmxJson.json +55103 -0
  60. package/test/mocks/table-prep-units--observations.json +284286 -0
  61. package/test/mocks/table-prep-units--unitsSeries.json +41042 -0
  62. package/test/parseAttributes.test.js +1 -1
  63. package/test/refineLayoutSize.test.js +415 -0
  64. package/test/table-layout-perf.test.js +74 -0
  65. package/test/table-prep-perf.test.js +65 -0
  66. package/lib/rules/src/table/factories/getSortedLayoutData.js +0 -145
  67. package/lib/rules/src/table/factories/refineLayoutHierarchy.js +0 -61
  68. package/lib/rules/src/table/preparators/parseObservations.js +0 -76
  69. package/lib/rules/src/table/units/getUnitsSeriesOccurences.js +0 -39
  70. package/src/rules/src/table/factories/getSortedLayoutData.js +0 -133
  71. package/src/rules/src/table/factories/refineLayoutHierarchy.js +0 -64
  72. package/src/rules/src/table/preparators/parseObservations.js +0 -81
  73. package/src/rules/src/table/units/getUnitsSeriesOccurences.js +0 -51
  74. package/test/appendUnitsInLayoutData.test.js +0 -248
  75. package/test/getLayoutData.test.js +0 -311
  76. package/test/getSortedLayoutData.test.js +0 -382
  77. package/test/getUnitsSeriesOccurences.test.js +0 -133
  78. package/test/parseObservations.test.js +0 -116
  79. package/test/refineDimSeriesUnits.test.js +0 -24
  80. package/test/refineLayoutHierarchy.test.js +0 -79
@@ -0,0 +1,155 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.enhanceObservations = 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 _getDisplay = require('./getDisplay');
17
+
18
+ var _formatValue = require('./formatValue');
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
+ /*
25
+ options = {
26
+ attachmentSeriesIndexes, //units
27
+ customAttributes: {
28
+ decimals: id,
29
+ prefscale: id,
30
+ },
31
+ noDisplayIndexes,
32
+ notDisplayedCodes,
33
+ unitsArtefacts,
34
+ obsAttributes,
35
+ rejectedValueIds,
36
+ }
37
+ */
38
+
39
+ var getSerieKey = function getSerieKey(dimValuesIndexes, options) {
40
+ var indexes = R.propOr([], 'attachmentSeriesIndexes', options);
41
+ return R.pipe(R.addIndex(R.map)(function (valueIndex, dimIndex) {
42
+ if (dimIndex === R.head(indexes)) {
43
+ indexes = R.tail(indexes);
44
+ return valueIndex;
45
+ }
46
+ return 'x';
47
+ }), R.join(':'))(dimValuesIndexes);
48
+ };
49
+
50
+ var getUnitsValues = function getUnitsValues(indexes, options) {
51
+ return R.reduce(function (acc, codelist) {
52
+ var id = codelist.id;
53
+
54
+ if (!R.includes(id, R.propOr([], 'unitsIds', options))) {
55
+ return acc;
56
+ }
57
+ var valueIndex = R.prop(codelist.__index, indexes);
58
+ if (R.isNil(valueIndex) || !(0, _getDisplay.getDisplay)(options)(codelist)) {
59
+ return acc;
60
+ }
61
+ var value = R.path(['values', Number(valueIndex)], codelist);
62
+ if (R.isNil(value) || R.includes(value.id, R.propOr([], 'rejectedValueIds', options)) || !(0, _getDisplay.getDisplay)(options)((0, _extends3.default)({}, value, { parent: codelist.id }))) {
63
+ return acc;
64
+ }
65
+ return R.assoc(id, (0, _extends3.default)({}, R.pick(['id', 'name', '__index'], codelist), {
66
+ value: R.when(R.complement(R.isNil), R.assoc('index', Number(valueIndex)))(value)
67
+ }), acc);
68
+ }, {});
69
+ };
70
+
71
+ var getObservationUnits = function getObservationUnits(observation, dimensions, attributes, options) {
72
+ var dimensionsUnits = getUnitsValues(R.propOr([], 'dimValuesIndexes', observation), options)(dimensions);
73
+
74
+ var attributesUnits = getUnitsValues(R.propOr([], 'attrValuesIndexes', observation), options)(attributes);
75
+
76
+ var serieKey = getSerieKey(R.propOr([], 'dimValuesIndexes', observation), options);
77
+
78
+ return (0, _extends3.default)({}, dimensionsUnits, attributesUnits, { serieKey: serieKey });
79
+ };
80
+
81
+ var getOrderedDimensionsIndexes = function getOrderedDimensionsIndexes(dimensions, indexes) {
82
+ return R.addIndex(R.map)(function (valueIndex, dimensionIndex) {
83
+ return R.path([dimensionIndex, 'values', valueIndex, '__indexPosition'], dimensions);
84
+ }, indexes);
85
+ };
86
+
87
+ var getFormatAttributesIndexes = function getFormatAttributesIndexes(attributes, customAttributes) {
88
+ return R.addIndex(R.reduce)(function (acc, attribute, index) {
89
+ if (R.equals(attribute.id, customAttributes.decimals)) {
90
+ return (0, _extends3.default)({}, acc, { decimals: index });
91
+ }
92
+ if (R.equals(attribute.id, customAttributes.prefscale)) {
93
+ return (0, _extends3.default)({}, acc, { prefscale: index });
94
+ }
95
+ return acc;
96
+ }, { prefscale: null, decimals: null }, attributes);
97
+ };
98
+
99
+ var getAttributeValue = function getAttributeValue(attribute, valueIndex, options) {
100
+ if (!(0, _getDisplay.getDisplay)(options)(attribute)) {
101
+ return null;
102
+ }
103
+ var value = R.pipe(R.propOr([], 'values'), R.nth(valueIndex))(attribute);
104
+
105
+ if (R.isNil(value) || !(0, _getDisplay.getDisplay)(options)((0, _extends3.default)({}, value, { parent: attribute.id }))) {
106
+ return null;
107
+ }
108
+
109
+ return (0, _extends3.default)({}, R.pick(['id', 'name'], attribute), {
110
+ value: R.pick(['id', 'name'], value)
111
+ });
112
+ };
113
+
114
+ var enhanceObservations = exports.enhanceObservations = function enhanceObservations() {
115
+ var dimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
116
+ var observations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
117
+ var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
118
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
119
+
120
+ var formatAttributesIndexes = getFormatAttributesIndexes(attributes, R.propOr({}, 'customAttributes', options));
121
+ var _attributes = R.addIndex(R.map)(function (attr, index) {
122
+ return R.assoc('__index', index, attr);
123
+ }, attributes);
124
+ var _obsAttributes = R.pipe(R.indexBy(R.prop('id')), R.props(options.attributesIds || []))(_attributes);
125
+
126
+ var seriesDimensions = R.filter(R.pipe(R.propOr([], 'values'), R.length, R.lt(1)), dimensions);
127
+
128
+ return R.mapObjIndexed(function (observation) {
129
+ var attrValuesIndexes = observation.attrValuesIndexes,
130
+ dimValuesIndexes = observation.dimValuesIndexes;
131
+
132
+ var obsAttributes = R.reduce(function (acc, attribute) {
133
+ var attrValue = getAttributeValue(attribute, R.nth(attribute.__index, attrValuesIndexes), options);
134
+ if (R.isNil(attrValue)) {
135
+ return acc;
136
+ }
137
+ return R.assoc(attribute.id, attrValue, acc);
138
+ }, {}, _obsAttributes);
139
+
140
+ var indexedDimValIds = R.addIndex(R.reduce)(function (acc, dimension, dimensionIndex) {
141
+ var id = dimension.id;
142
+ var valueIndex = R.nth(dimensionIndex, dimValuesIndexes);
143
+ var valueId = R.path(['values', Number(valueIndex), 'id'], dimension);
144
+ return R.assoc(id, valueId, acc);
145
+ }, {}, dimensions);
146
+
147
+ return (0, _extends3.default)({}, observation, {
148
+ attributes: obsAttributes,
149
+ formattedValue: (0, _formatValue.formatValue)(observation, formatAttributesIndexes, attributes),
150
+ orderedDimIndexes: getOrderedDimensionsIndexes(dimensions, dimValuesIndexes),
151
+ units: getObservationUnits(observation, seriesDimensions, _attributes, options),
152
+ indexedDimValIds: indexedDimValIds
153
+ });
154
+ }, observations);
155
+ };
@@ -0,0 +1,77 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatValue = undefined;
7
+
8
+ var _ramda = require('ramda');
9
+
10
+ var R = _interopRequireWildcard(_ramda);
11
+
12
+ var _numeral = require('numeral');
13
+
14
+ var _numeral2 = _interopRequireDefault(_numeral);
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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
+ var isValidNumber = R.both(R.is(Number), R.complement(R.equals(NaN)));
21
+
22
+ var getFormatAttributesValues = function getFormatAttributesValues(observation, formatAttributesIndexes, attributes) {
23
+ return R.mapObjIndexed(function (attributeIndex) {
24
+ var valueIndex = R.pipe(R.propOr([], 'attrValuesIndexes'), R.nth(attributeIndex), function (v) {
25
+ return R.isNil(v) ? null : Number(v);
26
+ }, function (v) {
27
+ return isNaN(v) ? null : v;
28
+ })(observation);
29
+
30
+ return R.pipe(R.path([attributeIndex, 'values', valueIndex, 'id']), function (v) {
31
+ return R.isNil(v) ? null : Number(v);
32
+ }, function (v) {
33
+ return isNaN(v) ? null : v;
34
+ })(attributes);
35
+ }, formatAttributesIndexes);
36
+ };
37
+
38
+ var formatValue = exports.formatValue = function formatValue(observation, formatAttributesIndexes, attributes) {
39
+ var value = R.prop('value', observation);
40
+ if (R.is(Boolean, value)) {
41
+ return value;
42
+ }
43
+ if (R.is(String, value)) {
44
+ var monthMatch = value.match(/^\-\-([\d]{2})$/);
45
+ if (R.is(Array, monthMatch)) {
46
+ return R.nth(1, monthMatch);
47
+ }
48
+ var monthDayMatch = value.match(/^\-\-([\d]{2}\-[\d]{2})$/);
49
+ if (R.is(Array, monthDayMatch)) {
50
+ return R.nth(1, monthDayMatch);
51
+ }
52
+ var dayMatch = value.match(/^\-\-\-([\d]{2})$/);
53
+ if (R.is(Array, dayMatch)) {
54
+ return R.nth(1, dayMatch);
55
+ }
56
+ return value;
57
+ }
58
+
59
+ var _getFormatAttributesV = getFormatAttributesValues(observation, formatAttributesIndexes, attributes),
60
+ prefscale = _getFormatAttributesV.prefscale,
61
+ decimals = _getFormatAttributesV.decimals;
62
+
63
+ var formatScale = R.when(R.always(isValidNumber(prefscale)), function (value) {
64
+ return (0, _numeral2.default)(value).multiply(Math.pow(10, -1 * Number(prefscale))).value();
65
+ });
66
+
67
+ var formatSeparator = function formatSeparator(value) {
68
+ return (0, _numeral2.default)(value).format('0,0.[0000000]');
69
+ };
70
+ var formatDecimals = R.ifElse(R.always(isValidNumber(decimals)), function (value) {
71
+ return (0, _numeral2.default)(value).format(R.ifElse(R.equals(0), R.always('0,0'), function (d) {
72
+ return '0,0.' + R.join('', R.times(R.always('0'), d));
73
+ })(decimals));
74
+ }, formatSeparator);
75
+
76
+ return R.ifElse(isValidNumber, R.pipe(formatScale, formatDecimals), R.always('..'))(observation.value);
77
+ };
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getDimensions = exports.isDisplayedFromOwnAnnotations = 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 _dotstatsuiteSdmxjs = require('@sis-cc/dotstatsuite-sdmxjs');
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 isDisplayedFromOwnAnnotations = exports.isDisplayedFromOwnAnnotations = function isDisplayedFromOwnAnnotations(artefact) {
23
+ var artefactAnnotations = R.propOr([], 'annotations', artefact);
24
+ return R.pipe(R.propOr([], 'annotations'), R.find(R.propEq('type', 'NOT_DISPLAYED')), R.isNil)(artefact);
25
+ };
26
+
27
+ // sdmxJson
28
+
29
+ var getDimensions = exports.getDimensions = function getDimensions(sdmxJson) {
30
+ var annotations = R.pathOr([], ['data', 'structure', 'annotations'], sdmxJson);
31
+ var locale = R.path([], ['meta', 'contentLanguage'], sdmxJson);
32
+
33
+ var enhanceValues = R.addIndex(R.map)(function (val, __index) {
34
+ var annotationsIndexes = R.propOr([], 'annotations', val);
35
+ var valueAnnotations = R.props(annotationsIndexes, annotations);
36
+
37
+ return (0, _extends3.default)({}, value, {
38
+ __index: __index,
39
+ annotations: valueAnnotations,
40
+ name: R.pathOr('[' + val.id + ']', ['names', locale], val)
41
+ });
42
+ });
43
+
44
+ return R.pipe(R.pathOr([], ['data', 'structure', 'dimensions']), R.addIndex(R.map)(function (dimension, __index) {
45
+ var annotationsIndexes = R.propOr([], 'annotations', dimension);
46
+ var dimensionAnnotations = R.props(annotationsIndexes, annotations);
47
+
48
+ return (0, _extends3.default)({}, dimension, {
49
+ __index: __index,
50
+ name: R.pathOr('[' + val.id + ']', ['names', locale], val),
51
+ annotations: dimensionAnnotations,
52
+ values: enhanceValues(R.propOr([], 'values', dimension))
53
+ });
54
+ }))(sdmxJson);
55
+ };
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getDisplay = 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 getDisplay = exports.getDisplay = function getDisplay(_ref) {
15
+ var _ref$noDisplayIndexes = _ref.noDisplayIndexes,
16
+ noDisplayIndexes = _ref$noDisplayIndexes === undefined ? [] : _ref$noDisplayIndexes,
17
+ _ref$notDisplayedCode = _ref.notDisplayedCodes,
18
+ notDisplayedCodes = _ref$notDisplayedCode === undefined ? {} : _ref$notDisplayedCode;
19
+
20
+ var annotationsValidator = R.pipe(R.propOr([], 'annotations'), R.intersection(noDisplayIndexes), R.isEmpty);
21
+
22
+ var blacklistValidator = R.ifElse(R.has('values'), function (_ref2) {
23
+ var id = _ref2.id;
24
+ return R.anyPass([R.complement(R.has)(id), R.hasPath([id, 'values'])])(notDisplayedCodes);
25
+ }, function (_ref3) {
26
+ var id = _ref3.id,
27
+ parent = _ref3.parent;
28
+ return R.complement(R.hasPath)([parent, 'values', id], notDisplayedCodes);
29
+ });
30
+
31
+ return R.allPass([annotationsValidator, blacklistValidator]);
32
+ };
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getObservations = 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 getObservations = exports.getObservations = function getObservations(sdmxJson) {
15
+ return R.pipe(R.pathOr({}, ['data', 'dataSets', 0, 'observations']), R.mapObjIndexed(function (observation, observationKey) {
16
+ var value = R.head(observation);
17
+ var attrValuesIndexes = R.tail(observation);
18
+ var dimValuesIndexes = R.split(':', observationKey);
19
+
20
+ return {
21
+ key: observationKey,
22
+ value: value,
23
+ attrValuesIndexes: attrValuesIndexes,
24
+ dimValuesIndexes: dimValuesIndexes
25
+ };
26
+ }))(sdmxJson);
27
+ };
@@ -9,8 +9,6 @@ var _ramda = require('ramda');
9
9
 
10
10
  var R = _interopRequireWildcard(_ramda);
11
11
 
12
- var _getCellValue = require('./getCellValue');
13
-
14
12
  var _dimensionUtils = require('../../dimension-utils');
15
13
 
16
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; } }
@@ -72,6 +70,6 @@ var isValidNumber = R.both(R.is(Number), R.complement(R.equals(NaN)));
72
70
 
73
71
  var getCells = exports.getCells = function getCells(data, display, customAttributes, unitsProps) {
74
72
  return R.mapObjIndexed(function (observation) {
75
- return R.pipe(R.set(R.lensProp('flags'), getFlags(customAttributes, (0, _dimensionUtils.dimensionValueDisplay)(display), unitsProps)(R.pick(['attributes', 'units'], observation))), R.set(R.lensProp('intValue'), R.prop('value')(observation)), R.set(R.lensProp('value'), (0, _getCellValue.getCellValue)(observation)), R.assoc('indexedDimValIds', R.prop('indexedDimValIds', observation)))({});
73
+ return R.pipe(R.set(R.lensProp('flags'), getFlags(customAttributes, (0, _dimensionUtils.dimensionValueDisplay)(display), unitsProps)(observation)), R.set(R.lensProp('intValue'), R.prop('value', observation)), R.set(R.lensProp('value'), R.prop('formattedValue', observation)), R.assoc('indexedDimValIds', R.prop('indexedDimValIds', observation)))({});
76
74
  }, R.propOr({}, 'observations', data));
77
75
  };