@visactor/vgrammar-core 0.16.4-alpha.4 → 0.17.0-alpha.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/cjs/glyph/index.d.ts +1 -1
- package/cjs/glyph/index.js +6 -1
- package/cjs/glyph/index.js.map +1 -1
- package/cjs/glyph/link-path.d.ts +14 -0
- package/cjs/glyph/link-path.js +104 -58
- package/cjs/glyph/link-path.js.map +1 -1
- package/cjs/graph/animation/animator.js +3 -5
- package/cjs/graph/animation/animator.js.map +1 -1
- package/cjs/graph/animation/attribute.d.ts +1 -2
- package/cjs/graph/animation/attribute.js +8 -25
- package/cjs/graph/animation/attribute.js.map +1 -1
- package/cjs/graph/animation/morph.js +9 -36
- package/cjs/graph/animation/morph.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/types/animate.d.ts +2 -1
- package/cjs/types/animate.js.map +1 -1
- package/es/glyph/index.d.ts +1 -1
- package/es/glyph/index.js +1 -1
- package/es/glyph/index.js.map +1 -1
- package/es/glyph/link-path.d.ts +14 -0
- package/es/glyph/link-path.js +90 -56
- package/es/glyph/link-path.js.map +1 -1
- package/es/graph/animation/animator.js +2 -4
- package/es/graph/animation/animator.js.map +1 -1
- package/es/graph/animation/attribute.d.ts +1 -2
- package/es/graph/animation/attribute.js +8 -23
- package/es/graph/animation/attribute.js.map +1 -1
- package/es/graph/animation/morph.js +7 -32
- package/es/graph/animation/morph.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/interactions/brush-base.js +2 -1
- package/es/interactions/element-active.js +1 -2
- package/es/interactions/element-select.js +2 -1
- package/es/interactions/filter.js +1 -1
- package/es/interactions/fish-eye.js +1 -1
- package/es/interactions/index.js +1 -1
- package/es/interactions/legend-filter.js +1 -1
- package/es/interactions/player-filter.js +1 -1
- package/es/interactions/roll-up.js +1 -1
- package/es/interactions/scrollbar-filter.js +1 -1
- package/es/parse/coordinate.js +1 -1
- package/es/parse/event.js +1 -1
- package/es/parse/mark.js +1 -1
- package/es/parse/option.js +1 -2
- package/es/parse/scale.js +1 -1
- package/es/parse/transform.js +1 -1
- package/es/parse/util.js +1 -1
- package/es/parse/view.js +1 -1
- package/es/types/animate.d.ts +2 -1
- package/es/types/animate.js.map +1 -1
- package/package.json +9 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/animation/attribute.ts"],"names":[],"mappings":";;;AAEA,yDAAkG;AAClG,6CAAiF;AASjF,mDAA6D;AAC7D,gDAA6C;AAE7C,MAAM,4BAA4B,GAAG,CAAC,UAAiC,EAAE,OAAiB,EAAyB,EAAE;IACnH,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,IAAI,CAAC;KACb;IAED,IAAI,UAAU,CAAC,IAAI,EAAE;QACnB,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACzB,IAAI,IAAA,cAAK,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE;gBACxB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;aACtB;QACH,CAAC,CAAC,CAAC;QACH,MAAM,aAAa,GAAG,IAAA,8BAAoB,EAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAA,gBAAO,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvG,IAAI,aAAa,EAAE;YACjB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,E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,WAAW,KAAK,CAAC,EAAE;YAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;SACnB;QACD,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;QAGtB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACnC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;gBAC1C,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;IACH,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,MAAM,CAAC,eAAe,CACzB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,UAAU,CAAC,OAAO,EACvB,GAAG,EACH,IAAI,CAAC,IAAI,EACT,KAAK,EACL,GAAG,EACH,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,cAAc,CACpB,CAAC;IACJ,CAAC;CACF;AA7GD,4CA6GC","file":"attribute.js","sourcesContent":["import type { EasingType, IGraphic } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { ACustomAnimate, AttributeUpdateType, NOWORK_ANIMATE_ATTR } from '@visactor/vrender-core';\nimport { isArray, isFunction, isNil, isObject, isValid } from '@visactor/vutils';\nimport type {\n IAnimationChannelInterpolator,\n IAnimationEffect,\n IAnimationParameters,\n IElement,\n IGlyphElement,\n IParsedAnimationAttrs\n} from '../../types';\nimport { isValidPointsChannel } from '../attributes/helpers';\nimport { Factory } from '../../core/factory';\n\nconst transformAnimationAttributes = (attributes: IParsedAnimationAttrs, element: IElement): IParsedAnimationAttrs => {\n if (!attributes) {\n return null;\n }\n\n if (attributes.from) {\n const from = attributes.from;\n const fromKeys = Object.keys(from);\n fromKeys.forEach(channel => {\n if (isNil(from[channel])) {\n delete from[channel];\n }\n });\n const computePoints = isValidPointsChannel(fromKeys, element.mark.markType) && !isValid(from.segments);\n if (computePoints) {\n const items = element.items.map(item => Object.assign({}, item, { nextAttrs: Object.assign({}, from) }));\n attributes.from = element.transformElementItems(items, element.mark.markType, computePoints);\n }\n }\n if (attributes.to) {\n const to = attributes.to;\n const toKeys = Object.keys(to);\n toKeys.forEach(channel => {\n if (isNil(to[channel])) {\n delete to[channel];\n }\n });\n const computePoints = isValidPointsChannel(toKeys, element.mark.markType) && !isValid(to.segments);\n if (computePoints) {\n const items = element.items.map(item => Object.assign({}, item, { nextAttrs: Object.assign({}, to) }));\n attributes.to = element.transformElementItems(items, element.mark.markType, computePoints);\n }\n }\n\n return attributes;\n};\n\nexport function typeAnimationAttributes(\n element: IElement,\n effect: IAnimationEffect,\n animationParameters: IAnimationParameters,\n parameters: any\n): IParsedAnimationAttrs {\n // const parameters =\n const options = isFunction(effect.options)\n ? effect.options.call(null, element.getDatum(), element, parameters)\n : effect.options;\n if (!effect.type || !Factory.getAnimationType(effect.type)) {\n return null;\n }\n const attributes = Factory.getAnimationType(effect.type)(element as IGlyphElement, options, animationParameters);\n\n return transformAnimationAttributes(attributes, element);\n}\n\nconst parseChannelValue = (\n element: IElement,\n channel: string,\n channelValue: any,\n animationParameters: IAnimationParameters,\n parameters: any\n) => {\n return isFunction(channelValue) ? channelValue(element.getDatum(), element, parameters) : channelValue;\n};\n\nexport function channelAnimationAttributes(\n element: IElement,\n effect: IAnimationEffect,\n animationParameters: IAnimationParameters,\n parameters: any\n): IParsedAnimationAttrs {\n const channel = effect.channel;\n let attributes: IParsedAnimationAttrs = null;\n\n if (isArray(channel)) {\n attributes = channel.reduce(\n (res, key) => {\n res.from[key] = element.getGraphicAttribute(key, true);\n res.to[key] = element.getGraphicAttribute(key, false);\n return res;\n },\n { from: {}, to: {} }\n );\n } else if (isObject(channel)) {\n attributes = Object.keys(channel).reduce(\n (res, key) => {\n const hasFrom = !isNil(channel[key]?.from);\n const hasTo = !isNil(channel[key]?.to);\n\n if (hasFrom || hasTo) {\n res.from[key] = hasFrom\n ? parseChannelValue(element, key, channel[key].from, animationParameters, parameters)\n : undefined;\n res.to[key] = hasTo\n ? parseChannelValue(element, key, channel[key].to, animationParameters, parameters)\n : element.getGraphicAttribute(key, false);\n }\n\n return res;\n },\n { from: {}, to: {} }\n );\n }\n\n return transformAnimationAttributes(attributes, element);\n}\n\nexport class CustomInterpolator extends ACustomAnimate<any> {\n private _element: IElement;\n private _interpolator?: IAnimationChannelInterpolator;\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: { interpolator: IAnimationChannelInterpolator; element: IElement; parameters?: any }\n ) {\n super(from, to, duration, easing, params);\n this._interpolator = params?.interpolator;\n this._element = params?.element;\n }\n\n onBind() {\n this.from = this.from ?? {};\n this.to = this.to ?? {};\n }\n\n getEndProps(): void | Record<string, any> {\n return this.to;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this._interpolator || !this._element) {\n return;\n }\n this._interpolator.call(\n this,\n ratio,\n this.from,\n this.to,\n out,\n this._element.getDatum(),\n this._element,\n this.params.parameters\n );\n }\n}\n\nexport class AttributeAnimate extends ACustomAnimate<any> {\n declare target: IGraphic;\n\n private _fromAttribute: any;\n private _toAttribute: any;\n\n getEndProps(): Record<string, any> {\n return this.to;\n }\n\n onBind() {\n const excludedChannelMap = (this.target.constructor as any).NOWORK_ANIMATE_ATTR ?? NOWORK_ANIMATE_ATTR;\n const excludedChannels = Object.keys(excludedChannelMap).filter(channel => excludedChannelMap[channel] !== 0);\n this.subAnimate.animate.preventAttrs(excludedChannels);\n\n const from = Object.assign({}, this.from);\n const to = Object.assign({}, this.to);\n const animatedChannels: string[] = [];\n Object.keys(to).forEach(k => {\n if (excludedChannels.includes(k)) {\n from[k] = to[k];\n this.from[k] = to[k];\n } else if (isNil(from[k])) {\n from[k] = this.target.getComputedAttribute(k);\n } else {\n animatedChannels.push(k);\n }\n });\n\n // prevent attributes at the animation invoking time\n this.target.animates.forEach(a => {\n if (a !== this.subAnimate.animate) {\n a.preventAttrs(animatedChannels);\n }\n });\n\n this._fromAttribute = from;\n this._toAttribute = to;\n }\n\n onStart(): void {\n if (this._fromAttribute) {\n const from = {};\n\n // apply attribute which has not been prevented\n Object.keys(this._fromAttribute).forEach(key => {\n if (this.subAnimate.animate.validAttr(key)) {\n from[key] = this._fromAttribute[key];\n }\n });\n\n this.target.setAttributes(from, !1, {\n type: AttributeUpdateType.ANIMATE_UPDATE,\n animationState: {\n ratio: 0,\n end: !1\n }\n });\n }\n }\n\n onEnd(): void {\n if (this._toAttribute) {\n const out = {};\n\n // apply attribute which has not been prevented\n Object.keys(this._toAttribute).forEach(key => {\n if (this.subAnimate.animate.validAttr(key)) {\n out[key] = this._toAttribute[key];\n }\n });\n\n this.target.setAttributes(out, false, {\n type: AttributeUpdateType.ANIMATE_END\n });\n }\n }\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updateCount === 0) {\n this.onFirstRun();\n }\n this.updateCount += 1;\n\n // Hack: waiting for canopus to remove invalid key when updating\n const lastProps = this.step.getLastProps();\n Object.keys(lastProps).forEach(key => {\n if (this.subAnimate.animate.validAttr(key)) {\n out[key] = lastProps[key];\n }\n });\n this.onUpdate(end, ratio, out);\n if (end) {\n this.onEnd();\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.stepInterpolate(\n this.subAnimate,\n this.subAnimate.animate,\n out,\n this.step,\n ratio,\n end,\n this._toAttribute,\n this._fromAttribute\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graph/animation/attribute.ts"],"names":[],"mappings":";;;AAEA,+DAA2D;AAC3D,yD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,CAAC,CAAC;QAC/B,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;IACH,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;IAW9D,CAAC;CACF;AA7GD,4CA6GC","file":"attribute.js","sourcesContent":["import type { EasingType, IGraphic } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { ACustomAnimate } from '@visactor/vrender-animate';\nimport { NOWORK_ANIMATE_ATTR, AttributeUpdateType } from '@visactor/vrender-core';\nimport { isArray, isFunction, isNil, isObject, isValid } from '@visactor/vutils';\nimport type {\n IAnimationChannelInterpolator,\n IAnimationEffect,\n IAnimationParameters,\n IElement,\n IGlyphElement,\n IParsedAnimationAttrs\n} from '../../types';\nimport { isValidPointsChannel } from '../attributes/helpers';\nimport { Factory } from '../../core/factory';\n\nconst transformAnimationAttributes = (attributes: IParsedAnimationAttrs, element: IElement): IParsedAnimationAttrs => {\n if (!attributes) {\n return null;\n }\n\n if (attributes.from) {\n const from = attributes.from;\n const fromKeys = Object.keys(from);\n fromKeys.forEach(channel => {\n if (isNil(from[channel])) {\n delete from[channel];\n }\n });\n const computePoints = isValidPointsChannel(fromKeys, element.mark.markType) && !isValid(from.segments);\n if (computePoints) {\n const items = element.items.map(item => Object.assign({}, item, { nextAttrs: Object.assign({}, from) }));\n attributes.from = element.transformElementItems(items, element.mark.markType, computePoints);\n }\n }\n if (attributes.to) {\n const to = attributes.to;\n const toKeys = Object.keys(to);\n toKeys.forEach(channel => {\n if (isNil(to[channel])) {\n delete to[channel];\n }\n });\n const computePoints = isValidPointsChannel(toKeys, element.mark.markType) && !isValid(to.segments);\n if (computePoints) {\n const items = element.items.map(item => Object.assign({}, item, { nextAttrs: Object.assign({}, to) }));\n attributes.to = element.transformElementItems(items, element.mark.markType, computePoints);\n }\n }\n\n return attributes;\n};\n\nexport function typeAnimationAttributes(\n element: IElement,\n effect: IAnimationEffect,\n animationParameters: IAnimationParameters,\n parameters: any\n): IParsedAnimationAttrs {\n // const parameters =\n const options = isFunction(effect.options)\n ? effect.options.call(null, element.getDatum(), element, parameters)\n : effect.options;\n if (!effect.type || !Factory.getAnimationType(effect.type)) {\n return null;\n }\n const attributes = Factory.getAnimationType(effect.type)(element as IGlyphElement, options, animationParameters);\n\n return transformAnimationAttributes(attributes, element);\n}\n\nconst parseChannelValue = (\n element: IElement,\n channel: string,\n channelValue: any,\n animationParameters: IAnimationParameters,\n parameters: any\n) => {\n return isFunction(channelValue) ? channelValue(element.getDatum(), element, parameters) : channelValue;\n};\n\nexport function channelAnimationAttributes(\n element: IElement,\n effect: IAnimationEffect,\n animationParameters: IAnimationParameters,\n parameters: any\n): IParsedAnimationAttrs {\n const channel = effect.channel;\n let attributes: IParsedAnimationAttrs = null;\n\n if (isArray(channel)) {\n attributes = channel.reduce(\n (res, key) => {\n res.from[key] = element.getGraphicAttribute(key, true);\n res.to[key] = element.getGraphicAttribute(key, false);\n return res;\n },\n { from: {}, to: {} }\n );\n } else if (isObject(channel)) {\n attributes = Object.keys(channel).reduce(\n (res, key) => {\n const hasFrom = !isNil(channel[key]?.from);\n const hasTo = !isNil(channel[key]?.to);\n\n if (hasFrom || hasTo) {\n res.from[key] = hasFrom\n ? parseChannelValue(element, key, channel[key].from, animationParameters, parameters)\n : undefined;\n res.to[key] = hasTo\n ? parseChannelValue(element, key, channel[key].to, animationParameters, parameters)\n : element.getGraphicAttribute(key, false);\n }\n\n return res;\n },\n { from: {}, to: {} }\n );\n }\n\n return transformAnimationAttributes(attributes, element);\n}\n\nexport class CustomInterpolator extends ACustomAnimate<any> {\n private _element: IElement;\n private _interpolator?: IAnimationChannelInterpolator;\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: { interpolator: IAnimationChannelInterpolator; element: IElement; parameters?: any }\n ) {\n super(from, to, duration, easing, params);\n this._interpolator = params?.interpolator;\n this._element = params?.element;\n }\n\n onBind() {\n this.from = this.from ?? {};\n this.to = this.to ?? {};\n }\n\n // getEndProps(): void | Record<string, any> {\n // return this.to;\n // }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this._interpolator || !this._element) {\n return;\n }\n this._interpolator.call(\n this,\n ratio,\n this.from,\n this.to,\n out,\n this._element.getDatum(),\n this._element,\n this.params.parameters\n );\n }\n}\n\nexport class AttributeAnimate extends ACustomAnimate<any> {\n declare target: IGraphic;\n\n private _fromAttribute: any;\n private _toAttribute: any;\n\n getEndProps(): Record<string, any> {\n return this.to;\n }\n\n onBind() {\n const excludedChannelMap = (this.target.constructor as any).NOWORK_ANIMATE_ATTR ?? NOWORK_ANIMATE_ATTR;\n const excludedChannels = Object.keys(excludedChannelMap).filter(channel => excludedChannelMap[channel] !== 0);\n // this.subAnimate.animate.preventAttrs(excludedChannels);\n\n const from = Object.assign({}, this.from);\n const to = Object.assign({}, this.to);\n const animatedChannels: string[] = [];\n Object.keys(to).forEach(k => {\n if (excludedChannels.includes(k)) {\n from[k] = to[k];\n this.from[k] = to[k];\n } else if (isNil(from[k])) {\n from[k] = this.target.getComputedAttribute(k);\n } else {\n animatedChannels.push(k);\n }\n });\n\n // prevent attributes at the animation invoking time\n // this.target.animates.forEach(a => {\n // if (a !== this.subAnimate.animate) {\n // a.preventAttrs(animatedChannels);\n // }\n // });\n\n this._fromAttribute = from;\n this._toAttribute = to;\n }\n\n onStart(): void {\n if (this._fromAttribute) {\n const from = {};\n\n // apply attribute which has not been prevented\n // Object.keys(this._fromAttribute).forEach(key => {\n // if (this.subAnimate.animate.validAttr(key)) {\n // from[key] = this._fromAttribute[key];\n // }\n // });\n\n this.target.setAttributes(from, !1, {\n type: AttributeUpdateType.ANIMATE_UPDATE,\n animationState: {\n ratio: 0,\n end: !1\n }\n });\n }\n }\n\n onEnd(): void {\n if (this._toAttribute) {\n const out = {};\n\n // apply attribute which has not been prevented\n // Object.keys(this._toAttribute).forEach(key => {\n // if (this.subAnimate.animate.validAttr(key)) {\n // out[key] = this._toAttribute[key];\n // }\n // });\n\n this.target.setAttributes(out, false, {\n type: AttributeUpdateType.ANIMATE_END\n });\n }\n }\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n // if (this.updateCount === 0) {\n // this.onFirstRun();\n // }\n // this.updateCount += 1;\n\n // // Hack: waiting for canopus to remove invalid key when updating\n // const lastProps = this.step.getLastProps();\n // Object.keys(lastProps).forEach(key => {\n // if (this.subAnimate.animate.validAttr(key)) {\n // out[key] = lastProps[key];\n // }\n // });\n this.onUpdate(end, ratio, out);\n if (end) {\n this.onEnd();\n }\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // this.target.stepInterpolate(\n // this.subAnimate,\n // this.subAnimate.animate,\n // out,\n // this.step,\n // ratio,\n // end,\n // this._toAttribute,\n // this._fromAttribute\n // );\n }\n}\n"]}
|
|
@@ -4,40 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.morph = void 0;
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
var _a, _b;
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), util_1 = require("../../parse/util"), differ_1 = require("../mark/differ"), doMorph = (prev, next, runningConfig, onEnd, parameters) => {
|
|
9
8
|
const morphData = {
|
|
10
9
|
prev: prev.map((element => element.getDatum())),
|
|
11
10
|
next: next.map((element => element.getDatum()))
|
|
12
11
|
}, morphElements = {
|
|
13
12
|
prev: prev.slice(),
|
|
14
13
|
next: next.slice()
|
|
15
|
-
},
|
|
16
|
-
util_1.invokeFunctionType)(runningConfig.animation.duration, parameters, morphData, morphElements), oneByOne = (0,
|
|
17
|
-
util_1.invokeFunctionType)(runningConfig.animation.oneByOne, parameters, morphData, morphElements)
|
|
18
|
-
util_1.invokeFunctionType)(runningConfig.animation.splitPath, parameters, morphData, morphElements),
|
|
19
|
-
|
|
20
|
-
1 !== prev.length && 0 !== prev.length || 1 !== next.length
|
|
21
|
-
vrender_core_1.oneToMultiMorph)(prev[0].getGraphicItem(), next.map((element => element.getGraphicItem())), {
|
|
22
|
-
delay: delay,
|
|
23
|
-
duration: duration,
|
|
24
|
-
easing: easing,
|
|
25
|
-
onEnd: onEnd,
|
|
26
|
-
individualDelay: individualDelay,
|
|
27
|
-
splitPath: splitPath
|
|
28
|
-
}) : prev.length > 1 && 1 === next.length && (0, vrender_core_1.multiToOneMorph)(prev.map((element => element.getGraphicItem())), next[0].getGraphicItem(), {
|
|
29
|
-
delay: delay,
|
|
30
|
-
duration: duration,
|
|
31
|
-
easing: easing,
|
|
32
|
-
onEnd: onEnd,
|
|
33
|
-
individualDelay: individualDelay,
|
|
34
|
-
splitPath: splitPath
|
|
35
|
-
}) : (0, vrender_core_1.morphPath)(null === (_b = null === (_a = prev[0]) || void 0 === _a ? void 0 : _a.getGraphicItem) || void 0 === _b ? void 0 : _b.call(_a), next[0].getGraphicItem(), {
|
|
36
|
-
delay: delay,
|
|
37
|
-
duration: duration,
|
|
38
|
-
easing: easing,
|
|
39
|
-
onEnd: onEnd
|
|
40
|
-
});
|
|
14
|
+
}, duration = (runningConfig.animation.easing, (0, util_1.invokeFunctionType)(runningConfig.animation.delay, parameters, morphData, morphElements),
|
|
15
|
+
(0, util_1.invokeFunctionType)(runningConfig.animation.duration, parameters, morphData, morphElements)), oneByOne = (0,
|
|
16
|
+
util_1.invokeFunctionType)(runningConfig.animation.oneByOne, parameters, morphData, morphElements);
|
|
17
|
+
(0, util_1.invokeFunctionType)(runningConfig.animation.splitPath, parameters, morphData, morphElements),
|
|
18
|
+
(0, vutils_1.isValidNumber)(oneByOne);
|
|
19
|
+
(1 !== prev.length && 0 !== prev.length || 1 !== next.length) && (1 === prev.length && next.length > 1 || prev.length > 1 && next.length);
|
|
41
20
|
}, divideElements = (elements, count) => {
|
|
42
21
|
const divideLength = Math.floor(elements.length / count);
|
|
43
22
|
return new Array(count).fill(0).map(((i, index) => elements.slice(divideLength * index, index === count - 1 ? elements.length : divideLength * (index + 1))));
|
|
@@ -66,19 +45,13 @@ const vrender_core_1 = require("@visactor/vrender-core"), vutils_1 = require("@v
|
|
|
66
45
|
const parameters = prevMarks.concat(nextMarks).reduce(((parameters, mark) => (Object.assign(parameters, mark.parameters()),
|
|
67
46
|
parameters)), {});
|
|
68
47
|
let morphCount = 0;
|
|
69
|
-
const onMorphEnd = () => {
|
|
70
|
-
morphCount -= 1, 0 === morphCount && nextMarks.forEach((mark => {
|
|
71
|
-
var _a, _b;
|
|
72
|
-
null === (_b = null === (_a = mark.animate) || void 0 === _a ? void 0 : _a.enable) || void 0 === _b || _b.call(_a);
|
|
73
|
-
}));
|
|
74
|
-
};
|
|
75
48
|
diffResult.enter.forEach((diff => {
|
|
76
49
|
diff.next.forEach((element => {
|
|
77
|
-
doMorph([], [ element ], runningConfig,
|
|
50
|
+
doMorph([], [ element ], runningConfig, 0, parameters);
|
|
78
51
|
})), morphCount += 1;
|
|
79
52
|
})), diffResult.update.forEach((diff => {
|
|
80
53
|
const divideCount = Math.min(diff.prev.length, diff.next.length), prevDivide = divideElements(diff.prev, divideCount), nextDivide = divideElements(diff.next, divideCount);
|
|
81
|
-
for (let i = 0; i < divideCount; i++) doMorph(prevDivide[i], nextDivide[i], runningConfig,
|
|
54
|
+
for (let i = 0; i < divideCount; i++) doMorph(prevDivide[i], nextDivide[i], runningConfig, 0, parameters),
|
|
82
55
|
morphCount += 1;
|
|
83
56
|
}));
|
|
84
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graph/animation/morph.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/graph/animation/morph.ts"],"names":[],"mappings":";;;AAEA,6CAAkE;AAGlE,2CAAkE;AAClE,2CAA8C;AAE9C,MAAM,OAAO,GAAG,CACd,IAAgB,EAChB,IAAgB,EAChB,aAA6B,EAC7B,KAAiB,EACjB,UAAe,EACf,EAAE;IACF,MAAM,SAAS,GAAc;QAC3B,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,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AAC,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;YAC7E,UAAU,IAAI,CAAC,CAAC;SACjB;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAjDW,QAAA,KAAK,SAiDhB","file":"morph.js","sourcesContent":["// TODO: morph animation 没有移到 vrender-animation\n// import { morphPath, multiToOneMorph, oneToMultiMorph } from '@visactor/vrender-core';\nimport { isNil, isNumber, isValidNumber } from '@visactor/vutils';\nimport type { IElement, IMark, IRunningConfig } from '../../types';\nimport type { MorphData, MorphElements } from '../../types/morph';\nimport { invokeFunctionType, parseField } from '../../parse/util';\nimport { diffMultiple } from '../mark/differ';\n\nconst doMorph = (\n prev: IElement[],\n next: IElement[],\n runningConfig: IRunningConfig,\n onEnd: () => void,\n parameters: any\n) => {\n const morphData: MorphData = {\n prev: prev.map(element => element.getDatum()),\n next: next.map(element => element.getDatum())\n };\n const morphElements: MorphElements = {\n prev: prev.slice(),\n next: next.slice()\n };\n const easing = runningConfig.animation.easing;\n const delay = invokeFunctionType(runningConfig.animation.delay, parameters, morphData, morphElements);\n const duration = invokeFunctionType(runningConfig.animation.duration, parameters, morphData, morphElements);\n const oneByOne = invokeFunctionType(runningConfig.animation.oneByOne, parameters, morphData, morphElements);\n const splitPath = invokeFunctionType(runningConfig.animation.splitPath, parameters, morphData, morphElements);\n const individualDelay =\n isValidNumber(oneByOne) && (oneByOne as number) > 0\n ? (index: number) => {\n if (isNumber(oneByOne)) {\n return index * (oneByOne as number);\n } else if (oneByOne === true) {\n return index * duration;\n }\n return 0;\n }\n : undefined;\n\n // if no previous item, still execute morph animation\n if ((prev.length === 1 || prev.length === 0) && next.length === 1) {\n // morphPath(prev[0]?.getGraphicItem?.(), next[0].getGraphicItem(), { delay, duration, easing, onEnd });\n } else if (prev.length === 1 && next.length > 1) {\n // oneToMultiMorph(\n // prev[0].getGraphicItem(),\n // next.map(element => element.getGraphicItem()),\n // { delay, duration, easing, onEnd, individualDelay, splitPath }\n // );\n } else if (prev.length > 1 && next.length === 1) {\n // multiToOneMorph(\n // prev.map(element => element.getGraphicItem()),\n // next[0].getGraphicItem(),\n // { delay, duration, easing, onEnd, individualDelay, splitPath }\n // );\n }\n};\n\nconst divideElements = (elements: IElement[], count: number) => {\n const divideLength = Math.floor(elements.length / count);\n return new Array(count).fill(0).map((i, index) => {\n return elements.slice(divideLength * index, index === count - 1 ? elements.length : divideLength * (index + 1));\n });\n};\n\nconst appendMorphKeyToElements = (mark: IMark) => {\n const config = mark.getMorphConfig();\n\n if (!isNil(config.morphElementKey)) {\n const getter = parseField(config.morphElementKey);\n\n if (mark.elements) {\n mark.elements.forEach(el => {\n (el as any).morphKey = getter(el.getDatum());\n });\n }\n }\n};\n\nexport const morph = (prevMarks: IMark[], nextMarks: IMark[], runningConfig: IRunningConfig) => {\n const prevElements = prevMarks.reduce((elements, mark) => {\n appendMorphKeyToElements(mark);\n\n return elements.concat(mark.elements);\n }, [] as IElement[]);\n const nextElements = nextMarks.reduce((elements, mark) => {\n appendMorphKeyToElements(mark);\n\n return elements.concat(mark.elements);\n }, [] as IElement[]);\n\n const key = (element: IElement) => (element as any).morphKey ?? element.key;\n const diffResult = diffMultiple(prevElements, nextElements, key);\n\n // disable normal animations of previous marks\n prevMarks.forEach(mark => mark.animate?.disable?.());\n nextMarks.forEach(mark => mark.animate?.disable?.());\n\n const parameters = prevMarks.concat(nextMarks).reduce((parameters, mark) => {\n Object.assign(parameters, mark.parameters());\n return parameters;\n }, {});\n\n let morphCount = 0;\n const onMorphEnd = () => {\n morphCount -= 1;\n if (morphCount === 0) {\n nextMarks.forEach(mark => {\n mark.animate?.enable?.();\n });\n }\n };\n // no animation for exit result\n diffResult.enter.forEach(diff => {\n diff.next.forEach(element => {\n doMorph([], [element], runningConfig, onMorphEnd, parameters);\n });\n morphCount += 1;\n });\n diffResult.update.forEach(diff => {\n const divideCount = Math.min(diff.prev.length, diff.next.length);\n const prevDivide = divideElements(diff.prev, divideCount);\n const nextDivide = divideElements(diff.next, divideCount);\n for (let i = 0; i < divideCount; i++) {\n doMorph(prevDivide[i], nextDivide[i], runningConfig, onMorphEnd, parameters);\n morphCount += 1;\n }\n });\n};\n"]}
|
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
20
|
}), exports.registerAnimate = exports.registerGesturePlugin = exports.registerDragPlugin = exports.GlyphMark = exports.registerGlyphMark = exports.defaultDoLayout = exports.registerDefaultLayout = exports.vglobal = exports.ThemeManager = exports.registerViewMorphAPI = exports.registerViewEventsAPI = exports.SIGNAL_VIEW_BOX = exports.SIGNAL_WIDTH = exports.SIGNAL_VIEW_WIDTH = exports.SIGNAL_VIEW_HEIGHT = exports.SIGNAL_PADDING = exports.SIGNAL_HEIGHT = exports.SIGNAL_AUTOFIT = exports.Factory = exports.GrammarBase = exports.invokeFunctionType = exports.parseFunctionType = exports.registerCoordinate = exports.Coordinate = exports.registerScale = exports.Scale = exports.View = exports.version = void 0,
|
|
21
|
-
exports.version = "0.
|
|
21
|
+
exports.version = "0.17.0-alpha.0", __exportStar(require("./graph"), exports), __exportStar(require("./interactions"), exports);
|
|
22
22
|
|
|
23
23
|
var view_1 = require("./view");
|
|
24
24
|
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,0CAAwB;AAExB,iDAA+B;AAE/B,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,sCAAoD;AAA3C,8FAAA,KAAK,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC7B,gDAAmE;AAA1D,wGAAA,UAAU,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACvC,qCAAqE;AAA5D,yG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ACzB,IAAA,2CAAsB,GAAE,CAAC;AAC3B,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,0CAAwB;AAExB,iDAA+B;AAE/B,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,sCAAoD;AAA3C,8FAAA,KAAK,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC7B,gDAAmE;AAA1D,wGAAA,UAAU,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACvC,qCAAqE;AAA5D,yGAAA,iBAAiB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAC9C,oDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,8CAQ0B;AAPxB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,yGAAA,YAAY,OAAA;AACZ,4GAAA,eAAe,OAAA;AAEjB,4DAAgE;AAAvD,yHAAA,qBAAqB,OAAA;AAC9B,4DAA+D;AAAtD,wHAAA,oBAAoB,OAAA;AAE7B,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C;AAE5C,uDAAiD;AAAxC,uGAAA,OAAO,OAAA;AAChB,wCAAsB;AACtB,iDAA+B;AAC/B,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC;AACrC,gDAA+E;AAAtE,+GAAA,qBAAqB,OAAA;AAAE,yGAAA,eAAe,OAAA;AAC/C,sCAA4D;AAAnD,0GAAA,iBAAiB,OAAA;AAAE,kGAAA,SAAS,OAAA;AAErC,yDAA4D;AAC5D,4CAAyC;AAElC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,iBAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,wBAAS,CAAC,CAAC;AACtD,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,iBAAO,CAAC,wBAAwB,CAAC,SAAS,EAAE,sBAAO,CAAC,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC;AAEF,kEAAmE;AACnE,kEAAmE;AAE5D,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,IAAA,2CAAsB,GAAE,CAAC;IACzB,IAAA,2CAAsB,GAAE,CAAC;AAC3B,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.17.0-alpha.0\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\nexport { registerViewEventsAPI } from './view/view-event-mixin';\nexport { registerViewMorphAPI } from './view/view-morph-mixin';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\nexport { registerDefaultLayout, defaultDoLayout } from './graph/layout/layout';\nexport { registerGlyphMark, GlyphMark } from './view/glyph';\n\nimport { DragNDrop, Gesture } from '@visactor/vrender-kits';\nimport { Factory } from './core/factory';\n\nexport const registerDragPlugin = () => {\n Factory.registerStageEventPlugin('drag', DragNDrop);\n};\n\nexport const registerGesturePlugin = () => {\n Factory.registerStageEventPlugin('gesture', Gesture);\n};\n\nimport { registerViewAnimateAPI } from './view/view-animate-mixin';\nimport { registerMarkAnimateAPI } from './view/mark-animate-mixin';\n\nexport const registerAnimate = () => {\n registerViewAnimateAPI();\n registerMarkAnimateAPI();\n};\n"]}
|
package/cjs/types/animate.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { IGraphic,
|
|
1
|
+
import type { IGraphic, EasingType } from '@visactor/vrender-core';
|
|
2
|
+
import type { ACustomAnimate } from '@visactor/vrender-animate';
|
|
2
3
|
import type { IPointLike } from '@visactor/vutils';
|
|
3
4
|
import type { MarkFunctionCallback, MarkFunctionType } from './mark';
|
|
4
5
|
import type { IMark } from './grammar';
|
package/cjs/types/animate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\nimport type { FunctionCallback } from './signal';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n excludeChannels?: string[];\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n /**\n * 状态动画的动画时长\n */\n duration?: number;\n /**\n * 状态动画的缓动函数类型\n */\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState: 'start' | 'end' | null, invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, EasingType } from '@visactor/vrender-core';\nimport type { ACustomAnimate } from '@visactor/vrender-animate';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\nimport type { FunctionCallback } from './signal';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n excludeChannels?: string[];\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n /**\n * 状态动画的动画时长\n */\n duration?: number;\n /**\n * 状态动画的缓动函数类型\n */\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState: 'start' | 'end' | null, invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
|
package/es/glyph/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export type { IBoxplotScaleAnimationOptions } from './boxplot';
|
|
|
2
2
|
export { registerBoxplotGlyph, registerBarBoxplotGlyph } from './boxplot';
|
|
3
3
|
export { registerRippleGlyph } from './ripple';
|
|
4
4
|
export { registerWaveGlyph } from './wave';
|
|
5
|
-
export { registerLinkPathGlyph } from './link-path';
|
|
5
|
+
export { registerLinkPathGlyph, registerLinkPathAnimation } from './link-path';
|
|
6
6
|
export { registerTreePathGlyph } from './tree-path';
|
|
7
7
|
export { registerViolinGlyph } from './violin';
|
package/es/glyph/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { registerRippleGlyph } from "./ripple";
|
|
|
4
4
|
|
|
5
5
|
export { registerWaveGlyph } from "./wave";
|
|
6
6
|
|
|
7
|
-
export { registerLinkPathGlyph } from "./link-path";
|
|
7
|
+
export { registerLinkPathGlyph, registerLinkPathAnimation } from "./link-path";
|
|
8
8
|
|
|
9
9
|
export { registerTreePathGlyph } from "./tree-path";
|
|
10
10
|
|
package/es/glyph/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/glyph/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/glyph/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC","file":"index.js","sourcesContent":["export type { IBoxplotScaleAnimationOptions } from './boxplot';\nexport { registerBoxplotGlyph, registerBarBoxplotGlyph } from './boxplot';\nexport { registerRippleGlyph } from './ripple';\nexport { registerWaveGlyph } from './wave';\nexport { registerLinkPathGlyph, registerLinkPathAnimation } from './link-path';\nexport { registerTreePathGlyph } from './tree-path';\nexport { registerViolinGlyph } from './violin';\n"]}
|
package/es/glyph/link-path.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import type { LinkPathEncoderSpec } from '../types';
|
|
2
|
+
import { ACustomAnimate } from '@visactor/vrender-animate';
|
|
2
3
|
export interface LinkPathConfig {
|
|
3
4
|
direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';
|
|
4
5
|
}
|
|
5
6
|
export declare const getHorizontalPath: (options: LinkPathEncoderSpec, ratio?: number) => string;
|
|
6
7
|
export declare const getVerticalPath: (options: LinkPathEncoderSpec, ratio?: number) => string;
|
|
8
|
+
export declare class LinkPathGrowIn extends ACustomAnimate<Record<string, number>> {
|
|
9
|
+
onBind(): void;
|
|
10
|
+
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class LinkPathGrowOut extends ACustomAnimate<Record<string, number>> {
|
|
13
|
+
onBind(): void;
|
|
14
|
+
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
15
|
+
}
|
|
16
|
+
export declare class LinkPathUpdate extends ACustomAnimate<Record<string, number>> {
|
|
17
|
+
onBind(): void;
|
|
18
|
+
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
19
|
+
}
|
|
7
20
|
export declare const registerLinkPathGlyph: () => void;
|
|
21
|
+
export declare const registerLinkPathAnimation: () => void;
|
package/es/glyph/link-path.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Factory } from "../core/factory";
|
|
2
2
|
|
|
3
|
-
import { isNil } from "@visactor/vutils";
|
|
4
|
-
|
|
5
3
|
import { registerGlyphGraphic, registerPathGraphic } from "../graph/mark/graphic";
|
|
6
4
|
|
|
7
5
|
import { registerGlyphMark } from "../view/glyph";
|
|
8
6
|
|
|
7
|
+
import { ACustomAnimate, AnimateExecutor } from "@visactor/vrender-animate";
|
|
8
|
+
|
|
9
9
|
export const getHorizontalPath = (options, ratio) => {
|
|
10
10
|
var _a;
|
|
11
11
|
const curvature = null !== (_a = options.curvature) && void 0 !== _a ? _a : .5, thickness = "number" == typeof ratio ? options.thickness * ratio : options.thickness;
|
|
@@ -45,22 +45,15 @@ const encoder = (encodeValues, datum, element, config) => {
|
|
|
45
45
|
path: parsePath(encodeValues, isRatioShow ? encodeValues.ratio : 1)
|
|
46
46
|
}
|
|
47
47
|
} : {};
|
|
48
|
-
}, linkPathGrowIn = (
|
|
48
|
+
}, linkPathGrowIn = (graphic, options, animationParameters) => {
|
|
49
49
|
const linkValues = {
|
|
50
|
-
x0:
|
|
51
|
-
x1:
|
|
52
|
-
y0:
|
|
53
|
-
y1:
|
|
54
|
-
thickness:
|
|
55
|
-
round: element.getGraphicAttribute("round", !1),
|
|
56
|
-
align: element.getGraphicAttribute("align", !1),
|
|
57
|
-
pathType: element.getGraphicAttribute("pathType", !1),
|
|
58
|
-
endArrow: element.getGraphicAttribute("endArrow", !1),
|
|
59
|
-
startArrow: element.getGraphicAttribute("startArrow", !1)
|
|
50
|
+
x0: graphic.getFinalAttribute().x0,
|
|
51
|
+
x1: graphic.getFinalAttribute().x1,
|
|
52
|
+
y0: graphic.getFinalAttribute().y0,
|
|
53
|
+
y1: graphic.getFinalAttribute().y1,
|
|
54
|
+
thickness: graphic.getFinalAttribute().thickness
|
|
60
55
|
};
|
|
61
|
-
return
|
|
62
|
-
isNil(linkValues[key]) && delete linkValues[key];
|
|
63
|
-
})), {
|
|
56
|
+
return {
|
|
64
57
|
from: Object.assign({}, linkValues, {
|
|
65
58
|
x1: linkValues.x0,
|
|
66
59
|
y1: linkValues.y0
|
|
@@ -69,54 +62,93 @@ const encoder = (encodeValues, datum, element, config) => {
|
|
|
69
62
|
};
|
|
70
63
|
}, linkPathGrowOut = (element, options, animationParameters) => {
|
|
71
64
|
const linkValues = {
|
|
72
|
-
x0: element.
|
|
73
|
-
x1: element.
|
|
74
|
-
y0: element.
|
|
75
|
-
y1: element.
|
|
76
|
-
thickness: element.
|
|
77
|
-
round: element.getGraphicAttribute("round", !0),
|
|
78
|
-
align: element.getGraphicAttribute("align", !0),
|
|
79
|
-
pathType: element.getGraphicAttribute("pathType", !0),
|
|
80
|
-
endArrow: element.getGraphicAttribute("endArrow", !0),
|
|
81
|
-
startArrow: element.getGraphicAttribute("startArrow", !0)
|
|
65
|
+
x0: element.getFinalAttribute().x0,
|
|
66
|
+
x1: element.getFinalAttribute().x1,
|
|
67
|
+
y0: element.getFinalAttribute().y0,
|
|
68
|
+
y1: element.getFinalAttribute().y1,
|
|
69
|
+
thickness: element.getFinalAttribute().thickness
|
|
82
70
|
};
|
|
83
|
-
return
|
|
84
|
-
isNil(linkValues[key]) && delete linkValues[key];
|
|
85
|
-
})), {
|
|
71
|
+
return {
|
|
86
72
|
from: linkValues,
|
|
87
73
|
to: Object.assign({}, linkValues, {
|
|
88
74
|
x1: linkValues.x0,
|
|
89
75
|
y1: linkValues.y0
|
|
90
76
|
})
|
|
91
77
|
};
|
|
92
|
-
}, linkPathUpdate = (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
78
|
+
}, linkPathUpdate = (graphic, options, animationParameters) => {
|
|
79
|
+
let from, to;
|
|
80
|
+
{
|
|
81
|
+
const {x0: x0, x1: x1, y0: y0, y1: y1} = graphic.getFinalAttribute();
|
|
82
|
+
from = {
|
|
83
|
+
x0: x0,
|
|
84
|
+
x1: x1,
|
|
85
|
+
y0: y0,
|
|
86
|
+
y1: y1
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
{
|
|
90
|
+
const {x0: x0, x1: x1, y0: y0, y1: y1} = graphic.attribute;
|
|
91
|
+
to = {
|
|
92
|
+
x0: x0,
|
|
93
|
+
x1: x1,
|
|
94
|
+
y0: y0,
|
|
95
|
+
y1: y1
|
|
96
|
+
};
|
|
97
|
+
}
|
|
104
98
|
return {
|
|
105
|
-
from:
|
|
106
|
-
|
|
107
|
-
x1: element.getGraphicAttribute("x1", !0),
|
|
108
|
-
y0: element.getGraphicAttribute("y0", !0),
|
|
109
|
-
y1: element.getGraphicAttribute("y1", !0)
|
|
110
|
-
}, bassLinkValues), bassLinkValues),
|
|
111
|
-
to: Object.assign({
|
|
112
|
-
x0: element.getGraphicAttribute("x0", !1),
|
|
113
|
-
x1: element.getGraphicAttribute("x1", !1),
|
|
114
|
-
y0: element.getGraphicAttribute("y0", !1),
|
|
115
|
-
y1: element.getGraphicAttribute("y1", !1)
|
|
116
|
-
}, bassLinkValues)
|
|
99
|
+
from: from,
|
|
100
|
+
to: to
|
|
117
101
|
};
|
|
118
102
|
};
|
|
119
103
|
|
|
104
|
+
export class LinkPathGrowIn extends ACustomAnimate {
|
|
105
|
+
onBind() {
|
|
106
|
+
var _a, _b, _c;
|
|
107
|
+
(null === (_a = this.params) || void 0 === _a ? void 0 : _a.diffAttrs) && this.target.setAttributes(this.params.diffAttrs);
|
|
108
|
+
const {from: from, to: to} = linkPathGrowIn(this.target, this.params.options, this.params), fromAttrs = null !== (_c = null === (_b = this.target.context) || void 0 === _b ? void 0 : _b.lastAttrs) && void 0 !== _c ? _c : from;
|
|
109
|
+
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
110
|
+
this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
|
|
111
|
+
}
|
|
112
|
+
onUpdate(end, ratio, out) {
|
|
113
|
+
const attribute = this.target.attribute;
|
|
114
|
+
this.propKeys.forEach((key => {
|
|
115
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
116
|
+
})), this.target.setAttributes(attribute);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export class LinkPathGrowOut extends ACustomAnimate {
|
|
121
|
+
onBind() {
|
|
122
|
+
var _a, _b, _c;
|
|
123
|
+
(null === (_a = this.params) || void 0 === _a ? void 0 : _a.diffAttrs) && this.target.setAttributes(this.params.diffAttrs);
|
|
124
|
+
const {from: from, to: to} = linkPathGrowOut(this.target, this.params.options, this.params), fromAttrs = null !== (_c = null === (_b = this.target.context) || void 0 === _b ? void 0 : _b.lastAttrs) && void 0 !== _c ? _c : from;
|
|
125
|
+
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
126
|
+
this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
|
|
127
|
+
}
|
|
128
|
+
onUpdate(end, ratio, out) {
|
|
129
|
+
const attribute = this.target.attribute;
|
|
130
|
+
this.propKeys.forEach((key => {
|
|
131
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
132
|
+
})), this.target.setAttributes(attribute);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export class LinkPathUpdate extends ACustomAnimate {
|
|
137
|
+
onBind() {
|
|
138
|
+
var _a, _b, _c;
|
|
139
|
+
(null === (_a = this.params) || void 0 === _a ? void 0 : _a.diffAttrs) && this.target.setAttributes(this.params.diffAttrs);
|
|
140
|
+
const {from: from, to: to} = linkPathUpdate(this.target, this.params.options, this.params), fromAttrs = null !== (_c = null === (_b = this.target.context) || void 0 === _b ? void 0 : _b.lastAttrs) && void 0 !== _c ? _c : from;
|
|
141
|
+
this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
|
|
142
|
+
this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
|
|
143
|
+
}
|
|
144
|
+
onUpdate(end, ratio, out) {
|
|
145
|
+
const attribute = this.target.attribute;
|
|
146
|
+
this.propKeys.forEach((key => {
|
|
147
|
+
attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
148
|
+
})), this.target.setAttributes(attribute);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
120
152
|
export const registerLinkPathGlyph = () => {
|
|
121
153
|
Factory.registerGlyph("linkPath", {
|
|
122
154
|
back: "path",
|
|
@@ -130,7 +162,9 @@ export const registerLinkPathGlyph = () => {
|
|
|
130
162
|
front: {
|
|
131
163
|
zIndex: 1
|
|
132
164
|
}
|
|
133
|
-
}))),
|
|
134
|
-
|
|
135
|
-
|
|
165
|
+
}))), registerGlyphMark(), registerGlyphGraphic(), registerPathGraphic();
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const registerLinkPathAnimation = () => {
|
|
169
|
+
AnimateExecutor.registerBuiltInAnimate("linkPathGrowIn", LinkPathGrowIn), AnimateExecutor.registerBuiltInAnimate("linkPathGrowOut", LinkPathGrowOut);
|
|
136
170
|
};
|