diff --git a/packages/vchart/src/series/bar/animation.ts b/packages/vchart/src/series/bar/animation.ts index 4b268ac467..aa9415ed64 100644 --- a/packages/vchart/src/series/bar/animation.ts +++ b/packages/vchart/src/series/bar/animation.ts @@ -1,4 +1,5 @@ import { Factory } from '../../core/factory'; +import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config'; import { Direction } from '../../typings/space'; // eslint-disable-next-line no-duplicate-imports import type { Datum } from '../../typings'; @@ -75,7 +76,7 @@ export const registerBarAnimation = () => { appear: barPresetAnimation(params, preset), enter: barGrowIn(params, false), exit: barGrowOut(params, false), - disappear: barGrowOut(params) + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } }; }); }; diff --git a/packages/vchart/src/series/circle-packing/animation.ts b/packages/vchart/src/series/circle-packing/animation.ts index e7e288b4f4..867dc7fcc1 100644 --- a/packages/vchart/src/series/circle-packing/animation.ts +++ b/packages/vchart/src/series/circle-packing/animation.ts @@ -1,5 +1,6 @@ import type { IAnimationTypeConfig } from '../../animation/interface'; import { Factory } from '../../core/factory'; +import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config'; import type { CirclePackingAppearPreset } from './interface'; export const circlePackingPresetAnimation = (preset: CirclePackingAppearPreset): IAnimationTypeConfig => { @@ -23,6 +24,6 @@ export const registerCirclePackingAnimation = () => { appear: circlePackingPresetAnimation(preset), enter: { type: 'growRadiusIn' }, exit: { type: 'growRadiusOut' }, - disappear: { type: 'growRadiusOut' } + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } })); }; diff --git a/packages/vchart/src/series/gauge/animation.ts b/packages/vchart/src/series/gauge/animation.ts index b38fa8d0b2..de00248d69 100644 --- a/packages/vchart/src/series/gauge/animation.ts +++ b/packages/vchart/src/series/gauge/animation.ts @@ -1,5 +1,6 @@ import type { IAnimationTypeConfig } from '../../animation/interface'; import { Factory } from '../../core'; +import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config'; export type ProgressLikeAppearPreset = 'grow' | 'fadeIn'; @@ -36,7 +37,7 @@ export const registerGaugePointerAnimation = () => { return { appear: animation, enter: animation, - disappear: { type: 'fadeOut' } + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } }; } ); diff --git a/packages/vchart/src/series/polar/progress-like/animation.ts b/packages/vchart/src/series/polar/progress-like/animation.ts index 4b7cf0aec4..b1a239468c 100644 --- a/packages/vchart/src/series/polar/progress-like/animation.ts +++ b/packages/vchart/src/series/polar/progress-like/animation.ts @@ -1,5 +1,6 @@ import type { IAnimationTypeConfig } from '../../../animation/interface'; import { Factory } from '../../../core/factory'; +import { DEFAULT_ANIMATION_CONFIG } from '../../../animation/config'; import type { IProgressLikeAnimationParams, ProgressLikeAppearPreset } from './interface'; const Appear_Grow = (params: IProgressLikeAnimationParams): IAnimationTypeConfig => ({ @@ -28,7 +29,7 @@ export const registerProgressLikeAnimation = () => { (params: IProgressLikeAnimationParams, preset: ProgressLikeAppearPreset) => ({ appear: progressLikePresetAnimation(params, preset), enter: { type: 'growAngleIn' }, - disappear: { type: 'growAngleOut' } + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } }) ); }; diff --git a/packages/vchart/src/series/sankey/animation.ts b/packages/vchart/src/series/sankey/animation.ts index 621fb9e2a9..be0f80d64c 100644 --- a/packages/vchart/src/series/sankey/animation.ts +++ b/packages/vchart/src/series/sankey/animation.ts @@ -1,6 +1,7 @@ // eslint-disable-next-line no-duplicate-imports import { Direction } from '../../typings/space'; import { Factory } from '../../core/factory'; +import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config'; import { FadeInOutAnimation } from '../../animation/config'; import type { ISankeyAnimationParams, SankeyAppearPreset } from './interface'; import type { IAnimationTypeConfig, IAnimationParameters } from '../../animation/interface'; @@ -226,7 +227,7 @@ export const registerSankeyAnimation = () => { appear: sankeyLinkPresetAnimation(preset), enter: { type: 'linkPathGrowIn' }, exit: { type: 'linkPathGrowOut' }, - disappear: { type: 'linkPathGrowOut' } + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } })); AnimateExecutor.registerBuiltInAnimate('linkPathGrowOut', LinkPathGrowOut); AnimateExecutor.registerBuiltInAnimate('linkPathGrowIn', LinkPathGrowIn); diff --git a/packages/vchart/src/series/treemap/animation.ts b/packages/vchart/src/series/treemap/animation.ts index e81843f07e..b763cc2f95 100644 --- a/packages/vchart/src/series/treemap/animation.ts +++ b/packages/vchart/src/series/treemap/animation.ts @@ -1,5 +1,6 @@ import type { IAnimationTypeConfig } from '../../animation/interface'; import { Factory } from '../../core/factory'; +import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config'; import type { TreemapAppearPreset } from './interface'; export const treemapPresetAnimation = (preset: TreemapAppearPreset): IAnimationTypeConfig => { @@ -27,7 +28,7 @@ export const registerTreemapAnimation = () => { appear: treemapPresetAnimation(preset), enter: { type: 'growCenterIn' }, exit: { type: 'growCenterOut' }, - disappear: { type: 'growCenterOut' } + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } }; }); }; diff --git a/packages/vchart/src/series/venn/animation.ts b/packages/vchart/src/series/venn/animation.ts index cd58270bf5..3b81f266f5 100644 --- a/packages/vchart/src/series/venn/animation.ts +++ b/packages/vchart/src/series/venn/animation.ts @@ -6,6 +6,7 @@ import type { VennAppearPreset } from './interface'; import type { IAnimationTypeConfig } from '../../animation/interface'; // import { ACustomAnimate } from '@visactor/vrender-animate'; import { Factory } from '../../core/factory'; +import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config'; export const vennCirclePresetAnimation = (preset: VennAppearPreset): IAnimationTypeConfig => { switch (preset) { @@ -96,7 +97,7 @@ export const registerVennAnimation = () => { appear: vennCirclePresetAnimation(preset), enter: { type: 'growRadiusIn' }, exit: { type: 'growRadiusOut' }, - disappear: { type: 'growRadiusOut' } + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } }; }); Factory.registerAnimation('vennOverlap', (params: unknown, preset: VennAppearPreset) => { @@ -105,7 +106,7 @@ export const registerVennAnimation = () => { update: { custom: VennOverlapAnimation }, enter: { type: 'fadeIn' }, exit: { type: 'fadeOut' }, - disappear: { type: 'fadeOut' } + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } }; }); }; diff --git a/packages/vchart/src/series/waterfall/animation.ts b/packages/vchart/src/series/waterfall/animation.ts index 9d90ed727d..27dbfe0ae6 100644 --- a/packages/vchart/src/series/waterfall/animation.ts +++ b/packages/vchart/src/series/waterfall/animation.ts @@ -3,6 +3,7 @@ import { barGrowIn, barGrowOut } from '../bar/animation'; import { Factory } from '../../core/factory'; import type { WaterfallAppearPreset } from './interface'; import type { IAnimationTypeConfig } from '../../animation/interface'; +import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config'; const Appear_FadeIn: IAnimationTypeConfig = { type: 'fadeIn' @@ -32,7 +33,7 @@ export const registerWaterfallAnimation = () => { appear: waterfallPresetAnimation(params, preset), enter: barGrowIn(params, false), exit: barGrowOut(params, false), - disappear: barGrowOut(params, false) + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } }; }); }; diff --git a/packages/vchart/src/series/word-cloud/animation.ts b/packages/vchart/src/series/word-cloud/animation.ts index 1b528cd866..7bfe8d3ac2 100644 --- a/packages/vchart/src/series/word-cloud/animation.ts +++ b/packages/vchart/src/series/word-cloud/animation.ts @@ -46,6 +46,6 @@ export const registerWordCloudAnimation = () => { appear: wordcloudPresetAnimation(params, preset), enter: { type: 'fadeIn' }, exit: { type: 'fadeOut' }, - disappear: { type: 'fadeOut' } + disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration } })); };