@visactor/react-vchart 2.0.23-alpha.3 → 2.0.23-alpha.4

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,8 +51954,7 @@
51954
51954
  this._option.layout = layout, null === (_a = this._chart) || void 0 === _a || _a.setLayout(layout);
51955
51955
  }
51956
51956
  reLayout() {
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();
51957
+ this._chart && this._compiler && !this._isReleased && (this._chart.resetLayoutItemTag(), this._chart.setLayoutTag(!0, null, !1), this._compiler.render(), this._chart.onEvaluateEnd());
51959
51958
  }
51960
51959
  getCompiler() {
51961
51960
  return this._compiler;
@@ -60579,29 +60578,54 @@
60579
60578
  visible: this._getInvalidDefined.bind(this)
60580
60579
  }, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series));
60581
60580
  }
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);
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
60592
60591
  });
60593
60592
  });
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({
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({
60600
60598
  postMatrix: new Matrix()
60601
- }), labelGroup.scale(e.scale, e.scale, e.scaleCenter));
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);
60602
60610
  }
60603
60611
  handlePan(e) {
60604
- this.handleZoom(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]);
60619
+ }
60620
+ onLayoutEnd() {
60621
+ var _a, _b, _c;
60622
+ super.onLayoutEnd(), this._updateSymbolGraphicPosition();
60623
+ const labelGraphic = null === (_b = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent()) || void 0 === _b ? void 0 : _b.getComponent();
60624
+ (null == labelGraphic ? void 0 : labelGraphic.attribute.postMatrix) && labelGraphic.setAttributes({
60625
+ postMatrix: new Matrix()
60626
+ });
60627
+ const vgrammarLabel = null === (_c = this._labelMark) || void 0 === _c ? void 0 : _c.getComponent();
60628
+ vgrammarLabel && vgrammarLabel.renderInner();
60605
60629
  }
60606
60630
  getDefaultShapeType() {
60607
60631
  return "circle";
@@ -61625,7 +61649,7 @@
61625
61649
  super.release(), this._areaCache.clear(), this._nameMap = {}, this._mapViewData = null;
61626
61650
  }
61627
61651
  handleZoom(e) {
61628
- var _a, _b, _c, _d;
61652
+ var _a;
61629
61653
  const {
61630
61654
  scale: scale,
61631
61655
  scaleCenter: scaleCenter
@@ -61635,17 +61659,11 @@
61635
61659
  pathGroup && (pathGroup.attribute.postMatrix || pathGroup.setAttributes({
61636
61660
  postMatrix: new Matrix()
61637
61661
  }), pathGroup.scale(scale, scale, scaleCenter));
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));
61662
+ const vgrammarLabel = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
61663
+ vgrammarLabel && vgrammarLabel.renderInner();
61646
61664
  }
61647
61665
  handlePan(e) {
61648
- var _a, _b, _c, _d;
61666
+ var _a;
61649
61667
  const {
61650
61668
  delta: delta
61651
61669
  } = e;
@@ -61654,14 +61672,8 @@
61654
61672
  pathGroup && (pathGroup.attribute.postMatrix || pathGroup.setAttributes({
61655
61673
  postMatrix: new Matrix()
61656
61674
  }), pathGroup.translate(delta[0], delta[1]));
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]));
61675
+ const vgrammarLabel = null === (_a = this._labelMark) || void 0 === _a ? void 0 : _a.getComponent();
61676
+ vgrammarLabel && vgrammarLabel.renderInner();
61665
61677
  }
61666
61678
  getDatumCenter(datum) {
61667
61679
  var _a, _b, _c, _d;
@@ -77157,7 +77169,7 @@
77157
77169
  return [this._legendComponent];
77158
77170
  }
77159
77171
  clear() {
77160
- super.clear(), this._legendComponent = null, this._cacheAttrs = null, this._preSelectedData = null;
77172
+ super.clear(), this._cacheAttrs = null, this._preSelectedData = null;
77161
77173
  }
77162
77174
  }
77163
77175
  BaseLegend.specKey = "legends";