From 985f69ccceeff43955fa48a614d1e24f01daa709 Mon Sep 17 00:00:00 2001 From: purpose Date: Thu, 27 Jun 2024 15:03:22 +0800 Subject: [PATCH 1/3] fix: fix animation config update --- packages/vgrammar-core/src/view/mark.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/vgrammar-core/src/view/mark.ts b/packages/vgrammar-core/src/view/mark.ts index d0fec883..9dac0773 100644 --- a/packages/vgrammar-core/src/view/mark.ts +++ b/packages/vgrammar-core/src/view/mark.ts @@ -658,9 +658,7 @@ export class Mark extends GrammarBase implements IMark { this.isUpdated = true; if (!this.renderContext.progressive) { - if (spec.animation) { - this.animate.updateConfig(spec.animation); - } + this.animate.updateConfig(spec.animation); this.animate.updateState(spec.animationState); } From 3f95e356abf1f46b96ddf1908fdbf7eb9073efc0 Mon Sep 17 00:00:00 2001 From: purpose Date: Thu, 27 Jun 2024 15:29:22 +0800 Subject: [PATCH 2/3] fix: wrap final animation attribute interface --- .../src/graph/animation/animation/fade.ts | 8 +- .../animation/animation/grow-cartesian.ts | 92 +++++++++---------- .../animation/animation/grow-interval.ts | 30 +++--- .../graph/animation/animation/grow-polar.ts | 48 +++++----- .../src/graph/animation/animation/move.ts | 4 +- .../src/graph/animation/animation/rotate.ts | 12 +-- .../src/graph/animation/animation/scale.ts | 10 +- .../src/graph/animation/animator.ts | 2 +- packages/vgrammar-core/src/graph/element.ts | 11 +++ packages/vgrammar-core/src/types/element.ts | 2 + 10 files changed, 116 insertions(+), 103 deletions(-) diff --git a/packages/vgrammar-core/src/graph/animation/animation/fade.ts b/packages/vgrammar-core/src/graph/animation/animation/fade.ts index 1410d2cf..221056b2 100644 --- a/packages/vgrammar-core/src/graph/animation/animation/fade.ts +++ b/packages/vgrammar-core/src/graph/animation/animation/fade.ts @@ -6,7 +6,7 @@ export const fadeIn: TypeAnimation = ( options: any, animationParameters: IAnimationParameters ) => { - const finalAttrs = element.getFinalGraphicAttributes() ?? {}; + const attrs = element.getFinalAnimationAttributes() ?? {}; return { from: { @@ -15,9 +15,9 @@ export const fadeIn: TypeAnimation = ( strokeOpacity: 0 }, to: { - opacity: finalAttrs.opacity ?? 1, - fillOpacity: finalAttrs.fillOpacity ?? 1, - strokeOpacity: finalAttrs.strokeOpacity ?? 1 + opacity: attrs.opacity ?? 1, + fillOpacity: attrs.fillOpacity ?? 1, + strokeOpacity: attrs.strokeOpacity ?? 1 } }; }; diff --git a/packages/vgrammar-core/src/graph/animation/animation/grow-cartesian.ts b/packages/vgrammar-core/src/graph/animation/animation/grow-cartesian.ts index cd297465..dcec1ebb 100644 --- a/packages/vgrammar-core/src/graph/animation/animation/grow-cartesian.ts +++ b/packages/vgrammar-core/src/graph/animation/animation/grow-cartesian.ts @@ -9,9 +9,9 @@ export const growCenterIn: TypeAnimation = ( ) => { switch (options?.direction) { case 'x': { - const x = element.getFinalGraphicAttributes()?.x; - const x1 = element.getFinalGraphicAttributes()?.x1; - const width = element.getFinalGraphicAttributes()?.width; + const x = element.getFinalAnimationAttribute('x'); + const x1 = element.getFinalAnimationAttribute('x1'); + const width = element.getFinalAnimationAttribute('width'); return { from: isValid(width) @@ -29,9 +29,9 @@ export const growCenterIn: TypeAnimation = ( }; } case 'y': { - const y = element.getFinalGraphicAttributes()?.y; - const y1 = element.getFinalGraphicAttributes()?.y1; - const height = element.getFinalGraphicAttributes()?.height; + const y = element.getFinalAnimationAttribute('y'); + const y1 = element.getFinalAnimationAttribute('y1'); + const height = element.getFinalAnimationAttribute('height'); return { from: isValid(height) @@ -50,12 +50,12 @@ export const growCenterIn: TypeAnimation = ( } case 'xy': default: { - const x = element.getFinalGraphicAttributes()?.x; - const x1 = element.getFinalGraphicAttributes()?.x1; - const width = element.getFinalGraphicAttributes()?.width; - const y = element.getFinalGraphicAttributes()?.y; - const y1 = element.getFinalGraphicAttributes()?.y1; - const height = element.getFinalGraphicAttributes()?.height; + const x = element.getFinalAnimationAttribute('x'); + const x1 = element.getFinalAnimationAttribute('x1'); + const width = element.getFinalAnimationAttribute('width'); + const y = element.getFinalAnimationAttribute('y'); + const y1 = element.getFinalAnimationAttribute('y1'); + const height = element.getFinalAnimationAttribute('height'); const from: any = {}; if (isValid(width)) { @@ -93,9 +93,9 @@ export const growCenterOut: TypeAnimation = ( ) => { switch (options?.direction) { case 'x': { - const x = element.getFinalGraphicAttributes()?.x; - const x1 = element.getFinalGraphicAttributes()?.x1; - const width = element.getFinalGraphicAttributes()?.width; + const x = element.getFinalAnimationAttribute('x'); + const x1 = element.getFinalAnimationAttribute('x1'); + const width = element.getFinalAnimationAttribute('width'); return { to: isValid(width) @@ -112,9 +112,9 @@ export const growCenterOut: TypeAnimation = ( }; } case 'y': { - const y = element.getFinalGraphicAttributes()?.y; - const y1 = element.getFinalGraphicAttributes()?.y1; - const height = element.getFinalGraphicAttributes()?.height; + const y = element.getFinalAnimationAttribute('y'); + const y1 = element.getFinalAnimationAttribute('y1'); + const height = element.getFinalAnimationAttribute('height'); return { to: isValid(height) @@ -132,12 +132,12 @@ export const growCenterOut: TypeAnimation = ( } case 'xy': default: { - const x = element.getFinalGraphicAttributes()?.x; - const y = element.getFinalGraphicAttributes()?.y; - const x1 = element.getFinalGraphicAttributes()?.x1; - const y1 = element.getFinalGraphicAttributes()?.y1; - const width = element.getFinalGraphicAttributes()?.width; - const height = element.getFinalGraphicAttributes()?.height; + const x = element.getFinalAnimationAttribute('x'); + const y = element.getFinalAnimationAttribute('y'); + const x1 = element.getFinalAnimationAttribute('x1'); + const y1 = element.getFinalAnimationAttribute('y1'); + const width = element.getFinalAnimationAttribute('width'); + const height = element.getFinalAnimationAttribute('height'); const to: any = {}; if (isValid(width)) { @@ -173,9 +173,9 @@ function growWidthInIndividual( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const x = element.getFinalGraphicAttributes()?.x; - const x1 = element.getFinalGraphicAttributes()?.x1; - const width = element.getFinalGraphicAttributes()?.width; + const x = element.getFinalAnimationAttribute('x'); + const x1 = element.getFinalAnimationAttribute('x1'); + const width = element.getFinalAnimationAttribute('width'); if (options && options.orient === 'negative') { const computedX1 = isValid(width) ? Math.max(x, x + width) : Math.max(x, x1); @@ -199,9 +199,9 @@ function growWidthInOverall( animationParameters: IAnimationParameters ) { // no need to handle the situation where x > x1 - const x = element.getFinalGraphicAttributes()?.x; - const x1 = element.getFinalGraphicAttributes()?.x1; - const width = element.getFinalGraphicAttributes()?.width; + const x = element.getFinalAnimationAttribute('x'); + const x1 = element.getFinalAnimationAttribute('x1'); + const width = element.getFinalAnimationAttribute('width'); let overallValue: number; if (options && options.orient === 'negative') { if (isNumber(options.overall)) { @@ -237,9 +237,9 @@ function growWidthOutIndividual( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const x = element.getFinalGraphicAttributes()?.x; - const x1 = element.getFinalGraphicAttributes()?.x1; - const width = element.getFinalGraphicAttributes()?.width; + const x = element.getFinalAnimationAttribute('x'); + const x1 = element.getFinalAnimationAttribute('x1'); + const width = element.getFinalAnimationAttribute('width'); if (options && options.orient === 'negative') { const computedX1 = isValid(width) ? Math.max(x, x + width) : Math.max(x, x1); @@ -260,8 +260,8 @@ function growWidthOutOverall( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const x1 = element.getFinalGraphicAttributes()?.x1; - const width = element.getFinalGraphicAttributes()?.width; + const x1 = element.getFinalAnimationAttribute('x1'); + const width = element.getFinalAnimationAttribute('width'); let overallValue: number; if (options && options.orient === 'negative') { @@ -299,9 +299,9 @@ function growHeightInIndividual( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const y = element.getFinalGraphicAttributes()?.y; - const y1 = element.getFinalGraphicAttributes()?.y1; - const height = element.getFinalGraphicAttributes()?.height; + const y = element.getFinalAnimationAttribute('y'); + const y1 = element.getFinalAnimationAttribute('y1'); + const height = element.getFinalAnimationAttribute('height'); if (options && options.orient === 'negative') { const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1); @@ -323,9 +323,9 @@ function growHeightInOverall( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const y = element.getFinalGraphicAttributes()?.y; - const y1 = element.getFinalGraphicAttributes()?.y1; - const height = element.getFinalGraphicAttributes()?.height; + const y = element.getFinalAnimationAttribute('y'); + const y1 = element.getFinalAnimationAttribute('y1'); + const height = element.getFinalAnimationAttribute('height'); let overallValue: number; if (options && options.orient === 'negative') { @@ -362,9 +362,9 @@ function growHeightOutIndividual( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const y = element.getFinalGraphicAttributes()?.y; - const y1 = element.getFinalGraphicAttributes()?.y1; - const height = element.getFinalGraphicAttributes()?.height; + const y = element.getFinalAnimationAttribute('y'); + const y1 = element.getFinalAnimationAttribute('y1'); + const height = element.getFinalAnimationAttribute('height'); if (options && options.orient === 'negative') { const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1); @@ -385,8 +385,8 @@ function growHeightOutOverall( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const y1 = element.getFinalGraphicAttributes()?.y1; - const height = element.getFinalGraphicAttributes()?.height; + const y1 = element.getFinalAnimationAttribute('y1'); + const height = element.getFinalAnimationAttribute('height'); let overallValue: number; if (options && options.orient === 'negative') { diff --git a/packages/vgrammar-core/src/graph/animation/animation/grow-interval.ts b/packages/vgrammar-core/src/graph/animation/animation/grow-interval.ts index c4f47ad4..e56d80af 100644 --- a/packages/vgrammar-core/src/graph/animation/animation/grow-interval.ts +++ b/packages/vgrammar-core/src/graph/animation/animation/grow-interval.ts @@ -9,11 +9,11 @@ function growIntervalInIndividual( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); if (options && options.direction === 'x') { - const x = finalAttrs?.x; - const x1 = finalAttrs?.x1; + const x = attrs?.x; + const x1 = attrs?.x1; if (options.orient === 'negative') { return { from: { x: x1, x1: x1 }, @@ -25,8 +25,8 @@ function growIntervalInIndividual( to: { x: x, y1: x1 } }; } - const y = finalAttrs?.y; - const y1 = finalAttrs?.y1; + const y = attrs?.y; + const y1 = attrs?.y1; if (options && options.orient === 'negative') { return { from: { y: y1, y1: y1 }, @@ -44,11 +44,11 @@ function growIntervalInOverall( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); if (options && options.direction === 'x') { - const x = finalAttrs?.x; - const x1 = finalAttrs?.x1; + const x = attrs?.x; + const x1 = attrs?.x1; let overallValue: number; if (options.orient === 'negative') { if (isNumber(options.overall)) { @@ -69,8 +69,8 @@ function growIntervalInOverall( }; } - const y = finalAttrs?.y; - const y1 = finalAttrs?.y1; + const y = attrs?.y; + const y1 = attrs?.y1; let overallValue: number; if (options && options.orient === 'negative') { if (isNumber(options.overall)) { @@ -114,10 +114,10 @@ function growIntervalOutIndividual( options: IGrowCartesianAnimationOptions, animationParameters: IAnimationParameters ) { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); if (options && options.direction === 'x') { - const x = finalAttrs?.x; - const x1 = finalAttrs?.x1; + const x = attrs?.x; + const x1 = attrs?.x1; const prevX = element.getGraphicAttribute('x', true); const prevX1 = element.getGraphicAttribute('x1', true); if (options.orient === 'negative') { @@ -132,8 +132,8 @@ function growIntervalOutIndividual( }; } - const y = finalAttrs?.y; - const y1 = finalAttrs?.y1; + const y = attrs?.y; + const y1 = attrs?.y1; const prevY = element.getGraphicAttribute('y', true); const prevY1 = element.getGraphicAttribute('y1', true); if (options && options.orient === 'negative') { diff --git a/packages/vgrammar-core/src/graph/animation/animation/grow-polar.ts b/packages/vgrammar-core/src/graph/animation/animation/grow-polar.ts index 7907e23a..5635a1db 100644 --- a/packages/vgrammar-core/src/graph/animation/animation/grow-polar.ts +++ b/packages/vgrammar-core/src/graph/animation/animation/grow-polar.ts @@ -14,16 +14,16 @@ const growAngleInIndividual = ( options: IGrowAngleAnimationOptions, animationParameters: IAnimationParameters ) => { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); if (options && options.orient === 'anticlockwise') { return { - from: { startAngle: finalAttrs?.endAngle }, - to: { startAngle: finalAttrs?.startAngle } + from: { startAngle: attrs?.endAngle }, + to: { startAngle: attrs?.startAngle } }; } return { - from: { endAngle: finalAttrs?.startAngle }, - to: { endAngle: finalAttrs?.endAngle } + from: { endAngle: attrs?.startAngle }, + to: { endAngle: attrs?.endAngle } }; }; @@ -32,7 +32,7 @@ const growAngleInOverall = ( options: IGrowAngleAnimationOptions, animationParameters: IAnimationParameters ) => { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); if (options && options.orient === 'anticlockwise') { const overallValue = isNumber(options.overall) ? options.overall : Math.PI * 2; @@ -42,8 +42,8 @@ const growAngleInOverall = ( endAngle: overallValue }, to: { - startAngle: finalAttrs?.startAngle, - endAngle: finalAttrs?.endAngle + startAngle: attrs?.startAngle, + endAngle: attrs?.endAngle } }; } @@ -54,8 +54,8 @@ const growAngleInOverall = ( endAngle: overallValue }, to: { - startAngle: finalAttrs?.startAngle, - endAngle: finalAttrs?.endAngle + startAngle: attrs?.startAngle, + endAngle: attrs?.endAngle } }; }; @@ -75,17 +75,17 @@ const growAngleOutIndividual = ( options: IGrowAngleAnimationOptions, animationParameters: IAnimationParameters ) => { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); if (options && options.orient === 'anticlockwise') { return { from: { startAngle: element.getGraphicAttribute('startAngle', true) }, - to: { startAngle: finalAttrs?.endAngle } + to: { startAngle: attrs?.endAngle } }; } return { from: { endAngle: element.getGraphicAttribute('endAngle', true) }, - to: { endAngle: finalAttrs?.startAngle } + to: { endAngle: attrs?.startAngle } }; }; @@ -137,17 +137,17 @@ const growRadiusInIndividual = ( options: IGrowRadiusAnimationOptions, animationParameters: IAnimationParameters ) => { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); if (options && options.orient === 'inside') { return { - from: { innerRadius: finalAttrs?.outerRadius }, - to: { innerRadius: finalAttrs?.innerRadius } + from: { innerRadius: attrs?.outerRadius }, + to: { innerRadius: attrs?.innerRadius } }; } return { - from: { outerRadius: finalAttrs?.innerRadius }, - to: { outerRadius: finalAttrs?.outerRadius } + from: { outerRadius: attrs?.innerRadius }, + to: { outerRadius: attrs?.outerRadius } }; }; @@ -156,7 +156,7 @@ const growRadiusInOverall = ( options: IGrowRadiusAnimationOptions, animationParameters: IAnimationParameters ) => { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); const overallValue = isNumber(options?.overall) ? options.overall : 0; return { from: { @@ -164,8 +164,8 @@ const growRadiusInOverall = ( outerRadius: overallValue }, to: { - innerRadius: finalAttrs?.innerRadius, - outerRadius: finalAttrs?.outerRadius + innerRadius: attrs?.innerRadius, + outerRadius: attrs?.outerRadius } }; }; @@ -185,16 +185,16 @@ const growRadiusOutIndividual = ( options: IGrowRadiusAnimationOptions, animationParameters: IAnimationParameters ) => { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); if (options && options.orient === 'inside') { return { from: { innerRadius: element.getGraphicAttribute('innerRadius', true) }, - to: { innerRadius: finalAttrs?.outerRadius } + to: { innerRadius: attrs?.outerRadius } }; } return { from: { outerRadius: element.getGraphicAttribute('outerRadius', true) }, - to: { outerRadius: finalAttrs?.innerRadius } + to: { outerRadius: attrs?.innerRadius } }; }; diff --git a/packages/vgrammar-core/src/graph/animation/animation/move.ts b/packages/vgrammar-core/src/graph/animation/animation/move.ts index ce56a564..48d4050a 100644 --- a/packages/vgrammar-core/src/graph/animation/animation/move.ts +++ b/packages/vgrammar-core/src/graph/animation/animation/move.ts @@ -34,10 +34,10 @@ export const moveIn: TypeAnimation = ( const fromY = point && isValidNumber(point.y) ? point.y : changedY; const finalAttrsX = excludeChannels.includes('x') ? element.getGraphicAttribute('x') - : element.getFinalGraphicAttributes()?.x; + : element.getFinalAnimationAttribute('x'); const finalAttrsY = excludeChannels.includes('y') ? element.getGraphicAttribute('y') - : element.getFinalGraphicAttributes()?.y; + : element.getFinalAnimationAttribute('y'); switch (direction) { case 'x': diff --git a/packages/vgrammar-core/src/graph/animation/animation/rotate.ts b/packages/vgrammar-core/src/graph/animation/animation/rotate.ts index 9fdded85..5e8fac4a 100644 --- a/packages/vgrammar-core/src/graph/animation/animation/rotate.ts +++ b/packages/vgrammar-core/src/graph/animation/animation/rotate.ts @@ -6,21 +6,21 @@ export const rotateIn: TypeAnimation = ( options: IRotateAnimationOptions, animationParameters: IAnimationParameters ) => { - const finalAngle = element.getFinalGraphicAttributes()?.angle ?? 0; + const attributeAngle = element.getFinalAnimationAttribute('angle') ?? 0; let angle = 0; - if (isNumberClose(finalAngle / (Math.PI * 2), 0)) { - angle = Math.round(finalAngle / (Math.PI * 2)) * Math.PI * 2; + if (isNumberClose(attributeAngle / (Math.PI * 2), 0)) { + angle = Math.round(attributeAngle / (Math.PI * 2)) * Math.PI * 2; } else if (isValidNumber(options?.angle)) { angle = options.angle; } else if (options?.orient === 'anticlockwise') { - angle = Math.ceil(finalAngle / (Math.PI * 2)) * Math.PI * 2; + angle = Math.ceil(attributeAngle / (Math.PI * 2)) * Math.PI * 2; } else { - angle = Math.floor(finalAngle / (Math.PI * 2)) * Math.PI * 2; + angle = Math.floor(attributeAngle / (Math.PI * 2)) * Math.PI * 2; } return { from: { angle }, - to: { angle: finalAngle } + to: { angle: attributeAngle } }; }; diff --git a/packages/vgrammar-core/src/graph/animation/animation/scale.ts b/packages/vgrammar-core/src/graph/animation/animation/scale.ts index c5333fc8..8ea3d1e1 100644 --- a/packages/vgrammar-core/src/graph/animation/animation/scale.ts +++ b/packages/vgrammar-core/src/graph/animation/animation/scale.ts @@ -7,26 +7,26 @@ export const scaleIn: TypeAnimation = ( options: IScaleAnimationOptions, animationParameters: IAnimationParameters ) => { - const finalAttrs = element.getFinalGraphicAttributes(); + const attrs = element.getFinalAnimationAttributes(); switch (options?.direction) { case 'x': return { from: { scaleX: 0 }, - to: { scaleX: finalAttrs?.scaleX ?? 1 } + to: { scaleX: attrs?.scaleX ?? 1 } }; case 'y': return { from: { scaleY: 0 }, - to: { scaleY: finalAttrs?.scaleY ?? 1 } + to: { scaleY: attrs?.scaleY ?? 1 } }; case 'xy': default: return { from: { scaleX: 0, scaleY: 0 }, to: { - scaleX: finalAttrs?.scaleX ?? 1, - scaleY: finalAttrs?.scaleY ?? 1 + scaleX: attrs?.scaleX ?? 1, + scaleY: attrs?.scaleY ?? 1 } }; } diff --git a/packages/vgrammar-core/src/graph/animation/animator.ts b/packages/vgrammar-core/src/graph/animation/animator.ts index aecc10e1..a06ed289 100644 --- a/packages/vgrammar-core/src/graph/animation/animator.ts +++ b/packages/vgrammar-core/src/graph/animation/animator.ts @@ -21,7 +21,7 @@ Animate.mode |= AnimateMode.SET_ATTR_IMMEDIATELY; let GlobalAnimatorId = 0; const isCustomAnimateCtor = (custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor) => { - if (isNil(custom)) { + if (isNil(custom) || isNil(custom.prototype)) { return false; } return ( diff --git a/packages/vgrammar-core/src/graph/element.ts b/packages/vgrammar-core/src/graph/element.ts index 2878fb93..641515a0 100644 --- a/packages/vgrammar-core/src/graph/element.ts +++ b/packages/vgrammar-core/src/graph/element.ts @@ -734,6 +734,17 @@ export class Element implements IElement { return (this.graphicItem as any).nextAttrs; } + /** + * 在动画执行中获取图元最终的视觉通道结果 + * @param channel 视觉通道 + */ + getFinalAnimationAttribute(channel: string) { + return this.getFinalGraphicAttributes()?.[channel] ?? this.getGraphicAttribute(channel); + } + getFinalAnimationAttributes() { + return this.getFinalGraphicAttributes() ?? this.graphicItem.attribute; + } + protected setNextGraphicAttributes(attributes: { [channel: string]: any }) { (this.graphicItem as any).nextAttrs = attributes; } diff --git a/packages/vgrammar-core/src/types/element.ts b/packages/vgrammar-core/src/types/element.ts index 2b428185..959cae0e 100644 --- a/packages/vgrammar-core/src/types/element.ts +++ b/packages/vgrammar-core/src/types/element.ts @@ -151,6 +151,8 @@ export interface IElement { getFinalGraphicAttributes: () => { [key: string]: any }; getPrevGraphicAttributes: () => { [key: string]: any }; getNextGraphicAttributes: () => { [key: string]: any }; + getFinalAnimationAttribute: (channel: string) => any; + getFinalAnimationAttributes: () => { [key: string]: any }; clearChangedGraphicAttributes: () => void; clearGraphicAttributes: () => void; From a17ad17dd2fe8eef389ac315211c7ebaa7880ef3 Mon Sep 17 00:00:00 2001 From: purpose Date: Thu, 27 Jun 2024 19:15:52 +0800 Subject: [PATCH 3/3] chore: add change log --- .../fix-animation-config-update_2024-06-27-11-15.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@visactor/vgrammar-core/fix-animation-config-update_2024-06-27-11-15.json diff --git a/common/changes/@visactor/vgrammar-core/fix-animation-config-update_2024-06-27-11-15.json b/common/changes/@visactor/vgrammar-core/fix-animation-config-update_2024-06-27-11-15.json new file mode 100644 index 00000000..91764fa1 --- /dev/null +++ b/common/changes/@visactor/vgrammar-core/fix-animation-config-update_2024-06-27-11-15.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vgrammar-core", + "comment": "fix: fix the animation config update", + "type": "none" + } + ], + "packageName": "@visactor/vgrammar-core" +} \ No newline at end of file