@visactor/vrender-animate 1.0.0-alpha.1 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/custom/clip-graphic.js +1 -1
- package/cjs/custom/clip-graphic.js.map +1 -1
- package/cjs/custom/common.js +2 -0
- package/cjs/custom/common.js.map +1 -1
- package/cjs/custom/custom-animate.js +1 -1
- package/cjs/custom/custom-animate.js.map +1 -1
- package/cjs/custom/{from-to.d.ts → fromTo.d.ts} +1 -0
- package/cjs/custom/fromTo.js +44 -0
- package/cjs/custom/fromTo.js.map +1 -0
- package/cjs/custom/{group-fade.js → groupFade.js} +1 -1
- package/cjs/custom/groupFade.js.map +1 -0
- package/cjs/custom/growAngle.js +2 -0
- package/cjs/custom/growAngle.js.map +1 -1
- package/cjs/custom/growCenter.js +2 -0
- package/cjs/custom/growCenter.js.map +1 -1
- package/cjs/custom/growHeight.js +2 -0
- package/cjs/custom/growHeight.js.map +1 -1
- package/cjs/custom/growPoints.js +6 -6
- package/cjs/custom/growPoints.js.map +1 -1
- package/cjs/custom/growRadius.js +2 -0
- package/cjs/custom/growRadius.js.map +1 -1
- package/cjs/custom/growWidth.js +2 -0
- package/cjs/custom/growWidth.js.map +1 -1
- package/cjs/custom/label-item-animate.js +2 -0
- package/cjs/custom/label-item-animate.js.map +1 -1
- package/cjs/custom/motionPath.d.ts +21 -0
- package/cjs/custom/motionPath.js +31 -0
- package/cjs/custom/motionPath.js.map +1 -0
- package/cjs/custom/move.js +2 -0
- package/cjs/custom/move.js.map +1 -1
- package/cjs/custom/poptip-animate.js +2 -0
- package/cjs/custom/poptip-animate.js.map +1 -1
- package/cjs/custom/register.d.ts +27 -0
- package/cjs/custom/register.js +376 -4
- package/cjs/custom/register.js.map +1 -1
- package/cjs/custom/richtext/input-richtext.js +2 -1
- package/cjs/custom/rotate.js +2 -0
- package/cjs/custom/rotate.js.map +1 -1
- package/cjs/custom/scale.js +3 -2
- package/cjs/custom/scale.js.map +1 -1
- package/cjs/custom/sphere.js +5 -2
- package/cjs/custom/sphere.js.map +1 -1
- package/cjs/custom/state.js +1 -1
- package/cjs/custom/state.js.map +1 -1
- package/cjs/custom/story.js +5 -0
- package/cjs/custom/story.js.map +1 -1
- package/cjs/custom/streamLight.d.ts +27 -0
- package/cjs/custom/streamLight.js +161 -0
- package/cjs/custom/streamLight.js.map +1 -0
- package/cjs/custom/tag-points.js +1 -0
- package/cjs/custom/tag-points.js.map +1 -1
- package/cjs/custom/update.js +1 -0
- package/cjs/custom/update.js.map +1 -1
- package/cjs/executor/animate-executor.js +8 -3
- package/cjs/executor/animate-executor.js.map +1 -1
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +5 -14
- package/cjs/index.js.map +1 -1
- package/cjs/step.d.ts +2 -0
- package/cjs/step.js +10 -6
- package/cjs/step.js.map +1 -1
- package/cjs/utils/easing-func.js +1 -2
- package/dist/index.es.js +359 -31
- package/es/custom/clip-graphic.js +1 -1
- package/es/custom/clip-graphic.js.map +1 -1
- package/es/custom/common.js +2 -0
- package/es/custom/common.js.map +1 -1
- package/es/custom/custom-animate.js +1 -1
- package/es/custom/custom-animate.js.map +1 -1
- package/es/custom/{from-to.d.ts → fromTo.d.ts} +1 -0
- package/es/custom/fromTo.js +36 -0
- package/es/custom/fromTo.js.map +1 -0
- package/es/custom/{group-fade.js → groupFade.js} +1 -1
- package/es/custom/groupFade.js.map +1 -0
- package/es/custom/growAngle.js +2 -0
- package/es/custom/growAngle.js.map +1 -1
- package/es/custom/growCenter.js +2 -0
- package/es/custom/growCenter.js.map +1 -1
- package/es/custom/growHeight.js +2 -0
- package/es/custom/growHeight.js.map +1 -1
- package/es/custom/growPoints.js +6 -6
- package/es/custom/growPoints.js.map +1 -1
- package/es/custom/growRadius.js +2 -0
- package/es/custom/growRadius.js.map +1 -1
- package/es/custom/growWidth.js +2 -0
- package/es/custom/growWidth.js.map +1 -1
- package/es/custom/label-item-animate.js +2 -0
- package/es/custom/label-item-animate.js.map +1 -1
- package/es/custom/motionPath.d.ts +21 -0
- package/es/custom/motionPath.js +23 -0
- package/es/custom/motionPath.js.map +1 -0
- package/es/custom/move.js +2 -0
- package/es/custom/move.js.map +1 -1
- package/es/custom/poptip-animate.js +2 -0
- package/es/custom/poptip-animate.js.map +1 -1
- package/es/custom/register.d.ts +27 -0
- package/es/custom/register.js +11 -2
- package/es/custom/register.js.map +1 -1
- package/es/custom/richtext/input-richtext.js +2 -1
- package/es/custom/rotate.js +2 -0
- package/es/custom/rotate.js.map +1 -1
- package/es/custom/scale.js +3 -2
- package/es/custom/scale.js.map +1 -1
- package/es/custom/sphere.js +5 -2
- package/es/custom/sphere.js.map +1 -1
- package/es/custom/state.js +1 -1
- package/es/custom/state.js.map +1 -1
- package/es/custom/story.js +5 -0
- package/es/custom/story.js.map +1 -1
- package/es/custom/streamLight.d.ts +27 -0
- package/es/custom/streamLight.js +157 -0
- package/es/custom/streamLight.js.map +1 -0
- package/es/custom/tag-points.js +1 -0
- package/es/custom/tag-points.js.map +1 -1
- package/es/custom/update.js +1 -0
- package/es/custom/update.js.map +1 -1
- package/es/executor/animate-executor.js +7 -3
- package/es/executor/animate-executor.js.map +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/index.js.map +1 -1
- package/es/step.d.ts +2 -0
- package/es/step.js +10 -6
- package/es/step.js.map +1 -1
- package/es/utils/easing-func.js +1 -2
- package/package.json +3 -3
- package/cjs/custom/from-to.js +0 -38
- package/cjs/custom/from-to.js.map +0 -1
- package/cjs/custom/group-fade.js.map +0 -1
- package/es/custom/from-to.js +0 -30
- package/es/custom/from-to.js.map +0 -1
- package/es/custom/group-fade.js.map +0 -1
- /package/cjs/custom/{group-fade.d.ts → groupFade.d.ts} +0 -0
- /package/es/custom/{group-fade.d.ts → groupFade.d.ts} +0 -0
package/cjs/custom/story.js
CHANGED
|
@@ -16,6 +16,7 @@ class SlideIn extends custom_animate_1.ACustomAnimate {
|
|
|
16
16
|
}
|
|
17
17
|
onBind() {
|
|
18
18
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
19
|
+
super.onBind();
|
|
19
20
|
const attrs = this.target.getFinalAttribute(), direction = (null === (_a = this.params) || void 0 === _a ? void 0 : _a.direction) || "right", distance = (null === (_b = this.params) || void 0 === _b ? void 0 : _b.distance) || 50, fromOpacity = null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromOpacity) && void 0 !== _d ? _d : 0, from = {
|
|
20
21
|
opacity: fromOpacity,
|
|
21
22
|
baseOpacity: fromOpacity
|
|
@@ -46,6 +47,7 @@ class GrowIn extends custom_animate_1.ACustomAnimate {
|
|
|
46
47
|
}
|
|
47
48
|
onBind() {
|
|
48
49
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
50
|
+
super.onBind();
|
|
49
51
|
const attrs = this.target.getFinalAttribute(), fromScale = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromScale) && void 0 !== _b ? _b : 0, direction = (null === (_c = this.params) || void 0 === _c ? void 0 : _c.direction) || "xy", fromOpacity = null !== (_e = null === (_d = this.params) || void 0 === _d ? void 0 : _d.fromOpacity) && void 0 !== _e ? _e : 0, from = {
|
|
50
52
|
opacity: fromOpacity,
|
|
51
53
|
baseOpacity: fromOpacity
|
|
@@ -75,6 +77,7 @@ class SpinIn extends custom_animate_1.ACustomAnimate {
|
|
|
75
77
|
}
|
|
76
78
|
onBind() {
|
|
77
79
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
80
|
+
super.onBind();
|
|
78
81
|
const attrs = this.target.getFinalAttribute(), fromAngle = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromAngle) && void 0 !== _b ? _b : 2 * Math.PI, fromScale = null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromScale) && void 0 !== _d ? _d : 0, fromOpacity = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.fromOpacity) && void 0 !== _f ? _f : 0, from = {
|
|
79
82
|
opacity: fromOpacity,
|
|
80
83
|
baseOpacity: fromOpacity,
|
|
@@ -110,6 +113,7 @@ class MoveScaleIn extends custom_animate_1.ACustomAnimate {
|
|
|
110
113
|
}
|
|
111
114
|
onBind() {
|
|
112
115
|
var _a, _b, _c, _d, _e, _f;
|
|
116
|
+
super.onBind();
|
|
113
117
|
const executor = new animate_executor_1.AnimateExecutor(this.target);
|
|
114
118
|
executor.execute({
|
|
115
119
|
type: "custom",
|
|
@@ -148,6 +152,7 @@ class MoveRotateIn extends custom_animate_1.ACustomAnimate {
|
|
|
148
152
|
}
|
|
149
153
|
onBind() {
|
|
150
154
|
var _a, _b, _c, _d, _e, _f;
|
|
155
|
+
super.onBind();
|
|
151
156
|
const executor = new animate_executor_1.AnimateExecutor(this.target);
|
|
152
157
|
executor.execute({
|
|
153
158
|
type: "custom",
|
package/cjs/custom/story.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/story.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAEhC,qDAAkD;AAClD,mEAA+D;AAE/D,MAAa,WAAY,SAAQ,aAAM;CAAG;AAA1C,kCAA0C;AA0B1C,MAAa,OAAQ,SAAQ,+BAAsC;IAMjE,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM;;QAEJ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAE9C,MAAM,SAAS,GAAG,CAAC,MAAA,IAAI,CAAC,MAAM,0CAAE,SAAiD,KAAI,OAAO,CAAC;QAC7F,MAAM,QAAQ,GAAG,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,QAAQ,KAAI,EAAE,CAAC;QA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AQ,CAAC,OAAO,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,gBAAgB,EAAE;gBAChB,SAAS,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,SAAS,KAAI,IAAI,CAAC,EAAE;gBAC5C,SAAS,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,SAAS,KAAI,GAAG;gBACxC,WAAW,EAAE,CAAC;gBACd,SAAS,EAAE,CAAC;aACb;YACD,QAAQ,EAAE,IAAI,CAAC,eAAe;YAC9B,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QAGH,QAAQ,CAAC,OAAO,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,QAAQ;YAChB,gBAAgB,EAAE;gBAChB,SAAS,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,cAAc,KAAI,OAAO;gBACjD,QAAQ,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,aAAa,KAAI,EAAE;gBAC1C,WAAW,EAAE,CAAC;aACf;YACD,QAAQ,EAAE,IAAI,CAAC,gBAAgB;YAC/B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,eAAe;SAC5B,CAAC,CAAC;IACL,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;IAE9D,CAAC;CACF;AAhDD,sCAgDC","file":"story.js","sourcesContent":["import { FadeIn } from './fade';\nimport type { EasingType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\nimport { AnimateExecutor } from '../executor/animate-executor';\n\nexport class StoryFadeIn extends FadeIn {}\n\n// 滑动动画的参数接口\nexport interface ISlideAnimationOptions {\n direction?: 'top' | 'bottom' | 'left' | 'right';\n distance?: number;\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n// 缩放动画的参数接口\nexport interface IGrowAnimationOptions {\n fromScale?: number;\n direction?: 'x' | 'y' | 'xy';\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n// 旋转动画的参数接口\nexport interface ISpinAnimationOptions {\n fromAngle?: number;\n fromScale?: number;\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n/**\n * 滑动入场动画,包括从上到下,从下到上,从左到右,从右到左的位置,以及透明度属性插值\n */\nexport class SlideIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: ISlideAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n // 用于入场的时候设置属性\n const attrs = this.target.getFinalAttribute();\n\n const direction = (this.params?.direction as 'top' | 'bottom' | 'left' | 'right') || 'right';\n const distance = this.params?.distance || 50;\n const fromOpacity = this.params?.fromOpacity ?? 0; // 使用透明度初始值参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: 1, baseOpacity: 1 };\n\n // 根据方向设置对应的属性\n if (direction === 'top') {\n from.y = (attrs.y ?? 0) - distance;\n to.y = attrs.y ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'bottom') {\n from.y = (attrs.y ?? 0) + distance;\n to.y = attrs.y ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'left') {\n from.x = (attrs.x ?? 0) - distance;\n to.x = attrs.x ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n } else {\n // right\n from.x = (attrs.x ?? 0) + distance;\n to.x = attrs.x ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n\n // 将初始属性应用到目标对象\n this.target.setAttributes(from as any);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 缩放入场动画,包括scaleX、scaleY属性从某个比例缩放到1,该比例可以小于1也可以大于1,以及透明度属性插值\n */\nexport class GrowIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IGrowAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n // 用于入场的时候设置属性\n const attrs = this.target.getFinalAttribute();\n\n const fromScale = this.params?.fromScale ?? 0;\n const direction = this.params?.direction || 'xy';\n const fromOpacity = this.params?.fromOpacity ?? 0; // 使用透明度初始值参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: 1, baseOpacity: 1 };\n this.propKeys = ['opacity', 'baseOpacity'];\n\n // 根据方向设置对应的缩放属性\n if (direction === 'x' || direction === 'xy') {\n from.scaleX = fromScale;\n to.scaleX = attrs.scaleX ?? 1;\n this.propKeys.push('scaleX');\n }\n\n if (direction === 'y' || direction === 'xy') {\n from.scaleY = fromScale;\n to.scaleY = attrs.scaleY ?? 1;\n this.propKeys.push('scaleY');\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n\n // 将初始属性应用到目标对象\n this.target.setAttributes(from as any);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 旋转入场动画,包括rotate属性从某个角度度旋转到0,以及缩放属性从某个比例缩放到1,该比例可以小于1也可以大于1\n */\nexport class SpinIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: ISpinAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n // 用于入场的时候设置属性\n const attrs = this.target.getFinalAttribute();\n\n const fromAngle = this.params?.fromAngle ?? Math.PI * 2; // 默认旋转一圈\n const fromScale = this.params?.fromScale ?? 0;\n const fromOpacity = this.params?.fromOpacity ?? 0; // 使用透明度初始值参数\n\n // 初始化from和to对象\n const from: Record<string, number> = {\n opacity: fromOpacity,\n baseOpacity: fromOpacity,\n angle: fromAngle,\n scaleX: fromScale,\n scaleY: fromScale\n };\n\n const to: Record<string, number> = {\n opacity: 1,\n baseOpacity: 1,\n angle: attrs.angle ?? 0,\n scaleX: attrs.scaleX ?? 1,\n scaleY: attrs.scaleY ?? 1\n };\n\n this.propKeys = ['opacity', 'baseOpacity', 'angle', 'scaleX', 'scaleY'];\n this.from = from;\n this.to = to;\n this.props = to;\n\n // 将初始属性应用到目标对象\n this.target.setAttributes(from as any);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n// 复合动画的参数接口\nexport interface IMoveScaleAnimationOptions {\n slideDirection?: 'top' | 'bottom' | 'left' | 'right';\n slideDistance?: number;\n fromScale?: number;\n scaleDirection?: 'x' | 'y' | 'xy';\n slideRatio?: number; // 滑动动画占总时长的比例,默认0.5\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n/**\n * 移动+缩放入场动画\n * 先走SlideIn,然后走GrowIn\n */\nexport class MoveScaleIn extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly slideInDuration: number;\n private readonly growInDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.slideInDuration = duration * slideRatio;\n this.growInDuration = duration * (1 - slideRatio);\n }\n\n onBind(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:滑动入场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideIn,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: this.params?.fromOpacity ?? 0\n },\n duration: this.slideInDuration,\n easing: this.easing\n });\n\n // 第二步:缩放入场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: GrowIn,\n customParameters: {\n fromScale: this.params?.fromScale || 0.5,\n direction: this.params?.scaleDirection || 'xy',\n fromOpacity: 1 // 设置初始透明度为1,使第二阶段不进行透明度插值\n },\n duration: this.growInDuration,\n easing: this.easing,\n delay: this.slideInDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n\n// 移动旋转动画的参数接口\nexport interface IMoveRotateAnimationOptions {\n slideDirection?: 'top' | 'bottom' | 'left' | 'right';\n slideDistance?: number;\n fromAngle?: number;\n fromScale?: number;\n slideRatio?: number; // 滑动动画占总时长的比例,默认0.5\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n/**\n * 移动+旋转入场动画\n * 先走SlideIn,然后走SpinIn\n */\nexport class MoveRotateIn extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly slideInDuration: number;\n private readonly spinInDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveRotateAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.slideInDuration = duration * slideRatio;\n this.spinInDuration = duration * (1 - slideRatio);\n }\n\n onBind(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:滑动入场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideIn,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: this.params?.fromOpacity ?? 0\n },\n duration: this.slideInDuration,\n easing: this.easing\n });\n\n // 第二步:旋转入场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SpinIn,\n customParameters: {\n fromAngle: this.params?.fromAngle || Math.PI,\n fromScale: this.params?.fromScale || 0.5,\n fromOpacity: 1 // 设置初始透明度为1,使第二阶段不进行透明度插值\n },\n duration: this.spinInDuration,\n easing: this.easing,\n delay: this.slideInDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n\n/**\n * 滑动出场动画,包括从当前位置滑动到指定方向,以及透明度属性插值\n */\nexport class SlideOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(\n from: null,\n to: null,\n duration: number,\n easing: EasingType,\n params?: ISlideAnimationOptions & { toOpacity?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n // 用于出场的时候设置属性\n const attrs = this.target.getAttributes();\n\n const direction = (this.params?.direction as 'top' | 'bottom' | 'left' | 'right') || 'right';\n const distance = this.params?.distance || 50;\n const fromOpacity = this.params?.fromOpacity ?? 1; // 使用透明度初始值参数\n const toOpacity = this.params?.toOpacity ?? 0; // 使用目标透明度参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: toOpacity, baseOpacity: toOpacity };\n\n // 根据方向设置对应的属性\n if (direction === 'top') {\n from.y = attrs.y ?? 0;\n to.y = (attrs.y ?? 0) - distance;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'bottom') {\n from.y = attrs.y ?? 0;\n to.y = (attrs.y ?? 0) + distance;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'left') {\n from.x = attrs.x ?? 0;\n to.x = (attrs.x ?? 0) - distance;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n } else {\n // right\n from.x = attrs.x ?? 0;\n to.x = (attrs.x ?? 0) + distance;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 缩放出场动画,包括scaleX、scaleY属性从当前比例缩放到指定比例,以及透明度属性插值\n */\nexport class GrowOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(\n from: null,\n to: null,\n duration: number,\n easing: EasingType,\n params?: IGrowAnimationOptions & { toOpacity?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n // 用于出场的时候设置属性\n const attrs = this.target.getAttributes();\n\n const toScale = this.params?.fromScale ?? 0; // 使用fromScale作为目标比例\n const direction = this.params?.direction || 'xy';\n const fromOpacity = this.params?.fromOpacity ?? 1; // 使用透明度初始值参数\n const toOpacity = this.params?.toOpacity ?? 0; // 使用目标透明度参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: toOpacity, baseOpacity: toOpacity };\n this.propKeys = ['opacity', 'baseOpacity'];\n\n // 根据方向设置对应的缩放属性\n if (direction === 'x' || direction === 'xy') {\n from.scaleX = attrs.scaleX ?? 1;\n to.scaleX = toScale;\n this.propKeys.push('scaleX');\n }\n\n if (direction === 'y' || direction === 'xy') {\n from.scaleY = attrs.scaleY ?? 1;\n to.scaleY = toScale;\n this.propKeys.push('scaleY');\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 旋转出场动画,包括rotate属性从当前角度旋转到指定角度,以及缩放属性从当前比例缩放到指定比例\n */\nexport class SpinOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(\n from: null,\n to: null,\n duration: number,\n easing: EasingType,\n params?: ISpinAnimationOptions & { toOpacity?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n // 用于出场的时候设置属性\n const attrs = this.target.getAttributes();\n\n const toAngle = this.params?.fromAngle ?? Math.PI * 2; // 默认旋转一圈\n const toScale = this.params?.fromScale ?? 0;\n const fromOpacity = this.params?.fromOpacity ?? 1; // 使用透明度初始值参数\n const toOpacity = this.params?.toOpacity ?? 0; // 使用目标透明度参数\n\n // 初始化from和to对象\n const from: Record<string, number> = {\n opacity: fromOpacity,\n baseOpacity: fromOpacity,\n angle: attrs.angle ?? 0,\n scaleX: attrs.scaleX ?? 1,\n scaleY: attrs.scaleY ?? 1\n };\n\n const to: Record<string, number> = {\n opacity: toOpacity,\n baseOpacity: toOpacity,\n angle: toAngle,\n scaleX: toScale,\n scaleY: toScale\n };\n\n this.propKeys = ['opacity', 'baseOpacity', 'angle', 'scaleX', 'scaleY'];\n this.from = from;\n this.to = to;\n this.props = to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 移动+缩放出场动画\n * 先走GrowOut,然后走SlideOut\n */\nexport class MoveScaleOut extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly growOutDuration: number;\n private readonly slideOutDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.growOutDuration = duration * (1 - slideRatio);\n this.slideOutDuration = duration * slideRatio;\n }\n\n onFirstRun(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:缩放出场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: GrowOut,\n customParameters: {\n fromScale: this.params?.fromScale || 0.5,\n direction: this.params?.scaleDirection || 'xy',\n fromOpacity: 1, // 保持透明度为1,不做变化\n toOpacity: 1 // 确保第一阶段不改变透明度\n },\n duration: this.growOutDuration,\n easing: this.easing\n });\n\n // 第二步:滑动出场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideOut,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: 1 // 起始透明度为1\n },\n duration: this.slideOutDuration,\n easing: this.easing,\n delay: this.growOutDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n\n/**\n * 移动+旋转出场动画\n * 先走SpinOut,然后走SlideOut\n */\nexport class MoveRotateOut extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly spinOutDuration: number;\n private readonly slideOutDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveRotateAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.spinOutDuration = duration * (1 - slideRatio);\n this.slideOutDuration = duration * slideRatio;\n }\n\n onFirstRun(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:旋转出场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SpinOut,\n customParameters: {\n fromAngle: this.params?.fromAngle || Math.PI,\n fromScale: this.params?.fromScale || 0.5,\n fromOpacity: 1, // 保持透明度为1,不做变化\n toOpacity: 1 // 确保第一阶段不改变透明度\n },\n duration: this.spinOutDuration,\n easing: this.easing\n });\n\n // 第二步:滑动出场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideOut,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: 1 // 起始透明度为1\n },\n duration: this.slideOutDuration,\n easing: this.easing,\n delay: this.spinOutDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/custom/story.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAEhC,qDAAkD;AAClD,mEAA+D;AAE/D,MAAa,WAAY,SAAQ,aAAM;CAAG;AAA1C,kCAA0C;AA0B1C,MAAa,OAAQ,SAAQ,+BAAsC;IAMjE,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM;;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QAEf,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAE9C,MAAM,SAAS,GAAG,CAAC,MAAA,IAAI,CAAC,MAAM,0CAAE,SAAiD,KAAI,OAAO,CAAC;QAC7F,M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e,GAAG,QAAQ,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;QACnD,IAAI,CAAC,gBAAgB,GAAG,QAAQ,GAAG,UAAU,CAAC;IAChD,CAAC;IAED,UAAU;;QAER,MAAM,QAAQ,GAAG,IAAI,kCAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAGlD,QAAQ,CAAC,OAAO,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,gBAAgB,EAAE;gBAChB,SAAS,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,SAAS,KAAI,IAAI,CAAC,EAAE;gBAC5C,SAAS,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,SAAS,KAAI,GAAG;gBACxC,WAAW,EAAE,CAAC;gBACd,SAAS,EAAE,CAAC;aACb;YACD,QAAQ,EAAE,IAAI,CAAC,eAAe;YAC9B,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QAGH,QAAQ,CAAC,OAAO,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,QAAQ;YAChB,gBAAgB,EAAE;gBAChB,SAAS,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,cAAc,KAAI,OAAO;gBACjD,QAAQ,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,aAAa,KAAI,EAAE;gBAC1C,WAAW,EAAE,CAAC;aACf;YACD,QAAQ,EAAE,IAAI,CAAC,gBAAgB;YAC/B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,eAAe;SAC5B,CAAC,CAAC;IACL,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;IAE9D,CAAC;CACF;AAhDD,sCAgDC","file":"story.js","sourcesContent":["import { FadeIn } from './fade';\nimport type { EasingType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\nimport { AnimateExecutor } from '../executor/animate-executor';\n\nexport class StoryFadeIn extends FadeIn {}\n\n// 滑动动画的参数接口\nexport interface ISlideAnimationOptions {\n direction?: 'top' | 'bottom' | 'left' | 'right';\n distance?: number;\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n// 缩放动画的参数接口\nexport interface IGrowAnimationOptions {\n fromScale?: number;\n direction?: 'x' | 'y' | 'xy';\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n// 旋转动画的参数接口\nexport interface ISpinAnimationOptions {\n fromAngle?: number;\n fromScale?: number;\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n/**\n * 滑动入场动画,包括从上到下,从下到上,从左到右,从右到左的位置,以及透明度属性插值\n */\nexport class SlideIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: ISlideAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n super.onBind();\n // 用于入场的时候设置属性\n const attrs = this.target.getFinalAttribute();\n\n const direction = (this.params?.direction as 'top' | 'bottom' | 'left' | 'right') || 'right';\n const distance = this.params?.distance || 50;\n const fromOpacity = this.params?.fromOpacity ?? 0; // 使用透明度初始值参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: 1, baseOpacity: 1 };\n\n // 根据方向设置对应的属性\n if (direction === 'top') {\n from.y = (attrs.y ?? 0) - distance;\n to.y = attrs.y ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'bottom') {\n from.y = (attrs.y ?? 0) + distance;\n to.y = attrs.y ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'left') {\n from.x = (attrs.x ?? 0) - distance;\n to.x = attrs.x ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n } else {\n // right\n from.x = (attrs.x ?? 0) + distance;\n to.x = attrs.x ?? 0;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n\n // 将初始属性应用到目标对象\n this.target.setAttributes(from as any);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 缩放入场动画,包括scaleX、scaleY属性从某个比例缩放到1,该比例可以小于1也可以大于1,以及透明度属性插值\n */\nexport class GrowIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IGrowAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n super.onBind();\n // 用于入场的时候设置属性\n const attrs = this.target.getFinalAttribute();\n\n const fromScale = this.params?.fromScale ?? 0;\n const direction = this.params?.direction || 'xy';\n const fromOpacity = this.params?.fromOpacity ?? 0; // 使用透明度初始值参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: 1, baseOpacity: 1 };\n this.propKeys = ['opacity', 'baseOpacity'];\n\n // 根据方向设置对应的缩放属性\n if (direction === 'x' || direction === 'xy') {\n from.scaleX = fromScale;\n to.scaleX = attrs.scaleX ?? 1;\n this.propKeys.push('scaleX');\n }\n\n if (direction === 'y' || direction === 'xy') {\n from.scaleY = fromScale;\n to.scaleY = attrs.scaleY ?? 1;\n this.propKeys.push('scaleY');\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n\n // 将初始属性应用到目标对象\n this.target.setAttributes(from as any);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 旋转入场动画,包括rotate属性从某个角度度旋转到0,以及缩放属性从某个比例缩放到1,该比例可以小于1也可以大于1\n */\nexport class SpinIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: ISpinAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n super.onBind();\n // 用于入场的时候设置属性\n const attrs = this.target.getFinalAttribute();\n\n const fromAngle = this.params?.fromAngle ?? Math.PI * 2; // 默认旋转一圈\n const fromScale = this.params?.fromScale ?? 0;\n const fromOpacity = this.params?.fromOpacity ?? 0; // 使用透明度初始值参数\n\n // 初始化from和to对象\n const from: Record<string, number> = {\n opacity: fromOpacity,\n baseOpacity: fromOpacity,\n angle: fromAngle,\n scaleX: fromScale,\n scaleY: fromScale\n };\n\n const to: Record<string, number> = {\n opacity: 1,\n baseOpacity: 1,\n angle: attrs.angle ?? 0,\n scaleX: attrs.scaleX ?? 1,\n scaleY: attrs.scaleY ?? 1\n };\n\n this.propKeys = ['opacity', 'baseOpacity', 'angle', 'scaleX', 'scaleY'];\n this.from = from;\n this.to = to;\n this.props = to;\n\n // 将初始属性应用到目标对象\n this.target.setAttributes(from as any);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n// 复合动画的参数接口\nexport interface IMoveScaleAnimationOptions {\n slideDirection?: 'top' | 'bottom' | 'left' | 'right';\n slideDistance?: number;\n fromScale?: number;\n scaleDirection?: 'x' | 'y' | 'xy';\n slideRatio?: number; // 滑动动画占总时长的比例,默认0.5\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n/**\n * 移动+缩放入场动画\n * 先走SlideIn,然后走GrowIn\n */\nexport class MoveScaleIn extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly slideInDuration: number;\n private readonly growInDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.slideInDuration = duration * slideRatio;\n this.growInDuration = duration * (1 - slideRatio);\n }\n\n onBind(): void {\n super.onBind();\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:滑动入场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideIn,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: this.params?.fromOpacity ?? 0\n },\n duration: this.slideInDuration,\n easing: this.easing\n });\n\n // 第二步:缩放入场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: GrowIn,\n customParameters: {\n fromScale: this.params?.fromScale || 0.5,\n direction: this.params?.scaleDirection || 'xy',\n fromOpacity: 1 // 设置初始透明度为1,使第二阶段不进行透明度插值\n },\n duration: this.growInDuration,\n easing: this.easing,\n delay: this.slideInDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n\n// 移动旋转动画的参数接口\nexport interface IMoveRotateAnimationOptions {\n slideDirection?: 'top' | 'bottom' | 'left' | 'right';\n slideDistance?: number;\n fromAngle?: number;\n fromScale?: number;\n slideRatio?: number; // 滑动动画占总时长的比例,默认0.5\n fromOpacity?: number; // 透明度初始值,默认0\n}\n\n/**\n * 移动+旋转入场动画\n * 先走SlideIn,然后走SpinIn\n */\nexport class MoveRotateIn extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly slideInDuration: number;\n private readonly spinInDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveRotateAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.slideInDuration = duration * slideRatio;\n this.spinInDuration = duration * (1 - slideRatio);\n }\n\n onBind(): void {\n super.onBind();\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:滑动入场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideIn,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: this.params?.fromOpacity ?? 0\n },\n duration: this.slideInDuration,\n easing: this.easing\n });\n\n // 第二步:旋转入场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SpinIn,\n customParameters: {\n fromAngle: this.params?.fromAngle || Math.PI,\n fromScale: this.params?.fromScale || 0.5,\n fromOpacity: 1 // 设置初始透明度为1,使第二阶段不进行透明度插值\n },\n duration: this.spinInDuration,\n easing: this.easing,\n delay: this.slideInDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n\n/**\n * 滑动出场动画,包括从当前位置滑动到指定方向,以及透明度属性插值\n */\nexport class SlideOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(\n from: null,\n to: null,\n duration: number,\n easing: EasingType,\n params?: ISlideAnimationOptions & { toOpacity?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n // 用于出场的时候设置属性\n const attrs = this.target.getAttributes();\n\n const direction = (this.params?.direction as 'top' | 'bottom' | 'left' | 'right') || 'right';\n const distance = this.params?.distance || 50;\n const fromOpacity = this.params?.fromOpacity ?? 1; // 使用透明度初始值参数\n const toOpacity = this.params?.toOpacity ?? 0; // 使用目标透明度参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: toOpacity, baseOpacity: toOpacity };\n\n // 根据方向设置对应的属性\n if (direction === 'top') {\n from.y = attrs.y ?? 0;\n to.y = (attrs.y ?? 0) - distance;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'bottom') {\n from.y = attrs.y ?? 0;\n to.y = (attrs.y ?? 0) + distance;\n this.propKeys = ['opacity', 'baseOpacity', 'y'];\n } else if (direction === 'left') {\n from.x = attrs.x ?? 0;\n to.x = (attrs.x ?? 0) - distance;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n } else {\n // right\n from.x = attrs.x ?? 0;\n to.x = (attrs.x ?? 0) + distance;\n this.propKeys = ['opacity', 'baseOpacity', 'x'];\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 缩放出场动画,包括scaleX、scaleY属性从当前比例缩放到指定比例,以及透明度属性插值\n */\nexport class GrowOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(\n from: null,\n to: null,\n duration: number,\n easing: EasingType,\n params?: IGrowAnimationOptions & { toOpacity?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n // 用于出场的时候设置属性\n const attrs = this.target.getAttributes();\n\n const toScale = this.params?.fromScale ?? 0; // 使用fromScale作为目标比例\n const direction = this.params?.direction || 'xy';\n const fromOpacity = this.params?.fromOpacity ?? 1; // 使用透明度初始值参数\n const toOpacity = this.params?.toOpacity ?? 0; // 使用目标透明度参数\n\n // 初始化from和to对象\n const from: Record<string, number> = { opacity: fromOpacity, baseOpacity: fromOpacity };\n const to: Record<string, number> = { opacity: toOpacity, baseOpacity: toOpacity };\n this.propKeys = ['opacity', 'baseOpacity'];\n\n // 根据方向设置对应的缩放属性\n if (direction === 'x' || direction === 'xy') {\n from.scaleX = attrs.scaleX ?? 1;\n to.scaleX = toScale;\n this.propKeys.push('scaleX');\n }\n\n if (direction === 'y' || direction === 'xy') {\n from.scaleY = attrs.scaleY ?? 1;\n to.scaleY = toScale;\n this.propKeys.push('scaleY');\n }\n\n this.from = from;\n this.to = to;\n this.props = to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 旋转出场动画,包括rotate属性从当前角度旋转到指定角度,以及缩放属性从当前比例缩放到指定比例\n */\nexport class SpinOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n declare propKeys: string[];\n declare from: Record<string, number>;\n declare to: Record<string, number>;\n\n constructor(\n from: null,\n to: null,\n duration: number,\n easing: EasingType,\n params?: ISpinAnimationOptions & { toOpacity?: number }\n ) {\n super(from, to, duration, easing, params);\n }\n\n onFirstRun(): void {\n // 用于出场的时候设置属性\n const attrs = this.target.getAttributes();\n\n const toAngle = this.params?.fromAngle ?? Math.PI * 2; // 默认旋转一圈\n const toScale = this.params?.fromScale ?? 0;\n const fromOpacity = this.params?.fromOpacity ?? 1; // 使用透明度初始值参数\n const toOpacity = this.params?.toOpacity ?? 0; // 使用目标透明度参数\n\n // 初始化from和to对象\n const from: Record<string, number> = {\n opacity: fromOpacity,\n baseOpacity: fromOpacity,\n angle: attrs.angle ?? 0,\n scaleX: attrs.scaleX ?? 1,\n scaleY: attrs.scaleY ?? 1\n };\n\n const to: Record<string, number> = {\n opacity: toOpacity,\n baseOpacity: toOpacity,\n angle: toAngle,\n scaleX: toScale,\n scaleY: toScale\n };\n\n this.propKeys = ['opacity', 'baseOpacity', 'angle', 'scaleX', 'scaleY'];\n this.from = from;\n this.to = to;\n this.props = to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 移动+缩放出场动画\n * 先走GrowOut,然后走SlideOut\n */\nexport class MoveScaleOut extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly growOutDuration: number;\n private readonly slideOutDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.growOutDuration = duration * (1 - slideRatio);\n this.slideOutDuration = duration * slideRatio;\n }\n\n onFirstRun(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:缩放出场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: GrowOut,\n customParameters: {\n fromScale: this.params?.fromScale || 0.5,\n direction: this.params?.scaleDirection || 'xy',\n fromOpacity: 1, // 保持透明度为1,不做变化\n toOpacity: 1 // 确保第一阶段不改变透明度\n },\n duration: this.growOutDuration,\n easing: this.easing\n });\n\n // 第二步:滑动出场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideOut,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: 1 // 起始透明度为1\n },\n duration: this.slideOutDuration,\n easing: this.easing,\n delay: this.growOutDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n\n/**\n * 移动+旋转出场动画\n * 先走SpinOut,然后走SlideOut\n */\nexport class MoveRotateOut extends ACustomAnimate<any> {\n declare valid: boolean;\n private readonly spinOutDuration: number;\n private readonly slideOutDuration: number;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IMoveRotateAnimationOptions) {\n super(from, to, duration, easing, params);\n const slideRatio = params?.slideRatio ?? 0.5;\n this.spinOutDuration = duration * (1 - slideRatio);\n this.slideOutDuration = duration * slideRatio;\n }\n\n onFirstRun(): void {\n // 创建AnimateExecutor来运行序列动画\n const executor = new AnimateExecutor(this.target);\n\n // 第一步:旋转出场(不包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SpinOut,\n customParameters: {\n fromAngle: this.params?.fromAngle || Math.PI,\n fromScale: this.params?.fromScale || 0.5,\n fromOpacity: 1, // 保持透明度为1,不做变化\n toOpacity: 1 // 确保第一阶段不改变透明度\n },\n duration: this.spinOutDuration,\n easing: this.easing\n });\n\n // 第二步:滑动出场(包含透明度变化)\n executor.execute({\n type: 'custom',\n custom: SlideOut,\n customParameters: {\n direction: this.params?.slideDirection || 'right',\n distance: this.params?.slideDistance || 50,\n fromOpacity: 1 // 起始透明度为1\n },\n duration: this.slideOutDuration,\n easing: this.easing,\n delay: this.spinOutDuration // 等第一步完成后再开始\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // 动画逻辑由子动画处理\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { EasingType, IArea, ICurve, ICustomPath2D, IGraphic, ILine, ILineAttribute, IRect, IRectAttribute } from '@visactor/vrender-core';
|
|
2
|
+
import { ACustomAnimate } from './custom-animate';
|
|
3
|
+
import type { IPoint } from '@visactor/vutils';
|
|
4
|
+
export declare class StreamLight extends ACustomAnimate<any> {
|
|
5
|
+
valid: boolean;
|
|
6
|
+
target: IGraphic;
|
|
7
|
+
rect: IRect;
|
|
8
|
+
line: ILine;
|
|
9
|
+
area: IArea;
|
|
10
|
+
constructor(from: any, to: any, duration: number, easing: EasingType, params?: {
|
|
11
|
+
attribute?: Partial<IRectAttribute | ILineAttribute>;
|
|
12
|
+
streamLength?: number;
|
|
13
|
+
isHorizontal?: boolean;
|
|
14
|
+
});
|
|
15
|
+
getEndProps(): Record<string, any>;
|
|
16
|
+
onStart(): void;
|
|
17
|
+
onStartLineOrArea(type: 'line' | 'area'): void;
|
|
18
|
+
onStartRect(): void;
|
|
19
|
+
onBind(): void;
|
|
20
|
+
onEnd(): void;
|
|
21
|
+
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
22
|
+
protected onUpdateRect(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
23
|
+
protected onUpdateLineOrArea(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
24
|
+
protected _onUpdateLineOrAreaWithCache(customPath: ICustomPath2D, g: ILine | IArea, end: boolean, ratio: number, out: Record<string, any>): void;
|
|
25
|
+
protected _updateCurves(customPath: ICustomPath2D, curves: ICurve<IPoint>[], totalLen: number, ratio: number): void;
|
|
26
|
+
protected _onUpdateLineWithoutCache(customPath: ICustomPath2D, line: ILine, end: boolean, ratio: number, out: Record<string, any>): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.StreamLight = void 0;
|
|
6
|
+
|
|
7
|
+
const vrender_core_1 = require("@visactor/vrender-core"), custom_animate_1 = require("./custom-animate"), vutils_1 = require("@visactor/vutils");
|
|
8
|
+
|
|
9
|
+
class StreamLight extends custom_animate_1.ACustomAnimate {
|
|
10
|
+
constructor(from, to, duration, easing, params) {
|
|
11
|
+
super(from, to, duration, easing, params);
|
|
12
|
+
}
|
|
13
|
+
getEndProps() {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
onStart() {
|
|
17
|
+
this.target && ("rect" === this.target.type ? this.onStartRect() : "line" === this.target.type ? this.onStartLineOrArea("line") : "area" === this.target.type && this.onStartLineOrArea("area"));
|
|
18
|
+
}
|
|
19
|
+
onStartLineOrArea(type) {
|
|
20
|
+
var _a;
|
|
21
|
+
const root = this.target.attachShadow(), line = vrender_core_1.application.graphicService.creator[type](Object.assign({}, null === (_a = this.params) || void 0 === _a ? void 0 : _a.attribute));
|
|
22
|
+
this[type] = line, line.pathProxy = new vrender_core_1.CustomPath2D, root.add(line);
|
|
23
|
+
}
|
|
24
|
+
onStartRect() {
|
|
25
|
+
var _a, _b, _c;
|
|
26
|
+
const root = this.target.attachShadow(), isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b, sizeAttr = isHorizontal ? "height" : "width", otherSizeAttr = isHorizontal ? "width" : "height", size = this.target.AABBBounds[sizeAttr](), y = isHorizontal ? 0 : this.target.AABBBounds.y1, rect = vrender_core_1.application.graphicService.creator.rect(Object.assign(Object.assign({
|
|
27
|
+
[sizeAttr]: size,
|
|
28
|
+
fill: "#bcdeff",
|
|
29
|
+
shadowBlur: 30,
|
|
30
|
+
shadowColor: "#bcdeff"
|
|
31
|
+
}, null === (_c = this.params) || void 0 === _c ? void 0 : _c.attribute), {
|
|
32
|
+
x: 0,
|
|
33
|
+
y: y,
|
|
34
|
+
[otherSizeAttr]: 0
|
|
35
|
+
}));
|
|
36
|
+
this.rect = rect, root.add(rect);
|
|
37
|
+
}
|
|
38
|
+
onBind() {}
|
|
39
|
+
onEnd() {
|
|
40
|
+
this.target.detachShadow();
|
|
41
|
+
}
|
|
42
|
+
onUpdate(end, ratio, out) {
|
|
43
|
+
return this.rect ? this.onUpdateRect(end, ratio, out) : this.line || this.area ? this.onUpdateLineOrArea(end, ratio, out) : void 0;
|
|
44
|
+
}
|
|
45
|
+
onUpdateRect(end, ratio, out) {
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
47
|
+
const isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b, parentAttr = this.target.attribute;
|
|
48
|
+
if (isHorizontal) {
|
|
49
|
+
const parentWidth = null !== (_d = null !== (_c = parentAttr.width) && void 0 !== _c ? _c : Math.abs(parentAttr.x1 - parentAttr.x)) && void 0 !== _d ? _d : 250, streamLength = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.streamLength) && void 0 !== _f ? _f : parentWidth, maxLength = null !== (_j = null === (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.attribute) || void 0 === _h ? void 0 : _h.width) && void 0 !== _j ? _j : 60, startX = -maxLength, currentX = startX + (streamLength - startX) * ratio, x = Math.max(currentX, 0), w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX), width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
|
|
50
|
+
this.rect.setAttributes({
|
|
51
|
+
x: x,
|
|
52
|
+
width: width,
|
|
53
|
+
dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
|
|
54
|
+
}, !1, {
|
|
55
|
+
type: vrender_core_1.AttributeUpdateType.ANIMATE_PLAY,
|
|
56
|
+
animationState: {
|
|
57
|
+
ratio: ratio,
|
|
58
|
+
end: end
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
} else {
|
|
62
|
+
const parentHeight = null !== (_l = null !== (_k = parentAttr.height) && void 0 !== _k ? _k : Math.abs(parentAttr.y1 - parentAttr.y)) && void 0 !== _l ? _l : 250, streamLength = null !== (_o = null === (_m = this.params) || void 0 === _m ? void 0 : _m.streamLength) && void 0 !== _o ? _o : parentHeight, maxLength = null !== (_r = null === (_q = null === (_p = this.params) || void 0 === _p ? void 0 : _p.attribute) || void 0 === _q ? void 0 : _q.height) && void 0 !== _r ? _r : 60, currentY = parentHeight - (streamLength + maxLength) * ratio;
|
|
63
|
+
let y = Math.min(currentY, parentHeight);
|
|
64
|
+
const h = Math.min(parentHeight - currentY, maxLength);
|
|
65
|
+
let height;
|
|
66
|
+
y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
|
|
67
|
+
y: y,
|
|
68
|
+
height: height,
|
|
69
|
+
dy: Math.min(parentAttr.y1 - parentAttr.y, 0)
|
|
70
|
+
}, !1, {
|
|
71
|
+
type: vrender_core_1.AttributeUpdateType.ANIMATE_PLAY,
|
|
72
|
+
animationState: {
|
|
73
|
+
ratio: ratio,
|
|
74
|
+
end: end
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
onUpdateLineOrArea(end, ratio, out) {
|
|
80
|
+
const target = this.line || this.area;
|
|
81
|
+
if (!target) return;
|
|
82
|
+
const customPath = target.pathProxy, targetLine = this.target;
|
|
83
|
+
targetLine.cache || targetLine.cacheArea ? this._onUpdateLineOrAreaWithCache(customPath, targetLine, end, ratio, out) : this._onUpdateLineWithoutCache(customPath, targetLine, end, ratio, out);
|
|
84
|
+
const targetAttrs = targetLine.attribute;
|
|
85
|
+
target.setAttributes(Object.assign({
|
|
86
|
+
stroke: targetAttrs.stroke
|
|
87
|
+
}, target.attribute)), target.addUpdateBoundTag();
|
|
88
|
+
}
|
|
89
|
+
_onUpdateLineOrAreaWithCache(customPath, g, end, ratio, out) {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
if (customPath.clear(), "line" === g.type) {
|
|
92
|
+
let cache = g.cache;
|
|
93
|
+
Array.isArray(cache) || (cache = [ cache ]);
|
|
94
|
+
const totalLen = cache.reduce(((l, c) => l + c.getLength()), 0), curves = [];
|
|
95
|
+
return cache.forEach((c => {
|
|
96
|
+
c.curves.forEach((ci => curves.push(ci)));
|
|
97
|
+
})), this._updateCurves(customPath, curves, totalLen, ratio);
|
|
98
|
+
}
|
|
99
|
+
if ("area" === g.type && (null === (_b = null === (_a = g.cacheArea) || void 0 === _a ? void 0 : _a.top) || void 0 === _b ? void 0 : _b.curves)) {
|
|
100
|
+
const cache = g.cacheArea, totalLen = cache.top.curves.reduce(((a, b) => a + b.getLength()), 0);
|
|
101
|
+
return this._updateCurves(customPath, cache.top.curves, totalLen, ratio);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
_updateCurves(customPath, curves, totalLen, ratio) {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
const startLen = totalLen * ratio, endLen = Math.min(startLen + (null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.streamLength) && void 0 !== _b ? _b : 10), totalLen);
|
|
107
|
+
let lastLen = 0, start = !1;
|
|
108
|
+
for (let i = 0; i < curves.length; i++) if (!1 !== curves[i].defined) {
|
|
109
|
+
const curveItem = curves[i], len = curveItem.getLength(), startPercent = 1 - (lastLen + len - startLen) / len;
|
|
110
|
+
let curveForStart, endPercent = 1 - (lastLen + len - endLen) / len;
|
|
111
|
+
if (lastLen < startLen && lastLen + len > startLen) if (start = !0, curveItem.p2 && curveItem.p3) {
|
|
112
|
+
const [_, curve2] = (0, vrender_core_1.divideCubic)(curveItem, startPercent);
|
|
113
|
+
customPath.moveTo(curve2.p0.x, curve2.p0.y), curveForStart = curve2;
|
|
114
|
+
} else {
|
|
115
|
+
const p = curveItem.getPointAt(startPercent);
|
|
116
|
+
customPath.moveTo(p.x, p.y);
|
|
117
|
+
}
|
|
118
|
+
if (lastLen < endLen && lastLen + len > endLen) {
|
|
119
|
+
if (curveItem.p2 && curveItem.p3) {
|
|
120
|
+
curveForStart && (endPercent = (endLen - startLen) / curveForStart.getLength());
|
|
121
|
+
const [curve1] = (0, vrender_core_1.divideCubic)(curveForStart || curveItem, endPercent);
|
|
122
|
+
customPath.bezierCurveTo(curve1.p1.x, curve1.p1.y, curve1.p2.x, curve1.p2.y, curve1.p3.x, curve1.p3.y);
|
|
123
|
+
} else {
|
|
124
|
+
const p = curveItem.getPointAt(endPercent);
|
|
125
|
+
customPath.lineTo(p.x, p.y);
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
if (start) if (curveItem.p2 && curveItem.p3) {
|
|
130
|
+
const curve = curveForStart || curveItem;
|
|
131
|
+
customPath.bezierCurveTo(curve.p1.x, curve.p1.y, curve.p2.x, curve.p2.y, curve.p3.x, curve.p3.y);
|
|
132
|
+
} else customPath.lineTo(curveItem.p1.x, curveItem.p1.y);
|
|
133
|
+
lastLen += len;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
_onUpdateLineWithoutCache(customPath, line, end, ratio, out) {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
const {points: points, curveType: curveType} = line.attribute;
|
|
139
|
+
if (!points || points.length < 2 || "linear" !== curveType) return;
|
|
140
|
+
let totalLen = 0;
|
|
141
|
+
for (let i = 1; i < points.length; i++) totalLen += vutils_1.PointService.distancePP(points[i], points[i - 1]);
|
|
142
|
+
const startLen = totalLen * ratio, endLen = Math.min(startLen + (null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.streamLength) && void 0 !== _b ? _b : 10), totalLen), nextPoints = [];
|
|
143
|
+
let lastLen = 0;
|
|
144
|
+
for (let i = 1; i < points.length; i++) {
|
|
145
|
+
const len = vutils_1.PointService.distancePP(points[i], points[i - 1]);
|
|
146
|
+
if (lastLen < startLen && lastLen + len > startLen && nextPoints.push(vutils_1.PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - startLen) / len)),
|
|
147
|
+
lastLen < endLen && lastLen + len > endLen) {
|
|
148
|
+
nextPoints.push(vutils_1.PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - endLen) / len));
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
nextPoints.length && nextPoints.push(points[i]), lastLen += len;
|
|
152
|
+
}
|
|
153
|
+
if (nextPoints.length && !(nextPoints.length < 2)) {
|
|
154
|
+
customPath.clear(), customPath.moveTo(nextPoints[0].x, nextPoints[0].y);
|
|
155
|
+
for (let i = 1; i < nextPoints.length; i++) customPath.lineTo(nextPoints[i].x, nextPoints[i].y);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
exports.StreamLight = StreamLight;
|
|
161
|
+
//# sourceMappingURL=streamLight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/custom/streamLight.ts"],"names":[],"mappings":";;;AAaA,yDAAqG;AACrG,qDAAkD;AAElD,6CAAgD;AAEhD,MAAa,WAAY,SAAQ,+BAAmB;IAOlD,YACE,IAAS,EACT,EAAO,EACP,QAAgB,EAChB,MAAkB,EAClB,MAAgH;QAEhH,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,WAAW;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,OAAO;SACR;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE;YAC/B,IAAI,CAAC,WAAW,EAAE,CAAC;SACpB;aAAM,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE;YACtC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;SAChC;aAAM,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE;YACtC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;SAChC;IACH,CAAC;IAED,iBAAiB,CAAC,IAAqB;;QACrC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QACxC,MAAM,IAAI,GAAG,0BAAW,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,mBAChD,MAAA,IAAI,CAAC,MAAM,0CAAE,SAAS,EACzB,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,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EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACrD;IACH,CAAC;CACF;AAtSD,kCAsSC","file":"streamLight.js","sourcesContent":["import type {\n EasingType,\n IArea,\n IAreaCacheItem,\n ICubicBezierCurve,\n ICurve,\n ICustomPath2D,\n IGraphic,\n ILine,\n ILineAttribute,\n IRect,\n IRectAttribute\n} from '@visactor/vrender-core';\nimport { application, AttributeUpdateType, CustomPath2D, divideCubic } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\nimport type { IPoint } from '@visactor/vutils';\nimport { PointService } from '@visactor/vutils';\n\nexport class StreamLight extends ACustomAnimate<any> {\n declare valid: boolean;\n declare target: IGraphic;\n\n declare rect: IRect;\n declare line: ILine;\n declare area: IArea;\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { attribute?: Partial<IRectAttribute | ILineAttribute>; streamLength?: number; isHorizontal?: boolean }\n ) {\n super(from, to, duration, easing, params);\n }\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onStart(): void {\n if (!this.target) {\n return;\n }\n if (this.target.type === 'rect') {\n this.onStartRect();\n } else if (this.target.type === 'line') {\n this.onStartLineOrArea('line');\n } else if (this.target.type === 'area') {\n this.onStartLineOrArea('area');\n }\n }\n\n onStartLineOrArea(type: 'line' | 'area') {\n const root = this.target.attachShadow();\n const line = application.graphicService.creator[type]({\n ...this.params?.attribute\n });\n this[type] = line;\n line.pathProxy = new CustomPath2D();\n root.add(line);\n }\n\n onStartRect(): void {\n const root = this.target.attachShadow();\n\n const isHorizontal = this.params?.isHorizontal ?? true;\n const sizeAttr = isHorizontal ? 'height' : 'width';\n const otherSizeAttr = isHorizontal ? 'width' : 'height';\n const size = this.target.AABBBounds[sizeAttr]();\n const y = isHorizontal ? 0 : this.target.AABBBounds.y1;\n\n const rect = application.graphicService.creator.rect({\n [sizeAttr]: size,\n fill: '#bcdeff',\n shadowBlur: 30,\n shadowColor: '#bcdeff',\n ...this.params?.attribute,\n x: 0,\n y,\n [otherSizeAttr]: 0\n });\n this.rect = rect;\n root.add(rect);\n }\n\n onBind(): void {\n return;\n }\n\n onEnd(): void {\n this.target.detachShadow();\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.rect) {\n return this.onUpdateRect(end, ratio, out);\n } else if (this.line || this.area) {\n return this.onUpdateLineOrArea(end, ratio, out);\n }\n }\n\n protected onUpdateRect(end: boolean, ratio: number, out: Record<string, any>): void {\n const isHorizontal = this.params?.isHorizontal ?? true;\n const parentAttr = (this.target as any).attribute;\n if (isHorizontal) {\n const parentWidth = parentAttr.width ?? Math.abs(parentAttr.x1 - parentAttr.x) ?? 250;\n const streamLength = this.params?.streamLength ?? parentWidth;\n const maxLength = this.params?.attribute?.width ?? 60;\n // 起点,rect x右端点 对齐 parent左端点\n // 如果parent.x1 < parent.x, 需要把rect属性移到parent x1的位置上, 因为初始 rect.x = parent.x\n const startX = -maxLength;\n // 插值\n const currentX = startX + (streamLength - startX) * ratio;\n // 位置限定 > 0\n const x = Math.max(currentX, 0);\n // 宽度计算\n const w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX);\n // 如果 rect右端点 超出 parent右端点, 宽度动态调整\n const width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;\n this.rect.setAttributes(\n {\n x,\n width,\n dx: Math.min(parentAttr.x1 - parentAttr.x, 0)\n } as any,\n false,\n {\n type: AttributeUpdateType.ANIMATE_PLAY,\n animationState: {\n ratio,\n end\n }\n }\n );\n } else {\n const parentHeight = parentAttr.height ?? Math.abs(parentAttr.y1 - parentAttr.y) ?? 250;\n const streamLength = this.params?.streamLength ?? parentHeight;\n const maxLength = this.params?.attribute?.height ?? 60;\n // 起点,y上端点 对齐 parent下端点\n const startY = parentHeight;\n // 插值\n const currentY = startY - (streamLength + maxLength) * ratio;\n // 位置限定 < parentHeight\n let y = Math.min(currentY, parentHeight);\n // 高度最小值\n const h = Math.min(parentHeight - currentY, maxLength);\n // 如果 rect上端点=y 超出 parent上端点 = 0, 则高度不断变小\n let height;\n if (y <= 0) {\n // 必须先得到高度再将y置为0, 顺序很重要\n height = Math.max(y + h, 0);\n y = 0;\n } else {\n height = h;\n }\n this.rect.setAttributes(\n {\n y,\n height,\n dy: Math.min(parentAttr.y1 - parentAttr.y, 0)\n } as any,\n false,\n {\n type: AttributeUpdateType.ANIMATE_PLAY,\n animationState: {\n ratio,\n end\n }\n }\n );\n }\n }\n\n protected onUpdateLineOrArea(end: boolean, ratio: number, out: Record<string, any>) {\n const target = this.line || this.area;\n if (!target) {\n return;\n }\n const customPath = target.pathProxy as ICustomPath2D;\n const targetLine = this.target as ILine | IArea;\n if (targetLine.cache || targetLine.cacheArea) {\n this._onUpdateLineOrAreaWithCache(customPath, targetLine, end, ratio, out);\n } else {\n this._onUpdateLineWithoutCache(customPath, targetLine, end, ratio, out);\n }\n const targetAttrs = targetLine.attribute;\n target.setAttributes({\n stroke: targetAttrs.stroke,\n ...target.attribute\n });\n target.addUpdateBoundTag();\n }\n\n // 针对有cache的linear\n protected _onUpdateLineOrAreaWithCache(\n customPath: ICustomPath2D,\n g: ILine | IArea,\n end: boolean,\n ratio: number,\n out: Record<string, any>\n ) {\n customPath.clear();\n if (g.type === 'line') {\n let cache = g.cache;\n if (!Array.isArray(cache)) {\n cache = [cache];\n }\n const totalLen = cache.reduce((l: any, c: any) => l + c.getLength(), 0);\n const curves: ICurve<IPoint>[] = [];\n cache.forEach((c: any) => {\n c.curves.forEach((ci: any) => curves.push(ci));\n });\n return this._updateCurves(customPath, curves, totalLen, ratio);\n } else if (g.type === 'area' && g.cacheArea?.top?.curves) {\n const cache = g.cacheArea as IAreaCacheItem;\n const totalLen = cache.top.curves.reduce((a, b) => a + b.getLength(), 0);\n return this._updateCurves(customPath, cache.top.curves, totalLen, ratio);\n }\n }\n\n protected _updateCurves(customPath: ICustomPath2D, curves: ICurve<IPoint>[], totalLen: number, ratio: number) {\n const startLen = totalLen * ratio;\n const endLen = Math.min(startLen + (this.params?.streamLength ?? 10), totalLen);\n let lastLen = 0;\n let start = false;\n for (let i = 0; i < curves.length; i++) {\n if (curves[i].defined !== false) {\n const curveItem = curves[i];\n const len = curveItem.getLength();\n const startPercent = 1 - (lastLen + len - startLen) / len;\n let endPercent = 1 - (lastLen + len - endLen) / len;\n let curveForStart: ICubicBezierCurve;\n if (lastLen < startLen && lastLen + len > startLen) {\n start = true;\n if (curveItem.p2 && curveItem.p3) {\n const [_, curve2] = divideCubic(curveItem as ICubicBezierCurve, startPercent);\n customPath.moveTo(curve2.p0.x, curve2.p0.y);\n curveForStart = curve2;\n // console.log(curve2.p0.x, curve2.p0.y);\n } else {\n const p = curveItem.getPointAt(startPercent);\n customPath.moveTo(p.x, p.y);\n }\n }\n if (lastLen < endLen && lastLen + len > endLen) {\n if (curveItem.p2 && curveItem.p3) {\n if (curveForStart) {\n endPercent = (endLen - startLen) / curveForStart.getLength();\n }\n const [curve1] = divideCubic(curveForStart || (curveItem as ICubicBezierCurve), endPercent);\n customPath.bezierCurveTo(curve1.p1.x, curve1.p1.y, curve1.p2.x, curve1.p2.y, curve1.p3.x, curve1.p3.y);\n } else {\n const p = curveItem.getPointAt(endPercent);\n customPath.lineTo(p.x, p.y);\n }\n break;\n } else if (start) {\n if (curveItem.p2 && curveItem.p3) {\n const curve = curveForStart || curveItem;\n customPath.bezierCurveTo(curve.p1.x, curve.p1.y, curve.p2.x, curve.p2.y, curve.p3.x, curve.p3.y);\n } else {\n customPath.lineTo(curveItem.p1.x, curveItem.p1.y);\n }\n }\n lastLen += len;\n }\n }\n }\n\n // 只针对最简单的linear\n protected _onUpdateLineWithoutCache(\n customPath: ICustomPath2D,\n line: ILine,\n end: boolean,\n ratio: number,\n out: Record<string, any>\n ) {\n const { points, curveType } = line.attribute;\n if (!points || points.length < 2 || curveType !== 'linear') {\n return;\n }\n let totalLen = 0;\n for (let i = 1; i < points.length; i++) {\n totalLen += PointService.distancePP(points[i], points[i - 1]);\n }\n const startLen = totalLen * ratio;\n const endLen = Math.min(startLen + (this.params?.streamLength ?? 10), totalLen);\n const nextPoints = [];\n let lastLen = 0;\n for (let i = 1; i < points.length; i++) {\n const len = PointService.distancePP(points[i], points[i - 1]);\n if (lastLen < startLen && lastLen + len > startLen) {\n nextPoints.push(PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - startLen) / len));\n }\n if (lastLen < endLen && lastLen + len > endLen) {\n nextPoints.push(PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - endLen) / len));\n break;\n } else if (nextPoints.length) {\n nextPoints.push(points[i]);\n }\n lastLen += len;\n }\n\n if (!nextPoints.length || nextPoints.length < 2) {\n return;\n }\n customPath.clear();\n customPath.moveTo(nextPoints[0].x, nextPoints[0].y);\n for (let i = 1; i < nextPoints.length; i++) {\n customPath.lineTo(nextPoints[i].x, nextPoints[i].y);\n }\n }\n}\n"]}
|
package/cjs/custom/tag-points.js
CHANGED
|
@@ -24,6 +24,7 @@ class TagPointsUpdate extends custom_animate_1.ACustomAnimate {
|
|
|
24
24
|
return [];
|
|
25
25
|
}
|
|
26
26
|
onBind() {
|
|
27
|
+
super.onBind();
|
|
27
28
|
const {points: points, segments: segments} = this.target.attribute, {points: pointsTo, segments: segmentsTo} = this.target.getFinalAttribute();
|
|
28
29
|
this.from = {
|
|
29
30
|
points: points,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/tag-points.ts"],"names":[],"mappings":";;;AAAA,6CAAgF;AAEhF,yDAA4D;AAC5D,qDAAkD;AAElD,MAAa,eAAgB,SAAQ,+BAAgE;IAWnG,YACE,IAAS,EACT,EAAO,EACP,QAAgB,EAChB,MAAkB,EAClB,MAA+F;;QAE/F,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,mBAAmB,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,mBA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ils';\nimport type { ISegment, ILineAttribute, EasingType } from '@visactor/vrender-core';\nimport { pointInterpolation } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport class TagPointsUpdate extends ACustomAnimate<{ points?: IPointLike[]; segments?: ISegment[] }> {\n protected fromPoints: IPointLike[];\n protected toPoints: IPointLike[];\n protected points: IPointLike[];\n protected interpolatePoints: [IPointLike, IPointLike][];\n protected newPointAnimateType: 'grow' | 'appear' | 'clip';\n protected clipRange: number;\n protected shrinkClipRange: number;\n protected clipRangeByDimension: 'x' | 'y';\n protected segmentsCache: number[];\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { newPointAnimateType?: 'grow' | 'appear' | 'clip'; clipRangeByDimension?: 'x' | 'y' }\n ) {\n super(from, to, duration, easing, params);\n this.newPointAnimateType = params?.newPointAnimateType ?? 'grow';\n this.clipRangeByDimension = params?.clipRangeByDimension ?? 'x';\n }\n\n private getPoints(attribute: typeof this.from, cache = false): IPointLike[] {\n if (attribute.points) {\n return attribute.points;\n }\n\n if (attribute.segments) {\n const points = [] as IPointLike[];\n if (!this.segmentsCache) {\n this.segmentsCache = [];\n }\n attribute.segments.map((segment: any) => {\n if (segment.points) {\n points.push(...segment.points);\n }\n if (cache) {\n this.segmentsCache.push(segment.points?.length ?? 0);\n }\n });\n return points;\n }\n return [];\n }\n\n onBind(): void {\n const { points, segments } = this.target.attribute as any;\n const { points: pointsTo, segments: segmentsTo } = this.target.getFinalAttribute() as any;\n\n this.from = { points, segments };\n this.to = { points: pointsTo, segments: segmentsTo };\n this.props = this.to;\n\n const originFromPoints = this.getPoints(this.from);\n const originToPoints = this.getPoints(this.to, true);\n this.fromPoints = !originFromPoints ? [] : !Array.isArray(originFromPoints) ? [originFromPoints] : originFromPoints;\n this.toPoints = !originToPoints ? [] : !Array.isArray(originToPoints) ? [originToPoints] : originToPoints;\n\n const tagMap = new Map<string, IPointLike>();\n this.fromPoints.forEach(point => {\n if (point.context) {\n tagMap.set(point.context, point);\n }\n });\n let firstMatchedIndex = Infinity;\n let lastMatchedIndex = -Infinity;\n let firstMatchedPoint: IPointLike;\n let lastMatchedPoint: IPointLike;\n for (let i = 0; i < this.toPoints.length; i += 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n firstMatchedIndex = i;\n firstMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n for (let i = this.toPoints.length - 1; i >= 0; i -= 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n lastMatchedIndex = i;\n lastMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n\n if (this.newPointAnimateType === 'clip') {\n if (this.toPoints.length !== 0) {\n if (Number.isFinite(lastMatchedIndex)) {\n this.clipRange =\n this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /\n this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension];\n if (this.clipRange === 1) {\n this.shrinkClipRange =\n this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /\n this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension];\n }\n if (!isValidNumber(this.clipRange)) {\n this.clipRange = 0;\n } else {\n this.clipRange = clamp(this.clipRange, 0, 1);\n }\n } else {\n this.clipRange = 0;\n }\n }\n }\n // TODO: shrink removed points\n // if no point is matched, animation should start from toPoint[0]\n let prevMatchedPoint = this.toPoints[0];\n this.interpolatePoints = this.toPoints.map((point, index) => {\n const matchedPoint = tagMap.get(point.context);\n if (matchedPoint) {\n prevMatchedPoint = matchedPoint;\n return [matchedPoint, point];\n }\n // appear new point\n if (this.newPointAnimateType === 'appear' || this.newPointAnimateType === 'clip') {\n return [point, point];\n }\n // grow new point\n if (index < firstMatchedIndex && firstMatchedPoint) {\n return [firstMatchedPoint, point];\n } else if (index > lastMatchedIndex && lastMatchedPoint) {\n return [lastMatchedPoint, point];\n }\n return [prevMatchedPoint, point];\n });\n this.points = this.interpolatePoints.map(interpolate => {\n const fromPoint = interpolate[0];\n const toPoint = interpolate[1];\n const newPoint = new Point(fromPoint.x, fromPoint.y, fromPoint.x1, fromPoint.y1);\n newPoint.defined = toPoint.defined;\n newPoint.context = toPoint.context;\n return newPoint;\n });\n }\n\n onFirstRun(): void {\n const lastClipRange = (this.target.attribute as any).clipRange;\n if (isValidNumber(lastClipRange * this.clipRange)) {\n this.clipRange *= lastClipRange;\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // if not create new points, multi points animation might not work well.\n this.points = this.points.map((point, index) => {\n const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);\n newPoint.context = point.context;\n return newPoint;\n });\n if (this.clipRange) {\n if (this.shrinkClipRange) {\n // 折线变短\n if (!end) {\n out.points = this.fromPoints;\n out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio;\n } else {\n out.points = this.toPoints;\n out.clipRange = 1;\n }\n return;\n }\n this.target.setAttributes({ clipRange: this.clipRange + (1 - this.clipRange) * ratio } as any);\n }\n if (this.segmentsCache && this.to.segments) {\n let start = 0;\n const segments = this.to.segments.map((segment: any, index: any) => {\n const end = start + this.segmentsCache[index];\n const points = this.points.slice(start, end);\n start = end;\n return {\n ...segment,\n points\n };\n });\n (this.target.attribute as ILineAttribute).points = segments;\n } else {\n (this.target.attribute as ILineAttribute).points = this.points;\n }\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/custom/tag-points.ts"],"names":[],"mappings":";;;AAAA,6CAAgF;AAEhF,yDAA4D;AAC5D,qDAAkD;AAElD,MAAa,eAAgB,SAAQ,+BAAgE;IAWnG,YACE,IAAS,EACT,EAAO,EACP,QAAgB,EAChB,MAAkB,EAClB,MAA+F;;QAE/F,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,mBAAmB,GAAG,MAAA,MAAM,aAAN,MAAM,uB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ag-points.js","sourcesContent":["import { clamp, isValidNumber, Point, type IPointLike } from '@visactor/vutils';\nimport type { ISegment, ILineAttribute, EasingType } from '@visactor/vrender-core';\nimport { pointInterpolation } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport class TagPointsUpdate extends ACustomAnimate<{ points?: IPointLike[]; segments?: ISegment[] }> {\n protected fromPoints: IPointLike[];\n protected toPoints: IPointLike[];\n protected points: IPointLike[];\n protected interpolatePoints: [IPointLike, IPointLike][];\n protected newPointAnimateType: 'grow' | 'appear' | 'clip';\n protected clipRange: number;\n protected shrinkClipRange: number;\n protected clipRangeByDimension: 'x' | 'y';\n protected segmentsCache: number[];\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params?: { newPointAnimateType?: 'grow' | 'appear' | 'clip'; clipRangeByDimension?: 'x' | 'y' }\n ) {\n super(from, to, duration, easing, params);\n this.newPointAnimateType = params?.newPointAnimateType ?? 'grow';\n this.clipRangeByDimension = params?.clipRangeByDimension ?? 'x';\n }\n\n private getPoints(attribute: typeof this.from, cache = false): IPointLike[] {\n if (attribute.points) {\n return attribute.points;\n }\n\n if (attribute.segments) {\n const points = [] as IPointLike[];\n if (!this.segmentsCache) {\n this.segmentsCache = [];\n }\n attribute.segments.map((segment: any) => {\n if (segment.points) {\n points.push(...segment.points);\n }\n if (cache) {\n this.segmentsCache.push(segment.points?.length ?? 0);\n }\n });\n return points;\n }\n return [];\n }\n\n onBind(): void {\n super.onBind();\n const { points, segments } = this.target.attribute as any;\n const { points: pointsTo, segments: segmentsTo } = this.target.getFinalAttribute() as any;\n\n this.from = { points, segments };\n this.to = { points: pointsTo, segments: segmentsTo };\n this.props = this.to;\n\n const originFromPoints = this.getPoints(this.from);\n const originToPoints = this.getPoints(this.to, true);\n this.fromPoints = !originFromPoints ? [] : !Array.isArray(originFromPoints) ? [originFromPoints] : originFromPoints;\n this.toPoints = !originToPoints ? [] : !Array.isArray(originToPoints) ? [originToPoints] : originToPoints;\n\n const tagMap = new Map<string, IPointLike>();\n this.fromPoints.forEach(point => {\n if (point.context) {\n tagMap.set(point.context, point);\n }\n });\n let firstMatchedIndex = Infinity;\n let lastMatchedIndex = -Infinity;\n let firstMatchedPoint: IPointLike;\n let lastMatchedPoint: IPointLike;\n for (let i = 0; i < this.toPoints.length; i += 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n firstMatchedIndex = i;\n firstMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n for (let i = this.toPoints.length - 1; i >= 0; i -= 1) {\n if (tagMap.has(this.toPoints[i].context)) {\n lastMatchedIndex = i;\n lastMatchedPoint = tagMap.get(this.toPoints[i].context);\n break;\n }\n }\n\n if (this.newPointAnimateType === 'clip') {\n if (this.toPoints.length !== 0) {\n if (Number.isFinite(lastMatchedIndex)) {\n this.clipRange =\n this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /\n this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension];\n if (this.clipRange === 1) {\n this.shrinkClipRange =\n this.toPoints[lastMatchedIndex][this.clipRangeByDimension] /\n this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension];\n }\n if (!isValidNumber(this.clipRange)) {\n this.clipRange = 0;\n } else {\n this.clipRange = clamp(this.clipRange, 0, 1);\n }\n } else {\n this.clipRange = 0;\n }\n }\n }\n // TODO: shrink removed points\n // if no point is matched, animation should start from toPoint[0]\n let prevMatchedPoint = this.toPoints[0];\n this.interpolatePoints = this.toPoints.map((point, index) => {\n const matchedPoint = tagMap.get(point.context);\n if (matchedPoint) {\n prevMatchedPoint = matchedPoint;\n return [matchedPoint, point];\n }\n // appear new point\n if (this.newPointAnimateType === 'appear' || this.newPointAnimateType === 'clip') {\n return [point, point];\n }\n // grow new point\n if (index < firstMatchedIndex && firstMatchedPoint) {\n return [firstMatchedPoint, point];\n } else if (index > lastMatchedIndex && lastMatchedPoint) {\n return [lastMatchedPoint, point];\n }\n return [prevMatchedPoint, point];\n });\n this.points = this.interpolatePoints.map(interpolate => {\n const fromPoint = interpolate[0];\n const toPoint = interpolate[1];\n const newPoint = new Point(fromPoint.x, fromPoint.y, fromPoint.x1, fromPoint.y1);\n newPoint.defined = toPoint.defined;\n newPoint.context = toPoint.context;\n return newPoint;\n });\n }\n\n onFirstRun(): void {\n const lastClipRange = (this.target.attribute as any).clipRange;\n if (isValidNumber(lastClipRange * this.clipRange)) {\n this.clipRange *= lastClipRange;\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // if not create new points, multi points animation might not work well.\n this.points = this.points.map((point, index) => {\n const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);\n newPoint.context = point.context;\n return newPoint;\n });\n if (this.clipRange) {\n if (this.shrinkClipRange) {\n // 折线变短\n if (!end) {\n out.points = this.fromPoints;\n out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio;\n } else {\n out.points = this.toPoints;\n out.clipRange = 1;\n }\n return;\n }\n this.target.setAttributes({ clipRange: this.clipRange + (1 - this.clipRange) * ratio } as any);\n }\n if (this.segmentsCache && this.to.segments) {\n let start = 0;\n const segments = this.to.segments.map((segment: any, index: any) => {\n const end = start + this.segmentsCache[index];\n const points = this.points.slice(start, end);\n start = end;\n return {\n ...segment,\n points\n };\n });\n (this.target.attribute as ILineAttribute).points = segments;\n } else {\n (this.target.attribute as ILineAttribute).points = this.points;\n }\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n"]}
|
package/cjs/custom/update.js
CHANGED
|
@@ -12,6 +12,7 @@ class Update extends custom_animate_1.ACustomAnimate {
|
|
|
12
12
|
}
|
|
13
13
|
onBind() {
|
|
14
14
|
var _a, _b;
|
|
15
|
+
super.onBind();
|
|
15
16
|
let {diffAttrs: diffAttrs = {}} = null !== (_a = this.target.context) && void 0 !== _a ? _a : {};
|
|
16
17
|
const {options: options} = this.params;
|
|
17
18
|
(null === (_b = null == options ? void 0 : options.excludeChannels) || void 0 === _b ? void 0 : _b.length) && (diffAttrs = Object.assign({}, diffAttrs),
|
package/cjs/custom/update.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/update.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAclD,MAAa,MAAO,SAAQ,+BAAsC;IAIhE,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAgC;QACtG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE5C,CAAC;IAED,MAAM;;QACJ,IAAI,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,OAAO,mCAAK,EAAU,CAAC;QAC5D,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAa,CAAC;QAEvC,IAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,0CAAE,MAAM,EAAE;YACpC,SAAS,qBAAQ,SAAS,CAAE,CAAC;YAC7B,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,OAAe,EAAE,EAAE;gBAClD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;SACJ;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC1D,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACjC,OAAO;SACR;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,CAAC,yBAAyB;YACpC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,SAAS,EAAE,IA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AAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACP,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;CACF;AA7CD,wBA6CC","file":"update.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport interface IUpdateAnimationOptions {\n diffAttrs: Record<string, any>;\n animationState: string;\n diffState: string;\n data: Record<string, any>[];\n}\n\n/**\n * 文本输入动画,实现类似打字机的字符逐个显示效果\n * 支持通过beforeText和afterText参数添加前缀和后缀\n * 支持通过showCursor参数显示光标,cursorChar自定义光标字符\n */\nexport class Update extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n // params: IUpdateAnimationOptions;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IUpdateAnimationOptions) {\n super(from, to, duration, easing, params);\n // this.params = params;\n }\n\n onBind() {\n super.onBind();\n let { diffAttrs = {} } = this.target.context ?? ({} as any);\n const { options } = this.params as any;\n\n if (options?.excludeChannels?.length) {\n diffAttrs = { ...diffAttrs };\n options.excludeChannels.forEach((channel: string) => {\n delete diffAttrs[channel];\n });\n }\n\n this.props = diffAttrs;\n }\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n this.onStart();\n if (!this.props || !this.propKeys) {\n return;\n }\n // 应用缓动函数\n const easedRatio = this.easing(ratio);\n this.animate.interpolateUpdateFunction\n ? this.animate.interpolateUpdateFunction(this.fromProps, this.props, easedRatio, this, this.target)\n : this.interpolateUpdateFunctions.forEach((func, index) => {\n // 如果这个属性被屏蔽了,直接跳过\n if (!this.animate.validAttr(this.propKeys[index])) {\n return;\n }\n const key = this.propKeys[index];\n const fromValue = this.fromProps[key];\n const toValue = this.props[key];\n func(key, fromValue, toValue, easedRatio, this, this.target);\n });\n this.onUpdate(end, easedRatio, out);\n }\n}\n"]}
|
|
@@ -132,7 +132,7 @@ class AnimateExecutor {
|
|
|
132
132
|
var _a, _b, _c, _d;
|
|
133
133
|
if (custom && customType) {
|
|
134
134
|
const customParams = this.resolveValue(customParameters, graphic, {}), objOptions = (0,
|
|
135
|
-
vutils_1.isFunction)(options) ? options.call(null, null !== (_b =
|
|
135
|
+
vutils_1.isFunction)(options) ? options.call(null, null !== (_b = customParams && (null === (_a = customParams.data) || void 0 === _a ? void 0 : _a[0])) && void 0 !== _b ? _b : null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, customParams) : options;
|
|
136
136
|
customParams.options = objOptions, 1 === customType ? this.createCustomAnimation(animate, custom, from, props, duration, easing, customParams) : 2 === customType && this.createCustomInterpolatorAnimation(animate, custom, props, duration, easing, customParams);
|
|
137
137
|
} else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
|
|
138
138
|
}
|
|
@@ -154,11 +154,15 @@ class AnimateExecutor {
|
|
|
154
154
|
vutils_1.isFunction)(delayAfter) ? delayAfter(null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, {}) : delayAfter;
|
|
155
155
|
delayValue > 0 && animate.wait(delayValue);
|
|
156
156
|
(Array.isArray(effects) ? effects : [ effects ]).forEach((effect => {
|
|
157
|
+
var _a, _b;
|
|
157
158
|
const {type: type = "fromTo", channel: channel, customParameters: customParameters, easing: easing = "linear", options: options} = effect;
|
|
158
159
|
let parsedFromProps = null, props = effect.to, from = effect.from;
|
|
159
160
|
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)),
|
|
160
161
|
props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)),
|
|
161
|
-
from = parsedFromProps.from)
|
|
162
|
+
from = parsedFromProps.from);
|
|
163
|
+
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type], customType = null !== (_b = effect.customType) && void 0 !== _b ? _b : custom && (0,
|
|
164
|
+
vutils_1.isFunction)(custom) ? /^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2 : 0;
|
|
165
|
+
this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, options, type, graphic);
|
|
162
166
|
})), delayAfterValue > 0 && animate.wait(delayAfterValue);
|
|
163
167
|
}
|
|
164
168
|
createCustomInterpolatorAnimation(animate, interpolator, props, duration, easing, customParams) {
|
|
@@ -180,8 +184,9 @@ class AnimateExecutor {
|
|
|
180
184
|
var _a, _b;
|
|
181
185
|
const value = null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs) || void 0 === _b ? void 0 : _b[key];
|
|
182
186
|
void 0 !== value && (props[key] = value);
|
|
183
|
-
})) : Object.
|
|
187
|
+
})) : Object.keys(channel).forEach((key => {
|
|
184
188
|
var _a, _b;
|
|
189
|
+
const config = channel[key];
|
|
185
190
|
void 0 !== config.to && ("function" == typeof config.to ? props[key] = config.to(null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data, graphic, {}) : props[key] = config.to),
|
|
186
191
|
void 0 !== config.from && (from || (from = {}), "function" == typeof config.from ? from[key] = config.from(null === (_b = graphic.context) || void 0 === _b ? void 0 : _b.data, graphic, {}) : from[key] = config.from);
|
|
187
192
|
})), {
|