@visactor/react-vchart 2.0.23-alpha.2 → 2.0.23-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.
package/build/index.js CHANGED
@@ -51954,7 +51954,8 @@
51954
51954
  this._option.layout = layout, null === (_a = this._chart) || void 0 === _a || _a.setLayout(layout);
51955
51955
  }
51956
51956
  reLayout() {
51957
- this._chart && this._compiler && !this._isReleased && (this._chart.resetLayoutItemTag(), this._chart.setLayoutTag(!0, null, !1), this._compiler.render(), this._chart.onEvaluateEnd());
51957
+ var _a, _b, _c;
51958
+ null === (_a = this._chart) || void 0 === _a || _a.resetLayoutItemTag(), null === (_b = this._chart) || void 0 === _b || _b.setLayoutTag(!0, null, !1), null === (_c = this._compiler) || void 0 === _c || _c.render();
51958
51959
  }
51959
51960
  getCompiler() {
51960
51961
  return this._compiler;
@@ -60578,44 +60579,29 @@
60578
60579
  visible: this._getInvalidDefined.bind(this)
60579
60580
  }, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series));
60580
60581
  }
60581
- _updateSymbolGraphicPosition() {
60582
- var _a;
60583
- const graphics = null === (_a = this._symbolMark) || void 0 === _a ? void 0 : _a.getGraphics();
60584
- graphics && graphics.length && graphics.forEach(graphicItem => {
60585
- var _a, _b;
60586
- const datum = null === (_b = null === (_a = null == graphicItem ? void 0 : graphicItem.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0],
60587
- newPosition = this.dataToPosition(datum);
60588
- newPosition && graphicItem && graphicItem.setAttributes({
60589
- x: newPosition.x,
60590
- y: newPosition.y
60582
+ handleZoom(e) {
60583
+ var _a, _b, _c, _d;
60584
+ this.getMarksWithoutRoot().forEach(mark => {
60585
+ if (!mark) return;
60586
+ const graphics = mark.getGraphics();
60587
+ graphics && graphics.length && graphics.forEach((graphicItem, i) => {
60588
+ var _a, _b;
60589
+ const datum = null === (_b = null === (_a = null == graphicItem ? void 0 : graphicItem.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0],
60590
+ newPosition = this.dataToPosition(datum);
60591
+ newPosition && graphicItem && graphicItem.translateTo(newPosition.x, newPosition.y);
60591
60592
  });
60592
60593
  });
60593
- }
60594
- _ensureLabelGraphicPostMatrix() {
60595
- var _a, _b;
60596
- const labelGraphic = null === (_b = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent()) || void 0 === _b ? void 0 : _b.getComponent();
60597
- return labelGraphic && !labelGraphic.attribute.postMatrix && labelGraphic.setAttributes({
60594
+ const labelComponent = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
60595
+ (null == labelComponent ? void 0 : labelComponent.renderInner) && labelComponent.renderInner();
60596
+ const vgrammarLabel = null === (_b = null == labelComponent ? void 0 : labelComponent.getComponent) || void 0 === _b ? void 0 : _b.call(labelComponent);
60597
+ (null == vgrammarLabel ? void 0 : vgrammarLabel.evaluate) && vgrammarLabel.evaluate(null, null);
60598
+ const labelGroup = null === (_c = null == labelComponent ? void 0 : labelComponent.getProduct) || void 0 === _c ? void 0 : _c.call(labelComponent);
60599
+ labelGroup && (null == e ? void 0 : e.scale) && (null == e ? void 0 : e.scaleCenter) && ((null === (_d = labelGroup.attribute) || void 0 === _d ? void 0 : _d.postMatrix) || labelGroup.setAttributes({
60598
60600
  postMatrix: new Matrix()
60599
- }), labelGraphic;
60600
- }
60601
- handleZoom(e) {
60602
- const {
60603
- scale: scale,
60604
- scaleCenter: scaleCenter
60605
- } = e;
60606
- if (1 === scale) return;
60607
- this._updateSymbolGraphicPosition();
60608
- const labelGraphic = this._ensureLabelGraphicPostMatrix();
60609
- labelGraphic && labelGraphic.scale(scale, scale, scaleCenter);
60601
+ }), labelGroup.scale(e.scale, e.scale, e.scaleCenter));
60610
60602
  }
60611
60603
  handlePan(e) {
60612
- const {
60613
- delta: delta
60614
- } = e;
60615
- if (0 === (null == delta ? void 0 : delta[0]) && 0 === (null == delta ? void 0 : delta[1])) return;
60616
- this._updateSymbolGraphicPosition();
60617
- const labelGraphic = this._ensureLabelGraphicPostMatrix();
60618
- labelGraphic && labelGraphic.translate(delta[0], delta[1]);
60604
+ this.handleZoom(e);
60619
60605
  }
60620
60606
  getDefaultShapeType() {
60621
60607
  return "circle";
@@ -61639,7 +61625,7 @@
61639
61625
  super.release(), this._areaCache.clear(), this._nameMap = {}, this._mapViewData = null;
61640
61626
  }
61641
61627
  handleZoom(e) {
61642
- var _a;
61628
+ var _a, _b, _c, _d;
61643
61629
  const {
61644
61630
  scale: scale,
61645
61631
  scaleCenter: scaleCenter
@@ -61649,11 +61635,17 @@
61649
61635
  pathGroup && (pathGroup.attribute.postMatrix || pathGroup.setAttributes({
61650
61636
  postMatrix: new Matrix()
61651
61637
  }), pathGroup.scale(scale, scale, scaleCenter));
61652
- const vgrammarLabel = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
61653
- vgrammarLabel && vgrammarLabel.renderInner();
61638
+ const labelComponent = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
61639
+ (null == labelComponent ? void 0 : labelComponent.renderInner) && labelComponent.renderInner();
61640
+ const vgrammarLabel = null === (_b = null == labelComponent ? void 0 : labelComponent.getComponent) || void 0 === _b ? void 0 : _b.call(labelComponent);
61641
+ (null == vgrammarLabel ? void 0 : vgrammarLabel.evaluate) && vgrammarLabel.evaluate(null, null);
61642
+ const labelGroup = null === (_c = null == labelComponent ? void 0 : labelComponent.getProduct) || void 0 === _c ? void 0 : _c.call(labelComponent);
61643
+ labelGroup && scale && scaleCenter && ((null === (_d = labelGroup.attribute) || void 0 === _d ? void 0 : _d.postMatrix) || labelGroup.setAttributes({
61644
+ postMatrix: new Matrix()
61645
+ }), labelGroup.scale(scale, scale, scaleCenter));
61654
61646
  }
61655
61647
  handlePan(e) {
61656
- var _a;
61648
+ var _a, _b, _c, _d;
61657
61649
  const {
61658
61650
  delta: delta
61659
61651
  } = e;
@@ -61662,8 +61654,14 @@
61662
61654
  pathGroup && (pathGroup.attribute.postMatrix || pathGroup.setAttributes({
61663
61655
  postMatrix: new Matrix()
61664
61656
  }), pathGroup.translate(delta[0], delta[1]));
61665
- const vgrammarLabel = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
61666
- vgrammarLabel && vgrammarLabel.renderInner();
61657
+ const labelComponent = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
61658
+ (null == labelComponent ? void 0 : labelComponent.renderInner) && labelComponent.renderInner();
61659
+ const vgrammarLabel = null === (_b = null == labelComponent ? void 0 : labelComponent.getComponent) || void 0 === _b ? void 0 : _b.call(labelComponent);
61660
+ (null == vgrammarLabel ? void 0 : vgrammarLabel.evaluate) && vgrammarLabel.evaluate(null, null);
61661
+ const labelGroup = null === (_c = null == labelComponent ? void 0 : labelComponent.getProduct) || void 0 === _c ? void 0 : _c.call(labelComponent);
61662
+ labelGroup && delta && ((null === (_d = labelGroup.attribute) || void 0 === _d ? void 0 : _d.postMatrix) || labelGroup.setAttributes({
61663
+ postMatrix: new Matrix()
61664
+ }), labelGroup.translate(delta[0], delta[1]));
61667
61665
  }
61668
61666
  getDatumCenter(datum) {
61669
61667
  var _a, _b, _c, _d;
@@ -77159,7 +77157,7 @@
77159
77157
  return [this._legendComponent];
77160
77158
  }
77161
77159
  clear() {
77162
- super.clear(), this._cacheAttrs = null, this._preSelectedData = null;
77160
+ super.clear(), this._legendComponent = null, this._cacheAttrs = null, this._preSelectedData = null;
77163
77161
  }
77164
77162
  }
77165
77163
  BaseLegend.specKey = "legends";