You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2021/04/08 09:02:25 UTC
[echarts] 04/04: fix: [geo svg] fix labelLayout broken by geo
refactor.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch fix/geo-location
in repository https://gitbox.apache.org/repos/asf/echarts.git
commit f76f6f8cf3878c09a80a6077b8978e1d4e3c6b39
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Apr 8 17:01:19 2021 +0800
fix: [geo svg] fix labelLayout broken by geo refactor.
---
src/component/helper/MapDraw.ts | 4 +++-
src/label/labelStyle.ts | 13 ++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/component/helper/MapDraw.ts b/src/component/helper/MapDraw.ts
index b1e2341..aefc310 100644
--- a/src/component/helper/MapDraw.ts
+++ b/src/component/helper/MapDraw.ts
@@ -38,7 +38,7 @@ import GeoView from '../geo/GeoView';
import MapView from '../../chart/map/MapView';
import Geo from '../../coord/geo/Geo';
import Model from '../../model/Model';
-import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';
+import { setLabelStyle, getLabelStatesModels, enableLayoutLayoutFeatures } from '../../label/labelStyle';
import { getECData } from '../../util/innerStore';
import { createOrUpdatePatternFromDecal } from '../../util/decal';
import ZRText, {TextStyleProps} from 'zrender/src/graphic/Text';
@@ -728,6 +728,8 @@ function resetLabelForRegion(
}
}
+ enableLayoutLayoutFeatures(el, dataIdx, null);
+
(el as ECElement).disableLabelAnimation = true;
}
else {
diff --git a/src/label/labelStyle.ts b/src/label/labelStyle.ts
index 713093a..002a77d 100644
--- a/src/label/labelStyle.ts
+++ b/src/label/labelStyle.ts
@@ -30,7 +30,8 @@ import {
ColorString,
ZRStyleProps,
AnimationOptionMixin,
- InterpolatableValue
+ InterpolatableValue,
+ SeriesDataType
} from '../util/types';
import GlobalModel from '../model/Global';
import { isFunction, retrieve2, extend, keys, trim } from 'zrender/src/core/util';
@@ -39,6 +40,7 @@ import { deprecateReplaceLog } from '../util/log';
import { makeInner, interpolateRawValues } from '../util/model';
import List from '../data/List';
import { initProps, updateProps } from '../util/graphic';
+import { getECData } from '../util/innerStore';
type TextCommonParams = {
/**
@@ -727,3 +729,12 @@ export function animateLabelValue(
: updateProps
)(textEl, {}, animatableModel, dataIndex, null, during);
}
+
+export function enableLayoutLayoutFeatures(
+ el: Element,
+ dataIndex: number,
+ dataType: SeriesDataType
+): void {
+ getECData(el).dataIndex = dataIndex;
+ getECData(el).dataType = dataType;
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org