@sis-cc/dotstatsuite-components 8.11.0 → 8.13.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 (52) hide show
  1. package/lib/app.js +13 -5
  2. package/lib/rules/src/factories/stacked-dimension.js +17 -23
  3. package/lib/rules/src/factories/stacked-series.js +82 -158
  4. package/lib/rules/src/index.js +3 -6
  5. package/lib/rules/src/properties/index.js +2 -1
  6. package/lib/rules/src/properties/stacked.js +35 -11
  7. package/lib/rules/src/properties/utils.js +7 -1
  8. package/lib/rules-driver/src/app.js +116 -167
  9. package/lib/viewer/src/app/use-case-3.js +52 -0
  10. package/lib/viewer/src/app.js +9 -0
  11. package/lib/viewer/src/index.js +1 -1
  12. package/lib/viewer/src/legends/SeriesLegend.js +3 -1
  13. package/package.json +2 -2
  14. package/src/app.js +10 -5
  15. package/src/rules/src/factories/stacked-dimension.js +14 -10
  16. package/src/rules/src/factories/stacked-series.js +102 -94
  17. package/src/rules/src/index.js +1 -2
  18. package/src/rules/src/properties/index.js +3 -1
  19. package/src/rules/src/properties/stacked.js +23 -7
  20. package/src/rules/src/properties/utils.js +8 -3
  21. package/src/rules-driver/src/app.js +116 -132
  22. package/src/rules-driver/src/mocks/data1.json +332 -0
  23. package/src/rules-driver/src/mocks/data2.json +309 -0
  24. package/src/viewer/src/app/use-case-3.js +18 -0
  25. package/src/viewer/src/app.js +6 -0
  26. package/src/viewer/src/index.js +2 -2
  27. package/src/viewer/src/legends/SeriesLegend.js +4 -1
  28. package/lib/rules-driver/src/app/chart.js +0 -52
  29. package/lib/rules-driver/src/app/config-axis.js +0 -95
  30. package/lib/rules-driver/src/app/config-buttons.js +0 -47
  31. package/lib/rules-driver/src/app/config-input.js +0 -51
  32. package/lib/rules-driver/src/app/config-select.js +0 -57
  33. package/lib/rules-driver/src/app/config-t4size.js +0 -61
  34. package/lib/rules-driver/src/app/config1.js +0 -148
  35. package/lib/rules-driver/src/app/menu.js +0 -44
  36. package/lib/rules-driver/src/app/viewer1.js +0 -39
  37. package/lib/rules-driver/src/app/viewer2.js +0 -115
  38. package/src/rules-driver/src/app/chart.js +0 -18
  39. package/src/rules-driver/src/app/config-axis.js +0 -54
  40. package/src/rules-driver/src/app/config-buttons.js +0 -27
  41. package/src/rules-driver/src/app/config-input.js +0 -35
  42. package/src/rules-driver/src/app/config-select.js +0 -25
  43. package/src/rules-driver/src/app/config-t4size.js +0 -50
  44. package/src/rules-driver/src/app/config1.js +0 -120
  45. package/src/rules-driver/src/app/menu.js +0 -27
  46. package/src/rules-driver/src/app/viewer1.js +0 -18
  47. package/src/rules-driver/src/app/viewer2.js +0 -77
  48. package/src/rules-driver/src/mocks/ecb.json +0 -2069
  49. package/src/rules-driver/src/mocks/ins.json +0 -264
  50. package/src/rules-driver/src/mocks/oecd-time.json +0 -864
  51. package/src/rules-driver/src/mocks/oecd.json +0 -372
  52. package/src/rules-driver/src/mocks/tunisia.json +0 -333
@@ -0,0 +1,332 @@
1
+ {
2
+ "header": {
3
+ "schema": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/master/data-message/tools/schemas/1.0/sdmx-json-data-schema.json",
4
+ "id": "IREF000446",
5
+ "prepared": "2021-09-07T13:44:06Z",
6
+ "test": true,
7
+ "contentLanguages": [
8
+ "en"
9
+ ],
10
+ "sender": {
11
+ "id": "SIS-CC-stable_-_DotStat_v8",
12
+ "name": "unknown",
13
+ "names": {
14
+ "en": "unknown"
15
+ }
16
+ }
17
+ },
18
+ "dataSets": [
19
+ {
20
+ "action": "Information",
21
+ "links": [
22
+ {
23
+ "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=OECD:DSD_KEI(1.0)",
24
+ "rel": "DataStructure"
25
+ }
26
+ ],
27
+ "annotations": [
28
+ 0,
29
+ 1,
30
+ 2,
31
+ 3,
32
+ 4
33
+ ],
34
+ "observations": {
35
+ "0:0:0:0:0": [
36
+ 5.73333333333333
37
+ ],
38
+ "0:1:0:0:0": [
39
+ 8.5
40
+ ],
41
+ "0:2:0:0:0": [
42
+ 6.05642340833333
43
+ ]
44
+ }
45
+ }
46
+ ],
47
+ "structure": {
48
+ "name": "Harmonised Unemployment Rate",
49
+ "names": {
50
+ "en": "Harmonised Unemployment Rate"
51
+ },
52
+ "dimensions": {
53
+ "observation": [
54
+ {
55
+ "id": "SUBJECT",
56
+ "name": "Subject",
57
+ "names": {
58
+ "en": "Subject"
59
+ },
60
+ "keyPosition": 0,
61
+ "roles": [
62
+ "SUBJECT"
63
+ ],
64
+ "values": [
65
+ {
66
+ "id": "LRHUTTTT",
67
+ "order": 75,
68
+ "name": "Harmonised unemployment rate: all persons, s.a.",
69
+ "names": {
70
+ "en": "Harmonised unemployment rate: all persons, s.a."
71
+ },
72
+ "parent": "LR",
73
+ "annotations": [
74
+ 5
75
+ ],
76
+ "__indexPosition": 0,
77
+ "__index": 0
78
+ }
79
+ ],
80
+ "role": "SUBJECT"
81
+ },
82
+ {
83
+ "id": "LOCATION",
84
+ "name": "Country",
85
+ "names": {
86
+ "en": "Country"
87
+ },
88
+ "keyPosition": 1,
89
+ "roles": [
90
+ "LOCATION"
91
+ ],
92
+ "values": [
93
+ {
94
+ "id": "AUS",
95
+ "order": 0,
96
+ "name": "Australia",
97
+ "names": {
98
+ "en": "Australia"
99
+ },
100
+ "annotations": [
101
+ 5
102
+ ],
103
+ "__indexPosition": 0,
104
+ "__index": 2
105
+ },
106
+ {
107
+ "id": "AUT",
108
+ "order": 1,
109
+ "name": "Austria",
110
+ "names": {
111
+ "en": "Austria"
112
+ },
113
+ "annotations": [
114
+ 6
115
+ ],
116
+ "__indexPosition": 1,
117
+ "__index": 0
118
+ },
119
+ {
120
+ "id": "BEL",
121
+ "order": 2,
122
+ "name": "Belgium",
123
+ "names": {
124
+ "en": "Belgium"
125
+ },
126
+ "annotations": [
127
+ 7
128
+ ],
129
+ "__indexPosition": 2,
130
+ "__index": 1
131
+ }
132
+ ],
133
+ "role": "LOCATION"
134
+ },
135
+ {
136
+ "id": "MEASURE",
137
+ "name": "Measure",
138
+ "names": {
139
+ "en": "Measure"
140
+ },
141
+ "keyPosition": 2,
142
+ "roles": [
143
+ "MEASURE"
144
+ ],
145
+ "values": [
146
+ {
147
+ "id": "ST",
148
+ "order": 5,
149
+ "name": "Level, ratio or index",
150
+ "names": {
151
+ "en": "Level, ratio or index"
152
+ },
153
+ "annotations": [
154
+ 7
155
+ ],
156
+ "__indexPosition": 0,
157
+ "__index": 0
158
+ }
159
+ ],
160
+ "role": "MEASURE"
161
+ },
162
+ {
163
+ "id": "FREQUENCY",
164
+ "name": "Frequency",
165
+ "names": {
166
+ "en": "Frequency"
167
+ },
168
+ "keyPosition": 3,
169
+ "roles": [
170
+ "FREQUENCY"
171
+ ],
172
+ "values": [
173
+ {
174
+ "id": "A",
175
+ "order": 0,
176
+ "name": "Annual",
177
+ "names": {
178
+ "en": "Annual"
179
+ },
180
+ "annotations": [
181
+ 8
182
+ ],
183
+ "__indexPosition": 0,
184
+ "__index": 0
185
+ }
186
+ ],
187
+ "role": "FREQUENCY"
188
+ },
189
+ {
190
+ "id": "TIME_PERIOD",
191
+ "name": "Time",
192
+ "names": {
193
+ "en": "Time"
194
+ },
195
+ "keyPosition": 4,
196
+ "roles": [
197
+ "TIME"
198
+ ],
199
+ "values": [
200
+ {
201
+ "start": "2015-01-01T00:00:00Z",
202
+ "end": "2015-12-31T23:59:59Z",
203
+ "id": "2015",
204
+ "name": "2015",
205
+ "names": {
206
+ "en": "2015"
207
+ },
208
+ "__indexPosition": 0,
209
+ "__index": 0
210
+ }
211
+ ],
212
+ "role": "TIME"
213
+ }
214
+ ]
215
+ },
216
+ "attributes": {
217
+ "dataSet": [
218
+ {
219
+ "id": "OBS_STATUS",
220
+ "name": "Observation Status",
221
+ "names": {
222
+ "en": "Observation Status"
223
+ },
224
+ "roles": [
225
+ "OBS_STATUS"
226
+ ],
227
+ "relationship": {
228
+ "none": {}
229
+ },
230
+ "values": []
231
+ },
232
+ {
233
+ "id": "UNIT_MEASURE",
234
+ "name": "Unit of Measures",
235
+ "names": {
236
+ "en": "Unit of Measures"
237
+ },
238
+ "roles": [
239
+ "UNIT_MEASURE"
240
+ ],
241
+ "relationship": {
242
+ "none": {}
243
+ },
244
+ "values": []
245
+ },
246
+ {
247
+ "id": "UNIT_MULT",
248
+ "name": "Multiplier",
249
+ "names": {
250
+ "en": "Multiplier"
251
+ },
252
+ "roles": [
253
+ "UNIT_MULT"
254
+ ],
255
+ "relationship": {
256
+ "none": {}
257
+ },
258
+ "values": []
259
+ },
260
+ {
261
+ "id": "BASE_PER",
262
+ "name": "Base reference period",
263
+ "names": {
264
+ "en": "Base reference period"
265
+ },
266
+ "roles": [
267
+ "BASE_PER"
268
+ ],
269
+ "relationship": {
270
+ "none": {}
271
+ },
272
+ "values": []
273
+ }
274
+ ],
275
+ "series": [],
276
+ "observation": []
277
+ },
278
+ "annotations": [
279
+ {
280
+ "type": "NonProductionDataflow",
281
+ "text": "true",
282
+ "texts": {
283
+ "en": "true"
284
+ }
285
+ },
286
+ {
287
+ "title": "FREQUENCY=A,SUBJECT=LRHUTTTT,TIME_PERIOD_START=2015",
288
+ "type": "DEFAULT"
289
+ },
290
+ {
291
+ "title": "LOCATION",
292
+ "type": "LAYOUT_ROW"
293
+ },
294
+ {
295
+ "title": "TIME_PERIOD",
296
+ "type": "LAYOUT_COLUMN"
297
+ },
298
+ {
299
+ "title": "FREQ",
300
+ "type": "NOT_DISPLAYED"
301
+ },
302
+ {
303
+ "type": "ORDER",
304
+ "text": "1",
305
+ "texts": {
306
+ "en": "1"
307
+ }
308
+ },
309
+ {
310
+ "type": "ORDER",
311
+ "text": "2",
312
+ "texts": {
313
+ "en": "2"
314
+ }
315
+ },
316
+ {
317
+ "type": "ORDER",
318
+ "text": "3",
319
+ "texts": {
320
+ "en": "3"
321
+ }
322
+ },
323
+ {
324
+ "type": "ORDER",
325
+ "text": "0",
326
+ "texts": {
327
+ "en": "0"
328
+ }
329
+ }
330
+ ]
331
+ }
332
+ }
@@ -0,0 +1,309 @@
1
+ {
2
+ "header": {
3
+ "schema": "https://raw.githubusercontent.com/sdmx-twg/sdmx-json/master/data-message/tools/schemas/1.0/sdmx-json-data-schema.json",
4
+ "id": "IREF000457",
5
+ "prepared": "2021-09-07T22:43:19Z",
6
+ "test": true,
7
+ "contentLanguages": [
8
+ "en"
9
+ ],
10
+ "sender": {
11
+ "id": "SIS-CC-stable_-_DotStat_v8",
12
+ "name": "unknown",
13
+ "names": {
14
+ "en": "unknown"
15
+ }
16
+ }
17
+ },
18
+ "dataSets": [
19
+ {
20
+ "action": "Information",
21
+ "links": [
22
+ {
23
+ "urn": "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=OECD:DSD_KEI(1.0)",
24
+ "rel": "DataStructure"
25
+ }
26
+ ],
27
+ "annotations": [
28
+ 0,
29
+ 1,
30
+ 2,
31
+ 3,
32
+ 4
33
+ ],
34
+ "observations": {
35
+ "0:0:0:0:0": [
36
+ 8.5
37
+ ],
38
+ "0:1:0:0:0": [
39
+ 6.05642340833333
40
+ ]
41
+ }
42
+ }
43
+ ],
44
+ "structure": {
45
+ "name": "Harmonised Unemployment Rate",
46
+ "names": {
47
+ "en": "Harmonised Unemployment Rate"
48
+ },
49
+ "dimensions": {
50
+ "observation": [
51
+ {
52
+ "id": "SUBJECT",
53
+ "name": "Subject",
54
+ "names": {
55
+ "en": "Subject"
56
+ },
57
+ "keyPosition": 0,
58
+ "roles": [
59
+ "SUBJECT"
60
+ ],
61
+ "values": [
62
+ {
63
+ "id": "LRHUTTTT",
64
+ "order": 75,
65
+ "name": "Harmonised unemployment rate: all persons, s.a.",
66
+ "names": {
67
+ "en": "Harmonised unemployment rate: all persons, s.a."
68
+ },
69
+ "parent": "LR",
70
+ "annotations": [
71
+ 5
72
+ ],
73
+ "__indexPosition": 0,
74
+ "__index": 0
75
+ }
76
+ ],
77
+ "role": "SUBJECT"
78
+ },
79
+ {
80
+ "id": "LOCATION",
81
+ "name": "Country",
82
+ "names": {
83
+ "en": "Country"
84
+ },
85
+ "keyPosition": 1,
86
+ "roles": [
87
+ "LOCATION"
88
+ ],
89
+ "values": [
90
+ {
91
+ "id": "AUS",
92
+ "order": 0,
93
+ "name": "Australia",
94
+ "names": {
95
+ "en": "Australia"
96
+ },
97
+ "annotations": [
98
+ 5
99
+ ],
100
+ "__indexPosition": 0,
101
+ "__index": 1
102
+ },
103
+ {
104
+ "id": "BEL",
105
+ "order": 2,
106
+ "name": "Belgium",
107
+ "names": {
108
+ "en": "Belgium"
109
+ },
110
+ "annotations": [
111
+ 6
112
+ ],
113
+ "__indexPosition": 1,
114
+ "__index": 0
115
+ }
116
+ ],
117
+ "role": "LOCATION"
118
+ },
119
+ {
120
+ "id": "MEASURE",
121
+ "name": "Measure",
122
+ "names": {
123
+ "en": "Measure"
124
+ },
125
+ "keyPosition": 2,
126
+ "roles": [
127
+ "MEASURE"
128
+ ],
129
+ "values": [
130
+ {
131
+ "id": "ST",
132
+ "order": 5,
133
+ "name": "Level, ratio or index",
134
+ "names": {
135
+ "en": "Level, ratio or index"
136
+ },
137
+ "annotations": [
138
+ 6
139
+ ],
140
+ "__indexPosition": 0,
141
+ "__index": 0
142
+ }
143
+ ],
144
+ "role": "MEASURE"
145
+ },
146
+ {
147
+ "id": "FREQUENCY",
148
+ "name": "Frequency",
149
+ "names": {
150
+ "en": "Frequency"
151
+ },
152
+ "keyPosition": 3,
153
+ "roles": [
154
+ "FREQUENCY"
155
+ ],
156
+ "values": [
157
+ {
158
+ "id": "A",
159
+ "order": 0,
160
+ "name": "Annual",
161
+ "names": {
162
+ "en": "Annual"
163
+ },
164
+ "annotations": [
165
+ 7
166
+ ],
167
+ "__indexPosition": 0,
168
+ "__index": 0
169
+ }
170
+ ],
171
+ "role": "FREQUENCY"
172
+ },
173
+ {
174
+ "id": "TIME_PERIOD",
175
+ "name": "Time",
176
+ "names": {
177
+ "en": "Time"
178
+ },
179
+ "keyPosition": 4,
180
+ "roles": [
181
+ "TIME"
182
+ ],
183
+ "values": [
184
+ {
185
+ "start": "2015-01-01T00:00:00Z",
186
+ "end": "2015-12-31T23:59:59Z",
187
+ "id": "2015",
188
+ "name": "2015",
189
+ "names": {
190
+ "en": "2015"
191
+ },
192
+ "__indexPosition": 0,
193
+ "__index": 0
194
+ }
195
+ ],
196
+ "role": "TIME"
197
+ }
198
+ ]
199
+ },
200
+ "attributes": {
201
+ "dataSet": [
202
+ {
203
+ "id": "OBS_STATUS",
204
+ "name": "Observation Status",
205
+ "names": {
206
+ "en": "Observation Status"
207
+ },
208
+ "roles": [
209
+ "OBS_STATUS"
210
+ ],
211
+ "relationship": {
212
+ "none": {}
213
+ },
214
+ "values": []
215
+ },
216
+ {
217
+ "id": "UNIT_MEASURE",
218
+ "name": "Unit of Measures",
219
+ "names": {
220
+ "en": "Unit of Measures"
221
+ },
222
+ "roles": [
223
+ "UNIT_MEASURE"
224
+ ],
225
+ "relationship": {
226
+ "none": {}
227
+ },
228
+ "values": []
229
+ },
230
+ {
231
+ "id": "UNIT_MULT",
232
+ "name": "Multiplier",
233
+ "names": {
234
+ "en": "Multiplier"
235
+ },
236
+ "roles": [
237
+ "UNIT_MULT"
238
+ ],
239
+ "relationship": {
240
+ "none": {}
241
+ },
242
+ "values": []
243
+ },
244
+ {
245
+ "id": "BASE_PER",
246
+ "name": "Base reference period",
247
+ "names": {
248
+ "en": "Base reference period"
249
+ },
250
+ "roles": [
251
+ "BASE_PER"
252
+ ],
253
+ "relationship": {
254
+ "none": {}
255
+ },
256
+ "values": []
257
+ }
258
+ ],
259
+ "series": [],
260
+ "observation": []
261
+ },
262
+ "annotations": [
263
+ {
264
+ "type": "NonProductionDataflow",
265
+ "text": "true",
266
+ "texts": {
267
+ "en": "true"
268
+ }
269
+ },
270
+ {
271
+ "title": "FREQUENCY=A,SUBJECT=LRHUTTTT,TIME_PERIOD_START=2015",
272
+ "type": "DEFAULT"
273
+ },
274
+ {
275
+ "title": "LOCATION",
276
+ "type": "LAYOUT_ROW"
277
+ },
278
+ {
279
+ "title": "TIME_PERIOD",
280
+ "type": "LAYOUT_COLUMN"
281
+ },
282
+ {
283
+ "title": "FREQ",
284
+ "type": "NOT_DISPLAYED"
285
+ },
286
+ {
287
+ "type": "ORDER",
288
+ "text": "1",
289
+ "texts": {
290
+ "en": "1"
291
+ }
292
+ },
293
+ {
294
+ "type": "ORDER",
295
+ "text": "3",
296
+ "texts": {
297
+ "en": "3"
298
+ }
299
+ },
300
+ {
301
+ "type": "ORDER",
302
+ "text": "0",
303
+ "texts": {
304
+ "en": "0"
305
+ }
306
+ }
307
+ ]
308
+ }
309
+ }
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import * as R from 'ramda';
3
+ import Viewer from '../';
4
+ import rowData from '../../mocks/row';
5
+ import stackData from '../../mocks/stack';
6
+
7
+ export default ({ options }) => {
8
+ return (
9
+ <div style={{ display: 'flex' }}>
10
+ <div>
11
+ <Viewer {...rowData()} chartOptions={options} type="RowChart" />
12
+ </div>
13
+ <div>
14
+ <Viewer {...stackData()} chartOptions={options} type="StackedBarChart" />
15
+ </div>
16
+ </div>
17
+ );
18
+ };
@@ -8,6 +8,7 @@ import UseCase1 from './app/use-case-1';
8
8
  import TableCase from './app/table';
9
9
  import TableOneCell from './app/one-table-cell';
10
10
  import UseCase2 from './app/use-case-2';
11
+ import UseCase3 from './app/use-case-3';
11
12
  import ResNoDataCase from './app/nodata-res';
12
13
  import SizedNoDataCase from './app/nodata-sized';
13
14
  import Legacy from './app/leg';
@@ -60,6 +61,11 @@ export default () => {
60
61
  <Helmet htmlAttributes={{ dir: isRtl ? 'rtl' : 'ltr' }} />
61
62
  <button onClick={() => setRtl(!isRtl)}>{isRtl ? 'left to right' : 'right to left'}</button>
62
63
  <Tabs2 renderActiveTabPanelOnly={false}>
64
+ <Tab2
65
+ id="uc3"
66
+ title={<AppTab label="fluid width" iconName="fullscreen" />}
67
+ panel={<UseCase3 isRtl={isRtl} config={config} style={style} options={options} />}
68
+ />
63
69
  <Tab2
64
70
  id="uc1"
65
71
  title={<AppTab label="full screen resizable chart" iconName="fullscreen" />}
@@ -35,8 +35,8 @@ const Container = glamorous.div({
35
35
 
36
36
  const ViewContent = ({ loading, noData = 'No Data', type, width, errorMessage, ...rest }) => {
37
37
  if (loading) return <Loading message={loading} />;
38
-
39
- if(errorMessage) return <NoData message={errorMessage} />;
38
+ if (!width) return <Loading message={loading} />;
39
+ if (errorMessage) return <NoData message={errorMessage} />;
40
40
 
41
41
  if (type === 'table') {
42
42
  const tableProps = R.propOr({}, 'tableProps', rest);