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 1131bad fix: add disableLabelAnimation for several series
1131bad is described below
commit 1131bad02a8fae04a3b680ddb20b26309c276c2d
Author: pissang <[email protected]>
AuthorDate: Fri Jul 10 14:07:02 2020 +0800
fix: add disableLabelAnimation for several series
---
src/chart/map/MapView.ts | 1 +
src/chart/sankey/SankeyView.ts | 4 +++-
src/label/LabelManager.ts | 5 +++--
src/util/types.ts | 5 +++++
4 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/chart/map/MapView.ts b/src/chart/map/MapView.ts
index 2ced9f5..3a44096 100644
--- a/src/chart/map/MapView.ts
+++ b/src/chart/map/MapView.ts
@@ -178,6 +178,7 @@ class MapView extends ChartView {
}
}
});
+ (circle as ECElement).disableLabelAnimation = true;
if (!labelModel.get('position')) {
circle.setTextConfig({
position: 'bottom'
diff --git a/src/chart/sankey/SankeyView.ts b/src/chart/sankey/SankeyView.ts
index 9c31ab4..1c7f335 100644
--- a/src/chart/sankey/SankeyView.ts
+++ b/src/chart/sankey/SankeyView.ts
@@ -19,7 +19,7 @@
import * as graphic from '../../util/graphic';
import * as zrUtil from 'zrender/src/core/util';
-import { LayoutOrient, Payload } from '../../util/types';
+import { LayoutOrient, Payload, ECElement } from '../../util/types';
import { PathProps } from 'zrender/src/graphic/Path';
import SankeySeriesModel, { SankeyEdgeItemOption, SankeyNodeItemOption } from
'./SankeySeries';
import ChartView from '../../view/Chart';
@@ -258,6 +258,8 @@ class SankeyView extends ChartView {
style: itemModel.getModel('itemStyle').getItemStyle()
});
+ (rect as ECElement).disableLabelAnimation = true;
+
const hoverStyle = itemModel.getModel(['emphasis',
'itemStyle']).getItemStyle();
graphic.setLabelStyle(
diff --git a/src/label/LabelManager.ts b/src/label/LabelManager.ts
index 7cac274..f6eeebc 100644
--- a/src/label/LabelManager.ts
+++ b/src/label/LabelManager.ts
@@ -35,7 +35,8 @@ import {
LabelLayoutOptionCallback,
LabelLayoutOptionCallbackParams,
LabelLineOption,
- Dictionary
+ Dictionary,
+ ECElement
} from '../util/types';
import { parsePercent } from '../util/number';
import ChartView from '../view/Chart';
@@ -480,7 +481,7 @@ class LabelManager {
const textEl = el.getTextContent();
const guideLine = el.getTextGuideLine();
// Animate
- if (textEl && !textEl.ignore && !textEl.invisible) {
+ if (textEl && !textEl.ignore && !textEl.invisible && !(el as
ECElement).disableLabelAnimation) {
const layoutStore = labelLayoutInnerStore(textEl);
const oldLayout = layoutStore.oldLayout;
const newProps = {
diff --git a/src/util/types.ts b/src/util/types.ts
index bfd2006..6effa65 100644
--- a/src/util/types.ts
+++ b/src/util/types.ts
@@ -110,6 +110,11 @@ export interface ECElement extends Element {
highlighted?: boolean;
selected?: boolean;
z2EmphasisLift?: number;
+
+ /**
+ * Force disable animation on any condition
+ */
+ disableLabelAnimation?: boolean
}
export interface DataHost {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]