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/11/24 09:10:50 UTC

[echarts] branch graphic-animation updated: feat(animation): rename to keyframeAnimation

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch graphic-animation
in repository https://gitbox.apache.org/repos/asf/echarts.git


The following commit(s) were added to refs/heads/graphic-animation by this push:
     new 459377a  feat(animation): rename to keyframeAnimation
459377a is described below

commit 459377ab632d1cd72837b65754cfc65a8472ea1b
Author: pissang <bm...@gmail.com>
AuthorDate: Wed Nov 24 17:10:09 2021 +0800

    feat(animation): rename to keyframeAnimation
---
 src/animation/customGraphicKeyframeAnimation.ts | 4 ++--
 src/component/graphic/GraphicModel.ts           | 8 ++++----
 src/component/graphic/GraphicView.ts            | 4 ++--
 src/util/types.ts                               | 7 +------
 4 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/src/animation/customGraphicKeyframeAnimation.ts b/src/animation/customGraphicKeyframeAnimation.ts
index 845ccbf..addbf79 100644
--- a/src/animation/customGraphicKeyframeAnimation.ts
+++ b/src/animation/customGraphicKeyframeAnimation.ts
@@ -21,7 +21,7 @@ import { AnimationEasing } from 'zrender/src/animation/easing';
 import Element from 'zrender/src/Element';
 import { keys, filter, each } from 'zrender/src/core/util';
 import { ELEMENT_ANIMATABLE_PROPS } from './customGraphicTransition';
-import { ElementAnimationOption } from '../util/types';
+import { AnimationOption } from '../util/types';
 
 // Helpers for creating keyframe based animations in custom series and graphic components.
 
@@ -30,7 +30,7 @@ type AnimationKeyframe<T extends Record<string, any>> = T & {
     percent?: number    // 0 - 1
 };
 
-export interface ElementKeyframeAnimationOption<Props extends Record<string, any>> extends ElementAnimationOption {
+export interface ElementKeyframeAnimationOption<Props extends Record<string, any>> extends AnimationOption {
     // Animation configuration for keyframe based animation.
     loop?: boolean
     keyframes?: AnimationKeyframe<Props>[]
diff --git a/src/component/graphic/GraphicModel.ts b/src/component/graphic/GraphicModel.ts
index 6691324..a891f32 100644
--- a/src/component/graphic/GraphicModel.ts
+++ b/src/component/graphic/GraphicModel.ts
@@ -151,16 +151,16 @@ export interface GraphicComponentGroupOption
     // children: Omit<GraphicComponentElementOption, 'focus' | 'blurScope'>[];
     children: GraphicComponentElementOption[];
 
-    animation?: ElementKeyframeAnimationOption<GroupProps>
+    keyframeAnimation?: ElementKeyframeAnimationOption<GroupProps>
 };
 export interface GraphicComponentZRPathOption extends GraphicComponentDisplayableOption {
     shape?: PathProps['shape'] & TransitionOptionMixin;
-    animation?: ElementKeyframeAnimationOption<PathProps>;
+    keyframeAnimation?: ElementKeyframeAnimationOption<PathProps>;
 }
 export interface GraphicComponentImageOption extends GraphicComponentDisplayableOption {
     type?: 'image';
     style?: ImageStyleProps & TransitionOptionMixin;
-    animation?: ElementKeyframeAnimationOption<ImageProps>;
+    keyframeAnimation?: ElementKeyframeAnimationOption<ImageProps>;
 }
 // TODO: states?
 // interface GraphicComponentImageOptionOnState extends GraphicComponentDisplayableOptionOnState {
@@ -170,7 +170,7 @@ interface GraphicComponentTextOption
     extends Omit<GraphicComponentDisplayableOption, 'textContent' | 'textConfig'> {
     type?: 'text';
     style?: TextStyleProps;
-    animation?: ElementKeyframeAnimationOption<TextProps>;
+    keyframeAnimation?: ElementKeyframeAnimationOption<TextProps>;
 }
 export type GraphicComponentElementOption =
     GraphicComponentGroupOption |
diff --git a/src/component/graphic/GraphicView.ts b/src/component/graphic/GraphicView.ts
index 05e295b..eff35f3 100644
--- a/src/component/graphic/GraphicView.ts
+++ b/src/component/graphic/GraphicView.ts
@@ -228,8 +228,8 @@ export class GraphicComponentView extends ComponentView {
                     itemTooltipOption: elOption.tooltip
                 });
 
-                if (elOption.animation) {
-                    applyKeyframeAnimation(el, elOption.animation);
+                if (elOption.keyframeAnimation) {
+                    applyKeyframeAnimation(el, elOption.keyframeAnimation);
                 }
             }
         });
diff --git a/src/util/types.ts b/src/util/types.ts
index a7114be..95e5b50 100644
--- a/src/util/types.ts
+++ b/src/util/types.ts
@@ -820,12 +820,7 @@ export interface AnimationOption {
     delay?: number
     // additive?: boolean
 }
-export interface ElementAnimationOption extends AnimationOption {
-    // Animation configuration of enter, update and leave transition.
-    enter?: AnimationOption
-    update?: AnimationOption
-    leave?: AnimationOption
-}
+
 /**
  * Mixin of option set to control the animation of series.
  */

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org