@visactor/vchart 1.1.1 → 1.1.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
@@ -54064,10 +54064,6 @@
54064
54064
  function getMapSource(type) {
54065
54065
  return geoSourceMap.get(type);
54066
54066
  }
54067
- function clearMapSource() {
54068
- geoSourceMap.clear();
54069
- mapDataSet = null;
54070
- }
54071
54067
 
54072
54068
  function copyOneDataView(d, deep = false) {
54073
54069
  let _deep = deep;
@@ -54862,7 +54858,6 @@
54862
54858
  this._compiler?.release();
54863
54859
  this._eventDispatcher?.release();
54864
54860
  this._unBindResizeEvent();
54865
- clearMapSource();
54866
54861
  this._releaseData();
54867
54862
  this._chart = null;
54868
54863
  this._compiler = null;
@@ -58033,7 +58028,7 @@
58033
58028
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
58034
58029
  Factory.registerRegion('region', Region);
58035
58030
  Factory.registerLayout('base', Layout);
58036
- const version = "1.1.1";
58031
+ const version = "1.1.2";
58037
58032
  Logger.getInstance(LoggerLevel.Error);
58038
58033
 
58039
58034
  var SeriesMarkNameEnum;
@@ -66475,7 +66470,7 @@
66475
66470
  }, {
66476
66471
  morph: shouldDoMorph(this._spec.animation, this._spec.morph, userAnimationConfig(this.type, this._spec)),
66477
66472
  defaultMorphElementKey: this._seriesField,
66478
- key: this._seriesField,
66473
+ key: DEFAULT_DATA_KEY,
66479
66474
  groupKey: this._seriesField,
66480
66475
  skipBeforeLayouted: true,
66481
66476
  isSeriesMark: true
@@ -81044,8 +81039,19 @@
81044
81039
  if (!this._expand) {
81045
81040
  return;
81046
81041
  }
81047
- const domainMin = domain[0];
81048
- const domainMax = domain[domain.length - 1];
81042
+ let domainMin = domain[0];
81043
+ let domainMax = domain[domain.length - 1];
81044
+ if (domainMin === domainMax) {
81045
+ if (domainMax === 0) {
81046
+ domainMax = 1;
81047
+ }
81048
+ else if (domainMax > 0) {
81049
+ domainMin = 0;
81050
+ }
81051
+ else if (domainMax < 0) {
81052
+ domainMax = 0;
81053
+ }
81054
+ }
81049
81055
  if (isValid(this._expand.min)) {
81050
81056
  domain[0] = domainMin - (domainMax - domainMin) * this._expand.min;
81051
81057
  }
@@ -81054,6 +81060,10 @@
81054
81060
  }
81055
81061
  }
81056
81062
  niceDomain(domain) {
81063
+ const { min: userMin, max: userMax } = getLinearAxisSpecDomain(this._spec);
81064
+ if (isValid(userMin) || isValid(userMax)) {
81065
+ return domain;
81066
+ }
81057
81067
  if (Math.abs(minInArray(domain) - maxInArray(domain)) <= 1e-12) {
81058
81068
  let num = domain[0];
81059
81069
  const flag = num >= 0 ? 1 : -1;
@@ -83095,9 +83105,26 @@
83095
83105
  this._actualScale = this._spec.zoomLimit?.max;
83096
83106
  scale = this._spec.zoomLimit?.max / _lastActualScale;
83097
83107
  }
83098
- event.zoomDelta = scale;
83108
+ if (event) {
83109
+ event.zoomDelta = scale;
83110
+ }
83099
83111
  this.zoom(scale, [params.zoomX, params.zoomY]);
83112
+ return scale;
83100
83113
  };
83114
+ dispatchZoom(zoomDelta, center) {
83115
+ const scaleCenter = center || {
83116
+ x: this.getLayoutStartPoint().x + this.getLayoutRect().width / 2,
83117
+ y: this.getLayoutStartPoint().y + this.getLayoutRect().height / 2
83118
+ };
83119
+ const scale = this._handleChartZoom({ zoomDelta, zoomX: scaleCenter.x, zoomY: scaleCenter.y });
83120
+ if (scale !== 1) {
83121
+ this.event.emit('zoom', {
83122
+ scale,
83123
+ scaleCenter,
83124
+ model: this
83125
+ });
83126
+ }
83127
+ }
83101
83128
  initEvent() {
83102
83129
  this.event.on(ChartEvent.scaleUpdate, { filter: ({ model }) => model?.id === this.id }, this.effect.scaleUpdate.bind(this));
83103
83130
  if (this._spec.roam) {
@@ -88227,6 +88254,12 @@
88227
88254
  });
88228
88255
  });
88229
88256
  }
88257
+ updateSpec(spec) {
88258
+ const result = super.updateSpec(spec);
88259
+ result.reRender = true;
88260
+ result.reMake = true;
88261
+ return result;
88262
+ }
88230
88263
  onRender(ctx) {
88231
88264
  }
88232
88265
  changeRegions(regions) {