@visactor/vrender 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.
package/cjs/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare const version = "0.16.15";
1
+ export declare const version = "0.16.17-alpha.1";
2
2
  export * from '@visactor/vrender-core';
3
3
  export * from '@visactor/vrender-kits';
package/cjs/index.js CHANGED
@@ -21,5 +21,5 @@ Object.defineProperty(exports, "__esModule", {
21
21
 
22
22
  const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits");
23
23
 
24
- exports.version = "0.16.15", (0, vrender_kits_1.loadAllModule)(vrender_core_1.container),
24
+ exports.version = "0.16.17-alpha.1", (0, vrender_kits_1.loadAllModule)(vrender_core_1.container),
25
25
  __exportStar(require("@visactor/vrender-core"), exports), __exportStar(require("@visactor/vrender-kits"), exports);
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAuD;AAG1C,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,IAAA,4BAAa,EAAC,wBAAS,CAAC,CAAC;AAEzB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadAllModule } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.16.15\";\n\nloadAllModule(container);\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AACnD,yDAAuD;AAG1C,QAAA,OAAO,GAAG,iBAAiB,CAAC;AAEzC,IAAA,4BAAa,EAAC,wBAAS,CAAC,CAAC;AAEzB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { loadAllModule } from '@visactor/vrender-kits';\n\n// 导出版本号\nexport const version = \"0.16.17-alpha.1\";\n\nloadAllModule(container);\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
package/dist/index.js CHANGED
@@ -12004,7 +12004,7 @@
12004
12004
  var tempMatrix = new Matrix(),
12005
12005
  tempBounds$1 = new AABBBounds();
12006
12006
  var PURE_STYLE_KEY = ["stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity"];
12007
- var GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "lineCap", "lineJoin", "miterLimit", "scaleX", "scaleY", "angle", "anchor"];
12007
+ var GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
12008
12008
  var tempConstantXYKey = ["x", "y"],
12009
12009
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
12010
12010
  tempConstantAngleKey = ["angle"],
@@ -15861,32 +15861,37 @@
15861
15861
  }(BaseSymbol);
15862
15862
  var close$1 = new CloseSymbol();
15863
15863
 
15864
- function rect(ctx, size, x, y) {
15864
+ function rectSizeArray(ctx, size, x, y) {
15865
15865
  return ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]), !1;
15866
15866
  }
15867
+ function rectSize(ctx, size, x, y) {
15868
+ var w = size,
15869
+ h = size / 2;
15870
+ return ctx.rect(x - w / 2, y - h / 2, w, h), !1;
15871
+ }
15867
15872
  var RectSymbol = /*#__PURE__*/function (_BaseSymbol) {
15868
15873
  _inherits(RectSymbol, _BaseSymbol);
15869
15874
  var _super = _createSuper(RectSymbol);
15870
15875
  function RectSymbol() {
15871
15876
  var _this;
15872
15877
  _classCallCheck(this, RectSymbol);
15873
- _this = _super.apply(this, arguments), _this.type = "rect", _this.pathStr = "M-0.5,-0.5h1v1h-1Z";
15878
+ _this = _super.apply(this, 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";
15874
15879
  return _this;
15875
15880
  }
15876
15881
  _createClass(RectSymbol, [{
15877
15882
  key: "draw",
15878
15883
  value: function draw(ctx, size, x, y) {
15879
- return rect(ctx, isNumber$2(size) ? [size, size] : size, x, y);
15884
+ return isNumber$2(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
15880
15885
  }
15881
15886
  }, {
15882
15887
  key: "drawOffset",
15883
15888
  value: function drawOffset(ctx, size, x, y, offset) {
15884
- return rect(ctx, isNumber$2(size) ? [size + 2 * offset, size + 2 * offset] : [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
15889
+ return isNumber$2(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
15885
15890
  }
15886
15891
  }]);
15887
15892
  return RectSymbol;
15888
15893
  }(BaseSymbol);
15889
- var rect$1 = new RectSymbol();
15894
+ var rect = new RectSymbol();
15890
15895
 
15891
15896
  var tempBounds = new AABBBounds();
15892
15897
  var CustomSymbolClass = /*#__PURE__*/function () {
@@ -15925,7 +15930,7 @@
15925
15930
  return CustomSymbolClass;
15926
15931
  }();
15927
15932
 
15928
- var builtinSymbols = [circle$1, cross$1, diamond$1, square$1, thinTriangle$1, triangle, star$1, arrow$1, wedge$1, stroke$1, wye$1, triangleLeft, triangleRight, triangleUp, triangleDown, arrow2Left$1, arrow2Right$1, arrow2Up$1, arrow2Down$1, rect$1, lineV$1, lineH$1, close$1];
15933
+ var builtinSymbols = [circle$1, cross$1, diamond$1, square$1, thinTriangle$1, triangle, star$1, arrow$1, wedge$1, stroke$1, wye$1, triangleLeft, triangleRight, triangleUp, triangleDown, arrow2Left$1, arrow2Right$1, arrow2Up$1, arrow2Down$1, rect, lineV$1, lineH$1, close$1];
15929
15934
  var builtinSymbolsMap = {};
15930
15935
  builtinSymbols.forEach(function (symbol) {
15931
15936
  builtinSymbolsMap[symbol.type] = symbol;
@@ -15933,7 +15938,6 @@
15933
15938
  var builtInSymbolStrMap = {
15934
15939
  arrowLeft: "M 0.25 -0.5 L -0.25 0 l 0.5 0.5",
15935
15940
  arrowRight: "M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",
15936
- rect: "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",
15937
15941
  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",
15938
15942
  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"
15939
15943
  };
@@ -18405,6 +18409,7 @@
18405
18409
  }, {
18406
18410
  key: "updateRectAABBBounds",
18407
18411
  value: function updateRectAABBBounds(attribute, rectTheme, aabbBounds, graphic) {
18412
+ if (!this._validCheck(attribute, rectTheme, aabbBounds, graphic)) return aabbBounds;
18408
18413
  if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
18409
18414
  var _attribute$width = attribute.width,
18410
18415
  width = _attribute$width === void 0 ? rectTheme.width : _attribute$width,
@@ -18438,13 +18443,14 @@
18438
18443
  }, {
18439
18444
  key: "updateGlyphAABBBounds",
18440
18445
  value: function updateGlyphAABBBounds(attribute, theme, aabbBounds, graphic) {
18441
- return graphic.getSubGraphic().forEach(function (node) {
18446
+ return this._validCheck(attribute, theme, aabbBounds, graphic) ? (graphic.getSubGraphic().forEach(function (node) {
18442
18447
  aabbBounds.union(node.AABBBounds);
18443
- }), aabbBounds;
18448
+ }), aabbBounds) : aabbBounds;
18444
18449
  }
18445
18450
  }, {
18446
18451
  key: "updateRichTextAABBBounds",
18447
18452
  value: function updateRichTextAABBBounds(attribute, richtextTheme, aabbBounds, graphic) {
18453
+ if (!this._validCheck(attribute, richtextTheme, aabbBounds, graphic)) return aabbBounds;
18448
18454
  if (!graphic) return aabbBounds;
18449
18455
  var _attribute$width2 = attribute.width,
18450
18456
  width = _attribute$width2 === void 0 ? richtextTheme.width : _attribute$width2,
@@ -18497,6 +18503,7 @@
18497
18503
  }, {
18498
18504
  key: "updateTextAABBBounds",
18499
18505
  value: function updateTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
18506
+ if (!this._validCheck(attribute, textTheme, aabbBounds, graphic)) return aabbBounds;
18500
18507
  if (!graphic) return aabbBounds;
18501
18508
  var _graphic$attribute$te = graphic.attribute.text,
18502
18509
  text = _graphic$attribute$te === void 0 ? textTheme.text : _graphic$attribute$te;
@@ -18521,6 +18528,7 @@
18521
18528
  }, {
18522
18529
  key: "updatePathAABBBounds",
18523
18530
  value: function updatePathAABBBounds(attribute, pathTheme, aabbBounds, graphic) {
18531
+ if (!this._validCheck(attribute, pathTheme, aabbBounds, graphic)) return aabbBounds;
18524
18532
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic);
18525
18533
  var tb1 = this.tempAABBBounds1,
18526
18534
  tb2 = this.tempAABBBounds2;
@@ -18572,6 +18580,7 @@
18572
18580
  }, {
18573
18581
  key: "updatePolygonAABBBounds",
18574
18582
  value: function updatePolygonAABBBounds(attribute, polygonTheme, aabbBounds, graphic) {
18583
+ if (!this._validCheck(attribute, polygonTheme, aabbBounds, graphic)) return aabbBounds;
18575
18584
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds, graphic);
18576
18585
  var tb1 = this.tempAABBBounds1,
18577
18586
  tb2 = this.tempAABBBounds2;
@@ -18592,6 +18601,7 @@
18592
18601
  }, {
18593
18602
  key: "updateLineAABBBounds",
18594
18603
  value: function updateLineAABBBounds(attribute, lineTheme, aabbBounds, graphic) {
18604
+ if (!this._validCheck(attribute, lineTheme, aabbBounds, graphic)) return aabbBounds;
18595
18605
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic));
18596
18606
  var tb1 = this.tempAABBBounds1,
18597
18607
  tb2 = this.tempAABBBounds2;
@@ -18625,6 +18635,7 @@
18625
18635
  }, {
18626
18636
  key: "updateAreaAABBBounds",
18627
18637
  value: function updateAreaAABBBounds(attribute, areaTheme, aabbBounds, graphic) {
18638
+ if (!this._validCheck(attribute, areaTheme, aabbBounds, graphic)) return aabbBounds;
18628
18639
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic));
18629
18640
  var tb1 = this.tempAABBBounds1,
18630
18641
  tb2 = this.tempAABBBounds2;
@@ -18660,6 +18671,7 @@
18660
18671
  }, {
18661
18672
  key: "updateCircleAABBBounds",
18662
18673
  value: function updateCircleAABBBounds(attribute, circleTheme, aabbBounds, full, graphic) {
18674
+ if (!this._validCheck(attribute, circleTheme, aabbBounds, graphic)) return aabbBounds;
18663
18675
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds, graphic) : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds, graphic));
18664
18676
  var tb1 = this.tempAABBBounds1,
18665
18677
  tb2 = this.tempAABBBounds2;
@@ -18688,6 +18700,7 @@
18688
18700
  }, {
18689
18701
  key: "updateArcAABBBounds",
18690
18702
  value: function updateArcAABBBounds(attribute, arcTheme, aabbBounds, full, graphic) {
18703
+ if (!this._validCheck(attribute, arcTheme, aabbBounds, graphic)) return aabbBounds;
18691
18704
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) : this.updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic));
18692
18705
  var tb1 = this.tempAABBBounds1,
18693
18706
  tb2 = this.tempAABBBounds2;
@@ -18729,6 +18742,7 @@
18729
18742
  }, {
18730
18743
  key: "updateSymbolAABBBounds",
18731
18744
  value: function updateSymbolAABBBounds(attribute, symbolTheme, aabbBounds, full, graphic) {
18745
+ if (!this._validCheck(attribute, symbolTheme, aabbBounds, graphic)) return aabbBounds;
18732
18746
  this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds, graphic) : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds, graphic));
18733
18747
  var tb1 = this.tempAABBBounds1,
18734
18748
  tb2 = this.tempAABBBounds2;
@@ -18761,6 +18775,7 @@
18761
18775
  }, {
18762
18776
  key: "updateImageAABBBounds",
18763
18777
  value: function updateImageAABBBounds(attribute, imageTheme, aabbBounds, graphic) {
18778
+ if (!this._validCheck(attribute, imageTheme, aabbBounds, graphic)) return aabbBounds;
18764
18779
  if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
18765
18780
  var _attribute$width3 = attribute.width,
18766
18781
  width = _attribute$width3 === void 0 ? imageTheme.width : _attribute$width3,
@@ -18807,6 +18822,15 @@
18807
18822
  }
18808
18823
  this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix);
18809
18824
  }
18825
+ }, {
18826
+ key: "_validCheck",
18827
+ value: function _validCheck(attribute, theme, aabbBounds, graphic) {
18828
+ if (!graphic) return !0;
18829
+ if (!graphic.valid) return aabbBounds.clear(), !1;
18830
+ var _attribute$visible = attribute.visible,
18831
+ visible = _attribute$visible === void 0 ? theme.visible : _attribute$visible;
18832
+ return !!visible || (aabbBounds.clear(), !1);
18833
+ }
18810
18834
  }]);
18811
18835
  return DefaultGraphicService;
18812
18836
  }();
@@ -34642,7 +34666,7 @@
34642
34666
 
34643
34667
  var roughModule = _roughModule;
34644
34668
 
34645
- const version = "0.16.15";
34669
+ const version = "0.16.17-alpha.1";
34646
34670
  loadAllModule(container);
34647
34671
 
34648
34672
  exports.ACustomAnimate = ACustomAnimate;