@sis-cc/dotstatsuite-components 8.10.0 → 8.12.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 (44) hide show
  1. package/lib/app.js +13 -5
  2. package/lib/rules/src/chart/getChartOptions.js +1 -1
  3. package/lib/rules/src/properties/index.js +1 -0
  4. package/lib/rules-driver/src/app.js +116 -167
  5. package/lib/viewer/src/app/use-case-3.js +52 -0
  6. package/lib/viewer/src/app.js +9 -0
  7. package/lib/viewer/src/chartUtils/series.js +3 -5
  8. package/lib/viewer/src/index.js +1 -1
  9. package/package.json +2 -2
  10. package/src/app.js +10 -5
  11. package/src/rules/src/chart/getChartOptions.js +2 -2
  12. package/src/rules/src/properties/index.js +1 -0
  13. package/src/rules-driver/src/app.js +116 -132
  14. package/src/rules-driver/src/mocks/data1.json +332 -0
  15. package/src/rules-driver/src/mocks/data2.json +309 -0
  16. package/src/viewer/src/app/use-case-3.js +18 -0
  17. package/src/viewer/src/app.js +6 -0
  18. package/src/viewer/src/chartUtils/series.js +4 -4
  19. package/src/viewer/src/index.js +2 -2
  20. package/lib/rules-driver/src/app/chart.js +0 -52
  21. package/lib/rules-driver/src/app/config-axis.js +0 -95
  22. package/lib/rules-driver/src/app/config-buttons.js +0 -47
  23. package/lib/rules-driver/src/app/config-input.js +0 -51
  24. package/lib/rules-driver/src/app/config-select.js +0 -57
  25. package/lib/rules-driver/src/app/config-t4size.js +0 -61
  26. package/lib/rules-driver/src/app/config1.js +0 -148
  27. package/lib/rules-driver/src/app/menu.js +0 -44
  28. package/lib/rules-driver/src/app/viewer1.js +0 -39
  29. package/lib/rules-driver/src/app/viewer2.js +0 -115
  30. package/src/rules-driver/src/app/chart.js +0 -18
  31. package/src/rules-driver/src/app/config-axis.js +0 -54
  32. package/src/rules-driver/src/app/config-buttons.js +0 -27
  33. package/src/rules-driver/src/app/config-input.js +0 -35
  34. package/src/rules-driver/src/app/config-select.js +0 -25
  35. package/src/rules-driver/src/app/config-t4size.js +0 -50
  36. package/src/rules-driver/src/app/config1.js +0 -120
  37. package/src/rules-driver/src/app/menu.js +0 -27
  38. package/src/rules-driver/src/app/viewer1.js +0 -18
  39. package/src/rules-driver/src/app/viewer2.js +0 -77
  40. package/src/rules-driver/src/mocks/ecb.json +0 -2069
  41. package/src/rules-driver/src/mocks/ins.json +0 -264
  42. package/src/rules-driver/src/mocks/oecd-time.json +0 -864
  43. package/src/rules-driver/src/mocks/oecd.json +0 -372
  44. package/src/rules-driver/src/mocks/tunisia.json +0 -333
@@ -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" />}
@@ -1,5 +1,5 @@
1
1
  import * as R from 'ramda';
2
- import { HSYMBOL, TIMELINE, VSYMBOL } from '../../../rules/src/constants';
2
+ import { H_SYMBOL, TIMELINE, V_SYMBOL } from '../../../rules/src/constants';
3
3
 
4
4
  const isFocused = (obj) => {
5
5
  const highlightIndex = R.propOr(-1, 'highlightIndex', obj);
@@ -10,7 +10,7 @@ const isFocused = (obj) => {
10
10
  const sampleFilterSeries = (series) => (
11
11
  R.map(
12
12
  serie => {
13
- const _datapoints = filter(serie.datapoints, dp => isFocused(dp));
13
+ const _datapoints = R.filter(isFocused, serie.datapoints);
14
14
  return { ...serie, datapoints: _datapoints };
15
15
  },
16
16
  series
@@ -25,7 +25,7 @@ export default (series, type, options) => {
25
25
  const minWidth = R.path(['base', 'minDisplayWidth'], options);
26
26
  const minHeight = R.path(['base', 'minDisplayHeight'], options);
27
27
  let filtered;
28
- if (type === HSYMBOL) {
28
+ if (type === H_SYMBOL) {
29
29
  if (height < minHeight) {
30
30
  filtered = sampleFilterSeries(series);
31
31
  return R.isEmpty(filtered[0].datapoints) ? series : filtered;
@@ -37,7 +37,7 @@ export default (series, type, options) => {
37
37
  return R.isEmpty(filtered) ? series : filtered;
38
38
  }
39
39
  }
40
- else if ( type === VSYMBOL) {
40
+ else if ( type === V_SYMBOL) {
41
41
  if (width < minWidth) {
42
42
  filtered = sampleFilterSeries(series);
43
43
  return R.isEmpty(filtered[0].datapoints) ? series : filtered;
@@ -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);
@@ -1,52 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _extends2 = require('babel-runtime/helpers/extends');
8
-
9
- var _extends3 = _interopRequireDefault(_extends2);
10
-
11
- var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
12
-
13
- var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
14
-
15
- var _react = require('react');
16
-
17
- var _react2 = _interopRequireDefault(_react);
18
-
19
- var _src = require('../../../chart/src');
20
-
21
- var _src2 = _interopRequireDefault(_src);
22
-
23
- var _src3 = require('../../../rules/src');
24
-
25
- var _ramda = require('ramda');
26
-
27
- var _glamorous = require('glamorous');
28
-
29
- var _glamorous2 = _interopRequireDefault(_glamorous);
30
-
31
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
-
33
- var Container = _glamorous2.default.div({
34
- marginBottom: 15,
35
- marginTop: 15
36
- });
37
-
38
- var Chart = function Chart(_ref) {
39
- var type = _ref.type,
40
- rest = (0, _objectWithoutProperties3.default)(_ref, ['type']);
41
- return (0, _ramda.has)(type, _src3.chartTypes) ? _react2.default.createElement(
42
- Container,
43
- null,
44
- _react2.default.createElement(_src2.default, (0, _extends3.default)({}, rest, { type: type }))
45
- ) : _react2.default.createElement(
46
- Container,
47
- null,
48
- 'Not a Chart Type'
49
- );
50
- };
51
-
52
- exports.default = Chart;
@@ -1,95 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _extends2 = require('babel-runtime/helpers/extends');
8
-
9
- var _extends3 = _interopRequireDefault(_extends2);
10
-
11
- var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
12
-
13
- var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
14
-
15
- var _react = require('react');
16
-
17
- var _react2 = _interopRequireDefault(_react);
18
-
19
- var _configInput = require('./config-input');
20
-
21
- var _configInput2 = _interopRequireDefault(_configInput);
22
-
23
- var _glamorous = require('glamorous');
24
-
25
- var _glamorous2 = _interopRequireDefault(_glamorous);
26
-
27
- var _core = require('@blueprintjs/core');
28
-
29
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
-
31
- var Content = _glamorous2.default.div({
32
- display: 'flex',
33
- flexDirection: 'row',
34
- flexWrap: 'wrap',
35
- justifyContent: 'space-between'
36
- });
37
-
38
- var Callout = _glamorous2.default.div({ marginBottom: 10 });
39
-
40
- var activeComponent = function activeComponent(Component) {
41
- return function (_ref) {
42
- var isActive = _ref.isActive,
43
- rest = (0, _objectWithoutProperties3.default)(_ref, ['isActive']);
44
- return isActive ? _react2.default.createElement(Component, rest) : null;
45
- };
46
- };
47
-
48
- var ConfigInput = activeComponent(_configInput2.default);
49
-
50
- var ConfigAxis = function ConfigAxis(_ref2) {
51
- var label = _ref2.label,
52
- max = _ref2.max,
53
- min = _ref2.min,
54
- pivot = _ref2.pivot,
55
- step = _ref2.step;
56
-
57
- if (!max.isActive && !min.isActive && !pivot.isActive && !step.isActive) {
58
- return null;
59
- }
60
- return _react2.default.createElement(
61
- Callout,
62
- null,
63
- _react2.default.createElement(
64
- 'div',
65
- { className: _core.Classes.CALLOUT },
66
- _react2.default.createElement(
67
- 'h5',
68
- null,
69
- label
70
- ),
71
- _react2.default.createElement(
72
- Content,
73
- null,
74
- _react2.default.createElement(ConfigInput, (0, _extends3.default)({}, min, {
75
- label: 'Min Value',
76
- isControlled: false
77
- })),
78
- _react2.default.createElement(ConfigInput, (0, _extends3.default)({}, max, {
79
- label: 'Max Value',
80
- isControlled: false
81
- })),
82
- _react2.default.createElement(ConfigInput, (0, _extends3.default)({}, pivot, {
83
- label: 'Pivot Value',
84
- isControlled: false
85
- })),
86
- _react2.default.createElement(ConfigInput, (0, _extends3.default)({}, step, {
87
- label: 'Step Value',
88
- isControlled: false
89
- }))
90
- )
91
- )
92
- );
93
- };
94
-
95
- exports.default = ConfigAxis;
@@ -1,47 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ConfigButtons = undefined;
7
-
8
- var _react = require('react');
9
-
10
- var _react2 = _interopRequireDefault(_react);
11
-
12
- var _ramda = require('ramda');
13
-
14
- var _core = require('@blueprintjs/core');
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- var ConfigButtons = exports.ConfigButtons = function ConfigButtons(_ref) {
19
- var label = _ref.label,
20
- onChange = _ref.onChange,
21
- options = _ref.options,
22
- value = _ref.value;
23
- return _react2.default.createElement(
24
- 'label',
25
- { className: 'pt-label pt-inline' },
26
- label,
27
- _react2.default.createElement(
28
- _core.ButtonGroup,
29
- null,
30
- (0, _ramda.map)(function (option) {
31
- return _react2.default.createElement(
32
- _core.Button,
33
- {
34
- active: option.value === value,
35
- key: option.value,
36
- onClick: function onClick() {
37
- return onChange(option.value);
38
- }
39
- },
40
- option.label
41
- );
42
- }, options)
43
- )
44
- );
45
- };
46
-
47
- exports.default = ConfigButtons;
@@ -1,51 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _react = require('react');
8
-
9
- var _react2 = _interopRequireDefault(_react);
10
-
11
- var _core = require('@blueprintjs/core');
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
- var ConfigInput = function ConfigInput(_ref) {
16
- var isControlled = _ref.isControlled,
17
- label = _ref.label,
18
- leftIcon = _ref.leftIcon,
19
- onChange = _ref.onChange,
20
- placeholder = _ref.placeholder,
21
- value = _ref.value;
22
-
23
- var submit = function submit(e) {
24
- return onChange(e.target.value);
25
- };
26
-
27
- var commit = function commit(e) {
28
- if (e.key === 'Enter') {
29
- e.preventDefault();
30
- submit(e);
31
- }
32
- };
33
- return _react2.default.createElement(
34
- 'label',
35
- { className: 'pt-label' },
36
- label,
37
- isControlled ? _react2.default.createElement(_core.InputGroup, {
38
- value: value,
39
- leftIconName: leftIcon,
40
- onChange: submit,
41
- placeholder: placeholder
42
- }) : _react2.default.createElement(_core.InputGroup, {
43
- defaultValue: value,
44
- leftIconName: leftIcon,
45
- onKeyPress: commit,
46
- placeholder: placeholder
47
- })
48
- );
49
- };
50
-
51
- exports.default = ConfigInput;