@visactor/vrender-components 1.1.0-alpha.22 → 1.1.0-alpha.24
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/animation/axis-animate.d.ts +1 -1
- package/cjs/animation/axis-animate.js +7 -7
- package/cjs/animation/axis-animate.js.map +1 -1
- 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/axis/animate/group-transition.d.ts +1 -1
- package/cjs/axis/animate/group-transition.js +2 -2
- package/cjs/axis/animate/group-transition.js.map +1 -1
- package/cjs/axis/register.js +8 -7
- package/cjs/axis/register.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/crosshair/register.js +7 -7
- package/cjs/crosshair/register.js.map +1 -1
- package/cjs/data-zoom/register.js +3 -3
- package/cjs/data-zoom/register.js.map +1 -1
- package/cjs/empty-tip/register.js +3 -2
- 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/label/base.d.ts +4 -1
- package/cjs/label/base.js +33 -34
- package/cjs/label/base.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/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/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 +6 -4
- 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/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/tooltip/register.js +3 -3
- package/cjs/tooltip/register.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 +4004 -3972
- package/es/animation/axis-animate.d.ts +1 -1
- package/es/animation/axis-animate.js +5 -1
- package/es/animation/axis-animate.js.map +1 -1
- 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/axis/animate/group-transition.d.ts +1 -1
- package/es/axis/animate/group-transition.js +1 -1
- package/es/axis/animate/group-transition.js.map +1 -1
- package/es/axis/register.js +13 -1
- package/es/axis/register.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/crosshair/register.js +9 -1
- package/es/crosshair/register.js.map +1 -1
- package/es/data-zoom/register.js +7 -1
- package/es/data-zoom/register.js.map +1 -1
- package/es/empty-tip/register.js +5 -1
- 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/label/base.d.ts +4 -1
- package/es/label/base.js +33 -34
- package/es/label/base.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/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/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 +6 -4
- 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/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/tooltip/register.js +9 -1
- package/es/tooltip/register.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 +220 -6
|
@@ -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
|
|
|
@@ -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,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAK7D,MAAM,OAAO,SAAU,SAAQ,iBAAsB;IACnD,MAAM;;QACJ,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAExD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAClC,IAAI,SAAS,IAAI,YAAY,IAAI,QAAQ,EAAE;YACzC,KAAK,GAAG,GAAG,CAAC;YAEZ,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACpD,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC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YAC5B,IAAI,EAAE,IAAI;YACV,EAAE,oBAAO,SAAS,CAAE;YACpB,QAAQ;YACR,MAAM;YACN,gBAAgB,EAAE;gBAChB,SAAS,oBAAO,SAAS,CAAE;aAC5B;SACF,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAGD,cAAc,CAAC,GAAW;QACxB,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,eAAe,CAAC,IAAc;QAC5B,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAGS,kBAAkB;QAC1B,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"]}
|
|
@@ -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;IACrD,MAAM;QACJ,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3B,MAA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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"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimateMode, type IGroup } from '@visactor/vrender-core';
|
|
2
|
-
import { ACustomAnimate } from '@visactor/vrender-animate';
|
|
2
|
+
import { ACustomAnimate } from '@visactor/vrender-animate/custom/custom-animate';
|
|
3
3
|
export declare class GroupTransition extends ACustomAnimate<any> {
|
|
4
4
|
target: IGroup;
|
|
5
5
|
private _newElementAttrMap;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnimateMode } from "@visactor/vrender-core";
|
|
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":"AAAA,OAAO,EAAE,WAAW,EAA+C,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/axis/animate/group-transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA+C,MAAM,wBAAwB,CAAC;AAClG,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,gBAAgB,EAAE,CAAC;QACrD,IAAI,CAAC,aAAa,EAAE;YAClB,OAAO;SACR;QAED,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QAI7B,aAAa,CAAC,gBAAgB,EAAE,CAAC,EAAY,EAAE,EAAE;;YAC/C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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 { AnimateMode, type EasingType, type IGraphic, type IGroup } from '@visactor/vrender-core';\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/register.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import { registerCircle
|
|
1
|
+
import { registerCircle } from "@visactor/vrender-kits/register/register-circle";
|
|
2
|
+
|
|
3
|
+
import { registerGroup } from "@visactor/vrender-kits/register/register-group";
|
|
4
|
+
|
|
5
|
+
import { registerLine } from "@visactor/vrender-kits/register/register-line";
|
|
6
|
+
|
|
7
|
+
import { registerPath } from "@visactor/vrender-kits/register/register-path";
|
|
8
|
+
|
|
9
|
+
import { registerRect } from "@visactor/vrender-kits/register/register-rect";
|
|
10
|
+
|
|
11
|
+
import { registerRichtext } from "@visactor/vrender-kits/register/register-richtext";
|
|
12
|
+
|
|
13
|
+
import { registerText } from "@visactor/vrender-kits/register/register-text";
|
|
2
14
|
|
|
3
15
|
import { registerAxisAnimate } from "../animation/axis-animate";
|
|
4
16
|
|
package/es/axis/register.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/axis/register.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"sources":["../src/axis/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,SAAS,aAAa;IACpB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,CAAC;IACnB,YAAY,EAAE,CAAC;IACf,mBAAmB,EAAE,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,aAAa,EAAE,CAAC;IAChB,cAAc,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;AACjB,CAAC","file":"register.js","sourcesContent":["import { registerCircle } from '@visactor/vrender-kits/register/register-circle';\nimport { registerGroup } from '@visactor/vrender-kits/register/register-group';\nimport { registerLine } from '@visactor/vrender-kits/register/register-line';\nimport { registerPath } from '@visactor/vrender-kits/register/register-path';\nimport { registerRect } from '@visactor/vrender-kits/register/register-rect';\nimport { registerRichtext } from '@visactor/vrender-kits/register/register-richtext';\nimport { registerText } from '@visactor/vrender-kits/register/register-text';\nimport { registerAxisAnimate } from '../animation/axis-animate';\n\nfunction loadBasicAxis() {\n registerGroup();\n registerLine();\n registerRichtext();\n registerText();\n registerAxisAnimate();\n}\n\nexport function loadLineAxisComponent() {\n loadBasicAxis();\n registerRect();\n}\n\nexport function loadCircleAxisComponent() {\n loadBasicAxis();\n registerCircle();\n}\n\nexport function loadLineAxisGridComponent() {\n registerGroup();\n registerPath();\n}\n\nexport function loadCircleAxisGridComponent() {\n registerGroup();\n registerPath();\n}\n"]}
|
package/es/brush/register.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { registerGroup
|
|
1
|
+
import { registerGroup } from "@visactor/vrender-kits/register/register-group";
|
|
2
|
+
|
|
3
|
+
import { registerPolygon } from "@visactor/vrender-kits/register/register-polygon";
|
|
2
4
|
|
|
3
5
|
export function loadBrushComponent() {
|
|
4
6
|
registerGroup(), registerPolygon();
|
package/es/brush/register.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/brush/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/brush/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,MAAM,UAAU,kBAAkB;IAChC,aAAa,EAAE,CAAC;IAChB,eAAe,EAAE,CAAC;AACpB,CAAC","file":"register.js","sourcesContent":["import { registerGroup } from '@visactor/vrender-kits/register/register-group';\nimport { registerPolygon } from '@visactor/vrender-kits/register/register-polygon';\n\nexport function loadBrushComponent() {\n registerGroup();\n registerPolygon();\n}\n"]}
|
package/es/checkbox/register.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { registerGroup
|
|
1
|
+
import { registerGroup } from "@visactor/vrender-kits/register/register-group";
|
|
2
|
+
|
|
3
|
+
import { registerImage } from "@visactor/vrender-kits/register/register-image";
|
|
4
|
+
|
|
5
|
+
import { registerRect } from "@visactor/vrender-kits/register/register-rect";
|
|
6
|
+
|
|
7
|
+
import { registerText } from "@visactor/vrender-kits/register/register-text";
|
|
2
8
|
|
|
3
9
|
export function loadCheckBoxComponent() {
|
|
4
10
|
registerGroup(), registerRect(), registerText(), registerImage();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/checkbox/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/checkbox/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,MAAM,UAAU,qBAAqB;IACnC,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;AAClB,CAAC","file":"register.js","sourcesContent":["import { registerGroup } from '@visactor/vrender-kits/register/register-group';\nimport { registerImage } from '@visactor/vrender-kits/register/register-image';\nimport { registerRect } from '@visactor/vrender-kits/register/register-rect';\nimport { registerText } from '@visactor/vrender-kits/register/register-text';\n\nexport function loadCheckBoxComponent() {\n registerGroup();\n registerRect();\n registerText();\n registerImage();\n}\n"]}
|
package/es/crosshair/register.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import { registerArc
|
|
1
|
+
import { registerArc } from "@visactor/vrender-kits/register/register-arc";
|
|
2
|
+
|
|
3
|
+
import { registerGroup } from "@visactor/vrender-kits/register/register-group";
|
|
4
|
+
|
|
5
|
+
import { registerLine } from "@visactor/vrender-kits/register/register-line";
|
|
6
|
+
|
|
7
|
+
import { registerPath } from "@visactor/vrender-kits/register/register-path";
|
|
8
|
+
|
|
9
|
+
import { registerRect } from "@visactor/vrender-kits/register/register-rect";
|
|
2
10
|
|
|
3
11
|
export function loadLineCrosshairComponent() {
|
|
4
12
|
registerGroup(), registerLine();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/crosshair/register.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/crosshair/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,MAAM,UAAU,0BAA0B;IACxC,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,aAAa,EAAE,CAAC;IAChB,WAAW,EAAE,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,aAAa,EAAE,CAAC;IAChB,WAAW,EAAE,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,mCAAmC;IACjD,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;AACjB,CAAC","file":"register.js","sourcesContent":["import { registerArc } from '@visactor/vrender-kits/register/register-arc';\nimport { registerGroup } from '@visactor/vrender-kits/register/register-group';\nimport { registerLine } from '@visactor/vrender-kits/register/register-line';\nimport { registerPath } from '@visactor/vrender-kits/register/register-path';\nimport { registerRect } from '@visactor/vrender-kits/register/register-rect';\n\nexport function loadLineCrosshairComponent() {\n registerGroup();\n registerLine();\n}\n\nexport function loadCircleCrosshairComponent() {\n registerGroup();\n registerArc();\n}\n\nexport function loadPolygonCrosshairComponent() {\n registerGroup();\n registerPath();\n}\n\nexport function loadRectCrosshairComponent() {\n registerGroup();\n registerRect();\n}\n\nexport function loadSectorCrosshairComponent() {\n registerGroup();\n registerArc();\n}\n\nexport function loadPolygonSectorCrosshairComponent() {\n registerGroup();\n registerPath();\n}\n"]}
|
package/es/data-zoom/register.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { registerArea
|
|
1
|
+
import { registerArea } from "@visactor/vrender-kits/register/register-area";
|
|
2
|
+
|
|
3
|
+
import { registerLine } from "@visactor/vrender-kits/register/register-line";
|
|
4
|
+
|
|
5
|
+
import { registerRect } from "@visactor/vrender-kits/register/register-rect";
|
|
6
|
+
|
|
7
|
+
import { registerSymbol } from "@visactor/vrender-kits/register/register-symbol";
|
|
2
8
|
|
|
3
9
|
import { loadTagComponent } from "../tag/register";
|
|
4
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/data-zoom/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/data-zoom/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,MAAM,UAAU,qBAAqB;IACnC,gBAAgB,EAAE,CAAC;IACnB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,YAAY,EAAE,CAAC;AACjB,CAAC","file":"register.js","sourcesContent":["import { registerArea } from '@visactor/vrender-kits/register/register-area';\nimport { registerLine } from '@visactor/vrender-kits/register/register-line';\nimport { registerRect } from '@visactor/vrender-kits/register/register-rect';\nimport { registerSymbol } from '@visactor/vrender-kits/register/register-symbol';\nimport { loadTagComponent } from '../tag/register';\nexport function loadDataZoomComponent() {\n loadTagComponent();\n registerRect();\n registerSymbol();\n registerArea();\n registerLine();\n}\n"]}
|
package/es/empty-tip/register.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { registerGroup
|
|
1
|
+
import { registerGroup } from "@visactor/vrender-kits/register/register-group";
|
|
2
|
+
|
|
3
|
+
import { registerImage } from "@visactor/vrender-kits/register/register-image";
|
|
4
|
+
|
|
5
|
+
import { registerText } from "@visactor/vrender-kits/register/register-text";
|
|
2
6
|
|
|
3
7
|
export function loadEmptyTipComponent() {
|
|
4
8
|
registerGroup(), registerText(), registerImage();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/empty-tip/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,
|
|
1
|
+
{"version":3,"sources":["../src/empty-tip/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,MAAM,UAAU,qBAAqB;IACnC,aAAa,EAAE,CAAC;IAEhB,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;AAClB,CAAC","file":"register.js","sourcesContent":["import { registerGroup } from '@visactor/vrender-kits/register/register-group';\nimport { registerImage } from '@visactor/vrender-kits/register/register-image';\nimport { registerText } from '@visactor/vrender-kits/register/register-text';\n\nexport function loadEmptyTipComponent() {\n registerGroup();\n // registerRect();\n registerText();\n registerImage();\n}\n"]}
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"1.1.0-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"1.1.0-alpha.24\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\nexport * from './table-series-number';\n"]}
|
package/es/indicator/register.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { registerGroup
|
|
1
|
+
import { registerGroup } from "@visactor/vrender-kits/register/register-group";
|
|
2
|
+
|
|
3
|
+
import { registerRichtext } from "@visactor/vrender-kits/register/register-richtext";
|
|
4
|
+
|
|
5
|
+
import { registerText } from "@visactor/vrender-kits/register/register-text";
|
|
2
6
|
|
|
3
7
|
export function loadIndicatorComponent() {
|
|
4
8
|
registerGroup(), registerText(), registerRichtext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/indicator/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"sources":["../src/indicator/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,MAAM,UAAU,sBAAsB;IACpC,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,CAAC;AACrB,CAAC","file":"register.js","sourcesContent":["import { registerGroup } from '@visactor/vrender-kits/register/register-group';\nimport { registerRichtext } from '@visactor/vrender-kits/register/register-richtext';\nimport { registerText } from '@visactor/vrender-kits/register/register-text';\n\nexport function loadIndicatorComponent() {\n registerGroup();\n registerText();\n registerRichtext();\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { IDefaultGraphicParamsType } from '@visactor/vrender-kits';
|
|
2
|
-
import type
|
|
3
|
-
import { Tag } from '../tag';
|
|
1
|
+
import type { IDefaultGraphicParamsType } from '@visactor/vrender-kits/jsx/graphicType';
|
|
2
|
+
import { Tag, type TagAttributes } from '../tag';
|
|
4
3
|
export declare function VTag(params: IDefaultGraphicParamsType<TagAttributes>): Tag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/jsx/component-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/jsx/component-type.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAsB,MAAM,QAAQ,CAAC;AAEjD,MAAM,UAAU,IAAI,CAAC,MAAgD;IACnE,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjD,CAAC","file":"component-type.js","sourcesContent":["import type { IDefaultGraphicParamsType } from '@visactor/vrender-kits/jsx/graphicType';\nimport { Tag, type TagAttributes } from '../tag';\n\nexport function VTag(params: IDefaultGraphicParamsType<TagAttributes>) {\n return new Tag(params ? params.attribute : {});\n}\n"]}
|
package/es/label/base.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare class LabelBase<T extends BaseLabelAttrs> extends AnimateComponen
|
|
|
27
27
|
private _lastSelect;
|
|
28
28
|
private _enableAnimation;
|
|
29
29
|
private _exitReleaseState?;
|
|
30
|
+
private _finalLayoutBoundsCache?;
|
|
30
31
|
constructor(attributes: BaseLabelAttrs, options?: ComponentOptions);
|
|
31
32
|
protected labeling(textBounds: IBoundsLike, graphicBounds: IBoundsLike, position?: BaseLabelAttrs['position'], offset?: number): {
|
|
32
33
|
x: number;
|
|
@@ -52,6 +53,8 @@ export declare class LabelBase<T extends BaseLabelAttrs> extends AnimateComponen
|
|
|
52
53
|
protected getRelatedGraphic(item: LabelItem): IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
|
|
53
54
|
protected getGraphicFinalLayoutAttributes<TAttrs extends Record<string, any> = Record<string, any>>(graphic: IGraphic): TAttrs;
|
|
54
55
|
protected hasGraphicContextFinalLayoutAttributes(graphic?: IGraphic): boolean;
|
|
56
|
+
protected shouldUseGraphicFinalLayoutAttributes(graphic?: IGraphic): boolean;
|
|
57
|
+
protected getGraphicFinalLayoutBounds(graphic?: IGraphic): IAABBBounds | undefined;
|
|
55
58
|
protected _initText(data?: LabelItem[]): (IText | IRichText)[];
|
|
56
59
|
protected _layout(texts: (IText | IRichText)[]): (IText | IRichText)[];
|
|
57
60
|
protected _overlapping(labels: (IText | IRichText)[]): (IRichText | IText)[];
|
|
@@ -72,7 +75,7 @@ export declare class LabelBase<T extends BaseLabelAttrs> extends AnimateComponen
|
|
|
72
75
|
private updateStatesOfLabels;
|
|
73
76
|
protected _handleRelatedGraphicSetState: (e: any) => void;
|
|
74
77
|
protected _smartInvert(labels: (IText | IRichText)[]): void;
|
|
75
|
-
protected _canPlaceInside(textBound: IBoundsLike, shapeBound
|
|
78
|
+
protected _canPlaceInside(textBound: IBoundsLike, shapeBound?: IAABBBounds): boolean;
|
|
76
79
|
release(all?: boolean): void;
|
|
77
80
|
setLocation(point: PointLocationCfg): void;
|
|
78
81
|
disableAnimation(): void;
|
package/es/label/base.js
CHANGED
|
@@ -36,15 +36,6 @@ import { commitUpdateAnimationTarget } from "../animation/static-truth";
|
|
|
36
36
|
|
|
37
37
|
import { appendExitReleaseCallback, bindExitReleaseAnimates, collectTrackedAnimates, runExitReleaseCallbacks } from "../animation/exit-release";
|
|
38
38
|
|
|
39
|
-
function cloneAttributeSnapshot(value) {
|
|
40
|
-
if (!isObject(value) || isArray(value)) return value;
|
|
41
|
-
const snapshot = {};
|
|
42
|
-
return Object.keys(value).forEach((key => {
|
|
43
|
-
const nextValue = value[key];
|
|
44
|
-
snapshot[key] = isObject(nextValue) && !isArray(nextValue) ? cloneAttributeSnapshot(nextValue) : nextValue;
|
|
45
|
-
})), snapshot;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
39
|
loadLabelComponent();
|
|
49
40
|
|
|
50
41
|
export class LabelBase extends AnimateComponent {
|
|
@@ -88,7 +79,7 @@ export class LabelBase extends AnimateComponent {
|
|
|
88
79
|
}
|
|
89
80
|
labeling(textBounds, graphicBounds, position, offset) {}
|
|
90
81
|
_getLabelLinePoints(text, baseMark) {
|
|
91
|
-
return connectLineBetweenBounds(text.AABBBounds,
|
|
82
|
+
return connectLineBetweenBounds(text.AABBBounds, this.getGraphicFinalLayoutBounds(baseMark));
|
|
92
83
|
}
|
|
93
84
|
_createLabelLine(text, baseMark) {
|
|
94
85
|
const points = this._getLabelLinePoints(text, baseMark);
|
|
@@ -158,11 +149,8 @@ export class LabelBase extends AnimateComponent {
|
|
|
158
149
|
}
|
|
159
150
|
render() {
|
|
160
151
|
if (this._exitReleaseState) return;
|
|
161
|
-
if (this._prepare(), isNil(this._idToGraphic) || this._isCollectionBase && isNil(this._idToPoint)) return;
|
|
162
|
-
|
|
163
|
-
!1 !== this._enableAnimation && this._baseMarks.forEach((mark => {
|
|
164
|
-
markAttributeList.push(cloneAttributeSnapshot(mark.attribute)), mark.initAttributes(this.getGraphicFinalLayoutAttributes(mark));
|
|
165
|
-
}));
|
|
152
|
+
if (this._finalLayoutBoundsCache = void 0, this._prepare(), isNil(this._idToGraphic) || this._isCollectionBase && isNil(this._idToPoint)) return;
|
|
153
|
+
this._finalLayoutBoundsCache = new Map;
|
|
166
154
|
const {overlap: overlap, smartInvert: smartInvert, dataFilter: dataFilter, customLayoutFunc: customLayoutFunc, customOverlapFunc: customOverlapFunc} = this.attribute;
|
|
167
155
|
let data = this.attribute.data;
|
|
168
156
|
if (isFunction(dataFilter) && (data = dataFilter(data)), data && data.length) {
|
|
@@ -183,9 +171,7 @@ export class LabelBase extends AnimateComponent {
|
|
|
183
171
|
labels && labels.length && labels.forEach((label => {
|
|
184
172
|
this._bindEvent(label), this._setStatesOfText(label);
|
|
185
173
|
})), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels),
|
|
186
|
-
|
|
187
|
-
mark.initAttributes(markAttributeList[index]);
|
|
188
|
-
}));
|
|
174
|
+
this._finalLayoutBoundsCache = void 0;
|
|
189
175
|
}
|
|
190
176
|
_bindEvent(target) {
|
|
191
177
|
if (this.attribute.disableTriggerEvent) return;
|
|
@@ -252,6 +238,24 @@ export class LabelBase extends AnimateComponent {
|
|
|
252
238
|
var _a;
|
|
253
239
|
return !!(null === (_a = null == graphic ? void 0 : graphic.context) || void 0 === _a ? void 0 : _a.finalAttrs);
|
|
254
240
|
}
|
|
241
|
+
shouldUseGraphicFinalLayoutAttributes(graphic) {
|
|
242
|
+
var _a;
|
|
243
|
+
return !!graphic && (!!(null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.animationState) || this.hasGraphicContextFinalLayoutAttributes(graphic));
|
|
244
|
+
}
|
|
245
|
+
getGraphicFinalLayoutBounds(graphic) {
|
|
246
|
+
var _a, _b;
|
|
247
|
+
if (!graphic) return;
|
|
248
|
+
const useFinalAttrs = this.shouldUseGraphicFinalLayoutAttributes(graphic), graphicAttrs = useFinalAttrs ? this.getGraphicFinalLayoutAttributes(graphic) : graphic.attribute;
|
|
249
|
+
if (!1 === (null == graphicAttrs ? void 0 : graphicAttrs.visible)) return;
|
|
250
|
+
if (!useFinalAttrs) return graphic.AABBBounds;
|
|
251
|
+
const cachedBounds = null === (_a = this._finalLayoutBoundsCache) || void 0 === _a ? void 0 : _a.get(graphic);
|
|
252
|
+
if (cachedBounds) return cachedBounds;
|
|
253
|
+
const clonedGraphic = graphic.clone();
|
|
254
|
+
clonedGraphic.initAttributes(Object.assign(Object.assign({}, clonedGraphic.attribute), graphicAttrs));
|
|
255
|
+
const bounds = clonedGraphic.AABBBounds;
|
|
256
|
+
return null === (_b = this._finalLayoutBoundsCache) || void 0 === _b || _b.set(graphic, bounds),
|
|
257
|
+
bounds;
|
|
258
|
+
}
|
|
255
259
|
_initText(data = []) {
|
|
256
260
|
const {textStyle: textStyle = {}} = this.attribute, labels = [];
|
|
257
261
|
for (let i = 0; i < data.length; i++) {
|
|
@@ -353,7 +357,8 @@ export class LabelBase extends AnimateComponent {
|
|
|
353
357
|
var _a;
|
|
354
358
|
const {avoidBaseMark: avoidBaseMark, strategy: strategy = [], hideOnHit: hideOnHit = !0, clampForce: clampForce = !0, avoidMarks: avoidMarks = [], overlapPadding: overlapPadding, hideOnOverflow: hideOnOverflow = !1} = option, result = [], checkBounds = strategy.some((s => "bound" === s.type));
|
|
355
359
|
avoidBaseMark && (null === (_a = this._baseMarks) || void 0 === _a || _a.forEach((mark => {
|
|
356
|
-
|
|
360
|
+
const markBounds = this.getGraphicFinalLayoutBounds(mark);
|
|
361
|
+
markBounds && bitmap.setRange(boundToRange(bmpTool, markBounds, !0));
|
|
357
362
|
}))), avoidMarks.length > 0 && avoidMarks.forEach((avoid => {
|
|
358
363
|
isString(avoid) ? getNoneGroupMarksByName(this.getRootNode(), avoid).forEach((avoidMark => {
|
|
359
364
|
avoidMark.AABBBounds && bitmap.setRange(boundToRange(bmpTool, avoidMark.AABBBounds, !0));
|
|
@@ -368,7 +373,7 @@ export class LabelBase extends AnimateComponent {
|
|
|
368
373
|
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
369
374
|
continue;
|
|
370
375
|
}
|
|
371
|
-
if (checkBounds && baseMark &&
|
|
376
|
+
if (checkBounds && baseMark && this._canPlaceInside(text.AABBBounds, this.getGraphicFinalLayoutBounds(baseMark))) {
|
|
372
377
|
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
373
378
|
continue;
|
|
374
379
|
}
|
|
@@ -394,14 +399,15 @@ export class LabelBase extends AnimateComponent {
|
|
|
394
399
|
return result;
|
|
395
400
|
}
|
|
396
401
|
isMarkInsideRect(baseMark, bmpTool) {
|
|
402
|
+
if (!baseMark) return !1;
|
|
397
403
|
const {left: left, right: right, top: top, bottom: bottom} = bmpTool.padding, rect = {
|
|
398
404
|
x1: -left,
|
|
399
405
|
x2: bmpTool.width + right,
|
|
400
406
|
y1: -top,
|
|
401
407
|
y2: bmpTool.height + bottom
|
|
402
|
-
}, bounds = baseMark
|
|
403
|
-
if (0 !== bounds.width() && 0 !== bounds.height()) return isRectIntersect(
|
|
404
|
-
const
|
|
408
|
+
}, bounds = this.getGraphicFinalLayoutBounds(baseMark);
|
|
409
|
+
if (bounds && 0 !== bounds.width() && 0 !== bounds.height()) return isRectIntersect(bounds, rect, !0);
|
|
410
|
+
const attribute = this.shouldUseGraphicFinalLayoutAttributes(baseMark) ? this.getGraphicFinalLayoutAttributes(baseMark) : baseMark.attribute;
|
|
405
411
|
if ("rect" === baseMark.type) {
|
|
406
412
|
const {x: x, x1: x1, y: y, y1: y1} = attribute;
|
|
407
413
|
return pointInRect({
|
|
@@ -419,17 +425,10 @@ export class LabelBase extends AnimateComponent {
|
|
|
419
425
|
if (baseMarkGroupName) return this.getRootNode().find((node => node.name === baseMarkGroupName), !0);
|
|
420
426
|
}
|
|
421
427
|
getGraphicBounds(graphic, point = {}, position) {
|
|
422
|
-
var _a;
|
|
423
428
|
if (graphic) {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
return Object.assign(clonedGraphic.attribute, this.getGraphicFinalLayoutAttributes(graphic)),
|
|
428
|
-
clonedGraphic.AABBBounds;
|
|
429
|
-
}
|
|
430
|
-
return graphic.AABBBounds;
|
|
431
|
-
}
|
|
432
|
-
const {x: x, y: y} = graphic.attribute;
|
|
429
|
+
const graphicAttrs = this.shouldUseGraphicFinalLayoutAttributes(graphic) ? this.getGraphicFinalLayoutAttributes(graphic) : graphic.attribute;
|
|
430
|
+
if (!1 !== graphicAttrs.visible) return this.getGraphicFinalLayoutBounds(graphic);
|
|
431
|
+
const {x: x, y: y} = graphicAttrs;
|
|
433
432
|
return {
|
|
434
433
|
x1: x,
|
|
435
434
|
x2: x,
|
|
@@ -570,7 +569,7 @@ export class LabelBase extends AnimateComponent {
|
|
|
570
569
|
const firstStopColor = null === (_g = null === (_f = backgroundColor.stops) || void 0 === _f ? void 0 : _f[0]) || void 0 === _g ? void 0 : _g.color;
|
|
571
570
|
firstStopColor && (backgroundColor = firstStopColor, foregroundColor = firstStopColor);
|
|
572
571
|
}
|
|
573
|
-
const invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors, mode), similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor, isInside = this._canPlaceInside(label.AABBBounds,
|
|
572
|
+
const invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors, mode), similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor, baseMarkBounds = this.getGraphicFinalLayoutBounds(baseMark), isInside = this._canPlaceInside(label.AABBBounds, baseMarkBounds), isIntersect = !isInside && label.AABBBounds && baseMarkBounds && baseMarkBounds.intersects(label.AABBBounds);
|
|
574
573
|
if (isInside || outsideEnable || isIntersect && "inside" === interactInvertType) {
|
|
575
574
|
const fill = smartInvertStrategy(fillStrategy, backgroundColor, invertColor, similarColor);
|
|
576
575
|
if (fill && label.setAttributes({
|