You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/10/20 11:51:15 UTC
[incubator-echarts] branch next updated: fix(line): fix symbol may
disappear if switched too frequently
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
The following commit(s) were added to refs/heads/next by this push:
new 3bd829d fix(line): fix symbol may disappear if switched too frequently
3bd829d is described below
commit 3bd829d65be6b6fcdc284cbec37fb622f4b7f9c7
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Oct 20 19:50:34 2020 +0800
fix(line): fix symbol may disappear if switched too frequently
---
src/chart/helper/Symbol.ts | 5 +++++
src/chart/line/LineView.ts | 7 ++++---
src/util/graphic.ts | 10 +++++-----
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/chart/helper/Symbol.ts b/src/chart/helper/Symbol.ts
index 7acb533..8703f68 100644
--- a/src/chart/helper/Symbol.ts
+++ b/src/chart/helper/Symbol.ts
@@ -192,6 +192,11 @@ class Symbol extends graphic.Group {
}
}
+ if (disableAnimation) {
+ // Must stop remove animation manually if don't call initProps or updateProps.
+ this.childAt(0).stopAnimation('remove');
+ }
+
this._seriesModel = seriesModel;
}
diff --git a/src/chart/line/LineView.ts b/src/chart/line/LineView.ts
index 654783e..ea3ef74 100644
--- a/src/chart/line/LineView.ts
+++ b/src/chart/line/LineView.ts
@@ -1011,9 +1011,10 @@ class LineView extends ChartView {
const symbolPath = el.getSymbolPath();
const text = symbolPath.getTextContent();
- symbolPath.animateFrom({
- scaleX: 0,
- scaleY: 0
+ el.attr({ scaleX: 0, scaleY: 0});
+ el.animateFrom({
+ scaleX: 1,
+ scaleY: 1
}, {
duration: 200,
delay: delay
diff --git a/src/util/graphic.ts b/src/util/graphic.ts
index dfeb952..b0c2b3d 100644
--- a/src/util/graphic.ts
+++ b/src/util/graphic.ts
@@ -331,6 +331,11 @@ function animateOrSetProps<Props>(
}
const animationEnabled = animatableModel && animatableModel.isAnimationEnabled();
+ if (!isRemove) {
+ // Must stop the remove animation.
+ el.stopAnimation('remove');
+ }
+
if (animationEnabled) {
let duration: number | Function;
let animationEasing: AnimationEasing;
@@ -368,11 +373,6 @@ function animateOrSetProps<Props>(
}
}
- if (!isRemove) {
- // Must stop the remove animation.
- el.stopAnimation('remove');
- }
-
duration > 0
? (
isFrom
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org