@visactor/vchart 1.3.3 → 1.3.4

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.
Files changed (51) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +41 -30
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/progress/circular/circular.js +1 -1
  6. package/cjs/chart/progress/circular/circular.js.map +1 -1
  7. package/cjs/component/axis/cartesian/axis.d.ts +8 -0
  8. package/cjs/component/axis/cartesian/axis.js +10 -9
  9. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  10. package/cjs/component/axis/cartesian/util/common.d.ts +1 -0
  11. package/cjs/component/axis/cartesian/util/common.js +8 -2
  12. package/cjs/component/axis/cartesian/util/common.js.map +1 -1
  13. package/cjs/component/base/base-component.js +2 -1
  14. package/cjs/component/base/base-component.js.map +1 -1
  15. package/cjs/core/index.d.ts +1 -1
  16. package/cjs/core/index.js +1 -1
  17. package/cjs/core/index.js.map +1 -1
  18. package/cjs/core/vchart.js +3 -2
  19. package/cjs/core/vchart.js.map +1 -1
  20. package/cjs/mark/progress-arc.js +2 -2
  21. package/cjs/mark/progress-arc.js.map +1 -1
  22. package/cjs/model/layout-item.js +1 -1
  23. package/cjs/model/layout-item.js.map +1 -1
  24. package/cjs/series/progress/circular/circular.js +4 -3
  25. package/cjs/series/progress/circular/circular.js.map +1 -1
  26. package/cjs/series/progress/linear/linear.js +8 -9
  27. package/cjs/series/progress/linear/linear.js.map +1 -1
  28. package/esm/chart/progress/circular/circular.js +1 -1
  29. package/esm/chart/progress/circular/circular.js.map +1 -1
  30. package/esm/component/axis/cartesian/axis.d.ts +8 -0
  31. package/esm/component/axis/cartesian/axis.js +11 -10
  32. package/esm/component/axis/cartesian/axis.js.map +1 -1
  33. package/esm/component/axis/cartesian/util/common.d.ts +1 -0
  34. package/esm/component/axis/cartesian/util/common.js +7 -1
  35. package/esm/component/axis/cartesian/util/common.js.map +1 -1
  36. package/esm/component/base/base-component.js +2 -1
  37. package/esm/component/base/base-component.js.map +1 -1
  38. package/esm/core/index.d.ts +1 -1
  39. package/esm/core/index.js +1 -1
  40. package/esm/core/index.js.map +1 -1
  41. package/esm/core/vchart.js +3 -2
  42. package/esm/core/vchart.js.map +1 -1
  43. package/esm/mark/progress-arc.js +2 -2
  44. package/esm/mark/progress-arc.js.map +1 -1
  45. package/esm/model/layout-item.js +1 -1
  46. package/esm/model/layout-item.js.map +1 -1
  47. package/esm/series/progress/circular/circular.js +4 -2
  48. package/esm/series/progress/circular/circular.js.map +1 -1
  49. package/esm/series/progress/linear/linear.js +7 -9
  50. package/esm/series/progress/linear/linear.js.map +1 -1
  51. package/package.json +3 -3
package/build/index.js CHANGED
@@ -53718,6 +53718,13 @@
53718
53718
  function getDirectionByOrient(orient) {
53719
53719
  return orient === 'top' || orient === 'bottom' ? Direction.horizontal : Direction.vertical;
53720
53720
  }
53721
+ function transformInverse(spec, isHorizontal) {
53722
+ let inverse = spec.inverse;
53723
+ if (isHorizontal && !isXAxis(spec.orient)) {
53724
+ inverse = isValid$1(spec.inverse) ? !spec.inverse : true;
53725
+ }
53726
+ return inverse;
53727
+ }
53721
53728
 
53722
53729
  const getAxis$1 = (chart, type, pos) => {
53723
53730
  const axesComponents = chart
@@ -57495,11 +57502,12 @@
57495
57502
  spec = mergeSpec({}, this._spec, spec);
57496
57503
  }
57497
57504
  yield this.updateCustomConfigAndRerender(() => {
57498
- var _a, _b;
57505
+ var _a, _b, _c;
57499
57506
  spec = specTransform(spec);
57500
57507
  this._spec = spec;
57501
57508
  this._updateCurrentTheme();
57502
- (_b = (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.getVGrammarView()) === null || _b === void 0 ? void 0 : _b.updateLayoutTag();
57509
+ (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setCurrentTheme(this._currentTheme, true);
57510
+ (_c = (_b = this._compiler) === null || _b === void 0 ? void 0 : _b.getVGrammarView()) === null || _c === void 0 ? void 0 : _c.updateLayoutTag();
57503
57511
  return this._chart.updateSpec(spec, morphConfig);
57504
57512
  }, morphConfig);
57505
57513
  return this;
@@ -58182,7 +58190,7 @@
58182
58190
  this.layoutZIndex = 0;
58183
58191
  }
58184
58192
  getSpec() {
58185
- return this._spec;
58193
+ return this._spec || {};
58186
58194
  }
58187
58195
  getAutoIndent() {
58188
58196
  return this._autoIndent;
@@ -60733,7 +60741,7 @@
60733
60741
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
60734
60742
  Factory.registerRegion('region', Region);
60735
60743
  Factory.registerLayout('base', Layout);
60736
- const version = "1.3.3";
60744
+ const version = "1.3.4";
60737
60745
  Logger.getInstance(LoggerLevel.Error);
60738
60746
 
60739
60747
  const Appear_ClipIn$1 = {
@@ -69365,17 +69373,17 @@
69365
69373
  return defaultStyle;
69366
69374
  }
69367
69375
  _filterStyle(style, state, level, stateStyle = this.stateStyle) {
69368
- var _a, _b, _c, _d, _e, _f;
69376
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
69369
69377
  if (isValid$1(style.innerRadius)) {
69370
69378
  this.setAttribute('innerRadius', this._styleConvert(style.innerRadius), state, level, this._cacheStateStyle);
69371
69379
  }
69372
69380
  if (isValid$1(style.outerRadius)) {
69373
69381
  this.setAttribute('outerRadius', this._styleConvert(style.outerRadius), state, level, this._cacheStateStyle);
69374
69382
  }
69375
- const innerPadding = (_a = style.innerPadding) !== null && _a !== void 0 ? _a : stateStyle[state].innerPadding.style;
69376
- const outerPadding = (_b = style.outerPadding) !== null && _b !== void 0 ? _b : stateStyle[state].outerPadding.style;
69377
- const innerRadius = (_d = (_c = style.innerRadius) !== null && _c !== void 0 ? _c : this._cacheStateStyle[state].innerRadius.style) !== null && _d !== void 0 ? _d : stateStyle[state].innerRadius.style;
69378
- const outerRadius = (_f = (_e = style.outerRadius) !== null && _e !== void 0 ? _e : this._cacheStateStyle[state].outerRadius.style) !== null && _f !== void 0 ? _f : stateStyle[state].outerRadius.style;
69383
+ const innerPadding = (_a = style.innerPadding) !== null && _a !== void 0 ? _a : (_c = (_b = stateStyle[state]) === null || _b === void 0 ? void 0 : _b.innerPadding) === null || _c === void 0 ? void 0 : _c.style;
69384
+ const outerPadding = (_d = style.outerPadding) !== null && _d !== void 0 ? _d : (_f = (_e = stateStyle[state]) === null || _e === void 0 ? void 0 : _e.outerPadding) === null || _f === void 0 ? void 0 : _f.style;
69385
+ const innerRadius = (_k = (_g = style.innerRadius) !== null && _g !== void 0 ? _g : (_j = (_h = this._cacheStateStyle[state]) === null || _h === void 0 ? void 0 : _h.innerRadius) === null || _j === void 0 ? void 0 : _j.style) !== null && _k !== void 0 ? _k : (_m = (_l = stateStyle[state]) === null || _l === void 0 ? void 0 : _l.innerRadius) === null || _m === void 0 ? void 0 : _m.style;
69386
+ const outerRadius = (_r = (_o = style.outerRadius) !== null && _o !== void 0 ? _o : (_q = (_p = this._cacheStateStyle[state]) === null || _p === void 0 ? void 0 : _p.outerRadius) === null || _q === void 0 ? void 0 : _q.style) !== null && _r !== void 0 ? _r : (_t = (_s = stateStyle[state]) === null || _s === void 0 ? void 0 : _s.outerRadius) === null || _t === void 0 ? void 0 : _t.style;
69379
69387
  if (innerRadius === 0 && outerRadius === 0) {
69380
69388
  return style;
69381
69389
  }
@@ -69387,7 +69395,9 @@
69387
69395
  if (isFunction$1(innerRadius)) {
69388
69396
  newStyle.innerRadius = (item, ctx, opt, source) => {
69389
69397
  const result = innerRadius(item, ctx, opt, source);
69390
- const padding = isFunction$1(innerPadding) ? innerPadding(item, ctx, opt, source) : innerPadding;
69398
+ const padding = isFunction$1(innerPadding)
69399
+ ? innerPadding(item, ctx, opt, source)
69400
+ : innerPadding;
69391
69401
  return result + padding;
69392
69402
  };
69393
69403
  }
@@ -69407,7 +69417,9 @@
69407
69417
  if (isFunction$1(outerRadius)) {
69408
69418
  newStyle.outerRadius = (item, ctx, opt, source) => {
69409
69419
  const result = outerRadius(item, ctx, opt, source);
69410
- const padding = isFunction$1(outerPadding) ? outerPadding(item, ctx, opt, source) : outerPadding;
69420
+ const padding = isFunction$1(outerPadding)
69421
+ ? outerPadding(item, ctx, opt, source)
69422
+ : outerPadding;
69411
69423
  return result - padding;
69412
69424
  };
69413
69425
  }
@@ -71352,7 +71364,7 @@
71352
71364
  fill: this.getColorAttribute(),
71353
71365
  zIndex: 200,
71354
71366
  forceShowCap: true
71355
- });
71367
+ }, 'normal', AttributeLevel.Series);
71356
71368
  this._trigger.registerMark(progressMark);
71357
71369
  (_b = this._tooltipHelper) === null || _b === void 0 ? void 0 : _b.activeTriggerSet.mark.add(progressMark);
71358
71370
  }
@@ -71377,7 +71389,7 @@
71377
71389
  cornerRadius: this._spec.cornerRadius,
71378
71390
  fill: this.getColorAttribute(),
71379
71391
  zIndex: 100
71380
- });
71392
+ }, 'normal', AttributeLevel.Series);
71381
71393
  this._trigger.registerMark(trackMark);
71382
71394
  }
71383
71395
  }
@@ -71424,7 +71436,7 @@
71424
71436
  _getDefaultSeriesSpec(spec) {
71425
71437
  var _a, _b;
71426
71438
  const series = super._getDefaultSeriesSpec(spec);
71427
- return Object.assign(Object.assign({}, series), { cornerRadius: (_a = spec.cornerRadius) !== null && _a !== void 0 ? _a : 0, roundCap: (_b = spec.roundCap) !== null && _b !== void 0 ? _b : false, progress: spec.progress, background: spec.background });
71439
+ return Object.assign(Object.assign({}, series), { cornerRadius: (_a = spec.cornerRadius) !== null && _a !== void 0 ? _a : 0, roundCap: (_b = spec.roundCap) !== null && _b !== void 0 ? _b : false, progress: spec.progress, track: spec.track });
71428
71440
  }
71429
71441
  transformSpec(spec) {
71430
71442
  super.transformSpec(spec);
@@ -71499,7 +71511,7 @@
71499
71511
  width: this._spec.bandWidth - leftPadding - rightPadding,
71500
71512
  cornerRadius: this._spec.cornerRadius,
71501
71513
  fill: this.getColorAttribute()
71502
- });
71514
+ }, 'normal', AttributeLevel.Series);
71503
71515
  }
71504
71516
  else {
71505
71517
  const topPadding = (_f = (_e = this._spec.progress) === null || _e === void 0 ? void 0 : _e.topPadding) !== null && _f !== void 0 ? _f : 0;
@@ -71520,7 +71532,7 @@
71520
71532
  width: () => { var _a; return (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.dataToPosition([1], { bandPosition: this._bandPosition }); },
71521
71533
  cornerRadius: this._spec.cornerRadius,
71522
71534
  fill: this.getColorAttribute()
71523
- });
71535
+ }, 'normal', AttributeLevel.Series);
71524
71536
  }
71525
71537
  this._trigger.registerMark(progressMark);
71526
71538
  (_j = this._tooltipHelper) === null || _j === void 0 ? void 0 : _j.activeTriggerSet.mark.add(progressMark);
@@ -71533,7 +71545,7 @@
71533
71545
  return this._trackMark;
71534
71546
  }
71535
71547
  initTrackMarkStyle() {
71536
- var _a, _b, _c, _d, _e;
71548
+ var _a;
71537
71549
  const trackMark = this._trackMark;
71538
71550
  if (trackMark) {
71539
71551
  if (this._spec.direction === 'vertical') {
@@ -71546,9 +71558,8 @@
71546
71558
  y: 0,
71547
71559
  width: this._spec.bandWidth,
71548
71560
  height: () => this._scaleY.range()[0],
71549
- cornerRadius: this._spec.cornerRadius,
71550
- fill: (_b = (_a = this._spec.track) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill
71551
- });
71561
+ cornerRadius: this._spec.cornerRadius
71562
+ }, 'normal', AttributeLevel.Series);
71552
71563
  }
71553
71564
  else {
71554
71565
  this.setMarkStyle(trackMark, {
@@ -71560,12 +71571,11 @@
71560
71571
  },
71561
71572
  height: this._spec.bandWidth,
71562
71573
  width: () => this._scaleX.range()[1],
71563
- cornerRadius: this._spec.cornerRadius,
71564
- fill: (_d = (_c = this._spec.track) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.fill
71565
- });
71574
+ cornerRadius: this._spec.cornerRadius
71575
+ }, 'normal', AttributeLevel.Series);
71566
71576
  }
71567
71577
  this._trigger.registerMark(trackMark);
71568
- (_e = this._tooltipHelper) === null || _e === void 0 ? void 0 : _e.activeTriggerSet.mark.add(trackMark);
71578
+ (_a = this._tooltipHelper) === null || _a === void 0 ? void 0 : _a.activeTriggerSet.mark.add(trackMark);
71569
71579
  }
71570
71580
  }
71571
71581
  initProgressGroupMark() {
@@ -79919,8 +79929,9 @@
79919
79929
  }
79920
79930
  }
79921
79931
  getContainer() {
79932
+ var _a;
79922
79933
  if (!this._container) {
79923
- this._container = this._option.globalInstance.getStage().find(node => node.name === 'root', true);
79934
+ this._container = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance.getStage().find(node => node.name === 'root', true);
79924
79935
  }
79925
79936
  return this._container;
79926
79937
  }
@@ -82993,11 +83004,7 @@
82993
83004
  const componentName = `${CartesianAxis.type}-${axisType}`;
82994
83005
  const C = Factory.getComponentInKey(componentName);
82995
83006
  if (C) {
82996
- let inverse = spec.inverse;
82997
- if (isHorizontal && !isXAxis(spec.orient)) {
82998
- inverse = isValid$1(spec.inverse) ? !spec.inverse : true;
82999
- }
83000
- return new C(Object.assign(Object.assign({}, spec), { type: axisType, inverse }), options);
83007
+ return new C(Object.assign(Object.assign({}, spec), { type: axisType, inverse: transformInverse(spec, isHorizontal) }), options);
83001
83008
  }
83002
83009
  options.onError(`Component ${componentName} not found`);
83003
83010
  return null;
@@ -83503,6 +83510,10 @@
83503
83510
  onDataUpdate() {
83504
83511
  this._clearLayoutCache();
83505
83512
  }
83513
+ updateSpec(spec) {
83514
+ const chartSpec = this._option.getChart().getSpec();
83515
+ return super.updateSpec(Object.assign(Object.assign({}, spec), { inverse: transformInverse(spec, chartSpec.direction === Direction.horizontal) }));
83516
+ }
83506
83517
  }
83507
83518
  CartesianAxis.type = ComponentTypeEnum.cartesianAxis;
83508
83519