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 2021/06/10 14:21:25 UTC
[echarts] branch enhance-morph updated: feat(ut): transition styles
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch enhance-morph
in repository https://gitbox.apache.org/repos/asf/echarts.git
The following commit(s) were added to refs/heads/enhance-morph by this push:
new 7b86131 feat(ut): transition styles
7b86131 is described below
commit 7b86131f926f7c74eca16ffac92fcb6265a9d314
Author: pissang <bm...@gmail.com>
AuthorDate: Thu Jun 10 22:20:40 2021 +0800
feat(ut): transition styles
---
src/animation/morphTransitionHelper.ts | 14 ++++++++++----
src/animation/universalTransition.ts | 9 ++++++---
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/src/animation/morphTransitionHelper.ts b/src/animation/morphTransitionHelper.ts
index a0993b7..4d1bdcb 100644
--- a/src/animation/morphTransitionHelper.ts
+++ b/src/animation/morphTransitionHelper.ts
@@ -26,7 +26,7 @@ import {
} from 'zrender/src/tool/morphPath';
import { Path } from '../util/graphic';
import { SeriesModel } from '../export/api';
-import Element from 'zrender/src/Element';
+import Element, { ElementAnimateConfig } from 'zrender/src/Element';
import { defaults, isArray} from 'zrender/src/core/util';
import Displayable from 'zrender/src/graphic/Displayable';
import { getAnimationConfig } from './basicTrasition';
@@ -93,7 +93,13 @@ export function applyMorphAnimation(
to: DescendentPaths | DescendentPaths[],
seriesModel: SeriesModel,
dataIndex: number,
- animateOtherProps: (fromIndividual: Path, toIndividual: Path, rawFrom: Path, rawTo: Path) => void
+ animateOtherProps: (
+ fromIndividual: Path,
+ toIndividual: Path,
+ rawFrom: Path,
+ rawTo: Path,
+ animationCfg: ElementAnimateConfig
+ ) => void
) {
if (!from.length || !to.length) {
return;
@@ -136,7 +142,7 @@ export function applyMorphAnimation(
}
else {
morphPath(batchFrom, batchTo, animationCfg);
- animateOtherProps(batchFrom, batchTo, batchFrom, batchTo);
+ animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, animationCfg);
}
}
else {
@@ -152,7 +158,7 @@ export function applyMorphAnimation(
fromIndividuals[k],
toIndividuals[k],
fromIsMany ? batchMany[k] : batch.one,
- fromIsMany ? batch.one : batchMany[k]
+ fromIsMany ? batch.one : batchMany[k], animationCfg
);
}
}
diff --git a/src/animation/universalTransition.ts b/src/animation/universalTransition.ts
index 6d96f4e..f2e12bb 100644
--- a/src/animation/universalTransition.ts
+++ b/src/animation/universalTransition.ts
@@ -20,7 +20,7 @@
import ExtensionAPI from '../core/ExtensionAPI';
import SeriesModel from '../model/Series';
import {createHashMap, each, filter} from 'zrender/src/core/util';
-import Element from 'zrender/src/Element';
+import Element, { ElementAnimateConfig } from 'zrender/src/Element';
import { applyMorphAnimation, getPathList } from './morphTransitionHelper';
import { getECData } from '../util/innerStore';
import Path from 'zrender/src/graphic/Path';
@@ -65,9 +65,12 @@ export function transitionBetweenSeries(
function updateMorphingPathProps(
from: Path, to: Path,
- rawFrom: Path, rawTo: Path
+ rawFrom: Path, rawTo: Path,
+ animationCfg: ElementAnimateConfig
) {
- // TODO
+ to.animateFrom({
+ style: rawFrom.style
+ }, animationCfg);
}
for (let i = 0; i < sourceElements.length; i++) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org