@visactor/vrender-components 0.18.10-alpha.1 → 0.18.10-alpha.3
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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/arc.d.ts +2 -2
- package/cjs/label/base.d.ts +2 -2
- package/{es/marker/polar/area.d.ts → cjs/marker/arc-area.d.ts} +15 -9
- package/cjs/marker/arc-area.js +123 -0
- package/cjs/marker/arc-area.js.map +1 -0
- package/cjs/marker/arc-line.d.ts +23 -0
- package/cjs/marker/arc-line.js +103 -0
- package/cjs/marker/arc-line.js.map +1 -0
- package/cjs/marker/{cartesian/area.d.ts → area.d.ts} +13 -8
- package/cjs/marker/{cartesian/area.js → area.js} +16 -17
- package/cjs/marker/area.js.map +1 -0
- package/cjs/marker/base-line.d.ts +2 -2
- package/cjs/marker/base-line.js +4 -18
- package/cjs/marker/base-line.js.map +1 -1
- package/cjs/marker/config.d.ts +55 -12
- package/cjs/marker/config.js +54 -43
- package/cjs/marker/config.js.map +1 -1
- package/cjs/marker/index.d.ts +4 -4
- package/cjs/marker/index.js +3 -3
- package/cjs/marker/index.js.map +1 -1
- package/cjs/marker/line.d.ts +28 -0
- package/cjs/marker/line.js +153 -0
- package/cjs/marker/line.js.map +1 -0
- package/cjs/marker/point.d.ts +1 -1
- package/cjs/marker/register.d.ts +4 -5
- package/cjs/marker/register.js +8 -12
- package/cjs/marker/register.js.map +1 -1
- package/cjs/marker/type.d.ts +30 -38
- package/cjs/marker/type.js +21 -21
- package/cjs/marker/type.js.map +1 -1
- package/cjs/tag/tag.d.ts +5 -0
- package/cjs/tag/tag.js +11 -2
- package/cjs/tag/tag.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/label/arc.d.ts +2 -2
- package/es/label/base.d.ts +2 -2
- package/{cjs/marker/polar/area.d.ts → es/marker/arc-area.d.ts} +15 -9
- package/es/marker/arc-area.js +133 -0
- package/es/marker/arc-area.js.map +1 -0
- package/es/marker/arc-line.d.ts +23 -0
- package/es/marker/arc-line.js +109 -0
- package/es/marker/arc-line.js.map +1 -0
- package/es/marker/{cartesian/area.d.ts → area.d.ts} +13 -8
- package/es/marker/{cartesian/area.js → area.js} +20 -21
- package/es/marker/area.js.map +1 -0
- package/es/marker/base-line.d.ts +2 -2
- package/es/marker/base-line.js +2 -20
- package/es/marker/base-line.js.map +1 -1
- package/es/marker/config.d.ts +55 -12
- package/es/marker/config.js +54 -43
- package/es/marker/config.js.map +1 -1
- package/es/marker/index.d.ts +4 -4
- package/es/marker/index.js +4 -4
- package/es/marker/index.js.map +1 -1
- package/es/marker/line.d.ts +28 -0
- package/es/marker/line.js +159 -0
- package/es/marker/line.js.map +1 -0
- package/es/marker/point.d.ts +1 -1
- package/es/marker/register.d.ts +4 -5
- package/es/marker/register.js +4 -8
- package/es/marker/register.js.map +1 -1
- package/es/marker/type.d.ts +30 -38
- package/es/marker/type.js +22 -22
- package/es/marker/type.js.map +1 -1
- package/es/tag/tag.d.ts +5 -0
- package/es/tag/tag.js +11 -2
- package/es/tag/tag.js.map +1 -1
- package/package.json +3 -3
- package/cjs/marker/cartesian/area.js.map +0 -1
- package/cjs/marker/cartesian/line.d.ts +0 -14
- package/cjs/marker/cartesian/line.js +0 -57
- package/cjs/marker/cartesian/line.js.map +0 -1
- package/cjs/marker/polar/arc-line.d.ts +0 -11
- package/cjs/marker/polar/arc-line.js +0 -50
- package/cjs/marker/polar/arc-line.js.map +0 -1
- package/cjs/marker/polar/area.js +0 -117
- package/cjs/marker/polar/area.js.map +0 -1
- package/cjs/marker/polar/line.d.ts +0 -1
- package/cjs/marker/polar/line.js +0 -3
- package/cjs/marker/polar/line.js.map +0 -1
- package/es/marker/cartesian/area.js.map +0 -1
- package/es/marker/cartesian/line.d.ts +0 -14
- package/es/marker/cartesian/line.js +0 -61
- package/es/marker/cartesian/line.js.map +0 -1
- package/es/marker/polar/arc-line.d.ts +0 -11
- package/es/marker/polar/arc-line.js +0 -54
- package/es/marker/polar/arc-line.js.map +0 -1
- package/es/marker/polar/area.js +0 -127
- package/es/marker/polar/area.js.map +0 -1
- package/es/marker/polar/line.d.ts +0 -1
- package/es/marker/polar/line.js +0 -3
- package/es/marker/polar/line.js.map +0 -1
package/es/marker/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TextAlignType, TextBaselineType } from '@visactor/vrender-core';
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
2
|
+
import { IMarkAreaLabelPosition, IMarkLineLabelPosition, IMarkCommonArcLabelPosition } from './type';
|
|
3
|
+
export declare const DEFAULT_MARK_LINE_THEME: {
|
|
4
4
|
interactive: boolean;
|
|
5
5
|
startSymbol: {
|
|
6
6
|
visible: boolean;
|
|
@@ -17,7 +17,7 @@ export declare const DEFAULT_COMMON_MARK_LINE_THEME: {
|
|
|
17
17
|
lineWidth: number;
|
|
18
18
|
};
|
|
19
19
|
label: {
|
|
20
|
-
position:
|
|
20
|
+
position: IMarkLineLabelPosition;
|
|
21
21
|
refX: number;
|
|
22
22
|
refY: number;
|
|
23
23
|
refAngle: number;
|
|
@@ -28,6 +28,8 @@ export declare const DEFAULT_COMMON_MARK_LINE_THEME: {
|
|
|
28
28
|
fontSize: number;
|
|
29
29
|
fontWeight: string;
|
|
30
30
|
fontStyle: string;
|
|
31
|
+
textAlign: string;
|
|
32
|
+
textBaseline: string;
|
|
31
33
|
};
|
|
32
34
|
padding: number[];
|
|
33
35
|
panel: {
|
|
@@ -43,16 +45,55 @@ export declare const DEFAULT_COMMON_MARK_LINE_THEME: {
|
|
|
43
45
|
lineDash: number[];
|
|
44
46
|
};
|
|
45
47
|
};
|
|
46
|
-
export declare const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
export declare const DEFAULT_MARK_ARC_LINE_THEME: {
|
|
49
|
+
interactive: boolean;
|
|
50
|
+
startSymbol: {
|
|
51
|
+
visible: boolean;
|
|
52
|
+
symbolType: string;
|
|
53
|
+
size: number;
|
|
54
|
+
fill: string;
|
|
55
|
+
lineWidth: number;
|
|
56
|
+
};
|
|
57
|
+
endSymbol: {
|
|
58
|
+
visible: boolean;
|
|
59
|
+
symbolType: string;
|
|
60
|
+
size: number;
|
|
61
|
+
fill: string;
|
|
62
|
+
lineWidth: number;
|
|
63
|
+
};
|
|
64
|
+
label: {
|
|
65
|
+
position: IMarkCommonArcLabelPosition;
|
|
66
|
+
refX: number;
|
|
67
|
+
refY: number;
|
|
68
|
+
refAngle: number;
|
|
69
|
+
textStyle: {
|
|
70
|
+
fill: string;
|
|
71
|
+
stroke: string;
|
|
72
|
+
lineWidth: number;
|
|
73
|
+
fontSize: number;
|
|
74
|
+
fontWeight: string;
|
|
75
|
+
fontStyle: string;
|
|
76
|
+
textAlign: string;
|
|
77
|
+
textBaseline: string;
|
|
78
|
+
};
|
|
79
|
+
padding: number[];
|
|
80
|
+
panel: {
|
|
81
|
+
visible: boolean;
|
|
82
|
+
cornerRadius: number;
|
|
83
|
+
fill: string;
|
|
84
|
+
fillOpacity: number;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
lineStyle: {
|
|
88
|
+
stroke: string;
|
|
89
|
+
lineWidth: number;
|
|
90
|
+
lineDash: number[];
|
|
50
91
|
};
|
|
51
92
|
};
|
|
52
|
-
export declare const
|
|
93
|
+
export declare const DEFAULT_MARK_AREA_THEME: {
|
|
53
94
|
interactive: boolean;
|
|
54
95
|
label: {
|
|
55
|
-
position:
|
|
96
|
+
position: IMarkAreaLabelPosition;
|
|
56
97
|
textStyle: {
|
|
57
98
|
fill: string;
|
|
58
99
|
stroke: string;
|
|
@@ -60,6 +101,8 @@ export declare const DEFAULT_CARTESIAN_MARK_AREA_THEME: {
|
|
|
60
101
|
fontSize: number;
|
|
61
102
|
fontWeight: string;
|
|
62
103
|
fontStyle: string;
|
|
104
|
+
textAlign: string;
|
|
105
|
+
textBaseline: string;
|
|
63
106
|
};
|
|
64
107
|
padding: number[];
|
|
65
108
|
panel: {
|
|
@@ -74,10 +117,10 @@ export declare const DEFAULT_CARTESIAN_MARK_AREA_THEME: {
|
|
|
74
117
|
visible: boolean;
|
|
75
118
|
};
|
|
76
119
|
};
|
|
77
|
-
export declare const
|
|
120
|
+
export declare const DEFAULT_MARK_ARC_AREA_THEME: {
|
|
78
121
|
interactive: boolean;
|
|
79
122
|
label: {
|
|
80
|
-
position:
|
|
123
|
+
position: IMarkCommonArcLabelPosition;
|
|
81
124
|
textStyle: {
|
|
82
125
|
fill: string;
|
|
83
126
|
stroke: string;
|
|
@@ -86,7 +129,7 @@ export declare const DEFAULT_POLAR_MARK_AREA_THEME: {
|
|
|
86
129
|
fontWeight: string;
|
|
87
130
|
fontStyle: string;
|
|
88
131
|
textAlign: string;
|
|
89
|
-
|
|
132
|
+
textBaseline: string;
|
|
90
133
|
};
|
|
91
134
|
padding: number[];
|
|
92
135
|
panel: {
|
package/es/marker/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IMarkAreaLabelPosition, IMarkLineLabelPosition, IMarkCommonArcLabelPosition } from "./type";
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const DEFAULT_MARK_LINE_THEME = {
|
|
4
4
|
interactive: !0,
|
|
5
5
|
startSymbol: {
|
|
6
6
|
visible: !1,
|
|
@@ -17,7 +17,7 @@ export const DEFAULT_COMMON_MARK_LINE_THEME = {
|
|
|
17
17
|
lineWidth: 0
|
|
18
18
|
},
|
|
19
19
|
label: {
|
|
20
|
-
position:
|
|
20
|
+
position: IMarkLineLabelPosition.end,
|
|
21
21
|
refX: 0,
|
|
22
22
|
refY: 0,
|
|
23
23
|
refAngle: 0,
|
|
@@ -27,7 +27,9 @@ export const DEFAULT_COMMON_MARK_LINE_THEME = {
|
|
|
27
27
|
lineWidth: 0,
|
|
28
28
|
fontSize: 10,
|
|
29
29
|
fontWeight: "normal",
|
|
30
|
-
fontStyle: "normal"
|
|
30
|
+
fontStyle: "normal",
|
|
31
|
+
textAlign: "center",
|
|
32
|
+
textBaseline: "middle"
|
|
31
33
|
},
|
|
32
34
|
padding: [ 2, 2, 4, 4 ],
|
|
33
35
|
panel: {
|
|
@@ -44,56 +46,65 @@ export const DEFAULT_COMMON_MARK_LINE_THEME = {
|
|
|
44
46
|
}
|
|
45
47
|
};
|
|
46
48
|
|
|
47
|
-
export const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
insideStartBottom: {
|
|
57
|
-
textAlign: "left",
|
|
58
|
-
textBaseline: "top"
|
|
59
|
-
},
|
|
60
|
-
middle: {
|
|
61
|
-
textAlign: "center",
|
|
62
|
-
textBaseline: "middle"
|
|
63
|
-
},
|
|
64
|
-
insideMiddleTop: {
|
|
65
|
-
textAlign: "center",
|
|
66
|
-
textBaseline: "bottom"
|
|
67
|
-
},
|
|
68
|
-
insideMiddleBottom: {
|
|
69
|
-
textAlign: "center",
|
|
70
|
-
textBaseline: "top"
|
|
49
|
+
export const DEFAULT_MARK_ARC_LINE_THEME = {
|
|
50
|
+
interactive: !0,
|
|
51
|
+
startSymbol: {
|
|
52
|
+
visible: !1,
|
|
53
|
+
symbolType: "triangle",
|
|
54
|
+
size: 12,
|
|
55
|
+
fill: "rgba(46, 47, 50)",
|
|
56
|
+
lineWidth: 0
|
|
71
57
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
endSymbol: {
|
|
59
|
+
visible: !0,
|
|
60
|
+
symbolType: "triangle",
|
|
61
|
+
size: 12,
|
|
62
|
+
fill: "rgba(46, 47, 50)",
|
|
63
|
+
lineWidth: 0
|
|
75
64
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
label: {
|
|
66
|
+
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
67
|
+
refX: 0,
|
|
68
|
+
refY: 0,
|
|
69
|
+
refAngle: 0,
|
|
70
|
+
textStyle: {
|
|
71
|
+
fill: "#fff",
|
|
72
|
+
stroke: "#fff",
|
|
73
|
+
lineWidth: 0,
|
|
74
|
+
fontSize: 10,
|
|
75
|
+
fontWeight: "normal",
|
|
76
|
+
fontStyle: "normal",
|
|
77
|
+
textAlign: "center",
|
|
78
|
+
textBaseline: "middle"
|
|
79
|
+
},
|
|
80
|
+
padding: [ 2, 2, 4, 4 ],
|
|
81
|
+
panel: {
|
|
82
|
+
visible: !0,
|
|
83
|
+
cornerRadius: 0,
|
|
84
|
+
fill: "rgb(48, 115, 242)",
|
|
85
|
+
fillOpacity: .8
|
|
86
|
+
}
|
|
79
87
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
lineStyle: {
|
|
89
|
+
stroke: "#b2bacf",
|
|
90
|
+
lineWidth: 1,
|
|
91
|
+
lineDash: [ 2 ]
|
|
83
92
|
}
|
|
84
93
|
};
|
|
85
94
|
|
|
86
|
-
export const
|
|
95
|
+
export const DEFAULT_MARK_AREA_THEME = {
|
|
87
96
|
interactive: !0,
|
|
88
97
|
label: {
|
|
89
|
-
position:
|
|
98
|
+
position: IMarkAreaLabelPosition.right,
|
|
90
99
|
textStyle: {
|
|
91
100
|
fill: "#fff",
|
|
92
101
|
stroke: "#fff",
|
|
93
102
|
lineWidth: 0,
|
|
94
103
|
fontSize: 10,
|
|
95
104
|
fontWeight: "normal",
|
|
96
|
-
fontStyle: "normal"
|
|
105
|
+
fontStyle: "normal",
|
|
106
|
+
textAlign: "center",
|
|
107
|
+
textBaseline: "middle"
|
|
97
108
|
},
|
|
98
109
|
padding: [ 2, 2, 4, 4 ],
|
|
99
110
|
panel: {
|
|
@@ -109,10 +120,10 @@ export const DEFAULT_CARTESIAN_MARK_AREA_THEME = {
|
|
|
109
120
|
}
|
|
110
121
|
};
|
|
111
122
|
|
|
112
|
-
export const
|
|
123
|
+
export const DEFAULT_MARK_ARC_AREA_THEME = {
|
|
113
124
|
interactive: !0,
|
|
114
125
|
label: {
|
|
115
|
-
position:
|
|
126
|
+
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
116
127
|
textStyle: {
|
|
117
128
|
fill: "#fff",
|
|
118
129
|
stroke: "#fff",
|
|
@@ -121,7 +132,7 @@ export const DEFAULT_POLAR_MARK_AREA_THEME = {
|
|
|
121
132
|
fontWeight: "normal",
|
|
122
133
|
fontStyle: "normal",
|
|
123
134
|
textAlign: "center",
|
|
124
|
-
|
|
135
|
+
textBaseline: "middle"
|
|
125
136
|
},
|
|
126
137
|
padding: [ 2, 2, 4, 4 ],
|
|
127
138
|
panel: {
|
package/es/marker/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAEpH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,4BAA4B,CAAC,GAAG;QAC1C,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,EAAE;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AClB,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,GAAG;YAChB,IAAI,EAAE,EAAE;SACT;QACD,SAAS,EAAE;YACT,EAAE,EAAE,CAAC;YACL,EAAE,EAAE,CAAC;SACN;QACD,UAAU,EAAE;YACV,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX;QACD,aAAa,EAAE;YACb,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAK1C;IACF,GAAG,EAAE;QACH,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,QAAQ;KACvB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,QAAQ;KACvB;IACD,SAAS,EAAE;QACT,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,QAAQ;KACvB;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,QAAQ;KACvB;CACF,CAAC","file":"config.js","sourcesContent":["import type { TextAlignType, TextBaselineType } from '@visactor/vrender-core';\nimport { ICartesianMarkAreaLabelPosition, ICommonMarkLineLabelPosition, IPolarMarkAreaLabelPosition } from './type';\n\nexport const DEFAULT_COMMON_MARK_LINE_THEME = {\n interactive: true,\n startSymbol: {\n visible: false,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n endSymbol: {\n visible: true,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n label: {\n position: ICommonMarkLineLabelPosition.end,\n refX: 0,\n refY: 0,\n refAngle: 0,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n lineStyle: {\n stroke: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n};\n\nexport const DEFAULT_COMMON_MARK_LINE_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n start: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n insideStartTop: {\n textAlign: 'left',\n textBaseline: 'bottom'\n },\n insideStartBottom: {\n textAlign: 'left',\n textBaseline: 'top'\n },\n\n middle: {\n textAlign: 'center',\n textBaseline: 'middle'\n },\n insideMiddleTop: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n insideMiddleBottom: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n\n end: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideEndTop: {\n textAlign: 'right',\n textBaseline: 'bottom'\n },\n insideEndBottom: {\n textAlign: 'right',\n textBaseline: 'top'\n }\n};\n\nexport const DEFAULT_CARTESIAN_MARK_AREA_THEME = {\n interactive: true,\n label: {\n position: ICartesianMarkAreaLabelPosition.right,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_POLAR_MARK_AREA_THEME = {\n interactive: true,\n label: {\n position: IPolarMarkAreaLabelPosition.arcInner,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseLine: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n left: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n insideLeft: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n\n right: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideRight: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n\n top: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n insideTop: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n\n bottom: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n insideBottom: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n\n middle: {\n textAlign: 'center',\n textBaseline: 'middle'\n }\n};\n\nexport const DEFAULT_MARK_POINT_THEME = {\n interactive: true,\n itemLine: {\n visible: true,\n decorativeLine: {\n visible: false,\n length: 30\n },\n startSymbol: {\n visible: true,\n clip: true,\n symbolType: 'circle',\n size: 20,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n endSymbol: {\n visible: false,\n clip: true,\n symbolType: 'triangle',\n size: 12,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n lineStyle: {\n stroke: '#000',\n lineWidth: 1\n }\n },\n itemContent: {\n type: 'text',\n position: 'middle',\n refX: 10,\n symbolStyle: {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n },\n textStyle: {\n dx: 0,\n dy: 0\n },\n imageStyle: {\n width: 80,\n height: 80\n },\n richTextStyle: {\n width: 100,\n height: 100\n }\n }\n};\n\nexport const DEFAULT_MARK_POINT_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n top: {\n textAlign: 'left',\n textBaseline: 'bottom'\n },\n bottom: {\n textAlign: 'left',\n textBaseline: 'top'\n },\n middle: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideTop: {\n textAlign: 'right',\n textBaseline: 'bottom'\n },\n insideBottom: {\n textAlign: 'right',\n textBaseline: 'top'\n },\n insideMiddle: {\n textAlign: 'right',\n textBaseline: 'middle'\n }\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/marker/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAErG,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,sBAAsB,CAAC,GAAG;QACpC,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,CAAC;YACZ,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,QAAQ;YACpB,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,QAAQ;YACnB,YAAY,EAAE,QAAQ;SACvB;QACD,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACrB,KAAK,EAAE;YACL,OAAO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,EAAE;YACT,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,CAAC;SACb;KACF;IACD,WAAW,EAAE;QACX,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,EAAE;QACR,WAAW,EAAE;YACX,UAAU,EAAE,MAAM;YAClB,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,GAAG;YAChB,IAAI,EAAE,EAAE;SACT;QACD,SAAS,EAAE;YACT,EAAE,EAAE,CAAC;YACL,EAAE,EAAE,CAAC;SACN;QACD,UAAU,EAAE;YACV,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX;QACD,aAAa,EAAE;YACb,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAK1C;IACF,GAAG,EAAE;QACH,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,QAAQ;KACvB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,MAAM,EAAE;QACN,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,QAAQ;KACvB;IACD,SAAS,EAAE;QACT,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,QAAQ;KACvB;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,QAAQ;KACvB;CACF,CAAC","file":"config.js","sourcesContent":["import type { TextAlignType, TextBaselineType } from '@visactor/vrender-core';\nimport { IMarkAreaLabelPosition, IMarkLineLabelPosition, IMarkCommonArcLabelPosition } from './type';\n\nexport const DEFAULT_MARK_LINE_THEME = {\n interactive: true,\n startSymbol: {\n visible: false,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n endSymbol: {\n visible: true,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n label: {\n position: IMarkLineLabelPosition.end,\n refX: 0,\n refY: 0,\n refAngle: 0,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n lineStyle: {\n stroke: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n};\n\nexport const DEFAULT_MARK_ARC_LINE_THEME = {\n interactive: true,\n startSymbol: {\n visible: false,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n endSymbol: {\n visible: true,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n label: {\n position: IMarkCommonArcLabelPosition.arcOuterMiddle,\n refX: 0,\n refY: 0,\n refAngle: 0,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n lineStyle: {\n stroke: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n};\n\nexport const DEFAULT_MARK_AREA_THEME = {\n interactive: true,\n label: {\n position: IMarkAreaLabelPosition.right,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_MARK_ARC_AREA_THEME = {\n interactive: true,\n label: {\n position: IMarkCommonArcLabelPosition.arcOuterMiddle,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n left: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n insideLeft: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n\n right: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideRight: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n\n top: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n insideTop: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n\n bottom: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n insideBottom: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n\n middle: {\n textAlign: 'center',\n textBaseline: 'middle'\n }\n};\n\nexport const DEFAULT_MARK_POINT_THEME = {\n interactive: true,\n itemLine: {\n visible: true,\n decorativeLine: {\n visible: false,\n length: 30\n },\n startSymbol: {\n visible: true,\n clip: true,\n symbolType: 'circle',\n size: 20,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n endSymbol: {\n visible: false,\n clip: true,\n symbolType: 'triangle',\n size: 12,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n lineStyle: {\n stroke: '#000',\n lineWidth: 1\n }\n },\n itemContent: {\n type: 'text',\n position: 'middle',\n refX: 10,\n symbolStyle: {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n },\n textStyle: {\n dx: 0,\n dy: 0\n },\n imageStyle: {\n width: 80,\n height: 80\n },\n richTextStyle: {\n width: 100,\n height: 100\n }\n }\n};\n\nexport const DEFAULT_MARK_POINT_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n top: {\n textAlign: 'left',\n textBaseline: 'bottom'\n },\n bottom: {\n textAlign: 'left',\n textBaseline: 'top'\n },\n middle: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideTop: {\n textAlign: 'right',\n textBaseline: 'bottom'\n },\n insideBottom: {\n textAlign: 'right',\n textBaseline: 'top'\n },\n insideMiddle: {\n textAlign: 'right',\n textBaseline: 'middle'\n }\n};\n"]}
|
package/es/marker/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './type';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
2
|
+
export * from './line';
|
|
3
|
+
export * from './area';
|
|
4
|
+
export * from './arc-line';
|
|
5
|
+
export * from './arc-area';
|
|
6
6
|
export * from './point';
|
package/es/marker/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export * from "./type";
|
|
2
2
|
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./line";
|
|
4
4
|
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./area";
|
|
6
6
|
|
|
7
|
-
export * from "./
|
|
7
|
+
export * from "./arc-line";
|
|
8
8
|
|
|
9
|
-
export * from "./
|
|
9
|
+
export * from "./arc-area";
|
|
10
10
|
|
|
11
11
|
export * from "./point";
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/es/marker/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,
|
|
1
|
+
{"version":3,"sources":["../src/marker/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAE3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC","file":"index.js","sourcesContent":["export * from './type';\nexport * from './line';\nexport * from './area';\nexport * from './arc-line';\n// export * from './polar/line';\nexport * from './arc-area';\nexport * from './point';\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IMarkLineLabelPosition } from './type';
|
|
2
|
+
import type { MarkLineAttrs } from './type';
|
|
3
|
+
import type { ComponentOptions } from '../interface';
|
|
4
|
+
import { BaseMarkLine } from './base-line';
|
|
5
|
+
import type { ArcSegment } from '../segment';
|
|
6
|
+
import { Segment } from '../segment';
|
|
7
|
+
import type { ILineGraphicAttribute } from '@visactor/vrender-core';
|
|
8
|
+
export declare class MarkLine extends BaseMarkLine<ILineGraphicAttribute, IMarkLineLabelPosition> {
|
|
9
|
+
name: string;
|
|
10
|
+
static defaultAttributes: Partial<MarkLineAttrs>;
|
|
11
|
+
protected _line: Segment | ArcSegment;
|
|
12
|
+
constructor(attributes: MarkLineAttrs, options?: ComponentOptions);
|
|
13
|
+
protected isValidPoints(): boolean;
|
|
14
|
+
protected getLabelOffsetByDirection(direction: IMarkLineLabelPosition): {
|
|
15
|
+
offsetX: number;
|
|
16
|
+
offsetY: number;
|
|
17
|
+
};
|
|
18
|
+
protected getPositionByDirection(direction: IMarkLineLabelPosition): {
|
|
19
|
+
position: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
angle: number;
|
|
24
|
+
};
|
|
25
|
+
protected setLabelPos(): void;
|
|
26
|
+
protected createSegment(): Segment;
|
|
27
|
+
protected setLineAttributes(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { isValidNumber, merge } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { IMarkLineLabelPosition } from "./type";
|
|
4
|
+
|
|
5
|
+
import { loadMarkLineComponent } from "./register";
|
|
6
|
+
|
|
7
|
+
import { BaseMarkLine } from "./base-line";
|
|
8
|
+
|
|
9
|
+
import { Segment } from "../segment";
|
|
10
|
+
|
|
11
|
+
import { DEFAULT_STATES } from "../constant";
|
|
12
|
+
|
|
13
|
+
import { DEFAULT_MARK_LINE_THEME } from "./config";
|
|
14
|
+
|
|
15
|
+
loadMarkLineComponent();
|
|
16
|
+
|
|
17
|
+
export class MarkLine extends BaseMarkLine {
|
|
18
|
+
constructor(attributes, options) {
|
|
19
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkLine.defaultAttributes, attributes)),
|
|
20
|
+
this.name = "MarkLine";
|
|
21
|
+
}
|
|
22
|
+
isValidPoints() {
|
|
23
|
+
const {points: points} = this.attribute;
|
|
24
|
+
if (!points || points.length < 2) return !1;
|
|
25
|
+
let validFlag = !0;
|
|
26
|
+
return points.forEach((point => {
|
|
27
|
+
if (point.length) point.forEach((p => {
|
|
28
|
+
isValidNumber(p.x) && isValidNumber(p.y) || (validFlag = !1);
|
|
29
|
+
})); else if (!isValidNumber(point.x) || !isValidNumber(point.y)) return void (validFlag = !1);
|
|
30
|
+
})), validFlag;
|
|
31
|
+
}
|
|
32
|
+
getLabelOffsetByDirection(direction) {
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
34
|
+
const 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), labelRectWidth = Math.abs((null !== (_k = null === (_j = this._label.getTextShape().AABBBounds) || void 0 === _j ? void 0 : _j.x2) && void 0 !== _k ? _k : 0) - (null !== (_m = null === (_l = this._label.getTextShape()) || void 0 === _l ? void 0 : _l.AABBBounds.x1) && void 0 !== _m ? _m : 0)), labelTextWidth = Math.abs((null !== (_p = null === (_o = this._label.getBgRect().AABBBounds) || void 0 === _o ? void 0 : _o.x2) && void 0 !== _p ? _p : 0) - (null !== (_r = null === (_q = this._label.getBgRect()) || void 0 === _q ? void 0 : _q.AABBBounds.x1) && void 0 !== _r ? _r : 0)), labelWidth = Math.max(labelRectWidth, labelTextWidth);
|
|
35
|
+
switch (direction) {
|
|
36
|
+
case IMarkLineLabelPosition.start:
|
|
37
|
+
return {
|
|
38
|
+
offsetX: -labelWidth / 2,
|
|
39
|
+
offsetY: 0
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
case IMarkLineLabelPosition.insideStartTop:
|
|
43
|
+
return {
|
|
44
|
+
offsetX: labelWidth / 2,
|
|
45
|
+
offsetY: labelHeight / 2
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
case IMarkLineLabelPosition.insideStartBottom:
|
|
49
|
+
return {
|
|
50
|
+
offsetX: labelWidth / 2,
|
|
51
|
+
offsetY: -labelHeight / 2
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
case IMarkLineLabelPosition.middle:
|
|
55
|
+
return {
|
|
56
|
+
offsetX: 0,
|
|
57
|
+
offsetY: 0
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
case IMarkLineLabelPosition.insideMiddleTop:
|
|
61
|
+
return {
|
|
62
|
+
offsetX: 0,
|
|
63
|
+
offsetY: labelHeight / 2
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
case IMarkLineLabelPosition.insideMiddleBottom:
|
|
67
|
+
return {
|
|
68
|
+
offsetX: 0,
|
|
69
|
+
offsetY: -labelHeight / 2
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
case IMarkLineLabelPosition.end:
|
|
73
|
+
return {
|
|
74
|
+
offsetX: labelWidth / 2,
|
|
75
|
+
offsetY: 0
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
case IMarkLineLabelPosition.insideEndTop:
|
|
79
|
+
return {
|
|
80
|
+
offsetX: -labelWidth / 2,
|
|
81
|
+
offsetY: labelHeight / 2
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
case IMarkLineLabelPosition.insideEndBottom:
|
|
85
|
+
return {
|
|
86
|
+
offsetX: -labelWidth / 2,
|
|
87
|
+
offsetY: -labelHeight / 2
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
default:
|
|
91
|
+
return {
|
|
92
|
+
offsetX: labelWidth / 2,
|
|
93
|
+
offsetY: 0
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
getPositionByDirection(direction) {
|
|
98
|
+
var _a;
|
|
99
|
+
const {label: label = {}} = this.attribute, {refX: refX = 0, refY: refY = 0} = label, points = this._line.getMainSegmentPoints(), labelAngle = null !== (_a = this._line.getEndAngle()) && void 0 !== _a ? _a : 0, totalRefX = refX + this.getLabelOffsetByDirection(direction).offsetX, totalRefY = refY + this.getLabelOffsetByDirection(direction).offsetY, labelOffsetX = totalRefX * Math.cos(labelAngle) + totalRefY * Math.cos(labelAngle - Math.PI / 2), labelOffsetY = totalRefX * Math.sin(labelAngle) + totalRefY * Math.sin(labelAngle - Math.PI / 2);
|
|
100
|
+
return direction.includes("start") || direction.includes("Start") ? {
|
|
101
|
+
position: {
|
|
102
|
+
x: points[0].x + labelOffsetX,
|
|
103
|
+
y: points[0].y + labelOffsetY
|
|
104
|
+
},
|
|
105
|
+
angle: labelAngle
|
|
106
|
+
} : direction.includes("middle") || direction.includes("Middle") ? {
|
|
107
|
+
position: {
|
|
108
|
+
x: (points[0].x + points[points.length - 1].x) / 2 + labelOffsetX,
|
|
109
|
+
y: (points[0].y + points[points.length - 1].y) / 2 + labelOffsetY
|
|
110
|
+
},
|
|
111
|
+
angle: labelAngle
|
|
112
|
+
} : {
|
|
113
|
+
position: {
|
|
114
|
+
x: points[points.length - 1].x + labelOffsetX,
|
|
115
|
+
y: points[points.length - 1].y + labelOffsetY
|
|
116
|
+
},
|
|
117
|
+
angle: labelAngle
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
setLabelPos() {
|
|
121
|
+
var _a;
|
|
122
|
+
super.setLabelPos();
|
|
123
|
+
const {label: label = {}} = this.attribute, {position: position = "end", autoRotate: autoRotate = !0} = label, labelAttr = this.getPositionByDirection(position);
|
|
124
|
+
this._label.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
|
|
125
|
+
angle: autoRotate ? labelAttr.angle + (null !== (_a = label.refAngle) && void 0 !== _a ? _a : 0) : 0
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
createSegment() {
|
|
129
|
+
const {points: points, startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle, mainSegmentIndex: mainSegmentIndex, multiSegment: multiSegment, state: state} = this.attribute;
|
|
130
|
+
return new Segment({
|
|
131
|
+
points: points,
|
|
132
|
+
startSymbol: startSymbol,
|
|
133
|
+
endSymbol: endSymbol,
|
|
134
|
+
lineStyle: lineStyle,
|
|
135
|
+
mainSegmentIndex: mainSegmentIndex,
|
|
136
|
+
multiSegment: multiSegment,
|
|
137
|
+
pickable: !1,
|
|
138
|
+
state: {
|
|
139
|
+
line: merge({}, DEFAULT_STATES, null == state ? void 0 : state.line),
|
|
140
|
+
startSymbol: merge({}, DEFAULT_STATES, null == state ? void 0 : state.lineStartSymbol),
|
|
141
|
+
endSymbol: merge({}, DEFAULT_STATES, null == state ? void 0 : state.lineEndSymbol)
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
setLineAttributes() {
|
|
146
|
+
const {points: points, startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle, mainSegmentIndex: mainSegmentIndex, multiSegment: multiSegment} = this.attribute;
|
|
147
|
+
this._line && this._line.setAttributes({
|
|
148
|
+
points: points,
|
|
149
|
+
startSymbol: startSymbol,
|
|
150
|
+
endSymbol: endSymbol,
|
|
151
|
+
lineStyle: lineStyle,
|
|
152
|
+
mainSegmentIndex: mainSegmentIndex,
|
|
153
|
+
multiSegment: multiSegment
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
MarkLine.defaultAttributes = DEFAULT_MARK_LINE_THEME;
|
|
159
|
+
//# sourceMappingURL=line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGnD,qBAAqB,EAAE,CAAC;AACxB,MAAM,OAAO,QAAS,SAAQ,YAA2D;IAMvF,YAAY,UAAyB,EAAE,OAA0B;QAC/D,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC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,EAAE;gBACL,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC;gBAC5C,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC;gBAC9D,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,CAAC;aAC3D;SACF,CAAC,CAAC;IACL,CAAC;IAES,iBAAiB;QACzB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,IAAI;aACvF,SAA0B,CAAC;QAC9B,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;gBACvB,MAAM;gBACN,WAAW;gBACX,SAAS;gBACT,SAAS;gBACT,gBAAgB;gBAChB,YAAY;aACb,CAAC,CAAC;SACJ;IACH,CAAC;;AA3LM,0BAAiB,GAA2B,uBAAmD,CAAC","file":"line.js","sourcesContent":["import { isValidNumber, merge } from '@visactor/vutils';\nimport { IMarkLineLabelPosition } from './type';\nimport type { MarkLineAttrs } from './type';\nimport type { ComponentOptions } from '../interface';\nimport { loadMarkLineComponent } from './register';\nimport type { Point } from '../core/type';\nimport { BaseMarkLine } from './base-line';\nimport type { ArcSegment } from '../segment';\n// eslint-disable-next-line no-duplicate-imports\nimport { Segment } from '../segment';\nimport { DEFAULT_STATES } from '../constant';\nimport { DEFAULT_MARK_LINE_THEME } from './config';\nimport type { ILineGraphicAttribute } from '@visactor/vrender-core';\n\nloadMarkLineComponent();\nexport class MarkLine extends BaseMarkLine<ILineGraphicAttribute, IMarkLineLabelPosition> {\n name = 'MarkLine';\n // eslint-disable-next-line max-len\n static defaultAttributes: Partial<MarkLineAttrs> = DEFAULT_MARK_LINE_THEME as unknown as MarkLineAttrs;\n protected _line!: Segment | ArcSegment;\n\n constructor(attributes: MarkLineAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, MarkLine.defaultAttributes, attributes));\n }\n\n protected isValidPoints() {\n const { points } = this.attribute as MarkLineAttrs;\n if (!points || points.length < 2) {\n return false;\n }\n let validFlag = true;\n points.forEach((point: Point | Point[]) => {\n if ((point as any).length) {\n (point as Point[]).forEach((p: Point) => {\n if (!isValidNumber((p as Point).x) || !isValidNumber((p as Point).y)) {\n validFlag = false;\n return;\n }\n });\n } else if (!isValidNumber((point as Point).x) || !isValidNumber((point as Point).y)) {\n validFlag = false;\n return;\n }\n });\n return validFlag;\n }\n\n protected getLabelOffsetByDirection(direction: IMarkLineLabelPosition) {\n // labelHeight\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 // labelWidth\n // eslint-disable-next-line max-len\n const labelRectWidth = Math.abs(\n (this._label.getTextShape().AABBBounds?.x2 ?? 0) - (this._label.getTextShape()?.AABBBounds.x1 ?? 0)\n );\n // eslint-disable-next-line max-len\n const labelTextWidth = Math.abs(\n (this._label.getBgRect().AABBBounds?.x2 ?? 0) - (this._label.getBgRect()?.AABBBounds.x1 ?? 0)\n );\n const labelWidth = Math.max(labelRectWidth, labelTextWidth);\n\n switch (direction) {\n case IMarkLineLabelPosition.start:\n return {\n offsetX: -labelWidth / 2,\n offsetY: 0\n };\n case IMarkLineLabelPosition.insideStartTop:\n return {\n offsetX: labelWidth / 2,\n offsetY: labelHeight / 2\n };\n case IMarkLineLabelPosition.insideStartBottom:\n return {\n offsetX: labelWidth / 2,\n offsetY: -labelHeight / 2\n };\n case IMarkLineLabelPosition.middle:\n return {\n offsetX: 0,\n offsetY: 0\n };\n case IMarkLineLabelPosition.insideMiddleTop:\n return {\n offsetX: 0,\n offsetY: labelHeight / 2\n };\n case IMarkLineLabelPosition.insideMiddleBottom:\n return {\n offsetX: 0,\n offsetY: -labelHeight / 2\n };\n case IMarkLineLabelPosition.end:\n return {\n offsetX: labelWidth / 2,\n offsetY: 0\n };\n case IMarkLineLabelPosition.insideEndTop:\n return {\n offsetX: -labelWidth / 2,\n offsetY: labelHeight / 2\n };\n case IMarkLineLabelPosition.insideEndBottom:\n return {\n offsetX: -labelWidth / 2,\n offsetY: -labelHeight / 2\n };\n default: // default end\n return {\n offsetX: labelWidth / 2,\n offsetY: 0\n };\n }\n }\n\n protected getPositionByDirection(direction: IMarkLineLabelPosition) {\n const { label = {} } = this.attribute;\n const { refX = 0, refY = 0 } = label;\n const points = this._line.getMainSegmentPoints();\n const labelAngle = this._line.getEndAngle() ?? 0;\n\n const totalRefX = refX + this.getLabelOffsetByDirection(direction).offsetX;\n const totalRefY = refY + this.getLabelOffsetByDirection(direction).offsetY;\n\n const labelOffsetX = totalRefX * Math.cos(labelAngle) + totalRefY * Math.cos(labelAngle - Math.PI / 2);\n const labelOffsetY = totalRefX * Math.sin(labelAngle) + totalRefY * Math.sin(labelAngle - Math.PI / 2);\n\n if (direction.includes('start') || direction.includes('Start')) {\n return {\n position: {\n x: points[0].x + labelOffsetX,\n y: points[0].y + labelOffsetY\n },\n angle: labelAngle\n };\n } else if (direction.includes('middle') || direction.includes('Middle')) {\n return {\n position: {\n x: (points[0].x + points[points.length - 1].x) / 2 + labelOffsetX,\n y: (points[0].y + points[points.length - 1].y) / 2 + labelOffsetY\n },\n angle: labelAngle\n };\n }\n return {\n position: {\n x: points[points.length - 1].x + labelOffsetX,\n y: points[points.length - 1].y + labelOffsetY\n },\n angle: labelAngle\n };\n }\n\n protected setLabelPos(): void {\n super.setLabelPos();\n const { label = {} } = this.attribute as MarkLineAttrs;\n const { position = 'end', autoRotate = true } = label;\n const labelAttr = this.getPositionByDirection(position as any);\n this._label.setAttributes({\n ...labelAttr.position,\n angle: autoRotate ? labelAttr.angle + (label.refAngle ?? 0) : 0\n });\n }\n\n protected createSegment() {\n const { points, startSymbol, endSymbol, lineStyle, mainSegmentIndex, multiSegment, state } = this\n .attribute as MarkLineAttrs;\n return new Segment({\n points,\n startSymbol,\n endSymbol,\n lineStyle,\n mainSegmentIndex,\n multiSegment,\n pickable: false, // 组件容器本身不参与拾取\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 { points, startSymbol, endSymbol, lineStyle, mainSegmentIndex, multiSegment } = this\n .attribute as MarkLineAttrs;\n if (this._line) {\n this._line.setAttributes({\n points,\n startSymbol,\n endSymbol,\n lineStyle,\n mainSegmentIndex,\n multiSegment\n });\n }\n }\n}\n"]}
|
package/es/marker/point.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare class MarkPoint extends Marker<MarkPointAttrs> {
|
|
|
72
72
|
protected setItemAttributes(item: ISymbol | Tag | IImage | IRichText, itemContent: IItemContent, itemPosition: Point, itemType: 'symbol' | 'text' | 'image' | 'richText' | 'custom'): void;
|
|
73
73
|
protected getItemDx(item: ISymbol | Tag | IImage | IRichText, position: keyof typeof IMarkPointItemPosition, style?: IImageGraphicAttribute | IRichTextGraphicAttribute): number;
|
|
74
74
|
protected getItemDy(item: ISymbol | Tag | IImage | IRichText, position: keyof typeof IMarkPointItemPosition, style?: IImageGraphicAttribute | IRichTextGraphicAttribute): number;
|
|
75
|
-
protected initItem(itemContent: IItemContent, itemPosition: Point): IGroup | Tag |
|
|
75
|
+
protected initItem(itemContent: IItemContent, itemPosition: Point): IGroup | Tag | IRichText | ISymbol | IImage;
|
|
76
76
|
protected getItemLineAttr(itemLine: IItemLine, position: Point, itemPosition: Point): Point[];
|
|
77
77
|
protected setItemLineAttr(itemLine: IItemLine, position: Point, itemPosition: Point, visible: boolean): void;
|
|
78
78
|
protected getDecorativeLineAttr(itemLine: IItemLine, itemPosition: Point): {
|
package/es/marker/register.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function loadPolarMarkAreaComponent(): void;
|
|
1
|
+
export declare function loadMarkLineComponent(): void;
|
|
2
|
+
export declare function loadMarkArcLineComponent(): void;
|
|
3
|
+
export declare function loadMarkAreaComponent(): void;
|
|
4
|
+
export declare function loadMarkArcAreaComponent(): void;
|
|
6
5
|
export declare function loadMarkPointComponent(): void;
|
package/es/marker/register.js
CHANGED
|
@@ -8,23 +8,19 @@ function loadBaseMarker() {
|
|
|
8
8
|
registerGroup(), loadTagComponent();
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export function
|
|
11
|
+
export function loadMarkLineComponent() {
|
|
12
12
|
loadBaseMarker(), loadSegmentComponent();
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export function
|
|
16
|
-
loadBaseMarker(), loadSegmentComponent();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function loadPolarMarkArcLineComponent() {
|
|
15
|
+
export function loadMarkArcLineComponent() {
|
|
20
16
|
loadBaseMarker(), loadArcSegmentComponent();
|
|
21
17
|
}
|
|
22
18
|
|
|
23
|
-
export function
|
|
19
|
+
export function loadMarkAreaComponent() {
|
|
24
20
|
loadBaseMarker(), registerPolygon();
|
|
25
21
|
}
|
|
26
22
|
|
|
27
|
-
export function
|
|
23
|
+
export function loadMarkArcAreaComponent() {
|
|
28
24
|
loadBaseMarker(), registerArc();
|
|
29
25
|
}
|
|
30
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/register.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpF,SAAS,cAAc;IACrB,aAAa,EAAE,CAAC;IAChB,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,
|
|
1
|
+
{"version":3,"sources":["../src/marker/register.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpF,SAAS,cAAc;IACrB,aAAa,EAAE,CAAC;IAChB,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,cAAc,EAAE,CAAC;IACjB,oBAAoB,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,cAAc,EAAE,CAAC;IACjB,uBAAuB,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,cAAc,EAAE,CAAC;IACjB,WAAW,EAAE,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,cAAc,EAAE,CAAC;IACjB,oBAAoB,EAAE,CAAC;IACvB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;AACjB,CAAC","file":"register.js","sourcesContent":["import {\n registerArc,\n registerGroup,\n registerImage,\n registerLine,\n registerPolygon,\n registerSymbol\n} from '@visactor/vrender-kits';\nimport { loadTagComponent } from '../tag/register';\nimport { loadArcSegmentComponent, loadSegmentComponent } from '../segment/register';\nfunction loadBaseMarker() {\n registerGroup();\n loadTagComponent();\n}\n\nexport function loadMarkLineComponent() {\n loadBaseMarker();\n loadSegmentComponent();\n}\n\nexport function loadMarkArcLineComponent() {\n loadBaseMarker();\n loadArcSegmentComponent();\n}\n\nexport function loadMarkAreaComponent() {\n loadBaseMarker();\n registerPolygon();\n}\n\nexport function loadMarkArcAreaComponent() {\n loadBaseMarker();\n registerArc();\n}\n\nexport function loadMarkPointComponent() {\n loadBaseMarker();\n loadSegmentComponent();\n registerSymbol();\n registerImage();\n registerLine();\n}\n"]}
|