@visactor/vchart 1.3.1 → 1.3.2-hotfix.0

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
@@ -58246,6 +58246,7 @@
58246
58246
  constructor(spec, options) {
58247
58247
  var _a, _b, _c, _d;
58248
58248
  this.id = createID();
58249
+ this._userEvents = [];
58249
58250
  this._autoSize = true;
58250
58251
  this._option = {
58251
58252
  mode: exports.RenderModeEnum['desktop-browser'],
@@ -58446,6 +58447,7 @@
58446
58447
  this._chart.release();
58447
58448
  this._chart = null;
58448
58449
  (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.releaseGrammar();
58450
+ this._userEvents.forEach(e => this.on(e.eType, e.query, e.callback));
58449
58451
  }
58450
58452
  else if (updateResult.reCompile) {
58451
58453
  (_b = this._compiler) === null || _b === void 0 ? void 0 : _b.clear({ chart: this._chart, vChart: this });
@@ -58516,11 +58518,13 @@
58516
58518
  (_b = this._chart) === null || _b === void 0 ? void 0 : _b.release();
58517
58519
  (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.release();
58518
58520
  (_d = this._eventDispatcher) === null || _d === void 0 ? void 0 : _d.release();
58521
+ this._userEvents.length = 0;
58519
58522
  this._unBindResizeEvent();
58520
58523
  this._releaseData();
58521
58524
  this._chart = null;
58522
58525
  this._compiler = null;
58523
58526
  this._spec = null;
58527
+ this._userEvents = null;
58524
58528
  this._event = null;
58525
58529
  this._eventDispatcher = null;
58526
58530
  InstanceManager.unregisterInstance(this);
@@ -58731,10 +58735,15 @@
58731
58735
  }
58732
58736
  on(eType, query, handler) {
58733
58737
  var _a;
58738
+ this._userEvents.push({ eType, query, callback: handler });
58734
58739
  (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(eType, query, handler);
58735
58740
  }
58736
58741
  off(eType, handler) {
58737
58742
  var _a;
58743
+ const index = this._userEvents.findIndex(e => e.eType === eType && e.callback === handler);
58744
+ if (index >= 0) {
58745
+ this._userEvents.splice(index, 1);
58746
+ }
58738
58747
  (_a = this._event) === null || _a === void 0 ? void 0 : _a.off(eType, handler);
58739
58748
  }
58740
58749
  updateState(state, filter) {
@@ -61873,7 +61882,7 @@
61873
61882
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
61874
61883
  Factory.registerRegion('region', Region);
61875
61884
  Factory.registerLayout('base', Layout);
61876
- const version = "1.3.1";
61885
+ const version = "1.3.1+hotfix.0";
61877
61886
  Logger.getInstance(LoggerLevel.Error);
61878
61887
 
61879
61888
  const Appear_ClipIn$1 = {