@visactor/vrender-core 0.16.15 → 0.16.17-alpha.1

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.
Files changed (109) hide show
  1. package/cjs/common/Reflect-metadata.js +1 -1
  2. package/cjs/common/bezier-utils.js +1 -2
  3. package/cjs/common/bounds-context.js +1 -1
  4. package/cjs/common/canvas-utils.js +1 -1
  5. package/cjs/common/contribution-provider.js +1 -1
  6. package/cjs/common/custom-path2d.js +1 -1
  7. package/cjs/common/enums.js +1 -1
  8. package/cjs/common/generator.js +1 -1
  9. package/cjs/common/matrix.js +1 -1
  10. package/cjs/common/morphing-utils.js +1 -1
  11. package/cjs/common/path-svg.js +1 -1
  12. package/cjs/common/polygon.js +2 -2
  13. package/cjs/common/render-area.js +1 -1
  14. package/cjs/common/render-command-list.js +1 -1
  15. package/cjs/common/render-curve.js +2 -2
  16. package/cjs/common/seg-context.js +1 -1
  17. package/cjs/common/sort.js +1 -1
  18. package/cjs/common/split-path.js +1 -2
  19. package/cjs/common/store.js +1 -1
  20. package/cjs/common/text.js +1 -1
  21. package/cjs/common/utils.js +1 -1
  22. package/cjs/core/camera.js +2 -1
  23. package/cjs/core/global-module.js +2 -0
  24. package/cjs/core/global.js +1 -1
  25. package/cjs/core/graphic-utils.js +1 -1
  26. package/cjs/core/index.js +1 -1
  27. package/cjs/core/layer-service.js +1 -1
  28. package/cjs/core/layer.js +1 -1
  29. package/cjs/core/light.js +1 -1
  30. package/cjs/core/stage.js +1 -1
  31. package/cjs/core/window.js +1 -1
  32. package/cjs/event/constant.js +1 -1
  33. package/cjs/event/event-manager.js +1 -1
  34. package/cjs/event/event-system.js +1 -1
  35. package/cjs/event/event-target.js +1 -1
  36. package/cjs/event/index.js +2 -1
  37. package/cjs/event/util.js +1 -1
  38. package/cjs/graphic/builtin-symbol/index.js +0 -1
  39. package/cjs/graphic/builtin-symbol/index.js.map +1 -1
  40. package/cjs/graphic/builtin-symbol/rect.d.ts +2 -1
  41. package/cjs/graphic/builtin-symbol/rect.js +11 -6
  42. package/cjs/graphic/builtin-symbol/rect.js.map +1 -1
  43. package/cjs/graphic/graphic-service/graphic-service.d.ts +3 -2
  44. package/cjs/graphic/graphic-service/graphic-service.js +19 -2
  45. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  46. package/cjs/graphic/graphic.js +1 -1
  47. package/cjs/graphic/graphic.js.map +1 -1
  48. package/cjs/interface/allocator.js +1 -1
  49. package/cjs/interface/animate.js +1 -1
  50. package/cjs/interface/camera.js +1 -1
  51. package/cjs/interface/canvas.js +1 -1
  52. package/cjs/interface/color.js +1 -1
  53. package/cjs/interface/common.js +1 -1
  54. package/dist/index.js +71 -15
  55. package/dist/index.min.js +1 -1
  56. package/es/common/Reflect-metadata.js +1 -1
  57. package/es/common/bezier-utils.js +1 -2
  58. package/es/common/bounds-context.js +1 -1
  59. package/es/common/canvas-utils.js +1 -1
  60. package/es/common/contribution-provider.js +1 -1
  61. package/es/common/custom-path2d.js +1 -1
  62. package/es/common/enums.js +1 -1
  63. package/es/common/generator.js +1 -1
  64. package/es/common/matrix.js +1 -1
  65. package/es/common/morphing-utils.js +1 -1
  66. package/es/common/path-svg.js +1 -1
  67. package/es/common/polygon.js +1 -1
  68. package/es/common/render-area.js +1 -1
  69. package/es/common/render-command-list.js +1 -1
  70. package/es/common/render-curve.js +1 -1
  71. package/es/common/seg-context.js +1 -1
  72. package/es/common/sort.js +1 -1
  73. package/es/common/split-path.js +1 -2
  74. package/es/common/store.js +1 -1
  75. package/es/common/text.js +1 -1
  76. package/es/common/utils.js +1 -1
  77. package/es/core/camera.js +2 -1
  78. package/es/core/global-module.js +2 -0
  79. package/es/core/global.js +1 -1
  80. package/es/core/graphic-utils.js +1 -1
  81. package/es/core/index.js +1 -1
  82. package/es/core/layer-service.js +1 -1
  83. package/es/core/layer.js +1 -1
  84. package/es/core/light.js +1 -1
  85. package/es/core/stage.js +1 -1
  86. package/es/core/window.js +1 -1
  87. package/es/event/constant.js +1 -1
  88. package/es/event/event-manager.js +1 -1
  89. package/es/event/event-system.js +1 -1
  90. package/es/event/event-target.js +1 -1
  91. package/es/event/index.js +2 -1
  92. package/es/event/util.js +1 -1
  93. package/es/graphic/builtin-symbol/index.js +0 -1
  94. package/es/graphic/builtin-symbol/index.js.map +1 -1
  95. package/es/graphic/builtin-symbol/rect.d.ts +2 -1
  96. package/es/graphic/builtin-symbol/rect.js +9 -4
  97. package/es/graphic/builtin-symbol/rect.js.map +1 -1
  98. package/es/graphic/graphic-service/graphic-service.d.ts +3 -2
  99. package/es/graphic/graphic-service/graphic-service.js +19 -2
  100. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  101. package/es/graphic/graphic.js +1 -1
  102. package/es/graphic/graphic.js.map +1 -1
  103. package/es/interface/allocator.js +1 -1
  104. package/es/interface/animate.js +1 -1
  105. package/es/interface/camera.js +1 -1
  106. package/es/interface/canvas.js +1 -1
  107. package/es/interface/color.js +1 -1
  108. package/es/interface/common.js +1 -1
  109. package/package.json +4 -4
@@ -385,4 +385,4 @@ export default (function(Reflect) {
385
385
  }(exporter);
386
386
  }(), Reflect;
387
387
  }(Reflect || (Reflect = {})));
388
- //# sourceMappingURL=Reflect-metadata.js.map
388
+ //# sourceMappingURL=Reflect-metadata.js.map
@@ -22,5 +22,4 @@ export function cubicCalc(p0, p1, p2, p3, t) {
22
22
  export function cubicPointAt(p0, p1, p2, p3, t) {
23
23
  const x = cubicCalc(p0.x, p1.x, p2.x, p3.x, t), y = cubicCalc(p0.y, p1.y, p2.y, p3.y, t);
24
24
  return new Point(x, y);
25
- }
26
- //# sourceMappingURL=bezier-utils.js.map
25
+ }
@@ -50,4 +50,4 @@ export class BoundsContext {
50
50
  }
51
51
  release(...params) {}
52
52
  }
53
- //# sourceMappingURL=bounds-context.js.map
53
+ //# sourceMappingURL=bounds-context.js.map
@@ -62,4 +62,4 @@ function createConicGradient(context, color, params, offsetX = 0, offsetY = 0) {
62
62
  canvasGradient.addColorStop(stop.offset, stop.color);
63
63
  })), canvasGradient.GetPattern(w + x, h + y, undefined);
64
64
  }
65
- //# sourceMappingURL=canvas-utils.js.map
65
+ //# sourceMappingURL=canvas-utils.js.map
@@ -17,4 +17,4 @@ export function bindContributionProvider(bind, id) {
17
17
  export function bindContributionProviderNoSingletonScope(bind, id) {
18
18
  bind(ContributionProvider).toDynamicValue((({container: container}) => new ContributionProviderCache(id, container))).whenTargetNamed(id);
19
19
  }
20
- //# sourceMappingURL=contribution-provider.js.map
20
+ //# sourceMappingURL=contribution-provider.js.map
@@ -335,4 +335,4 @@ function scale(current, sX, sY) {
335
335
  temp[7] = sY * current[7]; else if ("h" === c || "H" === c) temp[1] = sX * current[1]; else if ("v" === c || "V" === c) temp[1] = sY * current[1]; else for (let i = 1, n = current.length; i < n; ++i) temp[i] = (i % 2 == 1 ? sX : sY) * current[i];
336
336
  return temp;
337
337
  }
338
- //# sourceMappingURL=custom-path2d.js.map
338
+ //# sourceMappingURL=custom-path2d.js.map
@@ -70,4 +70,4 @@ export var BaseRenderContributionTime;
70
70
  BaseRenderContributionTime[BaseRenderContributionTime.beforeFillStroke = 0] = "beforeFillStroke",
71
71
  BaseRenderContributionTime[BaseRenderContributionTime.afterFillStroke = 1] = "afterFillStroke";
72
72
  }(BaseRenderContributionTime || (BaseRenderContributionTime = {}));
73
- //# sourceMappingURL=enums.js.map
73
+ //# sourceMappingURL=enums.js.map
@@ -5,4 +5,4 @@ export class Generator {
5
5
  }
6
6
 
7
7
  Generator.auto_increment_id = 0;
8
- //# sourceMappingURL=generator.js.map
8
+ //# sourceMappingURL=generator.js.map
@@ -45,4 +45,4 @@ export function transformMat4(out, a, m) {
45
45
  return w = w || 1, out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w, out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w,
46
46
  out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w, out;
47
47
  }
48
- //# sourceMappingURL=matrix.js.map
48
+ //# sourceMappingURL=matrix.js.map
@@ -284,4 +284,4 @@ export function bezierCurversToPath(bezierCurves) {
284
284
  }
285
285
  return path;
286
286
  }
287
- //# sourceMappingURL=morphing-utils.js.map
287
+ //# sourceMappingURL=morphing-utils.js.map
@@ -55,4 +55,4 @@ export function parseSvgPath(str) {
55
55
  } else result.push(currCommandData);
56
56
  return result;
57
57
  }
58
- //# sourceMappingURL=path-svg.js.map
58
+ //# sourceMappingURL=path-svg.js.map
@@ -36,4 +36,4 @@ function getProportionPoint(point, segment, length, dx, dy) {
36
36
  y: point.y - dy * factor
37
37
  };
38
38
  }
39
- //# sourceMappingURL=polygon.js.map
39
+ //# sourceMappingURL=polygon.js.map
@@ -130,4 +130,4 @@ function drawSegItem(ctx, curve, endPercent, params) {
130
130
  ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
131
131
  }
132
132
  }
133
- //# sourceMappingURL=render-area.js.map
133
+ //# sourceMappingURL=render-area.js.map
@@ -6,4 +6,4 @@ export function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy
6
6
  commandFuncs[command[0]](command, context, x, y, sx, sy, z);
7
7
  }
8
8
  }
9
- //# sourceMappingURL=render-command-list.js.map
9
+ //# sourceMappingURL=render-command-list.js.map
@@ -115,4 +115,4 @@ function drawSegItem(ctx, curve, endPercent, params) {
115
115
  ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
116
116
  }
117
117
  }
118
- //# sourceMappingURL=render-curve.js.map
118
+ //# sourceMappingURL=render-curve.js.map
@@ -91,4 +91,4 @@ export class ReflectSegContext extends SegContext {
91
91
  return super.clear();
92
92
  }
93
93
  }
94
- //# sourceMappingURL=seg-context.js.map
94
+ //# sourceMappingURL=seg-context.js.map
package/es/common/sort.js CHANGED
@@ -91,4 +91,4 @@ export function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
91
91
  !1)), reverse);
92
92
  return result;
93
93
  }
94
- //# sourceMappingURL=sort.js.map
94
+ //# sourceMappingURL=sort.js.map
@@ -245,5 +245,4 @@ export const splitPath = (path, count) => {
245
245
  remain -= stepCount;
246
246
  }
247
247
  return res;
248
- };
249
- //# sourceMappingURL=split-path.js.map
248
+ };
@@ -1,2 +1,2 @@
1
1
  class StageStore {}
2
- //# sourceMappingURL=store.js.map
2
+ //# sourceMappingURL=store.js.map
package/es/common/text.js CHANGED
@@ -16,4 +16,4 @@ export function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
16
16
  return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight),
17
17
  -(lineHeight - fontSize) / 2 - .79 * fontSize);
18
18
  }
19
- //# sourceMappingURL=text.js.map
19
+ //# sourceMappingURL=text.js.map
@@ -147,4 +147,4 @@ export const calculateLineHeight = (lineHeight, fontSize) => {
147
147
  }
148
148
  return lineHeight;
149
149
  };
150
- //# sourceMappingURL=utils.js.map
150
+ //# sourceMappingURL=utils.js.map
package/es/core/camera.js CHANGED
@@ -57,4 +57,5 @@ export class OrthoCamera {
57
57
  y: y * sizeProjection + pos[1]
58
58
  };
59
59
  }
60
- }
60
+ }
61
+ //# sourceMappingURL=camera.js.map
@@ -1 +1,3 @@
1
+
2
+
1
3
  //# sourceMappingURL=global-module.js.map
package/es/core/global.js CHANGED
@@ -174,4 +174,4 @@ let DefaultGlobal = class {
174
174
  DefaultGlobal = __decorate([ injectable(), __param(0, inject(ContributionProvider)), __param(0, named(EnvContribution)), __metadata("design:paramtypes", [ Object ]) ], DefaultGlobal);
175
175
 
176
176
  export { DefaultGlobal };
177
- //# sourceMappingURL=global.js.map
177
+ //# sourceMappingURL=global.js.map
@@ -143,4 +143,4 @@ let DefaultTransformUtil = class {
143
143
  DefaultTransformUtil = __decorate([ injectable(), __metadata("design:paramtypes", []) ], DefaultTransformUtil);
144
144
 
145
145
  export { DefaultTransformUtil };
146
- //# sourceMappingURL=graphic-utils.js.map
146
+ //# sourceMappingURL=graphic-utils.js.map
package/es/core/index.js CHANGED
@@ -15,4 +15,4 @@ export * from "./layer-service";
15
15
  export * from "./constants";
16
16
 
17
17
  export * from "../interface/core";
18
- //# sourceMappingURL=index.js.map
18
+ //# sourceMappingURL=index.js.map
@@ -79,4 +79,4 @@ let DefaultLayerService = class {
79
79
  DefaultLayerService = __decorate([ injectable(), __param(0, inject(VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultLayerService);
80
80
 
81
81
  export { DefaultLayerService };
82
- //# sourceMappingURL=layer-service.js.map
82
+ //# sourceMappingURL=layer-service.js.map
package/es/core/layer.js CHANGED
@@ -130,4 +130,4 @@ export class Layer extends Group {
130
130
  }, params)), this.afterDrawCbs.forEach((c => c(this)));
131
131
  }
132
132
  }
133
- //# sourceMappingURL=layer.js.map
133
+ //# sourceMappingURL=layer.js.map
package/es/core/light.js CHANGED
@@ -17,4 +17,4 @@ export class DirectionalLight {
17
17
  return `rgb(${lightColorArray[0] * colorArray[0] * brightness}, ${lightColorArray[1] * colorArray[1] * brightness}, ${lightColorArray[2] * colorArray[2] * brightness})`;
18
18
  }
19
19
  }
20
- //# sourceMappingURL=light.js.map
20
+ //# sourceMappingURL=light.js.map
package/es/core/stage.js CHANGED
@@ -476,4 +476,4 @@ export class Stage extends Group {
476
476
  return this._cursor;
477
477
  }
478
478
  }
479
- //# sourceMappingURL=stage.js.map
479
+ //# sourceMappingURL=stage.js.map
package/es/core/window.js CHANGED
@@ -127,4 +127,4 @@ __decorate([ postConstruct(), __metadata("design:type", Function), __metadata("d
127
127
  DefaultWindow = __decorate([ injectable(), __param(0, inject(VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultWindow);
128
128
 
129
129
  export { DefaultWindow };
130
- //# sourceMappingURL=window.js.map
130
+ //# sourceMappingURL=window.js.map
@@ -1,2 +1,2 @@
1
1
  export const WILDCARD = "*";
2
- //# sourceMappingURL=constant.js.map
2
+ //# sourceMappingURL=constant.js.map
@@ -273,4 +273,4 @@ export class EventManager {
273
273
  e && (e.pickParams = pickResult.params), target;
274
274
  }
275
275
  }
276
- //# sourceMappingURL=event-manager.js.map
276
+ //# sourceMappingURL=event-manager.js.map
@@ -191,4 +191,4 @@ export class EventSystem {
191
191
  return target !== (this.domElement.getNativeHandler ? this.domElement.getNativeHandler().nativeCanvas : this.domElement);
192
192
  }
193
193
  }
194
- //# sourceMappingURL=event-system.js.map
194
+ //# sourceMappingURL=event-system.js.map
@@ -13,4 +13,4 @@ export const EventTarget = {
13
13
  return this.dispatchEvent(new CustomEvent(eventName, object));
14
14
  }
15
15
  };
16
- //# sourceMappingURL=event-target.js.map
16
+ //# sourceMappingURL=event-target.js.map
package/es/event/index.js CHANGED
@@ -10,4 +10,5 @@ export * from "../interface/event";
10
10
 
11
11
  export * from "./util";
12
12
 
13
- export * from "./constant";
13
+ export * from "./constant";
14
+ //# sourceMappingURL=index.js.map
package/es/event/util.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const clock = "object" == typeof performance && performance.now ? performance : Date;
2
- //# sourceMappingURL=util.js.map
2
+ //# sourceMappingURL=util.js.map
@@ -55,7 +55,6 @@ builtinSymbols.forEach((symbol => {
55
55
  export const builtInSymbolStrMap = {
56
56
  arrowLeft: "M 0.25 -0.5 L -0.25 0 l 0.5 0.5",
57
57
  arrowRight: "M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",
58
- rect: "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",
59
58
  rectRound: "M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",
60
59
  roundLine: "M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"
61
60
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAG1B,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM;IACN,KAAK;IACL,OAAO;IACP,MAAM;IACN,YAAY;IACZ,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,GAAG;IACH,YAAY;IACZ,aAAa;IACb,UAAU;IACV,YAAY;IACZ,UAAU;IACV,WAAW;IACX,QAAQ;IACR,UAAU;IACV,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAiC,EAAE,CAAC;AAElE,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;IAC9B,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,SAAS,EAAE,iCAAiC;IAC5C,UAAU,EAAE,mCAAmC;IAC/C,IAAI,EAAE,mDAAmD;IACzD,SAAS,EAEP,8PAA8P;IAChQ,SAAS,EACP,sNAAsN;CACzN,CAAC;AAEF,cAAc,SAAS,CAAC","file":"index.js","sourcesContent":["import circle from './circle';\nimport cross from './cross';\nimport diamond from './diamond';\nimport square from './square';\nimport triangle from './triangle';\nimport star from './star';\nimport arrow from './arrow';\nimport wedge from './wedge';\nimport stroke from './stroke';\nimport wye from './wye';\nimport triangleLeft from './triangle-left';\nimport triangleRight from './triangle-right';\nimport triangleUp from './triangle-up';\nimport triangleDown from './triangle-down';\nimport thinTriangle from './thin-triangle';\nimport arrow2Left from './arrow2-left';\nimport arrow2Right from './arrow2-right';\nimport arrow2Up from './arrow2-up';\nimport arrow2Down from './arrow2-down';\nimport lineV from './line-v';\nimport lineH from './line-h';\nimport close from './close';\nimport rect from './rect';\nimport type { ISymbolClass } from '../../interface';\n\nexport const builtinSymbols = [\n circle,\n cross,\n diamond,\n square,\n thinTriangle,\n triangle,\n star,\n arrow,\n wedge,\n stroke,\n wye,\n triangleLeft,\n triangleRight,\n triangleUp,\n triangleDown,\n arrow2Left,\n arrow2Right,\n arrow2Up,\n arrow2Down,\n rect,\n lineV,\n lineH,\n close\n];\nexport const builtinSymbolsMap: Record<string, ISymbolClass> = {};\n\nbuiltinSymbols.forEach(symbol => {\n builtinSymbolsMap[symbol.type] = symbol;\n});\n\nexport const builtInSymbolStrMap: Record<string, string> = {\n arrowLeft: 'M 0.25 -0.5 L -0.25 0 l 0.5 0.5',\n arrowRight: 'M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5',\n rect: 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z',\n rectRound:\n // eslint-disable-next-line max-len\n 'M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z',\n roundLine:\n 'M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z'\n};\n\nexport * from './utils';\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAG1B,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM;IACN,KAAK;IACL,OAAO;IACP,MAAM;IACN,YAAY;IACZ,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,GAAG;IACH,YAAY;IACZ,aAAa;IACb,UAAU;IACV,YAAY;IACZ,UAAU;IACV,WAAW;IACX,QAAQ;IACR,UAAU;IACV,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAiC,EAAE,CAAC;AAElE,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;IAC9B,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,SAAS,EAAE,iCAAiC;IAC5C,UAAU,EAAE,mCAAmC;IAE/C,SAAS,EAEP,8PAA8P;IAChQ,SAAS,EACP,sNAAsN;CACzN,CAAC;AAEF,cAAc,SAAS,CAAC","file":"index.js","sourcesContent":["import circle from './circle';\nimport cross from './cross';\nimport diamond from './diamond';\nimport square from './square';\nimport triangle from './triangle';\nimport star from './star';\nimport arrow from './arrow';\nimport wedge from './wedge';\nimport stroke from './stroke';\nimport wye from './wye';\nimport triangleLeft from './triangle-left';\nimport triangleRight from './triangle-right';\nimport triangleUp from './triangle-up';\nimport triangleDown from './triangle-down';\nimport thinTriangle from './thin-triangle';\nimport arrow2Left from './arrow2-left';\nimport arrow2Right from './arrow2-right';\nimport arrow2Up from './arrow2-up';\nimport arrow2Down from './arrow2-down';\nimport lineV from './line-v';\nimport lineH from './line-h';\nimport close from './close';\nimport rect from './rect';\nimport type { ISymbolClass } from '../../interface';\n\nexport const builtinSymbols = [\n circle,\n cross,\n diamond,\n square,\n thinTriangle,\n triangle,\n star,\n arrow,\n wedge,\n stroke,\n wye,\n triangleLeft,\n triangleRight,\n triangleUp,\n triangleDown,\n arrow2Left,\n arrow2Right,\n arrow2Up,\n arrow2Down,\n rect,\n lineV,\n lineH,\n close\n];\nexport const builtinSymbolsMap: Record<string, ISymbolClass> = {};\n\nbuiltinSymbols.forEach(symbol => {\n builtinSymbolsMap[symbol.type] = symbol;\n});\n\nexport const builtInSymbolStrMap: Record<string, string> = {\n arrowLeft: 'M 0.25 -0.5 L -0.25 0 l 0.5 0.5',\n arrowRight: 'M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5',\n // rect: 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z',\n rectRound:\n // eslint-disable-next-line max-len\n 'M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z',\n roundLine:\n 'M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z'\n};\n\nexport * from './utils';\n"]}
@@ -1,6 +1,7 @@
1
1
  import type { IContext2d, SymbolType, ISymbolClass } from '../../interface';
2
2
  import { BaseSymbol } from './base';
3
- export declare function rect(ctx: IContext2d, size: [number, number], x: number, y: number): boolean;
3
+ export declare function rectSizeArray(ctx: IContext2d, size: [number, number], x: number, y: number): boolean;
4
+ export declare function rectSize(ctx: IContext2d, size: number, x: number, y: number): boolean;
4
5
  export declare class RectSymbol extends BaseSymbol implements ISymbolClass {
5
6
  type: SymbolType;
6
7
  pathStr: string;
@@ -2,19 +2,24 @@ import { isNumber } from "@visactor/vutils";
2
2
 
3
3
  import { BaseSymbol } from "./base";
4
4
 
5
- export function rect(ctx, size, x, y) {
5
+ export function rectSizeArray(ctx, size, x, y) {
6
6
  return ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]), !1;
7
7
  }
8
8
 
9
+ export function rectSize(ctx, size, x, y) {
10
+ const w = size, h = size / 2;
11
+ return ctx.rect(x - w / 2, y - h / 2, w, h), !1;
12
+ }
13
+
9
14
  export class RectSymbol extends BaseSymbol {
10
15
  constructor() {
11
- super(...arguments), this.type = "rect", this.pathStr = "M-0.5,-0.5h1v1h-1Z";
16
+ super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
12
17
  }
13
18
  draw(ctx, size, x, y) {
14
- return rect(ctx, isNumber(size) ? [ size, size ] : size, x, y);
19
+ return isNumber(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
15
20
  }
16
21
  drawOffset(ctx, size, x, y, offset) {
17
- return rect(ctx, isNumber(size) ? [ size + 2 * offset, size + 2 * offset ] : [ size[0] + 2 * offset, size[1] + 2 * offset ], x, y);
22
+ return isNumber(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [ size[0] + 2 * offset, size[1] + 2 * offset ], x, y);
18
23
  }
19
24
  }
20
25
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAiCpC,MAAM,UAAU,IAAI,CAAC,GAAe,EAAE,IAAsB,EAAE,CAAS,EAAE,CAAS;IAChF,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC;AAGD,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QACE,SAAI,GAAe,MAAM,CAAC;QAC1B,YAAO,GAAW,oBAAoB,CAAC;IAazC,CAAC;IAXC,IAAI,CAAC,GAAe,EAAE,IAA+B,EAAE,CAAS,EAAE,CAAS;QACzE,MAAM,QAAQ,GAAqB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACxE,OAAO,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAA+B,EAAE,CAAS,EAAE,CAAS,EAAE,MAAc;QAC/F,MAAM,QAAQ,GAAqB,QAAQ,CAAC,IAAI,CAAC;YAC/C,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,GAAG,CAAC,GAAG,MAAM,CAAC;YACxC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACF;AAED,eAAe,IAAI,UAAU,EAAE,CAAC","file":"rect.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport { isNumber } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * 部分源码参考 https://github.com/vega/vega/blob/main/packages/vega-scenegraph/src/path/symbols.js\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function rect(ctx: IContext2d, size: [number, number], x: number, y: number) {\n ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n return false;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class RectSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'rect';\n pathStr: string = 'M-0.5,-0.5h1v1h-1Z';\n\n draw(ctx: IContext2d, size: number | [number, number], x: number, y: number) {\n const rectSize: [number, number] = isNumber(size) ? [size, size] : size;\n return rect(ctx, rectSize, x, y);\n }\n\n drawOffset(ctx: IContext2d, size: number | [number, number], x: number, y: number, offset: number) {\n const rectSize: [number, number] = isNumber(size)\n ? [size + 2 * offset, size + 2 * offset]\n : [size[0] + 2 * offset, size[1] + 2 * offset];\n return rect(ctx, rectSize, x, y);\n }\n}\n\nexport default new RectSymbol();\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/rect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAiCpC,MAAM,UAAU,aAAa,CAAC,GAAe,EAAE,IAAsB,EAAE,CAAS,EAAE,CAAS;IACzF,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAe,EAAE,IAAY,EAAE,CAAS,EAAE,CAAS;IAC1E,MAAM,CAAC,GAAG,IAAI,CAAC;IACf,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;IACnB,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACrC,OAAO,KAAK,CAAC;AACf,CAAC;AAGD,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QACE,SAAI,GAAe,MAAM,CAAC;QAC1B,YAAO,GAAW,mDAAmD,CAAC;IAiBxE,CAAC;IAfC,IAAI,CAAC,GAAe,EAAE,IAA+B,EAAE,CAAS,EAAE,CAAS;QACzE,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;YAClB,OAAO,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SAClC;QACD,OAAO,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAGxC,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAA+B,EAAE,CAAS,EAAE,CAAS,EAAE,MAAc;QAC/F,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;YAClB,OAAO,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SAC/C;QACD,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,CAAC;CACF;AAED,eAAe,IAAI,UAAU,EAAE,CAAC","file":"rect.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport { isNumber } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * 部分源码参考 https://github.com/vega/vega/blob/main/packages/vega-scenegraph/src/path/symbols.js\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function rectSizeArray(ctx: IContext2d, size: [number, number], x: number, y: number) {\n ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n return false;\n}\n\nexport function rectSize(ctx: IContext2d, size: number, x: number, y: number) {\n const w = size;\n const h = size / 2;\n ctx.rect(x - w / 2, y - h / 2, w, h);\n return false;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class RectSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'rect';\n pathStr: string = 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z';\n\n draw(ctx: IContext2d, size: number | [number, number], x: number, y: number) {\n if (isNumber(size)) {\n return rectSize(ctx, size, x, y);\n }\n return rectSizeArray(ctx, size, x, y);\n // const rectSize: [number, number] = ? [size, size] : size;\n // return rect(ctx, rectSize, x, y);\n }\n\n drawOffset(ctx: IContext2d, size: number | [number, number], x: number, y: number, offset: number) {\n if (isNumber(size)) {\n return rectSize(ctx, size + 2 * offset, x, y);\n }\n return rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);\n }\n}\n\nexport default new RectSymbol();\n"]}
@@ -72,9 +72,10 @@ export declare class DefaultGraphicService implements IGraphicService {
72
72
  protected updateArcAABBBoundsImprecise(attribute: IArcGraphicAttribute, arcTheme: Required<IArcGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
73
73
  protected updateArcAABBBoundsAccurate(attribute: IArcGraphicAttribute, arcTheme: Required<IArcGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
74
74
  updateSymbolAABBBounds(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, full?: boolean, graphic?: ISymbol): IBounds;
75
- updateSymbolAABBBoundsImprecise(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
76
- updateSymbolAABBBoundsAccurate(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ISymbol): IAABBBounds;
75
+ protected updateSymbolAABBBoundsImprecise(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
76
+ protected updateSymbolAABBBoundsAccurate(attribute: ISymbolGraphicAttribute, symbolTheme: Required<ISymbolGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ISymbol): IAABBBounds;
77
77
  updateImageAABBBounds(attribute: IImageGraphicAttribute, imageTheme: Required<IImageGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IBounds;
78
78
  combindShadowAABBBounds(bounds: IAABBBounds, graphic?: IGraphic): void;
79
79
  transformAABBBounds(attribute: Partial<IGraphicAttribute>, aabbBounds: IAABBBounds, theme: Required<IGraphicAttribute>, miter: boolean, graphic?: IGraphic): void;
80
+ protected _validCheck(attribute: Partial<IGraphicAttribute>, theme: Required<IGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): boolean;
80
81
  }
@@ -242,6 +242,7 @@ let DefaultGraphicService = class {
242
242
  return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
243
243
  }
244
244
  updateRectAABBBounds(attribute, rectTheme, aabbBounds, graphic) {
245
+ if (!this._validCheck(attribute, rectTheme, aabbBounds, graphic)) return aabbBounds;
245
246
  if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
246
247
  const {width: width = rectTheme.width, height: height = rectTheme.height} = attribute;
247
248
  aabbBounds.set(0, 0, width, height);
@@ -266,11 +267,12 @@ let DefaultGraphicService = class {
266
267
  aabbBounds;
267
268
  }
268
269
  updateGlyphAABBBounds(attribute, theme, aabbBounds, graphic) {
269
- return graphic.getSubGraphic().forEach((node => {
270
+ return this._validCheck(attribute, theme, aabbBounds, graphic) ? (graphic.getSubGraphic().forEach((node => {
270
271
  aabbBounds.union(node.AABBBounds);
271
- })), aabbBounds;
272
+ })), aabbBounds) : aabbBounds;
272
273
  }
273
274
  updateRichTextAABBBounds(attribute, richtextTheme, aabbBounds, graphic) {
275
+ if (!this._validCheck(attribute, richtextTheme, aabbBounds, graphic)) return aabbBounds;
274
276
  if (!graphic) return aabbBounds;
275
277
  const {width: width = richtextTheme.width, height: height = richtextTheme.height, maxWidth: maxWidth = richtextTheme.maxWidth, maxHeight: maxHeight = richtextTheme.maxHeight, textAlign: textAlign = richtextTheme.textAlign, textBaseline: textBaseline = richtextTheme.textBaseline} = attribute;
276
278
  if (width > 0 && height > 0) aabbBounds.set(0, 0, width, height); else {
@@ -313,6 +315,7 @@ let DefaultGraphicService = class {
313
315
  aabbBounds;
314
316
  }
315
317
  updateTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
318
+ if (!this._validCheck(attribute, textTheme, aabbBounds, graphic)) return aabbBounds;
316
319
  if (!graphic) return aabbBounds;
317
320
  const {text: text = textTheme.text} = graphic.attribute;
318
321
  Array.isArray(text) ? graphic.updateMultilineAABBBounds(text) : graphic.updateSingallineAABBBounds(text);
@@ -327,6 +330,7 @@ let DefaultGraphicService = class {
327
330
  aabbBounds;
328
331
  }
329
332
  updatePathAABBBounds(attribute, pathTheme, aabbBounds, graphic) {
333
+ if (!this._validCheck(attribute, pathTheme, aabbBounds, graphic)) return aabbBounds;
330
334
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic);
331
335
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
332
336
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
@@ -368,6 +372,7 @@ let DefaultGraphicService = class {
368
372
  aabbBounds;
369
373
  }
370
374
  updatePolygonAABBBounds(attribute, polygonTheme, aabbBounds, graphic) {
375
+ if (!this._validCheck(attribute, polygonTheme, aabbBounds, graphic)) return aabbBounds;
371
376
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds, graphic);
372
377
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
373
378
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
@@ -382,6 +387,7 @@ let DefaultGraphicService = class {
382
387
  })), aabbBounds;
383
388
  }
384
389
  updateLineAABBBounds(attribute, lineTheme, aabbBounds, graphic) {
390
+ if (!this._validCheck(attribute, lineTheme, aabbBounds, graphic)) return aabbBounds;
385
391
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic));
386
392
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
387
393
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
@@ -404,6 +410,7 @@ let DefaultGraphicService = class {
404
410
  })), b;
405
411
  }
406
412
  updateAreaAABBBounds(attribute, areaTheme, aabbBounds, graphic) {
413
+ if (!this._validCheck(attribute, areaTheme, aabbBounds, graphic)) return aabbBounds;
407
414
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic));
408
415
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
409
416
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2);
@@ -428,6 +435,7 @@ let DefaultGraphicService = class {
428
435
  })), b;
429
436
  }
430
437
  updateCircleAABBBounds(attribute, circleTheme, aabbBounds, full, graphic) {
438
+ if (!this._validCheck(attribute, circleTheme, aabbBounds, graphic)) return aabbBounds;
431
439
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds, graphic) : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds, graphic));
432
440
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
433
441
  return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
@@ -447,6 +455,7 @@ let DefaultGraphicService = class {
447
455
  aabbBounds;
448
456
  }
449
457
  updateArcAABBBounds(attribute, arcTheme, aabbBounds, full, graphic) {
458
+ if (!this._validCheck(attribute, arcTheme, aabbBounds, graphic)) return aabbBounds;
450
459
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) : this.updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic));
451
460
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
452
461
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
@@ -477,6 +486,7 @@ let DefaultGraphicService = class {
477
486
  circleBounds(startAngle, endAngle, innerRadius, aabbBounds)), aabbBounds;
478
487
  }
479
488
  updateSymbolAABBBounds(attribute, symbolTheme, aabbBounds, full, graphic) {
489
+ if (!this._validCheck(attribute, symbolTheme, aabbBounds, graphic)) return aabbBounds;
480
490
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds, graphic) : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds, graphic));
481
491
  const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
482
492
  tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
@@ -502,6 +512,7 @@ let DefaultGraphicService = class {
502
512
  return graphic.getParsedPath().bounds(size, aabbBounds), aabbBounds;
503
513
  }
504
514
  updateImageAABBBounds(attribute, imageTheme, aabbBounds, graphic) {
515
+ if (!this._validCheck(attribute, imageTheme, aabbBounds, graphic)) return aabbBounds;
505
516
  if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
506
517
  const {width: width = imageTheme.width, height: height = imageTheme.height} = attribute;
507
518
  aabbBounds.set(0, 0, width, height);
@@ -530,6 +541,12 @@ let DefaultGraphicService = class {
530
541
  }
531
542
  this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix);
532
543
  }
544
+ _validCheck(attribute, theme, aabbBounds, graphic) {
545
+ if (!graphic) return !0;
546
+ if (!graphic.valid) return aabbBounds.clear(), !1;
547
+ const {visible: visible = theme.visible} = attribute;
548
+ return !!visible || (aabbBounds.clear(), !1);
549
+ }
533
550
  };
534
551
 
535
552
  DefaultGraphicService = __decorate([ injectable(), __param(0, inject(GraphicCreator)), __param(1, inject(ContributionProvider)), __param(1, named(RectBoundsContribution)), __param(2, inject(ContributionProvider)), __param(2, named(SymbolBoundsContribution)), __param(3, inject(ContributionProvider)), __param(3, named(CircleBoundsContribution)), __param(4, inject(ContributionProvider)), __param(4, named(ArcBoundsContribution)), __param(5, inject(ContributionProvider)), __param(5, named(PathBoundsContribution)), __metadata("design:paramtypes", [ Object, Object, Object, Object, Object, Object ]) ], DefaultGraphicService);