sea-chart 1.1.3 → 1.1.4

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.
@@ -292,12 +292,8 @@ registerInteraction('element-selected', {
292
292
  registerInteraction('element-highlight', {
293
293
  start: [{
294
294
  trigger: 'element:mouseenter',
295
- action: 'element-highlight:highlight',
296
- throttle: {
297
- wait: 350,
298
- leading: true,
299
- trailing: false
300
- }
295
+ action: 'element-highlight:highlight'
296
+ // throttle: { wait: 50, leading: true, trailing: false }
301
297
  }],
302
298
  end: [{
303
299
  trigger: 'element:mouseleave',
@@ -112,19 +112,37 @@ class View extends React.PureComponent {
112
112
  }
113
113
  componentDidMount() {
114
114
  this.unsubscribeReFreshChart = eventBus.subscribe(CommonEventTypes.REFRESH_CHARTS, this.refreshChart);
115
- this.calculateStatistic();
115
+ const {
116
+ hasUnSaved
117
+ } = this.props;
118
+ if (!hasUnSaved) {
119
+ this.calculateStatistic();
120
+ }
116
121
  }
117
122
  componentWillUnmount() {
118
123
  this.unsubscribeReFreshChart();
119
124
  }
120
125
  UNSAFE_componentWillReceiveProps(nextProps) {
121
126
  const {
122
- chart: oldChart
127
+ chart: oldChart,
128
+ hasUnSaved
123
129
  } = this.props;
124
130
  const {
125
- chart
131
+ chart,
132
+ hasUnSaved: nextUnSaved
126
133
  } = nextProps;
134
+ const {
135
+ data
136
+ } = this.state;
127
137
  context.api = this.props.api;
138
+
139
+ // universal-apps will not trigger calculation of the chart before the chart config saved
140
+ // after saved, hasUnSaved was set to false, then trigger calculation
141
+ const needCalc = hasUnSaved === true && nextUnSaved === false;
142
+ if (needCalc && !data) {
143
+ this.calculateStatistic();
144
+ return;
145
+ }
128
146
  if (shallowEqual(chart, oldChart)) return;
129
147
  this.setState({
130
148
  isCalculated: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",