@visactor/vrender-components 1.1.0-alpha.8 → 1.1.0
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/README.md +9 -1
- package/cjs/animation/axis-animate.d.ts +2 -1
- package/cjs/animation/axis-animate.js +11 -8
- package/cjs/animation/axis-animate.js.map +1 -1
- package/cjs/animation/exit-release.d.ts +13 -0
- package/cjs/animation/exit-release.js +39 -0
- package/cjs/animation/exit-release.js.map +1 -0
- package/cjs/animation/label-animate.d.ts +1 -1
- package/cjs/animation/label-animate.js +10 -20
- package/cjs/animation/label-animate.js.map +1 -1
- package/cjs/animation/static-truth.js +1 -5
- package/cjs/animation/static-truth.js.map +1 -1
- package/cjs/axis/animate/group-transition.d.ts +3 -2
- package/cjs/axis/animate/group-transition.js +3 -3
- package/cjs/axis/animate/group-transition.js.map +1 -1
- package/cjs/axis/base.d.ts +6 -2
- package/cjs/axis/base.js +61 -7
- package/cjs/axis/base.js.map +1 -1
- package/cjs/axis/constant.js +1 -2
- package/cjs/axis/index.js +2 -1
- package/cjs/axis/line.d.ts +1 -1
- package/cjs/axis/line.js +2 -2
- package/cjs/axis/line.js.map +1 -1
- package/cjs/axis/overlap/auto-hide.d.ts +1 -1
- package/cjs/axis/overlap/auto-hide.js.map +1 -1
- package/cjs/axis/register.js +8 -7
- package/cjs/axis/register.js.map +1 -1
- package/cjs/brush/brush.d.ts +4 -0
- package/cjs/brush/brush.js +30 -13
- package/cjs/brush/brush.js.map +1 -1
- package/cjs/brush/register.js +2 -2
- package/cjs/brush/register.js.map +1 -1
- package/cjs/checkbox/register.js +3 -3
- package/cjs/checkbox/register.js.map +1 -1
- package/cjs/core/base.d.ts +2 -2
- package/cjs/core/base.js +3 -3
- package/cjs/core/base.js.map +1 -1
- package/cjs/core/type.d.ts +7 -0
- package/cjs/core/type.js.map +1 -1
- package/cjs/crosshair/polygon-sector.js +1 -2
- package/cjs/crosshair/polygon.js +2 -1
- package/cjs/crosshair/register.js +7 -7
- package/cjs/crosshair/register.js.map +1 -1
- package/cjs/data-zoom/index.js +2 -1
- package/cjs/data-zoom/register.js +3 -3
- package/cjs/data-zoom/register.js.map +1 -1
- package/cjs/empty-tip/register.js +4 -4
- package/cjs/empty-tip/register.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/indicator/register.js +3 -2
- package/cjs/indicator/register.js.map +1 -1
- package/cjs/jsx/component-type.d.ts +2 -3
- package/cjs/jsx/component-type.js.map +1 -1
- package/cjs/jsx/index.js +1 -1
- package/cjs/label/arc.js +13 -8
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/base.d.ts +12 -2
- package/cjs/label/base.js +113 -40
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/dataLabel.d.ts +5 -1
- package/cjs/label/dataLabel.js +46 -1
- package/cjs/label/dataLabel.js.map +1 -1
- package/cjs/label/register.js +4 -3
- package/cjs/label/register.js.map +1 -1
- package/cjs/label-item/register.js +3 -3
- package/cjs/label-item/register.js.map +1 -1
- package/cjs/legend/discrete/discrete.js +4 -2
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/legend/register.js +3 -3
- package/cjs/legend/register.js.map +1 -1
- package/cjs/link-path/register.js +2 -2
- package/cjs/link-path/register.js.map +1 -1
- package/cjs/marker/animate/animate.d.ts +1 -1
- package/cjs/marker/animate/animate.js.map +1 -1
- package/cjs/marker/animate/call-in.d.ts +2 -2
- package/cjs/marker/animate/call-in.js +5 -4
- package/cjs/marker/animate/call-in.js.map +1 -1
- package/cjs/marker/animate/clip-in.js +5 -4
- package/cjs/marker/animate/clip-in.js.map +1 -1
- package/cjs/marker/animate/common.d.ts +1 -0
- package/cjs/marker/animate/common.js +13 -8
- package/cjs/marker/animate/common.js.map +1 -1
- package/cjs/marker/animate/fade-in.d.ts +1 -1
- package/cjs/marker/animate/fade-in.js.map +1 -1
- package/cjs/marker/animate/fade-out.d.ts +1 -1
- package/cjs/marker/animate/fade-out.js.map +1 -1
- package/cjs/marker/arc-area.d.ts +1 -1
- package/cjs/marker/area.d.ts +1 -1
- package/cjs/marker/base.d.ts +6 -2
- package/cjs/marker/base.js +51 -9
- package/cjs/marker/base.js.map +1 -1
- package/cjs/marker/common-line.d.ts +1 -1
- package/cjs/marker/point.d.ts +1 -1
- package/cjs/marker/register.js +8 -8
- package/cjs/marker/register.js.map +1 -1
- package/cjs/marker/type.d.ts +8 -5
- package/cjs/marker/type.js.map +1 -1
- package/cjs/pager/register.js +3 -2
- package/cjs/pager/register.js.map +1 -1
- package/cjs/player/register.js +3 -3
- package/cjs/player/register.js.map +1 -1
- package/cjs/poptip/module.js +3 -1
- package/cjs/poptip/module.js.map +1 -1
- package/cjs/poptip/register.js +3 -3
- package/cjs/poptip/register.js.map +1 -1
- package/cjs/radio/register.js +3 -3
- package/cjs/radio/register.js.map +1 -1
- package/cjs/scrollbar/register.js +2 -2
- package/cjs/scrollbar/register.js.map +1 -1
- package/cjs/segment/register.js +5 -5
- package/cjs/segment/register.js.map +1 -1
- package/cjs/slider/register.js +3 -3
- package/cjs/slider/register.js.map +1 -1
- package/cjs/switch/register.js +3 -3
- package/cjs/switch/register.js.map +1 -1
- package/cjs/table-series-number/register.js +3 -2
- package/cjs/table-series-number/register.js.map +1 -1
- package/cjs/tag/register.js +4 -3
- package/cjs/tag/register.js.map +1 -1
- package/cjs/timeline/register.js +3 -3
- package/cjs/timeline/register.js.map +1 -1
- package/cjs/title/register.js +3 -2
- package/cjs/title/register.js.map +1 -1
- package/cjs/title/title.js +5 -2
- package/cjs/title/title.js.map +1 -1
- package/cjs/tooltip/register.js +3 -3
- package/cjs/tooltip/register.js.map +1 -1
- package/cjs/tooltip/tooltip.js +8 -8
- package/cjs/tooltip/tooltip.js.map +1 -1
- package/cjs/util/event.js +2 -2
- package/cjs/util/event.js.map +1 -1
- package/cjs/util/graphic-creator.js +1 -1
- package/cjs/util/graphic-creator.js.map +1 -1
- package/cjs/util/text.js +3 -3
- package/cjs/util/text.js.map +1 -1
- package/cjs/weather/register.js +2 -2
- package/cjs/weather/register.js.map +1 -1
- package/cjs/weather/weather-box.js +5 -5
- package/cjs/weather/weather-box.js.map +1 -1
- package/dist/index.es.js +6758 -6002
- package/es/animation/axis-animate.d.ts +2 -1
- package/es/animation/axis-animate.js +9 -2
- package/es/animation/axis-animate.js.map +1 -1
- package/es/animation/exit-release.d.ts +13 -0
- package/es/animation/exit-release.js +31 -0
- package/es/animation/exit-release.js.map +1 -0
- package/es/animation/label-animate.d.ts +1 -1
- package/es/animation/label-animate.js +8 -12
- package/es/animation/label-animate.js.map +1 -1
- package/es/animation/static-truth.js +1 -5
- package/es/animation/static-truth.js.map +1 -1
- package/es/axis/animate/group-transition.d.ts +3 -2
- package/es/axis/animate/group-transition.js +2 -2
- package/es/axis/animate/group-transition.js.map +1 -1
- package/es/axis/base.d.ts +6 -2
- package/es/axis/base.js +60 -5
- package/es/axis/base.js.map +1 -1
- package/es/axis/constant.js +1 -2
- package/es/axis/index.js +2 -1
- package/es/axis/line.d.ts +1 -1
- package/es/axis/line.js +2 -2
- package/es/axis/line.js.map +1 -1
- package/es/axis/overlap/auto-hide.d.ts +1 -1
- package/es/axis/overlap/auto-hide.js.map +1 -1
- package/es/axis/register.js +13 -1
- package/es/axis/register.js.map +1 -1
- package/es/brush/brush.d.ts +4 -0
- package/es/brush/brush.js +30 -14
- package/es/brush/brush.js.map +1 -1
- package/es/brush/register.js +3 -1
- package/es/brush/register.js.map +1 -1
- package/es/checkbox/register.js +7 -1
- package/es/checkbox/register.js.map +1 -1
- package/es/core/base.d.ts +2 -2
- package/es/core/base.js +3 -1
- package/es/core/base.js.map +1 -1
- package/es/core/type.d.ts +7 -0
- package/es/core/type.js.map +1 -1
- package/es/crosshair/polygon-sector.js +1 -2
- package/es/crosshair/polygon.js +2 -1
- package/es/crosshair/register.js +9 -1
- package/es/crosshair/register.js.map +1 -1
- package/es/data-zoom/index.js +2 -1
- package/es/data-zoom/register.js +7 -1
- package/es/data-zoom/register.js.map +1 -1
- package/es/empty-tip/register.js +6 -3
- package/es/empty-tip/register.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/indicator/register.js +5 -1
- package/es/indicator/register.js.map +1 -1
- package/es/jsx/component-type.d.ts +2 -3
- package/es/jsx/component-type.js.map +1 -1
- package/es/jsx/index.js +1 -1
- package/es/label/arc.js +13 -8
- package/es/label/arc.js.map +1 -1
- package/es/label/base.d.ts +12 -2
- package/es/label/base.js +106 -30
- package/es/label/base.js.map +1 -1
- package/es/label/dataLabel.d.ts +5 -1
- package/es/label/dataLabel.js +46 -0
- package/es/label/dataLabel.js.map +1 -1
- package/es/label/register.js +7 -1
- package/es/label/register.js.map +1 -1
- package/es/label-item/register.js +7 -1
- package/es/label-item/register.js.map +1 -1
- package/es/legend/discrete/discrete.js +4 -2
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/legend/register.js +3 -1
- package/es/legend/register.js.map +1 -1
- package/es/link-path/register.js +3 -1
- package/es/link-path/register.js.map +1 -1
- package/es/marker/animate/animate.d.ts +1 -1
- package/es/marker/animate/animate.js.map +1 -1
- package/es/marker/animate/call-in.d.ts +2 -2
- package/es/marker/animate/call-in.js +6 -4
- package/es/marker/animate/call-in.js.map +1 -1
- package/es/marker/animate/clip-in.js +6 -4
- package/es/marker/animate/clip-in.js.map +1 -1
- package/es/marker/animate/common.d.ts +1 -0
- package/es/marker/animate/common.js +9 -4
- package/es/marker/animate/common.js.map +1 -1
- package/es/marker/animate/fade-in.d.ts +1 -1
- package/es/marker/animate/fade-in.js.map +1 -1
- package/es/marker/animate/fade-out.d.ts +1 -1
- package/es/marker/animate/fade-out.js.map +1 -1
- package/es/marker/arc-area.d.ts +1 -1
- package/es/marker/area.d.ts +1 -1
- package/es/marker/base.d.ts +6 -2
- package/es/marker/base.js +51 -8
- package/es/marker/base.js.map +1 -1
- package/es/marker/common-line.d.ts +1 -1
- package/es/marker/point.d.ts +1 -1
- package/es/marker/register.js +12 -2
- package/es/marker/register.js.map +1 -1
- package/es/marker/type.d.ts +8 -5
- package/es/marker/type.js.map +1 -1
- package/es/pager/register.js +5 -1
- package/es/pager/register.js.map +1 -1
- package/es/player/register.js +3 -1
- package/es/player/register.js.map +1 -1
- package/es/poptip/module.js +3 -1
- package/es/poptip/module.js.map +1 -1
- package/es/poptip/register.js +7 -1
- package/es/poptip/register.js.map +1 -1
- package/es/radio/register.js +7 -1
- package/es/radio/register.js.map +1 -1
- package/es/scrollbar/register.js +3 -1
- package/es/scrollbar/register.js.map +1 -1
- package/es/segment/register.js +9 -1
- package/es/segment/register.js.map +1 -1
- package/es/slider/register.js +7 -1
- package/es/slider/register.js.map +1 -1
- package/es/switch/register.js +7 -1
- package/es/switch/register.js.map +1 -1
- package/es/table-series-number/register.js +5 -1
- package/es/table-series-number/register.js.map +1 -1
- package/es/tag/register.js +9 -1
- package/es/tag/register.js.map +1 -1
- package/es/timeline/register.js +7 -1
- package/es/timeline/register.js.map +1 -1
- package/es/title/register.js +5 -1
- package/es/title/register.js.map +1 -1
- package/es/title/title.js +5 -2
- package/es/title/title.js.map +1 -1
- package/es/tooltip/register.js +9 -1
- package/es/tooltip/register.js.map +1 -1
- package/es/tooltip/tooltip.js +3 -1
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/util/event.js +1 -1
- package/es/util/event.js.map +1 -1
- package/es/util/graphic-creator.js +1 -1
- package/es/util/graphic-creator.js.map +1 -1
- package/es/util/text.js +1 -1
- package/es/util/text.js.map +1 -1
- package/es/weather/register.js +3 -1
- package/es/weather/register.js.map +1 -1
- package/es/weather/weather-box.js +3 -1
- package/es/weather/weather-box.js.map +1 -1
- package/package.json +486 -6
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { AComponentAnimate } from '@visactor/vrender-animate';
|
|
1
|
+
import { AComponentAnimate } from '@visactor/vrender-animate/custom/custom-animate';
|
|
2
2
|
export declare class AxisEnter extends AComponentAnimate<any> {
|
|
3
3
|
onBind(): void;
|
|
4
4
|
}
|
|
5
5
|
export declare class AxisUpdate extends AComponentAnimate<any> {
|
|
6
6
|
onBind(): void;
|
|
7
7
|
deleteSelfAttr(key: string): void;
|
|
8
|
+
deleteSelfAttrs(keys: string[]): void;
|
|
8
9
|
protected tryPreventConflict(): void;
|
|
9
10
|
}
|
|
10
11
|
export declare function registerAxisAnimate(): void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponentAnimator } from "@visactor/vrender-animate/component";
|
|
2
|
+
|
|
3
|
+
import { AComponentAnimate } from "@visactor/vrender-animate/custom/custom-animate";
|
|
4
|
+
|
|
5
|
+
import { AnimateExecutor } from "@visactor/vrender-animate/executor/animate-executor";
|
|
2
6
|
|
|
3
7
|
import { commitUpdateAnimationTarget } from "./static-truth";
|
|
4
8
|
|
|
@@ -54,7 +58,10 @@ export class AxisUpdate extends AComponentAnimate {
|
|
|
54
58
|
}), this.completeBind(animator);
|
|
55
59
|
}
|
|
56
60
|
deleteSelfAttr(key) {
|
|
57
|
-
|
|
61
|
+
this.deleteSelfAttrs([ key ]);
|
|
62
|
+
}
|
|
63
|
+
deleteSelfAttrs(keys) {
|
|
64
|
+
super.deleteSelfAttrs(keys), this._animator.deleteSelfAttrs(keys);
|
|
58
65
|
}
|
|
59
66
|
tryPreventConflict() {}
|
|
60
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/animation/axis-animate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"sources":["../src/animation/axis-animate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE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OAAO;IACT,CAAC;CACF;AAED,MAAM,UAAU,mBAAmB;IAEjC,eAAe,CAAC,sBAAsB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC/D,eAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC","file":"axis-animate.js","sourcesContent":["import { createComponentAnimator } from '@visactor/vrender-animate/component';\nimport { AComponentAnimate } from '@visactor/vrender-animate/custom/custom-animate';\nimport { AnimateExecutor } from '@visactor/vrender-animate/executor/animate-executor';\nimport { commitUpdateAnimationTarget } from './static-truth';\n\n/**\n * AxisEnter class handles the enter animation for Axis components\n */\nexport class AxisEnter extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n const { config, lastScale, getTickCoord } = this.params;\n\n let ratio = 1;\n const currData = this.target.data;\n if (lastScale && getTickCoord && currData) {\n ratio = 0.7;\n\n const oldValue = lastScale.scale(currData.rawValue);\n const point = getTickCoord(oldValue);\n const newX = this.target.attribute.x;\n const newY = this.target.attribute.y;\n\n commitUpdateAnimationTarget(this.target, { x: newX, y: newY }, { x: point.x, y: point.y });\n animator.animate(this.target, {\n type: 'to',\n to: { x: newX, y: newY },\n duration,\n easing\n });\n }\n\n // if (updateEls && updateEls.length > 1) {\n // ratio = 0.5;\n // const oldData1 = updateEls[0].oldEl.data;\n // const { rawValue: oldRawValue1, value: oldValue1 } = oldData1;\n // const oldData2 = updateEls[1].oldEl.data;\n // const { rawValue: oldRawValue2, value: oldValue2 } = oldData2;\n // const data = this.target.data;\n // const { rawValue: newRawValue } = data;\n // // rawValue 是原始值,value是映射出来的值,假设是线性映射,计算一下newRawValue在old阶段的value是什么值\n // const oldValue =\n // oldValue1 + ((oldValue2 - oldValue1) * (newRawValue - oldRawValue1)) / (oldRawValue2 - oldRawValue1);\n // // 将 x 和 y 做映射\n // const oldX1 = updateEls[0].oldEl.attribute.x;\n // const oldY1 = updateEls[0].oldEl.attribute.y;\n // const oldX2 = updateEls[1].oldEl.attribute.x;\n // const oldY2 = updateEls[1].oldEl.attribute.y;\n // const oldX = oldX1 + ((oldX2 - oldX1) * (oldValue - oldValue1)) / (oldValue2 - oldValue1);\n // const oldY = oldY1 + ((oldY2 - oldY1) * (oldValue - oldValue1)) / (oldValue2 - oldValue1);\n // const newX = this.target.attribute.x;\n // const newY = this.target.attribute.y;\n\n // this.target.setAttributes({ x: oldX, y: oldY });\n // animator.animate(this.target, {\n // type: 'to',\n // to: { x: newX, y: newY },\n // duration,\n // easing\n // });\n // }\n\n animator.animate(this.target, {\n type: config.type ?? 'fadeIn',\n to: config.to,\n duration: duration * ratio,\n easing\n });\n this.completeBind(animator);\n }\n}\n\n/**\n * AxisUpdate class handles the update animation for Axis components\n */\nexport class AxisUpdate extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n const { diffAttrs } = this.params;\n // this.target.applyAnimationState(\n // ['update'],\n // [\n // {\n // name: 'update',\n // animation: {\n // type: 'to',\n // to: { ...this.props },\n // duration,\n // easing,\n // customParameters: {\n // diffAttrs: { ...this.props }\n // }\n // }\n // }\n // ]\n // );\n // console.log('this.props', this.props, { ...this.target.attribute });\n commitUpdateAnimationTarget(this.target, { ...diffAttrs });\n animator.animate(this.target, {\n type: 'to',\n to: { ...diffAttrs },\n duration,\n easing,\n customParameters: {\n diffAttrs: { ...diffAttrs }\n }\n });\n this.completeBind(animator);\n }\n\n // 轴动画本身没有逻辑,具体通过animator中执行,所以当需要屏蔽自身属性时,需要通过animator中执行\n deleteSelfAttr(key: string): void {\n this.deleteSelfAttrs([key]);\n }\n\n deleteSelfAttrs(keys: string[]): void {\n super.deleteSelfAttrs(keys);\n this._animator.deleteSelfAttrs(keys);\n }\n\n // 轴动画本身没有逻辑,具体通过animator中执行,所以本身不需要屏蔽冲突\n protected tryPreventConflict(): void {\n return;\n }\n}\n\nexport function registerAxisAnimate() {\n // Label update animation\n AnimateExecutor.registerBuiltInAnimate('axisEnter', AxisEnter);\n AnimateExecutor.registerBuiltInAnimate('axisUpdate', AxisUpdate);\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IAnimate, IGraphic } from '@visactor/vrender-core';
|
|
2
|
+
export type ExitReleaseCallbackState = {
|
|
3
|
+
finalized: boolean;
|
|
4
|
+
removeFromParent: boolean;
|
|
5
|
+
onComplete: (() => void)[];
|
|
6
|
+
};
|
|
7
|
+
export type AnimateExitReleaseState = ExitReleaseCallbackState & {
|
|
8
|
+
pendingAnimates: Set<IAnimate>;
|
|
9
|
+
};
|
|
10
|
+
export declare function collectTrackedAnimates(graphic: IGraphic, animates?: IAnimate[], visited?: Set<IAnimate>): IAnimate[];
|
|
11
|
+
export declare function appendExitReleaseCallback(state: ExitReleaseCallbackState | undefined, callback?: () => void): void;
|
|
12
|
+
export declare function runExitReleaseCallbacks(callbacks: (() => void)[]): void;
|
|
13
|
+
export declare function bindExitReleaseAnimates<T extends AnimateExitReleaseState>(exitAnimates: IAnimate[], getState: () => T | undefined, finalize: () => void): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function collectTrackedAnimates(graphic, animates = [], visited = new Set) {
|
|
2
|
+
var _a, _b, _c, _d, _e;
|
|
3
|
+
const trackedAnimates = null !== (_c = null === (_b = (_a = graphic).getTrackedAnimates) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : graphic.animates;
|
|
4
|
+
return null == trackedAnimates || trackedAnimates.forEach((animate => {
|
|
5
|
+
animate && !visited.has(animate) && (visited.add(animate), animates.push(animate));
|
|
6
|
+
})), null === (_e = (_d = graphic).forEachChildren) || void 0 === _e || _e.call(_d, (child => {
|
|
7
|
+
collectTrackedAnimates(child, animates, visited);
|
|
8
|
+
})), animates;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function appendExitReleaseCallback(state, callback) {
|
|
12
|
+
callback && (null == state || state.onComplete.push(callback));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function runExitReleaseCallbacks(callbacks) {
|
|
16
|
+
callbacks.forEach((callback => {
|
|
17
|
+
callback();
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function bindExitReleaseAnimates(exitAnimates, getState, finalize) {
|
|
22
|
+
const finish = animate => {
|
|
23
|
+
const state = getState();
|
|
24
|
+
state && !state.finalized && state.pendingAnimates.has(animate) && (state.pendingAnimates.delete(animate),
|
|
25
|
+
state.pendingAnimates.size || finalize());
|
|
26
|
+
};
|
|
27
|
+
exitAnimates.forEach((animate => {
|
|
28
|
+
animate.onEnd((() => finish(animate))), animate.onRemove((() => finish(animate)));
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=exit-release.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/animation/exit-release.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,sBAAsB,CACpC,OAAiB,EACjB,WAAuB,EAAE,EACzB,UAAyB,IAAI,GAAG,EAAE;;IAElC,MAAM,eAAe,GAAG,MAAA,MAAA,MAAC,OAAe,EAAC,kBAAkB,kDAAI,mCAAK,OAAe,CAAC,QAAQ,CAAC;IAE7F,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,CAAC,CAAC,OAAiB,EAAE,EAAE;QAC7C,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACpC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACxB;IACH,CAAC,CAAC,CAAC;IAEH,MAAA,MAAC,OAAkB,EAAC,eAAe,mDAAG,CAAC,KAAe,EAAE,EAAE;QACxD,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAA2C,EAAE,QAAqB;IAC1G,IAAI,QAAQ,EAAE;QACZ,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KAClC;AACH,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,SAAyB;IAC/D,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC3B,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,YAAwB,EACxB,QAA6B,EAC7B,QAAoB;IAEpB,MAAM,MAAM,GAAG,CAAC,OAAiB,EAAE,EAAE;QACnC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;QACzB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACpE,OAAO;SACR;QAED,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE;YAC/B,QAAQ,EAAE,CAAC;SACZ;IACH,CAAC,CAAC;IAEF,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACrC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC","file":"exit-release.js","sourcesContent":["import type { IAnimate, IGraphic, IGroup } from '@visactor/vrender-core';\n\nexport type ExitReleaseCallbackState = {\n finalized: boolean;\n removeFromParent: boolean;\n onComplete: (() => void)[];\n};\n\nexport type AnimateExitReleaseState = ExitReleaseCallbackState & {\n pendingAnimates: Set<IAnimate>;\n};\n\nexport function collectTrackedAnimates(\n graphic: IGraphic,\n animates: IAnimate[] = [],\n visited: Set<IAnimate> = new Set()\n): IAnimate[] {\n const trackedAnimates = (graphic as any).getTrackedAnimates?.() ?? (graphic as any).animates;\n\n trackedAnimates?.forEach((animate: IAnimate) => {\n if (animate && !visited.has(animate)) {\n visited.add(animate);\n animates.push(animate);\n }\n });\n\n (graphic as IGroup).forEachChildren?.((child: IGraphic) => {\n collectTrackedAnimates(child, animates, visited);\n });\n\n return animates;\n}\n\nexport function appendExitReleaseCallback(state: ExitReleaseCallbackState | undefined, callback?: () => void) {\n if (callback) {\n state?.onComplete.push(callback);\n }\n}\n\nexport function runExitReleaseCallbacks(callbacks: (() => void)[]) {\n callbacks.forEach(callback => {\n callback();\n });\n}\n\nexport function bindExitReleaseAnimates<T extends AnimateExitReleaseState>(\n exitAnimates: IAnimate[],\n getState: () => T | undefined,\n finalize: () => void\n) {\n const finish = (animate: IAnimate) => {\n const state = getState();\n if (!state || state.finalized || !state.pendingAnimates.has(animate)) {\n return;\n }\n\n state.pendingAnimates.delete(animate);\n if (!state.pendingAnimates.size) {\n finalize();\n }\n };\n\n exitAnimates.forEach(animate => {\n animate.onEnd(() => finish(animate));\n animate.onRemove(() => finish(animate));\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AComponentAnimate } from '@visactor/vrender-animate';
|
|
1
|
+
import { AComponentAnimate } from '@visactor/vrender-animate/custom/custom-animate';
|
|
2
2
|
export declare class LabelUpdate extends AComponentAnimate<any> {
|
|
3
3
|
onBind(): void;
|
|
4
4
|
protected tryPreventConflict(): void;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
1
|
+
import { createComponentAnimator } from "@visactor/vrender-animate/component";
|
|
2
|
+
|
|
3
|
+
import { AComponentAnimate } from "@visactor/vrender-animate/custom/custom-animate";
|
|
4
|
+
|
|
5
|
+
import { IncreaseCount } from "@visactor/vrender-animate/custom/number";
|
|
10
6
|
|
|
11
|
-
import {
|
|
7
|
+
import { AnimateExecutor } from "@visactor/vrender-animate/executor/animate-executor";
|
|
12
8
|
|
|
13
9
|
export class LabelUpdate extends AComponentAnimate {
|
|
14
10
|
onBind() {
|
|
@@ -16,8 +12,8 @@ export class LabelUpdate extends AComponentAnimate {
|
|
|
16
12
|
this._animator = animator;
|
|
17
13
|
const duration = this.duration, easing = this.easing, {prevText: prevText, curText: curText, prevLabelLine: prevLabelLine, curLabelLine: curLabelLine, increaseEffect: increaseEffect = !0} = this.params, diff = {};
|
|
18
14
|
for (const key in curText.attribute) prevText.attribute[key] !== curText.attribute[key] && (diff[key] = curText.attribute[key]);
|
|
19
|
-
const
|
|
20
|
-
animator.animate(prevText, {
|
|
15
|
+
const rest = Object.assign({}, diff);
|
|
16
|
+
delete rest.text, animator.animate(prevText, {
|
|
21
17
|
type: "to",
|
|
22
18
|
to: rest,
|
|
23
19
|
duration: duration,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/animation/label-animate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/animation/label-animate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAKtF,MAAM,OAAO,WAAY,SAAQ,iBAAsB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AC,CAAC;wBACvF,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;SACN;aAAM;YAEL,cAAc,CAAC,QAAQ;gBACrB,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAY,EAAE,EAAE;oBAC/C,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;gBAC1D,CAAC,CAAC,CAAC;SACN;QAED,QAAQ,CAAC,OAAO,CAAC,MAAM,kCAClB,MAAM,KACT,QAAQ;YACR,MAAM;YACN,SAAS;YACT,IAAI,IACJ,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAGS,kBAAkB;QAC1B,OAAO;IACT,CAAC;CACF;AAED,MAAM,UAAU,oBAAoB;IAClC,eAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;IAEvE,eAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACnE,eAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC","file":"label-animate.js","sourcesContent":["import { createComponentAnimator } from '@visactor/vrender-animate/component';\nimport { AComponentAnimate } from '@visactor/vrender-animate/custom/custom-animate';\nimport { IncreaseCount } from '@visactor/vrender-animate/custom/number';\nimport { AnimateExecutor } from '@visactor/vrender-animate/executor/animate-executor';\n\n/**\n * LabelUpdate class handles the update animation for Label components\n */\nexport class LabelUpdate extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n\n const { prevText, curText, prevLabelLine, curLabelLine, increaseEffect = true } = this.params;\n const diff: Record<string, any> = {};\n\n for (const key in curText.attribute) {\n if (prevText.attribute[key] !== curText.attribute[key]) {\n diff[key] = curText.attribute[key];\n }\n }\n\n const rest = { ...diff };\n delete rest.text;\n\n animator.animate(prevText, {\n type: 'to',\n to: rest,\n duration,\n easing\n });\n\n if (increaseEffect !== false) {\n animator.animate(prevText, {\n type: 'increaseCount',\n to: {\n text: curText.attribute.text\n },\n duration,\n easing\n });\n }\n\n if (prevLabelLine) {\n animator.animate(prevLabelLine, {\n type: 'to',\n to: curLabelLine.attribute,\n duration,\n easing\n });\n }\n\n this.completeBind(animator);\n }\n\n // 标签动画本身没有逻辑,具体通过animator中执行,所以本身不需要屏蔽冲突\n protected tryPreventConflict(): void {\n return;\n }\n}\n\nexport class LabelEnter extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n\n const { relatedGraphic, relatedGraphics, config } = this.params;\n const { mode, type = 'fadeIn' } = config;\n\n const target = this.target;\n\n let startTime = 0;\n\n if (mode === 'after') {\n relatedGraphic.animates &&\n relatedGraphic.animates.forEach((animate: any) => {\n startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());\n });\n } else if (mode === 'after-all') {\n relatedGraphics &&\n relatedGraphics.forEach((graphic: any) => {\n graphic.animates &&\n graphic.animates.forEach((animate: any) => {\n startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());\n });\n });\n } else {\n // 'same-time'\n relatedGraphic.animates &&\n relatedGraphic.animates.forEach((animate: any) => {\n startTime = Math.max(startTime, animate.getStartTime());\n });\n }\n\n animator.animate(target, {\n ...config,\n duration,\n easing,\n startTime,\n type\n });\n\n this.completeBind(animator);\n }\n\n // 标签动画本身没有逻辑,具体通过animator中执行,所以本身不需要屏蔽冲突\n protected tryPreventConflict(): void {\n return;\n }\n}\n\nexport function registerLabelAnimate() {\n AnimateExecutor.registerBuiltInAnimate('increaseCount', IncreaseCount);\n // Label update animation\n AnimateExecutor.registerBuiltInAnimate('labelUpdate', LabelUpdate);\n AnimateExecutor.registerBuiltInAnimate('labelEnter', LabelEnter);\n}\n"]}
|
|
@@ -6,11 +6,7 @@ export function commitUpdateAnimationTarget(graphic, targetAttrs, startAttrs) {
|
|
|
6
6
|
var _a, _b, _c, _d;
|
|
7
7
|
if (!graphic || !targetAttrs) return;
|
|
8
8
|
const committedTargetAttrs = cloneDeep(targetAttrs), transientStartAttrs = cloneDeep(null != startAttrs ? startAttrs : graphic.attribute);
|
|
9
|
-
graphic.setAttributes(committedTargetAttrs)
|
|
10
|
-
const baseAttributes = graphic.baseAttributes;
|
|
11
|
-
baseAttributes && "object" == typeof baseAttributes && Object.keys(committedTargetAttrs).forEach((key => {
|
|
12
|
-
baseAttributes[key] = cloneDeep(committedTargetAttrs[key]);
|
|
13
|
-
})), null === (_b = (_a = graphic).setFinalAttributes) || void 0 === _b || _b.call(_a, committedTargetAttrs),
|
|
9
|
+
graphic.setAttributes(committedTargetAttrs), null === (_b = (_a = graphic).setFinalAttributes) || void 0 === _b || _b.call(_a, committedTargetAttrs),
|
|
14
10
|
null === (_d = (_c = graphic).setAttributesAndPreventAnimate) || void 0 === _d || _d.call(_c, transientStartAttrs, !1, {
|
|
15
11
|
type: AttributeUpdateType.ANIMATE_BIND
|
|
16
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/animation/static-truth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAiB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,UAAU,2BAA2B,CACzC,OAAkB,EAClB,WAAiC,EACjC,UAAgC;;IAEhC,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,EAAE;QAC5B,OAAO;KACR;IAED,MAAM,oBAAoB,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IACpD,MAAM,mBAAmB,GAAG,SAAS,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAEvE,OAAO,CAAC,aAAa,CAAC,oBAA2B,CAAC,CAAC;IACnD,
|
|
1
|
+
{"version":3,"sources":["../src/animation/static-truth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAiB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,UAAU,2BAA2B,CACzC,OAAkB,EAClB,WAAiC,EACjC,UAAgC;;IAEhC,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,EAAE;QAC5B,OAAO;KACR;IAED,MAAM,oBAAoB,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IACpD,MAAM,mBAAmB,GAAG,SAAS,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAEvE,OAAO,CAAC,aAAa,CAAC,oBAA2B,CAAC,CAAC;IACnD,MAAA,MAAC,OAAe,EAAC,kBAAkB,mDAAG,oBAAoB,CAAC,CAAC;IAC5D,MAAA,MAAC,OAAe,EAAC,8BAA8B,mDAAG,mBAA0B,EAAE,KAAK,EAAE;QACnF,IAAI,EAAE,mBAAmB,CAAC,YAAY;KACvC,CAAC,CAAC;AACL,CAAC","file":"static-truth.js","sourcesContent":["import { AttributeUpdateType, type IGraphic } from '@visactor/vrender-core';\nimport { cloneDeep } from '@visactor/vutils';\n\nexport function commitUpdateAnimationTarget(\n graphic?: IGraphic,\n targetAttrs?: Record<string, any>,\n startAttrs?: Record<string, any>\n) {\n if (!graphic || !targetAttrs) {\n return;\n }\n\n const committedTargetAttrs = cloneDeep(targetAttrs);\n const transientStartAttrs = cloneDeep(startAttrs ?? graphic.attribute);\n\n graphic.setAttributes(committedTargetAttrs as any);\n (graphic as any).setFinalAttributes?.(committedTargetAttrs);\n (graphic as any).setAttributesAndPreventAnimate?.(transientStartAttrs as any, false, {\n type: AttributeUpdateType.ANIMATE_BIND\n });\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { IGroup } from '@visactor/vrender-core';
|
|
2
|
+
import { AnimateMode } from '@visactor/vrender-core/event/constant';
|
|
3
|
+
import { ACustomAnimate } from '@visactor/vrender-animate/custom/custom-animate';
|
|
3
4
|
export declare class GroupTransition extends ACustomAnimate<any> {
|
|
4
5
|
target: IGroup;
|
|
5
6
|
private _newElementAttrMap;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnimateMode } from "@visactor/vrender-core";
|
|
1
|
+
import { AnimateMode } from "@visactor/vrender-core/event/constant";
|
|
2
2
|
|
|
3
|
-
import { ACustomAnimate } from "@visactor/vrender-animate";
|
|
3
|
+
import { ACustomAnimate } from "@visactor/vrender-animate/custom/custom-animate";
|
|
4
4
|
|
|
5
5
|
import { cloneDeep, interpolateString, isEqual, isValidNumber } from "@visactor/vutils";
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/axis/animate/group-transition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/axis/animate/group-transition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,EAAa,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAE3E,MAAM,OAAO,eAAgB,SAAQ,cAAmB;IAAxD;;QAKE,SAAI,GAAG,WAAW,CAAC,MAAM,CAAC;IA0G5B,CAAC;IAxGC,MAAM;QACJ,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QAEpD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,gB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ACP,WAAW,CAAC,GAAW,EAAE,KAAa,EAAE,IAAS,EAAE,EAAO,EAAE,cAAmB;4BAC7E,IAAI,GAAG,KAAK,MAAM,EAAE;gCAClB,cAAc,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;gCACzD,OAAO,IAAI,CAAC;6BACb;4BAED,OAAO,KAAK,CAAC;wBACf,CAAC;qBACF,CAAC;yBAED,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAoB,CAAC,CAAC;iBAC9C;qBAAM;oBACJ,IAAiB;yBACf,OAAO,EAAE;yBAET,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAoB,CAAC,CAAC;iBAC9C;YACH,CAAC,CAAC,CAAC;IACP,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;IAE9D,CAAC;CACF","file":"group-transition.js","sourcesContent":["import type { EasingType, IGraphic, IGroup } from '@visactor/vrender-core';\nimport { AnimateMode } from '@visactor/vrender-core/event/constant';\nimport { ACustomAnimate } from '@visactor/vrender-animate/custom/custom-animate';\nimport { cloneDeep, interpolateString, isEqual, isValidNumber, type Dict } from '@visactor/vutils';\nimport { traverseGroup } from '../../util';\nimport { commitUpdateAnimationTarget } from '../../animation/static-truth';\n\nexport class GroupTransition extends ACustomAnimate<any> {\n declare target: IGroup;\n\n private _newElementAttrMap: Dict<any>;\n private _started: boolean;\n mode = AnimateMode.NORMAL; // 组件的群组动画不需要设置走 AnimateMode.SET_ATTR_IMMEDIATELY\n\n onBind(): void {\n this._started = false;\n // @ts-ignore\n const currentInnerView = this.target.getInnerView();\n // @ts-ignore\n const prevInnerView = this.target.getPrevInnerView();\n if (!prevInnerView) {\n return;\n }\n\n this._newElementAttrMap = {};\n\n // 遍历新的场景树,将新节点属性更新为旧节点\n // TODO: 目前只处理更新场景\n traverseGroup(currentInnerView, (el: IGraphic) => {\n if ((el as IGraphic).type !== 'group' && el.id) {\n const oldEl = prevInnerView[el.id];\n if (oldEl) {\n if (!isEqual((el as IGraphic).attribute, (oldEl as IGraphic).attribute)) {\n // 更新\n const newProps = cloneDeep((el as IGraphic).attribute);\n this._newElementAttrMap[el.id] = {\n state: 'update',\n node: el,\n attrs: {\n ...newProps,\n opacity: newProps.opacity ?? 1,\n fillOpacity: newProps.fillOpacity ?? 1,\n strokeOpacity: newProps.strokeOpacity ?? 1\n }\n };\n\n commitUpdateAnimationTarget(\n el as IGraphic,\n this._newElementAttrMap[el.id].attrs,\n cloneDeep((oldEl as IGraphic).attribute)\n );\n }\n } else {\n // 新入场元素,进行 fadeIn 动画\n const finalOpacityAttrs = {\n opacity: el.attribute.opacity ?? 1,\n fillOpacity: el.attribute.fillOpacity ?? 1,\n strokeOpacity: el.attribute.strokeOpacity ?? 1\n };\n this._newElementAttrMap[el.id] = {\n state: 'enter',\n node: el,\n attrs: finalOpacityAttrs\n };\n commitUpdateAnimationTarget(el as IGraphic, finalOpacityAttrs, {\n opacity: 0,\n fillOpacity: 0,\n strokeOpacity: 0\n });\n }\n }\n });\n }\n\n onStart(): void {\n if (this._started) {\n return;\n }\n this._started = true;\n\n let duration = this.duration;\n let easing = this.easing;\n\n // 新的场景树\n this._newElementAttrMap &&\n Object.keys(this._newElementAttrMap).forEach(id => {\n const { node, attrs, state } = this._newElementAttrMap[id];\n if (state === 'enter') {\n const { enter = {} } = this.params ?? {};\n duration = isValidNumber(enter.duration) ? enter.duration : duration;\n easing = enter.easing ? enter.easing : easing;\n }\n if ((node as IGraphic).type === 'path') {\n (node as IGraphic)\n .animate({\n interpolate(key: string, ratio: number, from: any, to: any, nextAttributes: any) {\n if (key === 'path') {\n nextAttributes.path = interpolateString(from, to)(ratio);\n return true;\n }\n\n return false;\n }\n })\n // .wait(delay)\n .to(attrs, duration, easing as EasingType);\n } else {\n (node as IGraphic)\n .animate()\n // .wait(delay)\n .to(attrs, duration, easing as EasingType);\n }\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // do nothing\n }\n}\n"]}
|
package/es/axis/base.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IGroup, ITextGraphicAttribute, TextAlignType, TextBaselineType, IGraphic, IText } from '@visactor/vrender-core';
|
|
2
2
|
import type { Dict } from '@visactor/vutils';
|
|
3
|
-
import type { Point } from '../core/type';
|
|
3
|
+
import type { ComponentExitReleaseOptions, Point } from '../core/type';
|
|
4
4
|
import type { TagAttributes } from '../tag';
|
|
5
5
|
import type { AxisBaseAttributes, AxisItem, TransformedAxisItem, TickLineItem } from './type';
|
|
6
6
|
import { AnimateComponent } from '../animation/animate-component';
|
|
@@ -30,6 +30,7 @@ export declare abstract class AxisBase<T extends AxisBaseAttributes> extends Ani
|
|
|
30
30
|
protected axisContainer: IGroup;
|
|
31
31
|
private _lastHover;
|
|
32
32
|
private _lastSelect;
|
|
33
|
+
private _exitReleaseState?;
|
|
33
34
|
protected _newElementAttrMap: Dict<any>;
|
|
34
35
|
protected abstract renderLine(container: IGroup): void;
|
|
35
36
|
abstract isInValidValue(value: number): boolean;
|
|
@@ -45,6 +46,9 @@ export declare abstract class AxisBase<T extends AxisBaseAttributes> extends Ani
|
|
|
45
46
|
textBaseline: TextBaselineType;
|
|
46
47
|
};
|
|
47
48
|
getBoundsWithoutRender(attributes: Partial<T>): import("@visactor/vutils").IBounds;
|
|
49
|
+
private _finalizeExitRelease;
|
|
50
|
+
private _runExitAnimationBeforeRelease;
|
|
51
|
+
releaseWithExitAnimation(options?: ComponentExitReleaseOptions): boolean;
|
|
48
52
|
protected render(): void;
|
|
49
53
|
protected _prepare(): void;
|
|
50
54
|
private _bindEvent;
|
|
@@ -63,5 +67,5 @@ export declare abstract class AxisBase<T extends AxisBaseAttributes> extends Ani
|
|
|
63
67
|
protected getLabelPosition(point: Point, vector: [number, number], text: string | number, style: Partial<ITextGraphicAttribute>): Point;
|
|
64
68
|
private _transformItems;
|
|
65
69
|
protected runAnimation(): void;
|
|
66
|
-
release(): void;
|
|
70
|
+
release(all?: boolean): void;
|
|
67
71
|
}
|
package/es/axis/base.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { diff } from "@visactor/vrender-core";
|
|
1
|
+
import { diff } from "@visactor/vrender-core/common/diff";
|
|
2
2
|
|
|
3
3
|
import { graphicCreator } from "../util/graphic-creator";
|
|
4
4
|
|
|
@@ -22,6 +22,8 @@ import { AnimateComponent } from "../animation/animate-component";
|
|
|
22
22
|
|
|
23
23
|
import { commitUpdateAnimationTarget } from "../animation/static-truth";
|
|
24
24
|
|
|
25
|
+
import { appendExitReleaseCallback, bindExitReleaseAnimates, collectTrackedAnimates, runExitReleaseCallbacks } from "../animation/exit-release";
|
|
26
|
+
|
|
25
27
|
import { DefaultAxisAnimation } from "./animate/config";
|
|
26
28
|
|
|
27
29
|
export class AxisBase extends AnimateComponent {
|
|
@@ -52,14 +54,65 @@ export class AxisBase extends AnimateComponent {
|
|
|
52
54
|
return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup),
|
|
53
55
|
this.attribute = currentAttribute, offscreenGroup.AABBBounds;
|
|
54
56
|
}
|
|
57
|
+
_finalizeExitRelease() {
|
|
58
|
+
var _a, _b;
|
|
59
|
+
const state = this._exitReleaseState;
|
|
60
|
+
if (null == state ? void 0 : state.finalized) return;
|
|
61
|
+
state && (state.finalized = !0);
|
|
62
|
+
const parent = this.parent, removeFromParent = !!(null == state ? void 0 : state.removeFromParent), callbacks = null !== (_a = null == state ? void 0 : state.onComplete) && void 0 !== _a ? _a : [];
|
|
63
|
+
this._exitReleaseState = void 0, this._prevInnerView = null, this._innerView = null,
|
|
64
|
+
this.axisLabelsContainer = null, this.axisContainer = null, this.removeAllChild(!0),
|
|
65
|
+
super.release(!0), removeFromParent && (null === (_b = null != parent ? parent : this.parent) || void 0 === _b || _b.removeChild(this)),
|
|
66
|
+
runExitReleaseCallbacks(callbacks);
|
|
67
|
+
}
|
|
68
|
+
_runExitAnimationBeforeRelease(options = {}) {
|
|
69
|
+
var _a, _b, _c;
|
|
70
|
+
if (this._exitReleaseState && !this._exitReleaseState.finalized) return this._exitReleaseState.removeFromParent = this._exitReleaseState.removeFromParent || !!options.removeFromParent,
|
|
71
|
+
appendExitReleaseCallback(this._exitReleaseState, options.onComplete), !0;
|
|
72
|
+
if (!this.stage || !1 === this.attribute.animation || !1 === this.attribute.animationExit || !this._innerView) return !1;
|
|
73
|
+
if (this._prepare(), !(null === (_a = this._animationConfig) || void 0 === _a ? void 0 : _a.exit)) return !1;
|
|
74
|
+
const exitTargets = new Set;
|
|
75
|
+
if (traverseGroup(this._innerView, (el => {
|
|
76
|
+
"group" !== el.type && exitTargets.add(el);
|
|
77
|
+
})), !exitTargets.size) return !1;
|
|
78
|
+
const existingAnimates = collectTrackedAnimates(this), {delay: delay = 0, duration: duration = DefaultAxisAnimation.duration, easing: easing = DefaultAxisAnimation.easing} = this._animationConfig.exit;
|
|
79
|
+
exitTargets.forEach((target => {
|
|
80
|
+
var _a, _b, _c;
|
|
81
|
+
const startAttrs = {
|
|
82
|
+
opacity: null !== (_a = target.attribute.opacity) && void 0 !== _a ? _a : 1,
|
|
83
|
+
fillOpacity: null !== (_b = target.attribute.fillOpacity) && void 0 !== _b ? _b : 1,
|
|
84
|
+
strokeOpacity: null !== (_c = target.attribute.strokeOpacity) && void 0 !== _c ? _c : 1
|
|
85
|
+
}, endAttrs = {
|
|
86
|
+
opacity: 0,
|
|
87
|
+
fillOpacity: 0,
|
|
88
|
+
strokeOpacity: 0
|
|
89
|
+
};
|
|
90
|
+
commitUpdateAnimationTarget(target, endAttrs, startAttrs), target.animate().wait(delay).to(endAttrs, duration, easing);
|
|
91
|
+
}));
|
|
92
|
+
const exitAnimates = collectTrackedAnimates(this).filter((animate => !existingAnimates.includes(animate)));
|
|
93
|
+
if (!exitAnimates.length) return !1;
|
|
94
|
+
this.setAttribute("childrenPickable", !1), null === (_c = (_b = this._innerView).removeAllEventListeners) || void 0 === _c || _c.call(_b),
|
|
95
|
+
this.releaseStatus = "willRelease";
|
|
96
|
+
const pendingAnimates = new Set(exitAnimates);
|
|
97
|
+
return this._exitReleaseState = {
|
|
98
|
+
pendingAnimates: pendingAnimates,
|
|
99
|
+
finalized: !1,
|
|
100
|
+
removeFromParent: !!options.removeFromParent,
|
|
101
|
+
onComplete: options.onComplete ? [ options.onComplete ] : []
|
|
102
|
+
}, bindExitReleaseAnimates(exitAnimates, (() => this._exitReleaseState), (() => this._finalizeExitRelease())),
|
|
103
|
+
!0;
|
|
104
|
+
}
|
|
105
|
+
releaseWithExitAnimation(options = {}) {
|
|
106
|
+
return "released" !== this.releaseStatus && this._runExitAnimationBeforeRelease(options);
|
|
107
|
+
}
|
|
55
108
|
render() {
|
|
56
|
-
this._prepare(), this._prevInnerView = this._innerView && getElMap(this._innerView),
|
|
109
|
+
this._exitReleaseState || (this._prepare(), this._prevInnerView = this._innerView && getElMap(this._innerView),
|
|
57
110
|
this.removeAllChild(!0), this._innerView = graphicCreator.group({
|
|
58
111
|
x: 0,
|
|
59
112
|
y: 0,
|
|
60
113
|
pickable: !1
|
|
61
114
|
}), this.add(this._innerView), this._renderInner(this._innerView), this._bindEvent(),
|
|
62
|
-
this.runAnimation();
|
|
115
|
+
this.runAnimation());
|
|
63
116
|
}
|
|
64
117
|
_prepare() {
|
|
65
118
|
this._prepareAnimate(DefaultAxisAnimation);
|
|
@@ -337,8 +390,10 @@ export class AxisBase extends AnimateComponent {
|
|
|
337
390
|
}));
|
|
338
391
|
}
|
|
339
392
|
}
|
|
340
|
-
release() {
|
|
341
|
-
|
|
393
|
+
release(all) {
|
|
394
|
+
this._exitReleaseState ? this._finalizeExitRelease() : (all && this.removeAllChild(!0),
|
|
395
|
+
super.release(all), all && this.removeAllChild(!0), this._prevInnerView = null,
|
|
396
|
+
this._innerView = null);
|
|
342
397
|
}
|
|
343
398
|
}
|
|
344
399
|
//# sourceMappingURL=base.js.map
|