@sis-cc/dotstatsuite-components 16.8.0 → 16.8.2

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.
@@ -78,6 +78,7 @@ var ChartWrapper = function ChartWrapper() {
78
78
  }
79
79
 
80
80
  return _react2.default.createElement(Chart, (0, _extends3.default)({}, props, {
81
+ options: options,
81
82
  series: (0, _series2.default)(props.data.series, props.type, options) // responsive rule only display highlighted data
82
83
  }));
83
84
  };
@@ -179,25 +179,26 @@ var ViewerWrapper = function ViewerWrapper(_ref5) {
179
179
  heightOffsets = _useState2[0],
180
180
  setHeightOffsets = _useState2[1];
181
181
 
182
- if (type === 'table') return _react2.default.createElement(Viewer, (0, _extends3.default)({}, props, { chartOptions: chartOptions, type: type }));
183
-
184
- var preparedChartOptions = R.pipe(R.over(R.lensPath(['base', 'width']), R.when(R.anyPass([R.isNil, isNaN]), R.always(props.size.width || 0))), R.over(R.lensPath(['base', 'height']), R.when(R.anyPass([R.isNil, isNaN]), R.always(0))), function (chartOptions) {
185
- return (0, _options2.default)(chartOptions, props.chartData, type, theme, props.timeFormats, props.locale);
186
- })(chartOptions);
187
-
188
- return _react2.default.createElement(Viewer, (0, _extends3.default)({}, props, {
189
- chartOptions: preparedChartOptions,
190
- fixedWidth: R.path(['base', 'width'], chartOptions),
191
- fixedHeight: R.path(['base', 'height'], chartOptions),
192
- heightOffsets: heightOffsets,
182
+ var extendedProps = (0, _extends3.default)({}, props, {
183
+ type: type,
193
184
  setFooterOffset: function setFooterOffset(offset) {
194
185
  return setHeightOffsets(R.assoc('footer', offset));
195
186
  },
196
187
  setHeaderOffset: function setHeaderOffset(offset) {
197
188
  return setHeightOffsets(R.assoc('header', offset));
198
189
  },
199
- type: type
200
- }));
190
+ heightOffsets: heightOffsets,
191
+ fixedWidth: R.path(['base', 'width'], chartOptions),
192
+ fixedHeight: R.path(['base', 'height'], chartOptions)
193
+ });
194
+
195
+ if (type === 'table') return _react2.default.createElement(Viewer, (0, _extends3.default)({}, extendedProps, { chartOptions: chartOptions }));
196
+
197
+ var preparedChartOptions = R.pipe(R.over(R.lensPath(['base', 'width']), R.when(R.anyPass([R.isNil, isNaN]), R.always(props.size.width || 0))), R.over(R.lensPath(['base', 'height']), R.when(R.anyPass([R.isNil, isNaN]), R.always(0))), function (chartOptions) {
198
+ return (0, _options2.default)(chartOptions, props.chartData, type, theme, props.timeFormats, props.locale);
199
+ })(chartOptions);
200
+
201
+ return _react2.default.createElement(Viewer, (0, _extends3.default)({}, extendedProps, { chartOptions: preparedChartOptions }));
201
202
  };
202
203
 
203
204
  exports.default = (0, _reactSizeme2.default)({ noPlaceholder: true, monitorWidth: true, monitorHeight: true })(ViewerWrapper);
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": "16.8.0",
4
+ "version": "16.8.2",
5
5
  "main": "lib/index.js",
6
6
  "author": "OECD",
7
7
  "license": "MIT",
@@ -46,6 +46,7 @@ const ChartWrapper = (props = {}) => {
46
46
  return (
47
47
  <Chart
48
48
  {...props}
49
+ options={options}
49
50
  series={filterSeriesRegardingDimensions(props.data.series, props.type, options)} // responsive rule only display highlighted data
50
51
  />
51
52
  );
@@ -98,7 +98,17 @@ const ViewerWrapper = ({ chartOptions, type, ...props }) => {
98
98
  const theme = useTheme();
99
99
  const [heightOffsets, setHeightOffsets] = useState({ footer: 0, header: 0 });
100
100
 
101
- if (type === 'table') return <Viewer {...props} chartOptions={chartOptions} type={type} />;
101
+ const extendedProps = {
102
+ ...props,
103
+ type,
104
+ setFooterOffset: offset => setHeightOffsets(R.assoc('footer', offset)),
105
+ setHeaderOffset: offset => setHeightOffsets(R.assoc('header', offset)),
106
+ heightOffsets,
107
+ fixedWidth: R.path(['base', 'width'], chartOptions),
108
+ fixedHeight: R.path(['base', 'height'], chartOptions),
109
+ };
110
+
111
+ if (type === 'table') return <Viewer {...extendedProps} chartOptions={chartOptions} />;
102
112
 
103
113
  const preparedChartOptions = R.pipe(
104
114
  R.over(R.lensPath(['base', 'width']), R.when(R.anyPass([R.isNil, isNaN]), R.always(props.size.width || 0))),
@@ -106,18 +116,7 @@ const ViewerWrapper = ({ chartOptions, type, ...props }) => {
106
116
  chartOptions => getChartOptions(chartOptions, props.chartData, type, theme, props.timeFormats, props.locale),
107
117
  )(chartOptions);
108
118
 
109
- return (
110
- <Viewer
111
- {...props}
112
- chartOptions={preparedChartOptions}
113
- fixedWidth={R.path(['base', 'width'], chartOptions)}
114
- fixedHeight={R.path(['base', 'height'], chartOptions)}
115
- heightOffsets={heightOffsets}
116
- setFooterOffset={offset => setHeightOffsets(R.assoc('footer', offset))}
117
- setHeaderOffset={offset => setHeightOffsets(R.assoc('header', offset))}
118
- type={type}
119
- />
120
- );
119
+ return <Viewer {...extendedProps} chartOptions={preparedChartOptions} />;
121
120
  };
122
121
 
123
122
  export default sizeMe({ noPlaceholder: true, monitorWidth: true, monitorHeight: true })(ViewerWrapper);