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 323b939 refact: upgrade animateTo usage, use cfg object instead. 323b939 is described below commit 323b9392ed9c418c4ec77cf37d5fb1432c7e127f Author: pissang <bm2736...@gmail.com> AuthorDate: Wed Mar 25 16:07:46 2020 +0800 refact: upgrade animateTo usage, use cfg object instead. --- src/chart/bar/PictorialBarView.ts | 4 ++-- src/chart/helper/Symbol.ts | 4 ++-- src/chart/pie/PieView.ts | 4 ++-- src/component/timeline/SliderTimelineView.ts | 6 ++++-- src/util/animation.ts | 7 ++++++- src/util/graphic.ts | 8 +++++++- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/chart/bar/PictorialBarView.ts b/src/chart/bar/PictorialBarView.ts index e807ba3..549bcc4 100644 --- a/src/chart/bar/PictorialBarView.ts +++ b/src/chart/bar/PictorialBarView.ts @@ -773,12 +773,12 @@ function updateHoverAnimation(path: PictorialSymbol, symbolMeta: SymbolMeta) { .on('emphasis', function () { this.animateTo({ scale: [scale[0] * 1.1, scale[1] * 1.1] - }, 400, 'elasticOut'); + }, { duration: 400, easing: 'elasticOut' }); }) .on('normal', function () { this.animateTo({ scale: scale.slice() - }, 400, 'elasticOut'); + }, { duration: 400, easing: 'elasticOut' }); }); } diff --git a/src/chart/helper/Symbol.ts b/src/chart/helper/Symbol.ts index 10a2d57..f219ca2 100644 --- a/src/chart/helper/Symbol.ts +++ b/src/chart/helper/Symbol.ts @@ -358,12 +358,12 @@ function highDownOnUpdate(this: ECSymbol, fromState: DisplayState, toState: Disp // modify it after support stop specified animation. // toState === fromState // ? (this.stopAnimation(), this.attr(emphasisOpt)) - this.animateTo(emphasisOpt, 400, 'elasticOut'); + this.animateTo(emphasisOpt, { duration: 400, easing: 'elasticOut' }); } else if (toState === 'normal') { this.animateTo({ scale: this.__symbolOriginalScale - }, 400, 'elasticOut'); + }, { duration: 400, easing: 'elasticOut' }); } } diff --git a/src/chart/pie/PieView.ts b/src/chart/pie/PieView.ts index 5679444..0d7f158 100644 --- a/src/chart/pie/PieView.ts +++ b/src/chart/pie/PieView.ts @@ -207,7 +207,7 @@ class PiePiece extends graphic.Group { shape: { r: layout.r + seriesModel.get('hoverOffset') } - }, 300, 'elasticOut'); + }, { duration: 300, easing: 'elasticOut' }); } else { labelLine.ignore = labelLine.normalIgnore; @@ -218,7 +218,7 @@ class PiePiece extends graphic.Group { shape: { r: layout.r } - }, 300, 'elasticOut'); + }, { duration: 300, easing: 'elasticOut' }); } } : null; diff --git a/src/component/timeline/SliderTimelineView.ts b/src/component/timeline/SliderTimelineView.ts index c8e3a06..f612b3f 100644 --- a/src/component/timeline/SliderTimelineView.ts +++ b/src/component/timeline/SliderTimelineView.ts @@ -799,8 +799,10 @@ function pointerMoveTo( pointer.stopAnimation(true); pointer.animateTo( { position: [toCoord, 0] }, - pointerModel.get('animationDuration', true), - pointerModel.get('animationEasing', true) + { + duration: pointerModel.get('animationDuration', true), + easing: pointerModel.get('animationEasing', true) + } ); } } diff --git a/src/util/animation.ts b/src/util/animation.ts index ba1f152..021299b 100644 --- a/src/util/animation.ts +++ b/src/util/animation.ts @@ -95,7 +95,12 @@ export function createWrap() { for (let i = 0, len = storage.length; i < len; i++) { let item = storage[i]; - item.el.animateTo(item.target, item.time, item.delay, item.easing, done); + item.el.animateTo(item.target, { + duration: item.time, + delay: item.delay, + easing: item.easing, + done + }); } return this; diff --git a/src/util/graphic.ts b/src/util/graphic.ts index 3977d9e..2d92773 100644 --- a/src/util/graphic.ts +++ b/src/util/graphic.ts @@ -1042,7 +1042,13 @@ function animateOrSetProps<Props>( } duration > 0 - ? el.animateTo(props, duration, animationDelay || 0, animationEasing, cb, !!cb) + ? el.animateTo(props, { + duration, + delay: animationDelay || 0, + easing: animationEasing, + done: cb, + force: !!cb + }) : (el.stopAnimation(), el.attr(props), cb && cb()); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org