sea-chart 1.1.2 → 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
@@ -223,8 +223,7 @@ class Compare extends ChartComponent {
223
223
  style: {
224
224
  fontSize: BaseUtils.getLabelFontSize(label_font_size),
225
225
  fill: theme.labelColor,
226
- stroke: '#fff',
227
- lineWidth: 1
226
+ ...this.labelStroke
228
227
  }
229
228
  };
230
229
  }).color(increase_line_color || '#fbd44a').animate({
@@ -180,7 +180,7 @@ export default function Map(props) {
180
180
  // TODO
181
181
  // use data_color temporarily
182
182
  fill: data_color,
183
- ...this.labelStroke
183
+ stroke: '#fff'
184
184
  },
185
185
  align: legendDirection === 'vertical' ? 'right' : 'bottom',
186
186
  formatter: value => {
@@ -213,7 +213,7 @@ function WorldMap(props) {
213
213
  spacing: 2,
214
214
  style: {
215
215
  fill: themeColors.textColor,
216
- ...this.labelStroke
216
+ stroke: '#fff'
217
217
  },
218
218
  align: legendDirection === 'vertical' ? 'right' : 'bottom',
219
219
  formatter: value => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",