@antv/g-lite 1.2.16 → 1.2.18

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.
@@ -2,11 +2,30 @@ import type { DisplayObjectConfig } from '../dom/interfaces';
2
2
  import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
3
3
  import { DisplayObject } from './DisplayObject';
4
4
  export interface CircleStyleProps extends BaseStyleProps {
5
+ /**
6
+ * X coordinate of the center of the circle.
7
+ */
5
8
  cx?: number | string | null;
9
+ /**
10
+ * Y coordinate of the center of the circle.
11
+ */
6
12
  cy?: number | string | null;
13
+ /**
14
+ * Z coordinate of the center of the circle.
15
+ */
7
16
  cz?: number | string | null;
17
+ /**
18
+ * Radius of the circle.
19
+ */
8
20
  r: number | string | null;
21
+ /**
22
+ * Whether the circle is billboard.
23
+ */
9
24
  isBillboard?: boolean;
25
+ /**
26
+ * Whether the circle is size attenuation.
27
+ */
28
+ isSizeAttenuation?: boolean;
10
29
  }
11
30
  export interface ParsedCircleStyleProps extends ParsedBaseStyleProps {
12
31
  cx: number;
@@ -14,6 +33,7 @@ export interface ParsedCircleStyleProps extends ParsedBaseStyleProps {
14
33
  cz?: number;
15
34
  r: number;
16
35
  isBillboard?: boolean;
36
+ isSizeAttenuation?: boolean;
17
37
  }
18
38
  export declare class Circle extends DisplayObject<CircleStyleProps, ParsedCircleStyleProps> {
19
39
  constructor({ style, ...rest }?: DisplayObjectConfig<CircleStyleProps>);
@@ -9,9 +9,22 @@ export interface ImageStyleProps extends BaseStyleProps {
9
9
  src?: string | HTMLImageElement;
10
10
  width?: number | string;
11
11
  height?: number | string;
12
+ /**
13
+ * Whether the circle is billboard.
14
+ */
12
15
  isBillboard?: boolean;
13
- billboardRotation?: number;
16
+ /**
17
+ * When isBillboard enabled, whether the circle is size attenuation.
18
+ */
14
19
  isSizeAttenuation?: boolean;
20
+ /**
21
+ * When isBillboard enabled, the rotation.
22
+ */
23
+ billboardRotation?: number;
24
+ /**
25
+ * Whether to keep the aspect ratio of the image, under such circumstances, either the width or height can be omitted.
26
+ */
27
+ keepAspectRatio?: boolean;
15
28
  }
16
29
  export interface ParsedImageStyleProps extends ParsedBaseStyleProps {
17
30
  x: number;
@@ -24,6 +37,7 @@ export interface ParsedImageStyleProps extends ParsedBaseStyleProps {
24
37
  isBillboard?: boolean;
25
38
  billboardRotation?: number;
26
39
  isSizeAttenuation?: boolean;
40
+ keepAspectRatio?: boolean;
27
41
  }
28
42
  export declare class Image extends DisplayObject<ImageStyleProps, ParsedImageStyleProps> {
29
43
  constructor({ style, ...rest }?: DisplayObjectConfig<ImageStyleProps>);
@@ -3,13 +3,38 @@ import { Point } from '../shapes';
3
3
  import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
4
4
  import { DisplayObject } from './DisplayObject';
5
5
  export interface LineStyleProps extends BaseStyleProps {
6
+ /**
7
+ * X coordinate of the start of the line.
8
+ */
6
9
  x1: number;
10
+ /**
11
+ * Y coordinate of the start of the line.
12
+ */
7
13
  y1: number;
14
+ /**
15
+ * X coordinate of the end of the line.
16
+ */
8
17
  x2: number;
18
+ /**
19
+ * Y coordinate of the end of the line.
20
+ */
9
21
  y2: number;
22
+ /**
23
+ * Z coordinate of the start of the line.
24
+ */
10
25
  z1?: number;
26
+ /**
27
+ * Z coordinate of the end of the line.
28
+ */
11
29
  z2?: number;
30
+ /**
31
+ * Whether the line is billboard.
32
+ */
12
33
  isBillboard?: boolean;
34
+ /**
35
+ * Whether the line is size attenuation.
36
+ */
37
+ isSizeAttenuation?: boolean;
13
38
  /**
14
39
  * marker will be positioned at x1/y1
15
40
  */
@@ -37,6 +62,7 @@ export interface ParsedLineStyleProps extends ParsedBaseStyleProps {
37
62
  defX: number;
38
63
  defY: number;
39
64
  isBillboard?: boolean;
65
+ isSizeAttenuation?: boolean;
40
66
  markerStart?: DisplayObject | null;
41
67
  markerEnd?: DisplayObject | null;
42
68
  markerStartOffset?: number;
@@ -24,7 +24,14 @@ export interface PathStyleProps extends BaseStyleProps {
24
24
  * offset relative to original position
25
25
  */
26
26
  markerEndOffset?: number;
27
+ /**
28
+ * Whether the circle is billboard.
29
+ */
27
30
  isBillboard?: boolean;
31
+ /**
32
+ * Whether the circle is size attenuation.
33
+ */
34
+ isSizeAttenuation?: boolean;
28
35
  }
29
36
  export interface PathSegmentBBox {
30
37
  x: number;
@@ -88,6 +95,7 @@ export interface ParsedPathStyleProps extends ParsedBaseStyleProps {
88
95
  markerStartOffset?: number;
89
96
  markerEndOffset?: number;
90
97
  isBillboard?: boolean;
98
+ isSizeAttenuation?: boolean;
91
99
  }
92
100
  export declare class Path extends DisplayObject<PathStyleProps, ParsedPathStyleProps> {
93
101
  private markerStartAngle;
@@ -22,7 +22,14 @@ export interface PolylineStyleProps extends BaseStyleProps {
22
22
  * offset relative to original position
23
23
  */
24
24
  markerEndOffset?: number;
25
+ /**
26
+ * Whether the circle is billboard.
27
+ */
25
28
  isBillboard?: boolean;
29
+ /**
30
+ * Whether the circle is size attenuation.
31
+ */
32
+ isSizeAttenuation?: boolean;
26
33
  }
27
34
  export interface ParsedPolylineStyleProps extends ParsedBaseStyleProps {
28
35
  points: {
package/dist/index.esm.js CHANGED
@@ -11882,8 +11882,16 @@ var Element = /** @class */ (function (_super) {
11882
11882
  this.appendChild(newChild);
11883
11883
  }
11884
11884
  else {
11885
+ if (newChild.parentElement) {
11886
+ newChild.parentElement.removeChild(newChild);
11887
+ }
11885
11888
  var index = this.childNodes.indexOf(refChild);
11886
- this.appendChild(newChild, index - 1);
11889
+ if (index === -1) {
11890
+ this.appendChild(newChild);
11891
+ }
11892
+ else {
11893
+ this.appendChild(newChild, index);
11894
+ }
11887
11895
  }
11888
11896
  return newChild;
11889
11897
  };
@@ -13249,7 +13257,7 @@ var Line = /** @class */ (function (_super) {
13249
13257
  var _this = this;
13250
13258
  if (_a === void 0) { _a = {}; }
13251
13259
  var style = _a.style, rest = __rest(_a, ["style"]);
13252
- _this = _super.call(this, __assign({ type: Shape.LINE, style: __assign({ x1: 0, y1: 0, x2: 0, y2: 0, z1: 0, z2: 0, isBillboard: false }, style) }, rest)) || this;
13260
+ _this = _super.call(this, __assign({ type: Shape.LINE, style: __assign({ x1: 0, y1: 0, x2: 0, y2: 0, z1: 0, z2: 0 }, style) }, rest)) || this;
13253
13261
  _this.markerStartAngle = 0;
13254
13262
  _this.markerEndAngle = 0;
13255
13263
  var _b = _this.parsedStyle, markerStart = _b.markerStart, markerEnd = _b.markerEnd;