@visactor/vrender-components 0.18.11-alpha.7 → 0.18.11
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 +21 -9
- 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 +1 -5
- package/cjs/axis/grid/base.js.map +1 -1
- package/cjs/axis/index.d.ts +1 -0
- 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 +2 -4
- package/cjs/axis/mixin/circle.js.map +1 -1
- package/cjs/axis/overlap/auto-limit.js +8 -13
- package/cjs/axis/overlap/auto-limit.js.map +1 -1
- package/cjs/axis/util.d.ts +5 -2
- package/cjs/axis/util.js +18 -5
- package/cjs/axis/util.js.map +1 -1
- package/cjs/checkbox/checkbox.d.ts +1 -1
- package/cjs/checkbox/checkbox.js +9 -10
- package/cjs/checkbox/checkbox.js.map +1 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -2
- 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 +3 -1
- package/cjs/label/base.js.map +1 -1
- package/cjs/legend/color/color.js +7 -5
- package/cjs/legend/color/color.js.map +1 -1
- package/cjs/legend/discrete/discrete.js +4 -2
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/legend/size/size.js +6 -4
- package/cjs/legend/size/size.js.map +1 -1
- package/cjs/marker/area.d.ts +4 -14
- package/cjs/marker/area.js +21 -34
- package/cjs/marker/area.js.map +1 -1
- package/cjs/marker/base.d.ts +3 -21
- package/cjs/marker/base.js +5 -40
- package/cjs/marker/base.js.map +1 -1
- package/cjs/marker/config.d.ts +6 -79
- package/cjs/marker/config.js +37 -77
- package/cjs/marker/config.js.map +1 -1
- package/cjs/marker/index.d.ts +0 -2
- package/cjs/marker/index.js +1 -2
- package/cjs/marker/index.js.map +1 -1
- package/cjs/marker/line.d.ts +12 -24
- package/cjs/marker/line.js +45 -111
- package/cjs/marker/line.js.map +1 -1
- package/cjs/marker/point.d.ts +3 -8
- package/cjs/marker/point.js +9 -33
- package/cjs/marker/point.js.map +1 -1
- package/cjs/marker/register.d.ts +0 -2
- package/cjs/marker/register.js +2 -11
- package/cjs/marker/register.js.map +1 -1
- package/cjs/marker/type.d.ts +12 -102
- package/cjs/marker/type.js +2 -8
- package/cjs/marker/type.js.map +1 -1
- package/cjs/marker/util.js +3 -0
- package/cjs/marker/util.js.map +1 -0
- package/cjs/pager/pager.js +2 -2
- package/cjs/pager/pager.js.map +1 -1
- package/cjs/player/base-player.d.ts +2 -0
- package/cjs/player/base-player.js +11 -6
- package/cjs/player/base-player.js.map +1 -1
- package/cjs/player/continuous-player.d.ts +1 -1
- package/cjs/player/continuous-player.js +6 -4
- 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 +6 -4
- package/cjs/player/discrete-player.js.map +1 -1
- package/cjs/radio/index.d.ts +2 -0
- package/cjs/radio/index.js +21 -0
- package/cjs/radio/index.js.map +1 -0
- package/cjs/radio/radio.d.ts +16 -0
- package/cjs/radio/radio.js +88 -0
- package/cjs/radio/radio.js.map +1 -0
- package/cjs/radio/register.d.ts +1 -0
- package/cjs/radio/register.js +15 -0
- package/cjs/radio/register.js.map +1 -0
- package/cjs/radio/type.d.ts +21 -0
- package/cjs/radio/type.js +6 -0
- package/cjs/radio/type.js.map +1 -0
- package/cjs/segment/index.d.ts +0 -1
- package/cjs/segment/index.js +1 -2
- package/cjs/segment/index.js.map +1 -1
- package/cjs/segment/register.d.ts +1 -2
- package/cjs/segment/register.js +3 -8
- package/cjs/segment/register.js.map +1 -1
- package/cjs/segment/segment.d.ts +7 -9
- package/cjs/segment/segment.js +8 -12
- package/cjs/segment/segment.js.map +1 -1
- package/cjs/segment/type.d.ts +4 -24
- package/cjs/segment/type.js.map +1 -1
- package/cjs/slider/slider.d.ts +2 -0
- package/cjs/slider/slider.js +53 -38
- package/cjs/slider/slider.js.map +1 -1
- package/cjs/slider/type.d.ts +1 -0
- package/cjs/slider/type.js.map +1 -1
- package/cjs/tag/tag.d.ts +0 -5
- package/cjs/tag/tag.js +5 -14
- package/cjs/tag/tag.js.map +1 -1
- package/cjs/util/text.d.ts +1 -1
- package/cjs/util/text.js +6 -7
- package/cjs/util/text.js.map +1 -1
- package/es/axis/base.js +23 -13
- 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 +2 -6
- package/es/axis/grid/base.js.map +1 -1
- package/es/axis/index.d.ts +1 -0
- package/es/axis/index.js +2 -0
- 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 +2 -3
- package/es/axis/mixin/circle.js.map +1 -1
- package/es/axis/overlap/auto-limit.js +9 -13
- package/es/axis/overlap/auto-limit.js.map +1 -1
- package/es/axis/util.d.ts +5 -2
- package/es/axis/util.js +15 -1
- package/es/axis/util.js.map +1 -1
- package/es/checkbox/checkbox.d.ts +1 -1
- package/es/checkbox/checkbox.js +9 -10
- package/es/checkbox/checkbox.js.map +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -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 +3 -1
- package/es/label/base.js.map +1 -1
- package/es/legend/color/color.js +7 -5
- package/es/legend/color/color.js.map +1 -1
- package/es/legend/discrete/discrete.js +4 -2
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/legend/size/size.js +6 -4
- package/es/legend/size/size.js.map +1 -1
- package/es/marker/area.d.ts +4 -14
- package/es/marker/area.js +19 -36
- package/es/marker/area.js.map +1 -1
- package/es/marker/base.d.ts +3 -21
- package/es/marker/base.js +4 -43
- package/es/marker/base.js.map +1 -1
- package/es/marker/config.d.ts +6 -79
- package/es/marker/config.js +37 -79
- package/es/marker/config.js.map +1 -1
- package/es/marker/index.d.ts +0 -2
- package/es/marker/index.js +0 -4
- package/es/marker/index.js.map +1 -1
- package/es/marker/line.d.ts +12 -24
- package/es/marker/line.js +48 -116
- package/es/marker/line.js.map +1 -1
- package/es/marker/point.d.ts +3 -8
- package/es/marker/point.js +6 -34
- package/es/marker/point.js.map +1 -1
- package/es/marker/register.d.ts +0 -2
- package/es/marker/register.js +2 -10
- package/es/marker/register.js.map +1 -1
- package/es/marker/type.d.ts +12 -102
- package/es/marker/type.js +0 -9
- package/es/marker/type.js.map +1 -1
- package/es/marker/util.js +3 -0
- package/es/marker/util.js.map +1 -0
- package/es/pager/pager.js +2 -2
- package/es/pager/pager.js.map +1 -1
- package/es/player/base-player.d.ts +2 -0
- package/es/player/base-player.js +11 -6
- package/es/player/base-player.js.map +1 -1
- package/es/player/continuous-player.d.ts +1 -1
- package/es/player/continuous-player.js +6 -4
- 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 +6 -4
- package/es/player/discrete-player.js.map +1 -1
- package/es/radio/index.d.ts +2 -0
- package/es/radio/index.js +4 -0
- package/es/radio/index.js.map +1 -0
- package/es/radio/radio.d.ts +16 -0
- package/es/radio/radio.js +87 -0
- package/es/radio/radio.js.map +1 -0
- package/es/radio/register.d.ts +1 -0
- package/es/radio/register.js +6 -0
- package/es/radio/register.js.map +1 -0
- package/es/radio/type.d.ts +21 -0
- package/es/radio/type.js +2 -0
- package/es/radio/type.js.map +1 -0
- package/es/segment/index.d.ts +0 -1
- package/es/segment/index.js +0 -2
- package/es/segment/index.js.map +1 -1
- package/es/segment/register.d.ts +1 -2
- package/es/segment/register.js +2 -6
- package/es/segment/register.js.map +1 -1
- package/es/segment/segment.d.ts +7 -9
- package/es/segment/segment.js +8 -11
- package/es/segment/segment.js.map +1 -1
- package/es/segment/type.d.ts +4 -24
- package/es/segment/type.js.map +1 -1
- package/es/slider/slider.d.ts +2 -0
- package/es/slider/slider.js +50 -36
- package/es/slider/slider.js.map +1 -1
- package/es/slider/type.d.ts +1 -0
- package/es/slider/type.js.map +1 -1
- package/es/tag/tag.d.ts +0 -5
- package/es/tag/tag.js +5 -14
- package/es/tag/tag.js.map +1 -1
- package/es/util/text.d.ts +1 -1
- package/es/util/text.js +6 -7
- package/es/util/text.js.map +1 -1
- package/package.json +5 -5
- package/cjs/marker/animate/animate.d.ts +0 -13
- package/cjs/marker/animate/animate.js +0 -92
- package/cjs/marker/animate/animate.js.map +0 -1
- package/cjs/marker/animate/call-in.d.ts +0 -4
- package/cjs/marker/animate/call-in.js +0 -27
- package/cjs/marker/animate/call-in.js.map +0 -1
- package/cjs/marker/animate/clip-in.d.ts +0 -4
- package/cjs/marker/animate/clip-in.js +0 -23
- package/cjs/marker/animate/clip-in.js.map +0 -1
- package/cjs/marker/animate/common.d.ts +0 -9
- package/cjs/marker/animate/common.js +0 -48
- package/cjs/marker/animate/common.js.map +0 -1
- package/cjs/marker/animate/fade-in.d.ts +0 -7
- package/cjs/marker/animate/fade-in.js +0 -30
- package/cjs/marker/animate/fade-in.js.map +0 -1
- package/cjs/marker/animate/fade-out.d.ts +0 -7
- package/cjs/marker/animate/fade-out.js +0 -30
- package/cjs/marker/animate/fade-out.js.map +0 -1
- package/cjs/marker/animate/index.js +0 -3
- package/cjs/marker/animate/index.js.map +0 -1
- package/cjs/marker/arc-area.d.ts +0 -55
- package/cjs/marker/arc-area.js +0 -131
- package/cjs/marker/arc-area.js.map +0 -1
- package/cjs/marker/arc-line.d.ts +0 -25
- package/cjs/marker/arc-line.js +0 -106
- package/cjs/marker/arc-line.js.map +0 -1
- package/cjs/marker/common-line.d.ts +0 -22
- package/cjs/marker/common-line.js +0 -56
- package/cjs/marker/common-line.js.map +0 -1
- package/cjs/segment/arc-segment.d.ts +0 -13
- package/cjs/segment/arc-segment.js +0 -51
- package/cjs/segment/arc-segment.js.map +0 -1
- package/cjs/util/interaction.d.ts +0 -4
- package/cjs/util/interaction.js +0 -37
- package/cjs/util/interaction.js.map +0 -1
- package/es/marker/animate/animate.d.ts +0 -13
- package/es/marker/animate/animate.js +0 -92
- package/es/marker/animate/animate.js.map +0 -1
- package/es/marker/animate/call-in.d.ts +0 -4
- package/es/marker/animate/call-in.js +0 -17
- package/es/marker/animate/call-in.js.map +0 -1
- package/es/marker/animate/clip-in.d.ts +0 -4
- package/es/marker/animate/clip-in.js +0 -15
- package/es/marker/animate/clip-in.js.map +0 -1
- package/es/marker/animate/common.d.ts +0 -9
- package/es/marker/animate/common.js +0 -39
- package/es/marker/animate/common.js.map +0 -1
- package/es/marker/animate/fade-in.d.ts +0 -7
- package/es/marker/animate/fade-in.js +0 -20
- package/es/marker/animate/fade-in.js.map +0 -1
- package/es/marker/animate/fade-out.d.ts +0 -7
- package/es/marker/animate/fade-out.js +0 -20
- package/es/marker/animate/fade-out.js.map +0 -1
- package/es/marker/animate/index.js +0 -3
- package/es/marker/animate/index.js.map +0 -1
- package/es/marker/arc-area.d.ts +0 -55
- package/es/marker/arc-area.js +0 -143
- package/es/marker/arc-area.js.map +0 -1
- package/es/marker/arc-line.d.ts +0 -25
- package/es/marker/arc-line.js +0 -114
- package/es/marker/arc-line.js.map +0 -1
- package/es/marker/common-line.d.ts +0 -22
- package/es/marker/common-line.js +0 -58
- package/es/marker/common-line.js.map +0 -1
- package/es/segment/arc-segment.d.ts +0 -13
- package/es/segment/arc-segment.js +0 -49
- package/es/segment/arc-segment.js.map +0 -1
- package/es/util/interaction.d.ts +0 -4
- package/es/util/interaction.js +0 -30
- package/es/util/interaction.js.map +0 -1
- /package/cjs/marker/{animate/index.d.ts → util.d.ts} +0 -0
- /package/es/marker/{animate/index.d.ts → util.d.ts} +0 -0
package/cjs/marker/arc-line.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
}
|
package/cjs/marker/arc-line.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.MarkArcLine = exports.registerMarkArcLineAnimate = void 0;
|
|
6
|
-
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), segment_1 = require("../segment"), register_1 = require("./register"), constant_1 = require("../constant"), common_line_1 = require("./common-line"), type_1 = require("./type"), config_1 = require("./config"), animate_1 = require("./animate/animate");
|
|
8
|
-
|
|
9
|
-
function registerMarkArcLineAnimate() {
|
|
10
|
-
MarkArcLine._animate = animate_1.commonMarkLineAnimate;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
(0, register_1.loadMarkArcLineComponent)(), exports.registerMarkArcLineAnimate = registerMarkArcLineAnimate;
|
|
14
|
-
|
|
15
|
-
class MarkArcLine extends common_line_1.MarkCommonLine {
|
|
16
|
-
markerAnimate(state) {
|
|
17
|
-
MarkArcLine._animate && MarkArcLine._animate(this._line, this._label, this._animationConfig, state);
|
|
18
|
-
}
|
|
19
|
-
constructor(attributes, options) {
|
|
20
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : (0, vutils_1.merge)({}, MarkArcLine.defaultAttributes, attributes)),
|
|
21
|
-
this.name = "markArcLine";
|
|
22
|
-
}
|
|
23
|
-
getPointAttrByPosition(direction) {
|
|
24
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
25
|
-
const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, label: label} = this.attribute, {refX: refX = 0, refY: refY = 0} = label, labelRectHeight = Math.abs((null !== (_c = null === (_b = null === (_a = this._label.getTextShape()) || void 0 === _a ? void 0 : _a.AABBBounds) || void 0 === _b ? void 0 : _b.y2) && void 0 !== _c ? _c : 0) - (null !== (_e = null === (_d = this._label.getTextShape()) || void 0 === _d ? void 0 : _d.AABBBounds.y1) && void 0 !== _e ? _e : 0)), labelTextHeight = Math.abs((null !== (_h = null === (_g = null === (_f = this._label.getBgRect()) || void 0 === _f ? void 0 : _f.AABBBounds) || void 0 === _g ? void 0 : _g.y2) && void 0 !== _h ? _h : 0) - (null !== (_k = null === (_j = this._label.getBgRect()) || void 0 === _j ? void 0 : _j.AABBBounds.y1) && void 0 !== _k ? _k : 0)), labelHeight = Math.max(labelRectHeight, labelTextHeight);
|
|
26
|
-
let angle, orthogonalOffsetDirection;
|
|
27
|
-
switch (direction) {
|
|
28
|
-
case type_1.IMarkCommonArcLabelPosition.center:
|
|
29
|
-
angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 0;
|
|
30
|
-
break;
|
|
31
|
-
|
|
32
|
-
case type_1.IMarkCommonArcLabelPosition.arcInnerStart:
|
|
33
|
-
angle = startAngle, orthogonalOffsetDirection = -1;
|
|
34
|
-
break;
|
|
35
|
-
|
|
36
|
-
case type_1.IMarkCommonArcLabelPosition.arcOuterStart:
|
|
37
|
-
angle = startAngle, orthogonalOffsetDirection = 1;
|
|
38
|
-
break;
|
|
39
|
-
|
|
40
|
-
case type_1.IMarkCommonArcLabelPosition.arcInnerEnd:
|
|
41
|
-
angle = endAngle, orthogonalOffsetDirection = -1;
|
|
42
|
-
break;
|
|
43
|
-
|
|
44
|
-
case type_1.IMarkCommonArcLabelPosition.arcOuterEnd:
|
|
45
|
-
angle = endAngle, orthogonalOffsetDirection = 1;
|
|
46
|
-
break;
|
|
47
|
-
|
|
48
|
-
case type_1.IMarkCommonArcLabelPosition.arcInnerMiddle:
|
|
49
|
-
angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
|
|
50
|
-
break;
|
|
51
|
-
|
|
52
|
-
case type_1.IMarkCommonArcLabelPosition.arcOuterMiddle:
|
|
53
|
-
angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 1;
|
|
54
|
-
break;
|
|
55
|
-
|
|
56
|
-
default:
|
|
57
|
-
angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
position: {
|
|
61
|
-
x: center.x + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.cos(angle) + refX * Math.cos(angle - Math.PI / 2),
|
|
62
|
-
y: center.y + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.sin(angle) + refX * Math.sin(angle - Math.PI / 2)
|
|
63
|
-
},
|
|
64
|
-
angle: angle
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
getRotateByAngle(angle) {
|
|
68
|
-
var _a;
|
|
69
|
-
return angle - Math.PI / 2 + (null !== (_a = this.attribute.label.refAngle) && void 0 !== _a ? _a : 0);
|
|
70
|
-
}
|
|
71
|
-
createSegment() {
|
|
72
|
-
const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle, state: state} = this.attribute;
|
|
73
|
-
return new segment_1.ArcSegment({
|
|
74
|
-
center: center,
|
|
75
|
-
radius: radius,
|
|
76
|
-
startAngle: startAngle,
|
|
77
|
-
endAngle: endAngle,
|
|
78
|
-
startSymbol: startSymbol,
|
|
79
|
-
endSymbol: endSymbol,
|
|
80
|
-
lineStyle: lineStyle,
|
|
81
|
-
state: {
|
|
82
|
-
line: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.line),
|
|
83
|
-
startSymbol: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.lineStartSymbol),
|
|
84
|
-
endSymbol: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.lineEndSymbol)
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
setLineAttributes() {
|
|
89
|
-
const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle} = this.attribute;
|
|
90
|
-
this._line && this._line.setAttributes({
|
|
91
|
-
center: center,
|
|
92
|
-
radius: radius,
|
|
93
|
-
startAngle: startAngle,
|
|
94
|
-
endAngle: endAngle,
|
|
95
|
-
startSymbol: startSymbol,
|
|
96
|
-
endSymbol: endSymbol,
|
|
97
|
-
lineStyle: lineStyle
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
isValidPoints() {
|
|
101
|
-
return !0;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
exports.MarkArcLine = MarkArcLine, MarkArcLine.defaultAttributes = config_1.DEFAULT_MARK_ARC_LINE_THEME;
|
|
106
|
-
//# sourceMappingURL=arc-line.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/arc-line.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,wCAAwC;AACxC,yCAAsD;AACtD,0CAA6C;AAC7C,+CAA+C;AAG/C,iCAAqD;AAGrD,qCAAuD;AACvD,+CAA0D;AAE1D,IAAA,mCAAwB,GAAE,CAAC;AAE3B,SAAgB,0BAA0B;IACxC,WAAW,CAAC,QAAQ,GAAG,+BAAqB,CAAC;AAC/C,CAAC;AAFD,gEAEC;AACD,MAAa,WAAY,SAAQ,4BAAiE;IAMtF,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,YAAY,UAA4B,EAAE,OAA0B;QAClE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,WAAW,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAZlG,SAAI,GAAG,aAAa,CAAC;IAarB,CAAC;IAES,sBAAsB,CAAC,SAAsC;;QACrE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,SAA6B,CAAC;QAC3F,MAAM,EAAE,IAAI,GAAG,CAAC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egment } from '../segment';\nimport { loadMarkArcLineComponent } from './register';\nimport { DEFAULT_STATES } from '../constant';\nimport { MarkCommonLine } from './common-line';\nimport type { ComponentOptions } from '../interface';\nimport type { IArcGraphicAttribute } from '@visactor/vrender-core';\nimport { IMarkCommonArcLabelPosition } from './type';\n// eslint-disable-next-line no-duplicate-imports\nimport type { MarkArcLineAttrs, MarkerAnimationState } from './type';\nimport { DEFAULT_MARK_ARC_LINE_THEME } from './config';\nimport { commonMarkLineAnimate } from './animate/animate';\n\nloadMarkArcLineComponent();\n\nexport function registerMarkArcLineAnimate() {\n MarkArcLine._animate = commonMarkLineAnimate;\n}\nexport class MarkArcLine extends MarkCommonLine<IArcGraphicAttribute, IMarkCommonArcLabelPosition> {\n name = 'markArcLine';\n // eslint-disable-next-line max-len\n static defaultAttributes: Partial<MarkArcLineAttrs> = DEFAULT_MARK_ARC_LINE_THEME as unknown as MarkArcLineAttrs;\n protected _line!: ArcSegment;\n\n protected markerAnimate(state: MarkerAnimationState) {\n if (MarkArcLine._animate) {\n MarkArcLine._animate(this._line, this._label, this._animationConfig, state);\n }\n }\n\n constructor(attributes: MarkArcLineAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, MarkArcLine.defaultAttributes, attributes));\n }\n\n protected getPointAttrByPosition(direction: IMarkCommonArcLabelPosition) {\n const { center, radius, startAngle, endAngle, label } = this.attribute as MarkArcLineAttrs;\n const { refX = 0, refY = 0 } = label;\n const labelRectHeight = Math.abs(\n (this._label.getTextShape()?.AABBBounds?.y2 ?? 0) - (this._label.getTextShape()?.AABBBounds.y1 ?? 0)\n );\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 angle;\n // tag在正交方向是向内偏移,还是向外偏移\n // 不偏移: 0, 内: -1, 外: 1\n let orthogonalOffsetDirection;\n\n switch (direction) {\n case IMarkCommonArcLabelPosition.center:\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 0;\n break;\n case IMarkCommonArcLabelPosition.arcInnerStart:\n angle = startAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterStart:\n angle = startAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IMarkCommonArcLabelPosition.arcInnerEnd:\n angle = endAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterEnd:\n angle = endAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IMarkCommonArcLabelPosition.arcInnerMiddle:\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n break;\n case IMarkCommonArcLabelPosition.arcOuterMiddle:\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 1;\n break;\n default: // default arcInnerMiddle\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 getRotateByAngle(angle: number): number {\n return angle - Math.PI / 2 + (this.attribute.label.refAngle ?? 0);\n }\n\n protected createSegment() {\n const { center, radius, startAngle, endAngle, startSymbol, endSymbol, lineStyle, state } = this\n .attribute as MarkArcLineAttrs;\n return new ArcSegment({\n center,\n radius,\n startAngle,\n endAngle,\n startSymbol,\n endSymbol,\n lineStyle,\n state: {\n line: merge({}, DEFAULT_STATES, state?.line),\n startSymbol: merge({}, DEFAULT_STATES, state?.lineStartSymbol),\n endSymbol: merge({}, DEFAULT_STATES, state?.lineEndSymbol)\n }\n });\n }\n\n protected setLineAttributes() {\n const { center, radius, startAngle, endAngle, startSymbol, endSymbol, lineStyle } = this\n .attribute as MarkArcLineAttrs;\n if (this._line) {\n (this._line as any).setAttributes({\n center,\n radius,\n startAngle,\n endAngle,\n startSymbol,\n endSymbol,\n lineStyle\n });\n }\n }\n\n protected isValidPoints() {\n return true;\n }\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { IGroup } from '@visactor/vrender-core';
|
|
2
|
-
import type { ArcSegment, Segment } from '../segment';
|
|
3
|
-
import { Tag } from '../tag';
|
|
4
|
-
import type { CommonMarkLineAnimationType, CommonMarkLineAttrs, MarkerAnimationState, MarkerExitAnimation } from './type';
|
|
5
|
-
import { Marker } from './base';
|
|
6
|
-
export declare abstract class MarkCommonLine<LineAttr, LabelPosition> extends Marker<CommonMarkLineAttrs<LineAttr, LabelPosition, CommonMarkLineAnimationType>, CommonMarkLineAnimationType> {
|
|
7
|
-
name: string;
|
|
8
|
-
static _animate?: (line: Segment | ArcSegment, label: Tag, animationConfig: any, state: MarkerAnimationState) => void;
|
|
9
|
-
defaultUpdateAnimation: never;
|
|
10
|
-
defaultExitAnimation: MarkerExitAnimation;
|
|
11
|
-
protected _line: Segment | ArcSegment;
|
|
12
|
-
protected abstract createSegment(): any;
|
|
13
|
-
protected abstract setLineAttributes(): any;
|
|
14
|
-
protected abstract getPointAttrByPosition(position: any): any;
|
|
15
|
-
protected abstract getRotateByAngle(angle: number): number;
|
|
16
|
-
protected abstract markerAnimate(state: MarkerAnimationState): void;
|
|
17
|
-
getLine(): Segment | ArcSegment;
|
|
18
|
-
getLabel(): Tag;
|
|
19
|
-
protected setLabelPos(): void;
|
|
20
|
-
protected initMarker(container: IGroup): void;
|
|
21
|
-
protected updateMarker(): void;
|
|
22
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.MarkCommonLine = void 0;
|
|
6
|
-
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), tag_1 = require("../tag"), limit_shape_1 = require("../util/limit-shape"), constant_1 = require("../constant"), base_1 = require("./base"), animate_1 = require("./animate/animate");
|
|
8
|
-
|
|
9
|
-
class MarkCommonLine extends base_1.Marker {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments), this.name = "markCommonLine", this.defaultUpdateAnimation = animate_1.DefaultUpdateMarkLineAnimation,
|
|
12
|
-
this.defaultExitAnimation = animate_1.DefaultExitMarkerAnimation;
|
|
13
|
-
}
|
|
14
|
-
getLine() {
|
|
15
|
-
return this._line;
|
|
16
|
-
}
|
|
17
|
-
getLabel() {
|
|
18
|
-
return this._label;
|
|
19
|
-
}
|
|
20
|
-
setLabelPos() {
|
|
21
|
-
const {label: label = {}, limitRect: limitRect} = this.attribute, {position: position, confine: confine, autoRotate: autoRotate = !0} = label, labelPoint = this.getPointAttrByPosition(position);
|
|
22
|
-
if (this._label.setAttributes(Object.assign(Object.assign({}, labelPoint.position), {
|
|
23
|
-
angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0
|
|
24
|
-
})), limitRect && confine) {
|
|
25
|
-
const {x: x, y: y, width: width, height: height} = limitRect;
|
|
26
|
-
(0, limit_shape_1.limitShapeInBounds)(this._label, {
|
|
27
|
-
x1: x,
|
|
28
|
-
y1: y,
|
|
29
|
-
x2: x + width,
|
|
30
|
-
y2: y + height
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
initMarker(container) {
|
|
35
|
-
const {label: label, state: state} = this.attribute, line = this.createSegment();
|
|
36
|
-
line.name = "mark-common-line-line", this._line = line, container.add(line);
|
|
37
|
-
const markLabel = new tag_1.Tag(Object.assign(Object.assign({}, label), {
|
|
38
|
-
state: {
|
|
39
|
-
panel: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
|
|
40
|
-
text: (0, vutils_1.merge)({}, constant_1.DEFAULT_STATES, null == state ? void 0 : state.label)
|
|
41
|
-
}
|
|
42
|
-
}));
|
|
43
|
-
markLabel.name = "mark-common-line-label", this._label = markLabel, container.add(markLabel),
|
|
44
|
-
this.setLabelPos();
|
|
45
|
-
}
|
|
46
|
-
updateMarker() {
|
|
47
|
-
const {label: label} = this.attribute;
|
|
48
|
-
this.setLineAttributes(), this._label && this._label.setAttributes(Object.assign({
|
|
49
|
-
dx: 0,
|
|
50
|
-
dy: 0
|
|
51
|
-
}, label)), this.setLabelPos();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
exports.MarkCommonLine = MarkCommonLine;
|
|
56
|
-
//# sourceMappingURL=common-line.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/common-line.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAIzC,gCAA6B;AAO7B,qDAAyD;AACzD,0CAA6C;AAC7C,iCAAgC;AAChC,+CAA+F;AAE/F,MAAsB,cAAwC,SAAQ,aAGrE;IAHD;;QAIE,SAAI,GAAG,gBAAgB,CAAC;QAIxB,2BAAsB,GAAG,wCAA8B,CAAC;QACxD,yBAAoB,GAAG,oCAA0B,CAAC;IA0EpD,CAAC;IAjEC,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IACD,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAES,WAAW;QACnB,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QACjD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QACvD,MAAM,UAAU,GAAG,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,aAAa,iCACpB,UAAU,CAAC,QAAQ,KACtB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,gBAA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,CAAC,SAAsF,CAAC;QAE9G,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAEzB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,aAAa,iBACvB,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,IACD,KAAuB,EAC3B,CAAC;SACJ;QAED,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;CACF;AAnFD,wCAmFC","file":"common-line.js","sourcesContent":["import type { IGroup, INode } from '@visactor/vrender-core';\nimport { merge } from '@visactor/vutils';\nimport type { ArcSegment, Segment } from '../segment';\nimport type { TagAttributes } from '../tag';\n// eslint-disable-next-line no-duplicate-imports\nimport { Tag } from '../tag';\nimport type {\n CommonMarkLineAnimationType,\n CommonMarkLineAttrs,\n MarkerAnimationState,\n MarkerExitAnimation\n} from './type';\nimport { limitShapeInBounds } from '../util/limit-shape';\nimport { DEFAULT_STATES } from '../constant';\nimport { Marker } from './base';\nimport { DefaultExitMarkerAnimation, DefaultUpdateMarkLineAnimation } from './animate/animate';\n\nexport abstract class MarkCommonLine<LineAttr, LabelPosition> extends Marker<\n CommonMarkLineAttrs<LineAttr, LabelPosition, CommonMarkLineAnimationType>,\n CommonMarkLineAnimationType\n> {\n name = 'markCommonLine';\n\n /** animate */\n static _animate?: (line: Segment | ArcSegment, label: Tag, animationConfig: any, state: MarkerAnimationState) => void;\n defaultUpdateAnimation = DefaultUpdateMarkLineAnimation;\n defaultExitAnimation = DefaultExitMarkerAnimation;\n\n protected _line!: Segment | ArcSegment;\n protected abstract createSegment(): any;\n protected abstract setLineAttributes(): any;\n protected abstract getPointAttrByPosition(position: any): any;\n protected abstract getRotateByAngle(angle: number): number;\n protected abstract markerAnimate(state: MarkerAnimationState): void;\n\n getLine() {\n return this._line;\n }\n getLabel() {\n return this._label;\n }\n\n protected setLabelPos() {\n const { label = {}, limitRect } = this.attribute;\n const { position, confine, autoRotate = true } = label;\n const labelPoint = this.getPointAttrByPosition(position);\n this._label.setAttributes({\n ...labelPoint.position,\n angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0\n });\n if (limitRect && confine) {\n const { x, y, width, height } = limitRect;\n limitShapeInBounds(this._label, {\n x1: x,\n y1: y,\n x2: x + width,\n y2: y + height\n });\n }\n }\n\n protected initMarker(container: IGroup) {\n const { label, state } = this.attribute as CommonMarkLineAttrs<\n LineAttr,\n LabelPosition,\n CommonMarkLineAnimationType\n >;\n const line = this.createSegment();\n line.name = 'mark-common-line-line';\n this._line = line;\n container.add(line as unknown as INode);\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-common-line-label';\n this._label = markLabel;\n container.add(markLabel as unknown as INode);\n this.setLabelPos();\n }\n\n protected updateMarker() {\n const { label } = this.attribute as CommonMarkLineAttrs<LineAttr, LabelPosition, CommonMarkLineAnimationType>;\n\n this.setLineAttributes();\n\n if (this._label) {\n this._label.setAttributes({\n dx: 0,\n dy: 0, // 需要进行复位\n ...(label as TagAttributes)\n });\n }\n\n this.setLabelPos();\n }\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { IArc } from '@visactor/vrender-core';
|
|
2
|
-
import type { ArcSegmentAttributes } from './type';
|
|
3
|
-
import type { Point } from '../core/type';
|
|
4
|
-
import type { ComponentOptions } from '../interface';
|
|
5
|
-
import { Segment } from './segment';
|
|
6
|
-
export declare class ArcSegment extends Segment {
|
|
7
|
-
name: string;
|
|
8
|
-
line?: IArc;
|
|
9
|
-
constructor(attributes: ArcSegmentAttributes, options?: ComponentOptions);
|
|
10
|
-
getMainSegmentPoints(): Point[];
|
|
11
|
-
protected _computeRotate(angle: number): number;
|
|
12
|
-
protected render(): void;
|
|
13
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.ArcSegment = void 0;
|
|
6
|
-
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), vrender_core_1 = require("@visactor/vrender-core"), register_1 = require("./register"), segment_1 = require("./segment");
|
|
8
|
-
|
|
9
|
-
(0, register_1.loadArcSegmentComponent)();
|
|
10
|
-
|
|
11
|
-
class ArcSegment extends segment_1.Segment {
|
|
12
|
-
constructor(attributes, options) {
|
|
13
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : (0, vutils_1.merge)({}, segment_1.Segment.defaultAttributes, attributes)),
|
|
14
|
-
this.name = "arc-segment";
|
|
15
|
-
}
|
|
16
|
-
getMainSegmentPoints() {
|
|
17
|
-
return this._mainSegmentPoints;
|
|
18
|
-
}
|
|
19
|
-
_computeRotate(angle) {
|
|
20
|
-
return angle + Math.PI;
|
|
21
|
-
}
|
|
22
|
-
render() {
|
|
23
|
-
this.removeAllChild(!0), this._reset();
|
|
24
|
-
const {startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle, state: state, visible: visible = !0, radius: radius, startAngle: startAngle, endAngle: endAngle, center: center} = this.attribute;
|
|
25
|
-
if (!visible) return;
|
|
26
|
-
this._startAngle = startAngle, this._endAngle = endAngle;
|
|
27
|
-
const startPoint = {
|
|
28
|
-
x: center.x + radius * Math.cos(this._startAngle),
|
|
29
|
-
y: center.y + radius * Math.sin(this._startAngle)
|
|
30
|
-
}, endPoint = {
|
|
31
|
-
x: center.x + radius * Math.cos(this._endAngle),
|
|
32
|
-
y: center.y + radius * Math.sin(this._endAngle)
|
|
33
|
-
};
|
|
34
|
-
this._mainSegmentPoints = [ startPoint, endPoint ];
|
|
35
|
-
const startSymbolShape = this._renderSymbol(startSymbol, this._mainSegmentPoints, "start"), endSymbolShape = this._renderSymbol(endSymbol, this._mainSegmentPoints, "end");
|
|
36
|
-
this.startSymbol = startSymbolShape, this.endSymbol = endSymbolShape;
|
|
37
|
-
const line = vrender_core_1.graphicCreator.arc(Object.assign({
|
|
38
|
-
x: center.x,
|
|
39
|
-
y: center.y,
|
|
40
|
-
startAngle: startAngle,
|
|
41
|
-
endAngle: endAngle,
|
|
42
|
-
innerRadius: radius,
|
|
43
|
-
outerRadius: radius
|
|
44
|
-
}, lineStyle));
|
|
45
|
-
line.name = `${this.name}-line`, line.id = this._getNodeId("arc"), (0, vutils_1.isEmpty)(null == state ? void 0 : state.line) || (line.states = [].concat(state.line)[0]),
|
|
46
|
-
this.add(line), this.line = line;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
exports.ArcSegment = ArcSegment;
|
|
51
|
-
//# sourceMappingURL=arc-segment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/segment/arc-segment.ts"],"names":[],"mappings":";;;AAGA,6CAAkD;AAGlD,yDAAwD;AAIxD,yCAAqD;AACrD,uCAAoC;AAEpC,IAAA,kCAAuB,GAAE,CAAC;AAC1B,MAAa,UAAW,SAAQ,iBAAO;IAIrC,YAAY,UAAgC,EAAE,OAA0B;QACtE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,iBAAO,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAJ9F,SAAI,GAAG,aAAa,CAAC;IAKrB,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAES,cAAc,CAAC,KAAa;QACpC,OAAO,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC;IACzB,CAAC;IAES,MAAM;QACd,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,MAAM,EAEJ,WAAW,EACX,SAAS,EACT,SAAS,EACT,KAAK,EACL,OAAO,GAA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AAE,MAAM,EACnB,WAAW,EAAE,MAAM,IAChB,SAAS,EACZ,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,OAAO,CAAC;QAChC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,CAAC,IAAA,gBAAO,EAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC,EAAE;YACzB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;SACxC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AA1ED,gCA0EC","file":"arc-segment.js","sourcesContent":["/**\n * @description 标签组件\n */\nimport { isEmpty, merge } from '@visactor/vutils';\nimport type { IArc } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport type { ArcSegmentAttributes, SymbolAttributes } from './type';\nimport type { Point } from '../core/type';\nimport type { ComponentOptions } from '../interface';\nimport { loadArcSegmentComponent } from './register';\nimport { Segment } from './segment';\n\nloadArcSegmentComponent();\nexport class ArcSegment extends Segment {\n name = 'arc-segment';\n line?: IArc;\n\n constructor(attributes: ArcSegmentAttributes, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, Segment.defaultAttributes, attributes));\n }\n\n getMainSegmentPoints() {\n return this._mainSegmentPoints;\n }\n\n protected _computeRotate(angle: number) {\n return angle + Math.PI;\n }\n\n protected render() {\n this.removeAllChild(true);\n this._reset();\n const {\n // points,\n startSymbol,\n endSymbol,\n lineStyle,\n state,\n visible = true,\n radius,\n startAngle,\n endAngle,\n center\n } = this.attribute as ArcSegmentAttributes;\n\n if (!visible) {\n return;\n }\n\n this._startAngle = startAngle;\n this._endAngle = endAngle;\n\n // 绘制start和end symbol\n const startPoint: Point = {\n x: center.x + radius * Math.cos(this._startAngle),\n y: center.y + radius * Math.sin(this._startAngle)\n };\n const endPoint: Point = {\n x: center.x + radius * Math.cos(this._endAngle),\n y: center.y + radius * Math.sin(this._endAngle)\n };\n this._mainSegmentPoints = [startPoint, endPoint];\n\n const startSymbolShape = this._renderSymbol(startSymbol as SymbolAttributes, this._mainSegmentPoints, 'start');\n const endSymbolShape = this._renderSymbol(endSymbol as SymbolAttributes, this._mainSegmentPoints, 'end');\n\n this.startSymbol = startSymbolShape;\n this.endSymbol = endSymbolShape;\n\n const line = graphicCreator.arc({\n x: center.x,\n y: center.y,\n startAngle,\n endAngle,\n innerRadius: radius,\n outerRadius: radius,\n ...lineStyle\n });\n\n line.name = `${this.name}-line`;\n line.id = this._getNodeId('arc');\n if (!isEmpty(state?.line)) {\n line.states = [].concat(state.line)[0];\n }\n this.add(line);\n this.line = line;\n }\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { FederatedPointerEvent, IGraphic, IGroup } from '@visactor/vrender-core';
|
|
2
|
-
export declare const dispatchHoverState: (e: FederatedPointerEvent, container: IGroup, lastHover: IGraphic | null) => IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
|
|
3
|
-
export declare const dispatchUnHoverState: (e: FederatedPointerEvent, container: IGroup, lastHover: IGraphic | null) => IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
|
|
4
|
-
export declare const dispatchClickState: (e: FederatedPointerEvent, container: IGroup, lastSelect: IGraphic | null) => IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>;
|
package/cjs/util/interaction.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.dispatchClickState = exports.dispatchUnHoverState = exports.dispatchHoverState = void 0;
|
|
6
|
-
|
|
7
|
-
const constant_1 = require("../constant"), util_1 = require("../util"), vutils_1 = require("@visactor/vutils"), dispatchHoverState = (e, container, lastHover) => {
|
|
8
|
-
const target = e.target;
|
|
9
|
-
return target !== lastHover && target.name && !(0, vutils_1.isEmpty)(target.states) ? (target.addState(constant_1.StateValue.hover, !0),
|
|
10
|
-
(0, util_1.traverseGroup)(container, (node => {
|
|
11
|
-
node !== target && node.name && !(0, vutils_1.isEmpty)(node.states) && node.addState(constant_1.StateValue.hoverReverse, !0);
|
|
12
|
-
})), target) : lastHover;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
exports.dispatchHoverState = dispatchHoverState;
|
|
16
|
-
|
|
17
|
-
const dispatchUnHoverState = (e, container, lastHover) => lastHover ? ((0, util_1.traverseGroup)(container, (node => {
|
|
18
|
-
node.name && !(0, vutils_1.isEmpty)(node.states) && (node.removeState(constant_1.StateValue.hoverReverse),
|
|
19
|
-
node.removeState(constant_1.StateValue.hover));
|
|
20
|
-
})), null) : lastHover;
|
|
21
|
-
|
|
22
|
-
exports.dispatchUnHoverState = dispatchUnHoverState;
|
|
23
|
-
|
|
24
|
-
const dispatchClickState = (e, container, lastSelect) => {
|
|
25
|
-
const target = e.target;
|
|
26
|
-
return lastSelect === target && target.hasState(constant_1.StateValue.selected) ? ((0,
|
|
27
|
-
util_1.traverseGroup)(container, (node => {
|
|
28
|
-
node.name && !(0, vutils_1.isEmpty)(node.states) && (node.removeState(constant_1.StateValue.selectedReverse),
|
|
29
|
-
node.removeState(constant_1.StateValue.selected));
|
|
30
|
-
})), null) : target.name && !(0, vutils_1.isEmpty)(target.states) ? (target.addState(constant_1.StateValue.selected, !0),
|
|
31
|
-
(0, util_1.traverseGroup)(container, (node => {
|
|
32
|
-
node !== target && node.name && !(0, vutils_1.isEmpty)(node.states) && node.addState(constant_1.StateValue.selectedReverse, !0);
|
|
33
|
-
})), target) : lastSelect;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
exports.dispatchClickState = d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vBW,QAAA,kBAAkB,sBAuB7B","file":"interaction.js","sourcesContent":["import type { FederatedPointerEvent, IGraphic, IGroup } from '@visactor/vrender-core';\nimport { StateValue } from '../constant';\nimport { traverseGroup } from '../util';\nimport { isEmpty } from '@visactor/vutils';\n\nexport const dispatchHoverState = (e: FederatedPointerEvent, container: IGroup, lastHover: IGraphic | null) => {\n const target = e.target as unknown as IGraphic;\n if (target !== lastHover && target.name && !isEmpty(target.states)) {\n target.addState(StateValue.hover, true);\n traverseGroup(container, (node: IGraphic) => {\n if (node !== target && node.name && !isEmpty(node.states)) {\n node.addState(StateValue.hoverReverse, true);\n }\n });\n return target;\n }\n return lastHover;\n};\n\nexport const dispatchUnHoverState = (e: FederatedPointerEvent, container: IGroup, lastHover: IGraphic | null) => {\n if (lastHover) {\n traverseGroup(container, (node: IGraphic) => {\n if (node.name && !isEmpty(node.states)) {\n node.removeState(StateValue.hoverReverse);\n node.removeState(StateValue.hover);\n }\n });\n return null;\n }\n return lastHover;\n};\n\nexport const dispatchClickState = (e: FederatedPointerEvent, container: IGroup, lastSelect: IGraphic | null) => {\n const target = e.target as unknown as IGraphic;\n if (lastSelect === target && target.hasState(StateValue.selected)) {\n traverseGroup(container, (node: IGraphic) => {\n if (node.name && !isEmpty(node.states)) {\n node.removeState(StateValue.selectedReverse);\n node.removeState(StateValue.selected);\n }\n });\n // 取消选中\n return null;\n }\n\n if (target.name && !isEmpty(target.states)) {\n target.addState(StateValue.selected, true);\n traverseGroup(container, (node: IGraphic) => {\n if (node !== target && node.name && !isEmpty(node.states)) {\n node.addState(StateValue.selectedReverse, true);\n }\n });\n return target;\n }\n return lastSelect;\n};\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { IRichText, ISymbol, IImage, IArc } from '@visactor/vrender-core';
|
|
2
|
-
import type { ILine, IPolygon } from '@visactor/vrender-core';
|
|
3
|
-
import type { ArcSegment, Segment } from '../../segment';
|
|
4
|
-
import type { Tag } from '../../tag';
|
|
5
|
-
import type { CommonMarkAreaAnimationType, CommonMarkLineAnimationType, MarkPointAnimationType, MarkerAnimationState, MarkerExitAnimation, MarkerUpdateAnimation } from '../type';
|
|
6
|
-
export declare function commonMarkLineAnimate(line: Segment | ArcSegment, label: Tag, animationconfig: any, state: MarkerAnimationState): void;
|
|
7
|
-
export declare function markAreaAnimate(area: IPolygon, label: Tag, animationconfig: any, state: MarkerAnimationState): void;
|
|
8
|
-
export declare function markArcAreaAnimate(area: IArc, label: Tag, animationconfig: any, state: MarkerAnimationState): void;
|
|
9
|
-
export declare function markPointAnimate(lines: [Segment, ILine], item: Tag | IRichText | ISymbol | IImage, animationconfig: any, state: MarkerAnimationState): void;
|
|
10
|
-
export declare const DefaultUpdateMarkLineAnimation: MarkerUpdateAnimation<CommonMarkLineAnimationType>;
|
|
11
|
-
export declare const DefaultUpdateMarkAreaAnimation: MarkerUpdateAnimation<CommonMarkAreaAnimationType>;
|
|
12
|
-
export declare const DefaultUpdateMarkPointAnimation: MarkerUpdateAnimation<MarkPointAnimationType>;
|
|
13
|
-
export declare const DefaultExitMarkerAnimation: MarkerExitAnimation;
|
|
@@ -1,92 +0,0 @@
|
|
|
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: "lin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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"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
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;
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
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;
|