@visactor/vtable 1.11.6-alpha.7 → 1.11.6-alpha.8

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.
@@ -43,7 +43,7 @@ class BaseTable extends EventTarget_1.EventTarget {
43
43
  }
44
44
  constructor(container, options = {}) {
45
45
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
46
- if (super(), this.showFrozenIcon = !0, this.version = "1.11.6-alpha.7", this.id = `VTable${Date.now()}`,
46
+ if (super(), this.showFrozenIcon = !0, this.version = "1.11.6-alpha.8", this.id = `VTable${Date.now()}`,
47
47
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
48
48
  !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
49
49
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vrender_1.vglobal.isImageAnonymous = !1);
@@ -1620,8 +1620,11 @@ class BaseTable extends EventTarget_1.EventTarget {
1620
1620
  this.render();
1621
1621
  const stage = this.scenegraph.stage;
1622
1622
  if (stage) {
1623
- const contentWidth = this.tableX + this.getAllColsWidth(), contentHeight = this.tableY + this.getAllRowsHeight();
1624
- if (contentWidth >= this.canvasWidth && contentHeight >= this.canvasHeight) {
1623
+ let contentWidth = this.tableX + this.getAllColsWidth(), contentHeight = this.tableY + this.getAllRowsHeight();
1624
+ if (this.internalProps.legends && this.internalProps.legends.forEach((legend => {
1625
+ "right" === legend.orient ? contentWidth = Math.max(contentWidth, legend.legendComponent.globalAABBBounds.x2) : "bottom" === legend.orient && (contentHeight = Math.max(contentHeight, legend.legendComponent.globalAABBBounds.y2));
1626
+ })), this.internalProps.title && ("right" === this.internalProps.title._titleOption.orient ? contentWidth = Math.max(contentWidth, this.internalProps.title.getComponentGraphic().globalAABBBounds.x2) : "bottom" === this.internalProps.title._titleOption.orient && (contentHeight = Math.max(contentHeight, this.internalProps.title.getComponentGraphic().globalAABBBounds.y2))),
1627
+ contentWidth >= this.canvasWidth && contentHeight >= this.canvasHeight) {
1625
1628
  stage.render();
1626
1629
  return stage.window.getImageBuffer(type);
1627
1630
  }