@antv/g-lite 1.2.17 → 1.2.19

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
@@ -9926,13 +9926,13 @@ var OffscreenCanvasCreator = /** @class */ (function () {
9926
9926
  // user-defined offscreen canvas
9927
9927
  if (offscreenCanvas || runtime.offscreenCanvas) {
9928
9928
  this.canvas = offscreenCanvas || runtime.offscreenCanvas;
9929
- this.context = this.canvas.getContext('2d', contextAttributes);
9929
+ this.context = this.canvas.getContext('2d', __assign({ willReadFrequently: true }, contextAttributes));
9930
9930
  }
9931
9931
  else {
9932
9932
  try {
9933
9933
  // OffscreenCanvas2D measureText can be up to 40% faster.
9934
9934
  this.canvas = new window.OffscreenCanvas(0, 0);
9935
- this.context = this.canvas.getContext('2d', contextAttributes);
9935
+ this.context = this.canvas.getContext('2d', __assign({ willReadFrequently: true }, contextAttributes));
9936
9936
  if (!this.context || !this.context.measureText) {
9937
9937
  this.canvas = document.createElement('canvas');
9938
9938
  this.context = this.canvas.getContext('2d');
@@ -9940,7 +9940,7 @@ var OffscreenCanvasCreator = /** @class */ (function () {
9940
9940
  }
9941
9941
  catch (ex) {
9942
9942
  this.canvas = document.createElement('canvas');
9943
- this.context = this.canvas.getContext('2d', contextAttributes);
9943
+ this.context = this.canvas.getContext('2d', __assign({ willReadFrequently: true }, contextAttributes));
9944
9944
  }
9945
9945
  }
9946
9946
  this.canvas.width = 10;
@@ -13257,7 +13257,7 @@ var Line = /** @class */ (function (_super) {
13257
13257
  var _this = this;
13258
13258
  if (_a === void 0) { _a = {}; }
13259
13259
  var style = _a.style, rest = __rest(_a, ["style"]);
13260
- _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;
13261
13261
  _this.markerStartAngle = 0;
13262
13262
  _this.markerEndAngle = 0;
13263
13263
  var _b = _this.parsedStyle, markerStart = _b.markerStart, markerEnd = _b.markerEnd;