@visactor/vrender 0.18.14 → 0.18.16

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,4 +1,4 @@
1
1
  import '@visactor/vrender-core';
2
- export declare const version = "0.18.14";
2
+ export declare const version = "0.18.16";
3
3
  export * from '@visactor/vrender-core';
4
4
  export * from '@visactor/vrender-kits';
package/cjs/index.js CHANGED
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
21
21
 
22
22
  const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
23
23
 
24
- exports.version = "0.18.14", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
24
+ exports.version = "0.18.16", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
25
25
  vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
26
26
  vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
27
27
  (0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.18.14\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA8F;AAC9F,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AACnB,yDAAuC;AACvC,yDAAuC","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport { container, isBrowserEnv, isNodeEnv, preLoadAllModule } from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"0.18.16\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\n"]}
package/dist/index.js CHANGED
@@ -5100,6 +5100,8 @@
5100
5100
  pickStrokeBuffer: 0
5101
5101
  };
5102
5102
  var DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
5103
+ forceBoundsWidth: void 0,
5104
+ forceBoundsHeight: void 0,
5103
5105
  opacity: 1,
5104
5106
  background: null,
5105
5107
  backgroundOpacity: 1,
@@ -5126,6 +5128,7 @@
5126
5128
  };
5127
5129
  var DefaultAttribute = Object.assign(Object.assign(Object.assign({
5128
5130
  strokeSeg: null,
5131
+ renderable: !0,
5129
5132
  pickable: !0,
5130
5133
  childrenPickable: !0,
5131
5134
  fillPickable: !0,
@@ -6591,7 +6594,6 @@
6591
6594
  symbol: DefaultSymbolAttribute,
6592
6595
  text: DefaultTextAttribute,
6593
6596
  rect: DefaultRectAttribute,
6594
- rect3d: DefaultRect3dAttribute,
6595
6597
  polygon: DefaultPolygonAttribute,
6596
6598
  richtext: DefaultRichTextAttribute,
6597
6599
  richtextIcon: DefaultRichTextIconAttribute,
@@ -6610,7 +6612,6 @@
6610
6612
  symbol: Object.assign({}, defaultThemeObj.symbol),
6611
6613
  text: Object.assign({}, defaultThemeObj.text),
6612
6614
  rect: Object.assign({}, defaultThemeObj.rect),
6613
- rect3d: Object.assign({}, defaultThemeObj.rect3d),
6614
6615
  polygon: Object.assign({}, defaultThemeObj.polygon),
6615
6616
  richtext: Object.assign({}, defaultThemeObj.richtext),
6616
6617
  richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),
@@ -13237,7 +13238,7 @@
13237
13238
  }
13238
13239
  function drawPathProxy(graphic, context, x, y, drawContext, params, fillCb, strokeCb) {
13239
13240
  if (!graphic.pathProxy) return !1;
13240
- var themeAttributes = getTheme(graphic, null == params ? void 0 : params.theme)[graphic.type],
13241
+ var themeAttributes = getTheme(graphic, null == params ? void 0 : params.theme)[graphic.type.replace("3d", "")],
13241
13242
  _graphic$attribute = graphic.attribute,
13242
13243
  _graphic$attribute$fi = _graphic$attribute.fill,
13243
13244
  fill = _graphic$attribute$fi === void 0 ? themeAttributes.fill : _graphic$attribute$fi,
@@ -15528,7 +15529,7 @@
15528
15529
  vertices: [],
15529
15530
  edges: []
15530
15531
  },
15531
- rectTheme = getTheme(this).rect3d,
15532
+ rectTheme = getTheme(this).rect,
15532
15533
  _this$attribute = this.attribute,
15533
15534
  x1 = _this$attribute.x1,
15534
15535
  y1 = _this$attribute.y1,
@@ -17720,6 +17721,22 @@
17720
17721
  aabbBounds.union(node.AABBBounds);
17721
17722
  }), aabbBounds) : aabbBounds;
17722
17723
  }
17724
+ }, {
17725
+ key: "updateHTMLTextAABBBounds",
17726
+ value: function updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
17727
+ var textAlign = attribute.textAlign,
17728
+ textBaseline = attribute.textBaseline;
17729
+ if (null != attribute.forceBoundsHeight) {
17730
+ var h = isNumber$1(attribute.forceBoundsHeight) ? attribute.forceBoundsHeight : attribute.forceBoundsHeight(),
17731
+ dy = textLayoutOffsetY(textBaseline, h, h);
17732
+ aabbBounds.set(aabbBounds.x1, dy, aabbBounds.x2, dy + h);
17733
+ }
17734
+ if (null != attribute.forceBoundsWidth) {
17735
+ var w = isNumber$1(attribute.forceBoundsWidth) ? attribute.forceBoundsWidth : attribute.forceBoundsWidth(),
17736
+ dx = textDrawOffsetX(textAlign, w);
17737
+ aabbBounds.set(dx, aabbBounds.y1, dx + w, aabbBounds.y2);
17738
+ }
17739
+ }
17723
17740
  }, {
17724
17741
  key: "updateRichTextAABBBounds",
17725
17742
  value: function updateRichTextAABBBounds(attribute, richtextTheme, aabbBounds, graphic) {
@@ -17771,7 +17788,7 @@
17771
17788
  aabbBounds.translate(deltaX, deltaY);
17772
17789
  var tb1 = this.tempAABBBounds1,
17773
17790
  tb2 = this.tempAABBBounds2;
17774
- return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, graphic), aabbBounds;
17791
+ return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || this.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), this.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, graphic), aabbBounds;
17775
17792
  }
17776
17793
  }, {
17777
17794
  key: "updateTextAABBBounds",
@@ -17796,7 +17813,7 @@
17796
17813
  var shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
17797
17814
  boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
17798
17815
  }
17799
- return this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix), aabbBounds;
17816
+ return this.combindShadowAABBBounds(aabbBounds, graphic), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || this.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix), aabbBounds;
17800
17817
  }
17801
17818
  }, {
17802
17819
  key: "updatePathAABBBounds",
@@ -18120,6 +18137,7 @@
18120
18137
  key: "_validCheck",
18121
18138
  value: function _validCheck(attribute, theme, aabbBounds, graphic) {
18122
18139
  if (!graphic) return !0;
18140
+ if (null != attribute.forceBoundsHeight || null != attribute.forceBoundsWidth) return !0;
18123
18141
  if (!graphic.valid) return aabbBounds.clear(), !1;
18124
18142
  var _attribute$visible = attribute.visible,
18125
18143
  visible = _attribute$visible === void 0 ? theme.visible : _attribute$visible;
@@ -18312,6 +18330,8 @@
18312
18330
  value: function _draw(graphic, defaultAttr, computed3dMatrix, drawContext, params) {
18313
18331
  var context = drawContext.context;
18314
18332
  if (!context) return;
18333
+ var renderable = graphic.attribute.renderable;
18334
+ if (!1 === renderable) return;
18315
18335
  context.highPerformanceSave();
18316
18336
  var data = this.transform(graphic, defaultAttr, context, computed3dMatrix),
18317
18337
  x = data.x,
@@ -25785,7 +25805,7 @@
25785
25805
  key: "drawShape",
25786
25806
  value: function drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
25787
25807
  var _a;
25788
- var rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect3d,
25808
+ var rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect,
25789
25809
  _rect$attribute = rect.attribute,
25790
25810
  _rect$attribute$fill = _rect$attribute.fill,
25791
25811
  fill = _rect$attribute$fill === void 0 ? rectAttribute.fill : _rect$attribute$fill,
@@ -34930,7 +34950,7 @@
34930
34950
 
34931
34951
  var roughModule = _roughModule;
34932
34952
 
34933
- const version = "0.18.14";
34953
+ const version = "0.18.16";
34934
34954
  preLoadAllModule();
34935
34955
  if (isBrowserEnv()) {
34936
34956
  loadBrowserEnv(container);