@visactor/react-vchart 2.0.20-alpha.1 → 2.0.20-alpha.2

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
@@ -47252,11 +47252,24 @@
47252
47252
  updateLayoutTag() {
47253
47253
  this._layoutState = LayoutState.before;
47254
47254
  }
47255
+ _isGeoRegionRoamDragEnabled() {
47256
+ var _a, _b;
47257
+ const chartSpec = null === (_b = null === (_a = this._compileChart) || void 0 === _a ? void 0 : _a.getSpec) || void 0 === _b ? void 0 : _b.call(_a),
47258
+ regions = null == chartSpec ? void 0 : chartSpec.region;
47259
+ return !!isArray$1(regions) && regions.some(region => {
47260
+ var _a;
47261
+ return !("geo" !== (null == region ? void 0 : region.coordinate) || !region.roam) && (!0 === region.roam || null === (_a = region.roam.drag) || void 0 === _a || _a);
47262
+ });
47263
+ }
47264
+ _shouldDisableCanvasTouchAction() {
47265
+ if (!isTrueBrowser(this._option.mode)) return !1;
47266
+ return !1 === (isValid$1(this._option.supportsTouchEvents) ? this._option.supportsTouchEvents : vglobal.supportsTouchEvents) && this._isGeoRegionRoamDragEnabled();
47267
+ }
47255
47268
  _setCanvasStyle() {
47256
47269
  if (this._stage && this._container.dom && !isString$1(this._container.dom)) {
47257
47270
  this._container.dom.style.display = "block", this._container.dom.style.position = "relative";
47258
47271
  const canvas = this.getCanvas();
47259
- canvas && (canvas.style.display = "block");
47272
+ canvas && (canvas.style.display = "block", canvas.style.touchAction = this._shouldDisableCanvasTouchAction() ? "none" : "");
47260
47273
  }
47261
47274
  }
47262
47275
  compile(ctx, option) {
@@ -47264,7 +47277,7 @@
47264
47277
  const {
47265
47278
  chart: chart
47266
47279
  } = ctx;
47267
- this._compileChart = chart, this.initView(), this._stage && ("render" !== (null == option ? void 0 : option.actionSource) && this._cachedMarks && (this.reuseOrMorphing(option.morphConfig), this._cachedMarks = null), chart.compile(), chart.afterCompile());
47280
+ this._compileChart = chart, this.initView(), this._stage && ("render" !== (null == option ? void 0 : option.actionSource) && this._cachedMarks && (this.reuseOrMorphing(option.morphConfig), this._cachedMarks = null), chart.compile(), this._setCanvasStyle(), chart.afterCompile());
47268
47281
  }
47269
47282
  clearNextRender() {
47270
47283
  return !!this._nextRafId && (vglobal.getSpecifiedCancelAnimationFrame(10)(this._nextRafId), this._nextRafId = null, !0);
@@ -49153,9 +49166,6 @@
49153
49166
  });
49154
49167
  });
49155
49168
  }
49156
- clearAllStateInfo() {
49157
- this._stateInfoList = [];
49158
- }
49159
49169
  _isMultiMark() {
49160
49170
  return !this._mark || isMultiDatumMark(this._mark.type);
49161
49171
  }
@@ -49858,9 +49868,7 @@
49858
49868
  this._lastMark = mark;
49859
49869
  }
49860
49870
  reuse(mark) {
49861
- this.type === mark.type && (this._product = mark.getProduct(), this._product.clearStates(), this._graphics = mark.getGraphics(), this._graphics.forEach(g => {
49862
- g.clearStates();
49863
- }), this._graphicMap = mark._graphicMap, this._graphicMap.forEach(g => {
49871
+ this.type === mark.type && (this._product = mark.getProduct(), this._graphics = mark.getGraphics(), this._graphicMap = mark._graphicMap, this._graphicMap.forEach(g => {
49864
49872
  g.context = Object.assign(Object.assign({}, g.context), this._getCommonContext());
49865
49873
  }), this._dataByKey = mark._dataByKey, this._prevDataByKey = mark._prevDataByKey, this.needClear = mark.needClear);
49866
49874
  }
@@ -50306,11 +50314,6 @@
50306
50314
  runAnimation() {
50307
50315
  this._runStateAnimation(this.getGraphics());
50308
50316
  }
50309
- clearBeforeReInit() {
50310
- this.state.clearAllStateInfo(), this.uncommit(), this.stateStyle = {}, this.getGraphics().forEach(g => {
50311
- g.clearStates();
50312
- });
50313
- }
50314
50317
  }
50315
50318
 
50316
50319
  class GroupMark extends BaseMark {
@@ -53042,7 +53045,7 @@
53042
53045
  super.reInit(spec);
53043
53046
  const marks = this.getMarksWithoutRoot();
53044
53047
  marks.forEach(mark => {
53045
- mark.clearBeforeReInit(), this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
53048
+ this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
53046
53049
  }), this.initMarkStyle(), marks.forEach(mark => {
53047
53050
  mark.commit(!1);
53048
53051
  }), this._updateExtensionMarkSpec(), this._updateSpecData(), this._tooltipHelper && this._tooltipHelper.updateTooltipSpec();