@visactor/vchart-extension 2.0.1 → 2.0.3-alpha.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.
Files changed (63) hide show
  1. package/build/index.js +407 -132
  2. package/build/index.min.js +2 -2
  3. package/cjs/charts/axis-3d/axis-3d-mixin.js +1 -48
  4. package/cjs/charts/axis-3d/axis-3d-mixin.js.map +1 -1
  5. package/cjs/charts/axis-3d/util.js +8 -9
  6. package/cjs/charts/axis-3d/util.js.map +1 -1
  7. package/cjs/charts/funnel-3d/constant.d.ts +2 -0
  8. package/cjs/charts/funnel-3d/series.d.ts +2 -0
  9. package/cjs/charts/image-cloud/series/constant.d.ts +2 -0
  10. package/cjs/charts/image-cloud/series/image-cloud.d.ts +2 -0
  11. package/cjs/charts/pictogram/series/constant.d.ts +2 -0
  12. package/cjs/charts/pictogram/series/pictogram.d.ts +2 -0
  13. package/cjs/charts/pie-3d/constant.d.ts +2 -0
  14. package/cjs/charts/pie-3d/series.d.ts +2 -0
  15. package/cjs/charts/ranking-list/ranking-list-transformer.d.ts +0 -6
  16. package/cjs/charts/ranking-list/ranking-list-transformer.js +1 -2
  17. package/cjs/charts/ranking-list/ranking-list-transformer.js.map +1 -1
  18. package/cjs/charts/sequence-analysis/constant.d.ts +3 -0
  19. package/cjs/charts/sequence-analysis/constant.js +7 -0
  20. package/cjs/charts/sequence-analysis/constant.js.map +1 -0
  21. package/cjs/charts/sequence-analysis/interface.d.ts +40 -0
  22. package/cjs/charts/sequence-analysis/interface.js +6 -0
  23. package/cjs/charts/sequence-analysis/interface.js.map +1 -0
  24. package/cjs/charts/sequence-analysis/sequence-analysis-transformer.d.ts +4 -0
  25. package/cjs/charts/sequence-analysis/sequence-analysis-transformer.js +266 -0
  26. package/cjs/charts/sequence-analysis/sequence-analysis-transformer.js.map +1 -0
  27. package/cjs/charts/sequence-analysis/sequence-analysis.d.ts +16 -0
  28. package/cjs/charts/sequence-analysis/sequence-analysis.js +34 -0
  29. package/cjs/charts/sequence-analysis/sequence-analysis.js.map +1 -0
  30. package/cjs/index.d.ts +1 -0
  31. package/cjs/index.js +1 -0
  32. package/cjs/index.js.map +1 -1
  33. package/esm/charts/axis-3d/axis-3d-mixin.js +2 -48
  34. package/esm/charts/axis-3d/axis-3d-mixin.js.map +1 -1
  35. package/esm/charts/axis-3d/util.js +8 -9
  36. package/esm/charts/axis-3d/util.js.map +1 -1
  37. package/esm/charts/funnel-3d/constant.d.ts +2 -0
  38. package/esm/charts/funnel-3d/series.d.ts +2 -0
  39. package/esm/charts/image-cloud/series/constant.d.ts +2 -0
  40. package/esm/charts/image-cloud/series/image-cloud.d.ts +2 -0
  41. package/esm/charts/pictogram/series/constant.d.ts +2 -0
  42. package/esm/charts/pictogram/series/pictogram.d.ts +2 -0
  43. package/esm/charts/pie-3d/constant.d.ts +2 -0
  44. package/esm/charts/pie-3d/series.d.ts +2 -0
  45. package/esm/charts/ranking-list/ranking-list-transformer.d.ts +0 -6
  46. package/esm/charts/ranking-list/ranking-list-transformer.js +1 -2
  47. package/esm/charts/ranking-list/ranking-list-transformer.js.map +1 -1
  48. package/esm/charts/sequence-analysis/constant.d.ts +3 -0
  49. package/esm/charts/sequence-analysis/constant.js +6 -0
  50. package/esm/charts/sequence-analysis/constant.js.map +1 -0
  51. package/esm/charts/sequence-analysis/interface.d.ts +40 -0
  52. package/esm/charts/sequence-analysis/interface.js +2 -0
  53. package/esm/charts/sequence-analysis/interface.js.map +1 -0
  54. package/esm/charts/sequence-analysis/sequence-analysis-transformer.d.ts +4 -0
  55. package/esm/charts/sequence-analysis/sequence-analysis-transformer.js +258 -0
  56. package/esm/charts/sequence-analysis/sequence-analysis-transformer.js.map +1 -0
  57. package/esm/charts/sequence-analysis/sequence-analysis.d.ts +16 -0
  58. package/esm/charts/sequence-analysis/sequence-analysis.js +28 -0
  59. package/esm/charts/sequence-analysis/sequence-analysis.js.map +1 -0
  60. package/esm/index.d.ts +1 -0
  61. package/esm/index.js +2 -0
  62. package/esm/index.js.map +1 -1
  63. package/package.json +8 -8
package/build/index.js CHANGED
@@ -2989,7 +2989,6 @@
2989
2989
  options: {
2990
2990
  direction: 'y',
2991
2991
  orient: 'negative',
2992
- excludeChannels: ['x'],
2993
2992
  point: (datum, graphic) => {
2994
2993
  const channelAttr = graphic.getGraphicAttribute('y');
2995
2994
  const barSpace = spec.height / (spec.pageSize + 1);
@@ -3010,7 +3009,7 @@
3010
3009
  options: {
3011
3010
  direction: 'y',
3012
3011
  orient: 'negative',
3013
- excludeChannels: ['x'],
3012
+ excludeChannels: ['y'],
3014
3013
  point: (datum, graphic) => {
3015
3014
  const channelAttr = graphic.getGraphicAttribute('y');
3016
3015
  return { y: channelAttr + (spec.height / (spec.pageSize + 1)) * Math.min(spec.scrollSize, spec.pageSize) };
@@ -4755,6 +4754,371 @@
4755
4754
  }
4756
4755
  };
4757
4756
 
4757
+ class SequenceAnalysisChartSpecTransformer extends vchart.CommonChartSpecTransformer {
4758
+ transformSpec(spec) {
4759
+ var _a;
4760
+ delete spec.type;
4761
+ spec.type = 'common';
4762
+ spec.data = [
4763
+ {
4764
+ id: 'eventData',
4765
+ values: spec.eventData
4766
+ },
4767
+ {
4768
+ id: 'actionData',
4769
+ values: spec.actionData
4770
+ },
4771
+ {
4772
+ id: 'patternData',
4773
+ values: spec.patternData
4774
+ }
4775
+ ];
4776
+ const { eventData } = spec;
4777
+ const { mode, mediumConnection = false, actionTarget = false, stepMediumMap } = spec;
4778
+ spec.series = [
4779
+ {
4780
+ type: 'link',
4781
+ dataId: mode === 'time' ? 'actionData' : 'patternData',
4782
+ dotSeriesIndex: 1,
4783
+ fromField: 'from',
4784
+ toField: 'to',
4785
+ seriesField: 'pattern_type',
4786
+ imageLabelField: mode === 'time' && actionTarget ? 'user_image' : '',
4787
+ allowExtend: mode === 'step' && !mediumConnection,
4788
+ linkType: mode === 'step' && mediumConnection ? 'curve' : 'line',
4789
+ arrow: {
4790
+ style: {
4791
+ visible: mode === 'time' && actionTarget
4792
+ }
4793
+ },
4794
+ link: {
4795
+ state: {
4796
+ custom_unSelected: {
4797
+ strokeOpacity: 0.5,
4798
+ stroke: 'grey'
4799
+ }
4800
+ },
4801
+ style: {
4802
+ visible: mode === 'step' || actionTarget
4803
+ }
4804
+ },
4805
+ imageLabel: {
4806
+ visible: mode === 'time' && actionTarget,
4807
+ style: {
4808
+ width: 40,
4809
+ height: 40
4810
+ }
4811
+ }
4812
+ },
4813
+ {
4814
+ type: 'dot',
4815
+ xField: mode === 'time' ? 'time_stamp' : mediumConnection ? 'medium_type' : 'step',
4816
+ yField: 'user_id',
4817
+ titleField: 'user_id',
4818
+ seriesField: 'action_type',
4819
+ linearMode: mode === 'time',
4820
+ dataIndex: 0,
4821
+ highLightSeriesGroup: '',
4822
+ title: {
4823
+ visible: false,
4824
+ style: {
4825
+ fill: 'rgba(46, 47, 50)'
4826
+ }
4827
+ },
4828
+ grid: {
4829
+ style: {
4830
+ visible: false
4831
+ }
4832
+ },
4833
+ dot: {
4834
+ state: {
4835
+ custom_unSelected: {
4836
+ fillOpacity: 0.5,
4837
+ fill: 'grey'
4838
+ }
4839
+ }
4840
+ },
4841
+ symbol: {
4842
+ visible: false
4843
+ }
4844
+ }
4845
+ ];
4846
+ spec.series.forEach((s) => {
4847
+ if (s.type === 'link') {
4848
+ s.dotSeriesSpec = spec.series[s.dotSeriesIndex];
4849
+ }
4850
+ });
4851
+ const tickData = [];
4852
+ const timeCountMap = {};
4853
+ eventData.forEach(user => {
4854
+ user.dots.forEach(e => {
4855
+ if (timeCountMap[e.time_stamp]) {
4856
+ timeCountMap[e.time_stamp] += e.action_count;
4857
+ }
4858
+ else {
4859
+ timeCountMap[e.time_stamp] = e.action_count;
4860
+ }
4861
+ });
4862
+ });
4863
+ Object.keys(timeCountMap)
4864
+ .sort((a, b) => Number(a) - Number(b))
4865
+ .forEach(key => {
4866
+ tickData.push({
4867
+ time_stamp: Number(key),
4868
+ action_count: timeCountMap[key]
4869
+ });
4870
+ });
4871
+ const axes = [];
4872
+ if (mode === 'step') {
4873
+ if (mediumConnection) {
4874
+ axes.push({
4875
+ orient: 'top',
4876
+ type: 'band',
4877
+ id: 'top_medium'
4878
+ });
4879
+ }
4880
+ else {
4881
+ axes.push({
4882
+ orient: 'top',
4883
+ type: 'band',
4884
+ id: 'top_medium',
4885
+ label: {
4886
+ formatMethod: (label) => {
4887
+ return {
4888
+ type: 'rich',
4889
+ text: [
4890
+ {
4891
+ text: `${stepMediumMap[label].medium_type}... `,
4892
+ fontSize: 12
4893
+ },
4894
+ {
4895
+ text: `+${stepMediumMap[label].count}`,
4896
+ fontSize: 12,
4897
+ background: 'grey',
4898
+ backgroundOpacity: 0.4,
4899
+ backgroundCornerRadius: 5
4900
+ }
4901
+ ]
4902
+ };
4903
+ }
4904
+ }
4905
+ });
4906
+ axes.push({
4907
+ orient: 'bottom',
4908
+ id: 'bottom_step',
4909
+ type: 'band',
4910
+ bandPadding: 0
4911
+ });
4912
+ }
4913
+ }
4914
+ else {
4915
+ axes.push({
4916
+ orient: 'top',
4917
+ type: 'time',
4918
+ id: 'top_count',
4919
+ label: {
4920
+ dataFilter: (datum) => {
4921
+ const minData = datum[0].rawValue;
4922
+ const minValue = datum[0].value;
4923
+ const maxData = datum[datum.length - 1].rawValue;
4924
+ const maxValue = datum[datum.length - 1].value;
4925
+ return tickData
4926
+ .filter(t => t.time_stamp >= minData && t.time_stamp <= maxData)
4927
+ .map(t => ({
4928
+ id: t.time_stamp,
4929
+ label: t.action_count,
4930
+ value: ((t.time_stamp - minData) / (maxData - minData)) * (maxValue - minValue) + minValue,
4931
+ rawValue: t.time_stamp
4932
+ }));
4933
+ },
4934
+ formatMethod: (label, datum) => {
4935
+ if (datum === null || datum === void 0 ? void 0 : datum.rawValue) {
4936
+ return timeCountMap[datum.rawValue];
4937
+ }
4938
+ return label;
4939
+ }
4940
+ },
4941
+ tick: {
4942
+ visible: false
4943
+ },
4944
+ grid: {
4945
+ visible: false
4946
+ },
4947
+ innerOffset: {
4948
+ left: 50,
4949
+ right: 50
4950
+ }
4951
+ });
4952
+ axes.push({
4953
+ orient: 'bottom',
4954
+ id: 'bottom_time',
4955
+ type: 'time',
4956
+ layers: [
4957
+ {
4958
+ tickStep: 28800,
4959
+ timeFormat: '%Y%m%d'
4960
+ },
4961
+ {
4962
+ tickStep: 28800,
4963
+ timeFormat: '%H:%M'
4964
+ }
4965
+ ],
4966
+ label: {
4967
+ dataFilter: (datum) => {
4968
+ const minData = datum[0].rawValue;
4969
+ const minValue = datum[0].value;
4970
+ const maxData = datum[datum.length - 1].rawValue;
4971
+ const maxValue = datum[datum.length - 1].value;
4972
+ return tickData
4973
+ .filter(t => t.time_stamp >= minData && t.time_stamp <= maxData)
4974
+ .map(t => ({
4975
+ id: t.time_stamp,
4976
+ label: t.time_stamp,
4977
+ value: ((t.time_stamp - minData) / (maxData - minData)) * (maxValue - minValue) + minValue,
4978
+ rawValue: t.time_stamp
4979
+ }));
4980
+ }
4981
+ },
4982
+ tick: {
4983
+ visible: false
4984
+ },
4985
+ grid: {
4986
+ visible: false
4987
+ },
4988
+ innerOffset: {
4989
+ left: 50,
4990
+ right: 50
4991
+ }
4992
+ });
4993
+ }
4994
+ spec.axes = [
4995
+ ...axes,
4996
+ {
4997
+ orient: 'left',
4998
+ type: 'band',
4999
+ domainLine: {
5000
+ visible: false
5001
+ },
5002
+ tick: {
5003
+ visible: false
5004
+ },
5005
+ label: {
5006
+ formatMethod: label => {
5007
+ return {
5008
+ type: 'rich',
5009
+ text: [{ image: spec.userImageMap[label], width: 40, height: 40 }]
5010
+ };
5011
+ }
5012
+ },
5013
+ grid: {
5014
+ visible: true,
5015
+ style: {
5016
+ lineDash: [3, 3]
5017
+ }
5018
+ }
5019
+ }
5020
+ ];
5021
+ spec.dataZoom = [
5022
+ {
5023
+ orient: 'bottom',
5024
+ axisIndex: 0,
5025
+ filterMode: 'filter'
5026
+ }
5027
+ ];
5028
+ spec.scrollBar = [
5029
+ {
5030
+ orient: 'right',
5031
+ axisIndex: spec.axes.length - 1,
5032
+ filterMode: 'axis',
5033
+ start: 0,
5034
+ end: 0.8
5035
+ },
5036
+ {
5037
+ orient: 'bottom',
5038
+ axisIndex: 0,
5039
+ linkedAxisIndex: mediumConnection && mode === 'step' ? undefined : 1,
5040
+ filterMode: 'axis',
5041
+ start: 0,
5042
+ end: 0.8
5043
+ }
5044
+ ];
5045
+ spec.crosshair = {
5046
+ xField: {
5047
+ visible: true,
5048
+ line: {
5049
+ type: 'rect',
5050
+ width: 20,
5051
+ style: {
5052
+ fill: 'rgb(240,242,245)'
5053
+ }
5054
+ },
5055
+ bindingAxesIndex: [0, 1]
5056
+ },
5057
+ yField: {
5058
+ visible: true,
5059
+ bindingAxesIndex: [spec.axes.length - 1],
5060
+ line: {
5061
+ type: 'rect'
5062
+ }
5063
+ }
5064
+ };
5065
+ if (mode === 'time') {
5066
+ spec.markLine = tickData.map(t => ({
5067
+ zIndex: -1,
5068
+ x: t.time_stamp,
5069
+ endSymbol: {
5070
+ visible: false
5071
+ },
5072
+ label: {
5073
+ visible: false
5074
+ }
5075
+ }));
5076
+ }
5077
+ spec.tooltip = {
5078
+ visible: false
5079
+ };
5080
+ spec.animation = false;
5081
+ (_a = spec.customTransformSpec) === null || _a === void 0 ? void 0 : _a.call(spec, spec);
5082
+ super.transformSpec(spec);
5083
+ }
5084
+ }
5085
+
5086
+ class SequenceAnalysis extends vchart.BaseChart {
5087
+ constructor() {
5088
+ super(...arguments);
5089
+ this.type = 'sequenceAnalysis';
5090
+ this.transformerConstructor = SequenceAnalysisChartSpecTransformer;
5091
+ }
5092
+ init() {
5093
+ if (!this.isValid()) {
5094
+ return;
5095
+ }
5096
+ super.init();
5097
+ }
5098
+ isValid() {
5099
+ var _a, _b, _c, _d;
5100
+ const { eventData, type } = this._spec;
5101
+ if (type !== 'sequenceAnalysis') {
5102
+ (_b = (_a = this._option).onError) === null || _b === void 0 ? void 0 : _b.call(_a, 'Type is required');
5103
+ return false;
5104
+ }
5105
+ if (!eventData) {
5106
+ (_d = (_c = this._option).onError) === null || _d === void 0 ? void 0 : _d.call(_c, 'Data is required');
5107
+ return false;
5108
+ }
5109
+ return true;
5110
+ }
5111
+ }
5112
+ SequenceAnalysis.type = 'sequenceAnalysis';
5113
+ SequenceAnalysis.view = 'singleDefault';
5114
+ SequenceAnalysis.transformerConstructor = SequenceAnalysisChartSpecTransformer;
5115
+ const registerSequenceAnalysis = (option) => {
5116
+ const vchartConstructor = (option === null || option === void 0 ? void 0 : option.VChart) || vchart.VChart;
5117
+ if (vchartConstructor) {
5118
+ vchartConstructor.useChart([SequenceAnalysis, vchart.CommonChart]);
5119
+ }
5120
+ };
5121
+
4758
5122
  class Bar3dChartSpecTransformer extends vchart.BarChartSpecTransformer {
4759
5123
  _getDefaultSeriesSpec(spec) {
4760
5124
  const seriesSpec = super._getDefaultSeriesSpec(spec);
@@ -10211,9 +10575,9 @@
10211
10575
  setWidthHeightWithoutTransform(aabbBounds) {
10212
10576
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
10213
10577
  }
10214
- setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
10578
+ setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
10215
10579
  this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
10216
- (animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach(key => {
10580
+ Object.keys(params).forEach(key => {
10217
10581
  animate.preventAttr(key);
10218
10582
  });
10219
10583
  });
@@ -10384,7 +10748,7 @@
10384
10748
  });
10385
10749
  } else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
10386
10750
  type: AttributeUpdateType.STATE
10387
- }), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
10751
+ });
10388
10752
  this._emitCustomEvent("afterStateUpdate", {
10389
10753
  type: AttributeUpdateType.STATE
10390
10754
  });
@@ -10777,7 +11141,7 @@
10777
11141
  }
10778
11142
  removeChild(child) {
10779
11143
  const data = super.removeChild(child);
10780
- return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
11144
+ return child.stage = null, this.getGraphicService().onRemove(child), this.addUpdateBoundTag(), data;
10781
11145
  }
10782
11146
  removeAllChild(deep = !1) {
10783
11147
  this.forEachChildren(child => {
@@ -13478,10 +13842,9 @@
13478
13842
  return super.needUpdateTag(key, POLYGON_UPDATE_TAG_KEY);
13479
13843
  }
13480
13844
  toCustomPath() {
13481
- let path = super.toCustomPath();
13482
- if (path) return path;
13483
- const points = this.attribute.points;
13484
- return path = new CustomPath2D(), points.forEach((point, index) => {
13845
+ const points = this.attribute.points,
13846
+ path = new CustomPath2D();
13847
+ return points.forEach((point, index) => {
13485
13848
  0 === index ? path.moveTo(point.x, point.y) : path.lineTo(point.x, point.y);
13486
13849
  }), path.closePath(), path;
13487
13850
  }
@@ -17871,7 +18234,7 @@
17871
18234
  return this._animateCount;
17872
18235
  }
17873
18236
  constructor() {
17874
- super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this._animationEndFlag = !0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
18237
+ super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
17875
18238
  }
17876
18239
  isRunning() {
17877
18240
  return !this.paused && this._animateCount > 0;
@@ -17900,11 +18263,10 @@
17900
18263
  }
17901
18264
  tick(delta) {
17902
18265
  if (this.paused) return;
17903
- this._animationEndFlag && (this._animationEndFlag = !1, this.emit("animationStart"));
17904
18266
  const scaledDelta = delta * this._playSpeed;
17905
18267
  this._currentTime += scaledDelta, this.forEachAccessAnimate((animate, i) => {
17906
18268
  animate.status === AnimateStatus.END ? this.removeAnimate(animate, !0) : animate.status !== AnimateStatus.RUNNING && animate.status !== AnimateStatus.INITIAL || animate.advance(scaledDelta);
17907
- }), 0 === this._animateCount && (this._animationEndFlag = !0, this.emit("animationEnd"));
18269
+ }), 0 === this._animateCount && this.emit("animationEnd");
17908
18270
  }
17909
18271
  clear() {
17910
18272
  this.forEachAccessAnimate(animate => {
@@ -17968,9 +18330,7 @@
17968
18330
  return this._timeline;
17969
18331
  }
17970
18332
  bind(target) {
17971
- return this.target = target, this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this), this.onRemove(() => {
17972
- this.stop(), this.target.animates.delete(this.id);
17973
- }), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
18333
+ return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
17974
18334
  }
17975
18335
  to(props, duration = 300, easing = "linear") {
17976
18336
  const step = new Step(AnimateStepType.to, props, duration, easing);
@@ -18184,8 +18544,8 @@
18184
18544
  }
18185
18545
  init() {
18186
18546
  this.interval = 16, this.status = STATUS.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
18187
- this.initHandler(!1);
18188
- }), application.global.env && this.initHandler(!1);
18547
+ this.initHandler();
18548
+ }), application.global.env && this.initHandler();
18189
18549
  }
18190
18550
  addTimeline(timeline) {
18191
18551
  this.timelines.push(timeline);
@@ -18196,11 +18556,10 @@
18196
18556
  getTimelines() {
18197
18557
  return this.timelines;
18198
18558
  }
18199
- initHandler(force = !1) {
18200
- this.setupTickHandler(force);
18559
+ initHandler() {
18560
+ this.setupTickHandler();
18201
18561
  }
18202
- setupTickHandler(force = !1) {
18203
- if (!force && this.tickerHandler) return !0;
18562
+ setupTickHandler() {
18204
18563
  const handler = new RAFTickHandler();
18205
18564
  return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
18206
18565
  }
@@ -18251,7 +18610,7 @@
18251
18610
  return this.status = STATUS.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
18252
18611
  }
18253
18612
  stop() {
18254
- this.status = STATUS.INITIAL, this.setupTickHandler(!0), this.lastFrameTime = -1;
18613
+ this.status = STATUS.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
18255
18614
  }
18256
18615
  trySyncTickStatus() {
18257
18616
  this.status === STATUS.INITIAL && this.timelines.some(timeline => timeline.isRunning()) ? this.start() : this.status === STATUS.RUNNING && this.timelines.every(timeline => !timeline.isRunning()) && this.stop();
@@ -18261,8 +18620,7 @@
18261
18620
  this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
18262
18621
  }
18263
18622
  checkSkip(delta) {
18264
- var _a, _b, _c;
18265
- 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;
18623
+ if ("performance" === this.stage.params.optimize.tickRenderMode) return !1;
18266
18624
  return delta < this.interval + 2 * (Math.random() - .5) * this._jitter;
18267
18625
  }
18268
18626
  }
@@ -18513,11 +18871,10 @@
18513
18871
  _handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
18514
18872
  var _a, _b, _c, _d;
18515
18873
  if (custom && customType) {
18516
- const customParams = Object.assign({
18874
+ const customParams = this.resolveValue(customParameters, graphic, {
18517
18875
  width: graphic.stage.width,
18518
- height: graphic.stage.height,
18519
- group: this._target.parent
18520
- }, this.resolveValue(customParameters, graphic)),
18876
+ height: graphic.stage.height
18877
+ }),
18521
18878
  objOptions = isFunction$1(options) ? options.call(null, null !== (_b = customParams && (null === (_a = customParams.data) || void 0 === _a ? void 0 : _a[0])) && void 0 !== _b ? _b : null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, customParams) : options;
18522
18879
  customParams.options = objOptions, customParams.controlOptions = controlOptions, 1 === customType ? this.createCustomAnimation(animate, custom, from, props, duration, easing, customParams) : 2 === customType && this.createCustomInterpolatorAnimation(animate, custom, props, duration, easing, customParams);
18523
18880
  } else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
@@ -18735,14 +19092,6 @@
18735
19092
  state.executor.stop();
18736
19093
  }), this.stateList = null;
18737
19094
  }
18738
- reApplyState(state) {
18739
- var _a;
18740
- const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
18741
- if (stateInfo) {
18742
- const stateList = this.stateList.slice();
18743
- stateInfo.executor.stop(), this.stateList = stateList, stateInfo.executor.execute(stateInfo.animationConfig);
18744
- }
18745
- }
18746
19095
  }
18747
19096
 
18748
19097
  class GraphicStateExtension {
@@ -18773,20 +19122,11 @@
18773
19122
  applyUnhighlightState(animationConfig, callback) {
18774
19123
  return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
18775
19124
  }
18776
- stopAnimationState(state, type, deep = !1) {
18777
- return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
18778
- child.stopAnimationState(state, type, deep);
18779
- }), this;
19125
+ stopAnimationState(state, type) {
19126
+ return this._getAnimationStateManager(this).stopState(state, type), this;
18780
19127
  }
18781
19128
  clearAnimationStates() {
18782
- const stateManager = this._animationStateManager;
18783
- return stateManager && stateManager.clearState(), this;
18784
- }
18785
- reApplyAnimationState(state, deep = !1) {
18786
- const stateManager = this._animationStateManager;
18787
- return stateManager && stateManager.reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
18788
- child.reApplyAnimationState(state, deep);
18789
- }), this;
19129
+ return this._getAnimationStateManager(this).clearState(), this;
18790
19130
  }
18791
19131
  static extend(graphic) {
18792
19132
  return new GraphicStateExtension()._getAnimationStateManager(graphic), graphic;
@@ -18799,6 +19139,7 @@
18799
19139
  }
18800
19140
  animate(params) {
18801
19141
  var _a, _b, _c;
19142
+ this.animates || (this.animates = new Map());
18802
19143
  const animate = new Animate(null == params ? void 0 : params.id, null !== (_b = null !== (_a = null == params ? void 0 : params.timeline) && void 0 !== _a ? _a : this.stage && this.stage.getTimeline()) && void 0 !== _b ? _b : defaultTimeline, null == params ? void 0 : params.slience);
18803
19144
  if (animate.bind(this), params) {
18804
19145
  const {
@@ -18808,7 +19149,9 @@
18808
19149
  } = params;
18809
19150
  null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
18810
19151
  }
18811
- return null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
19152
+ return this.animates.set(animate.id, animate), animate.onRemove(() => {
19153
+ animate.stop(), this.animates.delete(animate.id);
19154
+ }), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
18812
19155
  }
18813
19156
  createTimeline() {
18814
19157
  return new DefaultTimeline();
@@ -18839,21 +19182,6 @@
18839
19182
  getGraphicAttribute(key, prev = !1) {
18840
19183
  return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
18841
19184
  }
18842
- pauseAnimation(deep = !1) {
18843
- this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
18844
- child.pauseAnimation(deep);
18845
- });
18846
- }
18847
- resumeAnimation(deep = !1) {
18848
- this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
18849
- child.resumeAnimation(deep);
18850
- });
18851
- }
18852
- stopAnimation(deep = !1) {
18853
- this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
18854
- child.stopAnimation(deep);
18855
- });
18856
- }
18857
19185
  }
18858
19186
 
18859
19187
  function registerAnimate() {
@@ -18862,7 +19190,7 @@
18862
19190
 
18863
19191
  class ACustomAnimate extends Step {
18864
19192
  constructor(customFrom, customTo, duration, easing, params) {
18865
- super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo;
19193
+ super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
18866
19194
  }
18867
19195
  update(end, ratio, out) {
18868
19196
  if (this.onStart(), !this.props || !this.propKeys) return;
@@ -19055,6 +19383,17 @@
19055
19383
  items,
19056
19384
  scale: axis._scale.clone()
19057
19385
  };
19386
+ if (!ignoreGrid) {
19387
+ attrs.grid = {
19388
+ type: 'line',
19389
+ start: { x: 0, y: 0 },
19390
+ end,
19391
+ items: items[0],
19392
+ verticalFactor: axis._axisStyle.verticalFactor,
19393
+ depth: depthZ,
19394
+ length: !ignoreGrid ? regionSize.height : 0
19395
+ };
19396
+ }
19058
19397
  const directionStr = (_a = axis.directionStr) !== null && _a !== void 0 ? _a : 'r2l';
19059
19398
  let anchor3d = [0, 0];
19060
19399
  let alpha = -Math.PI / 2;
@@ -19067,20 +19406,6 @@
19067
19406
  attrs.z = z;
19068
19407
  attrs.alpha = alpha;
19069
19408
  attrs.anchor3d = anchor3d;
19070
- if (!ignoreGrid) {
19071
- attrs.grid = {
19072
- type: 'line',
19073
- start: { x: 0, y: 0 },
19074
- end,
19075
- items: items[0],
19076
- verticalFactor: axis._axisStyle.verticalFactor,
19077
- depth: depthZ,
19078
- length: !ignoreGrid ? regionSize.height : 0,
19079
- alpha,
19080
- z,
19081
- anchor3d
19082
- };
19083
- }
19084
19409
  return attrs;
19085
19410
  };
19086
19411
 
@@ -19090,59 +19415,7 @@
19090
19415
  }
19091
19416
  _afterUpdateAttribute(attrs, ignoreGrid) {
19092
19417
  const isZ = vchart.isZAxis(this._orient);
19093
- const isX = vchart.isXAxis(this._orient);
19094
- const isY = vchart.isYAxis(this._orient);
19095
- let regionHeight = 0;
19096
- let regionWidth = 0;
19097
- if (!ignoreGrid) {
19098
- const regions = this.getRegions();
19099
- let { x: minX, y: minY } = regions[0].getLayoutStartPoint();
19100
- let maxX = minX + regions[0].getLayoutRect().width;
19101
- let maxY = minY + regions[0].getLayoutRect().height;
19102
- for (let index = 1; index < regions.length; index++) {
19103
- const region = regions[index];
19104
- const { x, y } = region.getLayoutStartPoint();
19105
- const { width, height } = region.getLayoutRect();
19106
- minX = Math.min(minX, x);
19107
- maxX = Math.max(maxX, width + x);
19108
- minY = Math.min(minY, y);
19109
- maxY = Math.max(maxY, height + y);
19110
- }
19111
- regionHeight = Math.abs(maxY - minY);
19112
- regionWidth = Math.abs(maxX - minX);
19113
- }
19114
- let gridLength = 0;
19115
- let axisLength = 0;
19116
- const { width, height } = this.getLayoutRect();
19117
- let end = { x: 0, y: 0 };
19118
- if (isX) {
19119
- end = { x: width, y: 0 };
19120
- gridLength = regionHeight;
19121
- axisLength = width;
19122
- }
19123
- else if (isY) {
19124
- end = { x: 0, y: height };
19125
- gridLength = regionWidth;
19126
- axisLength = height;
19127
- }
19128
- const depth = this.layout3dBox ? this.layout3dBox.length : 0;
19129
19418
  if (!isZ) {
19130
- const items = this.getLabelItems(axisLength);
19131
- attrs.grid = {
19132
- length: gridLength
19133
- };
19134
- attrs.start = { x: 0, y: 0 };
19135
- attrs.text = this._spec.title.text || this._dataFieldText;
19136
- attrs.maxWidth = this._getTitleLimit(isX);
19137
- attrs.items = items;
19138
- attrs.grid = {
19139
- type: 'line',
19140
- start: { x: 0, y: 0 },
19141
- end,
19142
- items: items[0],
19143
- depth,
19144
- length: gridLength
19145
- };
19146
19419
  return attrs;
19147
19420
  }
19148
19421
  return getUpdateAttributeOfZAxis(this, ignoreGrid);
@@ -25067,6 +25340,7 @@
25067
25340
  exports.RankingBar = RankingBar;
25068
25341
  exports.RankingList = RankingList;
25069
25342
  exports.SERIES_BREAK = SERIES_BREAK;
25343
+ exports.SequenceAnalysis = SequenceAnalysis;
25070
25344
  exports.SequenceScatterKDE = SequenceScatterKDE;
25071
25345
  exports.SequenceScatterLink = SequenceScatterLink;
25072
25346
  exports.SequenceScatterPixel = SequenceScatterPixel;
@@ -25103,6 +25377,7 @@
25103
25377
  exports.registerRankingBarChart = registerRankingBarChart;
25104
25378
  exports.registerRankingList = registerRankingList;
25105
25379
  exports.registerSVGSource = registerSVGSource;
25380
+ exports.registerSequenceAnalysis = registerSequenceAnalysis;
25106
25381
  exports.registerSequenceScatterKDE = registerSequenceScatterKDE;
25107
25382
  exports.registerSequenceScatterLink = registerSequenceScatterLink;
25108
25383
  exports.registerSequenceScatterPixel = registerSequenceScatterPixel;