@visactor/vchart 2.0.1-alpha.5 → 2.0.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.es.js CHANGED
@@ -17747,9 +17747,10 @@ class Polygon extends Graphic {
17747
17747
  return super.needUpdateTag(key, POLYGON_UPDATE_TAG_KEY);
17748
17748
  }
17749
17749
  toCustomPath() {
17750
- const points = this.attribute.points,
17751
- path = new CustomPath2D();
17752
- return points.forEach((point, index) => {
17750
+ let path = super.toCustomPath();
17751
+ if (path) return path;
17752
+ const points = this.attribute.points;
17753
+ return path = new CustomPath2D(), points.forEach((point, index) => {
17753
17754
  0 === index ? path.moveTo(point.x, point.y) : path.lineTo(point.x, point.y);
17754
17755
  }), path.closePath(), path;
17755
17756
  }
@@ -21014,6 +21015,7 @@ let DefaultDrawContribution = class {
21014
21015
  drawContext.updateBounds ? this.useDirtyBounds = !0 : this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;
21015
21016
  }
21016
21017
  draw(renderService, drawContext) {
21018
+ var _a;
21017
21019
  this.prepareForDraw(renderService, drawContext), drawContext.drawContribution = this, this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap, this.currentRenderService = renderService;
21018
21020
  const {
21019
21021
  context: context,
@@ -21028,7 +21030,7 @@ let DefaultDrawContribution = class {
21028
21030
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
21029
21031
  }
21030
21032
  const d = context.dpr % 1;
21031
- (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), renderService.renderTreeRoots.sort((a, b) => {
21033
+ (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearScreen.call(renderService.drawParams), renderService.renderTreeRoots.sort((a, b) => {
21032
21034
  var _a, _b;
21033
21035
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
21034
21036
  }).forEach(group => {
@@ -21164,7 +21166,7 @@ let DefaultDrawContribution = class {
21164
21166
  return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
21165
21167
  }
21166
21168
  clearScreen(renderService, context, drawContext) {
21167
- var _a, _b;
21169
+ var _a, _b, _c;
21168
21170
  const {
21169
21171
  clear: clear,
21170
21172
  viewBox: viewBox
@@ -21172,9 +21174,9 @@ let DefaultDrawContribution = class {
21172
21174
  width = viewBox.width(),
21173
21175
  height = viewBox.height();
21174
21176
  if (clear) {
21175
- context.clearRect(0, 0, width, height);
21176
- const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
21177
- if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
21177
+ context.clearRect(0, 0, width, height), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearRect.call(renderService.drawParams);
21178
+ const stage = null === (_b = renderService.drawParams) || void 0 === _b ? void 0 : _b.stage;
21179
+ if (stage && (context.globalAlpha = null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1), stage && stage.backgroundImg && stage.resources) {
21178
21180
  const res = stage.resources.get(clear);
21179
21181
  res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
21180
21182
  } else context.fillStyle = createColor(context, clear, {
@@ -21702,13 +21704,19 @@ class Stage extends Group$1 {
21702
21704
  } else this._skipRender = 1;
21703
21705
  }, this.beforeRender = stage => {
21704
21706
  this._beforeRender && this._beforeRender(stage);
21707
+ }, this.afterClearScreen = drawParams => {
21708
+ this._afterClearScreen && this._afterClearScreen(drawParams);
21709
+ }, this.afterClearRect = drawParams => {
21710
+ this._afterClearRect && this._afterClearRect(drawParams);
21705
21711
  }, this.afterRender = stage => {
21706
21712
  this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
21707
21713
  }, this.afterTickCb = () => {
21708
21714
  this.tickedBeforeRender = !0, "rendering" !== this.state && this.renderNextFrame();
21709
21715
  }, this.params = params, this.theme = new Theme(), this.hooks = {
21710
21716
  beforeRender: new SyncHook(["stage"]),
21711
- afterRender: new SyncHook(["stage"])
21717
+ afterRender: new SyncHook(["stage"]),
21718
+ afterClearScreen: new SyncHook(["stage"]),
21719
+ afterClearRect: new SyncHook(["stage"])
21712
21720
  }, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.graphicService = container.get(GraphicService), this.pluginService.active(this, params), this.window.create({
21713
21721
  width: params.width,
21714
21722
  height: params.height,
@@ -21720,7 +21728,7 @@ class Stage extends Group$1 {
21720
21728
  canvas: params.canvas
21721
21729
  }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
21722
21730
  main: !0
21723
- })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
21731
+ })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
21724
21732
  tickRenderMode: "effect"
21725
21733
  }), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
21726
21734
  background: this._background
@@ -32642,7 +32650,10 @@ class AnimationStateManager {
32642
32650
  reApplyState(state) {
32643
32651
  var _a;
32644
32652
  const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
32645
- stateInfo && (stateInfo.executor.stop(), stateInfo.executor.execute(stateInfo.animationConfig));
32653
+ if (stateInfo) {
32654
+ const stateList = this.stateList.slice();
32655
+ stateInfo.executor.stop(), this.stateList = stateList, stateInfo.executor.execute(stateInfo.animationConfig);
32656
+ }
32646
32657
  }
32647
32658
  }
32648
32659
 
@@ -32680,10 +32691,12 @@ class GraphicStateExtension {
32680
32691
  }), this;
32681
32692
  }
32682
32693
  clearAnimationStates() {
32683
- return this._getAnimationStateManager(this).clearState(), this;
32694
+ const stateManager = this._animationStateManager;
32695
+ return stateManager && stateManager.clearState(), this;
32684
32696
  }
32685
32697
  reApplyAnimationState(state, deep = !1) {
32686
- return this._getAnimationStateManager(this).reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
32698
+ const stateManager = this._animationStateManager;
32699
+ return stateManager && stateManager.reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
32687
32700
  child.reApplyAnimationState(state, deep);
32688
32701
  }), this;
32689
32702
  }
@@ -36093,9 +36106,8 @@ class StreamLight extends ACustomAnimate {
36093
36106
  w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX),
36094
36107
  width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
36095
36108
  this.rect.setAttributes({
36096
- x: x,
36097
- width: width,
36098
- dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
36109
+ x: x + Math.min(parentAttr.x1 - parentAttr.x, 0),
36110
+ width: width
36099
36111
  }, !1, {
36100
36112
  type: AttributeUpdateType.ANIMATE_PLAY,
36101
36113
  animationState: {
@@ -36112,9 +36124,8 @@ class StreamLight extends ACustomAnimate {
36112
36124
  const h = Math.min(parentHeight - currentY, maxLength);
36113
36125
  let height;
36114
36126
  y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
36115
- y: y,
36116
- height: height,
36117
- dy: Math.min(parentAttr.y1 - parentAttr.y, 0)
36127
+ y: y + Math.min(parentAttr.y1 - parentAttr.y, 0),
36128
+ height: height
36118
36129
  }, !1, {
36119
36130
  type: AttributeUpdateType.ANIMATE_PLAY,
36120
36131
  animationState: {
@@ -50254,7 +50265,7 @@ class Compiler {
50254
50265
  return this._stage;
50255
50266
  }
50256
50267
  initView() {
50257
- var _a, _b, _c;
50268
+ var _a, _b, _c, _d;
50258
50269
  if (this._released) {
50259
50270
  return;
50260
50271
  }
@@ -50265,36 +50276,14 @@ class Compiler {
50265
50276
  const { autoRefreshDpr, dpr, mode, modeParams, gestureConfig, interactive, clickInterval, autoPreventDefault, background } = this._option;
50266
50277
  vglobal.setEnv(toRenderMode(mode), modeParams !== null && modeParams !== void 0 ? modeParams : {});
50267
50278
  this._stage =
50268
- (_a = this._option.stage) !== null && _a !== void 0 ? _a : new Stage({
50269
- background,
50270
- width: this._width,
50271
- height: this._height,
50272
- container: (_b = this._container.dom) !== null && _b !== void 0 ? _b : null,
50273
- canvas: (_c = this._container.canvas) !== null && _c !== void 0 ? _c : null,
50274
- dpr,
50275
- viewBox: this._option.viewBox,
50276
- canvasControled: this._option.canvasControled,
50277
- beforeRender: (stage) => {
50279
+ (_a = this._option.stage) !== null && _a !== void 0 ? _a : new Stage(Object.assign({ background, width: this._width, height: this._height, container: (_b = this._container.dom) !== null && _b !== void 0 ? _b : null, canvas: (_c = this._container.canvas) !== null && _c !== void 0 ? _c : null, dpr, viewBox: this._option.viewBox, canvasControled: this._option.canvasControled, beforeRender: (stage) => {
50278
50280
  var _a, _b, _c;
50279
50281
  (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.onBeforeRender();
50280
50282
  (_c = (_b = this._option).beforeRender) === null || _c === void 0 ? void 0 : _c.call(_b, stage);
50281
- },
50282
- afterRender: this._option.afterRender,
50283
- disableDirtyBounds: true,
50284
- autoRender: true,
50285
- ticker: this._option.ticker,
50286
- pluginList: this._option.pluginList,
50287
- enableHtmlAttribute: this._option.enableHtmlAttribute,
50288
- optimize: this._option.optimize,
50289
- supportsTouchEvents: this._option.supportsTouchEvents,
50290
- supportsPointerEvents: this._option.supportsPointerEvents,
50291
- event: {
50283
+ }, afterRender: this._option.afterRender, disableDirtyBounds: true, autoRender: true, ticker: this._option.ticker, pluginList: this._option.pluginList, enableHtmlAttribute: this._option.enableHtmlAttribute, optimize: this._option.optimize, supportsTouchEvents: this._option.supportsTouchEvents, supportsPointerEvents: this._option.supportsPointerEvents, event: {
50292
50284
  clickInterval: clickInterval,
50293
50285
  autoPreventDefault: autoPreventDefault
50294
- },
50295
- ReactDOM: this._option.ReactDOM,
50296
- autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr)
50297
- });
50286
+ }, ReactDOM: this._option.ReactDOM, autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr) }, ((_d = this._option.renderHooks) !== null && _d !== void 0 ? _d : {})));
50298
50287
  this._stage.enableIncrementalAutoRender();
50299
50288
  this._stage.setTheme({
50300
50289
  symbol: {
@@ -56915,7 +56904,7 @@ const lookup = (data, opt) => {
56915
56904
  });
56916
56905
  };
56917
56906
 
56918
- const version = "2.0.1-alpha.5";
56907
+ const version = "2.0.2";
56919
56908
 
56920
56909
  const addVChartProperty = (data, op) => {
56921
56910
  const context = op.beforeCall();
@@ -89714,11 +89703,15 @@ class Tooltip extends BaseComponent {
89714
89703
  });
89715
89704
  };
89716
89705
  this._handleClickToLock = (params) => {
89706
+ var _a, _b;
89717
89707
  if (this._clickLock) {
89718
89708
  this._handleChartMouseOut(params);
89719
89709
  this._clickLock = false;
89720
89710
  }
89721
89711
  else {
89712
+ if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
89713
+ return;
89714
+ }
89722
89715
  this._clickLock = true;
89723
89716
  }
89724
89717
  };
@@ -90017,6 +90010,9 @@ class Tooltip extends BaseComponent {
90017
90010
  return;
90018
90011
  }
90019
90012
  this._isEnterTooltip = false;
90013
+ if (this._spec.triggerOff === 'none') {
90014
+ return;
90015
+ }
90020
90016
  if (this._cacheEnterableRect) {
90021
90017
  const newRect = (_a = container.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(container);
90022
90018
  if (newRect &&
package/build/index.js CHANGED
@@ -17753,9 +17753,10 @@
17753
17753
  return super.needUpdateTag(key, POLYGON_UPDATE_TAG_KEY);
17754
17754
  }
17755
17755
  toCustomPath() {
17756
- const points = this.attribute.points,
17757
- path = new CustomPath2D();
17758
- return points.forEach((point, index) => {
17756
+ let path = super.toCustomPath();
17757
+ if (path) return path;
17758
+ const points = this.attribute.points;
17759
+ return path = new CustomPath2D(), points.forEach((point, index) => {
17759
17760
  0 === index ? path.moveTo(point.x, point.y) : path.lineTo(point.x, point.y);
17760
17761
  }), path.closePath(), path;
17761
17762
  }
@@ -21020,6 +21021,7 @@
21020
21021
  drawContext.updateBounds ? this.useDirtyBounds = !0 : this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;
21021
21022
  }
21022
21023
  draw(renderService, drawContext) {
21024
+ var _a;
21023
21025
  this.prepareForDraw(renderService, drawContext), drawContext.drawContribution = this, this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap, this.currentRenderService = renderService;
21024
21026
  const {
21025
21027
  context: context,
@@ -21034,7 +21036,7 @@
21034
21036
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
21035
21037
  }
21036
21038
  const d = context.dpr % 1;
21037
- (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), renderService.renderTreeRoots.sort((a, b) => {
21039
+ (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearScreen.call(renderService.drawParams), renderService.renderTreeRoots.sort((a, b) => {
21038
21040
  var _a, _b;
21039
21041
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
21040
21042
  }).forEach(group => {
@@ -21170,7 +21172,7 @@
21170
21172
  return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
21171
21173
  }
21172
21174
  clearScreen(renderService, context, drawContext) {
21173
- var _a, _b;
21175
+ var _a, _b, _c;
21174
21176
  const {
21175
21177
  clear: clear,
21176
21178
  viewBox: viewBox
@@ -21178,9 +21180,9 @@
21178
21180
  width = viewBox.width(),
21179
21181
  height = viewBox.height();
21180
21182
  if (clear) {
21181
- context.clearRect(0, 0, width, height);
21182
- const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
21183
- if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
21183
+ context.clearRect(0, 0, width, height), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearRect.call(renderService.drawParams);
21184
+ const stage = null === (_b = renderService.drawParams) || void 0 === _b ? void 0 : _b.stage;
21185
+ if (stage && (context.globalAlpha = null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1), stage && stage.backgroundImg && stage.resources) {
21184
21186
  const res = stage.resources.get(clear);
21185
21187
  res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
21186
21188
  } else context.fillStyle = createColor(context, clear, {
@@ -21708,13 +21710,19 @@
21708
21710
  } else this._skipRender = 1;
21709
21711
  }, this.beforeRender = stage => {
21710
21712
  this._beforeRender && this._beforeRender(stage);
21713
+ }, this.afterClearScreen = drawParams => {
21714
+ this._afterClearScreen && this._afterClearScreen(drawParams);
21715
+ }, this.afterClearRect = drawParams => {
21716
+ this._afterClearRect && this._afterClearRect(drawParams);
21711
21717
  }, this.afterRender = stage => {
21712
21718
  this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
21713
21719
  }, this.afterTickCb = () => {
21714
21720
  this.tickedBeforeRender = !0, "rendering" !== this.state && this.renderNextFrame();
21715
21721
  }, this.params = params, this.theme = new Theme(), this.hooks = {
21716
21722
  beforeRender: new SyncHook(["stage"]),
21717
- afterRender: new SyncHook(["stage"])
21723
+ afterRender: new SyncHook(["stage"]),
21724
+ afterClearScreen: new SyncHook(["stage"]),
21725
+ afterClearRect: new SyncHook(["stage"])
21718
21726
  }, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.graphicService = container.get(GraphicService), this.pluginService.active(this, params), this.window.create({
21719
21727
  width: params.width,
21720
21728
  height: params.height,
@@ -21726,7 +21734,7 @@
21726
21734
  canvas: params.canvas
21727
21735
  }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
21728
21736
  main: !0
21729
- })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
21737
+ })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
21730
21738
  tickRenderMode: "effect"
21731
21739
  }), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
21732
21740
  background: this._background
@@ -32648,7 +32656,10 @@
32648
32656
  reApplyState(state) {
32649
32657
  var _a;
32650
32658
  const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
32651
- stateInfo && (stateInfo.executor.stop(), stateInfo.executor.execute(stateInfo.animationConfig));
32659
+ if (stateInfo) {
32660
+ const stateList = this.stateList.slice();
32661
+ stateInfo.executor.stop(), this.stateList = stateList, stateInfo.executor.execute(stateInfo.animationConfig);
32662
+ }
32652
32663
  }
32653
32664
  }
32654
32665
 
@@ -32686,10 +32697,12 @@
32686
32697
  }), this;
32687
32698
  }
32688
32699
  clearAnimationStates() {
32689
- return this._getAnimationStateManager(this).clearState(), this;
32700
+ const stateManager = this._animationStateManager;
32701
+ return stateManager && stateManager.clearState(), this;
32690
32702
  }
32691
32703
  reApplyAnimationState(state, deep = !1) {
32692
- return this._getAnimationStateManager(this).reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
32704
+ const stateManager = this._animationStateManager;
32705
+ return stateManager && stateManager.reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
32693
32706
  child.reApplyAnimationState(state, deep);
32694
32707
  }), this;
32695
32708
  }
@@ -36099,9 +36112,8 @@
36099
36112
  w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX),
36100
36113
  width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
36101
36114
  this.rect.setAttributes({
36102
- x: x,
36103
- width: width,
36104
- dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
36115
+ x: x + Math.min(parentAttr.x1 - parentAttr.x, 0),
36116
+ width: width
36105
36117
  }, !1, {
36106
36118
  type: AttributeUpdateType.ANIMATE_PLAY,
36107
36119
  animationState: {
@@ -36118,9 +36130,8 @@
36118
36130
  const h = Math.min(parentHeight - currentY, maxLength);
36119
36131
  let height;
36120
36132
  y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
36121
- y: y,
36122
- height: height,
36123
- dy: Math.min(parentAttr.y1 - parentAttr.y, 0)
36133
+ y: y + Math.min(parentAttr.y1 - parentAttr.y, 0),
36134
+ height: height
36124
36135
  }, !1, {
36125
36136
  type: AttributeUpdateType.ANIMATE_PLAY,
36126
36137
  animationState: {
@@ -50260,7 +50271,7 @@
50260
50271
  return this._stage;
50261
50272
  }
50262
50273
  initView() {
50263
- var _a, _b, _c;
50274
+ var _a, _b, _c, _d;
50264
50275
  if (this._released) {
50265
50276
  return;
50266
50277
  }
@@ -50271,36 +50282,14 @@
50271
50282
  const { autoRefreshDpr, dpr, mode, modeParams, gestureConfig, interactive, clickInterval, autoPreventDefault, background } = this._option;
50272
50283
  vglobal.setEnv(toRenderMode(mode), modeParams !== null && modeParams !== void 0 ? modeParams : {});
50273
50284
  this._stage =
50274
- (_a = this._option.stage) !== null && _a !== void 0 ? _a : new Stage({
50275
- background,
50276
- width: this._width,
50277
- height: this._height,
50278
- container: (_b = this._container.dom) !== null && _b !== void 0 ? _b : null,
50279
- canvas: (_c = this._container.canvas) !== null && _c !== void 0 ? _c : null,
50280
- dpr,
50281
- viewBox: this._option.viewBox,
50282
- canvasControled: this._option.canvasControled,
50283
- beforeRender: (stage) => {
50285
+ (_a = this._option.stage) !== null && _a !== void 0 ? _a : new Stage(Object.assign({ background, width: this._width, height: this._height, container: (_b = this._container.dom) !== null && _b !== void 0 ? _b : null, canvas: (_c = this._container.canvas) !== null && _c !== void 0 ? _c : null, dpr, viewBox: this._option.viewBox, canvasControled: this._option.canvasControled, beforeRender: (stage) => {
50284
50286
  var _a, _b, _c;
50285
50287
  (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.onBeforeRender();
50286
50288
  (_c = (_b = this._option).beforeRender) === null || _c === void 0 ? void 0 : _c.call(_b, stage);
50287
- },
50288
- afterRender: this._option.afterRender,
50289
- disableDirtyBounds: true,
50290
- autoRender: true,
50291
- ticker: this._option.ticker,
50292
- pluginList: this._option.pluginList,
50293
- enableHtmlAttribute: this._option.enableHtmlAttribute,
50294
- optimize: this._option.optimize,
50295
- supportsTouchEvents: this._option.supportsTouchEvents,
50296
- supportsPointerEvents: this._option.supportsPointerEvents,
50297
- event: {
50289
+ }, afterRender: this._option.afterRender, disableDirtyBounds: true, autoRender: true, ticker: this._option.ticker, pluginList: this._option.pluginList, enableHtmlAttribute: this._option.enableHtmlAttribute, optimize: this._option.optimize, supportsTouchEvents: this._option.supportsTouchEvents, supportsPointerEvents: this._option.supportsPointerEvents, event: {
50298
50290
  clickInterval: clickInterval,
50299
50291
  autoPreventDefault: autoPreventDefault
50300
- },
50301
- ReactDOM: this._option.ReactDOM,
50302
- autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr)
50303
- });
50292
+ }, ReactDOM: this._option.ReactDOM, autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr) }, ((_d = this._option.renderHooks) !== null && _d !== void 0 ? _d : {})));
50304
50293
  this._stage.enableIncrementalAutoRender();
50305
50294
  this._stage.setTheme({
50306
50295
  symbol: {
@@ -56921,7 +56910,7 @@
56921
56910
  });
56922
56911
  };
56923
56912
 
56924
- const version = "2.0.1-alpha.5";
56913
+ const version = "2.0.2";
56925
56914
 
56926
56915
  const addVChartProperty = (data, op) => {
56927
56916
  const context = op.beforeCall();
@@ -89720,11 +89709,15 @@
89720
89709
  });
89721
89710
  };
89722
89711
  this._handleClickToLock = (params) => {
89712
+ var _a, _b;
89723
89713
  if (this._clickLock) {
89724
89714
  this._handleChartMouseOut(params);
89725
89715
  this._clickLock = false;
89726
89716
  }
89727
89717
  else {
89718
+ if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
89719
+ return;
89720
+ }
89728
89721
  this._clickLock = true;
89729
89722
  }
89730
89723
  };
@@ -90023,6 +90016,9 @@
90023
90016
  return;
90024
90017
  }
90025
90018
  this._isEnterTooltip = false;
90019
+ if (this._spec.triggerOff === 'none') {
90020
+ return;
90021
+ }
90026
90022
  if (this._cacheEnterableRect) {
90027
90023
  const newRect = (_a = container.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(container);
90028
90024
  if (newRect &&