sea-chart 0.0.19 → 0.0.20

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.
@@ -1,14 +1,15 @@
1
1
  .sea-chart-formatter {
2
2
  height: 100%;
3
3
  width: 100%;
4
- display: flex;
5
- align-items: center;
6
- justify-content: center;
4
+ position: relative;
7
5
  }
8
6
 
9
7
  .sea-chart-formatter-tip {
10
8
  background-color: #F5F5F5;
11
9
  border-radius: 4px;
10
+ display: flex;
11
+ justify-content: center;
12
+ align-items: center;
12
13
  }
13
14
 
14
15
  .sea-chart-formatter.error {
@@ -23,14 +24,23 @@
23
24
  overflow: hidden;
24
25
  }
25
26
 
27
+ .sea-chart-formatter .sea-chart-cavans-container {
28
+ position: relative;
29
+ width: 100%;
30
+ height: 100%;
31
+ }
32
+
26
33
  .sea-chart-formatter .sea-chart-table-formatter-container {
27
34
  overflow: scroll;
28
35
  }
29
36
 
30
37
  .sea-chart-formatter .sea-chart-container {
31
- flex: 1;
32
38
  font-size: 12px;
33
- padding: 20px 40px 50px 50px;
39
+ position: absolute;
40
+ left: 2%;
41
+ right: 2%;
42
+ top: 2%;
43
+ bottom: 8%;
34
44
  }
35
45
 
36
46
  .sea-chart-formatter .sea-chart-container.show-x-axis-label,
@@ -64,5 +74,5 @@
64
74
  }
65
75
 
66
76
  .sea-chart-formatter .sea-chart-completeness-chart {
67
- padding-right: 20px;
77
+ padding-right: 0.5%;
68
78
  }
@@ -138,17 +138,17 @@ class View extends React.PureComponent {
138
138
  if (errorMessage) {
139
139
  return /*#__PURE__*/React.createElement("div", {
140
140
  className: classnames('error', validClassName, tipBackgroundColorClassName)
141
- }, intl.get(errorMessage));
141
+ }, /*#__PURE__*/React.createElement("span", null, intl.get(errorMessage)));
142
142
  }
143
143
  if (tipMessage) {
144
144
  return /*#__PURE__*/React.createElement("div", {
145
145
  className: classnames('error', validClassName, tipBackgroundColorClassName)
146
- }, intl.get(tipMessage));
146
+ }, /*#__PURE__*/React.createElement("span", null, intl.get(tipMessage)));
147
147
  }
148
148
  if (BaseUtils.imEmptyChartResult(data) && !chartType.includes('map')) {
149
149
  return /*#__PURE__*/React.createElement("div", {
150
150
  className: classnames('error', validClassName, tipBackgroundColorClassName)
151
- }, intl.get('There_are_no_statistic_results_yet'));
151
+ }, /*#__PURE__*/React.createElement("span", null, intl.get('There_are_no_statistic_results_yet')));
152
152
  }
153
153
  return /*#__PURE__*/React.createElement("div", {
154
154
  className: validClassName
@@ -156,13 +156,15 @@ class View extends React.PureComponent {
156
156
  className: classnames('sea-chart-formatter-container', "sea-chart-".concat(chart === null || chart === void 0 ? void 0 : (_chart$config2 = chart.config) === null || _chart$config2 === void 0 ? void 0 : _chart$config2.type, "-formatter-container"))
157
157
  }, /*#__PURE__*/React.createElement(Title, {
158
158
  chart: chart
159
- }), /*#__PURE__*/React.createElement(Wrapper, {
159
+ }), /*#__PURE__*/React.createElement("div", {
160
+ className: "sea-chart-cavans-container"
161
+ }, /*#__PURE__*/React.createElement(Wrapper, {
160
162
  chart: chart,
161
163
  data: data,
162
164
  tables: tables,
163
165
  canvasStyle: canvasStyle,
164
166
  customRender: render
165
- })));
167
+ }))));
166
168
  }
167
169
  }
168
170
  const propTypes = {
@@ -1,4 +1,3 @@
1
- import classnames from 'classnames';
2
1
  import PropTypes from 'prop-types';
3
2
  import React from 'react';
4
3
  import { CHART_SUMMARY_SHOW, CHART_SUMMARY_TYPE } from '../../constants';
@@ -24,7 +23,7 @@ class Area extends ChartComponent {
24
23
  const {
25
24
  y_axis_show_value
26
25
  } = chart.config;
27
- const appendPadding = [y_axis_show_value ? 47 : 30, 0, 0, 0];
26
+ const appendPadding = [y_axis_show_value ? 17 : 0, 0, 0, 0];
28
27
  this.initChart(this.container, {
29
28
  appendPadding
30
29
  });
@@ -164,14 +163,8 @@ class Area extends ChartComponent {
164
163
  this.chart && this.chart.destroy();
165
164
  }
166
165
  render() {
167
- const {
168
- chart
169
- } = this.props;
170
166
  return /*#__PURE__*/React.createElement("div", {
171
- className: classnames('sea-chart-container w-100', {
172
- 'show-x-axis-label': this.isShowXAxisLabel(chart),
173
- 'show-y-axis-label': this.isShowYAxisLabel(chart)
174
- }),
167
+ className: 'sea-chart-container',
175
168
  ref: ref => this.container = ref
176
169
  });
177
170
  }
@@ -21,7 +21,7 @@ class BarCustom extends ChartComponent {
21
21
  const {
22
22
  y_axis_show_value
23
23
  } = chart.config;
24
- const appendPadding = [y_axis_show_value ? 47 : 30, 0, 0, 0]; // used to display value on the top
24
+ const appendPadding = [y_axis_show_value ? 17 : 0, 0, 0, 0]; // used to display value on the top
25
25
  this.initChart(this.container, {
26
26
  appendPadding
27
27
  });
@@ -192,7 +192,7 @@ class BarCustom extends ChartComponent {
192
192
  }
193
193
  render() {
194
194
  return /*#__PURE__*/React.createElement("div", {
195
- className: 'sea-chart-container w-100',
195
+ className: 'sea-chart-container ',
196
196
  ref: ref => this.container = ref
197
197
  });
198
198
  }
@@ -24,7 +24,7 @@ class BarGroup extends ChartComponent {
24
24
  const {
25
25
  y_axis_show_value
26
26
  } = chart.config;
27
- const appendPadding = [y_axis_show_value ? 47 : 30, 0, 0, 0];
27
+ const appendPadding = [y_axis_show_value ? 17 : 0, 0, 0, 0];
28
28
  this.initChart(this.container, {
29
29
  appendPadding
30
30
  });
@@ -209,7 +209,7 @@ class BarGroup extends ChartComponent {
209
209
  }
210
210
  render() {
211
211
  return /*#__PURE__*/React.createElement("div", {
212
- className: 'sea-chart-container w-100',
212
+ className: 'sea-chart-container',
213
213
  ref: ref => this.container = ref
214
214
  });
215
215
  }
@@ -21,7 +21,7 @@ class Bar extends ChartComponent {
21
21
  const {
22
22
  y_axis_show_value
23
23
  } = chart.config;
24
- const appendPadding = [y_axis_show_value ? 47 : 30, 0, 0, 0]; // used to display value on the top
24
+ const appendPadding = [y_axis_show_value ? 17 : 0, 0, 0, 0]; // used to display value on the top
25
25
  this.initChart(this.container, {
26
26
  appendPadding
27
27
  });
@@ -132,7 +132,7 @@ class Bar extends ChartComponent {
132
132
  }
133
133
  render() {
134
134
  return /*#__PURE__*/React.createElement("div", {
135
- className: 'sea-chart-container w-100',
135
+ className: 'sea-chart-container ',
136
136
  ref: ref => this.container = ref
137
137
  });
138
138
  }
@@ -389,7 +389,7 @@ class Combination extends React.Component {
389
389
  chart
390
390
  } = this.props;
391
391
  return /*#__PURE__*/React.createElement("div", {
392
- className: classnames('sea-chart-container w-100', {
392
+ className: classnames('sea-chart-container ', {
393
393
  'show-x-axis-label': this.isShowXAxisLabel(chart),
394
394
  'show-y-axis-left-label': this.isShowYAxisLeftLabel(chart),
395
395
  'show-y-axis-right-label': this.isShowYAxisRightLabel(chart)
@@ -250,7 +250,7 @@ class Compare extends ChartComponent {
250
250
  chart
251
251
  } = this.props;
252
252
  return /*#__PURE__*/React.createElement("div", {
253
- className: classnames('sea-chart-container w-100', {
253
+ className: classnames('sea-chart-container ', {
254
254
  'show-x-axis-label': this.isShowXAxisLabel(chart),
255
255
  'show-y-axis-label': this.isShowYAxisLabel(chart)
256
256
  }),
@@ -29,7 +29,7 @@ export default function Completeness(props) {
29
29
  style_config
30
30
  }
31
31
  } = props;
32
- chartPaddingTop = ((_style_config$title = style_config.title) === null || _style_config$title === void 0 ? void 0 : _style_config$title.text) ? 47 : 30;
32
+ chartPaddingTop = ((_style_config$title = style_config.title) === null || _style_config$title === void 0 ? void 0 : _style_config$title.text) ? 17 : 0;
33
33
  const appendPadding = [chartPaddingTop, 30, 0, 0];
34
34
  currentChart.initChart(chartContainerRef.current, {
35
35
  appendPadding
@@ -157,7 +157,7 @@ export default function Completeness(props) {
157
157
  };
158
158
  }, [props]);
159
159
  return /*#__PURE__*/React.createElement("div", {
160
- className: classnames('sea-chart-completeness-chart sea-chart-container w-100'),
160
+ className: classnames('sea-chart-completeness-chart sea-chart-container '),
161
161
  ref: chartContainerRef
162
162
  });
163
163
  }
@@ -159,7 +159,7 @@ class Dashboard extends Component {
159
159
  render() {
160
160
  return /*#__PURE__*/React.createElement("div", {
161
161
  ref: ref => this.container = ref,
162
- className: "sea-chart-container w-100"
162
+ className: "sea-chart-container "
163
163
  });
164
164
  }
165
165
  }
@@ -21,7 +21,7 @@ class HorizontalBarGroup extends HorizontalComponent {
21
21
  const {
22
22
  display_data
23
23
  } = chart.config;
24
- this.chartTopPadding = display_data ? 47 : 30;
24
+ this.chartTopPadding = display_data ? 17 : 0;
25
25
  const appendPadding = [this.chartTopPadding, 0, 0, 0];
26
26
  this.initChart(this.container, {
27
27
  appendPadding
@@ -154,7 +154,7 @@ class HorizontalBarGroup extends HorizontalComponent {
154
154
  }
155
155
  render() {
156
156
  return /*#__PURE__*/React.createElement("div", {
157
- className: 'sea-chart-container w-100',
157
+ className: 'sea-chart-container ',
158
158
  ref: ref => this.container = ref
159
159
  });
160
160
  }
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import classnames from 'classnames';
4
3
  import { debounce } from 'lodash-es';
5
4
  import { CHART_SUMMARY_TYPE, CHART_SUMMARY_SHOW } from '../../constants';
6
5
  import { BaseUtils, isFunction } from '../../utils';
@@ -21,7 +20,7 @@ class HorizontalBar extends HorizontalComponent {
21
20
  const {
22
21
  display_data
23
22
  } = chart.config;
24
- const appendPadding = [0, display_data ? 47 : 30, 0, 0]; // used to display value on the right
23
+ const appendPadding = [0, display_data ? 17 : 0, 0, 0]; // used to display value on the right
25
24
  this.initChart(this.container, {
26
25
  appendPadding
27
26
  });
@@ -132,7 +131,7 @@ class HorizontalBar extends HorizontalComponent {
132
131
  }
133
132
  render() {
134
133
  return /*#__PURE__*/React.createElement("div", {
135
- className: classnames('sea-chart-container w-100'),
134
+ className: 'sea-chart-container',
136
135
  ref: ref => this.container = ref
137
136
  });
138
137
  }
@@ -14,7 +14,7 @@ class LineGroup extends ChartComponent {
14
14
  const {
15
15
  y_axis_show_value
16
16
  } = chart.config;
17
- const appendPadding = [y_axis_show_value ? 47 : 30, 0, 0, 0];
17
+ const appendPadding = [y_axis_show_value ? 17 : 0, 0, 0, 0];
18
18
  this.initChart(this.container, {
19
19
  appendPadding
20
20
  });
@@ -142,7 +142,7 @@ class LineGroup extends ChartComponent {
142
142
  chart
143
143
  } = this.props;
144
144
  return /*#__PURE__*/React.createElement("div", {
145
- className: classnames('sea-chart-container w-100', {
145
+ className: classnames('sea-chart-container ', {
146
146
  'show-x-axis-label': this.isShowXAxisLabel(chart),
147
147
  'show-y-axis-label': this.isShowYAxisLabel(chart)
148
148
  }),
@@ -14,7 +14,7 @@ class Line extends ChartComponent {
14
14
  const {
15
15
  y_axis_show_value
16
16
  } = chart.config;
17
- const appendPadding = [y_axis_show_value ? 47 : 30, 0, 0, 0];
17
+ const appendPadding = [y_axis_show_value ? 17 : 0, 0, 0, 0];
18
18
  this.initChart(this.container, {
19
19
  appendPadding
20
20
  });
@@ -151,7 +151,7 @@ class Line extends ChartComponent {
151
151
  chart
152
152
  } = this.props;
153
153
  return /*#__PURE__*/React.createElement("div", {
154
- className: classnames('sea-chart-container w-100', {
154
+ className: classnames('sea-chart-container ', {
155
155
  'show-x-axis-label': this.isShowXAxisLabel(chart),
156
156
  'show-y-axis-label': this.isShowYAxisLabel(chart)
157
157
  }),
@@ -316,7 +316,7 @@ export default function Map(props) {
316
316
  return /*#__PURE__*/React.createElement(React.Fragment, null, isLoading && /*#__PURE__*/React.createElement("div", {
317
317
  className: 'statistic-chart-loading-container'
318
318
  }, /*#__PURE__*/React.createElement(Loading, null)), /*#__PURE__*/React.createElement("div", {
319
- className: classnames('sea-chart-container w-100'),
319
+ className: classnames('sea-chart-container '),
320
320
  ref: chartContainerRef
321
321
  }));
322
322
  }
@@ -169,7 +169,7 @@ class Pie extends ChartComponent {
169
169
  }
170
170
  render() {
171
171
  return /*#__PURE__*/React.createElement("div", {
172
- className: "sea-chart-container w-100",
172
+ className: "sea-chart-container ",
173
173
  ref: ref => this.container = ref
174
174
  });
175
175
  }
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { CHART_LABEL_POSITIONS, CHART_LABEL_FORMATS } from '../../constants';
4
4
  import { BaseUtils, isFunction } from '../../utils';
5
- import ChartComponent from './chart-component';
6
5
  import intl from '../../intl';
6
+ import ChartComponent from './chart-component';
7
7
  class Ring extends ChartComponent {
8
8
  constructor(props) {
9
9
  var _this;
@@ -248,7 +248,7 @@ class Ring extends ChartComponent {
248
248
  }
249
249
  render() {
250
250
  return /*#__PURE__*/React.createElement("div", {
251
- className: "sea-chart-container w-100",
251
+ className: "sea-chart-container ",
252
252
  ref: ref => this.container = ref
253
253
  });
254
254
  }
@@ -121,7 +121,7 @@ export function Scatter(props) {
121
121
  const showXLabel = chartRef.current.isShowXAxisLabel(chart);
122
122
  const showYLabel = chartRef.current.isShowYAxisLabel(chart);
123
123
  return /*#__PURE__*/React.createElement("div", {
124
- className: classnames('sea-chart-container w-100', {
124
+ className: classnames('sea-chart-container ', {
125
125
  'show-x-axis-label': showXLabel,
126
126
  'show-y-axis-label': showYLabel
127
127
  }),
@@ -171,7 +171,7 @@ class Treemap extends ChartComponent {
171
171
  }
172
172
  render() {
173
173
  return /*#__PURE__*/React.createElement("div", {
174
- className: "sea-chart-container w-100",
174
+ className: "sea-chart-container ",
175
175
  ref: ref => this.container = ref
176
176
  });
177
177
  }
@@ -334,7 +334,7 @@ class WorldMap extends ChartComponent {
334
334
  }
335
335
  render() {
336
336
  return /*#__PURE__*/React.createElement("div", {
337
- className: "sea-chart-container w-100",
337
+ className: "sea-chart-container ",
338
338
  ref: ref => this.container = ref
339
339
  });
340
340
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",