@visactor/vrender-animate 0.22.4 → 0.22.12
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/animate-extension.d.ts +12 -5
- package/cjs/animate-extension.js +23 -12
- package/cjs/animate-extension.js.map +1 -1
- package/cjs/animate.d.ts +2 -5
- package/cjs/animate.js +23 -18
- package/cjs/animate.js.map +1 -1
- package/cjs/component/component-animate-extension.d.ts +1 -0
- package/cjs/component/component-animate-extension.js +1 -0
- package/cjs/component/component-animate-extension.js.map +1 -0
- package/cjs/component/component-animator.d.ts +22 -0
- package/cjs/component/component-animator.js +67 -0
- package/cjs/component/component-animator.js.map +1 -0
- package/cjs/component/index.d.ts +1 -0
- package/cjs/component/index.js +21 -0
- package/cjs/component/index.js.map +1 -0
- package/cjs/config/morphing.d.ts +2 -0
- package/cjs/config/morphing.js +9 -0
- package/cjs/config/morphing.js.map +1 -0
- package/cjs/custom/clip-graphic.d.ts +1 -1
- package/cjs/custom/clip-graphic.js +2 -2
- package/cjs/custom/clip-graphic.js.map +1 -1
- package/cjs/custom/clip.d.ts +2 -1
- package/cjs/custom/clip.js +9 -1
- package/cjs/custom/clip.js.map +1 -1
- package/cjs/custom/common.d.ts +1 -3
- package/cjs/custom/common.js +21 -17
- package/cjs/custom/common.js.map +1 -1
- package/cjs/custom/custom-animate.d.ts +7 -3
- package/cjs/custom/custom-animate.js +13 -2
- package/cjs/custom/custom-animate.js.map +1 -1
- package/cjs/custom/fade.d.ts +1 -1
- package/cjs/custom/fade.js +7 -2
- package/cjs/custom/fade.js.map +1 -1
- package/cjs/custom/fromTo.d.ts +10 -0
- package/cjs/custom/fromTo.js +42 -0
- package/cjs/custom/fromTo.js.map +1 -0
- package/cjs/custom/groupFade.d.ts +10 -0
- package/cjs/custom/groupFade.js +25 -0
- package/cjs/custom/groupFade.js.map +1 -0
- package/cjs/custom/growAngle.d.ts +10 -5
- package/cjs/custom/growAngle.js +38 -17
- package/cjs/custom/growAngle.js.map +1 -1
- package/cjs/custom/growCenter.d.ts +1 -2
- package/cjs/custom/growCenter.js +16 -10
- package/cjs/custom/growCenter.js.map +1 -1
- package/cjs/custom/growHeight.d.ts +1 -3
- package/cjs/custom/growHeight.js +19 -13
- package/cjs/custom/growHeight.js.map +1 -1
- package/cjs/custom/growPoints.d.ts +1 -2
- package/cjs/custom/growPoints.js +41 -36
- package/cjs/custom/growPoints.js.map +1 -1
- package/cjs/custom/growRadius.d.ts +4 -5
- package/cjs/custom/growRadius.js +22 -18
- package/cjs/custom/growRadius.js.map +1 -1
- package/cjs/custom/growWidth.d.ts +1 -3
- package/cjs/custom/growWidth.js +15 -9
- package/cjs/custom/growWidth.js.map +1 -1
- package/cjs/custom/input-text.d.ts +1 -2
- package/cjs/custom/input-text.js.map +1 -1
- package/cjs/custom/label-item-animate.d.ts +7 -0
- package/cjs/custom/label-item-animate.js +221 -0
- package/cjs/custom/label-item-animate.js.map +1 -0
- package/cjs/custom/morphing.d.ts +51 -0
- package/cjs/custom/morphing.js +298 -0
- package/cjs/custom/morphing.js.map +1 -0
- 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.d.ts +96 -0
- package/cjs/custom/move.js +133 -0
- package/cjs/custom/move.js.map +1 -0
- package/cjs/custom/number.d.ts +1 -2
- package/cjs/custom/number.js.map +1 -1
- package/cjs/custom/poptip-animate.d.ts +7 -0
- package/cjs/custom/poptip-animate.js +109 -0
- package/cjs/custom/poptip-animate.js.map +1 -0
- package/cjs/custom/register.d.ts +27 -0
- package/cjs/custom/register.js +418 -3
- package/cjs/custom/register.js.map +1 -1
- package/cjs/custom/richtext/input-richtext.d.ts +35 -0
- package/cjs/custom/richtext/input-richtext.js +80 -0
- package/cjs/custom/richtext/input-richtext.js.map +1 -0
- package/cjs/custom/richtext/output-richtext.d.ts +37 -0
- package/cjs/custom/richtext/output-richtext.js +94 -0
- package/cjs/custom/richtext/output-richtext.js.map +1 -0
- package/cjs/custom/richtext/slide-out-richtext.d.ts +38 -0
- package/cjs/custom/richtext/slide-out-richtext.js +146 -0
- package/cjs/custom/richtext/slide-out-richtext.js.map +1 -0
- package/cjs/custom/richtext/slide-richtext.d.ts +36 -0
- package/cjs/custom/richtext/slide-richtext.js +144 -0
- package/cjs/custom/richtext/slide-richtext.js.map +1 -0
- package/cjs/custom/rotate.d.ts +33 -0
- package/cjs/custom/rotate.js +79 -0
- package/cjs/custom/rotate.js.map +1 -0
- package/cjs/custom/scale.d.ts +6 -2
- package/cjs/custom/scale.js +32 -17
- package/cjs/custom/scale.js.map +1 -1
- package/cjs/custom/sphere.d.ts +2 -1
- package/cjs/custom/sphere.js +14 -5
- package/cjs/custom/sphere.js.map +1 -1
- package/cjs/custom/state.d.ts +1 -1
- package/cjs/custom/state.js +1 -1
- package/cjs/custom/state.js.map +1 -1
- package/cjs/custom/story.d.ts +196 -0
- package/cjs/custom/story.js +497 -0
- package/cjs/custom/story.js.map +1 -0
- 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.d.ts +2 -3
- package/cjs/custom/tag-points.js +20 -4
- package/cjs/custom/tag-points.js.map +1 -1
- package/cjs/custom/update.d.ts +2 -2
- package/cjs/custom/update.js +10 -2
- package/cjs/custom/update.js.map +1 -1
- package/cjs/executor/animate-executor.d.ts +7 -6
- package/cjs/executor/animate-executor.js +118 -62
- package/cjs/executor/animate-executor.js.map +1 -1
- package/cjs/executor/executor.d.ts +9 -3
- package/cjs/executor/executor.js.map +1 -1
- package/cjs/index.d.ts +8 -8
- package/cjs/index.js +50 -18
- package/cjs/index.js.map +1 -1
- package/cjs/interpolate/store.d.ts +6 -2
- package/cjs/interpolate/store.js +13 -2
- package/cjs/interpolate/store.js.map +1 -1
- package/cjs/register.js +1 -5
- package/cjs/register.js.map +1 -1
- package/cjs/state/animation-state.d.ts +20 -2
- package/cjs/state/animation-state.js +48 -4
- package/cjs/state/animation-state.js.map +1 -1
- package/cjs/state/animation-states-registry.js +18 -0
- package/cjs/state/animation-states-registry.js.map +1 -1
- package/cjs/state/graphic-extension.d.ts +7 -1
- package/cjs/state/graphic-extension.js +20 -0
- package/cjs/state/graphic-extension.js.map +1 -1
- package/cjs/step.d.ts +7 -4
- package/cjs/step.js +33 -15
- package/cjs/step.js.map +1 -1
- package/cjs/ticker/default-ticker.d.ts +12 -7
- package/cjs/ticker/default-ticker.js +38 -33
- package/cjs/ticker/default-ticker.js.map +1 -1
- package/cjs/ticker/manual-ticker.d.ts +6 -1
- package/cjs/ticker/manual-ticker.js +26 -4
- package/cjs/ticker/manual-ticker.js.map +1 -1
- package/cjs/timeline.d.ts +14 -7
- package/cjs/timeline.js +31 -18
- package/cjs/timeline.js.map +1 -1
- package/cjs/utils/transform.d.ts +2 -0
- package/cjs/utils/transform.js +10 -0
- package/cjs/utils/transform.js.map +1 -0
- package/dist/index.es.js +3765 -527
- package/es/animate-extension.d.ts +12 -5
- package/es/animate-extension.js +24 -11
- package/es/animate-extension.js.map +1 -1
- package/es/animate.d.ts +2 -5
- package/es/animate.js +14 -11
- package/es/animate.js.map +1 -1
- package/es/component/component-animate-extension.d.ts +1 -0
- package/es/component/component-animate-extension.js +1 -0
- package/es/component/component-animate-extension.js.map +1 -0
- package/es/component/component-animator.d.ts +22 -0
- package/es/component/component-animator.js +59 -0
- package/es/component/component-animator.js.map +1 -0
- package/es/component/index.d.ts +1 -0
- package/es/component/index.js +2 -0
- package/es/component/index.js.map +1 -0
- package/es/config/morphing.d.ts +2 -0
- package/es/config/morphing.js +5 -0
- package/es/config/morphing.js.map +1 -0
- package/es/custom/clip-graphic.d.ts +1 -1
- package/es/custom/clip-graphic.js +2 -2
- package/es/custom/clip-graphic.js.map +1 -1
- package/es/custom/clip.d.ts +2 -1
- package/es/custom/clip.js +9 -1
- package/es/custom/clip.js.map +1 -1
- package/es/custom/common.d.ts +1 -3
- package/es/custom/common.js +21 -17
- package/es/custom/common.js.map +1 -1
- package/es/custom/custom-animate.d.ts +7 -3
- package/es/custom/custom-animate.js +10 -1
- package/es/custom/custom-animate.js.map +1 -1
- package/es/custom/fade.d.ts +1 -1
- package/es/custom/fade.js +7 -2
- package/es/custom/fade.js.map +1 -1
- package/es/custom/fromTo.d.ts +10 -0
- package/es/custom/fromTo.js +34 -0
- package/es/custom/fromTo.js.map +1 -0
- package/es/custom/groupFade.d.ts +10 -0
- package/es/custom/groupFade.js +15 -0
- package/es/custom/groupFade.js.map +1 -0
- package/es/custom/growAngle.d.ts +10 -5
- package/es/custom/growAngle.js +39 -15
- package/es/custom/growAngle.js.map +1 -1
- package/es/custom/growCenter.d.ts +1 -2
- package/es/custom/growCenter.js +16 -10
- package/es/custom/growCenter.js.map +1 -1
- package/es/custom/growHeight.d.ts +1 -3
- package/es/custom/growHeight.js +20 -14
- package/es/custom/growHeight.js.map +1 -1
- package/es/custom/growPoints.d.ts +1 -2
- package/es/custom/growPoints.js +40 -36
- package/es/custom/growPoints.js.map +1 -1
- package/es/custom/growRadius.d.ts +4 -5
- package/es/custom/growRadius.js +22 -16
- package/es/custom/growRadius.js.map +1 -1
- package/es/custom/growWidth.d.ts +1 -3
- package/es/custom/growWidth.js +16 -10
- package/es/custom/growWidth.js.map +1 -1
- package/es/custom/input-text.d.ts +1 -2
- package/es/custom/input-text.js.map +1 -1
- package/es/custom/label-item-animate.d.ts +7 -0
- package/es/custom/label-item-animate.js +215 -0
- package/es/custom/label-item-animate.js.map +1 -0
- package/es/custom/morphing.d.ts +51 -0
- package/es/custom/morphing.js +289 -0
- package/es/custom/morphing.js.map +1 -0
- 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.d.ts +96 -0
- package/es/custom/move.js +118 -0
- package/es/custom/move.js.map +1 -0
- package/es/custom/number.d.ts +1 -2
- package/es/custom/number.js.map +1 -1
- package/es/custom/poptip-animate.d.ts +7 -0
- package/es/custom/poptip-animate.js +103 -0
- package/es/custom/poptip-animate.js.map +1 -0
- package/es/custom/register.d.ts +27 -0
- package/es/custom/register.js +48 -1
- package/es/custom/register.js.map +1 -1
- package/es/custom/richtext/input-richtext.d.ts +35 -0
- package/es/custom/richtext/input-richtext.js +74 -0
- package/es/custom/richtext/input-richtext.js.map +1 -0
- package/es/custom/richtext/output-richtext.d.ts +37 -0
- package/es/custom/richtext/output-richtext.js +88 -0
- package/es/custom/richtext/output-richtext.js.map +1 -0
- package/es/custom/richtext/slide-out-richtext.d.ts +38 -0
- package/es/custom/richtext/slide-out-richtext.js +140 -0
- package/es/custom/richtext/slide-out-richtext.js.map +1 -0
- package/es/custom/richtext/slide-richtext.d.ts +36 -0
- package/es/custom/richtext/slide-richtext.js +138 -0
- package/es/custom/richtext/slide-richtext.js.map +1 -0
- package/es/custom/rotate.d.ts +33 -0
- package/es/custom/rotate.js +65 -0
- package/es/custom/rotate.js.map +1 -0
- package/es/custom/scale.d.ts +6 -2
- package/es/custom/scale.js +32 -17
- package/es/custom/scale.js.map +1 -1
- package/es/custom/sphere.d.ts +2 -1
- package/es/custom/sphere.js +14 -5
- package/es/custom/sphere.js.map +1 -1
- package/es/custom/state.d.ts +1 -1
- package/es/custom/state.js +1 -1
- package/es/custom/state.js.map +1 -1
- package/es/custom/story.d.ts +196 -0
- package/es/custom/story.js +468 -0
- package/es/custom/story.js.map +1 -0
- 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.d.ts +2 -3
- package/es/custom/tag-points.js +21 -5
- package/es/custom/tag-points.js.map +1 -1
- package/es/custom/update.d.ts +2 -2
- package/es/custom/update.js +10 -2
- package/es/custom/update.js.map +1 -1
- package/es/executor/animate-executor.d.ts +7 -6
- package/es/executor/animate-executor.js +116 -61
- package/es/executor/animate-executor.js.map +1 -1
- package/es/executor/executor.d.ts +9 -3
- package/es/executor/executor.js.map +1 -1
- package/es/index.d.ts +8 -8
- package/es/index.js +10 -12
- package/es/index.js.map +1 -1
- package/es/interpolate/store.d.ts +6 -2
- package/es/interpolate/store.js +13 -3
- package/es/interpolate/store.js.map +1 -1
- package/es/register.js +0 -8
- package/es/register.js.map +1 -1
- package/es/state/animation-state.d.ts +20 -2
- package/es/state/animation-state.js +48 -2
- package/es/state/animation-state.js.map +1 -1
- package/es/state/animation-states-registry.js +18 -0
- package/es/state/animation-states-registry.js.map +1 -1
- package/es/state/graphic-extension.d.ts +7 -1
- package/es/state/graphic-extension.js +20 -0
- package/es/state/graphic-extension.js.map +1 -1
- package/es/step.d.ts +7 -4
- package/es/step.js +34 -16
- package/es/step.js.map +1 -1
- package/es/ticker/default-ticker.d.ts +12 -7
- package/es/ticker/default-ticker.js +30 -27
- package/es/ticker/default-ticker.js.map +1 -1
- package/es/ticker/manual-ticker.d.ts +6 -1
- package/es/ticker/manual-ticker.js +27 -3
- package/es/ticker/manual-ticker.js.map +1 -1
- package/es/timeline.d.ts +14 -7
- package/es/timeline.js +33 -18
- package/es/timeline.js.map +1 -1
- package/es/utils/transform.d.ts +2 -0
- package/es/utils/transform.js +4 -0
- package/es/utils/transform.js.map +1 -0
- package/package.json +16 -16
- package/cjs/custom/group-fade.d.ts +0 -16
- package/cjs/custom/group-fade.js +0 -66
- package/cjs/custom/group-fade.js.map +0 -1
- package/cjs/custom/scale-in.d.ts +0 -13
- package/cjs/custom/scale-in.js +0 -57
- package/cjs/custom/scale-in.js.map +0 -1
- package/cjs/interpolate/executor.d.ts +0 -66
- package/cjs/interpolate/executor.js +0 -6
- package/cjs/interpolate/executor.js.map +0 -1
- package/cjs/intreface/animate.d.ts +0 -91
- package/cjs/intreface/animate.js +0 -10
- package/cjs/intreface/animate.js.map +0 -1
- package/cjs/intreface/easing.d.ts +0 -3
- package/cjs/intreface/easing.js +0 -6
- package/cjs/intreface/easing.js.map +0 -1
- package/cjs/intreface/state.d.ts +0 -35
- package/cjs/intreface/state.js +0 -6
- package/cjs/intreface/state.js.map +0 -1
- package/cjs/intreface/ticker.d.ts +0 -37
- package/cjs/intreface/ticker.js +0 -10
- package/cjs/intreface/ticker.js.map +0 -1
- package/cjs/intreface/timeline.d.ts +0 -17
- package/cjs/intreface/timeline.js +0 -6
- package/cjs/intreface/timeline.js.map +0 -1
- package/cjs/intreface/type.d.ts +0 -13
- package/cjs/intreface/type.js +0 -15
- package/cjs/intreface/type.js.map +0 -1
- package/cjs/state/animation-state-machine.d.ts +0 -22
- package/cjs/state/animation-state-machine.js +0 -53
- package/cjs/state/animation-state-machine.js.map +0 -1
- package/cjs/state/animation-state-queue.d.ts +0 -24
- package/cjs/state/animation-state-queue.js +0 -66
- package/cjs/state/animation-state-queue.js.map +0 -1
- package/cjs/state/animation-state-registry.d.ts +0 -14
- package/cjs/state/animation-state-registry.js +0 -53
- package/cjs/state/animation-state-registry.js.map +0 -1
- package/es/custom/group-fade.d.ts +0 -16
- package/es/custom/group-fade.js +0 -56
- package/es/custom/group-fade.js.map +0 -1
- package/es/custom/scale-in.d.ts +0 -13
- package/es/custom/scale-in.js +0 -49
- package/es/custom/scale-in.js.map +0 -1
- package/es/interpolate/executor.d.ts +0 -66
- package/es/interpolate/executor.js +0 -2
- package/es/interpolate/executor.js.map +0 -1
- package/es/intreface/animate.d.ts +0 -91
- package/es/intreface/animate.js +0 -6
- package/es/intreface/animate.js.map +0 -1
- package/es/intreface/easing.d.ts +0 -3
- package/es/intreface/easing.js +0 -2
- package/es/intreface/easing.js.map +0 -1
- package/es/intreface/state.d.ts +0 -35
- package/es/intreface/state.js +0 -2
- package/es/intreface/state.js.map +0 -1
- package/es/intreface/ticker.d.ts +0 -37
- package/es/intreface/ticker.js +0 -6
- package/es/intreface/ticker.js.map +0 -1
- package/es/intreface/timeline.d.ts +0 -17
- package/es/intreface/timeline.js +0 -2
- package/es/intreface/timeline.js.map +0 -1
- package/es/intreface/type.d.ts +0 -13
- package/es/intreface/type.js +0 -14
- package/es/intreface/type.js.map +0 -1
- package/es/state/animation-state-machine.d.ts +0 -22
- package/es/state/animation-state-machine.js +0 -47
- package/es/state/animation-state-machine.js.map +0 -1
- package/es/state/animation-state-queue.d.ts +0 -24
- package/es/state/animation-state-queue.js +0 -58
- package/es/state/animation-state-queue.js.map +0 -1
- package/es/state/animation-state-registry.d.ts +0 -14
- package/es/state/animation-state-registry.js +0 -45
- package/es/state/animation-state-registry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/growCenter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuBlD,MAAM,YAAY,GAA4B,CAC5C,OAAiB,EACjB,OAAuC,EACvC,mBAAyC,EACzC,EAAE;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC1C,QAAQ,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,EAAE;QAC1B,KAAK,GAAG,CAAC,CAAC;YACR,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAE1B,OAAO;gBACL,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC;oBAClB,CAAC,CAAC;wBACE,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC;wBAChB,EAAE,EAAE,SAAS;wBACb,KAAK,EAAE,CAAC;qBACT;oBACH,CAAC,CAAC;wBACE,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;wBACf,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;wBAChB,KAAK,EAAE,SAAS;qBACjB;gBACL,EAAE,EAAE,EAAE,CAAC,E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iBAAiB,EAAE,CAAC;QAC9C,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAClF,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC;QAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IAEf,CAAC;IAED,KAAK,CAAC,EAA6C;QACjD,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QACtE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACF","file":"growCenter.js","sourcesContent":["import type { IGraphic, IGroup } from '@visactor/vrender-core';\nimport { isValid } from '@visactor/vutils';\nimport type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\ntype TypeAnimation<T extends IGraphic> = (\n graphic: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nconst growCenterIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n switch (options?.direction) {\n case 'x': {\n const x = attrs.x;\n const x1 = attrs.x1;\n const width = attrs.width;\n\n return {\n from: isValid(width)\n ? {\n x: x + width / 2,\n x1: undefined,\n width: 0\n }\n : {\n x: (x + x1) / 2,\n x1: (x + x1) / 2,\n width: undefined\n },\n to: { x, x1, width }\n };\n }\n case 'y': {\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n return {\n from: isValid(height)\n ? {\n y: y + height / 2,\n y1: undefined,\n height: 0\n }\n : {\n y: (y + y1) / 2,\n y1: (y + y1) / 2,\n height: undefined\n },\n to: { y, y1, height }\n };\n }\n case 'xy':\n default: {\n const x = attrs.x;\n const x1 = attrs.x1;\n const width = attrs.width;\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n const from: any = {};\n\n if (isValid(width)) {\n from.x = x + width / 2;\n from.width = 0;\n from.x1 = undefined;\n } else {\n from.x = (x + x1) / 2;\n from.x1 = (x + x1) / 2;\n from.width = undefined;\n }\n\n if (isValid(height)) {\n from.y = y + height / 2;\n from.height = 0;\n from.y1 = undefined;\n } else {\n from.y = (y + y1) / 2;\n from.y1 = (y + y1) / 2;\n from.height = undefined;\n }\n\n return {\n from,\n to: { x, y, x1, y1, width, height }\n };\n }\n }\n};\n\nconst growCenterOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n switch (options?.direction) {\n case 'x': {\n const x = attrs.x;\n const x1 = attrs.x1;\n const width = attrs.width;\n\n return {\n to: isValid(width)\n ? {\n x: x + width / 2,\n x1: undefined,\n width: 0\n }\n : {\n x: (x + x1) / 2,\n x1: (x + x1) / 2,\n width: undefined\n }\n };\n }\n case 'y': {\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n return {\n to: isValid(height)\n ? {\n y: y + height / 2,\n y1: undefined,\n height: 0\n }\n : {\n y: (y + y1) / 2,\n y1: (y + y1) / 2,\n height: undefined\n }\n };\n }\n case 'xy':\n default: {\n const x = attrs.x;\n const y = attrs.y;\n const x1 = attrs.x1;\n const y1 = attrs.y1;\n const width = attrs.width;\n const height = attrs.height;\n const to: any = {};\n\n if (isValid(width)) {\n to.x = x + width / 2;\n to.width = 0;\n to.x1 = undefined;\n } else {\n to.x = (x + x1) / 2;\n to.x1 = (x + x1) / 2;\n to.width = undefined;\n }\n\n if (isValid(height)) {\n to.y = y + height / 2;\n to.height = 0;\n to.y1 = undefined;\n } else {\n to.y = (y + y1) / 2;\n to.y1 = (y + y1) / 2;\n to.height = undefined;\n }\n\n return {\n to\n };\n }\n }\n};\n\n/**\n * 增长渐入\n */\nexport class GrowCenterIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const { from, to } = growCenterIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n\nexport class GrowCenterOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growCenterOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n // this.target.setAttributes(from);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/custom/growCenter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuBlD,MAAM,YAAY,GAA4B,CAC5C,OAAiB,EACjB,OAAuC,EACvC,mBAAyC,EACzC,EAAE;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC1C,QAAQ,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,EAAE;QAC1B,KAAK,GAAG,CAAC,CAAC;YACR,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAE1B,OAAO;gBACL,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC;oBAClB,CAAC,CAAC;wBACE,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC;wBAChB,EAAE,EAAE,SAAS;wBAC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AE;YAC1B,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAC5E,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;IAC3C,CAAC;CACF","file":"growCenter.js","sourcesContent":["import type { IGraphic, IGroup, IAnimate, IStep, EasingType } from '@visactor/vrender-core';\nimport { isValid } from '@visactor/vutils';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\ntype TypeAnimation<T extends IGraphic> = (\n graphic: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nconst growCenterIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n switch (options?.direction) {\n case 'x': {\n const x = attrs.x;\n const x1 = attrs.x1;\n const width = attrs.width;\n\n return {\n from: isValid(width)\n ? {\n x: x + width / 2,\n x1: undefined,\n width: 0\n }\n : {\n x: (x + x1) / 2,\n x1: (x + x1) / 2,\n width: undefined\n },\n to: { x, x1, width }\n };\n }\n case 'y': {\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n return {\n from: isValid(height)\n ? {\n y: y + height / 2,\n y1: undefined,\n height: 0\n }\n : {\n y: (y + y1) / 2,\n y1: (y + y1) / 2,\n height: undefined\n },\n to: { y, y1, height }\n };\n }\n case 'xy':\n default: {\n const x = attrs.x;\n const x1 = attrs.x1;\n const width = attrs.width;\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n const from: any = {};\n\n if (isValid(width)) {\n from.x = x + width / 2;\n from.width = 0;\n from.x1 = undefined;\n } else {\n from.x = (x + x1) / 2;\n from.x1 = (x + x1) / 2;\n from.width = undefined;\n }\n\n if (isValid(height)) {\n from.y = y + height / 2;\n from.height = 0;\n from.y1 = undefined;\n } else {\n from.y = (y + y1) / 2;\n from.y1 = (y + y1) / 2;\n from.height = undefined;\n }\n\n return {\n from,\n to: { x, y, x1, y1, width, height }\n };\n }\n }\n};\n\nconst growCenterOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.attribute as any;\n switch (options?.direction) {\n case 'x': {\n const x = attrs.x;\n const x1 = attrs.x1;\n const width = attrs.width;\n\n return {\n to: isValid(width)\n ? {\n x: x + width / 2,\n x1: undefined,\n width: 0\n }\n : {\n x: (x + x1) / 2,\n x1: (x + x1) / 2,\n width: undefined\n }\n };\n }\n case 'y': {\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n return {\n to: isValid(height)\n ? {\n y: y + height / 2,\n y1: undefined,\n height: 0\n }\n : {\n y: (y + y1) / 2,\n y1: (y + y1) / 2,\n height: undefined\n }\n };\n }\n case 'xy':\n default: {\n const x = attrs.x;\n const y = attrs.y;\n const x1 = attrs.x1;\n const y1 = attrs.y1;\n const width = attrs.width;\n const height = attrs.height;\n const to: any = {};\n\n if (isValid(width)) {\n to.x = x + width / 2;\n to.width = 0;\n to.x1 = undefined;\n } else {\n to.x = (x + x1) / 2;\n to.x1 = (x + x1) / 2;\n to.width = undefined;\n }\n\n if (isValid(height)) {\n to.y = y + height / 2;\n to.height = 0;\n to.y1 = undefined;\n } else {\n to.y = (y + y1) / 2;\n to.y1 = (y + y1) / 2;\n to.height = undefined;\n }\n\n return {\n to\n };\n }\n }\n};\n\n/**\n * 增长渐入\n */\nexport class GrowCenterIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n super.onBind();\n const { from, to } = growCenterIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context?.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = fromAttrs;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n\n this.target.setAttributes(fromAttrs);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\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\nexport class GrowCenterOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n super.onBind();\n const { from, to } = growCenterOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n\n this.from = from ?? (this.target.attribute as any);\n this.to = to;\n // this.target.setAttributes(from);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\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"]}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { IGraphic, IGroup } from '@visactor/vrender-core';
|
|
2
|
-
import type { IAnimate, IStep } from '../intreface/animate';
|
|
3
|
-
import type { EasingType } from '../intreface/easing';
|
|
1
|
+
import type { IGraphic, IGroup, IAnimate, IStep, EasingType } from '@visactor/vrender-core';
|
|
4
2
|
import { ACustomAnimate } from './custom-animate';
|
|
5
3
|
interface IAnimationParameters {
|
|
6
4
|
width: number;
|
package/es/custom/growHeight.js
CHANGED
|
@@ -35,10 +35,10 @@ function growHeightInIndividual(graphic, options, animationParameters) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function growHeightInOverall(graphic, options, animationParameters) {
|
|
38
|
-
var _a;
|
|
38
|
+
var _a, _b, _c;
|
|
39
39
|
const attrs = graphic.getFinalAttribute(), y = attrs.y, y1 = attrs.y1, height = attrs.height;
|
|
40
40
|
let overallValue;
|
|
41
|
-
return options && "negative" === options.orient ? isNumber(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(),
|
|
41
|
+
return options && "negative" === options.orient ? isNumber(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_c = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : null === (_b = options.layoutRect) || void 0 === _b ? void 0 : _b.height) && void 0 !== _c ? _c : animationParameters.group.getBounds().height(),
|
|
42
42
|
animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber(null == options ? void 0 : options.overall) ? options.overall : 0,
|
|
43
43
|
{
|
|
44
44
|
from: {
|
|
@@ -64,18 +64,22 @@ export class GrowHeightIn extends ACustomAnimate {
|
|
|
64
64
|
super(from, to, duration, easing, params);
|
|
65
65
|
}
|
|
66
66
|
onBind() {
|
|
67
|
-
var _a;
|
|
68
|
-
|
|
67
|
+
var _a, _b;
|
|
68
|
+
super.onBind();
|
|
69
|
+
const {from: from, to: to} = growHeightIn(this.target, this.params.options, this.params), fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
69
70
|
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
70
|
-
this.
|
|
71
|
+
this.from = fromAttrs, this.to = to;
|
|
72
|
+
const finalAttribute = this.target.getFinalAttribute();
|
|
73
|
+
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
71
74
|
}
|
|
72
75
|
onEnd(cb) {
|
|
73
76
|
super.onEnd(cb);
|
|
74
77
|
}
|
|
75
78
|
onUpdate(end, ratio, out) {
|
|
79
|
+
const attribute = this.target.attribute;
|
|
76
80
|
this.propKeys.forEach((key => {
|
|
77
|
-
|
|
78
|
-
})), this.target.
|
|
81
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
82
|
+
})), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
|
|
@@ -102,10 +106,10 @@ function growHeightOutIndividual(graphic, options, animationParameters) {
|
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
function growHeightOutOverall(graphic, options, animationParameters) {
|
|
105
|
-
var _a;
|
|
109
|
+
var _a, _b, _c;
|
|
106
110
|
const attrs = graphic.getFinalAttribute(), y1 = attrs.y1, height = attrs.height;
|
|
107
111
|
let overallValue;
|
|
108
|
-
return options && "negative" === options.orient ? isNumber(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(),
|
|
112
|
+
return options && "negative" === options.orient ? isNumber(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_c = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : null === (_b = options.layoutRect) || void 0 === _b ? void 0 : _b.height) && void 0 !== _c ? _c : animationParameters.group.getBounds().height(),
|
|
109
113
|
animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber(null == options ? void 0 : options.overall) ? options.overall : 0,
|
|
110
114
|
{
|
|
111
115
|
to: {
|
|
@@ -126,19 +130,21 @@ export class GrowHeightOut extends ACustomAnimate {
|
|
|
126
130
|
super(from, to, duration, easing, params);
|
|
127
131
|
}
|
|
128
132
|
onBind() {
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
super.onBind();
|
|
134
|
+
const {from: from, to: to} = (graphic = this.target, options = this.params.options,
|
|
135
|
+
animationParameters = this.params, !1 !== (null !== (_a = null == options ? void 0 : options.overall) && void 0 !== _a && _a) ? growHeightOutOverall(graphic, options, animationParameters) : growHeightOutIndividual(graphic, options, animationParameters));
|
|
131
136
|
var graphic, options, animationParameters, _a;
|
|
132
137
|
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
133
|
-
this.
|
|
138
|
+
this.from = null != from ? from : this.target.attribute, this.to = to;
|
|
134
139
|
}
|
|
135
140
|
onEnd(cb) {
|
|
136
141
|
super.onEnd(cb);
|
|
137
142
|
}
|
|
138
143
|
onUpdate(end, ratio, out) {
|
|
144
|
+
const attribute = this.target.attribute;
|
|
139
145
|
this.propKeys.forEach((key => {
|
|
140
|
-
|
|
141
|
-
})), this.target.
|
|
146
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
147
|
+
})), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
142
148
|
}
|
|
143
149
|
}
|
|
144
150
|
//# sourceMappingURL=growHeight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/growHeight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAE,cA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AC;QAC9C,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAClF,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC;QAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IAEf,CAAC;IAED,KAAK,CAAC,EAA6C;QACjD,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QACtE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACF","file":"growHeight.js","sourcesContent":["import type { IGraphic, IGroup } from '@visactor/vrender-core';\nimport { isNil, isNumber, isValid } from '@visactor/vutils';\nimport type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\ntype TypeAnimation<T extends IGraphic> = (\n graphic: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nfunction growHeightInIndividual(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n if (options && options.orient === 'negative') {\n const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1);\n return {\n from: { y: computedY1, y1: isNil(y1) ? undefined : computedY1, height: isNil(height) ? undefined : 0 },\n to: { y: y, y1: y1, height: height }\n };\n }\n\n const computedY = isValid(height) ? Math.min(y, y + height) : Math.min(y, y1);\n return {\n from: { y: computedY, y1: isNil(y1) ? undefined : computedY, height: isNil(height) ? undefined : 0 },\n to: { y: y, y1: y1, height: height }\n };\n}\n\nfunction growHeightInOverall(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n let overallValue: number;\n if (options && options.orient === 'negative') {\n if (isNumber(options.overall)) {\n overallValue = options.overall;\n } else if (animationParameters.group) {\n overallValue = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = overallValue;\n } else {\n overallValue = animationParameters.height;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options.overall : 0;\n }\n return {\n from: { y: overallValue, y1: isNil(y1) ? undefined : overallValue, height: isNil(height) ? undefined : 0 },\n to: { y: y, y1: y1, height: height }\n };\n}\n\nconst growHeightIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growHeightInOverall(graphic, options, animationParameters)\n : growHeightInIndividual(graphic, options, animationParameters);\n};\n\n/**\n * 增长渐入\n */\nexport class GrowHeightIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const { from, to } = growHeightIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n\nfunction growHeightOutIndividual(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n if (options && options.orient === 'negative') {\n const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1);\n\n return {\n to: { y: computedY1, y1: isNil(y1) ? undefined : computedY1, height: isNil(height) ? undefined : 0 }\n };\n }\n\n const computedY = isValid(height) ? Math.min(y, y + height) : Math.min(y, y1);\n return {\n to: { y: computedY, y1: isNil(y1) ? undefined : computedY, height: isNil(height) ? undefined : 0 }\n };\n}\n\nfunction growHeightOutOverall(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y1 = attrs.y1;\n const height = attrs.height;\n\n let overallValue: number;\n if (options && options.orient === 'negative') {\n if (isNumber(options.overall)) {\n overallValue = options.overall;\n } else if (animationParameters.group) {\n overallValue = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = overallValue;\n } else {\n overallValue = animationParameters.height;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options.overall : 0;\n }\n return {\n to: { y: overallValue, y1: isNil(y1) ? undefined : overallValue, height: isNil(height) ? undefined : 0 }\n };\n}\n\n/**\n * 增长渐出\n */\nexport const growHeightOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growHeightOutOverall(graphic, options, animationParameters)\n : growHeightOutIndividual(graphic, options, animationParameters);\n};\n\nexport class GrowHeightOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growHeightOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n // this.target.setAttributes(from);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/custom/growHeight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAwBlD,SAAS,sBAAsB,CAC7B,OAAiB,EACjB,OAAuC,EACvC,mBAAyC;IAEzC,MAAM,KAAK,GAAG,OAAO,C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AAC;QACnC,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;IAC3C,CAAC;CACF","file":"growHeight.js","sourcesContent":["import type { IGraphic, IGroup, IAnimate, IStep, EasingType } from '@visactor/vrender-core';\nimport { isNil, isNumber, isValid } from '@visactor/vutils';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n layoutRect?: { width: number; height: number };\n}\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\ntype TypeAnimation<T extends IGraphic> = (\n graphic: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nfunction growHeightInIndividual(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n if (options && options.orient === 'negative') {\n const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1);\n return {\n from: { y: computedY1, y1: isNil(y1) ? undefined : computedY1, height: isNil(height) ? undefined : 0 },\n to: { y: y, y1: y1, height: height }\n };\n }\n\n const computedY = isValid(height) ? Math.min(y, y + height) : Math.min(y, y1);\n return {\n from: { y: computedY, y1: isNil(y1) ? undefined : computedY, height: isNil(height) ? undefined : 0 },\n to: { y: y, y1: y1, height: height }\n };\n}\n\nfunction growHeightInOverall(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n let overallValue: number;\n if (options && options.orient === 'negative') {\n if (isNumber(options.overall)) {\n overallValue = options.overall;\n } else if (animationParameters.group) {\n overallValue =\n (animationParameters as any).groupHeight ??\n options.layoutRect?.height ??\n animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = overallValue;\n } else {\n overallValue = animationParameters.height;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options.overall : 0;\n }\n return {\n from: { y: overallValue, y1: isNil(y1) ? undefined : overallValue, height: isNil(height) ? undefined : 0 },\n to: { y: y, y1: y1, height: height }\n };\n}\n\nconst growHeightIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growHeightInOverall(graphic, options, animationParameters)\n : growHeightInIndividual(graphic, options, animationParameters);\n};\n\n/**\n * 增长渐入\n */\nexport class GrowHeightIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n super.onBind();\n const { from, to } = growHeightIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context?.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = fromAttrs;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n\n this.target.setAttributes(fromAttrs);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\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\nfunction growHeightOutIndividual(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n if (options && options.orient === 'negative') {\n const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1);\n\n return {\n to: { y: computedY1, y1: isNil(y1) ? undefined : computedY1, height: isNil(height) ? undefined : 0 }\n };\n }\n\n const computedY = isValid(height) ? Math.min(y, y + height) : Math.min(y, y1);\n return {\n to: { y: computedY, y1: isNil(y1) ? undefined : computedY, height: isNil(height) ? undefined : 0 }\n };\n}\n\nfunction growHeightOutOverall(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y1 = attrs.y1;\n const height = attrs.height;\n\n let overallValue: number;\n if (options && options.orient === 'negative') {\n if (isNumber(options.overall)) {\n overallValue = options.overall;\n } else if (animationParameters.group) {\n overallValue =\n (animationParameters as any).groupHeight ??\n options.layoutRect?.height ??\n animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = overallValue;\n } else {\n overallValue = animationParameters.height;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options.overall : 0;\n }\n return {\n to: { y: overallValue, y1: isNil(y1) ? undefined : overallValue, height: isNil(height) ? undefined : 0 }\n };\n}\n\n/**\n * 增长渐出\n */\nexport const growHeightOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growHeightOutOverall(graphic, options, animationParameters)\n : growHeightOutIndividual(graphic, options, animationParameters);\n};\n\nexport class GrowHeightOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n super.onBind();\n const { from, to } = growHeightOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = from ?? (this.target.attribute as any);\n this.to = to;\n // this.target.setAttributes(from);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\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"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type IGraphic, type IGroup } from '@visactor/vrender-core';
|
|
1
|
+
import { type IGraphic, type IGroup, type EasingType } from '@visactor/vrender-core';
|
|
2
2
|
import type { IPointLike } from '@visactor/vutils';
|
|
3
|
-
import type { EasingType } from '../intreface/easing';
|
|
4
3
|
import { ACustomAnimate } from './custom-animate';
|
|
5
4
|
interface IAnimationParameters {
|
|
6
5
|
width: number;
|
package/es/custom/growPoints.js
CHANGED
|
@@ -44,25 +44,27 @@ export class GworPointsBase extends ACustomAnimate {
|
|
|
44
44
|
onUpdate(end, ratio, out) {
|
|
45
45
|
var _a, _b;
|
|
46
46
|
const fromPoints = null === (_a = this.from) || void 0 === _a ? void 0 : _a.points, toPoints = null === (_b = this.to) || void 0 === _b ? void 0 : _b.points;
|
|
47
|
-
fromPoints && toPoints && (
|
|
48
|
-
this.target.
|
|
47
|
+
fromPoints && toPoints && (this.target.attribute.points = fromPoints.map(((point, index) => pointInterpolation(fromPoints[index], toPoints[index], ratio))),
|
|
48
|
+
this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag());
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export class GrowPointsIn extends GworPointsBase {
|
|
53
53
|
onBind() {
|
|
54
54
|
var _a;
|
|
55
|
-
if ([ "area", "line" ].includes(this.target.type)) {
|
|
56
|
-
const {from: from, to: to} = growPointsIn(this.target, this.params.options, this.params)
|
|
55
|
+
if (super.onBind(), [ "area", "line", "polygon" ].includes(this.target.type)) {
|
|
56
|
+
const {from: from, to: to} = growPointsIn(this.target, this.params.options, this.params);
|
|
57
57
|
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
58
|
-
this.
|
|
58
|
+
this.from = from, this.to = to;
|
|
59
|
+
const finalAttribute = this.target.getFinalAttribute();
|
|
60
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
|
|
59
61
|
} else this.valid = !1;
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
export class GrowPointsOut extends GworPointsBase {
|
|
64
66
|
onBind() {
|
|
65
|
-
if ([ "area", "line" ].includes(this.target.type)) {
|
|
67
|
+
if (super.onBind(), [ "area", "line" ].includes(this.target.type)) {
|
|
66
68
|
const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (graphic = this.target,
|
|
67
69
|
options = this.params.options, this.params, {
|
|
68
70
|
from: {
|
|
@@ -73,18 +75,17 @@ export class GrowPointsOut extends GworPointsBase {
|
|
|
73
75
|
}
|
|
74
76
|
});
|
|
75
77
|
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
76
|
-
this.
|
|
78
|
+
this.from = from || attrs, this.to = to;
|
|
77
79
|
} else this.valid = !1;
|
|
78
80
|
var graphic, options;
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
const changePointsX = (graphic, options, animationParameters) => graphic.getFinalAttribute().points.map((point => {
|
|
83
|
-
var _a;
|
|
84
85
|
if (options && "negative" === options.orient) {
|
|
85
|
-
let groupRight =
|
|
86
|
-
return
|
|
87
|
-
|
|
86
|
+
let groupRight = graphic.stage.viewWidth;
|
|
87
|
+
return graphic.parent.parent.parent && (groupRight = graphic.parent.parent.parent.AABBBounds.width()),
|
|
88
|
+
Object.assign(Object.assign({}, point), {
|
|
88
89
|
x: groupRight,
|
|
89
90
|
y: point.y,
|
|
90
91
|
x1: groupRight,
|
|
@@ -103,7 +104,7 @@ const changePointsX = (graphic, options, animationParameters) => graphic.getFina
|
|
|
103
104
|
const attrs = graphic.getFinalAttribute();
|
|
104
105
|
return {
|
|
105
106
|
from: {
|
|
106
|
-
points: changePointsX(graphic, options
|
|
107
|
+
points: changePointsX(graphic, options)
|
|
107
108
|
},
|
|
108
109
|
to: {
|
|
109
110
|
points: attrs.points
|
|
@@ -114,46 +115,47 @@ const changePointsX = (graphic, options, animationParameters) => graphic.getFina
|
|
|
114
115
|
points: graphic.getFinalAttribute().points
|
|
115
116
|
},
|
|
116
117
|
to: {
|
|
117
|
-
points: changePointsX(graphic, options
|
|
118
|
+
points: changePointsX(graphic, options)
|
|
118
119
|
}
|
|
119
120
|
});
|
|
120
121
|
|
|
121
122
|
export class GrowPointsXIn extends GworPointsBase {
|
|
122
123
|
onBind() {
|
|
123
124
|
var _a;
|
|
124
|
-
if ([ "area", "line" ].includes(this.target.type)) {
|
|
125
|
-
const {from: from, to: to} = growPointsXIn(this.target, this.params.options, this.params)
|
|
125
|
+
if (super.onBind(), [ "area", "line", "polygon" ].includes(this.target.type)) {
|
|
126
|
+
const {from: from, to: to} = growPointsXIn(this.target, this.params.options, this.params);
|
|
126
127
|
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
127
|
-
this.
|
|
128
|
+
this.from = from, this.to = to;
|
|
129
|
+
const finalAttribute = this.target.getFinalAttribute();
|
|
130
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
|
|
128
131
|
} else this.valid = !1;
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
export class GrowPointsXOut extends GworPointsBase {
|
|
133
136
|
onBind() {
|
|
134
|
-
if ([ "area", "line" ].includes(this.target.type)) {
|
|
137
|
+
if (super.onBind(), [ "area", "line" ].includes(this.target.type)) {
|
|
135
138
|
const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (graphic = this.target,
|
|
136
|
-
options = this.params.options,
|
|
139
|
+
options = this.params.options, this.params, {
|
|
137
140
|
from: {
|
|
138
141
|
points: graphic.getFinalAttribute().points
|
|
139
142
|
},
|
|
140
143
|
to: {
|
|
141
|
-
points: changePointsX(graphic, options
|
|
144
|
+
points: changePointsX(graphic, options)
|
|
142
145
|
}
|
|
143
146
|
});
|
|
144
147
|
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
145
|
-
this.
|
|
148
|
+
this.from = from || attrs, this.to = to;
|
|
146
149
|
} else this.valid = !1;
|
|
147
|
-
var graphic, options
|
|
150
|
+
var graphic, options;
|
|
148
151
|
}
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
const changePointsY = (graphic, options, animationParameters) => graphic.getFinalAttribute().points.map((point => {
|
|
152
|
-
var _a;
|
|
153
155
|
if (options && "negative" === options.orient) {
|
|
154
|
-
let groupBottom =
|
|
155
|
-
return
|
|
156
|
-
|
|
156
|
+
let groupBottom = graphic.stage.viewHeight;
|
|
157
|
+
return graphic.parent.parent.parent && (groupBottom = graphic.parent.parent.parent.AABBBounds.height()),
|
|
158
|
+
Object.assign(Object.assign({}, point), {
|
|
157
159
|
x: point.x,
|
|
158
160
|
y: groupBottom,
|
|
159
161
|
x1: point.x1,
|
|
@@ -172,7 +174,7 @@ const changePointsY = (graphic, options, animationParameters) => graphic.getFina
|
|
|
172
174
|
const attrs = graphic.getFinalAttribute();
|
|
173
175
|
return {
|
|
174
176
|
from: {
|
|
175
|
-
points: changePointsY(graphic, options
|
|
177
|
+
points: changePointsY(graphic, options)
|
|
176
178
|
},
|
|
177
179
|
to: {
|
|
178
180
|
points: attrs.points
|
|
@@ -183,37 +185,39 @@ const changePointsY = (graphic, options, animationParameters) => graphic.getFina
|
|
|
183
185
|
points: graphic.getFinalAttribute().points
|
|
184
186
|
},
|
|
185
187
|
to: {
|
|
186
|
-
points: changePointsY(graphic, options
|
|
188
|
+
points: changePointsY(graphic, options)
|
|
187
189
|
}
|
|
188
190
|
});
|
|
189
191
|
|
|
190
192
|
export class GrowPointsYIn extends GworPointsBase {
|
|
191
193
|
onBind() {
|
|
192
194
|
var _a;
|
|
193
|
-
if ([ "area", "line" ].includes(this.target.type)) {
|
|
194
|
-
const {from: from, to: to} = growPointsYIn(this.target, this.params.options, this.params)
|
|
195
|
+
if (super.onBind(), [ "area", "line", "polygon" ].includes(this.target.type)) {
|
|
196
|
+
const {from: from, to: to} = growPointsYIn(this.target, this.params.options, this.params);
|
|
195
197
|
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
196
|
-
this.
|
|
198
|
+
this.from = from, this.to = to;
|
|
199
|
+
const finalAttribute = this.target.getFinalAttribute();
|
|
200
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
|
|
197
201
|
} else this.valid = !1;
|
|
198
202
|
}
|
|
199
203
|
}
|
|
200
204
|
|
|
201
205
|
export class GrowPointsYOut extends GworPointsBase {
|
|
202
206
|
onBind() {
|
|
203
|
-
if ([ "area", "line" ].includes(this.target.type)) {
|
|
204
|
-
const
|
|
205
|
-
|
|
207
|
+
if (super.onBind(), [ "area", "line", "polygon" ].includes(this.target.type)) {
|
|
208
|
+
const {from: from, to: to} = (graphic = this.target, options = this.params.options,
|
|
209
|
+
this.params, {
|
|
206
210
|
from: {
|
|
207
211
|
points: graphic.getFinalAttribute().points
|
|
208
212
|
},
|
|
209
213
|
to: {
|
|
210
|
-
points: changePointsY(graphic, options
|
|
214
|
+
points: changePointsY(graphic, options)
|
|
211
215
|
}
|
|
212
216
|
});
|
|
213
217
|
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
214
|
-
this.
|
|
218
|
+
this.from = null != from ? from : this.target.attribute, this.to = to;
|
|
215
219
|
} else this.valid = !1;
|
|
216
|
-
var graphic, options
|
|
220
|
+
var graphic, options;
|
|
217
221
|
}
|
|
218
222
|
}
|
|
219
223
|
//# sourceMappingURL=growPoints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom/growPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA8B,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyBlD,MAAM,eAAe,GAAG,CACtB,OAAiB,EACjB,OAA2C,EAC3C,mBAAyC,EACzC,EAAE;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAiB,KAAK,CAAC,MAAM,CAAC;IAC1C,MAAM,MAAM,GAAe,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC1C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACrB,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;QACpB,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC;IAC1B,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC;IAE1B,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE;QAC7B,IAAI,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;YACnC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;SAC7B;QACD,IAAI,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;YACnC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;SAC7B;KACF;IAED,I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CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;YAC/D,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC;YAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;SACd;aAAM;YACL,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;SACpB;IACH,CAAC;CACF","file":"growPoints.js","sourcesContent":["import { pointInterpolation, type IGraphic, type IGroup } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport { isValidNumber } from '@visactor/vutils';\nimport type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\ntype TypeAnimation<T extends IGraphic> = (\n graphic: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nconst getCenterPoints = (\n graphic: IGraphic,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n const points: IPointLike[] = attrs.points;\n const center: IPointLike = { x: 0, y: 0 };\n points.forEach(point => {\n center.x += point.x;\n center.y += point.y;\n });\n center.x /= points.length;\n center.y /= points.length;\n\n if (options && options.center) {\n if (isValidNumber(options.center.x)) {\n center.x = options.center.x;\n }\n if (isValidNumber(options.center.y)) {\n center.y = options.center.y;\n }\n }\n\n if (graphic.type === 'area') {\n center.x1 = center.x;\n center.y1 = center.y;\n }\n\n return points.map(point => Object.assign({}, point, center));\n};\n\nexport const growPointsIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: getCenterPoints(graphic, options, animationParameters) },\n to: { points: attrs.points }\n };\n};\n\nexport const growPointsOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: attrs.points },\n to: { points: getCenterPoints(graphic, options, animationParameters) }\n };\n};\n\nexport class GworPointsBase extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const fromPoints = this.from?.points as unknown as IPointLike[];\n const toPoints = this.to?.points as unknown as IPointLike[];\n if (!fromPoints || !toPoints) {\n return;\n }\n\n out.points = fromPoints.map((point, index) => {\n const newPoint = pointInterpolation(fromPoints[index], toPoints[index], ratio);\n return newPoint;\n });\n this.target.setAttributes(out);\n }\n}\n\n/**\n * 增长渐入\n */\nexport class GrowPointsIn extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const { from, to } = growPointsIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n } else {\n this.valid = false;\n }\n }\n}\n\nexport class GrowPointsOut extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growPointsOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n } else {\n this.valid = false;\n }\n }\n}\n\nconst changePointsX = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n const points = attrs.points;\n return points.map((point: IPointLike) => {\n if (options && options.orient === 'negative') {\n let groupRight = animationParameters.width;\n\n if (animationParameters.group) {\n groupRight = (animationParameters as any).groupWidth ?? animationParameters.group.getBounds().width();\n\n (animationParameters as any).groupWidth = groupRight;\n }\n\n return {\n ...point,\n x: groupRight,\n y: point.y,\n x1: groupRight,\n y1: point.y1,\n defined: point.defined !== false\n } as IPointLike;\n }\n return {\n ...point,\n x: 0,\n y: point.y,\n x1: 0,\n y1: point.y1,\n defined: point.defined !== false\n } as IPointLike;\n });\n};\n\nconst growPointsXIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: changePointsX(graphic, options, animationParameters) },\n to: { points: attrs.points }\n };\n};\n\nconst growPointsXOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: attrs.points },\n to: { points: changePointsX(graphic, options, animationParameters) }\n };\n};\n\nexport class GrowPointsXIn extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const { from, to } = growPointsXIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n } else {\n this.valid = false;\n }\n }\n}\n\nexport class GrowPointsXOut extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growPointsXOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n } else {\n this.valid = false;\n }\n }\n}\n\nconst changePointsY = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n const points = attrs.points;\n return points.map((point: IPointLike) => {\n if (options && options.orient === 'negative') {\n let groupBottom = animationParameters.height;\n\n if (animationParameters.group) {\n groupBottom = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = groupBottom;\n }\n\n return {\n ...point,\n x: point.x,\n y: groupBottom,\n x1: point.x1,\n y1: groupBottom,\n defined: point.defined !== false\n } as IPointLike;\n }\n return {\n ...point,\n x: point.x,\n y: 0,\n x1: point.x1,\n y1: 0,\n defined: point.defined !== false\n } as IPointLike;\n });\n};\n\nconst growPointsYIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: changePointsY(graphic, options, animationParameters) },\n to: { points: attrs.points }\n };\n};\n\nconst growPointsYOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: attrs.points },\n to: { points: changePointsY(graphic, options, animationParameters) }\n };\n};\n\nexport class GrowPointsYIn extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const { from, to } = growPointsYIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n } else {\n this.valid = false;\n }\n }\n}\n\nexport class GrowPointsYOut extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growPointsYOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n } else {\n this.valid = false;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/custom/growPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA+C,MAAM,wBAAwB,CAAC;AAEzG,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyBlD,MAAM,eAAe,GAAG,CACtB,OAAiB,EACjB,OAA2C,EAC3C,mBAAyC,EACzC,EAAE;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAiB,KAAK,CAAC,MAAM,CAAC;IAC1C,MAAM,MAAM,GAAe,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC1C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACrB,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;QACpB,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC;IAC1B,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC;IAE1B,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE;QAC7B,IAAI,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;YACnC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;SAC7B;QACD,IAAI,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;Y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AAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,cAAc;IAChD,MAAM;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAC1D,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACnF,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;YAC/D,IAAI,CAAC,IAAI,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAK,IAAI,CAAC,MAAM,CAAC,SAAiB,CAAC;YACnD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;SACd;aAAM;YACL,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;SACpB;IACH,CAAC;CACF","file":"growPoints.js","sourcesContent":["import { pointInterpolation, type IGraphic, type IGroup, type EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport { isValidNumber } from '@visactor/vutils';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\ntype TypeAnimation<T extends IGraphic> = (\n graphic: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nconst getCenterPoints = (\n graphic: IGraphic,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n const points: IPointLike[] = attrs.points;\n const center: IPointLike = { x: 0, y: 0 };\n points.forEach(point => {\n center.x += point.x;\n center.y += point.y;\n });\n center.x /= points.length;\n center.y /= points.length;\n\n if (options && options.center) {\n if (isValidNumber(options.center.x)) {\n center.x = options.center.x;\n }\n if (isValidNumber(options.center.y)) {\n center.y = options.center.y;\n }\n }\n\n if (graphic.type === 'area') {\n center.x1 = center.x;\n center.y1 = center.y;\n }\n\n return points.map(point => Object.assign({}, point, center));\n};\n\nexport const growPointsIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: getCenterPoints(graphic, options, animationParameters) },\n to: { points: attrs.points }\n };\n};\n\nexport const growPointsOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: attrs.points },\n to: { points: getCenterPoints(graphic, options, animationParameters) }\n };\n};\n\nexport class GworPointsBase extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const fromPoints = this.from?.points as unknown as IPointLike[];\n const toPoints = this.to?.points as unknown as IPointLike[];\n if (!fromPoints || !toPoints) {\n return;\n }\n\n (this.target.attribute as any).points = fromPoints.map((point, index) => {\n const newPoint = pointInterpolation(fromPoints[index], toPoints[index], ratio);\n return newPoint;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n\n/**\n * 增长渐入\n */\nexport class GrowPointsIn extends GworPointsBase {\n onBind(): void {\n super.onBind();\n if (['area', 'line', 'polygon'].includes(this.target.type)) {\n const { from, to } = growPointsIn(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = from;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n if (this.params.controlOptions?.immediatelyApply !== false) {\n this.target.setAttributes(from);\n }\n } else {\n this.valid = false;\n }\n }\n}\n\nexport class GrowPointsOut extends GworPointsBase {\n onBind(): void {\n super.onBind();\n if (['area', 'line'].includes(this.target.type)) {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growPointsOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = from || attrs;\n this.to = to;\n } else {\n this.valid = false;\n }\n }\n}\n\nconst changePointsX = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n const points = attrs.points;\n return points.map((point: IPointLike) => {\n if (options && options.orient === 'negative') {\n let groupRight = graphic.stage.viewWidth;\n\n if (graphic.parent.parent.parent) {\n groupRight = graphic.parent.parent.parent.AABBBounds.width();\n }\n\n return {\n ...point,\n x: groupRight,\n y: point.y,\n x1: groupRight,\n y1: point.y1,\n defined: point.defined !== false\n } as IPointLike;\n }\n return {\n ...point,\n x: 0,\n y: point.y,\n x1: 0,\n y1: point.y1,\n defined: point.defined !== false\n } as IPointLike;\n });\n};\n\nconst growPointsXIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: changePointsX(graphic, options, animationParameters) },\n to: { points: attrs.points }\n };\n};\n\nconst growPointsXOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: attrs.points },\n to: { points: changePointsX(graphic, options, animationParameters) }\n };\n};\n\nexport class GrowPointsXIn extends GworPointsBase {\n onBind(): void {\n super.onBind();\n if (['area', 'line', 'polygon'].includes(this.target.type)) {\n const { from, to } = growPointsXIn(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = from;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n if (this.params.controlOptions?.immediatelyApply !== false) {\n this.target.setAttributes(from);\n }\n } else {\n this.valid = false;\n }\n }\n}\n\nexport class GrowPointsXOut extends GworPointsBase {\n onBind(): void {\n super.onBind();\n if (['area', 'line'].includes(this.target.type)) {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growPointsXOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = from || attrs;\n this.to = to;\n } else {\n this.valid = false;\n }\n }\n}\n\nconst changePointsY = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n const points = attrs.points;\n return points.map((point: IPointLike) => {\n if (options && options.orient === 'negative') {\n let groupBottom = graphic.stage.viewHeight;\n if (graphic.parent.parent.parent) {\n groupBottom = graphic.parent.parent.parent.AABBBounds.height();\n }\n\n return {\n ...point,\n x: point.x,\n y: groupBottom,\n x1: point.x1,\n y1: groupBottom,\n defined: point.defined !== false\n } as IPointLike;\n }\n return {\n ...point,\n x: point.x,\n y: 0,\n x1: point.x1,\n y1: 0,\n defined: point.defined !== false\n } as IPointLike;\n });\n};\n\nconst growPointsYIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: changePointsY(graphic, options, animationParameters) },\n to: { points: attrs.points }\n };\n};\n\nconst growPointsYOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: attrs.points },\n to: { points: changePointsY(graphic, options, animationParameters) }\n };\n};\n\nexport class GrowPointsYIn extends GworPointsBase {\n onBind(): void {\n super.onBind();\n if (['area', 'line', 'polygon'].includes(this.target.type)) {\n const { from, to } = growPointsYIn(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = from;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n\n if (this.params.controlOptions?.immediatelyApply !== false) {\n this.target.setAttributes(from);\n }\n } else {\n this.valid = false;\n }\n }\n}\n\nexport class GrowPointsYOut extends GworPointsBase {\n onBind(): void {\n super.onBind();\n if (['area', 'line', 'polygon'].includes(this.target.type)) {\n const { from, to } = growPointsYOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = from ?? (this.target.attribute as any);\n this.to = to;\n } else {\n this.valid = false;\n }\n }\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type IGraphic, type IGroup } from '@visactor/vrender-core';
|
|
2
|
-
import type { EasingType } from '../intreface/easing';
|
|
1
|
+
import { type IGraphic, type IGroup, type EasingType } from '@visactor/vrender-core';
|
|
3
2
|
import { ACustomAnimate } from './custom-animate';
|
|
4
3
|
interface IAnimationParameters {
|
|
5
4
|
width: number;
|
|
@@ -27,15 +26,15 @@ export interface IGrowRadiusAnimationOptions {
|
|
|
27
26
|
}
|
|
28
27
|
export declare const growRadiusIn: TypeAnimation<IGraphic>;
|
|
29
28
|
export declare const growRadiusOut: TypeAnimation<IGraphic>;
|
|
30
|
-
export declare class
|
|
29
|
+
export declare class GrowPointsBase extends ACustomAnimate<Record<string, number>> {
|
|
31
30
|
valid: boolean;
|
|
32
31
|
constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
|
|
33
32
|
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
34
33
|
}
|
|
35
|
-
export declare class GrowRadiusIn extends
|
|
34
|
+
export declare class GrowRadiusIn extends GrowPointsBase {
|
|
36
35
|
onBind(): void;
|
|
37
36
|
}
|
|
38
|
-
export declare class GrowRadiusOut extends
|
|
37
|
+
export declare class GrowRadiusOut extends GrowPointsBase {
|
|
39
38
|
onBind(): void;
|
|
40
39
|
}
|
|
41
40
|
export {};
|