@sis-cc/dotstatsuite-components 17.13.0 → 17.15.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/lib/rules/src/get-values-enhanced.js +1 -1
- package/lib/rules/src/v8-transformer.js +6 -6
- package/lib/rules2/src/index.js +0 -9
- package/lib/rules2/src/parseMetadataSeries.js +1 -3
- package/lib/rules2/src/table/getLayoutData2.js +81 -41
- package/lib/rules2/src/table/parseSeriesIndexesHierarchies.js +55 -42
- package/package.json +1 -1
- package/src/rules/src/get-values-enhanced.js +33 -33
- package/src/rules/src/v8-transformer.js +6 -7
- package/src/rules2/src/index.js +0 -1
- package/src/rules2/src/parseMetadataSeries.js +5 -6
- package/src/rules2/src/table/getLayoutData2.js +76 -61
- package/src/rules2/src/table/parseSeriesIndexesHierarchies.js +37 -40
- package/test/getLayoutData2.test.js +142 -33
- package/test/parseSeriesIndexesHierarchies.test.js +1 -0
- package/lib/rules2/src/getSidebarData.js +0 -92
- package/src/rules2/src/getSidebarData.js +0 -85
- package/test/getSidebarData.test.js +0 -322
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getSidebarData = 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 _src = require('../../rules/src');
|
|
17
|
-
|
|
18
|
-
var _constants = require('./constants');
|
|
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 sortByCoordinates = function sortByCoordinates(a, b) {
|
|
25
|
-
var splitACoord = a.splitCoord;
|
|
26
|
-
var splitBCoord = b.splitCoord;
|
|
27
|
-
|
|
28
|
-
var aWeight = R.pipe(R.reject(R.isEmpty), R.length)(splitACoord);
|
|
29
|
-
var bWeight = R.pipe(R.reject(R.isEmpty), R.length)(splitBCoord);
|
|
30
|
-
if (aWeight !== bWeight) {
|
|
31
|
-
return bWeight - aWeight;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
var ind = 0;
|
|
35
|
-
while (splitACoord[ind] === splitBCoord[ind]) {
|
|
36
|
-
ind++;
|
|
37
|
-
}
|
|
38
|
-
var _a = R.isEmpty(splitACoord[ind]) ? 0 : Number(splitACoord[ind]);
|
|
39
|
-
var _b = R.isEmpty(splitBCoord[ind]) ? 0 : Number(splitBCoord[ind]);
|
|
40
|
-
return _b - _a;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// options = { display, attributesLabel }
|
|
44
|
-
var getSidebarData = exports.getSidebarData = function getSidebarData(attributesSeries, metadataSeries, dataflow, dimensions, options) {
|
|
45
|
-
var coordinates = R.uniq(R.concat(R.keys(attributesSeries), R.keys(metadataSeries)));
|
|
46
|
-
return R.pipe(R.map(function (coordinate) {
|
|
47
|
-
var attributes = R.prop(coordinate, attributesSeries);
|
|
48
|
-
var metadata = R.prop(coordinate, metadataSeries);
|
|
49
|
-
var children = R.concat(R.isNil(attributes) ? [] : [{ id: coordinate + '-attr', label: options.attributesLabel, children: attributes }], R.isNil(metadata) ? [] : metadata);
|
|
50
|
-
var splitCoord = R.split(':', coordinate);
|
|
51
|
-
|
|
52
|
-
var _R$addIndex = R.addIndex(R.reduce)(function (acc, valIndex, dimIndex) {
|
|
53
|
-
if (R.isEmpty(valIndex)) {
|
|
54
|
-
return (0, _extends3.default)({}, acc, { split: R.append('', acc.split) });
|
|
55
|
-
}
|
|
56
|
-
var dim = R.nth(dimIndex, dimensions);
|
|
57
|
-
var values = R.propOr([], 'values', dim || {});
|
|
58
|
-
var value = R.nth(Number(valIndex), values);
|
|
59
|
-
if (!value || !R.propOr(true, 'display', dim) || !R.propOr(true, 'display', value) || R.includes(R.prop('id', value), _constants.REJECTED_VALUE_IDS)) {
|
|
60
|
-
return (0, _extends3.default)({}, acc, { split: R.append('', acc.split) });
|
|
61
|
-
}
|
|
62
|
-
var dimLabel = (0, _src.dimensionValueDisplay)(options.display)(dim);
|
|
63
|
-
var valLabel = (0, _src.dimensionValueDisplay)(options.display)(value);
|
|
64
|
-
return {
|
|
65
|
-
labels: R.append(dimLabel + ': ' + valLabel, acc.labels),
|
|
66
|
-
split: R.append(valIndex, acc.split)
|
|
67
|
-
};
|
|
68
|
-
}, { split: [], labels: [] }, splitCoord),
|
|
69
|
-
split = _R$addIndex.split,
|
|
70
|
-
labels = _R$addIndex.labels;
|
|
71
|
-
|
|
72
|
-
var label = R.isEmpty(labels) ? (0, _src.dimensionValueDisplay)(options.display)(dataflow) : R.join(' - ', labels);
|
|
73
|
-
|
|
74
|
-
return {
|
|
75
|
-
id: R.join(':', split),
|
|
76
|
-
splitCoord: split,
|
|
77
|
-
label: label,
|
|
78
|
-
children: R.filter(R.identity, children)
|
|
79
|
-
};
|
|
80
|
-
}), function (series) {
|
|
81
|
-
// after removed non displayed dim vals, some series might be duplicated
|
|
82
|
-
var grouped = R.groupBy(R.prop('id'), series);
|
|
83
|
-
return R.pipe(R.map(function (entries) {
|
|
84
|
-
if (R.length(entries) === 1) {
|
|
85
|
-
return R.head(entries);
|
|
86
|
-
}
|
|
87
|
-
var head = R.head(entries);
|
|
88
|
-
var children = R.pipe(R.pluck('children'), R.unnest)(entries);
|
|
89
|
-
return R.assoc('children', children, head);
|
|
90
|
-
}), R.values)(grouped);
|
|
91
|
-
}, R.sort(sortByCoordinates))(coordinates);
|
|
92
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import * as R from 'ramda';
|
|
2
|
-
import { dimensionValueDisplay } from '../../rules/src';
|
|
3
|
-
import { REJECTED_VALUE_IDS } from './constants';
|
|
4
|
-
|
|
5
|
-
const sortByCoordinates = (a, b) => {
|
|
6
|
-
const splitACoord = a.splitCoord;
|
|
7
|
-
const splitBCoord = b.splitCoord;
|
|
8
|
-
|
|
9
|
-
const aWeight = R.pipe(R.reject(R.isEmpty), R.length)(splitACoord);
|
|
10
|
-
const bWeight = R.pipe(R.reject(R.isEmpty), R.length)(splitBCoord);
|
|
11
|
-
if (aWeight !== bWeight) {
|
|
12
|
-
return bWeight - aWeight;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
let ind = 0;
|
|
16
|
-
while (splitACoord[ind] === splitBCoord[ind]) {
|
|
17
|
-
ind++;
|
|
18
|
-
}
|
|
19
|
-
const _a = R.isEmpty(splitACoord[ind]) ? 0 : Number(splitACoord[ind]);
|
|
20
|
-
const _b = R.isEmpty(splitBCoord[ind]) ? 0 : Number(splitBCoord[ind]);
|
|
21
|
-
return _b - _a;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// options = { display, attributesLabel }
|
|
25
|
-
export const getSidebarData = (attributesSeries, metadataSeries, dataflow, dimensions, options) => {
|
|
26
|
-
const coordinates = R.uniq(R.concat(R.keys(attributesSeries), R.keys(metadataSeries)));
|
|
27
|
-
return R.pipe(
|
|
28
|
-
R.map(coordinate => {
|
|
29
|
-
const attributes = R.prop(coordinate, attributesSeries);
|
|
30
|
-
const metadata = R.prop(coordinate, metadataSeries);
|
|
31
|
-
const children = R.concat(
|
|
32
|
-
R.isNil(attributes) ? [] : [{ id: `${coordinate}-attr`, label: options.attributesLabel, children: attributes }],
|
|
33
|
-
R.isNil(metadata) ? [] : metadata,
|
|
34
|
-
);
|
|
35
|
-
const splitCoord = R.split(':', coordinate);
|
|
36
|
-
const { split, labels } = R.addIndex(R.reduce)(
|
|
37
|
-
(acc, valIndex, dimIndex) => {
|
|
38
|
-
if (R.isEmpty(valIndex)) {
|
|
39
|
-
return ({ ...acc, split: R.append('', acc.split) });
|
|
40
|
-
}
|
|
41
|
-
const dim = R.nth(dimIndex, dimensions);
|
|
42
|
-
const values = R.propOr([], 'values', dim || {});
|
|
43
|
-
const value = R.nth(Number(valIndex), values);
|
|
44
|
-
if (!value || !R.propOr(true, 'display', dim) || !R.propOr(true, 'display', value)
|
|
45
|
-
|| R.includes(R.prop('id', value), REJECTED_VALUE_IDS)) {
|
|
46
|
-
return ({ ...acc, split: R.append('', acc.split) });
|
|
47
|
-
}
|
|
48
|
-
const dimLabel = dimensionValueDisplay(options.display)(dim);
|
|
49
|
-
const valLabel = dimensionValueDisplay(options.display)(value);
|
|
50
|
-
return ({
|
|
51
|
-
labels: R.append(`${dimLabel}: ${valLabel}`, acc.labels),
|
|
52
|
-
split: R.append(valIndex, acc.split)
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
{ split: [], labels: [] },
|
|
56
|
-
splitCoord
|
|
57
|
-
);
|
|
58
|
-
const label = R.isEmpty(labels)
|
|
59
|
-
? dimensionValueDisplay(options.display)(dataflow)
|
|
60
|
-
: R.join(' - ', labels);
|
|
61
|
-
|
|
62
|
-
return ({
|
|
63
|
-
id: R.join(':', split),
|
|
64
|
-
splitCoord: split,
|
|
65
|
-
label,
|
|
66
|
-
children: R.filter(R.identity, children),
|
|
67
|
-
});
|
|
68
|
-
}),
|
|
69
|
-
series => { // after removed non displayed dim vals, some series might be duplicated
|
|
70
|
-
const grouped = R.groupBy(R.prop('id'), series);
|
|
71
|
-
return R.pipe(
|
|
72
|
-
R.map(entries => {
|
|
73
|
-
if (R.length(entries) === 1) {
|
|
74
|
-
return R.head(entries);
|
|
75
|
-
}
|
|
76
|
-
const head = R.head(entries);
|
|
77
|
-
const children = R.pipe(R.pluck('children'), R.unnest)(entries);
|
|
78
|
-
return R.assoc('children', children, head);
|
|
79
|
-
}),
|
|
80
|
-
R.values
|
|
81
|
-
)(grouped);
|
|
82
|
-
},
|
|
83
|
-
R.sort(sortByCoordinates),
|
|
84
|
-
)(coordinates);
|
|
85
|
-
};
|
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai';
|
|
2
|
-
import { getSidebarData } from '../src/rules2/src/getSidebarData';
|
|
3
|
-
|
|
4
|
-
describe('getSidebarData tests', () => {
|
|
5
|
-
it('complete case', () => {
|
|
6
|
-
const attributes = {
|
|
7
|
-
'::': [
|
|
8
|
-
{ id: 'aa0', label: 'advanced attribute 0', value: 'value' },
|
|
9
|
-
{ id: 'aa1', label: 'advanced attribute 1', value: 'value' },
|
|
10
|
-
],
|
|
11
|
-
'0::': [
|
|
12
|
-
{ id: 'aa2', label: 'advanced attribute 2', value: 'value' },
|
|
13
|
-
{ id: 'aa3', label: 'advanced attribute 3', value: 'value' },
|
|
14
|
-
]
|
|
15
|
-
};
|
|
16
|
-
const metadata = {
|
|
17
|
-
'0::': [
|
|
18
|
-
{ id: 'ma0', label: 'metadata attribute 0', value: 'value' },
|
|
19
|
-
{ id: 'ma1', label: 'metadata attribute 1', value: 'value' },
|
|
20
|
-
],
|
|
21
|
-
'0::0': [
|
|
22
|
-
{ id: 'ma2', label: 'metadata attribute 2', value: 'value' },
|
|
23
|
-
{ id: 'ma3', label: 'metadata attribute 3', value: 'value' },
|
|
24
|
-
]
|
|
25
|
-
};
|
|
26
|
-
const options = {
|
|
27
|
-
display: 'code',
|
|
28
|
-
attributesLabel: 'Advanced Attributes'
|
|
29
|
-
};
|
|
30
|
-
const dataflow = {
|
|
31
|
-
id: 'DF',
|
|
32
|
-
name: 'Dataflow'
|
|
33
|
-
};
|
|
34
|
-
const dimensions = [
|
|
35
|
-
{ id: 'd0', name: 'dimension 0', values: [{ id: 'd0v0', name: 'value 0' }] },
|
|
36
|
-
{ id: 'd1', name: 'dimension 1', values: [{ id: 'd1v0', name: 'value 0' }] },
|
|
37
|
-
{ id: 'd2', name: 'dimension 2', values: [{ id: 'd2v0', name: 'value 0' }] },
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
expect(getSidebarData(attributes, metadata, dataflow, dimensions, options)).to.deep.equal([
|
|
41
|
-
{
|
|
42
|
-
id: '0::0',
|
|
43
|
-
label: 'd0: d0v0 - d2: d2v0',
|
|
44
|
-
splitCoord: ['0', '', '0'],
|
|
45
|
-
children: [
|
|
46
|
-
{
|
|
47
|
-
id: 'ma2',
|
|
48
|
-
label: 'metadata attribute 2',
|
|
49
|
-
value: 'value'
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: 'ma3',
|
|
53
|
-
label: 'metadata attribute 3',
|
|
54
|
-
value: 'value'
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: '0::',
|
|
60
|
-
label: 'd0: d0v0',
|
|
61
|
-
splitCoord: ['0', '', ''],
|
|
62
|
-
children: [
|
|
63
|
-
{
|
|
64
|
-
id: '0::-attr',
|
|
65
|
-
label: 'Advanced Attributes',
|
|
66
|
-
children: [
|
|
67
|
-
{
|
|
68
|
-
id: 'aa2',
|
|
69
|
-
label: 'advanced attribute 2',
|
|
70
|
-
value: 'value'
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
id: 'aa3',
|
|
74
|
-
label: 'advanced attribute 3',
|
|
75
|
-
value: 'value'
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: 'ma0',
|
|
81
|
-
label: 'metadata attribute 0',
|
|
82
|
-
value: 'value'
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: 'ma1',
|
|
86
|
-
label: 'metadata attribute 1',
|
|
87
|
-
value: 'value'
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: '::',
|
|
93
|
-
label: 'DF',
|
|
94
|
-
splitCoord: ['', '', ''],
|
|
95
|
-
children: [
|
|
96
|
-
{
|
|
97
|
-
id: '::-attr',
|
|
98
|
-
label: 'Advanced Attributes',
|
|
99
|
-
children: [
|
|
100
|
-
{
|
|
101
|
-
id: 'aa0',
|
|
102
|
-
label: 'advanced attribute 0',
|
|
103
|
-
value: 'value'
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
id: 'aa1',
|
|
107
|
-
label: 'advanced attribute 1',
|
|
108
|
-
value: 'value'
|
|
109
|
-
}
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
]);
|
|
115
|
-
});
|
|
116
|
-
it('discordadnce between dimensions and metadata case', () => {
|
|
117
|
-
const attributes = {
|
|
118
|
-
'::': [
|
|
119
|
-
{ id: 'aa0', label: 'advanced attribute 0', value: 'value' },
|
|
120
|
-
{ id: 'aa1', label: 'advanced attribute 1', value: 'value' },
|
|
121
|
-
],
|
|
122
|
-
'0::': [
|
|
123
|
-
{ id: 'aa2', label: 'advanced attribute 2', value: 'value' },
|
|
124
|
-
{ id: 'aa3', label: 'advanced attribute 3', value: 'value' },
|
|
125
|
-
]
|
|
126
|
-
};
|
|
127
|
-
const metadata = {
|
|
128
|
-
'0::': [
|
|
129
|
-
{ id: 'ma0', label: 'metadata attribute 0', value: 'value' },
|
|
130
|
-
{ id: 'ma1', label: 'metadata attribute 1', value: 'value' },
|
|
131
|
-
],
|
|
132
|
-
'0::0': [
|
|
133
|
-
{ id: 'ma2', label: 'metadata attribute 2', value: 'value' },
|
|
134
|
-
{ id: 'ma3', label: 'metadata attribute 3', value: 'value' },
|
|
135
|
-
]
|
|
136
|
-
};
|
|
137
|
-
const options = {
|
|
138
|
-
display: 'code',
|
|
139
|
-
attributesLabel: 'Advanced Attributes'
|
|
140
|
-
};
|
|
141
|
-
const dataflow = {
|
|
142
|
-
id: 'DF',
|
|
143
|
-
name: 'Dataflow'
|
|
144
|
-
};
|
|
145
|
-
const dimensions = [
|
|
146
|
-
{ id: 'd0', name: 'dimension 0', values: [{ id: 'd0v0', name: 'value 0' }] },
|
|
147
|
-
{ id: 'd1', name: 'dimension 1', values: [{ id: 'd1v0', name: 'value 0' }] },
|
|
148
|
-
];
|
|
149
|
-
expect(getSidebarData(attributes, metadata, dataflow, dimensions, options)).to.deep.equal([
|
|
150
|
-
{
|
|
151
|
-
id: '0::',
|
|
152
|
-
label: 'd0: d0v0',
|
|
153
|
-
splitCoord: ['0', '', ''],
|
|
154
|
-
children: [
|
|
155
|
-
{
|
|
156
|
-
id: '0::-attr',
|
|
157
|
-
label: 'Advanced Attributes',
|
|
158
|
-
children: [
|
|
159
|
-
{
|
|
160
|
-
id: 'aa2',
|
|
161
|
-
label: 'advanced attribute 2',
|
|
162
|
-
value: 'value'
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
id: 'aa3',
|
|
166
|
-
label: 'advanced attribute 3',
|
|
167
|
-
value: 'value'
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
id: 'ma0',
|
|
173
|
-
label: 'metadata attribute 0',
|
|
174
|
-
value: 'value'
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
id: 'ma1',
|
|
178
|
-
label: 'metadata attribute 1',
|
|
179
|
-
value: 'value'
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
id: 'ma2',
|
|
183
|
-
label: 'metadata attribute 2',
|
|
184
|
-
value: 'value'
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
id: 'ma3',
|
|
188
|
-
label: 'metadata attribute 3',
|
|
189
|
-
value: 'value'
|
|
190
|
-
}
|
|
191
|
-
]
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
id: '::',
|
|
195
|
-
label: 'DF',
|
|
196
|
-
splitCoord: ['', '', ''],
|
|
197
|
-
children: [
|
|
198
|
-
{
|
|
199
|
-
id: '::-attr',
|
|
200
|
-
label: 'Advanced Attributes',
|
|
201
|
-
children: [
|
|
202
|
-
{
|
|
203
|
-
id: 'aa0',
|
|
204
|
-
label: 'advanced attribute 0',
|
|
205
|
-
value: 'value'
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
id: 'aa1',
|
|
209
|
-
label: 'advanced attribute 1',
|
|
210
|
-
value: 'value'
|
|
211
|
-
}
|
|
212
|
-
]
|
|
213
|
-
}
|
|
214
|
-
]
|
|
215
|
-
}
|
|
216
|
-
]);
|
|
217
|
-
});
|
|
218
|
-
it('non displayed dimensions handling', () => {
|
|
219
|
-
const attributes = {
|
|
220
|
-
'::': [
|
|
221
|
-
{ id: 'aa0', label: 'advanced attribute 0', value: 'value' },
|
|
222
|
-
{ id: 'aa1', label: 'advanced attribute 1', value: 'value' },
|
|
223
|
-
],
|
|
224
|
-
'0::': [
|
|
225
|
-
{ id: 'aa2', label: 'advanced attribute 2', value: 'value' },
|
|
226
|
-
{ id: 'aa3', label: 'advanced attribute 3', value: 'value' },
|
|
227
|
-
]
|
|
228
|
-
};
|
|
229
|
-
const metadata = {
|
|
230
|
-
'0::': [
|
|
231
|
-
{ id: 'ma0', label: 'metadata attribute 0', value: 'value' },
|
|
232
|
-
{ id: 'ma1', label: 'metadata attribute 1', value: 'value' },
|
|
233
|
-
],
|
|
234
|
-
'0::0': [
|
|
235
|
-
{ id: 'ma2', label: 'metadata attribute 2', value: 'value' },
|
|
236
|
-
{ id: 'ma3', label: 'metadata attribute 3', value: 'value' },
|
|
237
|
-
]
|
|
238
|
-
};
|
|
239
|
-
const options = {
|
|
240
|
-
display: 'code',
|
|
241
|
-
attributesLabel: 'Advanced Attributes'
|
|
242
|
-
};
|
|
243
|
-
const dataflow = {
|
|
244
|
-
id: 'DF',
|
|
245
|
-
name: 'Dataflow'
|
|
246
|
-
};
|
|
247
|
-
const dimensions = [
|
|
248
|
-
{ id: 'd0', name: 'dimension 0', values: [{ id: 'd0v0', name: 'value 0' }] },
|
|
249
|
-
{ id: 'd1', name: 'dimension 1', values: [{ id: 'd1v0', name: 'value 0' }] },
|
|
250
|
-
{ id: 'd2', name: 'dimension 2', display: false, values: [{ id: 'd2v0', name: 'value 0' }] },
|
|
251
|
-
];
|
|
252
|
-
|
|
253
|
-
expect(getSidebarData(attributes, metadata, dataflow, dimensions, options)).to.deep.equal([
|
|
254
|
-
{
|
|
255
|
-
id: '0::',
|
|
256
|
-
label: 'd0: d0v0',
|
|
257
|
-
splitCoord: ['0', '', ''],
|
|
258
|
-
children: [
|
|
259
|
-
{
|
|
260
|
-
id: '0::-attr',
|
|
261
|
-
label: 'Advanced Attributes',
|
|
262
|
-
children: [
|
|
263
|
-
{
|
|
264
|
-
id: 'aa2',
|
|
265
|
-
label: 'advanced attribute 2',
|
|
266
|
-
value: 'value'
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
id: 'aa3',
|
|
270
|
-
label: 'advanced attribute 3',
|
|
271
|
-
value: 'value'
|
|
272
|
-
}
|
|
273
|
-
]
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
id: 'ma0',
|
|
277
|
-
label: 'metadata attribute 0',
|
|
278
|
-
value: 'value'
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
id: 'ma1',
|
|
282
|
-
label: 'metadata attribute 1',
|
|
283
|
-
value: 'value'
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
id: 'ma2',
|
|
287
|
-
label: 'metadata attribute 2',
|
|
288
|
-
value: 'value'
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
id: 'ma3',
|
|
292
|
-
label: 'metadata attribute 3',
|
|
293
|
-
value: 'value'
|
|
294
|
-
}
|
|
295
|
-
]
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
id: '::',
|
|
299
|
-
label: 'DF',
|
|
300
|
-
splitCoord: ['', '', ''],
|
|
301
|
-
children: [
|
|
302
|
-
{
|
|
303
|
-
id: '::-attr',
|
|
304
|
-
label: 'Advanced Attributes',
|
|
305
|
-
children: [
|
|
306
|
-
{
|
|
307
|
-
id: 'aa0',
|
|
308
|
-
label: 'advanced attribute 0',
|
|
309
|
-
value: 'value'
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
id: 'aa1',
|
|
313
|
-
label: 'advanced attribute 1',
|
|
314
|
-
value: 'value'
|
|
315
|
-
}
|
|
316
|
-
]
|
|
317
|
-
}
|
|
318
|
-
]
|
|
319
|
-
}
|
|
320
|
-
]);
|
|
321
|
-
});
|
|
322
|
-
});
|