@visactor/vchart-extension 2.0.1-alpha.1 → 2.0.1-alpha.3

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 (35) hide show
  1. package/build/index.js +100 -16
  2. package/build/index.min.js +2 -2
  3. package/cjs/charts/axis-3d/axis-3d-mixin.js +48 -1
  4. package/cjs/charts/axis-3d/axis-3d-mixin.js.map +1 -1
  5. package/cjs/charts/axis-3d/util.js +9 -8
  6. package/cjs/charts/axis-3d/util.js.map +1 -1
  7. package/cjs/charts/image-cloud/image-cloud-transformer.js +1 -2
  8. package/cjs/charts/image-cloud/index.js +1 -1
  9. package/cjs/charts/image-cloud/interface.js +1 -1
  10. package/cjs/charts/pictogram/element-highlight-by-graphic-name.js +2 -1
  11. package/cjs/charts/pictogram/pictogram-transformer.js +1 -1
  12. package/cjs/charts/pictogram/pictogram.js +1 -1
  13. package/cjs/charts/ranking-list/ranking-list-transformer.d.ts +6 -0
  14. package/cjs/charts/ranking-list/ranking-list-transformer.js +2 -1
  15. package/cjs/charts/ranking-list/ranking-list-transformer.js.map +1 -1
  16. package/esm/charts/axis-3d/axis-3d-mixin.js +48 -2
  17. package/esm/charts/axis-3d/axis-3d-mixin.js.map +1 -1
  18. package/esm/charts/axis-3d/util.js +9 -8
  19. package/esm/charts/axis-3d/util.js.map +1 -1
  20. package/esm/charts/image-cloud/image-cloud-transformer.js +1 -2
  21. package/esm/charts/image-cloud/index.js +1 -1
  22. package/esm/charts/image-cloud/interface.js +1 -1
  23. package/esm/charts/pictogram/element-highlight-by-graphic-name.js +2 -1
  24. package/esm/charts/pictogram/pictogram-transformer.js +1 -1
  25. package/esm/charts/pictogram/pictogram.js +1 -1
  26. package/esm/charts/ranking-list/ranking-list-transformer.d.ts +6 -0
  27. package/esm/charts/ranking-list/ranking-list-transformer.js +2 -1
  28. package/esm/charts/ranking-list/ranking-list-transformer.js.map +1 -1
  29. package/package.json +8 -8
  30. package/cjs/charts/sequence-scatter-link/utils.d.ts +0 -9
  31. package/cjs/charts/sequence-scatter-link/utils.js +0 -108
  32. package/cjs/charts/sequence-scatter-link/utils.js.map +0 -1
  33. package/esm/charts/sequence-scatter-link/utils.d.ts +0 -9
  34. package/esm/charts/sequence-scatter-link/utils.js +0 -100
  35. package/esm/charts/sequence-scatter-link/utils.js.map +0 -1
package/build/index.js CHANGED
@@ -2989,6 +2989,7 @@
2989
2989
  options: {
2990
2990
  direction: 'y',
2991
2991
  orient: 'negative',
2992
+ excludeChannels: ['x'],
2992
2993
  point: (datum, graphic) => {
2993
2994
  const channelAttr = graphic.getGraphicAttribute('y');
2994
2995
  const barSpace = spec.height / (spec.pageSize + 1);
@@ -3009,7 +3010,7 @@
3009
3010
  options: {
3010
3011
  direction: 'y',
3011
3012
  orient: 'negative',
3012
- excludeChannels: ['y'],
3013
+ excludeChannels: ['x'],
3013
3014
  point: (datum, graphic) => {
3014
3015
  const channelAttr = graphic.getGraphicAttribute('y');
3015
3016
  return { y: channelAttr + (spec.height / (spec.pageSize + 1)) * Math.min(spec.scrollSize, spec.pageSize) };
@@ -10776,7 +10777,7 @@
10776
10777
  }
10777
10778
  removeChild(child) {
10778
10779
  const data = super.removeChild(child);
10779
- return child.stage = null, this.getGraphicService().onRemove(child), this.addUpdateBoundTag(), data;
10780
+ return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
10780
10781
  }
10781
10782
  removeAllChild(deep = !1) {
10782
10783
  this.forEachChildren(child => {
@@ -18259,7 +18260,8 @@
18259
18260
  this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
18260
18261
  }
18261
18262
  checkSkip(delta) {
18262
- if ("performance" === this.stage.params.optimize.tickRenderMode) return !1;
18263
+ var _a, _b, _c;
18264
+ if ("performance" === (null === (_c = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.params) || void 0 === _b ? void 0 : _b.optimize) || void 0 === _c ? void 0 : _c.tickRenderMode)) return !1;
18263
18265
  return delta < this.interval + 2 * (Math.random() - .5) * this._jitter;
18264
18266
  }
18265
18267
  }
@@ -18732,6 +18734,11 @@
18732
18734
  state.executor.stop();
18733
18735
  }), this.stateList = null;
18734
18736
  }
18737
+ reApplyState(state) {
18738
+ var _a;
18739
+ const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
18740
+ stateInfo && (stateInfo.executor.stop(), stateInfo.executor.execute(stateInfo.animationConfig));
18741
+ }
18735
18742
  }
18736
18743
 
18737
18744
  class GraphicStateExtension {
@@ -18762,12 +18769,19 @@
18762
18769
  applyUnhighlightState(animationConfig, callback) {
18763
18770
  return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
18764
18771
  }
18765
- stopAnimationState(state, type) {
18766
- return this._getAnimationStateManager(this).stopState(state, type), this;
18772
+ stopAnimationState(state, type, deep = !1) {
18773
+ return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
18774
+ child.stopAnimationState(state, type, deep);
18775
+ }), this;
18767
18776
  }
18768
18777
  clearAnimationStates() {
18769
18778
  return this._getAnimationStateManager(this).clearState(), this;
18770
18779
  }
18780
+ reApplyAnimationState(state, deep = !1) {
18781
+ return this._getAnimationStateManager(this).reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
18782
+ child.reApplyAnimationState(state, deep);
18783
+ }), this;
18784
+ }
18771
18785
  static extend(graphic) {
18772
18786
  return new GraphicStateExtension()._getAnimationStateManager(graphic), graphic;
18773
18787
  }
@@ -18819,6 +18833,21 @@
18819
18833
  getGraphicAttribute(key, prev = !1) {
18820
18834
  return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
18821
18835
  }
18836
+ pauseAnimation(deep = !1) {
18837
+ this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
18838
+ child.pauseAnimation(deep);
18839
+ });
18840
+ }
18841
+ resumeAnimation(deep = !1) {
18842
+ this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
18843
+ child.resumeAnimation(deep);
18844
+ });
18845
+ }
18846
+ stopAnimation(deep = !1) {
18847
+ this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
18848
+ child.stopAnimation(deep);
18849
+ });
18850
+ }
18822
18851
  }
18823
18852
 
18824
18853
  function registerAnimate() {
@@ -19020,17 +19049,6 @@
19020
19049
  items,
19021
19050
  scale: axis._scale.clone()
19022
19051
  };
19023
- if (!ignoreGrid) {
19024
- attrs.grid = {
19025
- type: 'line',
19026
- start: { x: 0, y: 0 },
19027
- end,
19028
- items: items[0],
19029
- verticalFactor: axis._axisStyle.verticalFactor,
19030
- depth: depthZ,
19031
- length: !ignoreGrid ? regionSize.height : 0
19032
- };
19033
- }
19034
19052
  const directionStr = (_a = axis.directionStr) !== null && _a !== void 0 ? _a : 'r2l';
19035
19053
  let anchor3d = [0, 0];
19036
19054
  let alpha = -Math.PI / 2;
@@ -19043,6 +19061,20 @@
19043
19061
  attrs.z = z;
19044
19062
  attrs.alpha = alpha;
19045
19063
  attrs.anchor3d = anchor3d;
19064
+ if (!ignoreGrid) {
19065
+ attrs.grid = {
19066
+ type: 'line',
19067
+ start: { x: 0, y: 0 },
19068
+ end,
19069
+ items: items[0],
19070
+ verticalFactor: axis._axisStyle.verticalFactor,
19071
+ depth: depthZ,
19072
+ length: !ignoreGrid ? regionSize.height : 0,
19073
+ alpha,
19074
+ z,
19075
+ anchor3d
19076
+ };
19077
+ }
19046
19078
  return attrs;
19047
19079
  };
19048
19080
 
@@ -19052,7 +19084,59 @@
19052
19084
  }
19053
19085
  _afterUpdateAttribute(attrs, ignoreGrid) {
19054
19086
  const isZ = vchart.isZAxis(this._orient);
19087
+ const isX = vchart.isXAxis(this._orient);
19088
+ const isY = vchart.isYAxis(this._orient);
19089
+ let regionHeight = 0;
19090
+ let regionWidth = 0;
19091
+ if (!ignoreGrid) {
19092
+ const regions = this.getRegions();
19093
+ let { x: minX, y: minY } = regions[0].getLayoutStartPoint();
19094
+ let maxX = minX + regions[0].getLayoutRect().width;
19095
+ let maxY = minY + regions[0].getLayoutRect().height;
19096
+ for (let index = 1; index < regions.length; index++) {
19097
+ const region = regions[index];
19098
+ const { x, y } = region.getLayoutStartPoint();
19099
+ const { width, height } = region.getLayoutRect();
19100
+ minX = Math.min(minX, x);
19101
+ maxX = Math.max(maxX, width + x);
19102
+ minY = Math.min(minY, y);
19103
+ maxY = Math.max(maxY, height + y);
19104
+ }
19105
+ regionHeight = Math.abs(maxY - minY);
19106
+ regionWidth = Math.abs(maxX - minX);
19107
+ }
19108
+ let gridLength = 0;
19109
+ let axisLength = 0;
19110
+ const { width, height } = this.getLayoutRect();
19111
+ let end = { x: 0, y: 0 };
19112
+ if (isX) {
19113
+ end = { x: width, y: 0 };
19114
+ gridLength = regionHeight;
19115
+ axisLength = width;
19116
+ }
19117
+ else if (isY) {
19118
+ end = { x: 0, y: height };
19119
+ gridLength = regionWidth;
19120
+ axisLength = height;
19121
+ }
19122
+ const depth = this.layout3dBox ? this.layout3dBox.length : 0;
19055
19123
  if (!isZ) {
19124
+ const items = this.getLabelItems(axisLength);
19125
+ attrs.grid = {
19126
+ length: gridLength
19127
+ };
19128
+ attrs.start = { x: 0, y: 0 };
19129
+ attrs.text = this._spec.title.text || this._dataFieldText;
19130
+ attrs.maxWidth = this._getTitleLimit(isX);
19131
+ attrs.items = items;
19132
+ attrs.grid = {
19133
+ type: 'line',
19134
+ start: { x: 0, y: 0 },
19135
+ end,
19136
+ items: items[0],
19137
+ depth,
19138
+ length: gridLength
19139
+ };
19056
19140
  return attrs;
19057
19141
  }
19058
19142
  return getUpdateAttributeOfZAxis(this, ignoreGrid);