@visactor/vrender-core 1.0.46-alpha.1 → 1.0.46-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.
Files changed (88) hide show
  1. package/cjs/canvas/constants.js +1 -2
  2. package/cjs/canvas/empty-context.js +2 -1
  3. package/cjs/common/diff.js +2 -1
  4. package/cjs/common/event-transformer.js +1 -2
  5. package/cjs/common/render-area.js +1 -1
  6. package/cjs/common/render-command-list.js +1 -1
  7. package/cjs/common/render-curve.js +1 -1
  8. package/cjs/common/render-utils.js +1 -1
  9. package/cjs/common/seg-context.js +1 -1
  10. package/cjs/common/simplify.js +2 -1
  11. package/cjs/common/sort.js +1 -1
  12. package/cjs/common/split-path.js +1 -1
  13. package/cjs/common/store.js +1 -1
  14. package/cjs/common/text.js +1 -1
  15. package/cjs/common/utils.js +1 -1
  16. package/cjs/core/application.js +1 -1
  17. package/cjs/core/camera.js +1 -1
  18. package/cjs/core/constants.js +1 -1
  19. package/cjs/core/core-modules.js +1 -1
  20. package/cjs/core/global-module.js +0 -2
  21. package/cjs/core/global.js +1 -1
  22. package/cjs/core/graphic-utils.js +1 -1
  23. package/cjs/core/index.js +1 -1
  24. package/cjs/core/layer-service.js +1 -2
  25. package/cjs/core/layer.js +1 -1
  26. package/cjs/core/light.js +1 -1
  27. package/cjs/core/stage.js +1 -1
  28. package/cjs/core/window.js +1 -1
  29. package/cjs/event/constant.js +1 -1
  30. package/cjs/event/event-manager.js +1 -1
  31. package/cjs/graphic/area.js +2 -2
  32. package/cjs/graphic/area.js.map +1 -1
  33. package/cjs/graphic/config.js +1 -3
  34. package/cjs/graphic/config.js.map +1 -1
  35. package/cjs/graphic/graphic.js +5 -14
  36. package/cjs/graphic/graphic.js.map +1 -1
  37. package/cjs/graphic/line.js +4 -4
  38. package/cjs/graphic/line.js.map +1 -1
  39. package/cjs/interface/graphic.d.ts +3 -20
  40. package/cjs/interface/graphic.js.map +1 -1
  41. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.d.ts +2 -4
  42. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +29 -56
  43. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  44. package/dist/index.es.js +39 -121
  45. package/es/canvas/constants.js +1 -2
  46. package/es/canvas/empty-context.js +2 -1
  47. package/es/common/diff.js +2 -1
  48. package/es/common/event-transformer.js +1 -2
  49. package/es/common/render-area.js +1 -1
  50. package/es/common/render-command-list.js +1 -1
  51. package/es/common/render-curve.js +1 -1
  52. package/es/common/render-utils.js +1 -1
  53. package/es/common/seg-context.js +1 -1
  54. package/es/common/simplify.js +2 -1
  55. package/es/common/sort.js +1 -1
  56. package/es/common/split-path.js +1 -1
  57. package/es/common/store.js +1 -1
  58. package/es/common/text.js +1 -1
  59. package/es/common/utils.js +1 -1
  60. package/es/core/application.js +1 -1
  61. package/es/core/camera.js +1 -1
  62. package/es/core/constants.js +1 -1
  63. package/es/core/core-modules.js +1 -1
  64. package/es/core/global-module.js +0 -2
  65. package/es/core/global.js +1 -1
  66. package/es/core/graphic-utils.js +1 -1
  67. package/es/core/index.js +1 -1
  68. package/es/core/layer-service.js +1 -2
  69. package/es/core/layer.js +1 -1
  70. package/es/core/light.js +1 -1
  71. package/es/core/stage.js +1 -1
  72. package/es/core/window.js +1 -1
  73. package/es/event/constant.js +1 -1
  74. package/es/event/event-manager.js +1 -1
  75. package/es/graphic/area.js +2 -2
  76. package/es/graphic/area.js.map +1 -1
  77. package/es/graphic/config.js +1 -3
  78. package/es/graphic/config.js.map +1 -1
  79. package/es/graphic/graphic.js +5 -12
  80. package/es/graphic/graphic.js.map +1 -1
  81. package/es/graphic/line.js +4 -4
  82. package/es/graphic/line.js.map +1 -1
  83. package/es/interface/graphic.d.ts +3 -20
  84. package/es/interface/graphic.js.map +1 -1
  85. package/es/render/contributions/render/contributions/base-texture-contribution-render.d.ts +2 -4
  86. package/es/render/contributions/render/contributions/base-texture-contribution-render.js +29 -56
  87. package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  88. package/package.json +2 -2
package/dist/index.es.js CHANGED
@@ -3563,7 +3563,7 @@ const DefaultTextStyle = {
3563
3563
  const DefaultPickStyle = {
3564
3564
  pickStrokeBuffer: 0
3565
3565
  };
3566
- const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({ forceBoundsWidth: undefined, forceBoundsHeight: undefined, opacity: 1, background: null, autoAnimateTexture: false, textureRatio: 1, textureOptions: { alignToGraphic: true }, backgroundOpacity: 1, backgroundCornerRadius: 0, texture: null, textureColor: 'black', textureSize: 10, texturePadding: 2, backgroundMode: 'no-repeat', backgroundFit: true, backgroundKeepAspectRatio: false, backgroundClip: true, backgroundScale: 1, backgroundOffsetX: 0, backgroundOffsetY: 0, backgroundPosition: 'top-left', blur: 0, filter: '', cursor: null, html: null, react: null, vue: null }, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
3566
+ const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({ forceBoundsWidth: undefined, forceBoundsHeight: undefined, opacity: 1, background: null, autoAnimateTexture: false, textureRatio: 1, textureOptions: null, backgroundOpacity: 1, backgroundCornerRadius: 0, texture: null, textureColor: 'black', textureSize: 10, texturePadding: 2, backgroundMode: 'no-repeat', backgroundFit: true, backgroundKeepAspectRatio: false, backgroundClip: true, backgroundScale: 1, backgroundOffsetX: 0, backgroundOffsetY: 0, backgroundPosition: 'top-left', blur: 0, filter: '', cursor: null, html: null, react: null, vue: null }, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
3567
3567
  const DefaultConnectAttribute = {
3568
3568
  connectedType: 'none',
3569
3569
  connectedStyle: {},
@@ -11063,17 +11063,6 @@ const GRAPHIC_UPDATE_TAG_KEY = [
11063
11063
  const tempConstantXYKey = ['x', 'y'];
11064
11064
  const tempConstantScaleXYKey = ['scaleX', 'scaleY'];
11065
11065
  const tempConstantAngleKey = ['angle'];
11066
- const builtinTextureTypes = new Set([
11067
- 'circle',
11068
- 'diamond',
11069
- 'rect',
11070
- 'vertical-line',
11071
- 'horizontal-line',
11072
- 'bias-lr',
11073
- 'bias-rl',
11074
- 'grid',
11075
- 'wave'
11076
- ]);
11077
11066
  const point = new Point();
11078
11067
  const NOWORK_ANIMATE_ATTR = {
11079
11068
  strokeSeg: 1,
@@ -11139,9 +11128,6 @@ class Graphic extends Node {
11139
11128
  if (params.background) {
11140
11129
  this.loadImage((_a = params.background.background) !== null && _a !== void 0 ? _a : params.background, true);
11141
11130
  }
11142
- if (isExternalTexture(params.texture)) {
11143
- this.loadImage(params.texture, false);
11144
- }
11145
11131
  else if (params.shadowGraphic) {
11146
11132
  this.setShadowGraphic(params.shadowGraphic);
11147
11133
  }
@@ -11434,9 +11420,6 @@ class Graphic extends Node {
11434
11420
  if (params.background) {
11435
11421
  this.loadImage(params.background, true);
11436
11422
  }
11437
- if (isExternalTexture(params.texture)) {
11438
- this.loadImage(params.texture, false);
11439
- }
11440
11423
  else if (params.shadowGraphic) {
11441
11424
  this.setShadowGraphic(params.shadowGraphic);
11442
11425
  }
@@ -11486,9 +11469,6 @@ class Graphic extends Node {
11486
11469
  if (key === 'background') {
11487
11470
  this.loadImage(value, true);
11488
11471
  }
11489
- else if (key === 'texture' && isExternalTexture(value)) {
11490
- this.loadImage(value, false);
11491
- }
11492
11472
  else if (key === 'shadowGraphic') {
11493
11473
  this.setShadowGraphic(value);
11494
11474
  }
@@ -11519,9 +11499,6 @@ class Graphic extends Node {
11519
11499
  if (params.background) {
11520
11500
  this.loadImage(params.background, true);
11521
11501
  }
11522
- if (isExternalTexture(params.texture)) {
11523
- this.loadImage(params.texture, false);
11524
- }
11525
11502
  else if (params.shadowGraphic) {
11526
11503
  this.setShadowGraphic(params.shadowGraphic);
11527
11504
  }
@@ -12209,18 +12186,6 @@ function backgroundNotImage(image) {
12209
12186
  }
12210
12187
  return false;
12211
12188
  }
12212
- function isExternalTexture(texture) {
12213
- if (!texture) {
12214
- return false;
12215
- }
12216
- if (typeof texture === 'string') {
12217
- if (builtinTextureTypes.has(texture)) {
12218
- return false;
12219
- }
12220
- return texture.startsWith('<svg') || isValidUrl(texture) || texture.includes('/') || isBase64(texture);
12221
- }
12222
- return isObject(texture);
12223
- }
12224
12189
 
12225
12190
  var GroupUpdateAABBBoundsMode;
12226
12191
  (function (GroupUpdateAABBBoundsMode) {
@@ -14421,21 +14386,21 @@ let Line$1 = class Line extends Graphic {
14421
14386
  return aabbBounds;
14422
14387
  }
14423
14388
  updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic) {
14424
- const { points = lineTheme.points, connectedType } = attribute;
14389
+ const { points = lineTheme.points } = attribute;
14425
14390
  const b = aabbBounds;
14426
14391
  points.forEach(p => {
14427
- if (p.defined !== false || connectedType === 'connect') {
14392
+ if (p.defined !== false) {
14428
14393
  b.add(p.x, p.y);
14429
14394
  }
14430
14395
  });
14431
14396
  return b;
14432
14397
  }
14433
14398
  updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
14434
- const { segments = lineTheme.segments, connectedType } = attribute;
14399
+ const { segments = lineTheme.segments } = attribute;
14435
14400
  const b = aabbBounds;
14436
14401
  segments.forEach(s => {
14437
14402
  s.points.forEach(p => {
14438
- if (p.defined !== false || connectedType === 'connect') {
14403
+ if (p.defined !== false) {
14439
14404
  b.add(p.x, p.y);
14440
14405
  }
14441
14406
  });
@@ -16553,6 +16518,9 @@ class Area extends Graphic {
16553
16518
  const b = aabbBounds;
16554
16519
  points.forEach(p => {
16555
16520
  var _a, _b;
16521
+ if (p.defined === false) {
16522
+ return;
16523
+ }
16556
16524
  b.add(p.x, p.y);
16557
16525
  b.add((_a = p.x1) !== null && _a !== void 0 ? _a : p.x, (_b = p.y1) !== null && _b !== void 0 ? _b : p.y);
16558
16526
  });
@@ -16564,6 +16532,9 @@ class Area extends Graphic {
16564
16532
  segments.forEach(s => {
16565
16533
  s.points.forEach(p => {
16566
16534
  var _a, _b;
16535
+ if (p.defined === false) {
16536
+ return;
16537
+ }
16567
16538
  b.add(p.x, p.y);
16568
16539
  b.add((_a = p.x1) !== null && _a !== void 0 ? _a : p.x, (_b = p.y1) !== null && _b !== void 0 ? _b : p.y);
16569
16540
  });
@@ -17802,50 +17773,38 @@ class DefaultBaseTextureRenderContribution {
17802
17773
  this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
17803
17774
  }
17804
17775
  drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
17805
- var _a, _b, _c, _d, _e;
17776
+ var _a;
17806
17777
  const { textureRatio = graphicAttribute.textureRatio, textureOptions = null } = graphic.attribute;
17807
- let pattern = null;
17808
- const patternKey = this.getPatternCacheKey(texture, textureSize, texturePadding, textureColor, context.dpr);
17809
- if (patternKey !== null) {
17810
- pattern = this.textureMap.get(patternKey);
17811
- }
17778
+ let pattern = this.textureMap.get(texture);
17812
17779
  if (!pattern) {
17813
- if (typeof texture === 'string') {
17814
- switch (texture) {
17815
- case 'circle':
17816
- pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
17817
- break;
17818
- case 'diamond':
17819
- pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
17820
- break;
17821
- case 'rect':
17822
- pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
17823
- break;
17824
- case 'vertical-line':
17825
- pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
17826
- break;
17827
- case 'horizontal-line':
17828
- pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
17829
- break;
17830
- case 'bias-lr':
17831
- pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
17832
- break;
17833
- case 'bias-rl':
17834
- pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
17835
- break;
17836
- case 'grid':
17837
- pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
17838
- break;
17839
- }
17840
- }
17841
- if (!pattern) {
17842
- pattern = this.createResourcePattern(texture, graphic, context);
17843
- }
17844
- if (pattern && patternKey !== null) {
17845
- this.textureMap.set(patternKey, pattern);
17780
+ switch (texture) {
17781
+ case 'circle':
17782
+ pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
17783
+ break;
17784
+ case 'diamond':
17785
+ pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
17786
+ break;
17787
+ case 'rect':
17788
+ pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
17789
+ break;
17790
+ case 'vertical-line':
17791
+ pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
17792
+ break;
17793
+ case 'horizontal-line':
17794
+ pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
17795
+ break;
17796
+ case 'bias-lr':
17797
+ pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
17798
+ break;
17799
+ case 'bias-rl':
17800
+ pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
17801
+ break;
17802
+ case 'grid':
17803
+ pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
17804
+ break;
17846
17805
  }
17847
17806
  }
17848
- if (typeof texture === 'string' && textureOptions && textureOptions.dynamicTexture) {
17807
+ if (textureOptions && textureOptions.dynamicTexture) {
17849
17808
  const { gridConfig = {}, useNewCanvas } = textureOptions;
17850
17809
  const b = graphic.AABBBounds;
17851
17810
  x = b.x1;
@@ -17906,27 +17865,6 @@ class DefaultBaseTextureRenderContribution {
17906
17865
  originalContext.restore();
17907
17866
  }
17908
17867
  else if (pattern) {
17909
- if (pattern.setTransform) {
17910
- const alignToGraphic = !!(textureOptions === null || textureOptions === void 0 ? void 0 : textureOptions.alignToGraphic);
17911
- const alignOffsetX = (_b = textureOptions === null || textureOptions === void 0 ? void 0 : textureOptions.alignOffsetX) !== null && _b !== void 0 ? _b : 0;
17912
- const alignOffsetY = (_c = textureOptions === null || textureOptions === void 0 ? void 0 : textureOptions.alignOffsetY) !== null && _c !== void 0 ? _c : 0;
17913
- let translateX = 0;
17914
- let translateY = 0;
17915
- if (alignToGraphic) {
17916
- const m = context.currentMatrix;
17917
- const e = (_d = m === null || m === void 0 ? void 0 : m.e) !== null && _d !== void 0 ? _d : 0;
17918
- const f = (_e = m === null || m === void 0 ? void 0 : m.f) !== null && _e !== void 0 ? _e : 0;
17919
- const ux = e + x + alignOffsetX;
17920
- const uy = f + y + alignOffsetY;
17921
- translateX = ux;
17922
- translateY = uy;
17923
- }
17924
- else if (alignOffsetX || alignOffsetY) {
17925
- translateX = alignOffsetX;
17926
- translateY = alignOffsetY;
17927
- }
17928
- pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, translateX, translateY]));
17929
- }
17930
17868
  context.highPerformanceSave();
17931
17869
  context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);
17932
17870
  context.fillStyle = pattern;
@@ -17942,26 +17880,6 @@ class DefaultBaseTextureRenderContribution {
17942
17880
  context.restore();
17943
17881
  }
17944
17882
  }
17945
- getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr) {
17946
- if (typeof texture !== 'string') {
17947
- return texture;
17948
- }
17949
- if (texture === 'wave') {
17950
- return null;
17951
- }
17952
- return `${texture}-${textureSize}-${texturePadding}-${textureColor}-${dpr}`;
17953
- }
17954
- createResourcePattern(texture, graphic, context) {
17955
- var _a;
17956
- const resource = (_a = graphic.resources) === null || _a === void 0 ? void 0 : _a.get(texture);
17957
- const data = (resource === null || resource === void 0 ? void 0 : resource.state) === 'success' ? resource.data : typeof texture === 'object' ? texture : null;
17958
- if (!data) {
17959
- return null;
17960
- }
17961
- const pattern = context.createPattern(data, 'repeat');
17962
- (pattern === null || pattern === void 0 ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0]));
17963
- return pattern;
17964
- }
17965
17883
  }
17966
17884
  const defaultBaseTextureRenderContribution = new DefaultBaseTextureRenderContribution();
17967
17885
 
@@ -1,4 +1,3 @@
1
1
  export const CanvasFactory = Symbol.for("CanvasFactory");
2
2
 
3
- export const Context2dFactory = Symbol.for("Context2dFactory");
4
- //# sourceMappingURL=constants.js.map
3
+ export const Context2dFactory = Symbol.for("Context2dFactory");
@@ -219,4 +219,5 @@ let EmptyContext2d = class {
219
219
 
220
220
  EmptyContext2d = __decorate([ injectable(), __metadata("design:paramtypes", [ Object, Number ]) ], EmptyContext2d);
221
221
 
222
- export { EmptyContext2d };
222
+ export { EmptyContext2d };
223
+ //# sourceMappingURL=empty-context.js.map
package/es/common/diff.js CHANGED
@@ -8,4 +8,5 @@ export function diff(oldAttrs, newAttrs, getAttr) {
8
8
  void 0 !== value && (diffObj[key] = value);
9
9
  }
10
10
  return diffObj;
11
- }
11
+ }
12
+ //# sourceMappingURL=diff.js.map
@@ -77,5 +77,4 @@ export function mapToCanvasPointForCanvas(nativeEvent) {
77
77
  x: nativeEvent._canvasX || 0,
78
78
  y: nativeEvent._canvasY || 0
79
79
  };
80
- }
81
- //# sourceMappingURL=event-transformer.js.map
80
+ }
@@ -61,4 +61,4 @@ function drawAreaBlock(path, topList, bottomList, params) {
61
61
  }
62
62
  path.closePath();
63
63
  }
64
- //# sourceMappingURL=render-area.js.map
64
+ //# 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
@@ -93,4 +93,4 @@ export function drawIncrementalAreaSegments(path, lastSeg, segments, params) {
93
93
  path.closePath();
94
94
  }));
95
95
  }
96
- //# sourceMappingURL=render-curve.js.map
96
+ //# sourceMappingURL=render-curve.js.map
@@ -11,4 +11,4 @@ export function drawSegItem(ctx, curve, endPercent, params) {
11
11
  ctx.lineTo(offsetX + p.x, offsetY + p.y, offsetZ);
12
12
  }
13
13
  }
14
- //# sourceMappingURL=render-utils.js.map
14
+ //# sourceMappingURL=render-utils.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
@@ -29,4 +29,5 @@ function simplifyDouglasPeucker(points, sqTolerance) {
29
29
  export function flatten_simplify(points, tolerance, highestQuality) {
30
30
  if (points.length <= 10) return points;
31
31
  return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
32
- }
32
+ }
33
+ //# sourceMappingURL=simplify.js.map
package/es/common/sort.js CHANGED
@@ -94,4 +94,4 @@ export function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
94
94
  !1)), reverse);
95
95
  return result;
96
96
  }
97
- //# sourceMappingURL=sort.js.map
97
+ //# sourceMappingURL=sort.js.map
@@ -248,4 +248,4 @@ export const splitPath = (path, count) => {
248
248
  }
249
249
  return res;
250
250
  };
251
- //# sourceMappingURL=split-path.js.map
251
+ //# sourceMappingURL=split-path.js.map
@@ -1,2 +1,2 @@
1
1
  class StageStore {}
2
- //# sourceMappingURL=store.js.map
2
+ //# sourceMappingURL=store.js.map
package/es/common/text.js CHANGED
@@ -24,4 +24,4 @@ export function textAttributesToStyle(attrs) {
24
24
  attrs.underline ? style["text-decoration"] = "underline" : attrs.lineThrough && (style["text-decoration"] = "line-through"),
25
25
  attrs.fill && isString(attrs.fill) && (style.color = attrs.fill), style;
26
26
  }
27
- //# sourceMappingURL=text.js.map
27
+ //# sourceMappingURL=text.js.map
@@ -148,4 +148,4 @@ export const calculateLineHeight = (lineHeight, fontSize) => {
148
148
  const _lh = _calculateLineHeight(lineHeight, fontSize);
149
149
  return isNaN(_lh) ? _lh : Math.max(fontSize, _lh);
150
150
  };
151
- //# sourceMappingURL=utils.js.map
151
+ //# sourceMappingURL=utils.js.map
@@ -1,2 +1,2 @@
1
1
  export const ApplicationContribution = Symbol("ApplicationContribution");
2
- //# sourceMappingURL=application.js.map
2
+ //# sourceMappingURL=application.js.map
package/es/core/camera.js CHANGED
@@ -66,4 +66,4 @@ export class OrthoCamera {
66
66
  export const registerOrthoCamera = () => {
67
67
  Factory.registerPlugin("OrthoCamera", OrthoCamera);
68
68
  };
69
- //# sourceMappingURL=camera.js.map
69
+ //# sourceMappingURL=camera.js.map
@@ -9,4 +9,4 @@ export const StaticLayerHandlerContribution = Symbol.for("StaticLayerHandlerCont
9
9
  export const DynamicLayerHandlerContribution = Symbol.for("DynamicLayerHandlerContribution");
10
10
 
11
11
  export const VirtualLayerHandlerContribution = Symbol.for("VirtualLayerHandlerContribution");
12
- //# sourceMappingURL=constants.js.map
12
+ //# sourceMappingURL=constants.js.map
@@ -17,4 +17,4 @@ export default new ContainerModule((bind => {
17
17
  bind(GraphicUtil).to(DefaultGraphicUtil).inSingletonScope(), bind(TransformUtil).to(DefaultTransformUtil).inSingletonScope(),
18
18
  bind(LayerService).to(DefaultLayerService).inSingletonScope();
19
19
  }));
20
- //# sourceMappingURL=core-modules.js.map
20
+ //# sourceMappingURL=core-modules.js.map
@@ -1,3 +1 @@
1
-
2
-
3
1
  //# sourceMappingURL=global-module.js.map
package/es/core/global.js CHANGED
@@ -238,4 +238,4 @@ let DefaultGlobal = class extends EventListenerManager {
238
238
  DefaultGlobal = __decorate([ injectable(), __param(0, inject(ContributionProvider)), __param(0, named(EnvContribution)), __metadata("design:paramtypes", [ Object ]) ], DefaultGlobal);
239
239
 
240
240
  export { DefaultGlobal };
241
- //# sourceMappingURL=global.js.map
241
+ //# sourceMappingURL=global.js.map
@@ -189,4 +189,4 @@ let DefaultTransformUtil = class {
189
189
  DefaultTransformUtil = __decorate([ injectable(), __metadata("design:paramtypes", []) ], DefaultTransformUtil);
190
190
 
191
191
  export { DefaultTransformUtil };
192
- //# sourceMappingURL=graphic-utils.js.map
192
+ //# 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
@@ -82,5 +82,4 @@ let DefaultLayerService = DefaultLayerService_1 = class {
82
82
  DefaultLayerService.idprefix = "visactor_layer", DefaultLayerService.prefix_count = 0,
83
83
  DefaultLayerService = DefaultLayerService_1 = __decorate([ injectable(), __metadata("design:paramtypes", []) ], DefaultLayerService);
84
84
 
85
- export { DefaultLayerService };
86
- //# sourceMappingURL=layer-service.js.map
85
+ export { DefaultLayerService };
package/es/core/layer.js CHANGED
@@ -112,4 +112,4 @@ export class Layer extends Group {
112
112
  }, params)), this.afterDrawCbs.forEach((c => c(this)));
113
113
  }
114
114
  }
115
- //# sourceMappingURL=layer.js.map
115
+ //# sourceMappingURL=layer.js.map
package/es/core/light.js CHANGED
@@ -23,4 +23,4 @@ export class DirectionalLight {
23
23
  export const registerDirectionalLight = () => {
24
24
  Factory.registerPlugin("DirectionalLight", DirectionalLight);
25
25
  };
26
- //# sourceMappingURL=light.js.map
26
+ //# sourceMappingURL=light.js.map
package/es/core/stage.js CHANGED
@@ -589,4 +589,4 @@ export class Stage extends Group {
589
589
  this.renderService.reInit(), this.pickerService.reInit();
590
590
  }
591
591
  }
592
- //# sourceMappingURL=stage.js.map
592
+ //# sourceMappingURL=stage.js.map
package/es/core/window.js CHANGED
@@ -162,4 +162,4 @@ let DefaultWindow = class extends EventListenerManager {
162
162
  DefaultWindow = __decorate([ injectable(), __metadata("design:paramtypes", []) ], DefaultWindow);
163
163
 
164
164
  export { DefaultWindow };
165
- //# sourceMappingURL=window.js.map
165
+ //# sourceMappingURL=window.js.map
@@ -1,2 +1,2 @@
1
1
  export const WILDCARD = "*";
2
- //# sourceMappingURL=constant.js.map
2
+ //# sourceMappingURL=constant.js.map
@@ -299,4 +299,4 @@ export class EventManager {
299
299
  this.mappingTable = null, this.mappingState = null, this.cursorTarget = null;
300
300
  }
301
301
  }
302
- //# sourceMappingURL=event-manager.js.map
302
+ //# sourceMappingURL=event-manager.js.map
@@ -38,7 +38,7 @@ export class Area extends Graphic {
38
38
  const {points: points = areaTheme.points} = attribute, b = aabbBounds;
39
39
  return points.forEach((p => {
40
40
  var _a, _b;
41
- b.add(p.x, p.y), b.add(null !== (_a = p.x1) && void 0 !== _a ? _a : p.x, null !== (_b = p.y1) && void 0 !== _b ? _b : p.y);
41
+ !1 !== p.defined && (b.add(p.x, p.y), b.add(null !== (_a = p.x1) && void 0 !== _a ? _a : p.x, null !== (_b = p.y1) && void 0 !== _b ? _b : p.y));
42
42
  })), b;
43
43
  }
44
44
  updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) {
@@ -46,7 +46,7 @@ export class Area extends Graphic {
46
46
  return segments.forEach((s => {
47
47
  s.points.forEach((p => {
48
48
  var _a, _b;
49
- b.add(p.x, p.y), b.add(null !== (_a = p.x1) && void 0 !== _a ? _a : p.x, null !== (_b = p.y1) && void 0 !== _b ? _b : p.y);
49
+ !1 !== p.defined && (b.add(p.x, p.y), b.add(null !== (_a = p.x1) && void 0 !== _a ? _a : p.x, null !== (_b = p.y1) && void 0 !== _b ? _b : p.y));
50
50
  }));
51
51
  })), b;
52
52
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/area.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,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,SAAS,EAAE,CAAC,IACT,mBAAmB,EACtB;AAoKJ,MAAM,UAAU,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC","file":"area.js","sourcesContent":["import type { IAABBBounds, IPointLike } from '@visactor/vutils';\nimport type { IArea, IAreaCacheItem, IAreaGraphicAttribute } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { pointsInterpolation } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { AREA_NUMBER_TYPE } from './constants';\n\nconst AREA_UPDATE_TAG_KEY = ['segments', 'points', 'curveType', 'curveTension', ...GRAPHIC_UPDATE_TAG_KEY];\n\nexport class Area extends Graphic<IAreaGraphicAttribute> implements IArea {\n type: 'area' = 'area';\n\n static NOWORK_ANIMATE_ATTR = {\n segments: 1,\n curveType: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache?: IAreaCacheItem;\n\n constructor(params: IAreaGraphicAttribute) {\n super(params);\n this.numberType = AREA_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n if (this.pathProxy) {\n return true;\n }\n const { points, segments } = this.attribute;\n if (segments) {\n if (segments.length === 0) {\n return false;\n }\n return true;\n } else if (points) {\n if (points.length === 0) {\n return false;\n }\n return true;\n }\n return false;\n }\n\n getGraphicTheme(): Required<IAreaGraphicAttribute> {\n return getTheme(this).area;\n }\n\n protected updateAABBBounds(\n attribute: IAreaGraphicAttribute,\n areaTheme: Required<IAreaGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n attribute.segments\n ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds)\n : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds);\n }\n application.graphicService.updateTempAABBBounds(aabbBounds);\n // if (!this._rectBoundsContribitions) {\n // this._rectBoundsContribitions = this.rectBoundsContribitions.getContributions() || [];\n // }\n // this._rectBoundsContribitions.length &&\n // this._rectBoundsContribitions.forEach(c => {\n // c.updateBounds(attribute, areaTheme, tb1, graphic);\n // aabbBounds.union(tb1);\n // tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n // });\n\n this.setWidthHeightWithoutTransform(aabbBounds);\n\n const { lineJoin = areaTheme.lineJoin } = attribute;\n application.graphicService.transformAABBBounds(attribute, aabbBounds, areaTheme, lineJoin === 'miter', this);\n return aabbBounds;\n }\n\n protected updateAreaAABBBoundsByPoints(\n attribute: IAreaGraphicAttribute,\n areaTheme: Required<IAreaGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IArea\n ): IAABBBounds {\n const { points = areaTheme.points } = attribute;\n const b = aabbBounds;\n points.forEach(p => {\n b.add(p.x, p.y);\n b.add(p.x1 ?? p.x, p.y1 ?? p.y); //面积图特殊性:由三个值构成,横向面积图,x1会省略;纵向面积图,y1会省略\n });\n return b;\n }\n protected updateAreaAABBBoundsBySegments(\n attribute: IAreaGraphicAttribute,\n areaTheme: Required<IAreaGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IArea\n ): IAABBBounds {\n const { segments = areaTheme.segments } = attribute;\n const b = aabbBounds;\n segments.forEach(s => {\n s.points.forEach(p => {\n b.add(p.x, p.y);\n b.add(p.x1 ?? p.x, p.y1 ?? p.y); //面积图特殊性:由三个值构成,横向面积图,x1会省略;纵向面积图,y1会省略\n });\n });\n return b;\n }\n\n protected _interpolate(key: string, ratio: number, lastStepVal: any, nextStepVal: any, nextAttributes: any): void {\n if (key === 'points') {\n (nextAttributes as any).points = pointsInterpolation(lastStepVal, nextStepVal, ratio);\n }\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, AREA_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, AREA_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n let path = super.toCustomPath();\n if (path) {\n return path;\n }\n path = new CustomPath2D();\n const attribute = this.attribute;\n const segments = attribute.segments;\n\n const parsePoints = (points: IPointLike[]) => {\n if (points && points.length) {\n let isFirst = true;\n const basePoints: IPointLike[] = [];\n points.forEach(point => {\n if (point.defined === false) {\n return;\n }\n if (isFirst) {\n path.moveTo(point.x, point.y);\n } else {\n path.lineTo(point.x, point.y);\n }\n basePoints.push({ x: point.x1 ?? point.x, y: point.y1 ?? point.y });\n\n isFirst = false;\n });\n\n if (basePoints.length) {\n for (let i = basePoints.length - 1; i >= 0; i--) {\n path.lineTo(basePoints[i].x, basePoints[i].y);\n }\n\n path.closePath();\n }\n }\n };\n\n if (attribute.points) {\n parsePoints(attribute.points);\n } else if (segments && segments.length) {\n segments.forEach(seg => {\n parsePoints(seg.points);\n });\n }\n\n return path;\n }\n\n clone() {\n return new Area({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Area.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createArea(attributes: IAreaGraphicAttribute): IArea {\n return new Area(attributes);\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/area.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,sBAAsB,CAAC,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C,mBAAmB,CAAC;IAClC,CAAC;;AA3KM,wBAAmB,mBACxB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,IACT,mBAAmB,EACtB;AA0KJ,MAAM,UAAU,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC","file":"area.js","sourcesContent":["import type { IAABBBounds, IPointLike } from '@visactor/vutils';\nimport type { IArea, IAreaCacheItem, IAreaGraphicAttribute } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { pointsInterpolation } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { AREA_NUMBER_TYPE } from './constants';\n\nconst AREA_UPDATE_TAG_KEY = ['segments', 'points', 'curveType', 'curveTension', ...GRAPHIC_UPDATE_TAG_KEY];\n\nexport class Area extends Graphic<IAreaGraphicAttribute> implements IArea {\n type: 'area' = 'area';\n\n static NOWORK_ANIMATE_ATTR = {\n segments: 1,\n curveType: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache?: IAreaCacheItem;\n\n constructor(params: IAreaGraphicAttribute) {\n super(params);\n this.numberType = AREA_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n if (this.pathProxy) {\n return true;\n }\n const { points, segments } = this.attribute;\n if (segments) {\n if (segments.length === 0) {\n return false;\n }\n return true;\n } else if (points) {\n if (points.length === 0) {\n return false;\n }\n return true;\n }\n return false;\n }\n\n getGraphicTheme(): Required<IAreaGraphicAttribute> {\n return getTheme(this).area;\n }\n\n protected updateAABBBounds(\n attribute: IAreaGraphicAttribute,\n areaTheme: Required<IAreaGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n attribute.segments\n ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds)\n : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds);\n }\n application.graphicService.updateTempAABBBounds(aabbBounds);\n // if (!this._rectBoundsContribitions) {\n // this._rectBoundsContribitions = this.rectBoundsContribitions.getContributions() || [];\n // }\n // this._rectBoundsContribitions.length &&\n // this._rectBoundsContribitions.forEach(c => {\n // c.updateBounds(attribute, areaTheme, tb1, graphic);\n // aabbBounds.union(tb1);\n // tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n // });\n\n this.setWidthHeightWithoutTransform(aabbBounds);\n\n const { lineJoin = areaTheme.lineJoin } = attribute;\n application.graphicService.transformAABBBounds(attribute, aabbBounds, areaTheme, lineJoin === 'miter', this);\n return aabbBounds;\n }\n\n protected updateAreaAABBBoundsByPoints(\n attribute: IAreaGraphicAttribute,\n areaTheme: Required<IAreaGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IArea\n ): IAABBBounds {\n const { points = areaTheme.points } = attribute;\n const b = aabbBounds;\n points.forEach(p => {\n if (p.defined === false) {\n return;\n }\n b.add(p.x, p.y);\n b.add(p.x1 ?? p.x, p.y1 ?? p.y); //面积图特殊性:由三个值构成,横向面积图,x1会省略;纵向面积图,y1会省略\n });\n return b;\n }\n protected updateAreaAABBBoundsBySegments(\n attribute: IAreaGraphicAttribute,\n areaTheme: Required<IAreaGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IArea\n ): IAABBBounds {\n const { segments = areaTheme.segments } = attribute;\n const b = aabbBounds;\n segments.forEach(s => {\n s.points.forEach(p => {\n if (p.defined === false) {\n return;\n }\n b.add(p.x, p.y);\n b.add(p.x1 ?? p.x, p.y1 ?? p.y); //面积图特殊性:由三个值构成,横向面积图,x1会省略;纵向面积图,y1会省略\n });\n });\n return b;\n }\n\n protected _interpolate(key: string, ratio: number, lastStepVal: any, nextStepVal: any, nextAttributes: any): void {\n if (key === 'points') {\n (nextAttributes as any).points = pointsInterpolation(lastStepVal, nextStepVal, ratio);\n }\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, AREA_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, AREA_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n let path = super.toCustomPath();\n if (path) {\n return path;\n }\n path = new CustomPath2D();\n const attribute = this.attribute;\n const segments = attribute.segments;\n\n const parsePoints = (points: IPointLike[]) => {\n if (points && points.length) {\n let isFirst = true;\n const basePoints: IPointLike[] = [];\n points.forEach(point => {\n if (point.defined === false) {\n return;\n }\n if (isFirst) {\n path.moveTo(point.x, point.y);\n } else {\n path.lineTo(point.x, point.y);\n }\n basePoints.push({ x: point.x1 ?? point.x, y: point.y1 ?? point.y });\n\n isFirst = false;\n });\n\n if (basePoints.length) {\n for (let i = basePoints.length - 1; i >= 0; i--) {\n path.lineTo(basePoints[i].x, basePoints[i].y);\n }\n\n path.closePath();\n }\n }\n };\n\n if (attribute.points) {\n parsePoints(attribute.points);\n } else if (segments && segments.length) {\n segments.forEach(seg => {\n parsePoints(seg.points);\n });\n }\n\n return path;\n }\n\n clone() {\n return new Area({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Area.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createArea(attributes: IAreaGraphicAttribute): IArea {\n return new Area(attributes);\n}\n"]}
@@ -102,9 +102,7 @@ export const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.ass
102
102
  background: null,
103
103
  autoAnimateTexture: !1,
104
104
  textureRatio: 1,
105
- textureOptions: {
106
- alignToGraphic: !0
107
- },
105
+ textureOptions: null,
108
106
  backgroundOpacity: 1,
109
107
  backgroundCornerRadius: 0,
110
108
  texture: null,