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.
package/dist/utils/custom-g2.js
CHANGED
|
@@ -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',
|
package/dist/view/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
227
|
-
lineWidth: 1
|
|
226
|
+
...this.labelStroke
|
|
228
227
|
}
|
|
229
228
|
};
|
|
230
229
|
}).color(increase_line_color || '#fbd44a').animate({
|
package/dist/view/wrapper/map.js
CHANGED