@visactor/vchart 2.0.23-alpha.4 → 2.0.23-alpha.5

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.es.js CHANGED
@@ -74007,6 +74007,10 @@ class ScatterSeries extends CartesianSeries {
74007
74007
  if (this._symbolMark.getProduct()) {
74008
74008
  this._symbolMark.compileEncode();
74009
74009
  }
74010
+ if (this._isGeoCoordinateSeries()) {
74011
+ this._updateSymbolGraphicPosition();
74012
+ this._refreshLabelComponent(true, true);
74013
+ }
74010
74014
  }
74011
74015
  initLabelMarkStyle(labelMark) {
74012
74016
  if (!labelMark) {
@@ -74054,6 +74058,38 @@ class ScatterSeries extends CartesianSeries {
74054
74058
  }
74055
74059
  return labelGraphic;
74056
74060
  }
74061
+ _isGeoCoordinateSeries() {
74062
+ var _a, _b;
74063
+ return ((_b = (_a = this.getXAxisHelper()) === null || _a === void 0 ? void 0 : _a.getAxisType) === null || _b === void 0 ? void 0 : _b.call(_a)) === ComponentTypeEnum.geoCoordinate;
74064
+ }
74065
+ _refreshLabelComponent(resetPostMatrix = false, disableAnimation = false) {
74066
+ var _a, _b;
74067
+ const vgrammarLabel = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
74068
+ const labelGraphic = (_b = vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.getComponent) === null || _b === void 0 ? void 0 : _b.call(vgrammarLabel);
74069
+ if (resetPostMatrix) {
74070
+ if (labelGraphic === null || labelGraphic === void 0 ? void 0 : labelGraphic.attribute.postMatrix) {
74071
+ labelGraphic.setAttributes({
74072
+ postMatrix: new Matrix()
74073
+ });
74074
+ }
74075
+ }
74076
+ if (disableAnimation && (labelGraphic === null || labelGraphic === void 0 ? void 0 : labelGraphic.disableAnimation)) {
74077
+ labelGraphic.disableAnimation();
74078
+ if (!this._enableLabelAnimationHook) {
74079
+ this._enableLabelAnimationHook = () => {
74080
+ var _a, _b, _c, _d;
74081
+ const currentLabelGraphic = (_c = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getComponent) === null || _c === void 0 ? void 0 : _c.call(_b);
74082
+ (_d = currentLabelGraphic === null || currentLabelGraphic === void 0 ? void 0 : currentLabelGraphic.enableAnimation) === null || _d === void 0 ? void 0 : _d.call(currentLabelGraphic);
74083
+ this.event.off(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook);
74084
+ this._enableLabelAnimationHook = undefined;
74085
+ };
74086
+ this.event.on(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook);
74087
+ }
74088
+ }
74089
+ if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.getProduct()) {
74090
+ vgrammarLabel.renderInner();
74091
+ }
74092
+ }
74057
74093
  handleZoom(e) {
74058
74094
  const { scale, scaleCenter } = e;
74059
74095
  if (scale === 1) {
@@ -74077,7 +74113,7 @@ class ScatterSeries extends CartesianSeries {
74077
74113
  }
74078
74114
  }
74079
74115
  onLayoutEnd() {
74080
- var _a, _b, _c;
74116
+ var _a, _b;
74081
74117
  super.onLayoutEnd();
74082
74118
  this._updateSymbolGraphicPosition();
74083
74119
  const labelGraphic = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getComponent();
@@ -74086,10 +74122,7 @@ class ScatterSeries extends CartesianSeries {
74086
74122
  postMatrix: new Matrix()
74087
74123
  });
74088
74124
  }
74089
- const vgrammarLabel = (_c = this._labelMark) === null || _c === void 0 ? void 0 : _c.getComponent();
74090
- if (vgrammarLabel) {
74091
- vgrammarLabel.renderInner();
74092
- }
74125
+ this._refreshLabelComponent();
74093
74126
  }
74094
74127
  getDefaultShapeType() {
74095
74128
  return 'circle';
package/build/index.js CHANGED
@@ -74013,6 +74013,10 @@
74013
74013
  if (this._symbolMark.getProduct()) {
74014
74014
  this._symbolMark.compileEncode();
74015
74015
  }
74016
+ if (this._isGeoCoordinateSeries()) {
74017
+ this._updateSymbolGraphicPosition();
74018
+ this._refreshLabelComponent(true, true);
74019
+ }
74016
74020
  }
74017
74021
  initLabelMarkStyle(labelMark) {
74018
74022
  if (!labelMark) {
@@ -74060,6 +74064,38 @@
74060
74064
  }
74061
74065
  return labelGraphic;
74062
74066
  }
74067
+ _isGeoCoordinateSeries() {
74068
+ var _a, _b;
74069
+ return ((_b = (_a = this.getXAxisHelper()) === null || _a === void 0 ? void 0 : _a.getAxisType) === null || _b === void 0 ? void 0 : _b.call(_a)) === ComponentTypeEnum.geoCoordinate;
74070
+ }
74071
+ _refreshLabelComponent(resetPostMatrix = false, disableAnimation = false) {
74072
+ var _a, _b;
74073
+ const vgrammarLabel = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
74074
+ const labelGraphic = (_b = vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.getComponent) === null || _b === void 0 ? void 0 : _b.call(vgrammarLabel);
74075
+ if (resetPostMatrix) {
74076
+ if (labelGraphic === null || labelGraphic === void 0 ? void 0 : labelGraphic.attribute.postMatrix) {
74077
+ labelGraphic.setAttributes({
74078
+ postMatrix: new Matrix()
74079
+ });
74080
+ }
74081
+ }
74082
+ if (disableAnimation && (labelGraphic === null || labelGraphic === void 0 ? void 0 : labelGraphic.disableAnimation)) {
74083
+ labelGraphic.disableAnimation();
74084
+ if (!this._enableLabelAnimationHook) {
74085
+ this._enableLabelAnimationHook = () => {
74086
+ var _a, _b, _c, _d;
74087
+ const currentLabelGraphic = (_c = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getComponent) === null || _c === void 0 ? void 0 : _c.call(_b);
74088
+ (_d = currentLabelGraphic === null || currentLabelGraphic === void 0 ? void 0 : currentLabelGraphic.enableAnimation) === null || _d === void 0 ? void 0 : _d.call(currentLabelGraphic);
74089
+ this.event.off(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook);
74090
+ this._enableLabelAnimationHook = undefined;
74091
+ };
74092
+ this.event.on(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook);
74093
+ }
74094
+ }
74095
+ if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.getProduct()) {
74096
+ vgrammarLabel.renderInner();
74097
+ }
74098
+ }
74063
74099
  handleZoom(e) {
74064
74100
  const { scale, scaleCenter } = e;
74065
74101
  if (scale === 1) {
@@ -74083,7 +74119,7 @@
74083
74119
  }
74084
74120
  }
74085
74121
  onLayoutEnd() {
74086
- var _a, _b, _c;
74122
+ var _a, _b;
74087
74123
  super.onLayoutEnd();
74088
74124
  this._updateSymbolGraphicPosition();
74089
74125
  const labelGraphic = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getComponent();
@@ -74092,10 +74128,7 @@
74092
74128
  postMatrix: new Matrix()
74093
74129
  });
74094
74130
  }
74095
- const vgrammarLabel = (_c = this._labelMark) === null || _c === void 0 ? void 0 : _c.getComponent();
74096
- if (vgrammarLabel) {
74097
- vgrammarLabel.renderInner();
74098
- }
74131
+ this._refreshLabelComponent();
74099
74132
  }
74100
74133
  getDefaultShapeType() {
74101
74134
  return 'circle';