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/06/09 08:42:01 UTC
[incubator-echarts] branch label-enhancement updated: fix(state):
use flag to determine which states to restore instead of simply save and
restore
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch label-enhancement
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
The following commit(s) were added to refs/heads/label-enhancement by this push:
new 9919c52 fix(state): use flag to determine which states to restore instead of simply save and restore
9919c52 is described below
commit 9919c522d856b280e9bf266ecb3d446bba21af4c
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Jun 9 16:41:43 2020 +0800
fix(state): use flag to determine which states to restore instead of simply save and restore
---
src/echarts.ts | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/src/echarts.ts b/src/echarts.ts
index 3efed0c..0d16014 100644
--- a/src/echarts.ts
+++ b/src/echarts.ts
@@ -1826,21 +1826,14 @@ class ECharts extends Eventful {
});
};
- interface DisplayableWithStatesHistory extends Displayable {
- __prevStates: string[]
- };
// Clear states without animation.
// TODO States on component.
function clearStates(model: ComponentModel, view: ComponentView | ChartView): void {
view.group.traverse(function (el: Displayable) {
// TODO If el is incremental.
if (el.hasState()) {
- (el as DisplayableWithStatesHistory).__prevStates = el.currentStates;
el.clearStates();
}
- else if ((el as DisplayableWithStatesHistory).__prevStates) {
- (el as DisplayableWithStatesHistory).__prevStates = null;
- }
const textContent = el.getTextContent();
const textGuide = el.getTextGuideLine();
@@ -1862,11 +1855,6 @@ class ECharts extends Eventful {
view.group.traverse(function (el: Displayable) {
// Only updated on changed element. In case element is incremental and don't wan't to rerender.
if (el.__dirty && el.states && el.states.emphasis) {
- const prevStates = (el as DisplayableWithStatesHistory).__prevStates;
- // Restore states without animation
- if (prevStates) {
- el.useStates(prevStates);
- }
// Update state transition and enable animation again.
if (enableAnimation) {
graphic.setStateTransition(el, stateAnimationModel);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org