@antv/g 5.0.6 → 5.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +1 -1
- package/es/Canvas.js +1 -2
- package/es/display-objects/Line.d.ts +2 -0
- package/es/display-objects/Line.js +5 -8
- package/es/display-objects/Path.js +3 -7
- package/es/display-objects/Polyline.js +3 -7
- package/es/display-objects/Text.js +3 -7
- package/es/services/SceneGraphService.js +4 -4
- package/es/types.d.ts +2 -2
- package/es/types.js +16 -0
- package/lib/Canvas.js +1 -2
- package/lib/display-objects/Line.d.ts +2 -0
- package/lib/display-objects/Line.js +4 -7
- package/lib/display-objects/Path.js +2 -6
- package/lib/display-objects/Polyline.js +2 -6
- package/lib/display-objects/Text.js +2 -6
- package/lib/services/SceneGraphService.js +4 -4
- package/lib/types.d.ts +2 -2
- package/lib/types.js +19 -1
- package/package.json +3 -3
package/es/Canvas.js
CHANGED
|
@@ -9,6 +9,7 @@ export interface LineStyleProps extends BaseStyleProps {
|
|
|
9
9
|
y2: number;
|
|
10
10
|
z1?: number;
|
|
11
11
|
z2?: number;
|
|
12
|
+
isBillboard?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export interface ParsedLineStyleProps extends ParsedBaseStyleProps {
|
|
14
15
|
x1: number;
|
|
@@ -19,6 +20,7 @@ export interface ParsedLineStyleProps extends ParsedBaseStyleProps {
|
|
|
19
20
|
z2?: number;
|
|
20
21
|
defX: number;
|
|
21
22
|
defY: number;
|
|
23
|
+
isBillboard?: boolean;
|
|
22
24
|
}
|
|
23
25
|
export declare class Line extends DisplayObject<LineStyleProps, ParsedLineStyleProps> {
|
|
24
26
|
constructor({ style, ...rest }: DisplayObjectConfig<LineStyleProps>);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __extends, __rest } from "tslib";
|
|
2
2
|
import { Line as LineUtil } from '@antv/g-math';
|
|
3
|
-
import { SHAPE } from '../types';
|
|
3
|
+
import { SHAPE, LINE_CAP, LINE_JOIN } from '../types';
|
|
4
4
|
import { DisplayObject } from './DisplayObject';
|
|
5
5
|
import { Point } from '../shapes';
|
|
6
6
|
|
|
@@ -22,13 +22,10 @@ function (_super) {
|
|
|
22
22
|
y2: 0,
|
|
23
23
|
z1: 0,
|
|
24
24
|
z2: 0,
|
|
25
|
-
lineJoin:
|
|
26
|
-
|
|
27
|
-
,
|
|
28
|
-
|
|
29
|
-
/* Butt */
|
|
30
|
-
,
|
|
31
|
-
lineWidth: 1
|
|
25
|
+
lineJoin: LINE_JOIN.Miter,
|
|
26
|
+
lineCap: LINE_CAP.Butt,
|
|
27
|
+
lineWidth: 1,
|
|
28
|
+
isBillboard: false
|
|
32
29
|
}, style)
|
|
33
30
|
}, rest)) || this;
|
|
34
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign, __extends, __rest } from "tslib";
|
|
2
|
-
import { SHAPE } from '../types';
|
|
2
|
+
import { SHAPE, LINE_CAP, LINE_JOIN } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
import { Point } from '../shapes';
|
|
5
5
|
import { Cubic as CubicUtil } from '@antv/g-math';
|
|
@@ -18,12 +18,8 @@ function (_super) {
|
|
|
18
18
|
type: SHAPE.Path,
|
|
19
19
|
style: __assign({
|
|
20
20
|
path: '',
|
|
21
|
-
lineJoin:
|
|
22
|
-
|
|
23
|
-
,
|
|
24
|
-
lineCap: "butt"
|
|
25
|
-
/* Butt */
|
|
26
|
-
,
|
|
21
|
+
lineJoin: LINE_JOIN.Miter,
|
|
22
|
+
lineCap: LINE_CAP.Butt,
|
|
27
23
|
lineWidth: 1
|
|
28
24
|
}, style)
|
|
29
25
|
}, rest)) || this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __extends, __rest } from "tslib";
|
|
2
2
|
import { Line as LineUtil } from '@antv/g-math';
|
|
3
|
-
import { SHAPE } from '../types';
|
|
3
|
+
import { SHAPE, LINE_CAP, LINE_JOIN } from '../types';
|
|
4
4
|
import { DisplayObject } from './DisplayObject';
|
|
5
5
|
import { Point } from '../shapes';
|
|
6
6
|
|
|
@@ -17,12 +17,8 @@ function (_super) {
|
|
|
17
17
|
type: SHAPE.Polyline,
|
|
18
18
|
style: __assign({
|
|
19
19
|
points: [],
|
|
20
|
-
lineJoin:
|
|
21
|
-
|
|
22
|
-
,
|
|
23
|
-
lineCap: "butt"
|
|
24
|
-
/* Butt */
|
|
25
|
-
,
|
|
20
|
+
lineJoin: LINE_JOIN.Miter,
|
|
21
|
+
lineCap: LINE_CAP.Butt,
|
|
26
22
|
lineWidth: 1
|
|
27
23
|
}, style)
|
|
28
24
|
}, rest)) || this;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __assign, __extends, __rest } from "tslib";
|
|
2
|
-
import { SHAPE } from '../types';
|
|
2
|
+
import { SHAPE, LINE_JOIN, LINE_CAP } from '../types';
|
|
3
3
|
import { DisplayObject } from './DisplayObject';
|
|
4
4
|
|
|
5
5
|
var Text =
|
|
@@ -31,12 +31,8 @@ function (_super) {
|
|
|
31
31
|
fill: '#000',
|
|
32
32
|
letterSpacing: 0,
|
|
33
33
|
lineHeight: 0,
|
|
34
|
-
lineJoin:
|
|
35
|
-
|
|
36
|
-
,
|
|
37
|
-
lineCap: "butt"
|
|
38
|
-
/* Butt */
|
|
39
|
-
,
|
|
34
|
+
lineJoin: LINE_JOIN.Miter,
|
|
35
|
+
lineCap: LINE_CAP.Butt,
|
|
40
36
|
lineWidth: 0,
|
|
41
37
|
miterLimit: 10,
|
|
42
38
|
padding: 0,
|
|
@@ -144,7 +144,7 @@ function () {
|
|
|
144
144
|
|
|
145
145
|
var transform = element.transformable;
|
|
146
146
|
|
|
147
|
-
if (element.parentNode === null) {
|
|
147
|
+
if (element.parentNode === null || !element.parentNode.transformable) {
|
|
148
148
|
_this.rotateLocal(element, degrees);
|
|
149
149
|
} else {
|
|
150
150
|
var rotation = quat.create();
|
|
@@ -214,7 +214,7 @@ function () {
|
|
|
214
214
|
|
|
215
215
|
var transform = element.transformable;
|
|
216
216
|
|
|
217
|
-
if (element.parentNode === null) {
|
|
217
|
+
if (element.parentNode === null || !element.parentNode.transformable) {
|
|
218
218
|
_this.setLocalEulerAngles(element, degrees);
|
|
219
219
|
} else {
|
|
220
220
|
quat.fromEuler(transform.localRotation, degrees[0], degrees[1], degrees[2]);
|
|
@@ -285,7 +285,7 @@ function () {
|
|
|
285
285
|
|
|
286
286
|
transform.position = position;
|
|
287
287
|
|
|
288
|
-
if (element.parentNode === null) {
|
|
288
|
+
if (element.parentNode === null || !element.parentNode.transformable) {
|
|
289
289
|
vec3.copy(transform.localPosition, position);
|
|
290
290
|
} else {
|
|
291
291
|
var parentTransform = element.parentNode.transformable;
|
|
@@ -547,7 +547,7 @@ function () {
|
|
|
547
547
|
return transform.worldTransform;
|
|
548
548
|
}
|
|
549
549
|
|
|
550
|
-
if (element.parentNode) {
|
|
550
|
+
if (element.parentNode && element.parentNode.transformable) {
|
|
551
551
|
this.getWorldTransform(element.parentNode);
|
|
552
552
|
}
|
|
553
553
|
|
package/es/types.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ export interface EventPosition {
|
|
|
25
25
|
x: number;
|
|
26
26
|
y: number;
|
|
27
27
|
}
|
|
28
|
-
export declare
|
|
28
|
+
export declare enum LINE_CAP {
|
|
29
29
|
Butt = "butt",
|
|
30
30
|
Round = "round",
|
|
31
31
|
Square = "square"
|
|
32
32
|
}
|
|
33
|
-
export declare
|
|
33
|
+
export declare enum LINE_JOIN {
|
|
34
34
|
Bevel = "bevel",
|
|
35
35
|
Round = "round",
|
|
36
36
|
Miter = "miter"
|
package/es/types.js
CHANGED
|
@@ -14,4 +14,20 @@ export var SHAPE;
|
|
|
14
14
|
SHAPE["HTML"] = "html";
|
|
15
15
|
})(SHAPE || (SHAPE = {}));
|
|
16
16
|
|
|
17
|
+
export var LINE_CAP;
|
|
18
|
+
|
|
19
|
+
(function (LINE_CAP) {
|
|
20
|
+
LINE_CAP["Butt"] = "butt";
|
|
21
|
+
LINE_CAP["Round"] = "round";
|
|
22
|
+
LINE_CAP["Square"] = "square";
|
|
23
|
+
})(LINE_CAP || (LINE_CAP = {}));
|
|
24
|
+
|
|
25
|
+
export var LINE_JOIN;
|
|
26
|
+
|
|
27
|
+
(function (LINE_JOIN) {
|
|
28
|
+
LINE_JOIN["Bevel"] = "bevel";
|
|
29
|
+
LINE_JOIN["Round"] = "round";
|
|
30
|
+
LINE_JOIN["Miter"] = "miter";
|
|
31
|
+
})(LINE_JOIN || (LINE_JOIN = {}));
|
|
32
|
+
|
|
17
33
|
export var CanvasConfig = 'CanvasConfig';
|
package/lib/Canvas.js
CHANGED
|
@@ -9,6 +9,7 @@ export interface LineStyleProps extends BaseStyleProps {
|
|
|
9
9
|
y2: number;
|
|
10
10
|
z1?: number;
|
|
11
11
|
z2?: number;
|
|
12
|
+
isBillboard?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export interface ParsedLineStyleProps extends ParsedBaseStyleProps {
|
|
14
15
|
x1: number;
|
|
@@ -19,6 +20,7 @@ export interface ParsedLineStyleProps extends ParsedBaseStyleProps {
|
|
|
19
20
|
z2?: number;
|
|
20
21
|
defX: number;
|
|
21
22
|
defY: number;
|
|
23
|
+
isBillboard?: boolean;
|
|
22
24
|
}
|
|
23
25
|
export declare class Line extends DisplayObject<LineStyleProps, ParsedLineStyleProps> {
|
|
24
26
|
constructor({ style, ...rest }: DisplayObjectConfig<LineStyleProps>);
|
|
@@ -32,13 +32,10 @@ function (_super) {
|
|
|
32
32
|
y2: 0,
|
|
33
33
|
z1: 0,
|
|
34
34
|
z2: 0,
|
|
35
|
-
lineJoin:
|
|
36
|
-
|
|
37
|
-
,
|
|
38
|
-
|
|
39
|
-
/* Butt */
|
|
40
|
-
,
|
|
41
|
-
lineWidth: 1
|
|
35
|
+
lineJoin: _types.LINE_JOIN.Miter,
|
|
36
|
+
lineCap: _types.LINE_CAP.Butt,
|
|
37
|
+
lineWidth: 1,
|
|
38
|
+
isBillboard: false
|
|
42
39
|
}, style)
|
|
43
40
|
}, rest)) || this;
|
|
44
41
|
}
|
|
@@ -29,12 +29,8 @@ function (_super) {
|
|
|
29
29
|
type: _types.SHAPE.Path,
|
|
30
30
|
style: (0, _tslib.__assign)({
|
|
31
31
|
path: '',
|
|
32
|
-
lineJoin:
|
|
33
|
-
|
|
34
|
-
,
|
|
35
|
-
lineCap: "butt"
|
|
36
|
-
/* Butt */
|
|
37
|
-
,
|
|
32
|
+
lineJoin: _types.LINE_JOIN.Miter,
|
|
33
|
+
lineCap: _types.LINE_CAP.Butt,
|
|
38
34
|
lineWidth: 1
|
|
39
35
|
}, style)
|
|
40
36
|
}, rest)) || this;
|
|
@@ -27,12 +27,8 @@ function (_super) {
|
|
|
27
27
|
type: _types.SHAPE.Polyline,
|
|
28
28
|
style: (0, _tslib.__assign)({
|
|
29
29
|
points: [],
|
|
30
|
-
lineJoin:
|
|
31
|
-
|
|
32
|
-
,
|
|
33
|
-
lineCap: "butt"
|
|
34
|
-
/* Butt */
|
|
35
|
-
,
|
|
30
|
+
lineJoin: _types.LINE_JOIN.Miter,
|
|
31
|
+
lineCap: _types.LINE_CAP.Butt,
|
|
36
32
|
lineWidth: 1
|
|
37
33
|
}, style)
|
|
38
34
|
}, rest)) || this;
|
|
@@ -39,12 +39,8 @@ function (_super) {
|
|
|
39
39
|
fill: '#000',
|
|
40
40
|
letterSpacing: 0,
|
|
41
41
|
lineHeight: 0,
|
|
42
|
-
lineJoin:
|
|
43
|
-
|
|
44
|
-
,
|
|
45
|
-
lineCap: "butt"
|
|
46
|
-
/* Butt */
|
|
47
|
-
,
|
|
42
|
+
lineJoin: _types.LINE_JOIN.Miter,
|
|
43
|
+
lineCap: _types.LINE_CAP.Butt,
|
|
48
44
|
lineWidth: 0,
|
|
49
45
|
miterLimit: 10,
|
|
50
46
|
padding: 0,
|
|
@@ -165,7 +165,7 @@ function () {
|
|
|
165
165
|
|
|
166
166
|
var transform = element.transformable;
|
|
167
167
|
|
|
168
|
-
if (element.parentNode === null) {
|
|
168
|
+
if (element.parentNode === null || !element.parentNode.transformable) {
|
|
169
169
|
_this.rotateLocal(element, degrees);
|
|
170
170
|
} else {
|
|
171
171
|
var rotation = _glMatrix.quat.create();
|
|
@@ -244,7 +244,7 @@ function () {
|
|
|
244
244
|
|
|
245
245
|
var transform = element.transformable;
|
|
246
246
|
|
|
247
|
-
if (element.parentNode === null) {
|
|
247
|
+
if (element.parentNode === null || !element.parentNode.transformable) {
|
|
248
248
|
_this.setLocalEulerAngles(element, degrees);
|
|
249
249
|
} else {
|
|
250
250
|
_glMatrix.quat.fromEuler(transform.localRotation, degrees[0], degrees[1], degrees[2]);
|
|
@@ -318,7 +318,7 @@ function () {
|
|
|
318
318
|
|
|
319
319
|
transform.position = position;
|
|
320
320
|
|
|
321
|
-
if (element.parentNode === null) {
|
|
321
|
+
if (element.parentNode === null || !element.parentNode.transformable) {
|
|
322
322
|
_glMatrix.vec3.copy(transform.localPosition, position);
|
|
323
323
|
} else {
|
|
324
324
|
var parentTransform = element.parentNode.transformable;
|
|
@@ -595,7 +595,7 @@ function () {
|
|
|
595
595
|
return transform.worldTransform;
|
|
596
596
|
}
|
|
597
597
|
|
|
598
|
-
if (element.parentNode) {
|
|
598
|
+
if (element.parentNode && element.parentNode.transformable) {
|
|
599
599
|
this.getWorldTransform(element.parentNode);
|
|
600
600
|
}
|
|
601
601
|
|
package/lib/types.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ export interface EventPosition {
|
|
|
25
25
|
x: number;
|
|
26
26
|
y: number;
|
|
27
27
|
}
|
|
28
|
-
export declare
|
|
28
|
+
export declare enum LINE_CAP {
|
|
29
29
|
Butt = "butt",
|
|
30
30
|
Round = "round",
|
|
31
31
|
Square = "square"
|
|
32
32
|
}
|
|
33
|
-
export declare
|
|
33
|
+
export declare enum LINE_JOIN {
|
|
34
34
|
Bevel = "bevel",
|
|
35
35
|
Round = "round",
|
|
36
36
|
Miter = "miter"
|
package/lib/types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SHAPE = exports.CanvasConfig = void 0;
|
|
6
|
+
exports.SHAPE = exports.LINE_JOIN = exports.LINE_CAP = exports.CanvasConfig = void 0;
|
|
7
7
|
var SHAPE;
|
|
8
8
|
exports.SHAPE = SHAPE;
|
|
9
9
|
|
|
@@ -21,5 +21,23 @@ exports.SHAPE = SHAPE;
|
|
|
21
21
|
SHAPE["HTML"] = "html";
|
|
22
22
|
})(SHAPE || (exports.SHAPE = SHAPE = {}));
|
|
23
23
|
|
|
24
|
+
var LINE_CAP;
|
|
25
|
+
exports.LINE_CAP = LINE_CAP;
|
|
26
|
+
|
|
27
|
+
(function (LINE_CAP) {
|
|
28
|
+
LINE_CAP["Butt"] = "butt";
|
|
29
|
+
LINE_CAP["Round"] = "round";
|
|
30
|
+
LINE_CAP["Square"] = "square";
|
|
31
|
+
})(LINE_CAP || (exports.LINE_CAP = LINE_CAP = {}));
|
|
32
|
+
|
|
33
|
+
var LINE_JOIN;
|
|
34
|
+
exports.LINE_JOIN = LINE_JOIN;
|
|
35
|
+
|
|
36
|
+
(function (LINE_JOIN) {
|
|
37
|
+
LINE_JOIN["Bevel"] = "bevel";
|
|
38
|
+
LINE_JOIN["Round"] = "round";
|
|
39
|
+
LINE_JOIN["Miter"] = "miter";
|
|
40
|
+
})(LINE_JOIN || (exports.LINE_JOIN = LINE_JOIN = {}));
|
|
41
|
+
|
|
24
42
|
var CanvasConfig = 'CanvasConfig';
|
|
25
43
|
exports.CanvasConfig = CanvasConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.7",
|
|
4
4
|
"description": "A core module including ECS and DI container.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/antvis/g#readme",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@antv/g-math": "^1.0.
|
|
40
|
+
"@antv/g-math": "^1.0.6",
|
|
41
41
|
"@antv/path-util": "^2.0.14",
|
|
42
42
|
"@antv/util": "^2.0.13",
|
|
43
43
|
"d3-color": "^1.4.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"scripts": {
|
|
51
51
|
"umd": "webpack"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "aaa26a747017b8407bdbd3c9bcc24b058cdf06c9"
|
|
54
54
|
}
|