@visactor/vrender-components 0.18.11-alpha.5 → 0.18.11-alpha.7
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/axis/base.js +9 -21
- package/cjs/axis/base.js.map +1 -1
- package/cjs/axis/circle.js +1 -1
- package/cjs/axis/circle.js.map +1 -1
- package/cjs/axis/grid/base.js +5 -1
- package/cjs/axis/grid/base.js.map +1 -1
- package/cjs/axis/index.d.ts +0 -1
- package/cjs/axis/index.js +1 -1
- package/cjs/axis/index.js.map +1 -1
- package/cjs/axis/line.js +5 -5
- package/cjs/axis/line.js.map +1 -1
- package/cjs/axis/mixin/circle.js +4 -2
- package/cjs/axis/mixin/circle.js.map +1 -1
- package/cjs/axis/overlap/auto-limit.js +13 -8
- package/cjs/axis/overlap/auto-limit.js.map +1 -1
- package/cjs/axis/util.d.ts +2 -5
- package/cjs/axis/util.js +5 -18
- package/cjs/axis/util.js.map +1 -1
- package/cjs/brush/brush.js +6 -8
- package/cjs/brush/brush.js.map +1 -1
- package/cjs/checkbox/checkbox.d.ts +1 -1
- package/cjs/checkbox/checkbox.js +10 -9
- package/cjs/checkbox/checkbox.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/indicator.js +3 -3
- package/cjs/indicator/indicator.js.map +1 -1
- package/cjs/label/arc.d.ts +2 -2
- package/cjs/label/base.d.ts +2 -2
- package/cjs/label/base.js +1 -3
- package/cjs/label/base.js.map +1 -1
- package/cjs/legend/color/color.js +5 -7
- package/cjs/legend/color/color.js.map +1 -1
- package/cjs/legend/discrete/discrete.js +2 -4
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/legend/size/size.js +4 -6
- package/cjs/legend/size/size.js.map +1 -1
- package/cjs/marker/animate/animate.d.ts +13 -0
- package/cjs/marker/animate/animate.js +92 -0
- package/cjs/marker/animate/animate.js.map +1 -0
- package/cjs/marker/animate/call-in.d.ts +4 -0
- package/cjs/marker/animate/call-in.js +27 -0
- package/cjs/marker/animate/call-in.js.map +1 -0
- package/cjs/marker/animate/clip-in.d.ts +4 -0
- package/cjs/marker/animate/clip-in.js +23 -0
- package/cjs/marker/animate/clip-in.js.map +1 -0
- package/cjs/marker/animate/common.d.ts +9 -0
- package/cjs/marker/animate/common.js +48 -0
- package/cjs/marker/animate/common.js.map +1 -0
- package/cjs/marker/animate/fade-in.d.ts +7 -0
- package/cjs/marker/animate/fade-in.js +30 -0
- package/cjs/marker/animate/fade-in.js.map +1 -0
- package/cjs/marker/animate/fade-out.d.ts +7 -0
- package/cjs/marker/animate/fade-out.js +30 -0
- package/cjs/marker/animate/fade-out.js.map +1 -0
- package/cjs/marker/animate/index.js +3 -0
- package/cjs/marker/animate/index.js.map +1 -0
- package/cjs/marker/arc-area.d.ts +55 -0
- package/cjs/marker/arc-area.js +131 -0
- package/cjs/marker/arc-area.js.map +1 -0
- package/cjs/marker/arc-line.d.ts +25 -0
- package/cjs/marker/arc-line.js +106 -0
- package/cjs/marker/arc-line.js.map +1 -0
- package/cjs/marker/area.d.ts +14 -4
- package/cjs/marker/area.js +34 -21
- package/cjs/marker/area.js.map +1 -1
- package/cjs/marker/base.d.ts +21 -3
- package/cjs/marker/base.js +40 -5
- package/cjs/marker/base.js.map +1 -1
- package/cjs/marker/common-line.d.ts +22 -0
- package/cjs/marker/common-line.js +56 -0
- package/cjs/marker/common-line.js.map +1 -0
- package/cjs/marker/config.d.ts +79 -6
- package/cjs/marker/config.js +77 -37
- package/cjs/marker/config.js.map +1 -1
- package/cjs/marker/index.d.ts +2 -0
- package/cjs/marker/index.js +2 -1
- package/cjs/marker/index.js.map +1 -1
- package/cjs/marker/line.d.ts +24 -12
- package/cjs/marker/line.js +111 -45
- package/cjs/marker/line.js.map +1 -1
- package/cjs/marker/point.d.ts +8 -3
- package/cjs/marker/point.js +33 -9
- package/cjs/marker/point.js.map +1 -1
- package/cjs/marker/register.d.ts +2 -0
- package/cjs/marker/register.js +11 -2
- package/cjs/marker/register.js.map +1 -1
- package/cjs/marker/type.d.ts +102 -12
- package/cjs/marker/type.js +8 -2
- package/cjs/marker/type.js.map +1 -1
- package/cjs/pager/pager.js +2 -2
- package/cjs/pager/pager.js.map +1 -1
- package/cjs/player/base-player.d.ts +0 -2
- package/cjs/player/base-player.js +6 -11
- package/cjs/player/base-player.js.map +1 -1
- package/cjs/player/continuous-player.d.ts +1 -1
- package/cjs/player/continuous-player.js +4 -6
- package/cjs/player/continuous-player.js.map +1 -1
- package/cjs/player/controller/controller.js +4 -4
- package/cjs/player/controller/controller.js.map +1 -1
- package/cjs/player/discrete-player.d.ts +1 -1
- package/cjs/player/discrete-player.js +4 -6
- package/cjs/player/discrete-player.js.map +1 -1
- package/cjs/segment/arc-segment.d.ts +13 -0
- package/cjs/segment/arc-segment.js +51 -0
- package/cjs/segment/arc-segment.js.map +1 -0
- package/cjs/segment/index.d.ts +1 -0
- package/cjs/segment/index.js +2 -1
- package/cjs/segment/index.js.map +1 -1
- package/cjs/segment/register.d.ts +2 -1
- package/cjs/segment/register.js +8 -3
- package/cjs/segment/register.js.map +1 -1
- package/cjs/segment/segment.d.ts +9 -7
- package/cjs/segment/segment.js +12 -8
- package/cjs/segment/segment.js.map +1 -1
- package/cjs/segment/type.d.ts +24 -4
- package/cjs/segment/type.js.map +1 -1
- package/cjs/slider/slider.d.ts +0 -2
- package/cjs/slider/slider.js +38 -53
- package/cjs/slider/slider.js.map +1 -1
- package/cjs/slider/type.d.ts +0 -1
- package/cjs/slider/type.js.map +1 -1
- package/cjs/tag/tag.d.ts +5 -0
- package/cjs/tag/tag.js +14 -5
- package/cjs/tag/tag.js.map +1 -1
- package/cjs/util/interaction.d.ts +4 -0
- package/cjs/util/interaction.js +37 -0
- package/cjs/util/interaction.js.map +1 -0
- package/cjs/util/text.d.ts +1 -1
- package/cjs/util/text.js +7 -6
- package/cjs/util/text.js.map +1 -1
- package/es/axis/base.js +13 -23
- package/es/axis/base.js.map +1 -1
- package/es/axis/circle.js +2 -2
- package/es/axis/circle.js.map +1 -1
- package/es/axis/grid/base.js +6 -2
- package/es/axis/grid/base.js.map +1 -1
- package/es/axis/index.d.ts +0 -1
- package/es/axis/index.js +0 -2
- package/es/axis/index.js.map +1 -1
- package/es/axis/line.js +5 -5
- package/es/axis/line.js.map +1 -1
- package/es/axis/mixin/circle.js +3 -2
- package/es/axis/mixin/circle.js.map +1 -1
- package/es/axis/overlap/auto-limit.js +13 -9
- package/es/axis/overlap/auto-limit.js.map +1 -1
- package/es/axis/util.d.ts +2 -5
- package/es/axis/util.js +1 -15
- package/es/axis/util.js.map +1 -1
- package/es/brush/brush.js +6 -8
- package/es/brush/brush.js.map +1 -1
- package/es/checkbox/checkbox.d.ts +1 -1
- package/es/checkbox/checkbox.js +10 -9
- package/es/checkbox/checkbox.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/indicator.js +3 -3
- package/es/indicator/indicator.js.map +1 -1
- package/es/label/arc.d.ts +2 -2
- package/es/label/base.d.ts +2 -2
- package/es/label/base.js +1 -3
- package/es/label/base.js.map +1 -1
- package/es/legend/color/color.js +5 -7
- package/es/legend/color/color.js.map +1 -1
- package/es/legend/discrete/discrete.js +2 -4
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/legend/size/size.js +4 -6
- package/es/legend/size/size.js.map +1 -1
- package/es/marker/animate/animate.d.ts +13 -0
- package/es/marker/animate/animate.js +92 -0
- package/es/marker/animate/animate.js.map +1 -0
- package/es/marker/animate/call-in.d.ts +4 -0
- package/es/marker/animate/call-in.js +17 -0
- package/es/marker/animate/call-in.js.map +1 -0
- package/es/marker/animate/clip-in.d.ts +4 -0
- package/es/marker/animate/clip-in.js +15 -0
- package/es/marker/animate/clip-in.js.map +1 -0
- package/es/marker/animate/common.d.ts +9 -0
- package/es/marker/animate/common.js +39 -0
- package/es/marker/animate/common.js.map +1 -0
- package/es/marker/animate/fade-in.d.ts +7 -0
- package/es/marker/animate/fade-in.js +20 -0
- package/es/marker/animate/fade-in.js.map +1 -0
- package/es/marker/animate/fade-out.d.ts +7 -0
- package/es/marker/animate/fade-out.js +20 -0
- package/es/marker/animate/fade-out.js.map +1 -0
- package/es/marker/animate/index.js +3 -0
- package/es/marker/animate/index.js.map +1 -0
- package/es/marker/arc-area.d.ts +55 -0
- package/es/marker/arc-area.js +143 -0
- package/es/marker/arc-area.js.map +1 -0
- package/es/marker/arc-line.d.ts +25 -0
- package/es/marker/arc-line.js +114 -0
- package/es/marker/arc-line.js.map +1 -0
- package/es/marker/area.d.ts +14 -4
- package/es/marker/area.js +36 -19
- package/es/marker/area.js.map +1 -1
- package/es/marker/base.d.ts +21 -3
- package/es/marker/base.js +43 -4
- package/es/marker/base.js.map +1 -1
- package/es/marker/common-line.d.ts +22 -0
- package/es/marker/common-line.js +58 -0
- package/es/marker/common-line.js.map +1 -0
- package/es/marker/config.d.ts +79 -6
- package/es/marker/config.js +79 -37
- package/es/marker/config.js.map +1 -1
- package/es/marker/index.d.ts +2 -0
- package/es/marker/index.js +4 -0
- package/es/marker/index.js.map +1 -1
- package/es/marker/line.d.ts +24 -12
- package/es/marker/line.js +116 -48
- package/es/marker/line.js.map +1 -1
- package/es/marker/point.d.ts +8 -3
- package/es/marker/point.js +34 -6
- package/es/marker/point.js.map +1 -1
- package/es/marker/register.d.ts +2 -0
- package/es/marker/register.js +10 -2
- package/es/marker/register.js.map +1 -1
- package/es/marker/type.d.ts +102 -12
- package/es/marker/type.js +9 -0
- package/es/marker/type.js.map +1 -1
- package/es/pager/pager.js +2 -2
- package/es/pager/pager.js.map +1 -1
- package/es/player/base-player.d.ts +0 -2
- package/es/player/base-player.js +6 -11
- package/es/player/base-player.js.map +1 -1
- package/es/player/continuous-player.d.ts +1 -1
- package/es/player/continuous-player.js +4 -6
- package/es/player/continuous-player.js.map +1 -1
- package/es/player/controller/controller.js +5 -5
- package/es/player/controller/controller.js.map +1 -1
- package/es/player/discrete-player.d.ts +1 -1
- package/es/player/discrete-player.js +4 -6
- package/es/player/discrete-player.js.map +1 -1
- package/es/segment/arc-segment.d.ts +13 -0
- package/es/segment/arc-segment.js +49 -0
- package/es/segment/arc-segment.js.map +1 -0
- package/es/segment/index.d.ts +1 -0
- package/es/segment/index.js +2 -0
- package/es/segment/index.js.map +1 -1
- package/es/segment/register.d.ts +2 -1
- package/es/segment/register.js +6 -2
- package/es/segment/register.js.map +1 -1
- package/es/segment/segment.d.ts +9 -7
- package/es/segment/segment.js +11 -8
- package/es/segment/segment.js.map +1 -1
- package/es/segment/type.d.ts +24 -4
- package/es/segment/type.js.map +1 -1
- package/es/slider/slider.d.ts +0 -2
- package/es/slider/slider.js +36 -50
- package/es/slider/slider.js.map +1 -1
- package/es/slider/type.d.ts +0 -1
- package/es/slider/type.js.map +1 -1
- package/es/tag/tag.d.ts +5 -0
- package/es/tag/tag.js +14 -5
- package/es/tag/tag.js.map +1 -1
- package/es/util/interaction.d.ts +4 -0
- package/es/util/interaction.js +30 -0
- package/es/util/interaction.js.map +1 -0
- package/es/util/text.d.ts +1 -1
- package/es/util/text.js +7 -6
- package/es/util/text.js.map +1 -1
- package/package.json +5 -5
- package/cjs/marker/util.js +0 -3
- package/cjs/marker/util.js.map +0 -1
- package/es/marker/util.js +0 -3
- package/es/marker/util.js.map +0 -1
- /package/cjs/marker/{util.d.ts → animate/index.d.ts} +0 -0
- /package/es/marker/{util.d.ts → animate/index.d.ts} +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { commonLineClipIn } from "./clip-in";
|
|
2
|
+
|
|
3
|
+
import { areaFadeIn, commonLineFadeIn, arcAreaFadeIn, pointFadeIn } from "./fade-in";
|
|
4
|
+
|
|
5
|
+
import { areaFadeOut, commonLineFadeOut, arcAreaFadeOut, pointFadeOut } from "./fade-out";
|
|
6
|
+
|
|
7
|
+
import { pointCallIn } from "./call-in";
|
|
8
|
+
|
|
9
|
+
export function commonMarkLineAnimate(line, label, animationconfig, state) {
|
|
10
|
+
const {enter: enter, update: update, exit: exit} = animationconfig;
|
|
11
|
+
if ("enter" === state) {
|
|
12
|
+
const {type: type, duration: duration, delay: delay, easing: easing} = enter;
|
|
13
|
+
"clipIn" === type ? commonLineClipIn(line, label, duration, delay, easing) : "fadeIn" === type && commonLineFadeIn(line, label, duration, delay, easing);
|
|
14
|
+
} else if ("update" === state) {
|
|
15
|
+
const {type: type, duration: duration, delay: delay, easing: easing} = update;
|
|
16
|
+
"clipIn" === type ? commonLineClipIn(line, label, duration, delay, easing) : "fadeIn" === type && commonLineFadeIn(line, label, duration, delay, easing);
|
|
17
|
+
} else if ("exit" === state) {
|
|
18
|
+
const {duration: duration, delay: delay, easing: easing} = exit;
|
|
19
|
+
commonLineFadeOut(line, label, duration, delay, easing);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function markAreaAnimate(area, label, animationconfig, state) {
|
|
24
|
+
const {enter: enter, update: update, exit: exit} = animationconfig;
|
|
25
|
+
if ("enter" === state) {
|
|
26
|
+
const {type: type, duration: duration, delay: delay, easing: easing} = enter;
|
|
27
|
+
"fadeIn" === type && areaFadeIn(area, label, duration, delay, easing);
|
|
28
|
+
} else if ("update" === state) {
|
|
29
|
+
const {type: type, duration: duration, delay: delay, easing: easing} = update;
|
|
30
|
+
"fadeIn" === type && areaFadeIn(area, label, duration, delay, easing);
|
|
31
|
+
} else if ("exit" === state) {
|
|
32
|
+
const {duration: duration, delay: delay, easing: easing} = exit;
|
|
33
|
+
areaFadeOut(area, label, duration, delay, easing);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function markArcAreaAnimate(area, label, animationconfig, state) {
|
|
38
|
+
const {enter: enter, update: update, exit: exit} = animationconfig;
|
|
39
|
+
if ("enter" === state) {
|
|
40
|
+
const {type: type, duration: duration, delay: delay, easing: easing} = enter;
|
|
41
|
+
"fadeIn" === type && arcAreaFadeIn(area, label, duration, delay, easing);
|
|
42
|
+
} else if ("update" === state) {
|
|
43
|
+
const {type: type, duration: duration, delay: delay, easing: easing} = update;
|
|
44
|
+
"fadeIn" === type && arcAreaFadeIn(area, label, duration, delay, easing);
|
|
45
|
+
} else if ("exit" === state) {
|
|
46
|
+
const {duration: duration, delay: delay, easing: easing} = exit;
|
|
47
|
+
arcAreaFadeOut(area, label, duration, delay, easing);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function markPointAnimate(lines, item, animationconfig, state) {
|
|
52
|
+
const [itemLine, decorativeLine] = lines, {enter: enter, update: update, exit: exit} = animationconfig;
|
|
53
|
+
if ("enter" === state) {
|
|
54
|
+
const {type: type, duration: duration, delay: delay, easing: easing} = enter;
|
|
55
|
+
"fadeIn" === type ? pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) : "callIn" === type && pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);
|
|
56
|
+
} else if ("update" === state) {
|
|
57
|
+
const {type: type, duration: duration, delay: delay, easing: easing} = update;
|
|
58
|
+
"fadeIn" === type ? pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) : "callIn" === type && pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);
|
|
59
|
+
} else if ("exit" === state) {
|
|
60
|
+
const {duration: duration, delay: delay, easing: easing} = exit;
|
|
61
|
+
pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const DefaultUpdateMarkLineAnimation = {
|
|
66
|
+
type: "clipIn",
|
|
67
|
+
duration: 500,
|
|
68
|
+
easing: "linear",
|
|
69
|
+
delay: 0
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const DefaultUpdateMarkAreaAnimation = {
|
|
73
|
+
type: "fadeIn",
|
|
74
|
+
duration: 500,
|
|
75
|
+
easing: "linear",
|
|
76
|
+
delay: 0
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const DefaultUpdateMarkPointAnimation = {
|
|
80
|
+
type: "callIn",
|
|
81
|
+
duration: 500,
|
|
82
|
+
easing: "linear",
|
|
83
|
+
delay: 0
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const DefaultExitMarkerAnimation = {
|
|
87
|
+
type: "fadeOut",
|
|
88
|
+
duration: 500,
|
|
89
|
+
easing: "linear",
|
|
90
|
+
delay: 0
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=animate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/animate.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,UAAU,qBAAqB,CACnC,IAA0B,EAC1B,KAAU,EACV,eAAoB,EACpB,KAA2B;IAE3B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;IAChD,IAAI,KAAK,KAAK,OAAO,EAAE;QACrB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QAChD,IAAI,IAAI,KAAK,QAAQ,EAAE;YACrB,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;SACxD;aAAM,IAAI,IAAI,KAAK,QAAQ,EAAE;YAC5B,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;SACxD;KACF;SAAM,IAAI,KAAK,KAAK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EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,8BAA8B,GAAuD;IAChG,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,+BAA+B,GAAkD;IAC5F,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,0BAA0B,GAAwB;IAC7D,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACT,CAAC","file":"animate.js","sourcesContent":["import type { IRichText, ISymbol, IImage, IArc } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ILine, IPolygon } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport type {\n CommonMarkAreaAnimationType,\n CommonMarkLineAnimationType,\n MarkPointAnimationType,\n MarkerAnimationState,\n MarkerExitAnimation,\n MarkerUpdateAnimation\n} from '../type';\nimport { commonLineClipIn } from './clip-in';\nimport { areaFadeIn, commonLineFadeIn, arcAreaFadeIn, pointFadeIn } from './fade-in';\nimport { areaFadeOut, commonLineFadeOut, arcAreaFadeOut, pointFadeOut } from './fade-out';\nimport { pointCallIn } from './call-in';\n\nexport function commonMarkLineAnimate(\n line: Segment | ArcSegment,\n label: Tag,\n animationconfig: any,\n state: MarkerAnimationState\n) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'clipIn') {\n commonLineClipIn(line, label, duration, delay, easing);\n } else if (type === 'fadeIn') {\n commonLineFadeIn(line, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'clipIn') {\n commonLineClipIn(line, label, duration, delay, easing);\n } else if (type === 'fadeIn') {\n commonLineFadeIn(line, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n commonLineFadeOut(line, label, duration, delay, easing);\n }\n}\n\nexport function markAreaAnimate(area: IPolygon, label: Tag, animationconfig: any, state: MarkerAnimationState) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n areaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n areaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n areaFadeOut(area, label, duration, delay, easing);\n }\n}\n\nexport function markArcAreaAnimate(area: IArc, label: Tag, animationconfig: any, state: MarkerAnimationState) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n arcAreaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n arcAreaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n arcAreaFadeOut(area, label, duration, delay, easing);\n }\n}\n\nexport function markPointAnimate(\n lines: [Segment, ILine],\n item: Tag | IRichText | ISymbol | IImage,\n animationconfig: any,\n state: MarkerAnimationState\n) {\n const [itemLine, decorativeLine] = lines;\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing);\n } else if (type === 'callIn') {\n pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing);\n } else if (type === 'callIn') {\n pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing);\n }\n}\n\nexport const DefaultUpdateMarkLineAnimation: MarkerUpdateAnimation<CommonMarkLineAnimationType> = {\n type: 'clipIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultUpdateMarkAreaAnimation: MarkerUpdateAnimation<CommonMarkAreaAnimationType> = {\n type: 'fadeIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultUpdateMarkPointAnimation: MarkerUpdateAnimation<MarkPointAnimationType> = {\n type: 'callIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultExitMarkerAnimation: MarkerExitAnimation = {\n type: 'fadeOut',\n duration: 500,\n easing: 'linear',\n delay: 0\n};\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EasingType, IImage, ILine, IRichText, ISymbol } from '@visactor/vrender-core';
|
|
2
|
+
import type { Segment } from '../../segment';
|
|
3
|
+
import type { Tag } from '../../tag';
|
|
4
|
+
export declare function pointCallIn(itemLine: Segment, decorativeLine: ILine, item: Tag | IRichText | ISymbol | IImage, duration: number, delay: number, easing: EasingType): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { graphicFadeIn } from "./common";
|
|
2
|
+
|
|
3
|
+
export function pointCallIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
4
|
+
var _a;
|
|
5
|
+
const startSymbolDuration = .1 * duration, lineDuration = .65 * duration, decorativeDuration = .05 * duration, endSymbolDuration = .1 * duration, labelDuration = .1 * duration;
|
|
6
|
+
graphicFadeIn(itemLine.startSymbol, delay, startSymbolDuration, easing), itemLine.lines.forEach((line => line.setAttribute("clipRange", 0))),
|
|
7
|
+
itemLine.lines.forEach(((l, index) => {
|
|
8
|
+
const stepDuration = lineDuration / itemLine.lines.length;
|
|
9
|
+
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
10
|
+
clipRange: 1
|
|
11
|
+
}, stepDuration, easing);
|
|
12
|
+
})), graphicFadeIn(decorativeLine, delay + startSymbolDuration + lineDuration, decorativeDuration, easing),
|
|
13
|
+
graphicFadeIn(itemLine.endSymbol, delay + startSymbolDuration + lineDuration + decorativeDuration, endSymbolDuration, easing),
|
|
14
|
+
(null === (_a = item.getTextShape) || void 0 === _a ? void 0 : _a.call(item)) ? (graphicFadeIn(item.getTextShape(), delay + startSymbolDuration + lineDuration + decorativeDuration + endSymbolDuration, labelDuration, easing),
|
|
15
|
+
graphicFadeIn(item.getBgRect(), delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing)) : graphicFadeIn(item, delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=call-in.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/call-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,WAAW,CACzB,QAAiB,EACjB,cAAqB,EACrB,IAAwC,EACxC,QAAgB,EAChB,KAAa,EACb,MAAkB;;IAElB,MAAM,mBAAmB,GAAG,GAAG,GAAG,QAAQ,CAAC;IAC3C,MAAM,YAAY,GAAG,IAAI,GAAG,QAAQ,CAAC;IACrC,MAAM,kBAAkB,GAAG,IAAI,GAAG,QAAQ,CAAC;IAC3C,MAAM,iBAAiB,GAAG,GAAG,GAAG,QAAQ,CAAC;IACzC,MAAM,aAAa,GAAG,GAAG,GAAG,QAAQ,CAAC;IAGrC,aAAa,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAGxE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IAClE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QAClC,MAAM,YAAY,GAAG,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1D,CAAC,CAAC,OAAO,EAAE;aACR,IAAI,CAAC,KAAK,GAAG,mBAAmB,GAAG,KAAK,GAAG,YAAY,CAAC;aACxD,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,aAAa,CAAC,cAAc,EAAE,KAAK,GAAG,mBAAmB,GAAG,YAAY,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;IAGtG,aAAa,CACX,QAAQ,CAAC,SAAS,EAClB,KAAK,GAAG,mBAAmB,GAAG,YAAY,GAAG,kBAAkB,EAC/D,iBAAiB,EACjB,MAAM,CACP,CAAC;IAEF,IAAI,MAAA,IAAI,CAAC,YAAY,oDAAI,EAAE;QAEzB,aAAa,CACX,IAAI,CAAC,YAAY,EAAE,EACnB,KAAK,GAAG,mBAAmB,GAAG,YAAY,GAAG,kBAAkB,GAAG,iBAAiB,EACnF,aAAa,EACb,MAAM,CACP,CAAC;QAGF,aAAa,CACX,IAAI,CAAC,SAAS,EAAE,EAChB,KAAK,GAAG,mBAAmB,GAAG,YAAY,GAAG,iBAAiB,EAC9D,aAAa,EACb,MAAM,CACP,CAAC;KACH;SAAM;QACL,aAAa,CAAC,IAAI,EAAE,KAAK,GAAG,mBAAmB,GAAG,YAAY,GAAG,iBAAiB,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;KAC5G;AACH,CAAC","file":"call-in.js","sourcesContent":["import type { EasingType, IImage, ILine, IRichText, ISymbol } from '@visactor/vrender-core';\nimport type { Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeIn } from './common';\n\nexport function pointCallIn(\n itemLine: Segment,\n decorativeLine: ILine,\n item: Tag | IRichText | ISymbol | IImage,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n const startSymbolDuration = 0.1 * duration;\n const lineDuration = 0.65 * duration;\n const decorativeDuration = 0.05 * duration;\n const endSymbolDuration = 0.1 * duration;\n const labelDuration = 0.1 * duration;\n\n // start symbol\n graphicFadeIn(itemLine.startSymbol, delay, startSymbolDuration, easing);\n\n // line\n itemLine.lines.forEach(line => line.setAttribute('clipRange', 0));\n itemLine.lines.forEach((l, index) => {\n const stepDuration = lineDuration / itemLine.lines.length;\n l.animate()\n .wait(delay + startSymbolDuration + index * stepDuration)\n .to({ clipRange: 1 }, stepDuration, easing);\n });\n\n graphicFadeIn(decorativeLine, delay + startSymbolDuration + lineDuration, decorativeDuration, easing);\n\n // end symbol\n graphicFadeIn(\n itemLine.endSymbol,\n delay + startSymbolDuration + lineDuration + decorativeDuration,\n endSymbolDuration,\n easing\n );\n\n if (item.getTextShape?.()) {\n // text\n graphicFadeIn(\n item.getTextShape(),\n delay + startSymbolDuration + lineDuration + decorativeDuration + endSymbolDuration,\n labelDuration,\n easing\n );\n\n // text background\n graphicFadeIn(\n item.getBgRect(),\n delay + startSymbolDuration + lineDuration + endSymbolDuration,\n labelDuration,\n easing\n );\n } else {\n graphicFadeIn(item, delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing);\n }\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EasingType } from '@visactor/vrender-core';
|
|
2
|
+
import type { ArcSegment, Segment } from '../../segment';
|
|
3
|
+
import type { Tag } from '../../tag';
|
|
4
|
+
export declare function commonLineClipIn(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { graphicFadeIn } from "./common";
|
|
2
|
+
|
|
3
|
+
export function commonLineClipIn(line, label, duration, delay, easing) {
|
|
4
|
+
const startSymbolDuration = .1 * duration, lineDuration = .7 * duration, endSymbolDuration = .1 * duration, labelDuration = .1 * duration;
|
|
5
|
+
graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing), line.lines.forEach((line => line.setAttribute("clipRange", 0))),
|
|
6
|
+
line.lines.forEach(((l, index) => {
|
|
7
|
+
const stepDuration = lineDuration / line.lines.length;
|
|
8
|
+
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
9
|
+
clipRange: 1
|
|
10
|
+
}, stepDuration, easing);
|
|
11
|
+
})), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing),
|
|
12
|
+
graphicFadeIn(label.getTextShape(), delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing),
|
|
13
|
+
graphicFadeIn(label.getBgRect(), delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=clip-in.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/clip-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,gBAAgB,CAC9B,IAA0B,EAC1B,KAAU,EACV,QAAgB,EAChB,KAAa,EACb,MAAkB;IAElB,MAAM,mBAAmB,GAAG,GAAG,GAAG,QAAQ,CAAC;IAC3C,MAAM,YAAY,GAAG,GAAG,GAAG,QAAQ,CAAC;IACpC,MAAM,iBAAiB,GAAG,GAAG,GAAG,QAAQ,CAAC;IACzC,MAAM,aAAa,GAAG,GAAG,GAAG,QAAQ,CAAC;IAGrC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAGpE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QAC9B,MAAM,YAAY,GAAG,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QACtD,CAAC,CAAC,OAAO,EAAE;aACR,IAAI,CAAC,KAAK,GAAG,mBAAmB,GAAG,KAAK,GAAG,YAAY,CAAC;aACxD,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAGH,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,mBAAmB,GAAG,YAAY,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAGrG,aAAa,CACX,KAAK,CAAC,YAAY,EAAE,EACpB,KAAK,GAAG,mBAAmB,GAAG,YAAY,GAAG,iBAAiB,EAC9D,aAAa,EACb,MAAM,CACP,CAAC;IAGF,aAAa,CACX,KAAK,CAAC,SAAS,EAAE,EACjB,KAAK,GAAG,mBAAmB,GAAG,YAAY,GAAG,iBAAiB,EAC9D,aAAa,EACb,MAAM,CACP,CAAC;AACJ,CAAC","file":"clip-in.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeIn } from './common';\n\nexport function commonLineClipIn(\n line: Segment | ArcSegment,\n label: Tag,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n const startSymbolDuration = 0.1 * duration;\n const lineDuration = 0.7 * duration;\n const endSymbolDuration = 0.1 * duration;\n const labelDuration = 0.1 * duration;\n\n // start symbol\n graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing);\n\n // line\n line.lines.forEach(line => line.setAttribute('clipRange', 0));\n line.lines.forEach((l, index) => {\n const stepDuration = lineDuration / line.lines.length;\n l.animate()\n .wait(delay + startSymbolDuration + index * stepDuration)\n .to({ clipRange: 1 }, stepDuration, easing);\n });\n\n // end symbol\n graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing);\n\n // text\n graphicFadeIn(\n label.getTextShape(),\n delay + startSymbolDuration + lineDuration + endSymbolDuration,\n labelDuration,\n easing\n );\n\n // text background\n graphicFadeIn(\n label.getBgRect(),\n delay + startSymbolDuration + lineDuration + endSymbolDuration,\n labelDuration,\n easing\n );\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EasingType, IGraphic } from '@visactor/vrender-core';
|
|
2
|
+
import type { ArcSegment, Segment } from '../../segment';
|
|
3
|
+
import type { Tag } from '../../tag';
|
|
4
|
+
export declare function graphicFadeIn(graphic: IGraphic, delay: number, duration: number, easing: EasingType): void;
|
|
5
|
+
export declare function segmentFadeIn(segment: Segment, delay: number, duration: number, easing: EasingType): void;
|
|
6
|
+
export declare function tagFadeIn(tag: Tag, delay: number, duration: number, easing: EasingType): void;
|
|
7
|
+
export declare function graphicFadeOut(graphic: IGraphic, delay: number, duration: number, easing: EasingType): void;
|
|
8
|
+
export declare function segmentFadeOut(segment: Segment | ArcSegment, delay: number, duration: number, easing: EasingType): void;
|
|
9
|
+
export declare function tagFadeOut(tag: Tag, delay: number, duration: number, easing: EasingType): void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function graphicFadeIn(graphic, delay, duration, easing) {
|
|
2
|
+
graphic && (graphic.setAttributes({
|
|
3
|
+
fillOpacity: 0,
|
|
4
|
+
strokeOpacity: 0
|
|
5
|
+
}), graphic.animate().wait(delay).to({
|
|
6
|
+
fillOpacity: 1,
|
|
7
|
+
strokeOpacity: 1
|
|
8
|
+
}, duration, easing));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function segmentFadeIn(segment, delay, duration, easing) {
|
|
12
|
+
segment && (graphicFadeIn(segment.startSymbol, delay, duration, easing), segment.lines.forEach((line => graphicFadeIn(line, delay, duration, easing))),
|
|
13
|
+
graphicFadeIn(segment.line, delay, duration, easing), graphicFadeIn(segment.endSymbol, delay, duration, easing));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function tagFadeIn(tag, delay, duration, easing) {
|
|
17
|
+
tag && (graphicFadeIn(tag.getTextShape(), delay, duration, easing), graphicFadeIn(tag.getBgRect(), delay, duration, easing));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function graphicFadeOut(graphic, delay, duration, easing) {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
|
+
graphic && (graphic.setAttributes({
|
|
23
|
+
fillOpacity: null !== (_b = null === (_a = graphic.attribute) || void 0 === _a ? void 0 : _a.fillOpacity) && void 0 !== _b ? _b : 1,
|
|
24
|
+
strokeOpacity: null !== (_d = null === (_c = graphic.attribute) || void 0 === _c ? void 0 : _c.strokeOpacity) && void 0 !== _d ? _d : 1
|
|
25
|
+
}), graphic.animate().wait(delay).to({
|
|
26
|
+
fillOpacity: 0,
|
|
27
|
+
strokeOpacity: 0
|
|
28
|
+
}, duration, easing));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function segmentFadeOut(segment, delay, duration, easing) {
|
|
32
|
+
segment && (graphicFadeOut(segment.startSymbol, delay, duration, easing), segment.lines.forEach((line => graphicFadeOut(line, delay, duration, easing))),
|
|
33
|
+
graphicFadeOut(segment.line, delay, duration, easing), graphicFadeOut(segment.endSymbol, delay, duration, easing));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function tagFadeOut(tag, delay, duration, easing) {
|
|
37
|
+
tag && (graphicFadeOut(tag.getTextShape(), delay, duration, easing), graphicFadeOut(tag.getBgRect(), delay, duration, easing));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/common.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,aAAa,CAAC,OAAiB,EAAE,KAAa,EAAE,QAA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GAAG,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC","file":"common.js","sourcesContent":["import type { EasingType, IGraphic } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\n\n/** fade-in */\nexport function graphicFadeIn(graphic: IGraphic, delay: number, duration: number, easing: EasingType) {\n if (!graphic) {\n return;\n }\n\n graphic.setAttributes({\n fillOpacity: 0,\n strokeOpacity: 0\n });\n\n graphic.animate().wait(delay).to({ fillOpacity: 1, strokeOpacity: 1 }, duration, easing);\n}\n\nexport function segmentFadeIn(segment: Segment, delay: number, duration: number, easing: EasingType) {\n if (!segment) {\n return;\n }\n\n // start symbol\n graphicFadeIn(segment.startSymbol, delay, duration, easing);\n\n // line\n segment.lines.forEach(line => graphicFadeIn(line, delay, duration, easing));\n graphicFadeIn((segment as ArcSegment).line, delay, duration, easing);\n\n // end symbol\n graphicFadeIn(segment.endSymbol, delay, duration, easing);\n}\n\nexport function tagFadeIn(tag: Tag, delay: number, duration: number, easing: EasingType) {\n if (!tag) {\n return;\n }\n\n // text\n graphicFadeIn(tag.getTextShape(), delay, duration, easing);\n\n // text background\n graphicFadeIn(tag.getBgRect(), delay, duration, easing);\n}\n\n/** fade-out */\nexport function graphicFadeOut(graphic: IGraphic, delay: number, duration: number, easing: EasingType) {\n if (!graphic) {\n return;\n }\n\n graphic.setAttributes({\n fillOpacity: graphic.attribute?.fillOpacity ?? 1,\n strokeOpacity: graphic.attribute?.strokeOpacity ?? 1\n });\n\n graphic.animate().wait(delay).to({ fillOpacity: 0, strokeOpacity: 0 }, duration, easing);\n}\n\nexport function segmentFadeOut(segment: Segment | ArcSegment, delay: number, duration: number, easing: EasingType) {\n if (!segment) {\n return;\n }\n\n // start symbol\n graphicFadeOut(segment.startSymbol, delay, duration, easing);\n\n // line\n segment.lines.forEach(line => graphicFadeOut(line, delay, duration, easing));\n graphicFadeOut((segment as ArcSegment).line, delay, duration, easing);\n\n // end symbol\n graphicFadeOut(segment.endSymbol, delay, duration, easing);\n}\n\nexport function tagFadeOut(tag: Tag, delay: number, duration: number, easing: EasingType) {\n if (!tag) {\n return;\n }\n\n // text\n graphicFadeOut(tag.getTextShape(), delay, duration, easing);\n\n // text background\n graphicFadeOut(tag.getBgRect(), delay, duration, easing);\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';
|
|
2
|
+
import type { ArcSegment, Segment } from '../../segment';
|
|
3
|
+
import type { Tag } from '../../tag';
|
|
4
|
+
export declare function commonLineFadeIn(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
5
|
+
export declare function areaFadeIn(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
6
|
+
export declare function arcAreaFadeIn(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
7
|
+
export declare function pointFadeIn(itemLine: Segment, decorativeLine: ILine, item: Tag | IRichText | ISymbol | IImage, duration: number, delay: number, easing: EasingType): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { graphicFadeIn, segmentFadeIn, tagFadeIn } from "./common";
|
|
2
|
+
|
|
3
|
+
export function commonLineFadeIn(line, label, duration, delay, easing) {
|
|
4
|
+
segmentFadeIn(line, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function areaFadeIn(area, label, duration, delay, easing) {
|
|
8
|
+
graphicFadeIn(area, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function arcAreaFadeIn(area, label, duration, delay, easing) {
|
|
12
|
+
graphicFadeIn(area, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
16
|
+
var _a;
|
|
17
|
+
segmentFadeIn(itemLine, delay, duration, easing), graphicFadeIn(decorativeLine, delay, duration, easing),
|
|
18
|
+
(null === (_a = item.getTextShape) || void 0 === _a ? void 0 : _a.call(item)) ? tagFadeIn(item, delay, duration, easing) : graphicFadeIn(item, delay, duration, easing);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=fade-in.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/fade-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEnE,MAAM,UAAU,gBAAgB,CAC9B,IAA0B,EAC1B,KAAU,EACV,QAAgB,EAChB,KAAa,EACb,MAAkB;IAElB,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,KAAU,EAAE,QAAgB,EAAE,KAAa,EAAE,MAAkB;IACxG,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAU,EAAE,KAAU,EAAE,QAAgB,EAAE,KAAa,EAAE,MAAkB;IACvG,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,QAAiB,EACjB,cAAqB,EACrB,IAAwC,EACxC,QAAgB,EAChB,KAAa,EACb,MAAkB;;IAElB,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvD,IAAI,MAAA,IAAI,CAAC,YAAY,oDAAI,EAAE;QAEzB,SAAS,CAAC,IAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KACjD;SAAM;QAEL,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC9C;AACH,CAAC","file":"fade-in.js","sourcesContent":["import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeIn, segmentFadeIn, tagFadeIn } from './common';\n\nexport function commonLineFadeIn(\n line: Segment | ArcSegment,\n label: Tag,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeIn(line, delay, duration, easing);\n tagFadeIn(label, delay, duration, easing);\n}\n\nexport function areaFadeIn(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType) {\n graphicFadeIn(area, delay, duration, easing);\n tagFadeIn(label, delay, duration, easing);\n}\n\nexport function arcAreaFadeIn(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType) {\n graphicFadeIn(area, delay, duration, easing);\n tagFadeIn(label, delay, duration, easing);\n}\n\nexport function pointFadeIn(\n itemLine: Segment,\n decorativeLine: ILine,\n item: Tag | IRichText | ISymbol | IImage,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeIn(itemLine, delay, duration, easing);\n graphicFadeIn(decorativeLine, delay, duration, easing);\n if (item.getTextShape?.()) {\n // tag\n tagFadeIn(item as Tag, delay, duration, easing);\n } else {\n // symbol / richText / image\n graphicFadeIn(item, delay, duration, easing);\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';
|
|
2
|
+
import type { ArcSegment, Segment } from '../../segment';
|
|
3
|
+
import type { Tag } from '../../tag';
|
|
4
|
+
export declare function commonLineFadeOut(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
5
|
+
export declare function areaFadeOut(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
6
|
+
export declare function arcAreaFadeOut(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
7
|
+
export declare function pointFadeOut(itemLine: Segment, decorativeLine: ILine, item: Tag | IRichText | ISymbol | IImage, duration: number, delay: number, easing: EasingType): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { graphicFadeOut, segmentFadeOut, tagFadeOut } from "./common";
|
|
2
|
+
|
|
3
|
+
export function commonLineFadeOut(line, label, duration, delay, easing) {
|
|
4
|
+
segmentFadeOut(line, delay, duration, easing), tagFadeOut(label, delay, duration, easing);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function areaFadeOut(area, label, duration, delay, easing) {
|
|
8
|
+
graphicFadeOut(area, delay, duration, easing), tagFadeOut(label, delay, duration, easing);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function arcAreaFadeOut(area, label, duration, delay, easing) {
|
|
12
|
+
graphicFadeOut(area, delay, duration, easing), tagFadeOut(label, delay, duration, easing);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
16
|
+
var _a;
|
|
17
|
+
segmentFadeOut(itemLine, delay, duration, easing), graphicFadeOut(decorativeLine, delay, duration, easing),
|
|
18
|
+
(null === (_a = item.getTextShape) || void 0 === _a ? void 0 : _a.call(item)) ? tagFadeOut(item, delay, duration, easing) : graphicFadeOut(item, delay, duration, easing);
|
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AAY,oDAAI,EAAE;QAEzB,UAAU,CAAC,IAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD;SAAM;QAEL,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC/C;AACH,CAAC","file":"fade-out.js","sourcesContent":["import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeOut, segmentFadeOut, tagFadeOut } from './common';\n\nexport function commonLineFadeOut(\n line: Segment | ArcSegment,\n label: Tag,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeOut(line, delay, duration, easing);\n tagFadeOut(label, delay, duration, easing);\n}\n\nexport function areaFadeOut(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType) {\n graphicFadeOut(area, delay, duration, easing);\n tagFadeOut(label, delay, duration, easing);\n}\n\nexport function arcAreaFadeOut(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType) {\n graphicFadeOut(area, delay, duration, easing);\n tagFadeOut(label, delay, duration, easing);\n}\n\nexport function pointFadeOut(\n itemLine: Segment,\n decorativeLine: ILine,\n item: Tag | IRichText | ISymbol | IImage,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeOut(itemLine, delay, duration, easing);\n graphicFadeOut(decorativeLine, delay, duration, easing);\n if (item.getTextShape?.()) {\n // tag\n tagFadeOut(item as Tag, delay, duration, easing);\n } else {\n // symbol / richText / image\n graphicFadeOut(item, delay, duration, easing);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/index.ts"],"names":[],"mappings":"","file":"index.js","sourcesContent":[""]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { IArc, IGroup } from '@visactor/vrender-core';
|
|
2
|
+
import { Tag } from '../tag';
|
|
3
|
+
import { Marker } from './base';
|
|
4
|
+
import type { CommonMarkAreaAnimationType, MarkerAnimationState } from './type';
|
|
5
|
+
import { IMarkCommonArcLabelPosition, type MarkArcAreaAttrs } from './type';
|
|
6
|
+
import type { ComponentOptions } from '../interface';
|
|
7
|
+
export declare function registerMarkArcAreaAnimate(): void;
|
|
8
|
+
export declare class MarkArcArea extends Marker<MarkArcAreaAttrs, CommonMarkAreaAnimationType> {
|
|
9
|
+
name: string;
|
|
10
|
+
static defaultAttributes: {
|
|
11
|
+
interactive: boolean;
|
|
12
|
+
label: {
|
|
13
|
+
position: IMarkCommonArcLabelPosition;
|
|
14
|
+
textStyle: {
|
|
15
|
+
fill: string;
|
|
16
|
+
stroke: string;
|
|
17
|
+
lineWidth: number;
|
|
18
|
+
fontSize: number;
|
|
19
|
+
fontWeight: string;
|
|
20
|
+
fontStyle: string;
|
|
21
|
+
textAlign: string;
|
|
22
|
+
textBaseline: string;
|
|
23
|
+
};
|
|
24
|
+
padding: number[];
|
|
25
|
+
panel: {
|
|
26
|
+
visible: boolean;
|
|
27
|
+
cornerRadius: number;
|
|
28
|
+
fill: string;
|
|
29
|
+
fillOpacity: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
areaStyle: {
|
|
33
|
+
fill: string;
|
|
34
|
+
visible: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
private _area;
|
|
38
|
+
defaultUpdateAnimation: never;
|
|
39
|
+
defaultExitAnimation: import("./type").MarkerExitAnimation;
|
|
40
|
+
protected markerAnimate(state: MarkerAnimationState): void;
|
|
41
|
+
getArea(): IArc;
|
|
42
|
+
getLabel(): Tag;
|
|
43
|
+
constructor(attributes: MarkArcAreaAttrs, options?: ComponentOptions);
|
|
44
|
+
protected getPointAttrByPosition(position: IMarkCommonArcLabelPosition): {
|
|
45
|
+
position: {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
};
|
|
49
|
+
angle: number;
|
|
50
|
+
};
|
|
51
|
+
protected setLabelPos(): void;
|
|
52
|
+
protected initMarker(container: IGroup): void;
|
|
53
|
+
protected updateMarker(): void;
|
|
54
|
+
protected isValidPoints(): boolean;
|
|
55
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { graphicCreator } from "@visactor/vrender-core";
|
|
2
|
+
|
|
3
|
+
import { merge } from "@visactor/vutils";
|
|
4
|
+
|
|
5
|
+
import { Tag } from "../tag";
|
|
6
|
+
|
|
7
|
+
import { Marker } from "./base";
|
|
8
|
+
|
|
9
|
+
import { DEFAULT_MARK_ARC_AREA_THEME } from "./config";
|
|
10
|
+
|
|
11
|
+
import { IMarkCommonArcLabelPosition } from "./type";
|
|
12
|
+
|
|
13
|
+
import { limitShapeInBounds } from "../util/limit-shape";
|
|
14
|
+
|
|
15
|
+
import { loadMarkArcAreaComponent } from "./register";
|
|
16
|
+
|
|
17
|
+
import { DEFAULT_STATES } from "../constant";
|
|
18
|
+
|
|
19
|
+
import { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markArcAreaAnimate } from "./animate/animate";
|
|
20
|
+
|
|
21
|
+
loadMarkArcAreaComponent();
|
|
22
|
+
|
|
23
|
+
export function registerMarkArcAreaAnimate() {
|
|
24
|
+
MarkArcArea._animate = markArcAreaAnimate;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class MarkArcArea extends Marker {
|
|
28
|
+
markerAnimate(state) {
|
|
29
|
+
MarkArcArea._animate && MarkArcArea._animate(this._area, this._label, this._animationConfig, state);
|
|
30
|
+
}
|
|
31
|
+
getArea() {
|
|
32
|
+
return this._area;
|
|
33
|
+
}
|
|
34
|
+
getLabel() {
|
|
35
|
+
return this._label;
|
|
36
|
+
}
|
|
37
|
+
constructor(attributes, options) {
|
|
38
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcArea.defaultAttributes, attributes)),
|
|
39
|
+
this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation,
|
|
40
|
+
this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
41
|
+
}
|
|
42
|
+
getPointAttrByPosition(position) {
|
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
44
|
+
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, label: label} = this.attribute, {refX: refX = 0, refY: refY = 0} = label, labelRectHeight = Math.abs((null !== (_b = null === (_a = this._label.getTextShape().AABBBounds) || void 0 === _a ? void 0 : _a.y2) && void 0 !== _b ? _b : 0) - (null !== (_d = null === (_c = this._label.getTextShape()) || void 0 === _c ? void 0 : _c.AABBBounds.y1) && void 0 !== _d ? _d : 0)), labelTextHeight = Math.abs((null !== (_f = null === (_e = this._label.getBgRect().AABBBounds) || void 0 === _e ? void 0 : _e.y2) && void 0 !== _f ? _f : 0) - (null !== (_h = null === (_g = this._label.getBgRect()) || void 0 === _g ? void 0 : _g.AABBBounds.y1) && void 0 !== _h ? _h : 0)), labelHeight = Math.max(labelRectHeight, labelTextHeight);
|
|
45
|
+
let radius, angle, orthogonalOffsetDirection;
|
|
46
|
+
switch (position) {
|
|
47
|
+
case IMarkCommonArcLabelPosition.center:
|
|
48
|
+
radius = (innerRadius + outerRadius) / 2, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 0;
|
|
49
|
+
break;
|
|
50
|
+
|
|
51
|
+
case IMarkCommonArcLabelPosition.arcInnerStart:
|
|
52
|
+
radius = innerRadius, angle = startAngle, orthogonalOffsetDirection = -1;
|
|
53
|
+
break;
|
|
54
|
+
|
|
55
|
+
case IMarkCommonArcLabelPosition.arcOuterStart:
|
|
56
|
+
radius = outerRadius, angle = startAngle, orthogonalOffsetDirection = 1;
|
|
57
|
+
break;
|
|
58
|
+
|
|
59
|
+
case IMarkCommonArcLabelPosition.arcInnerEnd:
|
|
60
|
+
radius = innerRadius, angle = endAngle, orthogonalOffsetDirection = -1;
|
|
61
|
+
break;
|
|
62
|
+
|
|
63
|
+
case IMarkCommonArcLabelPosition.arcOuterEnd:
|
|
64
|
+
radius = outerRadius, angle = endAngle, orthogonalOffsetDirection = 1;
|
|
65
|
+
break;
|
|
66
|
+
|
|
67
|
+
case IMarkCommonArcLabelPosition.arcInnerMiddle:
|
|
68
|
+
radius = innerRadius, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
|
|
69
|
+
break;
|
|
70
|
+
|
|
71
|
+
case IMarkCommonArcLabelPosition.arcOuterMiddle:
|
|
72
|
+
radius = outerRadius, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 1;
|
|
73
|
+
break;
|
|
74
|
+
|
|
75
|
+
default:
|
|
76
|
+
radius = innerRadius, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
position: {
|
|
80
|
+
x: center.x + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.cos(angle) + refX * Math.cos(angle - Math.PI / 2),
|
|
81
|
+
y: center.y + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.sin(angle) + refX * Math.sin(angle - Math.PI / 2)
|
|
82
|
+
},
|
|
83
|
+
angle: angle
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
setLabelPos() {
|
|
87
|
+
var _a;
|
|
88
|
+
if (this._label && this._area) {
|
|
89
|
+
const {label: label = {}} = this.attribute, {position: labelPosition = "arcInnerMiddle", autoRotate: autoRotate = !0} = label, labelAttr = this.getPointAttrByPosition(labelPosition);
|
|
90
|
+
if (this._label.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
|
|
91
|
+
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = label.refAngle) && void 0 !== _a ? _a : 0) : 0
|
|
92
|
+
})), this.attribute.limitRect && label.confine) {
|
|
93
|
+
const {x: x, y: y, width: width, height: height} = this.attribute.limitRect;
|
|
94
|
+
limitShapeInBounds(this._label, {
|
|
95
|
+
x1: x,
|
|
96
|
+
y1: y,
|
|
97
|
+
x2: x + width,
|
|
98
|
+
y2: y + height
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
initMarker(container) {
|
|
104
|
+
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, areaStyle: areaStyle, label: label, state: state} = this.attribute, area = graphicCreator.arc(Object.assign({
|
|
105
|
+
x: center.x,
|
|
106
|
+
y: center.y,
|
|
107
|
+
innerRadius: innerRadius,
|
|
108
|
+
outerRadius: outerRadius,
|
|
109
|
+
startAngle: startAngle,
|
|
110
|
+
endAngle: endAngle
|
|
111
|
+
}, areaStyle));
|
|
112
|
+
area.states = merge({}, DEFAULT_STATES, null == state ? void 0 : state.area), area.name = "polar-mark-area-area",
|
|
113
|
+
this._area = area, container.add(area);
|
|
114
|
+
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
115
|
+
state: {
|
|
116
|
+
panel: merge({}, DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
|
|
117
|
+
text: merge({}, DEFAULT_STATES, null == state ? void 0 : state.label)
|
|
118
|
+
}
|
|
119
|
+
}));
|
|
120
|
+
markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel),
|
|
121
|
+
this.setLabelPos();
|
|
122
|
+
}
|
|
123
|
+
updateMarker() {
|
|
124
|
+
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, areaStyle: areaStyle, label: label} = this.attribute;
|
|
125
|
+
this._area && this._area.setAttributes(Object.assign({
|
|
126
|
+
x: center.x,
|
|
127
|
+
y: center.y,
|
|
128
|
+
innerRadius: innerRadius,
|
|
129
|
+
outerRadius: outerRadius,
|
|
130
|
+
startAngle: startAngle,
|
|
131
|
+
endAngle: endAngle
|
|
132
|
+
}, areaStyle)), this._area && this._label.setAttributes(Object.assign({
|
|
133
|
+
dx: 0,
|
|
134
|
+
dy: 0
|
|
135
|
+
}, label)), this.setLabelPos();
|
|
136
|
+
}
|
|
137
|
+
isValidPoints() {
|
|
138
|
+
return !0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
|
|
143
|
+
//# sourceMappingURL=arc-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/arc-area.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAGvD,OAAO,EAAE,2BAA2B,EAAyB,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEnH,wBAAwB,EAAE,CAAC;AAE3B,MAAM,UAAU,0BAA0B;IACxC,WAAW,CAAC,QAAQ,GAAG,kBAAkB,CAAC;AAC5C,CAAC;AAED,MAAM,OAAO,WAAY,SAAQ,MAAqD;IAQ1E,aAAa,CAAC,KAA2B;QACjD,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;SAC7E;IACH,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAA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AK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC;gBACxD,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC;aAC9C,IACD,CAAC;QACH,SAAS,CAAC,IAAI,GAAG,iBAAiB,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,SAAS,CAAC,GAAG,CAAC,SAA6B,CAAC,CAAC;QAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAES,YAAY;QACpB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI;aACtF,SAA6B,CAAC;QACjC,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,aAAa,iBACtB,CAAC,EAAE,MAAM,CAAC,CAAC,EACX,CAAC,EAAE,MAAM,CAAC,CAAC,EACX,WAAW;gBACX,WAAW;gBACX,UAAU;gBACV,QAAQ,IACL,SAAS,EACZ,CAAC;SACJ;QACD,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,aAAa,iBACvB,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,IACD,KAAuB,EAC3B,CAAC;SACJ;QACD,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;;AAnLM,6BAAiB,GAAG,2BAA2B,CAAC","file":"arc-area.js","sourcesContent":["import type { IArc, IGroup, INode } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { merge } from '@visactor/vutils';\nimport type { TagAttributes } from '../tag';\n// eslint-disable-next-line no-duplicate-imports\nimport { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_MARK_ARC_AREA_THEME } from './config';\nimport type { CommonMarkAreaAnimationType, MarkerAnimationState } from './type';\n// eslint-disable-next-line no-duplicate-imports\nimport { IMarkCommonArcLabelPosition, type MarkArcAreaAttrs } from './type';\nimport { limitShapeInBounds } from '../util/limit-shape';\nimport type { ComponentOptions } from '../interface';\nimport { loadMarkArcAreaComponent } from './register';\nimport { DEFAULT_STATES } from '../constant';\nimport { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markArcAreaAnimate } from './animate/animate';\n\nloadMarkArcAreaComponent();\n\nexport function registerMarkArcAreaAnimate() {\n MarkArcArea._animate = markArcAreaAnimate;\n}\n\nexport class MarkArcArea extends Marker<MarkArcAreaAttrs, CommonMarkAreaAnimationType> {\n name = 'markArcArea';\n static defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;\n private _area!: IArc;\n\n /** animate */\n defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation;\n defaultExitAnimation = DefaultExitMarkerAnimation;\n protected markerAnimate(state: MarkerAnimationState) {\n if (MarkArcArea._animate) {\n MarkArcArea._animate(this._area, this._label, this._animationConfig, state);\n }\n }\n\n getArea() {\n return this._area;\n }\n\n getLabel() {\n return this._label;\n }\n\n constructor(attributes: MarkArcAreaAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, MarkArcArea.defaultAttributes, attributes));\n }\n\n protected getPointAttrByPosition(position: IMarkCommonArcLabelPosition) {\n const { center, innerRadius, outerRadius, startAngle, endAngle, label } = this.attribute as MarkArcAreaAttrs;\n const { refX = 0, refY = 0 } = label;\n // eslint-disable-next-line max-len\n const labelRectHeight = Math.abs(\n (this._label.getTextShape().AABBBounds?.y2 ?? 0) - (this._label.getTextShape()?.AABBBounds.y1 ?? 0)\n );\n // eslint-disable-next-line max-len\n const labelTextHeight = Math.abs(\n (this._label.getBgRect().AABBBounds?.y2 ?? 0) - (this._label.getBgRect()?.AABBBounds.y1 ?? 0)\n );\n const labelHeight = Math.max(labelRectHeight, labelTextHeight);\n\n let radius;\n let angle;\n // tag在正交方向是向内偏移,还是向外偏移\n // 不偏移: 0, 内: -1, 外: 1\n let orthogonalOffsetDirection;\n\n switch (position) {\n case IMarkCommonArcLabelPosition.center:\n radius = (innerRadius + outerRadius) / 2;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 0;\n break;\n case IMarkCommonArcLabelPosition.arcInnerStart:\n radius = innerRadius;\n angle = startAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterStart:\n radius = outerRadius;\n angle = startAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IMarkCommonArcLabelPosition.arcInnerEnd:\n radius = innerRadius;\n angle = endAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterEnd:\n radius = outerRadius;\n angle = endAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IMarkCommonArcLabelPosition.arcInnerMiddle:\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterMiddle:\n radius = outerRadius;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 1;\n break;\n default: // default arcInnerMiddle\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n }\n\n return {\n position: {\n x:\n center.x +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.cos(angle) +\n refX * Math.cos(angle - Math.PI / 2),\n y:\n center.y +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.sin(angle) +\n refX * Math.sin(angle - Math.PI / 2)\n },\n angle\n };\n }\n\n protected setLabelPos() {\n if (this._label && this._area) {\n const { label = {} } = this.attribute as MarkArcAreaAttrs;\n const { position: labelPosition = 'arcInnerMiddle', autoRotate = true } = label;\n const labelAttr = this.getPointAttrByPosition(labelPosition as IMarkCommonArcLabelPosition);\n\n this._label.setAttributes({\n ...labelAttr.position,\n angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (label.refAngle ?? 0) : 0\n });\n\n if (this.attribute.limitRect && label.confine) {\n const { x, y, width, height } = this.attribute.limitRect;\n limitShapeInBounds(this._label, {\n x1: x,\n y1: y,\n x2: x + width,\n y2: y + height\n });\n }\n }\n }\n\n protected initMarker(container: IGroup) {\n const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label, state } = this\n .attribute as MarkArcAreaAttrs;\n const area = graphicCreator.arc({\n x: center.x,\n y: center.y,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n ...areaStyle\n });\n area.states = merge({}, DEFAULT_STATES, state?.area);\n area.name = 'polar-mark-area-area';\n this._area = area;\n container.add(area);\n\n const markLabel = new Tag({\n ...(label as TagAttributes),\n state: {\n panel: merge({}, DEFAULT_STATES, state?.labelBackground),\n text: merge({}, DEFAULT_STATES, state?.label)\n }\n });\n markLabel.name = 'mark-area-label';\n this._label = markLabel;\n container.add(markLabel as unknown as INode);\n this.setLabelPos();\n }\n\n protected updateMarker() {\n const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label } = this\n .attribute as MarkArcAreaAttrs;\n if (this._area) {\n this._area.setAttributes({\n x: center.x,\n y: center.y,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n ...areaStyle\n });\n }\n if (this._area) {\n this._label.setAttributes({\n dx: 0,\n dy: 0, // 需要进行复位\n ...(label as TagAttributes)\n });\n }\n this.setLabelPos();\n }\n\n protected isValidPoints() {\n return true;\n }\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ArcSegment } from '../segment';
|
|
2
|
+
import { MarkCommonLine } from './common-line';
|
|
3
|
+
import type { ComponentOptions } from '../interface';
|
|
4
|
+
import type { IArcGraphicAttribute } from '@visactor/vrender-core';
|
|
5
|
+
import { IMarkCommonArcLabelPosition } from './type';
|
|
6
|
+
import type { MarkArcLineAttrs, MarkerAnimationState } from './type';
|
|
7
|
+
export declare function registerMarkArcLineAnimate(): void;
|
|
8
|
+
export declare class MarkArcLine extends MarkCommonLine<IArcGraphicAttribute, IMarkCommonArcLabelPosition> {
|
|
9
|
+
name: string;
|
|
10
|
+
static defaultAttributes: Partial<MarkArcLineAttrs>;
|
|
11
|
+
protected _line: ArcSegment;
|
|
12
|
+
protected markerAnimate(state: MarkerAnimationState): void;
|
|
13
|
+
constructor(attributes: MarkArcLineAttrs, options?: ComponentOptions);
|
|
14
|
+
protected getPointAttrByPosition(direction: IMarkCommonArcLabelPosition): {
|
|
15
|
+
position: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
angle: number;
|
|
20
|
+
};
|
|
21
|
+
protected getRotateByAngle(angle: number): number;
|
|
22
|
+
protected createSegment(): ArcSegment;
|
|
23
|
+
protected setLineAttributes(): void;
|
|
24
|
+
protected isValidPoints(): boolean;
|
|
25
|
+
}
|